@osmo.inc/cli 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DEPLOY.md +87 -0
- package/README.md +243 -0
- package/RELEASE.md +164 -0
- package/SETUP.md +60 -0
- package/THIRD_PARTY_NOTICES.md +18 -0
- package/bin/osmo.mjs +12 -0
- package/dist/osmo.js +7817 -0
- package/node_modules/@esbuild/darwin-arm64/README.md +3 -0
- package/node_modules/@esbuild/darwin-arm64/bin/esbuild +0 -0
- package/node_modules/@esbuild/darwin-arm64/package.json +20 -0
- package/node_modules/esbuild/LICENSE.md +21 -0
- package/node_modules/esbuild/README.md +3 -0
- package/node_modules/esbuild/bin/esbuild +223 -0
- package/node_modules/esbuild/install.js +289 -0
- package/node_modules/esbuild/lib/main.d.ts +716 -0
- package/node_modules/esbuild/lib/main.js +2532 -0
- package/node_modules/esbuild/package.json +49 -0
- package/node_modules/fflate/LICENSE +21 -0
- package/node_modules/fflate/esm/index.mjs +2710 -0
- package/node_modules/fflate/package.json +128 -0
- package/node_modules/typescript/LICENSE.txt +55 -0
- package/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
- package/node_modules/typescript/lib/lib.d.ts +22 -0
- package/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
- package/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
- package/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
- package/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
- package/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
- package/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
- package/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
- package/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
- package/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
- package/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
- package/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
- package/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
- package/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
- package/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
- package/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
- package/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
- package/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
- package/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
- package/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
- package/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
- package/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
- package/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
- package/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
- package/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
- package/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
- package/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
- package/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
- package/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
- package/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
- package/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
- package/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
- package/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
- package/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
- package/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
- package/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
- package/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
- package/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
- package/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
- package/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
- package/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
- package/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
- package/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
- package/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
- package/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
- package/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
- package/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
- package/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
- package/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
- package/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
- package/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
- package/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
- package/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
- package/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
- package/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
- package/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
- package/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
- package/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
- package/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
- package/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
- package/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
- package/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
- package/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
- package/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
- package/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
- package/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
- package/node_modules/typescript/lib/lib.es6.d.ts +23 -0
- package/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
- package/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
- package/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
- package/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
- package/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
- package/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
- package/node_modules/typescript/lib/lib.esnext.float16.d.ts +445 -0
- package/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
- package/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
- package/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
- package/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
- package/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
- package/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
- package/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
- package/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
- package/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
- package/node_modules/typescript/lib/typescript.js +382 -0
- package/node_modules/typescript/package.json +57 -0
- package/package.json +54 -0
- package/release.json +136 -0
- package/runtime/apps/native/tools/compile.mjs +217 -0
- package/runtime/packages/scene/scripts/validate-strict.mjs +246 -0
- package/runtime/packages/scene/src/clip.d.mts +14 -0
- package/runtime/packages/scene/src/clip.mjs +15 -0
- package/runtime/packages/scene/src/color-value.d.mts +5 -0
- package/runtime/packages/scene/src/color-value.mjs +19 -0
- package/runtime/packages/scene/src/color.ts +1 -0
- package/runtime/packages/scene/src/effects.ts +213 -0
- package/runtime/packages/scene/src/elements.ts +491 -0
- package/runtime/packages/scene/src/evaluate.ts +919 -0
- package/runtime/packages/scene/src/index.ts +69 -0
- package/runtime/packages/scene/src/jsx-runtime.ts +73 -0
- package/runtime/packages/scene/src/knob-schema.ts +115 -0
- package/runtime/packages/scene/src/knobs.ts +118 -0
- package/runtime/packages/scene/src/mask.d.mts +6 -0
- package/runtime/packages/scene/src/mask.mjs +17 -0
- package/runtime/packages/scene/src/metadata.d.mts +23 -0
- package/runtime/packages/scene/src/metadata.mjs +44 -0
- package/runtime/packages/scene/src/motion-sampling.d.mts +2 -0
- package/runtime/packages/scene/src/motion-sampling.mjs +50 -0
- package/runtime/packages/scene/src/motion.ts +121 -0
- package/runtime/packages/scene/src/shader.ts +57 -0
- package/src/resource-examples/example-image/landscape.svg +7 -0
- package/src/resource-examples/example-image/resource.json +8 -0
- package/src/resource-examples/example-model/gem.glb +0 -0
- package/src/resource-examples/example-model/preview.svg +1 -0
- package/src/resource-examples/example-model/resource.json +7 -0
- package/src/resource-examples/example-scene/resource.json +1 -0
- package/src/resource-examples/example-scene/scene.tsx +8 -0
- package/src/resource-examples/example-shader/effect.wgsl +7 -0
- package/src/resource-examples/example-shader/preview.svg +1 -0
- package/src/resource-examples/example-shader/resource.json +27 -0
- package/src/resource-examples/example-shader/tint.wgsl +7 -0
- package/src/resource-examples/example-video/ambient.mp4 +0 -0
- package/src/resource-examples/example-video/resource.json +9 -0
- package/src/starter/scene.tsx +20 -0
- package/studio/index.html +2 -0
- package/studio/public/check-circle-filled.svg +3 -0
- package/studio/public/comment-cursor/active-outer.svg +3 -0
- package/studio/public/comment-cursor/default.svg +6 -0
- package/studio/public/osmo-studio-logo.svg +12 -0
- package/studio/public/pencil-simple.svg +5 -0
- package/studio/src/active-outer-TVYUEURE.svg +3 -0
- package/studio/src/app.css +4 -0
- package/studio/src/app.js +705 -0
- package/studio/src/default-6CTRH4V5.svg +6 -0
- package/studio/src/engine_bg.wasm +0 -0
- package/studio/src/inter-cyrillic-ext-wght-normal-IYF56FF6.woff2 +0 -0
- package/studio/src/inter-cyrillic-wght-normal-JEOLYBOO.woff2 +0 -0
- package/studio/src/inter-greek-ext-wght-normal-EOVOK2B5.woff2 +0 -0
- package/studio/src/inter-greek-wght-normal-IRE366VL.woff2 +0 -0
- package/studio/src/inter-latin-ext-wght-normal-HA22NDSG.woff2 +0 -0
- package/studio/src/inter-latin-wght-normal-NRMW37G5.woff2 +0 -0
- package/studio/src/inter-vietnamese-wght-normal-CE5GGD3W.woff2 +0 -0
- package/studio/src/osmo-studio-logo-D5R2V77B.svg +12 -0
- package/third-party/cargo/adler2@2.0.1/Cargo.toml +91 -0
- package/third-party/cargo/adler2@2.0.1/LICENSE-0BSD +12 -0
- package/third-party/cargo/adler2@2.0.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/adler2@2.0.1/LICENSE-MIT +23 -0
- package/third-party/cargo/allocator-api2@0.2.21/Cargo.toml +48 -0
- package/third-party/cargo/allocator-api2@0.2.21/LICENSE-APACHE +176 -0
- package/third-party/cargo/allocator-api2@0.2.21/LICENSE-MIT +23 -0
- package/third-party/cargo/arrayref@0.3.9/Cargo.toml +23 -0
- package/third-party/cargo/arrayref@0.3.9/LICENSE +26 -0
- package/third-party/cargo/arrayvec@0.7.8/Cargo.toml +112 -0
- package/third-party/cargo/arrayvec@0.7.8/LICENSE-APACHE +201 -0
- package/third-party/cargo/arrayvec@0.7.8/LICENSE-MIT +25 -0
- package/third-party/cargo/ascii@1.1.0/Cargo.toml +41 -0
- package/third-party/cargo/ascii@1.1.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/ascii@1.1.0/LICENSE-MIT +22 -0
- package/third-party/cargo/ash@0.38.0+1.3.281/Cargo.toml +66 -0
- package/third-party/cargo/ash@0.38.0+1.3.281/LICENSE-APACHE +67 -0
- package/third-party/cargo/ash@0.38.0+1.3.281/LICENSE-MIT +25 -0
- package/third-party/cargo/autocfg@1.5.1/Cargo.toml +75 -0
- package/third-party/cargo/autocfg@1.5.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/autocfg@1.5.1/LICENSE-MIT +25 -0
- package/third-party/cargo/base64@0.13.1/Cargo.toml +53 -0
- package/third-party/cargo/base64@0.13.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/base64@0.13.1/LICENSE-MIT +21 -0
- package/third-party/cargo/base64@0.22.1/Cargo.toml +85 -0
- package/third-party/cargo/base64@0.22.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/base64@0.22.1/LICENSE-MIT +21 -0
- package/third-party/cargo/bit-set@0.10.0/Cargo.toml +108 -0
- package/third-party/cargo/bit-set@0.10.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/bit-set@0.10.0/LICENSE-MIT +25 -0
- package/third-party/cargo/bit-vec@0.9.1/Cargo.toml +94 -0
- package/third-party/cargo/bit-vec@0.9.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/bit-vec@0.9.1/LICENSE-MIT +25 -0
- package/third-party/cargo/bitflags@2.13.0/Cargo.toml +120 -0
- package/third-party/cargo/bitflags@2.13.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/bitflags@2.13.0/LICENSE-MIT +25 -0
- package/third-party/cargo/block2@0.6.2/Cargo.toml +115 -0
- package/third-party/cargo/block2@0.6.2/MIT-terms.txt +22 -0
- package/third-party/cargo/block2@0.6.2/madsmtm-objc2-b4167b582b2f-LICENSE.md +34 -0
- package/third-party/cargo/bumpalo@3.20.3/Cargo.toml +99 -0
- package/third-party/cargo/bumpalo@3.20.3/LICENSE-APACHE +201 -0
- package/third-party/cargo/bumpalo@3.20.3/LICENSE-MIT +25 -0
- package/third-party/cargo/bytemuck@1.25.1/Cargo.toml +153 -0
- package/third-party/cargo/bytemuck@1.25.1/LICENSE-APACHE +61 -0
- package/third-party/cargo/bytemuck@1.25.1/LICENSE-MIT +9 -0
- package/third-party/cargo/bytemuck@1.25.1/LICENSE-ZLIB +11 -0
- package/third-party/cargo/bytemuck_derive@1.11.0/Cargo.toml +60 -0
- package/third-party/cargo/bytemuck_derive@1.11.0/LICENSE-APACHE +61 -0
- package/third-party/cargo/bytemuck_derive@1.11.0/LICENSE-MIT +9 -0
- package/third-party/cargo/bytemuck_derive@1.11.0/LICENSE-ZLIB +11 -0
- package/third-party/cargo/byteorder-lite@0.1.0/Cargo.toml +57 -0
- package/third-party/cargo/byteorder-lite@0.1.0/LICENSE-MIT +21 -0
- package/third-party/cargo/byteorder-lite@0.1.0/UNLICENSE +24 -0
- package/third-party/cargo/byteorder@1.5.0/COPYING +3 -0
- package/third-party/cargo/byteorder@1.5.0/Cargo.toml +54 -0
- package/third-party/cargo/byteorder@1.5.0/LICENSE-MIT +21 -0
- package/third-party/cargo/byteorder@1.5.0/UNLICENSE +24 -0
- package/third-party/cargo/cfg-if@1.0.4/Cargo.toml +47 -0
- package/third-party/cargo/cfg-if@1.0.4/LICENSE-APACHE +201 -0
- package/third-party/cargo/cfg-if@1.0.4/LICENSE-MIT +25 -0
- package/third-party/cargo/cfg_aliases@0.2.1/Cargo.toml +43 -0
- package/third-party/cargo/cfg_aliases@0.2.1/LICENSE +9 -0
- package/third-party/cargo/chunked_transfer@1.5.0/Cargo.toml +27 -0
- package/third-party/cargo/chunked_transfer@1.5.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/chunked_transfer@1.5.0/LICENSE-MIT +22 -0
- package/third-party/cargo/codespan-reporting@0.13.1/Cargo.toml +115 -0
- package/third-party/cargo/codespan-reporting@0.13.1/LICENSE +201 -0
- package/third-party/cargo/color_quant@1.1.0/Cargo.toml +20 -0
- package/third-party/cargo/color_quant@1.1.0/LICENSE +21 -0
- package/third-party/cargo/console_error_panic_hook@0.1.7/Cargo.toml +27 -0
- package/third-party/cargo/console_error_panic_hook@0.1.7/LICENSE-APACHE +201 -0
- package/third-party/cargo/console_error_panic_hook@0.1.7/LICENSE-MIT +25 -0
- package/third-party/cargo/core_maths@0.1.1/Cargo.toml +37 -0
- package/third-party/cargo/core_maths@0.1.1/LICENSE +21 -0
- package/third-party/cargo/cosmic-text@0.19.0/Cargo.toml +214 -0
- package/third-party/cargo/cosmic-text@0.19.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/cosmic-text@0.19.0/LICENSE-MIT +21 -0
- package/third-party/cargo/crc32fast@1.5.0/Cargo.toml +68 -0
- package/third-party/cargo/crc32fast@1.5.0/LICENSE-APACHE +202 -0
- package/third-party/cargo/crc32fast@1.5.0/LICENSE-MIT +21 -0
- package/third-party/cargo/data-url@0.3.2/Cargo.toml +63 -0
- package/third-party/cargo/data-url@0.3.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/data-url@0.3.2/LICENSE-MIT +25 -0
- package/third-party/cargo/dispatch2@0.3.1/Cargo.toml +122 -0
- package/third-party/cargo/dispatch2@0.3.1/MIT-terms.txt +22 -0
- package/third-party/cargo/dispatch2@0.3.1/madsmtm-objc2-8852b424193c-LICENSE.md +34 -0
- package/third-party/cargo/dlib@0.5.3/Cargo.toml +43 -0
- package/third-party/cargo/dlib@0.5.3/LICENSE.txt +19 -0
- package/third-party/cargo/document-features@0.2.12/Cargo.toml +51 -0
- package/third-party/cargo/document-features@0.2.12/LICENSE-APACHE +73 -0
- package/third-party/cargo/document-features@0.2.12/LICENSE-MIT +19 -0
- package/third-party/cargo/equivalent@1.0.2/Cargo.toml +37 -0
- package/third-party/cargo/equivalent@1.0.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/equivalent@1.0.2/LICENSE-MIT +25 -0
- package/third-party/cargo/errno@0.3.14/Cargo.toml +67 -0
- package/third-party/cargo/errno@0.3.14/LICENSE-APACHE +201 -0
- package/third-party/cargo/errno@0.3.14/LICENSE-MIT +25 -0
- package/third-party/cargo/etagere@0.3.0/Cargo.toml +57 -0
- package/third-party/cargo/etagere@0.3.0/LICENSE-APACHE +13 -0
- package/third-party/cargo/etagere@0.3.0/LICENSE-MIT +20 -0
- package/third-party/cargo/euclid@0.22.14/COPYRIGHT +5 -0
- package/third-party/cargo/euclid@0.22.14/Cargo.toml +66 -0
- package/third-party/cargo/euclid@0.22.14/LICENSE-APACHE +201 -0
- package/third-party/cargo/euclid@0.22.14/LICENSE-MIT +25 -0
- package/third-party/cargo/fastrand@2.5.0/Cargo.toml +89 -0
- package/third-party/cargo/fastrand@2.5.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/fastrand@2.5.0/LICENSE-MIT +23 -0
- package/third-party/cargo/fdeflate@0.3.7/Cargo.toml +55 -0
- package/third-party/cargo/fdeflate@0.3.7/LICENSE-APACHE +177 -0
- package/third-party/cargo/fdeflate@0.3.7/LICENSE-MIT +25 -0
- package/third-party/cargo/flate2@1.1.9/Cargo.toml +274 -0
- package/third-party/cargo/flate2@1.1.9/LICENSE-APACHE +201 -0
- package/third-party/cargo/flate2@1.1.9/LICENSE-MIT +25 -0
- package/third-party/cargo/float-cmp@0.9.0/Cargo.toml +39 -0
- package/third-party/cargo/float-cmp@0.9.0/LICENSE +19 -0
- package/third-party/cargo/float_next_after@1.0.0/Cargo.toml +43 -0
- package/third-party/cargo/float_next_after@1.0.0/LICENSE +23 -0
- package/third-party/cargo/foldhash@0.2.0/Cargo.toml +80 -0
- package/third-party/cargo/foldhash@0.2.0/LICENSE +19 -0
- package/third-party/cargo/font-types@0.11.3/Cargo.toml +55 -0
- package/third-party/cargo/font-types@0.11.3/LICENSE-APACHE +67 -0
- package/third-party/cargo/font-types@0.11.3/LICENSE-MIT +25 -0
- package/third-party/cargo/fontdb@0.23.0/Cargo.toml +83 -0
- package/third-party/cargo/fontdb@0.23.0/LICENSE +21 -0
- package/third-party/cargo/futures-core@0.3.32/Cargo.toml +66 -0
- package/third-party/cargo/futures-core@0.3.32/LICENSE-APACHE +202 -0
- package/third-party/cargo/futures-core@0.3.32/LICENSE-MIT +26 -0
- package/third-party/cargo/futures-task@0.3.32/Cargo.toml +58 -0
- package/third-party/cargo/futures-task@0.3.32/LICENSE-APACHE +202 -0
- package/third-party/cargo/futures-task@0.3.32/LICENSE-MIT +26 -0
- package/third-party/cargo/futures-util@0.3.32/Cargo.toml +181 -0
- package/third-party/cargo/futures-util@0.3.32/LICENSE-APACHE +202 -0
- package/third-party/cargo/futures-util@0.3.32/LICENSE-MIT +26 -0
- package/third-party/cargo/getrandom@0.4.3/Cargo.toml +165 -0
- package/third-party/cargo/getrandom@0.4.3/LICENSE-APACHE +201 -0
- package/third-party/cargo/getrandom@0.4.3/LICENSE-MIT +26 -0
- package/third-party/cargo/gif@0.14.2/Cargo.toml +84 -0
- package/third-party/cargo/gif@0.14.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/gif@0.14.2/LICENSE-MIT +21 -0
- package/third-party/cargo/glam@0.33.2/Cargo.toml +354 -0
- package/third-party/cargo/glam@0.33.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/glam@0.33.2/LICENSE-MIT +23 -0
- package/third-party/cargo/glow@0.17.0/Cargo.toml +122 -0
- package/third-party/cargo/glow@0.17.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/glow@0.17.0/LICENSE-MIT +23 -0
- package/third-party/cargo/glow@0.17.0/LICENSE-ZLIB +15 -0
- package/third-party/cargo/gltf-derive@1.4.1/Cargo.toml +34 -0
- package/third-party/cargo/gltf-derive@1.4.1/LICENSE-APACHE +202 -0
- package/third-party/cargo/gltf-derive@1.4.1/LICENSE-MIT +26 -0
- package/third-party/cargo/gltf-json@1.4.1/Cargo.toml +50 -0
- package/third-party/cargo/gltf-json@1.4.1/LICENSE-APACHE +202 -0
- package/third-party/cargo/gltf-json@1.4.1/LICENSE-MIT +26 -0
- package/third-party/cargo/gltf@1.4.1/Cargo.toml +122 -0
- package/third-party/cargo/gltf@1.4.1/LICENSE-APACHE +202 -0
- package/third-party/cargo/gltf@1.4.1/LICENSE-MIT +26 -0
- package/third-party/cargo/glyphon@0.12.0/Cargo.toml +35 -0
- package/third-party/cargo/glyphon@0.12.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/glyphon@0.12.0/LICENSE-MIT +23 -0
- package/third-party/cargo/glyphon@0.12.0/LICENSE-ZLIB +15 -0
- package/third-party/cargo/gpu-allocator@0.28.0/Cargo.toml +180 -0
- package/third-party/cargo/gpu-allocator@0.28.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/gpu-allocator@0.28.0/LICENSE-MIT +7 -0
- package/third-party/cargo/grid@1.0.1/Cargo.toml +77 -0
- package/third-party/cargo/grid@1.0.1/LICENSE +21 -0
- package/third-party/cargo/half@2.7.1/Cargo.toml +137 -0
- package/third-party/cargo/half@2.7.1/LICENSE-APACHE +176 -0
- package/third-party/cargo/half@2.7.1/LICENSE-MIT +19 -0
- package/third-party/cargo/harfrust@0.5.2/Cargo.toml +115 -0
- package/third-party/cargo/harfrust@0.5.2/harfbuzz-harfrust-efdae3142ab7-LICENSE +22 -0
- package/third-party/cargo/hashbrown@0.16.1/Cargo.toml +180 -0
- package/third-party/cargo/hashbrown@0.16.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/hashbrown@0.16.1/LICENSE-MIT +25 -0
- package/third-party/cargo/hashbrown@0.17.1/Cargo.toml +201 -0
- package/third-party/cargo/hashbrown@0.17.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/hashbrown@0.17.1/LICENSE-MIT +25 -0
- package/third-party/cargo/httpdate@1.0.3/Cargo.toml +35 -0
- package/third-party/cargo/httpdate@1.0.3/LICENSE-APACHE +201 -0
- package/third-party/cargo/httpdate@1.0.3/LICENSE-MIT +19 -0
- package/third-party/cargo/image-webp@0.2.4/Cargo.toml +63 -0
- package/third-party/cargo/image-webp@0.2.4/LICENSE-APACHE +177 -0
- package/third-party/cargo/image-webp@0.2.4/LICENSE-MIT +25 -0
- package/third-party/cargo/image@0.25.10/Cargo.toml +248 -0
- package/third-party/cargo/image@0.25.10/LICENSE-APACHE +177 -0
- package/third-party/cargo/image@0.25.10/LICENSE-MIT +25 -0
- package/third-party/cargo/imagesize@0.14.0/Cargo.toml +104 -0
- package/third-party/cargo/imagesize@0.14.0/LICENSE +21 -0
- package/third-party/cargo/indexmap@2.14.0/Cargo.toml +167 -0
- package/third-party/cargo/indexmap@2.14.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/indexmap@2.14.0/LICENSE-MIT +25 -0
- package/third-party/cargo/inflections@1.1.1/Cargo.toml +21 -0
- package/third-party/cargo/inflections@1.1.1/LICENSE +20 -0
- package/third-party/cargo/itoa@1.0.18/Cargo.toml +66 -0
- package/third-party/cargo/itoa@1.0.18/LICENSE-APACHE +176 -0
- package/third-party/cargo/itoa@1.0.18/LICENSE-MIT +23 -0
- package/third-party/cargo/js-sys@0.3.103/Cargo.toml +98 -0
- package/third-party/cargo/js-sys@0.3.103/LICENSE-APACHE +201 -0
- package/third-party/cargo/js-sys@0.3.103/LICENSE-MIT +25 -0
- package/third-party/cargo/khronos-egl@6.0.0/Cargo.toml +82 -0
- package/third-party/cargo/khronos-egl@6.0.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/khronos-egl@6.0.0/LICENSE-MIT +23 -0
- package/third-party/cargo/kurbo@0.13.1/Cargo.toml +230 -0
- package/third-party/cargo/kurbo@0.13.1/LICENSE-APACHE +202 -0
- package/third-party/cargo/kurbo@0.13.1/LICENSE-MIT +25 -0
- package/third-party/cargo/lazy_static@1.5.0/Cargo.toml +46 -0
- package/third-party/cargo/lazy_static@1.5.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/lazy_static@1.5.0/LICENSE-MIT +25 -0
- package/third-party/cargo/libc@0.2.186/Cargo.toml +229 -0
- package/third-party/cargo/libc@0.2.186/LICENSE-APACHE +176 -0
- package/third-party/cargo/libc@0.2.186/LICENSE-MIT +25 -0
- package/third-party/cargo/libloading@0.8.9/Cargo.toml +90 -0
- package/third-party/cargo/libloading@0.8.9/LICENSE +12 -0
- package/third-party/cargo/libm@0.2.16/Cargo.toml +61 -0
- package/third-party/cargo/libm@0.2.16/LICENSE.txt +258 -0
- package/third-party/cargo/linebender_resource_handle@0.1.1/Cargo.toml +107 -0
- package/third-party/cargo/linebender_resource_handle@0.1.1/LICENSE-APACHE +176 -0
- package/third-party/cargo/linebender_resource_handle@0.1.1/LICENSE-MIT +19 -0
- package/third-party/cargo/litrs@1.0.0/Cargo.toml +63 -0
- package/third-party/cargo/litrs@1.0.0/LICENSE-APACHE +176 -0
- package/third-party/cargo/litrs@1.0.0/LICENSE-MIT +25 -0
- package/third-party/cargo/lock_api@0.4.14/Cargo.toml +68 -0
- package/third-party/cargo/lock_api@0.4.14/LICENSE-APACHE +201 -0
- package/third-party/cargo/lock_api@0.4.14/LICENSE-MIT +25 -0
- package/third-party/cargo/log@0.4.33/Cargo.toml +152 -0
- package/third-party/cargo/log@0.4.33/LICENSE-APACHE +201 -0
- package/third-party/cargo/log@0.4.33/LICENSE-MIT +25 -0
- package/third-party/cargo/lru@0.16.4/Cargo.toml +47 -0
- package/third-party/cargo/lru@0.16.4/LICENSE +21 -0
- package/third-party/cargo/lyon_geom@1.0.19/Cargo.toml +69 -0
- package/third-party/cargo/lyon_geom@1.0.19/nical-lyon-56219c95c658-LICENSE-APACHE +13 -0
- package/third-party/cargo/lyon_geom@1.0.19/nical-lyon-56219c95c658-LICENSE-MIT +20 -0
- package/third-party/cargo/lyon_path@1.0.19/Cargo.toml +58 -0
- package/third-party/cargo/lyon_path@1.0.19/nical-lyon-56219c95c658-LICENSE-APACHE +13 -0
- package/third-party/cargo/lyon_path@1.0.19/nical-lyon-56219c95c658-LICENSE-MIT +20 -0
- package/third-party/cargo/lyon_tessellation@1.0.20/Cargo.toml +71 -0
- package/third-party/cargo/lyon_tessellation@1.0.20/nical-lyon-7fa75ea8eea3-LICENSE-APACHE +13 -0
- package/third-party/cargo/lyon_tessellation@1.0.20/nical-lyon-7fa75ea8eea3-LICENSE-MIT +20 -0
- package/third-party/cargo/memchr@2.8.3/COPYING +3 -0
- package/third-party/cargo/memchr@2.8.3/Cargo.toml +89 -0
- package/third-party/cargo/memchr@2.8.3/LICENSE-MIT +21 -0
- package/third-party/cargo/memchr@2.8.3/UNLICENSE +24 -0
- package/third-party/cargo/memmap2@0.9.11/Cargo.toml +59 -0
- package/third-party/cargo/memmap2@0.9.11/LICENSE-APACHE +201 -0
- package/third-party/cargo/memmap2@0.9.11/LICENSE-MIT +26 -0
- package/third-party/cargo/miniz_oxide@0.8.9/Cargo.toml +91 -0
- package/third-party/cargo/miniz_oxide@0.8.9/LICENSE +25 -0
- package/third-party/cargo/miniz_oxide@0.8.9/LICENSE-APACHE.md +177 -0
- package/third-party/cargo/miniz_oxide@0.8.9/LICENSE-MIT.md +24 -0
- package/third-party/cargo/miniz_oxide@0.8.9/LICENSE-ZLIB.md +14 -0
- package/third-party/cargo/moxcms@0.8.1/Cargo.toml +113 -0
- package/third-party/cargo/moxcms@0.8.1/LICENSE-APACHE.md +201 -0
- package/third-party/cargo/moxcms@0.8.1/LICENSE.md +26 -0
- package/third-party/cargo/naga-types@30.0.0/Cargo.toml +94 -0
- package/third-party/cargo/naga-types@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/naga-types@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/naga@30.0.0/Cargo.toml +246 -0
- package/third-party/cargo/naga@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/naga@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/num-traits@0.2.19/Cargo.toml +54 -0
- package/third-party/cargo/num-traits@0.2.19/LICENSE-APACHE +201 -0
- package/third-party/cargo/num-traits@0.2.19/LICENSE-MIT +25 -0
- package/third-party/cargo/objc2-core-foundation@0.3.2/Cargo.toml +221 -0
- package/third-party/cargo/objc2-core-foundation@0.3.2/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2-core-foundation@0.3.2/madsmtm-objc2-7b1abfd750a2-LICENSE.md +34 -0
- package/third-party/cargo/objc2-core-graphics@0.3.2/Cargo.toml +331 -0
- package/third-party/cargo/objc2-core-graphics@0.3.2/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2-core-graphics@0.3.2/madsmtm-objc2-7b1abfd750a2-LICENSE.md +34 -0
- package/third-party/cargo/objc2-encode@4.1.0/Cargo.toml +81 -0
- package/third-party/cargo/objc2-encode@4.1.0/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2-encode@4.1.0/madsmtm-objc2-8d214f547736-LICENSE.md +34 -0
- package/third-party/cargo/objc2-foundation@0.3.2/Cargo.toml +529 -0
- package/third-party/cargo/objc2-foundation@0.3.2/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2-foundation@0.3.2/madsmtm-objc2-7b1abfd750a2-LICENSE.md +34 -0
- package/third-party/cargo/objc2-io-surface@0.3.2/Cargo.toml +139 -0
- package/third-party/cargo/objc2-io-surface@0.3.2/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2-io-surface@0.3.2/madsmtm-objc2-7b1abfd750a2-LICENSE.md +34 -0
- package/third-party/cargo/objc2-metal@0.3.2/Cargo.toml +601 -0
- package/third-party/cargo/objc2-metal@0.3.2/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2-metal@0.3.2/madsmtm-objc2-7b1abfd750a2-LICENSE.md +34 -0
- package/third-party/cargo/objc2-quartz-core@0.3.2/Cargo.toml +302 -0
- package/third-party/cargo/objc2-quartz-core@0.3.2/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2-quartz-core@0.3.2/madsmtm-objc2-7b1abfd750a2-LICENSE.md +34 -0
- package/third-party/cargo/objc2@0.6.4/Cargo.toml +232 -0
- package/third-party/cargo/objc2@0.6.4/MIT-terms.txt +22 -0
- package/third-party/cargo/objc2@0.6.4/madsmtm-objc2-8852b424193c-LICENSE.md +34 -0
- package/third-party/cargo/once_cell@1.21.4/Cargo.toml +119 -0
- package/third-party/cargo/once_cell@1.21.4/LICENSE-APACHE +201 -0
- package/third-party/cargo/once_cell@1.21.4/LICENSE-MIT +23 -0
- package/third-party/cargo/ordered-float@5.3.0/Cargo.toml +162 -0
- package/third-party/cargo/ordered-float@5.3.0/LICENSE-MIT +25 -0
- package/third-party/cargo/parking_lot@0.12.5/Cargo.toml +87 -0
- package/third-party/cargo/parking_lot@0.12.5/LICENSE-APACHE +201 -0
- package/third-party/cargo/parking_lot@0.12.5/LICENSE-MIT +25 -0
- package/third-party/cargo/parking_lot_core@0.9.12/Cargo.toml +72 -0
- package/third-party/cargo/parking_lot_core@0.9.12/LICENSE-APACHE +201 -0
- package/third-party/cargo/parking_lot_core@0.9.12/LICENSE-MIT +25 -0
- package/third-party/cargo/pico-args@0.5.0/Cargo.toml +32 -0
- package/third-party/cargo/pico-args@0.5.0/LICENSE +20 -0
- package/third-party/cargo/pin-project-lite@0.2.17/Cargo.toml +198 -0
- package/third-party/cargo/pin-project-lite@0.2.17/LICENSE-APACHE +177 -0
- package/third-party/cargo/pin-project-lite@0.2.17/LICENSE-MIT +23 -0
- package/third-party/cargo/pkg-config@0.3.33/Cargo.toml +43 -0
- package/third-party/cargo/pkg-config@0.3.33/LICENSE-APACHE +201 -0
- package/third-party/cargo/pkg-config@0.3.33/LICENSE-MIT +25 -0
- package/third-party/cargo/png@0.18.1/Cargo.toml +130 -0
- package/third-party/cargo/png@0.18.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/png@0.18.1/LICENSE-MIT +25 -0
- package/third-party/cargo/pollster@0.4.0/Cargo.toml +53 -0
- package/third-party/cargo/pollster@0.4.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/pollster@0.4.0/LICENSE-MIT +25 -0
- package/third-party/cargo/polycool@0.4.0/Cargo.toml +83 -0
- package/third-party/cargo/polycool@0.4.0/LICENSE-APACHE +202 -0
- package/third-party/cargo/polycool@0.4.0/LICENSE-MIT +25 -0
- package/third-party/cargo/pp-rs@0.2.1/Cargo.toml +23 -0
- package/third-party/cargo/pp-rs@0.2.1/LICENSE +29 -0
- package/third-party/cargo/presser@0.3.1/Cargo.toml +58 -0
- package/third-party/cargo/presser@0.3.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/presser@0.3.1/LICENSE-MIT +25 -0
- package/third-party/cargo/proc-macro2@1.0.106/Cargo.toml +105 -0
- package/third-party/cargo/proc-macro2@1.0.106/LICENSE-APACHE +176 -0
- package/third-party/cargo/proc-macro2@1.0.106/LICENSE-MIT +23 -0
- package/third-party/cargo/profiling@1.0.18/Cargo.toml +96 -0
- package/third-party/cargo/profiling@1.0.18/aclysma-profiling-8271551172eb-LICENSE-APACHE +201 -0
- package/third-party/cargo/profiling@1.0.18/aclysma-profiling-8271551172eb-LICENSE-MIT +21 -0
- package/third-party/cargo/pxfm@0.1.30/Cargo.toml +53 -0
- package/third-party/cargo/pxfm@0.1.30/LICENSE-APACHE.md +201 -0
- package/third-party/cargo/pxfm@0.1.30/LICENSE.md +26 -0
- package/third-party/cargo/quick-error@2.0.1/Cargo.toml +24 -0
- package/third-party/cargo/quick-error@2.0.1/LICENSE-APACHE +202 -0
- package/third-party/cargo/quick-error@2.0.1/LICENSE-MIT +19 -0
- package/third-party/cargo/quote@1.0.46/Cargo.toml +70 -0
- package/third-party/cargo/quote@1.0.46/LICENSE-APACHE +176 -0
- package/third-party/cargo/quote@1.0.46/LICENSE-MIT +23 -0
- package/third-party/cargo/rangemap@1.7.1/Cargo.toml +91 -0
- package/third-party/cargo/rangemap@1.7.1/LICENSE-APACHE +191 -0
- package/third-party/cargo/rangemap@1.7.1/LICENSE-MIT +7 -0
- package/third-party/cargo/raw-window-handle@0.6.2/Cargo.toml +56 -0
- package/third-party/cargo/raw-window-handle@0.6.2/LICENSE-APACHE.md +177 -0
- package/third-party/cargo/raw-window-handle@0.6.2/LICENSE-MIT.md +21 -0
- package/third-party/cargo/raw-window-handle@0.6.2/LICENSE-ZLIB.md +11 -0
- package/third-party/cargo/raw-window-metal@1.1.0/Cargo.toml +111 -0
- package/third-party/cargo/raw-window-metal@1.1.0/LICENSE-APACHE +202 -0
- package/third-party/cargo/raw-window-metal@1.1.0/LICENSE-MIT +17 -0
- package/third-party/cargo/read-fonts@0.37.0/Cargo.toml +95 -0
- package/third-party/cargo/read-fonts@0.37.0/LICENSE-APACHE +67 -0
- package/third-party/cargo/read-fonts@0.37.0/LICENSE-MIT +25 -0
- package/third-party/cargo/read-fonts@0.39.2/Cargo.toml +96 -0
- package/third-party/cargo/read-fonts@0.39.2/LICENSE-APACHE +67 -0
- package/third-party/cargo/read-fonts@0.39.2/LICENSE-MIT +25 -0
- package/third-party/cargo/renderdoc-sys@1.1.0/Cargo.toml +39 -0
- package/third-party/cargo/renderdoc-sys@1.1.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/renderdoc-sys@1.1.0/LICENSE-MIT +25 -0
- package/third-party/cargo/resvg@0.47.0/Cargo.toml +112 -0
- package/third-party/cargo/resvg@0.47.0/LICENSE-APACHE +176 -0
- package/third-party/cargo/resvg@0.47.0/LICENSE-MIT +25 -0
- package/third-party/cargo/rgb@0.8.53/Cargo.toml +110 -0
- package/third-party/cargo/rgb@0.8.53/LICENSE +21 -0
- package/third-party/cargo/roxmltree@0.21.1/Cargo.toml +75 -0
- package/third-party/cargo/roxmltree@0.21.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/roxmltree@0.21.1/LICENSE-MIT +21 -0
- package/third-party/cargo/rustc-hash@1.1.0/Cargo.toml +25 -0
- package/third-party/cargo/rustc-hash@1.1.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/rustc-hash@1.1.0/LICENSE-MIT +23 -0
- package/third-party/cargo/rustc-hash@2.1.3/Cargo.toml +50 -0
- package/third-party/cargo/rustc-hash@2.1.3/LICENSE-APACHE +176 -0
- package/third-party/cargo/rustc-hash@2.1.3/LICENSE-MIT +23 -0
- package/third-party/cargo/rustix@1.1.4/COPYRIGHT +29 -0
- package/third-party/cargo/rustix@1.1.4/Cargo.toml +292 -0
- package/third-party/cargo/rustix@1.1.4/LICENSE-APACHE +201 -0
- package/third-party/cargo/rustix@1.1.4/LICENSE-Apache-2.0_WITH_LLVM-exception +220 -0
- package/third-party/cargo/rustix@1.1.4/LICENSE-MIT +23 -0
- package/third-party/cargo/rustversion@1.0.23/Cargo.toml +69 -0
- package/third-party/cargo/rustversion@1.0.23/LICENSE-APACHE +176 -0
- package/third-party/cargo/rustversion@1.0.23/LICENSE-MIT +23 -0
- package/third-party/cargo/rustybuzz@0.20.1/Cargo.toml +110 -0
- package/third-party/cargo/rustybuzz@0.20.1/LICENSE +22 -0
- package/third-party/cargo/scopeguard@1.2.0/Cargo.toml +43 -0
- package/third-party/cargo/scopeguard@1.2.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/scopeguard@1.2.0/LICENSE-MIT +25 -0
- package/third-party/cargo/self_cell@1.2.2/Cargo.toml +33 -0
- package/third-party/cargo/self_cell@1.2.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/self_cell@1.2.2/LICENSE-GPLv2 +339 -0
- package/third-party/cargo/self_cell@1.3.0/Cargo.toml +33 -0
- package/third-party/cargo/self_cell@1.3.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/self_cell@1.3.0/LICENSE-GPLv2 +339 -0
- package/third-party/cargo/serde@1.0.228/Cargo.toml +84 -0
- package/third-party/cargo/serde@1.0.228/LICENSE-APACHE +176 -0
- package/third-party/cargo/serde@1.0.228/LICENSE-MIT +23 -0
- package/third-party/cargo/serde_core@1.0.228/Cargo.toml +87 -0
- package/third-party/cargo/serde_core@1.0.228/LICENSE-APACHE +176 -0
- package/third-party/cargo/serde_core@1.0.228/LICENSE-MIT +23 -0
- package/third-party/cargo/serde_derive@1.0.228/Cargo.toml +87 -0
- package/third-party/cargo/serde_derive@1.0.228/LICENSE-APACHE +176 -0
- package/third-party/cargo/serde_derive@1.0.228/LICENSE-MIT +23 -0
- package/third-party/cargo/serde_json@1.0.150/Cargo.toml +162 -0
- package/third-party/cargo/serde_json@1.0.150/LICENSE-APACHE +176 -0
- package/third-party/cargo/serde_json@1.0.150/LICENSE-MIT +23 -0
- package/third-party/cargo/simd-adler32@0.3.10/Cargo.toml +68 -0
- package/third-party/cargo/simd-adler32@0.3.10/LICENSE.md +21 -0
- package/third-party/cargo/simplecss@0.2.2/Cargo.toml +146 -0
- package/third-party/cargo/simplecss@0.2.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/simplecss@0.2.2/LICENSE-MIT +21 -0
- package/third-party/cargo/siphasher@1.0.3/COPYING +7 -0
- package/third-party/cargo/siphasher@1.0.3/Cargo.toml +64 -0
- package/third-party/cargo/skrifa@0.40.0/Cargo.toml +86 -0
- package/third-party/cargo/skrifa@0.40.0/LICENSE-APACHE +67 -0
- package/third-party/cargo/skrifa@0.40.0/LICENSE-MIT +25 -0
- package/third-party/cargo/skrifa@0.42.1/Cargo.toml +86 -0
- package/third-party/cargo/skrifa@0.42.1/LICENSE-APACHE +67 -0
- package/third-party/cargo/skrifa@0.42.1/LICENSE-MIT +25 -0
- package/third-party/cargo/slab@0.4.12/Cargo.toml +67 -0
- package/third-party/cargo/slab@0.4.12/LICENSE +25 -0
- package/third-party/cargo/slotmap@1.1.1/Cargo.toml +83 -0
- package/third-party/cargo/slotmap@1.1.1/LICENSE +19 -0
- package/third-party/cargo/smallvec@1.15.2/Cargo.toml +103 -0
- package/third-party/cargo/smallvec@1.15.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/smallvec@1.15.2/LICENSE-MIT +25 -0
- package/third-party/cargo/smol_str@0.3.6/Cargo.toml +155 -0
- package/third-party/cargo/smol_str@0.3.6/LICENSE-APACHE +201 -0
- package/third-party/cargo/smol_str@0.3.6/LICENSE-MIT +23 -0
- package/third-party/cargo/spirv@0.4.0+sdk-1.4.341.0/Cargo.toml +56 -0
- package/third-party/cargo/spirv@0.4.0+sdk-1.4.341.0/gfx-rs-rspirv-8afc3d0ac8e1-LICENSE +202 -0
- package/third-party/cargo/static_assertions@1.1.0/Cargo.toml +39 -0
- package/third-party/cargo/static_assertions@1.1.0/LICENSE-APACHE +202 -0
- package/third-party/cargo/static_assertions@1.1.0/LICENSE-MIT +21 -0
- package/third-party/cargo/strict-num@0.1.1/Cargo.toml +35 -0
- package/third-party/cargo/strict-num@0.1.1/LICENSE +19 -0
- package/third-party/cargo/svgtypes@0.16.1/Cargo.toml +57 -0
- package/third-party/cargo/svgtypes@0.16.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/svgtypes@0.16.1/LICENSE-MIT +20 -0
- package/third-party/cargo/swash@0.2.9/Cargo.toml +93 -0
- package/third-party/cargo/swash@0.2.9/LICENSE-APACHE +201 -0
- package/third-party/cargo/swash@0.2.9/LICENSE-MIT +25 -0
- package/third-party/cargo/syn@2.0.118/Cargo.toml +272 -0
- package/third-party/cargo/syn@2.0.118/LICENSE-APACHE +176 -0
- package/third-party/cargo/syn@2.0.118/LICENSE-MIT +23 -0
- package/third-party/cargo/sys-locale@0.3.2/Cargo.toml +73 -0
- package/third-party/cargo/sys-locale@0.3.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/sys-locale@0.3.2/LICENSE-MIT +21 -0
- package/third-party/cargo/taffy@0.12.1/Cargo.toml +171 -0
- package/third-party/cargo/taffy@0.12.1/DioxusLabs-taffy-1c9e37a0a1cf-LICENSE.md +25 -0
- package/third-party/cargo/tempfile@3.27.0/Cargo.toml +105 -0
- package/third-party/cargo/tempfile@3.27.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/tempfile@3.27.0/LICENSE-MIT +25 -0
- package/third-party/cargo/termcolor@1.4.1/COPYING +3 -0
- package/third-party/cargo/termcolor@1.4.1/Cargo.toml +40 -0
- package/third-party/cargo/termcolor@1.4.1/LICENSE-MIT +21 -0
- package/third-party/cargo/termcolor@1.4.1/UNLICENSE +24 -0
- package/third-party/cargo/thiserror-impl@2.0.18/Cargo.toml +52 -0
- package/third-party/cargo/thiserror-impl@2.0.18/LICENSE-APACHE +176 -0
- package/third-party/cargo/thiserror-impl@2.0.18/LICENSE-MIT +23 -0
- package/third-party/cargo/thiserror@2.0.18/Cargo.toml +119 -0
- package/third-party/cargo/thiserror@2.0.18/LICENSE-APACHE +176 -0
- package/third-party/cargo/thiserror@2.0.18/LICENSE-MIT +23 -0
- package/third-party/cargo/tiny-skia-path@0.12.0/Cargo.toml +58 -0
- package/third-party/cargo/tiny-skia-path@0.12.0/LICENSE +30 -0
- package/third-party/cargo/tiny-skia@0.12.0/Cargo.toml +116 -0
- package/third-party/cargo/tiny-skia@0.12.0/LICENSE +30 -0
- package/third-party/cargo/tiny_http@0.12.0/Cargo.toml +82 -0
- package/third-party/cargo/tiny_http@0.12.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/tiny_http@0.12.0/LICENSE-MIT +25 -0
- package/third-party/cargo/tinyvec@1.12.0/Cargo.toml +184 -0
- package/third-party/cargo/tinyvec@1.12.0/LICENSE-APACHE.md +202 -0
- package/third-party/cargo/tinyvec@1.12.0/LICENSE-MIT.md +5 -0
- package/third-party/cargo/tinyvec@1.12.0/LICENSE-ZLIB.md +11 -0
- package/third-party/cargo/tinyvec_macros@0.1.1/Cargo.toml +19 -0
- package/third-party/cargo/tinyvec_macros@0.1.1/LICENSE-APACHE.md +202 -0
- package/third-party/cargo/tinyvec_macros@0.1.1/LICENSE-MIT.md +21 -0
- package/third-party/cargo/tinyvec_macros@0.1.1/LICENSE-ZLIB.md +20 -0
- package/third-party/cargo/ttf-parser@0.25.1/Cargo.toml +101 -0
- package/third-party/cargo/ttf-parser@0.25.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/ttf-parser@0.25.1/LICENSE-MIT +20 -0
- package/third-party/cargo/unicode-bidi-mirroring@0.4.0/Cargo.toml +22 -0
- package/third-party/cargo/unicode-bidi-mirroring@0.4.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-bidi-mirroring@0.4.0/LICENSE-MIT +21 -0
- package/third-party/cargo/unicode-bidi@0.3.18/COPYRIGHT +8 -0
- package/third-party/cargo/unicode-bidi@0.3.18/Cargo.toml +90 -0
- package/third-party/cargo/unicode-bidi@0.3.18/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-bidi@0.3.18/LICENSE-MIT +25 -0
- package/third-party/cargo/unicode-ccc@0.4.0/Cargo.toml +22 -0
- package/third-party/cargo/unicode-ccc@0.4.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-ccc@0.4.0/LICENSE-MIT +21 -0
- package/third-party/cargo/unicode-ident@1.0.24/Cargo.toml +84 -0
- package/third-party/cargo/unicode-ident@1.0.24/LICENSE-APACHE +176 -0
- package/third-party/cargo/unicode-ident@1.0.24/LICENSE-MIT +23 -0
- package/third-party/cargo/unicode-ident@1.0.24/LICENSE-UNICODE +39 -0
- package/third-party/cargo/unicode-linebreak@0.1.5/Cargo.toml +32 -0
- package/third-party/cargo/unicode-linebreak@0.1.5/LICENSE +201 -0
- package/third-party/cargo/unicode-properties@0.1.4/COPYRIGHT +7 -0
- package/third-party/cargo/unicode-properties@0.1.4/Cargo.toml +65 -0
- package/third-party/cargo/unicode-properties@0.1.4/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-properties@0.1.4/LICENSE-MIT +25 -0
- package/third-party/cargo/unicode-script@0.5.8/Cargo.toml +63 -0
- package/third-party/cargo/unicode-script@0.5.8/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-script@0.5.8/LICENSE-MIT +27 -0
- package/third-party/cargo/unicode-segmentation@1.13.3/COPYRIGHT +7 -0
- package/third-party/cargo/unicode-segmentation@1.13.3/Cargo.toml +91 -0
- package/third-party/cargo/unicode-segmentation@1.13.3/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-segmentation@1.13.3/LICENSE-MIT +25 -0
- package/third-party/cargo/unicode-vo@0.1.0/Cargo.toml +22 -0
- package/third-party/cargo/unicode-vo@0.1.0/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-vo@0.1.0/LICENSE-MIT +21 -0
- package/third-party/cargo/unicode-width@0.2.2/COPYRIGHT +7 -0
- package/third-party/cargo/unicode-width@0.2.2/Cargo.toml +77 -0
- package/third-party/cargo/unicode-width@0.2.2/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-width@0.2.2/LICENSE-MIT +25 -0
- package/third-party/cargo/unicode-xid@0.2.6/COPYRIGHT +7 -0
- package/third-party/cargo/unicode-xid@0.2.6/Cargo.toml +65 -0
- package/third-party/cargo/unicode-xid@0.2.6/LICENSE-APACHE +201 -0
- package/third-party/cargo/unicode-xid@0.2.6/LICENSE-MIT +25 -0
- package/third-party/cargo/urlencoding@2.1.3/Cargo.toml +41 -0
- package/third-party/cargo/urlencoding@2.1.3/LICENSE +20 -0
- package/third-party/cargo/usvg@0.47.0/Cargo.toml +138 -0
- package/third-party/cargo/usvg@0.47.0/LICENSE-APACHE +176 -0
- package/third-party/cargo/usvg@0.47.0/LICENSE-MIT +25 -0
- package/third-party/cargo/version_check@0.9.5/Cargo.toml +38 -0
- package/third-party/cargo/version_check@0.9.5/LICENSE-APACHE +201 -0
- package/third-party/cargo/version_check@0.9.5/LICENSE-MIT +19 -0
- package/third-party/cargo/wasm-bindgen-futures@0.4.76/Cargo.toml +88 -0
- package/third-party/cargo/wasm-bindgen-futures@0.4.76/LICENSE-APACHE +201 -0
- package/third-party/cargo/wasm-bindgen-futures@0.4.76/LICENSE-MIT +25 -0
- package/third-party/cargo/wasm-bindgen-macro-support@0.2.126/Cargo.toml +83 -0
- package/third-party/cargo/wasm-bindgen-macro-support@0.2.126/LICENSE-APACHE +201 -0
- package/third-party/cargo/wasm-bindgen-macro-support@0.2.126/LICENSE-MIT +25 -0
- package/third-party/cargo/wasm-bindgen-macro@0.2.126/Cargo.toml +73 -0
- package/third-party/cargo/wasm-bindgen-macro@0.2.126/LICENSE-APACHE +201 -0
- package/third-party/cargo/wasm-bindgen-macro@0.2.126/LICENSE-MIT +25 -0
- package/third-party/cargo/wasm-bindgen-shared@0.2.126/Cargo.toml +66 -0
- package/third-party/cargo/wasm-bindgen-shared@0.2.126/LICENSE-APACHE +201 -0
- package/third-party/cargo/wasm-bindgen-shared@0.2.126/LICENSE-MIT +25 -0
- package/third-party/cargo/wasm-bindgen@0.2.126/Cargo.toml +122 -0
- package/third-party/cargo/wasm-bindgen@0.2.126/LICENSE-APACHE +201 -0
- package/third-party/cargo/wasm-bindgen@0.2.126/LICENSE-MIT +25 -0
- package/third-party/cargo/wayland-sys@0.31.11/Cargo.toml +81 -0
- package/third-party/cargo/wayland-sys@0.31.11/LICENSE.txt +19 -0
- package/third-party/cargo/web-sys@0.3.103/Cargo.toml +2823 -0
- package/third-party/cargo/web-sys@0.3.103/LICENSE-APACHE +201 -0
- package/third-party/cargo/web-sys@0.3.103/LICENSE-MIT +25 -0
- package/third-party/cargo/weezl@0.1.12/Cargo.toml +120 -0
- package/third-party/cargo/weezl@0.1.12/LICENSE-APACHE +201 -0
- package/third-party/cargo/weezl@0.1.12/LICENSE-MIT +22 -0
- package/third-party/cargo/wgpu-core-deps-apple@30.0.0/Cargo.toml +53 -0
- package/third-party/cargo/wgpu-core-deps-apple@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/wgpu-core-deps-apple@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/wgpu-core@30.0.0/Cargo.toml +237 -0
- package/third-party/cargo/wgpu-core@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/wgpu-core@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/wgpu-hal@30.0.0/Cargo.toml +541 -0
- package/third-party/cargo/wgpu-hal@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/wgpu-hal@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/wgpu-naga-bridge@30.0.0/Cargo.toml +46 -0
- package/third-party/cargo/wgpu-naga-bridge@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/wgpu-naga-bridge@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/wgpu-types@30.0.0/Cargo.toml +161 -0
- package/third-party/cargo/wgpu-types@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/wgpu-types@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/wgpu@30.0.0/Cargo.toml +278 -0
- package/third-party/cargo/wgpu@30.0.0/LICENSE.APACHE +176 -0
- package/third-party/cargo/wgpu@30.0.0/LICENSE.MIT +21 -0
- package/third-party/cargo/xmlwriter@0.1.0/Cargo.toml +23 -0
- package/third-party/cargo/xmlwriter@0.1.0/LICENSE +21 -0
- package/third-party/cargo/yazi@0.2.1/Cargo.toml +45 -0
- package/third-party/cargo/yazi@0.2.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/yazi@0.2.1/LICENSE-MIT +19 -0
- package/third-party/cargo/zeno@0.3.3/Cargo.toml +65 -0
- package/third-party/cargo/zeno@0.3.3/LICENSE-APACHE +201 -0
- package/third-party/cargo/zeno@0.3.3/LICENSE-MIT +25 -0
- package/third-party/cargo/zerocopy-derive@0.8.54/Cargo.toml +209 -0
- package/third-party/cargo/zerocopy-derive@0.8.54/LICENSE-APACHE +202 -0
- package/third-party/cargo/zerocopy-derive@0.8.54/LICENSE-BSD +24 -0
- package/third-party/cargo/zerocopy-derive@0.8.54/LICENSE-MIT +26 -0
- package/third-party/cargo/zerocopy@0.8.54/Cargo.toml +419 -0
- package/third-party/cargo/zerocopy@0.8.54/LICENSE-APACHE +202 -0
- package/third-party/cargo/zerocopy@0.8.54/LICENSE-BSD +24 -0
- package/third-party/cargo/zerocopy@0.8.54/LICENSE-MIT +26 -0
- package/third-party/cargo/zmij@1.0.23/Cargo.toml +90 -0
- package/third-party/cargo/zmij@1.0.23/LICENSE-MIT +23 -0
- package/third-party/cargo/zune-core@0.5.1/Cargo.toml +47 -0
- package/third-party/cargo/zune-core@0.5.1/LICENSE-APACHE +201 -0
- package/third-party/cargo/zune-core@0.5.1/LICENSE-MIT +21 -0
- package/third-party/cargo/zune-core@0.5.1/LICENSE-ZLIB +19 -0
- package/third-party/cargo/zune-jpeg@0.5.15/Cargo.toml +67 -0
- package/third-party/cargo/zune-jpeg@0.5.15/LICENSE-APACHE +201 -0
- package/third-party/cargo/zune-jpeg@0.5.15/LICENSE-MIT +21 -0
- package/third-party/cargo/zune-jpeg@0.5.15/LICENSE-ZLIB +19 -0
- package/third-party/inventory.json +3614 -0
- package/third-party/npm/@esbuild__darwin-arm64@0.27.4/esbuild-0.27.4-LICENSE.md +21 -0
- package/third-party/npm/@esbuild__darwin-arm64@0.27.4/go-LICENSE +27 -0
- package/third-party/npm/@esbuild__darwin-arm64@0.27.4/golang-x-sys-c0bba94af5f8-LICENSE +27 -0
- package/third-party/npm/@esbuild__darwin-arm64@0.27.4/package.json +20 -0
- package/third-party/npm/@floating-ui__core@1.7.5/LICENSE +20 -0
- package/third-party/npm/@floating-ui__core@1.7.5/package.json +63 -0
- package/third-party/npm/@floating-ui__dom@1.7.6/LICENSE +20 -0
- package/third-party/npm/@floating-ui__dom@1.7.6/package.json +71 -0
- package/third-party/npm/@floating-ui__react-dom@2.1.8/LICENSE +20 -0
- package/third-party/npm/@floating-ui__react-dom@2.1.8/package.json +76 -0
- package/third-party/npm/@floating-ui__utils@0.2.11/LICENSE +20 -0
- package/third-party/npm/@floating-ui__utils@0.2.11/package.json +70 -0
- package/third-party/npm/@radix-ui__primitive@1.1.7/LICENSE +21 -0
- package/third-party/npm/@radix-ui__primitive@1.1.7/package.json +79 -0
- package/third-party/npm/@radix-ui__react-arrow@1.1.15/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-arrow@1.1.15/package.json +68 -0
- package/third-party/npm/@radix-ui__react-collection@1.1.15/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-collection@1.1.15/package.json +71 -0
- package/third-party/npm/@radix-ui__react-compose-refs@1.1.5/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-compose-refs@1.1.5/package.json +60 -0
- package/third-party/npm/@radix-ui__react-context-menu@2.3.7/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-context-menu@2.3.7/package.json +73 -0
- package/third-party/npm/@radix-ui__react-context@1.2.2/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-context@1.2.2/package.json +60 -0
- package/third-party/npm/@radix-ui__react-direction@1.1.4/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-direction@1.1.4/package.json +60 -0
- package/third-party/npm/@radix-ui__react-dismissable-layer@1.1.19/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-dismissable-layer@1.1.19/package.json +74 -0
- package/third-party/npm/@radix-ui__react-focus-guards@1.1.6/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-focus-guards@1.1.6/package.json +60 -0
- package/third-party/npm/@radix-ui__react-focus-scope@1.1.16/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-focus-scope@1.1.16/package.json +71 -0
- package/third-party/npm/@radix-ui__react-id@1.1.4/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-id@1.1.4/package.json +63 -0
- package/third-party/npm/@radix-ui__react-menu@2.1.24/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-menu@2.1.24/package.json +86 -0
- package/third-party/npm/@radix-ui__react-popper@1.3.7/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-popper@1.3.7/package.json +78 -0
- package/third-party/npm/@radix-ui__react-portal@1.1.17/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-portal@1.1.17/package.json +69 -0
- package/third-party/npm/@radix-ui__react-presence@1.1.10/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-presence@1.1.10/package.json +68 -0
- package/third-party/npm/@radix-ui__react-primitive@2.1.10/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-primitive@2.1.10/package.json +68 -0
- package/third-party/npm/@radix-ui__react-roving-focus@1.1.19/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-roving-focus@1.1.19/package.json +78 -0
- package/third-party/npm/@radix-ui__react-slot@1.3.3/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-slot@1.3.3/package.json +63 -0
- package/third-party/npm/@radix-ui__react-use-callback-ref@1.1.4/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-use-callback-ref@1.1.4/package.json +60 -0
- package/third-party/npm/@radix-ui__react-use-controllable-state@1.2.6/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-use-controllable-state@1.2.6/package.json +65 -0
- package/third-party/npm/@radix-ui__react-use-effect-event@0.0.5/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-use-effect-event@0.0.5/package.json +65 -0
- package/third-party/npm/@radix-ui__react-use-is-hydrated@0.1.3/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-use-is-hydrated@0.1.3/package.json +61 -0
- package/third-party/npm/@radix-ui__react-use-layout-effect@1.1.4/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-use-layout-effect@1.1.4/package.json +60 -0
- package/third-party/npm/@radix-ui__react-use-size@1.1.4/LICENSE +21 -0
- package/third-party/npm/@radix-ui__react-use-size@1.1.4/package.json +63 -0
- package/third-party/npm/aria-hidden@1.2.6/LICENSE +21 -0
- package/third-party/npm/aria-hidden@1.2.6/package.json +71 -0
- package/third-party/npm/detect-node-es@1.1.0/LICENSE +21 -0
- package/third-party/npm/detect-node-es@1.1.0/package.json +29 -0
- package/third-party/npm/esbuild@0.27.4/LICENSE.md +21 -0
- package/third-party/npm/esbuild@0.27.4/package.json +49 -0
- package/third-party/npm/fflate@0.8.3/LICENSE +21 -0
- package/third-party/npm/fflate@0.8.3/package.json +128 -0
- package/third-party/npm/get-nonce@1.0.1/LICENSE +21 -0
- package/third-party/npm/get-nonce@1.0.1/package.json +68 -0
- package/third-party/npm/mediabunny@1.52.2/LICENSE +373 -0
- package/third-party/npm/mediabunny@1.52.2/package.json +136 -0
- package/third-party/npm/mediabunny@1.52.2/source/LICENSE +373 -0
- package/third-party/npm/mediabunny@1.52.2/source/package.json +136 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/adts/adts-demuxer.ts +400 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/adts/adts-muxer.ts +124 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/adts/adts-reader.ts +85 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/aes.ts +307 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/codec-data.ts +3178 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/codec.ts +1154 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/conversion.ts +2042 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/custom-coder.ts +212 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/decode.ts +263 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/demuxer.ts +43 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/encode.ts +1412 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/flac/flac-demuxer.ts +813 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/flac/flac-misc.ts +165 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/flac/flac-muxer.ts +350 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/hls/hls-demuxer.ts +995 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/hls/hls-misc.ts +81 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/hls/hls-muxer.ts +1529 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/hls/hls-segmented-input.ts +772 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/id3.ts +972 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/index.ts +319 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/input-format.ts +819 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/input-track.ts +1141 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/input.ts +571 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/isobmff/isobmff-boxes.ts +1911 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/isobmff/isobmff-demuxer.ts +3953 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/isobmff/isobmff-misc.ts +90 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/isobmff/isobmff-muxer.ts +1595 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/isobmff/isobmff-reader.ts +91 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/logging.ts +120 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/matroska/ebml.ts +770 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/matroska/matroska-demuxer.ts +2598 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/matroska/matroska-misc.ts +29 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/matroska/matroska-muxer.ts +1360 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/media-sink.ts +2589 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/media-source.ts +3041 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/metadata.ts +335 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/misc.ts +1336 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/mp3/mp3-demuxer.ts +469 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/mp3/mp3-muxer.ts +169 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/mp3/mp3-reader.ts +61 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/mp3/mp3-writer.ts +121 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/mpeg-ts/mpeg-ts-demuxer.ts +2519 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/mpeg-ts/mpeg-ts-misc.ts +32 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/mpeg-ts/mpeg-ts-muxer.ts +842 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/muxer.ts +80 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/node.ts +11 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/ogg/ogg-demuxer.ts +1087 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/ogg/ogg-misc.ts +116 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/ogg/ogg-muxer.ts +527 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/ogg/ogg-reader.ts +93 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/output-format.ts +1425 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/output.ts +940 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/packet.ts +287 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/pcm.ts +112 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/reader.ts +391 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/resample.ts +287 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/sample.ts +3231 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/segmented-input.ts +575 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/source.ts +2588 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/subtitles.ts +131 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/target.ts +871 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/tsconfig.json +16 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/wave/riff-writer.ts +36 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/wave/wave-demuxer.ts +583 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/wave/wave-muxer.ts +375 -0
- package/third-party/npm/mediabunny@1.52.2/source/src/writer.ts +128 -0
- package/third-party/npm/react-dom@19.3.0/LICENSE +21 -0
- package/third-party/npm/react-dom@19.3.0/package.json +117 -0
- package/third-party/npm/react-remove-scroll-bar@2.3.8/package.json +85 -0
- package/third-party/npm/react-remove-scroll-bar@2.3.8/react-remove-scroll-bar-LICENSE +21 -0
- package/third-party/npm/react-remove-scroll@2.7.2/LICENSE +21 -0
- package/third-party/npm/react-remove-scroll@2.7.2/package.json +98 -0
- package/third-party/npm/react-style-singleton@2.2.3/LICENSE +21 -0
- package/third-party/npm/react-style-singleton@2.2.3/package.json +90 -0
- package/third-party/npm/react@19.3.0/LICENSE +21 -0
- package/third-party/npm/react@19.3.0/package.json +51 -0
- package/third-party/npm/scheduler@0.28.0/LICENSE +21 -0
- package/third-party/npm/scheduler@0.28.0/package.json +27 -0
- package/third-party/npm/tslib@2.8.1/LICENSE.txt +12 -0
- package/third-party/npm/tslib@2.8.1/package.json +47 -0
- package/third-party/npm/typescript@5.9.3/LICENSE.txt +55 -0
- package/third-party/npm/typescript@5.9.3/ThirdPartyNoticeText.txt +193 -0
- package/third-party/npm/typescript@5.9.3/package.json +120 -0
- package/third-party/npm/use-callback-ref@1.3.3/LICENSE +21 -0
- package/third-party/npm/use-callback-ref@1.3.3/package.json +85 -0
- package/third-party/npm/use-sidecar@1.1.3/LICENSE +21 -0
- package/third-party/npm/use-sidecar@1.1.3/package.json +93 -0
- package/third-party/packages/render-engine/assets/OFL.txt +93 -0
- package/third-party/packages/studio/public/fonts/OFL.txt +93 -0
- package/third-party/packages/studio/vendor/osmo-icons/LICENSE +21 -0
- package/third-party/packages/studio/vendor/shadcn/LICENSE +21 -0
- package/third-party/repository-notices.md +41 -0
- package/third-party/rust-standard-library/COPYRIGHT-library.html +5556 -0
- package/third-party/rust-standard-library/licenses/Apache-2.0.txt +73 -0
- package/third-party/rust-standard-library/licenses/BSD-2-Clause.txt +9 -0
- package/third-party/rust-standard-library/licenses/CC-BY-SA-4.0.txt +427 -0
- package/third-party/rust-standard-library/licenses/GCC-exception-3.1.txt +30 -0
- package/third-party/rust-standard-library/licenses/GPL-2.0-only.txt +133 -0
- package/third-party/rust-standard-library/licenses/GPL-3.0-or-later.txt +202 -0
- package/third-party/rust-standard-library/licenses/ISC.txt +7 -0
- package/third-party/rust-standard-library/licenses/LLVM-exception.txt +15 -0
- package/third-party/rust-standard-library/licenses/MIT.txt +9 -0
- package/third-party/rust-standard-library/licenses/NCSA.txt +29 -0
- package/third-party/rust-standard-library/licenses/OFL-1.1.txt +43 -0
- package/third-party/rust-standard-library/licenses/Unicode-3.0.txt +39 -0
- package/third-party/rust-standard-library/version.txt +1 -0
- package/vendor/osmo-lite +0 -0
- package/vendor/osmo-scene-0.1.0.tgz +0 -0
- package/vendor/platform.json +1 -0
|
@@ -0,0 +1,1336 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2026-present, Vanilagy and contributors
|
|
3
|
+
*
|
|
4
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { Bitstream } from '../shared/bitstream';
|
|
10
|
+
import { Logging } from './logging';
|
|
11
|
+
|
|
12
|
+
export function assert(x: unknown): asserts x {
|
|
13
|
+
if (!x) {
|
|
14
|
+
throw new Error('Assertion failed.');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Represents a clockwise rotation in degrees.
|
|
20
|
+
* @group Miscellaneous
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export type Rotation = 0 | 90 | 180 | 270;
|
|
24
|
+
|
|
25
|
+
export const normalizeRotation = (rotation: number) => {
|
|
26
|
+
const mappedRotation = (rotation % 360 + 360) % 360;
|
|
27
|
+
|
|
28
|
+
if (mappedRotation === 0 || mappedRotation === 90 || mappedRotation === 180 || mappedRotation === 270) {
|
|
29
|
+
return mappedRotation as Rotation;
|
|
30
|
+
} else {
|
|
31
|
+
throw new Error(`Invalid rotation ${rotation}.`);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type TransformationMatrix = [number, number, number, number, number, number, number, number, number];
|
|
36
|
+
|
|
37
|
+
export const last = <T>(arr: T[]) => {
|
|
38
|
+
return arr && arr[arr.length - 1];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const isU32 = (value: number) => {
|
|
42
|
+
return value >= 0 && value < 2 ** 32;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** Reads an exponential-Golomb universal code from a Bitstream. */
|
|
46
|
+
export const readExpGolomb = (bitstream: Bitstream) => {
|
|
47
|
+
let leadingZeroBits = 0;
|
|
48
|
+
while (bitstream.readBits(1) === 0 && leadingZeroBits < 32) {
|
|
49
|
+
leadingZeroBits++;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (leadingZeroBits >= 32) {
|
|
53
|
+
throw new Error('Invalid exponential-Golomb code.');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const result = (1 << leadingZeroBits) - 1 + bitstream.readBits(leadingZeroBits);
|
|
57
|
+
return result;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** Reads a signed exponential-Golomb universal code from a Bitstream. */
|
|
61
|
+
export const readSignedExpGolomb = (bitstream: Bitstream) => {
|
|
62
|
+
const codeNum = readExpGolomb(bitstream);
|
|
63
|
+
|
|
64
|
+
return ((codeNum & 1) === 0)
|
|
65
|
+
? -(codeNum >> 1)
|
|
66
|
+
: ((codeNum + 1) >> 1);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const writeBits = (bytes: Uint8Array, start: number, end: number, value: number) => {
|
|
70
|
+
for (let i = start; i < end; i++) {
|
|
71
|
+
const byteIndex = Math.floor(i / 8);
|
|
72
|
+
let byte = bytes[byteIndex]!;
|
|
73
|
+
const bitIndex = 0b111 - (i & 0b111);
|
|
74
|
+
|
|
75
|
+
byte &= ~(1 << bitIndex);
|
|
76
|
+
byte |= ((value & (1 << (end - i - 1))) >> (end - i - 1)) << bitIndex;
|
|
77
|
+
bytes[byteIndex] = byte;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const toUint8Array = (source: AllowSharedBufferSource): Uint8Array => {
|
|
82
|
+
if (source.constructor === Uint8Array) { // We want a true Uint8Array, not something that extends it like Buffer
|
|
83
|
+
return source;
|
|
84
|
+
} else if (ArrayBuffer.isView(source)) {
|
|
85
|
+
return new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
|
|
86
|
+
} else {
|
|
87
|
+
return new Uint8Array(source);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const toDataView = (source: AllowSharedBufferSource): DataView => {
|
|
92
|
+
if (source.constructor === DataView) {
|
|
93
|
+
return source;
|
|
94
|
+
} else if (ArrayBuffer.isView(source)) {
|
|
95
|
+
return new DataView(source.buffer, source.byteOffset, source.byteLength);
|
|
96
|
+
} else {
|
|
97
|
+
return new DataView(source);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const textDecoder = /* #__PURE__ */ new TextDecoder();
|
|
102
|
+
export const textEncoder = /* #__PURE__ */ new TextEncoder();
|
|
103
|
+
|
|
104
|
+
export const isIso88591Compatible = (text: string) => {
|
|
105
|
+
for (let i = 0; i < text.length; i++) {
|
|
106
|
+
const code = text.charCodeAt(i);
|
|
107
|
+
if (code > 255) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return true;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const invertObject = <K extends PropertyKey, V extends PropertyKey>(object: Record<K, V>) => {
|
|
116
|
+
return Object.fromEntries(Object.entries(object).map(([key, value]) => [value, key])) as Record<V, K>;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// For the color space mappings, see Rec. ITU-T H.273.
|
|
120
|
+
|
|
121
|
+
export const COLOR_PRIMARIES_MAP = {
|
|
122
|
+
bt709: 1, // ITU-R BT.709
|
|
123
|
+
bt470bg: 5, // ITU-R BT.470BG
|
|
124
|
+
smpte170m: 6, // ITU-R BT.601 525 - SMPTE 170M
|
|
125
|
+
bt2020: 9, // ITU-R BT.202
|
|
126
|
+
smpte432: 12, // SMPTE EG 432-1
|
|
127
|
+
};
|
|
128
|
+
export const COLOR_PRIMARIES_MAP_INVERSE = /* #__PURE__ */ invertObject(COLOR_PRIMARIES_MAP);
|
|
129
|
+
|
|
130
|
+
export const TRANSFER_CHARACTERISTICS_MAP = {
|
|
131
|
+
'bt709': 1, // ITU-R BT.709
|
|
132
|
+
'smpte170m': 6, // SMPTE 170M
|
|
133
|
+
'linear': 8, // Linear transfer characteristics
|
|
134
|
+
'iec61966-2-1': 13, // IEC 61966-2-1
|
|
135
|
+
'pq': 16, // Rec. ITU-R BT.2100-2 perceptual quantization (PQ) system
|
|
136
|
+
'hlg': 18, // Rec. ITU-R BT.2100-2 hybrid loggamma (HLG) system
|
|
137
|
+
};
|
|
138
|
+
export const TRANSFER_CHARACTERISTICS_MAP_INVERSE = /* #__PURE__ */ invertObject(TRANSFER_CHARACTERISTICS_MAP);
|
|
139
|
+
|
|
140
|
+
export const MATRIX_COEFFICIENTS_MAP = {
|
|
141
|
+
'rgb': 0, // Identity
|
|
142
|
+
'bt709': 1, // ITU-R BT.709
|
|
143
|
+
'bt470bg': 5, // ITU-R BT.470BG
|
|
144
|
+
'smpte170m': 6, // SMPTE 170M
|
|
145
|
+
'bt2020-ncl': 9, // ITU-R BT.2020-2 (non-constant luminance)
|
|
146
|
+
};
|
|
147
|
+
export const MATRIX_COEFFICIENTS_MAP_INVERSE = /* #__PURE__ */ invertObject(MATRIX_COEFFICIENTS_MAP);
|
|
148
|
+
|
|
149
|
+
export type RequiredNonNull<T> = {
|
|
150
|
+
[K in keyof T]-?: NonNullable<T[K]>;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export const colorSpaceIsComplete = (
|
|
154
|
+
colorSpace: VideoColorSpaceInit | undefined,
|
|
155
|
+
): colorSpace is RequiredNonNull<VideoColorSpaceInit> => {
|
|
156
|
+
return (
|
|
157
|
+
!!colorSpace
|
|
158
|
+
&& !!colorSpace.primaries
|
|
159
|
+
&& !!colorSpace.transfer
|
|
160
|
+
&& !!colorSpace.matrix
|
|
161
|
+
&& colorSpace.fullRange !== undefined
|
|
162
|
+
);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export const isAllowSharedBufferSource = (x: unknown) => {
|
|
166
|
+
return (
|
|
167
|
+
x instanceof ArrayBuffer
|
|
168
|
+
|| (typeof SharedArrayBuffer !== 'undefined' && x instanceof SharedArrayBuffer)
|
|
169
|
+
|| ArrayBuffer.isView(x)
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export class AsyncMutex {
|
|
174
|
+
currentPromise = Promise.resolve();
|
|
175
|
+
pending = 0;
|
|
176
|
+
|
|
177
|
+
async acquire() {
|
|
178
|
+
let resolver: () => void;
|
|
179
|
+
const nextPromise = new Promise<void>((resolve) => {
|
|
180
|
+
let resolved = false;
|
|
181
|
+
|
|
182
|
+
resolver = () => {
|
|
183
|
+
if (resolved) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
resolve();
|
|
188
|
+
this.pending--;
|
|
189
|
+
resolved = true;
|
|
190
|
+
};
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
const currentPromiseAlias = this.currentPromise;
|
|
194
|
+
this.currentPromise = nextPromise;
|
|
195
|
+
this.pending++;
|
|
196
|
+
|
|
197
|
+
await currentPromiseAlias;
|
|
198
|
+
|
|
199
|
+
return resolver!;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export const HEX_STRING_REGEX = /^[0-9a-fA-F]+$/;
|
|
204
|
+
|
|
205
|
+
export const bytesToHexString = (bytes: Uint8Array) => {
|
|
206
|
+
return [...bytes].map(x => x.toString(16).padStart(2, '0')).join('');
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
export const hexStringToBytes = (hexString: string) => {
|
|
210
|
+
assert(hexString.length % 2 === 0);
|
|
211
|
+
const bytes = new Uint8Array(hexString.length / 2);
|
|
212
|
+
for (let i = 0; i < hexString.length; i += 2) {
|
|
213
|
+
bytes[i / 2] = parseInt(hexString.slice(i, i + 2), 16);
|
|
214
|
+
}
|
|
215
|
+
return bytes;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
export const reverseBitsU32 = (x: number): number => {
|
|
219
|
+
x = ((x >> 1) & 0x55555555) | ((x & 0x55555555) << 1);
|
|
220
|
+
x = ((x >> 2) & 0x33333333) | ((x & 0x33333333) << 2);
|
|
221
|
+
x = ((x >> 4) & 0x0f0f0f0f) | ((x & 0x0f0f0f0f) << 4);
|
|
222
|
+
x = ((x >> 8) & 0x00ff00ff) | ((x & 0x00ff00ff) << 8);
|
|
223
|
+
x = ((x >> 16) & 0x0000ffff) | ((x & 0x0000ffff) << 16);
|
|
224
|
+
return x >>> 0; // Ensure it's treated as an unsigned 32-bit integer
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
/** Returns the smallest index i such that val[i] === key, or -1 if no such index exists. */
|
|
228
|
+
export const binarySearchExact = <T>(arr: T[], key: number, valueGetter: (x: T) => number): number => {
|
|
229
|
+
let low = 0;
|
|
230
|
+
let high = arr.length - 1;
|
|
231
|
+
let ans = -1;
|
|
232
|
+
|
|
233
|
+
while (low <= high) {
|
|
234
|
+
const mid = (low + high) >> 1;
|
|
235
|
+
const midVal = valueGetter(arr[mid]!);
|
|
236
|
+
|
|
237
|
+
if (midVal === key) {
|
|
238
|
+
ans = mid;
|
|
239
|
+
high = mid - 1; // Continue searching left to find the lowest index
|
|
240
|
+
} else if (midVal < key) {
|
|
241
|
+
low = mid + 1;
|
|
242
|
+
} else {
|
|
243
|
+
high = mid - 1;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return ans;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
/** Returns the largest index i such that val[i] <= key, or -1 if no such index exists. */
|
|
251
|
+
export const binarySearchLessOrEqual = <T>(arr: T[], key: number, valueGetter: (x: T) => number) => {
|
|
252
|
+
let low = 0;
|
|
253
|
+
let high = arr.length - 1;
|
|
254
|
+
let ans = -1;
|
|
255
|
+
|
|
256
|
+
while (low <= high) {
|
|
257
|
+
const mid = (low + (high - low + 1) / 2) | 0;
|
|
258
|
+
const midVal = valueGetter(arr[mid]!);
|
|
259
|
+
|
|
260
|
+
if (midVal <= key) {
|
|
261
|
+
ans = mid;
|
|
262
|
+
low = mid + 1;
|
|
263
|
+
} else {
|
|
264
|
+
high = mid - 1;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return ans;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
/** Assumes the array is already sorted. */
|
|
272
|
+
export const insertSorted = <T>(arr: T[], item: T, valueGetter: (x: T) => number) => {
|
|
273
|
+
const insertionIndex = binarySearchLessOrEqual(arr, valueGetter(item), valueGetter);
|
|
274
|
+
arr.splice(insertionIndex + 1, 0, item); // This even behaves correctly for the -1 case
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
export const promiseWithResolvers = <T = void>() => {
|
|
278
|
+
let resolve: (value: T) => void;
|
|
279
|
+
let reject: (reason: unknown) => void;
|
|
280
|
+
const promise = new Promise<T>((res, rej) => {
|
|
281
|
+
resolve = res;
|
|
282
|
+
reject = rej;
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
return { promise, resolve: resolve!, reject: reject! };
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
export const removeItem = <T>(arr: T[], item: T) => {
|
|
289
|
+
const index = arr.indexOf(item);
|
|
290
|
+
if (index !== -1) {
|
|
291
|
+
arr.splice(index, 1);
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
export const findLast = <T>(arr: T[], predicate: (x: T) => boolean) => {
|
|
296
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
297
|
+
if (predicate(arr[i]!)) {
|
|
298
|
+
return arr[i];
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
return undefined;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
export const findLastIndex = <T>(arr: T[], predicate: (x: T) => boolean) => {
|
|
306
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
307
|
+
if (predicate(arr[i]!)) {
|
|
308
|
+
return i;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
return -1;
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Sync or async iterable.
|
|
317
|
+
* @group Miscellaneous
|
|
318
|
+
* @public
|
|
319
|
+
*/
|
|
320
|
+
export type AnyIterable<T> =
|
|
321
|
+
| Iterable<T>
|
|
322
|
+
| AsyncIterable<T>;
|
|
323
|
+
|
|
324
|
+
export const toAsyncIterator = async function* <T>(source: AnyIterable<T>): AsyncGenerator<T, void, unknown> {
|
|
325
|
+
if (Symbol.iterator in source) {
|
|
326
|
+
// @ts-expect-error Trust me
|
|
327
|
+
yield* source[Symbol.iterator]();
|
|
328
|
+
} else {
|
|
329
|
+
// @ts-expect-error Trust me
|
|
330
|
+
yield* source[Symbol.asyncIterator]();
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
export const validateAnyIterable = (iterable: AnyIterable<unknown>) => {
|
|
335
|
+
if (!(Symbol.iterator in iterable) && !(Symbol.asyncIterator in iterable)) {
|
|
336
|
+
throw new TypeError('Argument must be an iterable or async iterable.');
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
export const assertNever = (x: never) => {
|
|
341
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
342
|
+
throw new Error(`Unexpected value: ${x}`);
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
export const getUint24 = (view: DataView, byteOffset: number, littleEndian: boolean) => {
|
|
346
|
+
const byte1 = view.getUint8(byteOffset);
|
|
347
|
+
const byte2 = view.getUint8(byteOffset + 1);
|
|
348
|
+
const byte3 = view.getUint8(byteOffset + 2);
|
|
349
|
+
|
|
350
|
+
if (littleEndian) {
|
|
351
|
+
return byte1 | (byte2 << 8) | (byte3 << 16);
|
|
352
|
+
} else {
|
|
353
|
+
return (byte1 << 16) | (byte2 << 8) | byte3;
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
export const getInt24 = (view: DataView, byteOffset: number, littleEndian: boolean) => {
|
|
358
|
+
// The left shift pushes the most significant bit into the sign bit region, and the subsequent right shift
|
|
359
|
+
// then correctly interprets the sign bit.
|
|
360
|
+
return getUint24(view, byteOffset, littleEndian) << 8 >> 8;
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
export const setUint24 = (view: DataView, byteOffset: number, value: number, littleEndian: boolean) => {
|
|
364
|
+
// Ensure the value is within 24-bit unsigned range (0 to 16777215)
|
|
365
|
+
value = value >>> 0; // Convert to unsigned 32-bit
|
|
366
|
+
value = value & 0xFFFFFF; // Mask to 24 bits
|
|
367
|
+
|
|
368
|
+
if (littleEndian) {
|
|
369
|
+
view.setUint8(byteOffset, value & 0xFF);
|
|
370
|
+
view.setUint8(byteOffset + 1, (value >>> 8) & 0xFF);
|
|
371
|
+
view.setUint8(byteOffset + 2, (value >>> 16) & 0xFF);
|
|
372
|
+
} else {
|
|
373
|
+
view.setUint8(byteOffset, (value >>> 16) & 0xFF);
|
|
374
|
+
view.setUint8(byteOffset + 1, (value >>> 8) & 0xFF);
|
|
375
|
+
view.setUint8(byteOffset + 2, value & 0xFF);
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
export const setInt24 = (view: DataView, byteOffset: number, value: number, littleEndian: boolean) => {
|
|
380
|
+
// Ensure the value is within 24-bit signed range (-8388608 to 8388607)
|
|
381
|
+
value = clamp(value, -8388608, 8388607);
|
|
382
|
+
|
|
383
|
+
// Convert negative values to their 24-bit representation
|
|
384
|
+
if (value < 0) {
|
|
385
|
+
value = (value + 0x1000000) & 0xFFFFFF;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
setUint24(view, byteOffset, value, littleEndian);
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
export const setInt64 = (view: DataView, byteOffset: number, value: number, littleEndian: boolean) => {
|
|
392
|
+
if (littleEndian) {
|
|
393
|
+
view.setUint32(byteOffset + 0, value, true);
|
|
394
|
+
view.setInt32(byteOffset + 4, Math.floor(value / 2 ** 32), true);
|
|
395
|
+
} else {
|
|
396
|
+
view.setInt32(byteOffset + 0, Math.floor(value / 2 ** 32), true);
|
|
397
|
+
view.setUint32(byteOffset + 4, value, true);
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Calls a function on each value spat out by an async generator. The reason for writing this manually instead of
|
|
403
|
+
* using a generator function is that the generator function queues return() calls - here, we forward them immediately.
|
|
404
|
+
*/
|
|
405
|
+
export const mapAsyncGenerator = <T, U>(
|
|
406
|
+
generator: AsyncGenerator<T, void, unknown>,
|
|
407
|
+
map: (t: T) => U,
|
|
408
|
+
): AsyncGenerator<U, void, unknown> => {
|
|
409
|
+
return {
|
|
410
|
+
async next() {
|
|
411
|
+
const result = await generator.next();
|
|
412
|
+
if (result.done) {
|
|
413
|
+
return { value: undefined, done: true };
|
|
414
|
+
} else {
|
|
415
|
+
return { value: map(result.value), done: false };
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
return() {
|
|
419
|
+
return generator.return() as ReturnType<AsyncGenerator<U, void, unknown>['return']>;
|
|
420
|
+
},
|
|
421
|
+
throw(error) {
|
|
422
|
+
return generator.throw(error) as ReturnType<AsyncGenerator<U, void, unknown>['throw']>;
|
|
423
|
+
},
|
|
424
|
+
[Symbol.asyncIterator]() {
|
|
425
|
+
return this;
|
|
426
|
+
},
|
|
427
|
+
};
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
export const clamp = (value: number, min: number, max: number) => {
|
|
431
|
+
return Math.max(min, Math.min(max, value));
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
export const lerp = (from: number, to: number, t: number) => {
|
|
435
|
+
return from + (to - from) * t;
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
export const UNDETERMINED_LANGUAGE = 'und';
|
|
439
|
+
|
|
440
|
+
export const roundIfAlmostInteger = (value: number) => {
|
|
441
|
+
const rounded = Math.round(value);
|
|
442
|
+
|
|
443
|
+
if (Math.abs(value / rounded - 1) < 10 * Number.EPSILON) {
|
|
444
|
+
return rounded;
|
|
445
|
+
} else {
|
|
446
|
+
return value;
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
export const roundToMultiple = (value: number, multiple: number) => {
|
|
451
|
+
return Math.round(value / multiple) * multiple;
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
export const roundToDivisor = (value: number, multiple: number) => {
|
|
455
|
+
return Math.round(value * multiple) / multiple;
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
export const floorToMultiple = (value: number, multiple: number) => {
|
|
459
|
+
return Math.floor(value / multiple) * multiple;
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
export const floorToDivisor = (value: number, multiple: number) => {
|
|
463
|
+
return Math.floor(value * multiple) / multiple;
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
export const ilog = (x: number) => {
|
|
467
|
+
let ret = 0;
|
|
468
|
+
while (x) {
|
|
469
|
+
ret++;
|
|
470
|
+
x >>= 1;
|
|
471
|
+
}
|
|
472
|
+
return ret;
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
const ISO_639_2_REGEX = /^[a-z]{3}$/;
|
|
476
|
+
export const isIso639Dash2LanguageCode = (x: string) => {
|
|
477
|
+
return ISO_639_2_REGEX.test(x);
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
// Since the result will be truncated, add a bit of eps to compensate for floating point errors
|
|
481
|
+
export const SECOND_TO_MICROSECOND_FACTOR = 1e6 * (1 + Number.EPSILON);
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Sets all keys K of T to be required.
|
|
485
|
+
* @group Miscellaneous
|
|
486
|
+
* @public
|
|
487
|
+
*/
|
|
488
|
+
export type SetRequired<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Recursively makes all properties of T readonly.
|
|
492
|
+
* @group Miscellaneous
|
|
493
|
+
* @public
|
|
494
|
+
*/
|
|
495
|
+
export type DeepReadonly<T> = T extends object ? {
|
|
496
|
+
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
497
|
+
} : T;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Sets all keys K of T to be optional.
|
|
501
|
+
* @group Miscellaneous
|
|
502
|
+
* @public
|
|
503
|
+
*/
|
|
504
|
+
export type SetOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Merges two RequestInit objects with special handling for headers.
|
|
508
|
+
* Headers are merged case-insensitively, but original casing is preserved.
|
|
509
|
+
* init2 headers take precedence and will override case-insensitive matches from init1.
|
|
510
|
+
*/
|
|
511
|
+
export const mergeRequestInit = (init1: RequestInit, init2: RequestInit): RequestInit => {
|
|
512
|
+
const merged: RequestInit = { ...init1, ...init2 };
|
|
513
|
+
|
|
514
|
+
// Special handling for headers
|
|
515
|
+
if (init1.headers || init2.headers) {
|
|
516
|
+
const headers1 = init1.headers ? normalizeHeaders(init1.headers) : {};
|
|
517
|
+
const headers2 = init2.headers ? normalizeHeaders(init2.headers) : {};
|
|
518
|
+
|
|
519
|
+
const mergedHeaders = { ...headers1 };
|
|
520
|
+
|
|
521
|
+
// For each header in headers2, check if a case-insensitive match exists in mergedHeaders
|
|
522
|
+
Object.entries(headers2).forEach(([key2, value2]) => {
|
|
523
|
+
const existingKey = Object.keys(mergedHeaders).find(
|
|
524
|
+
key1 => key1.toLowerCase() === key2.toLowerCase(),
|
|
525
|
+
);
|
|
526
|
+
|
|
527
|
+
if (existingKey) {
|
|
528
|
+
delete mergedHeaders[existingKey];
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
mergedHeaders[key2] = value2;
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
merged.headers = mergedHeaders;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
return merged;
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
/** Normalizes HeadersInit to a Record<string, string> format. */
|
|
541
|
+
export const normalizeHeaders = (headers: HeadersInit): Record<string, string> => {
|
|
542
|
+
if (headers instanceof Headers) {
|
|
543
|
+
const result: Record<string, string> = {};
|
|
544
|
+
headers.forEach((value, key) => {
|
|
545
|
+
result[key] = value;
|
|
546
|
+
});
|
|
547
|
+
return result;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
if (Array.isArray(headers)) {
|
|
551
|
+
const result: Record<string, string> = {};
|
|
552
|
+
headers.forEach(([key, value]) => {
|
|
553
|
+
result[key] = value;
|
|
554
|
+
});
|
|
555
|
+
return result;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
return headers;
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
export const retriedFetch = async (
|
|
562
|
+
fetchFn: typeof fetch,
|
|
563
|
+
url: string | URL | Request,
|
|
564
|
+
requestInit: RequestInit,
|
|
565
|
+
getRetryDelay: (previousAttempts: number, error: unknown, url: string | URL | Request) => number | null,
|
|
566
|
+
shouldStop: () => boolean,
|
|
567
|
+
) => {
|
|
568
|
+
let attempts = 0;
|
|
569
|
+
|
|
570
|
+
while (true) {
|
|
571
|
+
try {
|
|
572
|
+
return await fetchFn(url, requestInit);
|
|
573
|
+
} catch (error) {
|
|
574
|
+
if (shouldStop()) {
|
|
575
|
+
throw error;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
attempts++;
|
|
579
|
+
const retryDelayInSeconds = getRetryDelay(attempts, error, url);
|
|
580
|
+
|
|
581
|
+
if (retryDelayInSeconds === null) {
|
|
582
|
+
throw error;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
Logging._error('Retrying failed fetch. Error:', error);
|
|
586
|
+
|
|
587
|
+
if (!Number.isFinite(retryDelayInSeconds) || retryDelayInSeconds < 0) {
|
|
588
|
+
throw new TypeError('Retry delay must be a non-negative finite number.');
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
if (retryDelayInSeconds > 0) {
|
|
592
|
+
await wait(1000 * retryDelayInSeconds);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
if (shouldStop()) {
|
|
596
|
+
throw error;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
export const computeRationalApproximation = (x: number, maxDenominator: number): Rational => {
|
|
603
|
+
// Handle negative numbers
|
|
604
|
+
const sign = x < 0 ? -1 : 1;
|
|
605
|
+
x = Math.abs(x);
|
|
606
|
+
|
|
607
|
+
let prevNumerator = 0, prevDenominator = 1;
|
|
608
|
+
let currNumerator = 1, currDenominator = 0;
|
|
609
|
+
|
|
610
|
+
// Continued fraction algorithm
|
|
611
|
+
let remainder = x;
|
|
612
|
+
|
|
613
|
+
while (true) {
|
|
614
|
+
const integer = Math.floor(remainder);
|
|
615
|
+
|
|
616
|
+
// Calculate next convergent
|
|
617
|
+
const nextNumerator = integer * currNumerator + prevNumerator;
|
|
618
|
+
const nextDenominator = integer * currDenominator + prevDenominator;
|
|
619
|
+
|
|
620
|
+
if (nextDenominator > maxDenominator) {
|
|
621
|
+
return {
|
|
622
|
+
num: sign * currNumerator,
|
|
623
|
+
den: currDenominator,
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
prevNumerator = currNumerator;
|
|
628
|
+
prevDenominator = currDenominator;
|
|
629
|
+
currNumerator = nextNumerator;
|
|
630
|
+
currDenominator = nextDenominator;
|
|
631
|
+
|
|
632
|
+
remainder = 1 / (remainder - integer);
|
|
633
|
+
|
|
634
|
+
// Guard against precision issues
|
|
635
|
+
if (!isFinite(remainder)) {
|
|
636
|
+
break;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
return {
|
|
641
|
+
num: sign * currNumerator,
|
|
642
|
+
den: currDenominator,
|
|
643
|
+
};
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
export class CallSerializer {
|
|
647
|
+
currentPromise = Promise.resolve();
|
|
648
|
+
|
|
649
|
+
call(fn: () => Promise<void> | void) {
|
|
650
|
+
return this.currentPromise = this.currentPromise.then(fn);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
let isWebKitCache: boolean | null = null;
|
|
655
|
+
export const isWebKit = () => {
|
|
656
|
+
if (isWebKitCache !== null) {
|
|
657
|
+
return isWebKitCache;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
// This even returns true for WebKit-wrapping browsers such as Chrome on iOS
|
|
661
|
+
return isWebKitCache = !!(
|
|
662
|
+
typeof navigator !== 'undefined'
|
|
663
|
+
&& (
|
|
664
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
665
|
+
navigator.vendor?.match(/apple/i)
|
|
666
|
+
// Or, in workers:
|
|
667
|
+
|| (/AppleWebKit/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent))
|
|
668
|
+
|| /\b(iPad|iPhone|iPod)\b/.test(navigator.userAgent)
|
|
669
|
+
)
|
|
670
|
+
);
|
|
671
|
+
};
|
|
672
|
+
|
|
673
|
+
let isFirefoxCache: boolean | null = null;
|
|
674
|
+
export const isFirefox = () => {
|
|
675
|
+
if (isFirefoxCache !== null) {
|
|
676
|
+
return isFirefoxCache;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
return isFirefoxCache = typeof navigator !== 'undefined' && navigator.userAgent?.includes('Firefox');
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
let isChromiumCache: boolean | null = null;
|
|
683
|
+
export const isChromium = () => {
|
|
684
|
+
if (isChromiumCache !== null) {
|
|
685
|
+
return isChromiumCache;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
return isChromiumCache = !!(
|
|
689
|
+
typeof navigator !== 'undefined'
|
|
690
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
691
|
+
&& (navigator.vendor?.includes('Google Inc') || /Chrome/.test(navigator.userAgent))
|
|
692
|
+
);
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
let chromiumVersionCache: number | null = null;
|
|
696
|
+
export const getChromiumVersion = () => {
|
|
697
|
+
if (chromiumVersionCache !== null) {
|
|
698
|
+
return chromiumVersionCache;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
if (typeof navigator === 'undefined') {
|
|
702
|
+
return null;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
const match = /\bChrome\/(\d+)/.exec(navigator.userAgent);
|
|
706
|
+
if (!match) {
|
|
707
|
+
return null;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
return chromiumVersionCache = Number(match[1]!);
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* T or a promise that resolves to T.
|
|
715
|
+
* @group Miscellaneous
|
|
716
|
+
* @public
|
|
717
|
+
*/
|
|
718
|
+
export type MaybePromise<T> = T | Promise<T>;
|
|
719
|
+
|
|
720
|
+
/** Acts like `??` except the condition is -1 and not null/undefined. */
|
|
721
|
+
export const coalesceIndex = (a: number, b: number) => {
|
|
722
|
+
return a !== -1 ? a : b;
|
|
723
|
+
};
|
|
724
|
+
|
|
725
|
+
export const closedIntervalsOverlap = (startA: number, endA: number, startB: number, endB: number) => {
|
|
726
|
+
return startA <= endB && startB <= endA;
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
type KeyValuePair<T extends Record<string, unknown>> = {
|
|
730
|
+
[K in keyof T]-?: {
|
|
731
|
+
key: K;
|
|
732
|
+
value: T[K] extends infer R | undefined ? R : T[K];
|
|
733
|
+
}
|
|
734
|
+
}[keyof T];
|
|
735
|
+
|
|
736
|
+
export const keyValueIterator = function* <T extends Record<string, unknown>>(object: T) {
|
|
737
|
+
for (const key in object) {
|
|
738
|
+
const value = object[key];
|
|
739
|
+
if (value === undefined) {
|
|
740
|
+
continue;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
yield { key, value } as KeyValuePair<T>;
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
export const imageMimeTypeToExtension = (mimeType: string) => {
|
|
748
|
+
switch (mimeType.toLowerCase()) {
|
|
749
|
+
case 'image/jpeg':
|
|
750
|
+
case 'image/jpg':
|
|
751
|
+
return '.jpg';
|
|
752
|
+
case 'image/png':
|
|
753
|
+
return '.png';
|
|
754
|
+
case 'image/gif':
|
|
755
|
+
return '.gif';
|
|
756
|
+
case 'image/webp':
|
|
757
|
+
return '.webp';
|
|
758
|
+
case 'image/bmp':
|
|
759
|
+
return '.bmp';
|
|
760
|
+
case 'image/svg+xml':
|
|
761
|
+
return '.svg';
|
|
762
|
+
case 'image/tiff':
|
|
763
|
+
return '.tiff';
|
|
764
|
+
case 'image/avif':
|
|
765
|
+
return '.avif';
|
|
766
|
+
case 'image/x-icon':
|
|
767
|
+
case 'image/vnd.microsoft.icon':
|
|
768
|
+
return '.ico';
|
|
769
|
+
default:
|
|
770
|
+
return null;
|
|
771
|
+
}
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
export const base64ToBytes = (base64: string) => {
|
|
775
|
+
const decoded = atob(base64);
|
|
776
|
+
const bytes = new Uint8Array(decoded.length);
|
|
777
|
+
|
|
778
|
+
for (let i = 0; i < decoded.length; i++) {
|
|
779
|
+
bytes[i] = decoded.charCodeAt(i);
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
return bytes;
|
|
783
|
+
};
|
|
784
|
+
|
|
785
|
+
export const bytesToBase64 = (bytes: Uint8Array) => {
|
|
786
|
+
let string = '';
|
|
787
|
+
|
|
788
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
789
|
+
string += String.fromCharCode(bytes[i]!);
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
return btoa(string);
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
export const uint8ArraysAreEqual = (a: Uint8Array, b: Uint8Array) => {
|
|
796
|
+
if (a.length !== b.length) {
|
|
797
|
+
return false;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
for (let i = 0; i < a.length; i++) {
|
|
801
|
+
if (a[i] !== b[i]) {
|
|
802
|
+
return false;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
return true;
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
export const polyfillSymbolDispose = () => {
|
|
810
|
+
// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html
|
|
811
|
+
// @ts-expect-error Readonly
|
|
812
|
+
Symbol.dispose ??= Symbol('Symbol.dispose');
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
export const isNumber = (x: unknown) => {
|
|
816
|
+
return typeof x === 'number' && !Number.isNaN(x);
|
|
817
|
+
};
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* A path to a file. File paths can be relative or absolute, and be local paths or full URLs. Paths must be POSIX-like,
|
|
821
|
+
* using `/` as the separator.
|
|
822
|
+
*
|
|
823
|
+
* Examples of valid paths:
|
|
824
|
+
* - `'video.mp4'`
|
|
825
|
+
* - `'path/to/video.mp4'`
|
|
826
|
+
* - `'./video.mp4'`
|
|
827
|
+
* - `'../video.mp4'`
|
|
828
|
+
* - `'/path/to/video.mp4'`
|
|
829
|
+
* - `'https://example.com/video.mp4'`
|
|
830
|
+
* - `'file:///home/user/video.mp4'`
|
|
831
|
+
* - `'video.mp4?key=foo'`
|
|
832
|
+
*
|
|
833
|
+
* @group Miscellaneous
|
|
834
|
+
* @public
|
|
835
|
+
*/
|
|
836
|
+
export type FilePath = string;
|
|
837
|
+
|
|
838
|
+
export const joinPaths = (basePath: FilePath, relativePath: FilePath) => {
|
|
839
|
+
// If relativePath is a full URL with protocol, return it as-is
|
|
840
|
+
if (relativePath.includes('://')) {
|
|
841
|
+
return relativePath;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
// Strip query parameters from URL base paths so their contents don't mess up the join
|
|
845
|
+
if (basePath.includes('://')) {
|
|
846
|
+
const queryIndex = basePath.indexOf('?');
|
|
847
|
+
if (queryIndex !== -1) {
|
|
848
|
+
basePath = basePath.slice(0, queryIndex);
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
let result: string;
|
|
853
|
+
|
|
854
|
+
if (relativePath.startsWith('/')) {
|
|
855
|
+
const protocolIndex = basePath.indexOf('://');
|
|
856
|
+
if (protocolIndex === -1) {
|
|
857
|
+
result = relativePath;
|
|
858
|
+
} else {
|
|
859
|
+
const pathStart = basePath.indexOf('/', protocolIndex + 3);
|
|
860
|
+
if (pathStart === -1) {
|
|
861
|
+
result = basePath + relativePath;
|
|
862
|
+
} else {
|
|
863
|
+
result = basePath.slice(0, pathStart) + relativePath;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
} else {
|
|
867
|
+
const lastSlash = basePath.lastIndexOf('/');
|
|
868
|
+
if (lastSlash === -1) {
|
|
869
|
+
result = relativePath;
|
|
870
|
+
} else {
|
|
871
|
+
result = basePath.slice(0, lastSlash + 1) + relativePath;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
// Normalize ./ and ../
|
|
876
|
+
|
|
877
|
+
let prefix = '';
|
|
878
|
+
const protocolIndex = result.indexOf('://');
|
|
879
|
+
if (protocolIndex !== -1) {
|
|
880
|
+
const pathStart = result.indexOf('/', protocolIndex + 3);
|
|
881
|
+
if (pathStart !== -1) {
|
|
882
|
+
prefix = result.slice(0, pathStart);
|
|
883
|
+
result = result.slice(pathStart);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
const segments = result.split('/');
|
|
888
|
+
const normalized: string[] = [];
|
|
889
|
+
for (const segment of segments) {
|
|
890
|
+
if (segment === '..') {
|
|
891
|
+
normalized.pop();
|
|
892
|
+
} else if (segment !== '.') {
|
|
893
|
+
normalized.push(segment);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
return prefix + normalized.join('/');
|
|
898
|
+
};
|
|
899
|
+
|
|
900
|
+
export const arrayCount = <T>(array: T[], predicate: (item: T) => boolean) => {
|
|
901
|
+
let count = 0;
|
|
902
|
+
|
|
903
|
+
for (let i = 0; i < array.length; i++) {
|
|
904
|
+
if (predicate(array[i]!)) {
|
|
905
|
+
count++;
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
return count;
|
|
910
|
+
};
|
|
911
|
+
|
|
912
|
+
export const arrayArgmin = <T>(array: T[], getValue: (item: T) => number): number => {
|
|
913
|
+
let minIndex = -1;
|
|
914
|
+
let minValue = Infinity;
|
|
915
|
+
|
|
916
|
+
for (let i = 0; i < array.length; i++) {
|
|
917
|
+
const value = getValue(array[i]!);
|
|
918
|
+
if (value < minValue) {
|
|
919
|
+
minValue = value;
|
|
920
|
+
minIndex = i;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
return minIndex;
|
|
925
|
+
};
|
|
926
|
+
|
|
927
|
+
export const arrayArgmax = <T>(array: T[], getValue: (item: T) => number): number => {
|
|
928
|
+
let maxIndex = -1;
|
|
929
|
+
let maxValue = -Infinity;
|
|
930
|
+
|
|
931
|
+
for (let i = 0; i < array.length; i++) {
|
|
932
|
+
const value = getValue(array[i]!);
|
|
933
|
+
if (value > maxValue) {
|
|
934
|
+
maxValue = value;
|
|
935
|
+
maxIndex = i;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
return maxIndex;
|
|
940
|
+
};
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* A rational number; a ratio of two integers.
|
|
944
|
+
* @group Miscellaneous
|
|
945
|
+
* @public
|
|
946
|
+
*/
|
|
947
|
+
export type Rational = {
|
|
948
|
+
/** The numerator of the rational number. */
|
|
949
|
+
num: number;
|
|
950
|
+
/** The denominator of the rational number. */
|
|
951
|
+
den: number;
|
|
952
|
+
};
|
|
953
|
+
|
|
954
|
+
export const simplifyRational = (rational: Rational): Rational => {
|
|
955
|
+
assert(Number.isInteger(rational.num));
|
|
956
|
+
assert(Number.isInteger(rational.den));
|
|
957
|
+
assert(rational.den !== 0);
|
|
958
|
+
|
|
959
|
+
let a = Math.abs(rational.num);
|
|
960
|
+
let b = Math.abs(rational.den);
|
|
961
|
+
|
|
962
|
+
// Euclidean algorithm
|
|
963
|
+
while (b !== 0) {
|
|
964
|
+
const t = a % b;
|
|
965
|
+
a = b;
|
|
966
|
+
b = t;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
const gcd = a || 1;
|
|
970
|
+
return {
|
|
971
|
+
num: rational.num / gcd,
|
|
972
|
+
den: rational.den / gcd,
|
|
973
|
+
};
|
|
974
|
+
};
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* Specifies a rectangular region where all quantities must be non-negative integers.
|
|
978
|
+
* @group Miscellaneous
|
|
979
|
+
* @public
|
|
980
|
+
*/
|
|
981
|
+
export type Rectangle = {
|
|
982
|
+
/** The distance in pixels to the left edge of the rectangle. */
|
|
983
|
+
left: number;
|
|
984
|
+
/** The distance in pixels to the top edge of the rectangle. */
|
|
985
|
+
top: number;
|
|
986
|
+
/** The width in pixels of the rectangle. */
|
|
987
|
+
width: number;
|
|
988
|
+
/** The height in pixels of the rectangle. */
|
|
989
|
+
height: number;
|
|
990
|
+
};
|
|
991
|
+
|
|
992
|
+
export const validateRectangle = (rect: Rectangle, propertyPath: string) => {
|
|
993
|
+
if (typeof rect !== 'object' || !rect) {
|
|
994
|
+
throw new TypeError(`${propertyPath} must be an object.`);
|
|
995
|
+
}
|
|
996
|
+
if (!Number.isInteger(rect.left) || rect.left < 0) {
|
|
997
|
+
throw new TypeError(`${propertyPath}.left must be a non-negative integer.`);
|
|
998
|
+
}
|
|
999
|
+
if (!Number.isInteger(rect.top) || rect.top < 0) {
|
|
1000
|
+
throw new TypeError(`${propertyPath}.top must be a non-negative integer.`);
|
|
1001
|
+
}
|
|
1002
|
+
if (!Number.isInteger(rect.width) || rect.width < 0) {
|
|
1003
|
+
throw new TypeError(`${propertyPath}.width must be a non-negative integer.`);
|
|
1004
|
+
}
|
|
1005
|
+
if (!Number.isInteger(rect.height) || rect.height < 0) {
|
|
1006
|
+
throw new TypeError(`${propertyPath}.height must be a non-negative integer.`);
|
|
1007
|
+
}
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
export type NonFunctionKeys<T> = {
|
|
1011
|
+
[K in keyof T]-?: T[K] extends ((...args: never[]) => unknown) ? never : K
|
|
1012
|
+
}[keyof T];
|
|
1013
|
+
|
|
1014
|
+
export type UnthrottledTimerHandle = {
|
|
1015
|
+
id: ReturnType<typeof setTimeout> | number;
|
|
1016
|
+
};
|
|
1017
|
+
|
|
1018
|
+
type UnthrottledTimerMessage =
|
|
1019
|
+
| { type: 'set-timeout'; timerId: number; delay: number }
|
|
1020
|
+
| { type: 'set-interval'; timerId: number; delay: number }
|
|
1021
|
+
| { type: 'clear-timeout'; timerId: number }
|
|
1022
|
+
| { type: 'clear-interval'; timerId: number };
|
|
1023
|
+
|
|
1024
|
+
type UnthrottledTimerEvent = { type: 'fire'; timerId: number };
|
|
1025
|
+
|
|
1026
|
+
let unthrottledTimerWorker: Worker | undefined;
|
|
1027
|
+
let nextUnthrottledTimerId = 1;
|
|
1028
|
+
const unthrottledTimeoutCallbacks = new Map<number, () => void>();
|
|
1029
|
+
const unthrottledIntervalCallbacks = new Map<number, () => void>();
|
|
1030
|
+
|
|
1031
|
+
const shouldUseNativeTimers = () => {
|
|
1032
|
+
return typeof window === 'undefined';
|
|
1033
|
+
};
|
|
1034
|
+
|
|
1035
|
+
const unthrottledTimerWorkerMain = () => {
|
|
1036
|
+
const timeoutHandles = new Map<number, ReturnType<typeof setTimeout>>();
|
|
1037
|
+
const intervalHandles = new Map<number, ReturnType<typeof setInterval>>();
|
|
1038
|
+
|
|
1039
|
+
self.onmessage = (event: MessageEvent<UnthrottledTimerMessage>) => {
|
|
1040
|
+
const message = event.data;
|
|
1041
|
+
|
|
1042
|
+
switch (message.type) {
|
|
1043
|
+
case 'set-timeout': {
|
|
1044
|
+
const handle = setTimeout(() => {
|
|
1045
|
+
timeoutHandles.delete(message.timerId);
|
|
1046
|
+
self.postMessage({ type: 'fire', timerId: message.timerId });
|
|
1047
|
+
}, message.delay);
|
|
1048
|
+
|
|
1049
|
+
timeoutHandles.set(message.timerId, handle);
|
|
1050
|
+
}; break;
|
|
1051
|
+
|
|
1052
|
+
case 'set-interval': {
|
|
1053
|
+
const handle = setInterval(() => {
|
|
1054
|
+
self.postMessage({ type: 'fire', timerId: message.timerId });
|
|
1055
|
+
}, message.delay);
|
|
1056
|
+
|
|
1057
|
+
intervalHandles.set(message.timerId, handle);
|
|
1058
|
+
}; break;
|
|
1059
|
+
|
|
1060
|
+
case 'clear-timeout': {
|
|
1061
|
+
const handle = timeoutHandles.get(message.timerId);
|
|
1062
|
+
if (handle !== undefined) {
|
|
1063
|
+
clearTimeout(handle);
|
|
1064
|
+
timeoutHandles.delete(message.timerId);
|
|
1065
|
+
}
|
|
1066
|
+
}; break;
|
|
1067
|
+
|
|
1068
|
+
case 'clear-interval': {
|
|
1069
|
+
const handle = intervalHandles.get(message.timerId);
|
|
1070
|
+
if (handle !== undefined) {
|
|
1071
|
+
clearInterval(handle);
|
|
1072
|
+
intervalHandles.delete(message.timerId);
|
|
1073
|
+
}
|
|
1074
|
+
}; break;
|
|
1075
|
+
}
|
|
1076
|
+
};
|
|
1077
|
+
};
|
|
1078
|
+
|
|
1079
|
+
const getUnthrottledTimerWorker = () => {
|
|
1080
|
+
if (unthrottledTimerWorker) {
|
|
1081
|
+
return unthrottledTimerWorker;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
const workerSource = `(${unthrottledTimerWorkerMain.toString()})();`;
|
|
1085
|
+
const workerURL = URL.createObjectURL(new Blob([workerSource], { type: 'text/javascript' }));
|
|
1086
|
+
unthrottledTimerWorker = new Worker(workerURL);
|
|
1087
|
+
URL.revokeObjectURL(workerURL);
|
|
1088
|
+
|
|
1089
|
+
unthrottledTimerWorker.onmessage = (event: MessageEvent<UnthrottledTimerEvent>) => {
|
|
1090
|
+
const message = event.data;
|
|
1091
|
+
|
|
1092
|
+
const timeoutCallback = unthrottledTimeoutCallbacks.get(message.timerId);
|
|
1093
|
+
if (timeoutCallback) {
|
|
1094
|
+
unthrottledTimeoutCallbacks.delete(message.timerId);
|
|
1095
|
+
timeoutCallback();
|
|
1096
|
+
return;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
const intervalCallback = unthrottledIntervalCallbacks.get(message.timerId);
|
|
1100
|
+
if (intervalCallback) {
|
|
1101
|
+
intervalCallback();
|
|
1102
|
+
}
|
|
1103
|
+
};
|
|
1104
|
+
|
|
1105
|
+
return unthrottledTimerWorker;
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
export const setTimeoutUnthrottled = (
|
|
1109
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
1110
|
+
callback: Function,
|
|
1111
|
+
delay: number,
|
|
1112
|
+
): UnthrottledTimerHandle => {
|
|
1113
|
+
if (shouldUseNativeTimers()) {
|
|
1114
|
+
return { id: setTimeout(callback, delay) };
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
const timerId = nextUnthrottledTimerId++;
|
|
1118
|
+
unthrottledTimeoutCallbacks.set(timerId, () => {
|
|
1119
|
+
(callback as () => void)();
|
|
1120
|
+
});
|
|
1121
|
+
|
|
1122
|
+
getUnthrottledTimerWorker().postMessage({
|
|
1123
|
+
type: 'set-timeout',
|
|
1124
|
+
timerId,
|
|
1125
|
+
delay,
|
|
1126
|
+
} satisfies UnthrottledTimerMessage);
|
|
1127
|
+
|
|
1128
|
+
return { id: timerId };
|
|
1129
|
+
};
|
|
1130
|
+
|
|
1131
|
+
export const clearTimeoutUnthrottled = (timer: UnthrottledTimerHandle) => {
|
|
1132
|
+
if (shouldUseNativeTimers()) {
|
|
1133
|
+
clearTimeout(timer.id);
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
assert(typeof timer.id === 'number');
|
|
1138
|
+
unthrottledTimeoutCallbacks.delete(timer.id);
|
|
1139
|
+
|
|
1140
|
+
getUnthrottledTimerWorker().postMessage({
|
|
1141
|
+
type: 'clear-timeout',
|
|
1142
|
+
timerId: timer.id,
|
|
1143
|
+
} satisfies UnthrottledTimerMessage);
|
|
1144
|
+
};
|
|
1145
|
+
|
|
1146
|
+
export const setIntervalUnthrottled = (
|
|
1147
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
1148
|
+
callback: Function,
|
|
1149
|
+
delay: number,
|
|
1150
|
+
): UnthrottledTimerHandle => {
|
|
1151
|
+
if (shouldUseNativeTimers()) {
|
|
1152
|
+
return { id: setInterval(callback, delay) };
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
const timerId = nextUnthrottledTimerId++;
|
|
1156
|
+
unthrottledIntervalCallbacks.set(timerId, () => {
|
|
1157
|
+
(callback as () => void)();
|
|
1158
|
+
});
|
|
1159
|
+
|
|
1160
|
+
getUnthrottledTimerWorker().postMessage({
|
|
1161
|
+
type: 'set-interval',
|
|
1162
|
+
timerId,
|
|
1163
|
+
delay,
|
|
1164
|
+
} satisfies UnthrottledTimerMessage);
|
|
1165
|
+
|
|
1166
|
+
return { id: timerId };
|
|
1167
|
+
};
|
|
1168
|
+
|
|
1169
|
+
export const clearIntervalUnthrottled = (timer: UnthrottledTimerHandle) => {
|
|
1170
|
+
if (shouldUseNativeTimers()) {
|
|
1171
|
+
clearInterval(timer.id);
|
|
1172
|
+
return;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
assert(typeof timer.id === 'number');
|
|
1176
|
+
unthrottledIntervalCallbacks.delete(timer.id);
|
|
1177
|
+
|
|
1178
|
+
getUnthrottledTimerWorker().postMessage({
|
|
1179
|
+
type: 'clear-interval',
|
|
1180
|
+
timerId: timer.id,
|
|
1181
|
+
} satisfies UnthrottledTimerMessage);
|
|
1182
|
+
};
|
|
1183
|
+
|
|
1184
|
+
export const wait = (ms: number) => {
|
|
1185
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
1186
|
+
};
|
|
1187
|
+
|
|
1188
|
+
export const rejectAfter = (ms: number, message = 'Promise rejected') => {
|
|
1189
|
+
return new Promise((_, reject) => {
|
|
1190
|
+
setTimeout(() => reject(new Error(message)), ms);
|
|
1191
|
+
});
|
|
1192
|
+
};
|
|
1193
|
+
|
|
1194
|
+
export const toArray = <T>(x: T | T[]) => {
|
|
1195
|
+
if (Array.isArray(x)) {
|
|
1196
|
+
return x;
|
|
1197
|
+
} else {
|
|
1198
|
+
return [x];
|
|
1199
|
+
}
|
|
1200
|
+
};
|
|
1201
|
+
|
|
1202
|
+
/**
|
|
1203
|
+
* Options for {@link EventEmitter.on}.
|
|
1204
|
+
*
|
|
1205
|
+
* @group Miscellaneous
|
|
1206
|
+
* @public
|
|
1207
|
+
*/
|
|
1208
|
+
export type EventListenerOptions = {
|
|
1209
|
+
/** If `true`, the listener will be automatically removed after being called once. Defaults to `false`. */
|
|
1210
|
+
once?: boolean;
|
|
1211
|
+
};
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* A class that manages event listeners and dispatches events to them.
|
|
1215
|
+
*
|
|
1216
|
+
* @group Miscellaneous
|
|
1217
|
+
* @public
|
|
1218
|
+
*/
|
|
1219
|
+
export class EventEmitter<TEvents extends Record<string, unknown>> {
|
|
1220
|
+
/** @internal */
|
|
1221
|
+
_listeners = new Map<keyof TEvents, Set<{ fn: (data: never) => unknown; once: boolean }>>();
|
|
1222
|
+
|
|
1223
|
+
/** Registers a listener for the given event. Returns a function that, when called, removes the listener again. */
|
|
1224
|
+
on<K extends keyof TEvents>(
|
|
1225
|
+
event: K,
|
|
1226
|
+
listener: (data: TEvents[K]) => unknown,
|
|
1227
|
+
options?: EventListenerOptions,
|
|
1228
|
+
): () => void {
|
|
1229
|
+
if (!this._listeners.has(event)) {
|
|
1230
|
+
this._listeners.set(event, new Set());
|
|
1231
|
+
}
|
|
1232
|
+
const entry = { fn: listener as (data: never) => void, once: options?.once ?? false };
|
|
1233
|
+
this._listeners.get(event)!.add(entry);
|
|
1234
|
+
|
|
1235
|
+
return () => {
|
|
1236
|
+
this._listeners.get(event)?.delete(entry);
|
|
1237
|
+
};
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
/** @internal */
|
|
1241
|
+
_emit<K extends keyof TEvents>(
|
|
1242
|
+
...args: TEvents[K] extends void ? [event: K] : [event: K, data: TEvents[K]]
|
|
1243
|
+
): void {
|
|
1244
|
+
const [event, data] = args;
|
|
1245
|
+
const listeners = this._listeners.get(event);
|
|
1246
|
+
if (!listeners) {
|
|
1247
|
+
return;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
for (const entry of listeners) {
|
|
1251
|
+
try {
|
|
1252
|
+
(entry.fn as (data: unknown) => void)(data);
|
|
1253
|
+
} catch (error) {
|
|
1254
|
+
// Deliberately not routed through Logging here: Logging emits via an EventEmitter, so a throwing
|
|
1255
|
+
// log listener would recurse straight back into this handler.
|
|
1256
|
+
console.error(error);
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
if (entry.once) {
|
|
1260
|
+
listeners.delete(entry);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
export const ceilToMultipleOfTwo = (value: number) => Math.ceil(value / 2) * 2;
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* Utility class for running async functions in parallel up to a certain level of parallelism. Can be used to apply
|
|
1270
|
+
* backpressure only if the concurrency level would be exceeded.
|
|
1271
|
+
*
|
|
1272
|
+
* @group Miscellaneous
|
|
1273
|
+
* @public
|
|
1274
|
+
*/
|
|
1275
|
+
export class ConcurrentRunner {
|
|
1276
|
+
/** @internal */
|
|
1277
|
+
_queue: Promise<unknown>[] = [];
|
|
1278
|
+
/** @internal */
|
|
1279
|
+
_errored = false;
|
|
1280
|
+
|
|
1281
|
+
/**
|
|
1282
|
+
* The maximum number of in-flight promises. You can also think of it as the "high water mark".
|
|
1283
|
+
* You can set this value to dynamically change the level of parallelism.
|
|
1284
|
+
*/
|
|
1285
|
+
parallelism: number;
|
|
1286
|
+
|
|
1287
|
+
constructor(parallelism: number) {
|
|
1288
|
+
this.parallelism = parallelism;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
/** Whether any function has errored. The runner is effectively bricked if this is `true`, by design. */
|
|
1292
|
+
get errored() {
|
|
1293
|
+
return this._errored;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
/** The number of tasks currently running. */
|
|
1297
|
+
get inFlightCount() {
|
|
1298
|
+
return this._queue.length;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
/**
|
|
1302
|
+
* Schedules an async function to be run. If the maximum allowed level of parallelism has not yet been reached,
|
|
1303
|
+
* the function will be executed immediately and `run()` will resolve immediately. Otherwise, the function will be
|
|
1304
|
+
* called as soon as any currently-running function finishes, and `run()` will only resolve then.
|
|
1305
|
+
*
|
|
1306
|
+
* Throws if the runner is errored.
|
|
1307
|
+
*/
|
|
1308
|
+
async run(fn: () => Promise<unknown>) {
|
|
1309
|
+
if (this._errored) {
|
|
1310
|
+
await Promise.race(this._queue); // Will surface the error
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
while (this._queue.length >= this.parallelism) {
|
|
1314
|
+
await Promise.race(this._queue);
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
const promise = fn();
|
|
1318
|
+
this._queue.push(promise);
|
|
1319
|
+
|
|
1320
|
+
void promise
|
|
1321
|
+
.then(() => removeItem(this._queue, promise))
|
|
1322
|
+
.catch(() => this._errored = true);
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
/** Waits for all currently running functions to finish. Throws if the runner is errored. */
|
|
1326
|
+
async flush() {
|
|
1327
|
+
await Promise.all(this._queue);
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
export const isRecordStringString = (value: unknown): value is Record<string, string> => {
|
|
1332
|
+
return value !== null
|
|
1333
|
+
&& typeof value === 'object'
|
|
1334
|
+
&& Object.getPrototypeOf(value) === Object.prototype
|
|
1335
|
+
&& Object.values(value).every(x => typeof x === 'string');
|
|
1336
|
+
};
|