From 903ffe385ff2b9fb1258bc0d609b510b5d8156a4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 11:08:03 +0000 Subject: [PATCH 1/3] Initial plan From a93a4799e7fd2dc9c81fcdb5c60618ce323df4a3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 11:12:59 +0000 Subject: [PATCH 2/3] Remove TypeScript Mapper package completely Co-authored-by: raphael-goetz <52959657+raphael-goetz@users.noreply.github.com> --- package/mapper/package-lock.json | 2081 ----------- package/mapper/package.json | 38 - package/mapper/src/definition/mapper.ts | 88 - package/mapper/src/definition/reader.ts | 112 - package/mapper/src/index.ts | 16 - package/mapper/src/mapper/dataTypeMapper.ts | 296 -- package/mapper/src/mapper/flowTypeMapper.ts | 39 - package/mapper/src/mapper/functionMapper.ts | 49 - package/mapper/src/mapper/translation.ts | 9 - package/mapper/tsconfig.json | 25 - package/mapper/vite.config.ts | 20 - package/reader/dist/index.js | 3671 +++++++++++++++++++ 12 files changed, 3671 insertions(+), 2773 deletions(-) delete mode 100644 package/mapper/package-lock.json delete mode 100644 package/mapper/package.json delete mode 100644 package/mapper/src/definition/mapper.ts delete mode 100644 package/mapper/src/definition/reader.ts delete mode 100644 package/mapper/src/index.ts delete mode 100644 package/mapper/src/mapper/dataTypeMapper.ts delete mode 100644 package/mapper/src/mapper/flowTypeMapper.ts delete mode 100644 package/mapper/src/mapper/functionMapper.ts delete mode 100644 package/mapper/src/mapper/translation.ts delete mode 100644 package/mapper/tsconfig.json delete mode 100644 package/mapper/vite.config.ts create mode 100644 package/reader/dist/index.js diff --git a/package/mapper/package-lock.json b/package/mapper/package-lock.json deleted file mode 100644 index 3f4e6c5..0000000 --- a/package/mapper/package-lock.json +++ /dev/null @@ -1,2081 +0,0 @@ -{ - "name": "@code0-tech/definition-mapper", - "version": "0.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@code0-tech/definition-mapper", - "version": "0.0.0", - "dependencies": { - "@code0-tech/sagittarius-graphql-types": "^0.0.0-c63274fdd34593b8aa24f9f977659fd3d6270150", - "@code0-tech/tucana": "^0.0.47", - "@protobuf-ts/runtime": "^2.11.1", - "@protobuf-ts/runtime-rpc": "^2.11.1", - "vite-plugin-dts": "^4.5.4" - }, - "devDependencies": { - "@types/node": "^24.1.0", - "typescript": "^5.8.3", - "vite": "^7.1.11" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", - "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", - "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/parser": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", - "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", - "license": "MIT", - "dependencies": { - "@babel/types": "^7.28.5" - }, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/types": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", - "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", - "license": "MIT", - "dependencies": { - "@babel/helper-string-parser": "^7.27.1", - "@babel/helper-validator-identifier": "^7.28.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@code0-tech/sagittarius-graphql-types": { - "version": "0.0.0-f91466f0f343596ad170e7e5c5316a70b072594d", - "resolved": "https://registry.npmjs.org/@code0-tech/sagittarius-graphql-types/-/sagittarius-graphql-types-0.0.0-f91466f0f343596ad170e7e5c5316a70b072594d.tgz", - "integrity": "sha512-vXnbsCw1n3KhWX0ZutKR9xmspEyg9/cZspSMPTPyD8sSTDcPooei1967GlsfpPKfsJGPLzrMKxMRUS/ANXlATg==" - }, - "node_modules/@code0-tech/tucana": { - "version": "0.0.47", - "resolved": "https://registry.npmjs.org/@code0-tech/tucana/-/tucana-0.0.47.tgz", - "integrity": "sha512-2TGJIk7r1yRIYv0RFgc7nvFCbYS4uvwAh5KRP1Uv2xDpRFP9xzIGb/zRtIRyGrDsXsYT61ASHIGEdcDnm4kFHw==", - "license": "Apache-2.0" - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.1.tgz", - "integrity": "sha512-HHB50pdsBX6k47S4u5g/CaLjqS3qwaOVE5ILsq64jyzgMhLuCuZ8rGzM9yhsAjfjkbgUPMzZEPa7DAp7yz6vuA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.1.tgz", - "integrity": "sha512-kFqa6/UcaTbGm/NncN9kzVOODjhZW8e+FRdSeypWe6j33gzclHtwlANs26JrupOntlcWmB0u8+8HZo8s7thHvg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.1.tgz", - "integrity": "sha512-45fuKmAJpxnQWixOGCrS+ro4Uvb4Re9+UTieUY2f8AEc+t7d4AaZ6eUJ3Hva7dtrxAAWHtlEFsXFMAgNnGU9uQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.1.tgz", - "integrity": "sha512-LBEpOz0BsgMEeHgenf5aqmn/lLNTFXVfoWMUox8CtWWYK9X4jmQzWjoGoNb8lmAYml/tQ/Ysvm8q7szu7BoxRQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.1.tgz", - "integrity": "sha512-veg7fL8eMSCVKL7IW4pxb54QERtedFDfY/ASrumK/SbFsXnRazxY4YykN/THYqFnFwJ0aVjiUrVG2PwcdAEqQQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.1.tgz", - "integrity": "sha512-+3ELd+nTzhfWb07Vol7EZ+5PTbJ/u74nC6iv4/lwIU99Ip5uuY6QoIf0Hn4m2HoV0qcnRivN3KSqc+FyCHjoVQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.1.tgz", - "integrity": "sha512-/8Rfgns4XD9XOSXlzUDepG8PX+AVWHliYlUkFI3K3GB6tqbdjYqdhcb4BKRd7C0BhZSoaCxhv8kTcBrcZWP+xg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.1.tgz", - "integrity": "sha512-GITpD8dK9C+r+5yRT/UKVT36h/DQLOHdwGVwwoHidlnA168oD3uxA878XloXebK4Ul3gDBBIvEdL7go9gCUFzQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.1.tgz", - "integrity": "sha512-ieMID0JRZY/ZeCrsFQ3Y3NlHNCqIhTprJfDgSB3/lv5jJZ8FX3hqPyXWhe+gvS5ARMBJ242PM+VNz/ctNj//eA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.1.tgz", - "integrity": "sha512-W9//kCrh/6in9rWIBdKaMtuTTzNj6jSeG/haWBADqLLa9P8O5YSRDzgD5y9QBok4AYlzS6ARHifAb75V6G670Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.1.tgz", - "integrity": "sha512-VIUV4z8GD8rtSVMfAj1aXFahsi/+tcoXXNYmXgzISL+KB381vbSTNdeZHHHIYqFyXcoEhu9n5cT+05tRv13rlw==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.1.tgz", - "integrity": "sha512-l4rfiiJRN7sTNI//ff65zJ9z8U+k6zcCg0LALU5iEWzY+a1mVZ8iWC1k5EsNKThZ7XCQ6YWtsZ8EWYm7r1UEsg==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.1.tgz", - "integrity": "sha512-U0bEuAOLvO/DWFdygTHWY8C067FXz+UbzKgxYhXC0fDieFa0kDIra1FAhsAARRJbvEyso8aAqvPdNxzWuStBnA==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.1.tgz", - "integrity": "sha512-NzdQ/Xwu6vPSf/GkdmRNsOfIeSGnh7muundsWItmBsVpMoNPVpM61qNzAVY3pZ1glzzAxLR40UyYM23eaDDbYQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.1.tgz", - "integrity": "sha512-7zlw8p3IApcsN7mFw0O1Z1PyEk6PlKMu18roImfl3iQHTnr/yAfYv6s4hXPidbDoI2Q0pW+5xeoM4eTCC0UdrQ==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.1.tgz", - "integrity": "sha512-cGj5wli+G+nkVQdZo3+7FDKC25Uh4ZVwOAK6A06Hsvgr8WqBBuOy/1s+PUEd/6Je+vjfm6stX0kmib5b/O2Ykw==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.1.tgz", - "integrity": "sha512-z3H/HYI9MM0HTv3hQZ81f+AKb+yEoCRlUby1F80vbQ5XdzEMyY/9iNlAmhqiBKw4MJXwfgsh7ERGEOhrM1niMA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.1.tgz", - "integrity": "sha512-wzC24DxAvk8Em01YmVXyjl96Mr+ecTPyOuADAvjGg+fyBpGmxmcr2E5ttf7Im8D0sXZihpxzO1isus8MdjMCXQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.1.tgz", - "integrity": "sha512-1YQ8ybGi2yIXswu6eNzJsrYIGFpnlzEWRl6iR5gMgmsrR0FcNoV1m9k9sc3PuP5rUBLshOZylc9nqSgymI+TYg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.1.tgz", - "integrity": "sha512-5Z+DzLCrq5wmU7RDaMDe2DVXMRm2tTDvX2KU14JJVBN2CT/qov7XVix85QoJqHltpvAOZUAc3ndU56HSMWrv8g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.1.tgz", - "integrity": "sha512-Q73ENzIdPF5jap4wqLtsfh8YbYSZ8Q0wnxplOlZUOyZy7B4ZKW8DXGWgTCZmF8VWD7Tciwv5F4NsRf6vYlZtqg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.1.tgz", - "integrity": "sha512-ajbHrGM/XiK+sXM0JzEbJAen+0E+JMQZ2l4RR4VFwvV9JEERx+oxtgkpoKv1SevhjavK2z2ReHk32pjzktWbGg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.1.tgz", - "integrity": "sha512-IPUW+y4VIjuDVn+OMzHc5FV4GubIwPnsz6ubkvN8cuhEqH81NovB53IUlrlBkPMEPxvNnf79MGBoz8rZ2iW8HA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.1.tgz", - "integrity": "sha512-RIVRWiljWA6CdVu8zkWcRmGP7iRRIIwvhDKem8UMBjPql2TXM5PkDVvvrzMtj1V+WFPB4K7zkIGM7VzRtFkjdg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.1.tgz", - "integrity": "sha512-2BR5M8CPbptC1AK5JbJT1fWrHLvejwZidKx3UMSF0ecHMa+smhi16drIrCEggkgviBwLYd5nwrFLSl5Kho96RQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.1.tgz", - "integrity": "sha512-d5X6RMYv6taIymSk8JBP+nxv8DQAMY6A51GPgusqLdK9wBz5wWIXy1KjTck6HnjE9hqJzJRdk+1p/t5soSbCtw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@isaacs/balanced-match": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", - "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", - "license": "MIT", - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/@isaacs/brace-expansion": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", - "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", - "license": "MIT", - "dependencies": { - "@isaacs/balanced-match": "^4.0.1" - }, - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "license": "MIT" - }, - "node_modules/@microsoft/api-extractor": { - "version": "7.53.3", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.53.3.tgz", - "integrity": "sha512-p2HmQaMSVqMBj3bH3643f8xApKAqrF1jNpPsMCTQOYCYgfwLnvzsve8c+bgBWzCOBBgLK54PB6ZLIWMGLg8CZA==", - "license": "MIT", - "dependencies": { - "@microsoft/api-extractor-model": "7.31.3", - "@microsoft/tsdoc": "~0.15.1", - "@microsoft/tsdoc-config": "~0.17.1", - "@rushstack/node-core-library": "5.18.0", - "@rushstack/rig-package": "0.6.0", - "@rushstack/terminal": "0.19.3", - "@rushstack/ts-command-line": "5.1.3", - "lodash": "~4.17.15", - "minimatch": "10.0.3", - "resolve": "~1.22.1", - "semver": "~7.5.4", - "source-map": "~0.6.1", - "typescript": "5.8.2" - }, - "bin": { - "api-extractor": "bin/api-extractor" - } - }, - "node_modules/@microsoft/api-extractor-model": { - "version": "7.31.3", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.31.3.tgz", - "integrity": "sha512-dv4quQI46p0U03TCEpasUf6JrJL3qjMN7JUAobsPElxBv4xayYYvWW9aPpfYV+Jx6hqUcVaLVOeV7+5hxsyoFQ==", - "license": "MIT", - "dependencies": { - "@microsoft/tsdoc": "~0.15.1", - "@microsoft/tsdoc-config": "~0.17.1", - "@rushstack/node-core-library": "5.18.0" - } - }, - "node_modules/@microsoft/api-extractor/node_modules/typescript": { - "version": "5.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", - "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/@microsoft/tsdoc": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.15.1.tgz", - "integrity": "sha512-4aErSrCR/On/e5G2hDP0wjooqDdauzEbIq8hIkIe5pXV0rtWJZvdCEKL0ykZxex+IxIwBp0eGeV48hQN07dXtw==", - "license": "MIT" - }, - "node_modules/@microsoft/tsdoc-config": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.17.1.tgz", - "integrity": "sha512-UtjIFe0C6oYgTnad4q1QP4qXwLhe6tIpNTRStJ2RZEPIkqQPREAwE5spzVxsdn9UaEMUqhh0AqSx3X4nWAKXWw==", - "license": "MIT", - "dependencies": { - "@microsoft/tsdoc": "0.15.1", - "ajv": "~8.12.0", - "jju": "~1.4.0", - "resolve": "~1.22.2" - } - }, - "node_modules/@protobuf-ts/runtime": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.11.1.tgz", - "integrity": "sha512-KuDaT1IfHkugM2pyz+FwiY80ejWrkH1pAtOBOZFuR6SXEFTsnb/jiQWQ1rCIrcKx2BtyxnxW6BWwsVSA/Ie+WQ==", - "license": "(Apache-2.0 AND BSD-3-Clause)" - }, - "node_modules/@protobuf-ts/runtime-rpc": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.11.1.tgz", - "integrity": "sha512-4CqqUmNA+/uMz00+d3CYKgElXO9VrEbucjnBFEjqI4GuDrEQ32MaI3q+9qPBvIGOlL4PmHXrzM32vBPWRhQKWQ==", - "license": "Apache-2.0", - "dependencies": { - "@protobuf-ts/runtime": "^2.11.1" - } - }, - "node_modules/@rollup/pluginutils": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.3.0.tgz", - "integrity": "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==", - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0", - "estree-walker": "^2.0.2", - "picomatch": "^4.0.2" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.52.5.tgz", - "integrity": "sha512-8c1vW4ocv3UOMp9K+gToY5zL2XiiVw3k7f1ksf4yO1FlDFQ1C2u72iACFnSOceJFsWskc2WZNqeRhFRPzv+wtQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.52.5.tgz", - "integrity": "sha512-mQGfsIEFcu21mvqkEKKu2dYmtuSZOBMmAl5CFlPGLY94Vlcm+zWApK7F/eocsNzp8tKmbeBP8yXyAbx0XHsFNA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.52.5.tgz", - "integrity": "sha512-takF3CR71mCAGA+v794QUZ0b6ZSrgJkArC+gUiG6LB6TQty9T0Mqh3m2ImRBOxS2IeYBo4lKWIieSvnEk2OQWA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.52.5.tgz", - "integrity": "sha512-W901Pla8Ya95WpxDn//VF9K9u2JbocwV/v75TE0YIHNTbhqUTv9w4VuQ9MaWlNOkkEfFwkdNhXgcLqPSmHy0fA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.52.5.tgz", - "integrity": "sha512-QofO7i7JycsYOWxe0GFqhLmF6l1TqBswJMvICnRUjqCx8b47MTo46W8AoeQwiokAx3zVryVnxtBMcGcnX12LvA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.52.5.tgz", - "integrity": "sha512-jr21b/99ew8ujZubPo9skbrItHEIE50WdV86cdSoRkKtmWa+DDr6fu2c/xyRT0F/WazZpam6kk7IHBerSL7LDQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.52.5.tgz", - "integrity": "sha512-PsNAbcyv9CcecAUagQefwX8fQn9LQ4nZkpDboBOttmyffnInRy8R8dSg6hxxl2Re5QhHBf6FYIDhIj5v982ATQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.52.5.tgz", - "integrity": "sha512-Fw4tysRutyQc/wwkmcyoqFtJhh0u31K+Q6jYjeicsGJJ7bbEq8LwPWV/w0cnzOqR2m694/Af6hpFayLJZkG2VQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.52.5.tgz", - "integrity": "sha512-a+3wVnAYdQClOTlyapKmyI6BLPAFYs0JM8HRpgYZQO02rMR09ZcV9LbQB+NL6sljzG38869YqThrRnfPMCDtZg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.52.5.tgz", - "integrity": "sha512-AvttBOMwO9Pcuuf7m9PkC1PUIKsfaAJ4AYhy944qeTJgQOqJYJ9oVl2nYgY7Rk0mkbsuOpCAYSs6wLYB2Xiw0Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.52.5.tgz", - "integrity": "sha512-DkDk8pmXQV2wVrF6oq5tONK6UHLz/XcEVow4JTTerdeV1uqPeHxwcg7aFsfnSm9L+OO8WJsWotKM2JJPMWrQtA==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.52.5.tgz", - "integrity": "sha512-W/b9ZN/U9+hPQVvlGwjzi+Wy4xdoH2I8EjaCkMvzpI7wJUs8sWJ03Rq96jRnHkSrcHTpQe8h5Tg3ZzUPGauvAw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.52.5.tgz", - "integrity": "sha512-sjQLr9BW7R/ZiXnQiWPkErNfLMkkWIoCz7YMn27HldKsADEKa5WYdobaa1hmN6slu9oWQbB6/jFpJ+P2IkVrmw==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.52.5.tgz", - "integrity": "sha512-hq3jU/kGyjXWTvAh2awn8oHroCbrPm8JqM7RUpKjalIRWWXE01CQOf/tUNWNHjmbMHg/hmNCwc/Pz3k1T/j/Lg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.52.5.tgz", - "integrity": "sha512-gn8kHOrku8D4NGHMK1Y7NA7INQTRdVOntt1OCYypZPRt6skGbddska44K8iocdpxHTMMNui5oH4elPH4QOLrFQ==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.52.5.tgz", - "integrity": "sha512-hXGLYpdhiNElzN770+H2nlx+jRog8TyynpTVzdlc6bndktjKWyZyiCsuDAlpd+j+W+WNqfcyAWz9HxxIGfZm1Q==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.52.5.tgz", - "integrity": "sha512-arCGIcuNKjBoKAXD+y7XomR9gY6Mw7HnFBv5Rw7wQRvwYLR7gBAgV7Mb2QTyjXfTveBNFAtPt46/36vV9STLNg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.52.5.tgz", - "integrity": "sha512-QoFqB6+/9Rly/RiPjaomPLmR/13cgkIGfA40LHly9zcH1S0bN2HVFYk3a1eAyHQyjs3ZJYlXvIGtcCs5tko9Cw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.52.5.tgz", - "integrity": "sha512-w0cDWVR6MlTstla1cIfOGyl8+qb93FlAVutcor14Gf5Md5ap5ySfQ7R9S/NjNaMLSFdUnKGEasmVnu3lCMqB7w==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.52.5.tgz", - "integrity": "sha512-Aufdpzp7DpOTULJCuvzqcItSGDH73pF3ko/f+ckJhxQyHtp67rHw3HMNxoIdDMUITJESNE6a8uh4Lo4SLouOUg==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.52.5.tgz", - "integrity": "sha512-UGBUGPFp1vkj6p8wCRraqNhqwX/4kNQPS57BCFc8wYh0g94iVIW33wJtQAx3G7vrjjNtRaxiMUylM0ktp/TRSQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.52.5.tgz", - "integrity": "sha512-TAcgQh2sSkykPRWLrdyy2AiceMckNf5loITqXxFI5VuQjS5tSuw3WlwdN8qv8vzjLAUTvYaH/mVjSFpbkFbpTg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rushstack/node-core-library": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.18.0.tgz", - "integrity": "sha512-XDebtBdw5S3SuZIt+Ra2NieT8kQ3D2Ow1HxhDQ/2soinswnOu9e7S69VSwTOLlQnx5mpWbONu+5JJjDxMAb6Fw==", - "license": "MIT", - "dependencies": { - "ajv": "~8.13.0", - "ajv-draft-04": "~1.0.0", - "ajv-formats": "~3.0.1", - "fs-extra": "~11.3.0", - "import-lazy": "~4.0.0", - "jju": "~1.4.0", - "resolve": "~1.22.1", - "semver": "~7.5.4" - }, - "peerDependencies": { - "@types/node": "*" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@rushstack/node-core-library/node_modules/ajv": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", - "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.4.1" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/@rushstack/problem-matcher": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@rushstack/problem-matcher/-/problem-matcher-0.1.1.tgz", - "integrity": "sha512-Fm5XtS7+G8HLcJHCWpES5VmeMyjAKaWeyZU5qPzZC+22mPlJzAsOxymHiWIfuirtPckX3aptWws+K2d0BzniJA==", - "license": "MIT", - "peerDependencies": { - "@types/node": "*" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@rushstack/rig-package": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.6.0.tgz", - "integrity": "sha512-ZQmfzsLE2+Y91GF15c65L/slMRVhF6Hycq04D4TwtdGaUAbIXXg9c5pKA5KFU7M4QMaihoobp9JJYpYcaY3zOw==", - "license": "MIT", - "dependencies": { - "resolve": "~1.22.1", - "strip-json-comments": "~3.1.1" - } - }, - "node_modules/@rushstack/terminal": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.19.3.tgz", - "integrity": "sha512-0P8G18gK9STyO+CNBvkKPnWGMxESxecTYqOcikHOVIHXa9uAuTK+Fw8TJq2Gng1w7W6wTC9uPX6hGNvrMll2wA==", - "license": "MIT", - "dependencies": { - "@rushstack/node-core-library": "5.18.0", - "@rushstack/problem-matcher": "0.1.1", - "supports-color": "~8.1.1" - }, - "peerDependencies": { - "@types/node": "*" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - } - } - }, - "node_modules/@rushstack/ts-command-line": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-5.1.3.tgz", - "integrity": "sha512-Kdv0k/BnnxIYFlMVC1IxrIS0oGQd4T4b7vKfx52Y2+wk2WZSDFIvedr7JrhenzSlm3ou5KwtoTGTGd5nbODRug==", - "license": "MIT", - "dependencies": { - "@rushstack/terminal": "0.19.3", - "@types/argparse": "1.0.38", - "argparse": "~1.0.9", - "string-argv": "~0.3.1" - } - }, - "node_modules/@types/argparse": { - "version": "1.0.38", - "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", - "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==", - "license": "MIT" - }, - "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "license": "MIT" - }, - "node_modules/@types/node": { - "version": "24.10.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.4.tgz", - "integrity": "sha512-vnDVpYPMzs4wunl27jHrfmwojOGKya0xyM3sH+UE5iv5uPS6vX7UIoh6m+vQc5LGBq52HBKPIn/zcSZVzeDEZg==", - "devOptional": true, - "license": "MIT", - "peer": true, - "dependencies": { - "undici-types": "~7.16.0" - } - }, - "node_modules/@volar/language-core": { - "version": "2.4.23", - "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.23.tgz", - "integrity": "sha512-hEEd5ET/oSmBC6pi1j6NaNYRWoAiDhINbT8rmwtINugR39loROSlufGdYMF9TaKGfz+ViGs1Idi3mAhnuPcoGQ==", - "license": "MIT", - "dependencies": { - "@volar/source-map": "2.4.23" - } - }, - "node_modules/@volar/source-map": { - "version": "2.4.23", - "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.4.23.tgz", - "integrity": "sha512-Z1Uc8IB57Lm6k7q6KIDu/p+JWtf3xsXJqAX/5r18hYOTpJyBn0KXUR8oTJ4WFYOcDzWC9n3IflGgHowx6U6z9Q==", - "license": "MIT" - }, - "node_modules/@volar/typescript": { - "version": "2.4.23", - "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.4.23.tgz", - "integrity": "sha512-lAB5zJghWxVPqfcStmAP1ZqQacMpe90UrP5RJ3arDyrhy4aCUQqmxPPLB2PWDKugvylmO41ljK7vZ+t6INMTag==", - "license": "MIT", - "dependencies": { - "@volar/language-core": "2.4.23", - "path-browserify": "^1.0.1", - "vscode-uri": "^3.0.8" - } - }, - "node_modules/@vue/compiler-core": { - "version": "3.5.22", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.22.tgz", - "integrity": "sha512-jQ0pFPmZwTEiRNSb+i9Ow/I/cHv2tXYqsnHKKyCQ08irI2kdF5qmYedmF8si8mA7zepUFmJ2hqzS8CQmNOWOkQ==", - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.28.4", - "@vue/shared": "3.5.22", - "entities": "^4.5.0", - "estree-walker": "^2.0.2", - "source-map-js": "^1.2.1" - } - }, - "node_modules/@vue/compiler-dom": { - "version": "3.5.22", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.22.tgz", - "integrity": "sha512-W8RknzUM1BLkypvdz10OVsGxnMAuSIZs9Wdx1vzA3mL5fNMN15rhrSCLiTm6blWeACwUwizzPVqGJgOGBEN/hA==", - "license": "MIT", - "dependencies": { - "@vue/compiler-core": "3.5.22", - "@vue/shared": "3.5.22" - } - }, - "node_modules/@vue/compiler-vue2": { - "version": "2.7.16", - "resolved": "https://registry.npmjs.org/@vue/compiler-vue2/-/compiler-vue2-2.7.16.tgz", - "integrity": "sha512-qYC3Psj9S/mfu9uVi5WvNZIzq+xnXMhOwbTFKKDD7b1lhpnn71jXSFdTQ+WsIEk0ONCd7VV2IMm7ONl6tbQ86A==", - "license": "MIT", - "dependencies": { - "de-indent": "^1.0.2", - "he": "^1.2.0" - } - }, - "node_modules/@vue/language-core": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-2.2.0.tgz", - "integrity": "sha512-O1ZZFaaBGkKbsRfnVH1ifOK1/1BUkyK+3SQsfnh6PmMmD4qJcTU8godCeA96jjDRTL6zgnK7YzCHfaUlH2r0Mw==", - "license": "MIT", - "dependencies": { - "@volar/language-core": "~2.4.11", - "@vue/compiler-dom": "^3.5.0", - "@vue/compiler-vue2": "^2.7.16", - "@vue/shared": "^3.5.0", - "alien-signals": "^0.4.9", - "minimatch": "^9.0.3", - "muggle-string": "^0.4.1", - "path-browserify": "^1.0.1" - }, - "peerDependencies": { - "typescript": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@vue/language-core/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@vue/shared": { - "version": "3.5.22", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.22.tgz", - "integrity": "sha512-F4yc6palwq3TT0u+FYf0Ns4Tfl9GRFURDN2gWG7L1ecIaS/4fCIuFOjMTnCyjsu/OK6vaDKLCrGAa+KvvH+h4w==", - "license": "MIT" - }, - "node_modules/acorn": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", - "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-draft-04": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", - "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==", - "license": "MIT", - "peerDependencies": { - "ajv": "^8.5.0" - }, - "peerDependenciesMeta": { - "ajv": { - "optional": true - } - } - }, - "node_modules/ajv-formats": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", - "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", - "license": "MIT", - "dependencies": { - "ajv": "^8.0.0" - }, - "peerDependencies": { - "ajv": "^8.0.0" - }, - "peerDependenciesMeta": { - "ajv": { - "optional": true - } - } - }, - "node_modules/alien-signals": { - "version": "0.4.14", - "resolved": "https://registry.npmjs.org/alien-signals/-/alien-signals-0.4.14.tgz", - "integrity": "sha512-itUAVzhczTmP2U5yX67xVpsbbOiquusbWVyA9N+sy6+r6YVbFkahXvNCeEPWEOMhwDYwbVbGHFkVL03N9I5g+Q==", - "license": "MIT" - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "license": "MIT", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "license": "MIT" - }, - "node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/compare-versions": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.1.tgz", - "integrity": "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==", - "license": "MIT" - }, - "node_modules/confbox": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.2.tgz", - "integrity": "sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==", - "license": "MIT" - }, - "node_modules/de-indent": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", - "integrity": "sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==", - "license": "MIT" - }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/esbuild": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.1.tgz", - "integrity": "sha512-yY35KZckJJuVVPXpvjgxiCuVEJT67F6zDeVTv4rizyPrfGBUpZQsvmxnN+C371c2esD/hNMjj4tpBhuueLN7aA==", - "devOptional": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.27.1", - "@esbuild/android-arm": "0.27.1", - "@esbuild/android-arm64": "0.27.1", - "@esbuild/android-x64": "0.27.1", - "@esbuild/darwin-arm64": "0.27.1", - "@esbuild/darwin-x64": "0.27.1", - "@esbuild/freebsd-arm64": "0.27.1", - "@esbuild/freebsd-x64": "0.27.1", - "@esbuild/linux-arm": "0.27.1", - "@esbuild/linux-arm64": "0.27.1", - "@esbuild/linux-ia32": "0.27.1", - "@esbuild/linux-loong64": "0.27.1", - "@esbuild/linux-mips64el": "0.27.1", - "@esbuild/linux-ppc64": "0.27.1", - "@esbuild/linux-riscv64": "0.27.1", - "@esbuild/linux-s390x": "0.27.1", - "@esbuild/linux-x64": "0.27.1", - "@esbuild/netbsd-arm64": "0.27.1", - "@esbuild/netbsd-x64": "0.27.1", - "@esbuild/openbsd-arm64": "0.27.1", - "@esbuild/openbsd-x64": "0.27.1", - "@esbuild/openharmony-arm64": "0.27.1", - "@esbuild/sunos-x64": "0.27.1", - "@esbuild/win32-arm64": "0.27.1", - "@esbuild/win32-ia32": "0.27.1", - "@esbuild/win32-x64": "0.27.1" - } - }, - "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "license": "MIT" - }, - "node_modules/exsolve": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.7.tgz", - "integrity": "sha512-VO5fQUzZtI6C+vx4w/4BWJpg3s/5l+6pRQEHzFRM8WFi4XffSP1Z+4qi7GbjWbvRQEbdIco5mIMq+zX4rPuLrw==", - "license": "MIT" - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "license": "MIT" - }, - "node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "devOptional": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/fs-extra": { - "version": "11.3.2", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.2.tgz", - "integrity": "sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==", - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "license": "ISC" - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "license": "MIT", - "bin": { - "he": "bin/he" - } - }, - "node_modules/import-lazy": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", - "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-core-module": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", - "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", - "license": "MIT", - "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/jju": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", - "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==", - "license": "MIT" - }, - "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "license": "MIT" - }, - "node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/kolorist": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/kolorist/-/kolorist-1.8.0.tgz", - "integrity": "sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==", - "license": "MIT" - }, - "node_modules/local-pkg": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-1.1.2.tgz", - "integrity": "sha512-arhlxbFRmoQHl33a0Zkle/YWlmNwoyt6QNZEIJcqNbdrsix5Lvc4HyyI3EnwxTYlZYc32EbYrQ8SzEZ7dqgg9A==", - "license": "MIT", - "dependencies": { - "mlly": "^1.7.4", - "pkg-types": "^2.3.0", - "quansync": "^0.2.11" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "license": "MIT" - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/magic-string": { - "version": "0.30.21", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", - "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.5" - } - }, - "node_modules/minimatch": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz", - "integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==", - "license": "ISC", - "dependencies": { - "@isaacs/brace-expansion": "^5.0.0" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/mlly": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.0.tgz", - "integrity": "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==", - "license": "MIT", - "dependencies": { - "acorn": "^8.15.0", - "pathe": "^2.0.3", - "pkg-types": "^1.3.1", - "ufo": "^1.6.1" - } - }, - "node_modules/mlly/node_modules/confbox": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", - "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", - "license": "MIT" - }, - "node_modules/mlly/node_modules/pkg-types": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", - "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", - "license": "MIT", - "dependencies": { - "confbox": "^0.1.8", - "mlly": "^1.7.4", - "pathe": "^2.0.1" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/muggle-string": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.4.1.tgz", - "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==", - "license": "MIT" - }, - "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", - "devOptional": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/path-browserify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "license": "MIT" - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "license": "MIT" - }, - "node_modules/pathe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", - "license": "MIT" - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "devOptional": true, - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pkg-types": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.0.tgz", - "integrity": "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==", - "license": "MIT", - "dependencies": { - "confbox": "^0.2.2", - "exsolve": "^1.0.7", - "pathe": "^2.0.3" - } - }, - "node_modules/postcss": { - "version": "8.5.6", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", - "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", - "devOptional": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.11", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/quansync": { - "version": "0.2.11", - "resolved": "https://registry.npmjs.org/quansync/-/quansync-0.2.11.tgz", - "integrity": "sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/antfu" - }, - { - "type": "individual", - "url": "https://github.com/sponsors/sxzz" - } - ], - "license": "MIT" - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve": { - "version": "1.22.11", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", - "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", - "license": "MIT", - "dependencies": { - "is-core-module": "^2.16.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/rollup": { - "version": "4.52.5", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.5.tgz", - "integrity": "sha512-3GuObel8h7Kqdjt0gxkEzaifHTqLVW56Y/bjN7PSQtkKr0w3V/QYSdt6QWYtd7A1xUtYQigtdUfgj1RvWVtorw==", - "devOptional": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@types/estree": "1.0.8" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.52.5", - "@rollup/rollup-android-arm64": "4.52.5", - "@rollup/rollup-darwin-arm64": "4.52.5", - "@rollup/rollup-darwin-x64": "4.52.5", - "@rollup/rollup-freebsd-arm64": "4.52.5", - "@rollup/rollup-freebsd-x64": "4.52.5", - "@rollup/rollup-linux-arm-gnueabihf": "4.52.5", - "@rollup/rollup-linux-arm-musleabihf": "4.52.5", - "@rollup/rollup-linux-arm64-gnu": "4.52.5", - "@rollup/rollup-linux-arm64-musl": "4.52.5", - "@rollup/rollup-linux-loong64-gnu": "4.52.5", - "@rollup/rollup-linux-ppc64-gnu": "4.52.5", - "@rollup/rollup-linux-riscv64-gnu": "4.52.5", - "@rollup/rollup-linux-riscv64-musl": "4.52.5", - "@rollup/rollup-linux-s390x-gnu": "4.52.5", - "@rollup/rollup-linux-x64-gnu": "4.52.5", - "@rollup/rollup-linux-x64-musl": "4.52.5", - "@rollup/rollup-openharmony-arm64": "4.52.5", - "@rollup/rollup-win32-arm64-msvc": "4.52.5", - "@rollup/rollup-win32-ia32-msvc": "4.52.5", - "@rollup/rollup-win32-x64-gnu": "4.52.5", - "@rollup/rollup-win32-x64-msvc": "4.52.5", - "fsevents": "~2.3.2" - } - }, - "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "license": "BSD-3-Clause" - }, - "node_modules/string-argv": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", - "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", - "license": "MIT", - "engines": { - "node": ">=0.6.19" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/tinyglobby": { - "version": "0.2.15", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", - "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", - "devOptional": true, - "license": "MIT", - "dependencies": { - "fdir": "^6.5.0", - "picomatch": "^4.0.3" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" - } - }, - "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", - "license": "Apache-2.0", - "peer": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/ufo": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz", - "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==", - "license": "MIT" - }, - "node_modules/undici-types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", - "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", - "devOptional": true, - "license": "MIT" - }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "license": "BSD-2-Clause", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/vite": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.0.tgz", - "integrity": "sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==", - "devOptional": true, - "license": "MIT", - "peer": true, - "dependencies": { - "esbuild": "^0.27.0", - "fdir": "^6.5.0", - "picomatch": "^4.0.3", - "postcss": "^8.5.6", - "rollup": "^4.43.0", - "tinyglobby": "^0.2.15" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^20.19.0 || >=22.12.0", - "jiti": ">=1.21.0", - "less": "^4.0.0", - "lightningcss": "^1.21.0", - "sass": "^1.70.0", - "sass-embedded": "^1.70.0", - "stylus": ">=0.54.8", - "sugarss": "^5.0.0", - "terser": "^5.16.0", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "jiti": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } - } - }, - "node_modules/vite-plugin-dts": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-4.5.4.tgz", - "integrity": "sha512-d4sOM8M/8z7vRXHHq/ebbblfaxENjogAAekcfcDCCwAyvGqnPrc7f4NZbvItS+g4WTgerW0xDwSz5qz11JT3vg==", - "license": "MIT", - "dependencies": { - "@microsoft/api-extractor": "^7.50.1", - "@rollup/pluginutils": "^5.1.4", - "@volar/typescript": "^2.4.11", - "@vue/language-core": "2.2.0", - "compare-versions": "^6.1.1", - "debug": "^4.4.0", - "kolorist": "^1.8.0", - "local-pkg": "^1.0.0", - "magic-string": "^0.30.17" - }, - "peerDependencies": { - "typescript": "*", - "vite": "*" - }, - "peerDependenciesMeta": { - "vite": { - "optional": true - } - } - }, - "node_modules/vscode-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz", - "integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==", - "license": "MIT" - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "license": "ISC" - } - } -} diff --git a/package/mapper/package.json b/package/mapper/package.json deleted file mode 100644 index d942a92..0000000 --- a/package/mapper/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "@code0-tech/definition-mapper", - "version": "0.0.0", - "description": "Will map Code0-Definitions to its correspondent Sagittarius-Types", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "type": "module", - "scripts": { - "build": "vite build", - "start": "node ./dist/index.js", - "build:and:run": "vite build && node ./dist/index.js" - }, - "author": "", - "license": "", - "devDependencies": { - "@types/node": "^24.1.0", - "typescript": "^5.8.3", - "vite": "^7.1.11" - }, - "repository": { - "type": "git", - "url": "https://github.com/code0-tech/code0-definition" - }, - "files": [ - "dist", - "src" - ], - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@code0-tech/sagittarius-graphql-types": "^0.0.0-c63274fdd34593b8aa24f9f977659fd3d6270150", - "@code0-tech/tucana": "^0.0.47", - "@protobuf-ts/runtime": "^2.11.1", - "@protobuf-ts/runtime-rpc": "^2.11.1", - "vite-plugin-dts": "^4.5.4" - } -} diff --git a/package/mapper/src/definition/mapper.ts b/package/mapper/src/definition/mapper.ts deleted file mode 100644 index 4b7e0a8..0000000 --- a/package/mapper/src/definition/mapper.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { FlowType as TucanaFlowType } from "@code0-tech/tucana/pb/shared.flow_definition_pb.js"; -import { RuntimeFunctionDefinition as TucanaFunction } from "@code0-tech/tucana/pb/shared.runtime_function_pb.js"; -import { DefinitionDataType as TucanaDataType } from "@code0-tech/tucana/pb/shared.data_type_pb.js"; - -import type { DataType, FlowType, FunctionDefinition } from "@code0-tech/sagittarius-graphql-types"; -import { getDataType } from "../mapper/dataTypeMapper.js"; -import { mapFlowType } from "../mapper/flowTypeMapper.js"; -import { mapFunction } from "../mapper/functionMapper.js"; -import {Reader} from "./reader"; - -export interface ConstructedDataTypes { - scannedTucanaTypes: TucanaDataType[]; - constructedDataTypes: DataType[]; - id: number; -} - -export interface Feature { - name: string; - dataTypes: DataType[]; - flowTypes: FlowType[]; - runtimeFunctions: FunctionDefinition[]; -} -export function getID(constructedDataTypes: ConstructedDataTypes) { - const last = constructedDataTypes.id; - constructedDataTypes.id += 1; - return last; -} - -export async function DefinitionMapper(path: string): Promise { - const dataTypes: { feature: string; type: TucanaDataType }[] = []; - const flowTypes: { feature: string; flow: TucanaFlowType }[] = []; - const runtimeFunctions: { feature: string; func: TucanaFunction }[] = []; - - const tucanaFeature = await Reader.fromPath(path) - - tucanaFeature.forEach(feature => { - feature.data_types.forEach(dataType => { - dataTypes.push({ - feature: feature.name, - type: dataType - }) - }) - - feature.flow_types.forEach(flowType => { - flowTypes.push({ - feature: feature.name, - flow: flowType - }) - }) - - feature.runtime_functions.forEach(runtimeFunction => { - runtimeFunctions.push({ - feature: feature.name, - func: runtimeFunction - }) - }) - }) - - const constructed: ConstructedDataTypes = { - scannedTucanaTypes: dataTypes.map((d) => d.type), - constructedDataTypes: [], - id: 0, - }; - - const features: Feature[] = []; - const getFeature = (name: string): Feature => { - let f = features.find((x) => x.name === name); - if (!f) { - f = { name, dataTypes: [], flowTypes: [], runtimeFunctions: [] }; - features.push(f); - } - return f; - }; - - dataTypes - .map((f) => ({ name: f.feature, type: getDataType(f.type.identifier, constructed) })) - .forEach((dt) => dt.type && getFeature(dt.name).dataTypes.push(dt.type)); - - runtimeFunctions - .map((f) => ({ name: f.feature, type: mapFunction(f.func, constructed) })) - .forEach((rf) => rf.type && getFeature(rf.name).runtimeFunctions.push(rf.type)); - - flowTypes - .map((f) => ({ name: f.feature, type: mapFlowType(f.flow, constructed) })) - .forEach((ft) => ft.type && getFeature(ft.name).flowTypes.push(ft.type)); - - return features; -} diff --git a/package/mapper/src/definition/reader.ts b/package/mapper/src/definition/reader.ts deleted file mode 100644 index 82dab5b..0000000 --- a/package/mapper/src/definition/reader.ts +++ /dev/null @@ -1,112 +0,0 @@ -import {readdir, readFile} from "node:fs/promises"; -import {join, extname} from "node:path"; - -import {FlowType} from "@code0-tech/tucana/pb/shared.flow_definition_pb.js"; -import {RuntimeFunctionDefinition} from "@code0-tech/tucana/pb/shared.runtime_function_pb.js"; -import {DefinitionDataType} from "@code0-tech/tucana/pb/shared.data_type_pb.js"; - -export const enum MetaType { - FlowType = "FlowType", - DataType = "DataType", - RuntimeFunction = "RuntimeFunction", -} - -export interface DefinitionError { - definition: string; - definition_type: MetaType; - error: string; -} - -export interface TucanaFeature { - name: string; - data_types: DefinitionDataType[]; - flow_types: FlowType[]; - runtime_functions: RuntimeFunctionDefinition[]; - errors: DefinitionError[]; -} - -export class Reader { - static async fromPath(root: string): Promise { - const features = new Map(); - - for (const featureDir of await safeReadDir(root)) { - if (!featureDir.isDirectory()) continue; - const featureName = featureDir.name; - const featurePath = join(root, featureName); - - for (const typeDir of await safeReadDir(featurePath)) { - const type = toMetaType(typeDir.name); - if (!type) continue; - - const typePath = join(featurePath, typeDir.name); - const jsonPaths = await collectJsonFiles(typePath); - - for (const file of jsonPaths) { - const def = await readFile(file, "utf8"); - const f = features.get(featureName) ?? emptyFeature(featureName); - addDefinition(f, def, type); - features.set(featureName, f); - } - } - } - - return Array.from(features.values()); - } -} - -const toMetaType = (folder: string): MetaType | null => - ({ - flow_type: MetaType.FlowType, - data_type: MetaType.DataType, - runtime_definition: MetaType.RuntimeFunction - } as const)[folder] ?? null; - -const emptyFeature = (name: string): TucanaFeature => ({ - name, - data_types: [], - flow_types: [], - runtime_functions: [], - errors: [], -}); - -const safeReadDir = async (p: string) => { - try { - return await readdir(p, {withFileTypes: true}); - } catch { - return []; - } -}; - -const collectJsonFiles = async (dir: string): Promise => { - const entries = await safeReadDir(dir); - const files = entries.filter(e => e.isFile() && extname(e.name) === ".json").map(e => join(dir, e.name)); - - // include one nested level - for (const e of entries.filter(e => e.isDirectory())) { - const sub = (await safeReadDir(join(dir, e.name))) - .filter(s => s.isFile() && extname(s.name) === ".json") - .map(s => join(dir, e.name, s.name)); - files.push(...sub); - } - return files; -}; - -const addDefinition = (feature: TucanaFeature, def: string, type: MetaType) => { - try { - if (type === MetaType.DataType) feature.data_types.push(DefinitionDataType.fromJsonString(def)); - else if (type === MetaType.FlowType) feature.flow_types.push(FlowType.fromJsonString(def)); - else feature.runtime_functions.push(RuntimeFunctionDefinition.fromJsonString(def)); - } catch (err) { - feature.errors.push({ - definition: extractIdentifier(def, type), - definition_type: type, - error: err instanceof Error ? err.message : String(err), - }); - } -}; - -const extractIdentifier = (def: string, type: MetaType): string => { - const key = type === MetaType.RuntimeFunction ? "runtime_name" : "identifier"; - return def.match(new RegExp(`"${key}"\\s*:\\s*"([^"]+)"`))?.[1] ?? def; -}; - diff --git a/package/mapper/src/index.ts b/package/mapper/src/index.ts deleted file mode 100644 index 2869011..0000000 --- a/package/mapper/src/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {DefinitionMapper, Feature} from "./definition/mapper.js"; -import * as fs from "node:fs"; -import * as path from "node:path"; - -DefinitionMapper("../../../definitions").then((value: Feature[]) => { - const functions = value.flatMap(v => v.runtimeFunctions); - const types = value.flatMap(v => v.dataTypes); - const flows = value.flatMap(v => v.flowTypes); - - const outDir = path.resolve("./export"); - fs.mkdirSync(outDir, {recursive: true}); - - fs.writeFileSync(path.join(outDir, "functions.json"), JSON.stringify(functions)); - fs.writeFileSync(path.join(outDir, "dataTypes.json"), JSON.stringify(types)); - fs.writeFileSync(path.join(outDir, "flowTypes.json"), JSON.stringify(flows)); -}); diff --git a/package/mapper/src/mapper/dataTypeMapper.ts b/package/mapper/src/mapper/dataTypeMapper.ts deleted file mode 100644 index 0abe349..0000000 --- a/package/mapper/src/mapper/dataTypeMapper.ts +++ /dev/null @@ -1,296 +0,0 @@ -import { - DataType, - DataTypeIdentifier, DataTypeRule, - DataTypeRuleConnection, DataTypeRulesContainsKeyConfig, DataTypeRulesContainsTypeConfig, - DataTypeRulesInputTypeConfig, - DataTypeRulesInputTypesConfig, - DataTypeRulesItemOfCollectionConfig, DataTypeRulesNumberRangeConfig, - DataTypeRulesParentTypeConfig, DataTypeRulesRegexConfig, -} from "@code0-tech/sagittarius-graphql-types"; -import { - DataTypeIdentifier as TucanaDataTypeIdentifier, - DefinitionDataType_Variant, DefinitionDataTypeRule, GenericMapper_GenericCombinationStrategy -} from "@code0-tech/tucana/pb/shared.data_type_pb.js" -import {GenericMapper as TucanaGenericMapper} from "@code0-tech/tucana/pb/shared.data_type_pb.js" -import {ConstructedDataTypes, getID} from "../definition/mapper.js"; -import {getTranslationConnection} from "./translation.js"; -import {Value} from "@code0-tech/tucana/pb/shared.struct_pb.js"; - -enum GenericCombinationStrategyType { - /** Represents a logical AND combination. */ - And = 'AND', - /** Represents a logical OR combination. */ - Or = 'OR' -} - -enum DataTypeRulesVariant { - /** The rule checks if a key is present in the data type. */ - ContainsKey = 'CONTAINS_KEY', - /** The rule checks if a specific type is present in the data type. */ - ContainsType = 'CONTAINS_TYPE', - /** The rule checks if the data type matches a specific input type. */ - InputTypes = 'INPUT_TYPES', - /** The rule checks if an item is part of a collection in the data type. */ - ItemOfCollection = 'ITEM_OF_COLLECTION', - /** The rule checks if a number falls within a specified range. */ - NumberRange = 'NUMBER_RANGE', - /** The rule checks if the data type is a child of a specific parent type. */ - ParentType = 'PARENT_TYPE', - /** The rule checks if a string matches a specified regular expression. */ - Regex = 'REGEX', - /** The rule checks if the data type matches a specific return type. */ - ReturnType = 'RETURN_TYPE' -} - -enum DataTypeVariant { - /** Represents an array */ - Array = 'ARRAY', - /** Represents an data type containing a data type */ - DataType = 'DATA_TYPE', - /** Represents a error */ - Error = 'ERROR', - /** Represents a node */ - Node = 'NODE', - /** Represents an object */ - Object = 'OBJECT', - /** Represents a primitive datatype */ - Primitive = 'PRIMITIVE', - /** Represents a type */ - Type = 'TYPE' -} - -function getDataType(identifier: string, constructedDataTypes: ConstructedDataTypes): DataType | null { - const dataType = constructedDataTypes.constructedDataTypes.find(dt => dt.identifier === identifier) - if (dataType == undefined) { - const tucanaDataType = constructedDataTypes.scannedTucanaTypes.find(dt => dt.identifier === identifier) - if (tucanaDataType == undefined) { - console.error("Skipping Identifier because it can't be identified:" + identifier) - return null - } - const constructed: DataType = { - __typename: "DataType", - id: `gid://sagittarius/DataType/${getID(constructedDataTypes)}`, - genericKeys: tucanaDataType.genericKeys, - identifier: tucanaDataType.identifier, - aliases: getTranslationConnection(tucanaDataType.alias), - displayMessages: getTranslationConnection(tucanaDataType.displayMessage), - name: getTranslationConnection(tucanaDataType.name), - rules: createRules(tucanaDataType.rules, constructedDataTypes), - variant: getDataTypeVariant(tucanaDataType.variant), - } - - constructedDataTypes.constructedDataTypes.push(constructed) - return constructed; - } - return dataType; -} - -function createRules(rule: DefinitionDataTypeRule[], constructedDataTypes: ConstructedDataTypes) : DataTypeRuleConnection { - return { - count: rule.length, - nodes: rule.map(r => { - switch (r.config.oneofKind) { - case "containsType": { - const ruleConfig: DataTypeRulesContainsTypeConfig = { - dataTypeIdentifier: getDataTypeIdentifier(r.config.containsType.dataTypeIdentifier, constructedDataTypes), - } - const rule: DataTypeRule = { - variant: DataTypeRulesVariant.ContainsType, - config: ruleConfig - } - return rule; - } - case "containsKey": { - const ruleConfig: DataTypeRulesContainsKeyConfig = { - dataTypeIdentifier: getDataTypeIdentifier(r.config.containsKey.dataTypeIdentifier, constructedDataTypes), - key: r.config.containsKey.key, - } - const rule: DataTypeRule = { - variant: DataTypeRulesVariant.ContainsKey, - config: ruleConfig - } - return rule; - } - case "itemOfCollection": { - const ruleConfig: DataTypeRulesItemOfCollectionConfig = { - items: r.config.itemOfCollection.items.map(valueToJSON), - } - const rule: DataTypeRule = { - variant: DataTypeRulesVariant.ItemOfCollection, - config: ruleConfig - } - return rule; - } - case "numberRange": { - const ruleConfig: DataTypeRulesNumberRangeConfig = { - from: Number(r.config.numberRange.from), - steps: r.config.numberRange.steps ? Number(r.config.numberRange.steps) : undefined, - to: Number(r.config.numberRange.to), - } - const rule : DataTypeRule = { - variant: DataTypeRulesVariant.NumberRange, - config: ruleConfig - } - return rule; - } - case "regex": { - const ruleConfig: DataTypeRulesRegexConfig = { - pattern: r.config.regex.pattern, - } - const rule : DataTypeRule = { - variant: DataTypeRulesVariant.Regex, - config: ruleConfig - } - return rule; - } - case "inputTypes": { - const ruleConfig: DataTypeRulesInputTypesConfig = { - inputTypes: r.config.inputTypes.inputTypes.map(i => { - console.log("AF: " + i.inputIdentifier) - const input: DataTypeRulesInputTypeConfig = { - dataTypeIdentifier: getDataTypeIdentifier(i.dataTypeIdentifier, constructedDataTypes), - inputIdentifier: i.inputIdentifier, - } - return input; - }), - } - const rule : DataTypeRule = { - variant: DataTypeRulesVariant.InputTypes, - config: ruleConfig - } - return rule; - } - - case "returnType": { - const ruleConfig: DataTypeRulesParentTypeConfig = { - dataTypeIdentifier: getDataTypeIdentifier(r.config.returnType.dataTypeIdentifier, constructedDataTypes), - } - const rule : DataTypeRule = { - variant: DataTypeRulesVariant.ReturnType, - config: ruleConfig - } - return rule; - } - - case "parentType": { - const ruleConfig: DataTypeRulesParentTypeConfig = { - dataTypeIdentifier: getDataTypeIdentifier(r.config.parentType.parentType, constructedDataTypes), - } - const rule : DataTypeRule = { - variant: DataTypeRulesVariant.ParentType, - config: ruleConfig - } - return rule; - } - } - throw new Error(`Unknown rule: ${rule}`) - } - ) - } -} - -function getDataTypeVariant(variant: DefinitionDataType_Variant): DataTypeVariant { - switch (variant) { - case DefinitionDataType_Variant.ARRAY: - return DataTypeVariant.Array - case DefinitionDataType_Variant.DATATYPE: - return DataTypeVariant.DataType; - case DefinitionDataType_Variant.ERROR: - return DataTypeVariant.Error; - case DefinitionDataType_Variant.NODE: - return DataTypeVariant.Node; - case DefinitionDataType_Variant.OBJECT: - return DataTypeVariant.Object; - case DefinitionDataType_Variant.PRIMITIVE: - return DataTypeVariant.Primitive; - case DefinitionDataType_Variant.TYPE: - return DataTypeVariant.Type; - default: - throw new Error(`Unknown variant: ${variant}`); - } -} - -function getDataTypeIdentifier(identifier: TucanaDataTypeIdentifier | undefined, constructedDataTypes: ConstructedDataTypes): DataTypeIdentifier | null { - if (identifier == undefined) { - return null - } - - switch (identifier.type.oneofKind) { - case "genericType": { - return { - id: `gid://sagittarius/DataTypeIdentifier/${getID(constructedDataTypes)}`, - genericType: { - id: `gid://sagittarius/GenericType/${getID(constructedDataTypes)}`, - dataType: getDataType(identifier.type.genericType.dataTypeIdentifier, constructedDataTypes), - genericMappers: identifier.type.genericType.genericMappers.map((mapper: TucanaGenericMapper) => { - return { - genericCombinationStrategies: mapper.genericCombinations.map(m => { - let type = undefined - switch (m) { - case GenericMapper_GenericCombinationStrategy.AND: - type = GenericCombinationStrategyType.And - break - case GenericMapper_GenericCombinationStrategy.OR: - type = GenericCombinationStrategyType.Or - break - default: - throw new Error("GenericCombinationStrategy was Unknown"); - } - return { - id: `gid://sagittarius/GenericCombinationStrategy/${getID(constructedDataTypes)}`, - type: type - } - }), - sourceDataTypeIdentifiers: mapper.source.map(id => - getDataTypeIdentifier(id, constructedDataTypes) - ).filter(id => id != null), - target: mapper.target, - id: `gid://sagittarius/GenericMapper/${getID(constructedDataTypes)}`, - } - }), - } - } - } - - case "dataTypeIdentifier": { - return { - id: `gid://sagittarius/DataTypeIdentifier/${getID(constructedDataTypes)}`, - dataType: getDataType(identifier.type.dataTypeIdentifier, constructedDataTypes) - } - } - - case "genericKey": { - return { - id: `gid://sagittarius/DataTypeIdentifier/${getID(constructedDataTypes)}`, - genericKey: identifier.type.genericKey, - } - } - } - - return null; -} - -// @ts-ignore -function valueToJSON(value: Value) { - switch (value.kind.oneofKind) { - case "nullValue": - return null - case "numberValue": - return value.kind.numberValue - case "stringValue": - return value.kind.stringValue - case "boolValue": - return value.kind.boolValue - case "structValue": - return Object.fromEntries( - // @ts-ignore - Object.entries(value.kind.structValue.fields).map(([k, v]) => { - return [k, valueToJSON(v)] - }) - ) - case "listValue": - return value.kind.listValue.values.map(valueToJSON) - } -} - -export {getDataType, getDataTypeIdentifier} \ No newline at end of file diff --git a/package/mapper/src/mapper/flowTypeMapper.ts b/package/mapper/src/mapper/flowTypeMapper.ts deleted file mode 100644 index d6efeb9..0000000 --- a/package/mapper/src/mapper/flowTypeMapper.ts +++ /dev/null @@ -1,39 +0,0 @@ -import {FlowType as TucanaFlowType, FlowTypeSetting as TucanaFlowTypeSetting} from "@code0-tech/tucana/pb/shared.flow_definition_pb.js" -import {FlowType, FlowTypeSetting} from "@code0-tech/sagittarius-graphql-types"; -import {getDataType} from "./dataTypeMapper.js"; -import {getTranslationConnection} from "./translation.js"; -import {ConstructedDataTypes, getID} from "../definition/mapper.js"; - -function mapFlowType(flowType: TucanaFlowType, constructed: ConstructedDataTypes): FlowType | null { - return { - __typename: "FlowType", - id: `gid://sagittarius/FlowType/${getID(constructed)}`, - identifier: flowType.identifier, - inputType: getDataType(flowType.inputTypeIdentifier!!, constructed), - returnType: getDataType(flowType.returnTypeIdentifier!!, constructed), - flowTypeSettings: createFlowTypeSetting(flowType.settings, constructed), - names: getTranslationConnection(flowType.name), - descriptions: getTranslationConnection(flowType.description), - aliases: getTranslationConnection(flowType.alias), - displayMessages: getTranslationConnection(flowType.displayMessage), - editable: flowType.editable - } -} - -function createFlowTypeSetting(settings: TucanaFlowTypeSetting[], constructed: ConstructedDataTypes): FlowTypeSetting[] { - return settings.map(setting => { - const flowSetting: FlowTypeSetting = { - __typename: "FlowTypeSetting", - id: `gid://sagittarius/FlowTypeSetting/${getID(constructed)}`, - names: getTranslationConnection(setting.name), - descriptions: getTranslationConnection(setting.description), - dataType: getDataType(setting.dataTypeIdentifier, constructed), - identifier: setting.identifier, - unique: setting.unique, - } - - return flowSetting; - }) -} - -export {mapFlowType} \ No newline at end of file diff --git a/package/mapper/src/mapper/functionMapper.ts b/package/mapper/src/mapper/functionMapper.ts deleted file mode 100644 index de89d28..0000000 --- a/package/mapper/src/mapper/functionMapper.ts +++ /dev/null @@ -1,49 +0,0 @@ -import {FunctionDefinition, ParameterDefinitionConnection} from "@code0-tech/sagittarius-graphql-types"; -import { - RuntimeFunctionDefinition as TucanaFunction, - RuntimeParameterDefinition -} from "@code0-tech/tucana/pb/shared.runtime_function_pb.js"; -import {getDataTypeIdentifier} from "./dataTypeMapper.js"; -import {ConstructedDataTypes, getID} from "../definition/mapper.js"; -import {getTranslationConnection} from "./translation.js"; - -function mapFunction(func: TucanaFunction, constructed: ConstructedDataTypes): FunctionDefinition | null { - return { - __typename: "FunctionDefinition", - id: `gid://sagittarius/FunctionDefinition/${getID(constructed)}`, - genericKeys: func.genericKeys, - names: getTranslationConnection(func.name), - descriptions: getTranslationConnection(func.description), - documentations: getTranslationConnection(func.documentation), - deprecationMessages: getTranslationConnection(func.deprecationMessage), - identifier: func.runtimeName, - displayMessages: getTranslationConnection(func.displayMessage), - aliases: getTranslationConnection(func.alias), - throwsError: func.throwsError, - returnType: getDataTypeIdentifier(func.returnTypeIdentifier, constructed), - parameterDefinitions: getParameterDefinitionConnection(func.runtimeParameterDefinitions, constructed), - runtimeFunctionDefinition: { - id: `gid://sagittarius/RuntimeFunctionDefinition/${getID(constructed)}`, - identifier: func.runtimeName - } - } -} - -function getParameterDefinitionConnection(def: RuntimeParameterDefinition[], constructed: ConstructedDataTypes): ParameterDefinitionConnection { - return { - count: def.length, - nodes: def.map(node => { - return { - __typename: "ParameterDefinition", - id: `gid://sagittarius/ParameterDefinition/${getID(constructed)}`, - names: getTranslationConnection(node.name), - identifier: node.runtimeName, - descriptions: getTranslationConnection(node.description), - documentations: getTranslationConnection(node.documentation), - dataTypeIdentifier: getDataTypeIdentifier(node.dataTypeIdentifier, constructed) - } - }) - } -} - -export {mapFunction} \ No newline at end of file diff --git a/package/mapper/src/mapper/translation.ts b/package/mapper/src/mapper/translation.ts deleted file mode 100644 index fecd963..0000000 --- a/package/mapper/src/mapper/translation.ts +++ /dev/null @@ -1,9 +0,0 @@ -import {Translation} from "@code0-tech/tucana/pb/shared.translation_pb.js"; -import {TranslationConnection} from "@code0-tech/sagittarius-graphql-types"; - -export function getTranslationConnection(translation: Translation[]): TranslationConnection { - return { - count: translation.length, - nodes: translation, - } -} diff --git a/package/mapper/tsconfig.json b/package/mapper/tsconfig.json deleted file mode 100644 index 4a788d9..0000000 --- a/package/mapper/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "exclude": ["node_modules", "build", "dist"], - "include": ["node_modules/@code0-tech/tucana/pb/**/*.ts"], - "types": [ - "typePatches" - ], - "compilerOptions": { - "lib": ["ESNext"], - "module": "NodeNext", - "target": "ESNext", - "skipLibCheck": true, - "strict": true, - "paths": { - "src": [ - "src/*" - ] - }, - "baseUrl": "src/", - "sourceMap": true, - "moduleResolution": "nodenext", - "declaration": true, - "emitDeclarationOnly": true, - "esModuleInterop": true, - } -} diff --git a/package/mapper/vite.config.ts b/package/mapper/vite.config.ts deleted file mode 100644 index d11b3fe..0000000 --- a/package/mapper/vite.config.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { defineConfig } from 'vite'; -import dts from 'vite-plugin-dts' - -export default defineConfig({ - plugins: [dts({ - include: ["src"] - })], - build: { - lib: { - entry: './src/index.ts', - formats: ['es'], - }, - rollupOptions: { - external: [/^node:.*$/], - output: { - entryFileNames: '[name].js', - } - }, - }, -}); \ No newline at end of file diff --git a/package/reader/dist/index.js b/package/reader/dist/index.js new file mode 100644 index 0000000..37e8a63 --- /dev/null +++ b/package/reader/dist/index.js @@ -0,0 +1,3671 @@ +import { readFile as $e, readdir as xe } from "node:fs/promises"; +import { join as x, extname as ye } from "node:path"; +function Be(a) { + let e = typeof a; + if (e == "object") { + if (Array.isArray(a)) + return "array"; + if (a === null) + return "null"; + } + return e; +} +function Ve(a) { + return a !== null && typeof a == "object" && !Array.isArray(a); +} +let O = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), M = []; +for (let a = 0; a < O.length; a++) + M[O[a].charCodeAt(0)] = a; +M[45] = O.indexOf("+"); +M[95] = O.indexOf("/"); +function We(a) { + let e = a.length * 3 / 4; + a[a.length - 2] == "=" ? e -= 2 : a[a.length - 1] == "=" && (e -= 1); + let t = new Uint8Array(e), i = 0, r = 0, n, o = 0; + for (let s = 0; s < a.length; s++) { + if (n = M[a.charCodeAt(s)], n === void 0) + switch (a[s]) { + case "=": + r = 0; + // reset state when padding found + case ` +`: + case "\r": + case " ": + case " ": + continue; + // skip white-space, and padding + default: + throw Error("invalid base64 string."); + } + switch (r) { + case 0: + o = n, r = 1; + break; + case 1: + t[i++] = o << 2 | (n & 48) >> 4, o = n, r = 2; + break; + case 2: + t[i++] = (o & 15) << 4 | (n & 60) >> 2, o = n, r = 3; + break; + case 3: + t[i++] = (o & 3) << 6 | n, r = 0; + break; + } + } + if (r == 1) + throw Error("invalid base64 string."); + return t.subarray(0, i); +} +function Ke(a) { + let e = "", t = 0, i, r = 0; + for (let n = 0; n < a.length; n++) + switch (i = a[n], t) { + case 0: + e += O[i >> 2], r = (i & 3) << 4, t = 1; + break; + case 1: + e += O[r | i >> 4], r = (i & 15) << 2, t = 2; + break; + case 2: + e += O[r | i >> 6], e += O[i & 63], t = 0; + break; + } + return t && (e += O[r], e += "=", t == 1 && (e += "=")), e; +} +var y; +(function(a) { + a.symbol = /* @__PURE__ */ Symbol.for("protobuf-ts/unknown"), a.onRead = (t, i, r, n, o) => { + (e(i) ? i[a.symbol] : i[a.symbol] = []).push({ no: r, wireType: n, data: o }); + }, a.onWrite = (t, i, r) => { + for (let { no: n, wireType: o, data: s } of a.list(i)) + r.tag(n, o).raw(s); + }, a.list = (t, i) => { + if (e(t)) { + let r = t[a.symbol]; + return i ? r.filter((n) => n.no == i) : r; + } + return []; + }, a.last = (t, i) => a.list(t, i).slice(-1)[0]; + const e = (t) => t && Array.isArray(t[a.symbol]); +})(y || (y = {})); +var u; +(function(a) { + a[a.Varint = 0] = "Varint", a[a.Bit64 = 1] = "Bit64", a[a.LengthDelimited = 2] = "LengthDelimited", a[a.StartGroup = 3] = "StartGroup", a[a.EndGroup = 4] = "EndGroup", a[a.Bit32 = 5] = "Bit32"; +})(u || (u = {})); +function je() { + let a = 0, e = 0; + for (let i = 0; i < 28; i += 7) { + let r = this.buf[this.pos++]; + if (a |= (r & 127) << i, (r & 128) == 0) + return this.assertBounds(), [a, e]; + } + let t = this.buf[this.pos++]; + if (a |= (t & 15) << 28, e = (t & 112) >> 4, (t & 128) == 0) + return this.assertBounds(), [a, e]; + for (let i = 3; i <= 31; i += 7) { + let r = this.buf[this.pos++]; + if (e |= (r & 127) << i, (r & 128) == 0) + return this.assertBounds(), [a, e]; + } + throw new Error("invalid varint"); +} +function J(a, e, t) { + for (let n = 0; n < 28; n = n + 7) { + const o = a >>> n, s = !(!(o >>> 7) && e == 0), l = (s ? o | 128 : o) & 255; + if (t.push(l), !s) + return; + } + const i = a >>> 28 & 15 | (e & 7) << 4, r = e >> 3 != 0; + if (t.push((r ? i | 128 : i) & 255), !!r) { + for (let n = 3; n < 31; n = n + 7) { + const o = e >>> n, s = !!(o >>> 7), l = (s ? o | 128 : o) & 255; + if (t.push(l), !s) + return; + } + t.push(e >>> 31 & 1); + } +} +const A = 65536 * 65536; +function Ie(a) { + let e = a[0] == "-"; + e && (a = a.slice(1)); + const t = 1e6; + let i = 0, r = 0; + function n(o, s) { + const l = Number(a.slice(o, s)); + r *= t, i = i * t + l, i >= A && (r = r + (i / A | 0), i = i % A); + } + return n(-24, -18), n(-18, -12), n(-12, -6), n(-6), [e, i, r]; +} +function le(a, e) { + if (e >>> 0 <= 2097151) + return "" + (A * e + (a >>> 0)); + let t = a & 16777215, i = (a >>> 24 | e << 8) >>> 0 & 16777215, r = e >> 16 & 65535, n = t + i * 6777216 + r * 6710656, o = i + r * 8147497, s = r * 2, l = 1e7; + n >= l && (o += Math.floor(n / l), n %= l), o >= l && (s += Math.floor(o / l), o %= l); + function f(h, k) { + let p = h ? String(h) : ""; + return k ? "0000000".slice(p.length) + p : p; + } + return f( + s, + /*needLeadingZeros=*/ + 0 + ) + f( + o, + /*needLeadingZeros=*/ + s + ) + // If the final 1e7 digit didn't need leading zeros, we would have + // returned via the trivial code path at the top. + f( + n, + /*needLeadingZeros=*/ + 1 + ); +} +function pe(a, e) { + if (a >= 0) { + for (; a > 127; ) + e.push(a & 127 | 128), a = a >>> 7; + e.push(a); + } else { + for (let t = 0; t < 9; t++) + e.push(a & 127 | 128), a = a >> 7; + e.push(1); + } +} +function Ae() { + let a = this.buf[this.pos++], e = a & 127; + if ((a & 128) == 0) + return this.assertBounds(), e; + if (a = this.buf[this.pos++], e |= (a & 127) << 7, (a & 128) == 0) + return this.assertBounds(), e; + if (a = this.buf[this.pos++], e |= (a & 127) << 14, (a & 128) == 0) + return this.assertBounds(), e; + if (a = this.buf[this.pos++], e |= (a & 127) << 21, (a & 128) == 0) + return this.assertBounds(), e; + a = this.buf[this.pos++], e |= (a & 15) << 28; + for (let t = 5; (a & 128) !== 0 && t < 10; t++) + a = this.buf[this.pos++]; + if ((a & 128) != 0) + throw new Error("invalid varint"); + return this.assertBounds(), e >>> 0; +} +let b; +function Ce() { + const a = new DataView(new ArrayBuffer(8)); + b = globalThis.BigInt !== void 0 && typeof a.getBigInt64 == "function" && typeof a.getBigUint64 == "function" && typeof a.setBigInt64 == "function" && typeof a.setBigUint64 == "function" ? { + MIN: BigInt("-9223372036854775808"), + MAX: BigInt("9223372036854775807"), + UMIN: BigInt("0"), + UMAX: BigInt("18446744073709551615"), + C: BigInt, + V: a + } : void 0; +} +Ce(); +function Re(a) { + if (!a) + throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support"); +} +const De = /^-?[0-9]+$/, C = 4294967296, K = 2147483648; +class Fe { + /** + * Create a new instance with the given bits. + */ + constructor(e, t) { + this.lo = e | 0, this.hi = t | 0; + } + /** + * Is this instance equal to 0? + */ + isZero() { + return this.lo == 0 && this.hi == 0; + } + /** + * Convert to a native number. + */ + toNumber() { + let e = this.hi * C + (this.lo >>> 0); + if (!Number.isSafeInteger(e)) + throw new Error("cannot convert to safe number"); + return e; + } +} +class I extends Fe { + /** + * Create instance from a `string`, `number` or `bigint`. + */ + static from(e) { + if (b) + switch (typeof e) { + case "string": + if (e == "0") + return this.ZERO; + if (e == "") + throw new Error("string is no integer"); + e = b.C(e); + case "number": + if (e === 0) + return this.ZERO; + e = b.C(e); + case "bigint": + if (!e) + return this.ZERO; + if (e < b.UMIN) + throw new Error("signed value for ulong"); + if (e > b.UMAX) + throw new Error("ulong too large"); + return b.V.setBigUint64(0, e, !0), new I(b.V.getInt32(0, !0), b.V.getInt32(4, !0)); + } + else + switch (typeof e) { + case "string": + if (e == "0") + return this.ZERO; + if (e = e.trim(), !De.test(e)) + throw new Error("string is no integer"); + let [t, i, r] = Ie(e); + if (t) + throw new Error("signed value for ulong"); + return new I(i, r); + case "number": + if (e == 0) + return this.ZERO; + if (!Number.isSafeInteger(e)) + throw new Error("number is no integer"); + if (e < 0) + throw new Error("signed value for ulong"); + return new I(e, e / C); + } + throw new Error("unknown value " + typeof e); + } + /** + * Convert to decimal string. + */ + toString() { + return b ? this.toBigInt().toString() : le(this.lo, this.hi); + } + /** + * Convert to native bigint. + */ + toBigInt() { + return Re(b), b.V.setInt32(0, this.lo, !0), b.V.setInt32(4, this.hi, !0), b.V.getBigUint64(0, !0); + } +} +I.ZERO = new I(0, 0); +class N extends Fe { + /** + * Create instance from a `string`, `number` or `bigint`. + */ + static from(e) { + if (b) + switch (typeof e) { + case "string": + if (e == "0") + return this.ZERO; + if (e == "") + throw new Error("string is no integer"); + e = b.C(e); + case "number": + if (e === 0) + return this.ZERO; + e = b.C(e); + case "bigint": + if (!e) + return this.ZERO; + if (e < b.MIN) + throw new Error("signed long too small"); + if (e > b.MAX) + throw new Error("signed long too large"); + return b.V.setBigInt64(0, e, !0), new N(b.V.getInt32(0, !0), b.V.getInt32(4, !0)); + } + else + switch (typeof e) { + case "string": + if (e == "0") + return this.ZERO; + if (e = e.trim(), !De.test(e)) + throw new Error("string is no integer"); + let [t, i, r] = Ie(e); + if (t) { + if (r > K || r == K && i != 0) + throw new Error("signed long too small"); + } else if (r >= K) + throw new Error("signed long too large"); + let n = new N(i, r); + return t ? n.negate() : n; + case "number": + if (e == 0) + return this.ZERO; + if (!Number.isSafeInteger(e)) + throw new Error("number is no integer"); + return e > 0 ? new N(e, e / C) : new N(-e, -e / C).negate(); + } + throw new Error("unknown value " + typeof e); + } + /** + * Do we have a minus sign? + */ + isNegative() { + return (this.hi & K) !== 0; + } + /** + * Negate two's complement. + * Invert all the bits and add one to the result. + */ + negate() { + let e = ~this.hi, t = this.lo; + return t ? t = ~t + 1 : e += 1, new N(t, e); + } + /** + * Convert to decimal string. + */ + toString() { + if (b) + return this.toBigInt().toString(); + if (this.isNegative()) { + let e = this.negate(); + return "-" + le(e.lo, e.hi); + } + return le(this.lo, this.hi); + } + /** + * Convert to native bigint. + */ + toBigInt() { + return Re(b), b.V.setInt32(0, this.lo, !0), b.V.setInt32(4, this.hi, !0), b.V.getBigInt64(0, !0); + } +} +N.ZERO = new N(0, 0); +const ge = { + readUnknownField: !0, + readerFactory: (a) => new Se(a) +}; +function _e(a) { + return a ? Object.assign(Object.assign({}, ge), a) : ge; +} +class Se { + constructor(e, t) { + this.varint64 = je, this.uint32 = Ae, this.buf = e, this.len = e.length, this.pos = 0, this.view = new DataView(e.buffer, e.byteOffset, e.byteLength), this.textDecoder = t ?? new TextDecoder("utf-8", { + fatal: !0, + ignoreBOM: !0 + }); + } + /** + * Reads a tag - field number and wire type. + */ + tag() { + let e = this.uint32(), t = e >>> 3, i = e & 7; + if (t <= 0 || i < 0 || i > 5) + throw new Error("illegal tag: field no " + t + " wire type " + i); + return [t, i]; + } + /** + * Skip one element on the wire and return the skipped data. + * Supports WireType.StartGroup since v2.0.0-alpha.23. + */ + skip(e) { + let t = this.pos; + switch (e) { + case u.Varint: + for (; this.buf[this.pos++] & 128; ) + ; + break; + case u.Bit64: + this.pos += 4; + case u.Bit32: + this.pos += 4; + break; + case u.LengthDelimited: + let i = this.uint32(); + this.pos += i; + break; + case u.StartGroup: + let r; + for (; (r = this.tag()[1]) !== u.EndGroup; ) + this.skip(r); + break; + default: + throw new Error("cant skip wire type " + e); + } + return this.assertBounds(), this.buf.subarray(t, 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 e = this.uint32(); + return e >>> 1 ^ -(e & 1); + } + /** + * Read a `int64` field, a signed 64-bit varint. + */ + int64() { + return new N(...this.varint64()); + } + /** + * Read a `uint64` field, an unsigned 64-bit varint. + */ + uint64() { + return new I(...this.varint64()); + } + /** + * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. + */ + sint64() { + let [e, t] = this.varint64(), i = -(e & 1); + return e = (e >>> 1 | (t & 1) << 31) ^ i, t = t >>> 1 ^ i, new N(e, t); + } + /** + * Read a `bool` field, a variant. + */ + bool() { + let [e, t] = this.varint64(); + return e !== 0 || t !== 0; + } + /** + * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. + */ + fixed32() { + return this.view.getUint32((this.pos += 4) - 4, !0); + } + /** + * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. + */ + sfixed32() { + return this.view.getInt32((this.pos += 4) - 4, !0); + } + /** + * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. + */ + fixed64() { + return new I(this.sfixed32(), this.sfixed32()); + } + /** + * Read a `fixed64` field, a signed, fixed-length 64-bit integer. + */ + sfixed64() { + return new N(this.sfixed32(), this.sfixed32()); + } + /** + * Read a `float` field, 32-bit floating point number. + */ + float() { + return this.view.getFloat32((this.pos += 4) - 4, !0); + } + /** + * Read a `double` field, a 64-bit floating point number. + */ + double() { + return this.view.getFloat64((this.pos += 8) - 8, !0); + } + /** + * Read a `bytes` field, length-delimited arbitrary data. + */ + bytes() { + let e = this.uint32(), t = this.pos; + return this.pos += e, this.assertBounds(), this.buf.subarray(t, t + e); + } + /** + * Read a `string` field, length-delimited data converted to UTF-8 text. + */ + string() { + return this.textDecoder.decode(this.bytes()); + } +} +function g(a, e) { + if (!a) + throw new Error(e); +} +const Pe = 34028234663852886e22, Me = -34028234663852886e22, Xe = 4294967295, Je = 2147483647, Ge = -2147483648; +function V(a) { + if (typeof a != "number") + throw new Error("invalid int 32: " + typeof a); + if (!Number.isInteger(a) || a > Je || a < Ge) + throw new Error("invalid int 32: " + a); +} +function _(a) { + if (typeof a != "number") + throw new Error("invalid uint 32: " + typeof a); + if (!Number.isInteger(a) || a > Xe || a < 0) + throw new Error("invalid uint 32: " + a); +} +function de(a) { + if (typeof a != "number") + throw new Error("invalid float 32: " + typeof a); + if (Number.isFinite(a) && (a > Pe || a < Me)) + throw new Error("invalid float 32: " + a); +} +const me = { + writeUnknownFields: !0, + writerFactory: () => new Ye() +}; +function Ze(a) { + return a ? Object.assign(Object.assign({}, me), a) : me; +} +class Ye { + constructor(e) { + this.stack = [], this.textEncoder = e ?? new TextEncoder(), this.chunks = [], this.buf = []; + } + /** + * Return all bytes written and reset this writer. + */ + finish() { + this.chunks.push(new Uint8Array(this.buf)); + let e = 0; + for (let r = 0; r < this.chunks.length; r++) + e += this.chunks[r].length; + let t = new Uint8Array(e), i = 0; + for (let r = 0; r < this.chunks.length; r++) + t.set(this.chunks[r], i), i += this.chunks[r].length; + return this.chunks = [], t; + } + /** + * Start a new fork for length-delimited data like a message + * or a packed repeated field. + * + * Must be joined later with `join()`. + */ + fork() { + return this.stack.push({ chunks: this.chunks, buf: this.buf }), this.chunks = [], this.buf = [], this; + } + /** + * Join the last fork. Write its length and bytes, then + * return to the previous state. + */ + join() { + let e = this.finish(), t = this.stack.pop(); + if (!t) + throw new Error("invalid state, fork stack empty"); + return this.chunks = t.chunks, this.buf = t.buf, this.uint32(e.byteLength), this.raw(e); + } + /** + * 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(e, t) { + return this.uint32((e << 3 | t) >>> 0); + } + /** + * Write a chunk of raw bytes. + */ + raw(e) { + return this.buf.length && (this.chunks.push(new Uint8Array(this.buf)), this.buf = []), this.chunks.push(e), this; + } + /** + * Write a `uint32` value, an unsigned 32 bit varint. + */ + uint32(e) { + for (_(e); e > 127; ) + this.buf.push(e & 127 | 128), e = e >>> 7; + return this.buf.push(e), this; + } + /** + * Write a `int32` value, a signed 32 bit varint. + */ + int32(e) { + return V(e), pe(e, this.buf), this; + } + /** + * Write a `bool` value, a variant. + */ + bool(e) { + return this.buf.push(e ? 1 : 0), this; + } + /** + * Write a `bytes` value, length-delimited arbitrary data. + */ + bytes(e) { + return this.uint32(e.byteLength), this.raw(e); + } + /** + * Write a `string` value, length-delimited data converted to UTF-8 text. + */ + string(e) { + let t = this.textEncoder.encode(e); + return this.uint32(t.byteLength), this.raw(t); + } + /** + * Write a `float` value, 32-bit floating point number. + */ + float(e) { + de(e); + let t = new Uint8Array(4); + return new DataView(t.buffer).setFloat32(0, e, !0), this.raw(t); + } + /** + * Write a `double` value, a 64-bit floating point number. + */ + double(e) { + let t = new Uint8Array(8); + return new DataView(t.buffer).setFloat64(0, e, !0), this.raw(t); + } + /** + * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. + */ + fixed32(e) { + _(e); + let t = new Uint8Array(4); + return new DataView(t.buffer).setUint32(0, e, !0), this.raw(t); + } + /** + * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. + */ + sfixed32(e) { + V(e); + let t = new Uint8Array(4); + return new DataView(t.buffer).setInt32(0, e, !0), this.raw(t); + } + /** + * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. + */ + sint32(e) { + return V(e), e = (e << 1 ^ e >> 31) >>> 0, pe(e, this.buf), this; + } + /** + * Write a `fixed64` value, a signed, fixed-length 64-bit integer. + */ + sfixed64(e) { + let t = new Uint8Array(8), i = new DataView(t.buffer), r = N.from(e); + return i.setInt32(0, r.lo, !0), i.setInt32(4, r.hi, !0), this.raw(t); + } + /** + * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. + */ + fixed64(e) { + let t = new Uint8Array(8), i = new DataView(t.buffer), r = I.from(e); + return i.setInt32(0, r.lo, !0), i.setInt32(4, r.hi, !0), this.raw(t); + } + /** + * Write a `int64` value, a signed 64-bit varint. + */ + int64(e) { + let t = N.from(e); + return J(t.lo, t.hi, this.buf), this; + } + /** + * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. + */ + sint64(e) { + let t = N.from(e), i = t.hi >> 31, r = t.lo << 1 ^ i, n = (t.hi << 1 | t.lo >>> 31) ^ i; + return J(r, n, this.buf), this; + } + /** + * Write a `uint64` value, an unsigned 64-bit varint. + */ + uint64(e) { + let t = I.from(e); + return J(t.lo, t.hi, this.buf), this; + } +} +const ke = { + emitDefaultValues: !1, + enumAsInteger: !1, + useProtoFieldName: !1, + prettySpaces: 0 +}, be = { + ignoreUnknownFields: !1 +}; +function qe(a) { + return a ? Object.assign(Object.assign({}, be), a) : be; +} +function ze(a) { + return a ? Object.assign(Object.assign({}, ke), a) : ke; +} +const Ee = /* @__PURE__ */ Symbol.for("protobuf-ts/message-type"); +function Te(a) { + let e = !1; + const t = []; + for (let i = 0; i < a.length; i++) { + let r = a.charAt(i); + r == "_" ? e = !0 : /\d/.test(r) ? (t.push(r), e = !0) : e ? (t.push(r.toUpperCase()), e = !1) : i == 0 ? t.push(r.toLowerCase()) : t.push(r); + } + return t.join(""); +} +var c; +(function(a) { + a[a.DOUBLE = 1] = "DOUBLE", a[a.FLOAT = 2] = "FLOAT", a[a.INT64 = 3] = "INT64", a[a.UINT64 = 4] = "UINT64", a[a.INT32 = 5] = "INT32", a[a.FIXED64 = 6] = "FIXED64", a[a.FIXED32 = 7] = "FIXED32", a[a.BOOL = 8] = "BOOL", a[a.STRING = 9] = "STRING", a[a.BYTES = 12] = "BYTES", a[a.UINT32 = 13] = "UINT32", a[a.SFIXED32 = 15] = "SFIXED32", a[a.SFIXED64 = 16] = "SFIXED64", a[a.SINT32 = 17] = "SINT32", a[a.SINT64 = 18] = "SINT64"; +})(c || (c = {})); +var F; +(function(a) { + a[a.BIGINT = 0] = "BIGINT", a[a.STRING = 1] = "STRING", a[a.NUMBER = 2] = "NUMBER"; +})(F || (F = {})); +var S; +(function(a) { + a[a.NO = 0] = "NO", a[a.PACKED = 1] = "PACKED", a[a.UNPACKED = 2] = "UNPACKED"; +})(S || (S = {})); +function Qe(a) { + var e, t, i, r; + return a.localName = (e = a.localName) !== null && e !== void 0 ? e : Te(a.name), a.jsonName = (t = a.jsonName) !== null && t !== void 0 ? t : Te(a.name), a.repeat = (i = a.repeat) !== null && i !== void 0 ? i : S.NO, a.opt = (r = a.opt) !== null && r !== void 0 ? r : a.repeat || a.oneof ? !1 : a.kind == "message", a; +} +function He(a) { + if (typeof a != "object" || a === null || !a.hasOwnProperty("oneofKind")) + return !1; + switch (typeof a.oneofKind) { + case "string": + return a[a.oneofKind] === void 0 ? !1 : Object.keys(a).length == 2; + case "undefined": + return Object.keys(a).length == 1; + default: + return !1; + } +} +class ve { + constructor(e) { + var t; + this.fields = (t = e.fields) !== null && t !== void 0 ? t : []; + } + prepare() { + if (this.data) + return; + const e = [], t = [], i = []; + for (let r of this.fields) + if (r.oneof) + i.includes(r.oneof) || (i.push(r.oneof), e.push(r.oneof), t.push(r.oneof)); + else + switch (t.push(r.localName), r.kind) { + case "scalar": + case "enum": + (!r.opt || r.repeat) && e.push(r.localName); + break; + case "message": + r.repeat && e.push(r.localName); + break; + case "map": + e.push(r.localName); + break; + } + this.data = { req: e, known: t, oneofs: Object.values(i) }; + } + /** + * Is the argument a valid message as specified by the + * reflection information? + * + * Checks all field types recursively. The `depth` + * specifies how deep into the structure the check will be. + * + * With a depth of 0, only the presence of fields + * is checked. + * + * With a depth of 1 or more, the field types are checked. + * + * With a depth of 2 or more, the members of map, repeated + * and message fields are checked. + * + * Message fields will be checked recursively with depth - 1. + * + * The number of map entries / repeated values being checked + * is < depth. + */ + is(e, t, i = !1) { + if (t < 0) + return !0; + if (e == null || typeof e != "object") + return !1; + this.prepare(); + let r = Object.keys(e), n = this.data; + if (r.length < n.req.length || n.req.some((o) => !r.includes(o)) || !i && r.some((o) => !n.known.includes(o))) + return !1; + if (t < 1) + return !0; + for (const o of n.oneofs) { + const s = e[o]; + if (!He(s)) + return !1; + if (s.oneofKind === void 0) + continue; + const l = this.fields.find((f) => f.localName === s.oneofKind); + if (!l || !this.field(s[s.oneofKind], l, i, t)) + return !1; + } + for (const o of this.fields) + if (o.oneof === void 0 && !this.field(e[o.localName], o, i, t)) + return !1; + return !0; + } + field(e, t, i, r) { + let n = t.repeat; + switch (t.kind) { + case "scalar": + return e === void 0 ? t.opt : n ? this.scalars(e, t.T, r, t.L) : this.scalar(e, t.T, t.L); + case "enum": + return e === void 0 ? t.opt : n ? this.scalars(e, c.INT32, r) : this.scalar(e, c.INT32); + case "message": + return e === void 0 ? !0 : n ? this.messages(e, t.T(), i, r) : this.message(e, t.T(), i, r); + case "map": + if (typeof e != "object" || e === null) + return !1; + if (r < 2) + return !0; + if (!this.mapKeys(e, t.K, r)) + return !1; + switch (t.V.kind) { + case "scalar": + return this.scalars(Object.values(e), t.V.T, r, t.V.L); + case "enum": + return this.scalars(Object.values(e), c.INT32, r); + case "message": + return this.messages(Object.values(e), t.V.T(), i, r); + } + break; + } + return !0; + } + message(e, t, i, r) { + return i ? t.isAssignable(e, r) : t.is(e, r); + } + messages(e, t, i, r) { + if (!Array.isArray(e)) + return !1; + if (r < 2) + return !0; + if (i) { + for (let n = 0; n < e.length && n < r; n++) + if (!t.isAssignable(e[n], r - 1)) + return !1; + } else + for (let n = 0; n < e.length && n < r; n++) + if (!t.is(e[n], r - 1)) + return !1; + return !0; + } + scalar(e, t, i) { + let r = typeof e; + switch (t) { + case c.UINT64: + case c.FIXED64: + case c.INT64: + case c.SFIXED64: + case c.SINT64: + switch (i) { + case F.BIGINT: + return r == "bigint"; + case F.NUMBER: + return r == "number" && !isNaN(e); + default: + return r == "string"; + } + case c.BOOL: + return r == "boolean"; + case c.STRING: + return r == "string"; + case c.BYTES: + return e instanceof Uint8Array; + case c.DOUBLE: + case c.FLOAT: + return r == "number" && !isNaN(e); + default: + return r == "number" && Number.isInteger(e); + } + } + scalars(e, t, i, r) { + if (!Array.isArray(e)) + return !1; + if (i < 2) + return !0; + if (Array.isArray(e)) { + for (let n = 0; n < e.length && n < i; n++) + if (!this.scalar(e[n], t, r)) + return !1; + } + return !0; + } + mapKeys(e, t, i) { + let r = Object.keys(e); + switch (t) { + case c.INT32: + case c.FIXED32: + case c.SFIXED32: + case c.SINT32: + case c.UINT32: + return this.scalars(r.slice(0, i).map((n) => parseInt(n)), t, i); + case c.BOOL: + return this.scalars(r.slice(0, i).map((n) => n == "true" ? !0 : n == "false" ? !1 : n), t, i); + default: + return this.scalars(r, t, i, F.STRING); + } + } +} +function D(a, e) { + switch (e) { + case F.BIGINT: + return a.toBigInt(); + case F.NUMBER: + return a.toNumber(); + default: + return a.toString(); + } +} +class et { + constructor(e) { + this.info = e; + } + prepare() { + var e; + if (this.fMap === void 0) { + this.fMap = {}; + const t = (e = this.info.fields) !== null && e !== void 0 ? e : []; + for (const i of t) + this.fMap[i.name] = i, this.fMap[i.jsonName] = i, this.fMap[i.localName] = i; + } + } + // Cannot parse JSON for #. + assert(e, t, i) { + if (!e) { + let r = Be(i); + throw (r == "number" || r == "boolean") && (r = i.toString()), new Error(`Cannot parse JSON ${r} for ${this.info.typeName}#${t}`); + } + } + /** + * Reads a message from canonical JSON format into the target message. + * + * 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. + */ + read(e, t, i) { + this.prepare(); + const r = []; + for (const [n, o] of Object.entries(e)) { + const s = this.fMap[n]; + if (!s) { + if (!i.ignoreUnknownFields) + throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${n}`); + continue; + } + const l = s.localName; + let f; + if (s.oneof) { + if (o === null && (s.kind !== "enum" || s.T()[0] !== "google.protobuf.NullValue")) + continue; + if (r.includes(s.oneof)) + throw new Error(`Multiple members of the oneof group "${s.oneof}" of ${this.info.typeName} are present in JSON.`); + r.push(s.oneof), f = t[s.oneof] = { + oneofKind: l + }; + } else + f = t; + if (s.kind == "map") { + if (o === null) + continue; + this.assert(Ve(o), s.name, o); + const h = f[l]; + for (const [k, p] of Object.entries(o)) { + this.assert(p !== null, s.name + " map value", null); + let R; + switch (s.V.kind) { + case "message": + R = s.V.T().internalJsonRead(p, i); + break; + case "enum": + if (R = this.enum(s.V.T(), p, s.name, i.ignoreUnknownFields), R === !1) + continue; + break; + case "scalar": + R = this.scalar(p, s.V.T, s.V.L, s.name); + break; + } + this.assert(R !== void 0, s.name + " map value", p); + let E = k; + s.K == c.BOOL && (E = E == "true" ? !0 : E == "false" ? !1 : E), E = this.scalar(E, s.K, F.STRING, s.name).toString(), h[E] = R; + } + } else if (s.repeat) { + if (o === null) + continue; + this.assert(Array.isArray(o), s.name, o); + const h = f[l]; + for (const k of o) { + this.assert(k !== null, s.name, null); + let p; + switch (s.kind) { + case "message": + p = s.T().internalJsonRead(k, i); + break; + case "enum": + if (p = this.enum(s.T(), k, s.name, i.ignoreUnknownFields), p === !1) + continue; + break; + case "scalar": + p = this.scalar(k, s.T, s.L, s.name); + break; + } + this.assert(p !== void 0, s.name, o), h.push(p); + } + } else + switch (s.kind) { + case "message": + if (o === null && s.T().typeName != "google.protobuf.Value") { + this.assert(s.oneof === void 0, s.name + " (oneof member)", null); + continue; + } + f[l] = s.T().internalJsonRead(o, i, f[l]); + break; + case "enum": + if (o === null) + continue; + let h = this.enum(s.T(), o, s.name, i.ignoreUnknownFields); + if (h === !1) + continue; + f[l] = h; + break; + case "scalar": + if (o === null) + continue; + f[l] = this.scalar(o, s.T, s.L, s.name); + break; + } + } + } + /** + * Returns `false` for unrecognized string representations. + * + * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`). + */ + enum(e, t, i, r) { + if (e[0] == "google.protobuf.NullValue" && g(t === null || t === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${i}, enum ${e[0]} only accepts null.`), t === null) + return 0; + switch (typeof t) { + case "number": + return g(Number.isInteger(t), `Unable to parse field ${this.info.typeName}#${i}, enum can only be integral number, got ${t}.`), t; + case "string": + let n = t; + e[2] && t.substring(0, e[2].length) === e[2] && (n = t.substring(e[2].length)); + let o = e[1][n]; + return typeof o > "u" && r ? !1 : (g(typeof o == "number", `Unable to parse field ${this.info.typeName}#${i}, enum ${e[0]} has no value for "${t}".`), o); + } + g(!1, `Unable to parse field ${this.info.typeName}#${i}, cannot parse enum value from ${typeof t}".`); + } + scalar(e, t, i, r) { + let n; + try { + switch (t) { + // 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 c.DOUBLE: + case c.FLOAT: + if (e === null) + return 0; + if (e === "NaN") + return Number.NaN; + if (e === "Infinity") + return Number.POSITIVE_INFINITY; + if (e === "-Infinity") + return Number.NEGATIVE_INFINITY; + if (e === "") { + n = "empty string"; + break; + } + if (typeof e == "string" && e.trim().length !== e.length) { + n = "extra whitespace"; + break; + } + if (typeof e != "string" && typeof e != "number") + break; + let o = Number(e); + if (Number.isNaN(o)) { + n = "not a number"; + break; + } + if (!Number.isFinite(o)) { + n = "too large or small"; + break; + } + return t == c.FLOAT && de(o), o; + // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. + case c.INT32: + case c.FIXED32: + case c.SFIXED32: + case c.SINT32: + case c.UINT32: + if (e === null) + return 0; + let s; + if (typeof e == "number" ? s = e : e === "" ? n = "empty string" : typeof e == "string" && (e.trim().length !== e.length ? n = "extra whitespace" : s = Number(e)), s === void 0) + break; + return t == c.UINT32 ? _(s) : V(s), s; + // int64, fixed64, uint64: JSON value will be a decimal string. Either numbers or strings are accepted. + case c.INT64: + case c.SFIXED64: + case c.SINT64: + if (e === null) + return D(N.ZERO, i); + if (typeof e != "number" && typeof e != "string") + break; + return D(N.from(e), i); + case c.FIXED64: + case c.UINT64: + if (e === null) + return D(I.ZERO, i); + if (typeof e != "number" && typeof e != "string") + break; + return D(I.from(e), i); + // bool: + case c.BOOL: + if (e === null) + return !1; + if (typeof e != "boolean") + break; + return e; + // string: + case c.STRING: + if (e === null) + return ""; + if (typeof e != "string") { + n = "extra whitespace"; + break; + } + try { + encodeURIComponent(e); + } catch (l) { + l = "invalid UTF8"; + break; + } + return e; + // 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 c.BYTES: + if (e === null || e === "") + return new Uint8Array(0); + if (typeof e != "string") + break; + return We(e); + } + } catch (o) { + n = o.message; + } + this.assert(!1, r + (n ? " - " + n : ""), e); + } +} +class tt { + constructor(e) { + var t; + this.fields = (t = e.fields) !== null && t !== void 0 ? t : []; + } + /** + * Converts the message to a JSON object, based on the field descriptors. + */ + write(e, t) { + const i = {}, r = e; + for (const n of this.fields) { + if (!n.oneof) { + let f = this.field(n, r[n.localName], t); + f !== void 0 && (i[t.useProtoFieldName ? n.name : n.jsonName] = f); + continue; + } + const o = r[n.oneof]; + if (o.oneofKind !== n.localName) + continue; + const s = n.kind == "scalar" || n.kind == "enum" ? Object.assign(Object.assign({}, t), { emitDefaultValues: !0 }) : t; + let l = this.field(n, o[n.localName], s); + g(l !== void 0), i[t.useProtoFieldName ? n.name : n.jsonName] = l; + } + return i; + } + field(e, t, i) { + let r; + if (e.kind == "map") { + g(typeof t == "object" && t !== null); + const n = {}; + switch (e.V.kind) { + case "scalar": + for (const [l, f] of Object.entries(t)) { + const h = this.scalar(e.V.T, f, e.name, !1, !0); + g(h !== void 0), n[l.toString()] = h; + } + break; + case "message": + const o = e.V.T(); + for (const [l, f] of Object.entries(t)) { + const h = this.message(o, f, e.name, i); + g(h !== void 0), n[l.toString()] = h; + } + break; + case "enum": + const s = e.V.T(); + for (const [l, f] of Object.entries(t)) { + g(f === void 0 || typeof f == "number"); + const h = this.enum(s, f, e.name, !1, !0, i.enumAsInteger); + g(h !== void 0), n[l.toString()] = h; + } + break; + } + (i.emitDefaultValues || Object.keys(n).length > 0) && (r = n); + } else if (e.repeat) { + g(Array.isArray(t)); + const n = []; + switch (e.kind) { + case "scalar": + for (let l = 0; l < t.length; l++) { + const f = this.scalar(e.T, t[l], e.name, e.opt, !0); + g(f !== void 0), n.push(f); + } + break; + case "enum": + const o = e.T(); + for (let l = 0; l < t.length; l++) { + g(t[l] === void 0 || typeof t[l] == "number"); + const f = this.enum(o, t[l], e.name, e.opt, !0, i.enumAsInteger); + g(f !== void 0), n.push(f); + } + break; + case "message": + const s = e.T(); + for (let l = 0; l < t.length; l++) { + const f = this.message(s, t[l], e.name, i); + g(f !== void 0), n.push(f); + } + break; + } + (i.emitDefaultValues || n.length > 0 || i.emitDefaultValues) && (r = n); + } else + switch (e.kind) { + case "scalar": + r = this.scalar(e.T, t, e.name, e.opt, i.emitDefaultValues); + break; + case "enum": + r = this.enum(e.T(), t, e.name, e.opt, i.emitDefaultValues, i.enumAsInteger); + break; + case "message": + r = this.message(e.T(), t, e.name, i); + break; + } + return r; + } + /** + * Returns `null` as the default for google.protobuf.NullValue. + */ + enum(e, t, i, r, n, o) { + if (e[0] == "google.protobuf.NullValue") + return !n && !r ? void 0 : null; + if (t === void 0) { + g(r); + return; + } + if (!(t === 0 && !n && !r)) + return g(typeof t == "number"), g(Number.isInteger(t)), o || !e[1].hasOwnProperty(t) ? t : e[2] ? e[2] + e[1][t] : e[1][t]; + } + message(e, t, i, r) { + return t === void 0 ? r.emitDefaultValues ? null : void 0 : e.internalJsonWrite(t, r); + } + scalar(e, t, i, r, n) { + if (t === void 0) { + g(r); + return; + } + const o = n || r; + switch (e) { + // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. + case c.INT32: + case c.SFIXED32: + case c.SINT32: + return t === 0 ? o ? 0 : void 0 : (V(t), t); + case c.FIXED32: + case c.UINT32: + return t === 0 ? o ? 0 : void 0 : (_(t), t); + // 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 c.FLOAT: + de(t); + case c.DOUBLE: + return t === 0 ? o ? 0 : void 0 : (g(typeof t == "number"), Number.isNaN(t) ? "NaN" : t === Number.POSITIVE_INFINITY ? "Infinity" : t === Number.NEGATIVE_INFINITY ? "-Infinity" : t); + // string: + case c.STRING: + return t === "" ? o ? "" : void 0 : (g(typeof t == "string"), t); + // bool: + case c.BOOL: + return t === !1 ? o ? !1 : void 0 : (g(typeof t == "boolean"), t); + // JSON value will be a decimal string. Either numbers or strings are accepted. + case c.UINT64: + case c.FIXED64: + g(typeof t == "number" || typeof t == "string" || typeof t == "bigint"); + let s = I.from(t); + return s.isZero() && !o ? void 0 : s.toString(); + // JSON value will be a decimal string. Either numbers or strings are accepted. + case c.INT64: + case c.SFIXED64: + case c.SINT64: + g(typeof t == "number" || typeof t == "string" || typeof t == "bigint"); + let l = N.from(t); + return l.isZero() && !o ? void 0 : l.toString(); + // 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 c.BYTES: + return g(t instanceof Uint8Array), t.byteLength ? Ke(t) : o ? "" : void 0; + } + } +} +function fe(a, e = F.STRING) { + switch (a) { + case c.BOOL: + return !1; + case c.UINT64: + case c.FIXED64: + return D(I.ZERO, e); + case c.INT64: + case c.SFIXED64: + case c.SINT64: + return D(N.ZERO, e); + case c.DOUBLE: + case c.FLOAT: + return 0; + case c.BYTES: + return new Uint8Array(0); + case c.STRING: + return ""; + default: + return 0; + } +} +class nt { + constructor(e) { + this.info = e; + } + prepare() { + var e; + if (!this.fieldNoToField) { + const t = (e = this.info.fields) !== null && e !== void 0 ? e : []; + this.fieldNoToField = new Map(t.map((i) => [i.no, i])); + } + } + /** + * Reads a message from binary format into the target message. + * + * 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. + */ + read(e, t, i, r) { + this.prepare(); + const n = r === void 0 ? e.len : e.pos + r; + for (; e.pos < n; ) { + const [o, s] = e.tag(), l = this.fieldNoToField.get(o); + if (!l) { + let p = i.readUnknownField; + if (p == "throw") + throw new Error(`Unknown field ${o} (wire type ${s}) for ${this.info.typeName}`); + let R = e.skip(s); + p !== !1 && (p === !0 ? y.onRead : p)(this.info.typeName, t, o, s, R); + continue; + } + let f = t, h = l.repeat, k = l.localName; + switch (l.oneof && (f = f[l.oneof], f.oneofKind !== k && (f = t[l.oneof] = { + oneofKind: k + })), l.kind) { + case "scalar": + case "enum": + let p = l.kind == "enum" ? c.INT32 : l.T, R = l.kind == "scalar" ? l.L : void 0; + if (h) { + let W = f[k]; + if (s == u.LengthDelimited && p != c.STRING && p != c.BYTES) { + let X = e.uint32() + e.pos; + for (; e.pos < X; ) + W.push(this.scalar(e, p, R)); + } else + W.push(this.scalar(e, p, R)); + } else + f[k] = this.scalar(e, p, R); + break; + case "message": + if (h) { + let W = f[k], X = l.T().internalBinaryRead(e, e.uint32(), i); + W.push(X); + } else + f[k] = l.T().internalBinaryRead(e, e.uint32(), i, f[k]); + break; + case "map": + let [E, Ue] = this.mapEntry(l, e, i); + f[k][E] = Ue; + break; + } + } + } + /** + * Read a map field, expecting key field = 1, value field = 2 + */ + mapEntry(e, t, i) { + let r = t.uint32(), n = t.pos + r, o, s; + for (; t.pos < n; ) { + let [l, f] = t.tag(); + switch (l) { + case 1: + e.K == c.BOOL ? o = t.bool().toString() : o = this.scalar(t, e.K, F.STRING); + break; + case 2: + switch (e.V.kind) { + case "scalar": + s = this.scalar(t, e.V.T, e.V.L); + break; + case "enum": + s = t.int32(); + break; + case "message": + s = e.V.T().internalBinaryRead(t, t.uint32(), i); + break; + } + break; + default: + throw new Error(`Unknown field ${l} (wire type ${f}) in map entry for ${this.info.typeName}#${e.name}`); + } + } + if (o === void 0) { + let l = fe(e.K); + o = e.K == c.BOOL ? l.toString() : l; + } + if (s === void 0) + switch (e.V.kind) { + case "scalar": + s = fe(e.V.T, e.V.L); + break; + case "enum": + s = 0; + break; + case "message": + s = e.V.T().create(); + break; + } + return [o, s]; + } + scalar(e, t, i) { + switch (t) { + case c.INT32: + return e.int32(); + case c.STRING: + return e.string(); + case c.BOOL: + return e.bool(); + case c.DOUBLE: + return e.double(); + case c.FLOAT: + return e.float(); + case c.INT64: + return D(e.int64(), i); + case c.UINT64: + return D(e.uint64(), i); + case c.FIXED64: + return D(e.fixed64(), i); + case c.FIXED32: + return e.fixed32(); + case c.BYTES: + return e.bytes(); + case c.UINT32: + return e.uint32(); + case c.SFIXED32: + return e.sfixed32(); + case c.SFIXED64: + return D(e.sfixed64(), i); + case c.SINT32: + return e.sint32(); + case c.SINT64: + return D(e.sint64(), i); + } + } +} +class it { + constructor(e) { + this.info = e; + } + prepare() { + if (!this.fields) { + const e = this.info.fields ? this.info.fields.concat() : []; + this.fields = e.sort((t, i) => t.no - i.no); + } + } + /** + * Writes the message to binary format. + */ + write(e, t, i) { + this.prepare(); + for (const n of this.fields) { + let o, s, l = n.repeat, f = n.localName; + if (n.oneof) { + const h = e[n.oneof]; + if (h.oneofKind !== f) + continue; + o = h[f], s = !0; + } else + o = e[f], s = !1; + switch (n.kind) { + case "scalar": + case "enum": + let h = n.kind == "enum" ? c.INT32 : n.T; + if (l) + if (g(Array.isArray(o)), l == S.PACKED) + this.packed(t, h, n.no, o); + else + for (const k of o) + this.scalar(t, h, n.no, k, !0); + else o === void 0 ? g(n.opt) : this.scalar(t, h, n.no, o, s || n.opt); + break; + case "message": + if (l) { + g(Array.isArray(o)); + for (const k of o) + this.message(t, i, n.T(), n.no, k); + } else + this.message(t, i, n.T(), n.no, o); + break; + case "map": + g(typeof o == "object" && o !== null); + for (const [k, p] of Object.entries(o)) + this.mapEntry(t, i, n, k, p); + break; + } + } + let r = i.writeUnknownFields; + r !== !1 && (r === !0 ? y.onWrite : r)(this.info.typeName, e, t); + } + mapEntry(e, t, i, r, n) { + e.tag(i.no, u.LengthDelimited), e.fork(); + let o = r; + switch (i.K) { + case c.INT32: + case c.FIXED32: + case c.UINT32: + case c.SFIXED32: + case c.SINT32: + o = Number.parseInt(r); + break; + case c.BOOL: + g(r == "true" || r == "false"), o = r == "true"; + break; + } + switch (this.scalar(e, i.K, 1, o, !0), i.V.kind) { + case "scalar": + this.scalar(e, i.V.T, 2, n, !0); + break; + case "enum": + this.scalar(e, c.INT32, 2, n, !0); + break; + case "message": + this.message(e, t, i.V.T(), 2, n); + break; + } + e.join(); + } + message(e, t, i, r, n) { + n !== void 0 && (i.internalBinaryWrite(n, e.tag(r, u.LengthDelimited).fork(), t), e.join()); + } + /** + * Write a single scalar value. + */ + scalar(e, t, i, r, n) { + let [o, s, l] = this.scalarInfo(t, r); + (!l || n) && (e.tag(i, o), e[s](r)); + } + /** + * Write an array of scalar values in packed format. + */ + packed(e, t, i, r) { + if (!r.length) + return; + g(t !== c.BYTES && t !== c.STRING), e.tag(i, u.LengthDelimited), e.fork(); + let [, n] = this.scalarInfo(t); + for (let o = 0; o < r.length; o++) + e[n](r[o]); + e.join(); + } + /** + * Get information for writing a scalar value. + * + * Returns tuple: + * [0]: appropriate WireType + * [1]: name of the appropriate method of IBinaryWriter + * [2]: whether the given value is a default value + * + * If argument `value` is omitted, [2] is always false. + */ + scalarInfo(e, t) { + let i = u.Varint, r, n = t === void 0, o = t === 0; + switch (e) { + case c.INT32: + r = "int32"; + break; + case c.STRING: + o = n || !t.length, i = u.LengthDelimited, r = "string"; + break; + case c.BOOL: + o = t === !1, r = "bool"; + break; + case c.UINT32: + r = "uint32"; + break; + case c.DOUBLE: + i = u.Bit64, r = "double"; + break; + case c.FLOAT: + i = u.Bit32, r = "float"; + break; + case c.INT64: + o = n || N.from(t).isZero(), r = "int64"; + break; + case c.UINT64: + o = n || I.from(t).isZero(), r = "uint64"; + break; + case c.FIXED64: + o = n || I.from(t).isZero(), i = u.Bit64, r = "fixed64"; + break; + case c.BYTES: + o = n || !t.byteLength, i = u.LengthDelimited, r = "bytes"; + break; + case c.FIXED32: + i = u.Bit32, r = "fixed32"; + break; + case c.SFIXED32: + i = u.Bit32, r = "sfixed32"; + break; + case c.SFIXED64: + o = n || N.from(t).isZero(), i = u.Bit64, r = "sfixed64"; + break; + case c.SINT32: + r = "sint32"; + break; + case c.SINT64: + o = n || N.from(t).isZero(), r = "sint64"; + break; + } + return [i, r, n || o]; + } +} +function rt(a) { + const e = a.messagePrototype ? Object.create(a.messagePrototype) : Object.defineProperty({}, Ee, { value: a }); + for (let t of a.fields) { + let i = t.localName; + if (!t.opt) + if (t.oneof) + e[t.oneof] = { oneofKind: void 0 }; + else if (t.repeat) + e[i] = []; + else + switch (t.kind) { + case "scalar": + e[i] = fe(t.T, t.L); + break; + case "enum": + e[i] = 0; + break; + case "map": + e[i] = {}; + break; + } + } + return e; +} +function m(a, e, t) { + let i, r = t, n; + for (let o of a.fields) { + let s = o.localName; + if (o.oneof) { + const l = r[o.oneof]; + if (l?.oneofKind == null) + continue; + if (i = l[s], n = e[o.oneof], n.oneofKind = l.oneofKind, i == null) { + delete n[s]; + continue; + } + } else if (i = r[s], n = e, i == null) + continue; + switch (o.repeat && (n[s].length = i.length), o.kind) { + case "scalar": + case "enum": + if (o.repeat) + for (let f = 0; f < i.length; f++) + n[s][f] = i[f]; + else + n[s] = i; + break; + case "message": + let l = o.T(); + if (o.repeat) + for (let f = 0; f < i.length; f++) + n[s][f] = l.create(i[f]); + else n[s] === void 0 ? n[s] = l.create(i) : l.mergePartial(n[s], i); + break; + case "map": + switch (o.V.kind) { + case "scalar": + case "enum": + Object.assign(n[s], i); + break; + case "message": + let f = o.V.T(); + for (let h of Object.keys(i)) + n[s][h] = f.create(i[h]); + break; + } + break; + } + } +} +function at(a, e, t) { + if (e === t) + return !0; + if (!e || !t) + return !1; + for (let i of a.fields) { + let r = i.localName, n = i.oneof ? e[i.oneof][r] : e[r], o = i.oneof ? t[i.oneof][r] : t[r]; + switch (i.kind) { + case "enum": + case "scalar": + let s = i.kind == "enum" ? c.INT32 : i.T; + if (!(i.repeat ? we(s, n, o) : Oe(s, n, o))) + return !1; + break; + case "map": + if (!(i.V.kind == "message" ? Ne(i.V.T(), j(n), j(o)) : we(i.V.kind == "enum" ? c.INT32 : i.V.T, j(n), j(o)))) + return !1; + break; + case "message": + let l = i.T(); + if (!(i.repeat ? Ne(l, n, o) : l.equals(n, o))) + return !1; + break; + } + } + return !0; +} +const j = Object.values; +function Oe(a, e, t) { + if (e === t) + return !0; + if (a !== c.BYTES) + return !1; + let i = e, r = t; + if (i.length !== r.length) + return !1; + for (let n = 0; n < i.length; n++) + if (i[n] != r[n]) + return !1; + return !0; +} +function we(a, e, t) { + if (e.length !== t.length) + return !1; + for (let i = 0; i < e.length; i++) + if (!Oe(a, e[i], t[i])) + return !1; + return !0; +} +function Ne(a, e, t) { + if (e.length !== t.length) + return !1; + for (let i = 0; i < e.length; i++) + if (!a.equals(e[i], t[i])) + return !1; + return !0; +} +const Le = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})), st = Le[Ee] = {}; +class T { + constructor(e, t, i) { + this.defaultCheckDepth = 16, this.typeName = e, this.fields = t.map(Qe), this.options = i ?? {}, st.value = this, this.messagePrototype = Object.create(null, Le), this.refTypeCheck = new ve(this), this.refJsonReader = new et(this), this.refJsonWriter = new tt(this), this.refBinReader = new nt(this), this.refBinWriter = new it(this); + } + create(e) { + let t = rt(this); + return e !== void 0 && m(this, t, e), t; + } + /** + * Clone the message. + * + * Unknown fields are discarded. + */ + clone(e) { + let t = this.create(); + return m(this, t, e), t; + } + /** + * Determines whether two message of the same type have the same field values. + * Checks for deep equality, traversing repeated fields, oneof groups, maps + * and messages recursively. + * Will also return true if both messages are `undefined`. + */ + equals(e, t) { + return at(this, e, t); + } + /** + * Is the given value assignable to our message type + * and contains no [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)? + */ + is(e, t = this.defaultCheckDepth) { + return this.refTypeCheck.is(e, t, !1); + } + /** + * Is the given value assignable to our message type, + * regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)? + */ + isAssignable(e, t = this.defaultCheckDepth) { + return this.refTypeCheck.is(e, t, !0); + } + /** + * Copy partial data into the target message. + */ + mergePartial(e, t) { + m(this, e, t); + } + /** + * Create a new message from binary format. + */ + fromBinary(e, t) { + let i = _e(t); + return this.internalBinaryRead(i.readerFactory(e), e.byteLength, i); + } + /** + * Read a new message from a JSON value. + */ + fromJson(e, t) { + return this.internalJsonRead(e, qe(t)); + } + /** + * Read a new message from a JSON string. + * This is equivalent to `T.fromJson(JSON.parse(json))`. + */ + fromJsonString(e, t) { + let i = JSON.parse(e); + return this.fromJson(i, t); + } + /** + * Write the message to canonical JSON value. + */ + toJson(e, t) { + return this.internalJsonWrite(e, ze(t)); + } + /** + * Convert the message to canonical JSON string. + * This is equivalent to `JSON.stringify(T.toJson(t))` + */ + toJsonString(e, t) { + var i; + let r = this.toJson(e, t); + return JSON.stringify(r, null, (i = t?.prettySpaces) !== null && i !== void 0 ? i : 0); + } + /** + * Write the message to binary format. + */ + toBinary(e, t) { + let i = Ze(t); + return this.internalBinaryWrite(e, i.writerFactory(), i).finish(); + } + /** + * This is an internal method. If you just want to read a message from + * JSON, use `fromJson()` or `fromJsonString()`. + * + * Reads JSON value and merges the fields into the target + * according to protobuf rules. If the target is omitted, + * a new instance is created first. + */ + internalJsonRead(e, t, i) { + if (e !== null && typeof e == "object" && !Array.isArray(e)) { + let r = i ?? this.create(); + return this.refJsonReader.read(e, r, t), r; + } + throw new Error(`Unable to parse message ${this.typeName} from JSON ${Be(e)}.`); + } + /** + * This is an internal method. If you just want to write a message + * to JSON, use `toJson()` or `toJsonString(). + * + * Writes JSON value and returns it. + */ + internalJsonWrite(e, t) { + return this.refJsonWriter.write(e, t); + } + /** + * This is an internal method. If you just want to write a message + * in binary format, use `toBinary()`. + * + * Serializes the message in binary format and appends it to the given + * writer. Returns passed writer. + */ + internalBinaryWrite(e, t, i) { + return this.refBinWriter.write(e, t, i), t; + } + /** + * This is an internal method. If you just want to read a message from + * binary data, use `fromBinary()`. + * + * Reads data from binary format and merges the fields into + * the target according to protobuf rules. If the target is + * omitted, a new instance is created first. + */ + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(); + return this.refBinReader.read(e, n, i, t), n; + } +} +var ue; +(function(a) { + a[a.NULL_VALUE = 0] = "NULL_VALUE"; +})(ue || (ue = {})); +class ot extends T { + constructor() { + super("shared.Struct", [ + { no: 1, name: "fields", kind: "map", K: 9, V: { kind: "message", T: () => B } } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.fields = {}, e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* map fields */ + 1: + this.binaryReadMap1(n.fields, e, i); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + binaryReadMap1(e, t, i) { + let r = t.uint32(), n = t.pos + r, o, s; + for (; t.pos < n; ) { + let [l, f] = t.tag(); + switch (l) { + case 1: + o = t.string(); + break; + case 2: + s = B.internalBinaryRead(t, t.uint32(), i); + break; + default: + throw new globalThis.Error("unknown map entry field for shared.Struct.fields"); + } + } + e[o ?? ""] = s ?? B.create(); + } + internalBinaryWrite(e, t, i) { + for (let n of globalThis.Object.keys(e.fields)) + t.tag(1, u.LengthDelimited).fork().tag(1, u.LengthDelimited).string(n), t.tag(2, u.LengthDelimited).fork(), B.internalBinaryWrite(e.fields[n], t, i), t.join().join(); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const G = new ot(); +class lt extends T { + constructor() { + super("shared.Value", [ + { no: 1, name: "null_value", kind: "enum", oneof: "kind", T: () => ["shared.NullValue", ue] }, + { + no: 2, + name: "number_value", + kind: "scalar", + oneof: "kind", + T: 1 + /*ScalarType.DOUBLE*/ + }, + { + no: 3, + name: "string_value", + kind: "scalar", + oneof: "kind", + T: 9 + /*ScalarType.STRING*/ + }, + { + no: 4, + name: "bool_value", + kind: "scalar", + oneof: "kind", + T: 8 + /*ScalarType.BOOL*/ + }, + { no: 5, name: "struct_value", kind: "message", oneof: "kind", T: () => G }, + { no: 6, name: "list_value", kind: "message", oneof: "kind", T: () => Z } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.kind = { oneofKind: void 0 }, e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* shared.NullValue null_value */ + 1: + n.kind = { + oneofKind: "nullValue", + nullValue: e.int32() + }; + break; + case /* double number_value */ + 2: + n.kind = { + oneofKind: "numberValue", + numberValue: e.double() + }; + break; + case /* string string_value */ + 3: + n.kind = { + oneofKind: "stringValue", + stringValue: e.string() + }; + break; + case /* bool bool_value */ + 4: + n.kind = { + oneofKind: "boolValue", + boolValue: e.bool() + }; + break; + case /* shared.Struct struct_value */ + 5: + n.kind = { + oneofKind: "structValue", + structValue: G.internalBinaryRead(e, e.uint32(), i, n.kind.structValue) + }; + break; + case /* shared.ListValue list_value */ + 6: + n.kind = { + oneofKind: "listValue", + listValue: Z.internalBinaryRead(e, e.uint32(), i, n.kind.listValue) + }; + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.kind.oneofKind === "nullValue" && t.tag(1, u.Varint).int32(e.kind.nullValue), e.kind.oneofKind === "numberValue" && t.tag(2, u.Bit64).double(e.kind.numberValue), e.kind.oneofKind === "stringValue" && t.tag(3, u.LengthDelimited).string(e.kind.stringValue), e.kind.oneofKind === "boolValue" && t.tag(4, u.Varint).bool(e.kind.boolValue), e.kind.oneofKind === "structValue" && G.internalBinaryWrite(e.kind.structValue, t.tag(5, u.LengthDelimited).fork(), i).join(), e.kind.oneofKind === "listValue" && Z.internalBinaryWrite(e.kind.listValue, t.tag(6, u.LengthDelimited).fork(), i).join(); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const B = new lt(); +class ft extends T { + constructor() { + super("shared.ListValue", [ + { no: 1, name: "values", kind: "message", repeat: 2, T: () => B } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.values = [], e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* repeated shared.Value values */ + 1: + n.values.push(B.internalBinaryRead(e, e.uint32(), i)); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + for (let n = 0; n < e.values.length; n++) + B.internalBinaryWrite(e.values[n], t.tag(1, u.LengthDelimited).fork(), i).join(); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const Z = new ft(); +class ut extends T { + constructor() { + super("shared.Translation", [ + { + no: 1, + name: "code", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + }, + { + no: 2, + name: "content", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.code = "", t.content = "", e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* string code */ + 1: + n.code = e.string(); + break; + case /* string content */ + 2: + n.content = e.string(); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.code !== "" && t.tag(1, u.LengthDelimited).string(e.code), e.content !== "" && t.tag(2, u.LengthDelimited).string(e.content); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const d = new ut(); +class ct extends T { + constructor() { + super("shared.FlowType", [ + { + no: 1, + name: "identifier", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + }, + { no: 2, name: "settings", kind: "message", repeat: 2, T: () => Y }, + { + no: 3, + name: "input_type_identifier", + kind: "scalar", + opt: !0, + T: 9 + /*ScalarType.STRING*/ + }, + { + no: 4, + name: "return_type_identifier", + kind: "scalar", + opt: !0, + T: 9 + /*ScalarType.STRING*/ + }, + { + no: 5, + name: "editable", + kind: "scalar", + T: 8 + /*ScalarType.BOOL*/ + }, + { no: 6, name: "name", kind: "message", repeat: 2, T: () => d }, + { no: 7, name: "description", kind: "message", repeat: 2, T: () => d }, + { no: 8, name: "documentation", kind: "message", repeat: 2, T: () => d }, + { no: 9, name: "display_message", kind: "message", repeat: 2, T: () => d }, + { no: 10, name: "alias", kind: "message", repeat: 2, T: () => d }, + { + no: 11, + name: "version", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.identifier = "", t.settings = [], t.editable = !1, t.name = [], t.description = [], t.documentation = [], t.displayMessage = [], t.alias = [], t.version = "", e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* string identifier */ + 1: + n.identifier = e.string(); + break; + case /* repeated shared.FlowTypeSetting settings */ + 2: + n.settings.push(Y.internalBinaryRead(e, e.uint32(), i)); + break; + case /* optional string input_type_identifier */ + 3: + n.inputTypeIdentifier = e.string(); + break; + case /* optional string return_type_identifier */ + 4: + n.returnTypeIdentifier = e.string(); + break; + case /* bool editable */ + 5: + n.editable = e.bool(); + break; + case /* repeated shared.Translation name */ + 6: + n.name.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated shared.Translation description */ + 7: + n.description.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated shared.Translation documentation */ + 8: + n.documentation.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated shared.Translation display_message */ + 9: + n.displayMessage.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated shared.Translation alias */ + 10: + n.alias.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* string version */ + 11: + n.version = e.string(); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.identifier !== "" && t.tag(1, u.LengthDelimited).string(e.identifier); + for (let n = 0; n < e.settings.length; n++) + Y.internalBinaryWrite(e.settings[n], t.tag(2, u.LengthDelimited).fork(), i).join(); + e.inputTypeIdentifier !== void 0 && t.tag(3, u.LengthDelimited).string(e.inputTypeIdentifier), e.returnTypeIdentifier !== void 0 && t.tag(4, u.LengthDelimited).string(e.returnTypeIdentifier), e.editable !== !1 && t.tag(5, u.Varint).bool(e.editable); + for (let n = 0; n < e.name.length; n++) + d.internalBinaryWrite(e.name[n], t.tag(6, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.description.length; n++) + d.internalBinaryWrite(e.description[n], t.tag(7, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.documentation.length; n++) + d.internalBinaryWrite(e.documentation[n], t.tag(8, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.displayMessage.length; n++) + d.internalBinaryWrite(e.displayMessage[n], t.tag(9, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.alias.length; n++) + d.internalBinaryWrite(e.alias[n], t.tag(10, u.LengthDelimited).fork(), i).join(); + e.version !== "" && t.tag(11, u.LengthDelimited).string(e.version); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const ht = new ct(); +class dt extends T { + constructor() { + super("shared.FlowTypeSetting", [ + { + no: 1, + name: "identifier", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + }, + { + no: 2, + name: "unique", + kind: "scalar", + T: 8 + /*ScalarType.BOOL*/ + }, + { + no: 3, + name: "data_type_identifier", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + }, + { no: 4, name: "default_value", kind: "message", T: () => B }, + { no: 5, name: "name", kind: "message", repeat: 2, T: () => d }, + { no: 6, name: "description", kind: "message", repeat: 2, T: () => d } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.identifier = "", t.unique = !1, t.dataTypeIdentifier = "", t.name = [], t.description = [], e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* string identifier */ + 1: + n.identifier = e.string(); + break; + case /* bool unique */ + 2: + n.unique = e.bool(); + break; + case /* string data_type_identifier */ + 3: + n.dataTypeIdentifier = e.string(); + break; + case /* optional shared.Value default_value */ + 4: + n.defaultValue = B.internalBinaryRead(e, e.uint32(), i, n.defaultValue); + break; + case /* repeated shared.Translation name */ + 5: + n.name.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated shared.Translation description */ + 6: + n.description.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.identifier !== "" && t.tag(1, u.LengthDelimited).string(e.identifier), e.unique !== !1 && t.tag(2, u.Varint).bool(e.unique), e.dataTypeIdentifier !== "" && t.tag(3, u.LengthDelimited).string(e.dataTypeIdentifier), e.defaultValue && B.internalBinaryWrite(e.defaultValue, t.tag(4, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.name.length; n++) + d.internalBinaryWrite(e.name[n], t.tag(5, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.description.length; n++) + d.internalBinaryWrite(e.description[n], t.tag(6, u.LengthDelimited).fork(), i).join(); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const Y = new dt(); +var ce; +(function(a) { + a[a.UNKNOWN = 0] = "UNKNOWN", a[a.PRIMITIVE = 1] = "PRIMITIVE", a[a.TYPE = 2] = "TYPE", a[a.OBJECT = 3] = "OBJECT", a[a.DATATYPE = 4] = "DATATYPE", a[a.ARRAY = 5] = "ARRAY", a[a.ERROR = 6] = "ERROR", a[a.NODE = 7] = "NODE"; +})(ce || (ce = {})); +var he; +(function(a) { + a[a.UNKNOWN = 0] = "UNKNOWN", a[a.AND = 1] = "AND", a[a.OR = 2] = "OR"; +})(he || (he = {})); +class yt extends T { + constructor() { + super("shared.DefinitionDataType", [ + { no: 1, name: "variant", kind: "enum", T: () => ["shared.DefinitionDataType.Variant", ce] }, + { + no: 2, + name: "identifier", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + }, + { no: 3, name: "name", kind: "message", repeat: 2, T: () => d }, + { no: 4, name: "display_message", kind: "message", repeat: 2, T: () => d }, + { no: 5, name: "alias", kind: "message", repeat: 2, T: () => d }, + { no: 6, name: "rules", kind: "message", repeat: 2, T: () => q }, + { + no: 7, + name: "generic_keys", + kind: "scalar", + repeat: 2, + T: 9 + /*ScalarType.STRING*/ + }, + { + no: 8, + name: "version", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.variant = 0, t.identifier = "", t.name = [], t.displayMessage = [], t.alias = [], t.rules = [], t.genericKeys = [], t.version = "", e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* shared.DefinitionDataType.Variant variant */ + 1: + n.variant = e.int32(); + break; + case /* string identifier */ + 2: + n.identifier = e.string(); + break; + case /* repeated shared.Translation name */ + 3: + n.name.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated shared.Translation display_message */ + 4: + n.displayMessage.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated shared.Translation alias */ + 5: + n.alias.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated shared.DefinitionDataTypeRule rules */ + 6: + n.rules.push(q.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated string generic_keys */ + 7: + n.genericKeys.push(e.string()); + break; + case /* string version */ + 8: + n.version = e.string(); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.variant !== 0 && t.tag(1, u.Varint).int32(e.variant), e.identifier !== "" && t.tag(2, u.LengthDelimited).string(e.identifier); + for (let n = 0; n < e.name.length; n++) + d.internalBinaryWrite(e.name[n], t.tag(3, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.displayMessage.length; n++) + d.internalBinaryWrite(e.displayMessage[n], t.tag(4, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.alias.length; n++) + d.internalBinaryWrite(e.alias[n], t.tag(5, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.rules.length; n++) + q.internalBinaryWrite(e.rules[n], t.tag(6, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.genericKeys.length; n++) + t.tag(7, u.LengthDelimited).string(e.genericKeys[n]); + e.version !== "" && t.tag(8, u.LengthDelimited).string(e.version); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const pt = new yt(); +class gt extends T { + constructor() { + super("shared.ExecutionDataType", [ + { + no: 1, + name: "identifier", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + }, + { no: 2, name: "rules", kind: "message", repeat: 2, T: () => z } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.identifier = "", t.rules = [], e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* string identifier */ + 1: + n.identifier = e.string(); + break; + case /* repeated shared.ExecutionDataTypeRule rules */ + 2: + n.rules.push(z.internalBinaryRead(e, e.uint32(), i)); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.identifier !== "" && t.tag(1, u.LengthDelimited).string(e.identifier); + for (let n = 0; n < e.rules.length; n++) + z.internalBinaryWrite(e.rules[n], t.tag(2, u.LengthDelimited).fork(), i).join(); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +new gt(); +class mt extends T { + constructor() { + super("shared.DefinitionDataTypeRule", [ + { no: 1, name: "contains_key", kind: "message", oneof: "config", T: () => H }, + { no: 2, name: "contains_type", kind: "message", oneof: "config", T: () => ee }, + { no: 3, name: "item_of_collection", kind: "message", oneof: "config", T: () => L }, + { no: 4, name: "number_range", kind: "message", oneof: "config", T: () => U }, + { no: 5, name: "regex", kind: "message", oneof: "config", T: () => $ }, + { no: 6, name: "input_types", kind: "message", oneof: "config", T: () => ne }, + { no: 7, name: "return_type", kind: "message", oneof: "config", T: () => re }, + { no: 8, name: "parent_type", kind: "message", oneof: "config", T: () => Q } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.config = { oneofKind: void 0 }, e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* shared.DefinitionDataTypeContainsKeyRuleConfig contains_key */ + 1: + n.config = { + oneofKind: "containsKey", + containsKey: H.internalBinaryRead(e, e.uint32(), i, n.config.containsKey) + }; + break; + case /* shared.DefinitionDataTypeContainsTypeRuleConfig contains_type */ + 2: + n.config = { + oneofKind: "containsType", + containsType: ee.internalBinaryRead(e, e.uint32(), i, n.config.containsType) + }; + break; + case /* shared.DataTypeItemOfCollectionRuleConfig item_of_collection */ + 3: + n.config = { + oneofKind: "itemOfCollection", + itemOfCollection: L.internalBinaryRead(e, e.uint32(), i, n.config.itemOfCollection) + }; + break; + case /* shared.DataTypeNumberRangeRuleConfig number_range */ + 4: + n.config = { + oneofKind: "numberRange", + numberRange: U.internalBinaryRead(e, e.uint32(), i, n.config.numberRange) + }; + break; + case /* shared.DataTypeRegexRuleConfig regex */ + 5: + n.config = { + oneofKind: "regex", + regex: $.internalBinaryRead(e, e.uint32(), i, n.config.regex) + }; + break; + case /* shared.DefinitionDataTypeInputTypesRuleConfig input_types */ + 6: + n.config = { + oneofKind: "inputTypes", + inputTypes: ne.internalBinaryRead(e, e.uint32(), i, n.config.inputTypes) + }; + break; + case /* shared.DefinitionDataTypeReturnTypeRuleConfig return_type */ + 7: + n.config = { + oneofKind: "returnType", + returnType: re.internalBinaryRead(e, e.uint32(), i, n.config.returnType) + }; + break; + case /* shared.DefinitionDataTypeParentTypeRuleConfig parent_type */ + 8: + n.config = { + oneofKind: "parentType", + parentType: Q.internalBinaryRead(e, e.uint32(), i, n.config.parentType) + }; + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.config.oneofKind === "containsKey" && H.internalBinaryWrite(e.config.containsKey, t.tag(1, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "containsType" && ee.internalBinaryWrite(e.config.containsType, t.tag(2, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "itemOfCollection" && L.internalBinaryWrite(e.config.itemOfCollection, t.tag(3, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "numberRange" && U.internalBinaryWrite(e.config.numberRange, t.tag(4, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "regex" && $.internalBinaryWrite(e.config.regex, t.tag(5, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "inputTypes" && ne.internalBinaryWrite(e.config.inputTypes, t.tag(6, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "returnType" && re.internalBinaryWrite(e.config.returnType, t.tag(7, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "parentType" && Q.internalBinaryWrite(e.config.parentType, t.tag(8, u.LengthDelimited).fork(), i).join(); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const q = new mt(); +class kt extends T { + constructor() { + super("shared.ExecutionDataTypeRule", [ + { no: 1, name: "contains_key", kind: "message", oneof: "config", T: () => v }, + { no: 2, name: "contains_type", kind: "message", oneof: "config", T: () => te }, + { no: 3, name: "item_of_collection", kind: "message", oneof: "config", T: () => L }, + { no: 4, name: "number_range", kind: "message", oneof: "config", T: () => U }, + { no: 5, name: "regex", kind: "message", oneof: "config", T: () => $ } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.config = { oneofKind: void 0 }, e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* shared.ExecutionDataTypeContainsKeyRuleConfig contains_key */ + 1: + n.config = { + oneofKind: "containsKey", + containsKey: v.internalBinaryRead(e, e.uint32(), i, n.config.containsKey) + }; + break; + case /* shared.ExecutionDataTypeContainsTypeRuleConfig contains_type */ + 2: + n.config = { + oneofKind: "containsType", + containsType: te.internalBinaryRead(e, e.uint32(), i, n.config.containsType) + }; + break; + case /* shared.DataTypeItemOfCollectionRuleConfig item_of_collection */ + 3: + n.config = { + oneofKind: "itemOfCollection", + itemOfCollection: L.internalBinaryRead(e, e.uint32(), i, n.config.itemOfCollection) + }; + break; + case /* shared.DataTypeNumberRangeRuleConfig number_range */ + 4: + n.config = { + oneofKind: "numberRange", + numberRange: U.internalBinaryRead(e, e.uint32(), i, n.config.numberRange) + }; + break; + case /* shared.DataTypeRegexRuleConfig regex */ + 5: + n.config = { + oneofKind: "regex", + regex: $.internalBinaryRead(e, e.uint32(), i, n.config.regex) + }; + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.config.oneofKind === "containsKey" && v.internalBinaryWrite(e.config.containsKey, t.tag(1, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "containsType" && te.internalBinaryWrite(e.config.containsType, t.tag(2, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "itemOfCollection" && L.internalBinaryWrite(e.config.itemOfCollection, t.tag(3, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "numberRange" && U.internalBinaryWrite(e.config.numberRange, t.tag(4, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "regex" && $.internalBinaryWrite(e.config.regex, t.tag(5, u.LengthDelimited).fork(), i).join(); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const z = new kt(); +class bt extends T { + constructor() { + super("shared.DefinitionDataTypeParentTypeRuleConfig", [ + { no: 1, name: "parent_type", kind: "message", T: () => w } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* shared.DataTypeIdentifier parent_type */ + 1: + n.parentType = w.internalBinaryRead(e, e.uint32(), i, n.parentType); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.parentType && w.internalBinaryWrite(e.parentType, t.tag(1, u.LengthDelimited).fork(), i).join(); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const Q = new bt(); +class Tt extends T { + constructor() { + super("shared.DefinitionDataTypeContainsKeyRuleConfig", [ + { + no: 1, + name: "key", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + }, + { no: 2, name: "data_type_identifier", kind: "message", T: () => w } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.key = "", e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* string key */ + 1: + n.key = e.string(); + break; + case /* shared.DataTypeIdentifier data_type_identifier */ + 2: + n.dataTypeIdentifier = w.internalBinaryRead(e, e.uint32(), i, n.dataTypeIdentifier); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.key !== "" && t.tag(1, u.LengthDelimited).string(e.key), e.dataTypeIdentifier && w.internalBinaryWrite(e.dataTypeIdentifier, t.tag(2, u.LengthDelimited).fork(), i).join(); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const H = new Tt(); +class wt extends T { + constructor() { + super("shared.ExecutionDataTypeContainsKeyRuleConfig", [ + { + no: 1, + name: "key", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + }, + { + no: 2, + name: "data_type_identifier", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.key = "", t.dataTypeIdentifier = "", e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* string key */ + 1: + n.key = e.string(); + break; + case /* string data_type_identifier */ + 2: + n.dataTypeIdentifier = e.string(); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.key !== "" && t.tag(1, u.LengthDelimited).string(e.key), e.dataTypeIdentifier !== "" && t.tag(2, u.LengthDelimited).string(e.dataTypeIdentifier); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const v = new wt(); +class Nt extends T { + constructor() { + super("shared.DefinitionDataTypeContainsTypeRuleConfig", [ + { no: 1, name: "data_type_identifier", kind: "message", T: () => w } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* shared.DataTypeIdentifier data_type_identifier */ + 1: + n.dataTypeIdentifier = w.internalBinaryRead(e, e.uint32(), i, n.dataTypeIdentifier); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.dataTypeIdentifier && w.internalBinaryWrite(e.dataTypeIdentifier, t.tag(1, u.LengthDelimited).fork(), i).join(); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const ee = new Nt(); +class Bt extends T { + constructor() { + super("shared.ExecutionDataTypeContainsTypeRuleConfig", [ + { + no: 1, + name: "data_type_identifier", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.dataTypeIdentifier = "", e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* string data_type_identifier */ + 1: + n.dataTypeIdentifier = e.string(); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.dataTypeIdentifier !== "" && t.tag(1, u.LengthDelimited).string(e.dataTypeIdentifier); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const te = new Bt(); +class It extends T { + constructor() { + super("shared.DataTypeItemOfCollectionRuleConfig", [ + { no: 1, name: "items", kind: "message", repeat: 2, T: () => B } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.items = [], e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* repeated shared.Value items */ + 1: + n.items.push(B.internalBinaryRead(e, e.uint32(), i)); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + for (let n = 0; n < e.items.length; n++) + B.internalBinaryWrite(e.items[n], t.tag(1, u.LengthDelimited).fork(), i).join(); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const L = new It(); +class Rt extends T { + constructor() { + super("shared.DataTypeNumberRangeRuleConfig", [ + { + no: 1, + name: "from", + kind: "scalar", + T: 3, + L: 0 + /*LongType.BIGINT*/ + }, + { + no: 2, + name: "to", + kind: "scalar", + T: 3, + L: 0 + /*LongType.BIGINT*/ + }, + { + no: 3, + name: "steps", + kind: "scalar", + opt: !0, + T: 3, + L: 0 + /*LongType.BIGINT*/ + } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.from = 0n, t.to = 0n, e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* int64 from */ + 1: + n.from = e.int64().toBigInt(); + break; + case /* int64 to */ + 2: + n.to = e.int64().toBigInt(); + break; + case /* optional int64 steps */ + 3: + n.steps = e.int64().toBigInt(); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.from !== 0n && t.tag(1, u.Varint).int64(e.from), e.to !== 0n && t.tag(2, u.Varint).int64(e.to), e.steps !== void 0 && t.tag(3, u.Varint).int64(e.steps); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const U = new Rt(); +class Dt extends T { + constructor() { + super("shared.DataTypeRegexRuleConfig", [ + { + no: 1, + name: "pattern", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.pattern = "", e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* string pattern */ + 1: + n.pattern = e.string(); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.pattern !== "" && t.tag(1, u.LengthDelimited).string(e.pattern); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const $ = new Dt(); +class Ft extends T { + constructor() { + super("shared.DefinitionDataTypeInputTypesRuleConfig", [ + { no: 1, name: "input_types", kind: "message", repeat: 2, T: () => ie } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.inputTypes = [], e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* repeated shared.DefinitionDataTypeInputTypesRuleConfig.DataTypeInputType input_types */ + 1: + n.inputTypes.push(ie.internalBinaryRead(e, e.uint32(), i)); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + for (let n = 0; n < e.inputTypes.length; n++) + ie.internalBinaryWrite(e.inputTypes[n], t.tag(1, u.LengthDelimited).fork(), i).join(); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const ne = new Ft(); +class Et extends T { + constructor() { + super("shared.DefinitionDataTypeInputTypesRuleConfig.DataTypeInputType", [ + { no: 1, name: "data_type_identifier", kind: "message", T: () => w }, + { + no: 2, + name: "input_identifier", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.inputIdentifier = "", e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* shared.DataTypeIdentifier data_type_identifier */ + 1: + n.dataTypeIdentifier = w.internalBinaryRead(e, e.uint32(), i, n.dataTypeIdentifier); + break; + case /* string input_identifier */ + 2: + n.inputIdentifier = e.string(); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.dataTypeIdentifier && w.internalBinaryWrite(e.dataTypeIdentifier, t.tag(1, u.LengthDelimited).fork(), i).join(), e.inputIdentifier !== "" && t.tag(2, u.LengthDelimited).string(e.inputIdentifier); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const ie = new Et(); +class Ot extends T { + constructor() { + super("shared.DefinitionDataTypeReturnTypeRuleConfig", [ + { no: 1, name: "data_type_identifier", kind: "message", T: () => w } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* shared.DataTypeIdentifier data_type_identifier */ + 1: + n.dataTypeIdentifier = w.internalBinaryRead(e, e.uint32(), i, n.dataTypeIdentifier); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.dataTypeIdentifier && w.internalBinaryWrite(e.dataTypeIdentifier, t.tag(1, u.LengthDelimited).fork(), i).join(); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const re = new Ot(); +class Lt extends T { + constructor() { + super("shared.DataTypeIdentifier", [ + { + no: 1, + name: "data_type_identifier", + kind: "scalar", + oneof: "type", + T: 9 + /*ScalarType.STRING*/ + }, + { no: 2, name: "generic_type", kind: "message", oneof: "type", T: () => ae }, + { + no: 3, + name: "generic_key", + kind: "scalar", + oneof: "type", + T: 9 + /*ScalarType.STRING*/ + } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.type = { oneofKind: void 0 }, e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* string data_type_identifier */ + 1: + n.type = { + oneofKind: "dataTypeIdentifier", + dataTypeIdentifier: e.string() + }; + break; + case /* shared.GenericType generic_type */ + 2: + n.type = { + oneofKind: "genericType", + genericType: ae.internalBinaryRead(e, e.uint32(), i, n.type.genericType) + }; + break; + case /* string generic_key */ + 3: + n.type = { + oneofKind: "genericKey", + genericKey: e.string() + }; + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.type.oneofKind === "dataTypeIdentifier" && t.tag(1, u.LengthDelimited).string(e.type.dataTypeIdentifier), e.type.oneofKind === "genericType" && ae.internalBinaryWrite(e.type.genericType, t.tag(2, u.LengthDelimited).fork(), i).join(), e.type.oneofKind === "genericKey" && t.tag(3, u.LengthDelimited).string(e.type.genericKey); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const w = new Lt(); +class Ut extends T { + constructor() { + super("shared.GenericType", [ + { + no: 1, + name: "data_type_identifier", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + }, + { no: 2, name: "generic_mappers", kind: "message", repeat: 2, T: () => se } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.dataTypeIdentifier = "", t.genericMappers = [], e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* string data_type_identifier */ + 1: + n.dataTypeIdentifier = e.string(); + break; + case /* repeated shared.GenericMapper generic_mappers */ + 2: + n.genericMappers.push(se.internalBinaryRead(e, e.uint32(), i)); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.dataTypeIdentifier !== "" && t.tag(1, u.LengthDelimited).string(e.dataTypeIdentifier); + for (let n = 0; n < e.genericMappers.length; n++) + se.internalBinaryWrite(e.genericMappers[n], t.tag(2, u.LengthDelimited).fork(), i).join(); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const ae = new Ut(); +class $t extends T { + constructor() { + super("shared.GenericMapper", [ + { no: 1, name: "source", kind: "message", repeat: 2, T: () => w }, + { + no: 2, + name: "target", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + }, + { no: 3, name: "generic_combinations", kind: "enum", repeat: 1, T: () => ["shared.GenericMapper.GenericCombinationStrategy", he] } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.source = [], t.target = "", t.genericCombinations = [], e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* repeated shared.DataTypeIdentifier source */ + 1: + n.source.push(w.internalBinaryRead(e, e.uint32(), i)); + break; + case /* string target */ + 2: + n.target = e.string(); + break; + case /* repeated shared.GenericMapper.GenericCombinationStrategy generic_combinations */ + 3: + if (l === u.LengthDelimited) + for (let k = e.int32() + e.pos; e.pos < k; ) + n.genericCombinations.push(e.int32()); + else + n.genericCombinations.push(e.int32()); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + for (let n = 0; n < e.source.length; n++) + w.internalBinaryWrite(e.source[n], t.tag(1, u.LengthDelimited).fork(), i).join(); + if (e.target !== "" && t.tag(2, u.LengthDelimited).string(e.target), e.genericCombinations.length) { + t.tag(3, u.LengthDelimited).fork(); + for (let n = 0; n < e.genericCombinations.length; n++) + t.int32(e.genericCombinations[n]); + t.join(); + } + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const se = new $t(); +class xt extends T { + constructor() { + super("shared.RuntimeFunctionDefinition", [ + { + no: 1, + name: "runtime_name", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + }, + { no: 2, name: "runtime_parameter_definitions", kind: "message", repeat: 2, T: () => oe }, + { no: 3, name: "return_type_identifier", kind: "message", T: () => w }, + { + no: 4, + name: "throws_error", + kind: "scalar", + T: 8 + /*ScalarType.BOOL*/ + }, + { + no: 5, + name: "generic_keys", + kind: "scalar", + repeat: 2, + T: 9 + /*ScalarType.STRING*/ + }, + { no: 6, name: "name", kind: "message", repeat: 2, T: () => d }, + { no: 7, name: "description", kind: "message", repeat: 2, T: () => d }, + { no: 8, name: "documentation", kind: "message", repeat: 2, T: () => d }, + { no: 9, name: "deprecation_message", kind: "message", repeat: 2, T: () => d }, + { no: 10, name: "display_message", kind: "message", repeat: 2, T: () => d }, + { no: 11, name: "alias", kind: "message", repeat: 2, T: () => d }, + { + no: 12, + name: "version", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.runtimeName = "", t.runtimeParameterDefinitions = [], t.throwsError = !1, t.genericKeys = [], t.name = [], t.description = [], t.documentation = [], t.deprecationMessage = [], t.displayMessage = [], t.alias = [], t.version = "", e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* string runtime_name */ + 1: + n.runtimeName = e.string(); + break; + case /* repeated shared.RuntimeParameterDefinition runtime_parameter_definitions */ + 2: + n.runtimeParameterDefinitions.push(oe.internalBinaryRead(e, e.uint32(), i)); + break; + case /* optional shared.DataTypeIdentifier return_type_identifier */ + 3: + n.returnTypeIdentifier = w.internalBinaryRead(e, e.uint32(), i, n.returnTypeIdentifier); + break; + case /* bool throws_error */ + 4: + n.throwsError = e.bool(); + break; + case /* repeated string generic_keys */ + 5: + n.genericKeys.push(e.string()); + break; + case /* repeated shared.Translation name */ + 6: + n.name.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated shared.Translation description */ + 7: + n.description.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated shared.Translation documentation */ + 8: + n.documentation.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated shared.Translation deprecation_message */ + 9: + n.deprecationMessage.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated shared.Translation display_message */ + 10: + n.displayMessage.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated shared.Translation alias */ + 11: + n.alias.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* string version */ + 12: + n.version = e.string(); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.runtimeName !== "" && t.tag(1, u.LengthDelimited).string(e.runtimeName); + for (let n = 0; n < e.runtimeParameterDefinitions.length; n++) + oe.internalBinaryWrite(e.runtimeParameterDefinitions[n], t.tag(2, u.LengthDelimited).fork(), i).join(); + e.returnTypeIdentifier && w.internalBinaryWrite(e.returnTypeIdentifier, t.tag(3, u.LengthDelimited).fork(), i).join(), e.throwsError !== !1 && t.tag(4, u.Varint).bool(e.throwsError); + for (let n = 0; n < e.genericKeys.length; n++) + t.tag(5, u.LengthDelimited).string(e.genericKeys[n]); + for (let n = 0; n < e.name.length; n++) + d.internalBinaryWrite(e.name[n], t.tag(6, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.description.length; n++) + d.internalBinaryWrite(e.description[n], t.tag(7, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.documentation.length; n++) + d.internalBinaryWrite(e.documentation[n], t.tag(8, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.deprecationMessage.length; n++) + d.internalBinaryWrite(e.deprecationMessage[n], t.tag(9, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.displayMessage.length; n++) + d.internalBinaryWrite(e.displayMessage[n], t.tag(10, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.alias.length; n++) + d.internalBinaryWrite(e.alias[n], t.tag(11, u.LengthDelimited).fork(), i).join(); + e.version !== "" && t.tag(12, u.LengthDelimited).string(e.version); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const Vt = new xt(); +class Wt extends T { + constructor() { + super("shared.RuntimeParameterDefinition", [ + { no: 1, name: "data_type_identifier", kind: "message", T: () => w }, + { + no: 2, + name: "runtime_name", + kind: "scalar", + T: 9 + /*ScalarType.STRING*/ + }, + { no: 3, name: "default_value", kind: "message", T: () => B }, + { no: 4, name: "name", kind: "message", repeat: 2, T: () => d }, + { no: 5, name: "description", kind: "message", repeat: 2, T: () => d }, + { no: 6, name: "documentation", kind: "message", repeat: 2, T: () => d } + ]); + } + create(e) { + const t = globalThis.Object.create(this.messagePrototype); + return t.runtimeName = "", t.name = [], t.description = [], t.documentation = [], e !== void 0 && m(this, t, e), t; + } + internalBinaryRead(e, t, i, r) { + let n = r ?? this.create(), o = e.pos + t; + for (; e.pos < o; ) { + let [s, l] = e.tag(); + switch (s) { + case /* shared.DataTypeIdentifier data_type_identifier */ + 1: + n.dataTypeIdentifier = w.internalBinaryRead(e, e.uint32(), i, n.dataTypeIdentifier); + break; + case /* string runtime_name */ + 2: + n.runtimeName = e.string(); + break; + case /* optional shared.Value default_value */ + 3: + n.defaultValue = B.internalBinaryRead(e, e.uint32(), i, n.defaultValue); + break; + case /* repeated shared.Translation name */ + 4: + n.name.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated shared.Translation description */ + 5: + n.description.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + case /* repeated shared.Translation documentation */ + 6: + n.documentation.push(d.internalBinaryRead(e, e.uint32(), i)); + break; + default: + let f = i.readUnknownField; + if (f === "throw") + throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); + let h = e.skip(l); + f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); + } + } + return n; + } + internalBinaryWrite(e, t, i) { + e.dataTypeIdentifier && w.internalBinaryWrite(e.dataTypeIdentifier, t.tag(1, u.LengthDelimited).fork(), i).join(), e.runtimeName !== "" && t.tag(2, u.LengthDelimited).string(e.runtimeName), e.defaultValue && B.internalBinaryWrite(e.defaultValue, t.tag(3, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.name.length; n++) + d.internalBinaryWrite(e.name[n], t.tag(4, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.description.length; n++) + d.internalBinaryWrite(e.description[n], t.tag(5, u.LengthDelimited).fork(), i).join(); + for (let n = 0; n < e.documentation.length; n++) + d.internalBinaryWrite(e.documentation[n], t.tag(6, u.LengthDelimited).fork(), i).join(); + let r = i.writeUnknownFields; + return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; + } +} +const oe = new Wt(); +var Kt = /* @__PURE__ */ ((a) => (a.FlowType = "FlowType", a.DataType = "DataType", a.RuntimeFunction = "RuntimeFunction", a))(Kt || {}); +class Xt { + static async fromPath(e) { + const t = /* @__PURE__ */ new Map(); + for (const i of await P(e)) { + if (!i.isDirectory()) continue; + const r = i.name, n = x(e, r); + for (const o of await P(n)) { + const s = jt(o.name); + if (!s) continue; + const l = x(n, o.name), f = await Ct(l); + for (const h of f) { + const k = await $e(h, "utf8"), p = t.get(r) ?? At(r); + _t(p, k, s), t.set(r, p); + } + } + } + return Array.from(t.values()); + } +} +const jt = (a) => ({ + flow_type: "FlowType", + data_type: "DataType", + runtime_definition: "RuntimeFunction" + /* RuntimeFunction */ +})[a] ?? null, At = (a) => ({ + name: a, + data_types: [], + flow_types: [], + runtime_functions: [], + errors: [] +}), P = async (a) => { + try { + return await xe(a, { withFileTypes: !0 }); + } catch { + return []; + } +}, Ct = async (a) => { + const e = await P(a), t = e.filter((i) => i.isFile() && ye(i.name) === ".json").map((i) => x(a, i.name)); + for (const i of e.filter((r) => r.isDirectory())) { + const r = (await P(x(a, i.name))).filter((n) => n.isFile() && ye(n.name) === ".json").map((n) => x(a, i.name, n.name)); + t.push(...r); + } + return t; +}, _t = (a, e, t) => { + try { + t === "DataType" ? a.data_types.push(pt.fromJsonString(e)) : t === "FlowType" ? a.flow_types.push(ht.fromJsonString(e)) : a.runtime_functions.push(Vt.fromJsonString(e)); + } catch (i) { + a.errors.push({ + definition: St(e, t), + definition_type: t, + error: i instanceof Error ? i.message : String(i) + }); + } +}, St = (a, e) => { + const t = e === "RuntimeFunction" ? "runtime_name" : "identifier"; + return a.match(new RegExp(`"${t}"\\s*:\\s*"([^"]+)"`))?.[1] ?? a; +}; +export { + Kt as MetaType, + Xt as Reader +}; From 8d41aa15327f55ecdfcb84368ca38469da72276f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 11:13:50 +0000 Subject: [PATCH 3/3] Update .gitignore to exclude dist directories Co-authored-by: raphael-goetz <52959657+raphael-goetz@users.noreply.github.com> --- .gitignore | 3 +- package/reader/dist/index.js | 3671 ---------------------------------- 2 files changed, 2 insertions(+), 3672 deletions(-) delete mode 100644 package/reader/dist/index.js diff --git a/.gitignore b/.gitignore index 422ceb9..2c6584d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ reader/ts/src/*.js reader/ts/build bundles reader/**/*.js -*.d.ts \ No newline at end of file +*.d.ts +**/dist \ No newline at end of file diff --git a/package/reader/dist/index.js b/package/reader/dist/index.js deleted file mode 100644 index 37e8a63..0000000 --- a/package/reader/dist/index.js +++ /dev/null @@ -1,3671 +0,0 @@ -import { readFile as $e, readdir as xe } from "node:fs/promises"; -import { join as x, extname as ye } from "node:path"; -function Be(a) { - let e = typeof a; - if (e == "object") { - if (Array.isArray(a)) - return "array"; - if (a === null) - return "null"; - } - return e; -} -function Ve(a) { - return a !== null && typeof a == "object" && !Array.isArray(a); -} -let O = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), M = []; -for (let a = 0; a < O.length; a++) - M[O[a].charCodeAt(0)] = a; -M[45] = O.indexOf("+"); -M[95] = O.indexOf("/"); -function We(a) { - let e = a.length * 3 / 4; - a[a.length - 2] == "=" ? e -= 2 : a[a.length - 1] == "=" && (e -= 1); - let t = new Uint8Array(e), i = 0, r = 0, n, o = 0; - for (let s = 0; s < a.length; s++) { - if (n = M[a.charCodeAt(s)], n === void 0) - switch (a[s]) { - case "=": - r = 0; - // reset state when padding found - case ` -`: - case "\r": - case " ": - case " ": - continue; - // skip white-space, and padding - default: - throw Error("invalid base64 string."); - } - switch (r) { - case 0: - o = n, r = 1; - break; - case 1: - t[i++] = o << 2 | (n & 48) >> 4, o = n, r = 2; - break; - case 2: - t[i++] = (o & 15) << 4 | (n & 60) >> 2, o = n, r = 3; - break; - case 3: - t[i++] = (o & 3) << 6 | n, r = 0; - break; - } - } - if (r == 1) - throw Error("invalid base64 string."); - return t.subarray(0, i); -} -function Ke(a) { - let e = "", t = 0, i, r = 0; - for (let n = 0; n < a.length; n++) - switch (i = a[n], t) { - case 0: - e += O[i >> 2], r = (i & 3) << 4, t = 1; - break; - case 1: - e += O[r | i >> 4], r = (i & 15) << 2, t = 2; - break; - case 2: - e += O[r | i >> 6], e += O[i & 63], t = 0; - break; - } - return t && (e += O[r], e += "=", t == 1 && (e += "=")), e; -} -var y; -(function(a) { - a.symbol = /* @__PURE__ */ Symbol.for("protobuf-ts/unknown"), a.onRead = (t, i, r, n, o) => { - (e(i) ? i[a.symbol] : i[a.symbol] = []).push({ no: r, wireType: n, data: o }); - }, a.onWrite = (t, i, r) => { - for (let { no: n, wireType: o, data: s } of a.list(i)) - r.tag(n, o).raw(s); - }, a.list = (t, i) => { - if (e(t)) { - let r = t[a.symbol]; - return i ? r.filter((n) => n.no == i) : r; - } - return []; - }, a.last = (t, i) => a.list(t, i).slice(-1)[0]; - const e = (t) => t && Array.isArray(t[a.symbol]); -})(y || (y = {})); -var u; -(function(a) { - a[a.Varint = 0] = "Varint", a[a.Bit64 = 1] = "Bit64", a[a.LengthDelimited = 2] = "LengthDelimited", a[a.StartGroup = 3] = "StartGroup", a[a.EndGroup = 4] = "EndGroup", a[a.Bit32 = 5] = "Bit32"; -})(u || (u = {})); -function je() { - let a = 0, e = 0; - for (let i = 0; i < 28; i += 7) { - let r = this.buf[this.pos++]; - if (a |= (r & 127) << i, (r & 128) == 0) - return this.assertBounds(), [a, e]; - } - let t = this.buf[this.pos++]; - if (a |= (t & 15) << 28, e = (t & 112) >> 4, (t & 128) == 0) - return this.assertBounds(), [a, e]; - for (let i = 3; i <= 31; i += 7) { - let r = this.buf[this.pos++]; - if (e |= (r & 127) << i, (r & 128) == 0) - return this.assertBounds(), [a, e]; - } - throw new Error("invalid varint"); -} -function J(a, e, t) { - for (let n = 0; n < 28; n = n + 7) { - const o = a >>> n, s = !(!(o >>> 7) && e == 0), l = (s ? o | 128 : o) & 255; - if (t.push(l), !s) - return; - } - const i = a >>> 28 & 15 | (e & 7) << 4, r = e >> 3 != 0; - if (t.push((r ? i | 128 : i) & 255), !!r) { - for (let n = 3; n < 31; n = n + 7) { - const o = e >>> n, s = !!(o >>> 7), l = (s ? o | 128 : o) & 255; - if (t.push(l), !s) - return; - } - t.push(e >>> 31 & 1); - } -} -const A = 65536 * 65536; -function Ie(a) { - let e = a[0] == "-"; - e && (a = a.slice(1)); - const t = 1e6; - let i = 0, r = 0; - function n(o, s) { - const l = Number(a.slice(o, s)); - r *= t, i = i * t + l, i >= A && (r = r + (i / A | 0), i = i % A); - } - return n(-24, -18), n(-18, -12), n(-12, -6), n(-6), [e, i, r]; -} -function le(a, e) { - if (e >>> 0 <= 2097151) - return "" + (A * e + (a >>> 0)); - let t = a & 16777215, i = (a >>> 24 | e << 8) >>> 0 & 16777215, r = e >> 16 & 65535, n = t + i * 6777216 + r * 6710656, o = i + r * 8147497, s = r * 2, l = 1e7; - n >= l && (o += Math.floor(n / l), n %= l), o >= l && (s += Math.floor(o / l), o %= l); - function f(h, k) { - let p = h ? String(h) : ""; - return k ? "0000000".slice(p.length) + p : p; - } - return f( - s, - /*needLeadingZeros=*/ - 0 - ) + f( - o, - /*needLeadingZeros=*/ - s - ) + // If the final 1e7 digit didn't need leading zeros, we would have - // returned via the trivial code path at the top. - f( - n, - /*needLeadingZeros=*/ - 1 - ); -} -function pe(a, e) { - if (a >= 0) { - for (; a > 127; ) - e.push(a & 127 | 128), a = a >>> 7; - e.push(a); - } else { - for (let t = 0; t < 9; t++) - e.push(a & 127 | 128), a = a >> 7; - e.push(1); - } -} -function Ae() { - let a = this.buf[this.pos++], e = a & 127; - if ((a & 128) == 0) - return this.assertBounds(), e; - if (a = this.buf[this.pos++], e |= (a & 127) << 7, (a & 128) == 0) - return this.assertBounds(), e; - if (a = this.buf[this.pos++], e |= (a & 127) << 14, (a & 128) == 0) - return this.assertBounds(), e; - if (a = this.buf[this.pos++], e |= (a & 127) << 21, (a & 128) == 0) - return this.assertBounds(), e; - a = this.buf[this.pos++], e |= (a & 15) << 28; - for (let t = 5; (a & 128) !== 0 && t < 10; t++) - a = this.buf[this.pos++]; - if ((a & 128) != 0) - throw new Error("invalid varint"); - return this.assertBounds(), e >>> 0; -} -let b; -function Ce() { - const a = new DataView(new ArrayBuffer(8)); - b = globalThis.BigInt !== void 0 && typeof a.getBigInt64 == "function" && typeof a.getBigUint64 == "function" && typeof a.setBigInt64 == "function" && typeof a.setBigUint64 == "function" ? { - MIN: BigInt("-9223372036854775808"), - MAX: BigInt("9223372036854775807"), - UMIN: BigInt("0"), - UMAX: BigInt("18446744073709551615"), - C: BigInt, - V: a - } : void 0; -} -Ce(); -function Re(a) { - if (!a) - throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support"); -} -const De = /^-?[0-9]+$/, C = 4294967296, K = 2147483648; -class Fe { - /** - * Create a new instance with the given bits. - */ - constructor(e, t) { - this.lo = e | 0, this.hi = t | 0; - } - /** - * Is this instance equal to 0? - */ - isZero() { - return this.lo == 0 && this.hi == 0; - } - /** - * Convert to a native number. - */ - toNumber() { - let e = this.hi * C + (this.lo >>> 0); - if (!Number.isSafeInteger(e)) - throw new Error("cannot convert to safe number"); - return e; - } -} -class I extends Fe { - /** - * Create instance from a `string`, `number` or `bigint`. - */ - static from(e) { - if (b) - switch (typeof e) { - case "string": - if (e == "0") - return this.ZERO; - if (e == "") - throw new Error("string is no integer"); - e = b.C(e); - case "number": - if (e === 0) - return this.ZERO; - e = b.C(e); - case "bigint": - if (!e) - return this.ZERO; - if (e < b.UMIN) - throw new Error("signed value for ulong"); - if (e > b.UMAX) - throw new Error("ulong too large"); - return b.V.setBigUint64(0, e, !0), new I(b.V.getInt32(0, !0), b.V.getInt32(4, !0)); - } - else - switch (typeof e) { - case "string": - if (e == "0") - return this.ZERO; - if (e = e.trim(), !De.test(e)) - throw new Error("string is no integer"); - let [t, i, r] = Ie(e); - if (t) - throw new Error("signed value for ulong"); - return new I(i, r); - case "number": - if (e == 0) - return this.ZERO; - if (!Number.isSafeInteger(e)) - throw new Error("number is no integer"); - if (e < 0) - throw new Error("signed value for ulong"); - return new I(e, e / C); - } - throw new Error("unknown value " + typeof e); - } - /** - * Convert to decimal string. - */ - toString() { - return b ? this.toBigInt().toString() : le(this.lo, this.hi); - } - /** - * Convert to native bigint. - */ - toBigInt() { - return Re(b), b.V.setInt32(0, this.lo, !0), b.V.setInt32(4, this.hi, !0), b.V.getBigUint64(0, !0); - } -} -I.ZERO = new I(0, 0); -class N extends Fe { - /** - * Create instance from a `string`, `number` or `bigint`. - */ - static from(e) { - if (b) - switch (typeof e) { - case "string": - if (e == "0") - return this.ZERO; - if (e == "") - throw new Error("string is no integer"); - e = b.C(e); - case "number": - if (e === 0) - return this.ZERO; - e = b.C(e); - case "bigint": - if (!e) - return this.ZERO; - if (e < b.MIN) - throw new Error("signed long too small"); - if (e > b.MAX) - throw new Error("signed long too large"); - return b.V.setBigInt64(0, e, !0), new N(b.V.getInt32(0, !0), b.V.getInt32(4, !0)); - } - else - switch (typeof e) { - case "string": - if (e == "0") - return this.ZERO; - if (e = e.trim(), !De.test(e)) - throw new Error("string is no integer"); - let [t, i, r] = Ie(e); - if (t) { - if (r > K || r == K && i != 0) - throw new Error("signed long too small"); - } else if (r >= K) - throw new Error("signed long too large"); - let n = new N(i, r); - return t ? n.negate() : n; - case "number": - if (e == 0) - return this.ZERO; - if (!Number.isSafeInteger(e)) - throw new Error("number is no integer"); - return e > 0 ? new N(e, e / C) : new N(-e, -e / C).negate(); - } - throw new Error("unknown value " + typeof e); - } - /** - * Do we have a minus sign? - */ - isNegative() { - return (this.hi & K) !== 0; - } - /** - * Negate two's complement. - * Invert all the bits and add one to the result. - */ - negate() { - let e = ~this.hi, t = this.lo; - return t ? t = ~t + 1 : e += 1, new N(t, e); - } - /** - * Convert to decimal string. - */ - toString() { - if (b) - return this.toBigInt().toString(); - if (this.isNegative()) { - let e = this.negate(); - return "-" + le(e.lo, e.hi); - } - return le(this.lo, this.hi); - } - /** - * Convert to native bigint. - */ - toBigInt() { - return Re(b), b.V.setInt32(0, this.lo, !0), b.V.setInt32(4, this.hi, !0), b.V.getBigInt64(0, !0); - } -} -N.ZERO = new N(0, 0); -const ge = { - readUnknownField: !0, - readerFactory: (a) => new Se(a) -}; -function _e(a) { - return a ? Object.assign(Object.assign({}, ge), a) : ge; -} -class Se { - constructor(e, t) { - this.varint64 = je, this.uint32 = Ae, this.buf = e, this.len = e.length, this.pos = 0, this.view = new DataView(e.buffer, e.byteOffset, e.byteLength), this.textDecoder = t ?? new TextDecoder("utf-8", { - fatal: !0, - ignoreBOM: !0 - }); - } - /** - * Reads a tag - field number and wire type. - */ - tag() { - let e = this.uint32(), t = e >>> 3, i = e & 7; - if (t <= 0 || i < 0 || i > 5) - throw new Error("illegal tag: field no " + t + " wire type " + i); - return [t, i]; - } - /** - * Skip one element on the wire and return the skipped data. - * Supports WireType.StartGroup since v2.0.0-alpha.23. - */ - skip(e) { - let t = this.pos; - switch (e) { - case u.Varint: - for (; this.buf[this.pos++] & 128; ) - ; - break; - case u.Bit64: - this.pos += 4; - case u.Bit32: - this.pos += 4; - break; - case u.LengthDelimited: - let i = this.uint32(); - this.pos += i; - break; - case u.StartGroup: - let r; - for (; (r = this.tag()[1]) !== u.EndGroup; ) - this.skip(r); - break; - default: - throw new Error("cant skip wire type " + e); - } - return this.assertBounds(), this.buf.subarray(t, 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 e = this.uint32(); - return e >>> 1 ^ -(e & 1); - } - /** - * Read a `int64` field, a signed 64-bit varint. - */ - int64() { - return new N(...this.varint64()); - } - /** - * Read a `uint64` field, an unsigned 64-bit varint. - */ - uint64() { - return new I(...this.varint64()); - } - /** - * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. - */ - sint64() { - let [e, t] = this.varint64(), i = -(e & 1); - return e = (e >>> 1 | (t & 1) << 31) ^ i, t = t >>> 1 ^ i, new N(e, t); - } - /** - * Read a `bool` field, a variant. - */ - bool() { - let [e, t] = this.varint64(); - return e !== 0 || t !== 0; - } - /** - * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. - */ - fixed32() { - return this.view.getUint32((this.pos += 4) - 4, !0); - } - /** - * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. - */ - sfixed32() { - return this.view.getInt32((this.pos += 4) - 4, !0); - } - /** - * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. - */ - fixed64() { - return new I(this.sfixed32(), this.sfixed32()); - } - /** - * Read a `fixed64` field, a signed, fixed-length 64-bit integer. - */ - sfixed64() { - return new N(this.sfixed32(), this.sfixed32()); - } - /** - * Read a `float` field, 32-bit floating point number. - */ - float() { - return this.view.getFloat32((this.pos += 4) - 4, !0); - } - /** - * Read a `double` field, a 64-bit floating point number. - */ - double() { - return this.view.getFloat64((this.pos += 8) - 8, !0); - } - /** - * Read a `bytes` field, length-delimited arbitrary data. - */ - bytes() { - let e = this.uint32(), t = this.pos; - return this.pos += e, this.assertBounds(), this.buf.subarray(t, t + e); - } - /** - * Read a `string` field, length-delimited data converted to UTF-8 text. - */ - string() { - return this.textDecoder.decode(this.bytes()); - } -} -function g(a, e) { - if (!a) - throw new Error(e); -} -const Pe = 34028234663852886e22, Me = -34028234663852886e22, Xe = 4294967295, Je = 2147483647, Ge = -2147483648; -function V(a) { - if (typeof a != "number") - throw new Error("invalid int 32: " + typeof a); - if (!Number.isInteger(a) || a > Je || a < Ge) - throw new Error("invalid int 32: " + a); -} -function _(a) { - if (typeof a != "number") - throw new Error("invalid uint 32: " + typeof a); - if (!Number.isInteger(a) || a > Xe || a < 0) - throw new Error("invalid uint 32: " + a); -} -function de(a) { - if (typeof a != "number") - throw new Error("invalid float 32: " + typeof a); - if (Number.isFinite(a) && (a > Pe || a < Me)) - throw new Error("invalid float 32: " + a); -} -const me = { - writeUnknownFields: !0, - writerFactory: () => new Ye() -}; -function Ze(a) { - return a ? Object.assign(Object.assign({}, me), a) : me; -} -class Ye { - constructor(e) { - this.stack = [], this.textEncoder = e ?? new TextEncoder(), this.chunks = [], this.buf = []; - } - /** - * Return all bytes written and reset this writer. - */ - finish() { - this.chunks.push(new Uint8Array(this.buf)); - let e = 0; - for (let r = 0; r < this.chunks.length; r++) - e += this.chunks[r].length; - let t = new Uint8Array(e), i = 0; - for (let r = 0; r < this.chunks.length; r++) - t.set(this.chunks[r], i), i += this.chunks[r].length; - return this.chunks = [], t; - } - /** - * Start a new fork for length-delimited data like a message - * or a packed repeated field. - * - * Must be joined later with `join()`. - */ - fork() { - return this.stack.push({ chunks: this.chunks, buf: this.buf }), this.chunks = [], this.buf = [], this; - } - /** - * Join the last fork. Write its length and bytes, then - * return to the previous state. - */ - join() { - let e = this.finish(), t = this.stack.pop(); - if (!t) - throw new Error("invalid state, fork stack empty"); - return this.chunks = t.chunks, this.buf = t.buf, this.uint32(e.byteLength), this.raw(e); - } - /** - * 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(e, t) { - return this.uint32((e << 3 | t) >>> 0); - } - /** - * Write a chunk of raw bytes. - */ - raw(e) { - return this.buf.length && (this.chunks.push(new Uint8Array(this.buf)), this.buf = []), this.chunks.push(e), this; - } - /** - * Write a `uint32` value, an unsigned 32 bit varint. - */ - uint32(e) { - for (_(e); e > 127; ) - this.buf.push(e & 127 | 128), e = e >>> 7; - return this.buf.push(e), this; - } - /** - * Write a `int32` value, a signed 32 bit varint. - */ - int32(e) { - return V(e), pe(e, this.buf), this; - } - /** - * Write a `bool` value, a variant. - */ - bool(e) { - return this.buf.push(e ? 1 : 0), this; - } - /** - * Write a `bytes` value, length-delimited arbitrary data. - */ - bytes(e) { - return this.uint32(e.byteLength), this.raw(e); - } - /** - * Write a `string` value, length-delimited data converted to UTF-8 text. - */ - string(e) { - let t = this.textEncoder.encode(e); - return this.uint32(t.byteLength), this.raw(t); - } - /** - * Write a `float` value, 32-bit floating point number. - */ - float(e) { - de(e); - let t = new Uint8Array(4); - return new DataView(t.buffer).setFloat32(0, e, !0), this.raw(t); - } - /** - * Write a `double` value, a 64-bit floating point number. - */ - double(e) { - let t = new Uint8Array(8); - return new DataView(t.buffer).setFloat64(0, e, !0), this.raw(t); - } - /** - * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. - */ - fixed32(e) { - _(e); - let t = new Uint8Array(4); - return new DataView(t.buffer).setUint32(0, e, !0), this.raw(t); - } - /** - * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. - */ - sfixed32(e) { - V(e); - let t = new Uint8Array(4); - return new DataView(t.buffer).setInt32(0, e, !0), this.raw(t); - } - /** - * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. - */ - sint32(e) { - return V(e), e = (e << 1 ^ e >> 31) >>> 0, pe(e, this.buf), this; - } - /** - * Write a `fixed64` value, a signed, fixed-length 64-bit integer. - */ - sfixed64(e) { - let t = new Uint8Array(8), i = new DataView(t.buffer), r = N.from(e); - return i.setInt32(0, r.lo, !0), i.setInt32(4, r.hi, !0), this.raw(t); - } - /** - * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. - */ - fixed64(e) { - let t = new Uint8Array(8), i = new DataView(t.buffer), r = I.from(e); - return i.setInt32(0, r.lo, !0), i.setInt32(4, r.hi, !0), this.raw(t); - } - /** - * Write a `int64` value, a signed 64-bit varint. - */ - int64(e) { - let t = N.from(e); - return J(t.lo, t.hi, this.buf), this; - } - /** - * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. - */ - sint64(e) { - let t = N.from(e), i = t.hi >> 31, r = t.lo << 1 ^ i, n = (t.hi << 1 | t.lo >>> 31) ^ i; - return J(r, n, this.buf), this; - } - /** - * Write a `uint64` value, an unsigned 64-bit varint. - */ - uint64(e) { - let t = I.from(e); - return J(t.lo, t.hi, this.buf), this; - } -} -const ke = { - emitDefaultValues: !1, - enumAsInteger: !1, - useProtoFieldName: !1, - prettySpaces: 0 -}, be = { - ignoreUnknownFields: !1 -}; -function qe(a) { - return a ? Object.assign(Object.assign({}, be), a) : be; -} -function ze(a) { - return a ? Object.assign(Object.assign({}, ke), a) : ke; -} -const Ee = /* @__PURE__ */ Symbol.for("protobuf-ts/message-type"); -function Te(a) { - let e = !1; - const t = []; - for (let i = 0; i < a.length; i++) { - let r = a.charAt(i); - r == "_" ? e = !0 : /\d/.test(r) ? (t.push(r), e = !0) : e ? (t.push(r.toUpperCase()), e = !1) : i == 0 ? t.push(r.toLowerCase()) : t.push(r); - } - return t.join(""); -} -var c; -(function(a) { - a[a.DOUBLE = 1] = "DOUBLE", a[a.FLOAT = 2] = "FLOAT", a[a.INT64 = 3] = "INT64", a[a.UINT64 = 4] = "UINT64", a[a.INT32 = 5] = "INT32", a[a.FIXED64 = 6] = "FIXED64", a[a.FIXED32 = 7] = "FIXED32", a[a.BOOL = 8] = "BOOL", a[a.STRING = 9] = "STRING", a[a.BYTES = 12] = "BYTES", a[a.UINT32 = 13] = "UINT32", a[a.SFIXED32 = 15] = "SFIXED32", a[a.SFIXED64 = 16] = "SFIXED64", a[a.SINT32 = 17] = "SINT32", a[a.SINT64 = 18] = "SINT64"; -})(c || (c = {})); -var F; -(function(a) { - a[a.BIGINT = 0] = "BIGINT", a[a.STRING = 1] = "STRING", a[a.NUMBER = 2] = "NUMBER"; -})(F || (F = {})); -var S; -(function(a) { - a[a.NO = 0] = "NO", a[a.PACKED = 1] = "PACKED", a[a.UNPACKED = 2] = "UNPACKED"; -})(S || (S = {})); -function Qe(a) { - var e, t, i, r; - return a.localName = (e = a.localName) !== null && e !== void 0 ? e : Te(a.name), a.jsonName = (t = a.jsonName) !== null && t !== void 0 ? t : Te(a.name), a.repeat = (i = a.repeat) !== null && i !== void 0 ? i : S.NO, a.opt = (r = a.opt) !== null && r !== void 0 ? r : a.repeat || a.oneof ? !1 : a.kind == "message", a; -} -function He(a) { - if (typeof a != "object" || a === null || !a.hasOwnProperty("oneofKind")) - return !1; - switch (typeof a.oneofKind) { - case "string": - return a[a.oneofKind] === void 0 ? !1 : Object.keys(a).length == 2; - case "undefined": - return Object.keys(a).length == 1; - default: - return !1; - } -} -class ve { - constructor(e) { - var t; - this.fields = (t = e.fields) !== null && t !== void 0 ? t : []; - } - prepare() { - if (this.data) - return; - const e = [], t = [], i = []; - for (let r of this.fields) - if (r.oneof) - i.includes(r.oneof) || (i.push(r.oneof), e.push(r.oneof), t.push(r.oneof)); - else - switch (t.push(r.localName), r.kind) { - case "scalar": - case "enum": - (!r.opt || r.repeat) && e.push(r.localName); - break; - case "message": - r.repeat && e.push(r.localName); - break; - case "map": - e.push(r.localName); - break; - } - this.data = { req: e, known: t, oneofs: Object.values(i) }; - } - /** - * Is the argument a valid message as specified by the - * reflection information? - * - * Checks all field types recursively. The `depth` - * specifies how deep into the structure the check will be. - * - * With a depth of 0, only the presence of fields - * is checked. - * - * With a depth of 1 or more, the field types are checked. - * - * With a depth of 2 or more, the members of map, repeated - * and message fields are checked. - * - * Message fields will be checked recursively with depth - 1. - * - * The number of map entries / repeated values being checked - * is < depth. - */ - is(e, t, i = !1) { - if (t < 0) - return !0; - if (e == null || typeof e != "object") - return !1; - this.prepare(); - let r = Object.keys(e), n = this.data; - if (r.length < n.req.length || n.req.some((o) => !r.includes(o)) || !i && r.some((o) => !n.known.includes(o))) - return !1; - if (t < 1) - return !0; - for (const o of n.oneofs) { - const s = e[o]; - if (!He(s)) - return !1; - if (s.oneofKind === void 0) - continue; - const l = this.fields.find((f) => f.localName === s.oneofKind); - if (!l || !this.field(s[s.oneofKind], l, i, t)) - return !1; - } - for (const o of this.fields) - if (o.oneof === void 0 && !this.field(e[o.localName], o, i, t)) - return !1; - return !0; - } - field(e, t, i, r) { - let n = t.repeat; - switch (t.kind) { - case "scalar": - return e === void 0 ? t.opt : n ? this.scalars(e, t.T, r, t.L) : this.scalar(e, t.T, t.L); - case "enum": - return e === void 0 ? t.opt : n ? this.scalars(e, c.INT32, r) : this.scalar(e, c.INT32); - case "message": - return e === void 0 ? !0 : n ? this.messages(e, t.T(), i, r) : this.message(e, t.T(), i, r); - case "map": - if (typeof e != "object" || e === null) - return !1; - if (r < 2) - return !0; - if (!this.mapKeys(e, t.K, r)) - return !1; - switch (t.V.kind) { - case "scalar": - return this.scalars(Object.values(e), t.V.T, r, t.V.L); - case "enum": - return this.scalars(Object.values(e), c.INT32, r); - case "message": - return this.messages(Object.values(e), t.V.T(), i, r); - } - break; - } - return !0; - } - message(e, t, i, r) { - return i ? t.isAssignable(e, r) : t.is(e, r); - } - messages(e, t, i, r) { - if (!Array.isArray(e)) - return !1; - if (r < 2) - return !0; - if (i) { - for (let n = 0; n < e.length && n < r; n++) - if (!t.isAssignable(e[n], r - 1)) - return !1; - } else - for (let n = 0; n < e.length && n < r; n++) - if (!t.is(e[n], r - 1)) - return !1; - return !0; - } - scalar(e, t, i) { - let r = typeof e; - switch (t) { - case c.UINT64: - case c.FIXED64: - case c.INT64: - case c.SFIXED64: - case c.SINT64: - switch (i) { - case F.BIGINT: - return r == "bigint"; - case F.NUMBER: - return r == "number" && !isNaN(e); - default: - return r == "string"; - } - case c.BOOL: - return r == "boolean"; - case c.STRING: - return r == "string"; - case c.BYTES: - return e instanceof Uint8Array; - case c.DOUBLE: - case c.FLOAT: - return r == "number" && !isNaN(e); - default: - return r == "number" && Number.isInteger(e); - } - } - scalars(e, t, i, r) { - if (!Array.isArray(e)) - return !1; - if (i < 2) - return !0; - if (Array.isArray(e)) { - for (let n = 0; n < e.length && n < i; n++) - if (!this.scalar(e[n], t, r)) - return !1; - } - return !0; - } - mapKeys(e, t, i) { - let r = Object.keys(e); - switch (t) { - case c.INT32: - case c.FIXED32: - case c.SFIXED32: - case c.SINT32: - case c.UINT32: - return this.scalars(r.slice(0, i).map((n) => parseInt(n)), t, i); - case c.BOOL: - return this.scalars(r.slice(0, i).map((n) => n == "true" ? !0 : n == "false" ? !1 : n), t, i); - default: - return this.scalars(r, t, i, F.STRING); - } - } -} -function D(a, e) { - switch (e) { - case F.BIGINT: - return a.toBigInt(); - case F.NUMBER: - return a.toNumber(); - default: - return a.toString(); - } -} -class et { - constructor(e) { - this.info = e; - } - prepare() { - var e; - if (this.fMap === void 0) { - this.fMap = {}; - const t = (e = this.info.fields) !== null && e !== void 0 ? e : []; - for (const i of t) - this.fMap[i.name] = i, this.fMap[i.jsonName] = i, this.fMap[i.localName] = i; - } - } - // Cannot parse JSON for #. - assert(e, t, i) { - if (!e) { - let r = Be(i); - throw (r == "number" || r == "boolean") && (r = i.toString()), new Error(`Cannot parse JSON ${r} for ${this.info.typeName}#${t}`); - } - } - /** - * Reads a message from canonical JSON format into the target message. - * - * 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. - */ - read(e, t, i) { - this.prepare(); - const r = []; - for (const [n, o] of Object.entries(e)) { - const s = this.fMap[n]; - if (!s) { - if (!i.ignoreUnknownFields) - throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${n}`); - continue; - } - const l = s.localName; - let f; - if (s.oneof) { - if (o === null && (s.kind !== "enum" || s.T()[0] !== "google.protobuf.NullValue")) - continue; - if (r.includes(s.oneof)) - throw new Error(`Multiple members of the oneof group "${s.oneof}" of ${this.info.typeName} are present in JSON.`); - r.push(s.oneof), f = t[s.oneof] = { - oneofKind: l - }; - } else - f = t; - if (s.kind == "map") { - if (o === null) - continue; - this.assert(Ve(o), s.name, o); - const h = f[l]; - for (const [k, p] of Object.entries(o)) { - this.assert(p !== null, s.name + " map value", null); - let R; - switch (s.V.kind) { - case "message": - R = s.V.T().internalJsonRead(p, i); - break; - case "enum": - if (R = this.enum(s.V.T(), p, s.name, i.ignoreUnknownFields), R === !1) - continue; - break; - case "scalar": - R = this.scalar(p, s.V.T, s.V.L, s.name); - break; - } - this.assert(R !== void 0, s.name + " map value", p); - let E = k; - s.K == c.BOOL && (E = E == "true" ? !0 : E == "false" ? !1 : E), E = this.scalar(E, s.K, F.STRING, s.name).toString(), h[E] = R; - } - } else if (s.repeat) { - if (o === null) - continue; - this.assert(Array.isArray(o), s.name, o); - const h = f[l]; - for (const k of o) { - this.assert(k !== null, s.name, null); - let p; - switch (s.kind) { - case "message": - p = s.T().internalJsonRead(k, i); - break; - case "enum": - if (p = this.enum(s.T(), k, s.name, i.ignoreUnknownFields), p === !1) - continue; - break; - case "scalar": - p = this.scalar(k, s.T, s.L, s.name); - break; - } - this.assert(p !== void 0, s.name, o), h.push(p); - } - } else - switch (s.kind) { - case "message": - if (o === null && s.T().typeName != "google.protobuf.Value") { - this.assert(s.oneof === void 0, s.name + " (oneof member)", null); - continue; - } - f[l] = s.T().internalJsonRead(o, i, f[l]); - break; - case "enum": - if (o === null) - continue; - let h = this.enum(s.T(), o, s.name, i.ignoreUnknownFields); - if (h === !1) - continue; - f[l] = h; - break; - case "scalar": - if (o === null) - continue; - f[l] = this.scalar(o, s.T, s.L, s.name); - break; - } - } - } - /** - * Returns `false` for unrecognized string representations. - * - * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`). - */ - enum(e, t, i, r) { - if (e[0] == "google.protobuf.NullValue" && g(t === null || t === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${i}, enum ${e[0]} only accepts null.`), t === null) - return 0; - switch (typeof t) { - case "number": - return g(Number.isInteger(t), `Unable to parse field ${this.info.typeName}#${i}, enum can only be integral number, got ${t}.`), t; - case "string": - let n = t; - e[2] && t.substring(0, e[2].length) === e[2] && (n = t.substring(e[2].length)); - let o = e[1][n]; - return typeof o > "u" && r ? !1 : (g(typeof o == "number", `Unable to parse field ${this.info.typeName}#${i}, enum ${e[0]} has no value for "${t}".`), o); - } - g(!1, `Unable to parse field ${this.info.typeName}#${i}, cannot parse enum value from ${typeof t}".`); - } - scalar(e, t, i, r) { - let n; - try { - switch (t) { - // 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 c.DOUBLE: - case c.FLOAT: - if (e === null) - return 0; - if (e === "NaN") - return Number.NaN; - if (e === "Infinity") - return Number.POSITIVE_INFINITY; - if (e === "-Infinity") - return Number.NEGATIVE_INFINITY; - if (e === "") { - n = "empty string"; - break; - } - if (typeof e == "string" && e.trim().length !== e.length) { - n = "extra whitespace"; - break; - } - if (typeof e != "string" && typeof e != "number") - break; - let o = Number(e); - if (Number.isNaN(o)) { - n = "not a number"; - break; - } - if (!Number.isFinite(o)) { - n = "too large or small"; - break; - } - return t == c.FLOAT && de(o), o; - // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. - case c.INT32: - case c.FIXED32: - case c.SFIXED32: - case c.SINT32: - case c.UINT32: - if (e === null) - return 0; - let s; - if (typeof e == "number" ? s = e : e === "" ? n = "empty string" : typeof e == "string" && (e.trim().length !== e.length ? n = "extra whitespace" : s = Number(e)), s === void 0) - break; - return t == c.UINT32 ? _(s) : V(s), s; - // int64, fixed64, uint64: JSON value will be a decimal string. Either numbers or strings are accepted. - case c.INT64: - case c.SFIXED64: - case c.SINT64: - if (e === null) - return D(N.ZERO, i); - if (typeof e != "number" && typeof e != "string") - break; - return D(N.from(e), i); - case c.FIXED64: - case c.UINT64: - if (e === null) - return D(I.ZERO, i); - if (typeof e != "number" && typeof e != "string") - break; - return D(I.from(e), i); - // bool: - case c.BOOL: - if (e === null) - return !1; - if (typeof e != "boolean") - break; - return e; - // string: - case c.STRING: - if (e === null) - return ""; - if (typeof e != "string") { - n = "extra whitespace"; - break; - } - try { - encodeURIComponent(e); - } catch (l) { - l = "invalid UTF8"; - break; - } - return e; - // 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 c.BYTES: - if (e === null || e === "") - return new Uint8Array(0); - if (typeof e != "string") - break; - return We(e); - } - } catch (o) { - n = o.message; - } - this.assert(!1, r + (n ? " - " + n : ""), e); - } -} -class tt { - constructor(e) { - var t; - this.fields = (t = e.fields) !== null && t !== void 0 ? t : []; - } - /** - * Converts the message to a JSON object, based on the field descriptors. - */ - write(e, t) { - const i = {}, r = e; - for (const n of this.fields) { - if (!n.oneof) { - let f = this.field(n, r[n.localName], t); - f !== void 0 && (i[t.useProtoFieldName ? n.name : n.jsonName] = f); - continue; - } - const o = r[n.oneof]; - if (o.oneofKind !== n.localName) - continue; - const s = n.kind == "scalar" || n.kind == "enum" ? Object.assign(Object.assign({}, t), { emitDefaultValues: !0 }) : t; - let l = this.field(n, o[n.localName], s); - g(l !== void 0), i[t.useProtoFieldName ? n.name : n.jsonName] = l; - } - return i; - } - field(e, t, i) { - let r; - if (e.kind == "map") { - g(typeof t == "object" && t !== null); - const n = {}; - switch (e.V.kind) { - case "scalar": - for (const [l, f] of Object.entries(t)) { - const h = this.scalar(e.V.T, f, e.name, !1, !0); - g(h !== void 0), n[l.toString()] = h; - } - break; - case "message": - const o = e.V.T(); - for (const [l, f] of Object.entries(t)) { - const h = this.message(o, f, e.name, i); - g(h !== void 0), n[l.toString()] = h; - } - break; - case "enum": - const s = e.V.T(); - for (const [l, f] of Object.entries(t)) { - g(f === void 0 || typeof f == "number"); - const h = this.enum(s, f, e.name, !1, !0, i.enumAsInteger); - g(h !== void 0), n[l.toString()] = h; - } - break; - } - (i.emitDefaultValues || Object.keys(n).length > 0) && (r = n); - } else if (e.repeat) { - g(Array.isArray(t)); - const n = []; - switch (e.kind) { - case "scalar": - for (let l = 0; l < t.length; l++) { - const f = this.scalar(e.T, t[l], e.name, e.opt, !0); - g(f !== void 0), n.push(f); - } - break; - case "enum": - const o = e.T(); - for (let l = 0; l < t.length; l++) { - g(t[l] === void 0 || typeof t[l] == "number"); - const f = this.enum(o, t[l], e.name, e.opt, !0, i.enumAsInteger); - g(f !== void 0), n.push(f); - } - break; - case "message": - const s = e.T(); - for (let l = 0; l < t.length; l++) { - const f = this.message(s, t[l], e.name, i); - g(f !== void 0), n.push(f); - } - break; - } - (i.emitDefaultValues || n.length > 0 || i.emitDefaultValues) && (r = n); - } else - switch (e.kind) { - case "scalar": - r = this.scalar(e.T, t, e.name, e.opt, i.emitDefaultValues); - break; - case "enum": - r = this.enum(e.T(), t, e.name, e.opt, i.emitDefaultValues, i.enumAsInteger); - break; - case "message": - r = this.message(e.T(), t, e.name, i); - break; - } - return r; - } - /** - * Returns `null` as the default for google.protobuf.NullValue. - */ - enum(e, t, i, r, n, o) { - if (e[0] == "google.protobuf.NullValue") - return !n && !r ? void 0 : null; - if (t === void 0) { - g(r); - return; - } - if (!(t === 0 && !n && !r)) - return g(typeof t == "number"), g(Number.isInteger(t)), o || !e[1].hasOwnProperty(t) ? t : e[2] ? e[2] + e[1][t] : e[1][t]; - } - message(e, t, i, r) { - return t === void 0 ? r.emitDefaultValues ? null : void 0 : e.internalJsonWrite(t, r); - } - scalar(e, t, i, r, n) { - if (t === void 0) { - g(r); - return; - } - const o = n || r; - switch (e) { - // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. - case c.INT32: - case c.SFIXED32: - case c.SINT32: - return t === 0 ? o ? 0 : void 0 : (V(t), t); - case c.FIXED32: - case c.UINT32: - return t === 0 ? o ? 0 : void 0 : (_(t), t); - // 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 c.FLOAT: - de(t); - case c.DOUBLE: - return t === 0 ? o ? 0 : void 0 : (g(typeof t == "number"), Number.isNaN(t) ? "NaN" : t === Number.POSITIVE_INFINITY ? "Infinity" : t === Number.NEGATIVE_INFINITY ? "-Infinity" : t); - // string: - case c.STRING: - return t === "" ? o ? "" : void 0 : (g(typeof t == "string"), t); - // bool: - case c.BOOL: - return t === !1 ? o ? !1 : void 0 : (g(typeof t == "boolean"), t); - // JSON value will be a decimal string. Either numbers or strings are accepted. - case c.UINT64: - case c.FIXED64: - g(typeof t == "number" || typeof t == "string" || typeof t == "bigint"); - let s = I.from(t); - return s.isZero() && !o ? void 0 : s.toString(); - // JSON value will be a decimal string. Either numbers or strings are accepted. - case c.INT64: - case c.SFIXED64: - case c.SINT64: - g(typeof t == "number" || typeof t == "string" || typeof t == "bigint"); - let l = N.from(t); - return l.isZero() && !o ? void 0 : l.toString(); - // 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 c.BYTES: - return g(t instanceof Uint8Array), t.byteLength ? Ke(t) : o ? "" : void 0; - } - } -} -function fe(a, e = F.STRING) { - switch (a) { - case c.BOOL: - return !1; - case c.UINT64: - case c.FIXED64: - return D(I.ZERO, e); - case c.INT64: - case c.SFIXED64: - case c.SINT64: - return D(N.ZERO, e); - case c.DOUBLE: - case c.FLOAT: - return 0; - case c.BYTES: - return new Uint8Array(0); - case c.STRING: - return ""; - default: - return 0; - } -} -class nt { - constructor(e) { - this.info = e; - } - prepare() { - var e; - if (!this.fieldNoToField) { - const t = (e = this.info.fields) !== null && e !== void 0 ? e : []; - this.fieldNoToField = new Map(t.map((i) => [i.no, i])); - } - } - /** - * Reads a message from binary format into the target message. - * - * 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. - */ - read(e, t, i, r) { - this.prepare(); - const n = r === void 0 ? e.len : e.pos + r; - for (; e.pos < n; ) { - const [o, s] = e.tag(), l = this.fieldNoToField.get(o); - if (!l) { - let p = i.readUnknownField; - if (p == "throw") - throw new Error(`Unknown field ${o} (wire type ${s}) for ${this.info.typeName}`); - let R = e.skip(s); - p !== !1 && (p === !0 ? y.onRead : p)(this.info.typeName, t, o, s, R); - continue; - } - let f = t, h = l.repeat, k = l.localName; - switch (l.oneof && (f = f[l.oneof], f.oneofKind !== k && (f = t[l.oneof] = { - oneofKind: k - })), l.kind) { - case "scalar": - case "enum": - let p = l.kind == "enum" ? c.INT32 : l.T, R = l.kind == "scalar" ? l.L : void 0; - if (h) { - let W = f[k]; - if (s == u.LengthDelimited && p != c.STRING && p != c.BYTES) { - let X = e.uint32() + e.pos; - for (; e.pos < X; ) - W.push(this.scalar(e, p, R)); - } else - W.push(this.scalar(e, p, R)); - } else - f[k] = this.scalar(e, p, R); - break; - case "message": - if (h) { - let W = f[k], X = l.T().internalBinaryRead(e, e.uint32(), i); - W.push(X); - } else - f[k] = l.T().internalBinaryRead(e, e.uint32(), i, f[k]); - break; - case "map": - let [E, Ue] = this.mapEntry(l, e, i); - f[k][E] = Ue; - break; - } - } - } - /** - * Read a map field, expecting key field = 1, value field = 2 - */ - mapEntry(e, t, i) { - let r = t.uint32(), n = t.pos + r, o, s; - for (; t.pos < n; ) { - let [l, f] = t.tag(); - switch (l) { - case 1: - e.K == c.BOOL ? o = t.bool().toString() : o = this.scalar(t, e.K, F.STRING); - break; - case 2: - switch (e.V.kind) { - case "scalar": - s = this.scalar(t, e.V.T, e.V.L); - break; - case "enum": - s = t.int32(); - break; - case "message": - s = e.V.T().internalBinaryRead(t, t.uint32(), i); - break; - } - break; - default: - throw new Error(`Unknown field ${l} (wire type ${f}) in map entry for ${this.info.typeName}#${e.name}`); - } - } - if (o === void 0) { - let l = fe(e.K); - o = e.K == c.BOOL ? l.toString() : l; - } - if (s === void 0) - switch (e.V.kind) { - case "scalar": - s = fe(e.V.T, e.V.L); - break; - case "enum": - s = 0; - break; - case "message": - s = e.V.T().create(); - break; - } - return [o, s]; - } - scalar(e, t, i) { - switch (t) { - case c.INT32: - return e.int32(); - case c.STRING: - return e.string(); - case c.BOOL: - return e.bool(); - case c.DOUBLE: - return e.double(); - case c.FLOAT: - return e.float(); - case c.INT64: - return D(e.int64(), i); - case c.UINT64: - return D(e.uint64(), i); - case c.FIXED64: - return D(e.fixed64(), i); - case c.FIXED32: - return e.fixed32(); - case c.BYTES: - return e.bytes(); - case c.UINT32: - return e.uint32(); - case c.SFIXED32: - return e.sfixed32(); - case c.SFIXED64: - return D(e.sfixed64(), i); - case c.SINT32: - return e.sint32(); - case c.SINT64: - return D(e.sint64(), i); - } - } -} -class it { - constructor(e) { - this.info = e; - } - prepare() { - if (!this.fields) { - const e = this.info.fields ? this.info.fields.concat() : []; - this.fields = e.sort((t, i) => t.no - i.no); - } - } - /** - * Writes the message to binary format. - */ - write(e, t, i) { - this.prepare(); - for (const n of this.fields) { - let o, s, l = n.repeat, f = n.localName; - if (n.oneof) { - const h = e[n.oneof]; - if (h.oneofKind !== f) - continue; - o = h[f], s = !0; - } else - o = e[f], s = !1; - switch (n.kind) { - case "scalar": - case "enum": - let h = n.kind == "enum" ? c.INT32 : n.T; - if (l) - if (g(Array.isArray(o)), l == S.PACKED) - this.packed(t, h, n.no, o); - else - for (const k of o) - this.scalar(t, h, n.no, k, !0); - else o === void 0 ? g(n.opt) : this.scalar(t, h, n.no, o, s || n.opt); - break; - case "message": - if (l) { - g(Array.isArray(o)); - for (const k of o) - this.message(t, i, n.T(), n.no, k); - } else - this.message(t, i, n.T(), n.no, o); - break; - case "map": - g(typeof o == "object" && o !== null); - for (const [k, p] of Object.entries(o)) - this.mapEntry(t, i, n, k, p); - break; - } - } - let r = i.writeUnknownFields; - r !== !1 && (r === !0 ? y.onWrite : r)(this.info.typeName, e, t); - } - mapEntry(e, t, i, r, n) { - e.tag(i.no, u.LengthDelimited), e.fork(); - let o = r; - switch (i.K) { - case c.INT32: - case c.FIXED32: - case c.UINT32: - case c.SFIXED32: - case c.SINT32: - o = Number.parseInt(r); - break; - case c.BOOL: - g(r == "true" || r == "false"), o = r == "true"; - break; - } - switch (this.scalar(e, i.K, 1, o, !0), i.V.kind) { - case "scalar": - this.scalar(e, i.V.T, 2, n, !0); - break; - case "enum": - this.scalar(e, c.INT32, 2, n, !0); - break; - case "message": - this.message(e, t, i.V.T(), 2, n); - break; - } - e.join(); - } - message(e, t, i, r, n) { - n !== void 0 && (i.internalBinaryWrite(n, e.tag(r, u.LengthDelimited).fork(), t), e.join()); - } - /** - * Write a single scalar value. - */ - scalar(e, t, i, r, n) { - let [o, s, l] = this.scalarInfo(t, r); - (!l || n) && (e.tag(i, o), e[s](r)); - } - /** - * Write an array of scalar values in packed format. - */ - packed(e, t, i, r) { - if (!r.length) - return; - g(t !== c.BYTES && t !== c.STRING), e.tag(i, u.LengthDelimited), e.fork(); - let [, n] = this.scalarInfo(t); - for (let o = 0; o < r.length; o++) - e[n](r[o]); - e.join(); - } - /** - * Get information for writing a scalar value. - * - * Returns tuple: - * [0]: appropriate WireType - * [1]: name of the appropriate method of IBinaryWriter - * [2]: whether the given value is a default value - * - * If argument `value` is omitted, [2] is always false. - */ - scalarInfo(e, t) { - let i = u.Varint, r, n = t === void 0, o = t === 0; - switch (e) { - case c.INT32: - r = "int32"; - break; - case c.STRING: - o = n || !t.length, i = u.LengthDelimited, r = "string"; - break; - case c.BOOL: - o = t === !1, r = "bool"; - break; - case c.UINT32: - r = "uint32"; - break; - case c.DOUBLE: - i = u.Bit64, r = "double"; - break; - case c.FLOAT: - i = u.Bit32, r = "float"; - break; - case c.INT64: - o = n || N.from(t).isZero(), r = "int64"; - break; - case c.UINT64: - o = n || I.from(t).isZero(), r = "uint64"; - break; - case c.FIXED64: - o = n || I.from(t).isZero(), i = u.Bit64, r = "fixed64"; - break; - case c.BYTES: - o = n || !t.byteLength, i = u.LengthDelimited, r = "bytes"; - break; - case c.FIXED32: - i = u.Bit32, r = "fixed32"; - break; - case c.SFIXED32: - i = u.Bit32, r = "sfixed32"; - break; - case c.SFIXED64: - o = n || N.from(t).isZero(), i = u.Bit64, r = "sfixed64"; - break; - case c.SINT32: - r = "sint32"; - break; - case c.SINT64: - o = n || N.from(t).isZero(), r = "sint64"; - break; - } - return [i, r, n || o]; - } -} -function rt(a) { - const e = a.messagePrototype ? Object.create(a.messagePrototype) : Object.defineProperty({}, Ee, { value: a }); - for (let t of a.fields) { - let i = t.localName; - if (!t.opt) - if (t.oneof) - e[t.oneof] = { oneofKind: void 0 }; - else if (t.repeat) - e[i] = []; - else - switch (t.kind) { - case "scalar": - e[i] = fe(t.T, t.L); - break; - case "enum": - e[i] = 0; - break; - case "map": - e[i] = {}; - break; - } - } - return e; -} -function m(a, e, t) { - let i, r = t, n; - for (let o of a.fields) { - let s = o.localName; - if (o.oneof) { - const l = r[o.oneof]; - if (l?.oneofKind == null) - continue; - if (i = l[s], n = e[o.oneof], n.oneofKind = l.oneofKind, i == null) { - delete n[s]; - continue; - } - } else if (i = r[s], n = e, i == null) - continue; - switch (o.repeat && (n[s].length = i.length), o.kind) { - case "scalar": - case "enum": - if (o.repeat) - for (let f = 0; f < i.length; f++) - n[s][f] = i[f]; - else - n[s] = i; - break; - case "message": - let l = o.T(); - if (o.repeat) - for (let f = 0; f < i.length; f++) - n[s][f] = l.create(i[f]); - else n[s] === void 0 ? n[s] = l.create(i) : l.mergePartial(n[s], i); - break; - case "map": - switch (o.V.kind) { - case "scalar": - case "enum": - Object.assign(n[s], i); - break; - case "message": - let f = o.V.T(); - for (let h of Object.keys(i)) - n[s][h] = f.create(i[h]); - break; - } - break; - } - } -} -function at(a, e, t) { - if (e === t) - return !0; - if (!e || !t) - return !1; - for (let i of a.fields) { - let r = i.localName, n = i.oneof ? e[i.oneof][r] : e[r], o = i.oneof ? t[i.oneof][r] : t[r]; - switch (i.kind) { - case "enum": - case "scalar": - let s = i.kind == "enum" ? c.INT32 : i.T; - if (!(i.repeat ? we(s, n, o) : Oe(s, n, o))) - return !1; - break; - case "map": - if (!(i.V.kind == "message" ? Ne(i.V.T(), j(n), j(o)) : we(i.V.kind == "enum" ? c.INT32 : i.V.T, j(n), j(o)))) - return !1; - break; - case "message": - let l = i.T(); - if (!(i.repeat ? Ne(l, n, o) : l.equals(n, o))) - return !1; - break; - } - } - return !0; -} -const j = Object.values; -function Oe(a, e, t) { - if (e === t) - return !0; - if (a !== c.BYTES) - return !1; - let i = e, r = t; - if (i.length !== r.length) - return !1; - for (let n = 0; n < i.length; n++) - if (i[n] != r[n]) - return !1; - return !0; -} -function we(a, e, t) { - if (e.length !== t.length) - return !1; - for (let i = 0; i < e.length; i++) - if (!Oe(a, e[i], t[i])) - return !1; - return !0; -} -function Ne(a, e, t) { - if (e.length !== t.length) - return !1; - for (let i = 0; i < e.length; i++) - if (!a.equals(e[i], t[i])) - return !1; - return !0; -} -const Le = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})), st = Le[Ee] = {}; -class T { - constructor(e, t, i) { - this.defaultCheckDepth = 16, this.typeName = e, this.fields = t.map(Qe), this.options = i ?? {}, st.value = this, this.messagePrototype = Object.create(null, Le), this.refTypeCheck = new ve(this), this.refJsonReader = new et(this), this.refJsonWriter = new tt(this), this.refBinReader = new nt(this), this.refBinWriter = new it(this); - } - create(e) { - let t = rt(this); - return e !== void 0 && m(this, t, e), t; - } - /** - * Clone the message. - * - * Unknown fields are discarded. - */ - clone(e) { - let t = this.create(); - return m(this, t, e), t; - } - /** - * Determines whether two message of the same type have the same field values. - * Checks for deep equality, traversing repeated fields, oneof groups, maps - * and messages recursively. - * Will also return true if both messages are `undefined`. - */ - equals(e, t) { - return at(this, e, t); - } - /** - * Is the given value assignable to our message type - * and contains no [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)? - */ - is(e, t = this.defaultCheckDepth) { - return this.refTypeCheck.is(e, t, !1); - } - /** - * Is the given value assignable to our message type, - * regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)? - */ - isAssignable(e, t = this.defaultCheckDepth) { - return this.refTypeCheck.is(e, t, !0); - } - /** - * Copy partial data into the target message. - */ - mergePartial(e, t) { - m(this, e, t); - } - /** - * Create a new message from binary format. - */ - fromBinary(e, t) { - let i = _e(t); - return this.internalBinaryRead(i.readerFactory(e), e.byteLength, i); - } - /** - * Read a new message from a JSON value. - */ - fromJson(e, t) { - return this.internalJsonRead(e, qe(t)); - } - /** - * Read a new message from a JSON string. - * This is equivalent to `T.fromJson(JSON.parse(json))`. - */ - fromJsonString(e, t) { - let i = JSON.parse(e); - return this.fromJson(i, t); - } - /** - * Write the message to canonical JSON value. - */ - toJson(e, t) { - return this.internalJsonWrite(e, ze(t)); - } - /** - * Convert the message to canonical JSON string. - * This is equivalent to `JSON.stringify(T.toJson(t))` - */ - toJsonString(e, t) { - var i; - let r = this.toJson(e, t); - return JSON.stringify(r, null, (i = t?.prettySpaces) !== null && i !== void 0 ? i : 0); - } - /** - * Write the message to binary format. - */ - toBinary(e, t) { - let i = Ze(t); - return this.internalBinaryWrite(e, i.writerFactory(), i).finish(); - } - /** - * This is an internal method. If you just want to read a message from - * JSON, use `fromJson()` or `fromJsonString()`. - * - * Reads JSON value and merges the fields into the target - * according to protobuf rules. If the target is omitted, - * a new instance is created first. - */ - internalJsonRead(e, t, i) { - if (e !== null && typeof e == "object" && !Array.isArray(e)) { - let r = i ?? this.create(); - return this.refJsonReader.read(e, r, t), r; - } - throw new Error(`Unable to parse message ${this.typeName} from JSON ${Be(e)}.`); - } - /** - * This is an internal method. If you just want to write a message - * to JSON, use `toJson()` or `toJsonString(). - * - * Writes JSON value and returns it. - */ - internalJsonWrite(e, t) { - return this.refJsonWriter.write(e, t); - } - /** - * This is an internal method. If you just want to write a message - * in binary format, use `toBinary()`. - * - * Serializes the message in binary format and appends it to the given - * writer. Returns passed writer. - */ - internalBinaryWrite(e, t, i) { - return this.refBinWriter.write(e, t, i), t; - } - /** - * This is an internal method. If you just want to read a message from - * binary data, use `fromBinary()`. - * - * Reads data from binary format and merges the fields into - * the target according to protobuf rules. If the target is - * omitted, a new instance is created first. - */ - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(); - return this.refBinReader.read(e, n, i, t), n; - } -} -var ue; -(function(a) { - a[a.NULL_VALUE = 0] = "NULL_VALUE"; -})(ue || (ue = {})); -class ot extends T { - constructor() { - super("shared.Struct", [ - { no: 1, name: "fields", kind: "map", K: 9, V: { kind: "message", T: () => B } } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.fields = {}, e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* map fields */ - 1: - this.binaryReadMap1(n.fields, e, i); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - binaryReadMap1(e, t, i) { - let r = t.uint32(), n = t.pos + r, o, s; - for (; t.pos < n; ) { - let [l, f] = t.tag(); - switch (l) { - case 1: - o = t.string(); - break; - case 2: - s = B.internalBinaryRead(t, t.uint32(), i); - break; - default: - throw new globalThis.Error("unknown map entry field for shared.Struct.fields"); - } - } - e[o ?? ""] = s ?? B.create(); - } - internalBinaryWrite(e, t, i) { - for (let n of globalThis.Object.keys(e.fields)) - t.tag(1, u.LengthDelimited).fork().tag(1, u.LengthDelimited).string(n), t.tag(2, u.LengthDelimited).fork(), B.internalBinaryWrite(e.fields[n], t, i), t.join().join(); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const G = new ot(); -class lt extends T { - constructor() { - super("shared.Value", [ - { no: 1, name: "null_value", kind: "enum", oneof: "kind", T: () => ["shared.NullValue", ue] }, - { - no: 2, - name: "number_value", - kind: "scalar", - oneof: "kind", - T: 1 - /*ScalarType.DOUBLE*/ - }, - { - no: 3, - name: "string_value", - kind: "scalar", - oneof: "kind", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 4, - name: "bool_value", - kind: "scalar", - oneof: "kind", - T: 8 - /*ScalarType.BOOL*/ - }, - { no: 5, name: "struct_value", kind: "message", oneof: "kind", T: () => G }, - { no: 6, name: "list_value", kind: "message", oneof: "kind", T: () => Z } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.kind = { oneofKind: void 0 }, e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* shared.NullValue null_value */ - 1: - n.kind = { - oneofKind: "nullValue", - nullValue: e.int32() - }; - break; - case /* double number_value */ - 2: - n.kind = { - oneofKind: "numberValue", - numberValue: e.double() - }; - break; - case /* string string_value */ - 3: - n.kind = { - oneofKind: "stringValue", - stringValue: e.string() - }; - break; - case /* bool bool_value */ - 4: - n.kind = { - oneofKind: "boolValue", - boolValue: e.bool() - }; - break; - case /* shared.Struct struct_value */ - 5: - n.kind = { - oneofKind: "structValue", - structValue: G.internalBinaryRead(e, e.uint32(), i, n.kind.structValue) - }; - break; - case /* shared.ListValue list_value */ - 6: - n.kind = { - oneofKind: "listValue", - listValue: Z.internalBinaryRead(e, e.uint32(), i, n.kind.listValue) - }; - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.kind.oneofKind === "nullValue" && t.tag(1, u.Varint).int32(e.kind.nullValue), e.kind.oneofKind === "numberValue" && t.tag(2, u.Bit64).double(e.kind.numberValue), e.kind.oneofKind === "stringValue" && t.tag(3, u.LengthDelimited).string(e.kind.stringValue), e.kind.oneofKind === "boolValue" && t.tag(4, u.Varint).bool(e.kind.boolValue), e.kind.oneofKind === "structValue" && G.internalBinaryWrite(e.kind.structValue, t.tag(5, u.LengthDelimited).fork(), i).join(), e.kind.oneofKind === "listValue" && Z.internalBinaryWrite(e.kind.listValue, t.tag(6, u.LengthDelimited).fork(), i).join(); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const B = new lt(); -class ft extends T { - constructor() { - super("shared.ListValue", [ - { no: 1, name: "values", kind: "message", repeat: 2, T: () => B } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.values = [], e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* repeated shared.Value values */ - 1: - n.values.push(B.internalBinaryRead(e, e.uint32(), i)); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - for (let n = 0; n < e.values.length; n++) - B.internalBinaryWrite(e.values[n], t.tag(1, u.LengthDelimited).fork(), i).join(); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const Z = new ft(); -class ut extends T { - constructor() { - super("shared.Translation", [ - { - no: 1, - name: "code", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 2, - name: "content", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.code = "", t.content = "", e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* string code */ - 1: - n.code = e.string(); - break; - case /* string content */ - 2: - n.content = e.string(); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.code !== "" && t.tag(1, u.LengthDelimited).string(e.code), e.content !== "" && t.tag(2, u.LengthDelimited).string(e.content); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const d = new ut(); -class ct extends T { - constructor() { - super("shared.FlowType", [ - { - no: 1, - name: "identifier", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { no: 2, name: "settings", kind: "message", repeat: 2, T: () => Y }, - { - no: 3, - name: "input_type_identifier", - kind: "scalar", - opt: !0, - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 4, - name: "return_type_identifier", - kind: "scalar", - opt: !0, - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 5, - name: "editable", - kind: "scalar", - T: 8 - /*ScalarType.BOOL*/ - }, - { no: 6, name: "name", kind: "message", repeat: 2, T: () => d }, - { no: 7, name: "description", kind: "message", repeat: 2, T: () => d }, - { no: 8, name: "documentation", kind: "message", repeat: 2, T: () => d }, - { no: 9, name: "display_message", kind: "message", repeat: 2, T: () => d }, - { no: 10, name: "alias", kind: "message", repeat: 2, T: () => d }, - { - no: 11, - name: "version", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.identifier = "", t.settings = [], t.editable = !1, t.name = [], t.description = [], t.documentation = [], t.displayMessage = [], t.alias = [], t.version = "", e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* string identifier */ - 1: - n.identifier = e.string(); - break; - case /* repeated shared.FlowTypeSetting settings */ - 2: - n.settings.push(Y.internalBinaryRead(e, e.uint32(), i)); - break; - case /* optional string input_type_identifier */ - 3: - n.inputTypeIdentifier = e.string(); - break; - case /* optional string return_type_identifier */ - 4: - n.returnTypeIdentifier = e.string(); - break; - case /* bool editable */ - 5: - n.editable = e.bool(); - break; - case /* repeated shared.Translation name */ - 6: - n.name.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated shared.Translation description */ - 7: - n.description.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated shared.Translation documentation */ - 8: - n.documentation.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated shared.Translation display_message */ - 9: - n.displayMessage.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated shared.Translation alias */ - 10: - n.alias.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* string version */ - 11: - n.version = e.string(); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.identifier !== "" && t.tag(1, u.LengthDelimited).string(e.identifier); - for (let n = 0; n < e.settings.length; n++) - Y.internalBinaryWrite(e.settings[n], t.tag(2, u.LengthDelimited).fork(), i).join(); - e.inputTypeIdentifier !== void 0 && t.tag(3, u.LengthDelimited).string(e.inputTypeIdentifier), e.returnTypeIdentifier !== void 0 && t.tag(4, u.LengthDelimited).string(e.returnTypeIdentifier), e.editable !== !1 && t.tag(5, u.Varint).bool(e.editable); - for (let n = 0; n < e.name.length; n++) - d.internalBinaryWrite(e.name[n], t.tag(6, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.description.length; n++) - d.internalBinaryWrite(e.description[n], t.tag(7, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.documentation.length; n++) - d.internalBinaryWrite(e.documentation[n], t.tag(8, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.displayMessage.length; n++) - d.internalBinaryWrite(e.displayMessage[n], t.tag(9, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.alias.length; n++) - d.internalBinaryWrite(e.alias[n], t.tag(10, u.LengthDelimited).fork(), i).join(); - e.version !== "" && t.tag(11, u.LengthDelimited).string(e.version); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const ht = new ct(); -class dt extends T { - constructor() { - super("shared.FlowTypeSetting", [ - { - no: 1, - name: "identifier", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 2, - name: "unique", - kind: "scalar", - T: 8 - /*ScalarType.BOOL*/ - }, - { - no: 3, - name: "data_type_identifier", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { no: 4, name: "default_value", kind: "message", T: () => B }, - { no: 5, name: "name", kind: "message", repeat: 2, T: () => d }, - { no: 6, name: "description", kind: "message", repeat: 2, T: () => d } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.identifier = "", t.unique = !1, t.dataTypeIdentifier = "", t.name = [], t.description = [], e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* string identifier */ - 1: - n.identifier = e.string(); - break; - case /* bool unique */ - 2: - n.unique = e.bool(); - break; - case /* string data_type_identifier */ - 3: - n.dataTypeIdentifier = e.string(); - break; - case /* optional shared.Value default_value */ - 4: - n.defaultValue = B.internalBinaryRead(e, e.uint32(), i, n.defaultValue); - break; - case /* repeated shared.Translation name */ - 5: - n.name.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated shared.Translation description */ - 6: - n.description.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.identifier !== "" && t.tag(1, u.LengthDelimited).string(e.identifier), e.unique !== !1 && t.tag(2, u.Varint).bool(e.unique), e.dataTypeIdentifier !== "" && t.tag(3, u.LengthDelimited).string(e.dataTypeIdentifier), e.defaultValue && B.internalBinaryWrite(e.defaultValue, t.tag(4, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.name.length; n++) - d.internalBinaryWrite(e.name[n], t.tag(5, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.description.length; n++) - d.internalBinaryWrite(e.description[n], t.tag(6, u.LengthDelimited).fork(), i).join(); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const Y = new dt(); -var ce; -(function(a) { - a[a.UNKNOWN = 0] = "UNKNOWN", a[a.PRIMITIVE = 1] = "PRIMITIVE", a[a.TYPE = 2] = "TYPE", a[a.OBJECT = 3] = "OBJECT", a[a.DATATYPE = 4] = "DATATYPE", a[a.ARRAY = 5] = "ARRAY", a[a.ERROR = 6] = "ERROR", a[a.NODE = 7] = "NODE"; -})(ce || (ce = {})); -var he; -(function(a) { - a[a.UNKNOWN = 0] = "UNKNOWN", a[a.AND = 1] = "AND", a[a.OR = 2] = "OR"; -})(he || (he = {})); -class yt extends T { - constructor() { - super("shared.DefinitionDataType", [ - { no: 1, name: "variant", kind: "enum", T: () => ["shared.DefinitionDataType.Variant", ce] }, - { - no: 2, - name: "identifier", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { no: 3, name: "name", kind: "message", repeat: 2, T: () => d }, - { no: 4, name: "display_message", kind: "message", repeat: 2, T: () => d }, - { no: 5, name: "alias", kind: "message", repeat: 2, T: () => d }, - { no: 6, name: "rules", kind: "message", repeat: 2, T: () => q }, - { - no: 7, - name: "generic_keys", - kind: "scalar", - repeat: 2, - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 8, - name: "version", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.variant = 0, t.identifier = "", t.name = [], t.displayMessage = [], t.alias = [], t.rules = [], t.genericKeys = [], t.version = "", e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* shared.DefinitionDataType.Variant variant */ - 1: - n.variant = e.int32(); - break; - case /* string identifier */ - 2: - n.identifier = e.string(); - break; - case /* repeated shared.Translation name */ - 3: - n.name.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated shared.Translation display_message */ - 4: - n.displayMessage.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated shared.Translation alias */ - 5: - n.alias.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated shared.DefinitionDataTypeRule rules */ - 6: - n.rules.push(q.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated string generic_keys */ - 7: - n.genericKeys.push(e.string()); - break; - case /* string version */ - 8: - n.version = e.string(); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.variant !== 0 && t.tag(1, u.Varint).int32(e.variant), e.identifier !== "" && t.tag(2, u.LengthDelimited).string(e.identifier); - for (let n = 0; n < e.name.length; n++) - d.internalBinaryWrite(e.name[n], t.tag(3, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.displayMessage.length; n++) - d.internalBinaryWrite(e.displayMessage[n], t.tag(4, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.alias.length; n++) - d.internalBinaryWrite(e.alias[n], t.tag(5, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.rules.length; n++) - q.internalBinaryWrite(e.rules[n], t.tag(6, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.genericKeys.length; n++) - t.tag(7, u.LengthDelimited).string(e.genericKeys[n]); - e.version !== "" && t.tag(8, u.LengthDelimited).string(e.version); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const pt = new yt(); -class gt extends T { - constructor() { - super("shared.ExecutionDataType", [ - { - no: 1, - name: "identifier", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { no: 2, name: "rules", kind: "message", repeat: 2, T: () => z } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.identifier = "", t.rules = [], e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* string identifier */ - 1: - n.identifier = e.string(); - break; - case /* repeated shared.ExecutionDataTypeRule rules */ - 2: - n.rules.push(z.internalBinaryRead(e, e.uint32(), i)); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.identifier !== "" && t.tag(1, u.LengthDelimited).string(e.identifier); - for (let n = 0; n < e.rules.length; n++) - z.internalBinaryWrite(e.rules[n], t.tag(2, u.LengthDelimited).fork(), i).join(); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -new gt(); -class mt extends T { - constructor() { - super("shared.DefinitionDataTypeRule", [ - { no: 1, name: "contains_key", kind: "message", oneof: "config", T: () => H }, - { no: 2, name: "contains_type", kind: "message", oneof: "config", T: () => ee }, - { no: 3, name: "item_of_collection", kind: "message", oneof: "config", T: () => L }, - { no: 4, name: "number_range", kind: "message", oneof: "config", T: () => U }, - { no: 5, name: "regex", kind: "message", oneof: "config", T: () => $ }, - { no: 6, name: "input_types", kind: "message", oneof: "config", T: () => ne }, - { no: 7, name: "return_type", kind: "message", oneof: "config", T: () => re }, - { no: 8, name: "parent_type", kind: "message", oneof: "config", T: () => Q } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.config = { oneofKind: void 0 }, e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* shared.DefinitionDataTypeContainsKeyRuleConfig contains_key */ - 1: - n.config = { - oneofKind: "containsKey", - containsKey: H.internalBinaryRead(e, e.uint32(), i, n.config.containsKey) - }; - break; - case /* shared.DefinitionDataTypeContainsTypeRuleConfig contains_type */ - 2: - n.config = { - oneofKind: "containsType", - containsType: ee.internalBinaryRead(e, e.uint32(), i, n.config.containsType) - }; - break; - case /* shared.DataTypeItemOfCollectionRuleConfig item_of_collection */ - 3: - n.config = { - oneofKind: "itemOfCollection", - itemOfCollection: L.internalBinaryRead(e, e.uint32(), i, n.config.itemOfCollection) - }; - break; - case /* shared.DataTypeNumberRangeRuleConfig number_range */ - 4: - n.config = { - oneofKind: "numberRange", - numberRange: U.internalBinaryRead(e, e.uint32(), i, n.config.numberRange) - }; - break; - case /* shared.DataTypeRegexRuleConfig regex */ - 5: - n.config = { - oneofKind: "regex", - regex: $.internalBinaryRead(e, e.uint32(), i, n.config.regex) - }; - break; - case /* shared.DefinitionDataTypeInputTypesRuleConfig input_types */ - 6: - n.config = { - oneofKind: "inputTypes", - inputTypes: ne.internalBinaryRead(e, e.uint32(), i, n.config.inputTypes) - }; - break; - case /* shared.DefinitionDataTypeReturnTypeRuleConfig return_type */ - 7: - n.config = { - oneofKind: "returnType", - returnType: re.internalBinaryRead(e, e.uint32(), i, n.config.returnType) - }; - break; - case /* shared.DefinitionDataTypeParentTypeRuleConfig parent_type */ - 8: - n.config = { - oneofKind: "parentType", - parentType: Q.internalBinaryRead(e, e.uint32(), i, n.config.parentType) - }; - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.config.oneofKind === "containsKey" && H.internalBinaryWrite(e.config.containsKey, t.tag(1, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "containsType" && ee.internalBinaryWrite(e.config.containsType, t.tag(2, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "itemOfCollection" && L.internalBinaryWrite(e.config.itemOfCollection, t.tag(3, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "numberRange" && U.internalBinaryWrite(e.config.numberRange, t.tag(4, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "regex" && $.internalBinaryWrite(e.config.regex, t.tag(5, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "inputTypes" && ne.internalBinaryWrite(e.config.inputTypes, t.tag(6, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "returnType" && re.internalBinaryWrite(e.config.returnType, t.tag(7, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "parentType" && Q.internalBinaryWrite(e.config.parentType, t.tag(8, u.LengthDelimited).fork(), i).join(); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const q = new mt(); -class kt extends T { - constructor() { - super("shared.ExecutionDataTypeRule", [ - { no: 1, name: "contains_key", kind: "message", oneof: "config", T: () => v }, - { no: 2, name: "contains_type", kind: "message", oneof: "config", T: () => te }, - { no: 3, name: "item_of_collection", kind: "message", oneof: "config", T: () => L }, - { no: 4, name: "number_range", kind: "message", oneof: "config", T: () => U }, - { no: 5, name: "regex", kind: "message", oneof: "config", T: () => $ } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.config = { oneofKind: void 0 }, e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* shared.ExecutionDataTypeContainsKeyRuleConfig contains_key */ - 1: - n.config = { - oneofKind: "containsKey", - containsKey: v.internalBinaryRead(e, e.uint32(), i, n.config.containsKey) - }; - break; - case /* shared.ExecutionDataTypeContainsTypeRuleConfig contains_type */ - 2: - n.config = { - oneofKind: "containsType", - containsType: te.internalBinaryRead(e, e.uint32(), i, n.config.containsType) - }; - break; - case /* shared.DataTypeItemOfCollectionRuleConfig item_of_collection */ - 3: - n.config = { - oneofKind: "itemOfCollection", - itemOfCollection: L.internalBinaryRead(e, e.uint32(), i, n.config.itemOfCollection) - }; - break; - case /* shared.DataTypeNumberRangeRuleConfig number_range */ - 4: - n.config = { - oneofKind: "numberRange", - numberRange: U.internalBinaryRead(e, e.uint32(), i, n.config.numberRange) - }; - break; - case /* shared.DataTypeRegexRuleConfig regex */ - 5: - n.config = { - oneofKind: "regex", - regex: $.internalBinaryRead(e, e.uint32(), i, n.config.regex) - }; - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.config.oneofKind === "containsKey" && v.internalBinaryWrite(e.config.containsKey, t.tag(1, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "containsType" && te.internalBinaryWrite(e.config.containsType, t.tag(2, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "itemOfCollection" && L.internalBinaryWrite(e.config.itemOfCollection, t.tag(3, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "numberRange" && U.internalBinaryWrite(e.config.numberRange, t.tag(4, u.LengthDelimited).fork(), i).join(), e.config.oneofKind === "regex" && $.internalBinaryWrite(e.config.regex, t.tag(5, u.LengthDelimited).fork(), i).join(); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const z = new kt(); -class bt extends T { - constructor() { - super("shared.DefinitionDataTypeParentTypeRuleConfig", [ - { no: 1, name: "parent_type", kind: "message", T: () => w } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* shared.DataTypeIdentifier parent_type */ - 1: - n.parentType = w.internalBinaryRead(e, e.uint32(), i, n.parentType); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.parentType && w.internalBinaryWrite(e.parentType, t.tag(1, u.LengthDelimited).fork(), i).join(); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const Q = new bt(); -class Tt extends T { - constructor() { - super("shared.DefinitionDataTypeContainsKeyRuleConfig", [ - { - no: 1, - name: "key", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { no: 2, name: "data_type_identifier", kind: "message", T: () => w } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.key = "", e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* string key */ - 1: - n.key = e.string(); - break; - case /* shared.DataTypeIdentifier data_type_identifier */ - 2: - n.dataTypeIdentifier = w.internalBinaryRead(e, e.uint32(), i, n.dataTypeIdentifier); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.key !== "" && t.tag(1, u.LengthDelimited).string(e.key), e.dataTypeIdentifier && w.internalBinaryWrite(e.dataTypeIdentifier, t.tag(2, u.LengthDelimited).fork(), i).join(); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const H = new Tt(); -class wt extends T { - constructor() { - super("shared.ExecutionDataTypeContainsKeyRuleConfig", [ - { - no: 1, - name: "key", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { - no: 2, - name: "data_type_identifier", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.key = "", t.dataTypeIdentifier = "", e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* string key */ - 1: - n.key = e.string(); - break; - case /* string data_type_identifier */ - 2: - n.dataTypeIdentifier = e.string(); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.key !== "" && t.tag(1, u.LengthDelimited).string(e.key), e.dataTypeIdentifier !== "" && t.tag(2, u.LengthDelimited).string(e.dataTypeIdentifier); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const v = new wt(); -class Nt extends T { - constructor() { - super("shared.DefinitionDataTypeContainsTypeRuleConfig", [ - { no: 1, name: "data_type_identifier", kind: "message", T: () => w } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* shared.DataTypeIdentifier data_type_identifier */ - 1: - n.dataTypeIdentifier = w.internalBinaryRead(e, e.uint32(), i, n.dataTypeIdentifier); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.dataTypeIdentifier && w.internalBinaryWrite(e.dataTypeIdentifier, t.tag(1, u.LengthDelimited).fork(), i).join(); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const ee = new Nt(); -class Bt extends T { - constructor() { - super("shared.ExecutionDataTypeContainsTypeRuleConfig", [ - { - no: 1, - name: "data_type_identifier", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.dataTypeIdentifier = "", e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* string data_type_identifier */ - 1: - n.dataTypeIdentifier = e.string(); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.dataTypeIdentifier !== "" && t.tag(1, u.LengthDelimited).string(e.dataTypeIdentifier); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const te = new Bt(); -class It extends T { - constructor() { - super("shared.DataTypeItemOfCollectionRuleConfig", [ - { no: 1, name: "items", kind: "message", repeat: 2, T: () => B } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.items = [], e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* repeated shared.Value items */ - 1: - n.items.push(B.internalBinaryRead(e, e.uint32(), i)); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - for (let n = 0; n < e.items.length; n++) - B.internalBinaryWrite(e.items[n], t.tag(1, u.LengthDelimited).fork(), i).join(); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const L = new It(); -class Rt extends T { - constructor() { - super("shared.DataTypeNumberRangeRuleConfig", [ - { - no: 1, - name: "from", - kind: "scalar", - T: 3, - L: 0 - /*LongType.BIGINT*/ - }, - { - no: 2, - name: "to", - kind: "scalar", - T: 3, - L: 0 - /*LongType.BIGINT*/ - }, - { - no: 3, - name: "steps", - kind: "scalar", - opt: !0, - T: 3, - L: 0 - /*LongType.BIGINT*/ - } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.from = 0n, t.to = 0n, e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* int64 from */ - 1: - n.from = e.int64().toBigInt(); - break; - case /* int64 to */ - 2: - n.to = e.int64().toBigInt(); - break; - case /* optional int64 steps */ - 3: - n.steps = e.int64().toBigInt(); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.from !== 0n && t.tag(1, u.Varint).int64(e.from), e.to !== 0n && t.tag(2, u.Varint).int64(e.to), e.steps !== void 0 && t.tag(3, u.Varint).int64(e.steps); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const U = new Rt(); -class Dt extends T { - constructor() { - super("shared.DataTypeRegexRuleConfig", [ - { - no: 1, - name: "pattern", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.pattern = "", e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* string pattern */ - 1: - n.pattern = e.string(); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.pattern !== "" && t.tag(1, u.LengthDelimited).string(e.pattern); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const $ = new Dt(); -class Ft extends T { - constructor() { - super("shared.DefinitionDataTypeInputTypesRuleConfig", [ - { no: 1, name: "input_types", kind: "message", repeat: 2, T: () => ie } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.inputTypes = [], e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* repeated shared.DefinitionDataTypeInputTypesRuleConfig.DataTypeInputType input_types */ - 1: - n.inputTypes.push(ie.internalBinaryRead(e, e.uint32(), i)); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - for (let n = 0; n < e.inputTypes.length; n++) - ie.internalBinaryWrite(e.inputTypes[n], t.tag(1, u.LengthDelimited).fork(), i).join(); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const ne = new Ft(); -class Et extends T { - constructor() { - super("shared.DefinitionDataTypeInputTypesRuleConfig.DataTypeInputType", [ - { no: 1, name: "data_type_identifier", kind: "message", T: () => w }, - { - no: 2, - name: "input_identifier", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.inputIdentifier = "", e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* shared.DataTypeIdentifier data_type_identifier */ - 1: - n.dataTypeIdentifier = w.internalBinaryRead(e, e.uint32(), i, n.dataTypeIdentifier); - break; - case /* string input_identifier */ - 2: - n.inputIdentifier = e.string(); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.dataTypeIdentifier && w.internalBinaryWrite(e.dataTypeIdentifier, t.tag(1, u.LengthDelimited).fork(), i).join(), e.inputIdentifier !== "" && t.tag(2, u.LengthDelimited).string(e.inputIdentifier); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const ie = new Et(); -class Ot extends T { - constructor() { - super("shared.DefinitionDataTypeReturnTypeRuleConfig", [ - { no: 1, name: "data_type_identifier", kind: "message", T: () => w } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* shared.DataTypeIdentifier data_type_identifier */ - 1: - n.dataTypeIdentifier = w.internalBinaryRead(e, e.uint32(), i, n.dataTypeIdentifier); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.dataTypeIdentifier && w.internalBinaryWrite(e.dataTypeIdentifier, t.tag(1, u.LengthDelimited).fork(), i).join(); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const re = new Ot(); -class Lt extends T { - constructor() { - super("shared.DataTypeIdentifier", [ - { - no: 1, - name: "data_type_identifier", - kind: "scalar", - oneof: "type", - T: 9 - /*ScalarType.STRING*/ - }, - { no: 2, name: "generic_type", kind: "message", oneof: "type", T: () => ae }, - { - no: 3, - name: "generic_key", - kind: "scalar", - oneof: "type", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.type = { oneofKind: void 0 }, e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* string data_type_identifier */ - 1: - n.type = { - oneofKind: "dataTypeIdentifier", - dataTypeIdentifier: e.string() - }; - break; - case /* shared.GenericType generic_type */ - 2: - n.type = { - oneofKind: "genericType", - genericType: ae.internalBinaryRead(e, e.uint32(), i, n.type.genericType) - }; - break; - case /* string generic_key */ - 3: - n.type = { - oneofKind: "genericKey", - genericKey: e.string() - }; - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.type.oneofKind === "dataTypeIdentifier" && t.tag(1, u.LengthDelimited).string(e.type.dataTypeIdentifier), e.type.oneofKind === "genericType" && ae.internalBinaryWrite(e.type.genericType, t.tag(2, u.LengthDelimited).fork(), i).join(), e.type.oneofKind === "genericKey" && t.tag(3, u.LengthDelimited).string(e.type.genericKey); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const w = new Lt(); -class Ut extends T { - constructor() { - super("shared.GenericType", [ - { - no: 1, - name: "data_type_identifier", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { no: 2, name: "generic_mappers", kind: "message", repeat: 2, T: () => se } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.dataTypeIdentifier = "", t.genericMappers = [], e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* string data_type_identifier */ - 1: - n.dataTypeIdentifier = e.string(); - break; - case /* repeated shared.GenericMapper generic_mappers */ - 2: - n.genericMappers.push(se.internalBinaryRead(e, e.uint32(), i)); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.dataTypeIdentifier !== "" && t.tag(1, u.LengthDelimited).string(e.dataTypeIdentifier); - for (let n = 0; n < e.genericMappers.length; n++) - se.internalBinaryWrite(e.genericMappers[n], t.tag(2, u.LengthDelimited).fork(), i).join(); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const ae = new Ut(); -class $t extends T { - constructor() { - super("shared.GenericMapper", [ - { no: 1, name: "source", kind: "message", repeat: 2, T: () => w }, - { - no: 2, - name: "target", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { no: 3, name: "generic_combinations", kind: "enum", repeat: 1, T: () => ["shared.GenericMapper.GenericCombinationStrategy", he] } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.source = [], t.target = "", t.genericCombinations = [], e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* repeated shared.DataTypeIdentifier source */ - 1: - n.source.push(w.internalBinaryRead(e, e.uint32(), i)); - break; - case /* string target */ - 2: - n.target = e.string(); - break; - case /* repeated shared.GenericMapper.GenericCombinationStrategy generic_combinations */ - 3: - if (l === u.LengthDelimited) - for (let k = e.int32() + e.pos; e.pos < k; ) - n.genericCombinations.push(e.int32()); - else - n.genericCombinations.push(e.int32()); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - for (let n = 0; n < e.source.length; n++) - w.internalBinaryWrite(e.source[n], t.tag(1, u.LengthDelimited).fork(), i).join(); - if (e.target !== "" && t.tag(2, u.LengthDelimited).string(e.target), e.genericCombinations.length) { - t.tag(3, u.LengthDelimited).fork(); - for (let n = 0; n < e.genericCombinations.length; n++) - t.int32(e.genericCombinations[n]); - t.join(); - } - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const se = new $t(); -class xt extends T { - constructor() { - super("shared.RuntimeFunctionDefinition", [ - { - no: 1, - name: "runtime_name", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { no: 2, name: "runtime_parameter_definitions", kind: "message", repeat: 2, T: () => oe }, - { no: 3, name: "return_type_identifier", kind: "message", T: () => w }, - { - no: 4, - name: "throws_error", - kind: "scalar", - T: 8 - /*ScalarType.BOOL*/ - }, - { - no: 5, - name: "generic_keys", - kind: "scalar", - repeat: 2, - T: 9 - /*ScalarType.STRING*/ - }, - { no: 6, name: "name", kind: "message", repeat: 2, T: () => d }, - { no: 7, name: "description", kind: "message", repeat: 2, T: () => d }, - { no: 8, name: "documentation", kind: "message", repeat: 2, T: () => d }, - { no: 9, name: "deprecation_message", kind: "message", repeat: 2, T: () => d }, - { no: 10, name: "display_message", kind: "message", repeat: 2, T: () => d }, - { no: 11, name: "alias", kind: "message", repeat: 2, T: () => d }, - { - no: 12, - name: "version", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.runtimeName = "", t.runtimeParameterDefinitions = [], t.throwsError = !1, t.genericKeys = [], t.name = [], t.description = [], t.documentation = [], t.deprecationMessage = [], t.displayMessage = [], t.alias = [], t.version = "", e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* string runtime_name */ - 1: - n.runtimeName = e.string(); - break; - case /* repeated shared.RuntimeParameterDefinition runtime_parameter_definitions */ - 2: - n.runtimeParameterDefinitions.push(oe.internalBinaryRead(e, e.uint32(), i)); - break; - case /* optional shared.DataTypeIdentifier return_type_identifier */ - 3: - n.returnTypeIdentifier = w.internalBinaryRead(e, e.uint32(), i, n.returnTypeIdentifier); - break; - case /* bool throws_error */ - 4: - n.throwsError = e.bool(); - break; - case /* repeated string generic_keys */ - 5: - n.genericKeys.push(e.string()); - break; - case /* repeated shared.Translation name */ - 6: - n.name.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated shared.Translation description */ - 7: - n.description.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated shared.Translation documentation */ - 8: - n.documentation.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated shared.Translation deprecation_message */ - 9: - n.deprecationMessage.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated shared.Translation display_message */ - 10: - n.displayMessage.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated shared.Translation alias */ - 11: - n.alias.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* string version */ - 12: - n.version = e.string(); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.runtimeName !== "" && t.tag(1, u.LengthDelimited).string(e.runtimeName); - for (let n = 0; n < e.runtimeParameterDefinitions.length; n++) - oe.internalBinaryWrite(e.runtimeParameterDefinitions[n], t.tag(2, u.LengthDelimited).fork(), i).join(); - e.returnTypeIdentifier && w.internalBinaryWrite(e.returnTypeIdentifier, t.tag(3, u.LengthDelimited).fork(), i).join(), e.throwsError !== !1 && t.tag(4, u.Varint).bool(e.throwsError); - for (let n = 0; n < e.genericKeys.length; n++) - t.tag(5, u.LengthDelimited).string(e.genericKeys[n]); - for (let n = 0; n < e.name.length; n++) - d.internalBinaryWrite(e.name[n], t.tag(6, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.description.length; n++) - d.internalBinaryWrite(e.description[n], t.tag(7, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.documentation.length; n++) - d.internalBinaryWrite(e.documentation[n], t.tag(8, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.deprecationMessage.length; n++) - d.internalBinaryWrite(e.deprecationMessage[n], t.tag(9, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.displayMessage.length; n++) - d.internalBinaryWrite(e.displayMessage[n], t.tag(10, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.alias.length; n++) - d.internalBinaryWrite(e.alias[n], t.tag(11, u.LengthDelimited).fork(), i).join(); - e.version !== "" && t.tag(12, u.LengthDelimited).string(e.version); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const Vt = new xt(); -class Wt extends T { - constructor() { - super("shared.RuntimeParameterDefinition", [ - { no: 1, name: "data_type_identifier", kind: "message", T: () => w }, - { - no: 2, - name: "runtime_name", - kind: "scalar", - T: 9 - /*ScalarType.STRING*/ - }, - { no: 3, name: "default_value", kind: "message", T: () => B }, - { no: 4, name: "name", kind: "message", repeat: 2, T: () => d }, - { no: 5, name: "description", kind: "message", repeat: 2, T: () => d }, - { no: 6, name: "documentation", kind: "message", repeat: 2, T: () => d } - ]); - } - create(e) { - const t = globalThis.Object.create(this.messagePrototype); - return t.runtimeName = "", t.name = [], t.description = [], t.documentation = [], e !== void 0 && m(this, t, e), t; - } - internalBinaryRead(e, t, i, r) { - let n = r ?? this.create(), o = e.pos + t; - for (; e.pos < o; ) { - let [s, l] = e.tag(); - switch (s) { - case /* shared.DataTypeIdentifier data_type_identifier */ - 1: - n.dataTypeIdentifier = w.internalBinaryRead(e, e.uint32(), i, n.dataTypeIdentifier); - break; - case /* string runtime_name */ - 2: - n.runtimeName = e.string(); - break; - case /* optional shared.Value default_value */ - 3: - n.defaultValue = B.internalBinaryRead(e, e.uint32(), i, n.defaultValue); - break; - case /* repeated shared.Translation name */ - 4: - n.name.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated shared.Translation description */ - 5: - n.description.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - case /* repeated shared.Translation documentation */ - 6: - n.documentation.push(d.internalBinaryRead(e, e.uint32(), i)); - break; - default: - let f = i.readUnknownField; - if (f === "throw") - throw new globalThis.Error(`Unknown field ${s} (wire type ${l}) for ${this.typeName}`); - let h = e.skip(l); - f !== !1 && (f === !0 ? y.onRead : f)(this.typeName, n, s, l, h); - } - } - return n; - } - internalBinaryWrite(e, t, i) { - e.dataTypeIdentifier && w.internalBinaryWrite(e.dataTypeIdentifier, t.tag(1, u.LengthDelimited).fork(), i).join(), e.runtimeName !== "" && t.tag(2, u.LengthDelimited).string(e.runtimeName), e.defaultValue && B.internalBinaryWrite(e.defaultValue, t.tag(3, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.name.length; n++) - d.internalBinaryWrite(e.name[n], t.tag(4, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.description.length; n++) - d.internalBinaryWrite(e.description[n], t.tag(5, u.LengthDelimited).fork(), i).join(); - for (let n = 0; n < e.documentation.length; n++) - d.internalBinaryWrite(e.documentation[n], t.tag(6, u.LengthDelimited).fork(), i).join(); - let r = i.writeUnknownFields; - return r !== !1 && (r == !0 ? y.onWrite : r)(this.typeName, e, t), t; - } -} -const oe = new Wt(); -var Kt = /* @__PURE__ */ ((a) => (a.FlowType = "FlowType", a.DataType = "DataType", a.RuntimeFunction = "RuntimeFunction", a))(Kt || {}); -class Xt { - static async fromPath(e) { - const t = /* @__PURE__ */ new Map(); - for (const i of await P(e)) { - if (!i.isDirectory()) continue; - const r = i.name, n = x(e, r); - for (const o of await P(n)) { - const s = jt(o.name); - if (!s) continue; - const l = x(n, o.name), f = await Ct(l); - for (const h of f) { - const k = await $e(h, "utf8"), p = t.get(r) ?? At(r); - _t(p, k, s), t.set(r, p); - } - } - } - return Array.from(t.values()); - } -} -const jt = (a) => ({ - flow_type: "FlowType", - data_type: "DataType", - runtime_definition: "RuntimeFunction" - /* RuntimeFunction */ -})[a] ?? null, At = (a) => ({ - name: a, - data_types: [], - flow_types: [], - runtime_functions: [], - errors: [] -}), P = async (a) => { - try { - return await xe(a, { withFileTypes: !0 }); - } catch { - return []; - } -}, Ct = async (a) => { - const e = await P(a), t = e.filter((i) => i.isFile() && ye(i.name) === ".json").map((i) => x(a, i.name)); - for (const i of e.filter((r) => r.isDirectory())) { - const r = (await P(x(a, i.name))).filter((n) => n.isFile() && ye(n.name) === ".json").map((n) => x(a, i.name, n.name)); - t.push(...r); - } - return t; -}, _t = (a, e, t) => { - try { - t === "DataType" ? a.data_types.push(pt.fromJsonString(e)) : t === "FlowType" ? a.flow_types.push(ht.fromJsonString(e)) : a.runtime_functions.push(Vt.fromJsonString(e)); - } catch (i) { - a.errors.push({ - definition: St(e, t), - definition_type: t, - error: i instanceof Error ? i.message : String(i) - }); - } -}, St = (a, e) => { - const t = e === "RuntimeFunction" ? "runtime_name" : "identifier"; - return a.match(new RegExp(`"${t}"\\s*:\\s*"([^"]+)"`))?.[1] ?? a; -}; -export { - Kt as MetaType, - Xt as Reader -};