diff --git a/.github/workflows/marketing-deploy.yml b/.github/workflows/marketing-deploy.yml index dd17e735..3233f1cb 100644 --- a/.github/workflows/marketing-deploy.yml +++ b/.github/workflows/marketing-deploy.yml @@ -1,12 +1,11 @@ name: Deploy Marketing Site -# Builds the Astro marketing site, the VitePress docs, the orb editor SPA, -# AND the browser demo SPA, then deploys the combined bundle to Cloudflare -# Pages (project: orbis-marketing → https://orbis.protolabs.studio). The -# docs are served at /docs (built with DOCS_BASE=/docs/), the editor at -# /editor (Vite base=/editor/), and the browser demo at /demo (Vite -# base=/demo/) — all copied into the Astro output before deploy, so one -# Cloudflare Pages project serves them. +# Builds the Astro marketing site, the VitePress docs, AND the orb editor +# SPA, then deploys the combined bundle to Cloudflare Pages (project: +# orbis-marketing → https://orbis.protolabs.studio). The docs are served at +# /docs (built with DOCS_BASE=/docs/) and the editor at /editor (Vite +# base=/editor/) — both copied into the Astro output before deploy, so one +# Cloudflare Pages project serves all three. on: push: @@ -14,11 +13,7 @@ on: paths: - 'sites/marketing/**' - 'sites/editor/**' - - 'sites/demo/**' - 'packages/orb-runtime/**' - # The browser demo (sites/demo) bundles the real app from web/src as - # source, so app changes must redeploy it or /demo serves stale code. - - 'web/**' - 'docs/**' - 'package.json' - 'package-lock.json' @@ -97,30 +92,6 @@ jobs: mkdir -p sites/marketing/dist/editor cp -R sites/editor/dist/. sites/marketing/dist/editor/ - # --- Browser demo (Vite SPA / bun) served at /demo --- - # Runs the real app (web/src) in the browser via a Tauri shim; see - # sites/demo/vite.config.ts. - # The demo bundles web/src as source, so web's deps must be installed for - # its bare imports (lucide-react, @react-three/postprocessing, …) to - # resolve here — locally web/node_modules already exists, but CI is clean. - - name: Install web app dependencies (bundled as source by the demo) - run: bun install - working-directory: web - - - name: Install demo dependencies - run: bun install - working-directory: sites/demo - - - name: Build browser demo (base /demo/) - run: bun run build - working-directory: sites/demo - - - name: Fold demo into the marketing bundle at /demo - run: | - rm -rf sites/marketing/dist/demo - mkdir -p sites/marketing/dist/demo - cp -R sites/demo/dist/. sites/marketing/dist/demo/ - - name: Deploy to Cloudflare Pages run: bunx wrangler pages deploy dist --project-name=orbis-marketing --branch=main working-directory: sites/marketing diff --git a/sites/demo/.gitignore b/sites/demo/.gitignore deleted file mode 100644 index 3c25e1e4..00000000 --- a/sites/demo/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules/ -dist/ -*.log diff --git a/sites/demo/bun.lock b/sites/demo/bun.lock deleted file mode 100644 index a32ce87f..00000000 --- a/sites/demo/bun.lock +++ /dev/null @@ -1,1455 +0,0 @@ -{ - "lockfileVersion": 1, - "configVersion": 1, - "workspaces": { - "": { - "name": "orbis-demo", - "dependencies": { - "@fontsource-variable/geist": "^5.2.8", - "@huggingface/transformers": "^4.2.0", - "@protolabsai/design": "^0.5.0", - "@protolabsai/ui": "^0.26.2", - "@react-three/drei": "^10.7.7", - "@react-three/fiber": "^9.6.0", - "@react-three/postprocessing": "^3.0.4", - "class-variance-authority": "^0.7.1", - "clsx": "^2.1.1", - "kokoro-js": "^1.2.1", - "lucide-react": "^1.8.0", - "postprocessing": "^6.39.1", - "radix-ui": "^1.4.3", - "react": "^19.2.5", - "react-dom": "^19.2.5", - "react-markdown": "^9", - "remark-gfm": "^4", - "shadcn": "^4.4.0", - "tailwind-merge": "^3.5.0", - "three": "^0.184.0", - "tw-animate-css": "^1.4.0", - }, - "devDependencies": { - "@tailwindcss/vite": "^4.2.4", - "@types/node": "^24.12.2", - "@types/react": "^19.2.14", - "@types/react-dom": "^19.2.3", - "@types/three": "^0.184.0", - "@vitejs/plugin-react": "^6.0.1", - "tailwindcss": "^4.2.4", - "typescript": "~6.0.2", - "vite": "^8.0.9", - "vite-plugin-glsl": "^1.6.0", - }, - }, - }, - "packages": { - "@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="], - - "@babel/compat-data": ["@babel/compat-data@7.29.7", "", {}, "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg=="], - - "@babel/core": ["@babel/core@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.7", "@babel/helper-compilation-targets": "^7.29.7", "@babel/helper-module-transforms": "^7.29.7", "@babel/helpers": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA=="], - - "@babel/generator": ["@babel/generator@7.29.7", "", { "dependencies": { "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ=="], - - "@babel/helper-annotate-as-pure": ["@babel/helper-annotate-as-pure@7.29.7", "", { "dependencies": { "@babel/types": "^7.29.7" } }, "sha512-OoK6239jHPuSQOoS0kfTVKn0b/rVTk0seKq4Gd2UMLtmOVLjDC0ki3e+c90Trqv2gMfvJFqkiljrr568+qddiw=="], - - "@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.7", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g=="], - - "@babel/helper-create-class-features-plugin": ["@babel/helper-create-class-features-plugin@7.29.7", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.29.7", "@babel/helper-member-expression-to-functions": "^7.29.7", "@babel/helper-optimise-call-expression": "^7.29.7", "@babel/helper-replace-supers": "^7.29.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7", "@babel/traverse": "^7.29.7", "semver": "^6.3.1" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-IY3ZD9Tmooqr3TUhc3DUWxiuo8xx1DWLhd5M7hQ+ZWJamqM2BbalrBJb2MisSLoYorOj75U03qULCxQTY9r3hg=="], - - "@babel/helper-globals": ["@babel/helper-globals@7.29.7", "", {}, "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA=="], - - "@babel/helper-member-expression-to-functions": ["@babel/helper-member-expression-to-functions@7.29.7", "", { "dependencies": { "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-j+7JYmk1JYDtACIGj0QJqqWZjoUpMoEikQGADMaHgCMCSDqd2+P32rfcibUNrGOMWrlzK1WJBdxrB3JJQZwWtg=="], - - "@babel/helper-module-imports": ["@babel/helper-module-imports@7.29.7", "", { "dependencies": { "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g=="], - - "@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.7", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg=="], - - "@babel/helper-optimise-call-expression": ["@babel/helper-optimise-call-expression@7.29.7", "", { "dependencies": { "@babel/types": "^7.29.7" } }, "sha512-+kmGVjcT9RGYzoDwdwEqEvGgKe3BYq+O1iGzjFubaNgZHwYHP6lsF2Yghf4kEuv9BV7tYDZ913aBW9am6YKong=="], - - "@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="], - - "@babel/helper-replace-supers": ["@babel/helper-replace-supers@7.29.7", "", { "dependencies": { "@babel/helper-member-expression-to-functions": "^7.29.7", "@babel/helper-optimise-call-expression": "^7.29.7", "@babel/traverse": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-atfGXWSeCiF4DnKZIfmJfQRkSw9b9gNNXR1kqKjbhG4pGYCOnkp8OcTB8E3NXjBu8NpheSnOeNKz8KT7UNFTmQ=="], - - "@babel/helper-skip-transparent-expression-wrappers": ["@babel/helper-skip-transparent-expression-wrappers@7.29.7", "", { "dependencies": { "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-brcMGQaVzIeUb+6/bs1Av0f8YuNNjKY2JyvfRCsFuFsdKccEQ5Ges2y74D74NZ1Rz8lKJ9ksJkfqwQFJ/iNEyQ=="], - - "@babel/helper-string-parser": ["@babel/helper-string-parser@7.29.7", "", {}, "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw=="], - - "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.29.7", "", {}, "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg=="], - - "@babel/helper-validator-option": ["@babel/helper-validator-option@7.29.7", "", {}, "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw=="], - - "@babel/helpers": ["@babel/helpers@7.29.7", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg=="], - - "@babel/parser": ["@babel/parser@7.29.7", "", { "dependencies": { "@babel/types": "^7.29.7" }, "bin": "./bin/babel-parser.js" }, "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg=="], - - "@babel/plugin-syntax-jsx": ["@babel/plugin-syntax-jsx@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A=="], - - "@babel/plugin-syntax-typescript": ["@babel/plugin-syntax-typescript@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA=="], - - "@babel/plugin-transform-modules-commonjs": ["@babel/plugin-transform-modules-commonjs@7.29.7", "", { "dependencies": { "@babel/helper-module-transforms": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-j0vCldybPC5b5dwCQOJ21uKtHzt7hxLygJTg9eF1ScfaikEDNfzn94XoW5Fi+seBR0nCyL23xaBFFkq7dTM8XQ=="], - - "@babel/plugin-transform-typescript": ["@babel/plugin-transform-typescript@7.29.7", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.29.7", "@babel/helper-create-class-features-plugin": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7", "@babel/plugin-syntax-typescript": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-jK52h8LaLc7JarhQV2ofeFMts4H7vnOXnqZNA6fYglBTZewRBE51KWt3BUltW1P+KoPsYkHoJeXePuz4zo2LMw=="], - - "@babel/preset-typescript": ["@babel/preset-typescript@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "@babel/plugin-syntax-jsx": "^7.29.7", "@babel/plugin-transform-modules-commonjs": "^7.29.7", "@babel/plugin-transform-typescript": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-/Foi8vKY2EVbed/1eZx0gJEEwHAIxogrySI7rULcRIvhZzbvoE/b5qG5Ghc0WKAFKOHA9SD1x7RsFlOYdutIiQ=="], - - "@babel/runtime": ["@babel/runtime@7.29.7", "", {}, "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw=="], - - "@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], - - "@babel/traverse": ["@babel/traverse@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.7", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/template": "^7.29.7", "@babel/types": "^7.29.7", "debug": "^4.3.1" } }, "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw=="], - - "@babel/types": ["@babel/types@7.29.7", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7" } }, "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA=="], - - "@dimforge/rapier3d-compat": ["@dimforge/rapier3d-compat@0.12.0", "", {}, "sha512-uekIGetywIgopfD97oDL5PfeezkFpNhwlzlaEYNOA0N6ghdsOvh/HYjSMek5Q2O1PYvRSDFcqFVJl4r4ZBwOow=="], - - "@dnd-kit/accessibility": ["@dnd-kit/accessibility@3.1.1", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw=="], - - "@dnd-kit/core": ["@dnd-kit/core@6.3.1", "", { "dependencies": { "@dnd-kit/accessibility": "^3.1.1", "@dnd-kit/utilities": "^3.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ=="], - - "@dnd-kit/sortable": ["@dnd-kit/sortable@10.0.0", "", { "dependencies": { "@dnd-kit/utilities": "^3.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@dnd-kit/core": "^6.3.0", "react": ">=16.8.0" } }, "sha512-+xqhmIIzvAYMGfBYYnbKuNicfSsk4RksY2XdmJhT+HAC01nix6fHCztU68jooFiMUB01Ky3F0FyOvhG/BZrWkg=="], - - "@dnd-kit/utilities": ["@dnd-kit/utilities@3.2.2", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg=="], - - "@dotenvx/dotenvx": ["@dotenvx/dotenvx@1.75.1", "", { "dependencies": { "@dotenvx/primitives": "^0.8.0", "commander": "^11.1.0", "conf": "^10.2.0", "dotenv": "^17.2.1", "enquirer": "^2.4.1", "env-paths": "^2.2.1", "execa": "^5.1.1", "fdir": "^6.2.0", "ignore": "^5.3.0", "object-treeify": "1.1.33", "open": "^8.4.2", "picomatch": "^4.0.4", "systeminformation": "^5.22.11", "undici": "^7.11.0", "which": "^4.0.0", "yocto-spinner": "^1.1.0" }, "bin": { "dotenvx": "src/cli/dotenvx.js" } }, "sha512-/BITOC9dmS/edY2zQwZNicQ059O6RKabtQfyEafV0nGtfYRNHYy1DIPiYVcov40+tob9hfmBnbR963dS+EQ1DQ=="], - - "@dotenvx/primitives": ["@dotenvx/primitives@0.8.0", "", {}, "sha512-VYJy0uhFm9zTJ1TxBaW/pA8bjbOM/OttaNMwZ1RHG4JKyRG7DhSdiqD1ipQoAyoD22olUtxbP78W9xY3Wd11bg=="], - - "@emnapi/core": ["@emnapi/core@1.11.1", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.2", "tslib": "^2.4.0" } }, "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ=="], - - "@emnapi/runtime": ["@emnapi/runtime@1.11.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw=="], - - "@emnapi/wasi-threads": ["@emnapi/wasi-threads@1.2.2", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA=="], - - "@floating-ui/core": ["@floating-ui/core@1.7.5", "", { "dependencies": { "@floating-ui/utils": "^0.2.11" } }, "sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ=="], - - "@floating-ui/dom": ["@floating-ui/dom@1.7.6", "", { "dependencies": { "@floating-ui/core": "^1.7.5", "@floating-ui/utils": "^0.2.11" } }, "sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ=="], - - "@floating-ui/react-dom": ["@floating-ui/react-dom@2.1.8", "", { "dependencies": { "@floating-ui/dom": "^1.7.6" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-cC52bHwM/n/CxS87FH0yWdngEZrjdtLW/qVruo68qg+prK7ZQ4YGdut2GyDVpoGeAYe/h899rVeOVm6Oi40k2A=="], - - "@floating-ui/utils": ["@floating-ui/utils@0.2.11", "", {}, "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg=="], - - "@fontsource-variable/geist": ["@fontsource-variable/geist@5.2.9", "", {}, "sha512-TP+QSBG3wxKGPE33CbMy/L0Nu3qvJ6Fy81Yc4LnQ95xH+i+cfEp8fyU8/kfV14YwszxIFPhnoMTbjL71waVpyQ=="], - - "@hono/node-server": ["@hono/node-server@1.19.14", "", { "peerDependencies": { "hono": "^4" } }, "sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw=="], - - "@huggingface/jinja": ["@huggingface/jinja@0.5.9", "", {}, "sha512-uWTG+l3VJRsl7EXxYizuL3P+cCPoc3cRqbWWRcQN0FhejRfbdq0RNhCmbY/YDtnTcz9icdLYuLDjsnz4d8JMuw=="], - - "@huggingface/tokenizers": ["@huggingface/tokenizers@0.1.3", "", {}, "sha512-8rF/RRT10u+kn7YuUbUg0OF30K8rjTc78aHpxT+qJ1uWSqxT1MHi8+9ltwYfkFYJzT/oS+qw3JVfHtNMGAdqyA=="], - - "@huggingface/transformers": ["@huggingface/transformers@4.2.0", "", { "dependencies": { "@huggingface/jinja": "^0.5.6", "@huggingface/tokenizers": "^0.1.3", "onnxruntime-node": "1.24.3", "onnxruntime-web": "1.26.0-dev.20260416-b7804b056c", "sharp": "^0.34.5" } }, "sha512-8BRCoBMH0XsWaEIamuR0LrJGAfftgHAfb2Vrffy0VKlSAE/MnUJ5/h/zTfEP3fDIft+nk7TqB8xXEyABGitBjQ=="], - - "@img/colour": ["@img/colour@1.1.0", "", {}, "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ=="], - - "@img/sharp-darwin-arm64": ["@img/sharp-darwin-arm64@0.34.5", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-arm64": "1.2.4" }, "os": "darwin", "cpu": "arm64" }, "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w=="], - - "@img/sharp-darwin-x64": ["@img/sharp-darwin-x64@0.34.5", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-x64": "1.2.4" }, "os": "darwin", "cpu": "x64" }, "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw=="], - - "@img/sharp-libvips-darwin-arm64": ["@img/sharp-libvips-darwin-arm64@1.2.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g=="], - - "@img/sharp-libvips-darwin-x64": ["@img/sharp-libvips-darwin-x64@1.2.4", "", { "os": "darwin", "cpu": "x64" }, "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg=="], - - "@img/sharp-libvips-linux-arm": ["@img/sharp-libvips-linux-arm@1.2.4", "", { "os": "linux", "cpu": "arm" }, "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A=="], - - "@img/sharp-libvips-linux-arm64": ["@img/sharp-libvips-linux-arm64@1.2.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw=="], - - "@img/sharp-libvips-linux-ppc64": ["@img/sharp-libvips-linux-ppc64@1.2.4", "", { "os": "linux", "cpu": "ppc64" }, "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA=="], - - "@img/sharp-libvips-linux-riscv64": ["@img/sharp-libvips-linux-riscv64@1.2.4", "", { "os": "linux", "cpu": "none" }, "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA=="], - - "@img/sharp-libvips-linux-s390x": ["@img/sharp-libvips-linux-s390x@1.2.4", "", { "os": "linux", "cpu": "s390x" }, "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ=="], - - "@img/sharp-libvips-linux-x64": ["@img/sharp-libvips-linux-x64@1.2.4", "", { "os": "linux", "cpu": "x64" }, "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw=="], - - "@img/sharp-libvips-linuxmusl-arm64": ["@img/sharp-libvips-linuxmusl-arm64@1.2.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw=="], - - "@img/sharp-libvips-linuxmusl-x64": ["@img/sharp-libvips-linuxmusl-x64@1.2.4", "", { "os": "linux", "cpu": "x64" }, "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg=="], - - "@img/sharp-linux-arm": ["@img/sharp-linux-arm@0.34.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm": "1.2.4" }, "os": "linux", "cpu": "arm" }, "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw=="], - - "@img/sharp-linux-arm64": ["@img/sharp-linux-arm64@0.34.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-arm64": "1.2.4" }, "os": "linux", "cpu": "arm64" }, "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg=="], - - "@img/sharp-linux-ppc64": ["@img/sharp-linux-ppc64@0.34.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-ppc64": "1.2.4" }, "os": "linux", "cpu": "ppc64" }, "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA=="], - - "@img/sharp-linux-riscv64": ["@img/sharp-linux-riscv64@0.34.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-riscv64": "1.2.4" }, "os": "linux", "cpu": "none" }, "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw=="], - - "@img/sharp-linux-s390x": ["@img/sharp-linux-s390x@0.34.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-s390x": "1.2.4" }, "os": "linux", "cpu": "s390x" }, "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg=="], - - "@img/sharp-linux-x64": ["@img/sharp-linux-x64@0.34.5", "", { "optionalDependencies": { "@img/sharp-libvips-linux-x64": "1.2.4" }, "os": "linux", "cpu": "x64" }, "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ=="], - - "@img/sharp-linuxmusl-arm64": ["@img/sharp-linuxmusl-arm64@0.34.5", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" }, "os": "linux", "cpu": "arm64" }, "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg=="], - - "@img/sharp-linuxmusl-x64": ["@img/sharp-linuxmusl-x64@0.34.5", "", { "optionalDependencies": { "@img/sharp-libvips-linuxmusl-x64": "1.2.4" }, "os": "linux", "cpu": "x64" }, "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q=="], - - "@img/sharp-wasm32": ["@img/sharp-wasm32@0.34.5", "", { "dependencies": { "@emnapi/runtime": "^1.7.0" }, "cpu": "none" }, "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw=="], - - "@img/sharp-win32-arm64": ["@img/sharp-win32-arm64@0.34.5", "", { "os": "win32", "cpu": "arm64" }, "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g=="], - - "@img/sharp-win32-ia32": ["@img/sharp-win32-ia32@0.34.5", "", { "os": "win32", "cpu": "ia32" }, "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg=="], - - "@img/sharp-win32-x64": ["@img/sharp-win32-x64@0.34.5", "", { "os": "win32", "cpu": "x64" }, "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw=="], - - "@isaacs/fs-minipass": ["@isaacs/fs-minipass@4.0.1", "", { "dependencies": { "minipass": "^7.0.4" } }, "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w=="], - - "@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="], - - "@jridgewell/remapping": ["@jridgewell/remapping@2.3.5", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="], - - "@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="], - - "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.5", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="], - - "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="], - - "@mediapipe/tasks-vision": ["@mediapipe/tasks-vision@0.10.17", "", {}, "sha512-CZWV/q6TTe8ta61cZXjfnnHsfWIdFhms03M9T7Cnd5y2mdpylJM0rF1qRq+wsQVRMLz1OYPVEBU9ph2Bx8cxrg=="], - - "@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.29.0", "", { "dependencies": { "@hono/node-server": "^1.19.9", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.2.1", "express-rate-limit": "^8.2.1", "hono": "^4.11.4", "jose": "^6.1.3", "json-schema-typed": "^8.0.2", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.25 || ^4.0", "zod-to-json-schema": "^3.25.1" }, "peerDependencies": { "@cfworker/json-schema": "^4.1.1" }, "optionalPeers": ["@cfworker/json-schema"] }, "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ=="], - - "@monogrid/gainmap-js": ["@monogrid/gainmap-js@3.4.0", "", { "dependencies": { "promise-worker-transferable": "^1.0.4" }, "peerDependencies": { "three": ">= 0.159.0" } }, "sha512-2Z0FATFHaoYJ8b+Y4y4Hgfn3FRFwuU5zRrk+9dFWp4uGAdHGqVEdP7HP+gLA3X469KXHmfupJaUbKo1b/aDKIg=="], - - "@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.1.6", "", { "dependencies": { "@tybys/wasm-util": "^0.10.3" }, "peerDependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1" } }, "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg=="], - - "@nodelib/fs.scandir": ["@nodelib/fs.scandir@2.1.5", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="], - - "@nodelib/fs.stat": ["@nodelib/fs.stat@2.0.5", "", {}, "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A=="], - - "@nodelib/fs.walk": ["@nodelib/fs.walk@1.2.8", "", { "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg=="], - - "@oxc-project/types": ["@oxc-project/types@0.137.0", "", {}, "sha512-WT+Gb24i8hmvo85AIv2oEYouEXkRlKAlT9WaCa3TfLgNCN+GhrJOGZuIlMouAh38Qe4QOx26eUOVsq70qXrywA=="], - - "@protobufjs/aspromise": ["@protobufjs/aspromise@1.1.2", "", {}, "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ=="], - - "@protobufjs/base64": ["@protobufjs/base64@1.1.2", "", {}, "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg=="], - - "@protobufjs/codegen": ["@protobufjs/codegen@2.0.5", "", {}, "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g=="], - - "@protobufjs/eventemitter": ["@protobufjs/eventemitter@1.1.1", "", {}, "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg=="], - - "@protobufjs/fetch": ["@protobufjs/fetch@1.1.1", "", { "dependencies": { "@protobufjs/aspromise": "^1.1.1" } }, "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw=="], - - "@protobufjs/float": ["@protobufjs/float@1.0.2", "", {}, "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ=="], - - "@protobufjs/path": ["@protobufjs/path@1.1.2", "", {}, "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA=="], - - "@protobufjs/pool": ["@protobufjs/pool@1.1.0", "", {}, "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw=="], - - "@protobufjs/utf8": ["@protobufjs/utf8@1.1.1", "", {}, "sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg=="], - - "@protolabsai/design": ["@protolabsai/design@0.5.1", "", { "bin": { "protolabs-sync-assets": "bin/sync-assets.mjs" } }, "sha512-vffDv6H527tZXyfie41OM1nxIr3AoyCuvL8r+YxTIWczPjaI0EVHbJTE63IASoTsstAyBIETZeMQsTnhvYM9Qg=="], - - "@protolabsai/ui": ["@protolabsai/ui@0.26.2", "", { "dependencies": { "@dnd-kit/core": "^6.3.1", "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", "@protolabsai/design": "0.5.0", "@radix-ui/react-dropdown-menu": "^2.1.17", "@radix-ui/react-popover": "^1.1.16", "@types/react": "^19.0.0", "@types/react-dom": "^19.0.0", "culori": "^4.0.2" }, "peerDependencies": { "react": "^19.0.0", "react-dom": "^19.0.0" } }, "sha512-+dWUUTOHqfiDliAlMloEWFhUnhSOs0hNuNAVPYr/Xs3EZES6usY6wCRnTjhA7OrOu16sd7ZKp7o6xKZqvqOmdw=="], - - "@radix-ui/number": ["@radix-ui/number@1.1.2", "", {}, "sha512-ceTwaxc4I5IOi97DgCotl3pqiyRGvffcc0oOsE2dQYaJOFIDsDt4VWG6xEbg1QePv9QWausCEIppud/tJ1wNig=="], - - "@radix-ui/primitive": ["@radix-ui/primitive@1.1.4", "", {}, "sha512-7AdCK9PQyiljKoBDbN8OuctCbd/esdwZPQ8RtOE3SsyQtUpiPb+ND75q0jEhC1m1ecBI0MFNeLJvwIh9iKHRcQ=="], - - "@radix-ui/react-accessible-icon": ["@radix-ui/react-accessible-icon@1.1.10", "", { "dependencies": { "@radix-ui/react-visually-hidden": "1.2.6" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-TraSwZUqTcVbiDV2/RXzAXC7aeVVXchq0daPFZE7zAxYFaMzjOUggLOfQH9KFLgRizuwVKZO/crveV1eeO3/ZQ=="], - - "@radix-ui/react-accordion": ["@radix-ui/react-accordion@1.2.14", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-collapsible": "1.1.14", "@radix-ui/react-collection": "1.1.10", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-direction": "1.1.2", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-controllable-state": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-iE8YB9nmTBH8zd73ofBISZ8JCzgMoMkATJr7qDwa6u5F1+7mTM81V6fa71jgZ65rpjVpecDf1vSnwIFP9Ly1zw=="], - - "@radix-ui/react-alert-dialog": ["@radix-ui/react-alert-dialog@1.1.17", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-dialog": "1.1.17", "@radix-ui/react-primitive": "2.1.6" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-563ygGeyWPrxyVCNp7OV4rE2aIXhFPknpFyo4wbDlcyMMPZ6ySh+zC5WTvY0ZFLgPTg/QB6tA8PyDQyJ2b4cPg=="], - - "@radix-ui/react-arrow": ["@radix-ui/react-arrow@1.1.10", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.6" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-j2VTDz1vgCsmuG0k5lBfOcM8n5JPFqZBcMryasFjHYMhwxYL5SRUV5lMSUpRdNtw3D/Sv8pzJtrlAgkssYSsQQ=="], - - "@radix-ui/react-aspect-ratio": ["@radix-ui/react-aspect-ratio@1.1.10", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.6" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-kbI7NrqhDeuytYrq7JjAsoXczvL8wgj2tc1MyaYWm+50bMKHCHQtVWCryslx4cCpmCTTkBcwQckE4CmmGV2haQ=="], - - "@radix-ui/react-avatar": ["@radix-ui/react-avatar@1.2.0", "", { "dependencies": { "@radix-ui/react-context": "1.1.4", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-callback-ref": "1.1.2", "@radix-ui/react-use-is-hydrated": "0.1.1", "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-am/CwltXtmtdtP+5FbYblYDnMa/zuKcMJP1i3/SJMDXXfj2mG+BTqLH2wucqeyyiQMursUtg/5cK+Nh2pCaSOA=="], - - "@radix-ui/react-checkbox": ["@radix-ui/react-checkbox@1.3.5", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-presence": "1.1.6", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-controllable-state": "1.2.3", "@radix-ui/react-use-previous": "1.1.2", "@radix-ui/react-use-size": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-pREzrmNnVwGvYaBoM64huTRK7B3lrTRuwj8A9nwhPiEtMb+yudiWh6zWAqEtP0Dzd5+iBa1Ki7V1pCxV8ExMdA=="], - - "@radix-ui/react-collapsible": ["@radix-ui/react-collapsible@1.1.14", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-presence": "1.1.6", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-controllable-state": "1.2.3", "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-9bT+FvifX1FK2Mj6UEsTdyu0cN3JaA3KdfhaBao+ONrYFy/pyOy3TU1TNw7iOk1o+0hOEq67RojlUUmoFGwxyA=="], - - "@radix-ui/react-collection": ["@radix-ui/react-collection@1.1.10", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-slot": "1.3.0" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-IVVz4EvBcKjrzKgof714qDnz/SzQAkLA2Emh5edlHbgcE6fNd3Un6CJLlaYcnm8N4JmAtzQgse4dOKxcD2yc9g=="], - - "@radix-ui/react-compose-refs": ["@radix-ui/react-compose-refs@1.1.3", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-rYOP8OMnuuPMQF1uhPVlGNcCDlkokKqGFE3JcxFViIkAXP7EvFWUliJAstrapypaBLJNHbZL6jGhbVDGTwmVhA=="], - - "@radix-ui/react-context": ["@radix-ui/react-context@1.1.4", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-QwH4PO5urrbO+FaGd5Aglg+YJgWTyyuZ3g/6mKvsqraLkglDdckw9JafgL5McL5VEJ6EPNduPaT3ZE9BttDAqg=="], - - "@radix-ui/react-context-menu": ["@radix-ui/react-context-menu@2.3.1", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-menu": "2.1.18", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-controllable-state": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-XbrxS68W5dyiE4fAb96yvJwSVU5x66B20A99sD5Mk3xSWK/LqeOnx6TZnim1KieMjXS/CTFq8reOAjWxas2G8Q=="], - - "@radix-ui/react-dialog": ["@radix-ui/react-dialog@1.1.17", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-dismissable-layer": "1.1.13", "@radix-ui/react-focus-guards": "1.1.4", "@radix-ui/react-focus-scope": "1.1.10", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-portal": "1.1.12", "@radix-ui/react-presence": "1.1.6", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-slot": "1.3.0", "@radix-ui/react-use-controllable-state": "1.2.3", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.7.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-TDTYmpdq8dI2+Xgvgj9AJ8Ghqq+Eph/TRVEdaFQPDItIY+6QSkU7MJMeevw1568Yw/2Ijz8BTphPSP2XejKphw=="], - - "@radix-ui/react-direction": ["@radix-ui/react-direction@1.1.2", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-C3vFhbyi4SW3PmbAi6Awpu4OzJtd0MxGurvSsYtr7p7nM8RNB3VAF3CUmnp2j50knpkrRcB7+ycVXzgLgF6yNA=="], - - "@radix-ui/react-dismissable-layer": ["@radix-ui/react-dismissable-layer@1.1.13", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-callback-ref": "1.1.2", "@radix-ui/react-use-escape-keydown": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-2v+zNAWWe0ySxgC0D0yeXMPQ23xZVgXZTerTz+JKlmdRj6gfTqmCcR29jb6d290DezXPGgruHWDX/vYUebtErg=="], - - "@radix-ui/react-dropdown-menu": ["@radix-ui/react-dropdown-menu@2.1.18", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-menu": "2.1.18", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-controllable-state": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-PZGV82gFk0WltDRI//SsG28ZIjlo9ANTmoNYg0jLNzXXiDsAy5PkOOYQaVD1pPxY6t7gxffb1QMD6qaUvsBZdw=="], - - "@radix-ui/react-focus-guards": ["@radix-ui/react-focus-guards@1.1.4", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-cot/aB/mOm0IYVYTTmQcEEK1M48lZWi8FlYe5nDPQQ8NYZUlXEFgncJ9p2Kzer3RKSrY7cTTpEMLZKNo9QoP5Q=="], - - "@radix-ui/react-focus-scope": ["@radix-ui/react-focus-scope@1.1.10", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-callback-ref": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-Fas/lXQqhVvqwAb64s5RFeHiHYElZ6SUQbZaNd6EkfhP/Al7wTIQ9WIR4QVX475tlu5yFCEdDcJH6/UwsZjMWw=="], - - "@radix-ui/react-form": ["@radix-ui/react-form@0.1.10", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-label": "2.1.10", "@radix-ui/react-primitive": "2.1.6" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-1NfuvctVtX4sU3Mmq/IdrR8UunxiCMiVg3A5UENKhFzxUBeOyaQQ+lmaQaV7Tc8cqvBKsJL3/KGBsixK0D8WFg=="], - - "@radix-ui/react-hover-card": ["@radix-ui/react-hover-card@1.1.17", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-dismissable-layer": "1.1.13", "@radix-ui/react-popper": "1.3.1", "@radix-ui/react-portal": "1.1.12", "@radix-ui/react-presence": "1.1.6", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-controllable-state": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-GjZQIEANVkuuWeztlKz6QEHe31ZX2iDfHzcTMCQVZXC0JyQrgfKWSC+LOOEw6aVV64zyjzobIzSA4AU4eKWrHA=="], - - "@radix-ui/react-id": ["@radix-ui/react-id@1.1.2", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-orBC88futVpqCmhX1p4cvquNHsELQ+w+vBJnuj3ftETI5bJb0bZn3Tqu3SWN2IOcPycTnMGnhwoermvISt72sA=="], - - "@radix-ui/react-label": ["@radix-ui/react-label@2.1.10", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.6" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-ib0zvq2ZsAqKm5tRnqGJn3vOxSgIts5ToxsXT0q1S/GfLD1Zj7UOEnkw8u2w6sRmn47djpQWuSU1DCL1R29/yw=="], - - "@radix-ui/react-menu": ["@radix-ui/react-menu@2.1.18", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-collection": "1.1.10", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-direction": "1.1.2", "@radix-ui/react-dismissable-layer": "1.1.13", "@radix-ui/react-focus-guards": "1.1.4", "@radix-ui/react-focus-scope": "1.1.10", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-popper": "1.3.1", "@radix-ui/react-portal": "1.1.12", "@radix-ui/react-presence": "1.1.6", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-roving-focus": "1.1.13", "@radix-ui/react-slot": "1.3.0", "@radix-ui/react-use-callback-ref": "1.1.2", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.7.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-lj8Rxjtn6zJq1oSbE/uDtAwCbB9BnxgHD+8MwJMuTh6u1dPamYhW9iuELr/Z8d0D/UysFblYYHeBPwi7T4k0YQ=="], - - "@radix-ui/react-menubar": ["@radix-ui/react-menubar@1.1.18", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-collection": "1.1.10", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-direction": "1.1.2", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-menu": "2.1.18", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-roving-focus": "1.1.13", "@radix-ui/react-use-controllable-state": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-hX7EGx/oFq6DPY27GQuP/2wP48GHf5LG6r06VgNJlG+znmDS8OfopZcRcGly3L4lsB9FqpmLx6JQSE9P3BUpyw=="], - - "@radix-ui/react-navigation-menu": ["@radix-ui/react-navigation-menu@1.2.16", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-collection": "1.1.10", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-direction": "1.1.2", "@radix-ui/react-dismissable-layer": "1.1.13", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-presence": "1.1.6", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-callback-ref": "1.1.2", "@radix-ui/react-use-controllable-state": "1.2.3", "@radix-ui/react-use-layout-effect": "1.1.2", "@radix-ui/react-use-previous": "1.1.2", "@radix-ui/react-visually-hidden": "1.2.6" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-nJ0SkrSQgudyYhMiYeHA1ayLVuduEJCFLan1RZZN7c9kqzzCFLaU9kuy81uNtqzweM9YaQPgWzxi9MwQ9jZ04g=="], - - "@radix-ui/react-one-time-password-field": ["@radix-ui/react-one-time-password-field@0.1.10", "", { "dependencies": { "@radix-ui/number": "1.1.2", "@radix-ui/primitive": "1.1.4", "@radix-ui/react-collection": "1.1.10", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-direction": "1.1.2", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-roving-focus": "1.1.13", "@radix-ui/react-use-controllable-state": "1.2.3", "@radix-ui/react-use-effect-event": "0.0.3", "@radix-ui/react-use-is-hydrated": "0.1.1", "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-GHkcJ+WVj91At+OvUVTD4R3W0/wxw9t/sG5xFUBYXaCbtWiooZX5Md376QjJqgH4VsVyXrbVNHO2O4NYcmjfVg=="], - - "@radix-ui/react-password-toggle-field": ["@radix-ui/react-password-toggle-field@0.1.5", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-controllable-state": "1.2.3", "@radix-ui/react-use-effect-event": "0.0.3", "@radix-ui/react-use-is-hydrated": "0.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-fVuA82u0b/fClpbEJv8yp1nU9eSvoSEOERsU/hhf3FXGPIvkmE7oEaHEu8poowoXO39/Va7zq2E0TUcYr1dBRg=="], - - "@radix-ui/react-popover": ["@radix-ui/react-popover@1.1.17", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-dismissable-layer": "1.1.13", "@radix-ui/react-focus-guards": "1.1.4", "@radix-ui/react-focus-scope": "1.1.10", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-popper": "1.3.1", "@radix-ui/react-portal": "1.1.12", "@radix-ui/react-presence": "1.1.6", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-slot": "1.3.0", "@radix-ui/react-use-controllable-state": "1.2.3", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.7.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-/YSAOdJ7YJvdn7bn5sdSx2egW+SKY+u7O5RyAVs94Ymrg2fg5QTSFPMRkzvhGyFuE4/qsmPBdrwYoZMZh/4f+g=="], - - "@radix-ui/react-popper": ["@radix-ui/react-popper@1.3.1", "", { "dependencies": { "@floating-ui/react-dom": "^2.0.0", "@radix-ui/react-arrow": "1.1.10", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-callback-ref": "1.1.2", "@radix-ui/react-use-layout-effect": "1.1.2", "@radix-ui/react-use-rect": "1.1.2", "@radix-ui/react-use-size": "1.1.2", "@radix-ui/rect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-bhnq/0DEPTi2lsOD3J5rTL65qUKHbKbhqHsmN9TMiclSXpipi651ooUKPPp6G5lF/WiHBdn1s0Wuqsn+myVAvw=="], - - "@radix-ui/react-portal": ["@radix-ui/react-portal@1.1.12", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-m309havGzsjLHHaIX50G5PlvRs3xkgPCsGk/5PTvYm8D5q33yG0J7w/712PTOhid7NTaFETtnSXjngHQavvhVw=="], - - "@radix-ui/react-presence": ["@radix-ui/react-presence@1.1.6", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-zdTk4PlUO0E18HnZ3wYbW0KkJJxWCdiNYp6g6X1PtONFhxVkg01vliTJAmwIszU6mHiyBOoW9P0rAugl5/hULQ=="], - - "@radix-ui/react-primitive": ["@radix-ui/react-primitive@2.1.6", "", { "dependencies": { "@radix-ui/react-slot": "1.3.0" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-wetd0QI77DbvrPpTAvH1SqOxsYF2wZe5TNxqwOd5Ty4XDpV3dpV0s8K/1MGMJBeY5o7lg8ub5VIt1Ub+yVen6g=="], - - "@radix-ui/react-progress": ["@radix-ui/react-progress@1.1.10", "", { "dependencies": { "@radix-ui/react-context": "1.1.4", "@radix-ui/react-primitive": "2.1.6" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-JYzEg60lk79PwKM27WZyKd7PW8O4OM5jOaFfRPfOyeXmMw7tLJh5kSj+CEjVTehszuwml/AdCzPGMXBTGf4BBw=="], - - "@radix-ui/react-radio-group": ["@radix-ui/react-radio-group@1.4.1", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-direction": "1.1.2", "@radix-ui/react-presence": "1.1.6", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-roving-focus": "1.1.13", "@radix-ui/react-use-controllable-state": "1.2.3", "@radix-ui/react-use-previous": "1.1.2", "@radix-ui/react-use-size": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-/SSxZdKEo2Eo29FFRKd06EfFDYp8HryKg0WYg7QLXaydPzl52YfSvCH2a3QDBRdtcuwACroJT8UVjQVgOJ7P9A=="], - - "@radix-ui/react-roving-focus": ["@radix-ui/react-roving-focus@1.1.13", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-collection": "1.1.10", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-direction": "1.1.2", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-callback-ref": "1.1.2", "@radix-ui/react-use-controllable-state": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-9gkwneI0guf8JDmrFxPjJF6Ozzgioyw+/lonYNCwefS9ZHA05er0BVHiXr+LbWGHxUfczvMY6G1oiZZi1VzjRw=="], - - "@radix-ui/react-scroll-area": ["@radix-ui/react-scroll-area@1.2.12", "", { "dependencies": { "@radix-ui/number": "1.1.2", "@radix-ui/primitive": "1.1.4", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-direction": "1.1.2", "@radix-ui/react-presence": "1.1.6", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-callback-ref": "1.1.2", "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-xuafVzQiTCLsyEjakowTdG3OgTXsmO7IdCiO77otIa+z44xoLNs9Do5eg7POFumIOCjtG6djfm6RKUKpUa/csA=="], - - "@radix-ui/react-select": ["@radix-ui/react-select@2.3.1", "", { "dependencies": { "@radix-ui/number": "1.1.2", "@radix-ui/primitive": "1.1.4", "@radix-ui/react-collection": "1.1.10", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-direction": "1.1.2", "@radix-ui/react-dismissable-layer": "1.1.13", "@radix-ui/react-focus-guards": "1.1.4", "@radix-ui/react-focus-scope": "1.1.10", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-popper": "1.3.1", "@radix-ui/react-portal": "1.1.12", "@radix-ui/react-presence": "1.1.6", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-slot": "1.3.0", "@radix-ui/react-use-callback-ref": "1.1.2", "@radix-ui/react-use-controllable-state": "1.2.3", "@radix-ui/react-use-layout-effect": "1.1.2", "@radix-ui/react-use-previous": "1.1.2", "@radix-ui/react-visually-hidden": "1.2.6", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.7.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-w6eDvY78LE9ZUiNnXCA1QVK8RYN7k9galFv09kjVydJqBAgHd7Y9A6h0UJ/6DCZNGZMZrB2ohcSW1Bo9d8+wWA=="], - - "@radix-ui/react-separator": ["@radix-ui/react-separator@1.1.10", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.6" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-Y6K6jLQCVfCnTL2MEtGxDLffkhNfEfHsEg3Wa8JU+IWdn3EWbLXd3OuOfQRN7p/W/cUce1WyTk3QeuAoDBzN9g=="], - - "@radix-ui/react-slider": ["@radix-ui/react-slider@1.4.1", "", { "dependencies": { "@radix-ui/number": "1.1.2", "@radix-ui/primitive": "1.1.4", "@radix-ui/react-collection": "1.1.10", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-direction": "1.1.2", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-controllable-state": "1.2.3", "@radix-ui/react-use-layout-effect": "1.1.2", "@radix-ui/react-use-previous": "1.1.2", "@radix-ui/react-use-size": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-r91WSpQucNGFKAIxT8FT0H0zyjd5tJlqObLp7LOMV4z49KoDCwjy01w3vDOU4e1wxhF9IgjYco7SB6byOW7Buw=="], - - "@radix-ui/react-slot": ["@radix-ui/react-slot@1.3.0", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.3" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-MojKku4U/miO8Av4Dkb+ctMAQx7JmY96LmtDQlAarCRtd7rN52QCSzBF+XAvr5S6coSVj9HEPBgHAHKEJVk/WA=="], - - "@radix-ui/react-switch": ["@radix-ui/react-switch@1.3.1", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-controllable-state": "1.2.3", "@radix-ui/react-use-previous": "1.1.2", "@radix-ui/react-use-size": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-55bQtCnOB0BohomSHi6qvQXpJEEqUGDm6hRrM0Bph5OXwhSegqkd8IqgBAQkM1IlgUlWZIxpxRcpOEfRIgimyw=="], - - "@radix-ui/react-tabs": ["@radix-ui/react-tabs@1.1.15", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-direction": "1.1.2", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-presence": "1.1.6", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-roving-focus": "1.1.13", "@radix-ui/react-use-controllable-state": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-kxc9gI6/HfcU4nfMMVS3AmQK414kbU1IE6UCJmMmxjhO3cRPXOyYnmvyKD+ODt7q56nRq9l7Wovi6uaGwKgMlg=="], - - "@radix-ui/react-toast": ["@radix-ui/react-toast@1.2.17", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-collection": "1.1.10", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-dismissable-layer": "1.1.13", "@radix-ui/react-portal": "1.1.12", "@radix-ui/react-presence": "1.1.6", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-callback-ref": "1.1.2", "@radix-ui/react-use-controllable-state": "1.2.3", "@radix-ui/react-use-layout-effect": "1.1.2", "@radix-ui/react-visually-hidden": "1.2.6" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-uL4kyyWy000pPL43fGGCV5qT6ZchCWEQZOSlkYiPwPt8Hy1iW38RjeptIvz1/SZesrW6Vn58Ct3sV7tfEfiAbw=="], - - "@radix-ui/react-toggle": ["@radix-ui/react-toggle@1.1.12", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-use-controllable-state": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-AsAVsYNZIlRBsci7BhE+QyQeKd1h6TffJYt+lF0QQkd5OpQ3klfIByPsCb4G0h/Fq6PJwh1FYNluzBFYzhk4+w=="], - - "@radix-ui/react-toggle-group": ["@radix-ui/react-toggle-group@1.1.13", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-direction": "1.1.2", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-roving-focus": "1.1.13", "@radix-ui/react-toggle": "1.1.12", "@radix-ui/react-use-controllable-state": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-Xb9PLtlvU66F36LiKba6dFswu6V2mDkgidO4fNSbQHQwmZ9ObxMIO17MN/LJ4aWJecVuSVLAHPZjyeMzJrgeiA=="], - - "@radix-ui/react-toolbar": ["@radix-ui/react-toolbar@1.1.13", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-direction": "1.1.2", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-roving-focus": "1.1.13", "@radix-ui/react-separator": "1.1.10", "@radix-ui/react-toggle-group": "1.1.13" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-Za1l4f6fzTkGgz/iynAMN8iaqiKff2wm2/QwiLmHPtDQreWEBrvSimgQFIekxMUdRPhILM7xdIXxuS/o/DGZag=="], - - "@radix-ui/react-tooltip": ["@radix-ui/react-tooltip@1.2.10", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-dismissable-layer": "1.1.13", "@radix-ui/react-id": "1.1.2", "@radix-ui/react-popper": "1.3.1", "@radix-ui/react-portal": "1.1.12", "@radix-ui/react-presence": "1.1.6", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-slot": "1.3.0", "@radix-ui/react-use-controllable-state": "1.2.3", "@radix-ui/react-visually-hidden": "1.2.6" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-NlNe8D0dWEpVfXFli90IO6X07Josx/b1iu98tDnx9Xv0HT4wLIL+m2VOheMHhK7qbp2HoTBqALEFzGyZs/levw=="], - - "@radix-ui/react-use-callback-ref": ["@radix-ui/react-use-callback-ref@1.1.2", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-xCso9j1/u8sEgP1RNHjFrXJLApL8LiqOkI1R4ywuN00rxWdYg4oQXuwKLS3i0j5NWLromUD27/4nlxj2UFVvIw=="], - - "@radix-ui/react-use-controllable-state": ["@radix-ui/react-use-controllable-state@1.2.3", "", { "dependencies": { "@radix-ui/react-use-effect-event": "0.0.3", "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-PLzC90MS+ReootmjC597dvopoelpZ8Q61HJkDXZSExitIq7PL55vHNnesAHwguHK0aPfBnpdNzQtv1uliaqQrA=="], - - "@radix-ui/react-use-effect-event": ["@radix-ui/react-use-effect-event@0.0.3", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-6c8ZqvPTWILEKnyVkP53EGRCcpnJiKTC21sS/6R1GF5xKyHJJWQEPfkqlcgUkdRQivd6tb23abUwe4ngWmY0JA=="], - - "@radix-ui/react-use-escape-keydown": ["@radix-ui/react-use-escape-keydown@1.1.2", "", { "dependencies": { "@radix-ui/react-use-callback-ref": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-2uVLvLjgO7NZCWw01/FdqRwmA42J0BcjPMUCA+koFEOAb+zjqIP7SiFz/7zWPrKnVmSqr76Omq2ALyCuX4dhLw=="], - - "@radix-ui/react-use-is-hydrated": ["@radix-ui/react-use-is-hydrated@0.1.1", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-qwOiz4Tjo8CNnrOLAYUMXeZwDzXgXpvK4TKQPmWLECM9XoWvA6+0Z2/7Ag3A4ivjS4ovbLJPbskkxioFyBhr8A=="], - - "@radix-ui/react-use-layout-effect": ["@radix-ui/react-use-layout-effect@1.1.2", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-jrBWOxZITuGcnjRCM2t2U5ZPkCLxD+Ym6DjfssS5haTj2iiak/DOb64JeN6OdLfLgptb6/e2kKR+ZuTrGoZTPA=="], - - "@radix-ui/react-use-previous": ["@radix-ui/react-use-previous@1.1.2", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-IGBQPtRFdhN6MQ8dbegVmBq1LVZluya3F1jWY+puIcQC3MHctRwTDSBWCkL/3ZcnMJLTMJ++Z+ktmvg0F89iCw=="], - - "@radix-ui/react-use-rect": ["@radix-ui/react-use-rect@1.1.2", "", { "dependencies": { "@radix-ui/rect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-d8a+bBY/FxikNPlgJJoaBHZX+zKVbWHYJGTLnLvveQgFSTntkGdEKv3JDtHrMS0DNYpllz2nRsTLGLKYttbpmw=="], - - "@radix-ui/react-use-size": ["@radix-ui/react-use-size@1.1.2", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-giWQp+4mxjBPt4KZ0MmyuykFNWfbDxKt4x+fPkRYmgRFJSbCZFzUglvMb/Kjn38tm10YP4ufiQZDx3zna4LU6w=="], - - "@radix-ui/react-visually-hidden": ["@radix-ui/react-visually-hidden@1.2.6", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.6" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-jCE0WljWifTI4niIMCll06kGpsJTAPiZVU9H4WR1N6qW7At9ystHbN7dDB+we2xH535roFHj7qKS+RGj0FMDWQ=="], - - "@radix-ui/rect": ["@radix-ui/rect@1.1.2", "", {}, "sha512-xnXE7wG13PI+cxieVssYXlQJuYVRhH9NBoxt3KNwzghDIA69GMm7d4wXRouHIYjE+KvS6U/MsMO73NdS2MH9ZA=="], - - "@react-three/drei": ["@react-three/drei@10.7.7", "", { "dependencies": { "@babel/runtime": "^7.26.0", "@mediapipe/tasks-vision": "0.10.17", "@monogrid/gainmap-js": "^3.0.6", "@use-gesture/react": "^10.3.1", "camera-controls": "^3.1.0", "cross-env": "^7.0.3", "detect-gpu": "^5.0.56", "glsl-noise": "^0.0.0", "hls.js": "^1.5.17", "maath": "^0.10.8", "meshline": "^3.3.1", "stats-gl": "^2.2.8", "stats.js": "^0.17.0", "suspend-react": "^0.1.3", "three-mesh-bvh": "^0.8.3", "three-stdlib": "^2.35.6", "troika-three-text": "^0.52.4", "tunnel-rat": "^0.1.2", "use-sync-external-store": "^1.4.0", "utility-types": "^3.11.0", "zustand": "^5.0.1" }, "peerDependencies": { "@react-three/fiber": "^9.0.0", "react": "^19", "react-dom": "^19", "three": ">=0.159" }, "optionalPeers": ["react-dom"] }, "sha512-ff+J5iloR0k4tC++QtD/j9u3w5fzfgFAWDtAGQah9pF2B1YgOq/5JxqY0/aVoQG5r3xSZz0cv5tk2YuBob4xEQ=="], - - "@react-three/fiber": ["@react-three/fiber@9.6.1", "", { "dependencies": { "@babel/runtime": "^7.17.8", "@types/webxr": "*", "base64-js": "^1.5.1", "buffer": "^6.0.3", "its-fine": "^2.0.0", "react-use-measure": "^2.1.7", "scheduler": "^0.27.0", "suspend-react": "^0.1.3", "use-sync-external-store": "^1.4.0", "zustand": "^5.0.3" }, "peerDependencies": { "expo": ">=43.0", "expo-asset": ">=8.4", "expo-file-system": ">=11.0", "expo-gl": ">=11.0", "react": ">=19 <19.3", "react-dom": ">=19 <19.3", "react-native": ">=0.78", "three": ">=0.156" }, "optionalPeers": ["expo", "expo-asset", "expo-file-system", "expo-gl", "react-dom", "react-native"] }, "sha512-zF0rsKcVYpcJwbFEnv2HkHX9cvOEgsfQo/X8lwmR2dn13S4qEQJXir9fxf5js2LQFoXqxOY7MDkOkYx2uZ4gSg=="], - - "@react-three/postprocessing": ["@react-three/postprocessing@3.0.4", "", { "dependencies": { "maath": "^0.6.0", "n8ao": "^1.9.4", "postprocessing": "^6.36.6" }, "peerDependencies": { "@react-three/fiber": "^9.0.0", "react": "^19.0", "three": ">= 0.156.0" } }, "sha512-e4+F5xtudDYvhxx3y0NtWXpZbwvQ0x1zdOXWTbXMK6fFLVDd4qucN90YaaStanZGS4Bd5siQm0lGL/5ogf8iDQ=="], - - "@rolldown/binding-android-arm64": ["@rolldown/binding-android-arm64@1.1.3", "", { "os": "android", "cpu": "arm64" }, "sha512-DT6Z3PhvioeHMvxo+xHc3KtqggrI7CCTXCmC2h/5zUlp5jVitv7XEy+9q5/7v8IolhlioawpMo8Kg0EEBy7J0g=="], - - "@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.1.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-0NwgwsjM7LrsuVnXMK3koTpagBNOhloc/BNjKqZjv4V5zI5r13qx69uVhRx+o5Z0yy4Hzq+lpy7TAgUG/ocvrw=="], - - "@rolldown/binding-darwin-x64": ["@rolldown/binding-darwin-x64@1.1.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-YtiBp4disu6V560loT6PjMdiRaWmVvDNrUunAalbiFx2ggeJwxdAsgZMcoGP17uyAsTwAj5V1niksxlHnVQ1Sw=="], - - "@rolldown/binding-freebsd-x64": ["@rolldown/binding-freebsd-x64@1.1.3", "", { "os": "freebsd", "cpu": "x64" }, "sha512-yD3EkEdXk2LypPxnf/kSZHirarsI8gcPzc62SukhR9VJTyvV+F9Q/GxWNuCojc7sXyuVC4DxRGhdDK4X8VSsbw=="], - - "@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/binding-linux-arm-gnueabihf@1.1.3", "", { "os": "linux", "cpu": "arm" }, "sha512-c+8vieQbsD7HNAHKIA34w0GJ9FedFFuJGD+7E6vz7Q3uqAIugL5p45fhlsj4UaAsHpcmlqugBWMhA0/j7o0sIg=="], - - "@rolldown/binding-linux-arm64-gnu": ["@rolldown/binding-linux-arm64-gnu@1.1.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-50jD0uUwLvur7Zz9LHz17kaAdTPjn5wN93hEgjvmYFRZwiR7ZJYovTd5ipyWJDAnXKvZ+wgc+/Ika6dwSF5OcA=="], - - "@rolldown/binding-linux-arm64-musl": ["@rolldown/binding-linux-arm64-musl@1.1.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-BO9+oPL8K9poZJBfYPsXNtYjPE5uM3qeehT3aFcW4LITOl+iSqhp0abzjR2nWBUNjIZeKXjAEWBZ64WjNoHd6w=="], - - "@rolldown/binding-linux-ppc64-gnu": ["@rolldown/binding-linux-ppc64-gnu@1.1.3", "", { "os": "linux", "cpu": "ppc64" }, "sha512-f3VpLB1vQ0Eo6ecr/6cekLnvYMFF4YBFoVGkfkvPLq1bAkbAwHYQPZKoAmG6OJyTcxxoC+AvezGx/S1obNC0Mw=="], - - "@rolldown/binding-linux-s390x-gnu": ["@rolldown/binding-linux-s390x-gnu@1.1.3", "", { "os": "linux", "cpu": "s390x" }, "sha512-AmurZ26Pqx/RI9N1gzEOCklkKXl927yjfXWUUS0O7Puh8ARM/Ob8qfrD3qnWksScdw6cSrW5PSHE9DyLu7+PtA=="], - - "@rolldown/binding-linux-x64-gnu": ["@rolldown/binding-linux-x64-gnu@1.1.3", "", { "os": "linux", "cpu": "x64" }, "sha512-JJpqs8bRGITDOdbkNKnlojzBabbOHrqjSvDr0IVsZObE1lBcPjxItUEY9eWIDbxaJ3cGrXPWGfGkIxFijg/URg=="], - - "@rolldown/binding-linux-x64-musl": ["@rolldown/binding-linux-x64-musl@1.1.3", "", { "os": "linux", "cpu": "x64" }, "sha512-rSJcdjPxzA/by/6/rYs+v+bXU7UjvnbUWz8MJb6kh6+knqB1dCrtHg0uu7C/4haqJvqdkYHQ5IGn+tCH9GLW/g=="], - - "@rolldown/binding-openharmony-arm64": ["@rolldown/binding-openharmony-arm64@1.1.3", "", { "os": "none", "cpu": "arm64" }, "sha512-hQ3/PYkDJICgevvyNcVrihVeqq7k1Pp3VZ9lY+dauAYUJKO+auqApvANhvR1An9BhmqYKvW2Mu1F9u4DXSMLxQ=="], - - "@rolldown/binding-wasm32-wasi": ["@rolldown/binding-wasm32-wasi@1.1.3", "", { "dependencies": { "@emnapi/core": "1.11.1", "@emnapi/runtime": "1.11.1", "@napi-rs/wasm-runtime": "^1.1.6" }, "cpu": "none" }, "sha512-Elcv/BtML9lXrV6JuKITc/grN2kYV9gjsQpW8Jfw4ioK0TOkjBjye0nnyqQNy9STNaI20lXNaQBRrD5gSgR0Yg=="], - - "@rolldown/binding-win32-arm64-msvc": ["@rolldown/binding-win32-arm64-msvc@1.1.3", "", { "os": "win32", "cpu": "arm64" }, "sha512-2DrEfhluH9yhiaFApmsjsjwrSYbNcY1oFTzYSP1a535jDbV98zCFanA/96TBUd0iDFcxGmw9QRExwGCXz3U+/g=="], - - "@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.1.3", "", { "os": "win32", "cpu": "x64" }, "sha512-OL4OMk7UPXOeVGGd3qo5zJyPIljf4AFgk5QAkPPS+OoLuOOozhuaQGC18MxVTnw/06q93gShAJzlwnSCY9YtqA=="], - - "@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.1", "", {}, "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw=="], - - "@sec-ant/readable-stream": ["@sec-ant/readable-stream@0.4.1", "", {}, "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg=="], - - "@sindresorhus/merge-streams": ["@sindresorhus/merge-streams@4.0.0", "", {}, "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ=="], - - "@tailwindcss/node": ["@tailwindcss/node@4.3.1", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "enhanced-resolve": "5.21.6", "jiti": "^2.7.0", "lightningcss": "1.32.0", "magic-string": "^0.30.21", "source-map-js": "^1.2.1", "tailwindcss": "4.3.1" } }, "sha512-6NDaqRoAMSXD1mr/RXu0HBvNE9a2n5tHPsxu9XHLws8o4Twes5rBM2205SUUiJ9goAtadrN6xTGX0UDEwp/N4A=="], - - "@tailwindcss/oxide": ["@tailwindcss/oxide@4.3.1", "", { "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.3.1", "@tailwindcss/oxide-darwin-arm64": "4.3.1", "@tailwindcss/oxide-darwin-x64": "4.3.1", "@tailwindcss/oxide-freebsd-x64": "4.3.1", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.1", "@tailwindcss/oxide-linux-arm64-gnu": "4.3.1", "@tailwindcss/oxide-linux-arm64-musl": "4.3.1", "@tailwindcss/oxide-linux-x64-gnu": "4.3.1", "@tailwindcss/oxide-linux-x64-musl": "4.3.1", "@tailwindcss/oxide-wasm32-wasi": "4.3.1", "@tailwindcss/oxide-win32-arm64-msvc": "4.3.1", "@tailwindcss/oxide-win32-x64-msvc": "4.3.1" } }, "sha512-yVPyo8RNkabVr3O2EhHEE0Rewu7YKzc1DhIqfL46LKveFrmu9XbDazNOJY7/GRuvw1h6u3utWnR29H/p5JPlgA=="], - - "@tailwindcss/oxide-android-arm64": ["@tailwindcss/oxide-android-arm64@4.3.1", "", { "os": "android", "cpu": "arm64" }, "sha512-SVlyf61g374l5cHyg8x9kf5xmLcOaxvOTsbsqDnSsDJaKOEFZ7GCvi84VAVGpxojYOs1+3K6M0UjXfqPU8vmOQ=="], - - "@tailwindcss/oxide-darwin-arm64": ["@tailwindcss/oxide-darwin-arm64@4.3.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-hVnWLwv+e/l7c4WKyVtHVrIPvYdqWHjRB3MDIqARynzFtnQg85kmQEFCbV9Ja0VVx4xXTIiDWY60Y7iz/iNoDA=="], - - "@tailwindcss/oxide-darwin-x64": ["@tailwindcss/oxide-darwin-x64@4.3.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-Cf7abu0WVgbhU7ANgPUnSAvm7nCvMweusHb8FnaHlLfv/Caq4GYaEZg7ZImzzmjx4lIAfuS8q+eLIS7A7IzxIg=="], - - "@tailwindcss/oxide-freebsd-x64": ["@tailwindcss/oxide-freebsd-x64@4.3.1", "", { "os": "freebsd", "cpu": "x64" }, "sha512-ZZqzX2Y+GXtXXfqSfpJhDm60OoZfvLHLCgm+J7NVqgHHJjG/m9ugZI77RwTsVd4fnBJuCFP6Ae6kTJb71UdS8g=="], - - "@tailwindcss/oxide-linux-arm-gnueabihf": ["@tailwindcss/oxide-linux-arm-gnueabihf@4.3.1", "", { "os": "linux", "cpu": "arm" }, "sha512-/Ah/xik0LaMYfv9DZ0S/t4pBlBNYOcqtRwusjgovHkvT8ixueWCLyJjsaF5kQIckjb4IT8Q6K6p/iPmZMixYgg=="], - - "@tailwindcss/oxide-linux-arm64-gnu": ["@tailwindcss/oxide-linux-arm64-gnu@4.3.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-gqdFoVJlw444GvpnheZLHmvTzSxI/cOUUh2KSNejQjTcYkW062SVD+En0rUgD+QV91bz1XGIGtt1HJd48xUGbQ=="], - - "@tailwindcss/oxide-linux-arm64-musl": ["@tailwindcss/oxide-linux-arm64-musl@4.3.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-Bwv9KwOvE0VKa86xPFif9b9c3Y1NxOV1P0gLti/IYaWEsQYZXDlxfGEtA8mdDZ7SG3wyNXAWYT5SIn3giL57oA=="], - - "@tailwindcss/oxide-linux-x64-gnu": ["@tailwindcss/oxide-linux-x64-gnu@4.3.1", "", { "os": "linux", "cpu": "x64" }, "sha512-Ymi8O8T15HYQdOUWUtTI6ldN0neHP85FC+Qz32xTcZ7iJXtem/x8ITev0o1e9e5rkqj4lONZfTRLvkmin1+tKg=="], - - "@tailwindcss/oxide-linux-x64-musl": ["@tailwindcss/oxide-linux-x64-musl@4.3.1", "", { "os": "linux", "cpu": "x64" }, "sha512-M+P/91qJ6uILLw4k2G93GMDRAXj61SMvFQYt39AqvUqYgExXpLL5aepfns7sj4HiAQeolirQF9E0lzRvdf4zPQ=="], - - "@tailwindcss/oxide-wasm32-wasi": ["@tailwindcss/oxide-wasm32-wasi@4.3.1", "", { "dependencies": { "@emnapi/core": "^1.10.0", "@emnapi/runtime": "^1.10.0", "@emnapi/wasi-threads": "^1.2.1", "@napi-rs/wasm-runtime": "^1.1.4", "@tybys/wasm-util": "^0.10.2", "tslib": "^2.8.1" }, "cpu": "none" }, "sha512-zsM8uOeqvVGHsAXsJxsT28ttosFahLJKCLOTUBqRAtKnVgGSRitds9T432QiT8b77Yga7JIBkulIRRlJPtYhRA=="], - - "@tailwindcss/oxide-win32-arm64-msvc": ["@tailwindcss/oxide-win32-arm64-msvc@4.3.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-aiNvSq9BsVk8V513lDKlrCFAgf8qBMPZTpgEhInL+NwQqs97mYmupVMrPrgBBSL8Pv/0zXu9MrMF9rMun1ZeNg=="], - - "@tailwindcss/oxide-win32-x64-msvc": ["@tailwindcss/oxide-win32-x64-msvc@4.3.1", "", { "os": "win32", "cpu": "x64" }, "sha512-xDEyu1rg290472FEGaKHnzyDyh5QH+AlWvsU5hMoMtPpzmKlRI0jaYKCgSHDYtaQWZOYbMaduSyCwFwY4n1HmA=="], - - "@tailwindcss/vite": ["@tailwindcss/vite@4.3.1", "", { "dependencies": { "@tailwindcss/node": "4.3.1", "@tailwindcss/oxide": "4.3.1", "tailwindcss": "4.3.1" }, "peerDependencies": { "vite": "^5.2.0 || ^6 || ^7 || ^8" } }, "sha512-hItDHuIIlEV61R+faXu66s1K36aTurO/Qw0e45Vskz57gXl9pWOT6eg3zmcEui6CZXddbN7zd41bwmvag4JGwQ=="], - - "@ts-morph/common": ["@ts-morph/common@0.27.0", "", { "dependencies": { "fast-glob": "^3.3.3", "minimatch": "^10.0.1", "path-browserify": "^1.0.1" } }, "sha512-Wf29UqxWDpc+i61k3oIOzcUfQt79PIT9y/MWfAGlrkjg6lBC1hwDECLXPVJAhWjiGbfBCxZd65F/LIZF3+jeJQ=="], - - "@tweenjs/tween.js": ["@tweenjs/tween.js@23.1.3", "", {}, "sha512-vJmvvwFxYuGnF2axRtPYocag6Clbb5YS7kLL+SO/TeVFzHqDIWrNKYtcsPMibjDx9O+bu+psAy9NKfWklassUA=="], - - "@tybys/wasm-util": ["@tybys/wasm-util@0.10.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg=="], - - "@types/debug": ["@types/debug@4.1.13", "", { "dependencies": { "@types/ms": "*" } }, "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw=="], - - "@types/draco3d": ["@types/draco3d@1.4.10", "", {}, "sha512-AX22jp8Y7wwaBgAixaSvkoG4M/+PlAcm3Qs4OW8yT9DM4xUpWKeFhLueTAyZF39pviAdcDdeJoACapiAceqNcw=="], - - "@types/estree": ["@types/estree@1.0.9", "", {}, "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg=="], - - "@types/estree-jsx": ["@types/estree-jsx@1.0.5", "", { "dependencies": { "@types/estree": "*" } }, "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg=="], - - "@types/hast": ["@types/hast@3.0.4", "", { "dependencies": { "@types/unist": "*" } }, "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ=="], - - "@types/mdast": ["@types/mdast@4.0.4", "", { "dependencies": { "@types/unist": "*" } }, "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA=="], - - "@types/ms": ["@types/ms@2.1.0", "", {}, "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA=="], - - "@types/node": ["@types/node@24.13.2", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-fRa09kZTgu8o71KFcDjUFuc7F+dEbZYZmkI0mg5YBTRs0yMKjYHsq/c0urDKeDb+D5qVgXOdFcuu+DZPKOITwA=="], - - "@types/offscreencanvas": ["@types/offscreencanvas@2019.7.3", "", {}, "sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A=="], - - "@types/react": ["@types/react@19.2.17", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw=="], - - "@types/react-dom": ["@types/react-dom@19.2.3", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ=="], - - "@types/react-reconciler": ["@types/react-reconciler@0.28.9", "", { "peerDependencies": { "@types/react": "*" } }, "sha512-HHM3nxyUZ3zAylX8ZEyrDNd2XZOnQ0D5XfunJF5FLQnZbHHYq4UWvW1QfelQNXv1ICNkwYhfxjwfnqivYB6bFg=="], - - "@types/stats.js": ["@types/stats.js@0.17.4", "", {}, "sha512-jIBvWWShCvlBqBNIZt0KAshWpvSjhkwkEu4ZUcASoAvhmrgAUI2t1dXrjSL4xXVLB4FznPrIsX3nKXFl/Dt4vA=="], - - "@types/three": ["@types/three@0.184.1", "", { "dependencies": { "@dimforge/rapier3d-compat": "~0.12.0", "@tweenjs/tween.js": "~23.1.3", "@types/stats.js": "*", "@types/webxr": ">=0.5.17", "fflate": "~0.8.2", "meshoptimizer": "~1.1.1" } }, "sha512-6q4VdiqVsrTRqmk62/BnlcAvIrnDM0zf2ZDVKI5kZiniWrSaOHaQzmbp+BNzoggc/8tgW412pL//wZIxu2PPTA=="], - - "@types/unist": ["@types/unist@3.0.3", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="], - - "@types/validate-npm-package-name": ["@types/validate-npm-package-name@4.0.2", "", {}, "sha512-lrpDziQipxCEeK5kWxvljWYhUvOiB2A9izZd9B2AFarYAkqZshb4lPbRs7zKEic6eGtH8V/2qJW+dPp9OtF6bw=="], - - "@types/webxr": ["@types/webxr@0.5.24", "", {}, "sha512-h8fgEd/DpoS9CBrjEQXR+dIDraopAEfu4wYVNY2tEPwk60stPWhvZMf4Foo5FakuQ7HFZoa8WceaWFervK2Ovg=="], - - "@ungap/structured-clone": ["@ungap/structured-clone@1.3.2", "", {}, "sha512-5jsZFwgR5rTdKwidH9Qmat75RKwqfpKlWWB1frDkljN127mwqBu8K0PYo7/hFpF03IEJpfVPpCQDY/eDx3iHvA=="], - - "@use-gesture/core": ["@use-gesture/core@10.3.1", "", {}, "sha512-WcINiDt8WjqBdUXye25anHiNxPc0VOrlT8F6LLkU6cycrOGUDyY/yyFmsg3k8i5OLvv25llc0QC45GhR/C8llw=="], - - "@use-gesture/react": ["@use-gesture/react@10.3.1", "", { "dependencies": { "@use-gesture/core": "10.3.1" }, "peerDependencies": { "react": ">= 16.8.0" } }, "sha512-Yy19y6O2GJq8f7CHf7L0nxL8bf4PZCPaVOCgJrusOeFHY1LvHgYXnmnXg6N5iwAnbgbZCDjo60SiM6IPJi9C5g=="], - - "@vitejs/plugin-react": ["@vitejs/plugin-react@6.0.3", "", { "dependencies": { "@rolldown/pluginutils": "^1.0.1" }, "peerDependencies": { "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", "babel-plugin-react-compiler": "^1.0.0", "vite": "^8.0.0" }, "optionalPeers": ["@rolldown/plugin-babel", "babel-plugin-react-compiler"] }, "sha512-vmFvco5/QuC2f9Oj+wTk0+9XeDFkHxSamwZKYc7MxYwKICfvUvlMhqKI0VuICPltGqh1neqBKDvO4kes1ya8vg=="], - - "accepts": ["accepts@2.0.0", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="], - - "adm-zip": ["adm-zip@0.5.17", "", {}, "sha512-+Ut8d9LLqwEvHHJl1+PIHqoyDxFgVN847JTVM3Izi3xHDWPE4UtzzXysMZQs64DMcrJfBeS/uoEP4AD3HQHnQQ=="], - - "ajv": ["ajv@8.20.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA=="], - - "ajv-formats": ["ajv-formats@3.0.1", "", { "dependencies": { "ajv": "^8.0.0" } }, "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ=="], - - "ansi-colors": ["ansi-colors@4.1.3", "", {}, "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw=="], - - "ansi-regex": ["ansi-regex@6.2.2", "", {}, "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="], - - "argparse": ["argparse@2.0.1", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="], - - "aria-hidden": ["aria-hidden@1.2.6", "", { "dependencies": { "tslib": "^2.0.0" } }, "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA=="], - - "ast-types": ["ast-types@0.16.1", "", { "dependencies": { "tslib": "^2.0.1" } }, "sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg=="], - - "atomically": ["atomically@1.7.0", "", {}, "sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w=="], - - "bail": ["bail@2.0.2", "", {}, "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw=="], - - "balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="], - - "base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="], - - "baseline-browser-mapping": ["baseline-browser-mapping@2.10.40", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-BSSLZ9/Cjjv7Gtj5B68ZzXcXUg8iOf3fme+FCuh8rC/Go+Kmh8cox7M3A8dolou16s64QjLPOSdngh7GxXvkSw=="], - - "bidi-js": ["bidi-js@1.0.3", "", { "dependencies": { "require-from-string": "^2.0.2" } }, "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw=="], - - "body-parser": ["body-parser@2.3.0", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^2.0.0", "debug": "^4.4.3", "http-errors": "^2.0.1", "iconv-lite": "^0.7.2", "on-finished": "^2.4.1", "qs": "^6.15.2", "raw-body": "^3.0.2", "type-is": "^2.1.0" } }, "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw=="], - - "boolean": ["boolean@3.2.0", "", {}, "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw=="], - - "brace-expansion": ["brace-expansion@5.0.6", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g=="], - - "braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="], - - "browserslist": ["browserslist@4.28.4", "", { "dependencies": { "baseline-browser-mapping": "^2.10.38", "caniuse-lite": "^1.0.30001799", "electron-to-chromium": "^1.5.376", "node-releases": "^2.0.48", "update-browserslist-db": "^1.2.3" }, "bin": { "browserslist": "cli.js" } }, "sha512-MTc8i/x9jBQd1iMw2CFGS+rwMa07eYjLR0CCTLDACl9xhxy+nIs3KeML/biicXtk9JrZ6dnnTatmc7ErPXIxqw=="], - - "buffer": ["buffer@6.0.3", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA=="], - - "bundle-name": ["bundle-name@4.1.0", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q=="], - - "bytes": ["bytes@3.1.2", "", {}, "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="], - - "call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="], - - "call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="], - - "callsites": ["callsites@3.1.0", "", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="], - - "camera-controls": ["camera-controls@3.1.2", "", { "peerDependencies": { "three": ">=0.126.1" } }, "sha512-xkxfpG2ECZ6Ww5/9+kf4mfg1VEYAoe9aDSY+IwF0UEs7qEzwy0aVRfs2grImIECs/PoBtWFrh7RXsQkwG922JA=="], - - "caniuse-lite": ["caniuse-lite@1.0.30001799", "", {}, "sha512-hG1bReV+OUU+MOqK4t/ZWI0tZOyz3rqS9XuhOUz1cIcbwBKjOyJEJuw9ER5JuNyqxNk8u/JUVbGibBOL1yrjFw=="], - - "ccount": ["ccount@2.0.1", "", {}, "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg=="], - - "chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="], - - "character-entities": ["character-entities@2.0.2", "", {}, "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ=="], - - "character-entities-html4": ["character-entities-html4@2.1.0", "", {}, "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA=="], - - "character-entities-legacy": ["character-entities-legacy@3.0.0", "", {}, "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ=="], - - "character-reference-invalid": ["character-reference-invalid@2.0.1", "", {}, "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw=="], - - "chownr": ["chownr@3.0.0", "", {}, "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g=="], - - "class-variance-authority": ["class-variance-authority@0.7.1", "", { "dependencies": { "clsx": "^2.1.1" } }, "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg=="], - - "cli-cursor": ["cli-cursor@5.0.0", "", { "dependencies": { "restore-cursor": "^5.0.0" } }, "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw=="], - - "cli-spinners": ["cli-spinners@2.9.2", "", {}, "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg=="], - - "clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="], - - "code-block-writer": ["code-block-writer@13.0.3", "", {}, "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg=="], - - "comma-separated-tokens": ["comma-separated-tokens@2.0.3", "", {}, "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg=="], - - "commander": ["commander@14.0.3", "", {}, "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw=="], - - "conf": ["conf@10.2.0", "", { "dependencies": { "ajv": "^8.6.3", "ajv-formats": "^2.1.1", "atomically": "^1.7.0", "debounce-fn": "^4.0.0", "dot-prop": "^6.0.1", "env-paths": "^2.2.1", "json-schema-typed": "^7.0.3", "onetime": "^5.1.2", "pkg-up": "^3.1.0", "semver": "^7.3.5" } }, "sha512-8fLl9F04EJqjSqH+QjITQfJF8BrOVaYr1jewVgSRAEWePfxT0sku4w2hrGQ60BC/TNLGQ2pgxNlTbWQmMPFvXg=="], - - "content-disposition": ["content-disposition@1.1.0", "", {}, "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g=="], - - "content-type": ["content-type@1.0.5", "", {}, "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA=="], - - "convert-source-map": ["convert-source-map@2.0.0", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="], - - "cookie": ["cookie@0.7.2", "", {}, "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w=="], - - "cookie-signature": ["cookie-signature@1.2.2", "", {}, "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg=="], - - "cors": ["cors@2.8.6", "", { "dependencies": { "object-assign": "^4", "vary": "^1" } }, "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw=="], - - "cosmiconfig": ["cosmiconfig@9.0.2", "", { "dependencies": { "env-paths": "^2.2.1", "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", "parse-json": "^5.2.0" }, "peerDependencies": { "typescript": ">=4.9.5" }, "optionalPeers": ["typescript"] }, "sha512-gtTZxTDau1wL7Y7zifc2dd8jHSK/k6BTx/2Xp/BpdlAdnlYWFVt7qhJqgwi7637yRwRQ3qL4ZidbB4I8tA5VOg=="], - - "cross-env": ["cross-env@7.0.3", "", { "dependencies": { "cross-spawn": "^7.0.1" }, "bin": { "cross-env": "src/bin/cross-env.js", "cross-env-shell": "src/bin/cross-env-shell.js" } }, "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw=="], - - "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], - - "cssesc": ["cssesc@3.0.0", "", { "bin": { "cssesc": "bin/cssesc" } }, "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg=="], - - "csstype": ["csstype@3.2.3", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="], - - "culori": ["culori@4.0.2", "", {}, "sha512-1+BhOB8ahCn4O0cep0Sh2l9KCOfOdY+BXJnKMHFFzDEouSr/el18QwXEMRlOj9UY5nCeA8UN3a/82rUWRBeyBw=="], - - "debounce-fn": ["debounce-fn@4.0.0", "", { "dependencies": { "mimic-fn": "^3.0.0" } }, "sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ=="], - - "debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], - - "decode-named-character-reference": ["decode-named-character-reference@1.3.0", "", { "dependencies": { "character-entities": "^2.0.0" } }, "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q=="], - - "dedent": ["dedent@1.7.2", "", { "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, "optionalPeers": ["babel-plugin-macros"] }, "sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA=="], - - "deepmerge": ["deepmerge@4.3.1", "", {}, "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="], - - "default-browser": ["default-browser@5.5.0", "", { "dependencies": { "bundle-name": "^4.1.0", "default-browser-id": "^5.0.0" } }, "sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw=="], - - "default-browser-id": ["default-browser-id@5.0.1", "", {}, "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q=="], - - "define-data-property": ["define-data-property@1.1.4", "", { "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "gopd": "^1.0.1" } }, "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A=="], - - "define-lazy-prop": ["define-lazy-prop@3.0.0", "", {}, "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg=="], - - "define-properties": ["define-properties@1.2.1", "", { "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } }, "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg=="], - - "depd": ["depd@2.0.0", "", {}, "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="], - - "dequal": ["dequal@2.0.3", "", {}, "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA=="], - - "detect-gpu": ["detect-gpu@5.0.70", "", { "dependencies": { "webgl-constants": "^1.1.1" } }, "sha512-bqerEP1Ese6nt3rFkwPnGbsUF9a4q+gMmpTVVOEzoCyeCc+y7/RvJnQZJx1JwhgQI5Ntg0Kgat8Uu7XpBqnz1w=="], - - "detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], - - "detect-node": ["detect-node@2.1.0", "", {}, "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g=="], - - "detect-node-es": ["detect-node-es@1.1.0", "", {}, "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ=="], - - "devlop": ["devlop@1.1.0", "", { "dependencies": { "dequal": "^2.0.0" } }, "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA=="], - - "diff": ["diff@8.0.4", "", {}, "sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw=="], - - "dot-prop": ["dot-prop@6.0.1", "", { "dependencies": { "is-obj": "^2.0.0" } }, "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA=="], - - "dotenv": ["dotenv@17.4.2", "", {}, "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw=="], - - "draco3d": ["draco3d@1.5.7", "", {}, "sha512-m6WCKt/erDXcw+70IJXnG7M3awwQPAsZvJGX5zY7beBqpELw6RDGkYVU0W43AFxye4pDZ5i2Lbyc/NNGqwjUVQ=="], - - "dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="], - - "ee-first": ["ee-first@1.1.1", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="], - - "electron-to-chromium": ["electron-to-chromium@1.5.380", "", {}, "sha512-W6d5AbuEoRayO447cqrg6lKJIlscgRnnxOZl/08kfV71BQDoEBC7Wwis68z87LjyK6f4kWyTaubuDbhHKrZkbA=="], - - "emoji-regex": ["emoji-regex@10.6.0", "", {}, "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A=="], - - "encodeurl": ["encodeurl@2.0.0", "", {}, "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="], - - "enhanced-resolve": ["enhanced-resolve@5.21.6", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.3.3" } }, "sha512-aNnGCvbJ/RIyWo1IuhNdVjnNF+EjH9wpzpNHt+ci/m9He9LJvUN8wrCcXjp9cWsGNAuvSpVFTx/vraAFQ8qGjQ=="], - - "enquirer": ["enquirer@2.4.1", "", { "dependencies": { "ansi-colors": "^4.1.1", "strip-ansi": "^6.0.1" } }, "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ=="], - - "env-paths": ["env-paths@2.2.1", "", {}, "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A=="], - - "error-ex": ["error-ex@1.3.4", "", { "dependencies": { "is-arrayish": "^0.2.1" } }, "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ=="], - - "es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="], - - "es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="], - - "es-object-atoms": ["es-object-atoms@1.1.2", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw=="], - - "es6-error": ["es6-error@4.1.1", "", {}, "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg=="], - - "escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="], - - "escape-html": ["escape-html@1.0.3", "", {}, "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="], - - "escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="], - - "esprima": ["esprima@4.0.1", "", { "bin": { "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" } }, "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="], - - "estree-util-is-identifier-name": ["estree-util-is-identifier-name@3.0.0", "", {}, "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg=="], - - "etag": ["etag@1.8.1", "", {}, "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="], - - "eventsource": ["eventsource@3.0.7", "", { "dependencies": { "eventsource-parser": "^3.0.1" } }, "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA=="], - - "eventsource-parser": ["eventsource-parser@3.1.0", "", {}, "sha512-kJezFj9YFAMLeORyi7aCLxLbD5/qWMQnoMVlVPyHIll7lgRJCc3JVln9Vgl9nwQi0YkMnhdGTMNn7CkRRAptMg=="], - - "execa": ["execa@9.6.1", "", { "dependencies": { "@sindresorhus/merge-streams": "^4.0.0", "cross-spawn": "^7.0.6", "figures": "^6.1.0", "get-stream": "^9.0.0", "human-signals": "^8.0.1", "is-plain-obj": "^4.1.0", "is-stream": "^4.0.1", "npm-run-path": "^6.0.0", "pretty-ms": "^9.2.0", "signal-exit": "^4.1.0", "strip-final-newline": "^4.0.0", "yoctocolors": "^2.1.1" } }, "sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA=="], - - "express": ["express@5.2.1", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "depd": "^2.0.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw=="], - - "express-rate-limit": ["express-rate-limit@8.5.2", "", { "dependencies": { "ip-address": "^10.2.0" }, "peerDependencies": { "express": ">= 4.11" } }, "sha512-5Kb34ipNX694DH48vN9irak1Qx30nb0PLYHXfJgw4YEjiC3ZEmZJhwOp+VfiCYwFzvFTdB9QkArYS5kXa2cx2A=="], - - "extend": ["extend@3.0.2", "", {}, "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="], - - "fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="], - - "fast-glob": ["fast-glob@3.3.3", "", { "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.8" } }, "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg=="], - - "fast-uri": ["fast-uri@3.1.2", "", {}, "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ=="], - - "fastq": ["fastq@1.20.1", "", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw=="], - - "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], - - "fflate": ["fflate@0.8.3", "", {}, "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA=="], - - "figures": ["figures@6.1.0", "", { "dependencies": { "is-unicode-supported": "^2.0.0" } }, "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg=="], - - "fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="], - - "finalhandler": ["finalhandler@2.1.1", "", { "dependencies": { "debug": "^4.4.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "on-finished": "^2.4.1", "parseurl": "^1.3.3", "statuses": "^2.0.1" } }, "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA=="], - - "find-up": ["find-up@3.0.0", "", { "dependencies": { "locate-path": "^3.0.0" } }, "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg=="], - - "flatbuffers": ["flatbuffers@25.9.23", "", {}, "sha512-MI1qs7Lo4Syw0EOzUl0xjs2lsoeqFku44KpngfIduHBYvzm8h2+7K8YMQh1JtVVVrUvhLpNwqVi4DERegUJhPQ=="], - - "forwarded": ["forwarded@0.2.0", "", {}, "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="], - - "fresh": ["fresh@2.0.0", "", {}, "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A=="], - - "fs-extra": ["fs-extra@11.3.5", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-eKpRKAovdpZtR1WopLHxlBWvAgPny3c4gX1G5Jhwmmw4XJj0ifSD5qB5TOo8hmA0wlRKDAOAhEE1yVPgs6Fgcg=="], - - "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], - - "function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="], - - "fuzzysort": ["fuzzysort@3.1.0", "", {}, "sha512-sR9BNCjBg6LNgwvxlBd0sBABvQitkLzoVY9MYYROQVX/FvfJ4Mai9LsGhDgd8qYdds0bY77VzYd5iuB+v5rwQQ=="], - - "gensync": ["gensync@1.0.0-beta.2", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="], - - "get-east-asian-width": ["get-east-asian-width@1.6.0", "", {}, "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA=="], - - "get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="], - - "get-nonce": ["get-nonce@1.0.1", "", {}, "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q=="], - - "get-own-enumerable-keys": ["get-own-enumerable-keys@1.0.0", "", {}, "sha512-PKsK2FSrQCyxcGHsGrLDcK0lx+0Ke+6e8KFFozA9/fIQLhQzPaRvJFdcz7+Axg3jUH/Mq+NI4xa5u/UT2tQskA=="], - - "get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="], - - "get-stream": ["get-stream@9.0.1", "", { "dependencies": { "@sec-ant/readable-stream": "^0.4.1", "is-stream": "^4.0.1" } }, "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA=="], - - "glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], - - "global-agent": ["global-agent@3.0.0", "", { "dependencies": { "boolean": "^3.0.1", "es6-error": "^4.1.1", "matcher": "^3.0.0", "roarr": "^2.15.3", "semver": "^7.3.2", "serialize-error": "^7.0.1" } }, "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q=="], - - "globalthis": ["globalthis@1.0.4", "", { "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" } }, "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ=="], - - "glsl-noise": ["glsl-noise@0.0.0", "", {}, "sha512-b/ZCF6amfAUb7dJM/MxRs7AetQEahYzJ8PtgfrmEdtw6uyGOr+ZSGtgjFm6mfsBkxJ4d2W7kg+Nlqzqvn3Bc0w=="], - - "gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="], - - "graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="], - - "guid-typescript": ["guid-typescript@1.0.9", "", {}, "sha512-Y8T4vYhEfwJOTbouREvG+3XDsjr8E3kIr7uf+JZ0BYloFsttiHU0WfvANVsR7TxNUJa/WpCnw/Ino/p+DeBhBQ=="], - - "has-property-descriptors": ["has-property-descriptors@1.0.2", "", { "dependencies": { "es-define-property": "^1.0.0" } }, "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg=="], - - "has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="], - - "hasown": ["hasown@2.0.4", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A=="], - - "hast-util-to-jsx-runtime": ["hast-util-to-jsx-runtime@2.3.6", "", { "dependencies": { "@types/estree": "^1.0.0", "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", "comma-separated-tokens": "^2.0.0", "devlop": "^1.0.0", "estree-util-is-identifier-name": "^3.0.0", "hast-util-whitespace": "^3.0.0", "mdast-util-mdx-expression": "^2.0.0", "mdast-util-mdx-jsx": "^3.0.0", "mdast-util-mdxjs-esm": "^2.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0", "style-to-js": "^1.0.0", "unist-util-position": "^5.0.0", "vfile-message": "^4.0.0" } }, "sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg=="], - - "hast-util-whitespace": ["hast-util-whitespace@3.0.0", "", { "dependencies": { "@types/hast": "^3.0.0" } }, "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw=="], - - "hls.js": ["hls.js@1.6.16", "", {}, "sha512-VSIRpLfRwlAAdGL4wiTucx2ScRipo0ed1FBatWkyt832jC4CReKstga6yIhYVwGu9LOBjuX9wzmRMeQdBJtzEA=="], - - "hono": ["hono@4.12.27", "", {}, "sha512-1yrb/+w6HWQJrUCLkJ2IF5jNIPvvFkblV5RNOYl6bV+OA6p9GLcMpHFFGTosSvHvcAUibuUukRqhlYI4z32C7Q=="], - - "html-url-attributes": ["html-url-attributes@3.0.1", "", {}, "sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ=="], - - "http-errors": ["http-errors@2.0.1", "", { "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", "setprototypeof": "~1.2.0", "statuses": "~2.0.2", "toidentifier": "~1.0.1" } }, "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ=="], - - "human-signals": ["human-signals@8.0.1", "", {}, "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ=="], - - "iconv-lite": ["iconv-lite@0.7.2", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw=="], - - "ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="], - - "ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="], - - "immediate": ["immediate@3.0.6", "", {}, "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ=="], - - "import-fresh": ["import-fresh@3.3.1", "", { "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ=="], - - "inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="], - - "inline-style-parser": ["inline-style-parser@0.2.7", "", {}, "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA=="], - - "ip-address": ["ip-address@10.2.0", "", {}, "sha512-/+S6j4E9AHvW9SWMSEY9Xfy66O5PWvVEJ08O0y5JGyEKQpojb0K0GKpz/v5HJ/G0vi3D2sjGK78119oXZeE0qA=="], - - "ipaddr.js": ["ipaddr.js@1.9.1", "", {}, "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="], - - "is-alphabetical": ["is-alphabetical@2.0.1", "", {}, "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ=="], - - "is-alphanumerical": ["is-alphanumerical@2.0.1", "", { "dependencies": { "is-alphabetical": "^2.0.0", "is-decimal": "^2.0.0" } }, "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw=="], - - "is-arrayish": ["is-arrayish@0.2.1", "", {}, "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="], - - "is-decimal": ["is-decimal@2.0.1", "", {}, "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A=="], - - "is-docker": ["is-docker@2.2.1", "", { "bin": { "is-docker": "cli.js" } }, "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ=="], - - "is-extglob": ["is-extglob@2.1.1", "", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="], - - "is-glob": ["is-glob@4.0.3", "", { "dependencies": { "is-extglob": "^2.1.1" } }, "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg=="], - - "is-hexadecimal": ["is-hexadecimal@2.0.1", "", {}, "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg=="], - - "is-in-ssh": ["is-in-ssh@1.0.0", "", {}, "sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw=="], - - "is-inside-container": ["is-inside-container@1.0.0", "", { "dependencies": { "is-docker": "^3.0.0" }, "bin": { "is-inside-container": "cli.js" } }, "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA=="], - - "is-interactive": ["is-interactive@2.0.0", "", {}, "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ=="], - - "is-number": ["is-number@7.0.0", "", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="], - - "is-obj": ["is-obj@3.0.0", "", {}, "sha512-IlsXEHOjtKhpN8r/tRFj2nDyTmHvcfNeu/nrRIcXE17ROeatXchkojffa1SpdqW4cr/Fj6QkEf/Gn4zf6KKvEQ=="], - - "is-plain-obj": ["is-plain-obj@4.1.0", "", {}, "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg=="], - - "is-promise": ["is-promise@2.2.2", "", {}, "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="], - - "is-regexp": ["is-regexp@3.1.0", "", {}, "sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA=="], - - "is-stream": ["is-stream@4.0.1", "", {}, "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A=="], - - "is-unicode-supported": ["is-unicode-supported@2.1.0", "", {}, "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ=="], - - "is-wsl": ["is-wsl@2.2.0", "", { "dependencies": { "is-docker": "^2.0.0" } }, "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww=="], - - "isexe": ["isexe@3.1.5", "", {}, "sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w=="], - - "its-fine": ["its-fine@2.0.0", "", { "dependencies": { "@types/react-reconciler": "^0.28.9" }, "peerDependencies": { "react": "^19.0.0" } }, "sha512-KLViCmWx94zOvpLwSlsx6yOCeMhZYaxrJV87Po5k/FoZzcPSahvK5qJ7fYhS61sZi5ikmh2S3Hz55A2l3U69ng=="], - - "jiti": ["jiti@2.7.0", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ=="], - - "jose": ["jose@6.2.3", "", {}, "sha512-YYVDInQKFJfR/xa3ojUTl8c2KoTwiL1R5Wg9YCydwH0x0B9grbzlg5HC7mMjCtUJjbQ/YnGEZIhI5tCgfTb4Hw=="], - - "js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], - - "js-yaml": ["js-yaml@4.3.0", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q=="], - - "jsesc": ["jsesc@3.1.0", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="], - - "json-parse-even-better-errors": ["json-parse-even-better-errors@2.3.1", "", {}, "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="], - - "json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="], - - "json-schema-typed": ["json-schema-typed@8.0.2", "", {}, "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA=="], - - "json-stringify-safe": ["json-stringify-safe@5.0.1", "", {}, "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA=="], - - "json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="], - - "jsonfile": ["jsonfile@6.2.1", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q=="], - - "kleur": ["kleur@4.1.5", "", {}, "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ=="], - - "kokoro-js": ["kokoro-js@1.2.1", "", { "dependencies": { "@huggingface/transformers": "^3.5.1", "phonemizer": "^1.2.1" } }, "sha512-oq0HZJWis3t8lERkMJh84WLU86dpYD0EuBPtqYnLlQzyFP1OkyBRDcweAqCfhNOpltyN9j/azp1H6uuC47gShw=="], - - "lie": ["lie@3.3.0", "", { "dependencies": { "immediate": "~3.0.5" } }, "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ=="], - - "lightningcss": ["lightningcss@1.32.0", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.32.0", "lightningcss-darwin-arm64": "1.32.0", "lightningcss-darwin-x64": "1.32.0", "lightningcss-freebsd-x64": "1.32.0", "lightningcss-linux-arm-gnueabihf": "1.32.0", "lightningcss-linux-arm64-gnu": "1.32.0", "lightningcss-linux-arm64-musl": "1.32.0", "lightningcss-linux-x64-gnu": "1.32.0", "lightningcss-linux-x64-musl": "1.32.0", "lightningcss-win32-arm64-msvc": "1.32.0", "lightningcss-win32-x64-msvc": "1.32.0" } }, "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ=="], - - "lightningcss-android-arm64": ["lightningcss-android-arm64@1.32.0", "", { "os": "android", "cpu": "arm64" }, "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg=="], - - "lightningcss-darwin-arm64": ["lightningcss-darwin-arm64@1.32.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ=="], - - "lightningcss-darwin-x64": ["lightningcss-darwin-x64@1.32.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w=="], - - "lightningcss-freebsd-x64": ["lightningcss-freebsd-x64@1.32.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig=="], - - "lightningcss-linux-arm-gnueabihf": ["lightningcss-linux-arm-gnueabihf@1.32.0", "", { "os": "linux", "cpu": "arm" }, "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw=="], - - "lightningcss-linux-arm64-gnu": ["lightningcss-linux-arm64-gnu@1.32.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ=="], - - "lightningcss-linux-arm64-musl": ["lightningcss-linux-arm64-musl@1.32.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg=="], - - "lightningcss-linux-x64-gnu": ["lightningcss-linux-x64-gnu@1.32.0", "", { "os": "linux", "cpu": "x64" }, "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA=="], - - "lightningcss-linux-x64-musl": ["lightningcss-linux-x64-musl@1.32.0", "", { "os": "linux", "cpu": "x64" }, "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg=="], - - "lightningcss-win32-arm64-msvc": ["lightningcss-win32-arm64-msvc@1.32.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw=="], - - "lightningcss-win32-x64-msvc": ["lightningcss-win32-x64-msvc@1.32.0", "", { "os": "win32", "cpu": "x64" }, "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q=="], - - "lines-and-columns": ["lines-and-columns@1.2.4", "", {}, "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="], - - "locate-path": ["locate-path@3.0.0", "", { "dependencies": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" } }, "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A=="], - - "log-symbols": ["log-symbols@6.0.0", "", { "dependencies": { "chalk": "^5.3.0", "is-unicode-supported": "^1.3.0" } }, "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw=="], - - "long": ["long@5.3.2", "", {}, "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA=="], - - "longest-streak": ["longest-streak@3.1.0", "", {}, "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g=="], - - "lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], - - "lucide-react": ["lucide-react@1.21.0", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-reEZMXq8Qdd5jg5XYkQ5TR1fB/GiQ7ih4vcrthYDtgjSDwh0i6/YLiGjsWsIwgN49gpAnd4J2elSNzncMEEUUQ=="], - - "maath": ["maath@0.10.8", "", { "peerDependencies": { "@types/three": ">=0.134.0", "three": ">=0.134.0" } }, "sha512-tRvbDF0Pgqz+9XUa4jjfgAQ8/aPKmQdWXilFu2tMy4GWj4NOsx99HlULO4IeREfbO3a0sA145DZYyvXPkybm0g=="], - - "magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="], - - "markdown-table": ["markdown-table@3.0.4", "", {}, "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw=="], - - "matcher": ["matcher@3.0.0", "", { "dependencies": { "escape-string-regexp": "^4.0.0" } }, "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng=="], - - "math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="], - - "mdast-util-find-and-replace": ["mdast-util-find-and-replace@3.0.2", "", { "dependencies": { "@types/mdast": "^4.0.0", "escape-string-regexp": "^5.0.0", "unist-util-is": "^6.0.0", "unist-util-visit-parents": "^6.0.0" } }, "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg=="], - - "mdast-util-from-markdown": ["mdast-util-from-markdown@2.0.3", "", { "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "mdast-util-to-string": "^4.0.0", "micromark": "^4.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-decode-string": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0", "unist-util-stringify-position": "^4.0.0" } }, "sha512-W4mAWTvSlKvf8L6J+VN9yLSqQ9AOAAvHuoDAmPkz4dHf553m5gVj2ejadHJhoJmcmxEnOv6Pa8XJhpxE93kb8Q=="], - - "mdast-util-gfm": ["mdast-util-gfm@3.1.0", "", { "dependencies": { "mdast-util-from-markdown": "^2.0.0", "mdast-util-gfm-autolink-literal": "^2.0.0", "mdast-util-gfm-footnote": "^2.0.0", "mdast-util-gfm-strikethrough": "^2.0.0", "mdast-util-gfm-table": "^2.0.0", "mdast-util-gfm-task-list-item": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ=="], - - "mdast-util-gfm-autolink-literal": ["mdast-util-gfm-autolink-literal@2.0.1", "", { "dependencies": { "@types/mdast": "^4.0.0", "ccount": "^2.0.0", "devlop": "^1.0.0", "mdast-util-find-and-replace": "^3.0.0", "micromark-util-character": "^2.0.0" } }, "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ=="], - - "mdast-util-gfm-footnote": ["mdast-util-gfm-footnote@2.1.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.1.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0" } }, "sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ=="], - - "mdast-util-gfm-strikethrough": ["mdast-util-gfm-strikethrough@2.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg=="], - - "mdast-util-gfm-table": ["mdast-util-gfm-table@2.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "markdown-table": "^3.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg=="], - - "mdast-util-gfm-task-list-item": ["mdast-util-gfm-task-list-item@2.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ=="], - - "mdast-util-mdx-expression": ["mdast-util-mdx-expression@2.0.1", "", { "dependencies": { "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ=="], - - "mdast-util-mdx-jsx": ["mdast-util-mdx-jsx@3.2.0", "", { "dependencies": { "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", "ccount": "^2.0.0", "devlop": "^1.1.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0", "parse-entities": "^4.0.0", "stringify-entities": "^4.0.0", "unist-util-stringify-position": "^4.0.0", "vfile-message": "^4.0.0" } }, "sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q=="], - - "mdast-util-mdxjs-esm": ["mdast-util-mdxjs-esm@2.0.1", "", { "dependencies": { "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg=="], - - "mdast-util-phrasing": ["mdast-util-phrasing@4.1.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "unist-util-is": "^6.0.0" } }, "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w=="], - - "mdast-util-to-hast": ["mdast-util-to-hast@13.2.1", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "@ungap/structured-clone": "^1.0.0", "devlop": "^1.0.0", "micromark-util-sanitize-uri": "^2.0.0", "trim-lines": "^3.0.0", "unist-util-position": "^5.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0" } }, "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA=="], - - "mdast-util-to-markdown": ["mdast-util-to-markdown@2.1.2", "", { "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", "longest-streak": "^3.0.0", "mdast-util-phrasing": "^4.0.0", "mdast-util-to-string": "^4.0.0", "micromark-util-classify-character": "^2.0.0", "micromark-util-decode-string": "^2.0.0", "unist-util-visit": "^5.0.0", "zwitch": "^2.0.0" } }, "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA=="], - - "mdast-util-to-string": ["mdast-util-to-string@4.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0" } }, "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg=="], - - "media-typer": ["media-typer@1.1.0", "", {}, "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw=="], - - "merge-descriptors": ["merge-descriptors@2.0.0", "", {}, "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g=="], - - "merge-stream": ["merge-stream@2.0.0", "", {}, "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w=="], - - "merge2": ["merge2@1.4.1", "", {}, "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg=="], - - "meshline": ["meshline@3.3.1", "", { "peerDependencies": { "three": ">=0.137" } }, "sha512-/TQj+JdZkeSUOl5Mk2J7eLcYTLiQm2IDzmlSvYm7ov15anEcDJ92GHqqazxTSreeNgfnYu24kiEvvv0WlbCdFQ=="], - - "meshoptimizer": ["meshoptimizer@1.1.1", "", {}, "sha512-oRFNWJRDA/WTrVj7NWvqa5HqE1t9MYDj2VaWirQCzCCrAd2GHrqR/sQezCxiWATPNlKTcRaPRHPJwIRoPBAp5g=="], - - "micromark": ["micromark@4.0.2", "", { "dependencies": { "@types/debug": "^4.0.0", "debug": "^4.0.0", "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "micromark-core-commonmark": "^2.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-combine-extensions": "^2.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-encode": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-resolve-all": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", "micromark-util-subtokenize": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA=="], - - "micromark-core-commonmark": ["micromark-core-commonmark@2.0.3", "", { "dependencies": { "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "micromark-factory-destination": "^2.0.0", "micromark-factory-label": "^2.0.0", "micromark-factory-space": "^2.0.0", "micromark-factory-title": "^2.0.0", "micromark-factory-whitespace": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-classify-character": "^2.0.0", "micromark-util-html-tag-name": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-resolve-all": "^2.0.0", "micromark-util-subtokenize": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg=="], - - "micromark-extension-gfm": ["micromark-extension-gfm@3.0.0", "", { "dependencies": { "micromark-extension-gfm-autolink-literal": "^2.0.0", "micromark-extension-gfm-footnote": "^2.0.0", "micromark-extension-gfm-strikethrough": "^2.0.0", "micromark-extension-gfm-table": "^2.0.0", "micromark-extension-gfm-tagfilter": "^2.0.0", "micromark-extension-gfm-task-list-item": "^2.0.0", "micromark-util-combine-extensions": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w=="], - - "micromark-extension-gfm-autolink-literal": ["micromark-extension-gfm-autolink-literal@2.1.0", "", { "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw=="], - - "micromark-extension-gfm-footnote": ["micromark-extension-gfm-footnote@2.1.0", "", { "dependencies": { "devlop": "^1.0.0", "micromark-core-commonmark": "^2.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw=="], - - "micromark-extension-gfm-strikethrough": ["micromark-extension-gfm-strikethrough@2.1.0", "", { "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-classify-character": "^2.0.0", "micromark-util-resolve-all": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw=="], - - "micromark-extension-gfm-table": ["micromark-extension-gfm-table@2.1.1", "", { "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg=="], - - "micromark-extension-gfm-tagfilter": ["micromark-extension-gfm-tagfilter@2.0.0", "", { "dependencies": { "micromark-util-types": "^2.0.0" } }, "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg=="], - - "micromark-extension-gfm-task-list-item": ["micromark-extension-gfm-task-list-item@2.1.0", "", { "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw=="], - - "micromark-factory-destination": ["micromark-factory-destination@2.0.1", "", { "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA=="], - - "micromark-factory-label": ["micromark-factory-label@2.0.1", "", { "dependencies": { "devlop": "^1.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg=="], - - "micromark-factory-space": ["micromark-factory-space@2.0.1", "", { "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg=="], - - "micromark-factory-title": ["micromark-factory-title@2.0.1", "", { "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw=="], - - "micromark-factory-whitespace": ["micromark-factory-whitespace@2.0.1", "", { "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ=="], - - "micromark-util-character": ["micromark-util-character@2.1.1", "", { "dependencies": { "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q=="], - - "micromark-util-chunked": ["micromark-util-chunked@2.0.1", "", { "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA=="], - - "micromark-util-classify-character": ["micromark-util-classify-character@2.0.1", "", { "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q=="], - - "micromark-util-combine-extensions": ["micromark-util-combine-extensions@2.0.1", "", { "dependencies": { "micromark-util-chunked": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg=="], - - "micromark-util-decode-numeric-character-reference": ["micromark-util-decode-numeric-character-reference@2.0.2", "", { "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw=="], - - "micromark-util-decode-string": ["micromark-util-decode-string@2.0.1", "", { "dependencies": { "decode-named-character-reference": "^1.0.0", "micromark-util-character": "^2.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-symbol": "^2.0.0" } }, "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ=="], - - "micromark-util-encode": ["micromark-util-encode@2.0.1", "", {}, "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw=="], - - "micromark-util-html-tag-name": ["micromark-util-html-tag-name@2.0.1", "", {}, "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA=="], - - "micromark-util-normalize-identifier": ["micromark-util-normalize-identifier@2.0.1", "", { "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q=="], - - "micromark-util-resolve-all": ["micromark-util-resolve-all@2.0.1", "", { "dependencies": { "micromark-util-types": "^2.0.0" } }, "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg=="], - - "micromark-util-sanitize-uri": ["micromark-util-sanitize-uri@2.0.1", "", { "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-encode": "^2.0.0", "micromark-util-symbol": "^2.0.0" } }, "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ=="], - - "micromark-util-subtokenize": ["micromark-util-subtokenize@2.1.0", "", { "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA=="], - - "micromark-util-symbol": ["micromark-util-symbol@2.0.1", "", {}, "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q=="], - - "micromark-util-types": ["micromark-util-types@2.0.2", "", {}, "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA=="], - - "micromatch": ["micromatch@4.0.8", "", { "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" } }, "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="], - - "mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="], - - "mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="], - - "mimic-fn": ["mimic-fn@3.1.0", "", {}, "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ=="], - - "mimic-function": ["mimic-function@5.0.1", "", {}, "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA=="], - - "minimatch": ["minimatch@10.2.5", "", { "dependencies": { "brace-expansion": "^5.0.5" } }, "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg=="], - - "minimist": ["minimist@1.2.8", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="], - - "minipass": ["minipass@7.1.3", "", {}, "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A=="], - - "minizlib": ["minizlib@3.1.0", "", { "dependencies": { "minipass": "^7.1.2" } }, "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw=="], - - "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], - - "n8ao": ["n8ao@1.10.2", "", { "peerDependencies": { "postprocessing": ">=6.30.0", "three": ">=0.137" } }, "sha512-gh4i0xFP8DiRaNoX75kPiG3kGl7PmX9SW/OIn3Sv/YZmHrA8faLdSU1MM6M4gKtfKpxDnZagodu8FKob5URCVw=="], - - "nanoid": ["nanoid@3.3.15", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA=="], - - "negotiator": ["negotiator@1.0.0", "", {}, "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg=="], - - "node-releases": ["node-releases@2.0.50", "", {}, "sha512-J6l92tKHX6w8Jy5nO1Vuc01NoIiRGi/d6qBKVxh+IQ8Cr3b6HbVNfKiF8ZpFKufTwpwxMmce2W3iQZ861ZRyTg=="], - - "npm-run-path": ["npm-run-path@6.0.0", "", { "dependencies": { "path-key": "^4.0.0", "unicorn-magic": "^0.3.0" } }, "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA=="], - - "object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="], - - "object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="], - - "object-keys": ["object-keys@1.1.1", "", {}, "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="], - - "object-treeify": ["object-treeify@1.1.33", "", {}, "sha512-EFVjAYfzWqWsBMRHPMAXLCDIJnpMhdWAqR7xG6M6a2cs6PMFpl/+Z20w9zDW4vkxOFfddegBKq9Rehd0bxWE7A=="], - - "on-finished": ["on-finished@2.4.1", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg=="], - - "once": ["once@1.4.0", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="], - - "onetime": ["onetime@5.1.2", "", { "dependencies": { "mimic-fn": "^2.1.0" } }, "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg=="], - - "onnxruntime-common": ["onnxruntime-common@1.24.3", "", {}, "sha512-GeuPZO6U/LBJXvwdaqHbuUmoXiEdeCjWi/EG7Y1HNnDwJYuk6WUbNXpF6luSUY8yASul3cmUlLGrCCL1ZgVXqA=="], - - "onnxruntime-node": ["onnxruntime-node@1.24.3", "", { "dependencies": { "adm-zip": "^0.5.16", "global-agent": "^3.0.0", "onnxruntime-common": "1.24.3" }, "os": [ "linux", "win32", "darwin", ] }, "sha512-JH7+czbc8ALA819vlTgcV+Q214/+VjGeBHDjX81+ZCD0PCVCIFGFNtT0V4sXG/1JXypKPgScQcB3ij/hk3YnTg=="], - - "onnxruntime-web": ["onnxruntime-web@1.26.0-dev.20260416-b7804b056c", "", { "dependencies": { "flatbuffers": "^25.1.24", "guid-typescript": "^1.0.9", "long": "^5.2.3", "onnxruntime-common": "1.24.0-dev.20251116-b39e144322", "platform": "^1.3.6", "protobufjs": "^7.2.4" } }, "sha512-MD6Ss4GSpQBo6zqoJzyT9LRbKYs7x/JVN23FT24EcEvlqF4VuzPOeH6X38orZPKHQDbprn7K+SBpu0/mj2CQiw=="], - - "open": ["open@11.0.0", "", { "dependencies": { "default-browser": "^5.4.0", "define-lazy-prop": "^3.0.0", "is-in-ssh": "^1.0.0", "is-inside-container": "^1.0.0", "powershell-utils": "^0.1.0", "wsl-utils": "^0.3.0" } }, "sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw=="], - - "ora": ["ora@8.2.0", "", { "dependencies": { "chalk": "^5.3.0", "cli-cursor": "^5.0.0", "cli-spinners": "^2.9.2", "is-interactive": "^2.0.0", "is-unicode-supported": "^2.0.0", "log-symbols": "^6.0.0", "stdin-discarder": "^0.2.2", "string-width": "^7.2.0", "strip-ansi": "^7.1.0" } }, "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw=="], - - "p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="], - - "p-locate": ["p-locate@3.0.0", "", { "dependencies": { "p-limit": "^2.0.0" } }, "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ=="], - - "p-try": ["p-try@2.2.0", "", {}, "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="], - - "parent-module": ["parent-module@1.0.1", "", { "dependencies": { "callsites": "^3.0.0" } }, "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g=="], - - "parse-entities": ["parse-entities@4.0.2", "", { "dependencies": { "@types/unist": "^2.0.0", "character-entities-legacy": "^3.0.0", "character-reference-invalid": "^2.0.0", "decode-named-character-reference": "^1.0.0", "is-alphanumerical": "^2.0.0", "is-decimal": "^2.0.0", "is-hexadecimal": "^2.0.0" } }, "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw=="], - - "parse-json": ["parse-json@5.2.0", "", { "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg=="], - - "parse-ms": ["parse-ms@4.0.0", "", {}, "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw=="], - - "parseurl": ["parseurl@1.3.3", "", {}, "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="], - - "path-browserify": ["path-browserify@1.0.1", "", {}, "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="], - - "path-exists": ["path-exists@3.0.0", "", {}, "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ=="], - - "path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="], - - "path-to-regexp": ["path-to-regexp@8.4.2", "", {}, "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA=="], - - "phonemizer": ["phonemizer@1.2.1", "", {}, "sha512-v0KJ4mi2T4Q7eJQ0W15Xd4G9k4kICSXE8bpDeJ8jisL4RyJhNWsweKTOi88QXFc4r4LZlz5jVL5lCHhkpdT71A=="], - - "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], - - "picomatch": ["picomatch@4.0.4", "", {}, "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A=="], - - "pkce-challenge": ["pkce-challenge@5.0.1", "", {}, "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ=="], - - "pkg-up": ["pkg-up@3.1.0", "", { "dependencies": { "find-up": "^3.0.0" } }, "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA=="], - - "platform": ["platform@1.3.6", "", {}, "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg=="], - - "postcss": ["postcss@8.5.15", "", { "dependencies": { "nanoid": "^3.3.12", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A=="], - - "postcss-selector-parser": ["postcss-selector-parser@7.1.4", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-HeP7D2wyhkR+XaK6v4W8oRF62Dsz4flyuczALJp61GckGm42u1saSSJ/0auvcBqxs3jMRFEcPK34At/0JBKdOg=="], - - "postprocessing": ["postprocessing@6.39.1", "", { "peerDependencies": { "three": ">= 0.168.0 < 0.185.0" } }, "sha512-R2dG2zy+BAx3USl5EHw+PvnrlbT5PKnZVp3se0HCR0pWH8WQdh742yNG4YWOsq6c0bFpffk0Gd2RqPeoP/wKng=="], - - "potpack": ["potpack@1.0.2", "", {}, "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ=="], - - "powershell-utils": ["powershell-utils@0.1.0", "", {}, "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A=="], - - "pretty-ms": ["pretty-ms@9.3.0", "", { "dependencies": { "parse-ms": "^4.0.0" } }, "sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ=="], - - "promise-worker-transferable": ["promise-worker-transferable@1.0.4", "", { "dependencies": { "is-promise": "^2.1.0", "lie": "^3.0.2" } }, "sha512-bN+0ehEnrXfxV2ZQvU2PetO0n4gqBD4ulq3MI1WOPLgr7/Mg9yRQkX5+0v1vagr74ZTsl7XtzlaYDo2EuCeYJw=="], - - "prompts": ["prompts@2.4.2", "", { "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" } }, "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q=="], - - "property-information": ["property-information@7.2.0", "", {}, "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg=="], - - "protobufjs": ["protobufjs@7.6.4", "", { "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", "@protobufjs/codegen": "^2.0.5", "@protobufjs/eventemitter": "^1.1.1", "@protobufjs/fetch": "^1.1.1", "@protobufjs/float": "^1.0.2", "@protobufjs/path": "^1.1.2", "@protobufjs/pool": "^1.1.0", "@protobufjs/utf8": "^1.1.1", "@types/node": ">=13.7.0", "long": "^5.3.2" } }, "sha512-RJJPTTpvFfHcWLkIa2JFWK4XvtSzS0yEWDmunqHXli1h3JlkbcQZXDZdcWxv+JK3Xsl5/UFDPZ0iGm7DAengYw=="], - - "proxy-addr": ["proxy-addr@2.0.7", "", { "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" } }, "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg=="], - - "qs": ["qs@6.15.3", "", { "dependencies": { "es-define-property": "^1.0.1", "side-channel": "^1.1.1" } }, "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A=="], - - "queue-microtask": ["queue-microtask@1.2.3", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="], - - "radix-ui": ["radix-ui@1.6.0", "", { "dependencies": { "@radix-ui/primitive": "1.1.4", "@radix-ui/react-accessible-icon": "1.1.10", "@radix-ui/react-accordion": "1.2.14", "@radix-ui/react-alert-dialog": "1.1.17", "@radix-ui/react-arrow": "1.1.10", "@radix-ui/react-aspect-ratio": "1.1.10", "@radix-ui/react-avatar": "1.2.0", "@radix-ui/react-checkbox": "1.3.5", "@radix-ui/react-collapsible": "1.1.14", "@radix-ui/react-collection": "1.1.10", "@radix-ui/react-compose-refs": "1.1.3", "@radix-ui/react-context": "1.1.4", "@radix-ui/react-context-menu": "2.3.1", "@radix-ui/react-dialog": "1.1.17", "@radix-ui/react-direction": "1.1.2", "@radix-ui/react-dismissable-layer": "1.1.13", "@radix-ui/react-dropdown-menu": "2.1.18", "@radix-ui/react-focus-guards": "1.1.4", "@radix-ui/react-focus-scope": "1.1.10", "@radix-ui/react-form": "0.1.10", "@radix-ui/react-hover-card": "1.1.17", "@radix-ui/react-label": "2.1.10", "@radix-ui/react-menu": "2.1.18", "@radix-ui/react-menubar": "1.1.18", "@radix-ui/react-navigation-menu": "1.2.16", "@radix-ui/react-one-time-password-field": "0.1.10", "@radix-ui/react-password-toggle-field": "0.1.5", "@radix-ui/react-popover": "1.1.17", "@radix-ui/react-popper": "1.3.1", "@radix-ui/react-portal": "1.1.12", "@radix-ui/react-presence": "1.1.6", "@radix-ui/react-primitive": "2.1.6", "@radix-ui/react-progress": "1.1.10", "@radix-ui/react-radio-group": "1.4.1", "@radix-ui/react-roving-focus": "1.1.13", "@radix-ui/react-scroll-area": "1.2.12", "@radix-ui/react-select": "2.3.1", "@radix-ui/react-separator": "1.1.10", "@radix-ui/react-slider": "1.4.1", "@radix-ui/react-slot": "1.3.0", "@radix-ui/react-switch": "1.3.1", "@radix-ui/react-tabs": "1.1.15", "@radix-ui/react-toast": "1.2.17", "@radix-ui/react-toggle": "1.1.12", "@radix-ui/react-toggle-group": "1.1.13", "@radix-ui/react-toolbar": "1.1.13", "@radix-ui/react-tooltip": "1.2.10", "@radix-ui/react-use-callback-ref": "1.1.2", "@radix-ui/react-use-controllable-state": "1.2.3", "@radix-ui/react-use-effect-event": "0.0.3", "@radix-ui/react-use-escape-keydown": "1.1.2", "@radix-ui/react-use-is-hydrated": "0.1.1", "@radix-ui/react-use-layout-effect": "1.1.2", "@radix-ui/react-use-size": "1.1.2", "@radix-ui/react-visually-hidden": "1.2.6" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-EUEC70O03EgxWMP5aoqfBZ6iLC5bczFagGy7zhSYRt8o5DP7IWNiP3ywetse3L9b8843ExB0OGWZvgbYVJuNeg=="], - - "range-parser": ["range-parser@1.3.0", "", {}, "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw=="], - - "raw-body": ["raw-body@3.0.2", "", { "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", "iconv-lite": "~0.7.0", "unpipe": "~1.0.0" } }, "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA=="], - - "react": ["react@19.2.7", "", {}, "sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ=="], - - "react-dom": ["react-dom@19.2.7", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.7" } }, "sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ=="], - - "react-markdown": ["react-markdown@9.1.0", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "hast-util-to-jsx-runtime": "^2.0.0", "html-url-attributes": "^3.0.0", "mdast-util-to-hast": "^13.0.0", "remark-parse": "^11.0.0", "remark-rehype": "^11.0.0", "unified": "^11.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0" }, "peerDependencies": { "@types/react": ">=18", "react": ">=18" } }, "sha512-xaijuJB0kzGiUdG7nc2MOMDUDBWPyGAjZtUrow9XxUeua8IqeP+VlIfAZ3bphpcLTnSZXz6z9jcVC/TCwbfgdw=="], - - "react-remove-scroll": ["react-remove-scroll@2.7.2", "", { "dependencies": { "react-remove-scroll-bar": "^2.3.7", "react-style-singleton": "^2.2.3", "tslib": "^2.1.0", "use-callback-ref": "^1.3.3", "use-sidecar": "^1.1.3" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q=="], - - "react-remove-scroll-bar": ["react-remove-scroll-bar@2.3.8", "", { "dependencies": { "react-style-singleton": "^2.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "optionalPeers": ["@types/react"] }, "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q=="], - - "react-style-singleton": ["react-style-singleton@2.2.3", "", { "dependencies": { "get-nonce": "^1.0.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ=="], - - "react-use-measure": ["react-use-measure@2.1.7", "", { "peerDependencies": { "react": ">=16.13", "react-dom": ">=16.13" }, "optionalPeers": ["react-dom"] }, "sha512-KrvcAo13I/60HpwGO5jpW7E9DfusKyLPLvuHlUyP5zqnmAPhNc6qTRjUQrdTADl0lpPpDVU2/Gg51UlOGHXbdg=="], - - "recast": ["recast@0.23.12", "", { "dependencies": { "ast-types": "^0.16.1", "esprima": "~4.0.0", "source-map": "~0.6.1", "tiny-invariant": "^1.3.3", "tslib": "^2.0.1" } }, "sha512-dEWRjcINDu/F4l2dYx57ugBtD7HV9KXESyxhzw/MqWLeglJrsjJKqACPyUPg+6AF8mIgm+Zi0dZ3ACoIg+QtpA=="], - - "remark-gfm": ["remark-gfm@4.0.1", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-gfm": "^3.0.0", "micromark-extension-gfm": "^3.0.0", "remark-parse": "^11.0.0", "remark-stringify": "^11.0.0", "unified": "^11.0.0" } }, "sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg=="], - - "remark-parse": ["remark-parse@11.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-from-markdown": "^2.0.0", "micromark-util-types": "^2.0.0", "unified": "^11.0.0" } }, "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA=="], - - "remark-rehype": ["remark-rehype@11.1.2", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "mdast-util-to-hast": "^13.0.0", "unified": "^11.0.0", "vfile": "^6.0.0" } }, "sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw=="], - - "remark-stringify": ["remark-stringify@11.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-to-markdown": "^2.0.0", "unified": "^11.0.0" } }, "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw=="], - - "require-from-string": ["require-from-string@2.0.2", "", {}, "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="], - - "resolve-from": ["resolve-from@4.0.0", "", {}, "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="], - - "restore-cursor": ["restore-cursor@5.1.0", "", { "dependencies": { "onetime": "^7.0.0", "signal-exit": "^4.1.0" } }, "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA=="], - - "reusify": ["reusify@1.1.0", "", {}, "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw=="], - - "roarr": ["roarr@2.15.4", "", { "dependencies": { "boolean": "^3.0.1", "detect-node": "^2.0.4", "globalthis": "^1.0.1", "json-stringify-safe": "^5.0.1", "semver-compare": "^1.0.0", "sprintf-js": "^1.1.2" } }, "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A=="], - - "rolldown": ["rolldown@1.1.3", "", { "dependencies": { "@oxc-project/types": "=0.137.0", "@rolldown/pluginutils": "^1.0.0" }, "optionalDependencies": { "@rolldown/binding-android-arm64": "1.1.3", "@rolldown/binding-darwin-arm64": "1.1.3", "@rolldown/binding-darwin-x64": "1.1.3", "@rolldown/binding-freebsd-x64": "1.1.3", "@rolldown/binding-linux-arm-gnueabihf": "1.1.3", "@rolldown/binding-linux-arm64-gnu": "1.1.3", "@rolldown/binding-linux-arm64-musl": "1.1.3", "@rolldown/binding-linux-ppc64-gnu": "1.1.3", "@rolldown/binding-linux-s390x-gnu": "1.1.3", "@rolldown/binding-linux-x64-gnu": "1.1.3", "@rolldown/binding-linux-x64-musl": "1.1.3", "@rolldown/binding-openharmony-arm64": "1.1.3", "@rolldown/binding-wasm32-wasi": "1.1.3", "@rolldown/binding-win32-arm64-msvc": "1.1.3", "@rolldown/binding-win32-x64-msvc": "1.1.3" }, "bin": { "rolldown": "./bin/cli.mjs" } }, "sha512-1F1eEtUBtFvcGm1HQ9TiUIUHPQG7mSAODrhIzjxoUEFuo8OcbrGLiVLkevNgj84TE4lnHvnumwFjhJO5Eu135g=="], - - "router": ["router@2.2.0", "", { "dependencies": { "debug": "^4.4.0", "depd": "^2.0.0", "is-promise": "^4.0.0", "parseurl": "^1.3.3", "path-to-regexp": "^8.0.0" } }, "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ=="], - - "run-applescript": ["run-applescript@7.1.0", "", {}, "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q=="], - - "run-parallel": ["run-parallel@1.2.0", "", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="], - - "safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="], - - "scheduler": ["scheduler@0.27.0", "", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="], - - "semver": ["semver@7.8.5", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA=="], - - "semver-compare": ["semver-compare@1.0.0", "", {}, "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow=="], - - "send": ["send@1.2.1", "", { "dependencies": { "debug": "^4.4.3", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "fresh": "^2.0.0", "http-errors": "^2.0.1", "mime-types": "^3.0.2", "ms": "^2.1.3", "on-finished": "^2.4.1", "range-parser": "^1.2.1", "statuses": "^2.0.2" } }, "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ=="], - - "serialize-error": ["serialize-error@7.0.1", "", { "dependencies": { "type-fest": "^0.13.1" } }, "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw=="], - - "serve-static": ["serve-static@2.2.1", "", { "dependencies": { "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "parseurl": "^1.3.3", "send": "^1.2.0" } }, "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw=="], - - "setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="], - - "shadcn": ["shadcn@4.12.0", "", { "dependencies": { "@babel/core": "^7.28.0", "@babel/parser": "^7.28.0", "@babel/plugin-transform-typescript": "^7.28.0", "@babel/preset-typescript": "^7.27.1", "@dotenvx/dotenvx": "^1.48.4", "@modelcontextprotocol/sdk": "^1.26.0", "@types/validate-npm-package-name": "^4.0.2", "browserslist": "^4.26.2", "commander": "^14.0.0", "cosmiconfig": "^9.0.0", "dedent": "^1.6.0", "deepmerge": "^4.3.1", "diff": "^8.0.2", "execa": "^9.6.0", "fast-glob": "^3.3.3", "fs-extra": "^11.3.1", "fuzzysort": "^3.1.0", "kleur": "^4.1.5", "open": "^11.0.0", "ora": "^8.2.0", "postcss": "^8.5.6", "postcss-selector-parser": "^7.1.0", "prompts": "^2.4.2", "recast": "^0.23.11", "stringify-object": "^5.0.0", "tailwind-merge": "^3.0.1", "ts-morph": "^26.0.0", "tsconfig-paths": "^4.2.0", "undici": "^7.27.2", "validate-npm-package-name": "^7.0.1", "zod": "^3.24.1", "zod-to-json-schema": "^3.24.6" }, "bin": { "shadcn": "dist/index.js" } }, "sha512-o781ieQziCnXH2FKsEqxp1fnbHdbgAPO9inTSPeZ59hQfsZXuMGp3ul8oFSV5KQS4nbUK9b+DrDE6C7OvfKKQQ=="], - - "sharp": ["sharp@0.34.5", "", { "dependencies": { "@img/colour": "^1.0.0", "detect-libc": "^2.1.2", "semver": "^7.7.3" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.34.5", "@img/sharp-darwin-x64": "0.34.5", "@img/sharp-libvips-darwin-arm64": "1.2.4", "@img/sharp-libvips-darwin-x64": "1.2.4", "@img/sharp-libvips-linux-arm": "1.2.4", "@img/sharp-libvips-linux-arm64": "1.2.4", "@img/sharp-libvips-linux-ppc64": "1.2.4", "@img/sharp-libvips-linux-riscv64": "1.2.4", "@img/sharp-libvips-linux-s390x": "1.2.4", "@img/sharp-libvips-linux-x64": "1.2.4", "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", "@img/sharp-libvips-linuxmusl-x64": "1.2.4", "@img/sharp-linux-arm": "0.34.5", "@img/sharp-linux-arm64": "0.34.5", "@img/sharp-linux-ppc64": "0.34.5", "@img/sharp-linux-riscv64": "0.34.5", "@img/sharp-linux-s390x": "0.34.5", "@img/sharp-linux-x64": "0.34.5", "@img/sharp-linuxmusl-arm64": "0.34.5", "@img/sharp-linuxmusl-x64": "0.34.5", "@img/sharp-wasm32": "0.34.5", "@img/sharp-win32-arm64": "0.34.5", "@img/sharp-win32-ia32": "0.34.5", "@img/sharp-win32-x64": "0.34.5" } }, "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg=="], - - "shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="], - - "shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="], - - "side-channel": ["side-channel@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4", "side-channel-list": "^1.0.1", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ=="], - - "side-channel-list": ["side-channel-list@1.0.1", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4" } }, "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w=="], - - "side-channel-map": ["side-channel-map@1.0.1", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3" } }, "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA=="], - - "side-channel-weakmap": ["side-channel-weakmap@1.0.2", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3", "side-channel-map": "^1.0.1" } }, "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A=="], - - "signal-exit": ["signal-exit@4.1.0", "", {}, "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="], - - "sisteransi": ["sisteransi@1.0.5", "", {}, "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg=="], - - "source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], - - "source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="], - - "space-separated-tokens": ["space-separated-tokens@2.0.2", "", {}, "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q=="], - - "sprintf-js": ["sprintf-js@1.1.3", "", {}, "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA=="], - - "stats-gl": ["stats-gl@2.4.2", "", { "dependencies": { "@types/three": "*", "three": "^0.170.0" } }, "sha512-g5O9B0hm9CvnM36+v7SFl39T7hmAlv541tU81ME8YeSb3i1CIP5/QdDeSB3A0la0bKNHpxpwxOVRo2wFTYEosQ=="], - - "stats.js": ["stats.js@0.17.0", "", {}, "sha512-hNKz8phvYLPEcRkeG1rsGmV5ChMjKDAWU7/OJJdDErPBNChQXxCo3WZurGpnWc6gZhAzEPFad1aVgyOANH1sMw=="], - - "statuses": ["statuses@2.0.2", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="], - - "stdin-discarder": ["stdin-discarder@0.2.2", "", {}, "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ=="], - - "string-width": ["string-width@7.2.0", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="], - - "stringify-entities": ["stringify-entities@4.0.4", "", { "dependencies": { "character-entities-html4": "^2.0.0", "character-entities-legacy": "^3.0.0" } }, "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg=="], - - "stringify-object": ["stringify-object@5.0.0", "", { "dependencies": { "get-own-enumerable-keys": "^1.0.0", "is-obj": "^3.0.0", "is-regexp": "^3.1.0" } }, "sha512-zaJYxz2FtcMb4f+g60KsRNFOpVMUyuJgA51Zi5Z1DOTC3S59+OQiVOzE9GZt0x72uBGWKsQIuBKeF9iusmKFsg=="], - - "strip-ansi": ["strip-ansi@7.2.0", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="], - - "strip-bom": ["strip-bom@3.0.0", "", {}, "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA=="], - - "strip-final-newline": ["strip-final-newline@4.0.0", "", {}, "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw=="], - - "style-to-js": ["style-to-js@1.1.21", "", { "dependencies": { "style-to-object": "1.0.14" } }, "sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ=="], - - "style-to-object": ["style-to-object@1.0.14", "", { "dependencies": { "inline-style-parser": "0.2.7" } }, "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw=="], - - "suspend-react": ["suspend-react@0.1.3", "", { "peerDependencies": { "react": ">=17.0" } }, "sha512-aqldKgX9aZqpoDp3e8/BZ8Dm7x1pJl+qI3ZKxDN0i/IQTWUwBx/ManmlVJ3wowqbno6c2bmiIfs+Um6LbsjJyQ=="], - - "systeminformation": ["systeminformation@5.31.11", "", { "os": "!aix", "bin": { "systeminformation": "lib/cli.js" } }, "sha512-I6O7iaUj23AXRgCPDDnvi3xHvdOLp4+1YMbF+X194lJwY1NeWojgHJPhslVKcmTtrLTguRk3QJK+xEdTiI3P0w=="], - - "tailwind-merge": ["tailwind-merge@3.6.0", "", {}, "sha512-uxL7qAVQriqRQPAyK3pj66VqskWqoZ37PW94jwOTwNfq/z9oyu1V+eqrZqtR2+fCiXdYOZe/Modt8GtvqNzu+w=="], - - "tailwindcss": ["tailwindcss@4.3.1", "", {}, "sha512-hk+TB1m+K8CYNrP6rjQaq/Y+4Zylwpa87mLYBKCunwnnQ9p+fHb7kmSfGqyEJoxF/O6CDyABWVFEafNSYKll+Q=="], - - "tapable": ["tapable@2.3.3", "", {}, "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A=="], - - "tar": ["tar@7.5.18", "", { "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", "minipass": "^7.1.2", "minizlib": "^3.1.0", "yallist": "^5.0.0" } }, "sha512-PwA+nJl+AzsS9hRqtNRRq8/kTdNPoOLEPXpz9WBaErNm4+TFedJyQFJLITWdsmIBnwNS/TwXf1NV5Ak1KITc8g=="], - - "three": ["three@0.184.0", "", {}, "sha512-wtTRjG92pM5eUg/KuUnHsqSAlPM296brTOcLgMRqEeylYTh/CdtvKUvCyyCQTzFuStieWxvZb8mVTMvdPyUpxg=="], - - "three-mesh-bvh": ["three-mesh-bvh@0.8.3", "", { "peerDependencies": { "three": ">= 0.159.0" } }, "sha512-4G5lBaF+g2auKX3P0yqx+MJC6oVt6sB5k+CchS6Ob0qvH0YIhuUk1eYr7ktsIpY+albCqE80/FVQGV190PmiAg=="], - - "three-stdlib": ["three-stdlib@2.36.1", "", { "dependencies": { "@types/draco3d": "^1.4.0", "@types/offscreencanvas": "^2019.6.4", "@types/webxr": "^0.5.2", "draco3d": "^1.4.1", "fflate": "^0.6.9", "potpack": "^1.0.1" }, "peerDependencies": { "three": ">=0.128.0" } }, "sha512-XyGQrFmNQ5O/IoKm556ftwKsBg11TIb301MB5dWNicziQBEs2g3gtOYIf7pFiLa0zI2gUwhtCjv9fmjnxKZ1Cg=="], - - "tiny-invariant": ["tiny-invariant@1.3.3", "", {}, "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="], - - "tinyglobby": ["tinyglobby@0.2.17", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g=="], - - "to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="], - - "toidentifier": ["toidentifier@1.0.1", "", {}, "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="], - - "trim-lines": ["trim-lines@3.0.1", "", {}, "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg=="], - - "troika-three-text": ["troika-three-text@0.52.4", "", { "dependencies": { "bidi-js": "^1.0.2", "troika-three-utils": "^0.52.4", "troika-worker-utils": "^0.52.0", "webgl-sdf-generator": "1.1.1" }, "peerDependencies": { "three": ">=0.125.0" } }, "sha512-V50EwcYGruV5rUZ9F4aNsrytGdKcXKALjEtQXIOBfhVoZU9VAqZNIoGQ3TMiooVqFAbR1w15T+f+8gkzoFzawg=="], - - "troika-three-utils": ["troika-three-utils@0.52.4", "", { "peerDependencies": { "three": ">=0.125.0" } }, "sha512-NORAStSVa/BDiG52Mfudk4j1FG4jC4ILutB3foPnfGbOeIs9+G5vZLa0pnmnaftZUGm4UwSoqEpWdqvC7zms3A=="], - - "troika-worker-utils": ["troika-worker-utils@0.52.0", "", {}, "sha512-W1CpvTHykaPH5brv5VHLfQo9D1OYuo0cSBEUQFFT/nBUzM8iD6Lq2/tgG/f1OelbAS1WtaTPQzE5uM49egnngw=="], - - "trough": ["trough@2.2.0", "", {}, "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw=="], - - "ts-morph": ["ts-morph@26.0.0", "", { "dependencies": { "@ts-morph/common": "~0.27.0", "code-block-writer": "^13.0.3" } }, "sha512-ztMO++owQnz8c/gIENcM9XfCEzgoGphTv+nKpYNM1bgsdOVC/jRZuEBf6N+mLLDNg68Kl+GgUZfOySaRiG1/Ug=="], - - "tsconfig-paths": ["tsconfig-paths@4.2.0", "", { "dependencies": { "json5": "^2.2.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg=="], - - "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], - - "tunnel-rat": ["tunnel-rat@0.1.2", "", { "dependencies": { "zustand": "^4.3.2" } }, "sha512-lR5VHmkPhzdhrM092lI2nACsLO4QubF0/yoOhzX7c+wIpbN1GjHNzCc91QlpxBi+cnx8vVJ+Ur6vL5cEoQPFpQ=="], - - "tw-animate-css": ["tw-animate-css@1.4.0", "", {}, "sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ=="], - - "type-fest": ["type-fest@0.13.1", "", {}, "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg=="], - - "type-is": ["type-is@2.1.0", "", { "dependencies": { "content-type": "^2.0.0", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA=="], - - "typescript": ["typescript@6.0.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="], - - "undici": ["undici@7.28.0", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="], - - "undici-types": ["undici-types@7.18.2", "", {}, "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="], - - "unicorn-magic": ["unicorn-magic@0.3.0", "", {}, "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA=="], - - "unified": ["unified@11.0.5", "", { "dependencies": { "@types/unist": "^3.0.0", "bail": "^2.0.0", "devlop": "^1.0.0", "extend": "^3.0.0", "is-plain-obj": "^4.0.0", "trough": "^2.0.0", "vfile": "^6.0.0" } }, "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA=="], - - "unist-util-is": ["unist-util-is@6.0.1", "", { "dependencies": { "@types/unist": "^3.0.0" } }, "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g=="], - - "unist-util-position": ["unist-util-position@5.0.0", "", { "dependencies": { "@types/unist": "^3.0.0" } }, "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA=="], - - "unist-util-stringify-position": ["unist-util-stringify-position@4.0.0", "", { "dependencies": { "@types/unist": "^3.0.0" } }, "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ=="], - - "unist-util-visit": ["unist-util-visit@5.1.0", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0", "unist-util-visit-parents": "^6.0.0" } }, "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg=="], - - "unist-util-visit-parents": ["unist-util-visit-parents@6.0.2", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0" } }, "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ=="], - - "universalify": ["universalify@2.0.1", "", {}, "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw=="], - - "unpipe": ["unpipe@1.0.0", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="], - - "update-browserslist-db": ["update-browserslist-db@1.2.3", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w=="], - - "use-callback-ref": ["use-callback-ref@1.3.3", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg=="], - - "use-sidecar": ["use-sidecar@1.1.3", "", { "dependencies": { "detect-node-es": "^1.1.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ=="], - - "use-sync-external-store": ["use-sync-external-store@1.6.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w=="], - - "util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="], - - "utility-types": ["utility-types@3.11.0", "", {}, "sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw=="], - - "validate-npm-package-name": ["validate-npm-package-name@7.0.2", "", {}, "sha512-hVDIBwsRruT73PbK7uP5ebUt+ezEtCmzZz3F59BSr2F6OVFnJ/6h8liuvdLrQ88Xmnk6/+xGGuq+pG9WwTuy3A=="], - - "vary": ["vary@1.1.2", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="], - - "vfile": ["vfile@6.0.3", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="], - - "vfile-message": ["vfile-message@4.0.3", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-stringify-position": "^4.0.0" } }, "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw=="], - - "vite": ["vite@8.1.0", "", { "dependencies": { "lightningcss": "^1.32.0", "picomatch": "^4.0.4", "postcss": "^8.5.15", "rolldown": "~1.1.2", "tinyglobby": "^0.2.17" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.3.0", "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "@vitejs/devtools", "esbuild", "jiti", "less", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-BuJcQK/56NQTWDGn4ABea3q4SSBdNPWwNZKTkkUpcMPnLoquSYH8llRtSUIgoL1KSCpHt5eghLShn50mH36y7Q=="], - - "vite-plugin-glsl": ["vite-plugin-glsl@1.6.0", "", { "peerDependencies": { "@rollup/pluginutils": "^5.x", "esbuild": ">= 0.25", "vite": ">= 3.x" }, "optionalPeers": ["@rollup/pluginutils", "esbuild"] }, "sha512-3i3ZvIVb13LhTcAXEHGTOW+cNG2jbJ++XsDFyCWUpnoFN1NPXvdtC4j66pig+i0QjDnmusOK/YCpiDWizxBY0A=="], - - "webgl-constants": ["webgl-constants@1.1.1", "", {}, "sha512-LkBXKjU5r9vAW7Gcu3T5u+5cvSvh5WwINdr0C+9jpzVB41cjQAP5ePArDtk/WHYdVj0GefCgM73BA7FlIiNtdg=="], - - "webgl-sdf-generator": ["webgl-sdf-generator@1.1.1", "", {}, "sha512-9Z0JcMTFxeE+b2x1LJTdnaT8rT8aEp7MVxkNwoycNmJWwPdzoXzMh0BjJSh/AEFP+KPYZUli814h8bJZFIZ2jA=="], - - "which": ["which@4.0.0", "", { "dependencies": { "isexe": "^3.1.1" }, "bin": { "node-which": "bin/which.js" } }, "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg=="], - - "wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="], - - "wsl-utils": ["wsl-utils@0.3.1", "", { "dependencies": { "is-wsl": "^3.1.0", "powershell-utils": "^0.1.0" } }, "sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg=="], - - "yallist": ["yallist@5.0.0", "", {}, "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw=="], - - "yocto-spinner": ["yocto-spinner@1.2.0", "", { "dependencies": { "yoctocolors": "^2.1.1" } }, "sha512-Yw0hUB6UA3o4YUgKy3oSe9a4cxoaZ9sBfYDw+JSxo6Id0KoJGoxzPA24qqUXYKBWABs/zDSGTz9kww7t3F0XGw=="], - - "yoctocolors": ["yoctocolors@2.1.2", "", {}, "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug=="], - - "zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - - "zod-to-json-schema": ["zod-to-json-schema@3.25.2", "", { "peerDependencies": { "zod": "^3.25.28 || ^4" } }, "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA=="], - - "zustand": ["zustand@5.0.14", "", { "peerDependencies": { "@types/react": ">=18.0.0", "immer": ">=9.0.6", "react": ">=18.0.0", "use-sync-external-store": ">=1.2.0" }, "optionalPeers": ["@types/react", "immer", "react", "use-sync-external-store"] }, "sha512-/8tAspM5LMPr28b3fwLYrtdj77ECpfZviaP75CMTnwO8ISyaE4GDIG/9rDDYq/cH9D2Xw2A2RXglLInmVBQB/g=="], - - "zwitch": ["zwitch@2.0.4", "", {}, "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A=="], - - "@babel/core/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], - - "@babel/helper-compilation-targets/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], - - "@babel/helper-create-class-features-plugin/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], - - "@dotenvx/dotenvx/commander": ["commander@11.1.0", "", {}, "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ=="], - - "@dotenvx/dotenvx/execa": ["execa@5.1.1", "", { "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^4.0.1", "onetime": "^5.1.2", "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" } }, "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg=="], - - "@dotenvx/dotenvx/open": ["open@8.4.2", "", { "dependencies": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", "is-wsl": "^2.2.0" } }, "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ=="], - - "@protolabsai/ui/@protolabsai/design": ["@protolabsai/design@0.5.0", "", { "bin": { "protolabs-sync-assets": "bin/sync-assets.mjs" } }, "sha512-2ZgOlfcdvDaibvase8Vb+B2/L+cKaeTfCeT72vQepZB/e35dwHy2v9u8dofyI2nVDPDrCkL1e+Uy+vRBcHRnuQ=="], - - "@react-three/postprocessing/maath": ["maath@0.6.0", "", { "peerDependencies": { "@types/three": ">=0.144.0", "three": ">=0.144.0" } }, "sha512-dSb2xQuP7vDnaYqfoKzlApeRcR2xtN8/f7WV/TMAkBC8552TwTLtOO0JTcSygkYMjNDPoo6V01jTw/aPi4JrMw=="], - - "@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.11.1", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.2", "tslib": "^2.4.0" }, "bundled": true }, "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ=="], - - "@tailwindcss/oxide-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.11.1", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw=="], - - "@tailwindcss/oxide-wasm32-wasi/@emnapi/wasi-threads": ["@emnapi/wasi-threads@1.2.2", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA=="], - - "@tailwindcss/oxide-wasm32-wasi/@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.1.6", "", { "dependencies": { "@tybys/wasm-util": "^0.10.3" }, "peerDependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1" }, "bundled": true }, "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg=="], - - "@tailwindcss/oxide-wasm32-wasi/@tybys/wasm-util": ["@tybys/wasm-util@0.10.3", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg=="], - - "@tailwindcss/oxide-wasm32-wasi/tslib": ["tslib@2.8.1", "", { "bundled": true }, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], - - "body-parser/content-type": ["content-type@2.0.0", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="], - - "conf/ajv-formats": ["ajv-formats@2.1.1", "", { "dependencies": { "ajv": "^8.0.0" } }, "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA=="], - - "conf/json-schema-typed": ["json-schema-typed@7.0.3", "", {}, "sha512-7DE8mpG+/fVw+dTpjbxnx47TaMnDfOI1jwft9g1VybltZCduyRQPJPvc+zzKY9WPHxhPWczyFuYa6I8Mw4iU5A=="], - - "cross-spawn/which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="], - - "dot-prop/is-obj": ["is-obj@2.0.0", "", {}, "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w=="], - - "enquirer/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], - - "is-inside-container/is-docker": ["is-docker@3.0.0", "", { "bin": { "is-docker": "cli.js" } }, "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ=="], - - "kokoro-js/@huggingface/transformers": ["@huggingface/transformers@3.8.1", "", { "dependencies": { "@huggingface/jinja": "^0.5.3", "onnxruntime-node": "1.21.0", "onnxruntime-web": "1.22.0-dev.20250409-89f8206ba4", "sharp": "^0.34.1" } }, "sha512-tsTk4zVjImqdqjS8/AOZg2yNLd1z9S5v+7oUPpXaasDRwEDhB+xnglK1k5cad26lL5/ZIaeREgWWy0bs9y9pPA=="], - - "log-symbols/is-unicode-supported": ["is-unicode-supported@1.3.0", "", {}, "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ=="], - - "lru-cache/yallist": ["yallist@3.1.1", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="], - - "mdast-util-find-and-replace/escape-string-regexp": ["escape-string-regexp@5.0.0", "", {}, "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="], - - "micromatch/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], - - "npm-run-path/path-key": ["path-key@4.0.0", "", {}, "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ=="], - - "onetime/mimic-fn": ["mimic-fn@2.1.0", "", {}, "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="], - - "onnxruntime-web/onnxruntime-common": ["onnxruntime-common@1.24.0-dev.20251116-b39e144322", "", {}, "sha512-BOoomdHYmNRL5r4iQ4bMvsl2t0/hzVQ3OM3PHD0gxeXu1PmggqBv3puZicEUVOA3AtHHYmqZtjMj9FOfGrATTw=="], - - "parse-entities/@types/unist": ["@types/unist@2.0.11", "", {}, "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="], - - "prompts/kleur": ["kleur@3.0.3", "", {}, "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w=="], - - "restore-cursor/onetime": ["onetime@7.0.0", "", { "dependencies": { "mimic-function": "^5.0.0" } }, "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ=="], - - "router/is-promise": ["is-promise@4.0.0", "", {}, "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ=="], - - "stats-gl/three": ["three@0.170.0", "", {}, "sha512-FQK+LEpYc0fBD+J8g6oSEyyNzjp+Q7Ks1C568WWaoMRLW+TkNNWmenWeGgJjV105Gd+p/2ql1ZcjYvNiPZBhuQ=="], - - "three-stdlib/fflate": ["fflate@0.6.10", "", {}, "sha512-IQrh3lEPM93wVCEczc9SaAOvkmcoQn/G8Bo1e8ZPlY3X3bnAxWaBdvTdvM1hP62iZp0BXWDy4vTAy4fF0+Dlpg=="], - - "tunnel-rat/zustand": ["zustand@4.5.7", "", { "dependencies": { "use-sync-external-store": "^1.2.2" }, "peerDependencies": { "@types/react": ">=16.8", "immer": ">=9.0.6", "react": ">=16.8" }, "optionalPeers": ["@types/react", "immer", "react"] }, "sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw=="], - - "type-is/content-type": ["content-type@2.0.0", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="], - - "wsl-utils/is-wsl": ["is-wsl@3.1.1", "", { "dependencies": { "is-inside-container": "^1.0.0" } }, "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw=="], - - "@dotenvx/dotenvx/execa/get-stream": ["get-stream@6.0.1", "", {}, "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg=="], - - "@dotenvx/dotenvx/execa/human-signals": ["human-signals@2.1.0", "", {}, "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw=="], - - "@dotenvx/dotenvx/execa/is-stream": ["is-stream@2.0.1", "", {}, "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg=="], - - "@dotenvx/dotenvx/execa/npm-run-path": ["npm-run-path@4.0.1", "", { "dependencies": { "path-key": "^3.0.0" } }, "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw=="], - - "@dotenvx/dotenvx/execa/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], - - "@dotenvx/dotenvx/execa/strip-final-newline": ["strip-final-newline@2.0.0", "", {}, "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA=="], - - "@dotenvx/dotenvx/open/define-lazy-prop": ["define-lazy-prop@2.0.0", "", {}, "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og=="], - - "cross-spawn/which/isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="], - - "enquirer/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], - - "kokoro-js/@huggingface/transformers/onnxruntime-node": ["onnxruntime-node@1.21.0", "", { "dependencies": { "global-agent": "^3.0.0", "onnxruntime-common": "1.21.0", "tar": "^7.0.1" }, "os": [ "linux", "win32", "darwin", ] }, "sha512-NeaCX6WW2L8cRCSqy3bInlo5ojjQqu2fD3D+9W5qb5irwxhEyWKXeH2vZ8W9r6VxaMPUan+4/7NDwZMtouZxEw=="], - - "kokoro-js/@huggingface/transformers/onnxruntime-web": ["onnxruntime-web@1.22.0-dev.20250409-89f8206ba4", "", { "dependencies": { "flatbuffers": "^25.1.24", "guid-typescript": "^1.0.9", "long": "^5.2.3", "onnxruntime-common": "1.22.0-dev.20250409-89f8206ba4", "platform": "^1.3.6", "protobufjs": "^7.2.4" } }, "sha512-0uS76OPgH0hWCPrFKlL8kYVV7ckM7t/36HfbgoFw6Nd0CZVVbQC4PkrR8mBX8LtNUFZO25IQBqV2Hx2ho3FlbQ=="], - - "kokoro-js/@huggingface/transformers/onnxruntime-node/onnxruntime-common": ["onnxruntime-common@1.21.0", "", {}, "sha512-Q632iLLrtCAVOTO65dh2+mNbQir/QNTVBG3h/QdZBpns7mZ0RYbLRBgGABPbpU9351AgYy7SJf1WaeVwMrBFPQ=="], - - "kokoro-js/@huggingface/transformers/onnxruntime-web/onnxruntime-common": ["onnxruntime-common@1.22.0-dev.20250409-89f8206ba4", "", {}, "sha512-vDJMkfCfb0b1A836rgHj+ORuZf4B4+cc2bASQtpeoJLueuFc5DuYwjIZUBrSvx/fO5IrLjLz+oTrB3pcGlhovQ=="], - } -} diff --git a/sites/demo/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 b/sites/demo/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 new file mode 100644 index 00000000..4c462958 Binary files /dev/null and b/sites/demo/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 differ diff --git a/sites/demo/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 b/sites/demo/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 new file mode 100644 index 00000000..4b7a2bec Binary files /dev/null and b/sites/demo/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 differ diff --git a/sites/demo/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 b/sites/demo/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 new file mode 100644 index 00000000..ba90e209 Binary files /dev/null and b/sites/demo/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 differ diff --git a/sites/demo/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 b/sites/demo/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 new file mode 100644 index 00000000..991445d7 Binary files /dev/null and b/sites/demo/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 differ diff --git a/sites/demo/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 b/sites/demo/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 new file mode 100644 index 00000000..ee965898 Binary files /dev/null and b/sites/demo/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 differ diff --git a/sites/demo/dist/assets/index-9Exuw2Dr.css b/sites/demo/dist/assets/index-9Exuw2Dr.css new file mode 100644 index 00000000..806ee1ca --- /dev/null +++ b/sites/demo/dist/assets/index-9Exuw2Dr.css @@ -0,0 +1,2 @@ +/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--scroll-fade-t:0px;--scroll-fade-b:0px;--scroll-fade-s:0px;--scroll-fade-e:0px;--scroll-fade-mask:initial;--shimmer-image:initial;--shimmer-text-fill:initial}}}@layer theme{:root,:host{--font-sans:"Geist Variable", sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-500:oklch(63.7% .237 25.331);--color-red-900:oklch(39.6% .141 25.723);--color-yellow-400:oklch(85.2% .199 91.936);--color-emerald-400:oklch(76.5% .177 163.223);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-violet-400:oklch(70.2% .183 293.541);--color-rose-100:oklch(94.1% .03 12.58);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-950:oklch(14.1% .005 285.823);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-xl:36rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-md:calc(var(--radius) * .8);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-lg:16px;--blur-xl:24px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Geist Variable", sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab, var(--ring) 50%, transparent)}}body{background-color:var(--surface);color:var(--fg-body)}html{font-family:Geist Variable,sans-serif}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.inset-x-0{inset-inline:0}.-top-1\.5{top:calc(var(--spacing) * -1.5)}.top-0{top:0}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.top-9{top:calc(var(--spacing) * 9)}.top-16{top:calc(var(--spacing) * 16)}.top-\[15\%\]{top:15%}.-right-1\.5{right:calc(var(--spacing) * -1.5)}.right-0{right:0}.right-1\.5{right:calc(var(--spacing) * 1.5)}.right-2{right:calc(var(--spacing) * 2)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:0}.bottom-14{bottom:calc(var(--spacing) * 14)}.left-0{left:0}.left-1\/2{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.-m-1{margin:calc(var(--spacing) * -1)}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mr-1{margin-right:var(--spacing)}.mb-1{margin-bottom:var(--spacing)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.aspect-square{aspect-ratio:1}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.h-1{height:var(--spacing)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-48{height:calc(var(--spacing) * 48)}.h-\[18px\]{height:18px}.h-\[50dvh\]{height:50dvh}.h-\[calc\(100\%-1px\)\]{height:calc(100% - 1px)}.h-full{height:100%}.h-px{height:1px}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-\[55vh\]{max-height:55vh}.max-h-\[60vh\]{max-height:60vh}.max-h-\[85vh\]{max-height:85vh}.min-h-0{min-height:0}.min-h-\[2\.75rem\]{min-height:2.75rem}.min-h-full{min-height:100%}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-1\/3{width:33.3333%}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-24{width:calc(var(--spacing) * 24)}.w-40{width:calc(var(--spacing) * 40)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-80{width:calc(var(--spacing) * 80)}.w-\[18px\]{width:18px}.w-\[400px\]{width:400px}.w-\[min\(20rem\,92vw\)\]{width:min(20rem,92vw)}.w-\[min\(30rem\,92vw\)\]{width:min(30rem,92vw)}.w-\[min\(34rem\,92vw\)\]{width:min(34rem,92vw)}.w-\[min\(92vw\,640px\)\]{width:min(92vw,640px)}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\[55\%\]{max-width:55%}.max-w-\[60\%\]{max-width:60%}.max-w-\[92vw\]{max-width:92vw}.max-w-\[calc\(100vw-1\.5rem\)\]{max-width:calc(100vw - 1.5rem)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-36{min-width:calc(var(--spacing) * 36)}.min-w-\[6\.5rem\]{min-width:6.5rem}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.shimmer{--_spread:var(--shimmer-spread,calc(3ch + 40px));--_base:currentColor;--_highlight:var(--shimmer-color,oklch(from currentColor l c h / calc(alpha* .2)));background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), var(--_highlight) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, var(--_highlight) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}@supports (color:color-mix(in lab, red, red)){.shimmer{background-image:var(--shimmer-image,linear-gradient(calc(90deg + var(--shimmer-angle)), var(--_base) calc(50% - var(--_spread)), color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * .5), var(--_highlight) 50%, color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * .5), var(--_base) calc(50% + var(--_spread))))}}.shimmer{background-repeat:no-repeat;background-size:calc(200% + var(--_spread) * 2) 100%;-webkit-text-fill-color:var(--shimmer-text-fill,transparent);animation:tw-shimmer var(--shimmer-duration,2s) linear infinite;background-position:0 0;-webkit-background-clip:text;background-clip:text}.shimmer:is(.dark *){--_highlight:var(--shimmer-color,oklch(from currentColor max(.8, calc(l + .4)) c h / calc(alpha + .4)))}.shimmer:where([dir=rtl],[dir=rtl] *){animation-direction:reverse}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.scroll-my-1{scroll-margin-block:var(--spacing)}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0{gap:0}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:calc(var(--radius) * 1.8)}.rounded-4xl{border-radius:calc(var(--radius) * 2.6)}.rounded-\[min\(var\(--radius-md\)\,10px\)\]{border-radius:min(var(--radius-md), 10px)}.rounded-\[min\(var\(--radius-md\)\,12px\)\]{border-radius:min(var(--radius-md), 12px)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) * .8)}.rounded-sm{border-radius:calc(var(--radius) * .6)}.rounded-xl{border-radius:calc(var(--radius) * 1.4)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-border{border-color:var(--border)}.border-brand,.border-brand\/30{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.border-brand\/30{border-color:color-mix(in oklab, var(--brand) 30%, transparent)}}.border-brand\/40{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.border-brand\/40{border-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.border-brand\/50{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.border-brand\/50{border-color:color-mix(in oklab, var(--brand) 50%, transparent)}}.border-brand\/60{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.border-brand\/60{border-color:color-mix(in oklab, var(--brand) 60%, transparent)}}.border-edge{border-color:var(--edge)}.border-fg-muted{border-color:var(--fg-muted)}.border-indigo-400\/40{border-color:#7d87ff66}@supports (color:color-mix(in lab, red, red)){.border-indigo-400\/40{border-color:color-mix(in oklab, var(--color-indigo-400) 40%, transparent)}}.border-input{border-color:var(--input)}.border-raised\/60{border-color:var(--raised)}@supports (color:color-mix(in lab, red, red)){.border-raised\/60{border-color:color-mix(in oklab, var(--raised) 60%, transparent)}}.border-ring{border-color:var(--ring)}.border-rose-400\/50{border-color:#ff667f80}@supports (color:color-mix(in lab, red, red)){.border-rose-400\/50{border-color:color-mix(in oklab, var(--color-rose-400) 50%, transparent)}}.border-success\/30{border-color:var(--success)}@supports (color:color-mix(in lab, red, red)){.border-success\/30{border-color:color-mix(in oklab, var(--success) 30%, transparent)}}.border-transparent{border-color:#0000}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.border-white\/5{border-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.border-white\/10{border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.bg-background{background-color:var(--background)}.bg-black{background-color:var(--color-black)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-black\/75{background-color:#000000bf}@supports (color:color-mix(in lab, red, red)){.bg-black\/75{background-color:color-mix(in oklab, var(--color-black) 75%, transparent)}}.bg-border{background-color:var(--border)}.bg-brand,.bg-brand\/5{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\/5{background-color:color-mix(in oklab, var(--brand) 5%, transparent)}}.bg-brand\/10{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\/10{background-color:color-mix(in oklab, var(--brand) 10%, transparent)}}.bg-brand\/15{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\/15{background-color:color-mix(in oklab, var(--brand) 15%, transparent)}}.bg-brand\/50{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\/50{background-color:color-mix(in oklab, var(--brand) 50%, transparent)}}.bg-brand\/70{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\/70{background-color:color-mix(in oklab, var(--brand) 70%, transparent)}}.bg-brand\/80{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\/80{background-color:color-mix(in oklab, var(--brand) 80%, transparent)}}.bg-danger{background-color:var(--danger)}.bg-destructive\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\/10{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.bg-edge,.bg-edge\/80{background-color:var(--edge)}@supports (color:color-mix(in lab, red, red)){.bg-edge\/80{background-color:color-mix(in oklab, var(--edge) 80%, transparent)}}.bg-fg{background-color:var(--fg)}.bg-fg-faint{background-color:var(--fg-faint)}.bg-indigo-400\/10{background-color:#7d87ff1a}@supports (color:color-mix(in lab, red, red)){.bg-indigo-400\/10{background-color:color-mix(in oklab, var(--color-indigo-400) 10%, transparent)}}.bg-indigo-500\/90{background-color:#625fffe6}@supports (color:color-mix(in lab, red, red)){.bg-indigo-500\/90{background-color:color-mix(in oklab, var(--color-indigo-500) 90%, transparent)}}.bg-muted{background-color:var(--muted)}.bg-orb{background-color:var(--orb)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-raised,.bg-raised\/30{background-color:var(--raised)}@supports (color:color-mix(in lab, red, red)){.bg-raised\/30{background-color:color-mix(in oklab, var(--raised) 30%, transparent)}}.bg-raised\/40{background-color:var(--raised)}@supports (color:color-mix(in lab, red, red)){.bg-raised\/40{background-color:color-mix(in oklab, var(--raised) 40%, transparent)}}.bg-raised\/60{background-color:var(--raised)}@supports (color:color-mix(in lab, red, red)){.bg-raised\/60{background-color:color-mix(in oklab, var(--raised) 60%, transparent)}}.bg-raised\/70{background-color:var(--raised)}@supports (color:color-mix(in lab, red, red)){.bg-raised\/70{background-color:color-mix(in oklab, var(--raised) 70%, transparent)}}.bg-red-500{background-color:var(--color-red-500)}.bg-rose-500\/15{background-color:#ff235726}@supports (color:color-mix(in lab, red, red)){.bg-rose-500\/15{background-color:color-mix(in oklab, var(--color-rose-500) 15%, transparent)}}.bg-secondary{background-color:var(--secondary)}.bg-sky-500\/70{background-color:#00a5efb3}@supports (color:color-mix(in lab, red, red)){.bg-sky-500\/70{background-color:color-mix(in oklab, var(--color-sky-500) 70%, transparent)}}.bg-success,.bg-success\/5{background-color:var(--success)}@supports (color:color-mix(in lab, red, red)){.bg-success\/5{background-color:color-mix(in oklab, var(--success) 5%, transparent)}}.bg-success\/10{background-color:var(--success)}@supports (color:color-mix(in lab, red, red)){.bg-success\/10{background-color:color-mix(in oklab, var(--success) 10%, transparent)}}.bg-surface,.bg-surface\/60{background-color:var(--surface)}@supports (color:color-mix(in lab, red, red)){.bg-surface\/60{background-color:color-mix(in oklab, var(--surface) 60%, transparent)}}.bg-surface\/95{background-color:var(--surface)}@supports (color:color-mix(in lab, red, red)){.bg-surface\/95{background-color:color-mix(in oklab, var(--surface) 95%, transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/\[0\.02\]{background-color:#ffffff05}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.02\]{background-color:color-mix(in oklab, var(--color-white) 2%, transparent)}}.bg-yellow-400{background-color:var(--color-yellow-400)}.bg-zinc-950\/90{background-color:#09090be6}@supports (color:color-mix(in lab, red, red)){.bg-zinc-950\/90{background-color:color-mix(in oklab, var(--color-zinc-950) 90%, transparent)}}.bg-zinc-950\/95{background-color:#09090bf2}@supports (color:color-mix(in lab, red, red)){.bg-zinc-950\/95{background-color:color-mix(in oklab, var(--color-zinc-950) 95%, transparent)}}.bg-clip-padding{background-clip:padding-box}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-\[3px\]{padding:3px}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-px{padding-block:1px}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-0{padding-bottom:0}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-1\.5{padding-left:calc(var(--spacing) * 1.5)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-heading{font-family:var(--font-sans)}.font-mono{font-family:var(--font-mono)}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-helper{font-size:.75rem;line-height:var(--tw-leading,1rem)}.text-label{font-size:.8125rem;line-height:var(--tw-leading,1.125rem)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-micro{font-size:.6875rem;line-height:var(--tw-leading,1rem)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.8rem\]{font-size:.8rem}.text-\[0\.85em\]{font-size:.85em}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-brand,.text-brand\/70{color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.text-brand\/70{color:color-mix(in oklab, var(--brand) 70%, transparent)}}.text-brand\/80{color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.text-brand\/80{color:color-mix(in oklab, var(--brand) 80%, transparent)}}.text-danger,.text-danger\/90{color:var(--danger)}@supports (color:color-mix(in lab, red, red)){.text-danger\/90{color:color-mix(in oklab, var(--danger) 90%, transparent)}}.text-destructive{color:var(--destructive)}.text-edge{color:var(--edge)}.text-emerald-400{color:var(--color-emerald-400)}.text-fg{color:var(--fg)}.text-fg-body{color:var(--fg-body)}.text-fg-faint{color:var(--fg-faint)}.text-fg-muted{color:var(--fg-muted)}.text-fg-subtle,.text-fg-subtle\/60{color:var(--fg-subtle)}@supports (color:color-mix(in lab, red, red)){.text-fg-subtle\/60{color:color-mix(in oklab, var(--fg-subtle) 60%, transparent)}}.text-foreground,.text-foreground\/60{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\/60{color:color-mix(in oklab, var(--foreground) 60%, transparent)}}.text-indigo-100{color:var(--color-indigo-100)}.text-indigo-300{color:var(--color-indigo-300)}.text-muted-foreground{color:var(--muted-foreground)}.text-orb{color:var(--orb)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-rose-100{color:var(--color-rose-100)}.text-rose-400{color:var(--color-rose-400)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sky-400\/80{color:#00bcfecc}@supports (color:color-mix(in lab, red, red)){.text-sky-400\/80{color:color-mix(in oklab, var(--color-sky-400) 80%, transparent)}}.text-success,.text-success\/80{color:var(--success)}@supports (color:color-mix(in lab, red, red)){.text-success\/80{color:color-mix(in oklab, var(--success) 80%, transparent)}}.text-violet-400\/80{color:#a685ffcc}@supports (color:color-mix(in lab, red, red)){.text-violet-400\/80{color:color-mix(in oklab, var(--color-violet-400) 80%, transparent)}}.text-white{color:var(--color-white)}.text-zinc-200{color:var(--color-zinc-200)}.text-zinc-300{color:var(--color-zinc-300)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-600{color:var(--color-zinc-600)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.placeholder-fg-muted::placeholder{color:var(--fg-muted)}.placeholder-fg-subtle::placeholder{color:var(--fg-subtle)}.accent-brand{accent-color:var(--brand)}.opacity-0{opacity:0}.opacity-80{opacity:.8}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_6px_var\(--orb\)\]{--tw-shadow:0 0 6px var(--tw-shadow-color,var(--orb));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-brand\/60{--tw-ring-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.ring-brand\/60{--tw-ring-color:color-mix(in oklab, var(--brand) 60%, transparent)}}.ring-edge{--tw-ring-color:var(--edge)}.ring-foreground\/10{--tw-ring-color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.ring-foreground\/10{--tw-ring-color:color-mix(in oklab, var(--foreground) 10%, transparent)}}.ring-ring\/50{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.ring-ring\/50{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.ring-surface{--tw-ring-color:var(--surface)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-lg{--tw-blur:blur(var(--blur-lg));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[left\]{transition-property:left;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-75{--tw-duration:75ms;transition-duration:75ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-700{--tw-duration:.7s;transition-duration:.7s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.fade-out{--tw-exit-opacity:0}.paused{animation-play-state:paused}.running{animation-play-state:running}.group-open\:rotate-90:is(:where(.group):is([open],:popover-open,:open) *){rotate:90deg}@media (hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *),.group-hover\/w\:opacity-100:is(:where(.group\/w):hover *){opacity:1}}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\[variant\=line\]\/tabs-list\:bg-transparent:is(:where(.group\/tabs-list)[data-variant=line] *){background-color:#0000}.group-data-horizontal\/tabs\:h-8:is(:where(.group\/tabs):where([data-orientation=horizontal]) *){height:calc(var(--spacing) * 8)}.group-data-vertical\/tabs\:h-fit:is(:where(.group\/tabs):where([data-orientation=vertical]) *){height:fit-content}.group-data-vertical\/tabs\:w-full:is(:where(.group\/tabs):where([data-orientation=vertical]) *){width:100%}.group-data-vertical\/tabs\:flex-col:is(:where(.group\/tabs):where([data-orientation=vertical]) *){flex-direction:column}.group-data-vertical\/tabs\:justify-start:is(:where(.group\/tabs):where([data-orientation=vertical]) *){justify-content:flex-start}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-6::file-selector-button{height:calc(var(--spacing) * 6)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.placeholder\:text-zinc-600::placeholder{color:var(--color-zinc-600)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);inset:calc(var(--spacing) * -2)}.after\:bg-foreground:after{content:var(--tw-content);background-color:var(--foreground)}.after\:opacity-0:after{content:var(--tw-content);opacity:0}.after\:transition-opacity:after{content:var(--tw-content);transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.group-data-horizontal\/tabs\:after\:inset-x-0:is(:where(.group\/tabs):where([data-orientation=horizontal]) *):after{content:var(--tw-content);inset-inline:0}.group-data-horizontal\/tabs\:after\:bottom-\[-5px\]:is(:where(.group\/tabs):where([data-orientation=horizontal]) *):after{content:var(--tw-content);bottom:-5px}.group-data-horizontal\/tabs\:after\:h-0\.5:is(:where(.group\/tabs):where([data-orientation=horizontal]) *):after{content:var(--tw-content);height:calc(var(--spacing) * .5)}.group-data-vertical\/tabs\:after\:inset-y-0:is(:where(.group\/tabs):where([data-orientation=vertical]) *):after{content:var(--tw-content);inset-block:0}.group-data-vertical\/tabs\:after\:-right-1:is(:where(.group\/tabs):where([data-orientation=vertical]) *):after{content:var(--tw-content);right:calc(var(--spacing) * -1)}.group-data-vertical\/tabs\:after\:w-0\.5:is(:where(.group\/tabs):where([data-orientation=vertical]) *):after{content:var(--tw-content);width:calc(var(--spacing) * .5)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media (hover:hover){.hover\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:border-indigo-300\/70:hover{border-color:#a4b3ffb3}@supports (color:color-mix(in lab, red, red)){.hover\:border-indigo-300\/70:hover{border-color:color-mix(in oklab, var(--color-indigo-300) 70%, transparent)}}.hover\:border-white\/20:hover{border-color:#fff3}@supports (color:color-mix(in lab, red, red)){.hover\:border-white\/20:hover{border-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.hover\:bg-brand\/10:hover{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-brand\/10:hover{background-color:color-mix(in oklab, var(--brand) 10%, transparent)}}.hover\:bg-brand\/20:hover{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-brand\/20:hover{background-color:color-mix(in oklab, var(--brand) 20%, transparent)}}.hover\:bg-destructive\/20:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-destructive\/20:hover{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.hover\:bg-edge:hover,.hover\:bg-edge\/50:hover{background-color:var(--edge)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-edge\/50:hover{background-color:color-mix(in oklab, var(--edge) 50%, transparent)}}.hover\:bg-fg-faint:hover{background-color:var(--fg-faint)}.hover\:bg-indigo-500:hover{background-color:var(--color-indigo-500)}.hover\:bg-muted:hover{background-color:var(--muted)}.hover\:bg-raised:hover,.hover\:bg-raised\/50:hover{background-color:var(--raised)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-raised\/50:hover{background-color:color-mix(in oklab, var(--raised) 50%, transparent)}}.hover\:bg-raised\/70:hover{background-color:var(--raised)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-raised\/70:hover{background-color:color-mix(in oklab, var(--raised) 70%, transparent)}}.hover\:bg-red-900\/40:hover{background-color:#82181a66}@supports (color:color-mix(in lab, red, red)){.hover\:bg-red-900\/40:hover{background-color:color-mix(in oklab, var(--color-red-900) 40%, transparent)}}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.hover\:bg-success\/20:hover{background-color:var(--success)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-success\/20:hover{background-color:color-mix(in oklab, var(--success) 20%, transparent)}}.hover\:text-brand:hover{color:var(--brand)}.hover\:text-danger:hover{color:var(--danger)}.hover\:text-fg-body:hover{color:var(--fg-body)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-muted-foreground:hover{color:var(--muted-foreground)}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-zinc-300:hover{color:var(--color-zinc-300)}.hover\:text-zinc-400:hover{color:var(--color-zinc-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:ring-3:hover{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\:border-indigo-400\/50:focus{border-color:#7d87ff80}@supports (color:color-mix(in lab, red, red)){.focus\:border-indigo-400\/50:focus{border-color:color-mix(in oklab, var(--color-indigo-400) 50%, transparent)}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus,:is(.not-data-\[variant\=destructive\]\:focus\:\*\*\:text-accent-foreground:not([data-variant=destructive]):focus *){color:var(--accent-foreground)}.focus-visible\:border-destructive\/40:focus-visible{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:border-destructive\/40:focus-visible{border-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:text-fg-body:focus-visible{color:var(--fg-body)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-3:focus-visible,.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-fg-faint:focus-visible{--tw-ring-color:var(--fg-faint)}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:outline-hidden:focus-visible{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus-visible\:outline-hidden:focus-visible{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:ring-3:active{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.active\:not-aria-\[haspopup\]\:translate-y-px:active:not([aria-haspopup]){--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-input\/50:disabled{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.disabled\:bg-input\/50:disabled{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}:where([data-slot=button-group]) .in-data-\[slot\=button-group\]\:rounded-lg{border-radius:var(--radius)}.has-data-\[icon\=inline-end\]\:pr-1:has([data-icon=inline-end]){padding-right:var(--spacing)}.has-data-\[icon\=inline-end\]\:pr-1\.5:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-end\]\:pr-2:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 2)}.has-data-\[icon\=inline-start\]\:pl-1:has([data-icon=inline-start]){padding-left:var(--spacing)}.has-data-\[icon\=inline-start\]\:pl-1\.5:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-start\]\:pl-2:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 2)}.aria-expanded\:bg-muted[aria-expanded=true]{background-color:var(--muted)}.aria-expanded\:bg-secondary[aria-expanded=true]{background-color:var(--secondary)}.aria-expanded\:text-foreground[aria-expanded=true]{color:var(--foreground)}.aria-expanded\:text-secondary-foreground[aria-expanded=true]{color:var(--secondary-foreground)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-3[aria-invalid=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-placeholder\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[align-trigger\=true\]\:animate-none[data-align-trigger=true]{animation:none}.data-\[position\=popper\]\:h-\(--radix-select-trigger-height\)[data-position=popper]{height:var(--radix-select-trigger-height)}.data-\[position\=popper\]\:w-full[data-position=popper]{width:100%}.data-\[position\=popper\]\:min-w-\(--radix-select-trigger-width\)[data-position=popper]{min-width:var(--radix-select-trigger-width)}.data-\[side\=bottom\]\:inset-x-0[data-side=bottom]{inset-inline:0}.data-\[side\=bottom\]\:bottom-0[data-side=bottom]{bottom:0}.data-\[side\=bottom\]\:h-auto[data-side=bottom]{height:auto}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=bottom\]\:border-t[data-side=bottom]{border-top-style:var(--tw-border-style);border-top-width:1px}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:inset-y-0[data-side=left]{inset-block:0}.data-\[side\=left\]\:left-0[data-side=left]{left:0}.data-\[side\=left\]\:h-full[data-side=left]{height:100%}.data-\[side\=left\]\:w-3\/4[data-side=left]{width:75%}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=left\]\:border-r[data-side=left]{border-right-style:var(--tw-border-style);border-right-width:1px}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:inset-y-0[data-side=right]{inset-block:0}.data-\[side\=right\]\:right-0[data-side=right]{right:0}.data-\[side\=right\]\:h-full[data-side=right]{height:100%}.data-\[side\=right\]\:w-3\/4[data-side=right]{width:75%}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:border-l[data-side=right]{border-left-style:var(--tw-border-style);border-left-width:1px}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:inset-x-0[data-side=top]{inset-inline:0}.data-\[side\=top\]\:top-0[data-side=top]{top:0}.data-\[side\=top\]\:h-auto[data-side=top]{height:auto}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=top\]\:border-b[data-side=top]{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=default\]\:h-8[data-size=default]{height:calc(var(--spacing) * 8)}.data-\[size\=sm\]\:h-7[data-size=sm]{height:calc(var(--spacing) * 7)}.data-\[size\=sm\]\:rounded-\[min\(var\(--radius-md\)\,10px\)\][data-size=sm]{border-radius:min(var(--radius-md), 10px)}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-1\.5>*)[data-slot=select-value]{gap:calc(var(--spacing) * 1.5)}.data-\[state\=checked\]\:left-4[data-state=checked]{left:calc(var(--spacing) * 4)}.data-\[state\=checked\]\:border-brand[data-state=checked]{border-color:var(--brand)}.data-\[state\=checked\]\:bg-brand\/80[data-state=checked]{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.data-\[state\=checked\]\:bg-brand\/80[data-state=checked]{background-color:color-mix(in oklab, var(--brand) 80%, transparent)}}.data-\[state\=unchecked\]\:left-0\.5[data-state=unchecked]{left:calc(var(--spacing) * .5)}.data-\[state\=unchecked\]\:border-edge[data-state=unchecked]{border-color:var(--edge)}.data-\[state\=unchecked\]\:bg-raised[data-state=unchecked]{background-color:var(--raised)}.data-\[variant\=line\]\:rounded-none[data-variant=line]{border-radius:0}@media (width>=40rem){.sm\:h-10{height:calc(var(--spacing) * 10)}.sm\:w-10{width:calc(var(--spacing) * 10)}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.data-\[side\=left\]\:sm\:max-w-sm[data-side=left],.data-\[side\=right\]\:sm\:max-w-sm[data-side=right]{max-width:var(--container-sm)}}@media (width>=48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/20:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-destructive\/20:is(.dark *){background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab, var(--input) 30%, transparent)}}.dark\:text-muted-foreground:is(.dark *){color:var(--muted-foreground)}@media (hover:hover){.dark\:hover\:bg-destructive\/30:is(.dark *):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-destructive\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}.dark\:hover\:bg-muted\/50:is(.dark *):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-muted\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}.dark\:hover\:text-foreground:is(.dark *):hover{color:var(--foreground)}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:disabled\:bg-input\/80:is(.dark *):disabled{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:disabled\:bg-input\/80:is(.dark *):disabled{background-color:color-mix(in oklab, var(--input) 80%, transparent)}}.dark\:aria-invalid\:border-destructive\/50:is(.dark *)[aria-invalid=true]{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:aria-invalid\:border-destructive\/50:is(.dark *)[aria-invalid=true]{border-color:color-mix(in oklab, var(--destructive) 50%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.data-open\:animate-in:where([data-state=open]),.data-open\:animate-in:where([data-open]:not([data-open=false])){animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-open\:fade-in-0:where([data-state=open]),.data-open\:fade-in-0:where([data-open]:not([data-open=false])){--tw-enter-opacity:0}.data-open\:zoom-in-95:where([data-state=open]),.data-open\:zoom-in-95:where([data-open]:not([data-open=false])){--tw-enter-scale:.95}.data-\[side\=bottom\]\:data-open\:slide-in-from-bottom-10[data-side=bottom]:where([data-state=open]),.data-\[side\=bottom\]\:data-open\:slide-in-from-bottom-10[data-side=bottom]:where([data-open]:not([data-open=false])){--tw-enter-translate-y:calc(.1*100%)}.data-\[side\=left\]\:data-open\:slide-in-from-left-10[data-side=left]:where([data-state=open]),.data-\[side\=left\]\:data-open\:slide-in-from-left-10[data-side=left]:where([data-open]:not([data-open=false])){--tw-enter-translate-x:calc(.1*-100%)}.data-\[side\=right\]\:data-open\:slide-in-from-right-10[data-side=right]:where([data-state=open]),.data-\[side\=right\]\:data-open\:slide-in-from-right-10[data-side=right]:where([data-open]:not([data-open=false])){--tw-enter-translate-x:calc(.1*100%)}.data-\[side\=top\]\:data-open\:slide-in-from-top-10[data-side=top]:where([data-state=open]),.data-\[side\=top\]\:data-open\:slide-in-from-top-10[data-side=top]:where([data-open]:not([data-open=false])){--tw-enter-translate-y:calc(.1*-100%)}.data-closed\:animate-out:where([data-state=closed]),.data-closed\:animate-out:where([data-closed]:not([data-closed=false])){animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-closed\:fade-out-0:where([data-state=closed]),.data-closed\:fade-out-0:where([data-closed]:not([data-closed=false])){--tw-exit-opacity:0}.data-closed\:zoom-out-95:where([data-state=closed]),.data-closed\:zoom-out-95:where([data-closed]:not([data-closed=false])){--tw-exit-scale:.95}.data-\[side\=bottom\]\:data-closed\:slide-out-to-bottom-10[data-side=bottom]:where([data-state=closed]),.data-\[side\=bottom\]\:data-closed\:slide-out-to-bottom-10[data-side=bottom]:where([data-closed]:not([data-closed=false])){--tw-exit-translate-y:calc(.1*100%)}.data-\[side\=left\]\:data-closed\:slide-out-to-left-10[data-side=left]:where([data-state=closed]),.data-\[side\=left\]\:data-closed\:slide-out-to-left-10[data-side=left]:where([data-closed]:not([data-closed=false])){--tw-exit-translate-x:calc(.1*-100%)}.data-\[side\=right\]\:data-closed\:slide-out-to-right-10[data-side=right]:where([data-state=closed]),.data-\[side\=right\]\:data-closed\:slide-out-to-right-10[data-side=right]:where([data-closed]:not([data-closed=false])){--tw-exit-translate-x:calc(.1*100%)}.data-\[side\=top\]\:data-closed\:slide-out-to-top-10[data-side=top]:where([data-state=closed]),.data-\[side\=top\]\:data-closed\:slide-out-to-top-10[data-side=top]:where([data-closed]:not([data-closed=false])){--tw-exit-translate-y:calc(.1*-100%)}.data-disabled\:pointer-events-none:where([data-disabled=true]),.data-disabled\:pointer-events-none:where([data-disabled]:not([data-disabled=false])){pointer-events:none}.data-disabled\:opacity-50:where([data-disabled=true]),.data-disabled\:opacity-50:where([data-disabled]:not([data-disabled=false])){opacity:.5}.data-active\:bg-background:where([data-state=active]),.data-active\:bg-background:where([data-active]:not([data-active=false])){background-color:var(--background)}.data-active\:text-foreground:where([data-state=active]),.data-active\:text-foreground:where([data-active]:not([data-active=false])){color:var(--foreground)}.group-data-\[variant\=default\]\/tabs-list\:data-active\:shadow-sm:is(:where(.group\/tabs-list)[data-variant=default] *):where([data-state=active]),.group-data-\[variant\=default\]\/tabs-list\:data-active\:shadow-sm:is(:where(.group\/tabs-list)[data-variant=default] *):where([data-active]:not([data-active=false])){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.group-data-\[variant\=line\]\/tabs-list\:data-active\:bg-transparent:is(:where(.group\/tabs-list)[data-variant=line] *):where([data-state=active]),.group-data-\[variant\=line\]\/tabs-list\:data-active\:bg-transparent:is(:where(.group\/tabs-list)[data-variant=line] *):where([data-active]:not([data-active=false])){background-color:#0000}.group-data-\[variant\=line\]\/tabs-list\:data-active\:shadow-none:is(:where(.group\/tabs-list)[data-variant=line] *):where([data-state=active]),.group-data-\[variant\=line\]\/tabs-list\:data-active\:shadow-none:is(:where(.group\/tabs-list)[data-variant=line] *):where([data-active]:not([data-active=false])){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}:is(.group-data-\[variant\=line\]\/tabs-list\:data-active\:after\:opacity-100:is(:where(.group\/tabs-list)[data-variant=line] *):where([data-state=active]),.group-data-\[variant\=line\]\/tabs-list\:data-active\:after\:opacity-100:is(:where(.group\/tabs-list)[data-variant=line] *):where([data-active]:not([data-active=false]))):after{content:var(--tw-content);opacity:1}.dark\:data-active\:border-input:is(.dark *):where([data-state=active]),.dark\:data-active\:border-input:is(.dark *):where([data-active]:not([data-active=false])){border-color:var(--input)}.dark\:data-active\:bg-input\/30:is(.dark *):where([data-state=active]),.dark\:data-active\:bg-input\/30:is(.dark *):where([data-active]:not([data-active=false])){background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:data-active\:bg-input\/30:is(.dark *):where([data-state=active]),.dark\:data-active\:bg-input\/30:is(.dark *):where([data-active]:not([data-active=false])){background-color:color-mix(in oklab, var(--input) 30%, transparent)}}.dark\:data-active\:text-foreground:is(.dark *):where([data-state=active]),.dark\:data-active\:text-foreground:is(.dark *):where([data-active]:not([data-active=false])){color:var(--foreground)}.dark\:group-data-\[variant\=line\]\/tabs-list\:data-active\:border-transparent:is(.dark *):is(:where(.group\/tabs-list)[data-variant=line] *):where([data-state=active]),.dark\:group-data-\[variant\=line\]\/tabs-list\:data-active\:border-transparent:is(.dark *):is(:where(.group\/tabs-list)[data-variant=line] *):where([data-active]:not([data-active=false])){border-color:#0000}.dark\:group-data-\[variant\=line\]\/tabs-list\:data-active\:bg-transparent:is(.dark *):is(:where(.group\/tabs-list)[data-variant=line] *):where([data-state=active]),.dark\:group-data-\[variant\=line\]\/tabs-list\:data-active\:bg-transparent:is(.dark *):is(:where(.group\/tabs-list)[data-variant=line] *):where([data-active]:not([data-active=false])){background-color:#0000}.data-horizontal\:h-1:where([data-orientation=horizontal]){height:var(--spacing)}.data-horizontal\:h-full:where([data-orientation=horizontal]){height:100%}.data-horizontal\:w-full:where([data-orientation=horizontal]){width:100%}.data-horizontal\:flex-col:where([data-orientation=horizontal]){flex-direction:column}.data-vertical\:h-full:where([data-orientation=vertical]){height:100%}.data-vertical\:min-h-40:where([data-orientation=vertical]){min-height:calc(var(--spacing) * 40)}.data-vertical\:w-1:where([data-orientation=vertical]){width:var(--spacing)}.data-vertical\:w-auto:where([data-orientation=vertical]){width:auto}.data-vertical\:w-full:where([data-orientation=vertical]){width:100%}.data-vertical\:flex-col:where([data-orientation=vertical]){flex-direction:column}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3\.5 svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}@media (hover:hover){.\[a\]\:hover\:bg-destructive\/20:is(a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.\[a\]\:hover\:bg-destructive\/20:is(a):hover{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.\[a\]\:hover\:bg-muted:is(a):hover{background-color:var(--muted)}.\[a\]\:hover\:bg-primary\/80:is(a):hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.\[a\]\:hover\:bg-primary\/80:is(a):hover{background-color:color-mix(in oklab, var(--primary) 80%, transparent)}}.\[a\]\:hover\:bg-secondary\/80:is(a):hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.\[a\]\:hover\:bg-secondary\/80:is(a):hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.\[a\]\:hover\:text-muted-foreground:is(a):hover{color:var(--muted-foreground)}}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3\!>svg{width:calc(var(--spacing) * 3)!important;height:calc(var(--spacing) * 3)!important}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}@property --scroll-fade-t{syntax:"";inherits:false;initial-value:0}@property --scroll-fade-b{syntax:"";inherits:false;initial-value:0}@property --scroll-fade-s{syntax:"";inherits:false;initial-value:0}@property --scroll-fade-e{syntax:"";inherits:false;initial-value:0}@property --scroll-fade-mask{syntax:"*";inherits:false}@property --shimmer-angle{syntax:"";inherits:true;initial-value:20deg}@property --shimmer-image{syntax:"*";inherits:false}@property --shimmer-text-fill{syntax:"*";inherits:false}@media (prefers-reduced-motion:reduce){.shimmer{-webkit-text-fill-color:currentColor;background-image:none;animation:none}}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/demo/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/demo/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/demo/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/demo/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/demo/assets/geist-latin-wght-normal-BgDaEnEv.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--pl-color-brand-lavender:#9b87f2;--pl-color-brand-lavender-light:#b8a6f5;--pl-color-brand-lavender-deep:#5b3fc9;--pl-color-brand-indigo:#6366f1;--pl-color-brand-indigo-bright:#818cf8;--pl-color-brand-indigo-deep:#4f46e5;--pl-color-bg:#0a0a0c;--pl-color-bg-raised:#131316;--pl-color-bg-subtle:#1c1c22;--pl-color-bg-hover:#19191d;--pl-color-bg-inset:#060608;--pl-color-overlay:#0009;--pl-color-fg:#ededed;--pl-color-fg-muted:#a1a1aa;--pl-color-fg-subtle:#71717a;--pl-color-fg-on-accent:#0a0a0c;--pl-color-border:#ffffff14;--pl-color-border-strong:#ffffff2e;--pl-color-accent:#9b87f2;--pl-color-accent-hover:#b8a6f5;--pl-color-accent-fg:#b8a6f5;--pl-color-focus:#9b87f2;--pl-color-status-success:oklch(72% .13 145);--pl-color-status-warning:oklch(78% .12 75);--pl-color-status-error:oklch(64% .16 25);--pl-color-status-info:oklch(68% .12 230);--pl-gradient-brand:linear-gradient(135deg, #9b87f2 0%, #818cf8 50%, #6366f1 100%);--pl-gradient-brand-light:linear-gradient(135deg, #7355e8 0%, #6366f1 50%, #4f46e5 100%);--pl-shadow-glow:0 0 80px #9b87f214;--pl-shadow-popover:0 8px 28px #00000080;--pl-font-sans:"Geist", system-ui, -apple-system, sans-serif;--pl-font-mono:"Geist Mono", ui-monospace, "SF Mono", monospace;--pl-font-base-size:14px;--pl-font-line-height-body:1.6;--pl-font-line-height-heading:1.2;--pl-font-weight-body:440;--pl-font-weight-medium:500;--pl-font-weight-semibold:600;--pl-radius:4px;--pl-space-1:4px;--pl-space-2:8px;--pl-space-3:12px;--pl-space-4:16px;--pl-space-5:20px;--pl-space-6:24px;--pl-space-8:32px;--pl-space-12:48px;--pl-border-width:1px;--pl-motion-fast:.12s;--pl-motion-base:.2s;--pl-motion-theme:.4s;--pl-motion-loading:1s;--pl-motion-status:2s;--pl-motion-ease:ease;--pl-motion-ease-in-out:ease-in-out;--pl-motion-linear:linear}@media (prefers-color-scheme:light){:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--pl-color-bg:#f6f7f9;--pl-color-bg-raised:#fff;--pl-color-bg-subtle:#eceef2;--pl-color-bg-hover:#e4e7ec;--pl-color-bg-inset:#eef0f4;--pl-color-overlay:#14141e59;--pl-color-fg:#18181b;--pl-color-fg-muted:#52525b;--pl-color-fg-subtle:#8a8a94;--pl-color-fg-on-accent:#fff;--pl-color-border:#0000001a;--pl-color-border-strong:#0003;--pl-color-accent:#6366f1;--pl-color-accent-hover:#4f46e5;--pl-color-accent-fg:#4f46e5;--pl-color-focus:#6366f1;--pl-color-status-success:oklch(62% .15 150);--pl-color-status-warning:oklch(74% .16 92);--pl-color-status-error:oklch(58% .2 25);--pl-color-status-info:oklch(58% .17 255);--pl-gradient-brand:linear-gradient(135deg, #7355e8 0%, #6366f1 50%, #4f46e5 100%);--pl-shadow-popover:0 8px 24px #0000001f}}:root[data-theme=light]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--pl-color-bg:#f6f7f9;--pl-color-bg-raised:#fff;--pl-color-bg-subtle:#eceef2;--pl-color-bg-hover:#e4e7ec;--pl-color-bg-inset:#eef0f4;--pl-color-overlay:#14141e59;--pl-color-fg:#18181b;--pl-color-fg-muted:#52525b;--pl-color-fg-subtle:#8a8a94;--pl-color-fg-on-accent:#fff;--pl-color-border:#0000001a;--pl-color-border-strong:#0003;--pl-color-accent:#6366f1;--pl-color-accent-hover:#4f46e5;--pl-color-accent-fg:#4f46e5;--pl-color-focus:#6366f1;--pl-color-status-success:oklch(62% .15 150);--pl-color-status-warning:oklch(74% .16 92);--pl-color-status-error:oklch(58% .2 25);--pl-color-status-info:oklch(58% .17 255);--pl-gradient-brand:linear-gradient(135deg, #7355e8 0%, #6366f1 50%, #4f46e5 100%);--pl-shadow-popover:0 8px 24px #0000001f}:root[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--pl-color-bg:#0a0a0c;--pl-color-bg-raised:#131316;--pl-color-bg-subtle:#1c1c22;--pl-color-bg-hover:#19191d;--pl-color-bg-inset:#060608;--pl-color-overlay:#0009;--pl-color-fg:#ededed;--pl-color-fg-muted:#a1a1aa;--pl-color-fg-subtle:#71717a;--pl-color-fg-on-accent:#0a0a0c;--pl-color-border:#ffffff14;--pl-color-border-strong:#ffffff2e;--pl-color-accent:#9b87f2;--pl-color-accent-hover:#b8a6f5;--pl-color-accent-fg:#b8a6f5;--pl-color-focus:#9b87f2;--pl-color-status-success:oklch(72% .13 145);--pl-color-status-warning:oklch(78% .12 75);--pl-color-status-error:oklch(64% .16 25);--pl-color-status-info:oklch(68% .12 230);--pl-gradient-brand:linear-gradient(135deg, #9b87f2 0%, #818cf8 50%, #6366f1 100%);--pl-shadow-popover:0 8px 28px #00000080}.pl-btn{font-family:var(--pl-font-sans);color:var(--pl-color-fg);border:var(--pl-border-width) solid var(--pl-color-border-strong);border-radius:var(--pl-radius);cursor:pointer;transition:border-color var(--pl-motion-fast) var(--pl-motion-ease), color var(--pl-motion-fast) var(--pl-motion-ease), background var(--pl-motion-fast) var(--pl-motion-ease);background:0 0;align-items:center;gap:.4rem;padding:.5rem .9rem;font-size:13px;font-weight:400;text-decoration:none;display:inline-flex}.pl-btn:hover,.pl-btn--primary{border-color:var(--pl-color-fg)}.pl-btn--primary:hover{background:var(--pl-color-fg);color:var(--pl-color-bg)}.pl-btn:disabled{opacity:.5;cursor:not-allowed}.pl-badge{font-family:var(--pl-font-mono);text-transform:lowercase;letter-spacing:.02em;color:var(--pl-color-fg-muted);background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);align-items:center;gap:.35rem;padding:.15rem .5rem;font-size:11px;line-height:1.4;display:inline-flex}.pl-badge--success{color:var(--pl-color-status-success);border-color:var(--pl-color-status-success)}@supports (color:color-mix(in lab, red, red)){.pl-badge--success{border-color:color-mix(in oklch, var(--pl-color-status-success) 35%, transparent)}}.pl-badge--warning{color:var(--pl-color-status-warning);border-color:var(--pl-color-status-warning)}@supports (color:color-mix(in lab, red, red)){.pl-badge--warning{border-color:color-mix(in oklch, var(--pl-color-status-warning) 35%, transparent)}}.pl-badge--error{color:var(--pl-color-status-error);border-color:var(--pl-color-status-error)}@supports (color:color-mix(in lab, red, red)){.pl-badge--error{border-color:color-mix(in oklch, var(--pl-color-status-error) 35%, transparent)}}.pl-badge--info{color:var(--pl-color-status-info);border-color:var(--pl-color-status-info)}@supports (color:color-mix(in lab, red, red)){.pl-badge--info{border-color:color-mix(in oklch, var(--pl-color-status-info) 35%, transparent)}}.pl-card{background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);padding:var(--pl-space-4)}.pl-eyebrow{font-family:var(--pl-font-mono);font-size:11px;font-weight:var(--pl-font-weight-medium);text-transform:uppercase;letter-spacing:.08em;color:var(--pl-color-fg-muted)}.pl-empty{color:var(--pl-color-fg-muted);font-family:var(--pl-font-mono);padding:1rem 0;font-size:13px}.pl-empty--slotted{justify-content:center;align-items:center;gap:var(--pl-space-2);padding:var(--pl-space-6) var(--pl-space-4);text-align:center;flex-direction:column;display:flex}.pl-empty__icon{margin-bottom:var(--pl-space-1);color:var(--pl-color-fg-subtle);display:inline-flex}.pl-empty__icon svg{width:28px;height:28px}.pl-empty__title{font-family:var(--pl-font-sans);font-size:14px;font-weight:var(--pl-font-weight-medium);color:var(--pl-color-fg)}.pl-empty__desc{max-width:44ch;font-family:var(--pl-font-sans);color:var(--pl-color-fg-muted);font-size:13px;line-height:1.6}.pl-empty__action{margin-top:var(--pl-space-2)}.pl-count{min-width:16px;height:16px;font-family:var(--pl-font-mono);color:var(--pl-color-fg-muted);background:var(--pl-color-bg-subtle);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:999px;justify-content:center;align-items:center;padding:0 5px;font-size:10px;line-height:1;display:inline-flex}.pl-iconbtn{color:var(--pl-color-fg-muted);border-radius:var(--pl-radius);cursor:pointer;transition:background var(--pl-motion-fast) var(--pl-motion-ease), color var(--pl-motion-fast) var(--pl-motion-ease);background:0 0;border:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.pl-iconbtn:hover{color:var(--pl-color-fg);background:var(--pl-color-bg-hover)}.pl-divider{border:0;border-top:var(--pl-border-width) solid var(--pl-color-border);margin:2rem 0}.pl-callout{background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);border-left-width:2px;padding:.85rem 1rem}.pl-callout__title{font-family:var(--pl-font-mono);text-transform:lowercase;letter-spacing:.02em;color:var(--pl-color-fg);margin-bottom:.35rem;font-size:12px}.pl-callout__body{color:var(--pl-color-fg-muted);font-size:14px;line-height:1.6}.pl-callout--success{border-left-color:var(--pl-color-status-success)}.pl-callout--warning{border-left-color:var(--pl-color-status-warning)}.pl-callout--error{border-left-color:var(--pl-color-status-error)}.pl-callout--info{border-left-color:var(--pl-color-status-info)}.pl-kbd{font-family:var(--pl-font-mono);color:var(--pl-color-fg);background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);border-bottom-width:2px;padding:.1rem .4rem;font-size:.82em}.pl-link{color:inherit;text-underline-offset:3px;text-decoration:underline;-webkit-text-decoration-color:var(--pl-color-border-strong);-webkit-text-decoration-color:var(--pl-color-border-strong);-webkit-text-decoration-color:var(--pl-color-border-strong);text-decoration-color:var(--pl-color-border-strong);transition:text-decoration-color var(--pl-motion-fast) var(--pl-motion-ease), color var(--pl-motion-fast) var(--pl-motion-ease)}.pl-link:hover{-webkit-text-decoration-color:var(--pl-color-fg);-webkit-text-decoration-color:var(--pl-color-fg);-webkit-text-decoration-color:var(--pl-color-fg);text-decoration-color:var(--pl-color-fg)}.pl-btn--danger{border-color:var(--pl-color-status-error)}@supports (color:color-mix(in lab, red, red)){.pl-btn--danger{border-color:color-mix(in oklch, var(--pl-color-status-error) 60%, transparent)}}.pl-btn--danger{color:var(--pl-color-status-error)}.pl-btn--danger:hover{background:var(--pl-color-status-error);border-color:var(--pl-color-status-error);color:var(--pl-color-bg)}.pl-btn--ghost{border-color:#0000}.pl-btn--ghost:hover{border-color:var(--pl-color-border-strong);background:var(--pl-color-bg-hover)}.pl-btn--sm{padding:.3rem .6rem;font-size:12px}.pl-btn--icon{justify-content:center;width:30px;height:30px;padding:0}.pl-btn--icon.pl-btn--sm{width:26px;height:26px}.pl-btn--icon svg{width:16px;height:16px}.pl-avatar{background:var(--pl-color-bg-subtle);border:var(--pl-border-width) solid var(--pl-color-border);color:var(--pl-color-fg-muted);font-family:var(--pl-font-mono);font-weight:var(--pl-font-weight-medium);-webkit-user-select:none;user-select:none;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;line-height:1;display:inline-flex;overflow:hidden}.pl-avatar__img{object-fit:cover;width:100%;height:100%}.pl-avatar-group{align-items:center;display:inline-flex}.pl-avatar-group>.pl-avatar{box-shadow:0 0 0 2px var(--pl-color-bg);margin-left:-8px}.pl-avatar-group>.pl-avatar:first-child{margin-left:0}.pl-tag{height:20px;font-family:var(--pl-font-mono);color:var(--pl-color-fg);background:var(--pl-color-bg-subtle);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);align-items:center;gap:4px;padding:0 6px;font-size:11px;display:inline-flex}.pl-tag__remove{width:14px;height:14px;color:var(--pl-color-fg-muted);cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;margin-right:-2px;padding:0;font-size:13px;line-height:1;display:inline-flex}.pl-tag__remove:hover{color:var(--pl-color-fg);background:var(--pl-color-bg-hover)}.pl-logo{object-fit:contain;flex-shrink:0;display:block}.pl-stat__num{font-family:var(--pl-font-mono);color:var(--pl-color-fg);font-size:1.1rem}.pl-stat__label{color:var(--pl-color-fg-muted);margin-top:.15rem;font-size:12px}.pl-container{max-width:880px;margin:0 auto;padding:0 1.5rem}.pl-section{padding:4rem 0}.pl-stats{border-top:var(--pl-border-width) solid var(--pl-color-border);border-bottom:var(--pl-border-width) solid var(--pl-color-border);grid-template-columns:repeat(2,1fr);gap:1.5rem 2rem;padding:1.5rem 0;display:grid}@media (width>=640px){.pl-stats{grid-template-columns:repeat(4,1fr)}}.pl-grid{display:grid}.pl-grid--gap-sm{gap:var(--pl-space-2)}.pl-grid--gap-md{gap:var(--pl-space-4)}.pl-grid--gap-lg{gap:var(--pl-space-6)}.pl-grid--auto{grid-template-columns:repeat(auto-fill, minmax(var(--pl-grid-min,14rem), 1fr))}.pl-grid--cols{grid-template-columns:repeat(var(--pl-grid-cols,1), minmax(0, 1fr))}@media (width>=640px){.pl-grid--cols{grid-template-columns:repeat(var(--pl-grid-cols-sm,var(--pl-grid-cols,1)), minmax(0, 1fr))}}@media (width>=768px){.pl-grid--cols{grid-template-columns:repeat(var(--pl-grid-cols-md,var(--pl-grid-cols-sm,var(--pl-grid-cols,1))), minmax(0, 1fr))}}@media (width>=1024px){.pl-grid--cols{grid-template-columns:repeat(var(--pl-grid-cols-lg,var(--pl-grid-cols-md,var(--pl-grid-cols-sm,var(--pl-grid-cols,1)))), minmax(0, 1fr))}}@media (width>=1280px){.pl-grid--cols{grid-template-columns:repeat(var(--pl-grid-cols-xl,var(--pl-grid-cols-lg,var(--pl-grid-cols-md,var(--pl-grid-cols-sm,var(--pl-grid-cols,1))))), minmax(0, 1fr))}}.pl-row{border-top:var(--pl-border-width) solid var(--pl-color-border);color:var(--pl-color-fg);transition:opacity var(--pl-motion-fast) var(--pl-motion-ease);grid-template-columns:9rem 1fr;gap:1.25rem;padding:1rem 0;text-decoration:none;display:grid}.pl-row:last-of-type{border-bottom:var(--pl-border-width) solid var(--pl-color-border)}a.pl-row:hover{opacity:.7}.pl-row--wide{grid-template-columns:9rem 1fr auto}.pl-row__label{font-family:var(--pl-font-mono);color:var(--pl-color-fg-muted);font-size:12px}.pl-row__name{font-family:var(--pl-font-mono);color:var(--pl-color-fg);margin-bottom:.25rem;font-size:13px}.pl-row__desc{color:var(--pl-color-fg-muted);font-size:13px;line-height:1.5}.pl-row__status{font-family:var(--pl-font-mono);text-transform:lowercase;color:var(--pl-color-fg-muted);font-size:11px}@media (width<=640px){.pl-row,.pl-row--wide{grid-template-columns:1fr;gap:.25rem}}.pl-gradient-text{background:var(--pl-gradient-brand);-webkit-text-fill-color:transparent;letter-spacing:-.02em;-webkit-background-clip:text;background-clip:text;font-weight:700}.pl-hero{padding:5rem 0 3rem;display:block}.pl-hero h1{letter-spacing:-.025em;margin:0 0 1.25rem;font-size:clamp(2rem,4vw,2.75rem);font-weight:500;line-height:1.2}.pl-hero__cta{flex-wrap:wrap;gap:.75rem;display:flex}.pl-lead{color:var(--pl-color-fg-muted);max-width:60ch;margin:0 0 1.5rem;font-size:1.05rem;line-height:1.6}.pl-heading{letter-spacing:-.01em;color:var(--pl-color-fg);margin:0 0 1rem;font-size:1.4rem;font-weight:500;line-height:1.2}.pl-section-intro{color:var(--pl-color-fg-muted);max-width:60ch;margin:0 0 2rem;line-height:1.6}.pl-steps{gap:1.5rem;display:grid}.pl-step{grid-template-columns:2rem 1fr;align-items:baseline;gap:.5rem;display:grid}.pl-step__num{font-family:var(--pl-font-mono);color:var(--pl-color-fg-muted);font-size:13px}.pl-step__title{font-family:var(--pl-font-mono);color:var(--pl-color-fg);margin-bottom:.4rem;font-size:13px}.pl-step__body{color:var(--pl-color-fg-muted);font-size:14px;line-height:1.55}.pl-checks{gap:.5rem;display:grid}.pl-check{color:var(--pl-color-fg-muted);grid-template-columns:1.2rem 1fr;align-items:baseline;gap:.5rem;font-size:14px;display:grid}.pl-check__mark{color:var(--pl-color-fg);font-family:var(--pl-font-mono)}.pl-check strong{color:var(--pl-color-fg);font-weight:500}.pl-deliverables{gap:1.5rem;display:grid}@media (width>=640px){.pl-deliverables{grid-template-columns:1fr 1fr}}.pl-deliverable{border-left:var(--pl-border-width) solid var(--pl-color-border-strong);padding-left:1rem}.pl-deliverable__title{font-family:var(--pl-font-mono);color:var(--pl-color-fg);margin-bottom:.4rem;font-size:13px}.pl-deliverable__body{color:var(--pl-color-fg-muted);font-size:14px;line-height:1.55}.pl-post-list{gap:0;display:grid}.pl-post-item{border-top:var(--pl-border-width) solid var(--pl-color-border);color:var(--pl-color-fg);transition:opacity var(--pl-motion-fast) var(--pl-motion-ease);padding:1.25rem 0;text-decoration:none;display:block}.pl-post-item:last-of-type{border-bottom:var(--pl-border-width) solid var(--pl-color-border)}.pl-post-item:hover{opacity:.7}.pl-post-item__meta{font-family:var(--pl-font-mono);color:var(--pl-color-fg-muted);text-transform:uppercase;letter-spacing:.05em;margin-bottom:.4rem;font-size:11px}.pl-post-item__title{margin-bottom:.4rem;font-size:1.05rem;font-weight:500}.pl-post-item__excerpt{color:var(--pl-color-fg-muted);font-size:14px;line-height:1.55}.pl-prose{color:var(--pl-color-fg);font-size:1rem;line-height:1.7}.pl-prose h2{margin-top:2rem;margin-bottom:.75rem;font-size:1.3rem}.pl-prose h3{margin-top:1.5rem;margin-bottom:.5rem;font-size:1.1rem}.pl-prose p{margin:1rem 0}.pl-prose ul,.pl-prose ol{margin:1rem 0;padding-left:1.25rem}.pl-prose li{margin:.3rem 0}.pl-prose code{background:var(--pl-color-bg-raised);border-radius:var(--pl-radius);color:var(--pl-color-fg);padding:.1rem .35rem;font-size:.88em}.pl-prose pre{background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);margin:1rem 0;padding:1rem;overflow-x:auto}.pl-prose pre code{background:0 0;padding:0}.pl-prose blockquote{border-left:2px solid var(--pl-color-border-strong);color:var(--pl-color-fg-muted);margin:1.5rem 0;padding-left:1rem}.pl-changelog{gap:40px;margin:0;padding:0;list-style:none;display:grid;position:relative}.pl-changelog:before{content:"";background:var(--pl-color-border);width:1px;position:absolute;top:8px;bottom:0;left:12px}.pl-changelog__entry{gap:20px;display:flex;position:relative}.pl-changelog__dot{z-index:1;background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:25px;height:25px;margin-top:2px;display:inline-flex;position:relative}.pl-changelog__dot:after{content:"";background:var(--pl-color-fg-subtle);border-radius:50%;width:6px;height:6px}.pl-changelog__entry--latest .pl-changelog__dot{background:var(--pl-color-accent)}@supports (color:color-mix(in lab, red, red)){.pl-changelog__entry--latest .pl-changelog__dot{background:color-mix(in oklch, var(--pl-color-accent) 15%, transparent)}}.pl-changelog__entry--latest .pl-changelog__dot{border-color:var(--pl-color-accent)}@supports (color:color-mix(in lab, red, red)){.pl-changelog__entry--latest .pl-changelog__dot{border-color:color-mix(in oklch, var(--pl-color-accent) 50%, transparent)}}.pl-changelog__entry--latest .pl-changelog__dot:after{background:var(--pl-color-accent)}.pl-changelog__body{flex:1;min-width:0;padding-bottom:8px}.pl-changelog__meta{flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:12px;display:flex}.pl-changelog__version{font-family:var(--pl-font-mono);color:var(--pl-color-fg-muted);background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);transition:border-color var(--pl-motion-fast) var(--pl-motion-ease);padding:2px 8px;font-size:13px;text-decoration:none}a.pl-changelog__version:hover{border-color:var(--pl-color-accent)}.pl-changelog__entry--latest .pl-changelog__version{color:var(--pl-color-accent-fg);background:var(--pl-color-accent)}@supports (color:color-mix(in lab, red, red)){.pl-changelog__entry--latest .pl-changelog__version{background:color-mix(in oklch, var(--pl-color-accent) 10%, transparent)}}.pl-changelog__entry--latest .pl-changelog__version{border-color:var(--pl-color-accent)}@supports (color:color-mix(in lab, red, red)){.pl-changelog__entry--latest .pl-changelog__version{border-color:color-mix(in oklch, var(--pl-color-accent) 35%, transparent)}}.pl-changelog__date{color:var(--pl-color-fg-subtle);font-size:13px}.pl-changelog__latest{font-family:var(--pl-font-mono);color:var(--pl-color-accent-fg);background:var(--pl-color-accent);padding:1px 6px;font-size:11px}@supports (color:color-mix(in lab, red, red)){.pl-changelog__latest{background:color-mix(in oklch, var(--pl-color-accent) 8%, transparent)}}.pl-changelog__latest{border:var(--pl-border-width) solid var(--pl-color-accent)}@supports (color:color-mix(in lab, red, red)){.pl-changelog__latest{border:var(--pl-border-width) solid color-mix(in oklch, var(--pl-color-accent) 25%, transparent)}}.pl-changelog__latest{border-radius:var(--pl-radius)}.pl-changelog__changes{gap:6px;display:grid}.pl-changelog__change{color:var(--pl-color-fg);align-items:flex-start;gap:8px;font-size:14px;line-height:1.5;display:flex}.pl-changelog__bullet{color:var(--pl-color-fg-subtle);flex-shrink:0;margin-top:1px}.pl-changelog__tag{min-width:52px;font-family:var(--pl-font-mono);text-align:center;text-transform:lowercase;border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);flex-shrink:0;padding:0 6px;font-size:10px;line-height:18px}.pl-changelog__tag--added{color:var(--pl-color-status-success);border-color:var(--pl-color-status-success)}@supports (color:color-mix(in lab, red, red)){.pl-changelog__tag--added{border-color:color-mix(in oklch, var(--pl-color-status-success) 35%, transparent)}}.pl-changelog__tag--fixed{color:var(--pl-color-status-info);border-color:var(--pl-color-status-info)}@supports (color:color-mix(in lab, red, red)){.pl-changelog__tag--fixed{border-color:color-mix(in oklch, var(--pl-color-status-info) 35%, transparent)}}.pl-changelog__tag--changed{color:var(--pl-color-status-warning);border-color:var(--pl-color-status-warning)}@supports (color:color-mix(in lab, red, red)){.pl-changelog__tag--changed{border-color:color-mix(in oklch, var(--pl-color-status-warning) 35%, transparent)}}.pl-changelog__tag--removed{color:var(--pl-color-status-error);border-color:var(--pl-color-status-error)}@supports (color:color-mix(in lab, red, red)){.pl-changelog__tag--removed{border-color:color-mix(in oklch, var(--pl-color-status-error) 35%, transparent)}}.pl-tabs{border-bottom:var(--pl-border-width) solid var(--pl-color-border);gap:2px;display:flex}.pl-tab{color:var(--pl-color-fg-muted);font:inherit;font-family:var(--pl-font-sans);cursor:pointer;border-radius:var(--pl-radius) var(--pl-radius) 0 0;background:0 0;border:none;border-bottom:2px solid #0000;align-items:center;gap:6px;padding:8px 14px;display:inline-flex}.pl-tab__icon{align-items:center;display:inline-flex}.pl-tab__icon svg{width:15px;height:15px}.pl-tab--active .pl-count,.pl-tab:hover:not(:disabled){color:var(--pl-color-fg)}.pl-tab--active{color:var(--pl-color-fg);border-bottom-color:var(--pl-color-fg)}.pl-tab:disabled{opacity:.35;cursor:not-allowed}.pl-tab__lock{opacity:.6;margin-left:5px}.pl-tabs-wrap--responsive{width:100%;container-type:inline-size}.pl-tabs__select{width:100%;font:inherit;color:var(--pl-color-fg);background:var(--pl-color-bg-inset);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);padding:6px 10px;display:none}@container (width<=30rem){.pl-tabs-wrap--responsive>.pl-tabs{display:none}.pl-tabs-wrap--responsive>.pl-tabs__select{display:block}}.pl-board{align-items:flex-start;gap:12px;display:flex;overflow-x:auto}.pl-board-col{background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);flex-direction:column;flex:1 0 200px;min-width:200px;display:flex}.pl-board-col__head{border-bottom:var(--pl-border-width) solid var(--pl-color-border);justify-content:space-between;align-items:center;padding:10px 12px;font-size:12px;font-weight:600;display:flex}.pl-board-col__count{color:var(--pl-color-fg-muted);font-family:var(--pl-font-mono)}.pl-board-col__body{flex-direction:column;gap:8px;min-height:40px;padding:8px;display:flex}.pl-board-card{text-align:left;background:var(--pl-color-bg);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);color:var(--pl-color-fg);cursor:pointer;font:inherit;flex-direction:column;gap:6px;padding:10px 12px;display:flex}.pl-board-card:hover{border-color:var(--pl-color-fg)}.pl-panel-header{justify-content:space-between;align-items:center;gap:var(--pl-space-3);padding:var(--pl-space-3) var(--pl-space-4);border-bottom:var(--pl-border-width) solid var(--pl-color-border);display:flex}.pl-panel-header__kicker{font-family:var(--pl-font-mono);text-transform:uppercase;letter-spacing:.06em;color:var(--pl-color-fg-muted);margin-bottom:2px;font-size:11px}.pl-panel-header__title{font-size:15px;font-weight:var(--pl-font-weight-medium);color:var(--pl-color-fg);margin:0;line-height:1.2}.pl-panel-header__actions{align-items:center;gap:var(--pl-space-2);flex-shrink:0;display:flex}.pl-panel-header--compact{padding:var(--pl-space-2) var(--pl-space-3)}.pl-panel-header--compact .pl-panel-header__title{font-size:13px}.pl-accordion{border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);flex-direction:column;display:flex;overflow:hidden}.pl-accordion__item+.pl-accordion__item{border-top:var(--pl-border-width) solid var(--pl-color-border)}.pl-accordion__trigger{justify-content:space-between;align-items:center;gap:var(--pl-space-3);width:100%;padding:var(--pl-space-3);color:var(--pl-color-fg);font:inherit;text-align:left;cursor:pointer;transition:background var(--pl-motion-fast) var(--pl-motion-ease);background:0 0;border:none;font-size:14px;display:flex}.pl-accordion__trigger:hover{background:var(--pl-color-bg-hover)}.pl-accordion__trigger:focus-visible{outline:2px solid var(--pl-color-focus);outline-offset:-2px}.pl-accordion__trigger:disabled{opacity:.5;cursor:not-allowed}.pl-accordion__title{font-weight:var(--pl-font-weight-medium)}.pl-accordion__chevron{width:16px;height:16px;color:var(--pl-color-fg-muted);transition:transform var(--pl-motion-fast) var(--pl-motion-ease);flex-shrink:0}.pl-accordion__item--open .pl-accordion__chevron{transform:rotate(90deg)}.pl-accordion__panel{padding:0 var(--pl-space-3) var(--pl-space-3);color:var(--pl-color-fg-muted);font-size:14px;line-height:1.55}.pl-tabbar{scrollbar-width:thin;border-bottom:var(--pl-border-width) solid var(--pl-color-border);align-items:stretch;gap:2px;display:flex;overflow-x:auto}.pl-tabbar__tab{min-width:92px;max-width:220px;color:var(--pl-color-fg-muted);font-family:var(--pl-font-sans);cursor:pointer;border-radius:var(--pl-radius) var(--pl-radius) 0 0;transition:background var(--pl-motion-fast) var(--pl-motion-ease), color var(--pl-motion-fast) var(--pl-motion-ease);background:0 0;border:none;border-bottom:2px solid #0000;flex:0 auto;align-items:center;gap:7px;padding:7px 10px 7px 12px;font-size:13px;display:inline-flex}.pl-tabbar__tab:hover{background:var(--pl-color-bg-hover);color:var(--pl-color-fg)}.pl-tabbar__tab:focus-visible{outline:2px solid var(--pl-color-accent);outline-offset:-2px}.pl-tabbar__tab--active{color:var(--pl-color-fg);background:var(--pl-color-bg-subtle);border-bottom-color:var(--pl-color-accent)}.pl-tabbar__icon{align-items:center;display:inline-flex}.pl-tabbar__icon svg{width:15px;height:15px}.pl-tabbar__label{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.pl-tabbar__close{width:18px;height:18px;color:var(--pl-color-fg-subtle);opacity:.7;transition:opacity var(--pl-motion-fast) var(--pl-motion-ease);margin-right:-3px}.pl-tabbar__close:hover{opacity:1}.pl-tabbar__add{flex-shrink:0;width:28px;margin-left:2px}.pl-tabbar-wrap--responsive{width:100%;container-type:inline-size}.pl-tabbar__collapsed{align-items:center;gap:6px;display:none}.pl-tabbar__select{min-width:0;font:inherit;color:var(--pl-color-fg);background:var(--pl-color-bg-inset);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);flex:1;padding:6px 10px}@container (width<=26rem){.pl-tabbar-wrap--responsive>.pl-tabbar{display:none}.pl-tabbar-wrap--responsive>.pl-tabbar__collapsed{display:flex}}.pl-field{display:block}.pl-field__label{text-transform:uppercase;letter-spacing:.05em;color:var(--pl-color-fg-muted);margin-bottom:6px;font-size:11px;display:block}.pl-field__input{background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border);width:100%;color:var(--pl-color-fg);border-radius:var(--pl-radius);font:inherit;font-family:var(--pl-font-sans);resize:vertical;padding:9px 11px}.pl-field__input:focus{border-color:var(--pl-color-fg);outline:none}.pl-input{background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border);width:100%;color:var(--pl-color-fg);border-radius:var(--pl-radius);font:inherit;font-family:var(--pl-font-sans);padding:9px 11px;font-size:13px}.pl-input::placeholder{color:var(--pl-color-fg-muted)}.pl-input:focus{border-color:var(--pl-color-border-strong);outline:none}.pl-input:disabled{opacity:.5;cursor:not-allowed}.pl-textarea{resize:vertical;min-height:72px;line-height:1.5}.pl-select{cursor:pointer}.pl-switch{cursor:pointer;align-items:center;gap:.5rem;display:inline-flex}.pl-switch--disabled{opacity:.5;cursor:not-allowed}.pl-switch__input{opacity:0;width:0;height:0;position:absolute}.pl-switch__track{background:var(--pl-color-bg-subtle);border:var(--pl-border-width) solid var(--pl-color-border-strong);width:32px;height:18px;transition:background var(--pl-motion-fast) var(--pl-motion-ease);border-radius:999px;display:inline-block;position:relative}.pl-switch__thumb{background:var(--pl-color-fg-muted);width:12px;height:12px;transition:transform var(--pl-motion-fast) var(--pl-motion-ease), background var(--pl-motion-fast) var(--pl-motion-ease);border-radius:50%;position:absolute;top:2px;left:2px}.pl-switch__input:checked+.pl-switch__track{background:var(--pl-color-fg);border-color:var(--pl-color-fg)}.pl-switch__input:checked+.pl-switch__track .pl-switch__thumb{background:var(--pl-color-bg);transform:translate(14px)}.pl-switch__input:focus-visible+.pl-switch__track{outline:2px solid var(--pl-color-border-strong);outline-offset:2px}.pl-switch__label{color:var(--pl-color-fg);font-size:13px}.pl-checkbox{cursor:pointer;align-items:center;gap:.5rem;display:inline-flex}.pl-checkbox--disabled{opacity:.5;cursor:not-allowed}.pl-checkbox__input{opacity:0;width:0;height:0;position:absolute}.pl-checkbox__box{background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border-strong);border-radius:var(--pl-radius);width:16px;height:16px;transition:background var(--pl-motion-fast) var(--pl-motion-ease), border-color var(--pl-motion-fast) var(--pl-motion-ease);display:inline-block;position:relative}.pl-checkbox__input:checked+.pl-checkbox__box{background:var(--pl-color-fg);border-color:var(--pl-color-fg)}.pl-checkbox__input:checked+.pl-checkbox__box:after{content:"";border:solid var(--pl-color-bg);border-width:0 2px 2px 0;width:4px;height:8px;position:absolute;top:2px;left:5px;transform:rotate(45deg)}.pl-checkbox__input:focus-visible+.pl-checkbox__box{outline:2px solid var(--pl-color-border-strong);outline-offset:2px}.pl-checkbox__label{color:var(--pl-color-fg);font-size:13px}.pl-radiogroup{gap:var(--pl-space-2);display:grid}.pl-radio{cursor:pointer;align-items:center;gap:.5rem;display:inline-flex}.pl-radio--disabled{opacity:.5;cursor:not-allowed}.pl-radio__input{opacity:0;width:0;height:0;position:absolute}.pl-radio__control{background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border-strong);width:16px;height:16px;transition:background var(--pl-motion-fast) var(--pl-motion-ease), border-color var(--pl-motion-fast) var(--pl-motion-ease);border-radius:50%;flex-shrink:0;display:inline-block;position:relative}.pl-radio__control:after{content:"";background:var(--pl-color-fg);width:6px;height:6px;transition:transform var(--pl-motion-fast) var(--pl-motion-ease);border-radius:50%;margin:auto;position:absolute;inset:0;transform:scale(0)}.pl-radio__input:checked+.pl-radio__control{border-color:var(--pl-color-fg)}.pl-radio__input:checked+.pl-radio__control:after{transform:scale(1)}.pl-radio__input:focus-visible+.pl-radio__control{outline:2px solid var(--pl-color-border-strong);outline-offset:2px}.pl-radio__label{color:var(--pl-color-fg);font-size:13px}.pl-editable{cursor:text;border-radius:calc(var(--pl-radius) - 2px)}.pl-editable:hover{background:var(--pl-color-bg-hover)}.pl-editable:focus-visible{outline:2px solid var(--pl-color-accent);outline-offset:2px}.pl-editable__input{min-width:60px;font:inherit;color:var(--pl-color-fg);background:var(--pl-color-bg-inset);border:var(--pl-border-width) solid var(--pl-color-accent);border-radius:calc(var(--pl-radius) - 2px);outline:none;padding:1px 4px}.pl-editable__input--invalid{border-color:var(--pl-color-status-error)}.pl-overlay{z-index:1000;padding:var(--pl-space-4);background:var(--pl-color-overlay);justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.pl-overlay--drawer{padding:0}.pl-dialog{width:480px;max-width:100%;max-height:calc(100vh - 2 * var(--pl-space-4));background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border-strong);border-radius:var(--pl-radius);box-shadow:var(--pl-shadow-popover);flex-direction:column;display:flex}.pl-dialog:focus{outline:none}.pl-dialog__head{justify-content:space-between;align-items:center;gap:var(--pl-space-3);padding:var(--pl-space-3) var(--pl-space-4);border-bottom:var(--pl-border-width) solid var(--pl-color-border);display:flex}.pl-dialog__title{font-size:14px;font-weight:var(--pl-font-weight-medium);color:var(--pl-color-fg)}.pl-dialog__close{width:24px;height:24px;font-size:18px;line-height:1}.pl-dialog__body{padding:var(--pl-space-4);color:var(--pl-color-fg-muted);font-size:14px;line-height:1.6;overflow-y:auto}.pl-dialog__foot{justify-content:flex-end;gap:var(--pl-space-2);padding:var(--pl-space-3) var(--pl-space-4);border-top:var(--pl-border-width) solid var(--pl-color-border);display:flex}.pl-drawer{background:var(--pl-color-bg-raised);width:420px;max-width:100%;height:100%;box-shadow:var(--pl-shadow-popover);animation:pl-drawer-in var(--pl-motion-base) var(--pl-motion-ease);flex-direction:column;display:flex}.pl-drawer:focus{outline:none}.pl-drawer--right{border-left:var(--pl-border-width) solid var(--pl-color-border-strong);margin-left:auto}.pl-drawer--left{border-right:var(--pl-border-width) solid var(--pl-color-border-strong);margin-right:auto;animation-name:pl-drawer-in-left}.pl-overlay--drawer:has(.pl-drawer--left){justify-content:flex-start}@keyframes pl-drawer-in{0%{transform:translate(100%)}}@keyframes pl-drawer-in-left{0%{transform:translate(-100%)}}.pl-drawer__head{justify-content:space-between;align-items:center;gap:var(--pl-space-3);padding:var(--pl-space-3) var(--pl-space-4);border-bottom:var(--pl-border-width) solid var(--pl-color-border);display:flex}.pl-drawer__title{font-size:14px;font-weight:var(--pl-font-weight-medium);color:var(--pl-color-fg)}.pl-drawer__body{padding:var(--pl-space-4);color:var(--pl-color-fg-muted);flex:1;font-size:14px;line-height:1.6;overflow-y:auto}.pl-drawer__foot{justify-content:flex-end;gap:var(--pl-space-2);padding:var(--pl-space-3) var(--pl-space-4);border-top:var(--pl-border-width) solid var(--pl-color-border);display:flex}.pl-toast-stack{bottom:var(--pl-space-4);right:var(--pl-space-4);z-index:1100;gap:var(--pl-space-2);max-width:min(360px, calc(100vw - 2 * var(--pl-space-4)));flex-direction:column;display:flex;position:fixed}.pl-toast{align-items:flex-start;gap:var(--pl-space-3);padding:var(--pl-space-3);background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);box-shadow:var(--pl-shadow-popover);animation:pl-toast-in var(--pl-motion-base) var(--pl-motion-ease);border-left-width:2px;display:flex}@keyframes pl-toast-in{0%{opacity:0;transform:translateY(6px)}}.pl-toast--success{border-left-color:var(--pl-color-status-success)}.pl-toast--warning{border-left-color:var(--pl-color-status-warning)}.pl-toast--error{border-left-color:var(--pl-color-status-error)}.pl-toast--info{border-left-color:var(--pl-color-status-info)}.pl-toast__body{flex:1;min-width:0}.pl-toast__title{font-family:var(--pl-font-mono);color:var(--pl-color-fg);margin-bottom:.2rem;font-size:12px}.pl-toast__msg{color:var(--pl-color-fg-muted);font-size:13px;line-height:1.5}.pl-toast__close{flex-shrink:0;font-size:16px;line-height:1}.pl-tip-wrap{display:inline-flex;position:relative}.pl-tip{z-index:1200;pointer-events:none;white-space:nowrap;font-family:var(--pl-font-mono);color:var(--pl-color-fg);background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border-strong);border-radius:var(--pl-radius);box-shadow:var(--pl-shadow-popover);opacity:0;transition:opacity var(--pl-motion-fast) var(--pl-motion-ease);padding:.25rem .5rem;font-size:11px;position:absolute}.pl-tip-wrap:hover .pl-tip,.pl-tip-wrap:focus-within .pl-tip{opacity:1}.pl-tip--top{bottom:calc(100% + 6px);left:50%;transform:translate(-50%)}.pl-tip--bottom{top:calc(100% + 6px);left:50%;transform:translate(-50%)}.pl-tip--left{top:50%;right:calc(100% + 6px);transform:translateY(-50%)}.pl-tip--right{top:50%;left:calc(100% + 6px);transform:translateY(-50%)}.pl-popover{min-width:200px;max-width:320px;padding:var(--pl-space-3);color:var(--pl-color-fg);background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border-strong);border-radius:var(--pl-radius);box-shadow:var(--pl-shadow-popover);z-index:1200;font-size:13px;line-height:1.5}.pl-table{border-collapse:collapse;width:100%;font-size:13px}.pl-table th{text-align:left;font-family:var(--pl-font-mono);font-size:11px;font-weight:var(--pl-font-weight-medium);text-transform:uppercase;letter-spacing:.04em;color:var(--pl-color-fg-muted);padding:var(--pl-space-2) var(--pl-space-3);border-bottom:var(--pl-border-width) solid var(--pl-color-border)}.pl-table td{padding:var(--pl-space-2) var(--pl-space-3);color:var(--pl-color-fg);border-bottom:var(--pl-border-width) solid var(--pl-color-border)}.pl-table tbody tr.pl-tr--interactive{cursor:pointer;transition:background var(--pl-motion-fast) var(--pl-motion-ease)}.pl-table tbody tr.pl-tr--interactive:hover{background:var(--pl-color-bg-hover)}.pl-table tbody tr.pl-tr--selected{background:var(--pl-color-bg-subtle)}.pl-dot{background:var(--pl-color-fg-muted);border-radius:50%;width:8px;height:8px;display:inline-block}.pl-dot--success{background:var(--pl-color-status-success)}.pl-dot--warning{background:var(--pl-color-status-warning)}.pl-dot--error{background:var(--pl-color-status-error)}.pl-dot--info{background:var(--pl-color-status-info)}.pl-dot--pulse{animation:pl-dot-pulse var(--pl-motion-status) var(--pl-motion-ease-in-out) infinite}@keyframes pl-dot-pulse{0%,to{opacity:1}50%{opacity:.35}}.pl-dot-row{align-items:center;gap:.4rem;display:inline-flex}.pl-dot-row__label{color:var(--pl-color-fg-muted);font-size:12px}.pl-spinner{border:2px solid var(--pl-color-border-strong);border-top-color:var(--pl-color-fg);animation:pl-spin var(--pl-motion-loading) var(--pl-motion-linear) infinite;border-radius:50%;display:inline-block}@keyframes pl-spin{to{transform:rotate(360deg)}}.pl-scroll{overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:var(--pl-color-border-strong) transparent;min-height:0;overflow:auto}.pl-scroll:focus-visible{outline:1px solid var(--pl-color-fg);outline-offset:-2px}.pl-scroll::-webkit-scrollbar{width:8px;height:8px}.pl-scroll::-webkit-scrollbar-thumb{background:var(--pl-color-border-strong);border-radius:var(--pl-radius)}.pl-scroll::-webkit-scrollbar-track{background:0 0}.pl-skel{border-radius:var(--pl-radius);background-color:var(--pl-color-bg-subtle);background-image:linear-gradient(90deg, var(--pl-color-bg-subtle) 25%, var(--pl-color-bg-hover) 50%, var(--pl-color-bg-subtle) 75%);animation:pl-skel-shimmer 1.4s var(--pl-motion-ease-in-out) infinite;background-size:200% 100%;display:block}@keyframes pl-skel-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.pl-skel-lines{gap:8px;display:grid}.pl-skel-group{gap:var(--pl-space-3);display:grid}@media (prefers-reduced-motion:reduce){.pl-drawer,.pl-toast,.pl-dot--pulse,.pl-rail__dot,.pl-spinner{animation:none}.pl-skel{background-image:none;animation:none}}.pl-progress{gap:var(--pl-space-2);width:100%;display:grid}.pl-progress__caption{justify-content:space-between;align-items:center;gap:var(--pl-space-2);color:var(--pl-color-fg-muted);font-size:12px;display:flex}.pl-progress__value{font-family:var(--pl-font-mono);color:var(--pl-color-fg)}.pl-progress__track{background:var(--pl-color-bg-inset);border-radius:999px;height:6px;position:relative;overflow:hidden}.pl-progress__fill{background:var(--pl-color-accent);border-radius:inherit;height:100%;transition:width var(--pl-motion-base) var(--pl-motion-ease)}.pl-progress__fill--success{background:var(--pl-color-status-success)}.pl-progress__fill--warning{background:var(--pl-color-status-warning)}.pl-progress__fill--error{background:var(--pl-color-status-error)}.pl-progress__fill--info{background:var(--pl-color-status-info)}.pl-progress__fill--indeterminate{width:40%;animation:pl-progress-slide 1.1s var(--pl-motion-ease-in-out) infinite}@keyframes pl-progress-slide{0%{transform:translate(-120%)}to{transform:translate(320%)}}.pl-alert{align-items:flex-start;gap:var(--pl-space-3);padding:var(--pl-space-3);background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);color:var(--pl-color-fg);border-left-width:3px;display:flex}.pl-alert__icon{flex-shrink:0;width:16px;height:16px;margin-top:1px}.pl-alert__body{flex:1;min-width:0;font-size:13px;line-height:1.5}.pl-alert__title{font-weight:var(--pl-font-weight-medium)}.pl-alert__text{color:var(--pl-color-fg-muted)}.pl-alert__title+.pl-alert__text{margin-top:2px}.pl-alert__action{flex-shrink:0}.pl-alert__dismiss{border-radius:var(--pl-radius);color:var(--pl-color-fg-subtle);cursor:pointer;transition:color var(--pl-motion-fast) var(--pl-motion-ease);background:0 0;border:none;flex-shrink:0;margin:-2px -2px 0 0;padding:2px;display:inline-flex}.pl-alert__dismiss:hover{color:var(--pl-color-fg)}.pl-alert__dismiss svg{width:14px;height:14px}.pl-alert--success{border-left-color:var(--pl-color-status-success)}.pl-alert--success .pl-alert__icon{color:var(--pl-color-status-success)}.pl-alert--warning{border-left-color:var(--pl-color-status-warning)}.pl-alert--warning .pl-alert__icon{color:var(--pl-color-status-warning)}.pl-alert--error{border-left-color:var(--pl-color-status-error)}.pl-alert--error .pl-alert__icon{color:var(--pl-color-status-error)}.pl-alert--info{border-left-color:var(--pl-color-status-info)}.pl-alert--info .pl-alert__icon{color:var(--pl-color-status-info)}.pl-alert--neutral .pl-alert__icon{color:var(--pl-color-fg-muted)}.pl-menu__anchor{pointer-events:none;width:0;height:0}.pl-menu{background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border-strong);border-radius:var(--pl-radius);min-width:180px;box-shadow:var(--pl-shadow-popover);z-index:1200;padding:4px}.pl-menu__item{color:var(--pl-color-fg);border-radius:calc(var(--pl-radius) - 1px);cursor:pointer;-webkit-user-select:none;user-select:none;outline:none;align-items:center;gap:8px;padding:6px 8px;font-size:13px;display:flex}.pl-menu__item[data-highlighted]{background:var(--pl-color-bg-hover)}.pl-menu__item[data-disabled]{color:var(--pl-color-fg-muted);opacity:.5;pointer-events:none}.pl-menu__item--destructive{color:var(--pl-color-status-error)}.pl-menu__item--destructive[data-highlighted]{background:var(--pl-color-status-error)}@supports (color:color-mix(in lab, red, red)){.pl-menu__item--destructive[data-highlighted]{background:color-mix(in oklch, var(--pl-color-status-error) 16%, transparent)}}.pl-menu__icon{color:var(--pl-color-fg-muted);align-items:center;display:inline-flex}.pl-menu__icon svg{width:15px;height:15px}.pl-menu__item--destructive .pl-menu__icon{color:var(--pl-color-status-error)}.pl-menu__label{flex:1}.pl-menu__subarrow{color:var(--pl-color-fg-muted);font-size:14px;line-height:1}.pl-menu__sep{background:var(--pl-color-border);height:1px;margin:4px 0}.pl-menu__group-label{font-family:var(--pl-font-mono);text-transform:uppercase;letter-spacing:.06em;color:var(--pl-color-fg-muted);padding:4px 8px;font-size:10px}.pl-rail{background:var(--pl-color-bg-raised);border-right:var(--pl-border-width) solid var(--pl-color-border);flex-direction:column;flex-shrink:0;align-items:stretch;gap:2px;width:64px;padding:6px;display:flex}.pl-rail--right{border-right:none;border-left:var(--pl-border-width) solid var(--pl-color-border)}.pl-rail__btn{border-radius:var(--pl-radius);color:var(--pl-color-fg-muted);cursor:pointer;font:inherit;transition:background var(--pl-motion-fast) var(--pl-motion-ease), color var(--pl-motion-fast) var(--pl-motion-ease);background:0 0;border:none;flex-direction:column;align-items:center;gap:3px;padding:8px 2px;display:flex;position:relative}.pl-rail__btn:hover{background:var(--pl-color-bg-hover);color:var(--pl-color-fg)}.pl-rail__btn--active{background:var(--pl-color-bg-subtle);color:var(--pl-color-fg)}.pl-rail__icon{display:inline-flex}.pl-rail__icon svg{width:18px;height:18px}.pl-rail__label{text-align:center;text-overflow:ellipsis;white-space:nowrap;max-width:100%;font-size:9px;line-height:1.1;overflow:hidden}.pl-count--rail{min-width:15px;height:15px;color:var(--pl-color-fg);border-color:var(--pl-color-border-strong);padding:0 4px;font-size:9px;position:absolute;top:4px;right:9px}.pl-rail__dot{background:var(--pl-color-status-info);width:7px;height:7px;animation:pl-dot-pulse var(--pl-motion-status) var(--pl-motion-ease-in-out) infinite;border-radius:50%;position:absolute;top:6px;right:14px}.pl-mobilenav{background:var(--pl-color-bg-raised);border-top:var(--pl-border-width) solid var(--pl-color-border);align-items:stretch;display:flex}.pl-mobilenav__tab{color:var(--pl-color-fg-muted);font:inherit;cursor:pointer;background:0 0;border:none;flex-direction:column;flex:1;align-items:center;gap:3px;padding:8px 2px;font-size:10px;display:flex}.pl-mobilenav__tab--active{color:var(--pl-color-fg)}.pl-mobilenav__icon{display:inline-flex}.pl-mobilenav__icon svg{width:18px;height:18px}.pl-mobilenav__list{gap:2px;display:grid}.pl-mobilenav__list-item{border-radius:var(--pl-radius);width:100%;color:var(--pl-color-fg);font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;align-items:center;gap:10px;padding:10px 8px;font-size:14px;display:flex}.pl-mobilenav__list-item:hover{background:var(--pl-color-bg-hover)}.pl-mobilenav__list-item--active{background:var(--pl-color-bg-subtle)}.pl-appshell-frame{background:var(--pl-color-bg);height:100%;min-height:0;color:var(--pl-color-fg);flex-direction:column;display:flex}.pl-appshell{background:var(--pl-color-bg);min-height:0;color:var(--pl-color-fg);flex:auto;align-items:stretch;display:flex}.pl-appshell__utility{border-top:var(--pl-border-width) solid var(--pl-color-border);background:var(--pl-color-bg-raised);flex:0 0 40px;align-items:center;height:40px;display:flex}.pl-utilitybar{align-items:center;gap:var(--pl-space-2);width:100%;height:100%;padding:0 var(--pl-space-3);color:var(--pl-color-fg-muted);font-size:12px;display:flex}.pl-utilitybar__cluster{align-items:center;gap:var(--pl-space-3);display:flex}.pl-utilitybar__spacer{flex:1}.pl-appshell__col{flex-direction:column;min-width:0;min-height:0;display:flex;overflow:hidden}.pl-appshell__col--left{flex:auto}.pl-appshell__col--right{border-left:var(--pl-border-width) solid var(--pl-color-border);flex:none}.pl-appshell__col--fill{border-left:none;flex:auto}.pl-appshell__handle{cursor:col-resize;touch-action:none;width:5px;transition:background var(--pl-motion-fast) var(--pl-motion-ease);background:0 0;flex:none}.pl-appshell__handle:hover,.pl-appshell__handle:focus-visible{background:var(--pl-color-border-strong);outline:none}.pl-appshell__reopen{cursor:col-resize;touch-action:none;transition:background var(--pl-motion-fast) var(--pl-motion-ease);background:0 0;border:none;flex:0 0 6px;align-self:stretch;padding:0;position:relative}.pl-appshell__reopen--right{border-left:var(--pl-border-width) solid var(--pl-color-border)}.pl-appshell__reopen--left{border-right:var(--pl-border-width) solid var(--pl-color-border)}.pl-appshell__reopen:hover,.pl-appshell__reopen:focus-visible{background:var(--pl-color-bg-hover);outline:none}.pl-appshell__reopen:after{content:"";background:var(--pl-color-border-strong);opacity:0;width:2px;height:24px;transition:opacity var(--pl-motion-fast) var(--pl-motion-ease);border-radius:2px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.pl-appshell__reopen:hover:after,.pl-appshell__reopen:focus-visible:after{opacity:1}.pl-appshell-frame--dragging{cursor:col-resize;-webkit-user-select:none;user-select:none}.pl-appshell-frame--dragging iframe{pointer-events:none}.pl-appshell--mobile{flex-direction:column}.pl-appshell__mobile-stage{flex:auto;min-height:0;overflow:auto}.pl-rail--sortable .pl-rail__btn{cursor:grab;touch-action:none}.pl-rail--sortable .pl-rail__btn:active{cursor:grabbing}.pl-rail__btn--dragging{opacity:.4}.pl-rail__btn--overlay{width:56px;color:var(--pl-color-fg);background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border-strong);border-radius:var(--pl-radius);box-shadow:var(--pl-shadow-popover);cursor:grabbing;flex-direction:column;align-items:center;gap:3px;padding:8px 2px;display:flex;position:relative}.pl-appshell__header{border-bottom:var(--pl-border-width) solid var(--pl-color-border);background:var(--pl-color-bg-raised);flex:0 0 48px;align-items:center;height:48px;display:flex}.pl-header{align-items:center;gap:var(--pl-space-3);width:100%;height:100%;padding:0 var(--pl-space-3);display:flex}.pl-header__brand{align-items:center;gap:var(--pl-space-2);min-width:0;display:flex}.pl-header__lockup{flex-direction:column;justify-content:center;min-width:0;line-height:1.15;display:flex}.pl-header__name{font-size:13px;font-weight:var(--pl-font-weight-medium);color:var(--pl-color-fg);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pl-header__org{font-family:var(--pl-font-mono);color:var(--pl-color-fg-muted);font-size:10px}.pl-header__spacer{flex:1}.pl-header__status{align-items:center;display:flex}.pl-header__actions{align-items:center;gap:var(--pl-space-2);display:flex}.pl-toolcard-list{gap:var(--pl-space-2);flex-direction:column;min-width:0;display:flex}.pl-toolcard-group{flex-direction:column;gap:6px;min-width:0;display:flex}.pl-toolcard{background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);min-width:0;max-width:100%;overflow:hidden}.pl-toolcard__head-row{align-items:center;display:flex}.pl-toolcard__head{min-width:0;color:var(--pl-color-fg-muted);font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;flex:auto;align-items:center;gap:7px;padding:6px 9px;font-size:12px;display:flex}.pl-toolcard__actions{color:var(--pl-color-fg-muted);flex:none;align-items:center;gap:2px;padding-right:6px;display:inline-flex}.pl-toolcard__head:disabled{cursor:default}.pl-toolcard__head:hover:not(:disabled) .pl-toolcard__name{color:var(--pl-color-fg)}.pl-toolcard__caret{color:var(--pl-color-fg-subtle);transition:transform var(--pl-motion-fast) var(--pl-motion-ease);flex:none;display:inline-flex}.pl-toolcard__caret--open{transform:rotate(90deg)}.pl-toolcard__caret--hidden{visibility:hidden}.pl-toolcard__icon{color:var(--pl-color-fg-muted);flex:none;display:inline-flex}.pl-toolcard__icon svg{width:13px;height:13px}.pl-toolcard__name{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--pl-font-mono);color:var(--pl-color-fg);flex:auto;overflow:hidden}.pl-toolcard__dur{font-family:var(--pl-font-mono);color:var(--pl-color-fg-muted);font-variant-numeric:tabular-nums;flex:none;font-size:10px}.pl-toolcard__status{flex:none;display:inline-flex}.pl-toolcard__status--done{color:var(--pl-color-status-success)}.pl-toolcard__status--error{color:var(--pl-color-status-error)}.pl-toolcard__status--running{color:var(--pl-color-status-warning)}.pl-toolcard__spin{animation:.8s linear infinite pl-spin}.pl-toolcard__body{border-top:var(--pl-border-width) solid var(--pl-color-border);flex-direction:column;gap:8px;padding:8px 9px;display:flex}.pl-toolcard__children{border-left:2px solid var(--pl-color-border);flex-direction:column;gap:6px;min-width:0;margin-left:14px;padding-left:10px;display:flex}.pl-toolcard__section{flex-direction:column;gap:4px;min-width:0;display:flex}.pl-toolcard__section-head{justify-content:space-between;align-items:center;gap:8px;display:flex}.pl-toolcard__label{font-family:var(--pl-font-mono);text-transform:uppercase;letter-spacing:.04em;color:var(--pl-color-fg-subtle);font-size:10px}.pl-toolcard__copy{padding:2px}.pl-splash{z-index:2000;background:var(--pl-color-bg);opacity:1;justify-content:center;align-items:center;transition-property:opacity;transition-timing-function:ease-out;display:flex;position:fixed;inset:0}.pl-splash__rise{flex-direction:column;align-items:center;gap:20px;animation:.7s cubic-bezier(.2,.6,.2,1) both pl-splash-rise;display:flex}.pl-splash__mark{filter:drop-shadow(0 0 14px var(--pl-color-accent));display:inline-flex}@supports (color:color-mix(in lab, red, red)){.pl-splash__mark{filter:drop-shadow(0 0 14px color-mix(in srgb, var(--pl-color-accent) 35%, transparent))}}.pl-splash__word{font-family:var(--pl-font-sans);font-size:2rem;font-weight:var(--pl-font-weight-semibold,600);letter-spacing:-.01em;color:var(--pl-color-fg)}.pl-splash__word--gradient{background:var(--pl-gradient-brand);-webkit-text-fill-color:transparent;color:#0000;-webkit-background-clip:text;background-clip:text}@keyframes pl-splash-rise{0%{opacity:0;transform:translateY(10px)scale(.985)}to{opacity:1;transform:none}}.pl-bootgate{z-index:1900;padding:var(--pl-space-5);background:var(--pl-color-bg);justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.pl-bootgate__inner{align-items:center;gap:var(--pl-space-4);text-align:center;flex-direction:column;max-width:360px;display:flex}.pl-bootgate__mark{opacity:.9;filter:drop-shadow(0 0 10px var(--pl-color-accent));display:inline-flex}@supports (color:color-mix(in lab, red, red)){.pl-bootgate__mark{filter:drop-shadow(0 0 10px color-mix(in srgb, var(--pl-color-accent) 25%, transparent))}}.pl-bootgate__spinner{border:2.5px solid var(--pl-color-border);border-top-color:var(--pl-color-accent);border-radius:50%;width:26px;height:26px;animation:.8s linear infinite pl-spin}.pl-bootgate__title{font-size:1.05rem;font-weight:var(--pl-font-weight-semibold,600);letter-spacing:-.01em;color:var(--pl-color-fg)}.pl-bootgate__detail{color:var(--pl-color-fg-muted);margin:0;font-size:.85rem;line-height:1.45}.pl-theme-panel{width:100%;height:100%;color:var(--pl-color-fg);background:var(--pl-color-bg-raised);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);flex-direction:column;font-size:13px;display:flex}.pl-theme-panel__bar{align-items:center;gap:var(--pl-space-3);padding:var(--pl-space-3);border-bottom:var(--pl-border-width) solid var(--pl-color-border);display:flex}.pl-theme-panel__title{font-weight:var(--pl-font-weight-medium)}.pl-theme-panel__spacer{flex:1}.pl-segmented{background:var(--pl-color-bg-inset);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);padding:2px;display:inline-flex}.pl-segmented__btn{font:inherit;text-transform:capitalize;color:var(--pl-color-fg-muted);border-radius:calc(var(--pl-radius) - 1px);cursor:pointer;transition:background var(--pl-motion-fast) var(--pl-motion-ease), color var(--pl-motion-fast) var(--pl-motion-ease);background:0 0;border:none;padding:3px 12px;font-size:12px}.pl-segmented__btn--active{color:var(--pl-color-fg);background:var(--pl-color-bg-raised)}.pl-theme-panel__presets{align-items:center;gap:var(--pl-space-2);padding:var(--pl-space-3);border-bottom:var(--pl-border-width) solid var(--pl-color-border);flex-wrap:wrap;display:flex}.pl-theme-panel__preset-select{flex:140px}.pl-theme-panel__preset-name{flex:120px}.pl-theme-panel__groups{gap:var(--pl-space-4);min-height:0;padding:var(--pl-space-3);flex-direction:column;flex:1;display:flex;overflow-y:auto}.pl-theme-group{border:none;margin:0;padding:0}.pl-theme-group__legend{padding:0 0 var(--pl-space-2);font-size:10px;font-weight:var(--pl-font-weight-medium);text-transform:uppercase;letter-spacing:.06em;color:var(--pl-color-fg-subtle)}.pl-theme-row{align-items:center;gap:var(--pl-space-2);padding:3px 0;display:flex}.pl-theme-row__swatch{border:var(--pl-border-width) solid var(--pl-color-border-strong);border-radius:var(--pl-radius);cursor:pointer;background:0 0;flex-shrink:0;width:22px;height:22px;padding:0}.pl-theme-row__swatch::-webkit-color-swatch-wrapper{padding:0}.pl-theme-row__swatch::-webkit-color-swatch{border-radius:calc(var(--pl-radius) - 1px);border:none}.pl-theme-row__swatch::-moz-color-swatch{border-radius:calc(var(--pl-radius) - 1px);border:none}.pl-theme-row__swatch--none{cursor:default;border-color:#0000}.pl-theme-row__label{color:var(--pl-color-fg-muted);text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.pl-theme-row__value{width:116px;font-family:var(--pl-font-mono);color:var(--pl-color-fg);background:var(--pl-color-bg-inset);border:var(--pl-border-width) solid var(--pl-color-border);border-radius:var(--pl-radius);flex-shrink:0;padding:3px 6px;font-size:11px}.pl-theme-row__value:focus-visible{outline:2px solid var(--pl-color-focus);outline-offset:-1px}.pl-theme-row--changed .pl-theme-row__label{color:var(--pl-color-fg)}.pl-theme-row--changed .pl-theme-row__value{border-color:var(--pl-color-accent)}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(87% 0 0);--chart-2:oklch(55.6% 0 0);--chart-3:oklch(43.9% 0 0);--chart-4:oklch(37.1% 0 0);--chart-5:oklch(26.9% 0 0);--radius:.625rem;--surface:#0a0a0a;--raised:#18181b;--edge:#27272a;--fg:#f4f4f5;--fg-body:#e4e4e7;--fg-muted:#a1a1aa;--fg-subtle:#8a8a93;--fg-faint:#767680;--success:#34d399;--danger:#f87171;--brand:#9b87f2;--brand-mid:#818cf8;--brand-deep:#6366f1;--brand-gradient:linear-gradient(135deg, #9b87f2 0%, #818cf8 50%, #6366f1 100%);--orb-accent:#9b87f2;--orb:var(--orb-accent,var(--brand));--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0)}html,body{background:var(--surface);min-height:100svh;color:var(--fg-body);-webkit-font-smoothing:antialiased;overscroll-behavior:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;margin:0;font:16px/1.4 ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}.h-screen-dvh{height:100dvh}.min-h-screen-dvh{min-height:100dvh}.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(87% 0 0);--chart-2:oklch(55.6% 0 0);--chart-3:oklch(43.9% 0 0);--chart-4:oklch(37.1% 0 0);--chart-5:oklch(26.9% 0 0);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes tw-shimmer{0%{background-position:100% 0}to{background-position:0 0}} diff --git a/sites/demo/dist/assets/index-fEqLULUK.js b/sites/demo/dist/assets/index-fEqLULUK.js new file mode 100644 index 00000000..1418f7de --- /dev/null +++ b/sites/demo/dist/assets/index-fEqLULUK.js @@ -0,0 +1,5889 @@ +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,j(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1oe||(e.current=ae[oe],ae[oe]=null,oe--)}function le(e,t){oe++,ae[oe]=e.current,e.current=t}var ue=se(null),de=se(null),fe=se(null),pe=se(null);function me(e,t){switch(le(fe,t),le(de,e),le(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Wd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Wd(t),e=Gd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ce(ue),le(ue,e)}function he(){ce(ue),ce(de),ce(fe)}function ge(e){e.memoizedState!==null&&le(pe,e);var t=ue.current,n=Gd(t,e.type);t!==n&&(le(de,e),le(ue,n))}function _e(e){de.current===e&&(ce(ue),ce(de)),pe.current===e&&(ce(pe),tp._currentValue=ie)}var ve,ye;function be(e){if(ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ve=t&&t[1]||``,ye=-1)`:-1i||c[r]!==l[i]){var u=` +`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{P=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?be(n):``}function Se(e,t){switch(e.tag){case 26:case 27:case 5:return be(e.type);case 16:return be(`Lazy`);case 13:return e.child!==t&&t!==null?be(`Suspense Fallback`):be(`Suspense`);case 19:return be(`SuspenseList`);case 0:case 15:return xe(e.type,!1);case 11:return xe(e.type.render,!1);case 1:return xe(e.type,!0);case 31:return be(`Activity`);default:return``}}function F(e){try{var t=``,n=null;do t+=Se(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var I=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,L=t.unstable_cancelCallback,we=t.unstable_shouldYield,Te=t.unstable_requestPaint,Ee=t.unstable_now,De=t.unstable_getCurrentPriorityLevel,Oe=t.unstable_ImmediatePriority,ke=t.unstable_UserBlockingPriority,Ae=t.unstable_NormalPriority,je=t.unstable_LowPriority,Me=t.unstable_IdlePriority,Ne=t.log,Pe=t.unstable_setDisableYieldValue,Fe=null,Ie=null;function R(e){if(typeof Ne==`function`&&Pe(e),Ie&&typeof Ie.setStrictMode==`function`)try{Ie.setStrictMode(Fe,e)}catch{}}var Le=Math.clz32?Math.clz32:Be,Re=Math.log,ze=Math.LN2;function Be(e){return e>>>=0,e===0?32:31-(Re(e)/ze|0)|0}var Ve=256,He=262144,Ue=4194304;function We(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ge(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=We(n))):i=We(o):i=We(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=We(n))):i=We(o)):i=We(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ke(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Je(){var e=Ue;return Ue<<=1,!(Ue&62914560)&&(Ue=4194304),e}function Ye(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),un=!1;if(ln)try{var dn={};Object.defineProperty(dn,"passive",{get:function(){un=!0}}),window.addEventListener(`test`,dn,dn),window.removeEventListener(`test`,dn,dn)}catch{un=!1}var fn=null,pn=null,mn=null;function hn(){if(mn)return mn;var e,t=pn,n=t.length,r,i=`value`in fn?fn.value:fn.textContent,a=i.length;for(e=0;e=Gn),Jn=` `,Yn=!1;function Xn(e,t){switch(e){case`keyup`:return Un.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function V(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Zn=!1;function Qn(e,t){switch(e){case`compositionend`:return V(t);case`keypress`:return t.which===32?(Yn=!0,Jn):null;case`textInput`:return e=t.data,e===Jn&&Yn?null:e;default:return null}}function $n(e,t){if(Zn)return e===`compositionend`||!Wn&&Xn(e,t)?(e=hn(),mn=pn=fn=null,Zn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=It(e.document)}return t}function Cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var wr=ln&&`documentMode`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==It(r)||(r=Tr,`selectionStart`in r&&Cr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dr&&U(Dr,r)||(Dr=r,r=Od(Er,`onSelect`),0>=o,i-=o,bi=1<<32-Le(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Oi&&Si(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Oi&&Si(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Oi&&Si(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Oi&&Si(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&xa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Oa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=oi(o.type,o.key,o.props,null,e.mode,c),Oa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=ui(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=xa(o),b(e,r,o,c)}if(re(o))return h(e,r,o,c);if(te(o)){if(l=te(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Da(o),c);if(o.$$typeof===C)return b(e,r,Xi(e,o),c);ka(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ea=0;var i=b(e,t,n,r);return Ta=null,i}catch(t){if(t===ga||t===va)throw t;var a=ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var q=Aa(!0),ja=Aa(!1),Ma=!1;function Na(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Fa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ia(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Il&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=$r(e),Qr(e,null,n),t}return Yr(e,r,t,n),$r(e)}function La(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}function Ra(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var za=!1;function Ba(){if(za){var e=sa;if(e!==null)throw e}}function Va(e,t,n,r){za=!1;var i=e.updateQueue;Ma=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===oa&&(za=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ma=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Kl|=o,e.lanes=o,e.memoizedState=d}}function Ha(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ua(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=M.T,s={};M.T=s,ks(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Os(e,t,ua(c,r),mu(e)):Os(e,t,r,mu(e))}catch(n){Os(e,t,{then:function(){},status:`rejected`,reason:n},mu())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function vs(){}function ys(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=bs(e).queue;_s(e,a,t,ie,n===null?vs:function(){return xs(e),n(r)})}function bs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:ie},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function xs(e){var t=bs(e);t.next===null&&(t=e.alternate.memoizedState),Os(e,t.next.queue,{},mu())}function Ss(){return Yi(tp)}function Cs(){return To().memoizedState}function ws(){return To().memoizedState}function Ts(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mu();e=Fa(n);var r=Ia(t,e,n);r!==null&&(gu(r,t,n),La(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Es(e,t,n){var r=mu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},As(e)?js(t,n):(n=Xr(e,t,n,r),n!==null&&(gu(n,e,r),Ms(n,t,r)))}function Ds(e,t,n){Os(e,t,n,mu())}function Os(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(As(e))js(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,vr(s,o))return Yr(e,t,i,0),Ll===null&&Jr(),!1}catch{}if(n=Xr(e,t,i,r),n!==null)return gu(n,e,r),Ms(n,t,r),!0}return!1}function ks(e,t,n,r){if(r={lane:2,revertLane:fd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},As(e)){if(t)throw Error(i(479))}else t=Xr(e,n,r,2),t!==null&&gu(t,e,2)}function As(e){var t=e.alternate;return e===io||t!==null&&t===io}function js(e,t){co=so=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ms(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var Ns={readContext:Yi,use:Oo,useCallback:ho,useContext:ho,useEffect:ho,useImperativeHandle:ho,useLayoutEffect:ho,useInsertionEffect:ho,useMemo:ho,useReducer:ho,useRef:ho,useState:ho,useDebugValue:ho,useDeferredValue:ho,useTransition:ho,useSyncExternalStore:ho,useId:ho,useHostTransitionStatus:ho,useFormState:ho,useActionState:ho,useOptimistic:ho,useMemoCache:ho,useCacheRefresh:ho};Ns.useEffectEvent=ho;var Ps={readContext:Yi,use:Oo,useCallback:function(e,t){return wo().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:is,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ns(4194308,4,us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ns(4194308,4,e,t)},useInsertionEffect:function(e,t){ns(4,2,e,t)},useMemo:function(e,t){var n=wo();t=t===void 0?null:t;var r=e();if(lo){R(!0);try{e()}finally{R(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=wo();if(n!==void 0){var i=n(t);if(lo){R(!0);try{n(t)}finally{R(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Es.bind(null,io,e),[r.memoizedState,e]},useRef:function(e){var t=wo();return e={current:e},t.memoizedState=e},useState:function(e){e=Bo(e);var t=e.queue,n=Ds.bind(null,io,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:fs,useDeferredValue:function(e,t){return hs(wo(),e,t)},useTransition:function(){var e=Bo(!1);return e=_s.bind(null,io,e.queue,!0,!1),wo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=io,a=wo();if(Oi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ll===null)throw Error(i(349));Y&127||Fo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,is(Lo.bind(null,r,o,e),[e]),r.flags|=2048,es(9,{destroy:void 0},Io.bind(null,r,o,n,t),null),n},useId:function(){var e=wo(),t=Ll.identifierPrefix;if(Oi){var n=xi,r=bi;n=(r&~(1<<32-Le(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=uo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ot]=t,o[st]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Ld(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Oc(t)}}return Nc(t),kc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=fe.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ei,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Pd(e.nodeValue,n)),e||Mi(t,!0)}else e=Ud(e).createTextNode(r),e[ot]=t,t.stateNode=e}return Nc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Fi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ot]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nc(t),e=!1}else n=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(eo(t),t):(eo(t),null);if(t.flags&128)throw Error(i(558))}return Nc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Fi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ot]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nc(t),a=!1}else a=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(eo(t),t):(eo(t),null)}return eo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),jc(t,t.updateQueue),Nc(t),null);case 4:return he(),e===null&&wd(t.stateNode.containerInfo),Nc(t),null;case 10:return Ui(t.type),Nc(t),null;case 19:if(ce(to),r=t.memoizedState,r===null)return Nc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Mc(r,!1);else{if(Gl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=no(e),o!==null){for(t.flags|=128,Mc(r,!1),e=o.updateQueue,t.updateQueue=e,jc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ai(n,e),n=n.sibling;return le(to,to.current&1|2),Oi&&Si(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ee()>nu&&(t.flags|=128,a=!0,Mc(r,!1),t.lanes=4194304)}else{if(!a)if(e=no(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,jc(t,e),Mc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Oi)return Nc(t),null}else 2*Ee()-r.renderingStartTime>nu&&n!==536870912&&(t.flags|=128,a=!0,Mc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Nc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ee(),e.sibling=null,n=to.current,le(to,a?n&1|2:n&1),Oi&&Si(t,r.treeForkCount),e);case 22:case 23:return eo(t),qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Nc(t),t.subtreeFlags&6&&(t.flags|=8192)):Nc(t),n=t.updateQueue,n!==null&&jc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ce(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ta),Nc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Fc(e,t){switch(wi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),he(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(eo(t),t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(eo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ce(to),null;case 4:return he(),null;case 10:return Ui(t.type),null;case 22:case 23:return eo(t),qa(),e!==null&&ce(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(ta),null;case 25:return null;default:return null}}function Ic(e,t){switch(wi(t),t.tag){case 3:Ui(ta),he();break;case 26:case 27:case 5:_e(t);break;case 4:he();break;case 31:t.memoizedState!==null&&eo(t);break;case 13:eo(t);break;case 19:ce(to);break;case 10:Ui(t.type);break;case 22:case 23:eo(t),qa(),e!==null&&ce(fa);break;case 24:Ui(ta)}}function Lc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){X(t,t.return,e)}}function Rc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){X(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){X(t,t.return,e)}}function zc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ua(t,n)}catch(t){X(e,e.return,t)}}}function Bc(e,t,n){n.props=Vs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){X(e,t,n)}}function Vc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){X(e,t,n)}}function Hc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){X(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){X(e,t,n)}else n.current=null}function Uc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){X(e,e.return,t)}}function Wc(e,t,n){try{var r=e.stateNode;Rd(r,e.type,n,t),r[st]=t}catch(t){X(e,e.return,t)}}function Gc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ef(e.type)||e.tag===4}function Kc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Gc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ef(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$t));else if(r!==4&&(r===27&&ef(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&ef(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ld(t,r,n),t[ot]=e,t[st]=n}catch(t){X(e,e.return,t)}}var Xc=!1,Zc=!1,Qc=!1,$c=typeof WeakSet==`function`?WeakSet:Set,el=null;function tl(e,t){if(e=e.containerInfo,Vd=up,e=Sr(e),Cr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Hd={focusedElem:e,selectionRange:n},up=!1,el=t;el!==null;)if(t=el,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,el=e;else for(;el!==null;){switch(t=el,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Ld(o,r,n),o[ot]=e,yt(o),r=o;break a;case`link`:var s=Wf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=br(s,h),v=br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,M.T=null,n=uu,uu=null;var o=ou,s=cu;if(au=0,su=ou=null,cu=0,Il&6)throw Error(i(331));var c=Il;if(Il|=4,jl(o.current),Cl(o,o.current,s,n),Il=c,ad(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot==`function`)try{Ie.onPostCommitFiberRoot(Fe,o)}catch{}return!0}finally{N.p=a,M.T=r,Hu(e,t)}}function Gu(e,t,n){t=fi(n,t),t=qs(e.stateNode,t,2),e=Ia(e,t,2),e!==null&&(Xe(e,2),id(e))}function X(e,t,n){if(e.tag===3)Gu(e,e,n);else for(;t!==null;){if(t.tag===3){Gu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(iu===null||!iu.has(r))){e=fi(n,e),n=Js(2),r=Ia(t,n,2),r!==null&&(Ys(n,r,t,e),Xe(r,2),id(r));break}}t=t.return}}function Ku(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Fl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Ul=!0,i.add(n),e=qu.bind(null,e,t,n),t.then(e,e))}function qu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ll===e&&(Y&n)===n&&(Gl===4||Gl===3&&(Y&62914560)===Y&&300>Ee()-eu?!(Il&2)&&Cu(e,0):Jl|=n,Xl===Y&&(Xl=0)),id(e)}function Ju(e,t){t===0&&(t=Je()),e=Zr(e,t),e!==null&&(Xe(e,t),id(e))}function Yu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ju(e,n)}function Xu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ju(e,n)}function Zu(e,t){return Ce(e,t)}var Qu=null,$u=null,ed=!1,td=!1,nd=!1,rd=0;function id(e){e!==$u&&e.next===null&&($u===null?Qu=$u=e:$u=$u.next=e),td=!0,ed||(ed=!0,dd())}function ad(e,t){if(!nd&&td){nd=!0;do for(var n=!1,r=Qu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Le(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ud(r,a))}else a=Y,a=Ge(r,r===Ll?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ke(r,a)||(n=!0,ud(r,a));r=r.next}while(n);nd=!1}}function od(){sd()}function sd(){td=ed=!1;var e=0;rd!==0&&Jd()&&(e=rd);for(var t=Ee(),n=null,r=Qu;r!==null;){var i=r.next,a=cd(r,t);a===0?(r.next=null,n===null?Qu=i:n.next=i,i===null&&($u=n)):(n=r,(e!==0||a&3)&&(td=!0)),r=i}au!==0&&au!==5||ad(e,!1),rd!==0&&(rd=0)}function cd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&zd(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function wf(e,t,n){var r=Cf;if(r&&typeof t==`string`&&t){var i=Rt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),vf.has(i)||(vf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Ld(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Tf(e){bf.D(e),wf(`dns-prefetch`,e,null)}function Ef(e,t){bf.C(e,t),wf(`preconnect`,e,t)}function Df(e,t,n){bf.L(e,t,n);var r=Cf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Rt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Rt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Rt(n.imageSizes)+`"]`)):i+=`[href="`+Rt(e)+`"]`;var a=i;switch(t){case`style`:a=Nf(e);break;case`script`:a=Lf(e)}_f.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),_f.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Pf(a))||t===`script`&&r.querySelector(Rf(a))||(t=r.createElement(`link`),Ld(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Of(e,t){bf.m(e,t);var n=Cf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Rt(r)+`"][href="`+Rt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Lf(e)}if(!_f.has(a)&&(e=m({rel:`modulepreload`,href:e},t),_f.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Rf(a)))return}r=n.createElement(`link`),Ld(r,`link`,e),yt(r),n.head.appendChild(r)}}}function kf(e,t,n){bf.S(e,t,n);var r=Cf;if(r&&e){var i=vt(r).hoistableStyles,a=Nf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Pf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=_f.get(a))&&Vf(e,n);var c=o=r.createElement(`link`);yt(c),Ld(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Bf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Af(e,t){bf.X(e,t);var n=Cf;if(n&&e){var r=vt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=m({src:e,async:!0},t),(t=_f.get(i))&&Hf(e,t),a=n.createElement(`script`),yt(a),Ld(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t){bf.M(e,t);var n=Cf;if(n&&e){var r=vt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=_f.get(i))&&Hf(e,t),a=n.createElement(`script`),yt(a),Ld(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t,n,r){var a=(a=fe.current)?yf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Nf(n.href),n=vt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Nf(n.href);var o=vt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Pf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),_f.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},_f.set(e,n),o||If(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Lf(n),n=vt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Nf(e){return`href="`+Rt(e)+`"`}function Pf(e){return`link[rel="stylesheet"][`+e+`]`}function Ff(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function If(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Ld(t,`link`,n),yt(t),e.head.appendChild(t))}function Lf(e){return`[src="`+Rt(e)+`"]`}function Rf(e){return`script[async]`+e}function zf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Rt(n.href)+`"]`);if(r)return t.instance=r,yt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),yt(r),Ld(r,`style`,a),Bf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Nf(n.href);var o=e.querySelector(Pf(a));if(o)return t.state.loading|=4,t.instance=o,yt(o),o;r=Ff(n),(a=_f.get(a))&&Vf(r,a),o=(e.ownerDocument||e).createElement(`link`),yt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Ld(o,`link`,r),t.state.loading|=4,Bf(o,n.precedence,e),t.instance=o;case`script`:return o=Lf(n.src),(a=e.querySelector(Rf(o)))?(t.instance=a,yt(a),a):(r=n,(a=_f.get(o))&&(r=m({},n),Hf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),yt(a),Ld(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Bf(r,n.precedence,e));return t.instance}function Bf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Kf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function qf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Jf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Nf(r.href),a=t.querySelector(Pf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Zf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,yt(a);return}a=t.ownerDocument||t,r=Ff(r),(i=_f.get(i))&&Vf(r,i),a=a.createElement(`link`),yt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Ld(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Zf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Yf=0;function Xf(e,t){return e.stylesheets&&e.count===0&&$f(e,e.stylesheets),0Yf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Zf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$f(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qf=null;function $f(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qf=new Map,t.forEach(ep,e),Qf=null,Zf.call(e))}function ep(e,t){if(!(t.state.loading&4)){var n=Qf.get(e);if(n)var r=n.get(null);else{n=new Map,Qf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_(),b=new Map;function x(e,t){let n=b.get(e);return n||(n=new Set,b.set(e,n)),n.add(t),()=>{n.delete(t)}}function S(e,t){b.get(e)?.forEach(e=>e(t))}function C(e,t){S(`orbis-sse`,{event:e,data:JSON.stringify(t)})}var w=0;async function T(e,t){return x(e,n=>t({event:e,id:w++,payload:n}))}var E={state:`idle`,activation:null,wakePhrase:null,micListening:!1,micMuted:!1,connected:!1,lastUserTranscript:null,lastBotText:null,activeToolCall:null,delegationProgress:null,delegationOutcome:null,sessionId:null,epoch:0},D=new class{snap=E;listeners=new Set;getSnapshot=()=>this.snap;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});update(e){this.snap={...this.snap,...e,epoch:this.snap.epoch+1},this.listeners.forEach(e=>e())}reset(){this.snap={...E},this.listeners.forEach(e=>e())}},O=`orbis.widgets.v1`;function k(){try{let e=localStorage.getItem(O);if(!e)return[];let t=JSON.parse(e);if(Array.isArray(t))return t.filter(e=>e&&typeof e.id==`string`&&(e.surface===`dock`||e.surface===`window`)).map(e=>({id:e.id,surface:e.surface,x:typeof e.x==`number`?e.x:void 0,y:typeof e.y==`number`?e.y:void 0,props:e.props&&typeof e.props==`object`?e.props:void 0}))}catch{}return[]}var A=new class{open=k();listeners=new Set;constructor(){typeof window<`u`&&window.addEventListener(`storage`,e=>{e.key===O&&(this.open=k(),this.listeners.forEach(e=>e()))})}getSnapshot=()=>this.open;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});isOpen(e){return this.open.some(t=>t.id===e)}openWidget(e,t=`dock`){if(this.isOpen(e)){this.setSurface(e,t);return}this.open=[...this.open,{id:e,surface:t}],this.commit()}close(e){this.isOpen(e)&&(this.open=this.open.filter(t=>t.id!==e),this.commit())}toggle(e,t=`dock`){this.isOpen(e)?this.close(e):this.openWidget(e,t)}setSurface(e,t){let n=!1;this.open=this.open.map(r=>r.id===e&&r.surface!==t?(n=!0,{...r,surface:t}):r),n&&this.commit()}setProps(e,t){this.isOpen(e)&&(this.open=this.open.map(n=>n.id===e?{...n,props:{...n.props??{},...t}}:n),this.commit())}setPosition(e,t,n){let r=!1;this.open=this.open.map(i=>i.id===e&&(i.x!==t||i.y!==n)?(r=!0,{...i,x:t,y:n}):i),r&&this.commit()}commit(){try{localStorage.setItem(O,JSON.stringify(this.open))}catch{}this.listeners.forEach(e=>e())}};function ee(){let e=new Map,t=new Set,n=[],r=()=>{n=Array.from(e.values()),t.forEach(e=>e())};return{register:t=>(e.set(t.id,t),r(),()=>{e.delete(t.id)&&r()}),get:t=>e.get(t),all:()=>n,subscribe:e=>(t.add(e),()=>{t.delete(e)})}}var te=ee(),j=e=>te.register(e),ne=`orbis.params`,re=`orbis.palette`,M=`orbis.customPresets.v2`;function N(e,t){if(!e)return t;try{return JSON.parse(e)}catch{return t}}function ie(){try{return localStorage.getItem(re)}catch{return null}}function ae(e){try{localStorage.setItem(re,e)}catch{}}function oe(){try{return N(localStorage.getItem(ne),null)}catch{return null}}function se(e){try{localStorage.setItem(ne,JSON.stringify(e))}catch{}}function ce(e){return le()[e]??{}}function le(){try{return N(localStorage.getItem(M),{})}catch{return{}}}var ue=`orbis.orb.variant`;function de(){try{return localStorage.getItem(ue)??`fractal`}catch{return`fractal`}}function fe(e){try{localStorage.setItem(ue,e)}catch{}}var pe=class{snap;listeners=new Set;pending=null;constructor(){let e=de(),t=te.get(e)??te.all()[0],n=ie(),r=(n&&n.length>0?n:t?.defaultPalette)||`Aurora`,i=t?.palettes?.[r]??{},a=oe()??{};this.snap={variantId:t?.id??e,palette:r,params:{...i,...a},stateOverrides:{},moodOverrides:{},epoch:0},te.get(e)||(this.pending={variantId:e,palette:n??void 0}),te.subscribe(()=>this.tryApplyPending())}tryApplyPending(){let e=this.pending;if(!e)return;let t=te.get(e.variantId);if(!t)return;this.pending=null;let n=e.palette&&t.palettes[e.palette]?e.palette:t.defaultPalette,r=t.palettes[n]??{};this.snap={...this.snap,variantId:t.id,palette:n,params:{...r},epoch:this.snap.epoch+1},this.listeners.forEach(e=>e()),fe(t.id),ae(n),se(this.snap.params)}setOverrides(e,t){this.snap={...this.snap,stateOverrides:e,moodOverrides:t,epoch:this.snap.epoch+1},this.listeners.forEach(e=>e())}getSnapshot=()=>this.snap;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});setParam(e,t){let n={...this.snap.params,[e]:t};this.snap={...this.snap,params:n,epoch:this.snap.epoch+1},this.listeners.forEach(e=>e()),se(n)}setParams(e){let t={...this.snap.params,...e};this.snap={...this.snap,params:t,epoch:this.snap.epoch+1},this.listeners.forEach(e=>e()),se(t)}setPreset(e){if(this.pending){this.pending.palette=e,ae(e);return}let t=te.get(this.snap.variantId)?.palettes?.[e]??{};this.snap={...this.snap,palette:e,params:{...t},epoch:this.snap.epoch+1},this.listeners.forEach(e=>e()),ae(e),se(this.snap.params)}setVariant(e){let t=te.get(e);if(!t){this.pending={variantId:e},fe(e);return}this.pending=null;let n=t.defaultPalette,r=t.palettes[n]??{};this.snap={...this.snap,variantId:e,palette:n,params:{...r},epoch:this.snap.epoch+1},this.listeners.forEach(e=>e()),fe(e),ae(n),se(this.snap.params)}loadCustomPreset(e){let t=ce(this.snap.variantId)[e];if(!t)return;let n=t.palette||this.snap.palette;this.snap={...this.snap,palette:n,params:{...t.params},epoch:this.snap.epoch+1},this.listeners.forEach(e=>e()),n&&ae(n),se(this.snap.params)}},me=null,he={get:()=>(me||=new pe,me),getSnapshot:()=>(me||=new pe,me.getSnapshot()),subscribe:e=>(me||=new pe,me.subscribe(e))};function ge(e,t){he.get().setParam(e,t)}function _e(e){he.get().setPreset(e)}function ve(e){he.get().setVariant(e)}function ye(e,t){if(e===`__connected`){D.update({connected:!0});return}let n;try{n=JSON.parse(t)}catch{return}switch(e){case`bot-state`:{let e=n.state;e&&D.update({state:e});break}case`transcript`:{let e=n.source,t=n.text;e===`user`&&t?D.update({lastUserTranscript:t}):e===`bot`&&t&&D.update({lastBotText:t});break}case`session`:{let e=n.event;e===`start`?D.update({connected:!0,sessionId:n.session_id??null,state:`idle`}):e===`end`&&D.update({state:`idle`,sessionId:null});break}case`tool-call`:{let e=n.event;e===`start`&&n.name?D.update({activeToolCall:{name:String(n.name),args:P(n.args)},delegationProgress:null,delegationOutcome:null}):e===`end`&&D.update({activeToolCall:null,delegationProgress:null,delegationOutcome:n.outcome??`success`});break}case`delegation-progress`:typeof n.text==`string`&&D.update({delegationProgress:n.text});break;case`widget`:{let e=n.id;if(!e)break;if((n.action??`open`)===`close`)A.close(e);else{A.openWidget(e);let t=n.props;t&&typeof t==`object`&&A.setProps(e,t)}break}case`orb-config`:{let e=n.variant,t=n.palette;e&&ve(e),t&&_e(t);let r=n.params;if(r&&typeof r==`object`)for(let[e,t]of Object.entries(r))ge(e,t);break}}}function be(){let e=(0,v.useRef)(null),t=(0,v.useRef)(null);(0,v.useEffect)(()=>{let n=!1;return T(`orbis-sse`,e=>{ye(e.payload.event,e.payload.data)}).then(t=>{if(n){t();return}e.current=t,D.update({connected:!0})}).catch(()=>{}),T(`wake-state`,e=>{let t=e.payload?.state,n=t===`armed`||t===`listening`?t:null;D.update({activation:n,wakePhrase:e.payload?.phrase??null})}).then(e=>{if(n){e();return}t.current=e}).catch(()=>{}),()=>{n=!0,e.current&&=(e.current(),null),t.current&&=(t.current(),null),D.update({connected:!1})}},[])}function P(e){if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}}var xe={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Se={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},F=`attached`,I=`detached`,Ce=1e3,L=1001,we=1002,Te=1003,Ee=1004,De=1004,Oe=1005,ke=1005,Ae=1006,je=1007,Me=1007,Ne=1008,Pe=1008,Fe=1009,Ie=1010,R=1011,Le=1012,Re=1013,ze=1014,Be=1015,Ve=1016,He=1017,Ue=1018,We=1020,Ge=35902,Ke=35899,qe=1021,Je=1022,Ye=1023,Xe=1026,Ze=1027,Qe=1028,$e=1029,et=1030,tt=1031,nt=1032,rt=1033,it=33776,at=33777,ot=33778,st=33779,ct=35840,lt=35841,ut=35842,dt=35843,ft=36196,pt=37492,mt=37496,ht=37488,gt=37489,_t=37490,vt=37491,yt=37808,bt=37809,xt=37810,St=37811,Ct=37812,wt=37813,Tt=37814,Et=37815,Dt=37816,Ot=37817,kt=37818,At=37819,jt=37820,Mt=37821,Nt=36492,Pt=36494,Ft=36495,It=36283,Lt=36284,Rt=36285,zt=36286,Bt=2200,Vt=2201,Ht=2202,Ut=2300,Wt=2301,Gt=2302,Kt=2303,qt=2400,Jt=2401,Yt=2402,Xt=2500,Zt=2501,Qt=3200,$t=3201,en=3202,tn=3203,nn=`srgb`,rn=`srgb-linear`,an=`linear`,on=`srgb`,sn=7680,cn=7681,ln=7682,un=7683,dn=34055,fn=34056,pn=5386,mn=35044,hn=35048,gn=35040,_n=35045,vn=35049,yn=35041,bn=35046,xn=35050,Sn=35042,Cn=`300 es`,wn=2e3,Tn=2001,En={COMPUTE:`compute`,RENDER:`render`},Dn={PERSPECTIVE:`perspective`,LINEAR:`linear`,FLAT:`flat`},On={NORMAL:`normal`,CENTROID:`centroid`,SAMPLE:`sample`,FIRST:`first`,EITHER:`either`},kn={TEXTURE_COMPARE:`depthTextureCompare`};function An(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}var jn={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Mn(e,t){return new jn[e](t)}function Nn(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Pn(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function Fn(){let e=Pn(`canvas`);return e.style.display=`block`,e}var In={},Ln=null;function Rn(e){Ln=e}function zn(){return Ln}function Bn(...e){let t=`THREE.`+e.shift();Ln?Ln(`log`,t,...e):console.log(t,...e)}function Vn(e){let t=e[0];if(typeof t==`string`&&t.startsWith(`TSL:`)){let t=e[1];t&&t.isStackTrace?e[0]+=` `+t.getLocation():e[1]=`Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.`}return e}function z(...e){e=Vn(e);let t=`THREE.`+e.shift();if(Ln)Ln(`warn`,t,...e);else{let n=e[0];n&&n.isStackTrace?console.warn(n.getError(t)):console.warn(t,...e)}}function B(...e){e=Vn(e);let t=`THREE.`+e.shift();if(Ln)Ln(`error`,t,...e);else{let n=e[0];n&&n.isStackTrace?console.error(n.getError(t)):console.error(t,...e)}}function Hn(...e){let t=e.join(` `);t in In||(In[t]=!0,z(...e))}function Un(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}var Wn={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3},Gn=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n>8&255]+Kn[e>>16&255]+Kn[e>>24&255]+`-`+Kn[t&255]+Kn[t>>8&255]+`-`+Kn[t>>16&15|64]+Kn[t>>24&255]+`-`+Kn[n&63|128]+Kn[n>>8&255]+`-`+Kn[n>>16&255]+Kn[n>>24&255]+Kn[r&255]+Kn[r>>8&255]+Kn[r>>16&255]+Kn[r>>24&255]).toLowerCase()}function V(e,t,n){return Math.max(t,Math.min(n,e))}function Zn(e,t){return(e%t+t)%t}function Qn(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function $n(e,t,n){return e===t?0:(n-e)/(t-e)}function er(e,t,n){return(1-n)*e+n*t}function tr(e,t,n,r){return er(e,t,1-Math.exp(-n*r))}function nr(e,t=1){return t-Math.abs(Zn(e,t*2)-t)}function rr(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function ir(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function ar(e,t){return e+Math.floor(Math.random()*(t-e+1))}function or(e,t){return e+Math.random()*(t-e)}function sr(e){return e*(.5-Math.random())}function cr(e){e!==void 0&&(qn=e);let t=qn+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function lr(e){return e*Jn}function ur(e){return e*Yn}function dr(e){return(e&e-1)==0&&e!==0}function fr(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function pr(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function mr(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:z(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function hr(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`Invalid component type.`)}}function gr(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`Invalid component type.`)}}var _r={DEG2RAD:Jn,RAD2DEG:Yn,generateUUID:Xn,clamp:V,euclideanModulo:Zn,mapLinear:Qn,inverseLerp:$n,lerp:er,damp:tr,pingpong:nr,smoothstep:rr,smootherstep:ir,randInt:ar,randFloat:or,randFloatSpread:sr,seededRandom:cr,degToRad:lr,radToDeg:ur,isPowerOfTwo:dr,ceilPowerOfTwo:fr,floorPowerOfTwo:pr,setQuaternionFromProperEuler:mr,normalize:gr,denormalize:hr},H=class e{static{e.prototype.isVector2=!0}constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=V(this.x,e.x,t.x),this.y=V(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=V(this.x,e,t),this.y=V(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(V(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(V(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},vr=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:z(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(V(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},U=class e{static{e.prototype.isVector3=!0}constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(br.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(br.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=V(this.x,e.x,t.x),this.y=V(this.y,e.y,t.y),this.z=V(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=V(this.x,e,t),this.y=V(this.y,e,t),this.z=V(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(V(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return yr.copy(this).projectOnVector(e),this.sub(yr)}reflect(e){return this.sub(yr.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(V(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},yr=new U,br=new vr,xr=class e{static{e.prototype.isMatrix3=!0}constructor(e,t,n,r,i,a,o,s,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Sr.makeScale(e,t)),this}rotate(e){return this.premultiply(Sr.makeRotation(-e)),this}translate(e,t){return this.premultiply(Sr.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},Sr=new xr,Cr=new xr().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),wr=new xr().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Tr(){let e={enabled:!0,workingColorSpace:rn,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=Dr(e.r),e.g=Dr(e.g),e.b=Dr(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=Or(e.r),e.g=Or(e.g),e.b=Or(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?an:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return Hn(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return Hn(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[rn]:{primaries:t,whitePoint:r,transfer:an,toXYZ:Cr,fromXYZ:wr,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:nn},outputColorSpaceConfig:{drawingBufferColorSpace:nn}},[nn]:{primaries:t,whitePoint:r,transfer:on,toXYZ:Cr,fromXYZ:wr,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:nn}}}),e}var Er=Tr();function Dr(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function Or(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}var kr,Ar=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{kr===void 0&&(kr=Pn(`canvas`)),kr.width=e.width,kr.height=e.height;let t=kr.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=kr}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=Pn(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(Fr).x}get height(){return this.source.getSize(Fr).y}get depth(){return this.source.getSize(Fr).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){z(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){z(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:`Texture`,generator:`Texture.toJSON`},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ce:e.x-=Math.floor(e.x);break;case L:e.x=e.x<0?0:1;break;case we:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Ce:e.y-=Math.floor(e.y);break;case L:e.y=e.y<0?0:1;break;case we:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};Ir.DEFAULT_IMAGE=null,Ir.DEFAULT_MAPPING=300,Ir.DEFAULT_ANISOTROPY=1;var Lr=class e{static{e.prototype.isVector4=!0}constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w===void 0?1:e.w,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)s&&e>_?e_?s1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t0){r.children=[];for(let t=0;t0){r.animations=[];for(let t=0;t0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot===null?null:e.pivot.clone(),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let t=0;t.025?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,s.eventsEnabled&&s.dispatchEvent({type:`gripUpdated`,data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(vi)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new _i;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},bi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},xi={h:0,s:0,l:0},Si={h:0,s:0,l:0};function Ci(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var G=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=nn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Er.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=Er.workingColorSpace){return this.r=e,this.g=t,this.b=n,Er.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=Er.workingColorSpace){if(e=Zn(e,1),t=V(t,0,1),n=V(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Ci(i,r,e+1/3),this.g=Ci(i,r,e),this.b=Ci(i,r,e-1/3)}return Er.colorSpaceToWorking(this,r),this}setStyle(e,t=nn){function n(t){t!==void 0&&parseFloat(t)<1&&z(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:z(`Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);z(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=nn){let n=bi[e.toLowerCase()];return n===void 0?z(`Color: Unknown color `+e):this.setHex(n,t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Dr(e.r),this.g=Dr(e.g),this.b=Dr(e.b),this}copyLinearToSRGB(e){return this.r=Or(e.r),this.g=Or(e.g),this.b=Or(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=nn){return Er.workingToColorSpace(wi.copy(this),e),Math.round(V(wi.r*255,0,255))*65536+Math.round(V(wi.g*255,0,255))*256+Math.round(V(wi.b*255,0,255))}getHexString(e=nn){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Er.workingColorSpace){Er.workingToColorSpace(wi.copy(this),t);let n=wi.r,r=wi.g,i=wi.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},Oi=new U,ki=new U,Ai=new U,ji=new U,Mi=new U,Ni=new U,Pi=new U,Fi=new U,Ii=new U,Li=new U,Ri=new Lr,zi=new Lr,Bi=new Lr,Vi=class e{constructor(e=new U,t=new U,n=new U){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Oi.subVectors(e,t),r.cross(Oi);let i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Oi.subVectors(r,t),ki.subVectors(n,t),Ai.subVectors(e,t);let a=Oi.dot(Oi),o=Oi.dot(ki),s=Oi.dot(Ai),c=ki.dot(ki),l=ki.dot(Ai),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,ji)===null?!1:ji.x>=0&&ji.y>=0&&ji.x+ji.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,ji)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,ji.x),s.addScaledVector(a,ji.y),s.addScaledVector(o,ji.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return Ri.setScalar(0),zi.setScalar(0),Bi.setScalar(0),Ri.fromBufferAttribute(e,t),zi.fromBufferAttribute(e,n),Bi.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(Ri,i.x),a.addScaledVector(zi,i.y),a.addScaledVector(Bi,i.z),a}static isFrontFacing(e,t,n,r){return Oi.subVectors(n,t),ki.subVectors(e,t),Oi.cross(ki).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Oi.subVectors(this.c,this.b),ki.subVectors(this.a,this.b),Oi.cross(ki).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;Mi.subVectors(r,n),Ni.subVectors(i,n),Fi.subVectors(e,n);let s=Mi.dot(Fi),c=Ni.dot(Fi);if(s<=0&&c<=0)return t.copy(n);Ii.subVectors(e,r);let l=Mi.dot(Ii),u=Ni.dot(Ii);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Mi,a);Li.subVectors(e,i);let f=Mi.dot(Li),p=Ni.dot(Li);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(Ni,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return Pi.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(Pi,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(Mi,a).addScaledVector(Ni,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},Hi=class{constructor(e=new U(1/0,1/0,1/0),t=new U(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Wi),Wi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Qi),$i.subVectors(this.max,Qi),Ki.subVectors(e.a,Qi),qi.subVectors(e.b,Qi),Ji.subVectors(e.c,Qi),Yi.subVectors(qi,Ki),Xi.subVectors(Ji,qi),Zi.subVectors(Ki,Ji);let t=[0,-Yi.z,Yi.y,0,-Xi.z,Xi.y,0,-Zi.z,Zi.y,Yi.z,0,-Yi.x,Xi.z,0,-Xi.x,Zi.z,0,-Zi.x,-Yi.y,Yi.x,0,-Xi.y,Xi.x,0,-Zi.y,Zi.x,0];return!na(t,Ki,qi,Ji,$i)||(t=[1,0,0,0,1,0,0,0,1],!na(t,Ki,qi,Ji,$i))?!1:(ea.crossVectors(Yi,Xi),t=[ea.x,ea.y,ea.z],na(t,Ki,qi,Ji,$i))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Wi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Wi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Ui[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ui[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ui[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ui[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ui[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ui[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ui[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ui[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ui),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}},Ui=[new U,new U,new U,new U,new U,new U,new U,new U],Wi=new U,Gi=new Hi,Ki=new U,qi=new U,Ji=new U,Yi=new U,Xi=new U,Zi=new U,Qi=new U,$i=new U,ea=new U,ta=new U;function na(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){ta.fromArray(e,a);let o=i.x*Math.abs(ta.x)+i.y*Math.abs(ta.y)+i.z*Math.abs(ta.z),s=t.dot(ta),c=n.dot(ta),l=r.dot(ta);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}var ra=ia();function ia(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(r[e]=0,r[e|256]=32768,i[e]=24,i[e|256]=24):t<-14?(r[e]=1024>>-t-14,r[e|256]=1024>>-t-14|32768,i[e]=-t-1,i[e|256]=-t-1):t<=15?(r[e]=t+15<<10,r[e|256]=t+15<<10|32768,i[e]=13,i[e|256]=13):t<128?(r[e]=31744,r[e|256]=64512,i[e]=24,i[e|256]=24):(r[e]=31744,r[e|256]=64512,i[e]=13,i[e|256]=13)}let a=new Uint32Array(2048),o=new Uint32Array(64),s=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;!(t&8388608);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(s[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:o,offsetTable:s}}function aa(e){Math.abs(e)>65504&&z(`DataUtils.toHalfFloat(): Value out of range.`),e=V(e,-65504,65504),ra.floatView[0]=e;let t=ra.uint32View[0],n=t>>23&511;return ra.baseTable[n]+((t&8388607)>>ra.shiftTable[n])}function oa(e){let t=e>>10;return ra.uint32View[0]=ra.mantissaTable[ra.offsetTable[t]+(e&1023)]+ra.exponentTable[t],ra.floatView[0]}var sa=class{static toHalfFloat(e){return aa(e)}static fromHalfFloat(e){return oa(e)}},ca=new U,la=new H,ua=0,da=class extends Gn{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:ua++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=mn,this.updateRanges=[],this.gpuType=Be,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;xa.subVectors(e,this.center);let t=xa.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(xa,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Sa.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(xa.copy(e.center).add(Sa)),this.expandByPoint(xa.copy(e.center).sub(Sa))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}},wa=0,Ta=new W,Ea=new gi,Da=new U,Oa=new Hi,ka=new Hi,Aa=new U,q=class e extends Gn{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:wa++}),this.uuid=Xn(),this.name=``,this.type=`BufferGeometry`,this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(An(e)?va:ga)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let t=new xr().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Ta.makeRotationFromQuaternion(e),this.applyMatrix4(Ta),this}rotateX(e){return Ta.makeRotationX(e),this.applyMatrix4(Ta),this}rotateY(e){return Ta.makeRotationY(e),this.applyMatrix4(Ta),this}rotateZ(e){return Ta.makeRotationZ(e),this.applyMatrix4(Ta),this}translate(e,t,n){return Ta.makeTranslation(e,t,n),this.applyMatrix4(Ta),this}scale(e,t,n){return Ta.makeScale(e,t,n),this.applyMatrix4(Ta),this}lookAt(e){return Ea.lookAt(e),Ea.updateMatrix(),this.applyMatrix4(Ea.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Da).negate(),this.translate(Da.x,Da.y,Da.z),this}setFromPoints(e){let t=this.getAttribute(`position`);if(t===void 0){let t=[];for(let n=0,r=e.length;nt.count&&z(`BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.`),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Hi);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){B(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new U(-1/0,-1/0,-1/0),new U(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e0&&(e.userData=this.userData),this.parameters!==void 0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){z(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){z(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:`dispose`})}set needsUpdate(e){e===!0&&this.version++}},Ia=class extends Fa{constructor(e){super(),this.isSpriteMaterial=!0,this.type=`SpriteMaterial`,this.color=new G(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},La,Ra=new U,za=new U,Ba=new U,Va=new H,Ha=new H,Ua=new W,Wa=new U,J=new U,Ga=new U,Ka=new H,qa=new H,Ja=new H,Ya=class extends gi{constructor(e=new Ia){if(super(),this.isSprite=!0,this.type=`Sprite`,La===void 0){La=new q;let e=new ja(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);La.setIndex([0,1,2,0,2,3]),La.setAttribute(`position`,new Na(e,3,0,!1)),La.setAttribute(`uv`,new Na(e,2,3,!1))}this.geometry=La,this.material=e,this.center=new H(.5,.5),this.count=1}raycast(e,t){e.camera===null&&B(`Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.`),za.setFromMatrixScale(this.matrixWorld),Ua.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Ba.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&za.multiplyScalar(-Ba.z);let n=this.material.rotation,r,i;n!==0&&(i=Math.cos(n),r=Math.sin(n));let a=this.center;Xa(Wa.set(-.5,-.5,0),Ba,a,za,r,i),Xa(J.set(.5,-.5,0),Ba,a,za,r,i),Xa(Ga.set(.5,.5,0),Ba,a,za,r,i),Ka.set(0,0),qa.set(1,0),Ja.set(1,1);let o=e.ray.intersectTriangle(Wa,J,Ga,!1,Ra);if(o===null&&(Xa(J.set(-.5,.5,0),Ba,a,za,r,i),qa.set(0,1),o=e.ray.intersectTriangle(Wa,Ga,J,!1,Ra),o===null))return;let s=e.ray.origin.distanceTo(Ra);se.far||t.push({distance:s,point:Ra.clone(),uv:Vi.getInterpolation(Ra,Wa,J,Ga,Ka,qa,Ja,new H),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};function Xa(e,t,n,r,i,a){Va.subVectors(e,n).addScalar(.5).multiply(r),i===void 0?Ha.copy(Va):(Ha.x=a*Va.x-i*Va.y,Ha.y=i*Va.x+a*Va.y),e.copy(t),e.x+=Ha.x,e.y+=Ha.y,e.applyMatrix4(Ua)}var Za=new U,Qa=new U,$a=class extends gi{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type=`LOD`,Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let e=0,n=t.length;e0){let n,r;for(n=1,r=t.length;n0){Za.setFromMatrixPosition(this.matrixWorld);let n=e.ray.origin.distanceTo(Za);this.getObjectForDistance(n).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){Za.setFromMatrixPosition(e.matrixWorld),Qa.setFromMatrixPosition(this.matrixWorld);let n=Za.distanceTo(Qa)/e.zoom;t[0].object.visible=!0;let r,i;for(r=1,i=t.length;r=e)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r0)if(u=a*s-o,d=a*o-s,p=i*l,u>=0)if(d>=-p)if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(to).addScaledVector(no,d),f}intersectSphere(e,t){eo.subVectors(e.center,this.origin);let n=eo.dot(this.direction),r=eo.dot(eo)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,eo)!==null}intersectTriangle(e,t,n,r,i){io.subVectors(t,e),ao.subVectors(n,e),oo.crossVectors(io,ao);let a=this.direction.dot(oo),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;ro.subVectors(this.origin,e);let s=o*this.direction.dot(ao.crossVectors(ro,ao));if(s<0)return null;let c=o*this.direction.dot(io.cross(ro));if(c<0||s+c>a)return null;let l=-o*ro.dot(oo);return l<0?null:this.at(l/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},co=class extends Fa{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new G(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new $r,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},lo=new W,uo=new so,fo=new Ca,po=new U,mo=new U,ho=new U,go=new U,_o=new U,vo=new U,yo=new U,bo=new U,xo=class extends gi{constructor(e=new q,t=new co){super(),this.isMesh=!0,this.type=`Mesh`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e(e.far-e.near)**2))&&(lo.copy(i).invert(),uo.copy(e.ray).applyMatrix4(lo),!(n.boundingBox!==null&&uo.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,uo)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null)if(Array.isArray(a))for(let i=0,s=d.length;in.far?null:{distance:l,point:bo.clone(),object:e}}function Co(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,mo),e.getVertexPosition(c,ho),e.getVertexPosition(l,go);let u=So(e,t,n,r,mo,ho,go,yo);if(u){let e=new U;Vi.getBarycoord(yo,mo,ho,go,e),i&&(u.uv=Vi.getInterpolatedAttribute(i,s,c,l,e,new H)),a&&(u.uv1=Vi.getInterpolatedAttribute(a,s,c,l,e,new H)),o&&(u.normal=Vi.getInterpolatedAttribute(o,s,c,l,e,new U),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new U,materialIndex:0};Vi.getNormal(mo,ho,go,t.normal),u.face=t,u.barycoord=e}return u}var wo=new Lr,To=new Lr,Eo=new Lr,Do=new Lr,Oo=new W,ko=new U,Ao=new Ca,jo=new W,Mo=new so,No=class extends xo{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type=`SkinnedMesh`,this.bindMode=F,this.bindMatrix=new W,this.bindMatrixInverse=new W,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Hi),this.boundingBox.makeEmpty();let t=e.getAttribute(`position`);for(let e=0;e1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||Xo.getNormalMatrix(e),r=this.coplanarPoint(Jo).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}},Qo=new Ca,$o=new H(.5,.5),es=new U,ts=class{constructor(e=new Zo,t=new Zo,n=new Zo,r=new Zo,i=new Zo,a=new Zo){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=wn,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===2e3)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else if(t===2001)r[5].setComponents(s,d,h,y).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Qo.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Qo.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Qo)}intersectsSprite(e){return Qo.center.set(0,0,0),Qo.radius=.7071067811865476+$o.distanceTo(e.center),Qo.applyMatrix4(e.matrixWorld),this.intersectsSphere(Qo)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,es.y=r.normal.y>0?e.max.y:e.min.y,es.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(es)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}},ns=new W,rs=new ts,is=class e{constructor(){this.coordinateSystem=wn}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let n=0;n=i.length&&i.push({start:-1,count:-1,z:-1,index:-1});let o=i[this.index];a.push(o),this.index++,o.start=e,o.count=t,o.z=n,o.index=r}reset(){this.list.length=0,this.index=0}},ls=new W,us=new G(1,1,1),ds=new ts,fs=new is,ps=new Hi,ms=new Ca,hs=new U,gs=new U,_s=new U,vs=new cs,ys=new xo,bs=[];function xs(e,t,n=0){let r=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){let i=e.count;for(let a=0;a65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new da(e,1))}this._geometryInitialized=!0}}_validateGeometry(e){let t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw Error(`THREE.BatchedMesh: All geometries must consistently have "index".`);for(let n in t.attributes){if(!e.hasAttribute(n))throw Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);let r=e.getAttribute(n),i=t.getAttribute(n);if(r.itemSize!==i.itemSize||r.normalized!==i.normalized)throw Error(`THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.`)}}validateInstanceId(e){let t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){let t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Hi);let e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,r=t.length;n=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw Error(`THREE.BatchedMesh: Maximum item count reached.`);let t={visible:!0,active:!0,geometryIndex:e},n=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(as),n=this._availableInstanceIds.shift(),this._instanceInfo[n]=t):(n=this._instanceInfo.length,this._instanceInfo.push(t));let r=this._matricesTexture;ls.identity().toArray(r.image.data,n*16),r.needsUpdate=!0;let i=this._colorsTexture;return i&&(us.toArray(i.image.data,n*4),i.needsUpdate=!0),this._visibilityChanged=!0,n}addGeometry(e,t=-1,n=-1){this._initializeGeometry(e),this._validateGeometry(e);let r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},i=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=t===-1?e.getAttribute(`position`).count:t;let a=e.getIndex();if(a!==null&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=n===-1?a.count:n),r.indexStart!==-1&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw Error(`THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.`);let o;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(as),o=this._availableGeometryIds.shift(),i[o]=r):(o=this._geometryCount,this._geometryCount++,i.push(r)),this.setGeometryAt(o,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,o}setGeometryAt(e,t){if(e>=this._geometryCount)throw Error(`THREE.BatchedMesh: Maximum geometry count reached.`);this._validateGeometry(t);let n=this.geometry,r=n.getIndex()!==null,i=n.getIndex(),a=t.getIndex(),o=this._geometryInfo[e];if(r&&a.count>o.reservedIndexCount||t.attributes.position.count>o.reservedVertexCount)throw Error(`THREE.BatchedMesh: Reserved space not large enough for provided geometry.`);let s=o.vertexStart,c=o.reservedVertexCount;o.vertexCount=t.getAttribute(`position`).count;for(let e in n.attributes){let r=t.getAttribute(e),i=n.getAttribute(e);xs(r,i,s);let a=r.itemSize;for(let e=r.count,t=c;e=t.length||t[e].active===!1)return this;let n=this._instanceInfo;for(let t=0,r=n.length;tt).sort((e,t)=>n[e].vertexStart-n[t].vertexStart),i=this.geometry;for(let a=0,o=n.length;a=this._geometryCount)return null;let n=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){let e=new Hi,t=n.index,i=n.attributes.position;for(let n=r.start,a=r.start+r.count;n=this._geometryCount)return null;let n=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){let t=new Ca;this.getBoundingBoxAt(e,ps),ps.getCenter(t.center);let i=n.index,a=n.attributes.position,o=0;for(let e=r.start,n=r.start+r.count;ee.active);if(Math.max(...n.map(e=>e.vertexStart+e.reservedVertexCount))>e)throw Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(e=>e.indexStart+e.reservedIndexCount))>t)throw Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);let r=this.geometry;r.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new q,this._initializeGeometry(r));let i=this.geometry;r.index&&Ss(r.index.array,i.index.array);for(let e in r.attributes)Ss(r.attributes[e].array,i.attributes[e].array)}raycast(e,t){let n=this._instanceInfo,r=this._geometryInfo,i=this.matrixWorld,a=this.geometry;ys.material=this.material,ys.geometry.index=a.index,ys.geometry.attributes=a.attributes,ys.geometry.boundingBox===null&&(ys.geometry.boundingBox=new Hi),ys.geometry.boundingSphere===null&&(ys.geometry.boundingSphere=new Ca);for(let a=0,o=n.length;a({...e,boundingBox:e.boundingBox===null?null:e.boundingBox.clone(),boundingSphere:e.boundingSphere===null?null:e.boundingSphere.clone()})),this._instanceInfo=e._instanceInfo.map(e=>({...e})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,n,r,i){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let a=r.getIndex(),o=a===null?1:a.array.BYTES_PER_ELEMENT,s=1;i.wireframe&&(s=2,o=r.attributes.position.count>65535?4:2);let c=this._instanceInfo,l=this._multiDrawStarts,u=this._multiDrawCounts,d=this._geometryInfo,f=this.perObjectFrustumCulled,p=this._indirectTexture,m=p.image.data,h=n.isArrayCamera?fs:ds;f&&!n.isArrayCamera&&(ls.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),ds.setFromProjectionMatrix(ls,n.coordinateSystem,n.reversedDepth));let g=0;if(this.sortObjects){ls.copy(this.matrixWorld).invert(),hs.setFromMatrixPosition(n.matrixWorld).applyMatrix4(ls),gs.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(ls);for(let e=0,t=c.length;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;er)return;As.applyMatrix4(e.matrixWorld);let c=t.ray.origin.distanceTo(As);if(!(ct.far))return{distance:c,point:js.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}var Ps=new U,Fs=new U,Is=class extends Ms{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type=`LineSegments`}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[];for(let e=0,r=t.count;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;ei.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}var Gs=class extends Ir{constructor(e,t,n,r,i=Ae,a=Ae,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;let l=this;function u(){l.needsUpdate=!0,l._requestVideoFrameCallbackId=e.requestVideoFrameCallback(u)}`requestVideoFrameCallback`in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(u))}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;!(`requestVideoFrameCallback`in e)&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}},Ks=class extends Gs{constructor(e,t,n,r,i,a,o,s){super({},e,t,n,r,i,a,o,s),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}},qs=class extends Ir{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Te,this.minFilter=Te,this.generateMipmaps=!1,this.needsUpdate=!0}},Js=class extends Ir{constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}},Ys=class extends Js{constructor(e,t,n,r,i,a){super(e,t,n,i,a),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=L,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},Xs=class extends Js{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,301),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}},Zs=class extends Ir{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},Qs=class extends Ir{constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isCanvasTexture=!0,this.needsUpdate=!0}},$s=class extends Ir{constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isHTMLTexture=!0,this.generateMipmaps=!1,this.needsUpdate=!0;let l=e?e.parentNode:null;l!==null&&`requestPaint`in l&&(l.onpaint=()=>{this.needsUpdate=!0},l.requestPaint())}dispose(){let e=this.image?this.image.parentNode:null;e!==null&&`onpaint`in e&&(e.onpaint=null),super.dispose()}},ec=class extends Ir{constructor(e,t,n=ze,r,i,a,o=Te,s=Te,c,l=Xe,u=1){if(l!==1026&&l!==1027)throw Error(`DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Mr(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},tc=class extends ec{constructor(e,t=ze,n=301,r,i,a=Te,o=Te,s,c=Xe){let l={width:e,height:e,depth:1},u=[l,l,l,l,l,l];super(e,e,t,n,r,i,a,o,s,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},nc=class extends Ir{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},rc=class e extends q{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new K(c,3)),this.setAttribute(`normal`,new K(l,3)),this.setAttribute(`uv`,new K(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new U;for(let a=0;a0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e0){let e=(_-1)*m;for(let t=0;t0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute(`position`,new K(u,3)),this.setAttribute(`normal`,new K(d,3)),this.setAttribute(`uv`,new K(f,2));function _(){let a=new U,_=new U,v=0,y=(t-e)/n;for(let c=0;c<=i;c++){let l=[],g=c/i,v=g*(t-e)+e;for(let e=0;e<=r;e++){let t=e/r,i=t*s+o,c=Math.sin(i),m=Math.cos(i);_.x=v*c,_.y=-g*n+h,_.z=v*m,u.push(_.x,_.y,_.z),a.set(c,y,m).normalize(),d.push(a.x,a.y,a.z),f.push(t,1-g),l.push(p++)}m.push(l)}for(let n=0;n0||r!==0)&&(l.push(a,o,c),v+=3),(t>0||r!==i-1)&&(l.push(o,s,c),v+=3)}c.addGroup(g,v,0),g+=v}function v(n){let i=p,a=new H,m=new U,_=0,v=n===!0?e:t,y=n===!0?1:-1;for(let e=1;e<=r;e++)u.push(0,h*y,0),d.push(0,y,0),f.push(.5,.5),p++;let b=p;for(let e=0;e<=r;e++){let t=e/r*s+o,n=Math.cos(t),i=Math.sin(t);m.x=v*i,m.y=h*y,m.z=v*n,u.push(m.x,m.y,m.z),d.push(0,y,0),a.x=n*.5+.5,a.y=i*.5*y+.5,f.push(a.x,a.y),p++}for(let e=0;e.9&&Math.min(t,n,r)<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}function d(e){i.push(e.x,e.y,e.z)}function f(t,n){let r=t*3;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function p(){let e=new U,t=new U,n=new U,r=new U,o=new H,s=new H,c=new H;for(let l=0,u=0;l0)s=r-1;else{s=r;break}if(r=s,n[r]===a)return r/(i-1);let l=n[r],u=n[r+1]-l,d=(a-l)/u;return(r+d)/(i-1)}getTangent(e,t){let n=1e-4,r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);let a=this.getPoint(r),o=this.getPoint(i),s=t||(a.isVector2?new H:new U);return s.copy(o).sub(a).normalize(),s}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){let n=new U,r=[],i=[],a=[],o=new U,s=new W;for(let t=0;t<=e;t++){let n=t/e;r[t]=this.getTangentAt(n,new U)}i[0]=new U,a[0]=new U;let c=Number.MAX_VALUE,l=Math.abs(r[0].x),u=Math.abs(r[0].y),d=Math.abs(r[0].z);l<=c&&(c=l,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),a[t]=a[t-1].clone(),o.crossVectors(r[t-1],r[t]),o.length()>2**-52){o.normalize();let e=Math.acos(V(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(s.makeRotationAxis(o,e))}a[t].crossVectors(r[t],i[t])}if(t===!0){let t=Math.acos(V(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.7,type:`Curve`,generator:`Curve.toJSON`}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},gc=class extends hc{constructor(e=0,t=0,n=1,r=1,i=0,a=Math.PI*2,o=!1,s=0){super(),this.isEllipseCurve=!0,this.type=`EllipseCurve`,this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s}getPoint(e,t=new H){let n=t,r=Math.PI*2,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<2**-52;for(;i<0;)i+=r;for(;i>r;)i-=r;i<2**-52&&(i=a?0:r),this.aClockwise===!0&&!a&&(i===r?i=-r:i-=r);let o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=s-this.aX,r=c-this.aY;s=n*e-r*t+this.aX,c=n*t+r*e+this.aY}return n.set(s,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}},_c=class extends gc{constructor(e,t,n,r,i,a){super(e,t,n,n,r,i,a),this.isArcCurve=!0,this.type=`ArcCurve`}};function vc(){let e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){let c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;c*=o,l*=o,i(t,n,c,l)},calc:function(i){let a=i*i,o=a*i;return e+t*i+n*a+r*o}}}var yc=new U,bc=new U,xc=new vc,Sc=new vc,Cc=new vc,wc=class extends hc{constructor(e=[],t=!1,n=`centripetal`,r=.5){super(),this.isCatmullRomCurve3=!0,this.type=`CatmullRomCurve3`,this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new U){let n=t,r=this.points,i=r.length,a=(i-+!this.closed)*e,o=Math.floor(a),s=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/i)+1)*i:s===0&&o===i-1&&(o=i-2,s=1);let c,l;this.closed||o>0?c=r[(o-1)%i]:(bc.subVectors(r[0],r[1]).add(r[0]),c=bc);let u=r[o%i],d=r[(o+1)%i];if(this.closed||o+2r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(Tc(o,s.x,c.x,l.x,u.x),Tc(o,s.y,c.y,l.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){let e=r[i]-n,a=this.curves[i],o=a.getLength(),s=o===0?0:1-e/o;return a.getPointAt(s,t)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,r=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let e=c.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(c);let l=c.getPoint(1);return this.currentPoint.copy(l),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},Gc=class extends Wc{constructor(e){super(e),this.uuid=Xn(),this.type=`Shape`,this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,r=this.holes.length;n80*n){s=e[0],c=e[1];let t=s,r=c;for(let a=n;at&&(t=n),i>r&&(r=i)}l=Math.max(t-s,r-c),l=l===0?0:32767/l}return Yc(a,o,n,s,c,l,0),o}function qc(e,t,n,r,i){let a;if(i===wl(e,t,n,r)>0)for(let i=t;i=t;i-=r)a=xl(i/r|0,e[i],e[i+1],a);return a&&pl(a,a.next)&&(Sl(a),a=a.next),a}function Jc(e,t){if(!e)return e;t||=e;let n=e,r;do if(r=!1,!n.steiner&&(pl(n,n.next)||fl(n.prev,n,n.next)===0)){if(Sl(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function Yc(e,t,n,r,i,a,o){if(!e)return;!o&&a&&al(e,r,i,a);let s=e;for(;e.prev!==e.next;){let c=e.prev,l=e.next;if(a?Zc(e,r,i,a):Xc(e)){t.push(c.i,e.i,l.i),Sl(e),e=l.next,s=l.next;continue}if(e=l,e===s){o?o===1?(e=Qc(Jc(e),t),Yc(e,t,n,r,i,a,2)):o===2&&$c(e,t,n,r,i,a):Yc(Jc(e),t,n,r,i,a,1);break}}}function Xc(e){let t=e.prev,n=e,r=e.next;if(fl(t,n,r)>=0)return!1;let i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=Math.min(i,a,o),d=Math.min(s,c,l),f=Math.max(i,a,o),p=Math.max(s,c,l),m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&ul(i,s,a,c,o,l,m.x,m.y)&&fl(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Zc(e,t,n,r){let i=e.prev,a=e,o=e.next;if(fl(i,a,o)>=0)return!1;let s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=Math.min(s,c,l),m=Math.min(u,d,f),h=Math.max(s,c,l),g=Math.max(u,d,f),_=sl(p,m,t,n,r),v=sl(h,g,t,n,r),y=e.prevZ,b=e.nextZ;for(;y&&y.z>=_&&b&&b.z<=v;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&ul(s,u,c,d,l,f,y.x,y.y)&&fl(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&ul(s,u,c,d,l,f,b.x,b.y)&&fl(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&ul(s,u,c,d,l,f,y.x,y.y)&&fl(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&ul(s,u,c,d,l,f,b.x,b.y)&&fl(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Qc(e,t){let n=e;do{let r=n.prev,i=n.next.next;!pl(r,i)&&ml(r,n,n.next,i)&&vl(r,i)&&vl(i,r)&&(t.push(r.i,n.i,i.i),Sl(n),Sl(n.next),n=e=i),n=n.next}while(n!==e);return Jc(n)}function $c(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&dl(o,e)){let s=bl(o,e);o=Jc(o,o.next),s=Jc(s,s.next),Yc(o,t,n,r,i,a,0),Yc(s,t,n,r,i,a,0);return}e=e.next}o=o.next}while(o!==e)}function el(e,t,n,r){let i=[];for(let n=0,a=t.length;n=n.next.y&&n.next.y!==n.y){let e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,o=n.x=n.x&&n.x>=c&&r!==n.x&&ll(io.x||n.x===o.x&&il(o,n)))&&(o=n,u=t)}n=n.next}while(n!==s);return o}function il(e,t){return fl(e.prev,e,t.prev)<0&&fl(t.next,e,e.next)<0}function al(e,t,n,r){let i=e;do i.z===0&&(i.z=sl(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,ol(i)}function ol(e){let t,n=1;do{let r=e,i;e=null;let a=null;for(t=0;r;){t++;let o=r,s=0;for(let e=0;e0||c>0&&o;)s!==0&&(c===0||!o||r.z<=o.z)?(i=r,r=r.nextZ,s--):(i=o,o=o.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=o}a.nextZ=null,n*=2}while(t>1);return e}function sl(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function cl(e){let t=e,n=e;do(t.x=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function ul(e,t,n,r,i,a,o,s){return!(e===o&&t===s)&&ll(e,t,n,r,i,a,o,s)}function dl(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!_l(e,t)&&(vl(e,t)&&vl(t,e)&&yl(e,t)&&(fl(e.prev,e,t.prev)||fl(e,t.prev,t))||pl(e,t)&&fl(e.prev,e,e.next)>0&&fl(t.prev,t,t.next)>0)}function fl(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function pl(e,t){return e.x===t.x&&e.y===t.y}function ml(e,t,n,r){let i=gl(fl(e,t,n)),a=gl(fl(e,t,r)),o=gl(fl(n,r,e)),s=gl(fl(n,r,t));return!!(i!==a&&o!==s||i===0&&hl(e,n,t)||a===0&&hl(e,r,t)||o===0&&hl(n,e,r)||s===0&&hl(n,t,r))}function hl(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function gl(e){return e>0?1:e<0?-1:0}function _l(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&ml(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function vl(e,t){return fl(e.prev,e,e.next)<0?fl(e,t,e.next)>=0&&fl(e,e.prev,t)>=0:fl(e,t,e.prev)<0||fl(e,e.next,t)<0}function yl(e,t){let n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function bl(e,t){let n=Cl(e.i,e.x,e.y),r=Cl(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function xl(e,t,n,r){let i=Cl(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Sl(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Cl(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function wl(e,t,n,r){let i=0;for(let a=t,o=n-r;a2&&e[t-1].equals(e[0])&&e.pop()}function Ol(e,t){for(let n=0;n2**-52){let d=Math.sqrt(u),f=Math.sqrt(c*c+l*l),p=t.x-s/d,m=t.y+o/d,h=n.x-l/f,g=n.y+c/f,_=((h-p)*l-(g-m)*c)/(o*l-s*c);r=p+o*_-e.x,i=m+s*_-e.y;let v=r*r+i*i;if(v<=2)return new H(r,i);a=Math.sqrt(v/2)}else{let e=!1;o>2**-52?c>2**-52&&(e=!0):o<-(2**-52)?c<-(2**-52)&&(e=!0):Math.sign(s)===Math.sign(l)&&(e=!0),e?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new H(r/a,i/a)}let ee=[];for(let e=0,t=D.length,n=t-1,r=e+1;e=0;e--){let t=e/p,n=u*Math.cos(t*Math.PI/2),r=d*Math.sin(t*Math.PI/2)+f;for(let e=0,t=D.length;e=0;){let r=n,i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+p*2;e0)&&f.push(t,i,c),(e!==n-1||s0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)this.extensions[e]===!0&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}},nu=class extends tu{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type=`RawShaderMaterial`}},ru=class extends Fa{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type=`MeshStandardMaterial`,this.defines={STANDARD:``},this.color=new G(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new G(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new $r,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:``},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},iu=class extends ru{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:``,PHYSICAL:``},this.type=`MeshPhysicalMaterial`,this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new H(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return V(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new G(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new G(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new G(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:``,PHYSICAL:``},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}},au=class extends Fa{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type=`MeshPhongMaterial`,this.color=new G(16777215),this.specular=new G(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new G(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new $r,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},ou=class extends Fa{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:``},this.type=`MeshToonMaterial`,this.color=new G(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new G(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},su=class extends Fa{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type=`MeshNormalMaterial`,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}},cu=class extends Fa{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type=`MeshLambertMaterial`,this.color=new G(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new G(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new $r,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},lu=class extends Fa{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type=`MeshDepthMaterial`,this.depthPacking=Qt,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},uu=class extends Fa{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type=`MeshDistanceMaterial`,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}},du=class extends Fa{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:``},this.type=`MeshMatcapMaterial`,this.color=new G(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:``},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}},fu=class extends ws{constructor(e){super(),this.isLineDashedMaterial=!0,this.type=`LineDashedMaterial`,this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}};function pu(e,t){return!e||e.constructor===t?e:typeof t.BYTES_PER_ELEMENT==`number`?new t(e):Array.prototype.slice.call(e)}function mu(e){function t(t,n){return e[t]-e[n]}let n=e.length,r=Array(n);for(let e=0;e!==n;++e)r[e]=e;return r.sort(t),r}function hu(e,t,n){let r=e.length,i=new e.constructor(r);for(let a=0,o=0;o!==r;++a){let r=n[a]*t;for(let n=0;n!==t;++n)i[o++]=e[r+n]}return i}function gu(e,t,n,r){let i=1,a=e[0];for(;a!==void 0&&a[r]===void 0;)a=e[i++];if(a===void 0)return;let o=a[r];if(o!==void 0)if(Array.isArray(o))do o=a[r],o!==void 0&&(t.push(a.time),n.push(...o)),a=e[i++];while(a!==void 0);else if(o.toArray!==void 0)do o=a[r],o!==void 0&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++];while(a!==void 0);else do o=a[r],o!==void 0&&(t.push(a.time),n.push(o)),a=e[i++];while(a!==void 0)}function _u(e,t,n,r,i=30){let a=e.clone();a.name=t;let o=[];for(let e=0;e=r)){c.push(t.times[e]);for(let n=0;na.tracks[e].times[0]&&(s=a.tracks[e].times[0]);for(let e=0;e=r.times[d]){let e=d*c+s,t=e+c-s;f=r.values.slice(e,t)}else{let e=r.createInterpolant(),t=s,n=c-s;e.evaluate(a),f=e.resultBuffer.slice(t,n)}i===`quaternion`&&new vr().fromArray(f).normalize().conjugate().toArray(f);let p=o.times.length;for(let e=0;e=i)){let o=t[1];e=i)break seek}a=n,n=0;break linear_scan}break validate_interval}for(;n>>1;et;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);let e=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(B(`KeyframeTrack: Invalid value size in track.`,this),e=!1);let n=this.times,r=this.values,i=n.length;i===0&&(B(`KeyframeTrack: Track is empty.`,this),e=!1);let a=null;for(let t=0;t!==i;t++){let r=n[t];if(typeof r==`number`&&isNaN(r)){B(`KeyframeTrack: Time is not a valid number.`,this,t,r),e=!1;break}if(a!==null&&a>r){B(`KeyframeTrack: Out of order keys.`,this,t,r,a),e=!1;break}a=r}if(r!==void 0&&Nn(r))for(let t=0,n=r.length;t!==n;++t){let n=r[t];if(isNaN(n)){B(`KeyframeTrack: Value is not a valid number.`,this,t,n),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===Gt,i=e.length-1,a=1;for(let o=1;o0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a===e.length?(this.times=e,this.values=t):(this.times=e.slice(0,a),this.values=t.slice(0,a*n)),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};Tu.prototype.ValueTypeName=``,Tu.prototype.TimeBufferType=Float32Array,Tu.prototype.ValueBufferType=Float32Array,Tu.prototype.DefaultInterpolation=Wt;var Eu=class extends Tu{constructor(e,t,n){super(e,t,n)}};Eu.prototype.ValueTypeName=`bool`,Eu.prototype.ValueBufferType=Array,Eu.prototype.DefaultInterpolation=Ut,Eu.prototype.InterpolantFactoryMethodLinear=void 0,Eu.prototype.InterpolantFactoryMethodSmooth=void 0;var Du=class extends Tu{constructor(e,t,n,r){super(e,t,n,r)}};Du.prototype.ValueTypeName=`color`;var Ou=class extends Tu{constructor(e,t,n,r){super(e,t,n,r)}};Ou.prototype.ValueTypeName=`number`;var ku=class extends bu{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),c=e*o;for(let e=c+o;c!==e;c+=4)vr.slerpFlat(i,0,a,c-o,a,c,s);return i}},Au=class extends Tu{constructor(e,t,n,r){super(e,t,n,r)}InterpolantFactoryMethodLinear(e){return new ku(this.times,this.values,this.getValueSize(),e)}};Au.prototype.ValueTypeName=`quaternion`,Au.prototype.InterpolantFactoryMethodSmooth=void 0;var ju=class extends Tu{constructor(e,t,n){super(e,t,n)}};ju.prototype.ValueTypeName=`string`,ju.prototype.ValueBufferType=Array,ju.prototype.DefaultInterpolation=Ut,ju.prototype.InterpolantFactoryMethodLinear=void 0,ju.prototype.InterpolantFactoryMethodSmooth=void 0;var Mu=class extends Tu{constructor(e,t,n,r){super(e,t,n,r)}};Mu.prototype.ValueTypeName=`vector`;var Nu=class{constructor(e=``,t=-1,n=[],r=Xt){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=Xn(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(Fu(n[e]).scale(r));let i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i.userData=JSON.parse(e.userData||`{}`),i}static toJSON(e){let t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let e=0,r=n.length;e!==r;++e)t.push(Tu.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){let i=t.length,a=[];for(let e=0;e1){let e=a[1],t=r[e];t||(r[e]=t=[]),t.push(n)}}let a=[];for(let e in r)a.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return a}static parseAnimation(e,t){if(z(`AnimationClip: parseAnimation() is deprecated and will be removed with r185`),!e)return B(`AnimationClip: No animation in JSONLoader data.`),null;let n=function(e,t,n,r,i){if(n.length!==0){let a=[],o=[];gu(n,a,o,r),a.length!==0&&i.push(new e(t,a,o))}},r=[],i=e.name||`default`,a=e.fps||30,o=e.blendMode,s=e.length||-1,c=e.hierarchy||[];for(let e=0;e{t&&t(i),this.manager.itemEnd(e)},0);return}if(Vu[e]!==void 0){Vu[e].push({onLoad:t,onProgress:n,onError:r});return}Vu[e]=[],Vu[e].push({onLoad:t,onProgress:n,onError:r});let a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?`include`:`same-origin`,signal:typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,s=this.responseType;fetch(a).then(t=>{if(t.status===200||t.status===0){if(t.status===0&&z(`FileLoader: HTTP Status 0 received.`),typeof ReadableStream>`u`||t.body===void 0||t.body.getReader===void 0)return t;let n=Vu[e],r=t.body.getReader(),i=t.headers.get(`X-File-Size`)||t.headers.get(`Content-Length`),a=i?parseInt(i):0,o=a!==0,s=0,c=new ReadableStream({start(e){t();function t(){r.read().then(({done:r,value:i})=>{if(r)e.close();else{s+=i.byteLength;let r=new ProgressEvent(`progress`,{lengthComputable:o,loaded:s,total:a});for(let e=0,t=n.length;e{e.error(t)})}}});return new Response(c)}else throw new Hu(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(s){case`arraybuffer`:return e.arrayBuffer();case`blob`:return e.blob();case`document`:return e.text().then(e=>new DOMParser().parseFromString(e,o));case`json`:return e.json();default:if(o===``)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(o),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then(e=>r.decode(e))}}}).then(t=>{Iu.add(`file:${e}`,t);let n=Vu[e];delete Vu[e];for(let e=0,r=n.length;e{let n=Vu[e];if(n===void 0)throw this.manager.itemError(e),t;delete Vu[e];for(let e=0,r=n.length;e{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},Wu=class extends Bu{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new Uu(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):B(t),i.manager.itemError(e)}},n,r)}parse(e){let t=[];for(let n=0;n0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(let t in e.uniforms){let i=e.uniforms[t];switch(r.uniforms[t]={},i.type){case`t`:r.uniforms[t].value=n(i.value);break;case`c`:r.uniforms[t].value=new G().setHex(i.value);break;case`v2`:r.uniforms[t].value=new H().fromArray(i.value);break;case`v3`:r.uniforms[t].value=new U().fromArray(i.value);break;case`v4`:r.uniforms[t].value=new Lr().fromArray(i.value);break;case`m3`:r.uniforms[t].value=new xr().fromArray(i.value);break;case`m4`:r.uniforms[t].value=new W().fromArray(i.value);break;default:r.uniforms[t].value=i.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(let t in e.extensions)r.extensions[t]=e.extensions[t];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=n(e.map)),e.matcap!==void 0&&(r.matcap=n(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let t=e.normalScale;Array.isArray(t)===!1&&(t=[t,t]),r.normalScale=new H().fromArray(t)}return e.displacementMap!==void 0&&(r.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=n(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new H().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=n(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}createMaterialFromType(t){return e.createMaterialFromType(t)}static createMaterialFromType(e){return new{ShadowMaterial:Kl,SpriteMaterial:Ia,RawShaderMaterial:nu,ShaderMaterial:tu,PointsMaterial:Rs,MeshPhysicalMaterial:iu,MeshStandardMaterial:ru,MeshPhongMaterial:au,MeshToonMaterial:ou,MeshNormalMaterial:su,MeshLambertMaterial:cu,MeshDepthMaterial:lu,MeshDistanceMaterial:uu,MeshBasicMaterial:co,MeshMatcapMaterial:du,LineDashedMaterial:fu,LineBasicMaterial:ws,Material:Fa}[e]}},Sd=class{static extractUrlBase(e){let t=e.lastIndexOf(`/`);return t===-1?`./`:e.slice(0,t+1)}static resolveURL(e,t){return typeof e!=`string`||e===``?``:(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,`$1`)),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}},Cd=class extends q{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type=`InstancedBufferGeometry`,this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){let e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}},wd=class extends Bu{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new Uu(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):B(t),i.manager.itemError(e)}},n,r)}parse(e){let t={},n={};function r(e,n){if(t[n]!==void 0)return t[n];let r=e.interleavedBuffers[n],a=i(e,r.buffer),o=new ja(Mn(r.type,a),r.stride);return o.uuid=r.uuid,t[n]=o,o}function i(e,t){if(n[t]!==void 0)return n[t];let r=e.arrayBuffers[t],i=new Uint32Array(r).buffer;return n[t]=i,i}let a=e.isInstancedBufferGeometry?new Cd:new q,o=e.data.index;if(o!==void 0){let e=Mn(o.type,o.array);a.setIndex(new da(e,1))}let s=e.data.attributes;for(let t in s){let n=s[t],i;if(n.isInterleavedBufferAttribute)i=new Na(r(e.data,n.data),n.itemSize,n.offset,n.normalized);else{let e=Mn(n.type,n.array);i=new(n.isInstancedBufferAttribute?zo:da)(e,n.itemSize,n.normalized)}n.name!==void 0&&(i.name=n.name),n.usage!==void 0&&i.setUsage(n.usage),a.setAttribute(t,i)}let c=e.data.morphAttributes;if(c)for(let t in c){let n=c[t],i=[];for(let t=0,a=n.length;t0){i=new Ku(new Ru(t)),i.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t0){r=new Ku(this.manager),r.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t{let t=null,n=null;return e.boundingBox!==void 0&&(t=new Hi().fromJSON(e.boundingBox)),e.boundingSphere!==void 0&&(n=new Ca().fromJSON(e.boundingSphere)),{...e,boundingBox:t,boundingSphere:n}}),a._instanceInfo=e.instanceInfo,a._availableInstanceIds=e._availableInstanceIds,a._availableGeometryIds=e._availableGeometryIds,a._nextIndexStart=e.nextIndexStart,a._nextVertexStart=e.nextVertexStart,a._geometryCount=e.geometryCount,a._maxInstanceCount=e.maxInstanceCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._matricesTexture=c(e.matricesTexture.uuid),a._indirectTexture=c(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(a._colorsTexture=c(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(a.boundingSphere=new Ca().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(a.boundingBox=new Hi().fromJSON(e.boundingBox));break;case`LOD`:a=new $a;break;case`Line`:a=new Ms(o(e.geometry),s(e.material));break;case`LineLoop`:a=new Ls(o(e.geometry),s(e.material));break;case`LineSegments`:a=new Is(o(e.geometry),s(e.material));break;case`PointCloud`:case`Points`:a=new Us(o(e.geometry),s(e.material));break;case`Sprite`:a=new Ya(s(e.material));break;case`Group`:a=new _i;break;case`Bone`:a=new Po;break;default:a=new gi}if(a.uuid=e.uuid,e.name!==void 0&&(a.name=e.name),e.matrix===void 0?(e.position!==void 0&&a.position.fromArray(e.position),e.rotation!==void 0&&a.rotation.fromArray(e.rotation),e.quaternion!==void 0&&a.quaternion.fromArray(e.quaternion),e.scale!==void 0&&a.scale.fromArray(e.scale)):(a.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)),e.up!==void 0&&a.up.fromArray(e.up),e.pivot!==void 0&&(a.pivot=new U().fromArray(e.pivot)),e.morphTargetDictionary!==void 0&&(a.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),e.morphTargetInfluences!==void 0&&(a.morphTargetInfluences=e.morphTargetInfluences.slice()),e.castShadow!==void 0&&(a.castShadow=e.castShadow),e.receiveShadow!==void 0&&(a.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(a.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(a.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(a.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(a.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(a.visible=e.visible),e.frustumCulled!==void 0&&(a.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(a.renderOrder=e.renderOrder),e.static!==void 0&&(a.static=e.static),e.userData!==void 0&&(a.userData=e.userData),e.layers!==void 0&&(a.layers.mask=e.layers),e.children!==void 0){let o=e.children;for(let e=0;e`u`&&z(`ImageBitmapLoader: createImageBitmap() not supported.`),typeof fetch>`u`&&z(`ImageBitmapLoader: fetch() not supported.`),this.options={premultiplyAlpha:`none`},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,n,r){e===void 0&&(e=``),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=Iu.get(`image-bitmap:${e}`);if(a!==void 0){if(i.manager.itemStart(e),a.then){a.then(n=>{Ad.has(a)===!0?(r&&r(Ad.get(a)),i.manager.itemError(e),i.manager.itemEnd(e)):(t&&t(n),i.manager.itemEnd(e))});return}setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0);return}let o={};o.credentials=this.crossOrigin===`anonymous`?`same-origin`:`include`,o.headers=this.requestHeader,o.signal=typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let s=fetch(e,o).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:`none`}))}).then(function(n){Iu.add(`image-bitmap:${e}`,n),t&&t(n),i.manager.itemEnd(e)}).catch(function(t){r&&r(t),Ad.set(s,t),Iu.remove(`image-bitmap:${e}`),i.manager.itemError(e),i.manager.itemEnd(e)});Iu.add(`image-bitmap:${e}`,s),i.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},Md,Nd=class{static getContext(){return Md===void 0&&(Md=new(window.AudioContext||window.webkitAudioContext)),Md}static setContext(e){Md=e}},Pd=class extends Bu{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new Uu(this.manager);a.setResponseType(`arraybuffer`),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{let r=n.slice(0),a=Nd.getContext(),s=e+`#decode`;i.manager.itemStart(s),a.decodeAudioData(r,function(e){t(e),i.manager.itemEnd(s)}).catch(function(e){o(e),i.manager.itemEnd(s)})}catch(e){o(e)}},n,r);function o(t){r?r(t):B(t),i.manager.itemError(e)}}},Fd=new W,Id=new W,Ld=new W,Rd=class{constructor(){this.type=`StereoCamera`,this.aspect=1,this.eyeSep=.064,this.cameraL=new ld,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ld,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){let t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Ld.copy(e.projectionMatrix);let n=t.eyeSep/2,r=n*t.near/t.focus,i=t.near*Math.tan(Jn*t.fov*.5)/t.zoom,a,o;Id.elements[12]=-n,Fd.elements[12]=n,a=-i*t.aspect+r,o=i*t.aspect+r,Ld.elements[0]=2*t.near/(o-a),Ld.elements[8]=(o+a)/(o-a),this.cameraL.projectionMatrix.copy(Ld),a=-i*t.aspect-r,o=i*t.aspect-r,Ld.elements[0]=2*t.near/(o-a),Ld.elements[8]=(o+a)/(o-a),this.cameraR.projectionMatrix.copy(Ld)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Id),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Fd)}},zd=-90,Bd=1,Vd=class extends gi{constructor(e,t,n){super(),this.type=`CubeCamera`,this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new ld(zd,Bd,e,t);r.layers=this.layers,this.add(r);let i=new ld(zd,Bd,e,t);i.layers=this.layers,this.add(i);let a=new ld(zd,Bd,e,t);a.layers=this.layers,this.add(a);let o=new ld(zd,Bd,e,t);o.layers=this.layers,this.add(o);let s=new ld(zd,Bd,e,t);s.layers=this.layers,this.add(s);let c=new ld(zd,Bd,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(let e of t)this.remove(e);if(e===2e3)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else if(e===2001)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);else throw Error(`THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: `+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,o,s,c,l]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let h=!1;h=e.isWebGLRenderer===!0?e.state.buffers.depth.getReversed():e.reversedDepthBuffer,e.setRenderTarget(n,0,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,i),e.setRenderTarget(n,1,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,a),e.setRenderTarget(n,2,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,o),e.setRenderTarget(n,3,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,s),e.setRenderTarget(n,4,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,c),n.texture.generateMipmaps=m,e.setRenderTarget(n,5,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,l),e.setRenderTarget(u,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}},Hd=class extends ld{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}},Ud=class{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=Wd.bind(this),e.addEventListener(`visibilitychange`,this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener(`visibilitychange`,this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e===void 0?performance.now():e)-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}};function Wd(){this._document.hidden===!1&&this.reset()}var Gd=new U,Kd=new vr,qd=new U,Jd=new U,Yd=new U,Xd=class extends gi{constructor(){super(),this.type=`AudioListener`,this.context=Nd.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._timer=new Ud}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter===null?this.gain.disconnect(this.context.destination):(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e),this._timer.update();let t=this.context.listener;if(this.timeDelta=this._timer.getDelta(),this.matrixWorld.decompose(Gd,Kd,qd),Jd.set(0,0,-1).applyQuaternion(Kd),Yd.set(0,1,0).applyQuaternion(Kd),t.positionX){let e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Gd.x,e),t.positionY.linearRampToValueAtTime(Gd.y,e),t.positionZ.linearRampToValueAtTime(Gd.z,e),t.forwardX.linearRampToValueAtTime(Jd.x,e),t.forwardY.linearRampToValueAtTime(Jd.y,e),t.forwardZ.linearRampToValueAtTime(Jd.z,e),t.upX.linearRampToValueAtTime(Yd.x,e),t.upY.linearRampToValueAtTime(Yd.y,e),t.upZ.linearRampToValueAtTime(Yd.z,e)}else t.setPosition(Gd.x,Gd.y,Gd.z),t.setOrientation(Jd.x,Jd.y,Jd.z,Yd.x,Yd.y,Yd.z)}},Zd=class extends gi{constructor(e){super(),this.type=`Audio`,this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType=`empty`,this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType=`audioNode`,this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType=`mediaNode`,this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType=`mediaStreamNode`,this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType=`buffer`,this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){z(`Audio: Audio is already playing.`);return}if(this.hasPlaybackControl===!1){z(`Audio: this Audio has no playback control.`);return}this._startedAt=this.context.currentTime+e;let t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){z(`Audio: this Audio has no playback control.`);return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress%=this.duration||this.buffer.duration),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){z(`Audio: this Audio has no playback control.`);return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(n[e]!==n[e+t]){o.setValue(n,r);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let e=n,i=r;e!==i;++e)t[e]=t[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let r=0;r!==i;++r)e[t+r]=e[n+r]}_slerp(e,t,n,r){vr.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){let a=this._workIndex*i;vr.multiplyQuaternionsFlat(e,a,e,t,e,n),vr.slerpFlat(e,t,e,t,e,a,r)}_lerp(e,t,n,r,i){let a=1-r;for(let o=0;o!==i;++o){let i=t+o;e[i]=e[i]*a+e[n+o]*r}}_lerpAdditive(e,t,n,r,i){for(let a=0;a!==i;++a){let i=t+a;e[i]=e[i]+e[n+a]*r}}},of=`\\[\\]\\.:\\/`,sf=RegExp(`[\\[\\]\\.:\\/]`,`g`),cf=`[^\\[\\]\\.:\\/]`,lf=`[^`+of.replace(`\\.`,``)+`]`,uf=`((?:WC+[\\/:])*)`.replace(`WC`,cf),df=`(WCOD+)?`.replace(`WCOD`,lf),ff=`(?:\\.(WC+)(?:\\[(.+)\\])?)?`.replace(`WC`,cf),pf=`\\.(WC+)(?:\\[(.+)\\])?`.replace(`WC`,cf),mf=RegExp(`^`+uf+df+ff+pf+`$`),hf=[`material`,`materials`,`bones`,`map`],gf=class{constructor(e,t,n){let r=n||_f.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},_f=class e{constructor(t,n,r){this.path=n,this.parsedPath=r||e.parseTrackName(n),this.node=e.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,n,r){return t&&t.isAnimationObjectGroup?new e.Composite(t,n,r):new e(t,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,`_`).replace(sf,``)}static parseTrackName(e){let t=mf.exec(e);if(t===null)throw Error(`PropertyBinding: Cannot parse trackName: `+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(`.`);if(r!==void 0&&r!==-1){let e=n.nodeName.substring(r+1);hf.indexOf(e)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(n.propertyName===null||n.propertyName.length===0)throw Error(`PropertyBinding: can not parse propertyName from trackName: `+e);return n}static findNode(e,t){if(t===void 0||t===``||t===`.`||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(e){for(let r=0;r=i){let a=i++,l=e[a];t[l.uuid]=c,e[c]=l,t[s]=a,e[a]=o;for(let e=0,t=r;e!==t;++e){let t=n[e],r=t[a],i=t[c];t[c]=r,t[a]=i}}}this.nCachedObjects_=i}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,a=e.length;for(let o=0,s=arguments.length;o!==s;++o){let s=arguments[o].uuid,c=t[s];if(c!==void 0)if(delete t[s],c0&&(t[o.uuid]=c),e[c]=o,e.pop();for(let e=0,t=r;e!==t;++e){let t=n[e];t[c]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){let n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(r!==void 0)return i[r];let a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,u=Array(c);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(let n=l,r=s.length;n!==r;++n){let r=s[n];u[n]=new _f(r,e,t)}return u}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o],c=e[o];t[c]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}},yf=class{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;let i=t.tracks,a=i.length,o=Array(a),s={endingStart:qt,endingEnd:qt};for(let e=0;e!==a;++e){let t=i[e].createInterpolant(null);o[e]=t,t.settings&&Object.assign(s,t.settings),t.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Vt,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n=!1){if(e.fadeOut(t),this.fadeIn(t),n===!0){let n=this._clip.duration,r=e._clip.duration,i=r/n,a=n/r;e.warp(1,i,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n=!1){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let r=this._mixer,i=r.time,a=this.timeScale,o=this._timeScaleInterpolant;o===null&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);let s=o.parameterPositions,c=o.sampleValues;return s[0]=i,s[1]=i+n,c[0]=e/a,c[1]=t/a,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled){this._updateWeight(e);return}let i=this._startTime;if(i!==null){let r=(e-i)*n;r<0||n===0?t=0:(this._startTime=null,t=n*r)}t*=this._updateTimeScale(e);let a=this._updateTime(t),o=this._updateWeight(e);if(o>0){let e=this._interpolants,t=this._propertyBindings;switch(this.blendMode){case Zt:for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulateAdditive(o);break;case Xt:default:for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(a),t[n].accumulate(r,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;if(n!==null){let r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,r=this.time+e,i=this._loopCount,a=n===Ht;if(e===0)return i===-1?r:a&&(i&1)==1?t-r:r;if(n===2200){i===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));handle_stop:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break handle_stop}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:`finished`,action:this,direction:e<0?-1:1})}}else{if(i===-1&&(e>=0?(i=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),r>=t||r<0){let n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);let o=this.repetitions-i;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:`finished`,action:this,direction:e>0?1:-1});else{if(o===1){let t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:`loop`,action:this,loopDelta:n})}}else this._loopCount=i,this.time=r;if(a&&(i&1)==1)return t-r}return r}_setEndings(e,t,n){let r=this._interpolantSettings;n?(r.endingStart=Jt,r.endingEnd=Jt):(e?r.endingStart=this.zeroSlopeAtStart?Jt:qt:r.endingStart=Yt,t?r.endingEnd=this.zeroSlopeAtEnd?Jt:qt:r.endingEnd=Yt)}_scheduleFading(e,t,n){let r=this._mixer,i=r.time,a=this._weightInterpolant;a===null&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);let o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}},bf=new Float32Array(1),xf=class extends Gn{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}_bindAction(e,t){let n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];l===void 0&&(l={},c[s]=l);for(let e=0;e!==i;++e){let i=r[e],c=i.name,u=l[c];if(u!==void 0)++u.referenceCount,a[e]=u;else{if(u=a[e],u!==void 0){u._cacheIndex===null&&(++u.referenceCount,this._addInactiveBinding(u,s,c));continue}let r=t&&t._propertyBindings[e].binding.parsedPath;u=new af(_f.create(n,c,r),i.ValueTypeName,i.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,s,c),a[e]=u}o[e].resultBuffer=u.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];n.useCount++===0&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];--n.useCount===0&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let o=0;o!==n;++o)t[o]._update(r,e,i,a);let o=this._bindings,s=this._nActiveBindings;for(let e=0;e!==s;++e)o[e].apply(a);return this}setTime(e){this.time=0;for(let e=0;e=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,If).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},Rf=new U,zf=new U,Bf=new U,Vf=new U,Hf=new U,Uf=new U,Wf=new U,Gf=class{constructor(e=new U,t=new U){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Rf.subVectors(e,this.start),zf.subVectors(this.end,this.start);let n=zf.dot(zf);if(n===0)return 0;let r=zf.dot(Rf)/n;return t&&(r=V(r,0,1)),r}closestPointToPoint(e,t,n){let r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}distanceSqToLine3(e,t=Uf,n=Wf){let r=1e-8*1e-8,i,a,o=this.start,s=e.start,c=this.end,l=e.end;Bf.subVectors(c,o),Vf.subVectors(l,s),Hf.subVectors(o,s);let u=Bf.dot(Bf),d=Vf.dot(Vf),f=Vf.dot(Hf);if(u<=r&&d<=r)return t.copy(o),n.copy(s),t.sub(n),t.dot(t);if(u<=r)i=0,a=f/d,a=V(a,0,1);else{let e=Bf.dot(Hf);if(d<=r)a=0,i=V(-e/u,0,1);else{let t=Bf.dot(Vf),n=u*d-t*t;i=n===0?0:V((t*f-e*d)/n,0,1),a=(t*i+f)/d,a<0?(a=0,i=V(-e/u,0,1)):a>1&&(a=1,i=V((t-e)/u,0,1))}}return t.copy(o).addScaledVector(Bf,i),n.copy(s).addScaledVector(Vf,a),t.distanceToSquared(n)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},Kf=new U,qf=class extends gi{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type=`SpotLightHelper`;let n=new q,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1;e<32;e++,t++){let n=e/32*Math.PI*2,i=t/32*Math.PI*2;r.push(Math.cos(n),Math.sin(n),1,Math.cos(i),Math.sin(i),1)}n.setAttribute(`position`,new K(r,3));let i=new ws({fog:!1,toneMapped:!1});this.cone=new Is(n,i),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);let e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Kf.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Kf),this.color===void 0?this.cone.material.color.copy(this.light.color):this.cone.material.color.set(this.color)}},Jf=new U,Yf=new W,Xf=new W,Zf=class extends Is{constructor(e){let t=Qf(e),n=new q,r=[],i=[];for(let e=0;e1)for(let n=0;n.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{vp.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(vp,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},Sp=class extends Is{constructor(e=1){let t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new q;r.setAttribute(`position`,new K(t,3)),r.setAttribute(`color`,new K(n,3));let i=new ws({vertexColors:!0,toneMapped:!1});super(r,i),this.type=`AxesHelper`}setColors(e,t,n){let r=new G,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(t),r.toArray(i,6),r.toArray(i,9),r.set(n),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},Cp=class{constructor(){this.type=`ShapePath`,this.color=new G,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Wc,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e){let t=[];for(let n=0,r=e.length;n2**-52){if(c<0&&(n=t[a],s=-s,o=t[i],c=-c),e.yo.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{let t=c*(e.x-n.x)-s*(e.y-n.y);if(t===0)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(o.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=o.x)return!0}}return r}let r=El.isClockWise,i=this.subPaths;if(i.length===0)return[];let a,o,s,c=[];if(i.length===1)return o=i[0],s=new Gc,s.curves=o.curves,c.push(s),c;let l=!r(i[0].getPoints());l=e?!l:l;let u=[],d=[],f=[],p=0,m;d[p]=void 0,f[p]=[];for(let t=0,n=i.length;t1){let e=!1,t=0;for(let e=0,t=d.length;e0&&e===!1&&(f=u)}let h;for(let e=0,t=d.length;et?(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2):(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0),e}function Ep(e,t){let n=e.image&&e.image.width?e.image.width/e.image.height:1;return n>t?(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0):(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2),e}function Dp(e){return e.repeat.x=1,e.repeat.y=1,e.offset.x=0,e.offset.y=0,e}function Op(e,t,n,r){let i=kp(r);switch(n){case qe:return e*t;case Qe:return e*t/i.components*i.byteLength;case $e:return e*t/i.components*i.byteLength;case et:return e*t*2/i.components*i.byteLength;case tt:return e*t*2/i.components*i.byteLength;case Je:return e*t*3/i.components*i.byteLength;case Ye:return e*t*4/i.components*i.byteLength;case rt:return e*t*4/i.components*i.byteLength;case it:case at:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case ot:case st:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case lt:case dt:return Math.max(e,16)*Math.max(t,8)/4;case ct:case ut:return Math.max(e,8)*Math.max(t,8)/2;case ft:case pt:case ht:case gt:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case mt:case _t:case vt:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case yt:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case bt:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case xt:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case St:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case Ct:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case wt:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case Tt:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case Et:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case Dt:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case Ot:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case kt:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case At:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case jt:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case Mt:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case Nt:case Pt:case Ft:return Math.ceil(e/4)*Math.ceil(t/4)*16;case It:case Lt:return Math.ceil(e/4)*Math.ceil(t/4)*8;case Rt:case zt:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw Error(`Unable to determine texture byte length for ${n} format.`)}function kp(e){switch(e){case Fe:case Ie:return{byteLength:1,components:1};case Le:case R:case Ve:return{byteLength:2,components:1};case He:case Ue:return{byteLength:2,components:4};case ze:case Re:case Be:return{byteLength:4,components:1};case Ge:case Ke:return{byteLength:4,components:3}}throw Error(`Unknown texture type ${e}.`)}var Ap=class{static contain(e,t){return Tp(e,t)}static cover(e,t){return Ep(e,t)}static fill(e){return Dp(e)}static getByteLength(e,t,n,r){return Op(e,t,n,r)}};typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`register`,{detail:{revision:`184`}})),typeof window<`u`&&(window.__THREE__?z(`WARNING: Multiple instances of Three.js being imported.`):window.__THREE__=`184`);var jp=s({ACESFilmicToneMapping:()=>4,AddEquation:()=>100,AddOperation:()=>2,AdditiveAnimationBlendMode:()=>Zt,AdditiveBlending:()=>2,AgXToneMapping:()=>6,AlphaFormat:()=>qe,AlwaysCompare:()=>519,AlwaysDepth:()=>1,AlwaysStencilFunc:()=>519,AmbientLight:()=>_d,AnimationAction:()=>yf,AnimationClip:()=>Nu,AnimationLoader:()=>Wu,AnimationMixer:()=>xf,AnimationObjectGroup:()=>vf,AnimationUtils:()=>yu,ArcCurve:()=>_c,ArrayCamera:()=>Hd,ArrowHelper:()=>xp,AttachedBindMode:()=>F,Audio:()=>Zd,AudioAnalyser:()=>rf,AudioContext:()=>Nd,AudioListener:()=>Xd,AudioLoader:()=>Pd,AxesHelper:()=>Sp,BackSide:()=>1,BasicDepthPacking:()=>Qt,BasicShadowMap:()=>0,BatchedMesh:()=>Cs,BezierInterpolant:()=>wu,Bone:()=>Po,BooleanKeyframeTrack:()=>Eu,Box2:()=>Lf,Box3:()=>Hi,Box3Helper:()=>gp,BoxGeometry:()=>rc,BoxHelper:()=>hp,BufferAttribute:()=>da,BufferGeometry:()=>q,BufferGeometryLoader:()=>wd,ByteType:()=>Ie,Cache:()=>Iu,Camera:()=>ad,CameraHelper:()=>fp,CanvasTexture:()=>Qs,CapsuleGeometry:()=>ic,CatmullRomCurve3:()=>wc,CineonToneMapping:()=>3,CircleGeometry:()=>ac,ClampToEdgeWrapping:()=>L,Clock:()=>Mf,Color:()=>G,ColorKeyframeTrack:()=>Du,ColorManagement:()=>Er,Compatibility:()=>kn,CompressedArrayTexture:()=>Ys,CompressedCubeTexture:()=>Xs,CompressedTexture:()=>Js,CompressedTextureLoader:()=>Gu,ConeGeometry:()=>sc,ConstantAlphaFactor:()=>213,ConstantColorFactor:()=>211,Controls:()=>wp,CubeCamera:()=>Vd,CubeDepthTexture:()=>tc,CubeReflectionMapping:()=>301,CubeRefractionMapping:()=>302,CubeTexture:()=>Zs,CubeTextureLoader:()=>qu,CubeUVReflectionMapping:()=>306,CubicBezierCurve:()=>Fc,CubicBezierCurve3:()=>Ic,CubicInterpolant:()=>xu,CullFaceBack:()=>1,CullFaceFront:()=>2,CullFaceFrontBack:()=>3,CullFaceNone:()=>0,Curve:()=>hc,CurvePath:()=>Uc,CustomBlending:()=>5,CustomToneMapping:()=>5,CylinderGeometry:()=>oc,Cylindrical:()=>Pf,Data3DTexture:()=>Hr,DataArrayTexture:()=>Br,DataTexture:()=>Fo,DataTextureLoader:()=>Ju,DataUtils:()=>sa,DecrementStencilOp:()=>un,DecrementWrapStencilOp:()=>fn,DefaultLoadingManager:()=>zu,DepthFormat:()=>Xe,DepthStencilFormat:()=>Ze,DepthTexture:()=>ec,DetachedBindMode:()=>I,DirectionalLight:()=>gd,DirectionalLightHelper:()=>lp,DiscreteInterpolant:()=>Cu,DodecahedronGeometry:()=>lc,DoubleSide:()=>2,DstAlphaFactor:()=>206,DstColorFactor:()=>208,DynamicCopyUsage:()=>xn,DynamicDrawUsage:()=>hn,DynamicReadUsage:()=>vn,EdgesGeometry:()=>mc,EllipseCurve:()=>gc,EqualCompare:()=>514,EqualDepth:()=>4,EqualStencilFunc:()=>514,EquirectangularReflectionMapping:()=>303,EquirectangularRefractionMapping:()=>304,Euler:()=>$r,EventDispatcher:()=>Gn,ExternalTexture:()=>nc,ExtrudeGeometry:()=>kl,FileLoader:()=>Uu,Float16BufferAttribute:()=>ya,Float32BufferAttribute:()=>K,FloatType:()=>Be,Fog:()=>Ei,FogExp2:()=>Ti,FramebufferTexture:()=>qs,FrontSide:()=>0,Frustum:()=>ts,FrustumArray:()=>is,GLBufferAttribute:()=>Df,GLSL1:()=>`100`,GLSL3:()=>Cn,GreaterCompare:()=>516,GreaterDepth:()=>6,GreaterEqualCompare:()=>518,GreaterEqualDepth:()=>5,GreaterEqualStencilFunc:()=>518,GreaterStencilFunc:()=>516,GridHelper:()=>ip,Group:()=>_i,HTMLTexture:()=>$s,HalfFloatType:()=>Ve,HemisphereLight:()=>Zu,HemisphereLightHelper:()=>rp,IcosahedronGeometry:()=>Ml,ImageBitmapLoader:()=>jd,ImageLoader:()=>Ku,ImageUtils:()=>Ar,IncrementStencilOp:()=>ln,IncrementWrapStencilOp:()=>dn,InstancedBufferAttribute:()=>zo,InstancedBufferGeometry:()=>Cd,InstancedInterleavedBuffer:()=>Ef,InstancedMesh:()=>qo,Int16BufferAttribute:()=>ha,Int32BufferAttribute:()=>_a,Int8BufferAttribute:()=>fa,IntType:()=>Re,InterleavedBuffer:()=>ja,InterleavedBufferAttribute:()=>Na,Interpolant:()=>bu,InterpolateBezier:()=>Kt,InterpolateDiscrete:()=>Ut,InterpolateLinear:()=>Wt,InterpolateSmooth:()=>Gt,InterpolationSamplingMode:()=>On,InterpolationSamplingType:()=>Dn,InvertStencilOp:()=>pn,KeepStencilOp:()=>sn,KeyframeTrack:()=>Tu,LOD:()=>$a,LatheGeometry:()=>Nl,Layers:()=>ei,LessCompare:()=>513,LessDepth:()=>2,LessEqualCompare:()=>515,LessEqualDepth:()=>3,LessEqualStencilFunc:()=>515,LessStencilFunc:()=>513,Light:()=>Xu,LightProbe:()=>bd,Line:()=>Ms,Line3:()=>Gf,LineBasicMaterial:()=>ws,LineCurve:()=>Lc,LineCurve3:()=>Rc,LineDashedMaterial:()=>fu,LineLoop:()=>Ls,LineSegments:()=>Is,LinearFilter:()=>Ae,LinearInterpolant:()=>Su,LinearMipMapLinearFilter:()=>Pe,LinearMipMapNearestFilter:()=>Me,LinearMipmapLinearFilter:()=>Ne,LinearMipmapNearestFilter:()=>je,LinearSRGBColorSpace:()=>rn,LinearToneMapping:()=>1,LinearTransfer:()=>an,Loader:()=>Bu,LoaderUtils:()=>Sd,LoadingManager:()=>Ru,LoopOnce:()=>Bt,LoopPingPong:()=>Ht,LoopRepeat:()=>Vt,MOUSE:()=>xe,Material:()=>Fa,MaterialBlending:()=>6,MaterialLoader:()=>xd,MathUtils:()=>_r,Matrix2:()=>Ff,Matrix3:()=>xr,Matrix4:()=>W,MaxEquation:()=>104,Mesh:()=>xo,MeshBasicMaterial:()=>co,MeshDepthMaterial:()=>lu,MeshDistanceMaterial:()=>uu,MeshLambertMaterial:()=>cu,MeshMatcapMaterial:()=>du,MeshNormalMaterial:()=>su,MeshPhongMaterial:()=>au,MeshPhysicalMaterial:()=>iu,MeshStandardMaterial:()=>ru,MeshToonMaterial:()=>ou,MinEquation:()=>103,MirroredRepeatWrapping:()=>we,MixOperation:()=>1,MultiplyBlending:()=>4,MultiplyOperation:()=>0,NearestFilter:()=>Te,NearestMipMapLinearFilter:()=>ke,NearestMipMapNearestFilter:()=>De,NearestMipmapLinearFilter:()=>Oe,NearestMipmapNearestFilter:()=>Ee,NeutralToneMapping:()=>7,NeverCompare:()=>512,NeverDepth:()=>0,NeverStencilFunc:()=>512,NoBlending:()=>0,NoColorSpace:()=>``,NoNormalPacking:()=>``,NoToneMapping:()=>0,NormalAnimationBlendMode:()=>Xt,NormalBlending:()=>1,NormalGAPacking:()=>`ga`,NormalRGPacking:()=>`rg`,NotEqualCompare:()=>517,NotEqualDepth:()=>7,NotEqualStencilFunc:()=>517,NumberKeyframeTrack:()=>Ou,Object3D:()=>gi,ObjectLoader:()=>Ed,ObjectSpaceNormalMap:()=>1,OctahedronGeometry:()=>Pl,OneFactor:()=>201,OneMinusConstantAlphaFactor:()=>214,OneMinusConstantColorFactor:()=>212,OneMinusDstAlphaFactor:()=>207,OneMinusDstColorFactor:()=>209,OneMinusSrcAlphaFactor:()=>205,OneMinusSrcColorFactor:()=>203,OrthographicCamera:()=>md,PCFShadowMap:()=>1,PCFSoftShadowMap:()=>2,PMREMGenerator:()=>tm,Path:()=>Wc,PerspectiveCamera:()=>ld,Plane:()=>Zo,PlaneGeometry:()=>Fl,PlaneHelper:()=>_p,PointLight:()=>pd,PointLightHelper:()=>$f,Points:()=>Us,PointsMaterial:()=>Rs,PolarGridHelper:()=>ap,PolyhedronGeometry:()=>cc,PositionalAudio:()=>nf,PropertyBinding:()=>_f,PropertyMixer:()=>af,QuadraticBezierCurve:()=>zc,QuadraticBezierCurve3:()=>Bc,Quaternion:()=>vr,QuaternionKeyframeTrack:()=>Au,QuaternionLinearInterpolant:()=>ku,R11_EAC_Format:()=>ht,RED_GREEN_RGTC2_Format:()=>Rt,RED_RGTC1_Format:()=>It,REVISION:()=>`184`,RG11_EAC_Format:()=>_t,RGBADepthPacking:()=>$t,RGBAFormat:()=>Ye,RGBAIntegerFormat:()=>rt,RGBA_ASTC_10x10_Format:()=>At,RGBA_ASTC_10x5_Format:()=>Dt,RGBA_ASTC_10x6_Format:()=>Ot,RGBA_ASTC_10x8_Format:()=>kt,RGBA_ASTC_12x10_Format:()=>jt,RGBA_ASTC_12x12_Format:()=>Mt,RGBA_ASTC_4x4_Format:()=>yt,RGBA_ASTC_5x4_Format:()=>bt,RGBA_ASTC_5x5_Format:()=>xt,RGBA_ASTC_6x5_Format:()=>St,RGBA_ASTC_6x6_Format:()=>Ct,RGBA_ASTC_8x5_Format:()=>wt,RGBA_ASTC_8x6_Format:()=>Tt,RGBA_ASTC_8x8_Format:()=>Et,RGBA_BPTC_Format:()=>Nt,RGBA_ETC2_EAC_Format:()=>mt,RGBA_PVRTC_2BPPV1_Format:()=>dt,RGBA_PVRTC_4BPPV1_Format:()=>ut,RGBA_S3TC_DXT1_Format:()=>at,RGBA_S3TC_DXT3_Format:()=>ot,RGBA_S3TC_DXT5_Format:()=>st,RGBDepthPacking:()=>en,RGBFormat:()=>Je,RGBIntegerFormat:()=>nt,RGB_BPTC_SIGNED_Format:()=>Pt,RGB_BPTC_UNSIGNED_Format:()=>Ft,RGB_ETC1_Format:()=>ft,RGB_ETC2_Format:()=>pt,RGB_PVRTC_2BPPV1_Format:()=>lt,RGB_PVRTC_4BPPV1_Format:()=>ct,RGB_S3TC_DXT1_Format:()=>it,RGDepthPacking:()=>tn,RGFormat:()=>et,RGIntegerFormat:()=>tt,RawShaderMaterial:()=>nu,Ray:()=>so,Raycaster:()=>kf,RectAreaLight:()=>vd,RedFormat:()=>Qe,RedIntegerFormat:()=>$e,ReinhardToneMapping:()=>2,RenderTarget:()=>Rr,RenderTarget3D:()=>Sf,RepeatWrapping:()=>Ce,ReplaceStencilOp:()=>cn,ReverseSubtractEquation:()=>102,RingGeometry:()=>Il,SIGNED_R11_EAC_Format:()=>gt,SIGNED_RED_GREEN_RGTC2_Format:()=>zt,SIGNED_RED_RGTC1_Format:()=>Lt,SIGNED_RG11_EAC_Format:()=>vt,SRGBColorSpace:()=>nn,SRGBTransfer:()=>on,Scene:()=>Di,ShaderChunk:()=>Pp,ShaderLib:()=>Fp,ShaderMaterial:()=>tu,ShadowMaterial:()=>Kl,Shape:()=>Gc,ShapeGeometry:()=>Ll,ShapePath:()=>Cp,ShapeUtils:()=>El,ShortType:()=>R,Skeleton:()=>Ro,SkeletonHelper:()=>Zf,SkinnedMesh:()=>No,Source:()=>Mr,Sphere:()=>Ca,SphereGeometry:()=>Y,Spherical:()=>Nf,SphericalHarmonics3:()=>yd,SplineCurve:()=>Vc,SpotLight:()=>dd,SpotLightHelper:()=>qf,Sprite:()=>Ya,SpriteMaterial:()=>Ia,SrcAlphaFactor:()=>204,SrcAlphaSaturateFactor:()=>210,SrcColorFactor:()=>202,StaticCopyUsage:()=>bn,StaticDrawUsage:()=>mn,StaticReadUsage:()=>_n,StereoCamera:()=>Rd,StreamCopyUsage:()=>Sn,StreamDrawUsage:()=>gn,StreamReadUsage:()=>yn,StringKeyframeTrack:()=>ju,SubtractEquation:()=>101,SubtractiveBlending:()=>3,TOUCH:()=>Se,TangentSpaceNormalMap:()=>0,TetrahedronGeometry:()=>zl,Texture:()=>Ir,TextureLoader:()=>Yu,TextureUtils:()=>Ap,Timer:()=>Ud,TimestampQuery:()=>En,TorusGeometry:()=>Bl,TorusKnotGeometry:()=>Vl,Triangle:()=>Vi,TriangleFanDrawMode:()=>2,TriangleStripDrawMode:()=>1,TrianglesDrawMode:()=>0,TubeGeometry:()=>Hl,UVMapping:()=>300,Uint16BufferAttribute:()=>ga,Uint32BufferAttribute:()=>va,Uint8BufferAttribute:()=>pa,Uint8ClampedBufferAttribute:()=>ma,Uniform:()=>Cf,UniformsGroup:()=>Tf,UniformsLib:()=>Z,UniformsUtils:()=>Ql,UnsignedByteType:()=>Fe,UnsignedInt101111Type:()=>Ke,UnsignedInt248Type:()=>We,UnsignedInt5999Type:()=>Ge,UnsignedIntType:()=>ze,UnsignedShort4444Type:()=>He,UnsignedShort5551Type:()=>Ue,UnsignedShortType:()=>Le,VSMShadowMap:()=>3,Vector2:()=>H,Vector3:()=>U,Vector4:()=>Lr,VectorKeyframeTrack:()=>Mu,VideoFrameTexture:()=>Ks,VideoTexture:()=>Gs,WebGL3DRenderTarget:()=>Ur,WebGLArrayRenderTarget:()=>Vr,WebGLCoordinateSystem:()=>wn,WebGLCubeRenderTarget:()=>um,WebGLRenderTarget:()=>zr,WebGLRenderer:()=>Jg,WebGLUtils:()=>Ig,WebGPUCoordinateSystem:()=>Tn,WebXRController:()=>yi,WireframeGeometry:()=>Ul,WrapAroundEnding:()=>Yt,ZeroCurvatureEnding:()=>qt,ZeroFactor:()=>200,ZeroSlopeEnding:()=>Jt,ZeroStencilOp:()=>0,createCanvasElement:()=>Fn,error:()=>B,getConsoleFunction:()=>zn,log:()=>Bn,setConsoleFunction:()=>Rn,warn:()=>z,warnOnce:()=>Hn});function Mp(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){t!==!0&&n!==null&&e!==null&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e!==null&&e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Np(e){let t=new WeakMap;function n(t,n){let r=t.array,i=t.usage,a=r.byteLength,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback();let s;if(r instanceof Float32Array)s=e.FLOAT;else if(typeof Float16Array<`u`&&r instanceof Float16Array)s=e.HALF_FLOAT;else if(r instanceof Uint16Array)s=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)s=e.SHORT;else if(r instanceof Uint32Array)s=e.UNSIGNED_INT;else if(r instanceof Int32Array)s=e.INT;else if(r instanceof Int8Array)s=e.BYTE;else if(r instanceof Uint8Array)s=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)s=e.UNSIGNED_BYTE;else throw Error(`THREE.WebGLAttributes: Unsupported buffer data format: `+r);return{buffer:o,type:s,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:a}}function r(t,n,r){let i=n.array,a=n.updateRanges;if(e.bindBuffer(r,t),a.length===0)e.bufferSubData(r,0,i);else{a.sort((e,t)=>e.start-t.start);let t=0;for(let e=1;e 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,clipping_planes_pars_fragment:`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,clipping_planes_pars_vertex:`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,clipping_planes_vertex:`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,color_fragment:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#endif`,color_pars_fragment:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#endif`,color_pars_vertex:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec4 vColor; +#endif`,color_vertex:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec4( 1.0 ); +#endif +#ifdef USE_COLOR_ALPHA + vColor *= color; +#elif defined( USE_COLOR ) + vColor.rgb *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.rgb *= instanceColor.rgb; +#endif +#ifdef USE_BATCHING_COLOR + vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) ); +#endif`,common:`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,cube_uv_reflection_fragment:`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,defaultnormal_vertex:`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,displacementmap_pars_vertex:`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,displacementmap_vertex:`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,emissivemap_fragment:`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,emissivemap_pars_fragment:`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,colorspace_fragment:`gl_FragColor = linearToOutputTexel( gl_FragColor );`,colorspace_pars_fragment:`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,envmap_fragment:`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * reflectVec ); + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif + #endif +#endif`,envmap_common_pars_fragment:`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif +#endif`,envmap_pars_fragment:`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,envmap_pars_vertex:`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,envmap_physical_pars_fragment:`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,envmap_vertex:`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,fog_vertex:`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,fog_pars_vertex:`#ifdef USE_FOG + varying float vFogDepth; +#endif`,fog_fragment:`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,fog_pars_fragment:`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,gradientmap_pars_fragment:`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,lightmap_pars_fragment:`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,lights_lambert_fragment:`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,lights_lambert_pars_fragment:`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,lights_pars_begin:`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif +#include `,lights_toon_fragment:`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,lights_toon_pars_fragment:`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,lights_phong_fragment:`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,lights_phong_pars_fragment:`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,lights_physical_fragment:`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +material.metalness = metalnessFactor; +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor; + material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = vec3( 0.04 ); + material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,lights_physical_pars_fragment:`uniform sampler2D dfgLUT; +struct PhysicalMaterial { + vec3 diffuseColor; + vec3 diffuseContribution; + vec3 specularColor; + vec3 specularColorBlended; + float roughness; + float metalness; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + vec3 iridescenceFresnelDielectric; + vec3 iridescenceFresnelMetallic; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColorBlended; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transpose( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float rInv = 1.0 / ( roughness + 0.1 ); + float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv; + float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv; + float DG = exp( a * dotNV + b ); + return saturate( DG ); +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + float dotNV = saturate( dot( normal, viewDir ) ); + vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg; + vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg; + vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y; + vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y; + float Ess_V = dfgV.x + dfgV.y; + float Ess_L = dfgL.x + dfgL.y; + float Ems_V = 1.0 - Ess_V; + float Ems_L = 1.0 - Ess_L; + vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619; + vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON ); + float compensationFactor = Ems_V * Ems_L; + vec3 multiScatter = Fms * compensationFactor; + return singleScatter + multiScatter; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + #ifdef USE_CLEARCOAT + vec3 Ncc = geometryClearcoatNormal; + vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness ); + vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat ); + vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat ); + mat3 mInvClearcoat = mat3( + vec3( t1Clearcoat.x, 0, t1Clearcoat.y ), + vec3( 0, 1, 0 ), + vec3( t1Clearcoat.z, 0, t1Clearcoat.w ) + ); + vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y; + clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords ); + #endif + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + + float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness ); + + float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL ); + + irradiance *= sheenEnergyComp; + + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution ); + #ifdef USE_SHEEN + float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; + diffuse *= sheenEnergyComp; + #endif + reflectedLight.indirectDiffuse += diffuse; +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI; + #endif + vec3 singleScatteringDielectric = vec3( 0.0 ); + vec3 multiScatteringDielectric = vec3( 0.0 ); + vec3 singleScatteringMetallic = vec3( 0.0 ); + vec3 multiScatteringMetallic = vec3( 0.0 ); + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); + computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); + #endif + vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness ); + vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness ); + vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric; + vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + vec3 indirectSpecular = radiance * singleScattering; + indirectSpecular += multiScattering * cosineWeightedIrradiance; + vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance; + #ifdef USE_SHEEN + float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; + indirectSpecular *= sheenEnergyComp; + indirectDiffuse *= sheenEnergyComp; + #endif + reflectedLight.indirectSpecular += indirectSpecular; + reflectedLight.indirectDiffuse += indirectDiffuse; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,lights_fragment_begin:` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor ); + material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif + #ifdef USE_LIGHT_PROBES_GRID + vec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz; + vec3 probeWorldNormal = inverseTransformDirection( geometryNormal, viewMatrix ); + irradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal ); + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,lights_fragment_maps:`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV ) + #if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,lights_fragment_end:`#if defined( RE_IndirectDiffuse ) + #if defined( LAMBERT ) || defined( PHONG ) + irradiance += iblIrradiance; + #endif + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,lightprobes_pars_fragment:`#ifdef USE_LIGHT_PROBES_GRID +uniform highp sampler3D probesSH; +uniform vec3 probesMin; +uniform vec3 probesMax; +uniform vec3 probesResolution; +vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) { + vec3 res = probesResolution; + vec3 gridRange = probesMax - probesMin; + vec3 resMinusOne = res - 1.0; + vec3 probeSpacing = gridRange / resMinusOne; + vec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5; + vec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 ); + uvw = uvw * resMinusOne / res + 0.5 / res; + float nz = res.z; + float paddedSlices = nz + 2.0; + float atlasDepth = 7.0 * paddedSlices; + float uvZBase = uvw.z * nz + 1.0; + vec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase ) / atlasDepth ) ); + vec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase + paddedSlices ) / atlasDepth ) ); + vec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices ) / atlasDepth ) ); + vec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices ) / atlasDepth ) ); + vec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices ) / atlasDepth ) ); + vec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices ) / atlasDepth ) ); + vec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices ) / atlasDepth ) ); + vec3 c0 = s0.xyz; + vec3 c1 = vec3( s0.w, s1.xy ); + vec3 c2 = vec3( s1.zw, s2.x ); + vec3 c3 = s2.yzw; + vec3 c4 = s3.xyz; + vec3 c5 = vec3( s3.w, s4.xy ); + vec3 c6 = vec3( s4.zw, s5.x ); + vec3 c7 = s5.yzw; + vec3 c8 = s6.xyz; + float x = worldNormal.x, y = worldNormal.y, z = worldNormal.z; + vec3 result = c0 * 0.886227; + result += c1 * 2.0 * 0.511664 * y; + result += c2 * 2.0 * 0.511664 * z; + result += c3 * 2.0 * 0.511664 * x; + result += c4 * 2.0 * 0.429043 * x * y; + result += c5 * 2.0 * 0.429043 * y * z; + result += c6 * ( 0.743125 * z * z - 0.247708 ); + result += c7 * 2.0 * 0.429043 * x * z; + result += c8 * 0.429043 * ( x * x - y * y ); + return max( result, vec3( 0.0 ) ); +} +#endif`,logdepthbuf_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,logdepthbuf_pars_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,logdepthbuf_pars_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER + varying float vFragDepth; + varying float vIsPerspective; +#endif`,logdepthbuf_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,map_fragment:`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,map_pars_fragment:`#ifdef USE_MAP + uniform sampler2D map; +#endif`,map_particle_fragment:`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,map_particle_pars_fragment:`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,metalnessmap_fragment:`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,metalnessmap_pars_fragment:`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,morphinstance_vertex:`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,morphcolor_vertex:`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,morphnormal_vertex:`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,morphtarget_pars_vertex:`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,morphtarget_vertex:`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,normal_fragment_begin:`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,normal_fragment_maps:`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #if defined( USE_PACKED_NORMALMAP ) + mapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) ); + #endif + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,normal_pars_fragment:`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,normal_pars_vertex:`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,normal_vertex:`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,normalmap_pars_fragment:`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,clearcoat_normal_fragment_begin:`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,clearcoat_normal_fragment_maps:`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,clearcoat_pars_fragment:`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,iridescence_pars_fragment:`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,opaque_fragment:`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,packing:`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + #ifdef USE_REVERSED_DEPTH_BUFFER + + return depth * ( far - near ) - far; + #else + return depth * ( near - far ) - near; + #endif +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + + #ifdef USE_REVERSED_DEPTH_BUFFER + return ( near * far ) / ( ( near - far ) * depth - near ); + #else + return ( near * far ) / ( ( far - near ) * depth - far ); + #endif +}`,premultiplied_alpha_fragment:`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,project_vertex:`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,dithering_fragment:`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,dithering_pars_fragment:`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,roughnessmap_fragment:`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,roughnessmap_pars_fragment:`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,shadowmap_pars_fragment:`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + #if defined( SHADOWMAP_TYPE_PCF ) + uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + #else + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + #if defined( SHADOWMAP_TYPE_PCF ) + uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + #else + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #if defined( SHADOWMAP_TYPE_PCF ) + uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + #elif defined( SHADOWMAP_TYPE_BASIC ) + uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + #if defined( SHADOWMAP_TYPE_PCF ) + float interleavedGradientNoise( vec2 position ) { + return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) ); + } + vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) { + const float goldenAngle = 2.399963229728653; + float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) ); + float theta = float( sampleIndex ) * goldenAngle + phi; + return vec2( cos( theta ), sin( theta ) ) * r; + } + #endif + #if defined( SHADOWMAP_TYPE_PCF ) + float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float radius = shadowRadius * texelSize.x; + float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; + shadow = ( + texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) + + texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) + + texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) + + texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) + + texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) ) + ) * 0.2; + } + return mix( 1.0, shadow, shadowIntensity ); + } + #elif defined( SHADOWMAP_TYPE_VSM ) + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + #ifdef USE_REVERSED_DEPTH_BUFFER + shadowCoord.z -= shadowBias; + #else + shadowCoord.z += shadowBias; + #endif + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg; + float mean = distribution.x; + float variance = distribution.y * distribution.y; + #ifdef USE_REVERSED_DEPTH_BUFFER + float hard_shadow = step( mean, shadowCoord.z ); + #else + float hard_shadow = step( shadowCoord.z, mean ); + #endif + + if ( hard_shadow == 1.0 ) { + shadow = 1.0; + } else { + variance = max( variance, 0.0000001 ); + float d = shadowCoord.z - mean; + float p_max = variance / ( variance + d * d ); + p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 ); + shadow = max( hard_shadow, p_max ); + } + } + return mix( 1.0, shadow, shadowIntensity ); + } + #else + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + #ifdef USE_REVERSED_DEPTH_BUFFER + shadowCoord.z -= shadowBias; + #else + shadowCoord.z += shadowBias; + #endif + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + float depth = texture2D( shadowMap, shadowCoord.xy ).r; + #ifdef USE_REVERSED_DEPTH_BUFFER + shadow = step( depth, shadowCoord.z ); + #else + shadow = step( shadowCoord.z, depth ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #if defined( SHADOWMAP_TYPE_PCF ) + float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + vec3 bd3D = normalize( lightToPosition ); + vec3 absVec = abs( lightToPosition ); + float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); + if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { + #ifdef USE_REVERSED_DEPTH_BUFFER + float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); + dp -= shadowBias; + #else + float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); + dp += shadowBias; + #endif + float texelSize = shadowRadius / shadowMapSize.x; + vec3 absDir = abs( bd3D ); + vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 ); + tangent = normalize( cross( bd3D, tangent ) ); + vec3 bitangent = cross( bd3D, tangent ); + float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; + vec2 sample0 = vogelDiskSample( 0, 5, phi ); + vec2 sample1 = vogelDiskSample( 1, 5, phi ); + vec2 sample2 = vogelDiskSample( 2, 5, phi ); + vec2 sample3 = vogelDiskSample( 3, 5, phi ); + vec2 sample4 = vogelDiskSample( 4, 5, phi ); + shadow = ( + texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) + + texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) + + texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) + + texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) + + texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) ) + ) * 0.2; + } + return mix( 1.0, shadow, shadowIntensity ); + } + #elif defined( SHADOWMAP_TYPE_BASIC ) + float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + vec3 absVec = abs( lightToPosition ); + float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); + if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { + float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); + dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + float depth = textureCube( shadowMap, bd3D ).r; + #ifdef USE_REVERSED_DEPTH_BUFFER + depth = 1.0 - depth; + #endif + shadow = step( dp, depth ); + } + return mix( 1.0, shadow, shadowIntensity ); + } + #endif + #endif +#endif`,shadowmap_pars_vertex:`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,shadowmap_vertex:`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + #ifdef HAS_NORMAL + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #else + vec3 shadowWorldNormal = vec3( 0.0 ); + #endif + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,shadowmask_pars_fragment:`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,skinbase_vertex:`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,skinning_pars_vertex:`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,skinning_vertex:`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,skinnormal_vertex:`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,specularmap_fragment:`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,specularmap_pars_fragment:`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,tonemapping_fragment:`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,tonemapping_pars_fragment:`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,transmission_fragment:`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,transmission_pars_fragment:`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + #else + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,uv_pars_fragment:`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,uv_pars_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,uv_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,worldpos_vertex:`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`,background_vert:`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,background_frag:`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,backgroundCube_vert:`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,backgroundCube_frag:`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,cube_vert:`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,cube_frag:`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,depth_vert:`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,depth_frag:`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + #ifdef USE_REVERSED_DEPTH_BUFFER + float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; + #else + float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; + #endif + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,distance_vert:`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,distance_frag:`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 ); +}`,equirect_vert:`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,equirect_frag:`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,linedashed_vert:`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,linedashed_frag:`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,meshbasic_vert:`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,meshbasic_frag:`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,meshlambert_vert:`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,meshlambert_frag:`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,meshmatcap_vert:`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,meshmatcap_frag:`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,meshnormal_vert:`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,meshnormal_frag:`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,meshphong_vert:`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,meshphong_frag:`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,meshphysical_vert:`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,meshphysical_frag:`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + + outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect; + + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,meshtoon_vert:`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,meshtoon_frag:`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,points_vert:`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,points_frag:`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,shadow_vert:`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,shadow_frag:`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include + #include +}`,sprite_vert:`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,sprite_frag:`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`},Z={common:{diffuse:{value:new G(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new xr},alphaMap:{value:null},alphaMapTransform:{value:new xr},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new xr}},envmap:{envMap:{value:null},envMapRotation:{value:new xr},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new xr}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new xr}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new xr},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new xr},normalScale:{value:new H(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new xr},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new xr}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new xr}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new xr}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new G(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new U},probesMax:{value:new U},probesResolution:{value:new U}},points:{diffuse:{value:new G(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new xr},alphaTest:{value:0},uvTransform:{value:new xr}},sprite:{diffuse:{value:new G(16777215)},opacity:{value:1},center:{value:new H(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new xr},alphaMap:{value:null},alphaMapTransform:{value:new xr},alphaTest:{value:0}}},Fp={basic:{uniforms:Jl([Z.common,Z.specularmap,Z.envmap,Z.aomap,Z.lightmap,Z.fog]),vertexShader:Pp.meshbasic_vert,fragmentShader:Pp.meshbasic_frag},lambert:{uniforms:Jl([Z.common,Z.specularmap,Z.envmap,Z.aomap,Z.lightmap,Z.emissivemap,Z.bumpmap,Z.normalmap,Z.displacementmap,Z.fog,Z.lights,{emissive:{value:new G(0)},envMapIntensity:{value:1}}]),vertexShader:Pp.meshlambert_vert,fragmentShader:Pp.meshlambert_frag},phong:{uniforms:Jl([Z.common,Z.specularmap,Z.envmap,Z.aomap,Z.lightmap,Z.emissivemap,Z.bumpmap,Z.normalmap,Z.displacementmap,Z.fog,Z.lights,{emissive:{value:new G(0)},specular:{value:new G(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:Pp.meshphong_vert,fragmentShader:Pp.meshphong_frag},standard:{uniforms:Jl([Z.common,Z.envmap,Z.aomap,Z.lightmap,Z.emissivemap,Z.bumpmap,Z.normalmap,Z.displacementmap,Z.roughnessmap,Z.metalnessmap,Z.fog,Z.lights,{emissive:{value:new G(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Pp.meshphysical_vert,fragmentShader:Pp.meshphysical_frag},toon:{uniforms:Jl([Z.common,Z.aomap,Z.lightmap,Z.emissivemap,Z.bumpmap,Z.normalmap,Z.displacementmap,Z.gradientmap,Z.fog,Z.lights,{emissive:{value:new G(0)}}]),vertexShader:Pp.meshtoon_vert,fragmentShader:Pp.meshtoon_frag},matcap:{uniforms:Jl([Z.common,Z.bumpmap,Z.normalmap,Z.displacementmap,Z.fog,{matcap:{value:null}}]),vertexShader:Pp.meshmatcap_vert,fragmentShader:Pp.meshmatcap_frag},points:{uniforms:Jl([Z.points,Z.fog]),vertexShader:Pp.points_vert,fragmentShader:Pp.points_frag},dashed:{uniforms:Jl([Z.common,Z.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Pp.linedashed_vert,fragmentShader:Pp.linedashed_frag},depth:{uniforms:Jl([Z.common,Z.displacementmap]),vertexShader:Pp.depth_vert,fragmentShader:Pp.depth_frag},normal:{uniforms:Jl([Z.common,Z.bumpmap,Z.normalmap,Z.displacementmap,{opacity:{value:1}}]),vertexShader:Pp.meshnormal_vert,fragmentShader:Pp.meshnormal_frag},sprite:{uniforms:Jl([Z.sprite,Z.fog]),vertexShader:Pp.sprite_vert,fragmentShader:Pp.sprite_frag},background:{uniforms:{uvTransform:{value:new xr},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Pp.background_vert,fragmentShader:Pp.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new xr}},vertexShader:Pp.backgroundCube_vert,fragmentShader:Pp.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Pp.cube_vert,fragmentShader:Pp.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Pp.equirect_vert,fragmentShader:Pp.equirect_frag},distance:{uniforms:Jl([Z.common,Z.displacementmap,{referencePosition:{value:new U},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Pp.distance_vert,fragmentShader:Pp.distance_frag},shadow:{uniforms:Jl([Z.lights,Z.fog,{color:{value:new G(0)},opacity:{value:1}}]),vertexShader:Pp.shadow_vert,fragmentShader:Pp.shadow_frag}};Fp.physical={uniforms:Jl([Fp.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new xr},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new xr},clearcoatNormalScale:{value:new H(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new xr},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new xr},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new xr},sheen:{value:0},sheenColor:{value:new G(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new xr},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new xr},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new xr},transmissionSamplerSize:{value:new H},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new xr},attenuationDistance:{value:0},attenuationColor:{value:new G(0)},specularColor:{value:new G(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new xr},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new xr},anisotropyVector:{value:new H},anisotropyMap:{value:null},anisotropyMapTransform:{value:new xr}}]),vertexShader:Pp.meshphysical_vert,fragmentShader:Pp.meshphysical_frag};var Ip={r:0,b:0,g:0},Lp=new W,Rp=new xr;Rp.set(-1,0,0,0,1,0,0,0,1);function zp(e,t,n,r,i,a){let o=new G(0),s=i===!0?0:1,c,l,u=null,d=0,f=null;function p(e){let n=e.isScene===!0?e.background:null;if(n&&n.isTexture){let r=e.backgroundBlurriness>0;n=t.get(n,r)}return n}function m(t){let r=!1,i=p(t);i===null?g(o,s):i&&i.isColor&&(g(i,1),r=!0);let c=e.xr.getEnvironmentBlendMode();c===`additive`?n.buffers.color.setClear(0,0,0,1,a):c===`alpha-blend`&&n.buffers.color.setClear(0,0,0,0,a),(e.autoClear||r)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))}function h(t,n){let i=p(n);i&&(i.isCubeTexture||i.mapping===306)?(l===void 0&&(l=new xo(new rc(1,1,1),new tu({name:`BackgroundCubeMaterial`,uniforms:ql(Fp.backgroundCube.uniforms),vertexShader:Fp.backgroundCube.vertexShader,fragmentShader:Fp.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute(`normal`),l.geometry.deleteAttribute(`uv`),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(l)),l.material.uniforms.envMap.value=i,l.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(Lp.makeRotationFromEuler(n.backgroundRotation)).transpose(),i.isCubeTexture&&i.isRenderTargetTexture===!1&&l.material.uniforms.backgroundRotation.value.premultiply(Rp),l.material.toneMapped=Er.getTransfer(i.colorSpace)!==on,(u!==i||d!==i.version||f!==e.toneMapping)&&(l.material.needsUpdate=!0,u=i,d=i.version,f=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null)):i&&i.isTexture&&(c===void 0&&(c=new xo(new Fl(2,2),new tu({name:`BackgroundMaterial`,uniforms:ql(Fp.background.uniforms),vertexShader:Fp.background.vertexShader,fragmentShader:Fp.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute(`normal`),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=i,c.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,c.material.toneMapped=Er.getTransfer(i.colorSpace)!==on,i.matrixAutoUpdate===!0&&i.updateMatrix(),c.material.uniforms.uvTransform.value.copy(i.matrix),(u!==i||d!==i.version||f!==e.toneMapping)&&(c.material.needsUpdate=!0,u=i,d=i.version,f=e.toneMapping),c.layers.enableAll(),t.unshift(c,c.geometry,c.material,0,0,null))}function g(t,r){t.getRGB(Ip,Zl(e)),n.buffers.color.setClear(Ip.r,Ip.g,Ip.b,r,a)}function _(){l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),s=t,g(o,s)},getClearAlpha:function(){return s},setClearAlpha:function(e){s=e,g(o,s)},render:m,addToRenderList:h,dispose:_}}function Bp(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=f(null),a=i,o=!1;function s(n,r,i,s,c){let u=!1,f=d(n,s,i,r);a!==f&&(a=f,l(a.object)),u=p(n,s,i,c),u&&m(n,s,i,c),c!==null&&t.update(c,e.ELEMENT_ARRAY_BUFFER),(u||o)&&(o=!1,b(n,r,i,s),c!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(c).buffer))}function c(){return e.createVertexArray()}function l(t){return e.bindVertexArray(t)}function u(t){return e.deleteVertexArray(t)}function d(e,t,n,i){let a=i.wireframe===!0,o=r[t.id];o===void 0&&(o={},r[t.id]=o);let s=e.isInstancedMesh===!0?e.id:0,l=o[s];l===void 0&&(l={},o[s]=l);let u=l[n.id];u===void 0&&(u={},l[n.id]=u);let d=u[a];return d===void 0&&(d=f(c()),u[a]=d),d}function f(e){let t=[],r=[],i=[];for(let e=0;e=0){let n=i[t],r=o[t];if(r===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(r=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(r=e.instanceColor)),n===void 0||n.attribute!==r||r&&n.data!==r.data)return!0;s++}return a.attributesNum!==s||a.index!==r}function m(e,t,n,r){let i={},o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=o[t];n===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(n=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,s++}a.attributes=i,a.attributesNum=s,a.index=r}function h(){let e=a.newAttributes;for(let t=0,n=e.length;t=0){let s=o[r];if(s===void 0&&(r===`instanceMatrix`&&n.instanceMatrix&&(s=n.instanceMatrix),r===`instanceColor`&&n.instanceColor&&(s=n.instanceColor)),s!==void 0){let r=s.normalized,o=s.itemSize,c=t.get(s);if(c===void 0)continue;let l=c.buffer,u=c.type,d=c.bytesPerElement,f=u===e.INT||u===e.UNSIGNED_INT||s.gpuType===1013;if(s.isInterleavedBufferAttribute){let t=s.data,c=t.stride,p=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return`highp`;t=`mediump`}return t===`mediump`&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?`mediump`:`lowp`}let l=n.precision===void 0?`highp`:n.precision,u=c(l);u!==l&&(z(`WebGLRenderer:`,l,`not supported, using`,u,`instead.`),l=u);let d=n.logarithmicDepthBuffer===!0,f=n.reversedDepthBuffer===!0&&t.has(`EXT_clip_control`);n.reversedDepthBuffer===!0&&f===!1&&z(`WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.`);let p=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),m=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_TEXTURE_SIZE),g=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),_=e.getParameter(e.MAX_VERTEX_ATTRIBS),v=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),y=e.getParameter(e.MAX_VARYING_VECTORS),b=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),x=e.getParameter(e.MAX_SAMPLES),S=e.getParameter(e.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:c,textureFormatReadable:o,textureTypeReadable:s,precision:l,logarithmicDepthBuffer:d,reversedDepthBuffer:f,maxTextures:p,maxVertexTextures:m,maxTextureSize:h,maxCubemapSize:g,maxAttributes:_,maxVertexUniforms:v,maxVaryings:y,maxFragmentUniforms:b,maxSamples:x,samples:S}}function Up(e){let t=this,n=null,r=0,i=!1,a=!1,o=new Zo,s=new xr,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let n=e.length!==0||t||r!==0||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=u(e,t,0)},this.setState=function(t,o,s){let d=t.clippingPlanes,f=t.clipIntersection,p=t.clipShadows,m=e.get(t);if(!i||d===null||d.length===0||a&&!p)a?u(null):l();else{let e=a?0:r,t=e*4,i=m.clippingState||null;c.value=i,i=u(d,o,t,s);for(let e=0;e!==t;++e)i[e]=n[e];m.clippingState=i,this.numIntersection=f?this.numPlanes:0,this.numPlanes+=e}};function l(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){let a=e===null?0:e.length,l=null;if(a!==0){if(l=c.value,i!==!0||l===null){let t=r+a*4,i=n.matrixWorldInverse;s.getNormalMatrix(i),(l===null||l.length0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=cm(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=sm(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=2**this._lodMax}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?l:0,l,l),c.setRenderTarget(r),p&&c.render(d,a),c.render(e,a)}c.toneMapping=u,c.autoClear=l,e.background=m}_textureToCubeUV(e,t){let n=this._renderer,r=e.mapping===301||e.mapping===302;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=cm()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=sm());let i=r?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=i;let o=i.uniforms;o.envMap.value=e;let s=this._cubeSize;im(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,Jp)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodMeshes.length;for(let t=1;td-Wp?n-d+Wp:0),m=4*(this._cubeSize-f);s.envMap.value=e.texture,s.roughness.value=u,s.mipInt.value=d-t,im(i,p,m,3*f,2*f),r.setRenderTarget(i),r.render(o,Jp),s.envMap.value=i.texture,s.roughness.value=0,s.mipInt.value=d-n,im(e,p,m,3*f,2*f),r.setRenderTarget(e),r.render(o,Jp)}_blur(e,t,n,r,i){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,`latitudinal`,i),this._halfBlur(a,e,n,n,r,`longitudinal`,i)}_halfBlur(e,t,n,r,i,a,o){let s=this._renderer,c=this._blurMaterial;a!==`latitudinal`&&a!==`longitudinal`&&B(`blur direction must be either latitudinal or longitudinal!`);let l=this._lodMeshes[r];l.material=c;let u=c.uniforms,d=this._sizeLods[n]-1,f=isFinite(i)?Math.PI/(2*d):2*Math.PI/(2*Kp-1),p=i/f,m=isFinite(i)?1+Math.floor(3*p):Kp;m>Kp&&z(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Kp}`);let h=[],g=0;for(let e=0;e_-Wp?r-_+Wp:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(t),s.render(l,Jp)}};function nm(e){let t=[],n=[],r=[],i=e,a=e-Wp+1+Gp.length;for(let o=0;oe-Wp?s=Gp[o-e+Wp-1]:o===0&&(s=0),n.push(s);let c=1/(a-2),l=-c,u=1+c,d=[l,l,u,l,u,u,l,l,u,u,l,u],f=new Float32Array(108),p=new Float32Array(72),m=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];f.set(r,18*e),p.set(d,12*e);let i=[e,e,e,e,e,e];m.set(i,6*e)}let h=new q;h.setAttribute(`position`,new da(f,3)),h.setAttribute(`uv`,new da(p,2)),h.setAttribute(`faceIndex`,new da(m,1)),r.push(new xo(h,null)),i>Wp&&i--}return{lodMeshes:r,sizeLods:t,sigmas:n}}function rm(e,t,n){let r=new zr(e,t,n);return r.texture.mapping=306,r.texture.name=`PMREM.cubeUv`,r.scissorTest=!0,r}function im(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function am(e,t,n){return new tu({name:`PMREMGGXConvolution`,defines:{GGX_SAMPLES:qp,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:lm(),fragmentShader:` + + precision highp float; + precision highp int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform float roughness; + uniform float mipInt; + + #define ENVMAP_TYPE_CUBE_UV + #include + + #define PI 3.14159265359 + + // Van der Corput radical inverse + float radicalInverse_VdC(uint bits) { + bits = (bits << 16u) | (bits >> 16u); + bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); + bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); + bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); + bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); + return float(bits) * 2.3283064365386963e-10; // / 0x100000000 + } + + // Hammersley sequence + vec2 hammersley(uint i, uint N) { + return vec2(float(i) / float(N), radicalInverse_VdC(i)); + } + + // GGX VNDF importance sampling (Eric Heitz 2018) + // "Sampling the GGX Distribution of Visible Normals" + // https://jcgt.org/published/0007/04/01/ + vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { + float alpha = roughness * roughness; + + // Section 4.1: Orthonormal basis + vec3 T1 = vec3(1.0, 0.0, 0.0); + vec3 T2 = cross(V, T1); + + // Section 4.2: Parameterization of projected area + float r = sqrt(Xi.x); + float phi = 2.0 * PI * Xi.y; + float t1 = r * cos(phi); + float t2 = r * sin(phi); + float s = 0.5 * (1.0 + V.z); + t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; + + // Section 4.3: Reprojection onto hemisphere + vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V; + + // Section 3.4: Transform back to ellipsoid configuration + return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); + } + + void main() { + vec3 N = normalize(vOutputDirection); + vec3 V = N; // Assume view direction equals normal for pre-filtering + + vec3 prefilteredColor = vec3(0.0); + float totalWeight = 0.0; + + // For very low roughness, just sample the environment directly + if (roughness < 0.001) { + gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); + return; + } + + // Tangent space basis for VNDF sampling + vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); + vec3 tangent = normalize(cross(up, N)); + vec3 bitangent = cross(N, tangent); + + for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { + vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); + + // For PMREM, V = N, so in tangent space V is always (0, 0, 1) + vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); + + // Transform H back to world space + vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); + vec3 L = normalize(2.0 * dot(V, H) * H - V); + + float NdotL = max(dot(N, L), 0.0); + + if(NdotL > 0.0) { + // Sample environment at fixed mip level + // VNDF importance sampling handles the distribution filtering + vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); + + // Weight by NdotL for the split-sum approximation + // VNDF PDF naturally accounts for the visible microfacet distribution + prefilteredColor += sampleColor * NdotL; + totalWeight += NdotL; + } + } + + if (totalWeight > 0.0) { + prefilteredColor = prefilteredColor / totalWeight; + } + + gl_FragColor = vec4(prefilteredColor, 1.0); + } + `,blending:0,depthTest:!1,depthWrite:!1})}function om(e,t,n){let r=new Float32Array(Kp),i=new U(0,1,0);return new tu({name:`SphericalGaussianBlur`,defines:{n:Kp,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:lm(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:0,depthTest:!1,depthWrite:!1})}function sm(){return new tu({name:`EquirectangularToCubeUV`,uniforms:{envMap:{value:null}},vertexShader:lm(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:0,depthTest:!1,depthWrite:!1})}function cm(){return new tu({name:`CubemapToCubeUV`,uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:lm(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:0,depthTest:!1,depthWrite:!1})}function lm(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}var um=class extends zr{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new Zs(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},r=new rc(5,5,5),i=new tu({name:`CubemapFromEquirect`,uniforms:ql(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;let a=new xo(r,i),o=t.minFilter;return t.minFilter===1008&&(t.minFilter=Ae),new Vd(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){let i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}};function dm(e){let t=new WeakMap,n=new WeakMap,r=null;function i(e,t=!1){return e==null?null:t?o(e):a(e)}function a(n){if(n&&n.isTexture){let r=n.mapping;if(r===303||r===304)if(t.has(n)){let e=t.get(n).texture;return s(e,n.mapping)}else{let r=n.image;if(r&&r.height>0){let i=new um(r.height);return i.fromEquirectangularTexture(e,n),t.set(n,i),n.addEventListener(`dispose`,l),s(i.texture,n.mapping)}else return null}}return n}function o(t){if(t&&t.isTexture){let i=t.mapping,a=i===303||i===304,o=i===301||i===302;if(a||o){let i=n.get(t),s=i===void 0?0:i.texture.pmremVersion;if(t.isRenderTargetTexture&&t.pmremVersion!==s)return r===null&&(r=new tm(e)),i=a?r.fromEquirectangular(t,i):r.fromCubemap(t,i),i.texture.pmremVersion=t.pmremVersion,n.set(t,i),i.texture;if(i!==void 0)return i.texture;{let s=t.image;return a&&s&&s.height>0||o&&s&&c(s)?(r===null&&(r=new tm(e)),i=a?r.fromEquirectangular(t):r.fromCubemap(t),i.texture.pmremVersion=t.pmremVersion,n.set(t,i),t.addEventListener(`dispose`,u),i.texture):null}}}return t}function s(e,t){return t===303?e.mapping=301:t===304&&(e.mapping=302),e}function c(e){let t=0;for(let n=0;n<6;n++)e[n]!==void 0&&t++;return t===6}function l(e){let n=e.target;n.removeEventListener(`dispose`,l);let r=t.get(n);r!==void 0&&(t.delete(n),r.dispose())}function u(e){let t=e.target;t.removeEventListener(`dispose`,u);let r=n.get(t);r!==void 0&&(n.delete(t),r.dispose())}function d(){t=new WeakMap,n=new WeakMap,r!==null&&(r.dispose(),r=null)}return{get:i,dispose:d}}function fm(e){let t={};function n(n){if(t[n]!==void 0)return t[n];let r=e.getExtension(n);return t[n]=r,r}return{has:function(e){return n(e)!==null},init:function(){n(`EXT_color_buffer_float`),n(`WEBGL_clip_cull_distance`),n(`OES_texture_float_linear`),n(`EXT_color_buffer_half_float`),n(`WEBGL_multisampled_render_to_texture`),n(`WEBGL_render_shared_exponent`)},get:function(e){let t=n(e);return t===null&&Hn(`WebGLRenderer: `+e+` extension not supported.`),t}}}function pm(e,t,n,r){let i={},a=new WeakMap;function o(e){let s=e.target;s.index!==null&&t.remove(s.index);for(let e in s.attributes)t.remove(s.attributes[e]);s.removeEventListener(`dispose`,o),delete i[s.id];let c=a.get(s);c&&(t.remove(c),a.delete(s)),r.releaseStatesOfGeometry(s),s.isInstancedBufferGeometry===!0&&delete s._maxInstanceCount,n.memory.geometries--}function s(e,t){return i[t.id]===!0?t:(t.addEventListener(`dispose`,o),i[t.id]=!0,n.memory.geometries++,t)}function c(n){let r=n.attributes;for(let n in r)t.update(r[n],e.ARRAY_BUFFER)}function l(e){let n=[],r=e.index,i=e.attributes.position,o=0;if(i===void 0)return;if(r!==null){let e=r.array;o=r.version;for(let t=0,r=e.length;t=65535?va:ga)(n,1);s.version=o;let c=a.get(e);c&&t.remove(c),a.set(e,s)}function u(e){let t=a.get(e);if(t){let n=e.index;n!==null&&t.versiont.maxTextureSize&&(m=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let h=new Float32Array(p*m*4*u),g=new Br(h,p,m,u);g.type=Be,g.needsUpdate=!0;let _=f*4;for(let t=0;t + #include + + void main() { + gl_FragColor = texture2D( tDiffuse, vUv ); + + #ifdef LINEAR_TONE_MAPPING + gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); + #elif defined( REINHARD_TONE_MAPPING ) + gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); + #elif defined( CINEON_TONE_MAPPING ) + gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); + #elif defined( ACES_FILMIC_TONE_MAPPING ) + gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); + #elif defined( AGX_TONE_MAPPING ) + gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); + #elif defined( NEUTRAL_TONE_MAPPING ) + gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); + #elif defined( CUSTOM_TONE_MAPPING ) + gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); + #endif + + #ifdef SRGB_TRANSFER + gl_FragColor = sRGBTransferOETF( gl_FragColor ); + #endif + }`,depthTest:!1,depthWrite:!1}),l=new xo(s,c),u=new md(-1,1,1,-1,0,1),d=null,f=null,p=!1,m,h=null,g=[],_=!1;this.setSize=function(e,t){a.setSize(e,t),o.setSize(e,t);for(let n=0;n0&&g[0].isRenderPass===!0;let t=a.width,n=a.height;for(let e=0;e0)return e;let i=t*n,a=Tm[i];if(a===void 0&&(a=new Float32Array(i),Tm[i]=a),t!==0){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function jm(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n0&&(this.seq=r.concat(i))}setValue(e,t,n,r){let i=this.map[t];i!==void 0&&i.setValue(e,n,r)}setOptional(e,t,n){let r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,a=t.length;i!==a;++i){let a=t[i],o=n[a.id];o.needsUpdate!==!1&&a.setValue(e,o.value,r)}}static seqWithValue(e,t){let n=[];for(let r=0,i=e.length;r!==i;++r){let i=e[r];i.id in t&&n.push(i)}return n}};function Dh(e,t,n){let r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}var Oh=37297,kh=0;function Ah(e,t){let n=e.split(` +`),r=[],i=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=i;e`:` `} ${i}: ${n[e]}`)}return r.join(` +`)}var jh=new xr;function Mh(e){Er._getMatrix(jh,Er.workingColorSpace,e);let t=`mat3( ${jh.elements.map(e=>e.toFixed(4))} )`;switch(Er.getTransfer(e)){case an:return[t,`LinearTransferOETF`];case on:return[t,`sRGBTransferOETF`];default:return z(`WebGLProgram: Unsupported color space: `,e),[t,`LinearTransferOETF`]}}function Nh(e,t,n){let r=e.getShaderParameter(t,e.COMPILE_STATUS),i=(e.getShaderInfoLog(t)||``).trim();if(r&&i===``)return``;let a=/ERROR: 0:(\d+)/.exec(i);if(a){let r=parseInt(a[1]);return n.toUpperCase()+` + +`+i+` + +`+Ah(e.getShaderSource(t),r)}else return i}function Ph(e,t){let n=Mh(t);return[`vec4 ${e}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,`}`].join(` +`)}var Fh={1:`Linear`,2:`Reinhard`,3:`Cineon`,4:`ACESFilmic`,6:`AgX`,7:`Neutral`,5:`Custom`};function Ih(e,t){let n=Fh[t];return n===void 0?(z(`WebGLProgram: Unsupported toneMapping:`,t),`vec3 `+e+`( vec3 color ) { return LinearToneMapping( color ); }`):`vec3 `+e+`( vec3 color ) { return `+n+`ToneMapping( color ); }`}var Lh=new U;function Rh(){return Er.getLuminanceCoefficients(Lh),[`float luminance( const in vec3 rgb ) {`,` const vec3 weights = vec3( ${Lh.x.toFixed(4)}, ${Lh.y.toFixed(4)}, ${Lh.z.toFixed(4)} );`,` return dot( weights, rgb );`,`}`].join(` +`)}function zh(e){return[e.extensionClipCullDistance?`#extension GL_ANGLE_clip_cull_distance : require`:``,e.extensionMultiDraw?`#extension GL_ANGLE_multi_draw : require`:``].filter(Hh).join(` +`)}function Bh(e){let t=[];for(let n in e){let r=e[n];r!==!1&&t.push(`#define `+n+` `+r)}return t.join(` +`)}function Vh(e,t){let n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function Kh(e){return e.replace(Gh,Jh)}var qh=new Map;function Jh(e,t){let n=Pp[t];if(n===void 0){let e=qh.get(t);if(e!==void 0)n=Pp[e],z(`WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.`,t,e);else throw Error(`Can not resolve #include <`+t+`>`)}return Kh(n)}var Yh=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Xh(e){return e.replace(Yh,Zh)}function Zh(e,t,n,r){let i=``;for(let e=parseInt(t);e0&&(g+=` +`),_=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m].filter(Hh).join(` +`),_.length>0&&(_+=` +`)):(g=[Qh(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.extensionClipCullDistance?`#define USE_CLIP_DISTANCE`:``,n.batching?`#define USE_BATCHING`:``,n.batchingColor?`#define USE_BATCHING_COLOR`:``,n.instancing?`#define USE_INSTANCING`:``,n.instancingColor?`#define USE_INSTANCING_COLOR`:``,n.instancingMorph?`#define USE_INSTANCING_MORPH`:``,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.map?`#define USE_MAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+u:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.displacementMap?`#define USE_DISPLACEMENTMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.mapUv?`#define MAP_UV `+n.mapUv:``,n.alphaMapUv?`#define ALPHAMAP_UV `+n.alphaMapUv:``,n.lightMapUv?`#define LIGHTMAP_UV `+n.lightMapUv:``,n.aoMapUv?`#define AOMAP_UV `+n.aoMapUv:``,n.emissiveMapUv?`#define EMISSIVEMAP_UV `+n.emissiveMapUv:``,n.bumpMapUv?`#define BUMPMAP_UV `+n.bumpMapUv:``,n.normalMapUv?`#define NORMALMAP_UV `+n.normalMapUv:``,n.displacementMapUv?`#define DISPLACEMENTMAP_UV `+n.displacementMapUv:``,n.metalnessMapUv?`#define METALNESSMAP_UV `+n.metalnessMapUv:``,n.roughnessMapUv?`#define ROUGHNESSMAP_UV `+n.roughnessMapUv:``,n.anisotropyMapUv?`#define ANISOTROPYMAP_UV `+n.anisotropyMapUv:``,n.clearcoatMapUv?`#define CLEARCOATMAP_UV `+n.clearcoatMapUv:``,n.clearcoatNormalMapUv?`#define CLEARCOAT_NORMALMAP_UV `+n.clearcoatNormalMapUv:``,n.clearcoatRoughnessMapUv?`#define CLEARCOAT_ROUGHNESSMAP_UV `+n.clearcoatRoughnessMapUv:``,n.iridescenceMapUv?`#define IRIDESCENCEMAP_UV `+n.iridescenceMapUv:``,n.iridescenceThicknessMapUv?`#define IRIDESCENCE_THICKNESSMAP_UV `+n.iridescenceThicknessMapUv:``,n.sheenColorMapUv?`#define SHEEN_COLORMAP_UV `+n.sheenColorMapUv:``,n.sheenRoughnessMapUv?`#define SHEEN_ROUGHNESSMAP_UV `+n.sheenRoughnessMapUv:``,n.specularMapUv?`#define SPECULARMAP_UV `+n.specularMapUv:``,n.specularColorMapUv?`#define SPECULAR_COLORMAP_UV `+n.specularColorMapUv:``,n.specularIntensityMapUv?`#define SPECULAR_INTENSITYMAP_UV `+n.specularIntensityMapUv:``,n.transmissionMapUv?`#define TRANSMISSIONMAP_UV `+n.transmissionMapUv:``,n.thicknessMapUv?`#define THICKNESSMAP_UV `+n.thicknessMapUv:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexNormals?`#define HAS_NORMAL`:``,n.vertexColors?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.flatShading?`#define FLAT_SHADED`:``,n.skinning?`#define USE_SKINNING`:``,n.morphTargets?`#define USE_MORPHTARGETS`:``,n.morphNormals&&n.flatShading===!1?`#define USE_MORPHNORMALS`:``,n.morphColors?`#define USE_MORPHCOLORS`:``,n.morphTargetsCount>0?`#define MORPHTARGETS_TEXTURE_STRIDE `+n.morphTextureStride:``,n.morphTargetsCount>0?`#define MORPHTARGETS_COUNT `+n.morphTargetsCount:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.sizeAttenuation?`#define USE_SIZEATTENUATION`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 modelMatrix;`,`uniform mat4 modelViewMatrix;`,`uniform mat4 projectionMatrix;`,`uniform mat4 viewMatrix;`,`uniform mat3 normalMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,`#ifdef USE_INSTANCING`,` attribute mat4 instanceMatrix;`,`#endif`,`#ifdef USE_INSTANCING_COLOR`,` attribute vec3 instanceColor;`,`#endif`,`#ifdef USE_INSTANCING_MORPH`,` uniform sampler2D morphTexture;`,`#endif`,`attribute vec3 position;`,`attribute vec3 normal;`,`attribute vec2 uv;`,`#ifdef USE_UV1`,` attribute vec2 uv1;`,`#endif`,`#ifdef USE_UV2`,` attribute vec2 uv2;`,`#endif`,`#ifdef USE_UV3`,` attribute vec2 uv3;`,`#endif`,`#ifdef USE_TANGENT`,` attribute vec4 tangent;`,`#endif`,`#if defined( USE_COLOR_ALPHA )`,` attribute vec4 color;`,`#elif defined( USE_COLOR )`,` attribute vec3 color;`,`#endif`,`#ifdef USE_SKINNING`,` attribute vec4 skinIndex;`,` attribute vec4 skinWeight;`,`#endif`,` +`].filter(Hh).join(` +`),_=[Qh(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.alphaToCoverage?`#define ALPHA_TO_COVERAGE`:``,n.map?`#define USE_MAP`:``,n.matcap?`#define USE_MATCAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+l:``,n.envMap?`#define `+u:``,n.envMap?`#define `+d:``,f?`#define CUBEUV_TEXEL_WIDTH `+f.texelWidth:``,f?`#define CUBEUV_TEXEL_HEIGHT `+f.texelHeight:``,f?`#define CUBEUV_MAX_MIP `+f.maxMip+`.0`:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.packedNormalMap?`#define USE_PACKED_NORMALMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoat?`#define USE_CLEARCOAT`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.dispersion?`#define USE_DISPERSION`:``,n.iridescence?`#define USE_IRIDESCENCE`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaTest?`#define USE_ALPHATEST`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.sheen?`#define USE_SHEEN`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexColors||n.instancingColor?`#define USE_COLOR`:``,n.vertexAlphas||n.batchingColor?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.gradientMap?`#define USE_GRADIENTMAP`:``,n.flatShading?`#define FLAT_SHADED`:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.premultipliedAlpha?`#define PREMULTIPLIED_ALPHA`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.numLightProbeGrids>0?`#define USE_LIGHT_PROBES_GRID`:``,n.decodeVideoTexture?`#define DECODE_VIDEO_TEXTURE`:``,n.decodeVideoTextureEmissive?`#define DECODE_VIDEO_TEXTURE_EMISSIVE`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 viewMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,n.toneMapping===0?``:`#define TONE_MAPPING`,n.toneMapping===0?``:Pp.tonemapping_pars_fragment,n.toneMapping===0?``:Ih(`toneMapping`,n.toneMapping),n.dithering?`#define DITHERING`:``,n.opaque?`#define OPAQUE`:``,Pp.colorspace_pars_fragment,Ph(`linearToOutputTexel`,n.outputColorSpace),Rh(),n.useDepthPacking?`#define DEPTH_PACKING `+n.depthPacking:``,` +`].filter(Hh).join(` +`)),o=Kh(o),o=Uh(o,n),o=Wh(o,n),s=Kh(s),s=Uh(s,n),s=Wh(s,n),o=Xh(o),s=Xh(s),n.isRawShaderMaterial!==!0&&(v=`#version 300 es +`,g=[p,`#define attribute in`,`#define varying out`,`#define texture2D texture`].join(` +`)+` +`+g,_=[`#define varying in`,n.glslVersion===`300 es`?``:`layout(location = 0) out highp vec4 pc_fragColor;`,n.glslVersion===`300 es`?``:`#define gl_FragColor pc_fragColor`,`#define gl_FragDepthEXT gl_FragDepth`,`#define texture2D texture`,`#define textureCube texture`,`#define texture2DProj textureProj`,`#define texture2DLodEXT textureLod`,`#define texture2DProjLodEXT textureProjLod`,`#define textureCubeLodEXT textureLod`,`#define texture2DGradEXT textureGrad`,`#define texture2DProjGradEXT textureProjGrad`,`#define textureCubeGradEXT textureGrad`].join(` +`)+` +`+_);let y=v+g+o,b=v+_+s,x=Dh(i,i.VERTEX_SHADER,y),S=Dh(i,i.FRAGMENT_SHADER,b);i.attachShader(h,x),i.attachShader(h,S),n.index0AttributeName===void 0?n.morphTargets===!0&&i.bindAttribLocation(h,0,`position`):i.bindAttribLocation(h,0,n.index0AttributeName),i.linkProgram(h);function C(t){if(e.debug.checkShaderErrors){let n=i.getProgramInfoLog(h)||``,r=i.getShaderInfoLog(x)||``,a=i.getShaderInfoLog(S)||``,o=n.trim(),s=r.trim(),c=a.trim(),l=!0,u=!0;if(i.getProgramParameter(h,i.LINK_STATUS)===!1)if(l=!1,typeof e.debug.onShaderError==`function`)e.debug.onShaderError(i,h,x,S);else{let e=Nh(i,x,`vertex`),n=Nh(i,S,`fragment`);B(`THREE.WebGLProgram: Shader Error `+i.getError()+` - VALIDATE_STATUS `+i.getProgramParameter(h,i.VALIDATE_STATUS)+` + +Material Name: `+t.name+` +Material Type: `+t.type+` + +Program Info Log: `+o+` +`+e+` +`+n)}else o===``?(s===``||c===``)&&(u=!1):z(`WebGLProgram: Program Info Log:`,o);u&&(t.diagnostics={runnable:l,programLog:o,vertexShader:{log:s,prefix:g},fragmentShader:{log:c,prefix:_}})}i.deleteShader(x),i.deleteShader(S),w=new Eh(i,h),T=Vh(i,h)}let w;this.getUniforms=function(){return w===void 0&&C(this),w};let T;this.getAttributes=function(){return T===void 0&&C(this),T};let E=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=i.getProgramParameter(h,Oh)),E},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(h),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=kh++,this.cacheKey=t,this.usedTimes=1,this.program=h,this.vertexShader=x,this.fragmentShader=S,this}var lg=0,ug=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(i)===!1&&(a.add(i),i.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let e of t)e.usedTimes--,e.usedTimes===0&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new dg(e),t.set(e,n)),n}},dg=class{constructor(e){this.id=lg++,this.code=e,this.usedTimes=0}};function fg(e){return e===1030||e===37490||e===36285}function pg(e,t,n,r,i,a){let o=new ei,s=new ug,c=new Set,l=[],u=new Map,d=r.logarithmicDepthBuffer,f=r.precision,p={MeshDepthMaterial:`depth`,MeshDistanceMaterial:`distance`,MeshNormalMaterial:`normal`,MeshBasicMaterial:`basic`,MeshLambertMaterial:`lambert`,MeshPhongMaterial:`phong`,MeshToonMaterial:`toon`,MeshStandardMaterial:`physical`,MeshPhysicalMaterial:`physical`,MeshMatcapMaterial:`matcap`,LineBasicMaterial:`basic`,LineDashedMaterial:`dashed`,PointsMaterial:`points`,ShadowMaterial:`shadow`,SpriteMaterial:`sprite`};function m(e){return c.add(e),e===0?`uv`:`uv${e}`}function h(i,o,l,u,h,g){let _=u.fog,v=h.geometry,y=i.isMeshStandardMaterial||i.isMeshLambertMaterial||i.isMeshPhongMaterial?u.environment:null,b=i.isMeshStandardMaterial||i.isMeshLambertMaterial&&!i.envMap||i.isMeshPhongMaterial&&!i.envMap,x=t.get(i.envMap||y,b),S=x&&x.mapping===306?x.image.height:null,C=p[i.type];i.precision!==null&&(f=r.getMaxPrecision(i.precision),f!==i.precision&&z(`WebGLProgram.getParameters:`,i.precision,`not supported, using`,f,`instead.`));let w=v.morphAttributes.position||v.morphAttributes.normal||v.morphAttributes.color,T=w===void 0?0:w.length,E=0;v.morphAttributes.position!==void 0&&(E=1),v.morphAttributes.normal!==void 0&&(E=2),v.morphAttributes.color!==void 0&&(E=3);let D,O,k,A;if(C){let e=Fp[C];D=e.vertexShader,O=e.fragmentShader}else D=i.vertexShader,O=i.fragmentShader,s.update(i),k=s.getVertexShaderID(i),A=s.getFragmentShaderID(i);let ee=e.getRenderTarget(),te=e.state.buffers.depth.getReversed(),j=h.isInstancedMesh===!0,ne=h.isBatchedMesh===!0,re=!!i.map,M=!!i.matcap,N=!!x,ie=!!i.aoMap,ae=!!i.lightMap,oe=!!i.bumpMap,se=!!i.normalMap,ce=!!i.displacementMap,le=!!i.emissiveMap,ue=!!i.metalnessMap,de=!!i.roughnessMap,fe=i.anisotropy>0,pe=i.clearcoat>0,me=i.dispersion>0,he=i.iridescence>0,ge=i.sheen>0,_e=i.transmission>0,ve=fe&&!!i.anisotropyMap,ye=pe&&!!i.clearcoatMap,be=pe&&!!i.clearcoatNormalMap,P=pe&&!!i.clearcoatRoughnessMap,xe=he&&!!i.iridescenceMap,Se=he&&!!i.iridescenceThicknessMap,F=ge&&!!i.sheenColorMap,I=ge&&!!i.sheenRoughnessMap,Ce=!!i.specularMap,L=!!i.specularColorMap,we=!!i.specularIntensityMap,Te=_e&&!!i.transmissionMap,Ee=_e&&!!i.thicknessMap,De=!!i.gradientMap,Oe=!!i.alphaMap,ke=i.alphaTest>0,Ae=!!i.alphaHash,je=!!i.extensions,Me=0;i.toneMapped&&(ee===null||ee.isXRRenderTarget===!0)&&(Me=e.toneMapping);let Ne={shaderID:C,shaderType:i.type,shaderName:i.name,vertexShader:D,fragmentShader:O,defines:i.defines,customVertexShaderID:k,customFragmentShaderID:A,isRawShaderMaterial:i.isRawShaderMaterial===!0,glslVersion:i.glslVersion,precision:f,batching:ne,batchingColor:ne&&h._colorsTexture!==null,instancing:j,instancingColor:j&&h.instanceColor!==null,instancingMorph:j&&h.morphTexture!==null,outputColorSpace:ee===null?e.outputColorSpace:ee.isXRRenderTarget===!0?ee.texture.colorSpace:Er.workingColorSpace,alphaToCoverage:!!i.alphaToCoverage,map:re,matcap:M,envMap:N,envMapMode:N&&x.mapping,envMapCubeUVHeight:S,aoMap:ie,lightMap:ae,bumpMap:oe,normalMap:se,displacementMap:ce,emissiveMap:le,normalMapObjectSpace:se&&i.normalMapType===1,normalMapTangentSpace:se&&i.normalMapType===0,packedNormalMap:se&&i.normalMapType===0&&fg(i.normalMap.format),metalnessMap:ue,roughnessMap:de,anisotropy:fe,anisotropyMap:ve,clearcoat:pe,clearcoatMap:ye,clearcoatNormalMap:be,clearcoatRoughnessMap:P,dispersion:me,iridescence:he,iridescenceMap:xe,iridescenceThicknessMap:Se,sheen:ge,sheenColorMap:F,sheenRoughnessMap:I,specularMap:Ce,specularColorMap:L,specularIntensityMap:we,transmission:_e,transmissionMap:Te,thicknessMap:Ee,gradientMap:De,opaque:i.transparent===!1&&i.blending===1&&i.alphaToCoverage===!1,alphaMap:Oe,alphaTest:ke,alphaHash:Ae,combine:i.combine,mapUv:re&&m(i.map.channel),aoMapUv:ie&&m(i.aoMap.channel),lightMapUv:ae&&m(i.lightMap.channel),bumpMapUv:oe&&m(i.bumpMap.channel),normalMapUv:se&&m(i.normalMap.channel),displacementMapUv:ce&&m(i.displacementMap.channel),emissiveMapUv:le&&m(i.emissiveMap.channel),metalnessMapUv:ue&&m(i.metalnessMap.channel),roughnessMapUv:de&&m(i.roughnessMap.channel),anisotropyMapUv:ve&&m(i.anisotropyMap.channel),clearcoatMapUv:ye&&m(i.clearcoatMap.channel),clearcoatNormalMapUv:be&&m(i.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:P&&m(i.clearcoatRoughnessMap.channel),iridescenceMapUv:xe&&m(i.iridescenceMap.channel),iridescenceThicknessMapUv:Se&&m(i.iridescenceThicknessMap.channel),sheenColorMapUv:F&&m(i.sheenColorMap.channel),sheenRoughnessMapUv:I&&m(i.sheenRoughnessMap.channel),specularMapUv:Ce&&m(i.specularMap.channel),specularColorMapUv:L&&m(i.specularColorMap.channel),specularIntensityMapUv:we&&m(i.specularIntensityMap.channel),transmissionMapUv:Te&&m(i.transmissionMap.channel),thicknessMapUv:Ee&&m(i.thicknessMap.channel),alphaMapUv:Oe&&m(i.alphaMap.channel),vertexTangents:!!v.attributes.tangent&&(se||fe),vertexNormals:!!v.attributes.normal,vertexColors:i.vertexColors,vertexAlphas:i.vertexColors===!0&&!!v.attributes.color&&v.attributes.color.itemSize===4,pointsUvs:h.isPoints===!0&&!!v.attributes.uv&&(re||Oe),fog:!!_,useFog:i.fog===!0,fogExp2:!!_&&_.isFogExp2,flatShading:i.wireframe===!1&&(i.flatShading===!0||v.attributes.normal===void 0&&se===!1&&(i.isMeshLambertMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.isMeshPhysicalMaterial)),sizeAttenuation:i.sizeAttenuation===!0,logarithmicDepthBuffer:d,reversedDepthBuffer:te,skinning:h.isSkinnedMesh===!0,morphTargets:v.morphAttributes.position!==void 0,morphNormals:v.morphAttributes.normal!==void 0,morphColors:v.morphAttributes.color!==void 0,morphTargetsCount:T,morphTextureStride:E,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numLightProbeGrids:g.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&l.length>0,shadowMapType:e.shadowMap.type,toneMapping:Me,decodeVideoTexture:re&&i.map.isVideoTexture===!0&&Er.getTransfer(i.map.colorSpace)===`srgb`,decodeVideoTextureEmissive:le&&i.emissiveMap.isVideoTexture===!0&&Er.getTransfer(i.emissiveMap.colorSpace)===`srgb`,premultipliedAlpha:i.premultipliedAlpha,doubleSided:i.side===2,flipSided:i.side===1,useDepthPacking:i.depthPacking>=0,depthPacking:i.depthPacking||0,index0AttributeName:i.index0AttributeName,extensionClipCullDistance:je&&i.extensions.clipCullDistance===!0&&n.has(`WEBGL_clip_cull_distance`),extensionMultiDraw:(je&&i.extensions.multiDraw===!0||ne)&&n.has(`WEBGL_multi_draw`),rendererExtensionParallelShaderCompile:n.has(`KHR_parallel_shader_compile`),customProgramCacheKey:i.customProgramCacheKey()};return Ne.vertexUv1s=c.has(1),Ne.vertexUv2s=c.has(2),Ne.vertexUv3s=c.has(3),c.clear(),Ne}function g(t){let n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),t.defines!==void 0)for(let e in t.defines)n.push(e),n.push(t.defines[e]);return t.isRawShaderMaterial===!1&&(_(n,t),v(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()}function _(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}function v(e,t){o.disableAll(),t.instancing&&o.enable(0),t.instancingColor&&o.enable(1),t.instancingMorph&&o.enable(2),t.matcap&&o.enable(3),t.envMap&&o.enable(4),t.normalMapObjectSpace&&o.enable(5),t.normalMapTangentSpace&&o.enable(6),t.clearcoat&&o.enable(7),t.iridescence&&o.enable(8),t.alphaTest&&o.enable(9),t.vertexColors&&o.enable(10),t.vertexAlphas&&o.enable(11),t.vertexUv1s&&o.enable(12),t.vertexUv2s&&o.enable(13),t.vertexUv3s&&o.enable(14),t.vertexTangents&&o.enable(15),t.anisotropy&&o.enable(16),t.alphaHash&&o.enable(17),t.batching&&o.enable(18),t.dispersion&&o.enable(19),t.batchingColor&&o.enable(20),t.gradientMap&&o.enable(21),t.packedNormalMap&&o.enable(22),t.vertexNormals&&o.enable(23),e.push(o.mask),o.disableAll(),t.fog&&o.enable(0),t.useFog&&o.enable(1),t.flatShading&&o.enable(2),t.logarithmicDepthBuffer&&o.enable(3),t.reversedDepthBuffer&&o.enable(4),t.skinning&&o.enable(5),t.morphTargets&&o.enable(6),t.morphNormals&&o.enable(7),t.morphColors&&o.enable(8),t.premultipliedAlpha&&o.enable(9),t.shadowMapEnabled&&o.enable(10),t.doubleSided&&o.enable(11),t.flipSided&&o.enable(12),t.useDepthPacking&&o.enable(13),t.dithering&&o.enable(14),t.transmission&&o.enable(15),t.sheen&&o.enable(16),t.opaque&&o.enable(17),t.pointsUvs&&o.enable(18),t.decodeVideoTexture&&o.enable(19),t.decodeVideoTextureEmissive&&o.enable(20),t.alphaToCoverage&&o.enable(21),t.numLightProbeGrids>0&&o.enable(22),e.push(o.mask)}function y(e){let t=p[e.type],n;if(t){let e=Fp[t];n=Ql.clone(e.uniforms)}else n=e.uniforms;return n}function b(t,n){let r=u.get(n);return r===void 0?(r=new cg(e,n,t,i),l.push(r),u.set(n,r)):++r.usedTimes,r}function x(e){if(--e.usedTimes===0){let t=l.indexOf(e);l[t]=l[l.length-1],l.pop(),u.delete(e.cacheKey),e.destroy()}}function S(e){s.remove(e)}function C(){s.dispose()}return{getParameters:h,getProgramCacheKey:g,getUniforms:y,acquireProgram:b,releaseProgram:x,releaseShaderCache:S,programs:l,dispose:C}}function mg(){let e=new WeakMap;function t(t){return e.has(t)}function n(t){let n=e.get(t);return n===void 0&&(n={},e.set(t,n)),n}function r(t){e.delete(t)}function i(t,n,r){e.get(t)[n]=r}function a(){e=new WeakMap}return{has:t,get:n,remove:r,update:i,dispose:a}}function hg(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.material.id===t.material.id?e.materialVariant===t.materialVariant?e.z===t.z?e.id-t.id:e.z-t.z:e.materialVariant-t.materialVariant:e.material.id-t.material.id:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function gg(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.z===t.z?e.id-t.id:t.z-e.z:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function _g(){let e=[],t=0,n=[],r=[],i=[];function a(){t=0,n.length=0,r.length=0,i.length=0}function o(e){let t=0;return e.isInstancedMesh&&(t+=2),e.isSkinnedMesh&&(t+=1),t}function s(n,r,i,a,s,c){let l=e[t];return l===void 0?(l={id:n.id,object:n,geometry:r,material:i,materialVariant:o(n),groupOrder:a,renderOrder:n.renderOrder,z:s,group:c},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.materialVariant=o(n),l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=s,l.group=c),t++,l}function c(e,t,a,o,c,l){let u=s(e,t,a,o,c,l);a.transmission>0?r.push(u):a.transparent===!0?i.push(u):n.push(u)}function l(e,t,a,o,c,l){let u=s(e,t,a,o,c,l);a.transmission>0?r.unshift(u):a.transparent===!0?i.unshift(u):n.unshift(u)}function u(e,t){n.length>1&&n.sort(e||hg),r.length>1&&r.sort(t||gg),i.length>1&&i.sort(t||gg)}function d(){for(let n=t,r=e.length;n=r.length?(i=new _g,r.push(i)):i=r[n],i}function n(){e=new WeakMap}return{get:t,dispose:n}}function yg(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={direction:new U,color:new G};break;case`SpotLight`:n={position:new U,direction:new U,color:new G,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case`PointLight`:n={position:new U,color:new G,distance:0,decay:0};break;case`HemisphereLight`:n={direction:new U,skyColor:new G,groundColor:new G};break;case`RectAreaLight`:n={color:new G,position:new U,halfWidth:new U,halfHeight:new U};break}return e[t.id]=n,n}}}function bg(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new H};break;case`SpotLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new H};break;case`PointLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new H,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=n,n}}}var xg=0;function Sg(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+ +!!t.map-!!e.map}function Cg(e){let t=new yg,n=bg(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)r.probe.push(new U);let i=new U,a=new W,o=new W;function s(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0;i.sort(Sg);for(let e=0,y=i.length;e0&&(e.has(`OES_texture_float_linear`)===!0?(r.rectAreaLTC1=Z.LTC_FLOAT_1,r.rectAreaLTC2=Z.LTC_FLOAT_2):(r.rectAreaLTC1=Z.LTC_HALF_1,r.rectAreaLTC2=Z.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;let y=r.hash;(y.directionalLength!==c||y.pointLength!==l||y.spotLength!==u||y.rectAreaLength!==d||y.hemiLength!==f||y.numDirectionalShadows!==p||y.numPointShadows!==m||y.numSpotShadows!==h||y.numSpotMaps!==g||y.numLightProbes!==v)&&(r.directional.length=c,r.spot.length=u,r.rectArea.length=d,r.point.length=l,r.hemi.length=f,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=h,r.spotShadowMap.length=h,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=m,r.spotLightMatrix.length=h+g-_,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=v,y.directionalLength=c,y.pointLength=l,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=f,y.numDirectionalShadows=p,y.numPointShadows=m,y.numSpotShadows=h,y.numSpotMaps=g,y.numLightProbes=v,r.version=xg++)}function c(e,t){let n=0,s=0,c=0,l=0,u=0,d=t.matrixWorldInverse;for(let t=0,f=e.length;t=i.length?(a=new wg(e),i.push(a)):a=i[r],a}function r(){t=new WeakMap}return{get:n,dispose:r}}var Eg=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,Dg=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg; + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r; + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) ); + gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 ); +}`,Og=[new U(1,0,0),new U(-1,0,0),new U(0,1,0),new U(0,-1,0),new U(0,0,1),new U(0,0,-1)],kg=[new U(0,-1,0),new U(0,-1,0),new U(0,0,1),new U(0,0,-1),new U(0,-1,0),new U(0,-1,0)],Ag=new W,jg=new U,Mg=new U;function Ng(e,t,n){let r=new ts,i=new H,a=new H,o=new Lr,s=new lu,c=new uu,l={},u=n.maxTextureSize,d={0:1,1:0,2:2},f=new tu({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new H},radius:{value:4}},vertexShader:Eg,fragmentShader:Dg}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let m=new q;m.setAttribute(`position`,new da(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let h=new xo(m,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let _=this.type;this.render=function(t,n,s){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||t.length===0)return;this.type===2&&(z(`WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead.`),this.type=1);let c=e.getRenderTarget(),l=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.state;f.setBlending(0),f.buffers.depth.getReversed()===!0?f.buffers.color.setClear(0,0,0,0):f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);let p=_!==this.type;p&&n.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let c=0,l=t.length;cu||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/m.x),i.x=a.x*m.x,d.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/m.y),i.y=a.y*m.y,d.mapSize.y=a.y));let h=e.state.buffers.depth.getReversed();if(d.camera._reversedDepth=h,d.map===null||p===!0){if(d.map!==null&&(d.map.depthTexture!==null&&(d.map.depthTexture.dispose(),d.map.depthTexture=null),d.map.dispose()),this.type===3){if(l.isPointLight){z(`WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.`);continue}d.map=new zr(i.x,i.y,{format:et,type:Ve,minFilter:Ae,magFilter:Ae,generateMipmaps:!1}),d.map.texture.name=l.name+`.shadowMap`,d.map.depthTexture=new ec(i.x,i.y,Be),d.map.depthTexture.name=l.name+`.shadowMapDepth`,d.map.depthTexture.format=Xe,d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=Te,d.map.depthTexture.magFilter=Te}else l.isPointLight?(d.map=new um(i.x),d.map.depthTexture=new tc(i.x,ze)):(d.map=new zr(i.x,i.y),d.map.depthTexture=new ec(i.x,i.y,ze)),d.map.depthTexture.name=l.name+`.shadowMap`,d.map.depthTexture.format=Xe,this.type===1?(d.map.depthTexture.compareFunction=h?518:515,d.map.depthTexture.minFilter=Ae,d.map.depthTexture.magFilter=Ae):(d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=Te,d.map.depthTexture.magFilter=Te);d.camera.updateProjectionMatrix()}let g=d.map.isWebGLCubeRenderTarget?6:1;for(let t=0;t0||n.map&&n.alphaTest>0||n.alphaToCoverage===!0){let e=a.uuid,t=n.uuid,r=l[e];r===void 0&&(r={},l[e]=r);let i=r[t];i===void 0&&(i=a.clone(),r[t]=i,n.addEventListener(`dispose`,x)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,i===3?a.side=n.shadowSide===null?n.side:n.shadowSide:a.side=n.shadowSide===null?d[n.side]:n.shadowSide,a.alphaMap=n.alphaMap,a.alphaTest=n.alphaToCoverage===!0?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,r.isPointLight===!0&&a.isMeshDistanceMaterial===!0){let t=e.properties.get(a);t.light=r}return a}function b(n,i,a,o,s){if(n.visible===!1)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===3)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);let r=t.update(n),c=n.material;if(Array.isArray(c)){let t=r.groups;for(let l=0,u=t.length;l=2):(ne=parseFloat(/^WebGL (\d)/.exec(re)[1]),j=ne>=1);let M=null,N={},ie=e.getParameter(e.SCISSOR_BOX),ae=e.getParameter(e.VIEWPORT),oe=new Lr().fromArray(ie),se=new Lr().fromArray(ae);function ce(t,n,r,i){let a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o`u`?!1:/OculusBrowser/g.test(navigator.userAgent),l=new H,u=new WeakMap,d=new Set,f,p=new WeakMap,m=!1;try{m=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)!==null}catch{}function h(e,t){return m?new OffscreenCanvas(e,t):Pn(`canvas`)}function g(e,t,n){let r=1,i=ke(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1)if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||typeof VideoFrame<`u`&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);f===void 0&&(f=h(n,a));let o=t?h(n,a):f;return o.width=n,o.height=a,o.getContext(`2d`).drawImage(e,0,0,n,a),z(`WebGLRenderer: Texture has been resized from (`+i.width+`x`+i.height+`) to (`+n+`x`+a+`).`),o}else return`data`in e&&z(`WebGLRenderer: Image in DataTexture is too big (`+i.width+`x`+i.height+`).`),e;return e}function _(e){return e.generateMipmaps}function v(t){e.generateMipmap(t)}function y(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function b(n,r,i,a,o,s=!1){if(n!==null){if(e[n]!==void 0)return e[n];z(`WebGLRenderer: Attempt to use non-existing WebGL internal format '`+n+`'`)}let c;a&&(c=t.get(`EXT_texture_norm16`),c||z(`WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension`));let l=r;if(r===e.RED&&(i===e.FLOAT&&(l=e.R32F),i===e.HALF_FLOAT&&(l=e.R16F),i===e.UNSIGNED_BYTE&&(l=e.R8),i===e.UNSIGNED_SHORT&&c&&(l=c.R16_EXT),i===e.SHORT&&c&&(l=c.R16_SNORM_EXT)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.R8UI),i===e.UNSIGNED_SHORT&&(l=e.R16UI),i===e.UNSIGNED_INT&&(l=e.R32UI),i===e.BYTE&&(l=e.R8I),i===e.SHORT&&(l=e.R16I),i===e.INT&&(l=e.R32I)),r===e.RG&&(i===e.FLOAT&&(l=e.RG32F),i===e.HALF_FLOAT&&(l=e.RG16F),i===e.UNSIGNED_BYTE&&(l=e.RG8),i===e.UNSIGNED_SHORT&&c&&(l=c.RG16_EXT),i===e.SHORT&&c&&(l=c.RG16_SNORM_EXT)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RG8UI),i===e.UNSIGNED_SHORT&&(l=e.RG16UI),i===e.UNSIGNED_INT&&(l=e.RG32UI),i===e.BYTE&&(l=e.RG8I),i===e.SHORT&&(l=e.RG16I),i===e.INT&&(l=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RGB8UI),i===e.UNSIGNED_SHORT&&(l=e.RGB16UI),i===e.UNSIGNED_INT&&(l=e.RGB32UI),i===e.BYTE&&(l=e.RGB8I),i===e.SHORT&&(l=e.RGB16I),i===e.INT&&(l=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(l=e.RGBA16UI),i===e.UNSIGNED_INT&&(l=e.RGBA32UI),i===e.BYTE&&(l=e.RGBA8I),i===e.SHORT&&(l=e.RGBA16I),i===e.INT&&(l=e.RGBA32I)),r===e.RGB&&(i===e.UNSIGNED_SHORT&&c&&(l=c.RGB16_EXT),i===e.SHORT&&c&&(l=c.RGB16_SNORM_EXT),i===e.UNSIGNED_INT_5_9_9_9_REV&&(l=e.RGB9_E5),i===e.UNSIGNED_INT_10F_11F_11F_REV&&(l=e.R11F_G11F_B10F)),r===e.RGBA){let t=s?an:Er.getTransfer(o);i===e.FLOAT&&(l=e.RGBA32F),i===e.HALF_FLOAT&&(l=e.RGBA16F),i===e.UNSIGNED_BYTE&&(l=t===`srgb`?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT&&c&&(l=c.RGBA16_EXT),i===e.SHORT&&c&&(l=c.RGBA16_SNORM_EXT),i===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)}return(l===e.R16F||l===e.R32F||l===e.RG16F||l===e.RG32F||l===e.RGBA16F||l===e.RGBA32F)&&t.get(`EXT_color_buffer_float`),l}function x(t,n){let r;return t?n===null||n===1014||n===1020?r=e.DEPTH24_STENCIL8:n===1015?r=e.DEPTH32F_STENCIL8:n===1012&&(r=e.DEPTH24_STENCIL8,z(`DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.`)):n===null||n===1014||n===1020?r=e.DEPTH_COMPONENT24:n===1015?r=e.DEPTH_COMPONENT32F:n===1012&&(r=e.DEPTH_COMPONENT16),r}function S(e,t){return _(e)===!0||e.isFramebufferTexture&&e.minFilter!==1003&&e.minFilter!==1006?Math.log2(Math.max(t.width,t.height))+1:e.mipmaps!==void 0&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function C(e){let t=e.target;t.removeEventListener(`dispose`,C),T(t),t.isVideoTexture&&u.delete(t),t.isHTMLTexture&&d.delete(t)}function w(e){let t=e.target;t.removeEventListener(`dispose`,w),D(t)}function T(e){let t=r.get(e);if(t.__webglInit===void 0)return;let n=e.source,i=p.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,r.usedTimes===0&&E(e),Object.keys(i).length===0&&p.delete(n)}r.remove(e)}function E(t){let n=r.get(t);e.deleteTexture(n.__webglTexture);let i=t.source,a=p.get(i);delete a[n.__cacheKey],o.memory.textures--}function D(t){let n=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r=i.maxTextures&&z(`WebGLTextures: Trying to use `+e+` texture units while this GPU supports only `+i.maxTextures),O+=1,e}function j(e){let t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}function ne(t,i){let a=r.get(t);if(t.isVideoTexture&&I(t),t.isRenderTargetTexture===!1&&t.isExternalTexture!==!0&&t.version>0&&a.__version!==t.version){let e=t.image;if(e===null)z(`WebGLRenderer: Texture marked for update but no image data found.`);else if(e.complete===!1)z(`WebGLRenderer: Texture marked for update but image is incomplete`);else{de(a,t,i);return}}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}function re(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){de(a,t,i);return}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)}function M(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){de(a,t,i);return}n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)}function N(t,i){let a=r.get(t);if(t.isCubeDepthTexture!==!0&&t.version>0&&a.__version!==t.version){fe(a,t,i);return}n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture,e.TEXTURE0+i)}let ie={[Ce]:e.REPEAT,[L]:e.CLAMP_TO_EDGE,[we]:e.MIRRORED_REPEAT},ae={[Te]:e.NEAREST,[Ee]:e.NEAREST_MIPMAP_NEAREST,[Oe]:e.NEAREST_MIPMAP_LINEAR,[Ae]:e.LINEAR,[je]:e.LINEAR_MIPMAP_NEAREST,[Ne]:e.LINEAR_MIPMAP_LINEAR},oe={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function se(n,a){if(a.type===1015&&t.has(`OES_texture_float_linear`)===!1&&(a.magFilter===1006||a.magFilter===1007||a.magFilter===1005||a.magFilter===1008||a.minFilter===1006||a.minFilter===1007||a.minFilter===1005||a.minFilter===1008)&&z(`WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.`),e.texParameteri(n,e.TEXTURE_WRAP_S,ie[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,ie[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,ie[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,ae[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,ae[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,oe[a.compareFunction])),t.has(`EXT_texture_filter_anisotropic`)===!0){if(a.magFilter===1003||a.minFilter!==1005&&a.minFilter!==1008||a.type===1015&&t.has(`OES_texture_float_linear`)===!1)return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){let o=t.get(`EXT_texture_filter_anisotropic`);e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function ce(t,n){let r=!1;t.__webglInit===void 0&&(t.__webglInit=!0,n.addEventListener(`dispose`,C));let i=n.source,a=p.get(i);a===void 0&&(a={},p.set(i,a));let s=j(n);if(s!==t.__cacheKey){a[s]===void 0&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;let i=a[t.__cacheKey];i!==void 0&&(a[t.__cacheKey].usedTimes--,i.usedTimes===0&&E(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function le(e,t,n){return Math.floor(Math.floor(e/n)/t)}function ue(t,r,i,a){let o=t.updateRanges;if(o.length===0)n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,i,a,r.data);else{o.sort((e,t)=>e.start-t.start);let s=0;for(let e=1;e0){C&&w&&n.texStorage2D(e.TEXTURE_2D,E,m,y[0].width,y[0].height);for(let t=0,i=y.length;t0){let t=Op(h.width,h.height,o.format,o.type);for(let a of o.layerUpdates){let o=h.data.subarray(a*t/h.data.BYTES_PER_ELEMENT,(a+1)*t/h.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,a,h.width,h.height,1,r,o)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,h.width,h.height,t.depth,r,h.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,i,m,h.width,h.height,t.depth,0,h.data,0,0);else z(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`);else C?T&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,h.width,h.height,t.depth,r,p,h.data):n.texImage3D(e.TEXTURE_2D_ARRAY,i,m,h.width,h.height,t.depth,0,r,p,h.data)}else{C&&w&&n.texStorage2D(e.TEXTURE_2D,E,m,y[0].width,y[0].height);for(let t=0,i=y.length;t0){let i=Op(t.width,t.height,o.format,o.type);for(let a of o.layerUpdates){let o=t.data.subarray(a*i/t.data.BYTES_PER_ELEMENT,(a+1)*i/t.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,a,t.width,t.height,1,r,p,o)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,t.width,t.height,t.depth,r,p,t.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,m,t.width,t.height,t.depth,0,r,p,t.data);else if(o.isData3DTexture)C?(w&&n.texStorage3D(e.TEXTURE_3D,E,m,t.width,t.height,t.depth),T&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,t.width,t.height,t.depth,r,p,t.data)):n.texImage3D(e.TEXTURE_3D,0,m,t.width,t.height,t.depth,0,r,p,t.data);else if(o.isFramebufferTexture){if(w)if(C)n.texStorage2D(e.TEXTURE_2D,E,m,t.width,t.height);else{let i=t.width,a=t.height;for(let t=0;t>=1,a>>=1}}else if(o.isHTMLTexture){if(`texElementImage2D`in e){let n=e.canvas;if(n.hasAttribute(`layoutsubtree`)||n.setAttribute(`layoutsubtree`,`true`),t.parentNode!==n){n.appendChild(t),d.add(o),n.onpaint=e=>{let t=e.changedElements;for(let e of d)t.includes(e.image)&&(e.needsUpdate=!0)},n.requestPaint();return}let r=e.RGBA,i=e.RGBA,a=e.UNSIGNED_BYTE;e.texElementImage2D(e.TEXTURE_2D,0,r,i,a,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}}else if(y.length>0){if(C&&w){let t=ke(y[0]);n.texStorage2D(e.TEXTURE_2D,E,m,t.width,t.height)}for(let t=0,i=y.length;t0&&D++;let t=ke(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,D,C,t.width,t.height)}for(let t=0;t<6;t++)if(p){w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m[t].width,m[t].height,y,x,m[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,C,m[t].width,m[t].height,0,y,x,m[t].data);for(let r=0;r>u),r=Math.max(1,i.height>>u);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,u,p,t,r,i.depth,0,d,f,null):n.texImage2D(l,u,p,t,r,0,d,f,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),F(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,c,l,h.__webglTexture,0,Se(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,c,l,h.__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function me(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=x(n.stencilBuffer,a),c=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;F(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,Se(n),o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,Se(n),o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,c,e.RENDERBUFFER,t)}else{let t=n.textures;for(let i=0;i{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener(`dispose`,t)};e.addEventListener(`dispose`,t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer)if(a)for(let e=0;e<6;e++)he(i.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?he(i.__webglFramebuffer[0],t,0):he(i.__webglFramebuffer,t,0)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]===void 0)i.__webglDepthbuffer[r]=e.createRenderbuffer(),me(i.__webglDepthbuffer[r],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let r=t.texture.mipmaps;if(r&&r.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer===void 0)i.__webglDepthbuffer=e.createRenderbuffer(),me(i.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}function _e(t,n,i){let a=r.get(t);n!==void 0&&pe(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),i!==void 0&&ge(t)}function ve(t){let i=t.texture,s=r.get(t),c=r.get(i);t.addEventListener(`dispose`,w);let l=t.textures,u=t.isWebGLCubeRenderTarget===!0,d=l.length>1;if(d||(c.__webglTexture===void 0&&(c.__webglTexture=e.createTexture()),c.__version=i.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n0){s.__webglFramebuffer=[];for(let t=0;t0&&F(t)===!1){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n0)for(let r=0;r0)for(let n=0;n0){if(F(t)===!1){let i=t.textures,a=t.width,o=t.height,s=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),d=i.length>1;if(d)for(let t=0;t0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n0&&t.has(`WEBGL_multisampled_render_to_texture`)===!0&&n.__useRenderToTexture!==!1}function I(e){let t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}function De(e,t){let n=e.colorSpace,r=e.format,i=e.type;return e.isCompressedTexture===!0||e.isVideoTexture===!0||n!==`srgb-linear`&&n!==``&&(Er.getTransfer(n)===`srgb`?(r!==1023||i!==1009)&&z(`WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.`):B(`WebGLTextures: Unsupported texture color space:`,n)),t}function ke(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement?(l.width=e.naturalWidth||e.width,l.height=e.naturalHeight||e.height):typeof VideoFrame<`u`&&e instanceof VideoFrame?(l.width=e.displayWidth,l.height=e.displayHeight):(l.width=e.width,l.height=e.height),l}this.allocateTextureUnit=te,this.resetTextureUnits=k,this.getTextureUnits=A,this.setTextureUnits=ee,this.setTexture2D=ne,this.setTexture2DArray=re,this.setTexture3D=M,this.setTextureCube=N,this.rebindTextures=_e,this.setupRenderTarget=ve,this.updateRenderTargetMipmap=ye,this.updateMultisampleRenderTarget=xe,this.setupDepthRenderbuffer=ge,this.setupFrameBufferTexture=pe,this.useMultisampledRTT=F,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function Ig(e,t){function n(n,r=``){let i,a=Er.getTransfer(r);if(n===1009)return e.UNSIGNED_BYTE;if(n===1017)return e.UNSIGNED_SHORT_4_4_4_4;if(n===1018)return e.UNSIGNED_SHORT_5_5_5_1;if(n===35902)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===35899)return e.UNSIGNED_INT_10F_11F_11F_REV;if(n===1010)return e.BYTE;if(n===1011)return e.SHORT;if(n===1012)return e.UNSIGNED_SHORT;if(n===1013)return e.INT;if(n===1014)return e.UNSIGNED_INT;if(n===1015)return e.FLOAT;if(n===1016)return e.HALF_FLOAT;if(n===1021)return e.ALPHA;if(n===1022)return e.RGB;if(n===1023)return e.RGBA;if(n===1026)return e.DEPTH_COMPONENT;if(n===1027)return e.DEPTH_STENCIL;if(n===1028)return e.RED;if(n===1029)return e.RED_INTEGER;if(n===1030)return e.RG;if(n===1031)return e.RG_INTEGER;if(n===1033)return e.RGBA_INTEGER;if(n===33776||n===33777||n===33778||n===33779)if(a===`srgb`)if(i=t.get(`WEBGL_compressed_texture_s3tc_srgb`),i!==null){if(n===33776)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(i=t.get(`WEBGL_compressed_texture_s3tc`),i!==null){if(n===33776)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===35840||n===35841||n===35842||n===35843)if(i=t.get(`WEBGL_compressed_texture_pvrtc`),i!==null){if(n===35840)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===35841)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===35842)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===35843)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===36196||n===37492||n===37496||n===37488||n===37489||n===37490||n===37491)if(i=t.get(`WEBGL_compressed_texture_etc`),i!==null){if(n===36196||n===37492)return a===`srgb`?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===37496)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC;if(n===37488)return i.COMPRESSED_R11_EAC;if(n===37489)return i.COMPRESSED_SIGNED_R11_EAC;if(n===37490)return i.COMPRESSED_RG11_EAC;if(n===37491)return i.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===37808||n===37809||n===37810||n===37811||n===37812||n===37813||n===37814||n===37815||n===37816||n===37817||n===37818||n===37819||n===37820||n===37821)if(i=t.get(`WEBGL_compressed_texture_astc`),i!==null){if(n===37808)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===37809)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===37810)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===37811)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===37812)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===37813)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===37814)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===37815)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===37816)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===37817)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===37818)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===37819)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===37820)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===37821)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===36492||n===36494||n===36495)if(i=t.get(`EXT_texture_compression_bptc`),i!==null){if(n===36492)return a===`srgb`?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===36494)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===36495)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===36283||n===36284||n===36285||n===36286)if(i=t.get(`EXT_texture_compression_rgtc`),i!==null){if(n===36283)return i.COMPRESSED_RED_RGTC1_EXT;if(n===36284)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===36285)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===36286)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===1020?e.UNSIGNED_INT_24_8:e[n]===void 0?null:e[n]}return{convert:n}}var Lg=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,Rg=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`,zg=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let n=new nc(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new tu({vertexShader:Lg,fragmentShader:Rg,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new xo(new Fl(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},Bg=class extends Gn{constructor(e,t){super();let n=this,r=null,i=1,a=null,o=`local-floor`,s=1,c=null,l=null,u=null,d=null,f=null,p=null,m=typeof XRWebGLBinding<`u`,h=new zg,g={},_=t.getContextAttributes(),v=null,y=null,b=[],x=[],S=new H,C=null,w=new ld;w.viewport=new Lr;let T=new ld;T.viewport=new Lr;let E=[w,T],D=new Hd,O=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=b[e];return t===void 0&&(t=new yi,b[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=b[e];return t===void 0&&(t=new yi,b[e]=t),t.getGripSpace()},this.getHand=function(e){let t=b[e];return t===void 0&&(t=new yi,b[e]=t),t.getHandSpace()};function A(e){let t=x.indexOf(e.inputSource);if(t===-1)return;let n=b[t];n!==void 0&&(n.update(e.inputSource,e.frame,c||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function ee(){r.removeEventListener(`select`,A),r.removeEventListener(`selectstart`,A),r.removeEventListener(`selectend`,A),r.removeEventListener(`squeeze`,A),r.removeEventListener(`squeezestart`,A),r.removeEventListener(`squeezeend`,A),r.removeEventListener(`end`,ee),r.removeEventListener(`inputsourceschange`,te);for(let e=0;e=0&&(x[r]=null,b[r].disconnect(n))}for(let t=0;t=x.length){x.push(n),r=e;break}else if(x[e]===null){x[e]=n,r=e;break}if(r===-1)break}let i=b[r];i&&i.connect(n)}}let j=new U,ne=new U;function re(e,t,n){j.setFromMatrixPosition(t.matrixWorld),ne.setFromMatrixPosition(n.matrixWorld);let r=j.distanceTo(ne),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(a[8]+1)/a[0],f=o*u,p=o*d,m=r/(-u+d),h=m*-u;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(h),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),i[10]===-1)e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{let t=o+m,n=s+m,i=f-h,a=p+(r-h),u=c*s/n*t,d=l*s/n*t;e.projectionMatrix.makePerspective(i,a,u,d,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}function M(e,t){t===null?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(r===null)return;let t=e.near,n=e.far;h.texture!==null&&(h.depthNear>0&&(t=h.depthNear),h.depthFar>0&&(n=h.depthFar)),D.near=T.near=w.near=t,D.far=T.far=w.far=n,(O!==D.near||k!==D.far)&&(r.updateRenderState({depthNear:D.near,depthFar:D.far}),O=D.near,k=D.far),D.layers.mask=e.layers.mask|6,w.layers.mask=D.layers.mask&-5,T.layers.mask=D.layers.mask&-3;let i=e.parent,a=D.cameras;M(D,i);for(let e=0;e0&&(e.alphaTest.value=r.alphaTest);let i=t.get(r),a=i.envMap,o=i.envMapRotation;a&&(e.envMap.value=a,e.envMapRotation.value.setFromMatrix4(Vg.makeRotationFromEuler(o)).transpose(),a.isCubeTexture&&a.isRenderTargetTexture===!1&&e.envMapRotation.value.premultiply(Hg),e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}function o(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}function s(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function c(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=i*.5,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function l(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function u(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}function d(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function f(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function p(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===1&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}function m(e,t){t.matcap&&(e.matcap.value=t.matcap)}function h(e,n){let r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function Wg(e,t,n,r){let i={},a={},o=[],s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function c(e,t){let n=t.program;r.uniformBlockBinding(e,n)}function l(e,n){let o=i[e.id];o===void 0&&(m(e),o=u(e),i[e.id]=o,e.addEventListener(`dispose`,g));let s=n.program;r.updateUBOMapping(e,s);let c=t.render.frame;a[e.id]!==c&&(f(e),a[e.id]=c)}function u(t){let n=d();t.__bindingPointIndex=n;let r=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}function d(){for(let e=0;e0&&(n+=16-r),e.__size=n,e.__cache={},this}function h(e){let t={boundary:0,storage:0};return typeof e==`number`||typeof e==`boolean`?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?z(`WebGLRenderer: Texture samplers can not be part of an uniforms group.`):ArrayBuffer.isView(e)?(t.boundary=16,t.storage=e.byteLength):z(`WebGLRenderer: Unsupported uniform value type.`,e),t}function g(t){let n=t.target;n.removeEventListener(`dispose`,g);let r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}function _(){for(let t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}return{bind:c,update:l,dispose:_}}var Gg=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),Kg=null;function qg(){return Kg===null&&(Kg=new Fo(Gg,16,16,et,Ve),Kg.name=`DFG_LUT`,Kg.minFilter=Ae,Kg.magFilter=Ae,Kg.wrapS=L,Kg.wrapT=L,Kg.generateMipmaps=!1,Kg.needsUpdate=!0),Kg}var Jg=class{constructor(e={}){let{canvas:t=Fn(),context:n=null,depth:r=!0,stencil:i=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:c=!1,powerPreference:l=`default`,failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1,outputBufferType:f=Fe}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<`u`&&n instanceof WebGLRenderingContext)throw Error(`THREE.WebGLRenderer: WebGL 1 is not supported since r163.`);p=n.getContextAttributes().alpha}else p=a;let m=f,h=new Set([rt,tt,$e]),g=new Set([Fe,ze,Le,We,He,Ue]),_=new Uint32Array(4),v=new Int32Array(4),y=new U,b=null,x=null,S=[],C=[],w=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let T=this,E=!1,D=null;this._outputColorSpace=nn;let O=0,k=0,A=null,ee=-1,te=null,j=new Lr,ne=new Lr,re=null,M=new G(0),N=0,ie=t.width,ae=t.height,oe=1,se=null,ce=null,le=new Lr(0,0,ie,ae),ue=new Lr(0,0,ie,ae),de=!1,fe=new ts,pe=!1,me=!1,he=new W,ge=new U,_e=new Lr,ve={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},ye=!1;function be(){return A===null?oe:1}let P=n;function xe(e,n){return t.getContext(e,n)}try{let e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(`setAttribute`in t&&t.setAttribute(`data-engine`,`three.js r184`),t.addEventListener(`webglcontextlost`,Ze,!1),t.addEventListener(`webglcontextrestored`,Qe,!1),t.addEventListener(`webglcontextcreationerror`,et,!1),P===null){let t=`webgl2`;if(P=xe(t,e),P===null)throw xe(t)?Error(`Error creating WebGL context with your selected attributes.`):Error(`Error creating WebGL context.`)}}catch(e){throw B(`WebGLRenderer: `+e.message),e}let Se,F,I,Ce,L,we,Te,Ee,De,Oe,ke,Ae,je,Me,Pe,Ie,R,Re,Be,Ge,Ke,qe,Je;function Ye(){Se=new fm(P),Se.init(),Ke=new Ig(P,Se),F=new Hp(P,Se,e,Ke),I=new Pg(P,Se),F.reversedDepthBuffer&&d&&I.buffers.depth.setReversed(!0),Ce=new hm(P),L=new mg,we=new Fg(P,Se,I,L,F,Ke,Ce),Te=new dm(T),Ee=new Np(P),qe=new Bp(P,Ee),De=new pm(P,Ee,Ce,qe),Oe=new _m(P,De,Ee,qe,Ce),Re=new gm(P,F,we),Pe=new Up(L),ke=new pg(T,Te,Se,F,qe,Pe),Ae=new Ug(T,L),je=new vg,Me=new Tg(Se),R=new zp(T,Te,I,Oe,p,s),Ie=new Ng(T,Oe,F),Je=new Wg(P,Ce,F,I),Be=new Vp(P,Se,Ce),Ge=new mm(P,Se,Ce),Ce.programs=ke.programs,T.capabilities=F,T.extensions=Se,T.properties=L,T.renderLists=je,T.shadowMap=Ie,T.state=I,T.info=Ce}Ye(),m!==1009&&(w=new ym(m,t.width,t.height,r,i));let Xe=new Bg(T,P);this.xr=Xe,this.getContext=function(){return P},this.getContextAttributes=function(){return P.getContextAttributes()},this.forceContextLoss=function(){let e=Se.get(`WEBGL_lose_context`);e&&e.loseContext()},this.forceContextRestore=function(){let e=Se.get(`WEBGL_lose_context`);e&&e.restoreContext()},this.getPixelRatio=function(){return oe},this.setPixelRatio=function(e){e!==void 0&&(oe=e,this.setSize(ie,ae,!1))},this.getSize=function(e){return e.set(ie,ae)},this.setSize=function(e,n,r=!0){if(Xe.isPresenting){z(`WebGLRenderer: Can't change size while VR device is presenting.`);return}ie=e,ae=n,t.width=Math.floor(e*oe),t.height=Math.floor(n*oe),r===!0&&(t.style.width=e+`px`,t.style.height=n+`px`),w!==null&&w.setSize(t.width,t.height),this.setViewport(0,0,e,n)},this.getDrawingBufferSize=function(e){return e.set(ie*oe,ae*oe).floor()},this.setDrawingBufferSize=function(e,n,r){ie=e,ae=n,oe=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.setEffects=function(e){if(m===1009){B(`THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.`);return}if(e){for(let t=0;t{function n(){if(r.forEach(function(e){L.get(e).currentProgram.isReady()&&r.delete(e)}),r.size===0){t(e);return}setTimeout(n,10)}Se.get(`KHR_parallel_shader_compile`)===null?setTimeout(n,10):n()})};let st=null;function ct(e){st&&st(e)}function lt(){dt.stop()}function ut(){dt.start()}let dt=new Mp;dt.setAnimationLoop(ct),typeof self<`u`&&dt.setContext(self),this.setAnimationLoop=function(e){st=e,Xe.setAnimationLoop(e),e===null?dt.stop():dt.start()},Xe.addEventListener(`sessionstart`,lt),Xe.addEventListener(`sessionend`,ut),this.render=function(e,t){if(t!==void 0&&t.isCamera!==!0){B(`WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(E===!0)return;D!==null&&D.renderStart(e,t);let n=Xe.enabled===!0&&Xe.isPresenting===!0,r=w!==null&&(A===null||n)&&w.begin(T,A);if(e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),Xe.enabled===!0&&Xe.isPresenting===!0&&(w===null||w.isCompositing()===!1)&&(Xe.cameraAutoUpdate===!0&&Xe.updateCamera(t),t=Xe.getCamera()),e.isScene===!0&&e.onBeforeRender(T,e,t,A),x=Me.get(e,C.length),x.init(t),x.state.textureUnits=we.getTextureUnits(),C.push(x),he.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),fe.setFromProjectionMatrix(he,wn,t.reversedDepth),me=this.localClippingEnabled,pe=Pe.init(this.clippingPlanes,me),b=je.get(e,S.length),b.init(),S.push(b),Xe.enabled===!0&&Xe.isPresenting===!0){let e=T.xr.getDepthSensingMesh();e!==null&&ft(e,t,-1/0,T.sortObjects)}ft(e,t,0,T.sortObjects),b.finish(),T.sortObjects===!0&&b.sort(se,ce),ye=Xe.enabled===!1||Xe.isPresenting===!1||Xe.hasDepthSensing()===!1,ye&&R.addToRenderList(b,e),this.info.render.frame++,pe===!0&&Pe.beginShadows();let i=x.state.shadowsArray;if(Ie.render(i,e,t),pe===!0&&Pe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(r&&w.hasRenderPass())===!1){let n=b.opaque,r=b.transmissive;if(x.setupLights(),t.isArrayCamera){let i=t.cameras;if(r.length>0)for(let t=0,a=i.length;t0&&mt(n,r,e,t),ye&&R.render(e),pt(b,e,t)}A!==null&&k===0&&(we.updateMultisampleRenderTarget(A),we.updateRenderTargetMipmap(A)),r&&w.end(T),e.isScene===!0&&e.onAfterRender(T,e,t),qe.resetDefaultState(),ee=-1,te=null,C.pop(),C.length>0?(x=C[C.length-1],we.setTextureUnits(x.state.textureUnits),pe===!0&&Pe.setGlobalState(T.clippingPlanes,x.state.camera)):x=null,S.pop(),b=S.length>0?S[S.length-1]:null,D!==null&&D.renderEnd()};function ft(e,t,n,r){if(e.visible===!1)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLightProbeGrid)x.pushLightProbeGrid(e);else if(e.isLight)x.pushLight(e),e.castShadow&&x.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||fe.intersectsSprite(e)){r&&_e.setFromMatrixPosition(e.matrixWorld).applyMatrix4(he);let t=Oe.update(e),i=e.material;i.visible&&b.push(e,t,i,n,_e.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||fe.intersectsObject(e))){let t=Oe.update(e),i=e.material;if(r&&(e.boundingSphere===void 0?(t.boundingSphere===null&&t.computeBoundingSphere(),_e.copy(t.boundingSphere.center)):(e.boundingSphere===null&&e.computeBoundingSphere(),_e.copy(e.boundingSphere.center)),_e.applyMatrix4(e.matrixWorld).applyMatrix4(he)),Array.isArray(i)){let r=t.groups;for(let a=0,o=r.length;a0&&ht(i,t,n),a.length>0&&ht(a,t,n),o.length>0&&ht(o,t,n),I.buffers.depth.setTest(!0),I.buffers.depth.setMask(!0),I.buffers.color.setMask(!0),I.setPolygonOffset(!1)}function mt(e,t,n,r){if((n.isScene===!0?n.overrideMaterial:null)!==null)return;if(x.state.transmissionRenderTarget[r.id]===void 0){let e=Se.has(`EXT_color_buffer_half_float`)||Se.has(`EXT_color_buffer_float`);x.state.transmissionRenderTarget[r.id]=new zr(1,1,{generateMipmaps:!0,type:e?Ve:Fe,minFilter:Ne,samples:Math.max(4,F.samples),stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Er.workingColorSpace})}let a=x.state.transmissionRenderTarget[r.id],o=r.viewport||j;a.setSize(o.z*T.transmissionResolutionScale,o.w*T.transmissionResolutionScale);let s=T.getRenderTarget(),c=T.getActiveCubeFace(),l=T.getActiveMipmapLevel();T.setRenderTarget(a),T.getClearColor(M),N=T.getClearAlpha(),N<1&&T.setClearColor(16777215,.5),T.clear(),ye&&R.render(n);let u=T.toneMapping;T.toneMapping=0;let d=r.viewport;if(r.viewport!==void 0&&(r.viewport=void 0),x.setupLightsView(r),pe===!0&&Pe.setGlobalState(T.clippingPlanes,r),ht(e,n,r),we.updateMultisampleRenderTarget(a),we.updateRenderTargetMipmap(a),Se.has(`WEBGL_multisampled_render_to_texture`)===!1){let e=!1;for(let i=0,a=t.length;i0,r.currentProgram=d,r.uniformsList=null,d}function vt(e){if(e.uniformsList===null){let t=e.currentProgram.getUniforms();e.uniformsList=Eh.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function yt(e,t){let n=L.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}function bt(e,t){if(e.length===0)return null;if(e.length===1)return e[0].texture===null?null:e[0];y.setFromMatrixPosition(t.matrixWorld);for(let t=0,n=e.length;t0),f=!!n.morphAttributes.position,p=!!n.morphAttributes.normal,m=!!n.morphAttributes.color,h=0;r.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(h=T.toneMapping);let g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,_=g===void 0?0:g.length,v=L.get(r),y=x.state.lights;if(pe===!0&&(me===!0||e!==te)){let t=e===te&&r.id===ee;Pe.setState(r,e,t)}let b=!1;r.version===v.__version?v.needsLights&&v.lightsStateVersion!==y.state.version?b=!0:v.outputColorSpace===s?i.isBatchedMesh&&v.batching===!1||!i.isBatchedMesh&&v.batching===!0||i.isBatchedMesh&&v.batchingColor===!0&&i.colorTexture===null||i.isBatchedMesh&&v.batchingColor===!1&&i.colorTexture!==null||i.isInstancedMesh&&v.instancing===!1||!i.isInstancedMesh&&v.instancing===!0||i.isSkinnedMesh&&v.skinning===!1||!i.isSkinnedMesh&&v.skinning===!0||i.isInstancedMesh&&v.instancingColor===!0&&i.instanceColor===null||i.isInstancedMesh&&v.instancingColor===!1&&i.instanceColor!==null||i.isInstancedMesh&&v.instancingMorph===!0&&i.morphTexture===null||i.isInstancedMesh&&v.instancingMorph===!1&&i.morphTexture!==null?b=!0:v.envMap===l?r.fog===!0&&v.fog!==a||v.numClippingPlanes!==void 0&&(v.numClippingPlanes!==Pe.numPlanes||v.numIntersection!==Pe.numIntersection)?b=!0:v.vertexAlphas===u&&v.vertexTangents===d&&v.morphTargets===f&&v.morphNormals===p&&v.morphColors===m&&v.toneMapping===h&&v.morphTargetsCount===_?!!v.lightProbeGrid!=x.state.lightProbeGridArray.length>0&&(b=!0):b=!0:b=!0:b=!0:(b=!0,v.__version=r.version);let S=v.currentProgram;b===!0&&(S=_t(r,t,i),D&&r.isNodeMaterial&&D.onUpdateProgram(r,S,v));let C=!1,w=!1,E=!1,O=S.getUniforms(),k=v.uniforms;if(I.useProgram(S.program)&&(C=!0,w=!0,E=!0),r.id!==ee&&(ee=r.id,w=!0),v.needsLights){let e=bt(x.state.lightProbeGridArray,i);v.lightProbeGrid!==e&&(v.lightProbeGrid=e,w=!0)}if(C||te!==e){I.buffers.depth.getReversed()&&e.reversedDepth!==!0&&(e._reversedDepth=!0,e.updateProjectionMatrix()),O.setValue(P,`projectionMatrix`,e.projectionMatrix),O.setValue(P,`viewMatrix`,e.matrixWorldInverse);let t=O.map.cameraPosition;t!==void 0&&t.setValue(P,ge.setFromMatrixPosition(e.matrixWorld)),F.logarithmicDepthBuffer&&O.setValue(P,`logDepthBufFC`,2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&O.setValue(P,`isOrthographic`,e.isOrthographicCamera===!0),te!==e&&(te=e,w=!0,E=!0)}if(v.needsLights&&(y.state.directionalShadowMap.length>0&&O.setValue(P,`directionalShadowMap`,y.state.directionalShadowMap,we),y.state.spotShadowMap.length>0&&O.setValue(P,`spotShadowMap`,y.state.spotShadowMap,we),y.state.pointShadowMap.length>0&&O.setValue(P,`pointShadowMap`,y.state.pointShadowMap,we)),i.isSkinnedMesh){O.setOptional(P,i,`bindMatrix`),O.setOptional(P,i,`bindMatrixInverse`);let e=i.skeleton;e&&(e.boneTexture===null&&e.computeBoneTexture(),O.setValue(P,`boneTexture`,e.boneTexture,we))}i.isBatchedMesh&&(O.setOptional(P,i,`batchingTexture`),O.setValue(P,`batchingTexture`,i._matricesTexture,we),O.setOptional(P,i,`batchingIdTexture`),O.setValue(P,`batchingIdTexture`,i._indirectTexture,we),O.setOptional(P,i,`batchingColorTexture`),i._colorsTexture!==null&&O.setValue(P,`batchingColorTexture`,i._colorsTexture,we));let j=n.morphAttributes;if((j.position!==void 0||j.normal!==void 0||j.color!==void 0)&&Re.update(i,n,S),(w||v.receiveShadow!==i.receiveShadow)&&(v.receiveShadow=i.receiveShadow,O.setValue(P,`receiveShadow`,i.receiveShadow)),(r.isMeshStandardMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial)&&r.envMap===null&&t.environment!==null&&(k.envMapIntensity.value=t.environmentIntensity),k.dfgLUT!==void 0&&(k.dfgLUT.value=qg()),w){if(O.setValue(P,`toneMappingExposure`,T.toneMappingExposure),v.needsLights&&St(k,E),a&&r.fog===!0&&Ae.refreshFogUniforms(k,a),Ae.refreshMaterialUniforms(k,r,oe,ae,x.state.transmissionRenderTarget[e.id]),v.needsLights&&v.lightProbeGrid){let e=v.lightProbeGrid;k.probesSH.value=e.texture,k.probesMin.value.copy(e.boundingBox.min),k.probesMax.value.copy(e.boundingBox.max),k.probesResolution.value.copy(e.resolution)}Eh.upload(P,vt(v),k,we)}if(r.isShaderMaterial&&r.uniformsNeedUpdate===!0&&(Eh.upload(P,vt(v),k,we),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&O.setValue(P,`center`,i.center),O.setValue(P,`modelViewMatrix`,i.modelViewMatrix),O.setValue(P,`normalMatrix`,i.normalMatrix),O.setValue(P,`modelMatrix`,i.matrixWorld),r.uniformsGroups!==void 0){let e=r.uniformsGroups;for(let t=0,n=e.length;t0&&we.useMultisampledRTT(e)===!1?L.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,j.copy(e.viewport),ne.copy(e.scissor),re=e.scissorTest}else j.copy(le).multiplyScalar(oe).floor(),ne.copy(ue).multiplyScalar(oe).floor(),re=de;if(n!==0&&(r=wt),I.bindFramebuffer(P.FRAMEBUFFER,r)&&I.drawBuffers(e,r),I.viewport(j),I.scissor(ne),I.setScissorTest(re),i){let r=L.get(e.texture);P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(a){let r=t;for(let t=0;t1&&P.readBuffer(P.COLOR_ATTACHMENT0+s),!F.textureFormatReadable(c)){B(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.`);return}if(!F.textureTypeReadable(l)){B(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.`);return}t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&P.readPixels(t,n,r,i,Ke.convert(c),Ke.convert(l),a)}finally{let e=A===null?null:L.get(A).__webglFramebuffer;I.bindFramebuffer(P.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget))throw Error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);let c=L.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c)if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){I.bindFramebuffer(P.FRAMEBUFFER,c);let o=e.textures[s],l=o.format,u=o.type;if(e.textures.length>1&&P.readBuffer(P.COLOR_ATTACHMENT0+s),!F.textureFormatReadable(l))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.`);if(!F.textureTypeReadable(u))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.`);let d=P.createBuffer();P.bindBuffer(P.PIXEL_PACK_BUFFER,d),P.bufferData(P.PIXEL_PACK_BUFFER,a.byteLength,P.STREAM_READ),P.readPixels(t,n,r,i,Ke.convert(l),Ke.convert(u),0);let f=A===null?null:L.get(A).__webglFramebuffer;I.bindFramebuffer(P.FRAMEBUFFER,f);let p=P.fenceSync(P.SYNC_GPU_COMMANDS_COMPLETE,0);return P.flush(),await Un(P,p,4),P.bindBuffer(P.PIXEL_PACK_BUFFER,d),P.getBufferSubData(P.PIXEL_PACK_BUFFER,0,a),P.deleteBuffer(d),P.deleteSync(p),a}else throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.`)},this.copyFramebufferToTexture=function(e,t=null,n=0){let r=2**-n,i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=t===null?0:t.x,s=t===null?0:t.y;we.setTexture2D(e,0),P.copyTexSubImage2D(P.TEXTURE_2D,n,0,0,o,s,i,a),I.unbindTexture()};let Tt=P.createFramebuffer(),Et=P.createFramebuffer();this.copyTextureToTexture=function(e,t,n=null,r=null,i=0,a=0){let o,s,c,l,u,d,f,p,m,h=e.isCompressedTexture?e.mipmaps[a]:e.image;if(n!==null)o=n.max.x-n.min.x,s=n.max.y-n.min.y,c=n.isBox3?n.max.z-n.min.z:1,l=n.min.x,u=n.min.y,d=n.isBox3?n.min.z:0;else{let t=2**-i;o=Math.floor(h.width*t),s=Math.floor(h.height*t),c=e.isDataArrayTexture?h.depth:e.isData3DTexture?Math.floor(h.depth*t):1,l=0,u=0,d=0}r===null?(f=0,p=0,m=0):(f=r.x,p=r.y,m=r.z);let g=Ke.convert(t.format),_=Ke.convert(t.type),v;t.isData3DTexture?(we.setTexture3D(t,0),v=P.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(we.setTexture2DArray(t,0),v=P.TEXTURE_2D_ARRAY):(we.setTexture2D(t,0),v=P.TEXTURE_2D),I.activeTexture(P.TEXTURE0),I.pixelStorei(P.UNPACK_FLIP_Y_WEBGL,t.flipY),I.pixelStorei(P.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),I.pixelStorei(P.UNPACK_ALIGNMENT,t.unpackAlignment);let y=I.getParameter(P.UNPACK_ROW_LENGTH),b=I.getParameter(P.UNPACK_IMAGE_HEIGHT),x=I.getParameter(P.UNPACK_SKIP_PIXELS),S=I.getParameter(P.UNPACK_SKIP_ROWS),C=I.getParameter(P.UNPACK_SKIP_IMAGES);I.pixelStorei(P.UNPACK_ROW_LENGTH,h.width),I.pixelStorei(P.UNPACK_IMAGE_HEIGHT,h.height),I.pixelStorei(P.UNPACK_SKIP_PIXELS,l),I.pixelStorei(P.UNPACK_SKIP_ROWS,u),I.pixelStorei(P.UNPACK_SKIP_IMAGES,d);let w=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=L.get(e),r=L.get(t),h=L.get(n.__renderTarget),g=L.get(r.__renderTarget);I.bindFramebuffer(P.READ_FRAMEBUFFER,h.__webglFramebuffer),I.bindFramebuffer(P.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let n=0;n{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Xg=o(((e,t)=>{t.exports=Yg()})),Zg=o((e=>{var t=d(),n=Xg();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Qg=l(o(((e,t)=>{t.exports=Zg()}))(),1),$g=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},e_=(e=>e?$g(e):$g),{useSyncExternalStoreWithSelector:t_}=Qg.default,n_=e=>e;function r_(e,t=n_,n){let r=t_(e.subscribe,e.getState,e.getInitialState,t,n);return v.useDebugValue(r),r}var i_=(e,t)=>{let n=e_(e),r=(e,r=t)=>r_(n,e,r);return Object.assign(r,n),r},a_=((e,t)=>e?i_(e,t):i_),o_=e=>typeof e==`object`&&typeof e.then==`function`,s_=[];function c_(e,t,n=(e,t)=>e===t){if(e===t)return!0;if(!e||!t)return!1;let r=e.length;if(t.length!==r)return!1;for(let i=0;i0&&(e.timeout&&clearTimeout(e.timeout),e.timeout=setTimeout(e.remove,r.lifespan)),e.response;if(!n)throw e.promise}let i={keys:t,equal:r.equal,remove:()=>{let e=s_.indexOf(i);e!==-1&&s_.splice(e,1)},promise:(o_(e)?e:e(...t)).then(e=>{i.response=e,r.lifespan&&r.lifespan>0&&(i.timeout=setTimeout(i.remove,r.lifespan))}).catch(e=>i.error=e)};if(s_.push(i),!n)throw i.promise}var u_=(e,t,n)=>l_(e,t,!1,n),d_=(e,t,n)=>void l_(e,t,!0,n),f_=e=>{if(e===void 0||e.length===0)s_.splice(0,s_.length);else{let t=s_.find(t=>c_(e,t.keys,t.equal));t&&t.remove()}},p_=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),m_=o(((e,t)=>{t.exports=p_()})),h_=l(p()),Q=m_();typeof window<`u`&&(window.document?.createElement||window.navigator?.product===`ReactNative`)?v.useLayoutEffect:v.useEffect;function g_(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){let e=g_(r,t,n);if(e)return e;r=t?null:r.sibling}}function __(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}var v_=__(v.createContext(null)),y_=class extends v.Component{render(){return v.createElement(v_.Provider,{value:this._reactInternals},this.props.children)}};function b_(){let e=v.useContext(v_);if(e===null)throw Error(`its-fine: useFiber must be called within a !`);let t=v.useId();return v.useMemo(()=>{for(let n of[e,e?.alternate]){if(!n)continue;let e=g_(n,!1,e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}});if(e)return e}},[e,t])}var x_=Symbol.for(`react.context`),S_=e=>typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===x_;function C_(){let e=b_(),[t]=v.useState(()=>new Map);t.clear();let n=e;for(;n;){let e=n.type;S_(e)&&e!==v_&&!t.has(e)&&t.set(e,v.use(__(e))),n=n.return}return t}function w_(){let e=C_();return v.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>v.createElement(t,null,v.createElement(n.Provider,{...r,value:e.get(n)})),e=>v.createElement(y_,{...e})),[e])}function T_(e){let t=e.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}var E_=e=>e&&e.isOrthographicCamera,D_=e=>e&&e.hasOwnProperty(`current`),O_=e=>e!=null&&(typeof e==`string`||typeof e==`number`||e.isColor),k_=((e,t)=>typeof window<`u`&&((e=window.document)?.createElement||(t=window.navigator)?.product===`ReactNative`))()?v.useLayoutEffect:v.useEffect;function A_(e){let t=v.useRef(e);return k_(()=>void(t.current=e),[e]),t}function j_(){let e=b_(),t=w_();return v.useMemo(()=>({children:n})=>(0,Q.jsx)(g_(e,!0,e=>e.type===v.StrictMode)?v.StrictMode:v.Fragment,{children:(0,Q.jsx)(t,{children:n})}),[e,t])}function M_({set:e}){return k_(()=>(e(new Promise(()=>null)),()=>e(!1)),[e]),null}var N_=(e=>(e=class extends v.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}},e.getDerivedStateFromError=()=>({error:!0}),e))();function P_(e){let t=typeof window<`u`?window.devicePixelRatio??2:1;return Array.isArray(e)?Math.min(Math.max(e[0],t),e[1]):e}function F_(e){return e.__r3f?.root.getState()}var I_={obj:e=>e===Object(e)&&!I_.arr(e)&&typeof e!=`function`,fun:e=>typeof e==`function`,str:e=>typeof e==`string`,num:e=>typeof e==`number`,boo:e=>typeof e==`boolean`,und:e=>e===void 0,nul:e=>e===null,arr:e=>Array.isArray(e),equ(e,t,{arrays:n=`shallow`,objects:r=`reference`,strict:i=!0}={}){if(typeof e!=typeof t||!!e!=!!t)return!1;if(I_.str(e)||I_.num(e)||I_.boo(e))return e===t;let a=I_.obj(e);if(a&&r===`reference`)return e===t;let o=I_.arr(e);if(o&&n===`reference`)return e===t;if((o||a)&&e===t)return!0;let s;for(s in e)if(!(s in t))return!1;if(a&&n===`shallow`&&r===`shallow`){for(s in i?t:e)if(!I_.equ(e[s],t[s],{strict:i,objects:`reference`}))return!1}else for(s in i?t:e)if(e[s]!==t[s])return!1;if(I_.und(s)){if(o&&e.length===0&&t.length===0||a&&Object.keys(e).length===0&&Object.keys(t).length===0)return!0;if(e!==t)return!1}return!0}};function L_(e){let t={nodes:{},materials:{},meshes:{}};return e&&e.traverse(e=>{e.name&&(t.nodes[e.name]=e),e.material&&!t.materials[e.material.name]&&(t.materials[e.material.name]=e.material),e.isMesh&&!t.meshes[e.name]&&(t.meshes[e.name]=e)}),t}function R_(e){e.type!==`Scene`&&(e.dispose==null||e.dispose());for(let t in e){let n=e[t];n?.type!==`Scene`&&(n==null||n.dispose==null||n.dispose())}}var z_=[`children`,`key`,`ref`];function B_(e){let t={};for(let n in e)z_.includes(n)||(t[n]=e[n]);return t}function V_(e,t,n,r){let i=e,a=i?.__r3f;return a||(a={root:t,type:n,parent:null,children:[],props:B_(r),object:i,eventCount:0,handlers:{},isHidden:!1},i&&(i.__r3f=a)),a}function H_(e,t){if(!t.includes(`-`)||t in e)return{root:e,key:t,target:e[t]};let n=e,r=t.split(`-`);for(let i of r){if(typeof n!=`object`||!n){if(n!==void 0){let e=r.slice(r.indexOf(i)).join(`-`);return{root:n,key:e,target:void 0}}return{root:e,key:t,target:void 0}}t=i,e=n,n=n[t]}return{root:e,key:t,target:n}}var U_=/-\d+$/;function W_(e,t){if(I_.str(t.props.attach)){if(U_.test(t.props.attach)){let n=t.props.attach.replace(U_,``),{root:r,key:i}=H_(e.object,n);Array.isArray(r[i])||(r[i]=[])}let{root:n,key:r}=H_(e.object,t.props.attach);t.previousAttach=n[r],n[r]=t.object}else I_.fun(t.props.attach)&&(t.previousAttach=t.props.attach(e.object,t.object))}function G_(e,t){if(I_.str(t.props.attach)){let{root:n,key:r}=H_(e.object,t.props.attach),i=t.previousAttach;i===void 0?delete n[r]:n[r]=i}else t.previousAttach==null||t.previousAttach(e.object,t.object);delete t.previousAttach}var K_=[...z_,`args`,`dispose`,`attach`,`object`,`onUpdate`,`dispose`],q_=new Map;function J_(e){let t=q_.get(e.constructor);try{t||(t=new e.constructor,q_.set(e.constructor,t))}catch{}return t}function Y_(e,t){let n={};for(let r in t)if(!K_.includes(r)&&!I_.equ(t[r],e.props[r])){n[r]=t[r];for(let e in t)e.startsWith(`${r}-`)&&(n[e]=t[e])}for(let r in e.props){if(K_.includes(r)||t.hasOwnProperty(r))continue;let{root:i,key:a}=H_(e.object,r);if(i.constructor&&i.constructor.length===0){let e=J_(i);I_.und(e)||(n[a]=e[a])}else n[a]=0}return n}var X_=[`map`,`emissiveMap`,`sheenColorMap`,`specularColorMap`,`envMap`],Z_=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function Q_(e,t){var n;let r=e.__r3f,i=r&&T_(r).getState(),a=r?.eventCount;for(let n in t){let a=t[n];if(K_.includes(n))continue;if(r&&Z_.test(n)){typeof a==`function`?r.handlers[n]=a:delete r.handlers[n],r.eventCount=Object.keys(r.handlers).length;continue}if(a===void 0)continue;let{root:s,key:c,target:l}=H_(e,n);if(l===void 0&&(typeof s!=`object`||!s))throw Error(`R3F: Cannot set "${n}". Ensure it is an object before setting "${c}".`);if(l instanceof ei&&a instanceof ei)l.mask=a.mask;else if(l instanceof G&&O_(a))l.set(a);else if(typeof l==`object`&&l&&typeof l.set==`function`&&typeof l.copy==`function`&&a!=null&&a.constructor&&l.constructor===a.constructor)l.copy(a);else if(typeof l==`object`&&l&&typeof l.set==`function`&&Array.isArray(a))typeof l.fromArray==`function`?l.fromArray(a):l.set(...a);else if(typeof l==`object`&&l&&typeof l.set==`function`&&typeof a==`number`)typeof l.setScalar==`function`?l.setScalar(a):l.set(a);else if(s instanceof tu&&c===`uniforms`&&I_.obj(a)){I_.obj(s.uniforms)||(s.uniforms={});let e=s.uniforms,t=a;for(let n in t){let r=t[n],i=e[n];i?Object.assign(i,r):e[n]={...r}}}else{var o;s[c]=a,i&&!i.linear&&X_.includes(c)&&(o=s[c])!=null&&o.isTexture&&s[c].format===1023&&s[c].type===1009&&(s[c].colorSpace=nn)}}if(r!=null&&r.parent&&i!=null&&i.internal&&(n=r.object)!=null&&n.isObject3D&&a!==r.eventCount){let e=r.object,t=i.internal.interaction.indexOf(e);t>-1&&i.internal.interaction.splice(t,1),r.eventCount&&e.raycast!==null&&i.internal.interaction.push(e)}return r&&r.props.attach===void 0&&(r.object.isBufferGeometry?r.props.attach=`geometry`:r.object.isMaterial&&(r.props.attach=`material`)),r&&$_(r),e}function $_(e){var t;if(!e.parent)return;e.props.onUpdate==null||e.props.onUpdate(e.object);let n=(t=e.root)==null||t.getState==null?void 0:t.getState();n&&n.internal.frames===0&&n.invalidate()}function ev(e,t){e.manual||(E_(e)?(e.left=t.width/-2,e.right=t.width/2,e.top=t.height/2,e.bottom=t.height/-2):e.aspect=t.width/t.height,e.updateProjectionMatrix())}var tv=e=>e?.isObject3D;function nv(e){return(e.eventObject||e.object).uuid+`/`+e.index+e.instanceId}function rv(e,t,n,r){let i=n.get(t);i&&(n.delete(t),n.size===0&&(e.delete(r),i.target.releasePointerCapture(r)))}function iv(e,t,n){let{internal:r}=e.getState();for(let e=0;e{if(e.eventObject===t||e.object===t){r.hovered.delete(i);let a={...e,eventObject:e.eventObject===t?n:e.eventObject,object:e.object===t?n:e.object};r.hovered.set(nv(a),a)}}),r.capturedMap.forEach(e=>{let r=e.get(t);r&&(e.delete(t),e.set(n,r))})}function av(e,t){let{internal:n}=e.getState();n.interaction=n.interaction.filter(e=>e!==t),n.initialHits=n.initialHits.filter(e=>e!==t),n.hovered.forEach((e,r)=>{(e.eventObject===t||e.object===t)&&n.hovered.delete(r)}),n.capturedMap.forEach((e,r)=>{rv(n.capturedMap,t,e,r)})}function ov(e){function t(t){let{internal:n}=e.getState(),r=t.offsetX-n.initialClick[0],i=t.offsetY-n.initialClick[1];return Math.round(Math.sqrt(r*r+i*i))}function n(e){return e.filter(e=>[`Move`,`Over`,`Enter`,`Out`,`Leave`].some(t=>e.__r3f?.handlers[`onPointer`+t]))}function r(t,n){let r=e.getState(),i=new Set,a=[],o=n?n(r.internal.interaction):r.internal.interaction;for(let e=0;e{let n=F_(e.object),r=F_(t.object);return!n||!r?e.distance-t.distance:r.events.priority-n.events.priority||e.distance-t.distance}).filter(e=>{let t=nv(e);return i.has(t)?!1:(i.add(t),!0)});r.events.filter&&(c=r.events.filter(c,r));for(let e of c){let t=e.object;for(;t;){var l;(l=t.__r3f)!=null&&l.eventCount&&a.push({...e,eventObject:t}),t=t.parent}}if(`pointerId`in t&&r.internal.capturedMap.has(t.pointerId))for(let e of r.internal.capturedMap.get(t.pointerId).values())i.has(nv(e.intersection))||a.push(e.intersection);return a}function i(e,t,n,r){if(e.length){let i={stopped:!1};for(let o of e){let s=F_(o.object);if(s||o.object.traverseAncestors(e=>{let t=F_(e);if(t)return s=t,!1}),s){let{raycaster:c,pointer:l,camera:u,internal:d}=s,f=new U(l.x,l.y,0).unproject(u),p=e=>d.capturedMap.get(e)?.has(o.eventObject)??!1,m=e=>{let n={intersection:o,target:t.target};d.capturedMap.has(e)?d.capturedMap.get(e).set(o.eventObject,n):d.capturedMap.set(e,new Map([[o.eventObject,n]])),t.target.setPointerCapture(e)},h=e=>{let t=d.capturedMap.get(e);t&&rv(d.capturedMap,o.eventObject,t,e)},g={};for(let e in t){let n=t[e];typeof n!=`function`&&(g[e]=n)}let _={...o,...g,pointer:l,intersections:e,stopped:i.stopped,delta:n,unprojectedPoint:f,ray:c.ray,camera:u,stopPropagation(){let n=`pointerId`in t&&d.capturedMap.get(t.pointerId);(!n||n.has(o.eventObject))&&(_.stopped=i.stopped=!0,d.hovered.size&&Array.from(d.hovered.values()).find(e=>e.eventObject===o.eventObject)&&a([...e.slice(0,e.indexOf(o)),o]))},target:{hasPointerCapture:p,setPointerCapture:m,releasePointerCapture:h},currentTarget:{hasPointerCapture:p,setPointerCapture:m,releasePointerCapture:h},nativeEvent:t};if(r(_),i.stopped===!0)break}}}return e}function a(t){let{internal:n}=e.getState();for(let e of n.hovered.values())if(!t.length||!t.find(t=>t.object===e.object&&t.index===e.index&&t.instanceId===e.instanceId)){let r=e.eventObject.__r3f;if(n.hovered.delete(nv(e)),r!=null&&r.eventCount){let n=r.handlers,i={...e,intersections:t};n.onPointerOut==null||n.onPointerOut(i),n.onPointerLeave==null||n.onPointerLeave(i)}}}function o(e,t){for(let n=0;na([]);case`onLostPointerCapture`:return t=>{let{internal:n}=e.getState();`pointerId`in t&&n.capturedMap.has(t.pointerId)&&requestAnimationFrame(()=>{n.capturedMap.has(t.pointerId)&&(n.capturedMap.delete(t.pointerId),a([]))})}}return function(c){let{onPointerMissed:l,internal:u}=e.getState();u.lastEvent.current=c;let d=s===`onPointerMove`,f=s===`onClick`||s===`onContextMenu`||s===`onDoubleClick`,p=r(c,d?n:void 0),m=f?t(c):0;s===`onPointerDown`&&(u.initialClick=[c.offsetX,c.offsetY],u.initialHits=p.map(e=>e.eventObject)),f&&!p.length&&m<=2&&(o(c,u.interaction),l&&l(c)),d&&a(p);function h(e){let t=e.eventObject,n=t.__r3f;if(!(n!=null&&n.eventCount))return;let r=n.handlers;if(d){if(r.onPointerOver||r.onPointerEnter||r.onPointerOut||r.onPointerLeave){let t=nv(e),n=u.hovered.get(t);n?n.stopped&&e.stopPropagation():(u.hovered.set(t,e),r.onPointerOver==null||r.onPointerOver(e),r.onPointerEnter==null||r.onPointerEnter(e))}r.onPointerMove==null||r.onPointerMove(e)}else{let n=r[s];n?(!f||u.initialHits.includes(t))&&(o(c,u.interaction.filter(e=>!u.initialHits.includes(e))),n(e)):f&&u.initialHits.includes(t)&&o(c,u.interaction.filter(e=>!u.initialHits.includes(e)))}}i(p,c,m,h)}}return{handlePointer:s}}var sv=e=>!!(e!=null&&e.render),cv=v.createContext(null),lv=(e,t)=>{let n=a_((n,r)=>{let i=new U,a=new U,o=new U;function s(e=r().camera,t=a,n=r().size){let{width:s,height:c,top:l,left:u}=n,d=s/c;t.isVector3?o.copy(t):o.set(...t);let f=e.getWorldPosition(i).distanceTo(o);if(E_(e))return{width:s/e.zoom,height:c/e.zoom,top:l,left:u,factor:1,distance:f,aspect:d};{let t=e.fov*Math.PI/180,n=2*Math.tan(t/2)*f,r=s/c*n;return{width:r,height:n,top:l,left:u,factor:s/r,distance:f,aspect:d}}}let c,l=e=>n(t=>({performance:{...t.performance,current:e}})),u=new H;return{set:n,get:r,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(t=1)=>e(r(),t),advance:(e,n)=>t(e,n,r()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Mf,pointer:u,mouse:u,frameloop:`always`,onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let e=r();c&&clearTimeout(c),e.performance.current!==e.performance.min&&l(e.performance.min),c=setTimeout(()=>l(r().performance.max),e.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:s},setEvents:e=>n(t=>({...t,events:{...t.events,...e}})),setSize:(e,t,i=0,o=0)=>{let c=r().camera,l={width:e,height:t,top:i,left:o};n(e=>({size:l,viewport:{...e.viewport,...s(c,a,l)}}))},setDpr:e=>n(t=>{let n=P_(e);return{viewport:{...t.viewport,dpr:n,initialDpr:t.viewport.initialDpr||n}}}),setFrameloop:(e=`always`)=>{let t=r().clock;t.stop(),t.elapsedTime=0,e!==`never`&&(t.start(),t.elapsedTime=0),n(()=>({frameloop:e}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:v.createRef(),active:!1,frames:0,priority:0,subscribe:(e,t,n)=>{let i=r().internal;return i.priority+=+(t>0),i.subscribers.push({ref:e,priority:t,store:n}),i.subscribers=i.subscribers.sort((e,t)=>e.priority-t.priority),()=>{let n=r().internal;n!=null&&n.subscribers&&(n.priority-=+(t>0),n.subscribers=n.subscribers.filter(t=>t.ref!==e))}}}}}),r=n.getState(),i=r.size,a=r.viewport.dpr,o=r.camera;return n.subscribe(()=>{let{camera:e,size:t,viewport:r,gl:s,set:c}=n.getState();if(t.width!==i.width||t.height!==i.height||r.dpr!==a){i=t,a=r.dpr,ev(e,t),r.dpr>0&&s.setPixelRatio(r.dpr);let n=typeof HTMLCanvasElement<`u`&&s.domElement instanceof HTMLCanvasElement;s.setSize(t.width,t.height,n)}e!==o&&(o=e,c(t=>({viewport:{...t.viewport,...t.viewport.getCurrentViewport(e)}})))}),n.subscribe(t=>e(t)),n};function uv(){let e=v.useContext(cv);if(!e)throw Error(`R3F: Hooks can only be used within the Canvas component!`);return e}function dv(e=e=>e,t){return uv()(e,t)}function fv(e,t=0){let n=uv(),r=n.getState().internal.subscribe,i=A_(e);return k_(()=>r(i,t,n),[t,r,n]),null}var pv=new WeakMap,mv=e=>typeof e==`function`&&e?.prototype?.constructor===e;function hv(e,t){return function(n,...r){let i;return mv(n)?(i=pv.get(n),i||(i=new n,pv.set(n,i))):i=n,e&&e(i),Promise.all(r.map(e=>new Promise((n,r)=>i.load(e,e=>{tv(e?.scene)&&Object.assign(e,L_(e.scene)),n(e)},t,t=>r(Error(`Could not load ${e}: ${t?.message}`))))))}}function gv(e,t,n,r){let i=Array.isArray(t)?t:[t],a=u_(hv(n,r),[e,...i],{equal:I_.equ});return Array.isArray(t)?a:a[0]}gv.preload=function(e,t,n){let r=Array.isArray(t)?t:[t];return d_(hv(n),[e,...r])},gv.clear=function(e,t){return f_([e,...Array.isArray(t)?t:[t]])};var _v=1,vv=8,yv=32,bv=2,xv={name:`@react-three/fiber`,version:`9.6.1`,description:`A React renderer for Threejs`,keywords:[`react`,`renderer`,`fiber`,`three`,`threejs`],author:`Paul Henschel (https://github.com/drcmda)`,license:`MIT`,maintainers:[`Josh Ellis (https://github.com/joshuaellis)`,`Cody Bennett (https://github.com/codyjasonbennett)`,`Kris Baumgarter (https://github.com/krispya)`],bugs:{url:`https://github.com/pmndrs/react-three-fiber/issues`},homepage:`https://github.com/pmndrs/react-three-fiber#readme`,repository:{type:`git`,url:`git+https://github.com/pmndrs/react-three-fiber.git`},collective:{type:`opencollective`,url:`https://opencollective.com/react-three-fiber`},main:`dist/react-three-fiber.cjs.js`,module:`dist/react-three-fiber.esm.js`,types:`dist/react-three-fiber.cjs.d.ts`,"react-native":`native/dist/react-three-fiber-native.cjs.js`,sideEffects:!1,preconstruct:{entrypoints:[`index.tsx`,`native.tsx`]},scripts:{prebuild:`cp ../../readme.md readme.md`},devDependencies:{"@types/react-reconciler":`^0.32.3`,"react-reconciler":`^0.33.0`},dependencies:{"@babel/runtime":`^7.17.8`,"@types/webxr":`*`,"base64-js":`^1.5.1`,buffer:`^6.0.3`,"its-fine":`^2.0.0`,"react-use-measure":`^2.1.7`,scheduler:`^0.27.0`,"suspend-react":`^0.1.3`,"use-sync-external-store":`^1.4.0`,zustand:`^5.0.3`},peerDependencies:{expo:`>=43.0`,"expo-asset":`>=8.4`,"expo-file-system":`>=11.0`,"expo-gl":`>=11.0`,react:`>=19 <19.3`,"react-dom":`>=19 <19.3`,"react-native":`>=0.78`,three:`>=0.156`},peerDependenciesMeta:{"react-dom":{optional:!0},"react-native":{optional:!0},expo:{optional:!0},"expo-asset":{optional:!0},"expo-file-system":{optional:!0},"expo-gl":{optional:!0}}};function Sv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var Cv={exports:{}},wv={exports:{}};wv.exports;var Tv;function Ev(){return Tv||(Tv=1,function(e){e.exports=function(e){function t(e,t,n,r){return new la(e,t,n,r)}function n(){}function r(e){var t=`https://react.dev/errors/`+e;if(1uc||(e.current=lc[uc],lc[uc]=null,uc--)}function p(e,t){uc++,lc[uc]=e.current,e.current=t}function m(e){return e>>>=0,e===0?32:31-(pc(e)/mc|0)|0}function h(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function g(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=h(n))):i=h(o):i=h(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=h(n))):i=h(o)):i=h(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function _(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function y(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function b(){var e=_c;return _c<<=1,!(_c&62914560)&&(_c=4194304),e}function x(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function S(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function C(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0)`:-1i||c[r]!==l[i]){var u=` +`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ic=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ee(n):``}function j(e,t){switch(e.tag){case 26:case 27:case 5:return ee(e.type);case 16:return ee(`Lazy`);case 13:return e.child!==t&&t!==null?ee(`Suspense Fallback`):ee(`Suspense`);case 19:return ee(`SuspenseList`);case 0:case 15:return te(e.type,!1);case 11:return te(e.type.render,!1);case 1:return te(e.type,!0);case 31:return ee(`Activity`);default:return``}}function ne(e){try{var t=``,n=null;do t+=j(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}function re(e,t){if(typeof e==`object`&&e){var n=Lc.get(e);return n===void 0?(t={value:e,source:t,stack:ne(t)},Lc.set(e,t),t):n}return{value:e,source:t,stack:ne(t)}}function M(e,t){Rc[zc++]=Vc,Rc[zc++]=Bc,Bc=e,Vc=t}function N(e,t,n){Hc[Uc++]=Gc,Hc[Uc++]=Kc,Hc[Uc++]=Wc,Wc=e;var r=Gc;e=Kc;var i=32-fc(r)-1;r&=~(1<>=o,i-=o,Gc=1<<32-fc(t)+i|n<f?(p=d,d=null):p=d.sibling;var _=h(t,d,o[f],c);if(_===null){d===null&&(d=p);break}e&&d&&_.alternate===null&&n(t,d),r=s(_,r,f),u===null?l=_:u.sibling=_,u=_,d=p}if(f===o.length)return i(t,d),$c&&M(t,f),l;if(d===null){for(;fp?(_=f,f=null):_=f.sibling;var y=h(t,f,v.value,l);if(y===null){f===null&&(f=_);break}e&&f&&y.alternate===null&&n(t,f),o=s(y,o,p),d===null?u=y:d.sibling=y,d=y,f=_}if(v.done)return i(t,f),$c&&M(t,p),u;if(f===null){for(;!v.done;p++,v=c.next())v=m(t,v.value,l),v!==null&&(o=s(v,o,p),d===null?u=v:d.sibling=v,d=v);return $c&&M(t,p),u}for(f=a(f);!v.done;p++,v=c.next())v=g(f,t,p,v.value,l),v!==null&&(e&&v.alternate!==null&&f.delete(v.key===null?p:v.key),o=s(v,o,p),d===null?u=v:d.sibling=v,d=v);return e&&f.forEach(function(e){return n(t,e)}),$c&&M(t,p),u}function y(e,t,a,s){if(typeof a==`object`&&a&&a.type===q&&a.key===null&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case ka:e:{for(var u=a.key;t!==null;){if(t.key===u){if(u=a.type,u===q){if(t.tag===7){i(e,t.sibling),s=o(t,a.props.children),s.return=e,e=s;break e}}else if(t.elementType===u||typeof u==`object`&&u&&u.$$typeof===za&&We(u)===t.type){i(e,t.sibling),s=o(t,a.props),Je(s,a),s.return=e,e=s;break e}i(e,t);break}else n(e,t);t=t.sibling}a.type===q?(s=ma(a.props.children,e.mode,s,a.key),s.return=e,e=s):(s=pa(a.type,a.key,a.props,null,e.mode,s),Je(s,a),s.return=e,e=s)}return c(e);case Aa:e:{for(u=a.key;t!==null;){if(t.key===u)if(t.tag===4&&t.stateNode.containerInfo===a.containerInfo&&t.stateNode.implementation===a.implementation){i(e,t.sibling),s=o(t,a.children||[]),s.return=e,e=s;break e}else{i(e,t);break}else n(e,t);t=t.sibling}s=_a(a,e.mode,s),s.return=e,e=s}return c(e);case za:return a=We(a),y(e,t,a,s)}if(Wa(a))return _(e,t,a,s);if(l(a)){if(u=l(a),typeof u!=`function`)throw Error(r(150));return a=u.call(a),v(e,t,a,s)}if(typeof a.then==`function`)return y(e,t,qe(a),s);if(a.$$typeof===Pa)return y(e,t,Ce(e,a),s);Ye(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,t!==null&&t.tag===6?(i(e,t.sibling),s=o(t,a),s.return=e,e=s):(i(e,t),s=ha(a,e.mode,s),s.return=e,e=s),c(e)):i(e,t)}return function(e,n,r,i){try{Ol=0;var a=y(e,n,r,i);return Dl=null,a}catch(n){if(n===Sl||n===wl)throw n;var o=t(29,n,null,e.mode);return o.lanes=i,o.return=e,o}}}function Ze(){for(var e=Ml,t=Nl=Ml=0;ta?a:8);var o=J.T,s={};J.T=s,Pn(e,!1,t,n);try{var c=i(),l=J.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Nn(e,t,Le(c,r),wi(e)):Nn(e,t,r,wi(e))}catch(n){Nn(e,t,{then:function(){},status:`rejected`,reason:n},wi())}finally{mo(a),o!==null&&s.types!==null&&(o.types=s.types),J.T=o}}function En(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Eo,baseState:Eo,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lt,lastRenderedState:Eo},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lt,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Dn(){return I(Do)}function On(){return Mt().memoizedState}function kn(){return Mt().memoizedState}function An(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=wi();e=at(n);var r=ot(t,e,n);r!==null&&(Ei(r,t,n),st(r,t,n)),t={cache:we()},e.payload=t;return}t=t.return}}function jn(e,t,n){var r=wi();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fn(e)?In(t,n):(n=$e(e,t,n,r),n!==null&&(Ei(n,e,r),Ln(n,t,r)))}function Mn(e,t,n){Nn(e,t,n,wi())}function Nn(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fn(e))In(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,jc(s,o))return Qe(e,t,i,0),Cu===null&&Ze(),!1}catch{}if(n=$e(e,t,i,r),n!==null)return Ei(n,e,r),Ln(n,t,r),!0}return!1}function Pn(e,t,n,i){if(i={lane:2,revertLane:Fe(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Fn(e)){if(t)throw Error(r(479))}else t=$e(e,n,i,2),t!==null&&Ei(t,e,2)}function Fn(e){var t=e.alternate;return e===Vl||t!==null&&t===Vl}function In(e,t){Gl=Wl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ln(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,T(e,n)}}function Rn(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Da({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}function zn(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ve(n,r)||!Ve(i,a):!0}function Bn(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&tu.enqueueReplaceState(t,t.state,null)}function Vn(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=Da({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function z(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function B(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Hn(e,t,n){return n=at(n),n.tag=3,n.payload={element:null},n.callback=function(){z(e,t)},n}function Un(e){return e=at(e),e.tag=3,e}function Wn(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){B(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){B(t,n,r),typeof i!=`function`&&(Gu===null?Gu=new Set([this]):Gu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Gn(e,t,n,i,a){if(n.flags|=32768,typeof i==`object`&&i&&typeof i.then==`function`){if(t=n.alternate,t!==null&&xe(t,n,a,!0),n=Rl.current,n!==null){switch(n.tag){case 31:case 13:return Y===null?Ri():n.alternate===null&&Mu===0&&(Mu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,i===Tl?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),ra(e,i,a)),!1;case 22:return n.flags|=65536,i===Tl?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),ra(e,i,a)),!1}throw Error(r(435,n.tag))}return ra(e,i,a),Ri(),!1}if($c)return t=Rl.current,t===null?(i!==nl&&(t=Error(r(423),{cause:i}),_e(re(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,i=re(i,n),a=Hn(e.stateNode,i,a),ct(e,a),Mu!==4&&(Mu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,i!==nl&&(e=Error(r(422),{cause:i}),_e(re(e,n)))),!1;var o=Error(r(520),{cause:i});if(o=re(o,n),Ru===null?Ru=[o]:Ru.push(o),Mu!==4&&(Mu=2),t===null)return!0;i=re(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Hn(n.stateNode,i,e),ct(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Gu===null||!Gu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Un(a),Wn(a,e,n,i),ct(n,a),!1}n=n.return}while(n!==null);return!1}function Kn(e,t,n,r){t.child=e===null?Al(t,null,n,r):kl(t,e.child,n,r)}function qn(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return F(t),r=wt(e,t,n,o,a,i),s=Ot(),e!==null&&!ru?(kt(e,t,i),hr(e,t,i)):($c&&s&&ie(t),t.flags|=1,Kn(e,t,r,i),t.child)}function Jn(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ua(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Yn(e,t,a,r,i)):(e=pa(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!gr(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ve:n,n(o,r)&&e.ref===t.ref)return hr(e,t,i)}return t.flags|=1,e=da(a,r),e.ref=t.ref,e.return=t,t.child=e}function Yn(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ve(a,r)&&e.ref===t.ref)if(ru=!1,t.pendingProps=r=a,gr(e,i))e.flags&131072&&(ru=!0);else return t.lanes=e.lanes,hr(e,t,i)}return nr(e,t,n,r,i)}function Xn(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Zn(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ze(t,a===null?null:a.cachePool),a===null?mt():pt(t,a),vt(t);else return r=t.lanes=536870912,Zn(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ze(t,null),mt(),yt()):(ze(t,a.cachePool),pt(t,a),yt(),t.memoizedState=null);return Kn(e,t,i,n),t.child}function V(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Zn(e,t,n,r,i){var a=Re();return a=a===null?null:{parent:so?ll._currentValue:ll._currentValue2,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ze(t,null),mt(),vt(t),e!==null&&xe(e,t,r,!0),t.childLanes=i,null}function Qn(e,t){return t=ur({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function $n(e,t,n){return kl(t,e.child,null,n),e=Qn(t,t.pendingProps),e.flags|=2,bt(t),t.memoizedState=null,e}function er(e,t,n){var i=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if($c){if(i.mode===`hidden`)return e=Qn(t,i),t.lanes=536870912,V(null,e);if(_t(t),(e=Qc)?(e=Ss(e,tl),e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wc===null?null:{id:Gc,overflow:Kc},retryLane:536870912,hydrationErrors:null},n=ga(e),n.return=t,t.child=n,Zc=t,Qc=null)):e=null,e===null)throw de(t);return t.lanes=536870912,null}return Qn(t,i)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(_t(t),a)if(t.flags&256)t.flags&=-257,t=$n(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(ru||xe(e,t,n,!1),a=(n&e.childLanes)!==0,ru||a){if(i=Cu,i!==null&&(s=E(i,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,et(e,s),Ei(i,e,s),nu;Ri(),t=$n(e,t,n)}else e=o.treeContext,uo&&(Qc=_s(s),Zc=t,$c=!0,el=null,tl=!1,e!==null&&oe(t,e)),t=Qn(t,i),t.flags|=4096;return t}return e=da(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function tr(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(r(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function nr(e,t,n,r,i){return F(t),n=wt(e,t,n,r,void 0,i),r=Ot(),e!==null&&!ru?(kt(e,t,i),hr(e,t,i)):($c&&r&&ie(t),t.flags|=1,Kn(e,t,n,i),t.child)}function rr(e,t,n,r,i,a){return F(t),t.updateQueue=null,n=Et(t,r,n,i),Tt(e),r=Ot(),e!==null&&!ru?(kt(e,t,a),hr(e,t,a)):($c&&r&&ie(t),t.flags|=1,Kn(e,t,n,a),t.child)}function ir(e,t,n,r,i){if(F(t),t.stateNode===null){var a=dc,o=n.contextType;typeof o==`object`&&o&&(a=I(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=tu,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},rt(t),o=n.contextType,a.context=typeof o==`object`&&o?I(o):dc,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Rn(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&tu.enqueueReplaceState(a,a.state,null),ut(t,r,a,i),lt(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Vn(n,s);a.props=c;var l=a.context,u=n.contextType;o=dc,typeof u==`object`&&u&&(o=I(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Bn(t,a,r,o),Pl=!1;var f=t.memoizedState;a.state=f,ut(t,r,a,i),lt(),l=t.memoizedState,s||f!==l||Pl?(typeof d==`function`&&(Rn(t,n,d,r),l=t.memoizedState),(c=Pl||zn(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,it(e,t),o=t.memoizedProps,u=Vn(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=dc,typeof l==`object`&&l&&(c=I(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Bn(t,a,r,c),Pl=!1,f=t.memoizedState,a.state=f,ut(t,r,a,i),lt();var p=t.memoizedState;o!==d||f!==p||Pl||e!==null&&e.dependencies!==null&&Se(e.dependencies)?(typeof s==`function`&&(Rn(t,n,s,r),p=t.memoizedState),(u=Pl||zn(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Se(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,tr(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=kl(t,e.child,null,i),t.child=kl(t,null,n,i)):Kn(e,t,n,i),t.memoizedState=a.state,e=t.child):e=hr(e,t,i),e}function ar(e,t,n,r){return he(),t.flags|=256,Kn(e,t,n,r),t.child}function or(e){return{baseLanes:e,cachePool:Be()}}function sr(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Iu),e}function cr(e,t,n){var i=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(zl.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if($c){if(a?gt(t):yt(),(e=Qc)?(e=Cs(e,tl),e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wc===null?null:{id:Gc,overflow:Kc},retryLane:536870912,hydrationErrors:null},n=ga(e),n.return=t,t.child=n,Zc=t,Qc=null)):e=null,e===null)throw de(t);return cs(e)?t.lanes=32:t.lanes=536870912,null}var c=i.children;return i=i.fallback,a?(yt(),a=t.mode,c=ur({mode:`hidden`,children:c},a),i=ma(i,a,n,null),c.return=t,i.return=t,c.sibling=i,t.child=c,i=t.child,i.memoizedState=or(n),i.childLanes=sr(e,s,n),t.memoizedState=iu,V(null,i)):(gt(t),lr(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(gt(t),t.flags&=-257,t=dr(e,t,n)):t.memoizedState===null?(yt(),c=i.fallback,a=t.mode,i=ur({mode:`visible`,children:i.children},a),c=ma(c,a,n,null),c.flags|=2,i.return=t,c.return=t,i.sibling=c,t.child=i,kl(t,e.child,null,n),i=t.child,i.memoizedState=or(n),i.childLanes=sr(e,s,n),t.memoizedState=iu,t=V(null,i)):(yt(),t.child=e.child,t.flags|=128,t=null);else if(gt(t),cs(c))s=ls(c).digest,i=Error(r(419)),i.stack=``,i.digest=s,_e({value:i,source:null,stack:null}),t=dr(e,t,n);else if(ru||xe(e,t,n,!1),s=(n&e.childLanes)!==0,ru||s){if(s=Cu,s!==null&&(i=E(s,n),i!==0&&i!==l.retryLane))throw l.retryLane=i,et(e,i),Ei(s,e,i),nu;ss(c)||Ri(),t=dr(e,t,n)}else ss(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,uo&&(Qc=vs(c),Zc=t,$c=!0,el=null,tl=!1,e!==null&&oe(t,e)),t=lr(t,i.children),t.flags|=4096);return t}return a?(yt(),c=i.fallback,a=t.mode,l=e.child,o=l.sibling,i=da(l,{mode:`hidden`,children:i.children}),i.subtreeFlags=l.subtreeFlags&65011712,o===null?(c=ma(c,a,n,null),c.flags|=2):c=da(o,c),c.return=t,i.return=t,i.sibling=c,t.child=i,V(null,i),i=t.child,c=e.child.memoizedState,c===null?c=or(n):(a=c.cachePool,a===null?a=Be():(l=so?ll._currentValue:ll._currentValue2,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),i.memoizedState=c,i.childLanes=sr(e,s,n),t.memoizedState=iu,V(e.child,i)):(gt(t),n=e.child,e=n.sibling,n=da(n,{mode:`visible`,children:i.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function lr(e,t){return t=ur({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function ur(e,n){return e=t(22,e,null,n),e.lanes=0,e}function dr(e,t,n){return kl(t,e.child,null,n),e=lr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function fr(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),be(e.return,t,n)}function pr(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function mr(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=zl.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,p(zl,o),Kn(e,t,r,n),r=$c?Vc:0,!s&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fr(e,n,t);else if(e.tag===19)fr(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&xt(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),pr(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&xt(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}pr(t,!0,n,null,a,r);break;case`together`:pr(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function hr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Nu|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(xe(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=da(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=da(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function gr(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Se(e))):!0}function _r(e,t,n){switch(t.tag){case 3:se(t,t.stateNode.containerInfo),ve(t,ll,e.memoizedState.cache),he();break;case 27:case 5:le(t);break;case 4:se(t,t.stateNode.containerInfo);break;case 10:ve(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,_t(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(gt(t),e=hr(e,t,n),e===null?null:e.sibling):cr(e,t,n):(gt(t),t.flags|=128,null);gt(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(xe(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return mr(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),p(zl,zl.current),r)break;return null;case 22:return t.lanes=0,Xn(e,t,n,t.pendingProps);case 24:ve(t,ll,e.memoizedState.cache)}return hr(e,t,n)}function H(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ru=!0;else{if(!gr(e,n)&&!(t.flags&128))return ru=!1,_r(e,t,n);ru=(e.flags&131072)!=0}else ru=!1,$c&&t.flags&1048576&&N(t,Vc,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=We(t.elementType),t.type=e,typeof e==`function`)ua(e)?(i=Vn(e,i),t.tag=1,t=ir(null,t,e,i,n)):(t.tag=0,t=nr(null,t,e,i,n));else{if(e!=null){var a=e.$$typeof;if(a===Fa){t.tag=11,t=qn(null,t,e,i,n);break e}else if(a===Ra){t.tag=14,t=Jn(null,t,e,i,n);break e}}throw t=u(e)||e,Error(r(306,t,``))}}return t;case 0:return nr(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,a=Vn(i,t.pendingProps),ir(e,t,i,a,n);case 3:e:{if(se(t,t.stateNode.containerInfo),e===null)throw Error(r(387));var o=t.pendingProps;a=t.memoizedState,i=a.element,it(e,t),ut(t,o,null,n);var s=t.memoizedState;if(o=s.cache,ve(t,ll,o),o!==a.cache&&P(t,[ll],n,!0),lt(),o=s.element,uo&&a.isDehydrated)if(a={element:o,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=ar(e,t,o,n);break e}else if(o!==i){i=re(Error(r(424)),t),_e(i),t=ar(e,t,o,n);break e}else for(uo&&(Qc=gs(t.stateNode.containerInfo),Zc=t,$c=!0,el=null,tl=!0),n=Al(t,null,o,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(he(),o===i){t=hr(e,t,n);break e}Kn(e,t,o,n)}t=t.child}return t;case 26:if(Us)return tr(e,t),e===null?(n=Ks(t.type,null,t.pendingProps,null))?t.memoizedState=n:$c||(t.stateNode=Qs(t.type,t.pendingProps,Yc.current,t)):t.memoizedState=Ks(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:if(rc)return le(t),e===null&&rc&&$c&&(i=t.stateNode=ic(t.type,t.pendingProps,Yc.current,qc.current,!1),Zc=t,tl=!0,Qc=ys(t.type,i,Qc)),Kn(e,t,t.pendingProps.children,n),tr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&$c&&(Vs(t.type,t.pendingProps,qc.current),(a=i=Qc)&&(i=bs(i,t.type,t.pendingProps,tl),i===null?a=!1:(t.stateNode=i,Zc=t,Qc=hs(i),tl=!1,a=!0)),a||de(t)),le(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,i=o.children,no(a,o)?i=null:s!==null&&no(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=wt(e,t,Dt,null,null,n),so?Do._currentValue=a:Do._currentValue2=a),tr(e,t),Kn(e,t,i,n),t.child;case 6:return e===null&&$c&&(Hs(t.pendingProps,qc.current),(e=n=Qc)&&(n=xs(n,t.pendingProps,tl),n===null?e=!1:(t.stateNode=n,Zc=t,Qc=null,e=!0)),e||de(t)),null;case 13:return cr(e,t,n);case 4:return se(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=kl(t,null,i,n):Kn(e,t,i,n),t.child;case 11:return qn(e,t,t.type,t.pendingProps,n);case 7:return Kn(e,t,t.pendingProps,n),t.child;case 8:return Kn(e,t,t.pendingProps.children,n),t.child;case 12:return Kn(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,ve(t,t.type,i.value),Kn(e,t,i.children,n),t.child;case 9:return a=t.type._context,i=t.pendingProps.children,F(t),a=I(a),i=i(a),t.flags|=1,Kn(e,t,i,n),t.child;case 14:return Jn(e,t,t.type,t.pendingProps,n);case 15:return Yn(e,t,t.type,t.pendingProps,n);case 19:return mr(e,t,n);case 31:return er(e,t,n);case 22:return Xn(e,t,n,t.pendingProps);case 24:return F(t),i=I(ll),e===null?(a=Re(),a===null&&(a=Cu,o=we(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:i,cache:a},rt(t),ve(t,ll,a)):((e.lanes&n)!==0&&(it(e,t),ut(t,null,null,n),lt()),a=e.memoizedState,o=t.memoizedState,a.parent===i?(i=o.cache,ve(t,ll,i),i!==a.cache&&P(t,[ll],n,!0)):(a={parent:i,cache:i},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ve(t,ll,i))),Kn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function vr(e){e.flags|=4}function U(e){lo&&(e.flags|=8)}function yr(e,t){if(e!==null&&e.child===t.child)return!1;if(t.flags&16)return!0;for(e=t.child;e!==null;){if(e.flags&8218||e.subtreeFlags&8218)return!0;e=e.sibling}return!1}function br(e,t,n,r){if(co)for(n=t.child;n!==null;){if(n.tag===5||n.tag===6)eo(e,n.stateNode);else if(!(n.tag===4||rc&&n.tag===27)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}else if(lo)for(var i=t.child;i!==null;){if(i.tag===5){var a=i.stateNode;n&&r&&(a=as(a,i.type,i.memoizedProps)),eo(e,a)}else if(i.tag===6)a=i.stateNode,n&&r&&(a=os(a,i.memoizedProps)),eo(e,a);else if(i.tag!==4){if(i.tag===22&&i.memoizedState!==null)a=i.child,a!==null&&(a.return=i),br(e,i,!0,!0);else if(i.child!==null){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}}function xr(e,t,n,r){var i=!1;if(lo)for(var a=t.child;a!==null;){if(a.tag===5){var o=a.stateNode;n&&r&&(o=as(o,a.type,a.memoizedProps)),ns(e,o)}else if(a.tag===6)o=a.stateNode,n&&r&&(o=os(o,a.memoizedProps)),ns(e,o);else if(a.tag!==4){if(a.tag===22&&a.memoizedState!==null)i=a.child,i!==null&&(i.return=a),xr(e,a,!0,!0),i=!0;else if(a.child!==null){a.child.return=a,a=a.child;continue}}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return i;a=a.return}a.sibling.return=a.return,a=a.sibling}return i}function Sr(e,t){if(lo&&yr(e,t)){e=t.stateNode;var n=e.containerInfo,r=ts();xr(r,t,!1,!1),e.pendingChildren=r,vr(t),rs(n,r)}}function Cr(e,t,n,r){if(co)e.memoizedProps!==r&&vr(t);else if(lo){var i=e.stateNode,a=e.memoizedProps;if((e=yr(e,t))||a!==r){var o=qc.current;a=es(i,n,a,r,!e,null),a===i?t.stateNode=i:(U(t),to(a,n,r,o)&&vr(t),t.stateNode=a,e&&br(a,t,!1,!1))}else t.stateNode=i}}function wr(e,t,n,r,i){if(e.mode&32&&(n===null?yo(t,r):bo(t,n,r))){if(e.flags|=16777216,(i&335544128)===i||xo(t,r))if(So(e.stateNode,t,r))e.flags|=8192;else if(Fi())e.flags|=8192;else throw El=Tl,Cl}else e.flags&=-16777217}function Tr(e,t){if(ec(t)){if(e.flags|=16777216,!tc(t))if(Fi())e.flags|=8192;else throw El=Tl,Cl}else e.flags&=-16777217}function Er(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:b(),e.lanes|=t,Lu|=t)}function Dr(e,t){if(!$c)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Or(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function kr(e,t,n){var i=t.pendingProps;switch(ae(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Or(t),null;case 1:return Or(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ye(ll),ce(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(me(t)?vr(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ge())),Sr(e,t),Or(t),null;case 26:if(Us){var a=t.type,o=t.memoizedState;return e===null?(vr(t),o===null?(Or(t),wr(t,a,null,i,n)):(Or(t),Tr(t,o))):o?o===e.memoizedState?(Or(t),t.flags&=-16777217):(vr(t),Or(t),Tr(t,o)):(o=e.memoizedProps,co?o!==i&&vr(t):Cr(e,t,a,i),Or(t),wr(t,a,o,i,n)),null}case 27:if(rc){if(ue(t),n=Yc.current,a=t.type,e!==null&&t.stateNode!=null)co?e.memoizedProps!==i&&vr(t):Cr(e,t,a,i);else{if(!i){if(t.stateNode===null)throw Error(r(166));return Or(t),null}e=qc.current,me(t)?fe(t,e):(e=ic(a,i,n,e,!0),t.stateNode=e,vr(t))}return Or(t),null}case 5:if(ue(t),a=t.type,e!==null&&t.stateNode!=null)Cr(e,t,a,i);else{if(!i){if(t.stateNode===null)throw Error(r(166));return Or(t),null}if(o=qc.current,me(t))fe(t,o),Ps(t.stateNode,a,i,o)&&(t.flags|=64);else{var s=$a(a,i,Yc.current,o,t);U(t),br(s,t,!1,!1),t.stateNode=s,to(s,a,i,o)&&vr(t)}}return Or(t),wr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)n=e.memoizedProps,co?n!==i&&vr(t):lo&&(n===i?t.stateNode=e.stateNode:(e=Yc.current,n=qc.current,U(t),t.stateNode=ro(i,e,n,t)));else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(e=Yc.current,n=qc.current,me(t)){if(!uo)throw Error(r(176));if(e=t.stateNode,n=t.memoizedProps,i=null,a=Zc,a!==null)switch(a.tag){case 27:case 5:i=a.memoizedProps}Ts(e,n,t,i)||de(t,!0)}else U(t),t.stateNode=ro(i,e,n,t)}return Or(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=me(t),n!==null){if(e===null){if(!i)throw Error(r(318));if(!uo)throw Error(r(556));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(557));Es(e,t)}else he(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Or(t),e=!1}else n=ge(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(bt(t),t):(bt(t),null);if(t.flags&128)throw Error(r(558))}return Or(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=me(t),i!==null&&i.dehydrated!==null){if(e===null){if(!a)throw Error(r(318));if(!uo)throw Error(r(344));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(r(317));Ds(a,t)}else he(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Or(t),a=!1}else a=ge(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(bt(t),t):(bt(t),null)}return bt(t),t.flags&128?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,a=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(a=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==a&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Er(t,t.updateQueue),Or(t),null);case 4:return ce(),Sr(e,t),e===null&&po(t.stateNode.containerInfo),Or(t),null;case 10:return ye(t.type),Or(t),null;case 19:if(f(zl),i=t.memoizedState,i===null)return Or(t),null;if(a=(t.flags&128)!=0,o=i.rendering,o===null)if(a)Dr(i,!1);else{if(Mu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=xt(e),o!==null){for(t.flags|=128,Dr(i,!1),e=o.updateQueue,t.updateQueue=e,Er(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fa(n,e),n=n.sibling;return p(zl,zl.current&1|2),$c&&M(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Sc()>Uu&&(t.flags|=128,a=!0,Dr(i,!1),t.lanes=4194304)}else{if(!a)if(e=xt(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Er(t,e),Dr(i,!0),i.tail===null&&i.tailMode===`hidden`&&!o.alternate&&!$c)return Or(t),null}else 2*Sc()-i.renderingStartTime>Uu&&n!==536870912&&(t.flags|=128,a=!0,Dr(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(e=i.last,e===null?t.child=o:e.sibling=o,i.last=o)}return i.tail===null?(Or(t),null):(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Sc(),e.sibling=null,n=zl.current,p(zl,a?n&1|2:n&1),$c&&M(t,i.treeForkCount),e);case 22:case 23:return bt(t),ht(),i=t.memoizedState!==null,e===null?i&&(t.flags|=8192):e.memoizedState!==null!==i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(Or(t),t.subtreeFlags&6&&(t.flags|=8192)):Or(t),n=t.updateQueue,n!==null&&Er(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&f(xl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ye(ll),Or(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function Ar(e,t){switch(ae(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ye(ll),ce(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ue(t),null;case 31:if(t.memoizedState!==null){if(bt(t),t.alternate===null)throw Error(r(340));he()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(bt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));he()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return f(zl),null;case 4:return ce(),null;case 10:return ye(t.type),null;case 22:case 23:return bt(t),ht(),e!==null&&f(xl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ye(ll),null;case 25:return null;default:return null}}function jr(e,t){switch(ae(t),t.tag){case 3:ye(ll),ce();break;case 26:case 27:case 5:ue(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&bt(t);break;case 13:bt(t);break;case 19:f(zl);break;case 10:ye(t.type);break;case 22:case 23:bt(t),ht(),e!==null&&f(xl);break;case 24:ye(ll)}}function Mr(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){na(t,t.return,e)}}function Nr(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){na(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){na(t,t.return,e)}}function Pr(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ft(t,n)}catch(t){na(e,e.return,t)}}}function Fr(e,t,n){n.props=Vn(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){na(e,t,n)}}function Ir(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=Ja(e.stateNode);break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){na(e,t,n)}}function Lr(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){na(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){na(e,t,n)}else n.current=null}function Rr(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{Ho(r,t,n,e)}catch(t){na(e,e.return,t)}}function zr(e,t,n){try{Uo(e.stateNode,e.type,n,t,e)}catch(t){na(e,e.return,t)}}function Br(e){return e.tag===5||e.tag===3||(Us?e.tag===26:!1)||(rc?e.tag===27&&cc(e.type):!1)||e.tag===4}function Vr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Br(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(rc&&e.tag===27&&cc(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hr(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?Go(n,e,t):Bo(n,e);else if(r!==4&&(rc&&r===27&&cc(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Hr(e,t,n),e=e.sibling;e!==null;)Hr(e,t,n),e=e.sibling}function Ur(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?Wo(n,e,t):zo(n,e);else if(r!==4&&(rc&&r===27&&cc(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Ur(e,t,n),e=e.sibling;e!==null;)Ur(e,t,n),e=e.sibling}function W(e,t,n){e=e.containerInfo;try{is(e,n)}catch(e){na(t,t.return,e)}}function Wr(e){var t=e.stateNode,n=e.memoizedProps;try{ac(e.type,n,t,e)}catch(t){na(e,e.return,t)}}function Gr(e,t){for(Za(e.containerInfo),lu=t;lu!==null;)if(e=lu,t=e.child,e.subtreeFlags&1028&&t!==null)t.return=e,lu=t;else for(;lu!==null;){e=lu;var n=e.alternate;switch(t=e.flags,e.tag){case 0:if(t&4&&(t=e.updateQueue,t=t===null?null:t.events,t!==null))for(var i=0;i`;case gu:return`:has(`+(Si(e)||``)+`)`;case _u:return`[role="`+e.value+`"]`;case yu:return`"`+e.value+`"`;case vu:return`[data-testname="`+e.value+`"]`;default:throw Error(r(365))}}function Ci(e,t){var n=[];e=[e,0];for(var r=0;rn?32:n;n=J.T;var a=ho();try{mo(i),J.T=null,i=Xu,Xu=null;var o=Ku,s=Ju;if(X=0,qu=Ku=null,Ju=0,Su&6)throw Error(r(331));var c=Su;if(Su|=4,_i(o.current),ui(o,o.current,s,i),Su=c,Oe(0,!1),Ac&&typeof Ac.onPostCommitFiberRoot==`function`)try{Ac.onPostCommitFiberRoot(kc,o)}catch{}return!0}finally{mo(a),J.T=n,Qi(e,t)}}function ta(e,t,n){t=re(n,t),t=Hn(e.stateNode,t,2),e=ot(e,t,2),e!==null&&(S(e,2),De(e))}function na(e,t,n){if(e.tag===3)ta(e,e,n);else for(;t!==null;){if(t.tag===3){ta(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Gu===null||!Gu.has(r))){e=re(n,e),n=Un(2),r=ot(t,n,2),r!==null&&(Wn(n,r,t,e),S(r,2),De(r));break}}t=t.return}}function ra(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new xu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Au=!0,i.add(n),e=ia.bind(null,e,t,n),t.then(e,e))}function ia(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Cu===e&&(Tu&n)===n&&(Mu===4||Mu===3&&(Tu&62914560)===Tu&&300>Sc()-Vu?!(Su&2)&&Ni(e,0):Fu|=n,Lu===Tu&&(Lu=0)),De(e)}function aa(e,t){t===0&&(t=b()),e=et(e,t),e!==null&&(S(e,t),De(e))}function oa(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),aa(e,n)}function sa(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(r(314))}i!==null&&i.delete(t),aa(e,n)}function ca(e,t){return vc(e,t)}function la(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ua(e){return e=e.prototype,!(!e||!e.isReactComponent)}function da(e,n){var r=e.alternate;return r===null?(r=t(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function fa(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function pa(e,n,i,a,o,s){var c=0;if(a=e,typeof e==`function`)ua(e)&&(c=1);else if(typeof e==`string`)c=Us&&rc?Ws(e,i,qc.current)?26:sc(e)?27:5:Us?Ws(e,i,qc.current)?26:5:rc&&sc(e)?27:5;else e:switch(e){case Ba:return e=t(31,i,n,o),e.elementType=Ba,e.lanes=s,e;case q:return ma(i.children,o,s,n);case ja:c=8,o|=24;break;case Ma:return e=t(12,i,n,o|2),e.elementType=Ma,e.lanes=s,e;case Ia:return e=t(13,i,n,o),e.elementType=Ia,e.lanes=s,e;case La:return e=t(19,i,n,o),e.elementType=La,e.lanes=s,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case Pa:c=10;break e;case Na:c=9;break e;case Fa:c=11;break e;case Ra:c=14;break e;case za:c=16,a=null;break e}c=29,i=Error(r(130,e===null?`null`:typeof e,``)),a=null}return n=t(c,i,n,o),n.elementType=e,n.type=a,n.lanes=s,n}function ma(e,n,r,i){return e=t(7,e,i,n),e.lanes=r,e}function ha(e,n,r){return e=t(6,e,null,n),e.lanes=r,e}function ga(e){var n=t(18,null,null,0);return n.stateNode=e,n}function _a(e,n,r){return n=t(4,e.children===null?[]:e.children,e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function va(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=oo,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=x(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=x(0),this.hiddenUpdates=x(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ya(e,n,r,i,a,o,s,c,l,u,d,f){return e=new va(e,n,r,s,l,u,d,f,c),n=1,o===!0&&(n|=24),o=t(3,null,null,n),e.current=o,o.stateNode=e,n=we(),n.refCount++,e.pooledCache=n,n.refCount++,o.memoizedState={element:i,isDehydrated:r,cache:n},rt(o),e}function K(e){return e?(e=dc,e):dc}function ba(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=o(t),e=e===null?null:s(e),e===null?null:Ja(e.stateNode)}function xa(e,t,n,r,i,a){i=K(i),r.context===null?r.context=i:r.pendingContext=i,r=at(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=ot(e,r,t),n!==null&&(Ei(n,e,t),st(n,e,t))}function Sa(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n=u&&o>=f&&a<=d&&s<=p){e.splice(t,1);break}else if(i!==u||n.width!==l.width||ps){if(!(o!==f||n.height!==l.height||da)){u>i&&(l.width+=u-i,l.x=i),do&&(l.height+=f-o,l.y=o),pn&&(n=c)),c `)+` + +No matching component was found for: + `)+e.join(` > `)}return null},wa.getPublicRootInstance=function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 27:case 5:return Ja(e.child.stateNode);default:return e.child.stateNode}},wa.injectIntoDevTools=function(){var e={bundleType:0,version:Ga,rendererPackageName:Ka,currentDispatcherRef:J,reconcilerVersion:`19.2.0`};if(qa!==null&&(e.rendererConfig=qa),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{kc=t.inject(e),Ac=t}catch{}e=!!t.checkDCE}}return e},wa.isAlreadyRendering=function(){return(Su&6)!=0},wa.observeVisibleRects=function(e,t,n,i){if(!jo)throw Error(r(363));e=G(e,t);var a=Ro(e,n,i).disconnect;return{disconnect:function(){a()}}},wa.shouldError=function(){return null},wa.shouldSuspend=function(){return!1},wa.startHostTransition=function(e,t,i,a){if(e.tag!==5)throw Error(r(476));var o=En(e).queue;Tn(e,o,t,Eo,i===null?n:function(){var t=En(e);return t.next===null&&(t=e.alternate.memoizedState),Nn(e,t.next.queue,{},wi()),i(a)})},wa.updateContainer=function(e,t,n,r){var i=t.current,a=wi();return xa(i,a,e,t,n,r),a},wa.updateContainerSync=function(e,t,n,r){return xa(t.current,2,e,t,n,r),2},wa},e.exports.default=e.exports,Object.defineProperty(e.exports,"__esModule",{value:!0})}(wv)),wv.exports}({exports:{}}).exports;var Dv;function Ov(){return Dv||(Dv=1,Cv.exports=Ev()),Cv.exports}var kv=Sv(Ov());function Av(e){let t=kv(e);return t.injectIntoDevTools(),t}var jv=0,Mv={},Nv=/^three(?=[A-Z])/,Pv=e=>`${e[0].toUpperCase()}${e.slice(1)}`,Fv=0,Iv=e=>typeof e==`function`;function Lv(e){if(Iv(e)){let t=`${Fv++}`;return Mv[t]=e,t}else Object.assign(Mv,e)}function Rv(e,t){let n=Pv(e),r=Mv[n];if(e!==`primitive`&&!r)throw Error(`R3F: ${n} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(e===`primitive`&&!t.object)throw Error(`R3F: Primitives without 'object' are invalid!`);if(t.args!==void 0&&!Array.isArray(t.args))throw Error(`R3F: The args prop must be an array!`)}function zv(e,t,n){var r;return e=Pv(e)in Mv?e:e.replace(Nv,``),Rv(e,t),e===`primitive`&&(r=t.object)!=null&&r.__r3f&&delete t.object.__r3f,V_(t.object,n,e,t)}function Bv(e){if(!e.isHidden){var t;e.props.attach&&(t=e.parent)!=null&&t.object?G_(e.parent,e):tv(e.object)&&(e.object.visible=!1),e.isHidden=!0,$_(e)}}function Vv(e){if(e.isHidden){var t;e.props.attach&&(t=e.parent)!=null&&t.object?W_(e.parent,e):tv(e.object)&&e.props.visible!==!1&&(e.object.visible=!0),e.isHidden=!1,$_(e)}}function Hv(e,t,n){let r=t.root.getState();if(!(!e.parent&&e.object!==r.scene)){if(!t.object){let e=Mv[Pv(t.type)];t.object=t.props.object??new e(...t.props.args??[]),t.object.__r3f=t}if(Q_(t.object,t.props),t.props.attach)W_(e,t);else if(tv(t.object)&&tv(e.object)){let r=e.object.children.indexOf(n?.object);if(n&&r!==-1){let n=e.object.children.indexOf(t.object);if(n!==-1){e.object.children.splice(n,1);let i=n{try{e.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<`u`?t():(0,h_.unstable_scheduleCallback)(h_.unstable_IdlePriority,t)}}function Kv(e,t,n){if(!t)return;t.parent=null;let r=e.children.indexOf(t);r!==-1&&e.children.splice(r,1),t.props.attach?G_(e,t):tv(t.object)&&tv(e.object)&&(e.object.remove(t.object),av(T_(t),t.object));let i=t.props.dispose!==null&&n!==!1;for(let e=t.children.length-1;e>=0;e--){let n=t.children[e];Kv(t,n,i)}t.children.length=0,delete t.object.__r3f,i&&t.type!==`primitive`&&t.object.type!==`Scene`&&Gv(t.object),n===void 0&&$_(t)}function qv(e,t){for(let n of[e,e.alternate])if(n!==null)if(typeof n.ref==`function`){n.refCleanup==null||n.refCleanup();let e=n.ref(t);typeof e==`function`&&(n.refCleanup=e)}else n.ref&&(n.ref.current=t)}var Jv=[];function Yv(){for(let[e]of Jv){let t=e.parent;if(t){e.props.attach?G_(t,e):tv(e.object)&&tv(t.object)&&t.object.remove(e.object);for(let t of e.children)t.props.attach?G_(e,t):tv(t.object)&&tv(e.object)&&e.object.remove(t.object)}e.isHidden&&Vv(e),e.object.__r3f&&delete e.object.__r3f,e.type!==`primitive`&&Gv(e.object)}for(let[e,t,n]of Jv){e.props=t;let r=e.parent;if(r){let t=Mv[Pv(e.type)],i=e.object;e.object=e.props.object??new t(...e.props.args??[]),e.object.__r3f=e,qv(n,e.object),iv(T_(e),i,e.object),Q_(e.object,e.props),e.props.attach?W_(r,e):tv(e.object)&&tv(r.object)&&r.object.add(e.object);for(let t of e.children)t.props.attach?W_(e,t):tv(t.object)&&tv(e.object)&&e.object.add(t.object);$_(e)}}Jv.length=0}var Xv=()=>{},Zv={},Qv=jv,$v=0,ey=4,ty=Av({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:zv,removeChild:Kv,appendChild:Uv,appendInitialChild:Uv,insertBefore:Wv,appendChildToContainer(e,t){let n=e.getState().scene.__r3f;!t||!n||Uv(n,t)},removeChildFromContainer(e,t){let n=e.getState().scene.__r3f;!t||!n||Kv(n,t)},insertInContainerBefore(e,t,n){let r=e.getState().scene.__r3f;!t||!n||!r||Wv(r,t,n)},getRootHostContext:()=>Zv,getChildHostContext:()=>Zv,commitUpdate(e,t,n,r,i){var a;Rv(t,r);let o=!1;if(e.type===`primitive`&&n.object!==r.object?o=!0:r.args?.length===n.args?.length?(a=r.args)!=null&&a.some((e,t)=>e!==n.args?.[t])&&(o=!0):o=!0,o)Jv.push([e,{...r},i]);else{let t=Y_(e,r);Object.keys(t).length&&(Object.assign(e.props,t),Q_(e.object,t))}(i.sibling===null||(i.flags&ey)===$v)&&Yv()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:e=>e?.object,prepareForCommit:()=>null,preparePortalMount:e=>V_(e.getState().scene,e,``,{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:Bv,unhideInstance:Vv,createTextInstance:Xv,hideTextInstance:Xv,unhideTextInstance:Xv,scheduleTimeout:typeof setTimeout==`function`?setTimeout:void 0,cancelTimeout:typeof clearTimeout==`function`?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:v.createContext(null),setCurrentUpdatePriority(e){Qv=e},getCurrentUpdatePriority(){return Qv},resolveUpdatePriority(){if(Qv!==jv)return Qv;switch(typeof window<`u`&&window.event?.type){case`click`:case`contextmenu`:case`dblclick`:case`pointercancel`:case`pointerdown`:case`pointerup`:return bv;case`pointermove`:case`pointerout`:case`pointerover`:case`pointerenter`:case`pointerleave`:case`wheel`:return vv;default:return yv}},resetFormInstance(){},rendererPackageName:`@react-three/fiber`,rendererVersion:xv.version,applyViewTransitionName(e,t,n){},restoreViewTransitionName(e,t){},cancelViewTransitionName(e,t,n){},cancelRootViewTransitionName(e){},restoreRootViewTransitionName(e){},InstanceMeasurement:null,measureInstance:e=>null,wasInstanceInViewport:e=>!0,hasInstanceChanged:(e,t)=>!1,hasInstanceAffectedParent:(e,t)=>!1,suspendOnActiveViewTransition(e,t){},startGestureTransition:()=>null,startViewTransition:()=>null,stopViewTransition(e){},createViewTransitionInstance:e=>null,getCurrentGestureOffset(e){throw Error(`startGestureTransition is not yet supported in react-three-fiber.`)},cloneMutableInstance(e,t){return e},cloneMutableTextInstance(e){return e},cloneRootViewTransitionContainer(e){throw Error(`Not implemented.`)},removeRootViewTransitionClone(e,t){throw Error(`Not implemented.`)},createFragmentInstance:e=>null,updateFragmentInstanceFiber(e,t){},commitNewChildToFragmentInstance(e,t){},deleteChildFromFragmentInstance(e,t){},measureClonedInstance:e=>null,maySuspendCommitOnUpdate:(e,t,n)=>!1,maySuspendCommitInSyncRender:(e,t)=>!1,startSuspendingCommit:()=>null,getSuspendedCommitReason:(e,t)=>null}),ny=new Map,ry={objects:`shallow`,strict:!1};function iy(e,t){if(!t&&typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement&&e.parentElement){let{width:t,height:n,top:r,left:i}=e.parentElement.getBoundingClientRect();return{width:t,height:n,top:r,left:i}}else if(!t&&typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas)return{width:e.width,height:e.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...t}}function ay(e){let t=ny.get(e),n=t?.fiber,r=t?.store;t&&console.warn(`R3F.createRoot should only be called once!`);let i=typeof reportError==`function`?reportError:console.error,a=r||lv(wy,Ty),o=n||ty.createContainer(a,_v,null,!1,null,``,i,i,i,null);t||ny.set(e,{fiber:o,store:a});let s,c,l=!1,u=null;return{async configure(t={}){let n;u=new Promise(e=>n=e);let{gl:r,size:i,scene:o,events:d,onCreated:f,shadows:p=!1,linear:m=!1,flat:h=!1,legacy:g=!1,orthographic:_=!1,frameloop:v=`always`,dpr:y=[1,2],performance:b,raycaster:x,camera:S,onPointerMissed:C}=t,w=a.getState(),T=w.gl;if(!w.gl){let t={canvas:e,powerPreference:`high-performance`,antialias:!0,alpha:!0},n=typeof r==`function`?await r(t):r;T=sv(n)?n:new Jg({...t,...r}),w.set({gl:T})}let E=w.raycaster;E||w.set({raycaster:E=new kf});let{params:D,...O}=x||{};if(I_.equ(O,E,ry)||Q_(E,{...O}),I_.equ(D,E.params,ry)||Q_(E,{params:{...E.params,...D}}),!w.camera||w.camera===c&&!I_.equ(c,S,ry)){c=S;let e=S?.isCamera,t=e?S:_?new md(0,0,0,0,.1,1e3):new ld(75,0,.1,1e3);e||(t.position.z=5,S&&(Q_(t,S),t.manual||(`aspect`in S||`left`in S||`right`in S||`bottom`in S||`top`in S)&&(t.manual=!0,t.updateProjectionMatrix())),!w.camera&&!(S!=null&&S.rotation)&&t.lookAt(0,0,0)),w.set({camera:t}),E.camera=t}if(!w.scene){let e;o!=null&&o.isScene?(e=o,V_(e,a,``,{})):(e=new Di,V_(e,a,``,{}),o&&Q_(e,o)),w.set({scene:e})}d&&!w.events.handlers&&w.set({events:d(a)});let k=iy(e,i);if(I_.equ(k,w.size,ry)||w.setSize(k.width,k.height,k.top,k.left),y&&w.viewport.dpr!==P_(y)&&w.setDpr(y),w.frameloop!==v&&w.setFrameloop(v),w.onPointerMissed||w.set({onPointerMissed:C}),b&&!I_.equ(b,w.performance,ry)&&w.set(e=>({performance:{...e.performance,...b}})),!w.xr){let e=(e,t)=>{let n=a.getState();n.frameloop!==`never`&&Ty(e,!0,n,t)},t=()=>{let t=a.getState();t.gl.xr.enabled=t.gl.xr.isPresenting,t.gl.xr.setAnimationLoop(t.gl.xr.isPresenting?e:null),t.gl.xr.isPresenting||wy(t)},n={connect(){let e=a.getState().gl;e.xr.addEventListener(`sessionstart`,t),e.xr.addEventListener(`sessionend`,t)},disconnect(){let e=a.getState().gl;e.xr.removeEventListener(`sessionstart`,t),e.xr.removeEventListener(`sessionend`,t)}};typeof T.xr?.addEventListener==`function`&&n.connect(),w.set({xr:n})}if(T.shadowMap){let e=T.shadowMap.enabled,t=T.shadowMap.type;if(T.shadowMap.enabled=!!p,I_.boo(p))T.shadowMap.type=2;else if(I_.str(p)){let e={basic:0,percentage:1,soft:2,variance:3};T.shadowMap.type=e[p]??2}else I_.obj(p)&&Object.assign(T.shadowMap,p);(e!==T.shadowMap.enabled||t!==T.shadowMap.type)&&(T.shadowMap.needsUpdate=!0)}return Er.enabled=!g,l||(T.outputColorSpace=m?rn:nn,T.toneMapping=h?0:4),w.legacy!==g&&w.set(()=>({legacy:g})),w.linear!==m&&w.set(()=>({linear:m})),w.flat!==h&&w.set(()=>({flat:h})),r&&!I_.fun(r)&&!sv(r)&&!I_.equ(r,T,ry)&&Q_(T,r),s=f,l=!0,n(),this},render(t){return!l&&!u&&this.configure(),u.then(()=>{ty.updateContainer((0,Q.jsx)(oy,{store:a,children:t,onCreated:s,rootElement:e}),o,null,()=>void 0)}),a},unmount(){sy(e)}}}function oy({store:e,children:t,onCreated:n,rootElement:r}){return k_(()=>{let t=e.getState();t.set(e=>({internal:{...e.internal,active:!0}})),n&&n(t),e.getState().events.connected||t.events.connect==null||t.events.connect(r)},[]),(0,Q.jsx)(cv.Provider,{value:e,children:t})}function sy(e,t){let n=ny.get(e),r=n?.fiber;if(r){let i=n?.store.getState();i&&(i.internal.active=!1),ty.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var n,r,a,o;i.events.disconnect==null||i.events.disconnect(),(n=i.gl)==null||(r=n.renderLists)==null||r.dispose==null||r.dispose(),(a=i.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(o=i.gl)!=null&&o.xr&&i.xr.disconnect(),R_(i.scene),ny.delete(e),t&&t(e)}catch{}},500)})}}function cy(e,t,n){return(0,Q.jsx)(ly,{children:e,container:t,state:n})}function ly({state:e={},children:t,container:n}){let{events:r,size:i,...a}=e,o=uv(),[s]=v.useState(()=>new kf),[c]=v.useState(()=>new H),l=A_((e,t)=>{let a;if(t.camera&&i){let n=t.camera;a=e.viewport.getCurrentViewport(n,new U,i),n!==e.camera&&ev(n,i)}return{...e,...t,scene:n,raycaster:s,pointer:c,mouse:c,previousRoot:o,events:{...e.events,...t.events,...r},size:{...e.size,...i},viewport:{...e.viewport,...a},setEvents:e=>t.set(t=>({...t,events:{...t.events,...e}}))}}),u=v.useMemo(()=>{let e=a_((e,t)=>({...a,set:e,get:t})),t=t=>e.setState(e=>l.current(t,e));return t(o.getState()),o.subscribe(t),e},[o,n]);return(0,Q.jsx)(Q.Fragment,{children:ty.createPortal((0,Q.jsx)(cv.Provider,{value:u,children:t}),u,null)})}var uy=new Set,dy=new Set,fy=new Set;function py(e,t){if(e.size)for(let{callback:n}of e.values())n(t)}function my(e,t){switch(e){case`before`:return py(uy,t);case`after`:return py(dy,t);case`tail`:return py(fy,t)}}var hy,gy;function _y(e,t,n){let r=t.clock.getDelta();t.frameloop===`never`&&typeof e==`number`&&(r=e-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=e),hy=t.internal.subscribers;for(let e=0;e0)&&!((t=Sy.gl.xr)!=null&&t.isPresenting)&&(by+=_y(e,Sy))}if(yy=!1,my(`after`,e),by===0)return my(`tail`,e),vy=!1,cancelAnimationFrame(xy)}function wy(e,t=1){var n;if(!e)return ny.forEach(e=>wy(e.store.getState(),t));(n=e.gl.xr)!=null&&n.isPresenting||!e.internal.active||e.frameloop===`never`||(t>1?e.internal.frames=Math.min(60,e.internal.frames+t):yy?e.internal.frames=2:e.internal.frames=1,vy||(vy=!0,requestAnimationFrame(Cy)))}function Ty(e,t=!0,n,r){if(t&&my(`before`,e),n)_y(e,n,r);else for(let t of ny.values())_y(e,t.store.getState());t&&my(`after`,e)}var Ey={onClick:[`click`,!1],onContextMenu:[`contextmenu`,!1],onDoubleClick:[`dblclick`,!1],onWheel:[`wheel`,!0],onPointerDown:[`pointerdown`,!0],onPointerUp:[`pointerup`,!0],onPointerLeave:[`pointerleave`,!0],onPointerMove:[`pointermove`,!0],onPointerCancel:[`pointercancel`,!0],onLostPointerCapture:[`lostpointercapture`,!0]};function Dy(e){let{handlePointer:t}=ov(e);return{priority:1,enabled:!0,compute(e,t,n){t.pointer.set(e.offsetX/t.size.width*2-1,-(e.offsetY/t.size.height)*2+1),t.raycaster.setFromCamera(t.pointer,t.camera)},connected:void 0,handlers:Object.keys(Ey).reduce((e,n)=>({...e,[n]:t(n)}),{}),update:()=>{var t;let{events:n,internal:r}=e.getState();(t=r.lastEvent)!=null&&t.current&&n.handlers&&n.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{let{set:n,events:r}=e.getState();if(r.disconnect==null||r.disconnect(),n(e=>({events:{...e.events,connected:t}})),r.handlers)for(let e in r.handlers){let n=r.handlers[e],[i,a]=Ey[e];t.addEventListener(i,n,{passive:a})}},disconnect:()=>{let{set:t,events:n}=e.getState();if(n.connected){if(n.handlers)for(let e in n.handlers){let t=n.handlers[e],[r]=Ey[e];n.connected.removeEventListener(r,t)}t(e=>({events:{...e.events,connected:void 0}}))}}}}function Oy(e,t){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function ky({debounce:e,scroll:t,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){let i=n||(typeof window>`u`?class{}:window.ResizeObserver);if(!i)throw Error(`This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills`);let[a,o]=(0,v.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),s=(0,v.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a,orientationHandler:null}),c=e?typeof e==`number`?e:e.scroll:null,l=e?typeof e==`number`?e:e.resize:null,u=(0,v.useRef)(!1);(0,v.useEffect)(()=>(u.current=!0,()=>void(u.current=!1)));let[d,f,p]=(0,v.useMemo)(()=>{let e=()=>{if(!s.current.element)return;let{left:e,top:t,width:n,height:i,bottom:a,right:c,x:l,y:d}=s.current.element.getBoundingClientRect(),f={left:e,top:t,width:n,height:i,bottom:a,right:c,x:l,y:d};s.current.element instanceof HTMLElement&&r&&(f.height=s.current.element.offsetHeight,f.width=s.current.element.offsetWidth),Object.freeze(f),u.current&&!Py(s.current.lastBounds,f)&&o(s.current.lastBounds=f)};return[e,l?Oy(e,l):e,c?Oy(e,c):e]},[o,r,c,l]);function m(){s.current.scrollContainers&&(s.current.scrollContainers.forEach(e=>e.removeEventListener(`scroll`,p,!0)),s.current.scrollContainers=null),s.current.resizeObserver&&(s.current.resizeObserver.disconnect(),s.current.resizeObserver=null),s.current.orientationHandler&&(`orientation`in screen&&`removeEventListener`in screen.orientation?screen.orientation.removeEventListener(`change`,s.current.orientationHandler):`onorientationchange`in window&&window.removeEventListener(`orientationchange`,s.current.orientationHandler))}function h(){s.current.element&&(s.current.resizeObserver=new i(p),s.current.resizeObserver.observe(s.current.element),t&&s.current.scrollContainers&&s.current.scrollContainers.forEach(e=>e.addEventListener(`scroll`,p,{capture:!0,passive:!0})),s.current.orientationHandler=()=>{p()},`orientation`in screen&&`addEventListener`in screen.orientation?screen.orientation.addEventListener(`change`,s.current.orientationHandler):`onorientationchange`in window&&window.addEventListener(`orientationchange`,s.current.orientationHandler))}return jy(p,!!t),Ay(f),(0,v.useEffect)(()=>{m(),h()},[t,p,f]),(0,v.useEffect)(()=>m,[]),[e=>{!e||e===s.current.element||(m(),s.current.element=e,s.current.scrollContainers=My(e),h())},a,d]}function Ay(e){(0,v.useEffect)(()=>{let t=e;return window.addEventListener(`resize`,t),()=>void window.removeEventListener(`resize`,t)},[e])}function jy(e,t){(0,v.useEffect)(()=>{if(t){let t=e;return window.addEventListener(`scroll`,t,{capture:!0,passive:!0}),()=>void window.removeEventListener(`scroll`,t,!0)}},[e,t])}function My(e){let t=[];if(!e||e===document.body)return t;let{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(e);return[n,r,i].some(e=>e===`auto`||e===`scroll`)&&t.push(e),[...t,...My(e.parentElement)]}var Ny=[`x`,`y`,`top`,`bottom`,`left`,`right`,`width`,`height`],Py=(e,t)=>Ny.every(n=>e[n]===t[n]);function Fy({ref:e,children:t,fallback:n,resize:r,style:i,gl:a,events:o=Dy,eventSource:s,eventPrefix:c,shadows:l,linear:u,flat:d,legacy:f,orthographic:p,frameloop:m,dpr:h,performance:g,raycaster:_,camera:y,scene:b,onPointerMissed:x,onCreated:S,...C}){v.useMemo(()=>Lv(jp),[]);let w=j_(),[T,E]=ky({scroll:!0,debounce:{scroll:50,resize:0},...r}),D=v.useRef(null),O=v.useRef(null);v.useImperativeHandle(e,()=>D.current);let k=A_(x),[A,ee]=v.useState(!1),[te,j]=v.useState(!1);if(A)throw A;if(te)throw te;let ne=v.useRef(null);return k_(()=>{let e=D.current;if(E.width>0&&E.height>0&&e){ne.current||=ay(e);async function n(){await ne.current.configure({gl:a,scene:b,events:o,shadows:l,linear:u,flat:d,legacy:f,orthographic:p,frameloop:m,dpr:h,performance:g,raycaster:_,camera:y,size:E,onPointerMissed:(...e)=>k.current==null?void 0:k.current(...e),onCreated:e=>{e.events.connect==null||e.events.connect(s?D_(s)?s.current:s:O.current),c&&e.setEvents({compute:(e,t)=>{let n=e[c+`X`],r=e[c+`Y`];t.pointer.set(n/t.size.width*2-1,-(r/t.size.height)*2+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),S?.(e)}}),ne.current.render((0,Q.jsx)(w,{children:(0,Q.jsx)(N_,{set:j,children:(0,Q.jsx)(v.Suspense,{fallback:(0,Q.jsx)(M_,{set:ee}),children:t??null})})}))}n()}}),v.useEffect(()=>{let e=D.current;if(e)return()=>sy(e)},[]),(0,Q.jsx)(`div`,{ref:O,style:{position:`relative`,width:`100%`,height:`100%`,overflow:`hidden`,pointerEvents:s?`none`:`auto`,...i},...C,children:(0,Q.jsx)(`div`,{ref:T,style:{width:`100%`,height:`100%`},children:(0,Q.jsx)(`canvas`,{ref:D,style:{display:`block`},children:n})})})}function Iy(e){return(0,Q.jsx)(y_,{children:(0,Q.jsx)(Fy,{...e})})}var Ly=(()=>{let e=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),t=new Float32Array([0,0,2,0,0,2]),n=new q;return n.setAttribute(`position`,new da(e,3)),n.setAttribute(`uv`,new da(t,2)),n})(),Ry=class e{static get fullscreenGeometry(){return Ly}constructor(e=`Pass`,t=new Di,n=new md){this.name=e,this.renderer=null,this.scene=t,this.camera=n,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthBlit=!1,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){let t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen===null?null:this.screen.material}set fullscreenMaterial(t){let n=this.screen;n===null?(n=new xo(e.fullscreenGeometry,t),n.frustumCulled=!1,this.scene===null&&(this.scene=new Di),this.scene.add(n),this.screen=n):n.material=t}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=Qt){}render(e,t,n,r,i){throw Error(`Render method not implemented!`)}setSize(e,t){}initialize(e,t,n){}dispose(){for(let t of Object.keys(this)){let n=this[t];(n instanceof zr||n instanceof Fa||n instanceof Ir||n instanceof e)&&this[t].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},zy=class extends Ry{constructor(){super(`ClearMaskPass`,null,null),this.needsSwap=!1}render(e,t,n,r,i){let a=e.state.buffers.stencil;a.setLocked(!1),a.setTest(!1)}},By=`#ifdef COLOR_WRITE +#include +#include +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#endif +#ifdef DEPTH_WRITE +#include +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +return unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +return texture2D(depthBuffer,uv).r; +#endif +} +#endif +#ifdef USE_WEIGHTS +uniform vec4 channelWeights; +#endif +uniform float opacity;varying vec2 vUv;void main(){ +#ifdef COLOR_WRITE +vec4 texel=texture2D(inputBuffer,vUv); +#ifdef USE_WEIGHTS +texel*=channelWeights; +#endif +gl_FragColor=opacity*texel; +#ifdef COLOR_SPACE_CONVERSION +#include +#endif +#include +#else +gl_FragColor=vec4(0.0); +#endif +#ifdef DEPTH_WRITE +gl_FragDepth=readDepth(vUv); +#endif +}`,Vy=`varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}`,Hy=class extends tu{constructor(){super({name:`CopyMaterial`,defines:{COLOR_SPACE_CONVERSION:`1`,DEPTH_PACKING:`0`,COLOR_WRITE:`1`},uniforms:{inputBuffer:new Cf(null),depthBuffer:new Cf(null),channelWeights:new Cf(null),opacity:new Cf(1)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:By,vertexShader:Vy}),this.depthFunc=1}get inputBuffer(){return this.uniforms.inputBuffer.value}set inputBuffer(e){let t=e!==null;this.colorWrite!==t&&(t?this.defines.COLOR_WRITE=!0:delete this.defines.COLOR_WRITE,this.colorWrite=t,this.needsUpdate=!0),this.uniforms.inputBuffer.value=e}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){let t=e!==null;this.depthWrite!==t&&(t?this.defines.DEPTH_WRITE=!0:delete this.defines.DEPTH_WRITE,this.depthTest=t,this.depthWrite=t,this.needsUpdate=!0),this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}get colorSpaceConversion(){return this.defines.COLOR_SPACE_CONVERSION!==void 0}set colorSpaceConversion(e){this.colorSpaceConversion!==e&&(e?this.defines.COLOR_SPACE_CONVERSION=!0:delete this.defines.COLOR_SPACE_CONVERSION,this.needsUpdate=!0)}get channelWeights(){return this.uniforms.channelWeights.value}set channelWeights(e){e===null?delete this.defines.USE_WEIGHTS:(this.defines.USE_WEIGHTS=`1`,this.uniforms.channelWeights.value=e),this.needsUpdate=!0}setInputBuffer(e){this.uniforms.inputBuffer.value=e}getOpacity(e){return this.uniforms.opacity.value}setOpacity(e){this.uniforms.opacity.value=e}},Uy=class extends Ry{constructor(e,t=!0){super(`CopyPass`),this.fullscreenMaterial=new Hy,this.needsSwap=!1,this.renderTarget=e,e===void 0&&(this.renderTarget=new zr(1,1,{minFilter:Ae,magFilter:Ae,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name=`CopyPass.Target`),this.autoResize=t}get resize(){return this.autoResize}set resize(e){this.autoResize=e}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(e){this.autoResize=e}render(e,t,n,r,i){this.fullscreenMaterial.inputBuffer=t.texture,e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){this.autoResize&&this.renderTarget.setSize(e,t)}initialize(e,t,n){n!==void 0&&(this.renderTarget.texture.type=n,n===1009?e!==null&&e.outputColorSpace===`srgb`&&(this.renderTarget.texture.colorSpace=nn):this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH=`1`)}},Wy=new G,Gy=class extends Ry{constructor(e=!0,t=!0,n=!1){super(`ClearPass`,null,null),this.needsSwap=!1,this.color=e,this.depth=t,this.stencil=n,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(e,t,n){this.color=e,this.depth=t,this.stencil=n}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(e){this.overrideClearColor=e}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(e){this.overrideClearAlpha=e}render(e,t,n,r,i){let a=this.overrideClearColor,o=this.overrideClearAlpha,s=e.getClearAlpha(),c=a!==null,l=o>=0;c?(e.getClearColor(Wy),e.setClearColor(a,l?o:s)):l&&e.setClearAlpha(o),e.setRenderTarget(this.renderToScreen?null:t),e.clear(this.color,this.depth,this.stencil),c?e.setClearColor(Wy,s):l&&e.setClearAlpha(s)}},Ky=class extends Ry{constructor(e,t){super(`MaskPass`,e,t),this.needsSwap=!1,this.clearPass=new Gy(!1,!1,!0),this.inverse=!1}set mainScene(e){this.scene=e}set mainCamera(e){this.camera=e}get inverted(){return this.inverse}set inverted(e){this.inverse=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(e){this.inverted=e}render(e,t,n,r,i){let a=e.getContext(),o=e.state.buffers,s=this.scene,c=this.camera,l=this.clearPass,u=+!this.inverted,d=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(a.REPLACE,a.REPLACE,a.REPLACE),o.stencil.setFunc(a.ALWAYS,u,4294967295),o.stencil.setClear(d),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?l.render(e,null):(l.render(e,t),l.render(e,n))),this.renderToScreen?(e.setRenderTarget(null),e.render(s,c)):(e.setRenderTarget(t),e.render(s,c),e.setRenderTarget(n),e.render(s,c)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(a.EQUAL,1,4294967295),o.stencil.setOp(a.KEEP,a.KEEP,a.KEEP),o.stencil.setLocked(!0)}},qy=1/1e3,Jy=1e3,Yy=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(e){typeof document<`u`&&document.hidden!==void 0&&(e?document.addEventListener(`visibilitychange`,this):document.removeEventListener(`visibilitychange`,this),this._autoReset=e)}get delta(){return this._delta*qy}get fixedDelta(){return this._fixedDelta*qy}set fixedDelta(e){this._fixedDelta=e*Jy}get elapsed(){return this._elapsed*qy}update(e){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(e===void 0?performance.now():e)-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(e){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},Xy=class{constructor(e=null,{depthBuffer:t=!0,stencilBuffer:n=!1,multisampling:r=0,frameBufferType:i}={}){this.renderer=null,this.inputBuffer=this.createBuffer(t,n,i,r),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new Uy,this.depthTexture=null,this.depthRenderTarget=null,this.passes=[],this.timer=new Yy,this.autoRenderToScreen=!0,this.setRenderer(e)}get multisampling(){return this.inputBuffer.samples}set multisampling(e){let t=this.inputBuffer,n=this.multisampling;n>0&&e>0?(this.inputBuffer.samples=e,this.outputBuffer.samples=e,this.inputBuffer.dispose(),this.outputBuffer.dispose()):n!==e&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(t.depthBuffer,t.stencilBuffer,t.texture.type,e),this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(e){if(this.renderer=e,e!==null){let t=e.getSize(new H),n=e.getContext().getContextAttributes().alpha,r=this.inputBuffer.texture.type;r===1009&&e.outputColorSpace===`srgb`&&(this.inputBuffer.texture.colorSpace=nn,this.outputBuffer.texture.colorSpace=nn,this.inputBuffer.dispose(),this.outputBuffer.dispose()),e.autoClear=!1,this.setSize(t.width,t.height);for(let t of this.passes)t.initialize(e,n,r)}}replaceRenderer(e,t=!0){let n=this.renderer,r=n.domElement.parentNode;return this.setRenderer(e),t&&r!==null&&(r.removeChild(n.domElement),r.appendChild(e.domElement)),n}createDepthTexture(){let e=this.inputBuffer,t=new ec;this.depthTexture=t,e.stencilBuffer?(t.format=Ze,t.type=We):t.type=Be;let n=t.clone();return n.name=`EffectComposer.StableDepth`,this.depthRenderTarget=new zr(e.width,e.height,{depthBuffer:!0,stencilBuffer:e.stencilBuffer,depthTexture:n}),n}blitDepthBuffer(e){let t=this.renderer,n=this.depthRenderTarget,r=t.properties,i=t.getContext();t.setRenderTarget(n);let a=r.get(e).__webglFramebuffer,o=r.get(n).__webglFramebuffer,s=e.stencilBuffer?i.DEPTH_BUFFER_BIT|i.STENCIL_BUFFER_BIT:i.DEPTH_BUFFER_BIT;i.bindFramebuffer(i.READ_FRAMEBUFFER,a),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,o),i.blitFramebuffer(0,0,e.width,e.height,0,0,n.width,n.height,s,i.NEAREST),i.bindFramebuffer(i.READ_FRAMEBUFFER,null),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),t.setRenderTarget(null)}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.depthRenderTarget.dispose(),this.depthRenderTarget=null,this.inputBuffer.depthTexture=null,this.outputBuffer.depthTexture=null;for(let e of this.passes)e.setDepthTexture(null)}}createBuffer(e,t,n,r){let i=this.renderer,a=i===null?new H:i.getDrawingBufferSize(new H),o={minFilter:Ae,magFilter:Ae,stencilBuffer:t,depthBuffer:e,type:n},s=new zr(a.width,a.height,o);return r>0&&(s.samples=r),n===1009&&i!==null&&i.outputColorSpace===`srgb`&&(s.texture.colorSpace=nn),s.texture.name=`EffectComposer.Buffer`,s.texture.generateMipmaps=!1,s}setMainScene(e){for(let t of this.passes)t.mainScene=e}setMainCamera(e){for(let t of this.passes)t.mainCamera=e}addPass(e,t){let n=this.passes,r=this.renderer,i=r.getDrawingBufferSize(new H),a=r.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(e.renderer=r,e.setSize(i.width,i.height),e.initialize(r,a,o),this.autoRenderToScreen&&(n.length>0&&(n[n.length-1].renderToScreen=!1),e.renderToScreen&&(this.autoRenderToScreen=!1)),t===void 0?n.push(e):n.splice(t,0,e),this.autoRenderToScreen&&(n[n.length-1].renderToScreen=!0),e.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let t=this.createDepthTexture();for(e of n)e.setDepthTexture(t)}else{let t=this.depthRenderTarget.depthTexture;e.setDepthTexture(t)}}removePass(e){let t=this.passes,n=t.indexOf(e);if(n!==-1&&t.splice(n,1).length>0){if(this.depthTexture!==null&&!t.reduce((e,t)=>e||t.needsDepthTexture,!1)){let t=this.depthRenderTarget.depthTexture;e.getDepthTexture()===t&&e.setDepthTexture(null),this.deleteDepthTexture()}this.autoRenderToScreen&&n===t.length&&(e.renderToScreen=!1,t.length>0&&(t[t.length-1].renderToScreen=!0))}}removeAllPasses(){let e=this.passes;this.deleteDepthTexture(),e.length>0&&(this.autoRenderToScreen&&(e[e.length-1].renderToScreen=!1),this.passes=[])}render(e){let t=this.renderer,n=this.copyPass,r=this.inputBuffer,i=this.outputBuffer,a,o=!1;e===void 0&&(this.timer.update(),e=this.timer.getDelta());for(let s of this.passes)if(s.enabled){if(r.depthTexture=this.depthTexture,i.depthTexture=null,s.render(t,r,i,e,o),s.needsDepthBlit&&this.depthRenderTarget!==null&&this.blitDepthBuffer(r),s.needsSwap){if(o){n.renderToScreen=s.renderToScreen;let a=t.getContext(),c=t.state.buffers.stencil;c.setFunc(a.NOTEQUAL,1,4294967295),n.render(t,r,i,e,o),c.setFunc(a.EQUAL,1,4294967295)}a=r,r=i,i=a}s instanceof Ky?o=!0:s instanceof zy&&(o=!1)}}setSize(e,t,n){let r=this.renderer,i=r.getSize(new H);(e===void 0||t===void 0)&&(e=i.width,t=i.height),(i.width!==e||i.height!==t)&&r.setSize(e,t,n);let a=r.getDrawingBufferSize(new H);this.inputBuffer.setSize(a.width,a.height),this.outputBuffer.setSize(a.width,a.height),this.depthRenderTarget!==null&&this.depthRenderTarget.setSize(a.width,a.height);for(let e of this.passes)e.setSize(a.width,a.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let e of this.passes)e.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),Ry.fullscreenGeometry.dispose()}},Zy={NONE:0,DEPTH:1,CONVOLUTION:2},Qy={FRAGMENT_HEAD:`FRAGMENT_HEAD`,FRAGMENT_MAIN_UV:`FRAGMENT_MAIN_UV`,FRAGMENT_MAIN_IMAGE:`FRAGMENT_MAIN_IMAGE`,VERTEX_HEAD:`VERTEX_HEAD`,VERTEX_MAIN_SUPPORT:`VERTEX_MAIN_SUPPORT`},$y=class{constructor(){this.shaderParts=new Map([[Qy.FRAGMENT_HEAD,null],[Qy.FRAGMENT_MAIN_UV,null],[Qy.FRAGMENT_MAIN_IMAGE,null],[Qy.VERTEX_HEAD,null],[Qy.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=Zy.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=rn}},eb=!1,tb=class{constructor(e=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(e),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case 2:t=this.materialsFlatShadedDoubleSide;break;case 1:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case 2:t=this.materialsDoubleSide;break;case 1:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(e){if(!(e instanceof tu))return e.clone();let t=e.uniforms,n=new Map;for(let e in t){let r=t[e].value;r.isRenderTargetTexture&&(t[e].value=null,n.set(e,r))}let r=e.clone();for(let e of n)t[e[0]].value=e[1],r.uniforms[e[0]].value=e[1];return r}setMaterial(e){if(this.disposeMaterials(),this.material=e,e!==null){let t=this.materials=[this.cloneMaterial(e),this.cloneMaterial(e),this.cloneMaterial(e)];for(let n of t)n.uniforms=Object.assign({},e.uniforms),n.side=0;t[2].skinning=!0,this.materialsBackSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.side=1,n}),this.materialsDoubleSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.side=2,n}),this.materialsFlatShaded=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.flatShading=!0,n.side=1,n}),this.materialsFlatShadedDoubleSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.flatShading=!0,n.side=2,n})}}render(e,t,n){let r=e.shadowMap.enabled;if(e.shadowMap.enabled=!1,eb){let r=this.originalMaterials;this.meshCount=0,t.traverse(this.replaceMaterial),e.render(t,n);for(let e of r)e[0].material=e[1];this.meshCount!==r.size&&r.clear()}else{let r=t.overrideMaterial;t.overrideMaterial=this.material,e.render(t,n),t.overrideMaterial=r}e.shadowMap.enabled=r}disposeMaterials(){if(this.material!==null){let e=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let t of e)t.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return eb}static set workaroundEnabled(e){eb=e}},nb=-1,rb=class extends Gn{constructor(e=null,t=nb,n=nb,r=1){super(),e!==null&&this.addEventListener(`change`,()=>e.setSize(this.baseSize.width,this.baseSize.height)),this.baseSize=new H(1,1),this.preferredSize=new H(t,n),this.target=this.preferredSize,this.s=r,this.effectiveSize=new H,this.addEventListener(`change`,()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){let e=this.baseSize,t=this.preferredSize,n=this.effectiveSize,r=this.scale;t.width===nb?t.height===nb?n.width=Math.round(e.width*r):n.width=Math.round(t.height*(e.width/Math.max(e.height,1))):n.width=t.width,t.height===nb?t.width===nb?n.height=Math.round(e.height*r):n.height=Math.round(t.width/Math.max(e.width/Math.max(e.height,1),1)):n.height=t.height}get width(){return this.effectiveSize.width}set width(e){this.preferredWidth=e}get height(){return this.effectiveSize.height}set height(e){this.preferredHeight=e}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(e){this.s!==e&&(this.s=e,this.preferredSize.setScalar(nb),this.dispatchEvent({type:`change`}))}getScale(){return this.scale}setScale(e){this.scale=e}get baseWidth(){return this.baseSize.width}set baseWidth(e){this.baseSize.width!==e&&(this.baseSize.width=e,this.dispatchEvent({type:`change`}))}getBaseWidth(){return this.baseWidth}setBaseWidth(e){this.baseWidth=e}get baseHeight(){return this.baseSize.height}set baseHeight(e){this.baseSize.height!==e&&(this.baseSize.height=e,this.dispatchEvent({type:`change`}))}getBaseHeight(){return this.baseHeight}setBaseHeight(e){this.baseHeight=e}setBaseSize(e,t){(this.baseSize.width!==e||this.baseSize.height!==t)&&(this.baseSize.set(e,t),this.dispatchEvent({type:`change`}))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(e){this.preferredSize.width!==e&&(this.preferredSize.width=e,this.dispatchEvent({type:`change`}))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(e){this.preferredWidth=e}get preferredHeight(){return this.preferredSize.height}set preferredHeight(e){this.preferredSize.height!==e&&(this.preferredSize.height=e,this.dispatchEvent({type:`change`}))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(e){this.preferredHeight=e}setPreferredSize(e,t){(this.preferredSize.width!==e||this.preferredSize.height!==t)&&(this.preferredSize.set(e,t),this.dispatchEvent({type:`change`}))}copy(e){this.s=e.scale,this.baseSize.set(e.baseWidth,e.baseHeight),this.preferredSize.set(e.preferredWidth,e.preferredHeight),this.dispatchEvent({type:`change`})}static get AUTO_SIZE(){return nb}},ib={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},ab=new Map([[ib.ADD,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.ALPHA,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,src.a*opacity);}`],[ib.AVERAGE,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=(dst.rgb+src.rgb)*0.5;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.COLOR,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(b.xy,a.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.COLOR_BURN,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=dst.rgb,b=src.rgb;vec3 c=mix(step(0.0,b)*(1.0-min(vec3(1.0),(1.0-a)/max(b,1e-9))),vec3(1.0),step(1.0,a));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.COLOR_DODGE,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=dst.rgb,b=src.rgb;vec3 c=step(0.0,a)*mix(min(vec3(1.0),a/max(1.0-b,1e-9)),vec3(1.0),step(1.0,b));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.DARKEN,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=min(dst.rgb,src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.DIFFERENCE,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=abs(dst.rgb-src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.DIVIDE,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb/max(src.rgb,1e-9);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.DST,null],[ib.EXCLUSION,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb-2.0*dst.rgb*src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.HARD_LIGHT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=min(dst.rgb,1.0);vec3 b=min(src.rgb,1.0);vec3 c=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,b));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.HARD_MIX,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=step(1.0,dst.rgb+src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.HUE,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(b.x,a.yz));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.INVERT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(1.0-src.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.INVERT_RGB,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=src.rgb*max(1.0-dst.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.LIGHTEN,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(dst.rgb,src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.LINEAR_BURN,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=clamp(src.rgb+dst.rgb-1.0,0.0,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.LINEAR_DODGE,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=min(dst.rgb+src.rgb,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.LINEAR_LIGHT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=clamp(2.0*src.rgb+dst.rgb-1.0,0.0,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.LUMINOSITY,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(a.xy,b.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.MULTIPLY,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb*src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.NEGATION,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(1.0-abs(1.0-dst.rgb-src.rgb),0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.NORMAL,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,opacity);}`],[ib.OVERLAY,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=2.0*src.rgb*dst.rgb;vec3 b=1.0-2.0*(1.0-src.rgb)*(1.0-dst.rgb);vec3 c=mix(a,b,step(0.5,dst.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.PIN_LIGHT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 src2=2.0*src.rgb;vec3 c=mix(mix(src2,dst.rgb,step(0.5*dst.rgb,src.rgb)),max(src2-1.0,vec3(0.0)),step(dst.rgb,src2-1.0));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.REFLECT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=min(dst.rgb*dst.rgb/max(1.0-src.rgb,1e-9),1.0);vec3 c=mix(a,src.rgb,step(1.0,src.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.SATURATION,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(a.x,b.y,a.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.SCREEN,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb-min(dst.rgb*src.rgb,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.SOFT_LIGHT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 src2=2.0*src.rgb;vec3 d=dst.rgb+(src2-1.0);vec3 w=step(0.5,src.rgb);vec3 a=dst.rgb-(1.0-src2)*dst.rgb*(1.0-dst.rgb);vec3 b=mix(d*(sqrt(dst.rgb)-dst.rgb),d*dst.rgb*((16.0*dst.rgb-12.0)*dst.rgb+3.0),w*(1.0-step(0.25,dst.rgb)));vec3 c=mix(a,b,w);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.SRC,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return src;}`],[ib.SUBTRACT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(dst.rgb-src.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`],[ib.VIVID_LIGHT,`vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=mix(max(1.0-min((1.0-dst.rgb)/(2.0*src.rgb),1.0),0.0),min(dst.rgb/(2.0*(1.0-src.rgb)),1.0),step(0.5,src.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}`]]),ob=class extends Gn{constructor(e,t=1){super(),this._blendFunction=e,this.opacity=new Cf(t)}getOpacity(){return this.opacity.value}setOpacity(e){this.opacity.value=e}get blendFunction(){return this._blendFunction}set blendFunction(e){this._blendFunction=e,this.dispatchEvent({type:`change`})}getBlendFunction(){return this.blendFunction}setBlendFunction(e){this.blendFunction=e}getShaderCode(){return ab.get(this.blendFunction)}},sb=class extends Gn{constructor(e,t,{attributes:n=Zy.NONE,blendFunction:r=ib.NORMAL,defines:i=new Map,uniforms:a=new Map,extensions:o=null,vertexShader:s=null}={}){super(),this.name=e,this.renderer=null,this.attributes=n,this.fragmentShader=t,this.vertexShader=s,this.defines=i,this.uniforms=a,this.extensions=o,this.blendMode=new ob(r),this.blendMode.addEventListener(`change`,e=>this.setChanged()),this._inputColorSpace=rn,this._outputColorSpace=``}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(e){this._inputColorSpace=e,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e,this.setChanged()}set mainScene(e){}set mainCamera(e){}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:`change`})}setDepthTexture(e,t=Qt){}update(e,t,n){}setSize(e,t){}initialize(e,t,n){}dispose(){for(let e of Object.keys(this)){let t=this[e];(t instanceof zr||t instanceof Fa||t instanceof Ir||t instanceof Ry)&&this[e].dispose()}}},cb={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},lb=`#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; +#include +}`,ub=`uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}`,db=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],fb=class extends tu{constructor(e=new Lr){super({name:`KawaseBlurMaterial`,uniforms:{inputBuffer:new Cf(null),texelSize:new Cf(new Lr),scale:new Cf(1),kernel:new Cf(0)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:lb,vertexShader:ub}),this.setTexelSize(e.x,e.y),this.kernelSize=cb.MEDIUM}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.inputBuffer=e}get kernelSequence(){return db[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}getScale(){return this.uniforms.scale.value}setScale(e){this.uniforms.scale.value=e}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(e){this.uniforms.kernel.value=e}setKernel(e){this.kernel=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t,e*.5,t*.5)}setSize(e,t){let n=1/e,r=1/t;this.uniforms.texelSize.value.set(n,r,n*.5,r*.5)}},pb=class extends Ry{constructor({kernelSize:e=cb.MEDIUM,resolutionScale:t=.5,width:n=rb.AUTO_SIZE,height:r=rb.AUTO_SIZE,resolutionX:i=n,resolutionY:a=r}={}){super(`KawaseBlurPass`),this.renderTargetA=new zr(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name=`Blur.Target.A`,this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name=`Blur.Target.B`;let o=this.resolution=new rb(this,i,a,t);o.addEventListener(`change`,e=>this.setSize(o.baseWidth,o.baseHeight)),this._blurMaterial=new fb,this._blurMaterial.kernelSize=e,this.copyMaterial=new Hy}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(e){this._blurMaterial=e}get dithering(){return this.copyMaterial.dithering}set dithering(e){this.copyMaterial.dithering=e}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(e){this.blurMaterial.kernelSize=e}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get scale(){return this.blurMaterial.scale}set scale(e){this.blurMaterial.scale=e}getScale(){return this.blurMaterial.scale}setScale(e){this.blurMaterial.scale=e}getKernelSize(){return this.kernelSize}setKernelSize(e){this.kernelSize=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,n,r,i){let a=this.scene,o=this.camera,s=this.renderTargetA,c=this.renderTargetB,l=this.blurMaterial,u=l.kernelSequence,d=t;this.fullscreenMaterial=l;for(let t=0,n=u.length;t +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#ifdef RANGE +uniform vec2 range; +#elif defined(THRESHOLD) +uniform float threshold;uniform float smoothing; +#endif +varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb);float mask=1.0; +#ifdef RANGE +float low=step(range.x,l);float high=step(l,range.y);mask=low*high; +#elif defined(THRESHOLD) +mask=smoothstep(threshold,threshold+smoothing,l); +#endif +#ifdef COLOR +gl_FragColor=texel*mask; +#else +gl_FragColor=vec4(l*mask); +#endif +}`,hb=class extends tu{constructor(e=!1,t=null){super({name:`LuminanceMaterial`,defines:{THREE_REVISION:`184`.replace(/\D+/g,``)},uniforms:{inputBuffer:new Cf(null),threshold:new Cf(0),smoothing:new Cf(1),range:new Cf(null)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:mb,vertexShader:Vy}),this.colorOutput=e,this.luminanceRange=t}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get threshold(){return this.uniforms.threshold.value}set threshold(e){this.smoothing>0||e>0?this.defines.THRESHOLD=`1`:delete this.defines.THRESHOLD,this.uniforms.threshold.value=e}getThreshold(){return this.threshold}setThreshold(e){this.threshold=e}get smoothing(){return this.uniforms.smoothing.value}set smoothing(e){this.threshold>0||e>0?this.defines.THRESHOLD=`1`:delete this.defines.THRESHOLD,this.uniforms.smoothing.value=e}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(e){this.smoothing=e}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(e){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(e){e?this.defines.COLOR=`1`:delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(e){return this.colorOutput}setColorOutputEnabled(e){this.colorOutput=e}get useRange(){return this.luminanceRange!==null}set useRange(e){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(e){e===null?delete this.defines.RANGE:this.defines.RANGE=`1`,this.uniforms.range.value=e,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(e){this.luminanceRange=e}},gb=class extends Ry{constructor({renderTarget:e,luminanceRange:t,colorOutput:n,resolutionScale:r=1,width:i=rb.AUTO_SIZE,height:a=rb.AUTO_SIZE,resolutionX:o=i,resolutionY:s=a}={}){super(`LuminancePass`),this.fullscreenMaterial=new hb(n,t),this.needsSwap=!1,this.renderTarget=e,this.renderTarget===void 0&&(this.renderTarget=new zr(1,1,{depthBuffer:!1}),this.renderTarget.texture.name=`LuminancePass.Target`);let c=this.resolution=new rb(this,o,s,r);c.addEventListener(`change`,e=>this.setSize(c.baseWidth,c.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(e,t,n,r,i){let a=this.fullscreenMaterial;a.inputBuffer=t.texture,e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height)}initialize(e,t,n){n!==void 0&&n!==1009&&(this.renderTarget.texture.type=n,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH=`1`)}},_b=`#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#define WEIGHT_INNER 0.125 +#define WEIGHT_OUTER 0.05556 +varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c; +#include +}`,vb=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}`,yb=class extends tu{constructor(){super({name:`DownsamplingMaterial`,uniforms:{inputBuffer:new Cf(null),texelSize:new Cf(new H)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:_b,vertexShader:vb})}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},bb=`#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer; +#else +uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer; +#endif +uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius); +#include +}`,xb=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}`,Sb=class extends tu{constructor(){super({name:`UpsamplingMaterial`,uniforms:{inputBuffer:new Cf(null),supportBuffer:new Cf(null),texelSize:new Cf(new H),radius:new Cf(.85)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:bb,vertexShader:xb})}set inputBuffer(e){this.uniforms.inputBuffer.value=e}set supportBuffer(e){this.uniforms.supportBuffer.value=e}get radius(){return this.uniforms.radius.value}set radius(e){this.uniforms.radius.value=e}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},Cb=class extends Ry{constructor(){super(`MipmapBlurPass`),this.needsSwap=!1,this.renderTarget=new zr(1,1,{depthBuffer:!1}),this.renderTarget.texture.name=`Upsampling.Mipmap0`,this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new yb,this.upsamplingMaterial=new Sb,this.resolution=new H}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(e){if(this.levels!==e){let t=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let n=0;n=0;--t){let n=u[t];c.setSize(d.width,d.height),c.inputBuffer=d.texture,c.supportBuffer=l[t].texture,e.setRenderTarget(n),e.render(a,o),d=n}}setSize(e,t){let n=this.resolution;n.set(e,t);let r=n.width,i=n.height;for(let e=0,t=this.downsamplingMipmaps.length;ethis.setSize(p.baseWidth,p.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get dithering(){return this.blurPass.dithering}set dithering(e){this.blurPass.dithering=e}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(e){this.blurPass.kernelSize=e}get distinction(){return console.warn(this.name,`distinction was removed`),1}set distinction(e){console.warn(this.name,`distinction was removed`)}get intensity(){return this.uniforms.get(`intensity`).value}set intensity(e){this.uniforms.get(`intensity`).value=e}getIntensity(){return this.intensity}setIntensity(e){this.intensity=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}update(e,t,n){let r=this.renderTarget,i=this.luminancePass;i.enabled?(i.render(e,t),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(e,i.renderTarget):this.blurPass.render(e,i.renderTarget,r)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(e,t):this.blurPass.render(e,t,r)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height),this.blurPass.resolution.copy(n),this.luminancePass.setSize(e,t),this.mipmapBlurPass.setSize(e,t)}initialize(e,t,n){this.blurPass.initialize(e,t,n),this.luminancePass.initialize(e,t,n),this.mipmapBlurPass.initialize(e,t,n),n!==void 0&&(this.renderTarget.texture.type=n,e!==null&&e.outputColorSpace===`srgb`&&(this.renderTarget.texture.colorSpace=nn))}},Eb=class extends Ry{constructor(e,t,n=null){super(`RenderPass`,e,t),this.needsSwap=!1,this.needsDepthBlit=!0,this.clearPass=new Gy,this.overrideMaterialManager=n===null?null:new tb(n),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(e){this.scene=e}set mainCamera(e){this.camera=e}get renderToScreen(){return super.renderToScreen}set renderToScreen(e){super.renderToScreen=e,this.clearPass.renderToScreen=e}get overrideMaterial(){let e=this.overrideMaterialManager;return e===null?null:e.material}set overrideMaterial(e){let t=this.overrideMaterialManager;e===null?t!==null&&(t.dispose(),this.overrideMaterialManager=null):t===null?this.overrideMaterialManager=new tb(e):t.setMaterial(e)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(e){this.overrideMaterial=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getSelection(){return this.selection}setSelection(e){this.selection=e}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(e){this.ignoreBackground=e}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(e){this.skipShadowMapUpdate=e}getClearPass(){return this.clearPass}render(e,t,n,r,i){let a=this.scene,o=this.camera,s=this.selection,c=o.layers.mask,l=a.background,u=e.shadowMap.autoUpdate,d=this.renderToScreen?null:t;s!==null&&o.layers.set(s.getLayer()),this.skipShadowMapUpdate&&(e.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(a.background=null),this.clearPass.enabled&&this.clearPass.render(e,t),e.setRenderTarget(d),this.overrideMaterialManager===null?e.render(a,o):this.overrideMaterialManager.render(e,a,o),o.layers.mask=c,a.background=l,e.shadowMap.autoUpdate=u}};Math.PI*.5;var Db=`#include +#ifdef GL_FRAGMENT_PRECISION_HIGH +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +#ifdef DOWNSAMPLE_NORMALS +uniform lowp sampler2D normalBuffer; +#endif +varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +return unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +return texture2D(depthBuffer,uv).r; +#endif +}int findBestDepth(const in float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])*0.25;float distances[4];distances[0]=abs(c-samples[0]);distances[1]=abs(c-samples[1]);distances[2]=abs(c-samples[2]);distances[3]=abs(c-samples[3]);float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i]this.setSize(s.baseWidth,s.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(e,t=Qt){this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.depthPacking=t}render(e,t,n,r,i){e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height),this.fullscreenMaterial.setSize(e,t)}initialize(e,t,n){let r=e.getContext();if(!(r.getExtension(`EXT_color_buffer_float`)||r.getExtension(`EXT_color_buffer_half_float`)))throw Error(`Rendering to float texture is not supported.`)}},jb=`#include +#include +#include +#define packFloatToRGBA(v) packDepthToRGBA(v) +#define unpackRGBAToFloat(v) unpackRGBAToDepth(v) +#ifdef FRAMEBUFFER_PRECISION_HIGH +uniform mediump sampler2D inputBuffer; +#else +uniform lowp sampler2D inputBuffer; +#endif +#if DEPTH_PACKING == 3201 +uniform lowp sampler2D depthBuffer; +#elif defined(GL_FRAGMENT_PRECISION_HIGH) +uniform highp sampler2D depthBuffer; +#else +uniform mediump sampler2D depthBuffer; +#endif +uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;vec4 sRGBToLinear(const in vec4 value){return vec4(mix(pow(value.rgb*0.9478672986+vec3(0.0521327014),vec3(2.4)),value.rgb*0.0773993808,vec3(lessThanEqual(value.rgb,vec3(0.04045)))),value.a);}float readDepth(const in vec2 uv){ +#if DEPTH_PACKING == 3201 +float depth=unpackRGBAToDepth(texture2D(depthBuffer,uv)); +#else +float depth=texture2D(depthBuffer,uv).r; +#endif +#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH) +float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d; +#elif defined(USE_REVERSED_DEPTH_BUFFER) +depth=1.0-depth; +#endif +return depth;}float getViewZ(const in float depth){ +#ifdef PERSPECTIVE_CAMERA +return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); +#else +return orthographicDepthToViewZ(depth,cameraNear,cameraFar); +#endif +}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEAD void main(){FRAGMENT_MAIN_UV vec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGE color0.a=clamp(color0.a,0.0,1.0);gl_FragColor=color0; +#ifdef ENCODE_OUTPUT +#include +#endif +#include +}`,Mb=`uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}`,Nb=class extends tu{constructor(e,t,n,r,i=!1){super({name:`EffectMaterial`,defines:{THREE_REVISION:`184`.replace(/\D+/g,``),DEPTH_PACKING:`0`,ENCODE_OUTPUT:`1`},uniforms:{inputBuffer:new Cf(null),depthBuffer:new Cf(null),resolution:new Cf(new H),texelSize:new Cf(new H),cameraNear:new Cf(.3),cameraFar:new Cf(1e3),aspect:new Cf(1),time:new Cf(0)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:i}),e&&this.setShaderParts(e),t&&this.setDefines(t),n&&this.setUniforms(n),this.copyCameraSettings(r)}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){this.uniforms.depthBuffer.value=e}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=Qt){this.depthBuffer=e,this.depthPacking=t}setShaderData(e){this.setShaderParts(e.shaderParts),this.setDefines(e.defines),this.setUniforms(e.uniforms),this.setExtensions(e.extensions)}setShaderParts(e){return this.fragmentShader=jb.replace(Qy.FRAGMENT_HEAD,e.get(Qy.FRAGMENT_HEAD)||``).replace(Qy.FRAGMENT_MAIN_UV,e.get(Qy.FRAGMENT_MAIN_UV)||``).replace(Qy.FRAGMENT_MAIN_IMAGE,e.get(Qy.FRAGMENT_MAIN_IMAGE)||``),this.vertexShader=Mb.replace(Qy.VERTEX_HEAD,e.get(Qy.VERTEX_HEAD)||``).replace(Qy.VERTEX_MAIN_SUPPORT,e.get(Qy.VERTEX_MAIN_SUPPORT)||``),this.needsUpdate=!0,this}setDefines(e){for(let t of e.entries())this.defines[t[0]]=t[1];return this.needsUpdate=!0,this}setUniforms(e){for(let t of e.entries())this.uniforms[t[0]]=t[1];return this}setExtensions(e){this.extensions={};for(let t of e)this.extensions[t]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(e){this.encodeOutput!==e&&(e?this.defines.ENCODE_OUTPUT=`1`:delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(e){return this.encodeOutput}setOutputEncodingEnabled(e){this.encodeOutput=e}get time(){return this.uniforms.time.value}set time(e){this.uniforms.time.value=e}setDeltaTime(e){this.uniforms.time.value+=e}adoptCameraSettings(e){this.copyCameraSettings(e)}copyCameraSettings(e){e&&(this.uniforms.cameraNear.value=e.near,this.uniforms.cameraFar.value=e.far,e instanceof ld?this.defines.PERSPECTIVE_CAMERA=`1`:delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(e,t){let n=this.uniforms;n.resolution.value.set(e,t),n.texelSize.value.set(1/e,1/t),n.aspect.value=e/t}static get Section(){return Qy}};Number(`184`.replace(/\D+/g,``));var Pb=255/256;new Float32Array([Pb/256**3,Pb/256**2,Pb/256,Pb]),new Float32Array([Pb,Pb/256,Pb/256**2,1/256**3]);function Fb(e,t,n){for(let r of t){let t=`$1`+e+r.charAt(0).toUpperCase()+r.slice(1),i=RegExp(`([^\\.])(\\b`+r+`\\b)`,`g`);for(let e of n.entries())e[1]!==null&&n.set(e[0],e[1].replace(i,t))}}function Ib(e,t,n){let r=t.getFragmentShader(),i=t.getVertexShader(),a=r!==void 0&&/mainImage/.test(r),o=r!==void 0&&/mainUv/.test(r);if(n.attributes|=t.getAttributes(),r===void 0)throw Error(`Missing fragment shader (${t.name})`);if(o&&(n.attributes&Zy.CONVOLUTION)!==0)throw Error(`Effects that transform UVs are incompatible with convolution effects (${t.name})`);if(!a&&!o)throw Error(`Could not find mainImage or mainUv function (${t.name})`);{let s=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,c=n.shaderParts,l=c.get(Qy.FRAGMENT_HEAD)||``,u=c.get(Qy.FRAGMENT_MAIN_UV)||``,d=c.get(Qy.FRAGMENT_MAIN_IMAGE)||``,f=c.get(Qy.VERTEX_HEAD)||``,p=c.get(Qy.VERTEX_MAIN_SUPPORT)||``,m=new Set,h=new Set;if(o&&(u+=` ${e}MainUv(UV); +`,n.uvTransformation=!0),i!==null&&/mainSupport/.test(i)){let t=/mainSupport *\([\w\s]*?uv\s*?\)/.test(i);p+=` ${e}MainSupport(`,p+=t?`vUv); +`:`); +`;for(let e of i.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(let t of e[1].split(/\s*,\s*/))n.varyings.add(t),m.add(t),h.add(t);for(let e of i.matchAll(s))h.add(e[1])}for(let e of r.matchAll(s))h.add(e[1]);for(let e of t.defines.keys())h.add(e.replace(/\([\w\s,]*\)/g,``));for(let e of t.uniforms.keys())h.add(e);h.delete(`while`),h.delete(`for`),h.delete(`if`),t.uniforms.forEach((t,r)=>n.uniforms.set(e+r.charAt(0).toUpperCase()+r.slice(1),t)),t.defines.forEach((t,r)=>n.defines.set(e+r.charAt(0).toUpperCase()+r.slice(1),t));let g=new Map([[`fragment`,r],[`vertex`,i]]);Fb(e,h,n.defines),Fb(e,h,g),r=g.get(`fragment`),i=g.get(`vertex`);let _=t.blendMode;if(n.blendModes.set(_.blendFunction,_),a){t.inputColorSpace!==null&&t.inputColorSpace!==n.colorSpace&&(d+=t.inputColorSpace===`srgb`?`color0 = sRGBTransferOETF(color0); + `:`color0 = sRGBToLinear(color0); + `),t.outputColorSpace===``?t.inputColorSpace!==null&&(n.colorSpace=t.inputColorSpace):n.colorSpace=t.outputColorSpace,d+=`${e}MainImage(color0, UV, `,(n.attributes&Zy.DEPTH)!==0&&/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/.test(r)&&(d+=`depth, `,n.readDepth=!0),d+=`color1); + `;let i=e+`BlendOpacity`;n.uniforms.set(i,_.opacity),d+=`color0 = blend${_.blendFunction}(color0, color1, ${i}); + + `,l+=`uniform float ${i}; + +`}if(l+=r+` +`,i!==null&&(f+=i+` +`),c.set(Qy.FRAGMENT_HEAD,l),c.set(Qy.FRAGMENT_MAIN_UV,u),c.set(Qy.FRAGMENT_MAIN_IMAGE,d),c.set(Qy.VERTEX_HEAD,f),c.set(Qy.VERTEX_MAIN_SUPPORT,p),t.extensions!==null)for(let e of t.extensions)n.extensions.add(e)}}var Lb=class extends Ry{constructor(e,...t){super(`EffectPass`),this.fullscreenMaterial=new Nb(null,null,null,e),this.listener=e=>this.handleEvent(e),this.effects=[],this.setEffects(t),this.skipRendering=!1,this.minTime=1,this.maxTime=1/0,this.timeScale=1}set mainScene(e){for(let t of this.effects)t.mainScene=e}set mainCamera(e){this.fullscreenMaterial.copyCameraSettings(e);for(let t of this.effects)t.mainCamera=e}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(e){this.fullscreenMaterial.encodeOutput=e}get dithering(){return this.fullscreenMaterial.dithering}set dithering(e){let t=this.fullscreenMaterial;t.dithering=e,t.needsUpdate=!0}setEffects(e){for(let e of this.effects)e.removeEventListener(`change`,this.listener);this.effects=e.sort((e,t)=>t.attributes-e.attributes);for(let e of this.effects)e.addEventListener(`change`,this.listener)}updateMaterial(){let e=new $y,t=0;for(let n of this.effects)if(n.blendMode.blendFunction===ib.DST)e.attributes|=n.getAttributes()&Zy.DEPTH;else if((e.attributes&n.getAttributes()&Zy.CONVOLUTION)!==0)throw Error(`Convolution effects cannot be merged (${n.name})`);else Ib(`e`+t++,n,e);let n=e.shaderParts.get(Qy.FRAGMENT_HEAD),r=e.shaderParts.get(Qy.FRAGMENT_MAIN_IMAGE),i=e.shaderParts.get(Qy.FRAGMENT_MAIN_UV),a=/\bblend\b/g;for(let t of e.blendModes.values())n+=t.getShaderCode().replace(a,`blend${t.blendFunction}`)+` +`;(e.attributes&Zy.DEPTH)===0?this.needsDepthTexture=!1:(e.readDepth&&(r=`float depth = readDepth(UV); + + `+r),this.needsDepthTexture=this.getDepthTexture()===null),e.colorSpace===`srgb`&&(r+=`color0 = sRGBToLinear(color0); + `),e.uvTransformation?(i=`vec2 transformedUv = vUv; +`+i,e.defines.set(`UV`,`transformedUv`)):e.defines.set(`UV`,`vUv`),e.shaderParts.set(Qy.FRAGMENT_HEAD,n),e.shaderParts.set(Qy.FRAGMENT_MAIN_IMAGE,r),e.shaderParts.set(Qy.FRAGMENT_MAIN_UV,i);for(let[t,n]of e.shaderParts)n!==null&&e.shaderParts.set(t,n.trim().replace(/^#/,` +#`));this.skipRendering=t===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(e)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(e,t=Qt){this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.depthPacking=t;for(let n of this.effects)n.setDepthTexture(e,t)}render(e,t,n,r,i){for(let n of this.effects)n.update(e,t,r);if(!this.skipRendering||this.renderToScreen){let i=this.fullscreenMaterial;i.inputBuffer=t.texture,i.time+=r*this.timeScale,e.setRenderTarget(this.renderToScreen?null:n),e.render(this.scene,this.camera)}}setSize(e,t){this.fullscreenMaterial.setSize(e,t);for(let n of this.effects)n.setSize(e,t)}initialize(e,t,n){this.renderer=e;for(let r of this.effects)r.initialize(e,t,n);this.updateMaterial(),n!==void 0&&n!==1009&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH=`1`)}dispose(){super.dispose();for(let e of this.effects)e.removeEventListener(`change`,this.listener),e.dispose()}handleEvent(e){switch(e.type){case`change`:this.recompile();break}}},Rb=class extends Ry{constructor(e,t,{renderTarget:n,resolutionScale:r=1,width:i=rb.AUTO_SIZE,height:a=rb.AUTO_SIZE,resolutionX:o=i,resolutionY:s=a}={}){super(`NormalPass`),this.needsSwap=!1,this.renderPass=new Eb(e,t,new su);let c=this.renderPass;c.ignoreBackground=!0,c.skipShadowMapUpdate=!0;let l=c.getClearPass();l.overrideClearColor=new G(7829503),l.overrideClearAlpha=1,this.renderTarget=n,this.renderTarget===void 0&&(this.renderTarget=new zr(1,1,{minFilter:Te,magFilter:Te}),this.renderTarget.texture.name=`NormalPass.Target`);let u=this.resolution=new rb(this,o,s,r);u.addEventListener(`change`,e=>this.setSize(u.baseWidth,u.baseHeight))}set mainScene(e){this.renderPass.mainScene=e}set mainCamera(e){this.renderPass.mainCamera=e}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,n,r,i){let a=this.renderToScreen?null:this.renderTarget;this.renderPass.render(e,a,a)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height)}};new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125]),new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4]),new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3]),Bb(0,0,0,0),new Float32Array([0,0,0,0]),Bb(0,0,0,1),new Float32Array([0,0,0,1]),Bb(0,0,1,0),new Float32Array([0,0,1,0]),Bb(0,0,1,1),new Float32Array([0,0,1,1]),Bb(0,1,0,0),new Float32Array([0,1,0,0]),Bb(0,1,0,1),new Float32Array([0,1,0,1]),Bb(0,1,1,0),new Float32Array([0,1,1,0]),Bb(0,1,1,1),new Float32Array([0,1,1,1]),Bb(1,0,0,0),new Float32Array([1,0,0,0]),Bb(1,0,0,1),new Float32Array([1,0,0,1]),Bb(1,0,1,0),new Float32Array([1,0,1,0]),Bb(1,0,1,1),new Float32Array([1,0,1,1]),Bb(1,1,0,0),new Float32Array([1,1,0,0]),Bb(1,1,0,1),new Float32Array([1,1,0,1]),Bb(1,1,1,0),new Float32Array([1,1,1,0]),Bb(1,1,1,1),new Float32Array([1,1,1,1]);function zb(e,t,n){return e+(t-e)*n}function Bb(e,t,n,r){return zb(zb(e,t,.75),zb(n,r,.75),.875)}function Vb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}new H,new H;function Hb(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var Ub=function e(t,n,r){var i=this;Hb(this,e),Vb(this,`dot2`,function(e,t){return i.x*e+i.y*t}),Vb(this,`dot3`,function(e,t,n){return i.x*e+i.y*t+i.z*n}),this.x=t,this.y=n,this.z=r},Wb=[new Ub(1,1,0),new Ub(-1,1,0),new Ub(1,-1,0),new Ub(-1,-1,0),new Ub(1,0,1),new Ub(-1,0,1),new Ub(1,0,-1),new Ub(-1,0,-1),new Ub(0,1,1),new Ub(0,-1,1),new Ub(0,1,-1),new Ub(0,-1,-1)],Gb=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180],Kb=Array(512),qb=Array(512);(function(e){e>0&&e<1&&(e*=65536),e=Math.floor(e),e<256&&(e|=e<<8);for(var t=0;t<256;t++){var n=t&1?Gb[t]^e&255:Gb[t]^e>>8&255;Kb[t]=Kb[t+256]=n,qb[t]=qb[t+256]=Wb[n%12]}})(0),.5*(Math.sqrt(3)-1),(3-Math.sqrt(3))/6,Math.PI*2;function Jb(e){if(typeof e==`number`)e=Math.abs(e);else if(typeof e==`string`){var t=e;e=0;for(var n=0;n(e.getAttributes()&2)==2,Qb=(0,v.memo)((0,v.forwardRef)(({children:e,camera:t,scene:n,resolutionScale:r,enabled:i=!0,renderPriority:a=1,autoClear:o=!0,depthBuffer:s,enableNormalPass:c,stencilBuffer:l,multisampling:u=8,frameBufferType:d=Ve},f)=>{let{gl:p,scene:m,camera:h,size:g}=dv(),_=n||m,y=t||h,[b,x,S]=(0,v.useMemo)(()=>{let e=new Xy(p,{depthBuffer:s,stencilBuffer:l,multisampling:u,frameBufferType:d});e.addPass(new Eb(_,y));let t=null,n=null;return c&&(n=new Rb(_,y),n.enabled=!1,e.addPass(n),r!==void 0&&(t=new Ab({normalBuffer:n.texture,resolutionScale:r}),t.enabled=!1,e.addPass(t))),[e,n,t]},[y,p,s,l,u,d,_,c,r]);(0,v.useEffect)(()=>b?.setSize(g.width,g.height),[b,g]),fv((e,t)=>{if(i){let e=p.autoClear;p.autoClear=o,l&&!o&&p.clearStencil(),b.render(t),p.autoClear=e}},i?a:0);let C=(0,v.useRef)(null);(0,v.useLayoutEffect)(()=>{let e=[],t=C.current.__r3f;if(t&&b){let n=t.children;for(let t=0;t{for(let t of e)b?.removePass(t);x&&(x.enabled=!1),S&&(S.enabled=!1)}},[b,e,y,x,S]),(0,v.useEffect)(()=>{let e=p.toneMapping;return p.toneMapping=0,()=>{p.toneMapping=e}},[p]);let w=(0,v.useMemo)(()=>({composer:b,normalPass:x,downSamplingPass:S,resolutionScale:r,camera:y,scene:_}),[b,x,S,r,y,_]);return(0,v.useImperativeHandle)(f,()=>b,[b]),(0,Q.jsx)(Xb.Provider,{value:w,children:(0,Q.jsx)(`group`,{ref:C,children:e})})})),$b=0,ex=new WeakMap,tx=((e,t)=>function({blendFunction:n=t?.blendFunction,opacity:r=t?.opacity,...i}){let a=ex.get(e);if(!a){let t=`@react-three/postprocessing/${e.name}-${$b++}`;Lv({[t]:e}),ex.set(e,a=t)}let o=dv(e=>e.camera),s=v.useMemo(()=>[...t?.args??[],...i.args??[{...t,...i}]],[JSON.stringify(i)]);return(0,Q.jsx)(a,{camera:o,"blendMode-blendFunction":n,"blendMode-opacity-value":r,...i,args:s})})(Tb,{blendFunction:0});function nx(){return(0,v.useSyncExternalStore)(he.subscribe,he.getSnapshot,he.getSnapshot)}function rx(){let{variantId:e}=nx();return te.get(e)??null}function ix(){let{stateOverrides:e,moodOverrides:t}=nx();return{stateOverrides:e,moodOverrides:t}}function ax(e){let t=(0,v.useCallback)(()=>e(D.getSnapshot()),[e]);return(0,v.useSyncExternalStore)(D.subscribe,t,t)}var ox=` + uniform float uAmount; + + void mainImage(const in vec4 inputColor, const in vec2 uv, out vec4 outputColor) { + float luma = max(inputColor.r, max(inputColor.g, inputColor.b)); + float mask = smoothstep(0.01, 0.1, luma); + vec2 offset = (uv - 0.5) * uAmount; + float r = texture2D(inputBuffer, uv + offset).r; + float g = texture2D(inputBuffer, uv).g; + float b = texture2D(inputBuffer, uv - offset).b; + vec3 aberrated = vec3(r, g, b); + outputColor = vec4(mix(inputColor.rgb, aberrated, mask), inputColor.a); + } +`,sx=class extends sb{constructor({amount:e=.025}={}){super(`LumaChromaticAberration`,ox,{uniforms:new Map([[`uAmount`,new Cf(e)]])})}setAmount(e){let t=this.uniforms.get(`uAmount`);t&&(t.value=e)}},cx=ee();cx.register,cx.get,cx.all,cx.subscribe;var lx=new class{current=null;listeners=new Set;getSnapshot=()=>this.current;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});push(e,t=4e3){this.current={text:e,expiresAt:t>0?Date.now()+t:0},this.listeners.forEach(e=>e())}clear(){this.current!==null&&(this.current=null,this.listeners.forEach(e=>e()))}};function ux(e,t=4e3){lx.push(e,t)}function dx(e){return{status:200,body:JSON.stringify(e)}}var fx=[{slug:`aurora`,name:`Aurora`,description:`Shifting green-blue light, patient and wide.`,variant:`fractal`,palette:`Aurora`,params:{}},{slug:`ember`,name:`Ember`,description:`Warm crackling light with hot core.`,variant:`fractal`,palette:`Ember`,params:{}},{slug:`forest`,name:`Forest`,description:`Green-gold canopy light, deep and settled.`,variant:`fractal`,palette:`Forest`,params:{}},{slug:`andromeda`,name:`Andromeda`,description:`Deep cosmic clouds with drifting dust.`,variant:`nebula`,palette:`Andromeda`,params:{}},{slug:`helios`,name:`Helios`,description:`Solar and radiant, humming with energy.`,variant:`nebula`,palette:`Helios`,params:{}},{slug:`prism`,name:`Prism`,description:`Faceted refracted light, crystalline and bright.`,variant:`crystal`,palette:`Prism`,params:{}},{slug:`obsidian`,name:`Obsidian`,description:`Sharp and dark with hidden edges.`,variant:`crystal`,palette:`Obsidian`,params:{}},{slug:`constellation`,name:`Constellation`,description:`Scattered stars in slow orbit.`,variant:`particles`,palette:`Constellation`,params:{}}],px={persona:{slug:`orbis`,name:`Orbis`,user_name:`You`,filler_verbosity:`narrated`},voice:{tts_backend:`kokoro`,voice:`af_heart`,local_models:`on_device`},llm:{model:`gemma-4-e2b (on-device)`},stt:{backend:`local`,whisper_model:`whisper-base`},orb:{variant:`fractal`,palette:`Aurora`},wakeword:{enabled:!1},setup:{complete:!0},agent:{allow_orb_control:!0}};function mx(e){px={...px,...e}}async function hx(e){let{method:t,path:n,body:r}=e,i=n.split(`?`)[0];if(t===`GET`)switch(i){case`/api/whoami`:return dx({id:`you`,display_name:`You`,auth_source:`empty`});case`/api/config`:return dx({config:px});case`/api/verbosity`:return dx({verbosity:px.persona?.filler_verbosity??`narrated`});case`/api/personality`:return dx({axes:[],mood:null,recent_events:[],sessions:{count:0,last_ended_at:null}});case`/api/starter_orbs`:return dx({starters:fx});case`/api/orbs`:return dx({orbs:[]});case`/api/reminders`:return dx({ok:!0,reminders:[]});case`/api/delegates`:return dx({delegates:[]});case`/api/delegate-types`:return dx({types:[]});case`/api/wakeword/models`:return dx({models:[]});case`/api/llm/detect_local`:return dx({});default:return dx({})}if(t===`POST`||t===`PUT`){let e;if(r)try{e=JSON.parse(r)}catch{}if(i===`/api/config`)return e&&typeof e==`object`&&mx(e),dx({ok:!0,config:px});if(i===`/api/orb/select_starter`){let t=e?.slug,n=fx.find(e=>e.slug===t);return n?(px={...px,orb:{variant:n.variant,palette:n.palette}},dx({ok:!0,starter:n})):{status:404,body:JSON.stringify({ok:!1,error:`unknown starter`})}}return dx({ok:!0})}return dx(t===`DELETE`?{ok:!0}:{})}var gx={mic:0,playback:0},_x=()=>gx,vx=e=>{gx.mic=e},yx=e=>{gx.playback=e};function bx(e,t){if(t?.file)if(t.status===`done`){let n=e.get(t.file);n&&(n.loaded=n.total)}else e.set(t.file,{loaded:t.loaded??0,total:t.total??0});let n=0,r=0;for(let t of e.values())n+=t.loaded,r+=t.total;return r>0?Math.min(100,Math.round(n/r*100)):null}var xx=`You are Orbis, a warm, concise voice companion. Answer the user directly in a natural, spoken style — one or two short sentences. No markdown, no lists, no emoji. Do not describe yourself or mention being an AI unless the user explicitly asks who or what you are.`,Sx=new class{worker=null;messages=[{role:`system`,content:xx}];loaded=!1;loading=null;loadResolve=null;loadReject=null;onProgress=null;acc=``;onToken=null;genResolve=null;fileProg=new Map;get isLoaded(){return this.loaded}ensureWorker(){this.worker||(this.worker=new Worker(new URL(`/demo/assets/llm.worker-Bfp8AhaW.js`,``+import.meta.url),{type:`module`}),this.worker.addEventListener(`message`,e=>this.onMessage(e)))}load(e){return this.onProgress=e,this.loaded?Promise.resolve():this.loading?this.loading:(this.ensureWorker(),this.loading=new Promise((e,t)=>{this.loadResolve=e,this.loadReject=t}),this.worker.postMessage({type:`load`}),this.loading)}async complete(e,t){return!this.loaded||!this.worker?``:(this.messages.push({role:`user`,content:e}),this.acc=``,this.onToken=t??null,await new Promise(e=>{this.genResolve=e,this.worker.postMessage({type:`generate`,data:this.messages})}),this.messages.push({role:`assistant`,content:this.acc}),this.acc)}onMessage(e){let{type:t,data:n}=e.data??{};switch(t){case`progress`:this.onProgress?.(`downloading`,bx(this.fileProg,n));break;case`ready`:this.loaded=!0,this.onProgress?.(`ready`,100),this.loadResolve?.(),this.loadResolve=this.loadReject=null;break;case`token`:{let e=String(n??``);this.acc+=e,this.onToken?.(this.acc,e);break}case`done`:this.genResolve?.(),this.genResolve=null;break;case`error`:this.onProgress?.(`error: `+String(n),null),this.loadReject?.(Error(String(n))),this.loadResolve=this.loadReject=null,this.genResolve?.(),this.genResolve=null;break}}};function Cx(e){let t=0;for(let n=0;ne.stop()),!0}catch{return!1}}async function Ex(e){let t=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0}}),n=new AudioContext({sampleRate:16e3});n.state===`suspended`&&await n.resume();let r=n.createMediaStreamSource(t),i=n.createAnalyser();i.fftSize=1024,r.connect(i);let a=n.createScriptProcessor(4096,1,1),o=[];a.onaudioprocess=e=>{o.push(new Float32Array(e.inputBuffer.getChannelData(0)))},r.connect(a),a.connect(n.destination);let s=new Float32Array(i.fftSize),c=performance.now(),l=!1,u=c,d=!1,f=()=>{if(!wx)return;i.getFloatTimeDomainData(s);let t=Cx(s);vx(t);let n=performance.now();t>.015&&(l=!0,u=n),!d&&e&&(l&&n-u>1300||!l&&n-c>6e3||n-c>2e4)&&(d=!0,e()),wx&&(wx.raf=requestAnimationFrame(f))};wx={ctx:n,stream:t,node:a,analyser:i,chunks:o,raf:0},f()}async function Dx(){if(!wx)return new Float32Array;let e=wx;wx=null,cancelAnimationFrame(e.raf),vx(0);try{e.node.disconnect(),e.analyser.disconnect()}catch{}e.stream.getTracks().forEach(e=>e.stop());let t=e.chunks.reduce((e,t)=>e+t.length,0),n=new Float32Array(t),r=0;for(let t of e.chunks)n.set(t,r),r+=t.length;try{await e.ctx.close()}catch{}return n}var Ox=null,kx=null,Ax=0,jx=0,Mx=!0,Nx=!1,Px=0,Fx=null,Ix=0,Lx=1500;function Rx(){return Ox||(Ox=new AudioContext,kx=Ox.createAnalyser(),kx.fftSize=1024,kx.connect(Ox.destination)),Ox}function zx(){if(!Fx)return;cancelAnimationFrame(Ix),yx(0);let e=Fx;Fx=null,e()}function Bx(){let e=kx;if(!e)return;let t=new Float32Array(e.fftSize);cancelAnimationFrame(Ix);let n=()=>{if(!Fx)return;e.getFloatTimeDomainData(t);let r=Cx(t);yx(r);let i=performance.now();if(r>.01&&(Px=i),Nx&&i-Px>Lx){zx();return}Ix=requestAnimationFrame(n)};n()}function Vx(){let e=Rx();e.state===`suspended`&&e.resume(),Ax=e.currentTime,jx=0,Mx=!1,Nx=!1,Px=performance.now();let t=new Promise(e=>{Fx=e});return Bx(),t}function Hx(e,t){let n=Ox,r=kx;if(!n||!r||e.length===0)return;let i=n.createBuffer(1,e.length,t);i.getChannelData(0).set(e);let a=n.createBufferSource();a.buffer=i,a.connect(r);let o=Math.max(n.currentTime,Ax);a.start(o),Ax=o+i.duration,Nx=!0,Px=performance.now(),jx++,a.onended=()=>{jx--,jx===0&&Mx&&zx()}}function Ux(){Mx=!0,jx===0&&zx()}var Wx=`af_heart`,Gx=new class{onProgress=null;speech=null;speechLoaded=!1;speechLoading=null;speechResolve=null;speechReject=null;pendingTranscribe=null;speechFileProg=new Map;listening=!1;busy=!1;transitioning=!1;firstChunk=!1;init(){C(`session`,{event:`start`,session_id:`demo`}),C(`bot-state`,{state:`idle`})}get ready(){return Sx.isLoaded&&this.speechLoaded}get voiceReady(){return this.speechLoaded}get isListening(){return this.listening}get isBusy(){return this.busy||this.transitioning}async load(e){this.onProgress=e,await Sx.load((t,n)=>e(t===`ready`?`Brain ready`:`Downloading brain`,n)),await this.loadSpeech((t,n)=>e(t===`ready`?`Voice ready`:`Downloading voice`,n))}loadSpeech(e){return this.speechLoaded?Promise.resolve():this.speechLoading?this.speechLoading:(this.speech||(this.speech=new Worker(new URL(`/demo/assets/speech.worker-DS1vd6BU.js`,``+import.meta.url),{type:`module`}),this.speech.addEventListener(`message`,t=>this.onSpeech(t,e))),this.speechLoading=new Promise((e,t)=>{this.speechResolve=e,this.speechReject=t}),this.speech.postMessage({type:`load`}),this.speechLoading)}async activate(){if(!(this.busy||this.transitioning)){if(this.listening){await this.stopListening();return}if(!this.ready){this.transitioning=!0;try{await Tx(),await this.load(this.onProgress??(()=>{}))}finally{this.transitioning=!1}}await this.startListening()}}setListening(e){e?!this.listening&&!this.busy&&!this.transitioning&&this.activate():this.stopListening()}async startListening(){if(!(!this.ready||this.listening||this.busy)){this.listening=!0,C(`bot-state`,{state:`listening`});try{await Ex(()=>{this.stopListening()})}catch{this.listening=!1,C(`bot-state`,{state:`idle`})}}}async stopListening(){if(!this.listening)return;this.listening=!1;let e=await Dx();if(console.info(`[orbis-demo] captured`,e.length,`samples`),e.length<8e3){C(`bot-state`,{state:`idle`});return}C(`bot-state`,{state:`thinking`});let t=await this.transcribe(e);if(console.info(`[orbis-demo] transcript:`,JSON.stringify(t)),!t){C(`bot-state`,{state:`idle`});return}await this.handleInput(t)}async submitText(e){if(!(this.busy||this.listening||this.transitioning)){if(!this.ready){this.transitioning=!0;try{await this.load(this.onProgress??(()=>{}))}finally{this.transitioning=!1}}await this.handleInput(e)}}async handleInput(e){this.busy=!0,this.firstChunk=!0,C(`transcript`,{source:`user`,text:e,final:!0}),C(`bot-state`,{state:`thinking`});try{let t=Vx();this.speech.postMessage({type:`tts-start`,data:{voice:Wx}});let n=await Sx.complete(e,(e,t)=>{C(`transcript`,{source:`bot`,text:e,final:!1}),t&&this.speech.postMessage({type:`tts-push`,data:{text:t}})});console.info(`[orbis-demo] reply:`,JSON.stringify(n)),C(`transcript`,{source:`bot`,text:n,final:!0}),this.speech.postMessage({type:`tts-close`}),await t}finally{C(`bot-state`,{state:`idle`}),this.busy=!1}}transcribe(e){return new Promise(t=>{this.pendingTranscribe=t,this.speech.postMessage({type:`transcribe`,data:{audio:e}},[e.buffer])})}onSpeech(e,t){let{type:n,data:r,text:i,pcm:a,rate:o}=e.data??{};switch(n){case`progress`:t(`downloading`,bx(this.speechFileProg,r));break;case`ready`:this.speechLoaded=!0,this.speechResolve?.(),this.speechResolve=this.speechReject=null;break;case`transcript`:this.pendingTranscribe?.(String(i??``)),this.pendingTranscribe=null;break;case`tts-chunk`:this.firstChunk&&(this.firstChunk=!1,C(`bot-state`,{state:`speaking`})),Hx(a,o);break;case`tts-done`:Ux();break;case`error`:console.error(`[orbis-demo] speech worker error:`,r),this.speechReject?.(Error(String(r))),this.speechResolve=this.speechReject=null,this.pendingTranscribe?.(``),this.pendingTranscribe=null;break}}};async function Kx(e,t){switch(e){case`api_request`:return hx(t);case`backend_url`:return null;case`boot_status`:return JSON.stringify({stage:`ready`,detail:`Ready`});case`get_audio_level`:return 0;case`get_audio_levels`:return _x();case`list_audio_inputs`:case`list_audio_outputs`:return[];case`get_audio_input_mode`:return`half_duplex`;case`get_microphone_permission_status`:return`granted`;case`mic_listening`:return!1;case`get_activation_config`:return{enabled:!1,model:null,threshold:.5,listen_window_secs:30,full_duplex:!1};case`get_discoverable`:return!1;case`surface_enabled`:return!1;case`open_url`:{let e=t.url;return e&&window.open(e,`_blank`,`noopener,noreferrer`),null}case`set_mic_listening`:return Gx.setListening(!!t.on),null;case`set_mic_muted`:case`set_input_device`:case`set_output_device`:case`start_audio_engine`:case`set_activation_config`:case`set_full_duplex`:case`set_discoverable`:case`request_microphone_permission`:case`open_microphone_settings`:case`reveal_logs`:case`clear_browsing_data`:case`show_main`:case`open_widget_window`:case`close_widget_window`:return null;default:return console.warn(`[demo] unhandled invoke('${e}')`),null}}async function qx(e,t){return Kx(e,t??{})}function Jx(){return Jx=Object.assign?Object.assign.bind():function(e){for(var t=1;te.size),i=dv(e=>e.viewport),a=typeof e==`number`?e:r.width*i.dpr,o=typeof t==`number`?t:r.height*i.dpr,s=(typeof e==`number`?n:e)||{},{samples:c=0,depth:l,...u}=s,d=l??s.depthBuffer,f=v.useMemo(()=>{let e=new zr(a,o,{minFilter:Ae,magFilter:Ae,type:Ve,...u});return d&&(e.depthTexture=new ec(a,o,Be)),e.samples=c,e},[]);return v.useLayoutEffect(()=>{f.setSize(a,o),c&&(f.samples=c)},[c,f,a,o]),v.useEffect(()=>()=>f.dispose(),[]),f}function Xx(e,t,n,r){var i;return i=class extends tu{constructor(i){super({vertexShader:t,fragmentShader:n,...i});for(let t in e)this.uniforms[t]=new Cf(e[t]),Object.defineProperty(this,t,{get(){return this.uniforms[t].value},set(e){this.uniforms[t].value=e}});this.uniforms=Ql.clone(this.uniforms),r?.(this)}},i.key=_r.generateUUID(),i}var Zx=Xx({},`void main() { }`,`void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); discard; }`),Qx=class extends iu{constructor(e=6,t=!1){super(),this.uniforms={chromaticAberration:{value:.05},transmission:{value:0},_transmission:{value:1},transmissionMap:{value:null},roughness:{value:0},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:1/0},attenuationColor:{value:new G(`white`)},anisotropicBlur:{value:.1},time:{value:0},distortion:{value:0},distortionScale:{value:.5},temporalDistortion:{value:0},buffer:{value:null}},this.onBeforeCompile=n=>{n.uniforms={...n.uniforms,...this.uniforms},this.anisotropy>0&&(n.defines.USE_ANISOTROPY=``),t?n.defines.USE_SAMPLER=``:n.defines.USE_TRANSMISSION=``,n.fragmentShader=` + uniform float chromaticAberration; + uniform float anisotropicBlur; + uniform float time; + uniform float distortion; + uniform float distortionScale; + uniform float temporalDistortion; + uniform sampler2D buffer; + + vec3 random3(vec3 c) { + float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); + vec3 r; + r.z = fract(512.0*j); + j *= .125; + r.x = fract(512.0*j); + j *= .125; + r.y = fract(512.0*j); + return r-0.5; + } + + uint hash( uint x ) { + x += ( x << 10u ); + x ^= ( x >> 6u ); + x += ( x << 3u ); + x ^= ( x >> 11u ); + x += ( x << 15u ); + return x; + } + + // Compound versions of the hashing algorithm I whipped together. + uint hash( uvec2 v ) { return hash( v.x ^ hash(v.y) ); } + uint hash( uvec3 v ) { return hash( v.x ^ hash(v.y) ^ hash(v.z) ); } + uint hash( uvec4 v ) { return hash( v.x ^ hash(v.y) ^ hash(v.z) ^ hash(v.w) ); } + + // Construct a float with half-open range [0:1] using low 23 bits. + // All zeroes yields 0.0, all ones yields the next smallest representable value below 1.0. + float floatConstruct( uint m ) { + const uint ieeeMantissa = 0x007FFFFFu; // binary32 mantissa bitmask + const uint ieeeOne = 0x3F800000u; // 1.0 in IEEE binary32 + m &= ieeeMantissa; // Keep only mantissa bits (fractional part) + m |= ieeeOne; // Add fractional part to 1.0 + float f = uintBitsToFloat( m ); // Range [1:2] + return f - 1.0; // Range [0:1] + } + + // Pseudo-random value in half-open range [0:1]. + float randomBase( float x ) { return floatConstruct(hash(floatBitsToUint(x))); } + float randomBase( vec2 v ) { return floatConstruct(hash(floatBitsToUint(v))); } + float randomBase( vec3 v ) { return floatConstruct(hash(floatBitsToUint(v))); } + float randomBase( vec4 v ) { return floatConstruct(hash(floatBitsToUint(v))); } + float rand(float seed) { + float result = randomBase(vec3(gl_FragCoord.xy, seed)); + return result; + } + + const float F3 = 0.3333333; + const float G3 = 0.1666667; + + float snoise(vec3 p) { + vec3 s = floor(p + dot(p, vec3(F3))); + vec3 x = p - s + dot(s, vec3(G3)); + vec3 e = step(vec3(0.0), x - x.yzx); + vec3 i1 = e*(1.0 - e.zxy); + vec3 i2 = 1.0 - e.zxy*(1.0 - e); + vec3 x1 = x - i1 + G3; + vec3 x2 = x - i2 + 2.0*G3; + vec3 x3 = x - 1.0 + 3.0*G3; + vec4 w, d; + w.x = dot(x, x); + w.y = dot(x1, x1); + w.z = dot(x2, x2); + w.w = dot(x3, x3); + w = max(0.6 - w, 0.0); + d.x = dot(random3(s), x); + d.y = dot(random3(s + i1), x1); + d.z = dot(random3(s + i2), x2); + d.w = dot(random3(s + 1.0), x3); + w *= w; + w *= w; + d *= w; + return dot(d, vec4(52.0)); + } + + float snoiseFractal(vec3 m) { + return 0.5333333* snoise(m) + +0.2666667* snoise(2.0*m) + +0.1333333* snoise(4.0*m) + +0.0666667* snoise(8.0*m); + } +`+n.fragmentShader,n.fragmentShader=n.fragmentShader.replace(`#include `,` + #ifdef USE_TRANSMISSION + // Transmission code is based on glTF-Sampler-Viewer + // https://github.com/KhronosGroup/glTF-Sample-Viewer + uniform float _transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + // Direction of refracted light. + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + // Compute rotation-independant scaling of the model matrix. + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + // The thickness is specified in local space. + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and + // an IOR of 1.5 results in the default amount of microfacet refraction. + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + #ifdef USE_SAMPLER + #ifdef texture2DLodEXT + return texture2DLodEXT(transmissionSamplerMap, fragCoord.xy, framebufferLod); + #else + return texture2D(transmissionSamplerMap, fragCoord.xy, framebufferLod); + #endif + #else + return texture2D(buffer, fragCoord.xy); + #endif + } + vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + // Attenuation distance is +∞, i.e. the transmitted color is not attenuated at all. + return radiance; + } else { + // Compute light attenuation using Beer's law. + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); // Beer's law + return transmittance * radiance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + // Sample framebuffer to get pixel the refracted ray hits. + vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance ); + // Get the specular component. + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a ); + } + #endif +`),n.fragmentShader=n.fragmentShader.replace(`#include `,` + // Improve the refraction to use the world pos + material.transmission = _transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vUv ).g; + #endif + + vec3 pos = vWorldPosition; + float runningSeed = 0.0; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec3 transmission = vec3(0.0); + float transmissionR, transmissionB, transmissionG; + float randomCoords = rand(runningSeed++); + float thickness_smear = thickness * max(pow(roughnessFactor, 0.33), anisotropicBlur); + vec3 distortionNormal = vec3(0.0); + vec3 temporalOffset = vec3(time, -time, -time) * temporalDistortion; + if (distortion > 0.0) { + distortionNormal = distortion * vec3(snoiseFractal(vec3((pos * distortionScale + temporalOffset))), snoiseFractal(vec3(pos.zxy * distortionScale - temporalOffset)), snoiseFractal(vec3(pos.yxz * distortionScale + temporalOffset))); + } + for (float i = 0.0; i < ${e}.0; i ++) { + vec3 sampleNorm = normalize(n + roughnessFactor * roughnessFactor * 2.0 * normalize(vec3(rand(runningSeed++) - 0.5, rand(runningSeed++) - 0.5, rand(runningSeed++) - 0.5)) * pow(rand(runningSeed++), 0.33) + distortionNormal); + transmissionR = getIBLVolumeRefraction( + sampleNorm, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness + thickness_smear * (i + randomCoords) / float(${e}), + material.attenuationColor, material.attenuationDistance + ).r; + transmissionG = getIBLVolumeRefraction( + sampleNorm, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.ior * (1.0 + chromaticAberration * (i + randomCoords) / float(${e})) , material.thickness + thickness_smear * (i + randomCoords) / float(${e}), + material.attenuationColor, material.attenuationDistance + ).g; + transmissionB = getIBLVolumeRefraction( + sampleNorm, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.ior * (1.0 + 2.0 * chromaticAberration * (i + randomCoords) / float(${e})), material.thickness + thickness_smear * (i + randomCoords) / float(${e}), + material.attenuationColor, material.attenuationDistance + ).b; + transmission.r += transmissionR; + transmission.g += transmissionG; + transmission.b += transmissionB; + } + transmission /= ${e}.0; + totalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n`)},Object.keys(this.uniforms).forEach(e=>Object.defineProperty(this,e,{get:()=>this.uniforms[e].value,set:t=>this.uniforms[e].value=t}))}},$x=v.forwardRef(({buffer:e,transmissionSampler:t=!1,backside:n=!1,side:r=0,transmission:i=1,thickness:a=0,backsideThickness:o=0,backsideEnvMapIntensity:s=1,samples:c=10,resolution:l,backsideResolution:u,background:d,anisotropy:f,anisotropicBlur:p,...m},h)=>{Lv({MeshTransmissionMaterial:Qx});let g=v.useRef(null),[_]=v.useState(()=>new Zx),y=Yx(u||l),b=Yx(l),x,S,C,w;return fv(e=>{g.current.time=e.clock.elapsedTime,g.current.buffer===b.texture&&!t&&(w=g.current.__r3f.parent?.object,w&&(C=e.gl.toneMapping,x=e.scene.background,S=g.current.envMapIntensity,e.gl.toneMapping=0,d&&(e.scene.background=d),w.material=_,n&&(e.gl.setRenderTarget(y),e.gl.render(e.scene,e.camera),w.material=g.current,w.material.buffer=y.texture,w.material.thickness=o,w.material.side=1,w.material.envMapIntensity=s),e.gl.setRenderTarget(b),e.gl.render(e.scene,e.camera),w.material=g.current,w.material.thickness=a,w.material.side=r,w.material.buffer=b.texture,w.material.envMapIntensity=S,e.scene.background=x,e.gl.setRenderTarget(null),e.gl.toneMapping=C))}),v.useImperativeHandle(h,()=>g.current,[]),v.createElement(`meshTransmissionMaterial`,Jx({args:[c,t],ref:g},m,{buffer:e||b.texture,_transmission:i,anisotropicBlur:p??f,transmission:t?i:0,thickness:a,side:r}))}),eS=parseInt(`184`.replace(/\D+/g,``)),tS=e=>e&&e.isCubeTexture,nS=class extends xo{constructor(e,t){let n=tS(e),r=((n?e.image[0]?.width:e.image.width)??1024)/4,i=Math.floor(Math.log2(r)),a=2**i,o=3*Math.max(a,112),s=4*a,c=[n?`#define ENVMAP_TYPE_CUBE`:``,`#define CUBEUV_TEXEL_WIDTH ${1/o}`,`#define CUBEUV_TEXEL_HEIGHT ${1/s}`,`#define CUBEUV_MAX_MIP ${i}.0`].join(` +`)+` + #define ENVMAP_TYPE_CUBE_UV + varying vec3 vWorldPosition; + uniform float radius; + uniform float height; + uniform float angle; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube map; + #else + uniform sampler2D map; + #endif + // From: https://www.shadertoy.com/view/4tsBD7 + float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) + { + float d = dot ( rd, n ); + + if( d > 0.0 ) { return 1e6; } + + vec3 o = ro - c; + float t = - dot( n, o ) / d; + vec3 q = o + rd * t; + + return ( dot( q, q ) < r * r ) ? t : 1e6; + } + // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm + float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) + { + vec3 oc = ro - ce; + float b = dot( oc, rd ); + float c = dot( oc, oc ) - ra * ra; + float h = b * b - c; + + if( h < 0.0 ) { return -1.0; } + + h = sqrt( h ); + + return - b + h; + } + vec3 project() + { + vec3 p = normalize( vWorldPosition ); + vec3 camPos = cameraPosition; + camPos.y -= height; + float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius ); + if( intersection > 0.0 ) { + + vec3 h = vec3( 0.0, - height, 0.0 ); + float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius ); + p = ( camPos + min( intersection, intersection2 ) * p ) / radius; + } else { + p = vec3( 0.0, 1.0, 0.0 ); + } + return p; + } + #include + #include + void main() + { + vec3 projectedWorldPosition = project(); + + #ifdef ENVMAP_TYPE_CUBE + vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb; + #else + vec3 direction = normalize( projectedWorldPosition ); + vec2 uv = equirectUv( direction ); + vec3 outcolor = texture2D( map, uv ).rgb; + #endif + gl_FragColor = vec4( outcolor, 1.0 ); + #include + #include <${eS>=154?`colorspace_fragment`:`encodings_fragment`}> + } + `,l={map:{value:e},height:{value:t?.height||15},radius:{value:t?.radius||100}},u=new Ml(1,16),d=new tu({uniforms:l,fragmentShader:c,vertexShader:` + varying vec3 vWorldPosition; + void main() + { + vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) ); + vWorldPosition = worldPosition.xyz; + + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + } + `,side:2});super(u,d)}set radius(e){this.material.uniforms.radius.value=e}get radius(){return this.material.uniforms.radius.value}set height(e){this.material.uniforms.height.value=e}get height(){return this.material.uniforms.height.value}},rS=class extends Ju{constructor(e){super(e),this.type=Ve}parse(e){let t=function(e,t){switch(e){case 1:throw Error(`THREE.RGBELoader: Read Error: `+(t||``));case 2:throw Error(`THREE.RGBELoader: Write Error: `+(t||``));case 3:throw Error(`THREE.RGBELoader: Bad File Format: `+(t||``));default:case 4:throw Error(`THREE.RGBELoader: Memory Error: `+(t||``))}},n=function(e,t,n){t||=1024;let r=e.pos,i=-1,a=0,o=``,s=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));for(;0>(i=s.indexOf(` +`))&&a=e.byteLength||!(l=n(e)))&&t(1,`no header found`),(u=l.match(r))||t(3,`bad initial token`),c.valid|=1,c.programtype=u[1],c.string+=l+` +`;l=n(e),!1!==l;){if(c.string+=l+` +`,l.charAt(0)===`#`){c.comments+=l+` +`;continue}if((u=l.match(i))&&(c.gamma=parseFloat(u[1])),(u=l.match(a))&&(c.exposure=parseFloat(u[1])),(u=l.match(o))&&(c.valid|=2,c.format=u[1]),(u=l.match(s))&&(c.valid|=4,c.height=parseInt(u[1],10),c.width=parseInt(u[2],10)),c.valid&2&&c.valid&4)break}return c.valid&2||t(3,`missing format specifier`),c.valid&4||t(3,`missing image size specifier`),c},i=function(e,n,r){let i=n;if(i<8||i>32767||e[0]!==2||e[1]!==2||e[2]&128)return new Uint8Array(e);i!==(e[2]<<8|e[3])&&t(3,`wrong scanline width`);let a=new Uint8Array(4*n*r);a.length||t(4,`unable to allocate buffer space`);let o=0,s=0,c=4*i,l=new Uint8Array(4),u=new Uint8Array(c),d=r;for(;d>0&&se.byteLength&&t(1),l[0]=e[s++],l[1]=e[s++],l[2]=e[s++],l[3]=e[s++],(l[0]!=2||l[1]!=2||(l[2]<<8|l[3])!=i)&&t(3,`bad rgbe scanline format`);let n=0,r;for(;n128;if(i&&(r-=128),(r===0||n+r>c)&&t(3,`bad scanline data`),i){let t=e[s++];for(let e=0;e>>1|(_S&21845)<<1;vS=(vS&52428)>>>2|(vS&13107)<<2,vS=(vS&61680)>>>4|(vS&3855)<<4,gS[_S]=((vS&65280)>>>8|(vS&255)<<8)>>>1}for(var yS=(function(e,t,n){for(var r=e.length,i=0,a=new aS(t);i>>c]=l}else for(s=new aS(r),i=0;i>>15-e[i]);return s}),bS=new iS(288),_S=0;_S<144;++_S)bS[_S]=8;for(var _S=144;_S<256;++_S)bS[_S]=9;for(var _S=256;_S<280;++_S)bS[_S]=7;for(var _S=280;_S<288;++_S)bS[_S]=8;for(var xS=new iS(32),_S=0;_S<32;++_S)xS[_S]=5;var SS=yS(bS,9,1),CS=yS(xS,5,1),wS=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},TS=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},ES=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},DS=function(e){return(e/8|0)+(e&7&&1)},OS=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof aS?aS:e instanceof oS?oS:iS)(n-t);return r.set(e.subarray(t,n)),r},kS=function(e,t,n){var r=e.length;if(!r||n&&!n.l&&r<5)return t||new iS(0);var i=!t||n,a=!n||n.i;n||={},t||=new iS(r*3);var o=function(e){var n=t.length;if(e>n){var r=new iS(Math.max(n*2,e));r.set(t),t=r}},s=n.f||0,c=n.p||0,l=n.b||0,u=n.l,d=n.d,f=n.m,p=n.n,m=r*8;do{if(!u){n.f=s=TS(e,c,1);var h=TS(e,c+1,3);if(c+=3,!h){var g=DS(c)+4,_=e[g-4]|e[g-3]<<8,v=g+_;if(v>r){if(a)throw`unexpected EOF`;break}i&&o(l+_),t.set(e.subarray(g,v),l),n.b=l+=_,n.p=c=v*8;continue}else if(h==1)u=SS,d=CS,f=9,p=5;else if(h==2){var y=TS(e,c,31)+257,b=TS(e,c+10,15)+4,x=y+TS(e,c+5,31)+1;c+=14;for(var S=new iS(x),C=new iS(19),w=0;w>>4;if(g<16)S[w++]=g;else{var k=0,A=0;for(g==16?(A=3+TS(e,c,3),c+=2,k=S[w-1]):g==17?(A=3+TS(e,c,7),c+=3):g==18&&(A=11+TS(e,c,127),c+=7);A--;)S[w++]=k}}var ee=S.subarray(0,y),te=S.subarray(y);f=wS(ee),p=wS(te),u=yS(ee,f,1),d=yS(te,p,1)}else throw`invalid block type`;if(c>m){if(a)throw`unexpected EOF`;break}}i&&o(l+131072);for(var j=(1<>>4;if(c+=k&15,c>m){if(a)throw`unexpected EOF`;break}if(!k)throw`invalid length/literal`;if(M<256)t[l++]=M;else if(M==256){re=c,u=null;break}else{var N=M-254;if(M>264){var w=M-257,ie=sS[w];N=TS(e,c,(1<>>4;if(!ae)throw`invalid distance`;c+=ae&15;var te=hS[oe];if(oe>3){var ie=cS[oe];te+=ES(e,c)&(1<m){if(a)throw`unexpected EOF`;break}i&&o(l+131072);for(var se=l+N;l>>4>7||(e[0]<<8|e[1])%31)throw`invalid zlib data`;if(e[1]&32)throw`invalid zlib data: preset dictionaries not supported`};function MS(e,t){return kS((jS(e),e.subarray(2,-4)),t)}var NS=typeof TextDecoder<`u`&&new TextDecoder;try{NS.decode(AS,{stream:!0})}catch{}var PS=eS>=152,FS=class extends Ju{constructor(e){super(e),this.type=Ve}parse(e){let t=65536,n=8192,r=65537,i=16384,a=i-1,o=65535,s=2.7182818**2.2;function c(e,n){for(var r=0,i=0;i>3]&1<<(i&7))&&(n[r++]=i);for(var a=r-1;r>n&(1<0;--t){var i=n+f[t]>>1;f[t]=n,n=i}for(var t=0;t0&&(e[t]=a|f[a]++<<6)}}function m(e,t,n,r,i,a,o){for(var s=n,c=0,l=0;i<=a;i++){if(s.value-n.value>r)return!1;d(6,c,l,e,s);var f=u.l;if(c=u.c,l=u.lc,o[i]=f,f==63){if(s.value-n.value>r)throw`Something wrong with hufUnpackEncTable`;d(8,c,l,e,s);var m=u.l+6;if(c=u.c,l=u.lc,i+m>a+1)throw`Something wrong with hufUnpackEncTable`;for(;m--;)o[i++]=0;i--}else if(f>=59){var m=f-59+2;if(i+m>a+1)throw`Something wrong with hufUnpackEncTable`;for(;m--;)o[i++]=0;i--}}p(o)}function h(e){return e&63}function g(e){return e>>6}function _(e,t,n,r){for(;t<=n;t++){var i=g(e[t]),a=h(e[t]);if(i>>a)throw`Invalid table entry`;if(a>14){var o=r[i>>a-14];if(o.len)throw`Invalid table entry`;if(o.lit++,o.p){var s=o.p;o.p=Array(o.lit);for(var c=0;c0;c--){var o=r[(i<<14-a)+l];if(o.len||o.p)throw`Invalid table entry`;o.len=a,o.lit=t,l++}}return!0}let v={c:0,lc:0};function y(e,t,n,r){e=e<<8|ye(n,r),t+=8,v.c=e,v.lc=t}let b={c:0,lc:0};function x(e,t,n,r,i,a,o,s,c,l){if(e==t){r<8&&(y(n,r,i,o),n=v.c,r=v.lc),r-=8;var u=n>>r,u=new Uint8Array([u])[0];if(c.value+u>l)return!1;for(var d=s[c.value-1];u-->0;)s[c.value++]=d}else if(c.value32767?t-65536:t}let w={a:0,b:0};function T(e,t){var n=C(e),r=C(t),i=n+(r&1)+(r>>1),a=i,o=i-r;w.a=a,w.b=o}function E(e,t){var n=S(e),r=S(t),i=n-(r>>1)&o;w.a=r+i-32768&o,w.b=i}function D(e,t,n,r,i,a,o){for(var s=o<16384,c=n>i?i:n,l=1,u;l<=c;)l<<=1;for(l>>=1,u=l,l>>=1;l>=1;){for(var d=0,f=d+a*(i-u),p=a*l,m=a*u,h=r*l,g=r*u,_,v,y,b;d<=f;d+=m){for(var x=d,S=d+r*(n-u);x<=S;x+=g){var C=x+h,D=x+p,O=D+h;s?(T(e[x+t],e[D+t]),_=w.a,y=w.b,T(e[C+t],e[O+t]),v=w.a,b=w.b,T(_,v),e[x+t]=w.a,e[C+t]=w.b,T(y,b),e[D+t]=w.a,e[O+t]=w.b):(E(e[x+t],e[D+t]),_=w.a,y=w.b,E(e[C+t],e[O+t]),v=w.a,b=w.b,E(_,v),e[x+t]=w.a,e[C+t]=w.b,E(y,b),e[D+t]=w.a,e[O+t]=w.b)}if(n&l){var D=x+p;s?T(e[x+t],e[D+t]):E(e[x+t],e[D+t]),_=w.a,e[D+t]=w.b,e[x+t]=_}}if(i&l)for(var x=d,S=d+r*(n-u);x<=S;x+=g){var C=x+h;s?T(e[x+t],e[C+t]):E(e[x+t],e[C+t]),_=w.a,e[C+t]=w.b,e[x+t]=_}u=l,l>>=1}return d}function O(e,t,n,r,i,o,s,c,l,u){for(var d=0,f=0,p=c,m=Math.trunc(i.value+(o+7)/8);i.value=14;){var _=t[d>>f-14&a];if(_.len)f-=_.len,x(_.lit,s,d,f,n,r,i,l,u,p),d=b.c,f=b.lc;else{if(!_.p)throw`hufDecode issues`;var S;for(S=0;S<_.lit;S++){for(var C=h(e[_.p[S]]);f=C&&g(e[_.p[S]])==(d>>f-C&(1<>=w,f-=w;f>0;){var _=t[d<<14-f&a];if(_.len)f-=_.len,x(_.lit,s,d,f,n,r,i,l,u,p),d=b.c,f=b.lc;else throw`hufDecode issues`}return!0}function k(e,t,n,a,o,s){var c={value:0},u=n.value,d=ve(t,n),f=ve(t,n);n.value+=4;var p=ve(t,n);if(n.value+=4,d<0||d>=r||f<0||f>=r)throw`Something wrong with HUF_ENCSIZE`;var h=Array(r),g=Array(i);if(l(g),m(e,t,n,a-(n.value-u),d,f,h),p>8*(a-(n.value-u)))throw`Something wrong with hufUncompress`;_(h,d,f,g),O(h,g,e,t,n,p,f,s,o,c)}function A(e,t,n){for(var r=0;ra||(t[i++]=e[n++],i>a));)t[i++]=e[r++]}function j(e){for(var t=e.byteLength,n=[],r=0,i=new DataView(e);t>0;){var a=i.getInt8(r++);if(a<0){var o=-a;t-=o+1;for(var s=0;s>8==255?i+=r&255:(n[i]=r,i++),e.value++}function M(e,t){t[0]=F(e[0]),t[1]=F(e[1]),t[2]=F(e[5]),t[3]=F(e[6]),t[4]=F(e[14]),t[5]=F(e[15]),t[6]=F(e[27]),t[7]=F(e[28]),t[8]=F(e[2]),t[9]=F(e[4]),t[10]=F(e[7]),t[11]=F(e[13]),t[12]=F(e[16]),t[13]=F(e[26]),t[14]=F(e[29]),t[15]=F(e[42]),t[16]=F(e[3]),t[17]=F(e[8]),t[18]=F(e[12]),t[19]=F(e[17]),t[20]=F(e[25]),t[21]=F(e[30]),t[22]=F(e[41]),t[23]=F(e[43]),t[24]=F(e[9]),t[25]=F(e[11]),t[26]=F(e[18]),t[27]=F(e[24]),t[28]=F(e[31]),t[29]=F(e[40]),t[30]=F(e[44]),t[31]=F(e[53]),t[32]=F(e[10]),t[33]=F(e[19]),t[34]=F(e[23]),t[35]=F(e[32]),t[36]=F(e[39]),t[37]=F(e[45]),t[38]=F(e[52]),t[39]=F(e[54]),t[40]=F(e[20]),t[41]=F(e[22]),t[42]=F(e[33]),t[43]=F(e[38]),t[44]=F(e[46]),t[45]=F(e[51]),t[46]=F(e[55]),t[47]=F(e[60]),t[48]=F(e[21]),t[49]=F(e[34]),t[50]=F(e[37]),t[51]=F(e[47]),t[52]=F(e[50]),t[53]=F(e[56]),t[54]=F(e[59]),t[55]=F(e[61]),t[56]=F(e[35]),t[57]=F(e[36]),t[58]=F(e[48]),t[59]=F(e[49]),t[60]=F(e[57]),t[61]=F(e[58]),t[62]=F(e[62]),t[63]=F(e[63])}function N(e){let t=.5*Math.cos(3.14159/4),n=.5*Math.cos(3.14159/16),r=.5*Math.cos(3.14159/8),i=.5*Math.cos(3*3.14159/16),a=.5*Math.cos(5*3.14159/16),o=.5*Math.cos(3*3.14159/8),s=.5*Math.cos(7*3.14159/16);for(var c=[,,,,],l=[,,,,],u=[,,,,],d=[,,,,],f=0;f<8;++f){var p=f*8;c[0]=r*e[p+2],c[1]=o*e[p+2],c[2]=r*e[p+6],c[3]=o*e[p+6],l[0]=n*e[p+1]+i*e[p+3]+a*e[p+5]+s*e[p+7],l[1]=i*e[p+1]-s*e[p+3]-n*e[p+5]-a*e[p+7],l[2]=a*e[p+1]-n*e[p+3]+s*e[p+5]+i*e[p+7],l[3]=s*e[p+1]-a*e[p+3]+i*e[p+5]-n*e[p+7],u[0]=t*(e[p+0]+e[p+4]),u[3]=t*(e[p+0]-e[p+4]),u[1]=c[0]+c[3],u[2]=c[1]-c[2],d[0]=u[0]+u[1],d[1]=u[3]+u[2],d[2]=u[3]-u[2],d[3]=u[0]-u[1],e[p+0]=d[0]+l[0],e[p+1]=d[1]+l[1],e[p+2]=d[2]+l[2],e[p+3]=d[3]+l[3],e[p+4]=d[3]-l[3],e[p+5]=d[2]-l[2],e[p+6]=d[1]-l[1],e[p+7]=d[0]-l[0]}for(var m=0;m<8;++m)c[0]=r*e[16+m],c[1]=o*e[16+m],c[2]=r*e[48+m],c[3]=o*e[48+m],l[0]=n*e[8+m]+i*e[24+m]+a*e[40+m]+s*e[56+m],l[1]=i*e[8+m]-s*e[24+m]-n*e[40+m]-a*e[56+m],l[2]=a*e[8+m]-n*e[24+m]+s*e[40+m]+i*e[56+m],l[3]=s*e[8+m]-a*e[24+m]+i*e[40+m]-n*e[56+m],u[0]=t*(e[m]+e[32+m]),u[3]=t*(e[m]-e[32+m]),u[1]=c[0]+c[3],u[2]=c[1]-c[2],d[0]=u[0]+u[1],d[1]=u[3]+u[2],d[2]=u[3]-u[2],d[3]=u[0]-u[1],e[0+m]=d[0]+l[0],e[8+m]=d[1]+l[1],e[16+m]=d[2]+l[2],e[24+m]=d[3]+l[3],e[32+m]=d[3]-l[3],e[40+m]=d[2]-l[2],e[48+m]=d[1]-l[1],e[56+m]=d[0]-l[0]}function ie(e){for(var t=0;t<64;++t){var n=e[0][t],r=e[1][t],i=e[2][t];e[0][t]=n+1.5747*i,e[1][t]=n-.1873*r-.4682*i,e[2][t]=n+1.8556*r}}function ae(e,t,n){for(var r=0;r<64;++r)t[n+r]=sa.toHalfFloat(oe(e[r]))}function oe(e){return e<=1?Math.sign(e)*Math.abs(e)**2.2:Math.sign(e)*s**(Math.abs(e)-1)}function se(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function ce(e){var t=e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size),n=new Uint8Array(j(t)),r=new Uint8Array(n.length);return ee(n),te(n,r),new DataView(r.buffer)}function le(e){var t=MS(e.array.slice(e.offset.value,e.offset.value+e.size)),n=new Uint8Array(t.length);return ee(t),te(t,n),new DataView(n.buffer)}function ue(e){for(var r=e.viewer,i={value:e.offset.value},a=new Uint16Array(e.width*e.scanlineBlockSize*(e.channels*e.type)),o=new Uint8Array(n),s=0,l=Array(e.channels),u=0;u=n)throw`Something is wrong with PIZ_COMPRESSION BITMAP_SIZE`;if(d<=f)for(var u=0;u0;){var s=pe(t.buffer,n),c=be(t,n),l=c>>2&3,u=(c>>4)-1,d=new Int8Array([u])[0],f=be(t,n);a.push({name:s,index:d,type:f,compression:l}),o-=s.length+3}for(var p=Ie.channels,m=Array(e.channels),h=0;h=0&&(v.idx[b.index]=y),g.offset=y)}if(i.acCompressedSize>0)switch(i.acCompression){case 0:var x=new Uint16Array(i.totalAcUncompressedCount);k(e.array,t,n,i.acCompressedSize,x,i.totalAcUncompressedCount);break;case 1:var S=e.array.slice(n.value,n.value+i.totalAcUncompressedCount),C=MS(S),x=new Uint16Array(C.buffer);n.value+=i.totalAcUncompressedCount;break}if(i.dcCompressedSize>0){var w={array:e.array,offset:n,size:i.dcCompressedSize},T=new Uint16Array(le(w).buffer);n.value+=i.dcCompressedSize}if(i.rleRawSize>0){var S=e.array.slice(n.value,n.value+i.rleCompressedSize),C=MS(S),E=j(C.buffer);n.value+=i.rleCompressedSize}for(var D=0,O=Array(m.length),h=0;h>10,n=e&1023;return(e>>15?-1:1)*(t?t===31?n?NaN:1/0:2**(t-15)*(1+n/1024):n/1024*6103515625e-14)}function I(e,t){var n=e.getUint16(t.value,!0);return t.value+=2,n}function Ce(e,t){return F(I(e,t))}function L(e,t,n,r){for(var i=n.value,a=[];n.valueR.height?R.height-t:R.scanlineBlockSize;let n=R.size=R.height)break;for(let e=0;e{let r;switch(e){case Fe:r=new Uint8ClampedArray(t*n*4);break;case Ve:r=new Uint16Array(t*n*4);break;case ze:r=new Uint32Array(t*n*4);break;case Ie:r=new Int8Array(t*n*4);break;case R:r=new Int16Array(t*n*4);break;case Re:r=new Int32Array(t*n*4);break;case Be:r=new Float32Array(t*n*4);break;default:throw Error(`Unsupported data type`)}return r},LS,RS=(e,t,n,r)=>{if(LS!==void 0)return LS;let i=new zr(1,1,r);t.setRenderTarget(i);let a=new xo(new Fl,new co({color:16777215}));t.render(a,n),t.setRenderTarget(null);let o=IS(e,i.width,i.height);return t.readRenderTargetPixels(i,0,0,i.width,i.height,o),i.dispose(),a.geometry.dispose(),a.material.dispose(),LS=o[0]!==0,LS},zS=class e{_renderer;_rendererIsDisposable=!1;_material;_scene;_camera;_quad;_renderTarget;_width;_height;_type;_colorSpace;_supportsReadPixels=!0;constructor(t){this._width=t.width,this._height=t.height,this._type=t.type,this._colorSpace=t.colorSpace;let n={format:Ye,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:t.renderTargetOptions?.anisotropy===void 0?1:t.renderTargetOptions?.anisotropy,generateMipmaps:t.renderTargetOptions?.generateMipmaps===void 0?!1:t.renderTargetOptions?.generateMipmaps,magFilter:t.renderTargetOptions?.magFilter===void 0?Ae:t.renderTargetOptions?.magFilter,minFilter:t.renderTargetOptions?.minFilter===void 0?Ae:t.renderTargetOptions?.minFilter,samples:t.renderTargetOptions?.samples===void 0?void 0:t.renderTargetOptions?.samples,wrapS:t.renderTargetOptions?.wrapS===void 0?L:t.renderTargetOptions?.wrapS,wrapT:t.renderTargetOptions?.wrapT===void 0?L:t.renderTargetOptions?.wrapT};if(this._material=t.material,t.renderer?this._renderer=t.renderer:(this._renderer=e.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new Di,this._camera=new md,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!RS(this._type,this._renderer,this._camera,n)){let e;switch(this._type){case Ve:e=this._renderer.extensions.has(`EXT_color_buffer_float`)?Be:void 0;break}e===void 0?(this._supportsReadPixels=!1,console.warn(`This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown`)):(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${Be}`),this._type=e)}this._quad=new xo(new Fl,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new zr(this.width,this.height,n),this._renderTarget.texture.mapping=t.renderTargetOptions?.mapping===void 0?300:t.renderTargetOptions?.mapping}static instantiateRenderer(){let e=new Jg;return e.setSize(128,128),e}render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(e){throw this._renderer.setRenderTarget(null),e}this._renderer.setRenderTarget(null)};toArray(){if(!this._supportsReadPixels)throw Error(`Can't read pixels in this browser`);let e=IS(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){let t=new Fo(this.toArray(),this.width,this.height,Ye,this._type,e?.mapping||300,e?.wrapS||1001,e?.wrapT||1001,e?.magFilter||1006,e?.minFilter||1006,e?.anisotropy||1,rn);return t.generateMipmaps=e?.generateMipmaps===void 0?!1:e?.generateMipmaps,t}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof tu&&Object.values(this.material.uniforms).forEach(e=>{e.value instanceof Ir&&e.value.dispose()}),Object.values(this.material).forEach(e=>{e instanceof Ir&&e.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}},BS=class extends Error{},VS=class extends Error{},HS=(e,t,n)=>{let r=RegExp(`${t}="([^"]*)"`,`i`).exec(e);if(r)return r[1];let i=RegExp(`<${t}[^>]*>([\\s\\S]*?)`,`i`).exec(e);if(i){let e=i[1].match(/([^<]*)<\/rdf:li>/g);return e&&e.length===3?e.map(e=>e.replace(/<\/?rdf:li>/g,``)):i[1].trim()}if(n!==void 0)return n;throw Error(`Can't find ${t} in gainmap metadata`)},US=e=>{let t;t=typeof TextDecoder<`u`?new TextDecoder().decode(e):e.toString();let n=t.indexOf(``,n),r=t.slice(n,e+10);try{let e=HS(r,`hdrgm:GainMapMin`,`0`),t=HS(r,`hdrgm:GainMapMax`),n=HS(r,`hdrgm:Gamma`,`1`),i=HS(r,`hdrgm:OffsetSDR`,`0.015625`),a=HS(r,`hdrgm:OffsetHDR`,`0.015625`),o=/hdrgm:HDRCapacityMin="([^"]*)"/.exec(r),s=o?o[1]:`0`,c=/hdrgm:HDRCapacityMax="([^"]*)"/.exec(r);if(!c)throw Error(`Incomplete gainmap metadata`);let l=c[1];return{gainMapMin:Array.isArray(e)?e.map(e=>parseFloat(e)):[parseFloat(e),parseFloat(e),parseFloat(e)],gainMapMax:Array.isArray(t)?t.map(e=>parseFloat(e)):[parseFloat(t),parseFloat(t),parseFloat(t)],gamma:Array.isArray(n)?n.map(e=>parseFloat(e)):[parseFloat(n),parseFloat(n),parseFloat(n)],offsetSdr:Array.isArray(i)?i.map(e=>parseFloat(e)):[parseFloat(i),parseFloat(i),parseFloat(i)],offsetHdr:Array.isArray(a)?a.map(e=>parseFloat(e)):[parseFloat(a),parseFloat(a),parseFloat(a)],hdrCapacityMin:parseFloat(s),hdrCapacityMax:parseFloat(l)}}catch{}n=t.indexOf(`{let r=this.options.debug,i=new DataView(e.buffer);if(i.getUint16(0)!==65496){n(Error(`Not a valid jpeg`));return}let a=i.byteLength,o=2,s=0,c;for(;o250){n(Error(`Found no marker after ${s} loops 😵`));return}if(i.getUint8(o)!==255){n(Error(`Not a valid marker at offset 0x${o.toString(16)}, found: 0x${i.getUint8(o).toString(16)}`));return}if(c=i.getUint8(o+1),r&&console.log(`Marker: ${c.toString(16)}`),c===226){r&&console.log(`Found APP2 marker (0xffe2)`);let e=o+4;if(i.getUint32(e)===1297106432){let r=e+4,a;if(i.getUint16(r)===18761)a=!1;else if(i.getUint16(r)===19789)a=!0;else{n(Error(`No valid endianness marker found in TIFF header`));return}if(i.getUint16(r+2,!a)!==42){n(Error(`Not valid TIFF data! (no 0x002A marker)`));return}let o=i.getUint32(r+4,!a);if(o<8){n(Error(`Not valid TIFF data! (First offset less than 8)`));return}let s=r+o,c=i.getUint16(s,!a),l=s+2,u=0;for(let e=l;e{let t=US(e);if(!t)throw new VS(`Gain map XMP metadata not found`);let n=await new WS({extractFII:!0,extractNonFII:!0}).extract(e);if(n.length!==2)throw new BS(`Gain map recovery image not found`);return{sdr:new Uint8Array(await n[0].arrayBuffer()),gainMap:new Uint8Array(await n[1].arrayBuffer()),metadata:t}},KS=e=>new Promise((t,n)=>{let r=document.createElement(`img`);r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=URL.createObjectURL(e)}),qS=class extends Bu{_renderer;_renderTargetOptions;_internalLoadingManager;_config;constructor(e,t){super(t),this._config=e,e.renderer&&(this._renderer=e.renderer),this._internalLoadingManager=new Ru}setRenderer(e){return this._renderer=e,this}setRenderTargetOptions(e){return this._renderTargetOptions=e,this}prepareQuadRenderer(){this._renderer||console.warn(`WARNING: A Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.`);let e=this._config.createMaterial({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new Ir,sdr:new Ir});return this._config.createQuadRenderer({width:16,height:16,type:Ve,colorSpace:rn,material:e,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async processImages(e,t,n){let r=t?new Blob([t],{type:`image/jpeg`}):void 0,i=new Blob([e],{type:`image/jpeg`}),a,o,s=!1;if(typeof createImageBitmap>`u`){let e=await Promise.all([r?KS(r):Promise.resolve(void 0),KS(i)]);o=e[0],a=e[1],s=n===`flipY`}else{let e=await Promise.all([r?createImageBitmap(r,{imageOrientation:n||`flipY`}):Promise.resolve(void 0),createImageBitmap(i,{imageOrientation:n||`flipY`})]);o=e[0],a=e[1]}return{sdrImage:a,gainMapImage:o,needsFlip:s}}createTextures(e,t,n){let r=new Ir(t||new ImageData(2,2),300,L,L,Ae,Pe,Ye,Fe,1,rn);r.flipY=n,r.needsUpdate=!0;let i=new Ir(e,300,L,L,Ae,Pe,Ye,Fe,1,nn);return i.flipY=n,i.needsUpdate=!0,{gainMap:r,sdr:i}}updateQuadRenderer(e,t,n,r,i){e.width=t.width,e.height=t.height,e.material.gainMap=n,e.material.sdr=r,e.material.gainMapMin=i.gainMapMin,e.material.gainMapMax=i.gainMapMax,e.material.offsetHdr=i.offsetHdr,e.material.offsetSdr=i.offsetSdr,e.material.gamma=i.gamma,e.material.hdrCapacityMin=i.hdrCapacityMin,e.material.hdrCapacityMax=i.hdrCapacityMax,e.material.maxDisplayBoost=2**i.hdrCapacityMax,e.material.needsUpdate=!0}},JS=` +varying vec2 vUv; + +void main() { + vUv = uv; + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); +} +`,YS=` +// min half float value +#define HALF_FLOAT_MIN vec3( -65504, -65504, -65504 ) +// max half float value +#define HALF_FLOAT_MAX vec3( 65504, 65504, 65504 ) + +uniform sampler2D sdr; +uniform sampler2D gainMap; +uniform vec3 gamma; +uniform vec3 offsetHdr; +uniform vec3 offsetSdr; +uniform vec3 gainMapMin; +uniform vec3 gainMapMax; +uniform float weightFactor; + +varying vec2 vUv; + +void main() { + vec3 rgb = texture2D( sdr, vUv ).rgb; + vec3 recovery = texture2D( gainMap, vUv ).rgb; + vec3 logRecovery = pow( recovery, gamma ); + vec3 logBoost = gainMapMin * ( 1.0 - logRecovery ) + gainMapMax * logRecovery; + vec3 hdrColor = (rgb + offsetSdr) * exp2( logBoost * weightFactor ) - offsetHdr; + vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor )); + gl_FragColor = vec4( clampedHdrColor , 1.0 ); +} +`,XS=class extends tu{_maxDisplayBoost;_hdrCapacityMin;_hdrCapacityMax;constructor({gamma:e,offsetHdr:t,offsetSdr:n,gainMapMin:r,gainMapMax:i,maxDisplayBoost:a,hdrCapacityMin:o,hdrCapacityMax:s,sdr:c,gainMap:l}){super({name:`GainMapDecoderMaterial`,vertexShader:JS,fragmentShader:YS,uniforms:{sdr:{value:c},gainMap:{value:l},gamma:{value:new U(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new U().fromArray(t)},offsetSdr:{value:new U().fromArray(n)},gainMapMin:{value:new U().fromArray(r)},gainMapMax:{value:new U().fromArray(i)},weightFactor:{value:(Math.log2(a)-o)/(s-o)}},blending:0,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=a,this._hdrCapacityMin=o,this._hdrCapacityMax=s,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){let e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){let t=this.uniforms.gamma.value;t.x=1/e[0],t.y=1/e[1],t.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){let e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}},ZS=class extends qS{constructor(e,t){super({renderer:e,createMaterial:e=>new XS(e),createQuadRenderer:e=>new zS(e)},t)}async render(e,t,n,r){let{sdrImage:i,gainMapImage:a,needsFlip:o}=await this.processImages(n,r,`flipY`),{gainMap:s,sdr:c}=this.createTextures(i,a,o);this.updateQuadRenderer(e,i,s,c,t),e.render()}},QS=class extends ZS{load([e,t,n],r,i,a){let o=this.prepareQuadRenderer(),s,c,l,u=async()=>{if(s&&c&&l){try{await this.render(o,l,s,c)}catch(r){this.manager.itemError(e),this.manager.itemError(t),this.manager.itemError(n),typeof a==`function`&&a(r),o.disposeOnDemandRenderer();return}typeof r==`function`&&r(o),this.manager.itemEnd(e),this.manager.itemEnd(t),this.manager.itemEnd(n),o.disposeOnDemandRenderer()}},d=!0,f=0,p=0,m=!0,h=0,g=0,_=!0,v=0,y=0,b=()=>{if(typeof i==`function`){let e=f+h+v,t=p+g+y;i(new ProgressEvent(`progress`,{lengthComputable:d&&m&&_,loaded:t,total:e}))}};this.manager.itemStart(e),this.manager.itemStart(t),this.manager.itemStart(n);let x=new Uu(this._internalLoadingManager);x.setResponseType(`arraybuffer`),x.setRequestHeader(this.requestHeader),x.setPath(this.path),x.setWithCredentials(this.withCredentials),x.load(e,async e=>{if(typeof e==`string`)throw Error(`Invalid sdr buffer`);s=e,await u()},e=>{d=e.lengthComputable,p=e.loaded,f=e.total,b()},t=>{this.manager.itemError(e),typeof a==`function`&&a(t)});let S=new Uu(this._internalLoadingManager);S.setResponseType(`arraybuffer`),S.setRequestHeader(this.requestHeader),S.setPath(this.path),S.setWithCredentials(this.withCredentials),S.load(t,async e=>{if(typeof e==`string`)throw Error(`Invalid gainmap buffer`);c=e,await u()},e=>{m=e.lengthComputable,g=e.loaded,h=e.total,b()},e=>{this.manager.itemError(t),typeof a==`function`&&a(e)});let C=new Uu(this._internalLoadingManager);return C.setRequestHeader(this.requestHeader),C.setPath(this.path),C.setWithCredentials(this.withCredentials),C.load(n,async e=>{if(typeof e!=`string`)throw Error(`Invalid metadata string`);l=JSON.parse(e),await u()},e=>{_=e.lengthComputable,y=e.loaded,v=e.total,b()},e=>{this.manager.itemError(n),typeof a==`function`&&a(e)}),o}},$S=class extends ZS{load(e,t,n,r){let i=this.prepareQuadRenderer(),a=new Uu(this._internalLoadingManager);return a.setResponseType(`arraybuffer`),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(this.withCredentials),this.manager.itemStart(e),a.load(e,async n=>{if(typeof n==`string`)throw Error(`Invalid buffer, received [string], was expecting [ArrayBuffer]`);let a=new Uint8Array(n),o,s,c;try{let e=await GS(a);o=e.sdr,s=e.gainMap,c=e.metadata}catch(t){if(t instanceof VS||t instanceof BS)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),c={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},o=a;else throw t}try{await this.render(i,c,o.buffer,s?.buffer)}catch(t){this.manager.itemError(e),typeof r==`function`&&r(t),i.disposeOnDemandRenderer();return}typeof t==`function`&&t(i),this.manager.itemEnd(e),i.disposeOnDemandRenderer()},n,t=>{this.manager.itemError(e),typeof r==`function`&&r(t)}),i}},eC={apartment:`lebombo_1k.hdr`,city:`potsdamer_platz_1k.hdr`,dawn:`kiara_1_dawn_1k.hdr`,forest:`forest_slope_1k.hdr`,lobby:`st_fagans_interior_1k.hdr`,night:`dikhololo_night_1k.hdr`,park:`rooitou_park_1k.hdr`,studio:`studio_small_03_1k.hdr`,sunset:`venice_sunset_1k.hdr`,warehouse:`empty_warehouse_01_1k.hdr`},tC=`https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/`,nC=e=>Array.isArray(e),rC=[`/px.png`,`/nx.png`,`/py.png`,`/ny.png`,`/pz.png`,`/nz.png`];function iC({files:e=rC,path:t=``,preset:n=void 0,colorSpace:r=void 0,extensions:i}={}){n&&(sC(n),e=eC[n],t=tC);let a=nC(e),{extension:o,isCubemap:s}=cC(e),c=lC(o);if(!c)throw Error(`useEnvironment: Unrecognized file extension: `+e);let l=dv(e=>e.gl);(0,v.useLayoutEffect)(()=>{if(o!==`webp`&&o!==`jpg`&&o!==`jpeg`)return;function t(){gv.clear(c,a?[e]:e)}l.domElement.addEventListener(`webglcontextlost`,t,{once:!0})},[e,l.domElement]);let u=gv(c,a?[e]:e,e=>{(o===`webp`||o===`jpg`||o===`jpeg`)&&e.setRenderer(l),e.setPath==null||e.setPath(t),i&&i(e)}),d=a?u[0]:u;return(o===`jpg`||o===`jpeg`||o===`webp`)&&(d=d.renderTarget?.texture),d.mapping=s?301:303,d.colorSpace=r??(s?`srgb`:`srgb-linear`),d}var aC={files:rC,path:``,preset:void 0,extensions:void 0};iC.preload=e=>{let t={...aC,...e},{files:n,path:r=``}=t,{preset:i,extensions:a}=t;i&&(sC(i),n=eC[i],r=tC);let{extension:o}=cC(n);if(o===`webp`||o===`jpg`||o===`jpeg`)throw Error(`useEnvironment: Preloading gainmaps is not supported`);let s=lC(o);if(!s)throw Error(`useEnvironment: Unrecognized file extension: `+n);gv.preload(s,nC(n)?[n]:n,e=>{e.setPath==null||e.setPath(r),a&&a(e)})};var oC={files:rC,preset:void 0};iC.clear=e=>{let t={...oC,...e},{files:n}=t,{preset:r}=t;r&&(sC(r),n=eC[r]);let{extension:i}=cC(n),a=lC(i);if(!a)throw Error(`useEnvironment: Unrecognized file extension: `+n);gv.clear(a,nC(n)?[n]:n)};function sC(e){if(!(e in eC))throw Error(`Preset must be one of: `+Object.keys(eC).join(`, `))}function cC(e){var t;let n=nC(e)&&e.length===6,r=nC(e)&&e.length===3&&e.some(e=>e.endsWith(`json`)),i=nC(e)?e[0]:e;return{extension:n?`cube`:r?`webp`:i.startsWith(`data:application/exr`)?`exr`:i.startsWith(`data:application/hdr`)?`hdr`:i.startsWith(`data:image/jpeg`)?`jpg`:(t=i.split(`.`).pop())==null||(t=t.split(`?`))==null||(t=t.shift())==null?void 0:t.toLowerCase(),isCubemap:n,isGainmap:r}}function lC(e){return e===`cube`?qu:e===`hdr`?rS:e===`exr`?FS:e===`jpg`||e===`jpeg`?$S:e===`webp`?QS:null}var uC=e=>e.current&&e.current.isScene,dC=e=>uC(e)?e.current:e;function fC(e,t,n,r,i={}){var a,o;i={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...i};let s=dC(t||n),c=s.background,l=s.environment,u={backgroundBlurriness:s.backgroundBlurriness,backgroundIntensity:s.backgroundIntensity,backgroundRotation:((a=s.backgroundRotation)==null||a.clone==null?void 0:a.clone())??[0,0,0],environmentIntensity:s.environmentIntensity,environmentRotation:((o=s.environmentRotation)==null||o.clone==null?void 0:o.clone())??[0,0,0]};return e!==`only`&&(s.environment=r),e&&(s.background=r),Q_(s,i),()=>{e!==`only`&&(s.environment=l),e&&(s.background=c),Q_(s,u)}}function pC({scene:e,background:t=!1,map:n,...r}){let i=dv(e=>e.scene);return v.useLayoutEffect(()=>{if(n)return fC(t,e,i,n,r)}),null}function mC({background:e=!1,scene:t,blur:n,backgroundBlurriness:r,backgroundIntensity:i,backgroundRotation:a,environmentIntensity:o,environmentRotation:s,...c}){let l=iC(c),u=dv(e=>e.scene);return v.useLayoutEffect(()=>fC(e,t,u,l,{backgroundBlurriness:n??r,backgroundIntensity:i,backgroundRotation:a,environmentIntensity:o,environmentRotation:s})),v.useEffect(()=>()=>{l.dispose()},[l]),null}function hC({children:e,near:t=.1,far:n=1e3,resolution:r=256,frames:i=1,map:a,background:o=!1,blur:s,backgroundBlurriness:c,backgroundIntensity:l,backgroundRotation:u,environmentIntensity:d,environmentRotation:f,scene:p,files:m,path:h,preset:g=void 0,extensions:_}){let y=dv(e=>e.gl),b=dv(e=>e.scene),x=v.useRef(null),[S]=v.useState(()=>new Di),C=v.useMemo(()=>{let e=new um(r);return e.texture.type=Ve,e},[r]);v.useEffect(()=>()=>{C.dispose()},[C]),v.useLayoutEffect(()=>{if(i===1){let e=y.autoClear;y.autoClear=!0,x.current.update(y,S),y.autoClear=e}return fC(o,p,b,C.texture,{backgroundBlurriness:s??c,backgroundIntensity:l,backgroundRotation:u,environmentIntensity:d,environmentRotation:f})},[e,S,C.texture,p,b,o,i,y]);let w=1;return fv(()=>{if(i===1/0||wLv({GroundProjectedEnvImpl:nS}),[]),v.useEffect(()=>()=>{t.dispose()},[t]);let r=v.useMemo(()=>[n],[n]),i=e.ground?.height,a=e.ground?.radius,o=e.ground?.scale??1e3;return v.createElement(v.Fragment,null,v.createElement(pC,Jx({},e,{map:n})),v.createElement(`groundProjectedEnvImpl`,{args:r,scale:o,height:i,radius:a}))}function _C(e){return e.ground?v.createElement(gC,e):e.map?v.createElement(pC,e):e.children?v.createElement(hC,e):v.createElement(mC,e)}var vC=.22,yC={attack:.22,release:.04},bC={attack:.25,release:.1},xC=.1,SC=.02,CC=.3,wC=1/30,TC=.45,EC=3.5,DC=.1,OC=.037,kC=.03,AC=.15,jC=.96,MC=.93,NC=Math.PI*2,PC=NC*100,$=NC*50,FC=.003,IC=(e,t,n)=>e+(t-e)*n,LC=e=>e<0?0:e>1?1:e,RC=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2;function zC(e,t,n){let r=new G(e),i={h:0,s:0,l:0};return r.getHSL(i),new G().setHSL(i.h,LC(i.s*t),LC(i.l*n))}var BC=class{attack;release;s1=0;s2=0;constructor({attack:e,release:t}){this.attack=e,this.release=t}update(e){let t=e>this.s1?this.attack:this.release;return this.s1+=(e-this.s1)*t,this.s2+=(this.s1-this.s2)*vC,LC((this.s2-SC)/(CC-SC))}reset(){this.s1=0,this.s2=0}},VC=[`valence`,`arousal`,`guardedness`];function HC(e,t,n,r,i){let a={...e},o=t?.[r];if(o&&UC(a,o,1),n)for(let e of VC){let t=n[e],r=i[e];t&&(Math.abs(r)<.02||UC(a,t,r))}return a}function UC(e,t,n){for(let[r,i]of Object.entries(t))Object.hasOwn(e,r)&&(typeof i==`number`&&typeof e[r]==`number`?e[r]=e[r]+i*n:(typeof i==`string`||typeof i==`boolean`)&&(e[r]=i))}function WC(e){let t=(e,t)=>typeof e==`number`&&Number.isFinite(e)?e:t,n=(e,t)=>typeof e==`string`&&e.length>0?e:t;return{density:t(e.density,1),atmosphereGlow:t(e.atmosphereGlow,.5),speed:t(e.speed,1),chromaticAberration:t(e.chromaticAberration,0),asymmetry:t(e.asymmetry,0),orbRotation:t(e.orbRotation,.5),primaryEnergy:n(e.primaryEnergy,`#9b87f2`),secondaryEnergy:n(e.secondaryEnergy,`#6366f1`)}}function GC(e,t){switch(e){case`idle`:return{density:t.density*.55,glow:t.atmosphereGlow*.7,speed:t.speed*.7,ca:t.chromaticAberration*.4,asymmetry:t.asymmetry*.8,rotation:t.orbRotation*.55,scale:.94,primary:zC(t.primaryEnergy,.8,.7),secondary:zC(t.secondaryEnergy,.8,.7)};case`listening`:return{density:t.density*.8,glow:t.atmosphereGlow*.85,speed:t.speed*.65,ca:t.chromaticAberration*.6,asymmetry:t.asymmetry*.85,rotation:t.orbRotation*.55,scale:.93,primary:zC(t.primaryEnergy,.95,.95),secondary:zC(t.secondaryEnergy,.95,.95)};case`thinking`:return{density:t.density*.7,glow:t.atmosphereGlow*.9,speed:t.speed*1,ca:t.chromaticAberration*.7,asymmetry:t.asymmetry*.9,rotation:t.orbRotation*.85,scale:.96,primary:zC(t.primaryEnergy,.95,.9),secondary:zC(t.secondaryEnergy,.95,.9)};case`speaking`:return{density:t.density*.9,glow:t.atmosphereGlow*1.1,speed:t.speed*1.05,ca:t.chromaticAberration*1,asymmetry:t.asymmetry,rotation:t.orbRotation*1,scale:1.06,primary:new G(t.primaryEnergy),secondary:new G(t.secondaryEnergy)}}}function KC(e,t,n){return{density:IC(e.density,t.density,n),glow:IC(e.glow,t.glow,n),speed:IC(e.speed,t.speed,n),ca:IC(e.ca,t.ca,n),asymmetry:IC(e.asymmetry,t.asymmetry,n),rotation:IC(e.rotation,t.rotation,n),scale:IC(e.scale,t.scale,n),primary:e.primary.clone().lerp(t.primary,n),secondary:e.secondary.clone().lerp(t.secondary,n)}}function qC(e,t){let n=(0,v.useRef)(t);n.current=t;let r=(0,v.useRef)(GC(`idle`,t)),i=(0,v.useRef)({active:`idle`,from:r.current,to:r.current,xfadeStart:0,xfadeActive:!1,enteredMs:performance.now()}),a=e=>{let t=i.current;t.from={...r.current,primary:r.current.primary.clone(),secondary:r.current.secondary.clone()},t.to=GC(e,n.current),t.xfadeStart=performance.now(),t.xfadeActive=!0};return(0,v.useEffect)(()=>{let t=i.current;e!==t.active&&(t.active=e,t.enteredMs=performance.now(),a(e))},[e]),(0,v.useEffect)(()=>{a(i.current.active)},[t.primaryEnergy,t.secondaryEnergy,t.density,t.atmosphereGlow,t.speed,t.chromaticAberration,t.asymmetry,t.orbRotation]),fv(()=>{let e=i.current;if(!e.xfadeActive)return;let t=LC((performance.now()-e.xfadeStart)/600),n=RC(t);r.current=KC(e.from,e.to,n),t>=1&&(e.xfadeActive=!1,r.current=e.to)}),{snapRef:r}}function JC(){let e=(0,v.useRef)(0),t=(0,v.useRef)(performance.now());return fv(()=>{let n=(performance.now()-t.current)/1e3;e.current=(Math.sin(n*Math.PI*2*DC)+.5*Math.sin(n*Math.PI*2*OC))*.5}),{breathNormRef:e}}function YC(e){let{camera:t,gl:n}=dv(),r=(0,v.useRef)(new U(0,0,1)),i=(0,v.useRef)(0),a=(0,v.useRef)({x:0,y:0}),o=(0,v.useRef)(t.position.z),s=(0,v.useMemo)(()=>new kf,[]),c=(0,v.useMemo)(()=>new H,[]),l=(0,v.useRef)({dragging:!1,holding:!1,lastX:0,lastY:0,lastT:0}),u=(n,a)=>{let o=e.current;if(!o)return;c.set(n/window.innerWidth*2-1,-(a/window.innerHeight)*2+1),s.setFromCamera(c,t);let l=s.intersectObject(o,!1);if(!l.length){i.current=0;return}let u=o.worldToLocal(l[0].point.clone()).normalize();r.current.copy(u),i.current=1};return(0,v.useEffect)(()=>{let t=n.domElement;t.style.touchAction=`none`;let r=e=>{t.setPointerCapture(e.pointerId);let n=l.current;n.dragging=!0,n.holding=!0,n.lastX=e.clientX,n.lastY=e.clientY,n.lastT=performance.now(),a.current.x=0,a.current.y=0,u(e.clientX,e.clientY)},i=()=>{let e=l.current;e.dragging&&(e.dragging=!1,e.holding=!1,a.current.x=0,a.current.y=0)},s=t=>{let n=l.current;if(!n.dragging)return;if(t.buttons===0){i();return}let r=performance.now(),o=Math.max(1,r-n.lastT)/1e3,s=t.clientX-n.lastX,c=t.clientY-n.lastY,d=e.current;d&&(d.rotation.y+=s*FC,d.rotation.x+=c*FC);let f=(e,t)=>Math.max(-t,Math.min(t,e)),p=f(s*FC/o,EC),m=f(c*FC/o,EC);a.current.y=IC(a.current.y,p,.5),a.current.x=IC(a.current.x,m,.5),n.lastX=t.clientX,n.lastY=t.clientY,n.lastT=r,u(t.clientX,t.clientY)},c=e=>{let n=l.current;if(n.dragging){n.dragging=!1,n.holding=!1;try{t.releasePointerCapture(e.pointerId)}catch{}}},d=e=>{e.preventDefault();let t=e.deltaY*.001*Math.max(.5,o.current);o.current=Math.max(6,Math.min(20,o.current+t))},f=()=>i();return t.addEventListener(`pointerdown`,r),t.addEventListener(`pointermove`,s),t.addEventListener(`pointerup`,c),t.addEventListener(`pointercancel`,c),t.addEventListener(`wheel`,d,{passive:!1}),window.addEventListener(`blur`,f),document.addEventListener(`visibilitychange`,f),()=>{t.removeEventListener(`pointerdown`,r),t.removeEventListener(`pointermove`,s),t.removeEventListener(`pointerup`,c),t.removeEventListener(`pointercancel`,c),t.removeEventListener(`wheel`,d),window.removeEventListener(`blur`,f),document.removeEventListener(`visibilitychange`,f)}},[n,t,s,c]),fv(()=>{let e=l.current,n=a.current;e.dragging||(n.x*=jC,n.y*=jC,Math.abs(n.x)<.001&&(n.x=0),Math.abs(n.y)<.001&&(n.y=0)),!e.holding&&i.current>0&&(i.current*=MC,i.current<.01&&(i.current=0)),t.position.z=IC(t.position.z,o.current,AC)}),{clickDirRef:r,clickStrengthRef:i,dragVelRef:a}}var XC=`orbis-orb`,ZC=[`uTime`,`uLocalCamPos`,`uPrimaryColor`,`uSecondaryColor`,`uClickDir`,`uClickStrength`],QC=new Set([`uTime`,`uLocalCamPos`,`uClickDir`]),$C=`// — orbis standard prelude (injected) — +uniform float uTime; +uniform vec3 uLocalCamPos; +uniform vec3 uPrimaryColor; +uniform vec3 uSecondaryColor; +uniform vec3 uClickDir; +uniform float uClickStrength; +varying vec3 vLocalPosition; +varying vec3 vNormal; +varying vec3 vViewPosition; +`,ew=`varying vec3 vLocalPosition; +varying vec3 vNormal; +varying vec3 vViewPosition; + +void main() { + vLocalPosition = position; + vNormal = normalize(normalMatrix * normal); + vec4 mvPosition = modelViewMatrix * vec4(position, 1.0); + vViewPosition = -mvPosition.xyz; + gl_Position = projectionMatrix * mvPosition; +} +`,tw={float:`float`,vec2:`vec2`,vec3:`vec3`,vec4:`vec4`,color:`vec3`};function nw(e){let t=new Set(ZC),n=Object.entries(e.uniforms).filter(([e])=>!t.has(e)).map(([e,t])=>`uniform ${tw[t.type]} ${e};`).join(` +`);return`${$C}${n?n+` +`:``}// — definition body —\n${e.shaders.fragment}`}function rw(e){return e.shaders.vertex&&e.shaders.vertex.trim().length>0?e.shaders.vertex:ew}var iw=256e3,aw=512e3,ow=/^[a-z0-9][a-z0-9-]{1,63}$/,sw=/^u[A-Za-z0-9_]{1,63}$/,cw=/^#[0-9a-fA-F]{6}$/,lw=new Set([`float`,`vec2`,`vec3`,`vec4`,`color`]),uw=new Set([`color`,`energy`,`motion`,`fractal`,`perf`]),dw=new Set([`set`,`add`,`mul`]),fw=new Set([`linear`,`exp`,`smoothstep`]),pw=new Set([`x`,`y`,`z`,`w`]),mw=new Set([`time`,`bot.level`,`user.level`,`breath`,`pointer.clickStrength`,`mood.valence`,`mood.arousal`,`mood.guardedness`,`snap.density`,`snap.glow`,`snap.speed`,`snap.ca`,`snap.asymmetry`,`snap.rotation`,`snap.scale`]),hw=new Set([`snap.primary`,`snap.secondary`]),gw=e=>typeof e==`object`&&!!e&&!Array.isArray(e),_w=e=>typeof e==`number`&&Number.isFinite(e),vw=e=>typeof e==`string`;function yw(e){let t=[],n=[],r=e=>t.push(e);if(!gw(e))return{ok:!1,errors:[`definition must be a JSON object`],warnings:n};let i=e;try{if(JSON.stringify(i).length>512e3)return{ok:!1,errors:[`definition exceeds ${aw} chars`],warnings:n}}catch{return{ok:!1,errors:[`definition is not serializable JSON`],warnings:n}}i.format!==`orbis-orb`&&r(`format must be "${XC}"`),i.version!==1&&r(`version must be 1`),(!vw(i.id)||!ow.test(i.id))&&r(`id must be a slug ([a-z0-9-], 2-64 chars)`),(!vw(i.name)||i.name.trim().length===0||i.name.length>120)&&r(`name must be a non-empty string (≤120 chars)`),i.engine!==`raymarch-v1`&&r(`engine must be "raymarch-v1" (the only v1 engine)`);let a=gw(i.shaders)?i.shaders:void 0;!a||!vw(a.fragment)||a.fragment.trim().length===0?r(`shaders.fragment must be a non-empty GLSL string`):(a.fragment.length>256e3&&r(`shaders.fragment exceeds ${iw} chars`),a.fragment.includes(`gl_FragColor`)||n.push(`shaders.fragment never writes gl_FragColor`));let o=new Set(ZC),s=new Map;if(!gw(i.uniforms))r(`uniforms must be an object (may be empty)`);else{let e=Object.entries(i.uniforms);e.length>64&&r(`more than 64 uniforms`);for(let[t,n]of e){if(!sw.test(t)){r(`uniform "${t}" — names must match ${sw}`);continue}if(ZC.includes(t)){r(`uniform "${t}" shadows a standard uniform`);continue}if(!gw(n)||!vw(n.type)||!lw.has(n.type)){r(`uniform "${t}" — type must be one of float|vec2|vec3|vec4|color`);continue}let e=n.type,i=n.default;if(i!==void 0&&!bw(e,i)){r(`uniform "${t}" — default doesn't match type ${e}`);continue}o.add(t),s.set(t,{type:e,default:i})}}let c=new Set;if(Array.isArray(i.fields)?(i.fields.length>64&&r(`more than 64 fields`),i.fields.forEach((e,t)=>{let n=xw(e,t);n?r(n):c.add(e.key)})):r(`fields must be an array (may be empty)`),!gw(i.palettes)||Object.keys(i.palettes).length===0)r(`palettes must be a non-empty object`);else{let e=Object.keys(i.palettes);e.length>32&&r(`more than 32 palettes`);for(let[e,t]of Object.entries(i.palettes)){if(!gw(t)){r(`palette "${e}" must be an object`);continue}for(let[n,i]of Object.entries(t))!_w(i)&&!vw(i)&&r(`palette "${e}".${n} must be number or string`)}(!vw(i.defaultPalette)||!e.includes(i.defaultPalette))&&r(`defaultPalette must name an existing palette`)}if(Array.isArray(i.bindings)?(i.bindings.length>128&&r(`more than 128 bindings`),i.bindings.forEach((e,t)=>{for(let n of Sw(e,t,o,s,c))r(n)})):r(`bindings must be an array (may be empty)`),i.moodDefaults!=null)if(!gw(i.moodDefaults))r(`moodDefaults must be an object or null`);else for(let[e,t]of Object.entries(i.moodDefaults))[`valence`,`arousal`,`guardedness`].includes(e)?gw(t)||r(`moodDefaults.${e} must be an object of param deltas`):r(`moodDefaults.${e} — unknown mood dimension`);return i.geometry!=null&&!gw(i.geometry)&&r(`geometry must be an object`),i.material!=null&&!gw(i.material)&&r(`material must be an object`),i.motion!=null&&!gw(i.motion)&&r(`motion must be an object`),i.post!=null&&!gw(i.post)&&r(`post must be an object or null`),t.length>0?{ok:!1,errors:t,warnings:n}:{ok:!0,def:i,warnings:n}}function bw(e,t){switch(e){case`float`:return _w(t);case`color`:return vw(t)&&cw.test(t);case`vec2`:case`vec3`:case`vec4`:{let n={vec2:2,vec3:3,vec4:4}[e];return Array.isArray(t)&&t.length===n&&t.every(_w)}}}function xw(e,t){return gw(e)?!vw(e.key)||e.key.length===0||e.key.length>64?`fields[${t}].key invalid`:!vw(e.label)||e.label.length===0||e.label.length>64?`fields[${t}].label invalid`:!vw(e.section)||!uw.has(e.section)?`fields[${t}].section must be color|energy|motion|fractal|perf`:e.kind===`color`?null:e.kind===`slider`?!_w(e.min)||!_w(e.max)||!_w(e.step)||e.step<=0||e.max<=e.min?`fields[${t}] slider needs numeric min < max and step > 0`:null:`fields[${t}].kind must be color|slider`:`fields[${t}] must be an object`}function Sw(e,t,n,r,i){let a=[];if(!gw(e))return[`bindings[${t}] must be an object`];let o=e;if(!vw(o.target))return a.push(`bindings[${t}].target must be a string`),a;let[s,c,l]=o.target.split(`.`);if(l!==void 0||c!==void 0&&!pw.has(c))return a.push(`bindings[${t}].target "${o.target}" — component must be one of x|y|z|w`),a;QC.has(s)&&a.push(`bindings[${t}].target "${s}" is engine-managed and cannot be bound`),n.has(s)||a.push(`bindings[${t}].target "${s}" is not a declared or standard uniform`);let u=r.get(s),d=u?.type===`color`||s===`uPrimaryColor`||s===`uSecondaryColor`;if(c!==void 0)if(u===void 0||u.type===`float`||u.type===`color`)a.push(`bindings[${t}].target "${o.target}" — component suffix needs a vec uniform`);else{let e={vec2:2,vec3:3,vec4:4}[u.type];[`x`,`y`,`z`,`w`].indexOf(c)>=e&&a.push(`bindings[${t}].target "${o.target}" — out of range for ${u.type}`)}if(!vw(o.signal))return a.push(`bindings[${t}].signal must be a string`),a;let f=o.signal.startsWith(`param.`),p=f?o.signal.slice(6):null,m=mw.has(o.signal)||f,h=hw.has(o.signal)||f;return!m&&!h&&a.push(`bindings[${t}].signal "${o.signal}" is unknown`),f&&p&&i.has(p),d&&c===void 0&&(h||a.push(`bindings[${t}] — color target "${s}" needs a color signal`),o.op!==void 0&&o.op!==`set`&&a.push(`bindings[${t}] — color targets only support op "set"`)),o.op!==void 0&&!dw.has(o.op)&&a.push(`bindings[${t}].op must be set|add|mul`),o.curve!==void 0&&!fw.has(o.curve)&&a.push(`bindings[${t}].curve must be linear|exp|smoothstep`),o.scale!==void 0&&!_w(o.scale)&&a.push(`bindings[${t}].scale must be a number`),o.offset!==void 0&&!_w(o.offset)&&a.push(`bindings[${t}].offset must be a number`),o.smooth!==void 0&&(!_w(o.smooth)||o.smooth<=0||o.smooth>1)&&a.push(`bindings[${t}].smooth must be in (0, 1]`),a}function Cw(e){switch(e.type){case`float`:return typeof e.default==`number`?e.default:0;case`color`:return new G(typeof e.default==`string`?e.default:`#ffffff`);case`vec2`:{let t=Array.isArray(e.default)?e.default:[0,0];return new H(t[0]??0,t[1]??0)}case`vec3`:{let t=Array.isArray(e.default)?e.default:[0,0,0];return new U(t[0]??0,t[1]??0,t[2]??0)}case`vec4`:{let t=Array.isArray(e.default)?e.default:[0,0,0,0];return new Lr(t[0]??0,t[1]??0,t[2]??0,t[3]??0)}}}function ww(e){let t={uTime:{value:0},uLocalCamPos:{value:new U},uPrimaryColor:{value:new G(`#9b87f2`)},uSecondaryColor:{value:new G(`#6366f1`)},uClickDir:{value:new U(0,0,1)},uClickStrength:{value:0}};for(let[n,r]of Object.entries(e.uniforms))n in t||(t[n]={value:Cw(r)});return t}function Tw(e,t){let n=e.uniforms[t];return n&&n.type===`float`&&typeof n.default==`number`?n.default:0}function Ew(e,t){switch(e){case`time`:return t.time;case`bot.level`:return t.botLevel;case`user.level`:return t.userLevel;case`breath`:return t.breath;case`pointer.clickStrength`:return t.clickStrength;case`mood.valence`:return t.mood.valence;case`mood.arousal`:return t.mood.arousal;case`mood.guardedness`:return t.mood.guardedness;case`snap.density`:return t.snap.density;case`snap.glow`:return t.snap.glow;case`snap.speed`:return t.snap.speed;case`snap.ca`:return t.snap.ca;case`snap.asymmetry`:return t.snap.asymmetry;case`snap.rotation`:return t.snap.rotation;case`snap.scale`:return t.snap.scale}if(e.startsWith(`param.`)){let n=t.params[e.slice(6)];return typeof n==`number`&&Number.isFinite(n)?n:void 0}}var Dw=new G;function Ow(e,t){switch(e){case`snap.primary`:return t.snap.primary;case`snap.secondary`:return t.snap.secondary}if(e.startsWith(`param.`)){let n=t.params[e.slice(6)];if(typeof n==`string`&&n.length>0)try{return Dw.set(n),Dw}catch{return}}}var kw=[`x`,`y`,`z`,`w`];function Aw(e,t){switch(t){case`linear`:return e;case`exp`:return e*e;case`smoothstep`:{let t=e<0?0:e>1?1:e;return t*t*(3-2*t)}}}var jw=class{compiled=[];scalarTargets=new Map;def;constructor(e){this.def=e;for(let t of e.bindings)this.compile(t)}compile(e){let[t,n]=e.target.split(`.`),r=this.def.uniforms[t];if(n===void 0&&(r?.type===`color`||t===`uPrimaryColor`||t===`uSecondaryColor`)){this.compiled.push({kind:`color`,uniform:t,signal:e.signal});return}let i=n===void 0?-1:kw.indexOf(n),a=e.target;this.scalarTargets.has(a)||this.scalarTargets.set(a,i===-1?Tw(this.def,t):NaN),this.compiled.push({kind:`scalar`,uniform:t,component:i,signal:e.signal,op:e.op??`set`,scale:e.scale??1,offset:e.offset??0,curve:e.curve??`linear`,smooth:e.smooth??0,smoothState:0,smoothInit:!1})}apply(e,t){let n=new Map;for(let[e,r]of this.scalarTargets)if(Number.isNaN(r)){let[r,i]=e.split(`.`),a=t[r],o=kw.indexOf(i),s=a?.value;n.set(e,s?.getComponent?s.getComponent(o):0)}else n.set(e,r);for(let r of this.compiled){if(r.kind===`color`){let n=Ow(r.signal,e),i=t[r.uniform];n&&i&&i.value instanceof G&&i.value.copy(n);continue}let i=Ew(r.signal,e);if(i===void 0)continue;let a=Aw(i,r.curve)*r.scale+r.offset;r.smooth>0&&(r.smoothInit?r.smoothState=IC(r.smoothState,a,r.smooth):(r.smoothState=a,r.smoothInit=!0),a=r.smoothState);let o=r.component===-1?r.uniform:`${r.uniform}.${kw[r.component]}`,s=n.get(o)??0,c=r.op===`set`?a:r.op===`add`?s+a:s*a;n.set(o,c)}for(let[e,r]of n){let[n,i]=e.split(`.`),a=t[n];if(a)if(i===void 0)typeof a.value==`number`&&(a.value=r);else{let e=kw.indexOf(i);a.value.setComponent?.(e,r)}}}},Mw={valence:0,arousal:0,guardedness:0},Nw={current:0};function Pw({definition:e,voiceState:t,base:n,mood:r,botLevelRef:i,userLevelRef:a}){let{camera:o,gl:s}=dv(),c=(0,v.useRef)(null),l=WC(n),u=(0,v.useRef)(n);u.current=n;let d=(0,v.useRef)(r??Mw);d.current=r??Mw;let{snapRef:f}=qC(t,l),{breathNormRef:p}=JC(),{clickDirRef:m,clickStrengthRef:h,dragVelRef:g}=YC(c),_=(0,v.useMemo)(()=>new tu({uniforms:ww(e),vertexShader:rw(e),fragmentShader:nw(e),transparent:e.material?.transparent??!0,depthWrite:e.material?.depthWrite??!1,side:e.material?.doubleSide??!0?2:0,blending:(e.material?.blending??`additive`)===`additive`?2:1}),[e]);(0,v.useEffect)(()=>()=>_.dispose(),[_]);let y=(0,v.useMemo)(()=>{let t=e.geometry;return new Y(t?.radius??5.5,t?.widthSegments??32,t?.heightSegments??32)},[e]);(0,v.useEffect)(()=>()=>y.dispose(),[y]);let b=(0,v.useMemo)(()=>new jw(e),[e]),x=typeof n.dpr==`number`?n.dpr:void 0;(0,v.useEffect)(()=>{x!==void 0&&s.setPixelRatio(x)},[x,s]),(0,v.useEffect)(()=>{o.position.set(0,0,13)},[o]);let S=(0,v.useRef)(0),C=(0,v.useMemo)(()=>new U,[]),w=e.motion;return fv((e,t)=>{let n=Math.min(t,wC),r=c.current,s=f.current;if(!r||!s)return;let l=_.uniforms,v=(i??Nw).current??0,y=(a??Nw).current??0;S.current+=n*s.speed,S.current>PC&&(S.current-=PC),l.uTime.value=S.current,l.uPrimaryColor.value.copy(s.primary),l.uSecondaryColor.value.copy(s.secondary),l.uClickDir.value.copy(m.current),l.uClickStrength.value=h.current;let x={time:S.current,botLevel:v,userLevel:y,breath:p.current,clickStrength:h.current,mood:d.current,snap:s,params:u.current};b.apply(x,l);let T=w?.breath??!0,E=w?.scaleAudioPump??.06,D=s.scale*(T?1+p.current*kC:1)*(1+v*E);r.scale.setScalar(D);let O=w?.rotationXRatio??.5;r.rotation.y+=n*s.rotation*TC+g.current.y*n,r.rotation.x+=n*(s.rotation*O)*TC+g.current.x*n,r.rotation.y>$&&(r.rotation.y-=$),r.rotation.y<-$&&(r.rotation.y+=$),r.rotation.x>$&&(r.rotation.x-=$),r.rotation.x<-$&&(r.rotation.x+=$),r.updateMatrixWorld(),C.copy(o.position),r.worldToLocal(C),l.uLocalCamPos.value.copy(C)}),(0,Q.jsx)(`mesh`,{ref:c,geometry:y,material:_})}function Fw(e,t){e.getByteTimeDomainData(t);let n=0;for(let e=0;e{let e=!0,t=null,n=async()=>{if(t=null,!(!e||document.hidden)){try{let e=await qx(`get_audio_levels`);e&&(i.current=e)}catch{}e&&!document.hidden&&(t=setTimeout(n,33))}},r=()=>{!document.hidden&&e&&t===null&&n()};return document.addEventListener(`visibilitychange`,r),n(),()=>{e=!1,t&&clearTimeout(t),document.removeEventListener(`visibilitychange`,r)}},[]);let a=(0,v.useRef)({ctx:null,bot:null,user:null,envBot:new BC(bC),envUser:new BC(yC)});return(0,v.useEffect)(()=>{let t=a.current;if(e)return t.bot=zw(t,e),()=>{try{t.bot?.source.disconnect()}catch{}t.bot=null,t.envBot.reset()}},[e]),(0,v.useEffect)(()=>{let e=a.current;if(t)return e.user=zw(e,t),()=>{try{e.user?.source.disconnect()}catch{}e.user=null,e.envUser.reset()}},[t]),(0,v.useEffect)(()=>()=>{let e=a.current;if(e.ctx)try{e.ctx.close()}catch{}e.ctx=null},[]),fv(()=>{let e=a.current,t=i.current,o=0,s=0;o=e.bot?e.envBot.update(Fw(e.bot.analyser,e.bot.buf)):e.envBot.update(Math.min(1,t.playback*Iw)),s=e.user?e.envUser.update(Fw(e.user.analyser,e.user.buf)):e.envUser.update(Math.min(1,t.mic*Lw)),n.current=IC(n.current,o,xC),r.current=IC(r.current,s,xC)}),{dBotRef:n,dUserRef:r}}function zw(e,t){if(!e.ctx)try{e.ctx=new(window.AudioContext??window.webkitAudioContext)}catch{return null}let n=e.ctx;n.state===`suspended`&&n.resume().catch(()=>{});let r=n.createMediaStreamSource(t),i=n.createAnalyser();return i.fftSize=1024,i.smoothingTimeConstant=.55,r.connect(i),{analyser:i,source:r,buf:new Uint8Array(i.fftSize)}}var Bw={pinnedState:null,pinnedMood:null,epoch:0},Vw=new class{snap=Bw;listeners=new Set;getSnapshot=()=>this.snap;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});setPinnedState(e){this.snap.pinnedState!==e&&(this.snap={...this.snap,pinnedState:e,epoch:this.snap.epoch+1},this.listeners.forEach(e=>e()))}setPinnedMood(e){Hw(this.snap.pinnedMood,e)||(this.snap={...this.snap,pinnedMood:e,epoch:this.snap.epoch+1},this.listeners.forEach(e=>e()))}clear(){this.snap.pinnedState===null&&this.snap.pinnedMood===null||(this.snap={pinnedState:null,pinnedMood:null,epoch:this.snap.epoch+1},this.listeners.forEach(e=>e()))}};function Hw(e,t){return e===t?!0:!e||!t?!1:e.valence===t.valence&&e.arousal===t.arousal&&e.guardedness===t.guardedness}var Uw={valence:0,arousal:0,guardedness:0,updatedAt:``},Ww=new Set,Gw={get:()=>Uw,set:e=>{let t=Uw;Math.abs(t.valence-e.valence)<.02&&Math.abs(t.arousal-e.arousal)<.02&&Math.abs(t.guardedness-e.guardedness)<.02||(Uw=e,Ww.forEach(e=>e()))},subscribe:e=>(Ww.add(e),()=>{Ww.delete(e)})};function Kw(e){let{params:t}=nx(),{stateOverrides:n,moodOverrides:r}=ix(),i=rx(),a=(0,v.useSyncExternalStore)(Gw.subscribe,Gw.get,Gw.get),o=(0,v.useSyncExternalStore)(Vw.subscribe,Vw.getSnapshot,Vw.getSnapshot),s=o.pinnedState??e,c=o.pinnedMood??{valence:a.valence,arousal:a.arousal,guardedness:a.guardedness},l=(0,v.useMemo)(()=>qw(i?.moodDefaults,r),[i,r]);return{base:(0,v.useMemo)(()=>HC(t,n,l,s,c),[t,n,l,s,c.valence,c.arousal,c.guardedness]),effectiveState:s}}function qw(e,t){if(!e)return t;let n={};for(let r of[`valence`,`arousal`,`guardedness`]){let i=e[r],a=t[r];!i&&!a||(n[r]={...i??{},...a??{}})}return n}Lv({AtmosphereMaterial:Xx({uColor:new G(`#0ea5e9`),uColorSecondary:new G(`#f472b6`),uGlow:.18,uLevel:1,uClickDir:new U(0,0,1),uClickStrength:0},`varying vec3 vNormal; +varying vec3 vViewPosition; +varying vec3 vLocalPos; + +void main() { + vNormal = normalize(normalMatrix * normal); + vec4 mvPosition = modelViewMatrix * vec4(position, 1.0); + vViewPosition = -mvPosition.xyz; + vLocalPos = position; + gl_Position = projectionMatrix * mvPosition; +}`,`uniform vec3 uColor; +uniform vec3 uColorSecondary; +uniform float uGlow; +uniform float uLevel; +uniform vec3 uClickDir; +uniform float uClickStrength; + +varying vec3 vNormal; +varying vec3 vViewPosition; +varying vec3 vLocalPos; + +void main() { + vec3 normal = normalize(vNormal); + vec3 viewDir = normalize(vViewPosition); + float vdn = max(dot(normal, viewDir), 0.0); + float edgeFade = smoothstep(0.0, 0.15, vdn); + float innerFadePoint = clamp(1.0 - uLevel, 0.0, 0.99); + float centerFade = smoothstep(1.0, innerFadePoint, vdn); + float alpha = edgeFade * centerFade * uGlow; + + + + + float gradT = smoothstep(0.0, 0.85, vdn); + vec3 haloColor = mix(uColorSecondary, uColor, gradT); + + + + float clickBoost = smoothstep(0.6, 1.0, dot(normalize(vLocalPos), uClickDir)) * uClickStrength; + alpha *= (1.0 + clickBoost * 3.0); + haloColor = mix(haloColor, uColor * 1.25, clickBoost * 0.7); + + gl_FragColor = vec4(haloColor, alpha); +}`)});function Jw({geometry:e,snapRef:t,dBotRef:n,dUserRef:r,clickDirRef:i,clickStrengthRef:a}){let o=(0,v.useRef)(null),s=(0,v.useRef)(null),{params:c}=nx(),l=Number(c.atmosphereLevel??1),u=Number(c.atmosphereScale??1.03);return(0,v.useEffect)(()=>{s.current&&(s.current.uniforms.uLevel.value=l)},[l]),(0,v.useEffect)(()=>{o.current&&o.current.scale.setScalar(u)},[u]),fv(()=>{let e=s.current,o=t.current;if(!e||!o)return;let c=n.current??0,l=r.current??0;e.uniforms.uColor.value.copy(o.primary),e.uniforms.uColorSecondary.value.copy(o.secondary),e.uniforms.uGlow.value=o.glow+c*1.1+l*.35,e.uniforms.uClickDir.value.copy(i.current??new U(0,0,1)),e.uniforms.uClickStrength.value=a.current??0}),(0,Q.jsx)(`mesh`,{ref:o,geometry:e,scale:u,children:(0,Q.jsx)(`atmosphereMaterial`,{ref:s,transparent:!0,side:0,depthWrite:!1,blending:2,attach:`material`})})}function Yw({voiceState:e,botStream:t,localStream:n}){let{camera:r,gl:i}=dv(),a=(0,v.useRef)(null),o=(0,v.useRef)(null),{base:s,effectiveState:c}=Kw(e),{dBotRef:l,dUserRef:u}=Rw({botStream:t,localStream:n}),{snapRef:d}=qC(c,s),{breathNormRef:f}=JC(),{clickDirRef:p,clickStrengthRef:m,dragVelRef:h}=YC(a),g=(0,v.useMemo)(()=>new Ml(1.2,Math.max(0,Math.min(3,Math.round(s.detail)))),[s.detail]);(0,v.useEffect)(()=>()=>g.dispose(),[g]),(0,v.useEffect)(()=>{i.setPixelRatio(s.dpr)},[s.dpr,i]),(0,v.useEffect)(()=>{r.position.set(0,0,6)},[r]);let _=(0,v.useMemo)(()=>new Y(1.25,64,64),[]);return(0,v.useEffect)(()=>()=>_.dispose(),[_]),fv((e,t)=>{let n=Math.min(t,wC),r=a.current,i=o.current,c=d.current;if(!r||!c)return;let p=l.current,m=u.current;i&&(i.attenuationColor?.copy&&i.attenuationColor.copy(c.primary),i.color?.copy&&i.color.copy(c.secondary),`distortion`in i&&(i.distortion=s.asymmetry*(.15+m*.6)),`temporalDistortion`in i&&(i.temporalDistortion=.1+p*.25),i.emissive?.copy&&i.emissive.copy(c.primary),`emissiveIntensity`in i&&(i.emissiveIntensity=c.glow*.6+p*.9));let g=1+p*.12*s.density+f.current*kC;r.scale.setScalar(c.scale*g);let _=c.rotation*TC*s.speed+m*.15;r.rotation.y+=n*_+h.current.y*n,r.rotation.x+=_*.5*n+h.current.x*n,r.rotation.y>$&&(r.rotation.y-=$),r.rotation.y<-$&&(r.rotation.y+=$),r.rotation.x>$&&(r.rotation.x-=$),r.rotation.x<-$&&(r.rotation.x+=$)}),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(_C,{preset:`city`,environmentIntensity:s.envIntensity}),(0,Q.jsx)(`ambientLight`,{intensity:.2}),(0,Q.jsx)(`directionalLight`,{position:[5,8,3],intensity:1.2}),(0,Q.jsx)(`mesh`,{ref:a,geometry:g,children:(0,Q.jsx)($x,{ref:o,transmission:s.transmission,thickness:s.thickness,ior:s.ior,roughness:s.roughness,chromaticAberration:s.chromaticAberration*4,anisotropicBlur:.1,distortion:.2,temporalDistortion:.1,iridescence:s.iridescence,iridescenceIOR:1.3,iridescenceThicknessRange:[100,400],clearcoat:1,clearcoatRoughness:0,samples:6,resolution:512})}),(0,Q.jsx)(Jw,{geometry:_,snapRef:d,dBotRef:l,dUserRef:u,clickDirRef:p,clickStrengthRef:m})]})}var Xw={ProtoLabs:{primaryEnergy:`#9b87f2`,secondaryEnergy:`#6366f1`,speed:.35,density:.6,dpr:.9,atmosphereGlow:.1,atmosphereLevel:.6,atmosphereScale:1.04,orbRotation:.3,asymmetry:.3,chromaticAberration:.08,transmission:1,ior:1.6,thickness:.8,roughness:.02,iridescence:.5,detail:0,envIntensity:1.3},Prism:{primaryEnergy:`#a78bfa`,secondaryEnergy:`#22d3ee`,speed:.35,density:.6,dpr:.9,atmosphereGlow:.1,atmosphereLevel:.6,atmosphereScale:1.04,orbRotation:.3,asymmetry:.3,chromaticAberration:.08,transmission:1,ior:1.6,thickness:.8,roughness:.02,iridescence:.5,detail:0,envIntensity:1.3},Sapphire:{primaryEnergy:`#3b82f6`,secondaryEnergy:`#7c3aed`,speed:.3,density:.5,dpr:.9,atmosphereGlow:.12,atmosphereLevel:.7,atmosphereScale:1.04,orbRotation:.25,asymmetry:.25,chromaticAberration:.04,transmission:1,ior:1.85,thickness:.9,roughness:.04,iridescence:.25,detail:1,envIntensity:1.1},Topaz:{primaryEnergy:`#f59e0b`,secondaryEnergy:`#dc2626`,speed:.4,density:.7,dpr:.9,atmosphereGlow:.14,atmosphereLevel:.7,atmosphereScale:1.03,orbRotation:.35,asymmetry:.3,chromaticAberration:.06,transmission:.95,ior:1.7,thickness:.7,roughness:.06,iridescence:.15,detail:1,envIntensity:1.2},Obsidian:{primaryEnergy:`#1e1b4b`,secondaryEnergy:`#64748b`,speed:.28,density:.4,dpr:.9,atmosphereGlow:.08,atmosphereLevel:.5,atmosphereScale:1.03,orbRotation:.22,asymmetry:.15,chromaticAberration:.02,transmission:.4,ior:1.5,thickness:1.2,roughness:.35,iridescence:0,detail:0,envIntensity:.9}},Zw=[{kind:`color`,key:`primaryEnergy`,label:`Primary`,section:`color`},{kind:`color`,key:`secondaryEnergy`,label:`Secondary`,section:`color`},{kind:`slider`,key:`density`,label:`Wobble`,section:`energy`,min:0,max:1.5,step:.01},{kind:`slider`,key:`atmosphereGlow`,label:`Halo glow`,section:`energy`,min:0,max:1,step:.01},{kind:`slider`,key:`atmosphereLevel`,label:`Halo thickness`,section:`energy`,min:.1,max:1,step:.01},{kind:`slider`,key:`atmosphereScale`,label:`Halo scale`,section:`energy`,min:1,max:1.1,step:.001},{kind:`slider`,key:`chromaticAberration`,label:`Aberration`,section:`energy`,min:0,max:.3,step:.001},{kind:`slider`,key:`speed`,label:`Rotation speed`,section:`motion`,min:.1,max:2,step:.05},{kind:`slider`,key:`orbRotation`,label:`Auto-rotation`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`asymmetry`,label:`Asymmetry`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`transmission`,label:`Transmission`,section:`fractal`,min:0,max:1,step:.01},{kind:`slider`,key:`ior`,label:`IOR`,section:`fractal`,min:1,max:2.5,step:.01},{kind:`slider`,key:`thickness`,label:`Thickness`,section:`fractal`,min:0,max:2,step:.01},{kind:`slider`,key:`roughness`,label:`Roughness`,section:`fractal`,min:0,max:1,step:.01},{kind:`slider`,key:`iridescence`,label:`Iridescence`,section:`fractal`,min:0,max:1,step:.01},{kind:`slider`,key:`envIntensity`,label:`Env reflection`,section:`fractal`,min:0,max:2,step:.05},{kind:`slider`,key:`detail`,label:`Facets (0=low)`,section:`fractal`,min:0,max:3,step:1},{kind:`slider`,key:`dpr`,label:`Resolution`,section:`perf`,min:.1,max:2,step:.1}],Qw={valence:{atmosphereGlow:.06,density:.15,asymmetry:-.05},arousal:{speed:.4,orbRotation:.2,density:.4,chromaticAberration:.008},guardedness:{atmosphereGlow:-.1,density:-.4,asymmetry:.15,orbRotation:-.15}};function $w(e){let t={};for(let n of[`valence`,`arousal`,`guardedness`]){let r=Qw[n],i=e[n];!r&&!i||(t[n]={...r??{},...i??{}})}return t}j({id:`crystal`,name:`Crystal`,description:`Faceted icosahedron with PBR transmission + iridescence.`,Component:Yw,palettes:Xw,fields:Zw,defaultPalette:`Prism`,moodDefaults:$w({valence:{iridescence:.1,transmission:.05},arousal:{roughness:-.06,envIntensity:.2,iridescence:.05},guardedness:{transmission:-.15,iridescence:-.1,envIntensity:-.2,roughness:.1}})});var eT=`varying vec3 vLocalPosition; +varying vec3 vNormal; +varying vec3 vViewPosition; + +void main() { + vLocalPosition = position; + vNormal = normalize(normalMatrix * normal); + vec4 mvPosition = modelViewMatrix * vec4(position, 1.0); + vViewPosition = -mvPosition.xyz; + gl_Position = projectionMatrix * mvPosition; +}`;Lv({FluxMaterial:Xx({uTime:0,uLocalCamPos:new U,uColorBase:new G(`#ff7a18`),uIterations:20,uDistortion:2.2,uPulseIntensity:2.5,uFractalScale:.16,uRadius:1.85},eT,`uniform float uTime; +uniform vec3 uLocalCamPos; +uniform vec3 uColorBase; +uniform float uIterations; +uniform float uDistortion; +uniform float uPulseIntensity; +uniform float uFractalScale; +uniform float uRadius; + +varying vec3 vLocalPosition; +varying vec3 vNormal; +varying vec3 vViewPosition; + +float gPhase = 1.0; + +mat2 rot2(float a) { + float s = sin(a), c = cos(a); + return mat2(c, s, -s, c); +} + +float dither(vec2 p) { + vec3 h = fract(vec3(p.xyx) * 0.8431); + h += dot(h, h.yzx + 48.55); + return fract((h.x + h.y) * h.z); +} + +vec2 intersectSphere(vec3 ro, vec3 rd, float radius) { + float b = dot(ro, rd); + float c = dot(ro, ro) - radius * radius; + float h = b * b - c; + if (h < 0.0) return vec2(-1.0); + h = sqrt(h); + return vec2(-b - h, -b + h); +} + +float sceneSDF(vec3 p) { + p.yz *= rot2(0.4); + p.xz *= rot2(uTime * 0.4); + float minD = 125.4; + p *= uFractalScale; + for (int i = 0; i < 30; ++i) { + if (float(i) >= uIterations) break; + float fi = float(i) + 55.0; + p.xy = abs(p.xy); + p.xy = sin(p.xy * uDistortion); + p.xy *= rot2(0.5); + p.xz *= rot2(0.7); + float d = length(p.xy) + 0.07; + if (i > 0) minD = min(minD, d); + if (minD == d) gPhase = fi; + } + return minD * 0.3; +} + +void main() { + vec3 ro = uLocalCamPos; + vec3 rd = normalize(vLocalPosition - uLocalCamPos); + + vec2 hit = intersectSphere(ro, rd, uRadius); + if (hit.y < 0.0) { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + return; + } + + float tEnter = max(0.0, hit.x); + float tExit = hit.y; + float t = tEnter + dither(gl_FragCoord.xy + uTime) * 0.1; + vec3 acc = vec3(0.0); + + for (int s = 0; s < 75; s++) { + vec3 pos = ro + rd * t; + float d = abs(sceneSDF(pos)); + t += max(0.015, d); + if (t > tExit) break; + + vec3 tint = uColorBase; + + + + tint *= exp(0.14 * (t - tEnter)); + tint *= exp(1.0 * length(pos)); + tint /= (80.0 + d * 1500.0); + + float wave = (length(pos) * 0.05) - (uTime * 0.03) + (gPhase * 0.56); + float pulse = abs(pow(abs(fract(wave) - 0.50) * 2.0, 68.4)); + tint *= (0.2 + pulse * uPulseIntensity); + + acc += tint; + acc += exp(-4.9 * length(pos)) * 0.07; + } + + gl_FragColor = vec4(acc, 1.0); +}`)});function tT({voiceState:e,botStream:t,localStream:n}){let{camera:r,gl:i}=dv(),a=(0,v.useRef)(null),o=(0,v.useRef)(null),{base:s,effectiveState:c}=Kw(e),{dBotRef:l,dUserRef:u}=Rw({botStream:t,localStream:n}),{snapRef:d}=qC(c,s),{breathNormRef:f}=JC(),{dragVelRef:p}=YC(a);(0,v.useEffect)(()=>{let e=o.current;e&&(e.uniforms.uIterations.value=s.iterations,e.uniforms.uDistortion.value=s.distortion,e.uniforms.uPulseIntensity.value=s.pulseIntensity,e.uniforms.uFractalScale.value=s.fractalScale)},[s.iterations,s.distortion,s.pulseIntensity,s.fractalScale]),(0,v.useEffect)(()=>{i.setPixelRatio(s.dpr)},[s.dpr,i]),(0,v.useEffect)(()=>{r.position.set(0,0,13)},[r]);let m=(0,v.useMemo)(()=>new U,[]),h=(0,v.useMemo)(()=>new G,[]),g=(0,v.useMemo)(()=>new G,[]);(0,v.useEffect)(()=>{g.set(s.tertiaryEnergy)},[s.tertiaryEnergy,g]);let _=(0,v.useMemo)(()=>new Y(2,64,64),[]);(0,v.useEffect)(()=>()=>_.dispose(),[_]);let y=(0,v.useRef)(0);return fv((e,t)=>{let n=Math.min(t,wC),i=o.current,c=a.current,u=d.current;if(!i||!c||!u)return;let _=l.current;y.current=(y.current+n*s.cycleSpeed)%3;let v=y.current,b=Math.floor(v),x=v-b,S=b===0?u.primary:b===1?u.secondary:g,C=b===0?u.secondary:b===1?g:u.primary;h.copy(S).lerp(C,x);let w=s.brightness*(.7+u.glow)*(1+_*.4);i.uniforms.uColorBase.value.copy(h).multiplyScalar(w);let T=u.scale*(1+f.current*kC)*(1+_*.05);c.scale.setScalar(T),i.uniforms.uTime.value+=n*u.speed*s.speed,c.rotation.y+=n*u.rotation*TC+p.current.y*n,c.rotation.x+=n*u.rotation*.5*TC+p.current.x*n,i.uniforms.uTime.value>PC&&(i.uniforms.uTime.value-=PC),c.rotation.y>$&&(c.rotation.y-=$),c.rotation.y<-$&&(c.rotation.y+=$),c.rotation.x>$&&(c.rotation.x-=$),c.rotation.x<-$&&(c.rotation.x+=$),c.updateMatrixWorld(),m.copy(r.position),c.worldToLocal(m),i.uniforms.uLocalCamPos.value.copy(m)}),(0,Q.jsx)(`mesh`,{ref:a,geometry:_,children:(0,Q.jsx)(`fluxMaterial`,{ref:o,transparent:!0,side:2,depthWrite:!1,blending:2,attach:`material`})})}function nT(){let{params:e}=nx();return(0,Q.jsx)(tx,{intensity:e.bloom??1,luminanceThreshold:.15,luminanceSmoothing:.7,mipmapBlur:!0})}j({id:`flux`,name:`Flux`,description:`A fluid, ever-shifting energy bloom.`,Component:tT,PostEffects:nT,palettes:{Flux:{primaryEnergy:`#ff7a18`,secondaryEnergy:`#ff2d76`,tertiaryEnergy:`#7a2dff`,density:1,atmosphereGlow:.3,speed:1,chromaticAberration:.014,asymmetry:.3,orbRotation:.18,dpr:.8,iterations:20,distortion:2.2,pulseIntensity:2.5,fractalScale:.16,brightness:.5,cycleSpeed:.14,bloom:1},Ember:{primaryEnergy:`#ff3b1f`,secondaryEnergy:`#ff8c1a`,tertiaryEnergy:`#ffd24a`,density:1,atmosphereGlow:.28,speed:.9,chromaticAberration:.012,asymmetry:.25,orbRotation:.16,dpr:.8,iterations:18,distortion:2,pulseIntensity:3,fractalScale:.15,brightness:.5,cycleSpeed:.1,bloom:.95},Tide:{primaryEnergy:`#16f0c8`,secondaryEnergy:`#19a7ff`,tertiaryEnergy:`#5d6bff`,density:1,atmosphereGlow:.32,speed:.95,chromaticAberration:.014,asymmetry:.3,orbRotation:.18,dpr:.8,iterations:20,distortion:2.3,pulseIntensity:2.2,fractalScale:.17,brightness:.5,cycleSpeed:.12,bloom:1.05},Toxic:{primaryEnergy:`#7CFF2A`,secondaryEnergy:`#c8ff19`,tertiaryEnergy:`#19ffa3`,density:1,atmosphereGlow:.3,speed:1.05,chromaticAberration:.018,asymmetry:.35,orbRotation:.2,dpr:.8,iterations:22,distortion:2.4,pulseIntensity:2.8,fractalScale:.18,brightness:.48,cycleSpeed:.2,bloom:1},Nova:{primaryEnergy:`#dbe4ff`,secondaryEnergy:`#5ec8ff`,tertiaryEnergy:`#ff7ad6`,density:1,atmosphereGlow:.36,speed:1,chromaticAberration:.02,asymmetry:.4,orbRotation:.18,dpr:.8,iterations:20,distortion:2.2,pulseIntensity:2.4,fractalScale:.16,brightness:.55,cycleSpeed:.16,bloom:1.1}},fields:[{kind:`color`,key:`primaryEnergy`,label:`Colour A`,section:`color`},{kind:`color`,key:`secondaryEnergy`,label:`Colour B`,section:`color`},{kind:`color`,key:`tertiaryEnergy`,label:`Colour C`,section:`color`},{kind:`slider`,key:`bloom`,label:`Bloom`,section:`energy`,min:0,max:2,step:.05},{kind:`slider`,key:`brightness`,label:`Brightness`,section:`energy`,min:.1,max:2,step:.01},{kind:`slider`,key:`chromaticAberration`,label:`Aberration`,section:`energy`,min:0,max:.05,step:.001},{kind:`slider`,key:`cycleSpeed`,label:`Colour cycle`,section:`motion`,min:0,max:.6,step:.01},{kind:`slider`,key:`pulseIntensity`,label:`Pulse`,section:`motion`,min:0,max:6,step:.1},{kind:`slider`,key:`orbRotation`,label:`Auto-rotation`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`speed`,label:`Speed`,section:`motion`,min:.1,max:2,step:.05},{kind:`slider`,key:`iterations`,label:`Complexity`,section:`fractal`,min:1,max:30,step:1},{kind:`slider`,key:`distortion`,label:`Fluid`,section:`fractal`,min:.5,max:5,step:.1},{kind:`slider`,key:`fractalScale`,label:`Scale`,section:`fractal`,min:.05,max:.4,step:.005},{kind:`slider`,key:`dpr`,label:`Resolution`,section:`perf`,min:.3,max:1.5,step:.1}],defaultPalette:`Flux`,premium:!0}),Lv({FractalMaterial:Xx({uTime:0,uLocalCamPos:new U,uPrimaryColor:new G(`#0ea5e9`),uSecondaryColor:new G(`#f472b6`),uDensity:2.4,uFractalIters:4,uFractalScale:.85,uFractalDecay:-17,uInternalAnim:.42,uSmoothness:.032,uAsymmetry:.5,uAtmosphereGlow:.18,uClickDir:new U(0,0,1),uClickStrength:0},eT,`uniform float uTime; +uniform vec3 uLocalCamPos; +uniform vec3 uPrimaryColor; +uniform vec3 uSecondaryColor; +uniform float uDensity; +uniform float uFractalIters; +uniform float uFractalScale; +uniform float uFractalDecay; +uniform float uInternalAnim; +uniform float uSmoothness; +uniform float uAsymmetry; +uniform float uAtmosphereGlow; +uniform vec3 uClickDir; +uniform float uClickStrength; + +varying vec3 vLocalPosition; +varying vec3 vNormal; +varying vec3 vViewPosition; + +float evaluateStructure(vec3 pos) { + float densityAcc = 0.0; + vec3 anchor = pos; + float animTime = uTime * uInternalAnim; + float s = sin(animTime); + float c = cos(animTime); + mat2 rotAnim = mat2(c, s, -s, c); + float a = 0.5 * uAsymmetry; + mat2 rotAsym1 = mat2(cos(a), sin(a), -sin(a), cos(a)); + float b = 0.3 * uAsymmetry; + mat2 rotAsym2 = mat2(cos(b), sin(b), -sin(b), cos(b)); + for (int step = 0; step < 12; ++step) { + if (float(step) >= uFractalIters) break; + pos.xy *= rotAnim; + pos.yz *= rotAnim; + pos.xz *= rotAsym1; + pos.yz *= rotAsym2; + pos += vec3(0.05, -0.02, 0.03) * uAsymmetry; + vec3 foldedPos = sqrt(pos * pos + uSmoothness); + float magnitudeSq = dot(foldedPos, foldedPos); + magnitudeSq = max(magnitudeSq, 0.00001); + pos = (uFractalScale * foldedPos / magnitudeSq) - uFractalScale; + float ySq = pos.y * pos.y; + float zSq = pos.z * pos.z; + float yz2 = 2.0 * pos.y * pos.z; + pos.yz = vec2(ySq - zSq, yz2); + pos = vec3(pos.z, pos.x, pos.y); + densityAcc += exp(uFractalDecay * abs(dot(pos, anchor))); + } + return densityAcc * 0.5; +} + +vec2 getVolumeBounds(vec3 origin, vec3 dir, float radius) { + float b = dot(origin, dir); + float c = dot(origin, origin) - radius * radius; + float discriminant = b * b - c; + if (discriminant < 0.0) return vec2(-1.0); + float root = sqrt(discriminant); + return vec2(-b - root, -b + root); +} + +vec3 traceEnergy(vec3 origin, vec3 dir, vec2 limits) { + float currentDepth = limits.x; + float marchStep = 0.02; + vec3 finalEnergy = vec3(0.0); + float fieldVal = 0.0; + for (int i = 0; i < 64; i++) { + currentDepth += marchStep * exp(-2.0 * fieldVal); + if (currentDepth > limits.y) break; + vec3 samplePoint = origin + currentDepth * dir; + fieldVal = evaluateStructure(samplePoint); + float vSq = fieldVal * fieldVal; + + + float g = smoothstep(0.05, 0.75, fieldVal); + float hot = smoothstep(0.70, 1.00, fieldVal); + vec3 baseGradient = mix(uSecondaryColor, uPrimaryColor, g); + vec3 hotColor = mix(uPrimaryColor, vec3(1.0), 0.30); + vec3 currentGradient = mix(baseGradient, hotColor, hot * 0.55); + vec3 emission = currentGradient * (fieldVal * 1.8 + vSq * 1.0); + finalEnergy = 0.99 * finalEnergy + (0.08 * uDensity) * emission; + } + return finalEnergy; +} + +void main() { + vec3 rayOrig = uLocalCamPos; + vec3 rayDir = normalize(vLocalPosition - uLocalCamPos); + float t = uTime * 0.1; + float s = sin(t); + float c = cos(t); + mat2 rotXZ = mat2(c, s, -s, c); + rayOrig.xz *= rotXZ; + rayDir.xz *= rotXZ; + vec2 limits = getVolumeBounds(rayOrig, rayDir, 2.0); + + + + limits.x = max(limits.x, 0.0); + if (limits.y < 0.0) discard; + vec3 volumeColor = traceEnergy(rayOrig, rayDir, limits); + vec3 normal = normalize(vNormal); + vec3 viewDir = normalize(vViewPosition); + float facingRatio = max(dot(normal, viewDir), 0.0); + float edgeAA = smoothstep(0.0, 0.05, facingRatio); + vec3 finalColor = 0.5 * log(1.0 + volumeColor); + finalColor = clamp(finalColor, 0.0, 1.0); + finalColor *= edgeAA; + float maxLuma = max(finalColor.r, max(finalColor.g, finalColor.b)); + float alpha = clamp(maxLuma * 1.5, 0.0, 1.0) * edgeAA; + + + + + + vec3 localNormal = normalize(vLocalPosition); + float clickBoost = smoothstep(0.75, 1.0, dot(localNormal, uClickDir)) * uClickStrength; + finalColor += uPrimaryColor * clickBoost * 0.9; + alpha = clamp(alpha + clickBoost * 0.4, 0.0, 1.0); + + gl_FragColor = vec4(finalColor, alpha); +}`)});function rT({voiceState:e,botStream:t,localStream:n}){let{camera:r,gl:i}=dv(),a=(0,v.useRef)(null),o=(0,v.useRef)(null),{base:s,effectiveState:c}=Kw(e),l=(0,v.useRef)(s);l.current=s;let{dBotRef:u,dUserRef:d}=Rw({botStream:t,localStream:n}),{snapRef:f}=qC(c,s),{breathNormRef:p}=JC(),{clickDirRef:m,clickStrengthRef:h,dragVelRef:g}=YC(a);(0,v.useEffect)(()=>{let e=o.current;e&&(e.uniforms.uFractalIters.value=s.fractalIters,e.uniforms.uFractalScale.value=s.fractalScale,e.uniforms.uFractalDecay.value=s.fractalDecay,e.uniforms.uSmoothness.value=s.smoothness,e.uniforms.uInternalAnim.value=s.internalAnim)},[s.fractalIters,s.fractalScale,s.fractalDecay,s.smoothness,s.internalAnim]),(0,v.useEffect)(()=>{i.setPixelRatio(s.dpr)},[s.dpr,i]),(0,v.useEffect)(()=>{r.position.set(0,0,13)},[r]);let _=(0,v.useMemo)(()=>new U,[]),y=(0,v.useMemo)(()=>new Y(2,128,128),[]);return(0,v.useEffect)(()=>()=>y.dispose(),[y]),fv((e,t)=>{let n=Math.min(t,wC),i=o.current,s=a.current,c=f.current;if(!i||!s||!c)return;let l=u.current,v=d.current;i.uniforms.uDensity.value=c.density+l*.9,i.uniforms.uAsymmetry.value=LC(c.asymmetry+v*.06),i.uniforms.uPrimaryColor.value.copy(c.primary),i.uniforms.uSecondaryColor.value.copy(c.secondary),i.uniforms.uClickDir.value.copy(m.current),i.uniforms.uClickStrength.value=h.current;let y=c.scale*(1+p.current*kC)*(1+l*.06);s.scale.setScalar(y),i.uniforms.uTime.value+=n*c.speed,s.rotation.y+=n*c.rotation*TC+g.current.y*n,s.rotation.x+=n*(c.rotation*.5)*TC+g.current.x*n,i.uniforms.uTime.value>PC&&(i.uniforms.uTime.value-=PC),s.rotation.y>$&&(s.rotation.y-=$),s.rotation.y<-$&&(s.rotation.y+=$),s.rotation.x>$&&(s.rotation.x-=$),s.rotation.x<-$&&(s.rotation.x+=$),s.updateMatrixWorld(),_.copy(r.position),s.worldToLocal(_),i.uniforms.uLocalCamPos.value.copy(_)}),(0,Q.jsxs)(`mesh`,{ref:a,geometry:y,children:[(0,Q.jsx)(`fractalMaterial`,{ref:o,transparent:!0,side:2,depthWrite:!1,blending:2,attach:`material`}),(0,Q.jsx)(Jw,{geometry:y,snapRef:f,dBotRef:u,dUserRef:d,clickDirRef:m,clickStrengthRef:h})]})}j({id:`fractal`,name:`Fractal`,description:`Ray-marched volumetric fractal with atmosphere shell.`,Component:rT,palettes:{ProtoLabs:{primaryEnergy:`#9b87f2`,secondaryEnergy:`#6366f1`,speed:.5,density:2.4,dpr:.7,atmosphereGlow:.18,atmosphereLevel:1,atmosphereScale:1.03,orbRotation:.8,internalAnim:.42,fractalIters:4,fractalScale:.85,fractalDecay:-17,smoothness:.032,asymmetry:.5,chromaticAberration:.022},Aurora:{primaryEnergy:`#0ea5e9`,secondaryEnergy:`#f472b6`,speed:.5,density:2.4,dpr:.7,atmosphereGlow:.18,atmosphereLevel:1,atmosphereScale:1.03,orbRotation:.8,internalAnim:.42,fractalIters:4,fractalScale:.85,fractalDecay:-17,smoothness:.032,asymmetry:.5,chromaticAberration:.022},Ember:{primaryEnergy:`#f97316`,secondaryEnergy:`#4338ca`,speed:.6,density:2.1,dpr:.7,atmosphereGlow:.22,atmosphereLevel:1,atmosphereScale:1.03,orbRotation:.7,internalAnim:.55,fractalIters:4,fractalScale:.9,fractalDecay:-15.5,smoothness:.028,asymmetry:.6,chromaticAberration:.026},Citrus:{primaryEnergy:`#eab308`,secondaryEnergy:`#a855f7`,speed:.55,density:1.8,dpr:.7,atmosphereGlow:.18,atmosphereLevel:1,atmosphereScale:1.03,orbRotation:.55,internalAnim:.45,fractalIters:3,fractalScale:.78,fractalDecay:-14.8,smoothness:.014,asymmetry:.38,chromaticAberration:.022},Forest:{primaryEnergy:`#10b981`,secondaryEnergy:`#db2777`,speed:.9,density:1.6,dpr:.7,atmosphereGlow:.2,atmosphereLevel:1,atmosphereScale:1.03,orbRotation:.6,internalAnim:.42,fractalIters:4,fractalScale:.86,fractalDecay:-22,smoothness:.06,asymmetry:.3,chromaticAberration:.006},Noir:{primaryEnergy:`#e4e4e7`,secondaryEnergy:`#18181b`,speed:.35,density:1,dpr:.7,atmosphereGlow:.14,atmosphereLevel:1,atmosphereScale:1.03,orbRotation:.45,internalAnim:.22,fractalIters:4,fractalScale:.76,fractalDecay:-20,smoothness:.034,asymmetry:.1,chromaticAberration:.016}},fields:[{kind:`color`,key:`primaryEnergy`,label:`Primary`,section:`color`},{kind:`color`,key:`secondaryEnergy`,label:`Secondary`,section:`color`},{kind:`slider`,key:`density`,label:`Density`,section:`energy`,min:.1,max:3,step:.1},{kind:`slider`,key:`atmosphereGlow`,label:`Glow`,section:`energy`,min:0,max:5,step:.01},{kind:`slider`,key:`atmosphereLevel`,label:`Halo thickness`,section:`energy`,min:.1,max:1,step:.01},{kind:`slider`,key:`atmosphereScale`,label:`Halo scale`,section:`energy`,min:1,max:1.1,step:.001},{kind:`slider`,key:`chromaticAberration`,label:`Aberration`,section:`energy`,min:0,max:.05,step:.001},{kind:`slider`,key:`speed`,label:`Internal speed`,section:`motion`,min:.1,max:3,step:.1},{kind:`slider`,key:`orbRotation`,label:`Auto-rotation`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`internalAnim`,label:`Anim speed`,section:`motion`,min:0,max:2,step:.01},{kind:`slider`,key:`fractalIters`,label:`Iterations`,section:`fractal`,min:2,max:12,step:1},{kind:`slider`,key:`fractalScale`,label:`Scale`,section:`fractal`,min:.3,max:1.5,step:.01},{kind:`slider`,key:`fractalDecay`,label:`Decay`,section:`fractal`,min:-25,max:-5,step:.1},{kind:`slider`,key:`smoothness`,label:`Smoothness`,section:`fractal`,min:0,max:.15,step:.001},{kind:`slider`,key:`asymmetry`,label:`Asymmetry`,section:`fractal`,min:0,max:1,step:.01},{kind:`slider`,key:`dpr`,label:`Resolution`,section:`perf`,min:.1,max:2,step:.1}],defaultPalette:`Aurora`,moodDefaults:$w({arousal:{fractalIters:.8,internalAnim:.1,fractalScale:.04},guardedness:{fractalIters:-.5,smoothness:-.008,internalAnim:-.06},valence:{fractalScale:.05}})}),Lv({GalaxyShellMaterial:Xx({uColor:new G(`#0066ff`),uOpacity:.41},eT,`uniform vec3 uColor; +uniform float uOpacity; + +varying vec3 vNormal; +varying vec3 vViewPosition; + +void main() { + float fresnel = pow( + 1.0 - dot(normalize(vNormal), normalize(vViewPosition)), + 2.5 + ); + gl_FragColor = vec4(uColor, fresnel * uOpacity); +}`),GalaxyPlasmaMaterial:Xx({uTime:0,uScale:.2,uBrightness:1.31,uThreshold:.09,uColorDeep:new G(`#001433`),uColorMid:new G(`#0084ff`),uColorBright:new G(`#00ffe1`),uPrimaryColor:new G(`#7dd3fc`),uSecondaryColor:new G(`#fb7185`),uVoiceMix:.25,uClickDir:new U(0,0,1),uClickStrength:0},eT,`uniform float uTime; +uniform float uScale; +uniform float uBrightness; +uniform float uThreshold; +uniform vec3 uColorDeep; +uniform vec3 uColorMid; +uniform vec3 uColorBright; +uniform vec3 uPrimaryColor; +uniform vec3 uSecondaryColor; +uniform float uVoiceMix; + +uniform vec3 uClickDir; +uniform float uClickStrength; + +varying vec3 vLocalPosition; +varying vec3 vNormal; +varying vec3 vViewPosition; + +vec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; } +vec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; } +vec4 permute(vec4 x) { return mod289(((x * 34.0) + 1.0) * x); } +vec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; } + +float snoise(vec3 v) { + const vec2 C = vec2(1.0/6.0, 1.0/3.0); + const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); + vec3 i = floor(v + dot(v, C.yyy)); + vec3 x0 = v - i + dot(i, C.xxx); + vec3 g = step(x0.yzx, x0.xyz); + vec3 l = 1.0 - g; + vec3 i1 = min(g.xyz, l.zxy); + vec3 i2 = max(g.xyz, l.zxy); + vec3 x1 = x0 - i1 + C.xxx; + vec3 x2 = x0 - i2 + C.yyy; + vec3 x3 = x0 - D.yyy; + i = mod289(i); + vec4 p = permute(permute(permute( + i.z + vec4(0.0, i1.z, i2.z, 1.0)) + + i.y + vec4(0.0, i1.y, i2.y, 1.0)) + + i.x + vec4(0.0, i1.x, i2.x, 1.0)); + float n_ = 0.142857142857; + vec3 ns = n_ * D.wyz - D.xzx; + vec4 j = p - 49.0 * floor(p * ns.z * ns.z); + vec4 x_ = floor(j * ns.z); + vec4 y_ = floor(j - 7.0 * x_); + vec4 x = x_ * ns.x + ns.yyyy; + vec4 y = y_ * ns.x + ns.yyyy; + vec4 h = 1.0 - abs(x) - abs(y); + vec4 b0 = vec4(x.xy, y.xy); + vec4 b1 = vec4(x.zw, y.zw); + vec4 s0 = floor(b0) * 2.0 + 1.0; + vec4 s1 = floor(b1) * 2.0 + 1.0; + vec4 sh = -step(h, vec4(0.0)); + vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy; + vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww; + vec3 p0 = vec3(a0.xy, h.x); + vec3 p1 = vec3(a0.zw, h.y); + vec3 p2 = vec3(a1.xy, h.z); + vec3 p3 = vec3(a1.zw, h.w); + vec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); + p0 *= norm.x; p1 *= norm.y; p2 *= norm.z; p3 *= norm.w; + vec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0); + m = m * m; + return 42.0 * dot(m * m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3))); +} + +float fbm(vec3 p) { + float total = 0.0; + float amplitude = 0.5; + float frequency = 1.0; + for (int i = 0; i < 3; i++) { + total += snoise(p * frequency) * amplitude; + amplitude *= 0.5; + frequency *= 2.0; + } + return total; +} + +void main() { + vec3 p = vLocalPosition * uScale; + + + + vec3 q = vec3( + fbm(p + vec3(0.0, uTime * 0.05, 0.0)), + fbm(p + vec3(5.2, 1.3, 2.8) + uTime * 0.05), + fbm(p + vec3(2.2, 8.4, 0.5) - uTime * 0.02) + ); + + float density = fbm(p + 2.0 * q); + float t = (density + 0.4) * 0.8; + float alpha = smoothstep(uThreshold, 0.7, t); + + + vec3 cWhite = vec3(1.0, 1.0, 1.0); + vec3 color = mix(uColorDeep, uColorMid, smoothstep(uThreshold, 0.5, t)); + color = mix(color, uColorBright, smoothstep(0.5, 0.8, t)); + color = mix(color, cWhite, smoothstep(0.8, 1.0, t)); + + + + + vec3 voicePalette = mix(uColorMid, uColorBright, smoothstep(0.5, 0.8, t)); + voicePalette = mix(voicePalette, uPrimaryColor, smoothstep(0.5, 1.0, t)); + voicePalette = mix(uSecondaryColor, voicePalette, smoothstep(0.0, 0.5, t)); + color = mix(color, voicePalette, uVoiceMix); + + + + + float facing = dot(normalize(vNormal), normalize(vViewPosition)); + float depthFactor = (facing + 1.0) * 0.5; + float finalAlpha = alpha * (0.02 + 0.98 * depthFactor); + + + + vec3 hitDir = normalize(vLocalPosition); + float clickBoost = uClickStrength * smoothstep(0.55, 1.0, dot(hitDir, uClickDir)); + color += uPrimaryColor * clickBoost * 0.4; + + gl_FragColor = vec4(color * uBrightness, finalAlpha); +}`),GalaxyParticlesMaterial:Xx({uTime:0,uColor:new G(`#ffffff`)},`uniform float uTime; +attribute float aSize; +varying float vAlpha; + +void main() { + vec3 pos = position; + + + + + pos.y += sin(uTime * 0.2 + pos.x) * 0.02; + pos.x += cos(uTime * 0.15 + pos.z) * 0.02; + + vec4 mvPosition = modelViewMatrix * vec4(pos, 1.0); + gl_Position = projectionMatrix * mvPosition; + + + + + float baseSize = 8.0 * aSize + 4.0; + gl_PointSize = baseSize * (1.0 / -mvPosition.z); + + + + vAlpha = 0.8 + 0.2 * sin(uTime + aSize * 10.0); +}`,`uniform vec3 uColor; +varying float vAlpha; + +void main() { + vec2 uv = gl_PointCoord - vec2(0.5); + float dist = length(uv); + if (dist > 0.5) discard; + + float glow = 1.0 - (dist * 2.0); + glow = pow(glow, 1.8); + + gl_FragColor = vec4(uColor, glow * vAlpha); +}`)});function iT({voiceState:e,botStream:t,localStream:n}){let{camera:r,gl:i}=dv(),a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(null),u=(0,v.useRef)(null),d=(0,v.useRef)(null),{base:f,effectiveState:p}=Kw(e),m=(0,v.useRef)(f);m.current=f;let{dBotRef:h,dUserRef:g}=Rw({botStream:t,localStream:n}),{snapRef:_}=qC(p,f),{breathNormRef:y}=JC(),{clickDirRef:b,clickStrengthRef:x,dragVelRef:S}=YC(d);(0,v.useEffect)(()=>{let e=o.current;e&&(e.uniforms.uScale.value=f.plasmaScale,e.uniforms.uColorDeep.value.set(f.colorDeep),e.uniforms.uColorMid.value.set(f.colorMid),e.uniforms.uColorBright.value.set(f.colorBright),e.uniforms.uVoiceMix.value=f.voiceMix)},[f.plasmaScale,f.colorDeep,f.colorMid,f.colorBright,f.voiceMix]),(0,v.useEffect)(()=>{s.current&&(s.current.uniforms.uColor.value.set(f.shellColor),s.current.uniforms.uOpacity.value=f.shellOpacity),c.current&&(c.current.uniforms.uColor.value.set(f.shellColor).multiplyScalar(.4),c.current.uniforms.uOpacity.value=f.shellOpacity*.7)},[f.shellColor,f.shellOpacity]),(0,v.useEffect)(()=>{l.current&&l.current.uniforms.uColor.value.set(f.particleColor)},[f.particleColor]),(0,v.useEffect)(()=>{i.setPixelRatio(f.dpr)},[f.dpr,i]),(0,v.useEffect)(()=>{r.position.set(0,0,13)},[r]);let C=(0,v.useMemo)(()=>new Y(2,64,64),[]),w=(0,v.useMemo)(()=>new Y(1.996,96,96),[]);(0,v.useEffect)(()=>()=>{C.dispose(),w.dispose()},[C,w]);let T=(0,v.useMemo)(()=>{let e=Math.max(50,Math.round(f.particleCount)),t=f.particleRadius,n=new Float32Array(e*3),r=new Float32Array(e);for(let i=0;i()=>T.dispose(),[T]),fv((e,t)=>{let n=Math.min(t,wC),r=o.current,i=l.current,s=a.current,c=u.current,d=_.current;if(!r||!i||!s||!c||!d)return;let p=h.current,m=g.current;r.uniforms.uBrightness.value=f.plasmaBrightness*(.85+d.density*.25)+p*.4,r.uniforms.uThreshold.value=f.voidThreshold+m*.05,r.uniforms.uPrimaryColor.value.copy(d.primary),r.uniforms.uSecondaryColor.value.copy(d.secondary),r.uniforms.uClickDir.value.copy(b.current),r.uniforms.uClickStrength.value=x.current,r.uniforms.uTime.value+=n*d.speed,i.uniforms.uTime.value+=n,r.uniforms.uTime.value>PC&&(r.uniforms.uTime.value-=PC),i.uniforms.uTime.value>PC&&(i.uniforms.uTime.value-=PC);let v=d.scale*(1+y.current*kC)*(1+p*.06);s.scale.setScalar(v),c.rotation.y+=n*.08,s.rotation.y+=n*d.rotation*TC+S.current.y*n,s.rotation.x+=n*(d.rotation*.5)*TC+S.current.x*n,s.rotation.y>$&&(s.rotation.y-=$),s.rotation.y<-$&&(s.rotation.y+=$),s.rotation.x>$&&(s.rotation.x-=$),s.rotation.x<-$&&(s.rotation.x+=$)}),(0,Q.jsxs)(`group`,{ref:a,children:[(0,Q.jsx)(`mesh`,{ref:d,geometry:C,visible:!1}),(0,Q.jsx)(`mesh`,{geometry:C,children:(0,Q.jsx)(`galaxyShellMaterial`,{ref:c,transparent:!0,side:1,blending:2,depthWrite:!1,attach:`material`})}),(0,Q.jsx)(`mesh`,{geometry:C,children:(0,Q.jsx)(`galaxyShellMaterial`,{ref:s,transparent:!0,side:0,blending:2,depthWrite:!1,attach:`material`})}),(0,Q.jsx)(`mesh`,{ref:u,geometry:w,children:(0,Q.jsx)(`galaxyPlasmaMaterial`,{ref:o,transparent:!0,side:2,blending:2,depthWrite:!1,attach:`material`})}),(0,Q.jsx)(`points`,{geometry:T,children:(0,Q.jsx)(`galaxyParticlesMaterial`,{ref:l,transparent:!0,blending:2,depthWrite:!1,attach:`material`})})]})}j({id:`galaxy`,name:`Galaxy`,description:`Three-layer composition — Fresnel shell, domain-warped plasma core, dust-particle field.`,Component:iT,palettes:{ProtoLabs:{primaryEnergy:`#9b87f2`,secondaryEnergy:`#312e81`,density:1.5,atmosphereGlow:.18,atmosphereLevel:1,atmosphereScale:1.03,speed:.5,chromaticAberration:.014,asymmetry:.4,orbRotation:.5,plasmaScale:.2,plasmaBrightness:1.31,voidThreshold:.09,colorDeep:`#1e1b4b`,colorMid:`#6366f1`,colorBright:`#a78bfa`,voiceMix:.25,shellColor:`#818cf8`,shellOpacity:.41,particleCount:600,particleColor:`#e0e7ff`,particleRadius:.95,dpr:.7},Andromeda:{primaryEnergy:`#22d3ee`,secondaryEnergy:`#1e1b4b`,density:1.5,atmosphereGlow:.18,atmosphereLevel:1,atmosphereScale:1.03,speed:.5,chromaticAberration:.014,asymmetry:.4,orbRotation:.5,plasmaScale:.2,plasmaBrightness:1.31,voidThreshold:.09,colorDeep:`#001433`,colorMid:`#0084ff`,colorBright:`#00ffe1`,voiceMix:.25,shellColor:`#0066ff`,shellOpacity:.41,particleCount:600,particleColor:`#ffffff`,particleRadius:.95,dpr:.7},Phoenix:{primaryEnergy:`#fbbf24`,secondaryEnergy:`#7c2d12`,density:1.7,atmosphereGlow:.22,atmosphereLevel:1,atmosphereScale:1.03,speed:.55,chromaticAberration:.02,asymmetry:.5,orbRotation:.55,plasmaScale:.22,plasmaBrightness:1.5,voidThreshold:.07,colorDeep:`#3b0a02`,colorMid:`#dc2626`,colorBright:`#fbbf24`,voiceMix:.3,shellColor:`#ff6b35`,shellOpacity:.45,particleCount:700,particleColor:`#ffe4a3`,particleRadius:.95,dpr:.7},Magellanic:{primaryEnergy:`#c084fc`,secondaryEnergy:`#1e1b4b`,density:1.6,atmosphereGlow:.2,atmosphereLevel:1,atmosphereScale:1.03,speed:.5,chromaticAberration:.018,asymmetry:.45,orbRotation:.5,plasmaScale:.18,plasmaBrightness:1.4,voidThreshold:.1,colorDeep:`#1e1b4b`,colorMid:`#7c3aed`,colorBright:`#f0abfc`,voiceMix:.25,shellColor:`#8b5cf6`,shellOpacity:.42,particleCount:600,particleColor:`#fce7f3`,particleRadius:.95,dpr:.7},Calm:{primaryEnergy:`#94a3b8`,secondaryEnergy:`#0f172a`,density:1.2,atmosphereGlow:.14,atmosphereLevel:1,atmosphereScale:1.03,speed:.4,chromaticAberration:.01,asymmetry:.3,orbRotation:.4,plasmaScale:.15,plasmaBrightness:1.1,voidThreshold:.12,colorDeep:`#0f172a`,colorMid:`#475569`,colorBright:`#cbd5e1`,voiceMix:.2,shellColor:`#64748b`,shellOpacity:.35,particleCount:400,particleColor:`#e2e8f0`,particleRadius:.95,dpr:.7}},fields:[{kind:`color`,key:`primaryEnergy`,label:`Primary tint`,section:`color`},{kind:`color`,key:`secondaryEnergy`,label:`Secondary tint`,section:`color`},{kind:`color`,key:`colorDeep`,label:`Plasma deep`,section:`color`},{kind:`color`,key:`colorMid`,label:`Plasma mid`,section:`color`},{kind:`color`,key:`colorBright`,label:`Plasma bright`,section:`color`},{kind:`color`,key:`shellColor`,label:`Shell`,section:`color`},{kind:`color`,key:`particleColor`,label:`Particle`,section:`color`},{kind:`slider`,key:`density`,label:`Density`,section:`energy`,min:.1,max:3,step:.1},{kind:`slider`,key:`atmosphereGlow`,label:`Glow`,section:`energy`,min:0,max:5,step:.01},{kind:`slider`,key:`atmosphereLevel`,label:`Halo thickness`,section:`energy`,min:.1,max:1,step:.01},{kind:`slider`,key:`atmosphereScale`,label:`Halo scale`,section:`energy`,min:1,max:1.1,step:.001},{kind:`slider`,key:`plasmaBrightness`,label:`Plasma bright`,section:`energy`,min:.5,max:3,step:.05},{kind:`slider`,key:`voidThreshold`,label:`Voids`,section:`energy`,min:0,max:.8,step:.01},{kind:`slider`,key:`shellOpacity`,label:`Shell opacity`,section:`energy`,min:0,max:1,step:.01},{kind:`slider`,key:`voiceMix`,label:`Voice tint`,section:`energy`,min:0,max:1,step:.05},{kind:`slider`,key:`chromaticAberration`,label:`Aberration`,section:`energy`,min:0,max:.05,step:.001},{kind:`slider`,key:`speed`,label:`Internal speed`,section:`motion`,min:.1,max:3,step:.1},{kind:`slider`,key:`orbRotation`,label:`Auto-rotation`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`asymmetry`,label:`Asymmetry`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`plasmaScale`,label:`Plasma scale`,section:`fractal`,min:.05,max:.5,step:.01},{kind:`slider`,key:`particleCount`,label:`Particle count`,section:`fractal`,min:100,max:1500,step:50},{kind:`slider`,key:`particleRadius`,label:`Particle radius`,section:`fractal`,min:.5,max:1,step:.01},{kind:`slider`,key:`dpr`,label:`Resolution`,section:`perf`,min:.1,max:2,step:.1}],defaultPalette:`Andromeda`,premium:!0,moodDefaults:$w({valence:{plasmaBrightness:.1,shellOpacity:.05},arousal:{plasmaBrightness:.15,voiceMix:.1,voidThreshold:-.02},guardedness:{plasmaBrightness:-.2,voidThreshold:.05,shellOpacity:-.1}})}),Lv({LatticeMaterial:Xx({uTime:0,uLocalCamPos:new U,uPrimaryColor:new G(`#7dd3fc`),uSecondaryColor:new G(`#fb7185`),uCubeSize:2,uGridScale:1,uDistortion:0,uGlow:.6,uColorOffset:new U(2,1,0),uClickDir:new U(0,0,1),uClickStrength:0},eT,`uniform float uTime; +uniform vec3 uLocalCamPos; +uniform vec3 uPrimaryColor; +uniform vec3 uSecondaryColor; + +uniform float uCubeSize; +uniform float uGridScale; +uniform float uDistortion; +uniform float uGlow; +uniform vec3 uColorOffset; + +uniform vec3 uClickDir; +uniform float uClickStrength; + +varying vec3 vLocalPosition; + +vec2 intersectBox(vec3 ro, vec3 rd, vec3 extents) { + vec3 m = 0.99 / rd; + vec3 n = m * ro; + vec3 k = abs(m) * extents; + vec3 t1 = -n - k; + vec3 t2 = -n + k; + float tNear = max(max(t1.x, t1.y), t1.z); + float tFar = min(min(t2.x, t2.y), t2.z); + if (tNear > tFar || tFar < 0.0) return vec2(-1.0); + return vec2(max(tNear, 0.0), tFar); +} + +void main() { + vec3 ro = uLocalCamPos; + vec3 rd = normalize(vLocalPosition - uLocalCamPos); + + vec3 boxExtents = vec3(uCubeSize); + vec2 hit = intersectBox(ro, rd, boxExtents); + + + + + if (hit.y < 0.0) discard; + + float t = hit.x; + float tMax = hit.y; + + + + vec3 colorBase = uColorOffset + (uTime * 2.0) + 0.09; + + vec3 accum = vec3(0.0); + + + + + for (int i = 0; i < 100; i++) { + if (t >= tMax) break; + vec3 pos = ro + rd * t; + vec3 q = pos * uGridScale; + + + + vec3 pWrap = abs(fract(q * 0.25) * 4.0 - 2.0); + float dStruct = min( + max(pWrap.x, pWrap.y), + min(max(pWrap.y, pWrap.z), max(pWrap.x, pWrap.z)) + ) - 1.0; + + float distortion = 0.0; + + + if (uDistortion > 0.001) { + distortion = uDistortion * dot(sin(q * 1.2), cos(q.yzx * 1.0)); + } + + float shape = abs(dStruct) + distortion; + float stepSize = max(0.01, 0.7 * abs(shape)); + stepSize = min(stepSize, tMax - t); + + + + + float depthT = float(i) / 100.0; + vec3 voiceMix = mix(uSecondaryColor, uPrimaryColor, depthT); + vec3 palette = (0.5 + 0.5 * cos(0.15 * float(i) + colorBase)) * voiceMix; + + + + + float plen = length(pos); + vec3 pDir = (plen > 1e-4) ? pos / plen : vec3(0.0); + float clickBoost = uClickStrength * smoothstep(0.55, 1.0, dot(pDir, uClickDir)); + + + + float edgeFade = smoothstep(0.0, 0.5, t - hit.x); + float weight = stepSize * edgeFade * (0.049 / (abs(shape) + 0.09)); + + accum += palette * weight * (1.0 + clickBoost * 2.0); + if (clickBoost > 0.001) { + accum += uPrimaryColor * weight * clickBoost * 0.4; + } + + t += stepSize; + } + + + + vec3 finalColor = tanh(accum * uGlow * 1.4); + + + + float maxLuma = max(finalColor.r, max(finalColor.g, finalColor.b)); + float alpha = clamp(maxLuma * 1.5, 0.0, 1.0); + + gl_FragColor = vec4(finalColor, alpha); +}`)});function aT({voiceState:e,botStream:t,localStream:n}){let{camera:r,gl:i}=dv(),a=(0,v.useRef)(null),o=(0,v.useRef)(null),{base:s,effectiveState:c}=Kw(e),l=(0,v.useRef)(s);l.current=s;let{dBotRef:u,dUserRef:d}=Rw({botStream:t,localStream:n}),{snapRef:f}=qC(c,s),{breathNormRef:p}=JC(),{clickDirRef:m,clickStrengthRef:h,dragVelRef:g}=YC(a);(0,v.useEffect)(()=>{let e=o.current;e&&(e.uniforms.uCubeSize.value=s.cubeSize,e.uniforms.uGridScale.value=s.gridScale,e.uniforms.uColorOffset.value.set(s.colorOffsetR,s.colorOffsetG,s.colorOffsetB))},[s.cubeSize,s.gridScale,s.colorOffsetR,s.colorOffsetG,s.colorOffsetB]),(0,v.useEffect)(()=>{i.setPixelRatio(s.dpr)},[s.dpr,i]),(0,v.useEffect)(()=>{r.position.set(0,0,13)},[r]);let _=(0,v.useMemo)(()=>new U,[]),y=(0,v.useMemo)(()=>new Y(5,32,32),[]);return(0,v.useEffect)(()=>()=>y.dispose(),[y]),fv((e,t)=>{let n=Math.min(t,wC),i=o.current,c=a.current,l=f.current;if(!i||!c||!l)return;let v=u.current,y=d.current;i.uniforms.uGlow.value=s.glow*(.85+l.density*.25)+v*.18,i.uniforms.uDistortion.value=s.distortion+y*.1,i.uniforms.uPrimaryColor.value.copy(l.primary),i.uniforms.uSecondaryColor.value.copy(l.secondary),i.uniforms.uClickDir.value.copy(m.current),i.uniforms.uClickStrength.value=h.current;let b=l.scale*(1+p.current*kC)*(1+v*.06);c.scale.setScalar(b),i.uniforms.uTime.value+=n*l.speed,c.rotation.y+=n*l.rotation*TC+g.current.y*n,c.rotation.x+=n*(l.rotation*.5)*TC+g.current.x*n,i.uniforms.uTime.value>PC&&(i.uniforms.uTime.value-=PC),c.rotation.y>$&&(c.rotation.y-=$),c.rotation.y<-$&&(c.rotation.y+=$),c.rotation.x>$&&(c.rotation.x-=$),c.rotation.x<-$&&(c.rotation.x+=$),c.updateMatrixWorld(),_.copy(r.position),c.worldToLocal(_),i.uniforms.uLocalCamPos.value.copy(_)}),(0,Q.jsx)(`mesh`,{ref:a,geometry:y,children:(0,Q.jsx)(`latticeMaterial`,{ref:o,transparent:!0,side:2,depthWrite:!1,blending:2,attach:`material`})})}j({id:`lattice`,name:`Lattice`,description:`AABB-bounded raymarch through a wrapped grid — cube silhouette with faceted lattice shells inside.`,Component:aT,palettes:{ProtoLabs:{primaryEnergy:`#9b87f2`,secondaryEnergy:`#6366f1`,density:1.6,atmosphereGlow:.16,atmosphereLevel:1,atmosphereScale:1.03,speed:.5,chromaticAberration:.018,asymmetry:.45,orbRotation:.55,cubeSize:2,gridScale:1,distortion:0,glow:.6,colorOffsetR:2,colorOffsetG:1,colorOffsetB:0,dpr:.7},Glasshouse:{primaryEnergy:`#7dd3fc`,secondaryEnergy:`#fb7185`,density:1.6,atmosphereGlow:.16,atmosphereLevel:1,atmosphereScale:1.03,speed:.5,chromaticAberration:.018,asymmetry:.45,orbRotation:.55,cubeSize:2,gridScale:1,distortion:0,glow:.6,colorOffsetR:2,colorOffsetG:1,colorOffsetB:0,dpr:.7},Forge:{primaryEnergy:`#f59e0b`,secondaryEnergy:`#7c2d12`,density:1.8,atmosphereGlow:.2,atmosphereLevel:1,atmosphereScale:1.03,speed:.55,chromaticAberration:.024,asymmetry:.55,orbRotation:.6,cubeSize:2.2,gridScale:1.1,distortion:.15,glow:.7,colorOffsetR:.8,colorOffsetG:.2,colorOffsetB:1.6,dpr:.7},Quartz:{primaryEnergy:`#cbd5e1`,secondaryEnergy:`#0f172a`,density:1.2,atmosphereGlow:.14,atmosphereLevel:1,atmosphereScale:1.03,speed:.4,chromaticAberration:.012,asymmetry:.3,orbRotation:.45,cubeSize:2,gridScale:.9,distortion:0,glow:.5,colorOffsetR:0,colorOffsetG:0,colorOffsetB:0,dpr:.7},Voltage:{primaryEnergy:`#a3e635`,secondaryEnergy:`#d946ef`,density:2,atmosphereGlow:.2,atmosphereLevel:1,atmosphereScale:1.03,speed:.7,chromaticAberration:.026,asymmetry:.6,orbRotation:.75,cubeSize:2,gridScale:1.4,distortion:.35,glow:.85,colorOffsetR:1.6,colorOffsetG:.6,colorOffsetB:2.4,dpr:.7}},fields:[{kind:`color`,key:`primaryEnergy`,label:`Primary`,section:`color`},{kind:`color`,key:`secondaryEnergy`,label:`Secondary`,section:`color`},{kind:`slider`,key:`density`,label:`Density`,section:`energy`,min:.1,max:3,step:.1},{kind:`slider`,key:`atmosphereGlow`,label:`Glow`,section:`energy`,min:0,max:5,step:.01},{kind:`slider`,key:`atmosphereLevel`,label:`Halo thickness`,section:`energy`,min:.1,max:1,step:.01},{kind:`slider`,key:`atmosphereScale`,label:`Halo scale`,section:`energy`,min:1,max:1.1,step:.001},{kind:`slider`,key:`glow`,label:`Core glow`,section:`energy`,min:0,max:1.5,step:.01},{kind:`slider`,key:`chromaticAberration`,label:`Aberration`,section:`energy`,min:0,max:.05,step:.001},{kind:`slider`,key:`speed`,label:`Internal speed`,section:`motion`,min:.1,max:3,step:.1},{kind:`slider`,key:`orbRotation`,label:`Auto-rotation`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`asymmetry`,label:`Asymmetry`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`cubeSize`,label:`Cube size`,section:`fractal`,min:.5,max:4,step:.1},{kind:`slider`,key:`gridScale`,label:`Grid scale`,section:`fractal`,min:.3,max:3,step:.05},{kind:`slider`,key:`distortion`,label:`Distortion`,section:`fractal`,min:0,max:1,step:.01},{kind:`slider`,key:`colorOffsetR`,label:`Color shift R`,section:`fractal`,min:0,max:5,step:.1},{kind:`slider`,key:`colorOffsetG`,label:`Color shift G`,section:`fractal`,min:0,max:5,step:.1},{kind:`slider`,key:`colorOffsetB`,label:`Color shift B`,section:`fractal`,min:0,max:5,step:.1},{kind:`slider`,key:`dpr`,label:`Resolution`,section:`perf`,min:.1,max:2,step:.1}],defaultPalette:`Glasshouse`,premium:!0,moodDefaults:$w({valence:{glow:.1,gridScale:.05},arousal:{glow:.1,distortion:.1,gridScale:.15},guardedness:{glow:-.15,gridScale:-.1,distortion:-.05}})}),Lv({NebulaMaterial:Xx({uTime:0,uLocalCamPos:new U,uPrimaryColor:new G(`#c084fc`),uSecondaryColor:new G(`#38bdf8`),uDensity:1.2,uCloudScale:1.8,uCloudiness:.9,uDrift:.5,uSoftness:.6,uClickDir:new U(0,0,1),uClickStrength:0},eT,`uniform float uTime; +uniform vec3 uLocalCamPos; +uniform vec3 uPrimaryColor; +uniform vec3 uSecondaryColor; +uniform float uDensity; +uniform float uCloudScale; +uniform float uCloudiness; +uniform float uDrift; +uniform float uSoftness; +uniform vec3 uClickDir; +uniform float uClickStrength; + +varying vec3 vLocalPosition; +varying vec3 vNormal; +varying vec3 vViewPosition; + +float hash(vec3 p) { + p = fract(p * 0.3183099 + 0.1); + p *= 17.0; + return fract(p.x * p.y * p.z * (p.x + p.y + p.z)); +} + +float noise(vec3 p) { + vec3 i = floor(p); + vec3 f = fract(p); + f = f * f * (3.0 - 2.0 * f); + return mix( + mix( + mix(hash(i + vec3(0, 0, 0)), hash(i + vec3(1, 0, 0)), f.x), + mix(hash(i + vec3(0, 1, 0)), hash(i + vec3(1, 1, 0)), f.x), + f.y + ), + mix( + mix(hash(i + vec3(0, 0, 1)), hash(i + vec3(1, 0, 1)), f.x), + mix(hash(i + vec3(0, 1, 1)), hash(i + vec3(1, 1, 1)), f.x), + f.y + ), + f.z + ); +} + +float fbm(vec3 p) { + float a = 0.5; + float s = 0.0; + for (int i = 0; i < 3; i++) { + s += a * noise(p); + p *= 2.02; + a *= 0.5; + } + return s; +} + +float evaluate(vec3 pos) { + + vec3 drift = vec3(uTime * uDrift * 0.08, uTime * uDrift * -0.05, uTime * uDrift * 0.03); + + + + float shape = noise(pos * uCloudScale * 0.5 + drift * 0.3); + + + vec3 warped = pos * uCloudScale + drift + noise(pos * uCloudScale * 1.5) * 0.4; + float detail = fbm(warped); + float d = smoothstep(0.25, 0.85, shape) * detail; + + float edge = smoothstep(2.0, 2.0 - uSoftness * 2.0, length(pos)); + return d * edge * uCloudiness; +} + +vec2 getVolumeBounds(vec3 origin, vec3 dir, float radius) { + float b = dot(origin, dir); + float c = dot(origin, origin) - radius * radius; + float discriminant = b * b - c; + if (discriminant < 0.0) return vec2(-1.0); + float root = sqrt(discriminant); + return vec2(-b - root, -b + root); +} + +float phase(float cosTheta, float g) { + float g2 = g * g; + return (1.0 - g2) / (4.0 * 3.14159 * pow(1.0 + g2 - 2.0 * g * cosTheta, 1.5)); +} + +vec3 traceVolume(vec3 origin, vec3 dir, vec2 limits) { + float t = limits.x; + vec3 accum = vec3(0.0); + float trans = 1.0; + vec3 lightDir = normalize(vec3(0.3, 0.6, 0.5)); + float forward = phase(dot(dir, lightDir), 0.45); + + for (int i = 0; i < 28; i++) { + if (t > limits.y || trans < 0.02) break; + vec3 p = origin + t * dir; + float d = evaluate(p); + + + float step = mix(0.18, 0.08, smoothstep(0.0, 0.15, d)); + if (d > 0.001) { + float g = smoothstep(0.0, 0.6, d); + vec3 baseRamp = mix(uSecondaryColor, uPrimaryColor, g); + vec3 hotTip = mix(uPrimaryColor, vec3(1.0), 0.35); + vec3 col = mix(baseRamp, hotTip, smoothstep(0.6, 1.0, d) * 0.5); + col *= (0.8 + forward * 1.2); + float sigma = 1.1 * uDensity; + float absorption = exp(-d * step * sigma); + accum += trans * (1.0 - absorption) * col; + trans *= absorption; + } + t += step; + } + return accum; +} + +void main() { + vec3 rayOrig = uLocalCamPos; + vec3 rayDir = normalize(vLocalPosition - uLocalCamPos); + vec2 limits = getVolumeBounds(rayOrig, rayDir, 2.0); + limits.x = max(limits.x, 0.0); + if (limits.y < 0.0) discard; + + vec3 volume = traceVolume(rayOrig, rayDir, limits); + vec3 finalColor = volume; + + vec3 normal = normalize(vNormal); + vec3 viewDir = normalize(vViewPosition); + float edgeAA = smoothstep(0.0, 0.05, max(dot(normal, viewDir), 0.0)); + finalColor *= edgeAA; + float maxLuma = max(finalColor.r, max(finalColor.g, finalColor.b)); + float alpha = clamp(maxLuma * 1.3, 0.0, 1.0) * edgeAA; + + + vec3 localNormal = normalize(vLocalPosition); + float clickBoost = smoothstep(0.75, 1.0, dot(localNormal, uClickDir)) * uClickStrength; + finalColor += uPrimaryColor * clickBoost * 0.7; + alpha = clamp(alpha + clickBoost * 0.4, 0.0, 1.0); + + gl_FragColor = vec4(finalColor, alpha); +}`)});function oT({voiceState:e,botStream:t,localStream:n}){let{camera:r,gl:i}=dv(),a=(0,v.useRef)(null),o=(0,v.useRef)(null),{base:s,effectiveState:c}=Kw(e),{dBotRef:l,dUserRef:u}=Rw({botStream:t,localStream:n}),{snapRef:d}=qC(c,s),{breathNormRef:f}=JC(),{clickDirRef:p,clickStrengthRef:m,dragVelRef:h}=YC(a);(0,v.useEffect)(()=>{let e=o.current;e&&(e.uniforms.uCloudScale.value=s.cloudScale,e.uniforms.uSoftness.value=s.softness)},[s.cloudScale,s.softness]),(0,v.useEffect)(()=>{i.setPixelRatio(s.dpr)},[s.dpr,i]),(0,v.useEffect)(()=>{r.position.set(0,0,13)},[r]);let g=(0,v.useMemo)(()=>new U,[]),_=(0,v.useMemo)(()=>new Y(2,96,96),[]);return(0,v.useEffect)(()=>()=>_.dispose(),[_]),fv((e,t)=>{let n=Math.min(t,wC),i=o.current,c=a.current,_=d.current;if(!i||!c||!_)return;let v=l.current,y=u.current;i.uniforms.uDensity.value=s.density*(.8+_.density*.3)+v*1.2,i.uniforms.uCloudiness.value=s.cloudiness*(1+f.current*kC*2),i.uniforms.uDrift.value=s.drift*(1+y*1.8+v*.4),i.uniforms.uPrimaryColor.value.copy(_.primary),i.uniforms.uSecondaryColor.value.copy(_.secondary),i.uniforms.uClickDir.value.copy(p.current),i.uniforms.uClickStrength.value=m.current;let b=_.scale*(1+f.current*kC)*(1+v*.04);c.scale.setScalar(b),i.uniforms.uTime.value+=n*_.speed,c.rotation.y+=n*_.rotation*TC+h.current.y*n,c.rotation.x+=n*(_.rotation*.5)*TC+h.current.x*n,i.uniforms.uTime.value>PC&&(i.uniforms.uTime.value-=PC),c.rotation.y>$&&(c.rotation.y-=$),c.rotation.y<-$&&(c.rotation.y+=$),c.rotation.x>$&&(c.rotation.x-=$),c.rotation.x<-$&&(c.rotation.x+=$),c.updateMatrixWorld(),g.copy(r.position),c.worldToLocal(g),i.uniforms.uLocalCamPos.value.copy(g)}),(0,Q.jsxs)(`mesh`,{ref:a,geometry:_,children:[(0,Q.jsx)(`nebulaMaterial`,{ref:o,transparent:!0,side:2,depthWrite:!1,blending:2,attach:`material`}),(0,Q.jsx)(Jw,{geometry:_,snapRef:d,dBotRef:l,dUserRef:u,clickDirRef:p,clickStrengthRef:m})]})}j({id:`nebula`,name:`Nebula`,description:`Noise-based volumetric cloud — raymarched FBM with domain warp.`,Component:oT,palettes:{ProtoLabs:{primaryEnergy:`#9b87f2`,secondaryEnergy:`#6366f1`,speed:.5,density:1.3,dpr:.55,atmosphereGlow:.18,atmosphereLevel:.9,atmosphereScale:1.04,orbRotation:.45,asymmetry:.4,chromaticAberration:.018,cloudScale:1.8,cloudiness:.95,drift:.5,softness:.6,internalAnim:.4},Andromeda:{primaryEnergy:`#c084fc`,secondaryEnergy:`#38bdf8`,speed:.5,density:1.3,dpr:.55,atmosphereGlow:.18,atmosphereLevel:.9,atmosphereScale:1.04,orbRotation:.45,asymmetry:.4,chromaticAberration:.018,cloudScale:1.8,cloudiness:.95,drift:.5,softness:.6,internalAnim:.4},Emerald:{primaryEnergy:`#34d399`,secondaryEnergy:`#f472b6`,speed:.45,density:1.5,dpr:.55,atmosphereGlow:.22,atmosphereLevel:.9,atmosphereScale:1.04,orbRotation:.55,asymmetry:.5,chromaticAberration:.022,cloudScale:2.1,cloudiness:1,drift:.6,softness:.55,internalAnim:.45},Helios:{primaryEnergy:`#fbbf24`,secondaryEnergy:`#ef4444`,speed:.6,density:1.8,dpr:.55,atmosphereGlow:.28,atmosphereLevel:1,atmosphereScale:1.03,orbRotation:.6,asymmetry:.55,chromaticAberration:.028,cloudScale:1.6,cloudiness:1.1,drift:.7,softness:.5,internalAnim:.5},Veil:{primaryEnergy:`#e4e4e7`,secondaryEnergy:`#3730a3`,speed:.35,density:1,dpr:.55,atmosphereGlow:.12,atmosphereLevel:.8,atmosphereScale:1.04,orbRotation:.4,asymmetry:.3,chromaticAberration:.012,cloudScale:2.4,cloudiness:.8,drift:.4,softness:.7,internalAnim:.35}},fields:[{kind:`color`,key:`primaryEnergy`,label:`Primary`,section:`color`},{kind:`color`,key:`secondaryEnergy`,label:`Secondary`,section:`color`},{kind:`slider`,key:`density`,label:`Density`,section:`energy`,min:.2,max:3,step:.05},{kind:`slider`,key:`atmosphereGlow`,label:`Halo glow`,section:`energy`,min:0,max:1,step:.01},{kind:`slider`,key:`atmosphereLevel`,label:`Halo thickness`,section:`energy`,min:.1,max:1,step:.01},{kind:`slider`,key:`atmosphereScale`,label:`Halo scale`,section:`energy`,min:1,max:1.1,step:.001},{kind:`slider`,key:`chromaticAberration`,label:`Aberration`,section:`energy`,min:0,max:.05,step:.001},{kind:`slider`,key:`speed`,label:`Drift speed`,section:`motion`,min:.1,max:3,step:.1},{kind:`slider`,key:`orbRotation`,label:`Auto-rotation`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`asymmetry`,label:`Asymmetry`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`cloudScale`,label:`Cloud scale`,section:`fractal`,min:.8,max:4,step:.05},{kind:`slider`,key:`cloudiness`,label:`Cloudiness`,section:`fractal`,min:.3,max:1.5,step:.01},{kind:`slider`,key:`drift`,label:`Drift`,section:`fractal`,min:0,max:1.5,step:.01},{kind:`slider`,key:`softness`,label:`Edge softness`,section:`fractal`,min:.1,max:1,step:.01},{kind:`slider`,key:`dpr`,label:`Resolution`,section:`perf`,min:.1,max:2,step:.1}],defaultPalette:`Andromeda`,moodDefaults:$w({arousal:{cloudiness:.2,drift:.3},valence:{cloudiness:.1,softness:.04},guardedness:{cloudiness:-.2,drift:-.2,softness:-.05}})});function sT(e,t=1){let n=Math.PI*(3-Math.sqrt(5)),r=Array(e);for(let i=0;isT(_,1),[_]),b=(0,v.useMemo)(()=>{let e=new Float32Array(_*3),t=196108,n=()=>(t^=t<<13,t^=t>>>17,t^=t<<5,(t>>>0)%1e4/1e4);for(let t=0;t<_;t++)e[t*3+0]=n()*Math.PI*2,e[t*3+1]=n()*2-1,e[t*3+2]=.6+n()*.6;return e},[_]),x=(0,v.useMemo)(()=>new Ml(1,0),[]);(0,v.useEffect)(()=>()=>x.dispose(),[x]);let S=(0,v.useMemo)(()=>new co({transparent:!0,blending:2,depthWrite:!1,toneMapped:!1}),[]);(0,v.useEffect)(()=>()=>S.dispose(),[S]),(0,v.useEffect)(()=>{r.setPixelRatio(c.dpr)},[c.dpr,r]),(0,v.useEffect)(()=>{i.position.set(0,0,6)},[i]);let C=(0,v.useMemo)(()=>new Y(1.2,24,24),[]);(0,v.useEffect)(()=>()=>C.dispose(),[C]);let w=(0,v.useMemo)(()=>new Y(1.25,64,64),[]);(0,v.useEffect)(()=>()=>w.dispose(),[w]);let T=(0,v.useMemo)(()=>new G,[]),E=(0,v.useMemo)(()=>new W,[]),D=(0,v.useMemo)(()=>new U,[]),O=(0,v.useMemo)(()=>new vr,[]),k=(0,v.useMemo)(()=>new U,[]);return fv((e,t)=>{let n=Math.min(t,wC),r=a.current,i=o.current,s=f.current;if(!r||!i||!s)return;let l=u.current,m=d.current,h=p.current,v=performance.now()*.001,x=c.radius*s.scale*(1+h*kC)*(1+l*.15*c.density),S=(c.hueSpread??15)/360,C={h:0,s:0,l:0};s.primary.getHSL(C);for(let e=0;e<_;e++){let t=y[e].x,n=y[e].y,i=y[e].z,a=b[e*3+0],o=b[e*3+1],u=b[e*3+2],d=1+Math.sin(v*1.6+a)*.04*(.6+l*1.5),f=Math.sin(v*3.1+a*1.3)*m*c.jitter*u,p=Math.cos(v*2.7+a*1.8)*m*c.jitter*u,h=Math.sin(v*2.3+a*.9)*m*c.jitter*u;D.set(t*x*d+f,n*x*d+p,i*x*d+h),O.identity(),k.setScalar(c.particleSize),E.compose(D,O,k),r.setMatrixAt(e,E);let g=(C.h+o*S+1)%1;T.setHSL(g,C.s,C.l),o>.4&&T.lerp(s.secondary,.25*o),r.setColorAt(e,T)}r.instanceMatrix.needsUpdate=!0,r.instanceColor&&(r.instanceColor.needsUpdate=!0);let w=s.rotation*TC*c.speed;i.rotation.y+=n*w+g.current.y*n,i.rotation.x+=w*.5*n+g.current.x*n,i.rotation.y>$&&(i.rotation.y-=$),i.rotation.y<-$&&(i.rotation.y+=$),i.rotation.x>$&&(i.rotation.x-=$),i.rotation.x<-$&&(i.rotation.x+=$)}),(0,Q.jsxs)(`group`,{ref:o,children:[(0,Q.jsx)(`instancedMesh`,{ref:a,args:[x,S,_],frustumCulled:!1}),(0,Q.jsx)(`mesh`,{ref:s,geometry:C,visible:!1}),(0,Q.jsx)(Jw,{geometry:w,snapRef:f,dBotRef:u,dUserRef:d,clickDirRef:m,clickStrengthRef:h})]})}j({id:`particles`,name:`Particles`,description:`Fibonacci-lattice sphere of small icosahedra, audio-reactive.`,Component:cT,palettes:{ProtoLabs:{primaryEnergy:`#9b87f2`,secondaryEnergy:`#6366f1`,speed:.4,density:.6,dpr:.9,atmosphereGlow:.15,atmosphereLevel:.7,atmosphereScale:1.05,orbRotation:.35,asymmetry:.25,chromaticAberration:.016,count:1800,particleSize:.022,jitter:.08,radius:1.15,hueSpread:12},Constellation:{primaryEnergy:`#38bdf8`,secondaryEnergy:`#fb923c`,speed:.4,density:.6,dpr:.9,atmosphereGlow:.15,atmosphereLevel:.7,atmosphereScale:1.05,orbRotation:.35,asymmetry:.25,chromaticAberration:.016,count:1800,particleSize:.022,jitter:.08,radius:1.15,hueSpread:15},Stardust:{primaryEnergy:`#f472b6`,secondaryEnergy:`#a78bfa`,speed:.35,density:.7,dpr:.9,atmosphereGlow:.22,atmosphereLevel:.8,atmosphereScale:1.05,orbRotation:.3,asymmetry:.3,chromaticAberration:.02,count:2400,particleSize:.018,jitter:.1,radius:1.1,hueSpread:22},Ember:{primaryEnergy:`#fbbf24`,secondaryEnergy:`#dc2626`,speed:.55,density:.8,dpr:.9,atmosphereGlow:.3,atmosphereLevel:.8,atmosphereScale:1.04,orbRotation:.4,asymmetry:.4,chromaticAberration:.024,count:1500,particleSize:.026,jitter:.14,radius:1.05,hueSpread:18},Moss:{primaryEnergy:`#4ade80`,secondaryEnergy:`#0ea5e9`,speed:.3,density:.5,dpr:.9,atmosphereGlow:.12,atmosphereLevel:.65,atmosphereScale:1.06,orbRotation:.28,asymmetry:.2,chromaticAberration:.01,count:2e3,particleSize:.02,jitter:.06,radius:1.2,hueSpread:10}},fields:[{kind:`color`,key:`primaryEnergy`,label:`Primary`,section:`color`},{kind:`color`,key:`secondaryEnergy`,label:`Secondary`,section:`color`},{kind:`slider`,key:`density`,label:`Radial push`,section:`energy`,min:0,max:1.5,step:.01},{kind:`slider`,key:`atmosphereGlow`,label:`Halo glow`,section:`energy`,min:0,max:1,step:.01},{kind:`slider`,key:`atmosphereLevel`,label:`Halo thickness`,section:`energy`,min:.1,max:1,step:.01},{kind:`slider`,key:`atmosphereScale`,label:`Halo scale`,section:`energy`,min:1,max:1.1,step:.001},{kind:`slider`,key:`chromaticAberration`,label:`Aberration`,section:`energy`,min:0,max:.05,step:.001},{kind:`slider`,key:`speed`,label:`Rotation speed`,section:`motion`,min:.1,max:2,step:.05},{kind:`slider`,key:`orbRotation`,label:`Auto-rotation`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`asymmetry`,label:`Asymmetry`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`count`,label:`Particle count`,section:`fractal`,min:400,max:3200,step:100},{kind:`slider`,key:`particleSize`,label:`Particle size`,section:`fractal`,min:.005,max:.05,step:.001},{kind:`slider`,key:`jitter`,label:`Voice jitter`,section:`fractal`,min:0,max:.3,step:.005},{kind:`slider`,key:`radius`,label:`Shell radius`,section:`fractal`,min:.6,max:1.8,step:.01},{kind:`slider`,key:`hueSpread`,label:`Hue spread`,section:`fractal`,min:0,max:60,step:1},{kind:`slider`,key:`dpr`,label:`Resolution`,section:`perf`,min:.1,max:2,step:.1}],defaultPalette:`Constellation`,moodDefaults:$w({arousal:{jitter:.08,hueSpread:15,particleSize:.005},valence:{hueSpread:8,particleSize:.003},guardedness:{jitter:-.06,hueSpread:-10,radius:-.05}})}),Lv({ReactorMaterial:Xx({uTime:0,uLocalCamPos:new U,uBaseColor:new G(`#7780ff`),uSecondaryColor:new G(`#00e5ff`),uBrightness:1.42,uFoldSteps:6,uKifsScale:1.26,uKifsOffset:8.9,uTextureScale:1.45,uLightSpeed:5.5,uMaxSteps:110,uAutoRotationSpeed:1,uShellInner:1.82},eT,`uniform float uTime; +uniform vec3 uLocalCamPos; +uniform vec3 uBaseColor; +uniform vec3 uSecondaryColor; +uniform float uBrightness; +uniform float uFoldSteps; +uniform float uKifsScale; +uniform float uKifsOffset; +uniform float uTextureScale; +uniform float uLightSpeed; +uniform float uMaxSteps; +uniform float uAutoRotationSpeed; +uniform float uShellInner; + +varying vec3 vLocalPosition; +varying vec3 vNormal; +varying vec3 vViewPosition; + +const float OUTER = 2.0; +const float DOMAIN = 7.5; + +mat2 rot2(float a) { + float s = sin(a), c = cos(a); + return mat2(c, -s, s, c); +} + +vec2 intersectSphere(vec3 ro, vec3 rd, float radius) { + float b = dot(ro, rd); + float c = dot(ro, ro) - radius * radius; + float h = b * b - c; + if (h < 0.0) return vec2(-1.0); + h = sqrt(h); + return vec2(-b - h, -b + h); +} + +void main() { + vec3 ro = uLocalCamPos; + vec3 rd = normalize(vLocalPosition - uLocalCamPos); + + vec2 hit = intersectSphere(ro, rd, OUTER); + if (hit.y < 0.0) { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + return; + } + + float tStart = max(0.0, hit.x); + float tEnd = hit.y; + float stepSize = (tEnd - tStart) / uMaxSteps; + float t = tStart; + + vec3 acc = vec3(0.0); + + for (int i = 0; i < 220; i++) { + if (float(i) >= uMaxSteps) break; + + vec3 localPos = ro + rd * t; + float dist = length(localPos); + + + float wallMask = + smoothstep(uShellInner, uShellInner + 0.10, dist) * + smoothstep(OUTER, OUTER - 0.04, dist); + + if (wallMask > 0.01) { + vec3 p = localPos * DOMAIN * uTextureScale; + + + p.xy *= rot2(uTime * 0.15 * uAutoRotationSpeed); + p.xz *= rot2(uTime * 0.10 * uAutoRotationSpeed); + + p = abs(p); + + float timeVal = 2.6 + float(i) * 0.356; + vec3 reflAxis = normalize(tan(timeVal + vec3(2.5, 1.0, 0.0))); + p = reflect(-p, reflAxis) - vec3(-2.6, -1.0, 0.2); + + float accScale = 0.1; + if (p.x < p.z) p = p.zyx; + + for (int k = 0; k < 16; k++) { + if (float(k) >= uFoldSteps) break; + p *= uKifsScale; accScale *= uKifsScale; p.y += uKifsOffset; + if (p.y > p.z) p = p.xzy; + p *= uKifsScale; accScale *= uKifsScale; p.y += uKifsOffset; + if (p.x < p.y) p = p.yxz; + } + + float density = max(length(p.xz) / accScale, 0.001); + vec3 phase = p.xyz; + vec3 light = exp(sin(uTime * uLightSpeed + phase)) / density; + acc += uBaseColor * light * stepSize * uBrightness * wallMask; + } + + t += stepSize; + } + + gl_FragColor.rgb = tanh(acc); + gl_FragColor.a = 1.0; + + + float rim = 0.7 - max(dot(-rd, normalize(vLocalPosition)), 0.5); + gl_FragColor.rgb += uSecondaryColor * 0.5 * pow(max(rim, 0.0), 4.0); +}`)});function lT({voiceState:e,botStream:t,localStream:n}){let{camera:r,gl:i}=dv(),a=(0,v.useRef)(null),o=(0,v.useRef)(null),{base:s,effectiveState:c}=Kw(e),{dBotRef:l,dUserRef:u}=Rw({botStream:t,localStream:n}),{snapRef:d}=qC(c,s),{breathNormRef:f}=JC(),{dragVelRef:p}=YC(a);(0,v.useEffect)(()=>{let e=o.current;e&&(e.uniforms.uFoldSteps.value=s.foldSteps,e.uniforms.uKifsScale.value=s.kifsScale,e.uniforms.uKifsOffset.value=s.kifsOffset,e.uniforms.uTextureScale.value=s.textureScale,e.uniforms.uLightSpeed.value=s.lightSpeed,e.uniforms.uMaxSteps.value=s.maxSteps,e.uniforms.uAutoRotationSpeed.value=s.autoRotationSpeed,e.uniforms.uShellInner.value=s.shellInner)},[s.foldSteps,s.kifsScale,s.kifsOffset,s.textureScale,s.lightSpeed,s.maxSteps,s.autoRotationSpeed,s.shellInner]),(0,v.useEffect)(()=>{i.setPixelRatio(s.dpr)},[s.dpr,i]),(0,v.useEffect)(()=>{r.position.set(0,0,13)},[r]);let m=(0,v.useMemo)(()=>new U,[]),h=(0,v.useMemo)(()=>new Y(2,64,64),[]);return(0,v.useEffect)(()=>()=>h.dispose(),[h]),fv((e,t)=>{let n=Math.min(t,wC),i=o.current,c=a.current,u=d.current;if(!i||!c||!u)return;let h=l.current;i.uniforms.uBaseColor.value.copy(u.primary).multiplyScalar(s.colorBoost),i.uniforms.uSecondaryColor.value.copy(u.secondary),i.uniforms.uBrightness.value=s.brightness*(.7+u.glow)*(1+h*.4);let g=u.scale*(1+f.current*kC)*(1+h*.05);c.scale.setScalar(g),i.uniforms.uTime.value+=n*u.speed*s.speed,c.rotation.y+=n*u.rotation*TC+p.current.y*n,c.rotation.x+=n*u.rotation*.5*TC+p.current.x*n,i.uniforms.uTime.value>PC&&(i.uniforms.uTime.value-=PC),c.rotation.y>$&&(c.rotation.y-=$),c.rotation.y<-$&&(c.rotation.y+=$),c.rotation.x>$&&(c.rotation.x-=$),c.rotation.x<-$&&(c.rotation.x+=$),c.updateMatrixWorld(),m.copy(r.position),c.worldToLocal(m),i.uniforms.uLocalCamPos.value.copy(m)}),(0,Q.jsx)(`mesh`,{ref:a,geometry:h,children:(0,Q.jsx)(`reactorMaterial`,{ref:o,transparent:!0,side:2,depthWrite:!1,blending:2,attach:`material`})})}function uT(){let{params:e}=nx();return(0,Q.jsx)(tx,{intensity:e.bloom??1,luminanceThreshold:.15,luminanceSmoothing:.7,mipmapBlur:!0})}j({id:`reactor`,name:`Reactor`,description:`A pulsing kaleidoscopic energy core, caged in glass.`,Component:lT,PostEffects:uT,palettes:{Reactor:{primaryEnergy:`#7780ff`,secondaryEnergy:`#00e5ff`,density:1,atmosphereGlow:.3,speed:1,chromaticAberration:.012,asymmetry:.3,orbRotation:.25,dpr:.8,foldSteps:6,kifsScale:1.26,kifsOffset:8.9,textureScale:1.45,brightness:1.42,colorBoost:3,lightSpeed:5.5,maxSteps:110,autoRotationSpeed:1,shellInner:1.82,bloom:1},Fusion:{primaryEnergy:`#dbe4ff`,secondaryEnergy:`#ffffff`,density:1,atmosphereGlow:.34,speed:1.1,chromaticAberration:.016,asymmetry:.35,orbRotation:.3,dpr:.8,foldSteps:7,kifsScale:1.3,kifsOffset:8.2,textureScale:1.55,brightness:1.3,colorBoost:2.6,lightSpeed:6.5,maxSteps:110,autoRotationSpeed:1.3,shellInner:1.84,bloom:1.1},Acid:{primaryEnergy:`#7CFF6B`,secondaryEnergy:`#ff3df0`,density:1,atmosphereGlow:.32,speed:.9,chromaticAberration:.018,asymmetry:.4,orbRotation:.22,dpr:.8,foldSteps:5,kifsScale:1.22,kifsOffset:9.6,textureScale:1.35,brightness:1.55,colorBoost:3.2,lightSpeed:4.5,maxSteps:110,autoRotationSpeed:.8,shellInner:1.8,bloom:1},Sunset:{primaryEnergy:`#ffae42`,secondaryEnergy:`#ff5d8f`,density:1,atmosphereGlow:.3,speed:.95,chromaticAberration:.014,asymmetry:.3,orbRotation:.24,dpr:.8,foldSteps:6,kifsScale:1.27,kifsOffset:8.7,textureScale:1.45,brightness:1.45,colorBoost:3,lightSpeed:5,maxSteps:110,autoRotationSpeed:1,shellInner:1.82,bloom:.95},Vapor:{primaryEnergy:`#ff6ec7`,secondaryEnergy:`#5ef2ff`,density:1,atmosphereGlow:.36,speed:1.05,chromaticAberration:.02,asymmetry:.45,orbRotation:.28,dpr:.8,foldSteps:6,kifsScale:1.28,kifsOffset:8.5,textureScale:1.5,brightness:1.5,colorBoost:3,lightSpeed:5.8,maxSteps:110,autoRotationSpeed:1.1,shellInner:1.83,bloom:1.1}},fields:[{kind:`color`,key:`primaryEnergy`,label:`Core`,section:`color`},{kind:`color`,key:`secondaryEnergy`,label:`Rim`,section:`color`},{kind:`slider`,key:`bloom`,label:`Bloom`,section:`energy`,min:0,max:2,step:.05},{kind:`slider`,key:`brightness`,label:`Brightness`,section:`energy`,min:.1,max:3,step:.01},{kind:`slider`,key:`colorBoost`,label:`Glow intensity`,section:`energy`,min:.5,max:6,step:.1},{kind:`slider`,key:`chromaticAberration`,label:`Aberration`,section:`energy`,min:0,max:.05,step:.001},{kind:`slider`,key:`lightSpeed`,label:`Pulse speed`,section:`motion`,min:0,max:12,step:.1},{kind:`slider`,key:`autoRotationSpeed`,label:`Morph`,section:`motion`,min:0,max:3,step:.05},{kind:`slider`,key:`orbRotation`,label:`Auto-rotation`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`speed`,label:`Speed`,section:`motion`,min:.1,max:2,step:.05},{kind:`slider`,key:`foldSteps`,label:`Detail`,section:`fractal`,min:1,max:12,step:1},{kind:`slider`,key:`kifsScale`,label:`Fold scale`,section:`fractal`,min:1,max:1.6,step:.01},{kind:`slider`,key:`kifsOffset`,label:`Fold offset`,section:`fractal`,min:4,max:14,step:.1},{kind:`slider`,key:`textureScale`,label:`Pattern scale`,section:`fractal`,min:.5,max:3,step:.05},{kind:`slider`,key:`shellInner`,label:`Shell`,section:`fractal`,min:1.5,max:1.95,step:.01},{kind:`slider`,key:`maxSteps`,label:`Raymarch detail`,section:`perf`,min:40,max:200,step:2},{kind:`slider`,key:`dpr`,label:`Resolution`,section:`perf`,min:.3,max:1.5,step:.1}],defaultPalette:`Reactor`,premium:!0}),Lv({SpectrumMaterial:Xx({uTime:0,uLocalCamPos:new U,uPrimaryColor:new G(`#7dd3fc`),uSecondaryColor:new G(`#fb7185`),uFractalScale:1,uFadeOuter:2.56,uFadeInner:2.55,uSmoothing:1.55,uColorPhases:new Lr(5.8,4.1,2.8,.2),uGlow:1,uClickDir:new U(0,0,1),uClickStrength:0},eT,`uniform float uTime; +uniform vec3 uLocalCamPos; +uniform vec3 uPrimaryColor; +uniform vec3 uSecondaryColor; + +uniform float uFractalScale; +uniform float uFadeOuter; +uniform float uFadeInner; +uniform float uSmoothing; +uniform vec4 uColorPhases; +uniform float uGlow; + +uniform vec3 uClickDir; +uniform float uClickStrength; + +varying vec3 vLocalPosition; + +float smin(float a, float b, float k) { + float h = clamp(0.5 + 0.5 * (b - a) / k, 0.0, 1.0); + return mix(b, a, h) - k * h * (1.0 - h); +} + +float evaluateScene(vec3 p, float t, out vec3 secondaryPosOut) { + vec3 primaryPos = p * uFractalScale; + vec3 secondaryPos = p * uFractalScale; + + for (float iteration = 2.3; iteration <= 6.0; iteration += 1.1) { + float secondaryScale = iteration * 0.3; + secondaryPos += sin(0.6 * t + primaryPos.zxy * secondaryScale) * 0.4; + primaryPos += sin(t + primaryPos.yzx * iteration) * 0.25; + } + + secondaryPosOut = secondaryPos; + + float sphereA = length(primaryPos + 1.0) - 2.0; + float sphereB = length(secondaryPos - 1.3) - 2.9; + float blended = smin(sphereA, sphereB, uSmoothing); + + + + + return abs(blended) * 0.1 / uFractalScale; +} + +float hash(vec2 p) { + return fract(sin(dot(p, vec2(12.8998, 78.233))) * 43758.5453); +} + +vec3 paletteFor(float depth) { + + + return 1.0 + cos(depth + uColorPhases.rgb); +} + +void main() { + vec3 ro = uLocalCamPos; + vec3 rd = normalize(vLocalPosition - uLocalCamPos); + + + float t = -0.015 * hash(gl_FragCoord.xy); + + vec3 accum = vec3(0.0); + + + + + + + + const float T_MAX = 25.0; + + for (int step = 0; step < 90; step++) { + if (t > T_MAX) break; + vec3 pos = ro + rd * t; + float distFromCenter = length(pos); + + + + + if (distFromCenter > uFadeOuter + 0.01) { + t += distFromCenter - uFadeOuter; + continue; + } + + vec3 secondaryPos; + float sceneDist = evaluateScene(pos, uTime, secondaryPos); + + float stepSize = 0.012 + sceneDist; + t += stepSize; + + + + + + + + + + float lo = min(uFadeInner, uFadeOuter); + float hi = max(uFadeInner, uFadeOuter); + float radialFade = 1.0 - smoothstep(lo, max(hi, lo + 1e-4), distFromCenter); + + + + vec3 baseColor = paletteFor(pos.z); + + + + + + vec3 voiceTint = mix(uSecondaryColor, uPrimaryColor, 0.5); + baseColor = mix(baseColor, baseColor * voiceTint * 2.0, 0.25); + + + + + float plen = length(pos); + vec3 pDir = (plen > 1e-4) ? pos / plen : vec3(0.0); + float clickBoost = uClickStrength * smoothstep(0.55, 1.0, dot(pDir, uClickDir)); + + float weight = (1.0 / max(stepSize, 1e-4)) * radialFade; + accum += baseColor * weight * (1.0 + clickBoost * 1.5); + } + + + + + vec3 tone = accum * uGlow / 8000.0; + + + + vec3 clamped = clamp(tone, -20.0, 20.0); + vec3 e2x = exp(2.0 * clamped); + vec3 finalColor = (e2x - 1.0) / (e2x + 1.0); + finalColor = clamp(finalColor, 0.0, 1.0); + + + + float maxLuma = max(finalColor.r, max(finalColor.g, finalColor.b)); + float alpha = clamp(maxLuma * 1.5, 0.0, 1.0); + + gl_FragColor = vec4(finalColor, alpha); +}`)});function dT({voiceState:e,botStream:t,localStream:n}){let{camera:r,gl:i}=dv(),a=(0,v.useRef)(null),o=(0,v.useRef)(null),{base:s,effectiveState:c}=Kw(e),l=(0,v.useRef)(s);l.current=s;let{dBotRef:u,dUserRef:d}=Rw({botStream:t,localStream:n}),{snapRef:f}=qC(c,s),{breathNormRef:p}=JC(),{clickDirRef:m,clickStrengthRef:h,dragVelRef:g}=YC(a);(0,v.useEffect)(()=>{let e=o.current;e&&(e.uniforms.uFractalScale.value=s.fractalScale,e.uniforms.uFadeOuter.value=s.fadeOuter,e.uniforms.uFadeInner.value=s.fadeInner,e.uniforms.uColorPhases.value.set(s.colorPhaseR,s.colorPhaseG,s.colorPhaseB,s.colorPhaseA))},[s.fractalScale,s.fadeOuter,s.fadeInner,s.colorPhaseR,s.colorPhaseG,s.colorPhaseB,s.colorPhaseA]),(0,v.useEffect)(()=>{i.setPixelRatio(s.dpr)},[s.dpr,i]),(0,v.useEffect)(()=>{r.position.set(0,0,13)},[r]);let _=(0,v.useMemo)(()=>new U,[]),y=(0,v.useMemo)(()=>new Y(5.5,32,32),[]);return(0,v.useEffect)(()=>()=>y.dispose(),[y]),fv((e,t)=>{let n=Math.min(t,wC),i=o.current,c=a.current,l=f.current;if(!i||!c||!l)return;let v=u.current,y=d.current;i.uniforms.uGlow.value=s.glow*(.85+l.density*.25)+v*.5,i.uniforms.uSmoothing.value=s.smoothing+y*.4,i.uniforms.uPrimaryColor.value.copy(l.primary),i.uniforms.uSecondaryColor.value.copy(l.secondary),i.uniforms.uClickDir.value.copy(m.current),i.uniforms.uClickStrength.value=h.current;let b=l.scale*(1+p.current*kC)*(1+v*.06);c.scale.setScalar(b),i.uniforms.uTime.value+=n*l.speed,c.rotation.y+=n*l.rotation*TC+g.current.y*n,c.rotation.x+=n*(l.rotation*.5)*TC+g.current.x*n,i.uniforms.uTime.value>PC&&(i.uniforms.uTime.value-=PC),c.rotation.y>$&&(c.rotation.y-=$),c.rotation.y<-$&&(c.rotation.y+=$),c.rotation.x>$&&(c.rotation.x-=$),c.rotation.x<-$&&(c.rotation.x+=$),c.updateMatrixWorld(),_.copy(r.position),c.worldToLocal(_),i.uniforms.uLocalCamPos.value.copy(_)}),(0,Q.jsx)(`mesh`,{ref:a,geometry:y,children:(0,Q.jsx)(`spectrumMaterial`,{ref:o,transparent:!0,side:2,depthWrite:!1,blending:2,attach:`material`})})}j({id:`spectrum`,name:`Spectrum`,description:`Rainbow volumetric orb — two smooth-blended SDFs, nested turbulence, cosine-palette emission.`,Component:dT,palettes:{ProtoLabs:{primaryEnergy:`#9b87f2`,secondaryEnergy:`#6366f1`,density:1.6,atmosphereGlow:.18,atmosphereLevel:1,atmosphereScale:1.03,speed:.5,chromaticAberration:.018,asymmetry:.45,orbRotation:.5,fractalScale:1,fadeOuter:2.6,fadeInner:2.45,smoothing:1.55,glow:1,colorPhaseR:1,colorPhaseG:4.2,colorPhaseB:1.4,colorPhaseA:.2,dpr:.7},Rainbow:{primaryEnergy:`#a78bfa`,secondaryEnergy:`#f472b6`,density:1.6,atmosphereGlow:.18,atmosphereLevel:1,atmosphereScale:1.03,speed:.5,chromaticAberration:.018,asymmetry:.45,orbRotation:.5,fractalScale:1,fadeOuter:2.6,fadeInner:2.45,smoothing:1.55,glow:1,colorPhaseR:5.8,colorPhaseG:4.1,colorPhaseB:2.8,colorPhaseA:.2,dpr:.7},Sunset:{primaryEnergy:`#f97316`,secondaryEnergy:`#7c2d12`,density:1.8,atmosphereGlow:.22,atmosphereLevel:1,atmosphereScale:1.03,speed:.55,chromaticAberration:.024,asymmetry:.55,orbRotation:.55,fractalScale:1,fadeOuter:2.6,fadeInner:2.4,smoothing:1.6,glow:1.1,colorPhaseR:.5,colorPhaseG:1.5,colorPhaseB:3,colorPhaseA:.5,dpr:.7},Tide:{primaryEnergy:`#0ea5e9`,secondaryEnergy:`#1e3a8a`,density:1.4,atmosphereGlow:.16,atmosphereLevel:1,atmosphereScale:1.03,speed:.45,chromaticAberration:.014,asymmetry:.4,orbRotation:.45,fractalScale:1.05,fadeOuter:2.4,fadeInner:2.2,smoothing:1.4,glow:.9,colorPhaseR:3,colorPhaseG:5,colorPhaseB:6.5,colorPhaseA:1.5,dpr:.7},Halo:{primaryEnergy:`#fef3c7`,secondaryEnergy:`#a78bfa`,density:1.2,atmosphereGlow:.14,atmosphereLevel:1,atmosphereScale:1.03,speed:.4,chromaticAberration:.012,asymmetry:.3,orbRotation:.4,fractalScale:.95,fadeOuter:3,fadeInner:2,smoothing:1.7,glow:.85,colorPhaseR:2,colorPhaseG:2.5,colorPhaseB:3,colorPhaseA:.3,dpr:.7}},fields:[{kind:`color`,key:`primaryEnergy`,label:`Primary`,section:`color`},{kind:`color`,key:`secondaryEnergy`,label:`Secondary`,section:`color`},{kind:`slider`,key:`density`,label:`Density`,section:`energy`,min:.1,max:3,step:.1},{kind:`slider`,key:`atmosphereGlow`,label:`Glow`,section:`energy`,min:0,max:5,step:.01},{kind:`slider`,key:`atmosphereLevel`,label:`Halo thickness`,section:`energy`,min:.1,max:1,step:.01},{kind:`slider`,key:`atmosphereScale`,label:`Halo scale`,section:`energy`,min:1,max:1.1,step:.001},{kind:`slider`,key:`glow`,label:`Core glow`,section:`energy`,min:.1,max:2.5,step:.05},{kind:`slider`,key:`chromaticAberration`,label:`Aberration`,section:`energy`,min:0,max:.05,step:.001},{kind:`slider`,key:`speed`,label:`Internal speed`,section:`motion`,min:.1,max:3,step:.1},{kind:`slider`,key:`orbRotation`,label:`Auto-rotation`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`asymmetry`,label:`Asymmetry`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`fractalScale`,label:`Scale`,section:`fractal`,min:.5,max:2,step:.05},{kind:`slider`,key:`fadeOuter`,label:`Halo outer`,section:`fractal`,min:1,max:5,step:.05},{kind:`slider`,key:`fadeInner`,label:`Halo inner`,section:`fractal`,min:.5,max:4,step:.05},{kind:`slider`,key:`smoothing`,label:`Smoothing`,section:`fractal`,min:.1,max:4,step:.05},{kind:`slider`,key:`colorPhaseR`,label:`Phase R`,section:`fractal`,min:0,max:10,step:.1},{kind:`slider`,key:`colorPhaseG`,label:`Phase G`,section:`fractal`,min:0,max:10,step:.1},{kind:`slider`,key:`colorPhaseB`,label:`Phase B`,section:`fractal`,min:0,max:10,step:.1},{kind:`slider`,key:`colorPhaseA`,label:`Phase A`,section:`fractal`,min:0,max:10,step:.1},{kind:`slider`,key:`dpr`,label:`Resolution`,section:`perf`,min:.1,max:2,step:.1}],defaultPalette:`Rainbow`,premium:!0,moodDefaults:$w({valence:{glow:.1,fadeOuter:.08},arousal:{glow:.15,smoothing:-.15},guardedness:{glow:-.15,fadeOuter:-.1,smoothing:.2}})}),Lv({TetraMaterial:Xx({uTime:0,uLocalCamPos:new U,uPrimaryColor:new G(`#7dd3fc`),uSecondaryColor:new G(`#fb7185`),uShapeSize:1.6,uIterations:5,uFold:new U(1.7,.5,.7),uGlowIntensity:.028,uGlowBase:.282,uInternalAnim:.15,uClickDir:new U(0,0,1),uClickStrength:0},eT,`uniform float uTime; +uniform vec3 uLocalCamPos; +uniform vec3 uPrimaryColor; +uniform vec3 uSecondaryColor; +uniform float uShapeSize; +uniform float uIterations; +uniform vec3 uFold; +uniform float uGlowIntensity; +uniform float uGlowBase; +uniform float uInternalAnim; +uniform vec3 uClickDir; +uniform float uClickStrength; + +varying vec3 vLocalPosition; + +vec3 g_tint; + +mat2 rot2(float a) { + float c = cos(a), s = sin(a); + return mat2(c, -s, s, c); +} + +float sdTetra(vec3 p, float r) { + float d = max( + max(-p.x - p.y - p.z, p.x + p.y - p.z), + max(-p.x + p.y + p.z, p.x - p.y + p.z) + ); + return (d - r) / sqrt(3.0); +} + +float sceneSDF( + vec3 p, + mat2 rotAnim, mat2 rotAnim07, + mat2 rotXY, mat2 rotXZ +) { + vec3 lp = p; + lp.xz *= rotAnim; + lp.xy *= rotAnim07; + + float bound = sdTetra(lp, uShapeSize); + + vec4 q = vec4(lp, 1.0); + for (int k = 0; k < 10; k++) { + if (float(k) >= uIterations) break; + + + float r2 = dot(q.xyz, q.xyz); + float fold = max(1.4 / max(r2, -0.8), 1.1); + q *= fold; + + q.xyz = abs(q.xyz) - uFold; + q.xy *= rotXY; + q.xz *= rotXZ; + q *= 1.4; + } + + g_tint = q.xyz * log(q.w + 1.0); + + float surf = (length(q.xyz) - 1.2) / q.w; + return max(bound, surf); +} + +vec2 sphereBounds(vec3 o, vec3 d, float r) { + float b = dot(o, d); + float c = dot(o, o) - r * r; + float disc = b * b - c; + if (disc < 0.0) return vec2(-1.0); + float root = sqrt(disc); + return vec2(-b - root, -b + root); +} + +float hash(vec2 p) { + return fract(sin(dot(p, vec2(12.9098, 78.013))) * 43758.5453); +} + +void main() { + vec3 origin = uLocalCamPos; + vec3 dir = normalize(vLocalPosition - uLocalCamPos); + + + + + vec2 limits = sphereBounds(origin, dir, 3.5); + + + limits.x = max(limits.x, 0.0); + if (limits.y < 0.0) discard; + + float t = uTime * uInternalAnim; + mat2 rotAnim = rot2(t); + mat2 rotAnim07 = rot2(t * 0.7); + mat2 rotXY = rot2(0.7 + sin(uTime * 0.05) * 0.1); + mat2 rotXZ = rot2(0.5); + + + + float jitter = hash(gl_FragCoord.xy) * 0.05; + float depth = limits.x + jitter; + + vec3 accum = vec3(0.0); + int hitCount = 0; + + for (int i = 0; i < 96; i++) { + if (depth > limits.y) break; + vec3 p = origin + dir * depth; + float sd = sceneSDF(p, rotAnim, rotAnim07, rotXY, rotXZ); + + + + g_tint = cos(g_tint * uGlowBase); + g_tint *= g_tint; + + if (i > 1) { + float distSq = dot(p, p); + float att = exp(-distSq * 0.25); + + + + float mixT = clamp(length(g_tint) * 0.6, 0.0, 1.0); + vec3 emission = mix(uSecondaryColor, uPrimaryColor, mixT); + + + + + + + + float plen = length(p); + vec3 pDir = (plen > 1e-4) ? p / plen : vec3(0.0); + float clickCone = smoothstep(0.55, 1.0, dot(pDir, uClickDir)); + float clickBoost = uClickStrength * clickCone; + + accum += uGlowIntensity * g_tint * att * emission * (1.0 + clickBoost * 2.0); + + + accum += uPrimaryColor * att * clickBoost * 0.05; + } + + if (sd < 0.0002) { + + + accum *= 1.18; + depth += 0.04; + hitCount++; + if (hitCount > 2) break; + } + + depth += sd * 0.8; + } + + + + + + vec3 finalColor = accum * accum; + finalColor = clamp(finalColor, 0.0, 1.0); + + float maxLuma = max(finalColor.r, max(finalColor.g, finalColor.b)); + float alpha = clamp(maxLuma * 1.5, 0.0, 1.0); + + gl_FragColor = vec4(finalColor, alpha); +}`)});function fT({voiceState:e,botStream:t,localStream:n}){let{camera:r,gl:i}=dv(),a=(0,v.useRef)(null),o=(0,v.useRef)(null),{base:s,effectiveState:c}=Kw(e),l=(0,v.useRef)(s);l.current=s;let{dBotRef:u,dUserRef:d}=Rw({botStream:t,localStream:n}),{snapRef:f}=qC(c,s),{breathNormRef:p}=JC(),{clickDirRef:m,clickStrengthRef:h,dragVelRef:g}=YC(a);(0,v.useEffect)(()=>{let e=o.current;e&&(e.uniforms.uShapeSize.value=s.shapeSize,e.uniforms.uIterations.value=s.iterations,e.uniforms.uGlowBase.value=s.glowBase,e.uniforms.uInternalAnim.value=s.internalAnim)},[s.shapeSize,s.iterations,s.glowBase,s.internalAnim]),(0,v.useEffect)(()=>{i.setPixelRatio(s.dpr)},[s.dpr,i]),(0,v.useEffect)(()=>{r.position.set(0,0,13)},[r]);let _=(0,v.useMemo)(()=>new U,[]),y=(0,v.useMemo)(()=>new U,[]),b=(0,v.useMemo)(()=>new Y(3.5,32,32),[]);return(0,v.useEffect)(()=>()=>b.dispose(),[b]),fv((e,t)=>{let n=Math.min(t,wC),i=o.current,c=a.current,l=f.current;if(!i||!c||!l)return;let v=u.current,b=d.current;i.uniforms.uGlowIntensity.value=s.glowIntensity*(.85+l.density*.25)+v*.04,y.set(s.foldX,s.foldY+b*.15,s.foldZ),i.uniforms.uFold.value.copy(y),i.uniforms.uPrimaryColor.value.copy(l.primary),i.uniforms.uSecondaryColor.value.copy(l.secondary),i.uniforms.uClickDir.value.copy(m.current),i.uniforms.uClickStrength.value=h.current;let x=l.scale*(1+p.current*kC)*(1+v*.06);c.scale.setScalar(x),i.uniforms.uTime.value+=n*l.speed,c.rotation.y+=n*l.rotation*TC+g.current.y*n,c.rotation.x+=n*(l.rotation*.5)*TC+g.current.x*n,i.uniforms.uTime.value>PC&&(i.uniforms.uTime.value-=PC),c.rotation.y>$&&(c.rotation.y-=$),c.rotation.y<-$&&(c.rotation.y+=$),c.rotation.x>$&&(c.rotation.x-=$),c.rotation.x<-$&&(c.rotation.x+=$),c.updateMatrixWorld(),_.copy(r.position),c.worldToLocal(_),i.uniforms.uLocalCamPos.value.copy(_)}),(0,Q.jsx)(`mesh`,{ref:a,geometry:b,children:(0,Q.jsx)(`tetraMaterial`,{ref:o,transparent:!0,side:2,depthWrite:!1,blending:2,attach:`material`})})}j({id:`tetra`,name:`Tetra`,description:`Tetrahedron-bound spherical-inversion fractal — sharp silhouette, curling inner engine.`,Component:fT,palettes:{ProtoLabs:{primaryEnergy:`#9b87f2`,secondaryEnergy:`#6366f1`,density:1.6,atmosphereGlow:.16,atmosphereLevel:1,atmosphereScale:1.03,speed:.5,chromaticAberration:.018,asymmetry:.45,orbRotation:.55,shapeSize:1.6,iterations:5,foldX:1.7,foldY:.5,foldZ:.7,glowIntensity:.03,glowBase:.28,internalAnim:.15,dpr:.7},Drift:{primaryEnergy:`#7dd3fc`,secondaryEnergy:`#fb7185`,density:1.6,atmosphereGlow:.16,atmosphereLevel:1,atmosphereScale:1.03,speed:.5,chromaticAberration:.018,asymmetry:.45,orbRotation:.55,shapeSize:1.6,iterations:5,foldX:1.7,foldY:.5,foldZ:.7,glowIntensity:.03,glowBase:.28,internalAnim:.15,dpr:.7},Forge:{primaryEnergy:`#f97316`,secondaryEnergy:`#1e3a8a`,density:1.8,atmosphereGlow:.22,atmosphereLevel:1,atmosphereScale:1.03,speed:.6,chromaticAberration:.024,asymmetry:.55,orbRotation:.65,shapeSize:1.5,iterations:6,foldX:1.9,foldY:.6,foldZ:.8,glowIntensity:.034,glowBase:.32,internalAnim:.18,dpr:.7},Steel:{primaryEnergy:`#cbd5e1`,secondaryEnergy:`#0f172a`,density:1.2,atmosphereGlow:.14,atmosphereLevel:1,atmosphereScale:1.03,speed:.4,chromaticAberration:.012,asymmetry:.35,orbRotation:.5,shapeSize:1.7,iterations:4,foldX:1.6,foldY:.4,foldZ:.6,glowIntensity:.022,glowBase:.25,internalAnim:.12,dpr:.7},Pulse:{primaryEnergy:`#a3e635`,secondaryEnergy:`#d946ef`,density:2,atmosphereGlow:.2,atmosphereLevel:1,atmosphereScale:1.03,speed:.7,chromaticAberration:.026,asymmetry:.6,orbRotation:.75,shapeSize:1.4,iterations:7,foldX:2,foldY:.55,foldZ:.85,glowIntensity:.036,glowBase:.3,internalAnim:.22,dpr:.7}},fields:[{kind:`color`,key:`primaryEnergy`,label:`Primary`,section:`color`},{kind:`color`,key:`secondaryEnergy`,label:`Secondary`,section:`color`},{kind:`slider`,key:`density`,label:`Density`,section:`energy`,min:.1,max:3,step:.1},{kind:`slider`,key:`atmosphereGlow`,label:`Glow`,section:`energy`,min:0,max:5,step:.01},{kind:`slider`,key:`atmosphereLevel`,label:`Halo thickness`,section:`energy`,min:.1,max:1,step:.01},{kind:`slider`,key:`atmosphereScale`,label:`Halo scale`,section:`energy`,min:1,max:1.1,step:.001},{kind:`slider`,key:`glowIntensity`,label:`Volumetric glow`,section:`energy`,min:0,max:.1,step:.001},{kind:`slider`,key:`glowBase`,label:`Glow base`,section:`energy`,min:0,max:1,step:.01},{kind:`slider`,key:`chromaticAberration`,label:`Aberration`,section:`energy`,min:0,max:.05,step:.001},{kind:`slider`,key:`speed`,label:`Internal speed`,section:`motion`,min:.1,max:3,step:.1},{kind:`slider`,key:`orbRotation`,label:`Auto-rotation`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`internalAnim`,label:`Anim speed`,section:`motion`,min:0,max:.5,step:.01},{kind:`slider`,key:`asymmetry`,label:`Asymmetry`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`shapeSize`,label:`Shape size`,section:`fractal`,min:.5,max:3,step:.05},{kind:`slider`,key:`iterations`,label:`Iterations`,section:`fractal`,min:1,max:10,step:1},{kind:`slider`,key:`foldX`,label:`Fold X`,section:`fractal`,min:0,max:3,step:.05},{kind:`slider`,key:`foldY`,label:`Fold Y`,section:`fractal`,min:0,max:3,step:.05},{kind:`slider`,key:`foldZ`,label:`Fold Z`,section:`fractal`,min:0,max:3,step:.05},{kind:`slider`,key:`dpr`,label:`Resolution`,section:`perf`,min:.1,max:2,step:.1}],defaultPalette:`Drift`,premium:!0,moodDefaults:$w({valence:{glowIntensity:.01,glowBase:.06},arousal:{glowIntensity:.008,internalAnim:.06},guardedness:{glowIntensity:-.012,internalAnim:-.04,shapeSize:.15}})});var pT={format:`orbis-orb`,version:1,id:`prism`,name:`Prism`,author:`ORBIS`,description:`Refraction-tilted volumetric orb — the first data-driven .orbis definition, rendered by the raymarch-v1 engine.`,engine:`raymarch-v1`,geometry:{type:`sphere`,radius:5.5,widthSegments:32,heightSegments:32},material:{blending:`additive`,transparent:!0,depthWrite:!1,doubleSide:!0},motion:{scaleAudioPump:.06,breath:!0,rotationXRatio:.5},shaders:{fragment:`// Polynomial smooth minimum — organic blend between two SDFs. +float smin(float a, float b, float k) { + float h = clamp(0.5 + 0.5 * (b - a) / k, 0.0, 1.0); + return mix(b, a, h) - k * h * (1.0 - h); +} + +// Two-sphere blend with nested sine-wave turbulence on both +// sample positions. The non-uniform iteration step (2.3 → 6.0 +// step 1.1) is kept verbatim — that irregularity is what makes +// the turbulence feel organic instead of grid-like. +float evaluateScene(vec3 p, float t, out vec3 secondaryPosOut) { + vec3 primaryPos = p * uFractalScale; + vec3 secondaryPos = p * uFractalScale; + + for (float iteration = 2.3; iteration <= 6.0; iteration += 1.1) { + float secondaryScale = iteration * 0.3; + secondaryPos += sin(0.6 * t + primaryPos.zxy * secondaryScale) * 0.4; + primaryPos += sin(t + primaryPos.yzx * iteration) * 0.25; + } + + secondaryPosOut = secondaryPos; + + float sphereA = length(primaryPos + 1.0) - 2.0; + float sphereB = length(secondaryPos - 1.3) - 2.9; + float blended = smin(sphereA, sphereB, uSmoothing); + + // Volume contribution: thin shell around the blended surface. + // Divide by uFractalScale so the SDF stays correctly normalised + // when uFractalScale changes (otherwise denser scales overshoot). + return abs(blended) * 0.1 / uFractalScale; +} + +// Hash for jitter — breaks up volumetric banding. +float hash(vec2 p) { + return fract(sin(dot(p, vec2(12.8998, 78.233))) * 43758.5453); +} + +// Cosine-palette emission. Phase shifts in uColorPhases pull the +// rainbow toward different hues; the per-pixel z-depth is what +// produces the rainbow gradient through the volume. +vec3 paletteFor(float depth) { + // The original returns vec4 + uColorPhases (RGBA); we only need + // RGB for the additive accumulator. + return 1.0 + cos(depth + uColorPhases.rgb); +} + +void main() { + vec3 ro = uLocalCamPos; + vec3 rd = normalize(vLocalPosition - uLocalCamPos); + + // Pixel-stable jitter to break banding. + float t = -0.015 * hash(gl_FragCoord.xy); + + vec3 accum = vec3(0.0); + + // Per-pixel ray budget. The source ran from a camera at z=-4.5 with + // a 10-unit cap; ORBIS's camera sits at z=13 in object space and the + // bounding-sphere fast-forward jumps the ray from there to fadeOuter, + // which already eats ~10 units before the orb is reached. Raise the + // cap to comfortably cover camera distance + sphere diameter + a + // little slack. + const float T_MAX = 25.0; + + for (int step = 0; step < 90; step++) { + if (t > T_MAX) break; + vec3 pos = ro + rd * t; + float distFromCenter = length(pos); + + // Bounding-sphere fast-forward — skip expensive turbulence math + // when we're outside the visible volume. The 0.01 offset lets + // the smoothstep below still feather correctly at the edge. + if (distFromCenter > uFadeOuter + 0.01) { + t += distFromCenter - uFadeOuter; + continue; + } + + vec3 secondaryPos; + float sceneDist = evaluateScene(pos, uTime, secondaryPos); + + float stepSize = 0.012 + sceneDist; + t += stepSize; + + // Soft containment — full contribution inside fadeInner, fading + // to zero at fadeOuter. Defend against degenerate ranges where + // the slider step (0.05) snaps fadeOuter to ≤ fadeInner, or a + // user drags inner above outer — both make smoothstep undefined + // per the GLSL spec, and Rainbow's 2.56/2.55 defaults sit + // exactly on that quantization cliff. min/max keeps the window + // valid; the +1e-4 floor stops a zero-width band from collapsing + // the whole orb to alpha=0. + float lo = min(uFadeInner, uFadeOuter); + float hi = max(uFadeInner, uFadeOuter); + float radialFade = 1.0 - smoothstep(lo, max(hi, lo + 1e-4), distFromCenter); + + // Per-step rainbow palette. uColorPhases is the deployer's hue + // shift; the depth-mod-by-z gives the rainbow gradient. + vec3 baseColor = paletteFor(pos.z); + + // Lightly tint with primary↔secondary so voice-state colour + // crossfades come through without overpowering the rainbow. + // 25% mix keeps the spectrum identity intact in idle / neutral + // states; state changes still register visually. + vec3 voiceTint = mix(uSecondaryColor, uPrimaryColor, 0.5); + baseColor = mix(baseColor, baseColor * voiceTint * 2.0, 0.25); + + // Click reactivity — same in-march directional boost the other + // sphere-mounted variants use. Samples whose direction from + // origin aligns with uClickDir glow brighter. + float plen = length(pos); + vec3 pDir = (plen > 1e-4) ? pos / plen : vec3(0.0); + float clickBoost = uClickStrength * smoothstep(0.55, 1.0, dot(pDir, uClickDir)); + + float weight = (1.0 / max(stepSize, 1e-4)) * radialFade; + accum += baseColor * weight * (1.0 + clickBoost * 1.5); + } + + // Tone-map. The original divides by 8000 × screen-vignette; + // sphere-mounted geometry has no usable screen-uv so we drop + // the vignette and use a softer divisor instead. + vec3 tone = accum * uGlow / 8000.0; + + // tanh keeps highlights from clipping while preserving bright + // cores; clamp the input so exp() can't blow up on mobile GPUs. + vec3 clamped = clamp(tone, -20.0, 20.0); + vec3 e2x = exp(2.0 * clamped); + vec3 finalColor = (e2x - 1.0) / (e2x + 1.0); + finalColor = clamp(finalColor, 0.0, 1.0); + + // Alpha mirrors luminance so the orb blends into the canvas + // background instead of carrying a black box around its silhouette. + float maxLuma = max(finalColor.r, max(finalColor.g, finalColor.b)); + float alpha = clamp(maxLuma * 1.5, 0.0, 1.0); + + gl_FragColor = vec4(finalColor, alpha); +} +`,vertex:null},uniforms:{uFractalScale:{type:`float`,default:1},uFadeOuter:{type:`float`,default:2.6},uFadeInner:{type:`float`,default:2.45},uSmoothing:{type:`float`,default:1.55},uColorPhases:{type:`vec4`,default:[2.4,3.4,4.4,.8]},uGlow:{type:`float`,default:1}},fields:[{kind:`color`,key:`primaryEnergy`,label:`Primary`,section:`color`},{kind:`color`,key:`secondaryEnergy`,label:`Secondary`,section:`color`},{kind:`slider`,key:`density`,label:`Density`,section:`energy`,min:.1,max:3,step:.1},{kind:`slider`,key:`atmosphereGlow`,label:`Glow`,section:`energy`,min:0,max:5,step:.01},{kind:`slider`,key:`glow`,label:`Core glow`,section:`energy`,min:.1,max:2.5,step:.05},{kind:`slider`,key:`chromaticAberration`,label:`Aberration`,section:`energy`,min:0,max:.05,step:.001},{kind:`slider`,key:`speed`,label:`Internal speed`,section:`motion`,min:.1,max:3,step:.1},{kind:`slider`,key:`orbRotation`,label:`Auto-rotation`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`asymmetry`,label:`Asymmetry`,section:`motion`,min:0,max:1,step:.01},{kind:`slider`,key:`fractalScale`,label:`Scale`,section:`fractal`,min:.5,max:2,step:.05},{kind:`slider`,key:`fadeOuter`,label:`Halo outer`,section:`fractal`,min:1,max:5,step:.05},{kind:`slider`,key:`fadeInner`,label:`Halo inner`,section:`fractal`,min:.5,max:4,step:.05},{kind:`slider`,key:`smoothing`,label:`Smoothing`,section:`fractal`,min:.1,max:4,step:.05},{kind:`slider`,key:`colorPhaseR`,label:`Phase R`,section:`fractal`,min:0,max:10,step:.1},{kind:`slider`,key:`colorPhaseG`,label:`Phase G`,section:`fractal`,min:0,max:10,step:.1},{kind:`slider`,key:`colorPhaseB`,label:`Phase B`,section:`fractal`,min:0,max:10,step:.1},{kind:`slider`,key:`colorPhaseA`,label:`Phase A`,section:`fractal`,min:0,max:10,step:.1},{kind:`slider`,key:`dpr`,label:`Resolution`,section:`perf`,min:.1,max:2,step:.1}],palettes:{Prism:{primaryEnergy:`#8be9fd`,secondaryEnergy:`#bd93f9`,density:1.6,atmosphereGlow:.18,speed:.5,chromaticAberration:.018,asymmetry:.45,orbRotation:.5,fractalScale:1,fadeOuter:2.6,fadeInner:2.45,smoothing:1.55,glow:1,colorPhaseR:2.4,colorPhaseG:3.4,colorPhaseB:4.4,colorPhaseA:.8,dpr:.7},Sunburst:{primaryEnergy:`#fbbf24`,secondaryEnergy:`#dc2626`,density:1.8,atmosphereGlow:.22,speed:.55,chromaticAberration:.024,asymmetry:.55,orbRotation:.55,fractalScale:1,fadeOuter:2.6,fadeInner:2.4,smoothing:1.6,glow:1.1,colorPhaseR:.3,colorPhaseG:1.2,colorPhaseB:2.6,colorPhaseA:.5,dpr:.7},Glacier:{primaryEnergy:`#67e8f9`,secondaryEnergy:`#1e40af`,density:1.4,atmosphereGlow:.16,speed:.45,chromaticAberration:.014,asymmetry:.4,orbRotation:.45,fractalScale:1.05,fadeOuter:2.4,fadeInner:2.2,smoothing:1.4,glow:.9,colorPhaseR:3.2,colorPhaseG:4.8,colorPhaseB:6.2,colorPhaseA:1.4,dpr:.7}},defaultPalette:`Prism`,bindings:[{target:`uFractalScale`,signal:`param.fractalScale`},{target:`uFadeOuter`,signal:`param.fadeOuter`},{target:`uFadeInner`,signal:`param.fadeInner`},{target:`uColorPhases.x`,signal:`param.colorPhaseR`},{target:`uColorPhases.y`,signal:`param.colorPhaseG`},{target:`uColorPhases.z`,signal:`param.colorPhaseB`},{target:`uColorPhases.w`,signal:`param.colorPhaseA`},{target:`uGlow`,signal:`param.glow`},{target:`uGlow`,signal:`snap.density`,op:`mul`,scale:.25,offset:.85},{target:`uGlow`,signal:`bot.level`,op:`add`,scale:.5},{target:`uSmoothing`,signal:`param.smoothing`},{target:`uSmoothing`,signal:`user.level`,op:`add`,scale:.4}],moodDefaults:{valence:{glow:.1,fadeOuter:.08,atmosphereGlow:.06,density:.15,asymmetry:-.05},arousal:{glow:.15,smoothing:-.15,speed:.4,orbRotation:.2,density:.4,chromaticAberration:.008},guardedness:{glow:-.15,fadeOuter:-.1,smoothing:.2,atmosphereGlow:-.1,density:-.4,asymmetry:.15,orbRotation:-.15}},premium:!0,post:null};function mT(e){return function({voiceState:t,botStream:n,localStream:r}){let{base:i,effectiveState:a}=Kw(t),{dBotRef:o,dUserRef:s}=Rw({botStream:n,localStream:r});return(0,Q.jsx)(Pw,{definition:e,voiceState:a,base:i,mood:(0,v.useSyncExternalStore)(Gw.subscribe,Gw.get,Gw.get),botLevelRef:o,userLevelRef:s})}}function hT(e){return function(){return(0,Q.jsx)(tx,{intensity:e.intensity??1,luminanceThreshold:e.luminanceThreshold??.15,luminanceSmoothing:e.luminanceSmoothing??.7,mipmapBlur:e.mipmapBlur??!0})}}function gT(e){return j({id:e.id,name:e.name,description:e.description,Component:mT(e),palettes:e.palettes,fields:e.fields,defaultPalette:e.defaultPalette,premium:e.premium??!0,moodDefaults:e.moodDefaults??void 0,PostEffects:e.post?.bloom?hT(e.post.bloom):void 0})}var _T=`orbis.apiKey`,vT=typeof localStorage<`u`?localStorage.getItem(_T):null,yT=new Set,bT={get:()=>vT,set:e=>{vT=e&&e.trim()?e.trim():null;try{vT===null?localStorage.removeItem(_T):localStorage.setItem(_T,vT)}catch{}yT.forEach(e=>e())},clear:()=>bT.set(null),subscribe:e=>(yT.add(e),()=>{yT.delete(e)})};function xT(e={}){let t=new Headers(e),n=bT.get();return n&&t.set(`X-API-Key`,n),t}var ST=500,CT=[],wT=new Set,TT={push(e){let t={ts:Date.now(),...e};CT=CT.length>=ST?[...CT.slice(CT.length-ST+1),t]:[...CT,t],wT.forEach(e=>e())},snapshot:()=>CT,clear(){CT=[],wT.forEach(e=>e())},subscribe(e){return wT.add(e),()=>{wT.delete(e)}}},ET=OT(),DT=[];function OT(){let e=window.__ORBIS_BACKEND__;if(typeof e==`string`&&e)return e;let t=window.location.protocol;return t===`http:`||t===`https:`?window.location.origin:null}function kT(e){for(ET=e;DT.length;)DT.shift()(e)}typeof window<`u`&&window.addEventListener(`orbis-backend-ready`,()=>{let e=window.__ORBIS_BACKEND__;typeof e==`string`&&e&&kT(e)});async function AT(){if(ET)return ET;try{let e=await qx(`backend_url`);if(e)return kT(e),e}catch{}return new Promise(e=>{ET?e(ET):DT.push(e)})}var jT=class extends Error{constructor(e){super(`${e} → 401 unauthorized`)}},MT=class extends Error{status;constructor(e,t){super(e),this.status=t}};async function NT(e){return RT(`GET`,e)}async function PT(e,t){return LT(`POST`,e,t)}async function FT(e,t){return LT(`PUT`,e,t)}async function IT(e){return LT(`DELETE`,e)}async function LT(e,t,n){return RT(e,t,n)}async function RT(e,t,n){let r=performance.now();await AT();let i;try{i=await qx(`api_request`,{method:e,path:t,body:n===void 0?null:JSON.stringify(n),headers:n===void 0?xT():xT({"Content-Type":`application/json`})})}catch(n){let i=Math.round(performance.now()-r);throw TT.push({source:`api`,level:`error`,message:`${e} ${t} -> ${n.message} (${i}ms)`}),n}let a=Math.round(performance.now()-r),o=i.status>=200&&i.status<300;if(TT.push({source:`api`,level:o?`info`:`warn`,message:`${e} ${t} -> ${i.status} (${a}ms)`}),i.status===401)throw new jT(t);if(!o){let e=`HTTP ${i.status}`;try{let t=JSON.parse(i.body);t?.error&&(e=String(t.error))}catch{}throw new MT(`${t} → ${e}`,i.status)}return JSON.parse(i.body)}var zT={whoami:()=>NT(`/api/whoami`),reminders:{list:()=>NT(`/api/reminders`),cancel:e=>PT(`/api/reminders/cancel`,e)},verbosity:()=>NT(`/api/verbosity`),setVerbosity:e=>PT(`/api/verbosity`,{level:e}),starterOrbs:()=>NT(`/api/starter_orbs`),config:()=>NT(`/api/config`),putConfig:e=>PT(`/api/config`,e),personality:()=>NT(`/api/personality`),selectStarter:e=>PT(`/api/orb/select_starter`,{slug:e}),orbs:{list:()=>NT(`/api/orbs`),import:e=>PT(`/api/orbs`,e),remove:e=>IT(`/api/orbs/${encodeURIComponent(e)}`)},llmTest:e=>PT(`/api/llm/test`,e),llmModels:e=>PT(`/api/llm/models`,e),llmDetectLocal:()=>NT(`/api/llm/detect_local`),ttsVoices:e=>NT(`/api/tts/voices?backend=${encodeURIComponent(e)}`),ttsDownloadVoice:e=>PT(`/api/tts/voices/download`,e),delegates:{list:()=>NT(`/api/delegates`),create:e=>PT(`/api/delegates`,e),update:(e,t)=>FT(`/api/delegates/${encodeURIComponent(e)}`,t),remove:e=>IT(`/api/delegates/${encodeURIComponent(e)}`),test:e=>PT(`/api/delegates/test`,e),types:()=>NT(`/api/delegate-types`),discover:()=>NT(`/api/delegates/discover`)},wakeword:{models:()=>NT(`/api/wakeword/models`),download:e=>PT(`/api/wakeword/models/${encodeURIComponent(e)}/download`,{}),remove:e=>IT(`/api/wakeword/models/${encodeURIComponent(e)}`)}},BT=new Map;function VT(e){BT.get(e.id)?.(),BT.set(e.id,gT(e))}async function HT(e=0){try{let{orbs:e}=await zT.orbs.list();for(let t of e){let e=yw(t);e.ok?VT(e.def):console.warn(`[orb] stored definition rejected:`,e.errors)}}catch{e<2&&setTimeout(()=>HT(e+1),4e3)}}var UT=Object.assign({"./prism.orbis.json":pT});for(let[e,t]of Object.entries(UT)){let n=yw(t);n.ok?gT(n.def):console.error(`[orb] bundled definition ${e} rejected:`,n.errors)}HT();function WT(){let e=rx(),t=ax(e=>e.state),n=(0,v.useMemo)(()=>null,[]),r=(0,v.useMemo)(()=>null,[]),[i,a]=(0,v.useState)(typeof document<`u`&&document.hidden?`never`:`always`);(0,v.useEffect)(()=>{let e=()=>a(document.hidden?`never`:`always`);return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]);let o=()=>{if(D.getSnapshot().micMuted){ux(`muted — tap the mic to unmute`,2400);return}let e=!D.getSnapshot().micListening;D.update({micListening:e}),ux(e?`listening…`:`stopped`,1800),qx(`set_mic_listening`,{on:e}).catch(()=>{})};if(!e)return(0,Q.jsx)(`div`,{className:`absolute inset-0 grid place-items-center text-fg-subtle text-sm`,children:`No orb variant registered.`});let s=e.Component,c=e.PostEffects;return(0,Q.jsx)(`div`,{onDoubleClick:o,className:`absolute inset-0`,style:{touchAction:`none`},children:(0,Q.jsxs)(Iy,{frameloop:i,camera:{fov:45,near:.1,far:100,position:[0,0,13]},dpr:.7,gl:{antialias:!0,alpha:!1},children:[(0,Q.jsx)(`color`,{attach:`background`,args:[`#000000`]}),(0,Q.jsx)(s,{voiceState:t,botStream:n,localStream:r}),(0,Q.jsxs)(Qb,{enabled:!0,children:[(0,Q.jsx)(GT,{}),c?(0,Q.jsx)(c,{}):(0,Q.jsx)(Q.Fragment,{})]})]})})}function GT(){let{params:e}=nx(),t=e,n=(0,v.useMemo)(()=>new sx({amount:.025}),[]);return fv(()=>{let e=Math.min(.05,(t.chromaticAberration??.022)*.9);n.setAmount(e)}),(0,v.useEffect)(()=>()=>n.dispose(),[n]),(0,Q.jsx)(`primitive`,{object:n})}var KT=!1;async function qT(){if(!KT){KT=!0;try{let{config:e}=await zT.config();e?.orb?.variant&&ve(e.orb.variant),e?.orb?.palette&&_e(e.orb.palette),e?.orb?.params&&he.get().setParams(e.orb.params);let t=e?.orb?.state_overrides??{},n=e?.orb?.mood_overrides??{};he.get().setOverrides(t,n)}catch{KT=!1}}}var JT=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),YT=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),XT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),ZT=e=>{let t=XT(e);return t.charAt(0).toUpperCase()+t.slice(1)},QT={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},$T=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},eE=(0,v.createContext)({}),tE=()=>(0,v.useContext)(eE),nE=(0,v.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=tE()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,v.createElement)(`svg`,{ref:c,...QT,width:t??l??QT.width,height:t??l??QT.height,stroke:e??f,strokeWidth:m,className:JT(`lucide`,p,i),...!a&&!$T(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),rE=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(nE,{ref:i,iconNode:t,className:JT(`lucide-${YT(ZT(e))}`,`lucide-${e}`,n),...r}));return n.displayName=ZT(e),n},iE=rE(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),aE=rE(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),oE=rE(`ear`,[[`path`,{d:`M6 8.5a6.5 6.5 0 1 1 13 0c0 6-6 6-6 10a3.5 3.5 0 1 1-7 0`,key:`1dfaln`}],[`path`,{d:`M15 8.5a2.5 2.5 0 0 0-5 0v1a2 2 0 1 1 0 4`,key:`1qnva7`}]]),sE=rE(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),cE=rE(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),lE=rE(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),uE=rE(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),dE=rE(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function fE(){return typeof navigator<`u`&&`gpu`in navigator&&!!navigator.gpu}async function pE(){if(!fE())return{supported:!1};try{let e=(await navigator.gpu.requestAdapter())?.info;return{supported:!0,adapter:(e?[e.vendor,e.architecture,e.description].filter(Boolean).join(` `).trim():``)||`available`}}catch{return{supported:!0}}}function mE(){let[e]=(0,v.useState)(fE),[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``),s=ax(e=>e.state),c=s===`listening`,l=s===`thinking`||s===`speaking`;(0,v.useEffect)(()=>(Gx.onProgress=(e,t)=>n(t===100?null:{label:e,pct:t}),()=>{Gx.onProgress=null}),[]);let u=`fixed bottom-14 left-1/2 -translate-x-1/2 z-50 flex flex-col items-center gap-2 w-[min(34rem,92vw)]`;if(!e)return(0,Q.jsx)(`div`,{className:`${u} text-center text-sm text-zinc-400`,children:(0,Q.jsxs)(`span`,{className:`rounded-full border border-white/10 bg-black/60 px-4 py-2 backdrop-blur`,children:[`This browser doesn't support WebGPU —`,` `,(0,Q.jsx)(`a`,{href:`/download`,className:`text-indigo-300 underline`,children:`download ORBIS for Mac →`})]})});let d=async()=>{if(!l){i(!0);try{await Gx.activate()}finally{i(!1),n(null)}}},f=async e=>{e.preventDefault();let t=a.trim();if(!(!t||l||c)){o(``),i(!0);try{await Gx.submitText(t)}finally{i(!1),n(null)}}},p=!!t||r&&!c&&!l,m=t?`${t.label}${t.pct==null?``:` ${Math.round(t.pct)}%`}`:c?`Listening — tap to stop`:s===`thinking`?`Thinking…`:s===`speaking`?`Speaking…`:r?`Preparing…`:`Tap to talk`,h=p||l?iE:c?lE:sE;return(0,Q.jsxs)(`div`,{className:u,children:[(0,Q.jsxs)(`button`,{onClick:d,disabled:l,"aria-label":m,className:[`flex items-center gap-2 rounded-full px-5 py-2.5 text-sm font-medium backdrop-blur transition-colors`,c?`border border-rose-400/50 bg-rose-500/15 text-rose-100`:`border border-indigo-400/40 bg-indigo-400/10 text-indigo-100 hover:border-indigo-300/70`,l?`opacity-80`:``].join(` `),children:[(0,Q.jsx)(h,{className:`h-4 w-4 ${p||l?`animate-spin`:``}`}),m]}),(0,Q.jsx)(`form`,{onSubmit:f,className:`w-full`,children:(0,Q.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),disabled:l||c,placeholder:`…or type to Orbis`,className:`w-full rounded-full border border-white/10 bg-black/50 px-4 py-2 text-center text-xs text-white placeholder:text-zinc-600 backdrop-blur outline-none focus:border-indigo-400/50 disabled:opacity-50`})}),(0,Q.jsx)(`p`,{className:`text-[11px] text-zinc-600`,children:p?`one-time download — cached after this, then instant`:`on-device · nothing leaves your machine · or double-click the orb`})]})}var hE=`https://github.com/protoLabsAI/ORBIS`,gE=`https://protolabs.studio`;function _E(){let[e,t]=(0,v.useState)(!1),[n,r]=(0,v.useState)({supported:!1});(0,v.useEffect)(()=>{pE().then(r)},[]);let i=Sx.isLoaded,a=Gx.voiceReady;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`button`,{onClick:()=>t(e=>!e),"aria-label":`System info`,className:`fixed right-4 top-4 z-50 rounded-full border border-white/10 bg-black/50 p-2 text-zinc-300 backdrop-blur transition-colors hover:text-white`,children:(0,Q.jsx)(cE,{className:`h-4 w-4`})}),e&&(0,Q.jsxs)(`div`,{className:`fixed right-4 top-16 z-50 w-[min(20rem,92vw)] rounded-2xl border border-white/10 bg-zinc-950/90 p-4 text-sm text-zinc-200 shadow-2xl backdrop-blur-xl`,children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:`System`}),(0,Q.jsx)(`button`,{onClick:()=>t(!1),className:`text-zinc-500 hover:text-white`,children:(0,Q.jsx)(dE,{className:`h-4 w-4`})})]}),(0,Q.jsxs)(`div`,{className:`space-y-1 text-xs text-zinc-400`,children:[(0,Q.jsx)(vE,{label:`WebGPU`,value:n.supported?`on`:`off`,good:n.supported}),n.adapter&&(0,Q.jsxs)(`div`,{className:`flex justify-between gap-2`,children:[(0,Q.jsx)(`span`,{children:`GPU`}),(0,Q.jsx)(`span`,{className:`truncate text-right text-zinc-500`,children:n.adapter})]}),(0,Q.jsx)(vE,{label:`Brain · Gemma`,value:i?`loaded`:`on demand`,good:i}),(0,Q.jsx)(vE,{label:`Voice · Moonshine + Kokoro`,value:a?`loaded`:`on demand`,good:a}),(0,Q.jsx)(`p`,{className:`pt-1 text-zinc-600`,children:`Everything runs on your device — nothing leaves it. Audio uses your system's default mic & speaker. Speed depends on your GPU; this in-browser preview isn't representative of the native app.`})]}),(0,Q.jsxs)(`div`,{className:`mt-4 border-t border-white/5 pt-3`,children:[(0,Q.jsx)(`p`,{className:`mb-2 text-xs text-zinc-500`,children:`Want the full, more powerful version?`}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`a`,{href:`/download`,className:`rounded-lg bg-indigo-500/90 px-3 py-2 text-center text-sm font-medium text-white transition-colors hover:bg-indigo-500`,children:`Download for Mac`}),(0,Q.jsx)(`a`,{href:hE,target:`_blank`,rel:`noopener noreferrer`,className:`rounded-lg border border-white/10 px-3 py-2 text-center text-sm text-zinc-300 transition-colors hover:border-white/20`,children:`Build from source →`})]})]}),(0,Q.jsx)(`div`,{className:`mt-4 border-t border-white/5 pt-3 text-center`,children:(0,Q.jsx)(`a`,{href:gE,target:`_blank`,rel:`noopener noreferrer`,className:`text-xs text-zinc-500 transition-colors hover:text-zinc-300`,children:`Built by protoLabs.studio ↗`})})]})]})}function vE({label:e,value:t,good:n}){return(0,Q.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Q.jsx)(`span`,{children:e}),(0,Q.jsx)(`span`,{className:n?`text-emerald-400`:`text-zinc-600`,children:t})]})}var yE=`orbis-demo-intro-seen`,bE=[{Icon:aE,label:`Brain`,sub:`Gemma · language model`,size:`~500 MB`},{Icon:oE,label:`Ears`,sub:`Moonshine · speech-to-text`,size:`~60 MB`},{Icon:uE,label:`Voice`,sub:`Kokoro · text-to-speech`,size:`~80 MB`}];function xE(){let[e,t]=(0,v.useState)(()=>{try{return sessionStorage.getItem(yE)!==`1`}catch{return!0}});if(!e)return null;let n=()=>{try{sessionStorage.setItem(yE,`1`)}catch{}t(!1)};return(0,Q.jsx)(`div`,{className:`fixed inset-0 z-[100] flex items-center justify-center bg-black/75 p-6 backdrop-blur-sm`,onClick:n,children:(0,Q.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`w-[min(30rem,92vw)] rounded-2xl border border-white/10 bg-zinc-950/95 p-6 text-zinc-200 shadow-2xl`,children:[(0,Q.jsx)(`div`,{className:`mb-1 font-mono text-xs uppercase tracking-widest text-indigo-300`,children:`Browser preview`}),(0,Q.jsx)(`h2`,{className:`mb-3 text-xl font-semibold text-white`,children:`Meet your first orb`}),(0,Q.jsxs)(`p`,{className:`mb-4 text-sm leading-relaxed text-zinc-400`,children:[`A taste of ORBIS running `,(0,Q.jsx)(`span`,{className:`text-zinc-200`,children:`100% on your device`}),` — you talk, a local model thinks, and it answers out loud. Nothing leaves your machine.`]}),(0,Q.jsxs)(`div`,{className:`mb-4 rounded-xl border border-white/5 bg-white/[0.02] p-3`,children:[(0,Q.jsx)(`p`,{className:`mb-2 text-xs text-zinc-500`,children:`The first time you tap to talk, three on-device models download once, then cache for instant loads after:`}),(0,Q.jsx)(`ul`,{className:`space-y-2`,children:bE.map(({Icon:e,label:t,sub:n,size:r})=>(0,Q.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`grid h-8 w-8 place-items-center rounded-lg bg-indigo-400/10 text-indigo-300`,children:(0,Q.jsx)(e,{className:`h-4 w-4`})}),(0,Q.jsxs)(`span`,{className:`flex-1 text-sm`,children:[(0,Q.jsx)(`span`,{className:`text-zinc-200`,children:t}),` `,(0,Q.jsxs)(`span`,{className:`text-xs text-zinc-500`,children:[`· `,n]})]}),(0,Q.jsx)(`span`,{className:`text-xs tabular-nums text-zinc-500`,children:r})]},t))}),(0,Q.jsx)(`p`,{className:`mt-2 text-[11px] text-zinc-600`,children:`~640 MB total · requires WebGPU (Chrome, Edge, or Safari 26+)`})]}),(0,Q.jsx)(`p`,{className:`mb-4 text-xs leading-relaxed text-zinc-500`,children:`It runs smaller models in your browser, so speed depends on your GPU — this preview isn't representative of the native Mac app's performance.`}),(0,Q.jsx)(`button`,{onClick:n,className:`w-full rounded-lg bg-indigo-500/90 px-4 py-2.5 text-sm font-medium text-white transition-colors hover:bg-indigo-500`,children:`Got it — let's talk`}),(0,Q.jsx)(`a`,{href:`https://protolabs.studio`,target:`_blank`,rel:`noopener noreferrer`,className:`mt-3 block text-center text-[11px] text-zinc-600 transition-colors hover:text-zinc-400`,children:`Built by protoLabs.studio ↗`})]})})}function SE(){let e=ax(e=>e.lastUserTranscript);return(0,Q.jsx)(`div`,{className:`pointer-events-none fixed inset-x-0 top-[15%] z-40 flex flex-col items-center gap-2 px-6 text-center`,children:e&&(0,Q.jsxs)(`p`,{className:`text-sm text-zinc-500`,children:[`“`,e,`”`]})})}function CE(){return be(),(0,v.useEffect)(()=>{qT()},[]),(0,Q.jsxs)(`div`,{className:`fixed inset-0 overflow-hidden`,style:{background:`#000`},children:[(0,Q.jsx)(WT,{}),(0,Q.jsx)(SE,{}),(0,Q.jsx)(mE,{}),(0,Q.jsx)(_E,{}),(0,Q.jsx)(xE,{})]})}document.documentElement.classList.add(`dark`),document.documentElement.dataset.theme=`dark`,Gx.init(),(0,y.createRoot)(document.getElementById(`root`)).render((0,Q.jsx)(v.StrictMode,{children:(0,Q.jsx)(CE,{})})); \ No newline at end of file diff --git a/sites/demo/dist/assets/llm.worker-Bfp8AhaW.js b/sites/demo/dist/assets/llm.worker-Bfp8AhaW.js new file mode 100644 index 00000000..2aea50b7 --- /dev/null +++ b/sites/demo/dist/assets/llm.worker-Bfp8AhaW.js @@ -0,0 +1,45 @@ +(function(){var e=Object.defineProperty,t=((t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r})({InferenceSession:()=>Oe,TRACE:()=>be,TRACE_EVENT_BEGIN:()=>Ce,TRACE_EVENT_END:()=>we,TRACE_FUNC_BEGIN:()=>D,TRACE_FUNC_END:()=>Se,Tensor:()=>ve,default:()=>ir,env:()=>S,registerBackend:()=>p}),n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){ +/*! +* ONNX Runtime Web v1.26.0-dev.20260416-b7804b056c +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT License. +*/ +if(typeof require<`u`)return require.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),s=(e,t)=>()=>(e&&(t=e(e=0)),t),c=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},l=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},u=e=>l(n({},`__esModule`,{value:!0}),e),d,f,p,m,h,g=s(()=>{"use strict";d=new Map,f=[],p=(e,t,n)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let r=d.get(e);if(r===void 0)d.set(e,{backend:t,priority:n});else{if(r.priority>n)return;if(r.priority===n&&r.backend!==t)throw Error(`cannot register backend "${e}" using priority ${n}`)}if(n>=0){let t=f.indexOf(e);t!==-1&&f.splice(t,1);for(let t=0;t{let t=d.get(e);if(!t)return`backend not found.`;if(t.initialized)return t.backend;if(t.aborted)return t.error;{let n=!!t.initPromise;try{return n||(t.initPromise=t.backend.init(e)),await t.initPromise,t.initialized=!0,t.backend}catch(e){return n||(t.error=`${e}`,t.aborted=!0),t.error}finally{delete t.initPromise}}},h=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),r=n.length===0?f:n,i,a=[],o=new Set;for(let e of r){let t=await m(e);typeof t==`string`?a.push({name:e,err:t}):(i||=t,i===t&&o.add(e))}if(!i)throw Error(`no available backend found. ERR: ${a.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of a)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let s=t.filter(e=>o.has(typeof e==`string`?e:e.name));return[i,new Proxy(e,{get:(e,t)=>t===`executionProviders`?s:Reflect.get(e,t)})]}}),_=s(()=>{"use strict";g()}),v,y=s(()=>{"use strict";v=`1.24.0-dev.20251116-b39e144322`}),b,x,ee=s(()=>{"use strict";y(),b=`warning`,x={wasm:{},webgl:{},webgpu:{},versions:{common:v},set logLevel(e){if(e!==void 0){if(typeof e!=`string`||[`verbose`,`info`,`warning`,`error`,`fatal`].indexOf(e)===-1)throw Error(`Unsupported logging level: ${e}`);b=e}},get logLevel(){return b}},Object.defineProperty(x,"logLevel",{enumerable:!0})}),S,te=s(()=>{"use strict";ee(),S=x}),C,w,ne=s(()=>{"use strict";C=(e,t)=>{let n=typeof document<`u`?document.createElement(`canvas`):new OffscreenCanvas(1,1);n.width=e.dims[3],n.height=e.dims[2];let r=n.getContext(`2d`);if(r!=null){let i,a;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[3]):(i=e.dims[3],a=e.dims[2]);let o=t?.format===void 0?`RGB`:t.format,s=t?.norm,c,l;s===void 0||s.mean===void 0?c=[255,255,255,255]:typeof s.mean==`number`?c=[s.mean,s.mean,s.mean,s.mean]:(c=[s.mean[0],s.mean[1],s.mean[2],0],s.mean[3]!==void 0&&(c[3]=s.mean[3])),s===void 0||s.bias===void 0?l=[0,0,0,0]:typeof s.bias==`number`?l=[s.bias,s.bias,s.bias,s.bias]:(l=[s.bias[0],s.bias[1],s.bias[2],0],s.bias[3]!==void 0&&(l[3]=s.bias[3]));let u=a*i,d=0,f=u,p=u*2,m=-1;o===`RGBA`?(d=0,f=u,p=u*2,m=u*3):o===`RGB`?(d=0,f=u,p=u*2):o===`RBG`&&(d=0,p=u,f=u*2);for(let t=0;t{let n=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):new OffscreenCanvas(1,1).getContext(`2d`),r;if(n!=null){let i,a,o;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[1],o=e.dims[3]):(i=e.dims[3],a=e.dims[2],o=e.dims[1]);let s=t!==void 0&&t.format!==void 0?t.format:`RGB`,c=t?.norm,l,u;c===void 0||c.mean===void 0?l=[255,255,255,255]:typeof c.mean==`number`?l=[c.mean,c.mean,c.mean,c.mean]:(l=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(l[3]=c.mean[3])),c===void 0||c.bias===void 0?u=[0,0,0,0]:typeof c.bias==`number`?u=[c.bias,c.bias,c.bias,c.bias]:(u=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(u[3]=c.bias[3]));let d=a*i;if(t!==void 0&&(t.format!==void 0&&o===4&&t.format!==`RGBA`||o===3&&t.format!==`RGB`&&t.format!==`BGR`))throw Error(`Tensor format doesn't match input tensor dims`);let f=0,p=1,m=2,h=3,g=0,_=d,v=d*2,y=-1;s===`RGBA`?(g=0,_=d,v=d*2,y=d*3):s===`RGB`?(g=0,_=d,v=d*2):s===`RBG`&&(g=0,v=d,_=d*2),r=n.createImageData(i,a);for(let t=0;t{"use strict";_e(),re=(e,t)=>{if(e===void 0)throw Error(`Image buffer must be defined`);if(t.height===void 0||t.width===void 0)throw Error(`Image height and width must be defined`);if(t.tensorLayout===`NHWC`)throw Error(`NHWC Tensor layout is not supported yet`);let{height:n,width:r}=t,i=t.norm??{mean:255,bias:0},a,o;a=typeof i.mean==`number`?[i.mean,i.mean,i.mean,i.mean]:[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],o=typeof i.bias==`number`?[i.bias,i.bias,i.bias,i.bias]:[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let s=t.format===void 0?`RGBA`:t.format,c=t.tensorFormat!==void 0&&t.tensorFormat!==void 0?t.tensorFormat:`RGB`,l=n*r,u=c===`RGBA`?new Float32Array(l*4):new Float32Array(l*3),d=4,f=0,p=1,m=2,h=3,g=0,_=l,v=l*2,y=-1;s===`RGB`&&(d=3,f=0,p=1,m=2,h=-1),c===`RGBA`?y=l*3:c===`RBG`?(g=0,v=l,_=l*2):c===`BGR`&&(v=0,_=l,g=l*2);for(let t=0;t{let n=typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement,r=typeof ImageData<`u`&&e instanceof ImageData,i=typeof ImageBitmap<`u`&&e instanceof ImageBitmap,a=typeof e==`string`,o,s=t??{},c=()=>{if(typeof document<`u`)return document.createElement(`canvas`);if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(1,1);throw Error(`Canvas is not supported`)},l=e=>typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas?e.getContext(`2d`):null;if(n){let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let n=e.height,i=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(n=t.resizedHeight,i=t.resizedWidth),t!==void 0){if(s=t,t.tensorFormat!==void 0)throw Error(`Image input config format must be RGBA for HTMLImageElement`);s.tensorFormat=`RGBA`,s.height=n,s.width=i}else s.tensorFormat=`RGBA`,s.height=n,s.width=i;r.drawImage(e,0,0),o=r.getImageData(0,0,i,n).data}else throw Error(`Can not access image data`)}else if(r){let n,r;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(n=t.resizedHeight,r=t.resizedWidth):(n=e.height,r=e.width),t!==void 0&&(s=t),s.format=`RGBA`,s.height=n,s.width=r,t!==void 0){let t=c();t.width=r,t.height=n;let i=l(t);if(i!=null)i.putImageData(e,0,0),o=i.getImageData(0,0,r,n).data;else throw Error(`Can not access image data`)}else o=e.data}else if(i){if(t===void 0)throw Error(`Please provide image config with format for Imagebitmap`);let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let t=e.height,n=e.width;return r.drawImage(e,0,0,n,t),o=r.getImageData(0,0,n,t).data,s.height=t,s.width=n,re(o,s)}else throw Error(`Can not access image data`)}else{if(a)return new Promise((t,n)=>{let r=c(),i=l(r);if(!e||!i)return n();let a=new Image;a.crossOrigin=`Anonymous`,a.src=e,a.onload=()=>{r.width=a.width,r.height=a.height,i.drawImage(a,0,0,r.width,r.height);let e=i.getImageData(0,0,r.width,r.height);s.height=r.height,s.width=r.width,t(re(e.data,s))}});throw Error(`Input data provided is not supported - aborted tensor creation`)}if(o!==void 0)return re(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},E=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t;return new ge({location:`texture`,type:`float32`,texture:e,dims:[1,r,n,4],download:i,dispose:a})},ie=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new ge({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},ae=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new ge({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},oe=(e,t,n)=>new ge({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]})}),ce,le,ue,de,fe=s(()=>{"use strict";ce=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),le=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]),ue=!1,de=()=>{if(!ue){ue=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=typeof n<`u`&&n.from;e&&(ce.set(`int64`,BigInt64Array),le.set(BigInt64Array,`int64`)),t&&(ce.set(`uint64`,BigUint64Array),le.set(BigUint64Array,`uint64`)),r?(ce.set(`float16`,n),le.set(n,`float16`)):ce.set(`float16`,Uint16Array)}}}),pe,me,he=s(()=>{"use strict";_e(),pe=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new ge(e.type,e.data,t);case`cpu-pinned`:return new ge({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new ge({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new ge({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new ge({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),ge,_e=s(()=>{"use strict";ne(),se(),fe(),he(),ge=class{constructor(e,t,n){de();let r,i;if(typeof e==`object`&&`location`in e)switch(this.dataLocation=e.location,r=e.type,i=e.dims,e.location){case`cpu-pinned`:{let t=ce.get(r);if(!t)throw TypeError(`unsupported type "${r}" to create tensor from pinned buffer`);if(!(e.data instanceof t))throw TypeError(`buffer should be of type ${t.name}`);this.cpuData=e.data;break}case`texture`:if(r!==`float32`)throw TypeError(`unsupported type "${r}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break;case`gpu-buffer`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break;case`ml-tensor`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint64`&&r!==`int8`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break;default:throw Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,o;if(typeof e==`string`)if(r=e,o=n,e===`string`){if(!Array.isArray(t))throw TypeError(`A string tensor's data must be a string array.`);a=t}else{let n=ce.get(e);if(n===void 0)throw TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t)){if(e===`float16`&&n===Uint16Array||e===`uint4`||e===`int4`)throw TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${n.name} as data.`);a=e===`uint64`||e===`int64`?n.from(t,BigInt):n.from(t)}else if(t instanceof n)a=t;else if(t instanceof Uint8ClampedArray)if(e===`uint8`)a=Uint8Array.from(t);else throw TypeError(`A Uint8ClampedArray tensor's data must be type of uint8`);else if(e===`float16`&&t instanceof Uint16Array&&n!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw TypeError(`A ${r} tensor's data must be type of ${n}`)}else if(o=t,Array.isArray(e)){if(e.length===0)throw TypeError(`Tensor type cannot be inferred from an empty array.`);let t=typeof e[0];if(t===`string`)r=`string`,a=e;else if(t===`boolean`)r=`bool`,a=Uint8Array.from(e);else throw TypeError(`Invalid element type of data array: ${t}.`)}else if(e instanceof Uint8ClampedArray)r=`uint8`,a=Uint8Array.from(e);else{let t=le.get(e.constructor);if(t===void 0)throw TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,a=e}if(o===void 0)o=[a.length];else if(!Array.isArray(o))throw TypeError(`A tensor's dims must be a number array`);i=o,this.cpuData=a,this.dataLocation=`cpu`}let a=pe(i);if(this.cpuData&&a!==this.cpuData.length&&!((r===`uint4`||r===`int4`)&&Math.ceil(a/2)===this.cpuData.length))throw Error(`Tensor's size(${a}) does not match data length(${this.cpuData.length}).`);this.type=r,this.dims=i,this.size=a}static async fromImage(e,t){return T(e,t)}static fromTexture(e,t){return E(e,t)}static fromGpuBuffer(e,t){return ie(e,t)}static fromMLTensor(e,t){return ae(e,t)}static fromPinnedBuffer(e,t,n){return oe(e,t,n)}toDataURL(e){return C(this,e)}toImageData(e){return w(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw Error(`The data is not stored as a WebGL texture.`);return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw Error(`The data is not stored as a WebGPU buffer.`);return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw Error(`The data is not stored as a WebNN MLTensor.`);return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case`cpu`:case`cpu-pinned`:return this.data;case`texture`:case`gpu-buffer`:case`ml-tensor`:if(!this.downloader)throw Error(`The current tensor is not created with a specified data downloader.`);if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);try{this.isDownloading=!0;let t=await this.downloader();return this.downloader=void 0,this.dataLocation=`cpu`,this.cpuData=t,e&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}default:throw Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);this.disposer&&=(this.disposer(),void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation=`none`}ensureValid(){if(this.dataLocation===`none`)throw Error(`The tensor is disposed.`)}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw Error(`Cannot reshape a tensor that owns GPU resource.`);return me(this,e)}}}),ve,ye=s(()=>{"use strict";_e(),ve=ge}),be,xe,D,Se,Ce,we,Te=s(()=>{"use strict";ee(),be=(e,t)=>{(typeof x.trace>`u`?!x.wasm.trace:!x.trace)||console.timeStamp(`${e}::ORT::${t}`)},xe=(e,t)=>{let n=Error().stack?.split(/\r\n|\r|\n/g)||[],r=!1;for(let i=0;i{(typeof x.trace>`u`?!x.wasm.trace:!x.trace)||xe(`BEGIN`,e)},Se=e=>{(typeof x.trace>`u`?!x.wasm.trace:!x.trace)||xe(`END`,e)},Ce=e=>{(typeof x.trace>`u`?!x.wasm.trace:!x.trace)||console.time(`ORT::${e}`)},we=e=>{(typeof x.trace>`u`?!x.wasm.trace:!x.trace)||console.timeEnd(`ORT::${e}`)}}),Ee,De=s(()=>{"use strict";g(),ye(),Te(),Ee=class e{constructor(e){this.handler=e}async run(e,t,n){D(),Ce(`InferenceSession.run`);let r={},i={};if(typeof e!=`object`||!e||e instanceof ve||Array.isArray(e))throw TypeError(`'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.`);let a=!0;if(typeof t==`object`){if(t===null)throw TypeError(`Unexpected argument[1]: cannot be null.`);if(t instanceof ve)throw TypeError(`'fetches' cannot be a Tensor`);if(Array.isArray(t)){if(t.length===0)throw TypeError(`'fetches' cannot be an empty array.`);a=!1;for(let e of t){if(typeof e!=`string`)throw TypeError(`'fetches' must be a string array or an object.`);if(this.outputNames.indexOf(e)===-1)throw RangeError(`'fetches' contains invalid output name: ${e}.`);r[e]=null}if(typeof n==`object`&&n)i=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else{let e=!1,o=Object.getOwnPropertyNames(t);for(let n of this.outputNames)if(o.indexOf(n)!==-1){let i=t[n];(i===null||i instanceof ve)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else i=t}}else if(typeof t<`u`)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(typeof e[t]>`u`)throw Error(`input '${t}' is missing in 'feeds'.`);if(a)for(let e of this.outputNames)r[e]=null;let o=await this.handler.run(e,r,i),s={};for(let e in o)if(Object.hasOwnProperty.call(o,e)){let t=o[e];t instanceof ve?s[e]=t:s[e]=new ve(t.type,t.data,t.dims)}return we(`InferenceSession.run`),Se(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){D(),Ce(`InferenceSession.create`);let a,o={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer){let e=t,s=0,c=t.byteLength;if(typeof n==`object`&&n)o=n;else if(typeof n==`number`){if(s=n,!Number.isSafeInteger(s))throw RangeError(`'byteOffset' must be an integer.`);if(s<0||s>=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(c=t.byteLength-s,typeof r==`number`){if(c=r,!Number.isSafeInteger(c))throw RangeError(`'byteLength' must be an integer.`);if(c<=0||s+c>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-s}].`);if(typeof i==`object`&&i)o=i;else if(typeof i<`u`)throw TypeError(`'options' must be an object.`)}else if(typeof r<`u`)throw TypeError(`'byteLength' must be a number.`)}else if(typeof n<`u`)throw TypeError(`'options' must be an object.`);a=new Uint8Array(e,s,c)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let[s,c]=await h(o),l=await s.createInferenceSessionHandler(a,c);return we(`InferenceSession.create`),Se(),new e(l)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}}}),Oe,ke=s(()=>{"use strict";De(),Oe=Ee}),Ae=s(()=>{"use strict";}),je=s(()=>{"use strict";}),Me=s(()=>{"use strict";}),Ne=s(()=>{"use strict";}),Pe={};c(Pe,{InferenceSession:()=>Oe,TRACE:()=>be,TRACE_EVENT_BEGIN:()=>Ce,TRACE_EVENT_END:()=>we,TRACE_FUNC_BEGIN:()=>D,TRACE_FUNC_END:()=>Se,Tensor:()=>ve,env:()=>S,registerBackend:()=>p});var Fe=s(()=>{"use strict";_(),te(),ke(),ye(),Ae(),je(),Te(),Me(),Ne()}),Ie=s(()=>{"use strict";}),Le={};c(Le,{default:()=>Be});var Re,ze,Be,Ve=s(()=>{"use strict";On(),gt(),st(),Re=`ort-wasm-proxy-worker`,ze=globalThis.self?.name===Re,ze&&(self.onmessage=e=>{let{type:t,in:n}=e.data;try{switch(t){case`init-wasm`:ht(n.wasm).then(()=>{gn(n).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})})},e=>{postMessage({type:t,err:e})});break;case`init-ep`:{let{epName:e,env:r}=n;_n(r,e).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})});break}case`copy-from`:{let{buffer:e}=n,r=xn(e);postMessage({type:t,out:r});break}case`create`:{let{model:e,options:r}=n;Sn(e,r).then(e=>{postMessage({type:t,out:e})},e=>{postMessage({type:t,err:e})});break}case`release`:Cn(n),postMessage({type:t});break;case`run`:{let{sessionId:e,inputIndices:r,inputs:i,outputIndices:a,options:o}=n;Tn(e,r,i,a,Array(a.length).fill(null),o).then(e=>{e.some(e=>e[3]!==`cpu`)?postMessage({type:t,err:`Proxy does not support non-cpu tensor location.`}):postMessage({type:t,out:e},Dn([...i,...e]))},e=>{postMessage({type:t,err:e})});break}case`end-profiling`:En(n),postMessage({type:t});break;default:}}catch(e){postMessage({type:t,err:e})}}),Be=ze?null:e=>new Worker(e??Xe,{type:`module`,name:Re})}),He={};c(He,{default:()=>We});async function Ue(e={}){var t=e,n=!!globalThis.window,r=!!globalThis.WorkerGlobalScope,i=r&&self.name?.startsWith(`em-pthread`);t.mountExternalData=(e,n)=>{e.startsWith(`./`)&&(e=e.substring(2)),(t.Uc||=new Map).set(e,n)},t.unmountExternalData=()=>{delete t.Uc},globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,shared:!0}).buffer.constructor;let a=()=>{let e=e=>(...t)=>{let n=un;return t=e(...t),un==n?t:new Promise((e,t)=>{_n={resolve:e,reject:t}})};(()=>{for(let n of[`_OrtAppendExecutionProvider`,`_OrtCreateSession`,`_OrtRun`,`_OrtRunWithBinding`,`_OrtBindInput`])t[n]=e(t[n])})(),typeof jsepRunAsync<`u`&&(t._OrtRun=jsepRunAsync(t._OrtRun),t._OrtRunWithBinding=jsepRunAsync(t._OrtRunWithBinding)),a=void 0};t.asyncInit=()=>{a?.()};var o,s,c=(e,t)=>{throw t},l=self.location.href,u=``;if(n||r){try{u=new URL(`.`,l).href}catch{}r&&(s=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),o=async e=>{if(ee(e))return new Promise((t,n)=>{var r=new XMLHttpRequest;r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onload=()=>{r.status==200||r.status==0&&r.response?t(r.response):n(r.status)},r.onerror=n,r.send(null)});var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)}}var d,f,p,m,h,g,_=console.log.bind(console),v=console.error.bind(console),y=_,b=v,x=!1,ee=e=>e.startsWith(`file://`);function S(){Ne.buffer!=C.buffer&&ue()}if(i){let e=function(n){try{var r=n.data,i=r.Oc;if(i===`load`){let n=[];self.onmessage=e=>n.push(e),g=()=>{postMessage({Oc:`loaded`});for(let t of n)e(t);self.onmessage=e};for(let e of r.ce)t[e]&&!t[e].proxy||(t[e]=(...t)=>{postMessage({Oc:`callHandler`,be:e,args:t})},e==`print`&&(y=t[e]),e==`printErr`&&(b=t[e]));Ne=r.ie,ue(),f=r.je,me(),Lo()}else if(i===`run`){(function(e){var t=(S(),E)[e+52>>>2>>>0];e=(S(),E)[e+56>>>2>>>0],oa(t,t-e),F(t)})(r.Nc),Zi(r.Nc,0,0,1,0,0),Ae(),Qt(r.Nc),te||=(Oi(),!0);try{Pe(r.ge,r.Wc)}catch(e){if(e!=`unwind`)throw e}}else r.target!==`setimmediate`&&(i===`checkMailbox`?te&&$t():i&&(b(`worker: received unknown command ${i}`),b(r)))}catch(e){throw Qi(),e}};var te=!1;self.onunhandledrejection=e=>{throw e.reason||e},self.onmessage=e}var C,w,ne,re,T,E,ie,ae,oe,se,ce,le=!1;function ue(){var e=Ne.buffer;t.HEAP8=C=new Int8Array(e),ne=new Int16Array(e),t.HEAPU8=w=new Uint8Array(e),re=new Uint16Array(e),t.HEAP32=T=new Int32Array(e),t.HEAPU32=E=new Uint32Array(e),ie=new Float32Array(e),ae=new Float64Array(e),oe=new BigInt64Array(e),se=new BigUint64Array(e)}function de(){le=!0,i?g():Za._b()}function fe(e){throw b(e=`Aborted(`+e+`)`),x=!0,e=new WebAssembly.RuntimeError(e+`. Build with -sASSERTIONS for more info.`),h?.(e),e}function pe(){return{a:{f:Re,J:Be,k:Ge,p:Ke,l:qe,sa:Je,b:Ye,ca:Xe,Ja:Qe,q:$e,da:it,Za:at,Fa:ot,Ha:st,_a:ct,Xa:lt,Qa:ut,Wa:dt,oa:ft,Ga:pt,Xb:mt,Ya:ht,Yb:O,db:gt,Da:Ct,Sb:wt,Qb:Mt,Ca:Pt,M:Ft,I:It,Rb:zt,ja:qt,Tb:Jt,Ta:Yt,Vb:en,Ka:nn,Ob:rn,ka:an,Sa:Qt,ab:on,U:bn,n:Dn,c:Dt,rb:On,w:kn,L:An,z:jn,j:Mn,o:Nn,sb:Pn,G:Fn,T:In,h:Ln,u:Rn,m:zn,i:Bn,Na:Vn,Oa:Gn,Pa:Kn,La:qn,Ma:Jn,Pb:Zn,eb:Qn,cb:tr,Y:ir,qb:ar,la:or,bb:$n,fb:sr,$a:cr,Wb:lr,N:Xn,gb:ur,X:dr,Ub:fr,nb:Nr,C:Pr,ra:Fr,qa:Ir,pb:Lr,W:Rr,v:zr,mb:Br,lb:Vr,kb:Hr,ob:Ur,jb:Wr,ib:j,hb:Gr,Ua:Yr,Va:Xr,Ia:we,V:Zr,na:Qr,Ra:M,ma:ei,Cb:Fo,xa:ko,Db:Po,ya:Oo,F:_o,e:ro,s:to,x:eo,B:mo,Fb:To,ba:wo,D:oo,za:Eo,$:Ao,ga:Co,Gb:So,Hb:xo,Ba:vo,Aa:bo,Ib:yo,wa:No,aa:Do,d:no,A:ao,r:io,Bb:Io,t:co,y:ho,H:so,E:lo,K:go,R:jo,ia:po,_:Mo,Jb:fo,Kb:uo,g:ti,a:Ne,Nb:Se,Eb:ni,ha:ri,O:ii,pa:ai,Lb:oi,ta:si,Q:ci,yb:li,zb:ui,ua:N,ea:di,P:fi,Ea:pi,va:mi,Z:hi,wb:gi,Zb:_i,S:vi,Ab:yi,tb:bi,ub:Si,vb:Ci,fa:wi,xb:Ti,Mb:Ei}}}async function me(){function e(e,n){var r=Za=e.exports;e={};for(let[t,n]of Object.entries(r))typeof n==`function`?(r=cn(n),e[t]=r):e[t]=n;return Za=e,Za=function(){var e=Za,t=e=>t=>e(t)>>>0,n=e=>()=>e()>>>0;return(e=Object.assign({},e)).$b=t(e.$b),e.Cc=n(e.Cc),e.Ec=t(e.Ec),e.rd=(e=>(t,n)=>e(t,n)>>>0)(e.rd),e.wd=t(e.wd),e.xd=n(e.xd),e.Bd=t(e.Bd),e}(),De.push(Za.id),Di=(e=Za).$b,Oi=e.ac,t._OrtInit=e.bc,t._OrtGetLastError=e.cc,t._OrtCreateSessionOptions=e.dc,t._OrtAppendExecutionProvider=e.ec,t._OrtAddFreeDimensionOverride=e.fc,t._OrtAddSessionConfigEntry=e.gc,t._OrtReleaseSessionOptions=e.hc,t._OrtCreateSession=e.ic,t._OrtReleaseSession=e.jc,t._OrtGetInputOutputCount=e.kc,t._OrtGetInputOutputMetadata=e.lc,t._OrtFree=e.mc,t._OrtCreateTensor=e.nc,t._OrtGetTensorData=e.oc,t._OrtReleaseTensor=e.pc,t._OrtCreateRunOptions=e.qc,t._OrtAddRunConfigEntry=e.rc,t._OrtReleaseRunOptions=e.sc,t._OrtCreateBinding=e.tc,t._OrtBindInput=e.uc,t._OrtBindOutput=e.vc,t._OrtClearBoundOutputs=e.wc,t._OrtReleaseBinding=e.xc,t._OrtRunWithBinding=e.yc,t._OrtRun=e.zc,t._OrtEndProfiling=e.Ac,ki=t._OrtGetWebGpuDevice=e.Bc,Ai=e.Cc,ji=t._free=e.Dc,Mi=t._malloc=e.Ec,Ni=t._wgpuBufferRelease=e.Fc,Pi=t._wgpuCreateInstance=e.Gc,Fi=e.Hc,Ii=e.Ic,Li=e.Jc,Ri=e.Kc,zi=e.Lc,Bi=e.Pc,Vi=e.Zc,Hi=e._c,Ui=e.$c,Wi=e.bd,Gi=e.cd,Ki=e.dd,qi=e.ed,Ji=e.fd,Yi=e.gd,Xi=e.hd,Zi=e.kd,Qi=e.ld,$i=e.md,ea=e.nd,ta=e.od,na=e.pd,ra=e.qd,ia=e.rd,P=e.sd,aa=e.td,oa=e.ud,F=e.vd,sa=e.wd,I=e.xd,ca=e.yd,la=e.zd,ua=e.Ad,da=e.Bd,fa=e.Cd,pa=e.Dd,ma=e.Ed,ha=e.Fd,ga=e.Gd,_a=e.Hd,va=e.Id,ya=e.Jd,ba=e.Kd,xa=e.Ld,Sa=e.Md,Ca=e.Nd,wa=e.Od,Ta=e.Pd,Ea=e.Qd,Da=e.Rd,Oa=e.Td,ka=e.Ud,Aa=e.Vd,ja=e.Wd,Ma=e.Yd,Na=e.Zd,Pa=e._d,Fa=e.$d,Ia=e.ae,La=e.oe,Ra=e.pe,za=e.qe,Ba=e.re,Va=e.se,L=e.te,Ha=e.ue,Ua=e.ve,Wa=e.we,Ga=e.xe,Ka=e.ye,qa=e.Ye,Ja=e.Ze,Ya=e._e,Xa=e.$e,f=n,Za}var n,r=pe();return t.instantiateWasm?new Promise(n=>{t.instantiateWasm(r,(t,r)=>{n(e(t,r))})}):i?e(new WebAssembly.Instance(f,pe()),f):(ce??=t.locateFile?t.locateFile?t.locateFile(`ort-wasm-simd-threaded.asyncify.wasm`,u):u+`ort-wasm-simd-threaded.asyncify.wasm`:new URL(`/demo/assets/ort-wasm-simd-threaded.asyncify-DMmc6YqF.wasm`,``+self.location.href).href,n=await async function(e){var t=ce;if(!d&&!ee(t))try{var n=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(n,e)}catch(e){b(`wasm streaming compile failed: ${e}`),b(`falling back to ArrayBuffer instantiation`)}return async function(e,t){try{var n=await async function(e){if(!d)try{var t=await o(e);return new Uint8Array(t)}catch{}if(e==ce&&d)e=new Uint8Array(d);else{if(!s)throw`both async and sync fetching of the wasm failed`;e=s(e)}return e}(e);return await WebAssembly.instantiate(n,t)}catch(e){b(`failed to asynchronously prepare wasm: ${e}`),fe(e)}}(t,e)}(r),e(n.instance,n.module))}class he{name=`ExitStatus`;constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var ge=e=>{e.terminate(),e.onmessage=()=>{}},_e=[],ve=0,ye=null,be=e=>{Te.length==0&&(Me(),je(Te[0]));var t=Te.pop();if(!t)return 6;Ee.push(t),Oe[e.Nc]=t,t.Nc=e.Nc;var n={Oc:`run`,ge:e.fe,Wc:e.Wc,Nc:e.Nc};return t.postMessage(n,e.Yc),0},xe=0,D=(e,t,...n)=>{var r,i=16*n.length,a=I(),o=sa(i),s=o>>>3;for(r of n)typeof r==`bigint`?((S(),oe)[s++>>>0]=1n,(S(),oe)[s++>>>0]=r):((S(),oe)[s++>>>0]=0n,(S(),ae)[s++>>>0]=r);return e=$i(e,0,i,o,t),F(a),e};function Se(e){if(i)return D(0,1,e);if(p=e,!(0{if(p=e,i)throw Ce(e),`unwind`;Se(e)},Te=[],Ee=[],De=[],Oe={},ke=e=>{var t=e.Nc;delete Oe[t],Te.push(e),Ee.splice(Ee.indexOf(e),1),e.Nc=0,ea(t)};function Ae(){De.forEach(e=>e())}var je=e=>new Promise(n=>{e.onmessage=r=>{var i=r.data;if(r=i.Oc,i.Vc&&i.Vc!=Ai()){var a=Oe[i.Vc];a?a.postMessage(i,i.Yc):b(`Internal error! Worker sent a message "${r}" to target pthread ${i.Vc}, but that thread no longer exists!`)}else r===`checkMailbox`?$t():r===`spawnThread`?be(i):r===`cleanupThread`?Xt(()=>{ke(Oe[i.he])}):r===`loaded`?(e.loaded=!0,n(e)):i.target===`setimmediate`?e.postMessage(i):r===`uncaughtException`?e.onerror(i.error):r===`callHandler`?t[i.be](...i.args):r&&b(`worker sent an unknown command ${r}`)},e.onerror=e=>{throw b(`worker sent an error! ${e.filename}:${e.lineno}: ${e.message}`),e};var r,i=[];for(r of[])t.propertyIsEnumerable(r)&&i.push(r);e.postMessage({Oc:`load`,ce:i,ie:Ne,je:f})});function Me(){var e=new Worker((()=>{let e=URL;return self.location.href>`file:`&&self.location.href<`file;`?new e(`ort.webgpu.bundle.min.mjs`,self.location.href):new URL(self.location.href)})(),{type:`module`,workerData:`em-pthread`,name:`em-pthread`});Te.push(e)}var Ne,Pe=(e,t)=>{xe=0,e=pa(e,t),0-9007199254740992>e||9007199254740992>>=0);return(S(),C)[t.Qc+12>>>0]==0&&(Ve(t,!0),Ie--),He(t,!1),Fe.push(t),da(e)}var ze=0,Be=()=>{P(0,0);var e=Fe.pop();ca(e.Xc),ze=0};function Ve(e,t){t=+!!t,(S(),C)[e.Qc+12>>>0]=t}function He(e,t){t=+!!t,(S(),C)[e.Qc+13>>>0]=t}class Ue{constructor(e){this.Xc=e,this.Qc=e-24}}var We=e=>{var t=ze;if(!t)return aa(0),0;var n=new Ue(t);(S(),E)[n.Qc+16>>>2>>>0]=t;var r=(S(),E)[n.Qc+4>>>2>>>0];if(!r)return aa(0),t;for(var i of e){if(i===0||i===r)break;if(ua(i,r,n.Qc+16))return aa(i),t}return aa(r),t};function Ge(){return We([])}function Ke(e){return We([e>>>0])}function qe(e,t,n,r){return We([e>>>0,t>>>0,n>>>0,r>>>0])}var Je=()=>{var e=Fe.pop();e||fe(`no exception to throw`);var t=e.Xc;throw(S(),C)[e.Qc+13>>>0]==0&&(Fe.push(e),He(e,!0),Ve(e,!1),Ie++),la(t),ze=t};function Ye(e,t,n){var r=new Ue(e>>>=0);throw t>>>=0,n>>>=0,(S(),E)[r.Qc+16>>>2>>>0]=0,(S(),E)[r.Qc+4>>>2>>>0]=t,(S(),E)[r.Qc+8>>>2>>>0]=n,la(e),Ie++,ze=e}var Xe=()=>Ie;function Ze(e,t,n,r){return i?D(2,1,e,t,n,r):Qe(e,t,n,r)}function Qe(e,t,n,r){if(e>>>=0,t>>>=0,n>>>=0,r>>>=0,!globalThis.SharedArrayBuffer)return 6;var a=[];return i&&a.length===0?Ze(e,t,n,r):(e={fe:n,Nc:e,Wc:r,Yc:a},i?(e.Oc=`spawnThread`,postMessage(e,a),0):be(e))}function $e(e){throw ze||=e>>>0,ze}var et=globalThis.TextDecoder&&new TextDecoder,tt=(e,t,n,r)=>{if(n=t+n,r)return n;for(;e[t]&&!(t>=n);)++t;return t},nt=(e,t=0,n,r)=>{if(16<(n=tt(e,t>>>=0,n,r))-t&&e.buffer&&et)return et.decode(e.buffer instanceof ArrayBuffer?e.subarray(t,n):e.slice(t,n));for(r=``;t(i=(240&i)==224?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r},rt=(e,t,n)=>(e>>>=0)?nt((S(),w),e,t,n):``;function it(e,t,n){return i?D(3,1,e,t,n):0}function at(e,t){if(i)return D(4,1,e,t)}function ot(e,t){if(i)return D(5,1,e,t)}function st(e,t,n){if(i)return D(6,1,e,t,n)}function ct(e,t,n){return i?D(7,1,e,t,n):0}function lt(e,t){if(i)return D(8,1,e,t)}function ut(e,t,n){if(i)return D(9,1,e,t,n)}function dt(e,t,n,r){if(i)return D(10,1,e,t,n,r)}function ft(e,t,n,r){if(i)return D(11,1,e,t,n,r)}function pt(e,t,n,r){if(i)return D(12,1,e,t,n,r)}function mt(e){if(i)return D(13,1,e)}function ht(e,t){if(i)return D(14,1,e,t)}function O(e,t,n){if(i)return D(15,1,e,t,n)}var gt=()=>fe(``),_t=e=>{e>>>=0;for(var t=``;;){var n=(S(),w)[e++>>>0];if(!n)return t;t+=String.fromCharCode(n)}},vt={},k={},yt={},bt=class extends Error{constructor(e){super(e),this.name=`BindingError`}};function xt(e,t,n={}){return function(e,t,n={}){var r=t.name;if(!e)throw new bt(`type "${r}" must have a positive integer typeid pointer`);if(k.hasOwnProperty(e)){if(n.de)return;throw new bt(`Cannot register type '${r}' twice`)}k[e]=t,delete yt[e],vt.hasOwnProperty(e)&&(t=vt[e],delete vt[e],t.forEach(e=>e()))}(e,t,n)}var St=(e,t,n)=>{switch(t){case 1:return n?e=>(S(),C)[e>>>0]:e=>(S(),w)[e>>>0];case 2:return n?e=>(S(),ne)[e>>>1>>>0]:e=>(S(),re)[e>>>1>>>0];case 4:return n?e=>(S(),T)[e>>>2>>>0]:e=>(S(),E)[e>>>2>>>0];case 8:return n?e=>(S(),oe)[e>>>3>>>0]:e=>(S(),se)[e>>>3>>>0];default:throw TypeError(`invalid integer width (${t}): ${e}`)}};function Ct(e,t,n,r,i){e>>>=0,n>>>=0,t=_t(t>>>0);let a=e=>e;if(r=r===0n){let e=8*n;a=t=>BigInt.asUintN(e,t),i=a(i)}xt(e,{name:t,Mc:a,Sc:(e,t)=>(typeof t==`number`&&(t=BigInt(t)),t),Rc:St(t,n,!r),Tc:null})}function wt(e,t,n,r){xt(e>>>=0,{name:t=_t(t>>>0),Mc:function(e){return!!e},Sc:function(e,t){return t?n:r},Rc:function(e){return this.Mc((S(),w)[e>>>0])},Tc:null})}var Tt=[],Et=[0,1,,1,null,1,!0,1,!1,1];function Dt(e){9<(e>>>=0)&&--Et[e+1]==0&&(Et[e]=void 0,Tt.push(e))}var Ot=e=>{if(!e)throw new bt(`Cannot use deleted val. handle = ${e}`);return Et[e]},kt=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=Tt.pop()||Et.length;return Et[t]=e,Et[t+1]=1,t}};function At(e){return this.Mc((S(),E)[e>>>2>>>0])}var jt={name:`emscripten::val`,Mc:e=>{var t=Ot(e);return Dt(e),t},Sc:(e,t)=>kt(t),Rc:At,Tc:null};function Mt(e){return xt(e>>>0,jt)}var Nt=(e,t)=>{switch(t){case 4:return function(e){return this.Mc((S(),ie)[e>>>2>>>0])};case 8:return function(e){return this.Mc((S(),ae)[e>>>3>>>0])};default:throw TypeError(`invalid float width (${t}): ${e}`)}};function Pt(e,t,n){n>>>=0,xt(e>>>=0,{name:t=_t(t>>>0),Mc:e=>e,Sc:(e,t)=>t,Rc:Nt(t,n),Tc:null})}function Ft(e,t,n,r,i){e>>>=0,n>>>=0,t=_t(t>>>0);let a=e=>e;if(r===0){var o=32-8*n;a=e=>e<>>o,i=a(i)}xt(e,{name:t,Mc:a,Sc:(e,t)=>t,Rc:St(t,n,r!==0),Tc:null})}function It(e,t,n){function r(e){var t=(S(),E)[e>>>2>>>0];return e=(S(),E)[e+4>>>2>>>0],new i((S(),C).buffer,e,t)}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];xt(e>>>=0,{name:n=_t(n>>>0),Mc:r,Rc:r},{de:!0})}var Lt=(e,t,n)=>{var r=(S(),w);if(t>>>=0,0=o){if(t>=n)break;r[t++>>>0]=o}else if(2047>=o){if(t+1>=n)break;r[t++>>>0]=192|o>>6,r[t++>>>0]=128|63&o}else if(65535>=o){if(t+2>=n)break;r[t++>>>0]=224|o>>12,r[t++>>>0]=128|o>>6&63,r[t++>>>0]=128|63&o}else{if(t+3>=n)break;r[t++>>>0]=240|o>>18,r[t++>>>0]=128|o>>12&63,r[t++>>>0]=128|o>>6&63,r[t++>>>0]=128|63&o,a++}}r[t>>>0]=0,e=t-i}else e=0;return e},Rt=e=>{for(var t=0,n=0;n=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t};function zt(e,t){xt(e>>>=0,{name:t=_t(t>>>0),Mc(e){var t=(S(),E)[e>>>2>>>0];return t=rt(e+4,t,!0),ji(e),t},Sc(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n=typeof t==`string`;if(!(n||ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT==1))throw new bt(`Cannot pass non-string to std::string`);var r=n?Rt(t):t.length,i=Mi(4+r+1),a=i+4;return(S(),E)[i>>>2>>>0]=r,n?Lt(t,a,r+1):(S(),w).set(t,a>>>0),e!==null&&e.push(ji,i),i},Rc:At,Tc(e){ji(e)}})}var Bt=globalThis.TextDecoder?new TextDecoder(`utf-16le`):void 0,Vt=(e,t,n)=>{if(e>>>=1,16<(t=tt((S(),re),e,t/2,n))-e&&Bt)return Bt.decode((S(),re).slice(e,t));for(n=``;e>>0];n+=String.fromCharCode(r)}return n},Ht=(e,t,n)=>{if(n??=2147483647,2>n)return 0;var r=t;n=(n-=2)<2*e.length?n/2:e.length;for(var i=0;i>>1>>>0]=a,t+=2}return(S(),ne)[t>>>1>>>0]=0,t-r},Ut=e=>2*e.length,Wt=(e,t,n)=>{var r=``;e>>>=2;for(var i=0;!(i>=t/4);i++){var a=(S(),E)[e+i>>>0];if(!a&&!n)break;r+=String.fromCodePoint(a)}return r},Gt=(e,t,n)=>{if(t>>>=0,n??=2147483647,4>n)return 0;var r=t;n=r+n-4;for(var i=0;i>>2>>>0]=a,(t+=4)+4>n)break}return(S(),T)[t>>>2>>>0]=0,t-r},Kt=e=>{for(var t=0,n=0;n>>=0,t>>>=0,n=_t(n>>>=0),t===2)var r=Vt,i=Ht,a=Ut;else r=Wt,i=Gt,a=Kt;xt(e,{name:n,Mc:e=>{var n=(S(),E)[e>>>2>>>0];return n=r(e+4,n*t,!0),ji(e),n},Sc:(e,r)=>{if(typeof r!=`string`)throw new bt(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=Mi(4+o+t);return(S(),E)[s>>>2>>>0]=o/t,i(r,s+4,o+t),e!==null&&e.push(ji,s),s},Rc:At,Tc(e){ji(e)}})}function Jt(e,t){xt(e>>>=0,{ee:!0,name:t=_t(t>>>0),Mc:()=>{},Sc:()=>{}})}function Yt(e){Zi(e>>>0,!r,1,!n,131072,!1),Ae()}var Xt=e=>{if(!x)try{if(e(),!(0Number((navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)||[])[2]);function Qt(e){e>>>=0,Zt||(Atomics.waitAsync((S(),T),e>>>2,e).value.then($t),e+=128,Atomics.store((S(),T),e>>>2,1))}var $t=()=>Xt(()=>{var e=Ai();e&&(Qt(e),ra())});function en(e,t){(e>>>=0)==t>>>0?setTimeout($t):i?postMessage({Vc:e,Oc:`checkMailbox`}):(e=Oe[e])&&e.postMessage({Oc:`checkMailbox`})}var tn=[];function nn(e,t,n,r,i){for(t>>>=0,i>>>=0,tn.length=0,n=i>>>3,r=i+r>>>3;n>>0]?(S(),oe)[n++>>>0]:(S(),ae)[n++>>>0];tn.push(a)}return(t?$a[t]:Qa[e])(...tn)}var rn=()=>{xe=0};function an(e){e>>>=0,i?postMessage({Oc:`cleanupThread`,he:e}):ke(Oe[e])}function on(e){}var sn=e=>{try{e()}catch(e){fe(e)}};function cn(e){var t=(...t)=>{fn.push(e);try{return e(...t)}finally{x||(fn.pop(),un&&ln===1&&fn.length===0&&(ln=0,xe+=1,sn(Ja),typeof Fibers<`u`&&Fibers.Be()))}};return hn.set(e,t),t}var ln=0,un=null,dn=0,fn=[],pn=new Map,mn=new Map,hn=new Map,gn=0,_n=null,vn=[],yn=e=>function(e){if(!x){if(ln===0){var t=!1,n=!1;e((e=0)=>{if(!x&&(dn=e,t=!0,n)){ln=2,sn(()=>Ya(un)),typeof MainLoop<`u`&&MainLoop.Xd&&MainLoop.resume(),e=!1;try{var r=function(){var e=(S(),T)[un+8>>>2>>>0];return e=mn.get(e),e=hn.get(e),--xe,e()}()}catch(t){r=t,e=!0}var i=!1;if(!un){var a=_n;a&&(_n=null,(e?a.reject:a.resolve)(r),i=!0)}if(e&&!i)throw r}}),n=!0,t||(ln=1,un=function(){var e=Mi(65548),t=e+12;if((S(),E)[e>>>2>>>0]=t,(S(),E)[e+4>>>2>>>0]=t+65536,t=fn[0],!pn.has(t)){var n=gn++;pn.set(t,n),mn.set(n,t)}return t=pn.get(t),(S(),T)[e+8>>>2>>>0]=t,e}(),typeof MainLoop<`u`&&MainLoop.Xd&&MainLoop.pause(),sn(()=>qa(un)))}else ln===2?(ln=0,sn(Xa),ji(un),un=null,vn.forEach(Xt)):fe(`invalid state: ${ln}`);return dn}}(t=>{e().then(t)});function bn(e){return e>>>=0,yn(async()=>kt(await Ot(e)))}var xn=[],Sn=e=>{var t=xn.length;return xn.push(e),t},Cn=(e,t)=>{for(var n=Array(e),r=0;r>>2>>>0],o=k[a];if(o===void 0)throw e=`parameter ${r}`,a=Di(a),t=_t(a),ji(a),new bt(`${e} has unknown type ${t}`);n[i]=o}return n},wn=(e,t,n)=>{var r=[];return e=e(r,n),r.length&&((S(),E)[t>>>2>>>0]=kt(r)),e},Tn={},En=e=>{var t=Tn[e];return t===void 0?_t(e):t};function Dn(e,t,n){var[r,...i]=Cn(e,t>>>0);t=r.Sc.bind(r);var a=i.map(e=>e.Rc.bind(e));e--;var o={toValue:Ot};switch(e=a.map((e,t)=>{var n=`argFromPtr${t}`;return o[n]=e,`${n}(args${t?`+`+8*t:``})`}),n){case 0:var s=`toValue(handle)`;break;case 2:s=`new (toValue(handle))`;break;case 3:s=``;break;case 1:o.getStringOrSymbol=En,s=`toValue(handle)[getStringOrSymbol(methodName)]`}return s+=`(${e})`,r.ee||(o.toReturnWire=t,o.emval_returnValue=wn,s=`return emval_returnValue(toReturnWire, destructorsRef, ${s})`),s=`return function (handle, methodName, destructorsRef, args) { + ${s} + }`,n=Function(Object.keys(o),s)(...Object.values(o)),s=`methodCaller<(${i.map(e=>e.name)}) => ${r.name}>`,Sn(Object.defineProperty(n,"name",{value:s}))}function On(e,t){return t>>>=0,(e=Ot(e>>>0))==Ot(t)}function kn(e){return(e>>>=0)?(e=En(e),kt(globalThis[e])):kt(globalThis)}function An(e){return e=En(e>>>0),kt(t[e])}function jn(e,t){return t>>>=0,e=Ot(e>>>0),t=Ot(t),kt(e[t])}function Mn(e){9<(e>>>=0)&&(Et[e+1]+=1)}function Nn(e,t,n,r,i){return xn[e>>>0](t>>>0,n>>>0,r>>>0,i>>>0)}function Pn(e,t,n,r,i){return Nn(e>>>0,t>>>0,n>>>0,r>>>0,i>>>0)}function Fn(){return kt([])}function In(e){e=Ot(e>>>0);for(var t=Array(e.length),n=0;n>>0))}function Rn(){return kt({})}function zn(e){for(var t=Ot(e>>>=0);t.length;){var n=t.pop();t.pop()(n)}Dt(e)}function Bn(e,t,n){t>>>=0,n>>>=0,e=Ot(e>>>0),t=Ot(t),n=Ot(n),e[t]=n}function Vn(e,t){e=Le(e),t>>>=0,e=new Date(1e3*e),(S(),T)[t>>>2>>>0]=e.getUTCSeconds(),(S(),T)[t+4>>>2>>>0]=e.getUTCMinutes(),(S(),T)[t+8>>>2>>>0]=e.getUTCHours(),(S(),T)[t+12>>>2>>>0]=e.getUTCDate(),(S(),T)[t+16>>>2>>>0]=e.getUTCMonth(),(S(),T)[t+20>>>2>>>0]=e.getUTCFullYear()-1900,(S(),T)[t+24>>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,(S(),T)[t+28>>>2>>>0]=e}var Hn=e=>e%4==0&&(e%100!=0||e%400==0),Un=[0,31,60,91,121,152,182,213,244,274,305,335],Wn=[0,31,59,90,120,151,181,212,243,273,304,334];function Gn(e,t){e=Le(e),t>>>=0,e=new Date(1e3*e),(S(),T)[t>>>2>>>0]=e.getSeconds(),(S(),T)[t+4>>>2>>>0]=e.getMinutes(),(S(),T)[t+8>>>2>>>0]=e.getHours(),(S(),T)[t+12>>>2>>>0]=e.getDate(),(S(),T)[t+16>>>2>>>0]=e.getMonth(),(S(),T)[t+20>>>2>>>0]=e.getFullYear()-1900,(S(),T)[t+24>>>2>>>0]=e.getDay();var n=(Hn(e.getFullYear())?Un:Wn)[e.getMonth()]+e.getDate()-1|0;(S(),T)[t+28>>>2>>>0]=n,(S(),T)[t+36>>>2>>>0]=-60*e.getTimezoneOffset(),n=new Date(e.getFullYear(),6,1).getTimezoneOffset();var r=new Date(e.getFullYear(),0,1).getTimezoneOffset();e=0|(n!=r&&e.getTimezoneOffset()==Math.min(r,n)),(S(),T)[t+32>>>2>>>0]=e}function Kn(e){e>>>=0;var t=new Date((S(),T)[e+20>>>2>>>0]+1900,(S(),T)[e+16>>>2>>>0],(S(),T)[e+12>>>2>>>0],(S(),T)[e+8>>>2>>>0],(S(),T)[e+4>>>2>>>0],(S(),T)[e>>>2>>>0],0),n=(S(),T)[e+32>>>2>>>0],r=t.getTimezoneOffset(),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=new Date(t.getFullYear(),0,1).getTimezoneOffset(),o=Math.min(a,i);return 0>n?(S(),T)[e+32>>>2>>>0]=+(i!=a&&o==r):0>>2>>>0]=t.getDay(),n=(Hn(t.getFullYear())?Un:Wn)[t.getMonth()]+t.getDate()-1|0,(S(),T)[e+28>>>2>>>0]=n,(S(),T)[e>>>2>>>0]=t.getSeconds(),(S(),T)[e+4>>>2>>>0]=t.getMinutes(),(S(),T)[e+8>>>2>>>0]=t.getHours(),(S(),T)[e+12>>>2>>>0]=t.getDate(),(S(),T)[e+16>>>2>>>0]=t.getMonth(),(S(),T)[e+20>>>2>>>0]=t.getYear(),e=t.getTime(),BigInt(isNaN(e)?-1:e/1e3)}function qn(e,t,n,r,a,o,s){return i?D(16,1,e,t,n,r,a,o,s):-52}function Jn(e,t,n,r,a,o){if(i)return D(17,1,e,t,n,r,a,o)}var Yn={},Xn=()=>performance.timeOrigin+performance.now();function Zn(e,t){return i?D(18,1,e,t):(Yn[e]&&(clearTimeout(Yn[e].id),delete Yn[e]),t&&(Yn[e]={id:setTimeout(()=>{delete Yn[e],Xt(()=>na(e,performance.timeOrigin+performance.now()))},t),Ae:t}),0)}function Qn(e,t,n,r){e>>>=0,t>>>=0,n>>>=0,r>>>=0;var i=new Date().getFullYear(),a=new Date(i,0,1).getTimezoneOffset();i=new Date(i,6,1).getTimezoneOffset();var o=Math.max(a,i);(S(),E)[e>>>2>>>0]=60*o,(S(),T)[t>>>2>>>0]=+(a!=i),e=(t=e=>{var t=Math.abs(e);return`UTC${0<=e?`-`:`+`}${String(Math.floor(t/60)).padStart(2,`0`)}${String(t%60).padStart(2,`0`)}`})(a),t=t(i),iDate.now(),er=1;function tr(e,t,n){if(n>>>=0,!(0<=e&&3>=e))return 28;if(e===0)e=Date.now();else{if(!er)return 52;e=performance.timeOrigin+performance.now()}return e=Math.round(1e6*e),(S(),oe)[n>>>3>>>0]=BigInt(e),0}var nr=[],rr=(e,t)=>{nr.length=0;for(var n;n=(S(),w)[e++>>>0];){var r=n!=105;t+=(r&=n!=112)&&t%8?4:0,nr.push(n==112?(S(),E)[t>>>2>>>0]:n==106?(S(),oe)[t>>>3>>>0]:n==105?(S(),T)[t>>>2>>>0]:(S(),ae)[t>>>3>>>0]),t+=r?8:4}return nr};function ir(e,t,n){return e>>>=0,t=rr(t>>>0,n>>>0),$a[e](...t)}function ar(e,t,n){return e>>>=0,t=rr(t>>>0,n>>>0),$a[e](...t)}var or=()=>{};function sr(e,t){return b(rt(e>>>0,t>>>0))}var cr=()=>{throw xe+=1,`unwind`};function lr(){return 4294901760}var ur=()=>1,dr=()=>navigator.hardwareConcurrency;function fr(e){e>>>=0;var t=(S(),w).length;if(e<=t||4294901760=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);e:{r=(Math.min(4294901760,65536*Math.ceil(Math.max(e,r)/65536))-Ne.buffer.byteLength+65535)/65536|0;try{Ne.grow(r),ue();var i=1;break e}catch{}i=void 0}if(i)return!0}return!1}var pr=e=>{var t=Rt(e)+1,n=sa(t);return Lt(e,n,t),n},mr=(e,t)=>{(S(),E)[e>>>2>>>0]=t;var n=(S(),E)[e>>>2>>>0];(S(),E)[e+4>>>2>>>0]=(t-n)/4294967296},hr=e=>(S(),E)[e>>>2>>>0]+4294967296*(S(),T)[e+4>>>2>>>0],gr=[],_r=(e,t)=>{gr[e>>>0]=t},vr=[],yr=[],br=(e,t)=>{yr[e]=new Promise(n=>t.finally(()=>n(e)))},A=e=>{if(e)return gr[e>>>0]},xr=(e,t)=>{for(e=(S(),E)[e>>>2>>>0];e;e=(S(),E)[e>>>2>>>0])t[(S(),T)[e+4>>>2>>>0]](e)},Sr=(e,t,n)=>{(S(),E)[e>>>2>>>0]=t,(S(),E)[e+4>>>2>>>0]=n},Cr=e=>{var t=(S(),E)[e>>>2>>>0];return e=(S(),E)[e+4>>>2>>>0],rt(t,e)},wr=e=>{var t=(S(),E)[e>>>2>>>0];return e=(S(),E)[e+4>>>2>>>0],t?rt(t,e):e===0?``:void 0},Tr=e=>{var t=wr(e+4),n=(n=(S(),E)[e+12>>>2>>>0])?A(n):`auto`;if(e+=16){var r=A((S(),E)[e+4>>>2>>>0]),i=(S(),E)[e+16>>>2>>>0],a=(S(),E)[e+20>>>2>>>0];if(i){for(var o={},s=0;s>>3>>>0]}i=o}else i=void 0;e={module:r,constants:i,entryPoint:wr(e+8)}}else e=void 0;return{label:t,layout:n,compute:e}},Er=(e,t)=>{function n(n,r){n=e[n],(S(),E)[t+r>>>2>>>0]=n}n(`maxTextureDimension1D`,4),n(`maxTextureDimension2D`,8),n(`maxTextureDimension3D`,12),n(`maxTextureArrayLayers`,16),n(`maxBindGroups`,20),n(`maxBindGroupsPlusVertexBuffers`,24),n(`maxBindingsPerBindGroup`,28),n(`maxDynamicUniformBuffersPerPipelineLayout`,32),n(`maxDynamicStorageBuffersPerPipelineLayout`,36),n(`maxSampledTexturesPerShaderStage`,40),n(`maxSamplersPerShaderStage`,44),n(`maxStorageBuffersPerShaderStage`,48),n(`maxStorageTexturesPerShaderStage`,52),n(`maxUniformBuffersPerShaderStage`,56),n(`minUniformBufferOffsetAlignment`,80),n(`minStorageBufferOffsetAlignment`,84),mr(t+64,e.maxUniformBufferBindingSize),mr(t+72,e.maxStorageBufferBindingSize),n(`maxVertexBuffers`,88),mr(t+96,e.maxBufferSize),n(`maxVertexAttributes`,104),n(`maxVertexBufferArrayStride`,108),n(`maxInterStageShaderVariables`,112),n(`maxColorAttachments`,116),n(`maxColorAttachmentBytesPerSample`,120),n(`maxComputeWorkgroupStorageSize`,124),n(`maxComputeInvocationsPerWorkgroup`,128),n(`maxComputeWorkgroupSizeX`,132),n(`maxComputeWorkgroupSizeY`,136),n(`maxComputeWorkgroupSizeZ`,140),n(`maxComputeWorkgroupsPerDimension`,144),e.ze!==void 0&&n(`maxImmediateSize`,148)},Dr=[,`validation`,`out-of-memory`,`internal`],Or=[,`compatibility`,`core`],kr={1:`core-features-and-limits`,2:`depth-clip-control`,3:`depth32float-stencil8`,4:`texture-compression-bc`,5:`texture-compression-bc-sliced-3d`,6:`texture-compression-etc2`,7:`texture-compression-astc`,8:`texture-compression-astc-sliced-3d`,9:`timestamp-query`,10:`indirect-first-instance`,11:`shader-f16`,12:`rg11b10ufloat-renderable`,13:`bgra8unorm-storage`,14:`float32-filterable`,15:`float32-blendable`,16:`clip-distances`,17:`dual-source-blending`,18:`subgroups`,19:`texture-formats-tier1`,20:`texture-formats-tier2`,21:`primitive-index`,22:`texture-component-swizzle`,327692:`chromium-experimental-unorm16-texture-formats`,327729:`chromium-experimental-multi-draw-indirect`},Ar=[,`low-power`,`high-performance`],jr=[,`occlusion`,`timestamp`],Mr={undefined:1,unknown:1,destroyed:2};function Nr(e,t,n,r,i,a){t=Le(t),n=Le(n),r>>>=0,i>>>=0,a>>>=0;var o=A(e>>>0);if(e={},a){var s=(S(),E)[a+12>>>2>>>0];if(s){var c=(S(),E)[a+16>>>2>>>0];e.requiredFeatures=Array.from((S(),E).subarray(c>>>2>>>0,c+4*s>>>2>>>0),e=>kr[e])}var l=(S(),E)[a+20>>>2>>>0];if(l){let t=function(e,t,n=!1){t=l+t,(t=(S(),E)[t>>>2>>>0])==4294967295||n&&t==0||(u[e]=t)},n=function(e,t){t=l+t;var n=(S(),E)[t>>>2>>>0],r=(S(),E)[t+4>>>2>>>0];n==4294967295&&r==4294967295||(u[e]=hr(t))};var u={};t(`maxTextureDimension1D`,4),t(`maxTextureDimension2D`,8),t(`maxTextureDimension3D`,12),t(`maxTextureArrayLayers`,16),t(`maxBindGroups`,20),t(`maxBindGroupsPlusVertexBuffers`,24),t(`maxDynamicUniformBuffersPerPipelineLayout`,32),t(`maxDynamicStorageBuffersPerPipelineLayout`,36),t(`maxSampledTexturesPerShaderStage`,40),t(`maxSamplersPerShaderStage`,44),t(`maxStorageBuffersPerShaderStage`,48),t(`maxStorageTexturesPerShaderStage`,52),t(`maxUniformBuffersPerShaderStage`,56),t(`minUniformBufferOffsetAlignment`,80),t(`minStorageBufferOffsetAlignment`,84),n(`maxUniformBufferBindingSize`,64),n(`maxStorageBufferBindingSize`,72),t(`maxVertexBuffers`,88),n(`maxBufferSize`,96),t(`maxVertexAttributes`,104),t(`maxVertexBufferArrayStride`,108),t(`maxInterStageShaderVariables`,112),t(`maxColorAttachments`,116),t(`maxColorAttachmentBytesPerSample`,120),t(`maxComputeWorkgroupStorageSize`,124),t(`maxComputeInvocationsPerWorkgroup`,128),t(`maxComputeWorkgroupSizeX`,132),t(`maxComputeWorkgroupSizeY`,136),t(`maxComputeWorkgroupSizeZ`,140),t(`maxComputeWorkgroupsPerDimension`,144),t(`maxImmediateSize`,148,!0),e.requiredLimits=u}(s=(S(),E)[a+24>>>2>>>0])&&(s={label:wr(s+4)},e.defaultQueue=s),e.label=wr(a+4)}xe+=1,br(t,o.requestDevice(e).then(e=>{--xe,Xt(()=>{gr[i>>>0]=e.queue,gr[r>>>0]=e,xe+=1,br(n,e.lost.then(t=>{Xt(()=>{e.onuncapturederror=()=>{};var r=I(),i=pr(t.message);Gi(n,Mr[t.reason],i),F(r)}),--xe})),e.onuncapturederror=e=>{var t=5;e.error instanceof GPUValidationError?t=2:e.error instanceof GPUOutOfMemoryError?t=3:e.error instanceof GPUInternalError&&(t=4);var n=I();e=pr(e.error.message),Xi(r,t,e),F(n)},`adapterInfo`in e||(e.adapterInfo=o.info),Yi(t,1,r,0)})},e=>{--xe,Xt(()=>{var i=I(),a=pr(e.message);Yi(t,3,r,a),n&&Gi(n,4,a),F(i)})}))}function Pr(e){var t=A(e>>>=0),n=vr[e];if(n){for(var r=0;r>>=0;var r=A(e>>>=0);n==4294967295&&(n=void 0);try{var i=r.getMappedRange(t>>>0,n)}catch{return 0}var a=ia(16,i.byteLength);return(S(),w).set(new Uint8Array(i),a>>>0),vr[e].push(()=>ji(a)),a}function Ir(e,t,n){n>>>=0;var r=A(e>>>=0);n==4294967295&&(n=void 0);try{var i=r.getMappedRange(t>>>0,n)}catch{return 0}var a=ia(16,i.byteLength);return(S(),w).fill(0,a,i.byteLength),vr[e].push(()=>{new Uint8Array(i).set((S(),w).subarray(a>>>0,a+i.byteLength>>>0)),ji(a)}),a}function Lr(e,t,n,r,i){e>>>=0,t=Le(t),n=Le(n),i>>>=0;var a=A(e);vr[e]=[],i==4294967295&&(i=void 0),xe+=1,br(t,a.mapAsync(n,r>>>0,i).then(()=>{--xe,Xt(()=>{Ki(t,1,0)})},n=>{--xe,Xt(()=>{I();var r=pr(n.message);Ki(t,n.name===`AbortError`?4:n.name===`OperationError`?3:0,r),delete vr[e]})}))}function Rr(e){var t=A(e>>>=0),n=vr[e];if(n){for(var r=0;r>>0]}function Br(e,t,n){e>>>=0,t>>>=0,n>>>=0;var r=!!(S(),E)[t+32>>>2>>>0];t={label:wr(t+4),usage:(S(),E)[t+16>>>2>>>0],size:hr(t+24),mappedAtCreation:r},e=A(e);try{var i=e.createBuffer(t)}catch{return!1}return gr[n>>>0]=i,r&&(vr[n]=[]),!0}function Vr(e,t,n,r){e>>>=0,t=Le(t),r>>>=0,n=Tr(n>>>0),e=A(e),xe+=1,br(t,e.createComputePipelineAsync(n).then(e=>{--xe,Xt(()=>{gr[r>>>0]=e,Wi(t,1,r,0)})},e=>{--xe,Xt(()=>{var n=I(),i=pr(e.message);Wi(t,e.reason===`validation`?3:e.reason===`internal`?4:0,r,i),F(n)})}))}function Hr(e,t,n){e>>>=0,t>>>=0,n>>>=0;var r=(S(),E)[t>>>2>>>0],i=(S(),T)[r+4>>>2>>>0];t={label:wr(t+4),code:``},i===2&&(t.code=Cr(r+8)),e=A(e).createShaderModule(t),gr[n>>>0]=e}var Ur=e=>{(e=A(e)).onuncapturederror=null,e.destroy()};function Wr(e,t){t=Le(t),e=A(e>>>0),xe+=1,br(t,e.popErrorScope().then(e=>{--xe,Xt(()=>{var n=5;e?e instanceof GPUValidationError?n=2:e instanceof GPUOutOfMemoryError?n=3:e instanceof GPUInternalError&&(n=4):n=1;var r=I(),i=e?pr(e.message):0;qi(t,1,n,i),F(r)})},e=>{--xe,Xt(()=>{var n=I(),r=pr(e.message);qi(t,1,5,r),F(n)})}))}function j(e,t,n,r){if(t=Le(t),r>>>=0,n>>>=0){var i={featureLevel:Or[(S(),T)[n+4>>>2>>>0]],powerPreference:Ar[(S(),T)[n+8>>>2>>>0]],forceFallbackAdapter:!!(S(),E)[n+12>>>2>>>0]};(e=(S(),E)[n>>>2>>>0])!==0&&(S(),i.De=!!(S(),E)[e+8>>>2>>>0])}`gpu`in navigator?(xe+=1,br(t,navigator.gpu.requestAdapter(i).then(e=>{--xe,Xt(()=>{if(e)gr[r>>>0]=e,Ji(t,1,r,0);else{var n=I(),i=pr(`WebGPU not available on this browser (requestAdapter returned null)`);Ji(t,3,r,i),F(n)}})},e=>{--xe,Xt(()=>{var n=I(),i=pr(e.message);Ji(t,4,r,i),F(n)})}))):(i=I(),e=pr(`WebGPU not available on this browser (navigator.gpu is not available)`),Ji(t,3,r,e),F(i))}function Gr(e,t,n){return e>>>=0,t>>>=0,n>>>=0,yn(async()=>{var r=[];if(n){var i=(S(),T)[n>>>2>>>0];r.length=t+1,r[t]=new Promise(e=>setTimeout(e,i,0))}else r.length=t;for(var a=0;a{if(!Kr){var e,t={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(globalThis.navigator?.language??`C`).replace(`-`,`_`)+`.UTF-8`,_:`./this.program`};for(e in qr)qr[e]===void 0?delete t[e]:t[e]=qr[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);Kr=n}return Kr};function Yr(e,t){if(i)return D(19,1,e,t);e>>>=0,t>>>=0;var n,r=0,a=0;for(n of Jr()){var o=t+r;(S(),E)[e+a>>>2>>>0]=o,r+=Lt(n,o,1/0)+1,a+=4}return 0}function Xr(e,t){if(i)return D(20,1,e,t);e>>>=0,t>>>=0;var n=Jr();for(var r of((S(),E)[e>>>2>>>0]=n.length,e=0,n))e+=Rt(r)+1;return(S(),E)[t>>>2>>>0]=e,0}function Zr(e){return i?D(21,1,e):52}function Qr(e,t,n,r){return i?D(22,1,e,t,n,r):52}function M(e,t,n,r){return i?D(23,1,e,t,n,r):70}var $r=[null,[],[]];function ei(e,t,n,r){if(i)return D(24,1,e,t,n,r);t>>>=0,n>>>=0,r>>>=0;for(var a=0,o=0;o>>2>>>0],c=(S(),E)[t+4>>>2>>>0];t+=8;for(var l=0;l>>0],f=$r[u];d===0||d===10?((u===1?y:b)(nt(f)),f.length=0):f.push(d)}a+=c}return(S(),E)[r>>>2>>>0]=a,0}function ti(e){return e>>>0}function ni(e,t){return Er(A(e>>>0).limits,t>>>0),1}function ri(e,t){return A(e>>>0).features.has(kr[t])}function ii(e){return BigInt(A(e>>>0).size)}function ai(e){return BigInt(A(e>>>0).usage)}function oi(e,t){if(e>>>=0,t>>>=0){var n=wr(t+4);n={label:n,timestampWrites:t=(t=(S(),E)[t+12>>>2>>>0])===0?void 0:{querySet:A((S(),E)[t+4>>>2>>>0]),beginningOfPassWriteIndex:(S(),E)[t+8>>>2>>>0],endOfPassWriteIndex:(S(),E)[t+12>>>2>>>0]}}}return t=A(e),e=zi(0),n=t.beginComputePass(n),gr[e>>>0]=n,e}function si(e,t,n,r){n=Le(n),(r=Le(r))==-1&&(r=void 0),(e=A(e>>>0)).clearBuffer(A(t>>>0),n,r)}function ci(e,t,n,r,i,a){n=Le(n),i=Le(i),a=Le(a),A(e>>>0).copyBufferToBuffer(A(t>>>0),n,A(r>>>0),i,a)}function li(e){var t=A(e>>>0);return e=Li(0),t=t.finish(),gr[e>>>0]=t,e}function ui(e,t,n,r,i,a){a=Le(a),A(e>>>0).resolveQuerySet(A(t>>>0),n,r,A(i>>>0),a)}function N(e,t,n,r){A(e>>>0).dispatchWorkgroups(t,n,r)}function di(e,t,n){n=Le(n),A(e>>>0).dispatchWorkgroupsIndirect(A(t>>>0),n)}function fi(e){A(e>>>0).end()}function pi(e,t,n,r,i){r>>>=0,i>>>=0,e=A(e>>>0),n=A(n>>>0),r==0?e.setBindGroup(t,n):e.setBindGroup(t,n,(S(),E),i>>>2,r)}function mi(e,t){A(e>>>0).setPipeline(A(t>>>0))}function hi(e,t,n){A(e>>>0).Ce(A(t>>>0),n)}function gi(e,t){var n=A(e>>>0);return e=Ii(0),t=n.getBindGroupLayout(t),gr[e>>>0]=t,e}function _i(e,t){function n(e){var t=(S(),E)[e+8>>>2>>>0],n=(S(),E)[e+32>>>2>>>0],r=(S(),E)[e+36>>>2>>>0],i=0;return xr(e,{327681:e=>{i=(S(),E)[e+8>>>2>>>0]}}),t?((n=hr(e+24))==-1&&(n=void 0),t={buffer:A(t),offset:hr(e+16),size:n}):t=A(n||r||i),{binding:(S(),E)[e+4>>>2>>>0],resource:t}}e>>>=0,t={label:wr(4+(t>>>=0)),layout:A((S(),E)[t+12>>>2>>>0]),entries:function(e,t){for(var r=[],i=0;i>>2>>>0],(S(),E)[t+20>>>2>>>0])},e=A(e);var r=Fi(0);return _r(r,e.createBindGroup(t)),r}function vi(e,t){var n;return e>>>=0,(t>>>=0)&&(n={label:wr(t+4)}),t=A(e),e=Ri(0),n=t.createCommandEncoder(n),gr[e>>>0]=n,e}function yi(e,t){e>>>=0,t>>>=0,t={type:jr[(S(),T)[t+12>>>2>>>0]],count:(S(),E)[t+16>>>2>>>0]};var n=A(e);return e=Bi(0),t=n.createQuerySet(t),gr[e>>>0]=t,e}function bi(e,t){e=A(e>>>0).adapterInfo,t>>>=0,(S(),E)[t+52>>>2>>>0]=e.subgroupMinSize,(S(),E)[t+56>>>2>>>0]=e.subgroupMaxSize;var n=e.vendor+e.architecture+e.device+e.description,r=Rt(n)+1,i=Mi(r);return i&&Lt(n,i,r),n=i,r=Rt(e.vendor),Sr(t+4,n,r),n+=r,r=Rt(e.architecture),Sr(t+12,n,r),n+=r,r=Rt(e.device),Sr(t+20,n,r),Sr(t+28,n+r,Rt(e.description)),(S(),T)[t+36>>>2>>>0]=2,e=e.isFallbackAdapter?3:4,(S(),T)[t+40>>>2>>>0]=e,(S(),E)[t+44>>>2>>>0]=0,(S(),E)[t+48>>>2>>>0]=0,1}var xi={"core-features-and-limits":1,"depth-clip-control":2,"depth32float-stencil8":3,"texture-compression-bc":4,"texture-compression-bc-sliced-3d":5,"texture-compression-etc2":6,"texture-compression-astc":7,"texture-compression-astc-sliced-3d":8,"timestamp-query":9,"indirect-first-instance":10,"shader-f16":11,"rg11b10ufloat-renderable":12,"bgra8unorm-storage":13,"float32-filterable":14,"float32-blendable":15,"clip-distances":16,"dual-source-blending":17,subgroups:18,"texture-formats-tier1":19,"texture-formats-tier2":20,"primitive-index":21,"texture-component-swizzle":22,"chromium-experimental-unorm16-texture-formats":327692,"chromium-experimental-multi-draw-indirect":327729};function Si(e,t){t>>>=0;var n=A(e>>>0);e=Mi(4*n.features.size);var r=0,i=0;for(let t of n.features)0<=(n=xi[t])&&((S(),T)[e+r>>>2>>>0]=n,r+=4,i++);(S(),E)[t+4>>>2>>>0]=e,(S(),E)[t>>>2>>>0]=i}function Ci(e,t){return Er(A(e>>>0).limits,t>>>0),1}function wi(e,t){A(e>>>0).pushErrorScope(Dr[t])}function Ti(e,t,n){t>>>=0,n>>>=0,e=A(e>>>0),t=Array.from((S(),T).subarray(n>>>2>>>0,n+4*t>>>2>>>0),e=>A(e)),e.submit(t)}function Ei(e,t,n,r,i){n=Le(n),r>>>=0,i>>>=0,e=A(e>>>0),t=A(t>>>0),r=(S(),w).subarray(r>>>0,r+i>>>0),e.writeBuffer(t,n,r,0,i)}i||function(){for(var e=t.numThreads-1;e--;)Me();_e.push(async()=>{var e=async function(){if(!i)return Promise.all(Te.map(je))}();ve++,await e,--ve==0&&ye&&(e=ye,ye=null,e())})}(),i||(Ne=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),ue()),t.wasmBinary&&(d=t.wasmBinary),t.stackSave=()=>I(),t.stackRestore=e=>F(e),t.stackAlloc=e=>sa(e),t.setValue=function(e,t,n=`i8`){switch(n.endsWith(`*`)&&(n=`*`),n){case`i1`:case`i8`:(S(),C)[e>>>0]=t;break;case`i16`:(S(),ne)[e>>>1>>>0]=t;break;case`i32`:(S(),T)[e>>>2>>>0]=t;break;case`i64`:(S(),oe)[e>>>3>>>0]=BigInt(t);break;case`float`:(S(),ie)[e>>>2>>>0]=t;break;case`double`:(S(),ae)[e>>>3>>>0]=t;break;case`*`:(S(),E)[e>>>2>>>0]=t;break;default:fe(`invalid type for setValue: ${n}`)}},t.getValue=function(e,t=`i8`){switch(t.endsWith(`*`)&&(t=`*`),t){case`i1`:case`i8`:return(S(),C)[e>>>0];case`i16`:return(S(),ne)[e>>>1>>>0];case`i32`:return(S(),T)[e>>>2>>>0];case`i64`:return(S(),oe)[e>>>3>>>0];case`float`:return(S(),ie)[e>>>2>>>0];case`double`:return(S(),ae)[e>>>3>>>0];case`*`:return(S(),E)[e>>>2>>>0];default:fe(`invalid type for getValue: ${t}`)}},t.UTF8ToString=rt,t.stringToUTF8=Lt,t.lengthBytesUTF8=Rt;var Di,Oi,ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,P,aa,oa,F,sa,I,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,L,Ha,Ua,Wa,Ga,Ka,qa,Ja,Ya,Xa,Za,Qa=[Se,Ce,Ze,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,O,qn,Jn,Zn,Yr,Xr,Zr,Qr,M,ei],$a={970348:(e,n,r,i,a)=>{if(t===void 0||!t.Uc)return 1;if((e=rt(Number(e>>>0))).startsWith(`./`)&&(e=e.substring(2)),!(e=t.Uc.get(e)))return 2;if(n=Number(n>>>0),r=Number(r>>>0),i=Number(i>>>0),n+r>e.byteLength)return 3;try{let o=e.subarray(n,n+r);switch(a){case 0:(S(),w).set(o,i>>>0);break;case 1:t.ad?t.ad(i,o):t.ne(i,o);break;default:return 4}return 0}catch{return 4}},971172:(e,n,r)=>{t.Sd(e,(S(),w).subarray(n>>>0,n+r>>>0))},971236:()=>t.le(),971278:e=>{t.jd(e)},971315:()=>typeof wasmOffsetConverter<`u`};function eo(e,t,n,r){var i=I();try{return xa(e,t,n,r)}catch(e){if(F(i),e!==e+0)throw e;P(1,0)}}function to(e,t,n){var r=I();try{return va(e,t,n)}catch(e){if(F(r),e!==e+0)throw e;P(1,0)}}function no(e){var t=I();try{ma(e)}catch(e){if(F(t),e!==e+0)throw e;P(1,0)}}function ro(e,t){var n=I();try{return pa(e,t)}catch(e){if(F(n),e!==e+0)throw e;P(1,0)}}function io(e,t,n){var r=I();try{fa(e,t,n)}catch(e){if(F(r),e!==e+0)throw e;P(1,0)}}function ao(e,t){var n=I();try{Sa(e,t)}catch(e){if(F(n),e!==e+0)throw e;P(1,0)}}function oo(e,t,n,r,i,a,o){var s=I();try{return _a(e,t,n,r,i,a,o)}catch(e){if(F(s),e!==e+0)throw e;P(1,0)}}function so(e,t,n,r,i,a){var o=I();try{ha(e,t,n,r,i,a)}catch(e){if(F(o),e!==e+0)throw e;P(1,0)}}function co(e,t,n,r){var i=I();try{ba(e,t,n,r)}catch(e){if(F(i),e!==e+0)throw e;P(1,0)}}function lo(e,t,n,r,i,a,o){var s=I();try{wa(e,t,n,r,i,a,o)}catch(e){if(F(s),e!==e+0)throw e;P(1,0)}}function uo(e,t,n,r,i,a,o){var s=I();try{Ta(e,t,n,r,i,a,o)}catch(e){if(F(s),e!==e+0)throw e;P(1,0)}}function fo(e,t,n,r,i,a,o,s){var c=I();try{Pa(e,t,n,r,i,a,o,s)}catch(e){if(F(c),e!==e+0)throw e;P(1,0)}}function po(e,t,n,r,i,a,o,s,c,l,u,d){var f=I();try{Ea(e,t,n,r,i,a,o,s,c,l,u,d)}catch(e){if(F(f),e!==e+0)throw e;P(1,0)}}function mo(e,t,n,r,i){var a=I();try{return Ca(e,t,n,r,i)}catch(e){if(F(a),e!==e+0)throw e;P(1,0)}}function ho(e,t,n,r,i){var a=I();try{ga(e,t,n,r,i)}catch(e){if(F(a),e!==e+0)throw e;P(1,0)}}function go(e,t,n,r,i,a,o,s){var c=I();try{ya(e,t,n,r,i,a,o,s)}catch(e){if(F(c),e!==e+0)throw e;P(1,0)}}function _o(e){var t=I();try{return Fa(e)}catch(e){if(F(t),e!==e+0)throw e;P(1,0)}}function vo(e,t,n){var r=I();try{return Ia(e,t,n)}catch(e){if(F(r),e!==e+0)throw e;P(1,0)}}function yo(e,t){var n=I();try{return Ka(e,t)}catch(e){if(F(n),e!==e+0)throw e;return P(1,0),0n}}function bo(e){var t=I();try{return Da(e)}catch(e){if(F(t),e!==e+0)throw e;return P(1,0),0n}}function xo(e,t,n,r){var i=I();try{return La(e,t,n,r)}catch(e){if(F(i),e!==e+0)throw e;P(1,0)}}function So(e,t,n,r,i){var a=I();try{return Ra(e,t,n,r,i)}catch(e){if(F(a),e!==e+0)throw e;P(1,0)}}function Co(e,t,n,r,i,a){var o=I();try{return za(e,t,n,r,i,a)}catch(e){if(F(o),e!==e+0)throw e;P(1,0)}}function wo(e,t,n,r,i,a){var o=I();try{return Ma(e,t,n,r,i,a)}catch(e){if(F(o),e!==e+0)throw e;P(1,0)}}function To(e,t,n,r,i,a){var o=I();try{return Ba(e,t,n,r,i,a)}catch(e){if(F(o),e!==e+0)throw e;P(1,0)}}function Eo(e,t,n,r,i,a,o,s){var c=I();try{return Na(e,t,n,r,i,a,o,s)}catch(e){if(F(c),e!==e+0)throw e;P(1,0)}}function Do(e,t,n,r,i){var a=I();try{return Va(e,t,n,r,i)}catch(e){if(F(a),e!==e+0)throw e;return P(1,0),0n}}function Oo(e,t,n,r){var i=I();try{return L(e,t,n,r)}catch(e){if(F(i),e!==e+0)throw e;P(1,0)}}function ko(e,t,n,r){var i=I();try{return Ha(e,t,n,r)}catch(e){if(F(i),e!==e+0)throw e;P(1,0)}}function Ao(e,t,n,r,i,a,o,s,c,l,u,d){var f=I();try{return Ua(e,t,n,r,i,a,o,s,c,l,u,d)}catch(e){if(F(f),e!==e+0)throw e;P(1,0)}}function jo(e,t,n,r,i,a,o,s,c,l,u){var d=I();try{Wa(e,t,n,r,i,a,o,s,c,l,u)}catch(e){if(F(d),e!==e+0)throw e;P(1,0)}}function Mo(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g=I();try{Ga(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}catch(e){if(F(g),e!==e+0)throw e;P(1,0)}}function No(e,t,n){var r=I();try{return ka(e,t,n)}catch(e){if(F(r),e!==e+0)throw e;return P(1,0),0n}}function Po(e,t,n){var r=I();try{return Oa(e,t,n)}catch(e){if(F(r),e!==e+0)throw e;P(1,0)}}function Fo(e,t,n){var r=I();try{return Aa(e,t,n)}catch(e){if(F(r),e!==e+0)throw e;P(1,0)}}function Io(e,t,n,r){var i=I();try{ja(e,t,n,r)}catch(e){if(F(i),e!==e+0)throw e;P(1,0)}}function Lo(){if(0{let n=new WeakMap,r,i,a=1;t.webgpuRegisterDevice=e=>{if(i!==void 0)throw Error(`another WebGPU EP inference session is being created.`);if(e){var t=n.get(e);if(!t){let r=((e,t=0)=>{var n=Ui(t);return t=Hi(t,n),gr[n>>>0]=e.queue,gr[t>>>0]=e,t})(e,t=Pi(0));t=[a++,t,r],n.set(e,t)}return r=e,i=t[0],t}r=void 0,i=0};let o=new Map;t.webgpuOnCreateSession=t=>{if(i!==void 0){var n=i;if(i=void 0,t){let i=ki(n);o.set(t,i),n===0&&e(r??A(i))}r=void 0}},t.webgpuOnReleaseSession=e=>{o.delete(e)};let s=Symbol(`gpuBufferMetadata`);t.webgpuRegisterBuffer=(e,t,n)=>{if(n)return e[s]=[n,NaN],n;if(n=e[s])return n[1]++,n[0];if((t=o.get(t))===void 0)throw Error(`Invalid session handle passed to webgpuRegisterBuffer`);return t=((e,t=0)=>(e.mapState===`unmapped`||fe(),t=Vi(t),gr[t>>>0]=e,t))(e,t),e[s]=[t,1],t},t.webgpuUnregisterBuffer=e=>{let t=e[s];if(!t)throw Error(`Buffer is not registered`);t[1]--,t[1]===0&&(Ni(t[0]),delete e[s])},t.webgpuGetBuffer=e=>A(e),t.webgpuCreateDownloader=(e,t,n)=>{if((n=o.get(n))===void 0)throw Error(`Invalid session handle passed to webgpuRegisterBuffer`);let r=A(n),i=16*Math.ceil(Number(t)/16);return async()=>{let n=r.createBuffer({size:i,usage:9});try{let a=r.createCommandEncoder();return a.copyBufferToBuffer(e,0,n,0,i),r.queue.submit([a.finish()]),await n.mapAsync(GPUMapMode.READ),n.getMappedRange().slice(0,t)}finally{n.destroy()}}},t.ad=(e,t)=>{var n=t.buffer;let a=t.byteOffset,o=t.byteLength;if(t=16*Math.ceil(Number(o)/16),e=A(e),!r){var s=ki(i);r=A(s)}let c=(s=r.createBuffer({mappedAtCreation:!0,size:t,usage:6})).getMappedRange();new Uint8Array(c).set(new Uint8Array(n,a,o)),s.unmap(),(n=r.createCommandEncoder()).copyBufferToBuffer(s,0,e,0,t),r.queue.submit([n.finish()]),s.destroy()}},t.webnnInit=e=>{let n=e[0];[t.le,t.jd,t.webnnEnsureTensor,t.Sd,t.webnnDownloadTensor,t.ke,t.webnnEnableTraceEvent]=e.slice(1),t.webnnReleaseTensorId=t.jd,t.webnnUploadTensor=t.Sd,t.webnnRegisterMLContext=t.ke,t.webnnOnRunStart=e=>n.onRunStart(e),t.webnnOnRunEnd=n.onRunEnd.bind(n),t.webnnOnReleaseSession=e=>{n.onReleaseSession(e)},t.webnnCreateMLTensorDownloader=(e,t)=>n.createMLTensorDownloader(e,t),t.webnnRegisterMLTensor=(e,t,r,i)=>n.registerMLTensor(e,t,r,i),t.webnnCreateMLContext=e=>n.createMLContext(e),t.webnnRegisterMLConstant=(e,r,i,a,o,s)=>n.registerMLConstant(e,r,i,a,o,t.Uc,s),t.webnnRegisterGraphInput=n.registerGraphInput.bind(n),t.webnnIsGraphInput=n.isGraphInput.bind(n),t.webnnRegisterGraphOutput=n.registerGraphOutput.bind(n),t.webnnIsGraphOutput=n.isGraphOutput.bind(n),t.webnnCreateTemporaryTensor=n.createTemporaryTensor.bind(n),t.webnnIsGraphInputOutputTypeSupported=n.isGraphInputOutputTypeSupported.bind(n)},le?t:new Promise((e,t)=>{m=e,h=t})}var We,Ge,Ke=s(()=>{"use strict";We=Ue,Ge=globalThis.self?.name?.startsWith(`em-pthread`),Ge&&Ue()}),qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,st=s(()=>{"use strict";Ie(),qe=typeof location>`u`?void 0:location.origin,Je=self.location.href>`file:`&&self.location.href<`file;`,Ye=()=>Je?new URL(new URL(`ort.webgpu.bundle.min.mjs`,self.location.href).href,qe).href:self.location.href,Xe=Ye(),Ze=()=>{if(Xe&&!Xe.startsWith(`blob:`))return Xe.substring(0,Xe.lastIndexOf(`/`)+1)},Qe=(e,t)=>{try{let n=t??Xe;return(n?new URL(e,n):new URL(e)).origin===qe}catch{return!1}},$e=(e,t)=>{let n=t??Xe;try{return(n?new URL(e,n):new URL(e)).href}catch{return}},et=(e,t)=>`${t??`./`}${e}`,tt=async e=>{let t=await(await fetch(e,{credentials:`same-origin`})).blob();return URL.createObjectURL(t)},nt=async e=>(await import(e)).default,rt=(Ve(),u(Le)).default,it=async()=>{if(!Xe)throw Error(`Failed to load proxy worker: cannot determine the script source URL.`);if(Qe(Xe))return[void 0,rt()];let e=await tt(Xe);return[e,rt(e)]},at=(Ke(),u(He)).default,ot=async(e,t,n,r)=>{let i=at&&!(e||t);if(i)if(Xe)i=Qe(Xe)||r&&!n;else if(r&&!n)i=!0;else throw Error(`cannot determine the script source URL.`);if(i)return[void 0,at];{let r=`ort-wasm-simd-threaded.asyncify.mjs`,i=e??$e(r,t),a=n&&i&&!Qe(i,t),o=a?await tt(i):i??et(r,t);return[a?o:void 0,await nt(o)]}}}),ct,lt,ut,dt,ft,pt,mt,ht,O,gt=s(()=>{"use strict";st(),lt=!1,ut=!1,dt=!1,ft=()=>{if(typeof SharedArrayBuffer>`u`)return!1;try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch{return!1}},pt=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}},mt=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},ht=async e=>{if(lt)return Promise.resolve();if(ut)throw Error(`multiple calls to 'initializeWebAssembly()' detected.`);if(dt)throw Error(`previous call to 'initializeWebAssembly()' failed.`);ut=!0;let t=e.initTimeout,n=e.numThreads;if(e.simd!==!1){if(e.simd===`relaxed`){if(!mt())throw Error(`Relaxed WebAssembly SIMD is not supported in the current environment.`)}else if(!pt())throw Error(`WebAssembly SIMD is not supported in the current environment.`)}let r=ft();n>1&&!r&&(typeof self<`u`&&!self.crossOriginIsolated&&console.warn(`env.wasm.numThreads is set to `+n+`, but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info.`),console.warn(`WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading.`),e.numThreads=n=1);let i=e.wasmPaths,a=typeof i==`string`?i:void 0,o=i?.mjs,s=o?.href??o,c=i?.wasm,l=c?.href??c,u=e.wasmBinary,[d,f]=await ot(s,a,n>1,!!u||!!l),p=!1,m=[];if(t>0&&m.push(new Promise(e=>{setTimeout(()=>{p=!0,e()},t)})),m.push(new Promise((e,t)=>{let r={numThreads:n};if(u)r.wasmBinary=u,r.locateFile=e=>e;else if(l||a)r.locateFile=e=>l??a+e;else if(s&&s.indexOf(`blob:`)!==0)r.locateFile=e=>new URL(e,s).href;else if(d){let e=Ze();e&&(r.locateFile=t=>e+t)}f(r).then(t=>{ut=!1,lt=!0,ct=t,e(),d&&URL.revokeObjectURL(d)},e=>{ut=!1,dt=!0,t(e)})})),await Promise.race(m),p)throw Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},O=()=>{if(lt&&ct)return ct;throw Error(`WebAssembly is not initialized yet.`)}}),_t,vt,k,yt=s(()=>{"use strict";gt(),_t=(e,t)=>{let n=O(),r=n.lengthBytesUTF8(e)+1,i=n._malloc(r);return n.stringToUTF8(e,i,r),t.push(i),i},vt=(e,t,n,r)=>{if(typeof e==`object`&&e){if(n.has(e))throw Error(`Circular reference in options`);n.add(e)}Object.entries(e).forEach(([e,i])=>{let a=t?t+e:e;if(typeof i==`object`)vt(i,a+`.`,n,r);else if(typeof i==`string`||typeof i==`number`)r(a,i.toString());else if(typeof i==`boolean`)r(a,i?`1`:`0`);else throw Error(`Can't handle extra config type: ${typeof i}`)})},k=e=>{let t=O(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetLastError(r,r+n);let i=Number(t.getValue(r,n===4?`i32`:`i64`)),a=t.getValue(r+n,`*`),o=a?t.UTF8ToString(a):``;throw Error(`${e} ERROR_CODE: ${i}, ERROR_MESSAGE: ${o}`)}finally{t.stackRestore(n)}}}),bt,xt=s(()=>{"use strict";gt(),yt(),bt=e=>{let t=O(),n=0,r=[],i=e||{};try{if(e?.logSeverityLevel===void 0)i.logSeverityLevel=2;else if(typeof e.logSeverityLevel!=`number`||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw Error(`log severity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)i.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!=`number`||!Number.isInteger(e.logVerbosityLevel))throw Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&(i.terminate=!1);let a=0;return e?.tag!==void 0&&(a=_t(e.tag,r)),n=t._OrtCreateRunOptions(i.logSeverityLevel,i.logVerbosityLevel,!!i.terminate,a),n===0&&k(`Can't create run options.`),e?.extra!==void 0&&vt(e.extra,``,new WeakSet,(e,i)=>{let a=_t(e,r),o=_t(i,r);t._OrtAddRunConfigEntry(n,a,o)!==0&&k(`Can't set a run config entry: ${e} - ${i}.`)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseRunOptions(n),r.forEach(e=>t._free(e)),e}}}),St,Ct,wt,Tt,Et,Dt,Ot,kt=s(()=>{"use strict";gt(),yt(),St=e=>{switch(e){case`disabled`:return 0;case`basic`:return 1;case`extended`:return 2;case`layout`:return 3;case`all`:return 99;default:throw Error(`unsupported graph optimization level: ${e}`)}},Ct=e=>{switch(e){case`sequential`:return 0;case`parallel`:return 1;default:throw Error(`unsupported execution mode: ${e}`)}},wt=e=>{e.extra||={},e.extra.session||(e.extra.session={});let t=e.extra.session;t.use_ort_model_bytes_directly||=`1`,e.executionProviders&&e.executionProviders.some(e=>(typeof e==`string`?e:e.name)===`webgpu`)&&(e.enableMemPattern=!1)},Tt=(e,t,n,r)=>{let i=_t(t,r),a=_t(n,r);O()._OrtAddSessionConfigEntry(e,i,a)!==0&&k(`Can't set a session config entry: ${t} - ${n}.`)},Et=(e,t,n,r)=>{let i=_t(t,r),a=_t(n,r);e.push([i,a])},Dt=async(e,t,n)=>{let r=t.executionProviders;for(let i of r){let r=typeof i==`string`?i:i.name,a=[];switch(r){case`webnn`:if(r=`WEBNN`,typeof i!=`string`){let t=i?.deviceType;t&&Tt(e,`deviceType`,t,n)}break;case`webgpu`:{r=`WebGPU`;let e;if(typeof i!=`string`){let r=i;if(r.device)if(typeof GPUDevice<`u`&&r.device instanceof GPUDevice)e=r.device;else throw Error(`Invalid GPU device set in WebGPU EP options.`);let{enableGraphCapture:o}=t;if(typeof o==`boolean`&&o&&Et(a,`enableGraphCapture`,`1`,n),typeof r.preferredLayout==`string`&&Et(a,`preferredLayout`,r.preferredLayout,n),r.forceCpuNodeNames){let e=Array.isArray(r.forceCpuNodeNames)?r.forceCpuNodeNames:[r.forceCpuNodeNames];Et(a,`forceCpuNodeNames`,e.join(` +`),n)}r.validationMode&&Et(a,`validationMode`,r.validationMode,n)}let o=O().webgpuRegisterDevice(e);if(o){let[e,t,r]=o;Et(a,`deviceId`,e.toString(),n),Et(a,`webgpuInstance`,t.toString(),n),Et(a,`webgpuDevice`,r.toString(),n)}}break;case`wasm`:case`cpu`:continue;default:throw Error(`not supported execution provider: ${r}`)}let o=_t(r,n),s=a.length,c=0,l=0;if(s>0){c=O()._malloc(s*O().PTR_SIZE),n.push(c),l=O()._malloc(s*O().PTR_SIZE),n.push(l);for(let e=0;e{let t=O(),n=0,r=[],i=e||{};wt(i);try{let e=St(i.graphOptimizationLevel??`all`),a=Ct(i.executionMode??`sequential`),o=typeof i.logId==`string`?_t(i.logId,r):0,s=i.logSeverityLevel??2;if(!Number.isInteger(s)||s<0||s>4)throw Error(`log severity level is not valid: ${s}`);let c=i.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw Error(`log verbosity level is not valid: ${c}`);let l=typeof i.optimizedModelFilePath==`string`?_t(i.optimizedModelFilePath,r):0;if(n=t._OrtCreateSessionOptions(e,!!i.enableCpuMemArena,!!i.enableMemPattern,a,!!i.enableProfiling,0,o,s,c,l),n===0&&k(`Can't create session options.`),i.executionProviders&&await Dt(n,i,r),i.enableGraphCapture!==void 0){if(typeof i.enableGraphCapture!=`boolean`)throw Error(`enableGraphCapture must be a boolean value: ${i.enableGraphCapture}`);Tt(n,`enableGraphCapture`,i.enableGraphCapture.toString(),r)}if(i.freeDimensionOverrides)for(let[e,a]of Object.entries(i.freeDimensionOverrides)){if(typeof e!=`string`)throw Error(`free dimension override name must be a string: ${e}`);if(typeof a!=`number`||!Number.isInteger(a)||a<0)throw Error(`free dimension override value must be a non-negative integer: ${a}`);let i=_t(e,r);t._OrtAddFreeDimensionOverride(n,i,a)!==0&&k(`Can't set a free dimension override: ${e} - ${a}.`)}return i.extra!==void 0&&vt(i.extra,``,new WeakSet,(e,t)=>{Tt(n,e,t,r)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseSessionOptions(n)!==0&&k(`Can't release session options.`),r.forEach(e=>t._free(e)),e}}}),At,jt,Mt,Nt,Pt,Ft,It,Lt,Rt=s(()=>{"use strict";At=e=>{switch(e){case`int8`:return 3;case`uint8`:return 2;case`bool`:return 9;case`int16`:return 5;case`uint16`:return 4;case`int32`:return 6;case`uint32`:return 12;case`float16`:return 10;case`float32`:return 1;case`float64`:return 11;case`string`:return 8;case`int64`:return 7;case`uint64`:return 13;case`int4`:return 22;case`uint4`:return 21;default:throw Error(`unsupported data type: ${e}`)}},jt=e=>{switch(e){case 3:return`int8`;case 2:return`uint8`;case 9:return`bool`;case 5:return`int16`;case 4:return`uint16`;case 6:return`int32`;case 12:return`uint32`;case 10:return`float16`;case 1:return`float32`;case 11:return`float64`;case 8:return`string`;case 7:return`int64`;case 13:return`uint64`;case 22:return`int4`;case 21:return`uint4`;default:throw Error(`unsupported data type: ${e}`)}},Mt=(e,t)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],r=typeof t==`number`?t:t.reduce((e,t)=>e*t,1);return n>0?Math.ceil(r*n):void 0},Nt=e=>{switch(e){case`float16`:return typeof Float16Array<`u`&&Float16Array.from?Float16Array:Uint16Array;case`float32`:return Float32Array;case`uint8`:return Uint8Array;case`int8`:return Int8Array;case`uint16`:return Uint16Array;case`int16`:return Int16Array;case`int32`:return Int32Array;case`bool`:return Uint8Array;case`float64`:return Float64Array;case`uint32`:return Uint32Array;case`int64`:return BigInt64Array;case`uint64`:return BigUint64Array;default:throw Error(`unsupported type: ${e}`)}},Pt=e=>{switch(e){case`verbose`:return 0;case`info`:return 1;case`warning`:return 2;case`error`:return 3;case`fatal`:return 4;default:throw Error(`unsupported logging level: ${e}`)}},Ft=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,It=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint64`||e===`int8`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,Lt=e=>{switch(e){case`none`:return 0;case`cpu`:return 1;case`cpu-pinned`:return 2;case`texture`:return 3;case`gpu-buffer`:return 4;case`ml-tensor`:return 5;default:throw Error(`unsupported data location: ${e}`)}}}),zt,Bt=s(()=>{"use strict";Ie(),zt=async e=>{if(typeof e==`string`){let t=await fetch(e);if(!t.ok)throw Error(`failed to load external data file: ${e}`);let n=t.headers.get(`Content-Length`),r=n?parseInt(n,10):0;if(r<1073741824)return new Uint8Array(await t.arrayBuffer());{if(!t.body)throw Error(`failed to load external data file: ${e}, no response body.`);let n=t.body.getReader(),i;try{i=new ArrayBuffer(r)}catch(e){if(e instanceof RangeError){let e=Math.ceil(r/65536);i=new WebAssembly.Memory({initial:e,maximum:e}).buffer}else throw e}let a=0;for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=t.byteLength;new Uint8Array(i,a,r).set(t),a+=r}return new Uint8Array(i,0,r)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),Vt,Ht=s(()=>{"use strict";Rt(),Vt=(e,t)=>new(Nt(t))(e)}),Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt=s(()=>{"use strict";Rt(),Ut=[`V`,`I`,`W`,`E`,`F`],Wt=(e,t)=>{console.log(`[${Ut[e]},${new Date().toISOString()}]${t}`)},qt=(e,t)=>{Gt=e,Kt=t},Jt=(e,t)=>{let n=Pt(e);n>=Pt(Gt)&&Wt(n,typeof t==`function`?t():t)},Yt=(...e)=>{Kt&&Jt(...e)}}),Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln=s(()=>{"use strict";Rt(),Xt(),Zt=new Map([[`float32`,32],[`float16`,16],[`int32`,32],[`uint32`,32],[`int64`,64],[`uint64`,64],[`int8`,8],[`uint8`,8],[`int4`,4],[`uint4`,4]]),Qt=(e,t)=>{if(t===`int32`)return e;let n=Zt.get(t);if(!n)throw Error(`WebNN backend does not support data type: ${t}`);let r=n/8;if(e.byteLength%r!==0)throw Error(`Invalid Uint8Array length - must be a multiple of ${r}.`);let i=e.byteLength/r,a=new(Nt(t))(e.buffer,e.byteOffset,i);switch(t){case`int64`:case`uint64`:{let e=new Int32Array(i);for(let t=0;t2147483647n||n<-2147483648n)throw Error(`Can not convert int64 data to int32 - value out of range.`);e[t]=Number(n)}return new Uint8Array(e.buffer)}case`int8`:case`uint8`:case`uint32`:{if(t===`uint32`&&a.some(e=>e>2147483647))throw Error(`Can not convert uint32 data to int32 - value out of range.`);let e=Int32Array.from(a,Number);return new Uint8Array(e.buffer)}default:throw Error(`Unsupported data conversion from ${t} to 'int32'`)}},$t=(e,t)=>{if(t===`int32`)return e;if(e.byteLength%4!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 4 (int32).`);let n=e.byteLength/4,r=new Int32Array(e.buffer,e.byteOffset,n);switch(t){case`int64`:{let e=BigInt64Array.from(r,BigInt);return new Uint8Array(e.buffer)}case`uint64`:{if(r.some(e=>e<0))throw Error(`Can not convert int32 data to uin64 - negative value found.`);let e=BigUint64Array.from(r,BigInt);return new Uint8Array(e.buffer)}case`int8`:{if(r.some(e=>e<-128||e>127))throw Error(`Can not convert int32 data to int8 - value out of range.`);let e=Int8Array.from(r,Number);return new Uint8Array(e.buffer)}case`uint8`:if(r.some(e=>e<0||e>255))throw Error(`Can not convert int32 data to uint8 - value out of range.`);return Uint8Array.from(r,Number);case`uint32`:{if(r.some(e=>e<0))throw Error(`Can not convert int32 data to uint32 - negative value found.`);let e=Uint32Array.from(r,Number);return new Uint8Array(e.buffer)}default:throw Error(`Unsupported data conversion from 'int32' to ${t}`)}},en=1,tn=()=>en++,nn=new Map([[`int8`,`int32`],[`uint8`,`int32`],[`uint32`,`int32`],[`int64`,`int32`]]),rn=(e,t)=>{let n=Zt.get(e);if(!n)throw Error(`WebNN backend does not support data type: ${e}`);return t.length>0?Math.ceil(t.reduce((e,t)=>e*t)*n/8):0},an=class{constructor(e){this.isDataConverted=!1;let{sessionId:t,context:n,tensor:r,dataType:i,shape:a,fallbackDataType:o}=e;this.sessionId=t,this.mlContext=n,this.mlTensor=r,this.dataType=i,this.tensorShape=a,this.fallbackDataType=o}get tensor(){return this.mlTensor}get type(){return this.dataType}get fallbackType(){return this.fallbackDataType}get shape(){return this.tensorShape}get byteLength(){return rn(this.dataType,this.tensorShape)}destroy(){Yt(`verbose`,()=>`[WebNN] TensorWrapper.destroy`),this.mlTensor.destroy()}write(e){this.mlContext.writeTensor(this.mlTensor,e)}async read(e){if(this.fallbackDataType){let t=await this.mlContext.readTensor(this.mlTensor),n=$t(new Uint8Array(t),this.dataType);if(e){(e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).set(n);return}else return n.buffer}else return e?this.mlContext.readTensor(this.mlTensor,e):this.mlContext.readTensor(this.mlTensor)}canReuseTensor(e,t,n){return this.mlContext===e&&this.dataType===t&&this.tensorShape.length===n.length&&this.tensorShape.every((e,t)=>e===n[t])}setIsDataConverted(e){this.isDataConverted=e}},on=class{constructor(e,t){this.tensorManager=e,this.wrapper=t}get tensorWrapper(){return this.wrapper}releaseTensor(){this.tensorWrapper&&(this.tensorManager.releaseTensor(this.tensorWrapper),this.wrapper=void 0)}async ensureTensor(e,t,n,r){let i=this.tensorManager.getMLContext(e),a=this.tensorManager.getMLOpSupportLimits(e),o;if(!a?.input.dataTypes.includes(t)){if(o=nn.get(t),!o||a?.input.dataTypes.includes(o))throw Error(`WebNN backend does not support data type: ${t}`);Yt(`verbose`,()=>`[WebNN] TensorIdTracker.ensureTensor: fallback dataType from ${t} to ${o}`)}if(this.wrapper){if(this.wrapper.canReuseTensor(i,t,n))return this.wrapper.tensor;if(r){if(this.wrapper.byteLength!==rn(t,n))throw Error(`Unable to copy data to tensor with different size.`);this.activeUpload=new Uint8Array(await this.wrapper.read())}this.tensorManager.releaseTensor(this.wrapper)}let s=typeof MLTensorUsage>`u`?void 0:MLTensorUsage.READ|MLTensorUsage.WRITE;return this.wrapper=await this.tensorManager.getCachedTensor(e,t,n,s,!0,!0,o),r&&this.activeUpload&&(this.wrapper.write(this.activeUpload),this.activeUpload=void 0),this.wrapper.tensor}upload(e){let t=e;if(this.wrapper){if(this.wrapper.fallbackType)if(this.wrapper.fallbackType===`int32`)t=Qt(e,this.wrapper.type),this.wrapper.setIsDataConverted(!0);else throw Error(`Unsupported fallback data type: ${this.wrapper.fallbackType}`);if(e.byteLength===this.wrapper.byteLength){this.wrapper.write(t);return}else Yt(`verbose`,()=>`Data size does not match tensor size. Releasing tensor.`),this.releaseTensor()}this.activeUpload?this.activeUpload.set(t):this.activeUpload=new Uint8Array(t)}async download(e){if(this.activeUpload){let t=this.wrapper?.isDataConverted?$t(this.activeUpload,this.wrapper?.type):this.activeUpload;if(e){e instanceof ArrayBuffer?new Uint8Array(e).set(t):new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(t);return}else return t.buffer}if(!this.wrapper)throw Error(`Tensor has not been created.`);return e?this.wrapper.read(e):this.wrapper.read()}},sn=class{constructor(e){this.backend=e,this.tensorTrackersById=new Map,this.freeTensors=[],this.externalTensors=new Set}getMLContext(e){let t=this.backend.getMLContext(e);if(!t)throw Error(`MLContext not found for session.`);return t}getMLOpSupportLimits(e){return this.backend.getMLOpSupportLimits(e)}reserveTensorId(){let e=tn();return this.tensorTrackersById.set(e,new on(this)),e}releaseTensorId(e){let t=this.tensorTrackersById.get(e);t&&(this.tensorTrackersById.delete(e),t.tensorWrapper&&this.releaseTensor(t.tensorWrapper))}async ensureTensor(e,t,n,r,i){Yt(`verbose`,()=>`[WebNN] TensorManager.ensureTensor {tensorId: ${t}, dataType: ${n}, shape: ${r}, copyOld: ${i}}`);let a=this.tensorTrackersById.get(t);if(!a)throw Error(`Tensor not found.`);return a.ensureTensor(e,n,r,i)}upload(e,t){let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);n.upload(t)}async download(e,t){Yt(`verbose`,()=>`[WebNN] TensorManager.download {tensorId: ${e}, dstBuffer: ${t?.byteLength}}`);let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);return n.download(t)}releaseTensorsForSession(e){for(let t of this.freeTensors)t.sessionId===e&&t.destroy();this.freeTensors=this.freeTensors.filter(t=>t.sessionId!==e)}registerTensor(e,t,n,r){let i=this.getMLContext(e),a=tn(),o=new an({sessionId:e,context:i,tensor:t,dataType:n,shape:r});return this.tensorTrackersById.set(a,new on(this,o)),this.externalTensors.add(o),a}async getCachedTensor(e,t,n,r,i,a,o){let s=this.getMLContext(e);for(let[r,i]of this.freeTensors.entries())if(i.canReuseTensor(s,t,n)){Yt(`verbose`,()=>`[WebNN] Reusing tensor {dataType: ${t}, ${o?`fallbackDataType: ${o},`:``} shape: ${n}`);let i=this.freeTensors.splice(r,1)[0];return i.sessionId=e,i}Yt(`verbose`,()=>`[WebNN] MLContext.createTensor {dataType: ${t}, ${o?`fallbackDataType: ${o},`:``} shape: ${n}}`);let c=await s.createTensor({dataType:o??t,shape:n,dimensions:n,usage:r,writable:i,readable:a});return new an({sessionId:e,context:s,tensor:c,dataType:t,shape:n,fallbackDataType:o})}releaseTensor(e){this.externalTensors.has(e)&&this.externalTensors.delete(e),this.freeTensors.push(e)}},cn=(...e)=>new sn(...e)}),un={};c(un,{WebNNBackend:()=>pn});var dn,fn,pn,mn=s(()=>{"use strict";Rt(),gt(),Ht(),ln(),Xt(),dn=new Map([[1,`float32`],[10,`float16`],[6,`int32`],[12,`uint32`],[7,`int64`],[13,`uint64`],[22,`int4`],[21,`uint4`],[3,`int8`],[2,`uint8`],[9,`uint8`]]),fn=(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((n,i)=>n===r[i]&&e[n]===t[n])},pn=class{constructor(e){this.tensorManager=cn(this),this.mlContextBySessionId=new Map,this.sessionIdsByMLContext=new Map,this.mlContextCache=[],this.sessionGraphInputs=new Map,this.sessionGraphOutputs=new Map,this.temporaryGraphInputs=[],this.temporaryGraphOutputs=[],this.temporarySessionTensorIds=new Map,this.mlOpSupportLimitsBySessionId=new Map,qt(e.logLevel,!!e.debug)}get currentSessionId(){if(this.activeSessionId===void 0)throw Error(`No active session`);return this.activeSessionId}onRunStart(e){Yt(`verbose`,()=>`[WebNN] onRunStart {sessionId: ${e}}`),this.activeSessionId=e}onRunEnd(e){Yt(`verbose`,()=>`[WebNN] onRunEnd {sessionId: ${e}}`);let t=this.temporarySessionTensorIds.get(e);if(t){for(let e of t)Yt(`verbose`,()=>`[WebNN] releasing temporary tensor {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e);this.temporarySessionTensorIds.delete(e),this.activeSessionId=void 0}}async createMLContext(e){if(e instanceof GPUDevice){let t=this.mlContextCache.findIndex(t=>t.gpuDevice===e);if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({gpuDevice:e,mlContext:t}),t}}else if(e===void 0){let e=this.mlContextCache.findIndex(e=>e.options===void 0&&e.gpuDevice===void 0);if(e!==-1)return this.mlContextCache[e].mlContext;{let e=await navigator.ml.createContext();return this.mlContextCache.push({mlContext:e}),e}}let t=this.mlContextCache.findIndex(t=>fn(t.options,e));if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({options:e,mlContext:t}),t}}registerMLContext(e,t){this.mlContextBySessionId.set(e,t);let n=this.sessionIdsByMLContext.get(t);n||(n=new Set,this.sessionIdsByMLContext.set(t,n)),n.add(e),this.mlOpSupportLimitsBySessionId.has(e)||this.mlOpSupportLimitsBySessionId.set(e,t.opSupportLimits()),this.temporaryGraphInputs.length>0&&(this.sessionGraphInputs.set(e,this.temporaryGraphInputs),this.temporaryGraphInputs=[]),this.temporaryGraphOutputs.length>0&&(this.sessionGraphOutputs.set(e,this.temporaryGraphOutputs),this.temporaryGraphOutputs=[])}onReleaseSession(e){this.sessionGraphInputs.delete(e),this.sessionGraphOutputs.delete(e);let t=this.mlContextBySessionId.get(e);if(!t)return;this.tensorManager.releaseTensorsForSession(e),this.mlContextBySessionId.delete(e),this.mlOpSupportLimitsBySessionId.delete(e);let n=this.sessionIdsByMLContext.get(t);if(n.delete(e),n.size===0){this.sessionIdsByMLContext.delete(t);let e=this.mlContextCache.findIndex(e=>e.mlContext===t);e!==-1&&this.mlContextCache.splice(e,1)}}getMLContext(e){return this.mlContextBySessionId.get(e)}getMLOpSupportLimits(e){return this.mlOpSupportLimitsBySessionId.get(e)}reserveTensorId(){return this.tensorManager.reserveTensorId()}releaseTensorId(e){Yt(`verbose`,()=>`[WebNN] releaseTensorId {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e)}async ensureTensor(e,t,n,r,i){let a=dn.get(n);if(!a)throw Error(`Unsupported ONNX data type: ${n}`);return this.tensorManager.ensureTensor(e??this.currentSessionId,t,a,r,i)}async createTemporaryTensor(e,t,n){Yt(`verbose`,()=>`[WebNN] createTemporaryTensor {onnxDataType: ${t}, shape: ${n}}`);let r=dn.get(t);if(!r)throw Error(`Unsupported ONNX data type: ${t}`);let i=this.tensorManager.reserveTensorId();await this.tensorManager.ensureTensor(e,i,r,n,!1);let a=this.temporarySessionTensorIds.get(e);return a?a.push(i):this.temporarySessionTensorIds.set(e,[i]),i}uploadTensor(e,t){if(!O().shouldTransferToMLTensor)throw Error(`Trying to upload to a MLTensor while shouldTransferToMLTensor is false`);Yt(`verbose`,()=>`[WebNN] uploadTensor {tensorId: ${e}, data: ${t.byteLength}}`),this.tensorManager.upload(e,t)}async downloadTensor(e,t){return this.tensorManager.download(e,t)}createMLTensorDownloader(e,t){return async()=>{let n=await this.tensorManager.download(e);return Vt(n,t)}}registerMLTensor(e,t,n,r){let i=dn.get(n);if(!i)throw Error(`Unsupported ONNX data type: ${n}`);let a=this.tensorManager.registerTensor(e,t,i,r);return Yt(`verbose`,()=>`[WebNN] registerMLTensor {tensor: ${t}, dataType: ${i}, dimensions: ${r}} -> {tensorId: ${a}}`),a}registerMLConstant(e,t,n,r,i,a,o=!1){if(!a)throw Error(`External mounted files are not available.`);let s=e;e.startsWith(`./`)&&(s=e.substring(2));let c=a.get(s);if(!c)throw Error(`File with name ${s} not found in preloaded files.`);if(t+n>c.byteLength)throw Error(`Out of bounds: data offset and length exceed the external file data size.`);let l=c.slice(t,t+n).buffer,u;switch(i.dataType){case`float32`:u=new Float32Array(l);break;case`float16`:u=typeof Float16Array<`u`&&Float16Array.from?new Float16Array(l):new Uint16Array(l);break;case`int32`:u=new Int32Array(l);break;case`uint32`:u=new Uint32Array(l);break;case`int64`:if(o){let e=Qt(new Uint8Array(l),`int64`);u=new Int32Array(e.buffer),i.dataType=`int32`}else u=new BigInt64Array(l);break;case`uint64`:u=new BigUint64Array(l);break;case`int8`:u=new Int8Array(l);break;case`int4`:case`uint4`:case`uint8`:u=new Uint8Array(l);break;default:throw Error(`Unsupported data type: ${i.dataType} in creating WebNN Constant from external data.`)}return Yt(`verbose`,()=>`[WebNN] registerMLConstant {dataType: ${i.dataType}, shape: ${i.shape}}} ${o?`(Note: it was int64 data type and registered to int32 as workaround)`:``}`),r.constant(i,u)}registerGraphInput(e){this.temporaryGraphInputs.push(e)}registerGraphOutput(e){this.temporaryGraphOutputs.push(e)}isGraphInput(e,t){let n=this.sessionGraphInputs.get(e);return n?n.includes(t):!1}isGraphOutput(e,t){let n=this.sessionGraphOutputs.get(e);return n?n.includes(t):!1}isGraphInputOutputTypeSupported(e,t,n=!0){let r=dn.get(At(t)),i=this.mlOpSupportLimitsBySessionId.get(e);return typeof r>`u`?!1:n?!!i?.input.dataTypes.includes(r):!!i?.output.dataTypes.includes(r)}flush(){}}}),hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On=s(()=>{"use strict";Fe(),xt(),kt(),Rt(),gt(),yt(),Bt(),hn=(e,t)=>{O()._OrtInit(e,t)!==0&&k(`Can't initialize onnxruntime.`)},gn=async e=>{hn(e.wasm.numThreads,Pt(e.logLevel))},_n=async(e,t)=>{O().asyncInit?.();let n=e.webgpu.adapter;if(t===`webgpu`){if(typeof navigator>`u`||!navigator.gpu)throw Error(`WebGPU is not supported in current environment`);if(n){if(typeof n.limits!=`object`||typeof n.features!=`object`||typeof n.requestDevice!=`function`)throw Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let t=e.webgpu.powerPreference;if(t!==void 0&&t!==`low-power`&&t!==`high-performance`)throw Error(`Invalid powerPreference setting: "${t}"`);let r=e.webgpu.forceFallbackAdapter;if(r!==void 0&&typeof r!=`boolean`)throw Error(`Invalid forceFallbackAdapter setting: "${r}"`);if(n=await navigator.gpu.requestAdapter({powerPreference:t,forceFallbackAdapter:r}),!n)throw Error(`Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.`)}}if(t===`webnn`&&(typeof navigator>`u`||!navigator.ml))throw Error(`WebNN is not supported in current environment`);if(t===`webgpu`&&O().webgpuInit(t=>{e.webgpu.device=t}),t===`webnn`){let t=new(mn(),u(un)).WebNNBackend(e);O().webnnInit([t,()=>t.reserveTensorId(),e=>t.releaseTensorId(e),async(e,n,r,i,a)=>t.ensureTensor(e,n,r,i,a),(e,n)=>{t.uploadTensor(e,n)},async(e,n)=>t.downloadTensor(e,n),(e,n)=>t.registerMLContext(e,n),!!e.trace])}},vn=new Map,yn=e=>{let t=O(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetInputOutputCount(e,r,r+n)!==0&&k(`Can't get session input/output count.`);let i=n===4?`i32`:`i64`;return[Number(t.getValue(r,i)),Number(t.getValue(r+n,i))]}finally{t.stackRestore(n)}},bn=(e,t)=>{let n=O(),r=n.stackSave(),i=0;try{let r=n.PTR_SIZE,a=n.stackAlloc(2*r);n._OrtGetInputOutputMetadata(e,t,a,a+r)!==0&&k(`Can't get session input/output metadata.`);let o=Number(n.getValue(a,`*`));i=Number(n.getValue(a+r,`*`));let s=n.HEAP32[i/4];if(s===0)return[o,0];let c=n.HEAPU32[i/4+1],l=[];for(let e=0;e{let t=O(),n=t._malloc(e.byteLength);if(n===0)throw Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return t.HEAPU8.set(e,n),[n,e.byteLength]},Sn=async(e,t)=>{let n,r,i=O();Array.isArray(e)?[n,r]=e:e.buffer===i.HEAPU8.buffer?[n,r]=[e.byteOffset,e.byteLength]:[n,r]=xn(e);let a=0,o=0,s=0,c=[],l=[],u=[];try{if([o,c]=await Ot(t),t?.externalData&&i.mountExternalData){let e=[];for(let n of t.externalData){let t=typeof n==`string`?n:n.path;e.push(zt(typeof n==`string`?n:n.data).then(e=>{i.mountExternalData(t,e)}))}await Promise.all(e)}for(let e of t?.executionProviders??[])if((typeof e==`string`?e:e.name)===`webnn`){if(i.shouldTransferToMLTensor=!1,typeof e!=`string`){let t=e,n=t?.context,r=t?.gpuDevice,a=t?.deviceType,o=t?.powerPreference;n?i.currentContext=n:r?i.currentContext=await i.webnnCreateMLContext(r):i.currentContext=await i.webnnCreateMLContext({deviceType:a,powerPreference:o})}else i.currentContext=await i.webnnCreateMLContext();break}a=await i._OrtCreateSession(n,r,o),i.webgpuOnCreateSession?.(a),a===0&&k(`Can't create a session.`),i.jsepOnCreateSession?.(),i.currentContext&&(i.webnnRegisterMLContext(a,i.currentContext),i.currentContext=void 0,i.shouldTransferToMLTensor=!0);let[e,d]=yn(a),f=!!t?.enableGraphCapture,p=[],m=[],h=[],g=[],_=[];for(let t=0;te===`gpu-buffer`||e===`ml-tensor`||e===`ml-tensor-cpu-output`)&&(s=i._OrtCreateBinding(a),s===0&&k(`Can't create IO binding.`),v={handle:s,outputPreferredLocations:_,outputPreferredLocationsEncoded:_.map(e=>e===`ml-tensor-cpu-output`?`ml-tensor`:e).map(e=>Lt(e))}),vn.set(a,[a,l,u,v,f,!1]),[a,p,m,h,g]}catch(e){throw l.forEach(e=>i._OrtFree(e)),u.forEach(e=>i._OrtFree(e)),s!==0&&i._OrtReleaseBinding(s)!==0&&k(`Can't release IO binding.`),a!==0&&i._OrtReleaseSession(a)!==0&&k(`Can't release session.`),e}finally{i._free(n),o!==0&&i._OrtReleaseSessionOptions(o)!==0&&k(`Can't release session options.`),c.forEach(e=>i._free(e)),i.unmountExternalData?.()}},Cn=e=>{let t=O(),n=vn.get(e);if(!n)throw Error(`cannot release session. invalid session id: ${e}`);let[r,i,a,o,s]=n;o&&(s&&t._OrtClearBoundOutputs(o.handle)!==0&&k(`Can't clear bound outputs.`),t._OrtReleaseBinding(o.handle)!==0&&k(`Can't release IO binding.`)),t.jsepOnReleaseSession?.(e),t.webnnOnReleaseSession?.(e),t.webgpuOnReleaseSession?.(e),i.forEach(e=>t._OrtFree(e)),a.forEach(e=>t._OrtFree(e)),t._OrtReleaseSession(r)!==0&&k(`Can't release session.`),vn.delete(e)},wn=async(e,t,n,r,i,a,o=!1)=>{if(!e){t.push(0);return}let s=O(),c=s.PTR_SIZE,l=e[0],u=e[1],d=e[3],f=d,p,m;if(l===`string`&&(d===`gpu-buffer`||d===`ml-tensor`))throw Error(`String tensor is not supported on GPU.`);if(o&&d!==`gpu-buffer`)throw Error(`External buffer must be provided for input/output index ${a} when enableGraphCapture is true.`);if(d===`gpu-buffer`){let t=e[2].gpuBuffer;m=Mt(At(l),u);{let e=s.webgpuRegisterBuffer;if(!e)throw Error(`Tensor location "gpu-buffer" is not supported without using WebGPU.`);p=e(t,r)}}else if(d===`ml-tensor`){let t=e[2].mlTensor;m=Mt(At(l),u);let n=s.webnnRegisterMLTensor;if(!n)throw Error(`Tensor location "ml-tensor" is not supported without using WebNN.`);p=n(r,t,At(l),u)}else{let t=e[2];if(Array.isArray(t)){m=c*t.length,p=s._malloc(m),n.push(p);for(let e=0;es.setValue(g+t*c,e,c===4?`i32`:`i64`));let e=s._OrtCreateTensor(At(l),p,m,g,u.length,Lt(f));e===0&&k(`Can't create tensor for input/output. session=${r}, index=${a}.`),t.push(e)}finally{s.stackRestore(h)}},Tn=async(e,t,n,r,i,a)=>{let o=O(),s=o.PTR_SIZE,c=vn.get(e);if(!c)throw Error(`cannot run inference. invalid session id: ${e}`);let l=c[0],u=c[1],d=c[2],f=c[3],p=c[4],m=c[5],h=t.length,g=r.length,_=0,v=[],y=[],b=[],x=[],ee=[],S=o.stackSave(),te=o.stackAlloc(h*s),C=o.stackAlloc(h*s),w=o.stackAlloc(g*s),ne=o.stackAlloc(g*s);try{[_,v]=bt(a),Ce(`wasm prepareInputOutputTensor`);for(let r=0;re*t,1);u=jt(a);let _=f?.outputPreferredLocations[r[t]];if(u===`string`){if(_===`gpu-buffer`||_===`ml-tensor`)throw Error(`String tensor is not supported on GPU.`);let e=[];for(let t=0;t0){let t=o.webgpuGetBuffer;if(!t)throw Error(`preferredLocation "gpu-buffer" is not supported without using WebGPU.`);let r=t(d),i=Mt(a,g);if(i===void 0||!Ft(u))throw Error(`Unsupported data type: ${u}`);l=!0;{o.webgpuRegisterBuffer(r,e,d);let t=o.webgpuCreateDownloader(r,i,e);S.push([u,h,{gpuBuffer:r,download:async()=>{let e=await t();return new(Nt(u))(e)},dispose:()=>{o._OrtReleaseTensor(n)!==0&&k(`Can't release tensor.`)}},`gpu-buffer`])}}else if(_===`ml-tensor`&&g>0){let t=o.webnnEnsureTensor,r=o.webnnIsGraphInputOutputTypeSupported;if(!t||!r)throw Error(`preferredLocation "ml-tensor" is not supported without using WebNN.`);if(Mt(a,g)===void 0||!It(u))throw Error(`Unsupported data type: ${u}`);if(!r(e,u,!1))throw Error(`preferredLocation "ml-tensor" for ${u} output is not supported by current WebNN Context.`);let i=await t(e,d,a,h,!1);l=!0,S.push([u,h,{mlTensor:i,download:o.webnnCreateMLTensorDownloader(d,u),dispose:()=>{o.webnnReleaseTensorId(d),o._OrtReleaseTensor(n)}},`ml-tensor`])}else if(_===`ml-tensor-cpu-output`&&g>0){let e=o.webnnCreateMLTensorDownloader(d,u)(),t=S.length;l=!0,re.push((async()=>{let r=[t,await e];return o.webnnReleaseTensorId(d),o._OrtReleaseTensor(n),r})()),S.push([u,h,[],`cpu`])}else{let e=new(Nt(u))(g);new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(o.HEAPU8.subarray(d,d+e.byteLength)),S.push([u,h,e,`cpu`])}}finally{o.stackRestore(a),u===`string`&&d&&o._free(d),l||o._OrtReleaseTensor(n)}}f&&!p&&(o._OrtClearBoundOutputs(f.handle)!==0&&k(`Can't clear bound outputs.`),vn.set(e,[l,u,d,f,p,!1]));for(let[e,t]of await Promise.all(re))S[e][2]=t;return we(`wasm ProcessOutputTensor`),S}finally{o.webnnOnRunEnd?.(l),o.stackRestore(S),n.forEach(e=>{e&&e[3]===`gpu-buffer`&&o.webgpuUnregisterBuffer(e[2].gpuBuffer)}),i.forEach(e=>{e&&e[3]===`gpu-buffer`&&o.webgpuUnregisterBuffer(e[2].gpuBuffer)}),y.forEach(e=>o._OrtReleaseTensor(e)),b.forEach(e=>o._OrtReleaseTensor(e)),x.forEach(e=>o._free(e)),_!==0&&o._OrtReleaseRunOptions(_),v.forEach(e=>o._free(e))}},En=e=>{let t=O(),n=vn.get(e);if(!n)throw Error(`invalid session id`);let r=n[0],i=t._OrtEndProfiling(r);i===0&&k(`Can't get an profile file name.`),t._OrtFree(i)},Dn=e=>{let t=[];for(let n of e){let e=n[2];!Array.isArray(e)&&`buffer`in e&&t.push(e.buffer)}return t}}),kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn=s(()=>{"use strict";Fe(),On(),gt(),st(),kn=()=>!!S.wasm.proxy&&typeof document<`u`,jn=!1,Mn=!1,Nn=!1,In=new Map,Ln=(e,t)=>{let n=In.get(e);n?n.push(t):In.set(e,[t])},Rn=()=>{if(jn||!Mn||Nn||!An)throw Error(`worker not ready`)},zn=e=>{switch(e.data.type){case`init-wasm`:jn=!1,e.data.err?(Nn=!0,Fn[1](e.data.err)):(Mn=!0,Fn[0]()),Pn&&=(URL.revokeObjectURL(Pn),void 0);break;case`init-ep`:case`copy-from`:case`create`:case`release`:case`run`:case`end-profiling`:{let t=In.get(e.data.type);e.data.err?t.shift()[1](e.data.err):t.shift()[0](e.data.out);break}default:}},Bn=async()=>{if(!Mn){if(jn)throw Error(`multiple calls to 'initWasm()' detected.`);if(Nn)throw Error(`previous call to 'initWasm()' failed.`);if(jn=!0,kn())return new Promise((e,t)=>{An?.terminate(),it().then(([n,r])=>{try{An=r,An.onerror=e=>t(e),An.onmessage=zn,Fn=[e,t];let i={type:`init-wasm`,in:S};!i.in.wasm.wasmPaths&&(n||Je)&&(i.in.wasm.wasmPaths={wasm:new URL(`/demo/assets/ort-wasm-simd-threaded.asyncify-DMmc6YqF.wasm`,``+self.location.href).href}),An.postMessage(i),Pn=n}catch(e){t(e)}},t)});try{await ht(S.wasm),await gn(S),Mn=!0}catch(e){throw Nn=!0,e}finally{jn=!1}}},Vn=async e=>{if(kn())return Rn(),new Promise((t,n)=>{Ln(`init-ep`,[t,n]);let r={type:`init-ep`,in:{epName:e,env:S}};An.postMessage(r)});await _n(S,e)},Hn=async e=>kn()?(Rn(),new Promise((t,n)=>{Ln(`copy-from`,[t,n]);let r={type:`copy-from`,in:{buffer:e}};An.postMessage(r,[e.buffer])})):xn(e),Un=async(e,t)=>{if(kn()){if(t?.preferredOutputLocation)throw Error(`session option "preferredOutputLocation" is not supported for proxy.`);return Rn(),new Promise((n,r)=>{Ln(`create`,[n,r]);let i={type:`create`,in:{model:e,options:{...t}}},a=[];e instanceof Uint8Array&&a.push(e.buffer),An.postMessage(i,a)})}else return Sn(e,t)},Wn=async e=>{if(kn())return Rn(),new Promise((t,n)=>{Ln(`release`,[t,n]);let r={type:`release`,in:e};An.postMessage(r)});Cn(e)},Gn=async(e,t,n,r,i,a)=>{if(kn()){if(n.some(e=>e[3]!==`cpu`))throw Error(`input tensor on GPU is not supported for proxy.`);if(i.some(e=>e))throw Error(`pre-allocated output tensor is not supported for proxy.`);return Rn(),new Promise((i,o)=>{Ln(`run`,[i,o]);let s=n,c={type:`run`,in:{sessionId:e,inputIndices:t,inputs:s,outputIndices:r,options:a}};An.postMessage(c,Dn(s))})}else return Tn(e,t,n,r,i,a)},Kn=async e=>{if(kn())return Rn(),new Promise((t,n)=>{Ln(`end-profiling`,[t,n]);let r={type:`end-profiling`,in:e};An.postMessage(r)});En(e)}}),Jn,Yn,Xn,Zn=s(()=>{"use strict";Fe(),qn(),Rt(),Ie(),Bt(),Jn=(e,t)=>{switch(e.location){case`cpu`:return[e.type,e.dims,e.data,`cpu`];case`gpu-buffer`:return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},`gpu-buffer`];case`ml-tensor`:return[e.type,e.dims,{mlTensor:e.mlTensor},`ml-tensor`];default:throw Error(`invalid data location: ${e.location} for ${t()}`)}},Yn=e=>{switch(e[3]){case`cpu`:return new ve(e[0],e[2],e[1]);case`gpu-buffer`:{let t=e[0];if(!Ft(t))throw Error(`not supported data type: ${t} for deserializing GPU tensor`);let{gpuBuffer:n,download:r,dispose:i}=e[2];return ve.fromGpuBuffer(n,{dataType:t,dims:e[1],download:r,dispose:i})}case`ml-tensor`:{let t=e[0];if(!It(t))throw Error(`not supported data type: ${t} for deserializing MLTensor tensor`);let{mlTensor:n,download:r,dispose:i}=e[2];return ve.fromMLTensor(n,{dataType:t,dims:e[1],download:r,dispose:i})}default:throw Error(`invalid data location: ${e[3]}`)}},Xn=class{async fetchModelAndCopyToWasmMemory(e){return Hn(await zt(e))}async loadModel(e,t){D();let n;n=typeof e==`string`?await this.fetchModelAndCopyToWasmMemory(e):e,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await Un(n,t),Se()}async dispose(){return Wn(this.sessionId)}async run(e,t,n){D();let r=[],i=[];Object.entries(e).forEach(e=>{let t=e[0],n=e[1],a=this.inputNames.indexOf(t);if(a===-1)throw Error(`invalid input '${t}'`);r.push(n),i.push(a)});let a=[],o=[];Object.entries(t).forEach(e=>{let t=e[0],n=e[1],r=this.outputNames.indexOf(t);if(r===-1)throw Error(`invalid output '${t}'`);a.push(n),o.push(r)});let s=r.map((e,t)=>Jn(e,()=>`input "${this.inputNames[i[t]]}"`)),c=a.map((e,t)=>e?Jn(e,()=>`output "${this.outputNames[o[t]]}"`):null),l=await Gn(this.sessionId,i,s,o,c,n),u={};for(let e=0;eer,initializeFlags:()=>$n,wasmBackend:()=>tr});var $n,er,tr,nr=s(()=>{"use strict";Fe(),qn(),Zn(),$n=()=>{(typeof S.wasm.initTimeout!=`number`||S.wasm.initTimeout<0)&&(S.wasm.initTimeout=0);let e=S.wasm.simd;if(typeof e!=`boolean`&&e!==void 0&&e!==`fixed`&&e!==`relaxed`&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${e}". Reset it to \`false\` and ignore SIMD feature checking.`),S.wasm.simd=!1),typeof S.wasm.proxy!=`boolean`&&(S.wasm.proxy=!1),typeof S.wasm.trace!=`boolean`&&(S.wasm.trace=!1),typeof S.wasm.numThreads!=`number`||!Number.isInteger(S.wasm.numThreads)||S.wasm.numThreads<=0)if(typeof self<`u`&&!self.crossOriginIsolated)S.wasm.numThreads=1;else{let e=typeof navigator>`u`?o(`node:os`).cpus().length:navigator.hardwareConcurrency;S.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},er=class{async init(e){$n(),await Bn(),await Vn(e)}async createInferenceSessionHandler(e,t){let n=new Xn;return await n.loadModel(e,t),n}},tr=new er});Fe(),Fe(),Fe();var rr=`1.26.0-dev.20260416-b7804b056c`,ir=Pe;{let e=(nr(),u(Qn)).wasmBackend;p(`webgpu`,e,5),p(`webnn`,e,5),p(`cpu`,e,10),p(`wasm`,e,10)}Object.defineProperty(S.versions,"web",{value:rr,enumerable:!0});let ar=`warning`;Object.defineProperty({wasm:{},webgl:{},webgpu:{},versions:{common:`1.24.3`},set logLevel(e){if(e!==void 0){if(typeof e!=`string`||[`verbose`,`info`,`warning`,`error`,`fatal`].indexOf(e)===-1)throw Error(`Unsupported logging level: ${e}`);ar=e}},get logLevel(){return ar}},"logLevel",{enumerable:!0});let or=(e,t)=>{let n=typeof document<`u`?document.createElement(`canvas`):new OffscreenCanvas(1,1);n.width=e.dims[3],n.height=e.dims[2];let r=n.getContext(`2d`);if(r!=null){let i,a;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[3]):(i=e.dims[3],a=e.dims[2]);let o=t?.format===void 0?`RGB`:t.format,s=t?.norm,c,l;s===void 0||s.mean===void 0?c=[255,255,255,255]:typeof s.mean==`number`?c=[s.mean,s.mean,s.mean,s.mean]:(c=[s.mean[0],s.mean[1],s.mean[2],0],s.mean[3]!==void 0&&(c[3]=s.mean[3])),s===void 0||s.bias===void 0?l=[0,0,0,0]:typeof s.bias==`number`?l=[s.bias,s.bias,s.bias,s.bias]:(l=[s.bias[0],s.bias[1],s.bias[2],0],s.bias[3]!==void 0&&(l[3]=s.bias[3]));let u=a*i,d=0,f=u,p=u*2,m=-1;o===`RGBA`?(d=0,f=u,p=u*2,m=u*3):o===`RGB`?(d=0,f=u,p=u*2):o===`RBG`&&(d=0,p=u,f=u*2);for(let t=0;t{let n=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):new OffscreenCanvas(1,1).getContext(`2d`),r;if(n!=null){let i,a,o;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[1],o=e.dims[3]):(i=e.dims[3],a=e.dims[2],o=e.dims[1]);let s=t===void 0||t.format===void 0?`RGB`:t.format,c=t?.norm,l,u;c===void 0||c.mean===void 0?l=[255,255,255,255]:typeof c.mean==`number`?l=[c.mean,c.mean,c.mean,c.mean]:(l=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(l[3]=c.mean[3])),c===void 0||c.bias===void 0?u=[0,0,0,0]:typeof c.bias==`number`?u=[c.bias,c.bias,c.bias,c.bias]:(u=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(u[3]=c.bias[3]));let d=a*i;if(t!==void 0&&(t.format!==void 0&&o===4&&t.format!==`RGBA`||o===3&&t.format!==`RGB`&&t.format!==`BGR`))throw Error(`Tensor format doesn't match input tensor dims`);let f=0,p=1,m=2,h=3,g=0,_=d,v=d*2,y=-1;s===`RGBA`?(g=0,_=d,v=d*2,y=d*3):s===`RGB`?(g=0,_=d,v=d*2):s===`RBG`&&(g=0,v=d,_=d*2),r=n.createImageData(i,a);for(let t=0;t{if(e===void 0)throw Error(`Image buffer must be defined`);if(t.height===void 0||t.width===void 0)throw Error(`Image height and width must be defined`);if(t.tensorLayout===`NHWC`)throw Error(`NHWC Tensor layout is not supported yet`);let{height:n,width:r}=t,i=t.norm??{mean:255,bias:0},a,o;a=typeof i.mean==`number`?[i.mean,i.mean,i.mean,i.mean]:[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],o=typeof i.bias==`number`?[i.bias,i.bias,i.bias,i.bias]:[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let s=t.format===void 0?`RGBA`:t.format,c=t.tensorFormat===void 0||t.tensorFormat===void 0?`RGB`:t.tensorFormat,l=n*r,u=c===`RGBA`?new Float32Array(l*4):new Float32Array(l*3),d=4,f=0,p=1,m=2,h=3,g=0,_=l,v=l*2,y=-1;s===`RGB`&&(d=3,f=0,p=1,m=2,h=-1),c===`RGBA`?y=l*3:c===`RBG`?(g=0,v=l,_=l*2):c===`BGR`&&(v=0,_=l,g=l*2);for(let t=0;t{let n=typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement,r=typeof ImageData<`u`&&e instanceof ImageData,i=typeof ImageBitmap<`u`&&e instanceof ImageBitmap,a=typeof e==`string`,o,s=t??{},c=()=>{if(typeof document<`u`)return document.createElement(`canvas`);if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(1,1);throw Error(`Canvas is not supported`)},l=e=>typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas?e.getContext(`2d`):null;if(n){let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let n=e.height,i=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(n=t.resizedHeight,i=t.resizedWidth),t!==void 0){if(s=t,t.tensorFormat!==void 0)throw Error(`Image input config format must be RGBA for HTMLImageElement`);s.tensorFormat=`RGBA`,s.height=n,s.width=i}else s.tensorFormat=`RGBA`,s.height=n,s.width=i;r.drawImage(e,0,0),o=r.getImageData(0,0,i,n).data}else throw Error(`Can not access image data`)}else if(r){let n,r;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(n=t.resizedHeight,r=t.resizedWidth):(n=e.height,r=e.width),t!==void 0&&(s=t),s.format=`RGBA`,s.height=n,s.width=r,t!==void 0){let t=c();t.width=r,t.height=n;let i=l(t);if(i!=null)i.putImageData(e,0,0),o=i.getImageData(0,0,r,n).data;else throw Error(`Can not access image data`)}else o=e.data}else if(i){if(t===void 0)throw Error(`Please provide image config with format for Imagebitmap`);let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let t=e.height,n=e.width;return r.drawImage(e,0,0,n,t),o=r.getImageData(0,0,n,t).data,s.height=t,s.width=n,cr(o,s)}else throw Error(`Can not access image data`)}else if(a)return new Promise((t,n)=>{let r=c(),i=l(r);if(!e||!i)return n();let a=new Image;a.crossOrigin=`Anonymous`,a.src=e,a.onload=()=>{r.width=a.width,r.height=a.height,i.drawImage(a,0,0,r.width,r.height);let e=i.getImageData(0,0,r.width,r.height);s.height=r.height,s.width=r.width,t(cr(e.data,s))}});else throw Error(`Input data provided is not supported - aborted tensor creation`);if(o!==void 0)return cr(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},ur=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t;return new br({location:`texture`,type:`float32`,texture:e,dims:[1,r,n,4],download:i,dispose:a})},dr=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new br({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},fr=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new br({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},pr=(e,t,n)=>new br({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]}),mr=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),hr=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]),gr=!1,_r=()=>{if(!gr){gr=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=n!==void 0&&n.from;e&&(mr.set(`int64`,BigInt64Array),hr.set(BigInt64Array,`int64`)),t&&(mr.set(`uint64`,BigUint64Array),hr.set(BigUint64Array,`uint64`)),r?(mr.set(`float16`,n),hr.set(n,`float16`)):mr.set(`float16`,Uint16Array)}},vr=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new br(e.type,e.data,t);case`cpu-pinned`:return new br({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new br({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new br({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new br({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}};var br=class{constructor(e,t,n){_r();let r,i;if(typeof e==`object`&&`location`in e)switch(this.dataLocation=e.location,r=e.type,i=e.dims,e.location){case`cpu-pinned`:{let t=mr.get(r);if(!t)throw TypeError(`unsupported type "${r}" to create tensor from pinned buffer`);if(!(e.data instanceof t))throw TypeError(`buffer should be of type ${t.name}`);this.cpuData=e.data;break}case`texture`:if(r!==`float32`)throw TypeError(`unsupported type "${r}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break;case`gpu-buffer`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break;case`ml-tensor`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint64`&&r!==`int8`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break;default:throw Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,o;if(typeof e==`string`)if(r=e,o=n,e===`string`){if(!Array.isArray(t))throw TypeError(`A string tensor's data must be a string array.`);a=t}else{let n=mr.get(e);if(n===void 0)throw TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t)){if(e===`float16`&&n===Uint16Array||e===`uint4`||e===`int4`)throw TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${n.name} as data.`);a=e===`uint64`||e===`int64`?n.from(t,BigInt):n.from(t)}else if(t instanceof n)a=t;else if(t instanceof Uint8ClampedArray)if(e===`uint8`)a=Uint8Array.from(t);else throw TypeError(`A Uint8ClampedArray tensor's data must be type of uint8`);else if(e===`float16`&&t instanceof Uint16Array&&n!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw TypeError(`A ${r} tensor's data must be type of ${n}`)}else if(o=t,Array.isArray(e)){if(e.length===0)throw TypeError(`Tensor type cannot be inferred from an empty array.`);let t=typeof e[0];if(t===`string`)r=`string`,a=e;else if(t===`boolean`)r=`bool`,a=Uint8Array.from(e);else throw TypeError(`Invalid element type of data array: ${t}.`)}else if(e instanceof Uint8ClampedArray)r=`uint8`,a=Uint8Array.from(e);else{let t=hr.get(e.constructor);if(t===void 0)throw TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,a=e}if(o===void 0)o=[a.length];else if(!Array.isArray(o))throw TypeError(`A tensor's dims must be a number array`);i=o,this.cpuData=a,this.dataLocation=`cpu`}let a=vr(i);if(this.cpuData&&a!==this.cpuData.length&&!((r===`uint4`||r===`int4`)&&Math.ceil(a/2)===this.cpuData.length))throw Error(`Tensor's size(${a}) does not match data length(${this.cpuData.length}).`);this.type=r,this.dims=i,this.size=a}static async fromImage(e,t){return lr(e,t)}static fromTexture(e,t){return ur(e,t)}static fromGpuBuffer(e,t){return dr(e,t)}static fromMLTensor(e,t){return fr(e,t)}static fromPinnedBuffer(e,t,n){return pr(e,t,n)}toDataURL(e){return or(this,e)}toImageData(e){return sr(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw Error(`The data is not stored as a WebGL texture.`);return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw Error(`The data is not stored as a WebGPU buffer.`);return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw Error(`The data is not stored as a WebNN MLTensor.`);return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case`cpu`:case`cpu-pinned`:return this.data;case`texture`:case`gpu-buffer`:case`ml-tensor`:if(!this.downloader)throw Error(`The current tensor is not created with a specified data downloader.`);if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);try{this.isDownloading=!0;let t=await this.downloader();return this.downloader=void 0,this.dataLocation=`cpu`,this.cpuData=t,e&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}default:throw Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);this.disposer&&=(this.disposer(),void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation=`none`}ensureValid(){if(this.dataLocation===`none`)throw Error(`The tensor is disposed.`)}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw Error(`Cannot reshape a tensor that owns GPU resource.`);return yr(this,e)}};let A=br;var xr={url:self.location.href},Sr=Object.defineProperty,Cr=(e,t)=>{for(var n in t)Sr(e,n,{get:t[n],enumerable:!0})},wr={},Tr={},Er={},Dr=`4.2.0`,Or=typeof self<`u`,kr=!$r(wr),Ar=!$r(Tr),jr=Or&&`caches`in self,Mr=globalThis.Deno!==void 0;globalThis.Bun;var Nr=Mr&&jr&&!kr,Pr=typeof process<`u`,Fr=Pr&&process?.release?.name===`node`&&!Nr,Ir=typeof window<`u`&&window.document!==void 0,Lr=Or&&[`DedicatedWorkerGlobalScope`,`ServiceWorkerGlobalScope`,`SharedWorkerGlobalScope`].includes(self.constructor?.name),Rr=Ir||Lr||Nr,zr=Fr||typeof navigator<`u`&&`gpu`in navigator,Br=typeof navigator<`u`&&`ml`in navigator,Vr=typeof crypto<`u`&&typeof crypto.getRandomValues==`function`,Hr=typeof chrome<`u`&&chrome.runtime!==void 0&&typeof chrome.runtime.id==`string`,Ur=typeof ServiceWorkerGlobalScope<`u`&&Or&&self instanceof ServiceWorkerGlobalScope,Wr=(()=>{if(typeof navigator>`u`)return!1;let e=navigator.userAgent,t=(navigator.vendor||``).indexOf(`Apple`)>-1,n=!e.match(/CriOS|FxiOS|EdgiOS|OPiOS|mercury|brave/i)&&!e.includes(`Chrome`)&&!e.includes(`Android`);return t&&n})(),j=Object.freeze({IS_BROWSER_ENV:Ir,IS_WEBWORKER_ENV:Lr,IS_WEB_ENV:Rr,IS_SERVICE_WORKER_ENV:Ur,IS_DENO_WEB_RUNTIME:Nr,IS_WEB_CACHE_AVAILABLE:jr,IS_WEBGPU_AVAILABLE:zr,IS_WEBNN_AVAILABLE:Br,IS_SAFARI:Wr,IS_PROCESS_AVAILABLE:Pr,IS_NODE_ENV:Fr,IS_FS_AVAILABLE:kr,IS_PATH_AVAILABLE:Ar,IS_CRYPTO_AVAILABLE:Vr,IS_CHROME_AVAILABLE:Hr}),Gr=kr&&Ar,Kr=`./`;if(Gr){let e=Object(xr).url;e?Kr=Tr.dirname(Tr.dirname(Er.fileURLToPath(e))):typeof __dirname<`u`&&(Kr=Tr.dirname(__dirname))}var qr=Gr?Tr.join(Kr,`/.cache/`):null,Jr=`/models/`,Yr=Gr?Tr.join(Kr,Jr):Jr,Xr=typeof globalThis.fetch==`function`?globalThis.fetch.bind(globalThis):void 0,Zr=Object.freeze({DEBUG:10,INFO:20,WARNING:30,ERROR:40,NONE:50}),Qr=Zr.WARNING,M={version:Dr,backends:{onnx:{}},get logLevel(){return Qr},set logLevel(e){Qr=e,M.backends.onnx?.setLogLevel?.(e)},allowRemoteModels:!0,remoteHost:`https://huggingface.co/`,remotePathTemplate:`{model}/resolve/{revision}/`,allowLocalModels:!(Ir||Lr||Nr),localModelPath:Yr,useFS:kr,useBrowserCache:jr,useFSCache:kr,cacheDir:qr,useCustomCache:!1,customCache:null,useWasmCache:jr||kr,cacheKey:`transformers-cache`,experimental_useCrossOriginStorage:!1,fetch:Xr};function $r(e){return Object.keys(e).length===0}var ei=class{constructor(){let e=function(...t){return e._call(...t)};return Object.setPrototypeOf(e,new.target.prototype)}_call(...e){throw Error(`Must implement _call method in subclass`)}};function ti(e,t){e&&e(t)}var ni=class extends ei{constructor(e,t){super(),this.callback=e,this.files_loading=t}_call(e){if(e.status===`progress`){this.files_loading[e.file]={loaded:e.loaded,total:e.total};let t=Object.values(this.files_loading).reduce((e,t)=>e+t.loaded,0),n=Object.values(this.files_loading).reduce((e,t)=>e+t.total,0),r=n>0?t/n*100:0;this.callback({status:`progress_total`,name:e.name,progress:r,loaded:t,total:n,files:structuredClone(this.files_loading)})}this.callback(e)}};function ri(e){return Number.isInteger(e)||typeof e==`bigint`}function ii(e){return e==null||e===-1}function ai(e){let t=[],n=e;for(;Array.isArray(n);)t.push(n.length),n=n[0];return t}function oi(...e){return Array.prototype.concat.apply([],e)}function si(...e){return e.reduce((e,t)=>e.flatMap(e=>t.map(t=>[e,t])))}function ci(e,t){return Math.abs((e+t)%(2*t)-t)}function li(e,t){return Object.assign({},...t.map(t=>{if(e[t]!==void 0)return{[t]:e[t]}}))}function ui(e,t){let n=0;for(let r of e)r===t&&++n;return n}var N={error(...e){M.logLevel<=Zr.ERROR&&console.error(...e)},warn(...e){M.logLevel<=Zr.WARNING&&console.warn(...e)},info(...e){M.logLevel<=Zr.INFO&&console.log(...e)},debug(...e){M.logLevel<=Zr.DEBUG&&console.log(...e)},log(...e){this.info(...e)}},di=class{constructor(e){this.trie=this._build_trie(e)}_build_trie(e){let t=Object.create(null);for(let n of e){let e=t;for(let t=0;tr&&t.push(e.slice(r,i)),t.push(o),i+=o.length,r=i):++i}return r{let e=[...Array.from({length:94},(e,t)=>t+33),...Array.from({length:12},(e,t)=>t+161),...Array.from({length:82},(e,t)=>t+174)],t=e.slice(),n=0;for(let r=0;r<256;++r)e.includes(r)||(e.push(r),t.push(256+n),n+=1);let r=t.map(e=>String.fromCharCode(e));return Object.fromEntries(e.map((e,t)=>[e,r[t]]))})(),mi=(e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[t,e])))(pi),hi=`.,!?…。,、।۔،`,gi=new Map([[`(?i:'s|'t|'re|'ve|'m|'ll|'d)`,`(?:'([sS]|[tT]|[rR][eE]|[vV][eE]|[mM]|[lL][lL]|[dD]))`],[`(?i:[sdmt]|ll|ve|re)`,`(?:[sS]|[dD]|[mM]|[tT]|[lL][lL]|[vV][eE]|[rR][eE])`],[`[^\\r\\n\\p{L}\\p{N}]?+`,`[^\\r\\n\\p{L}\\p{N}]?`],[`[^\\s\\p{L}\\p{N}]++`,`[^\\s\\p{L}\\p{N}]+`],[`(?>\\p{Nd}{510})`,`(?:\\p{Nd}{510})`],[`\\p{Nd}{3}+`,`(?:\\p{Nd}{3})+`],[`\\G`,``],[` ?[^(\\s|[${hi}])]+`,` ?[^\\s${hi}]+`]]),_i=`\\p{P}\\u0021-\\u002F\\u003A-\\u0040\\u005B-\\u0060\\u007B-\\u007E`,vi=e=>e.replace(/ \./g,`.`).replace(/ \?/g,`?`).replace(/ \!/g,`!`).replace(/ ,/g,`,`).replace(/ \' /g,`'`).replace(/ n't/g,`n't`).replace(/ 'm/g,`'m`).replace(/ 's/g,`'s`).replace(/ 've/g,`'ve`).replace(/ 're/g,`'re`),yi=(e,t=!0)=>{if(e.Regex!==void 0){let t=e.Regex.replace(/\\([#&~])/g,`$1`);t=t.replace(/\\A/g,`^`).replace(/\\z/g,`$`).replace(/\\Z/g,`(?=\\r?\\n?$)`);for(let[e,n]of gi)t=t.replaceAll(e,n);try{return new RegExp(t,`gu`)}catch(e){if(!(e instanceof SyntaxError)||!e.message.toLowerCase().includes(`invalid property name`))throw e;let n=!1,r=t.replace(/(\\[pP])\{([^}=]+)\}/g,(e,t,r)=>{try{return RegExp(`\\p{${r}}`,`u`),`${t}{${r}}`}catch{return n=!0,`${t}{Script=${r}}`}});if(!n)throw e;try{return new RegExp(r,`gu`)}catch{throw e}}}else if(e.String!==void 0){let n=bi(e.String);return new RegExp(t?n:`(${n})`,`gu`)}else return console.warn(`Unknown pattern type:`,e),null},bi=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),xi=(e,t,n)=>{let r=[],i=0;for(;ie>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103,Ci=e=>Number.isInteger(e)||typeof e==`bigint`,wi=e=>{let t=0;for(let n of e)++t;return t},Ti=e=>ki(e.toLowerCase()),Ei=(...e)=>Array.prototype.concat.apply([],e),Di=e=>new Map(Object.entries(e)),Oi=(e,t)=>{let n=[],r=0;for(let i of e.matchAll(t)){let t=i[0];r0&&n.push(t),r=i.index+t.length}return re.replace(/\p{M}/gu,``),Ai=(e,t,n=[])=>{if(!e||Array.isArray(e)||typeof e!=`object`)return`${t} must be a valid object`;for(let r of n)if(!(r in e))return`${t} must contain a "${r}" property`;return null},ji=e=>e.match(/\S+/g)||[],Mi=class{constructor(){let e=function(...t){return e._call(...t)};return Object.setPrototypeOf(e,new.target.prototype)}},Ni=class extends Mi{constructor(e){super(),this.config=e}_call(e){return this.normalize(e)}},Pi=class extends Ni{tokenize_chinese_chars(e){let t=[];for(let n=0;ne.normalize(`NFKC`)).join(`~`):e.normalize(`NFKC`),e}},Ii=class extends Ni{constructor(e){super(e),this.normalizers=(e.normalizers??[]).map(e=>Ji(e))}normalize(e){return this.normalizers.reduce((e,t)=>t?t.normalize(e):e,e)}},Li=class extends Ni{normalize(e){let t=yi(this.config.pattern??{});return t===null?e:e.replaceAll(t,this.config.content??``)}},Ri=class extends Ni{constructor(){super(...arguments),this.form=`NFC`}normalize(e){return e=e.normalize(this.form),e}},zi=class extends Ri{constructor(){super(...arguments),this.form=`NFC`}},Bi=class extends Ri{constructor(){super(...arguments),this.form=`NFD`}},Vi=class extends Ri{constructor(){super(...arguments),this.form=`NFKC`}},Hi=class extends Ri{constructor(){super(...arguments),this.form=`NFKD`}},Ui=class extends Ni{normalize(e){return this.config.strip_left&&this.config.strip_right?e=e.trim():(this.config.strip_left&&(e=e.trimStart()),this.config.strip_right&&(e=e.trimEnd())),e}},Wi=class extends Ni{normalize(e){return ki(e)}},Gi=class extends Ni{normalize(e){return e.toLowerCase()}},Ki=class extends Ni{normalize(e){return e=this.config.prepend+e,e}};function qi(e){if(e===null)return null;switch(e.type){case`BertNormalizer`:return new Pi(e);case`Precompiled`:return new Fi(e);case`Sequence`:return new Ii(e);case`Replace`:return new Li(e);case`NFC`:return new zi(e);case`NFD`:return new Bi(e);case`NFKC`:return new Vi(e);case`NFKD`:return new Hi(e);case`Strip`:return new Ui(e);case`StripAccents`:return new Wi(e);case`Lowercase`:return new Gi(e);case`Prepend`:return new Ki(e);default:throw Error(`Unknown Normalizer type: ${e.type}`)}}var Ji=qi,Yi=class extends Mi{pre_tokenize(e,t){return(Array.isArray(e)?e.map(e=>this.pre_tokenize_text(e,t)):this.pre_tokenize_text(e,t)).flat()}_call(e,t){return this.pre_tokenize(e,t)}},Xi=class extends Yi{constructor(e){super(),this.config=e,this.add_prefix_space=this.config.add_prefix_space??!1,this.trim_offsets=this.config.trim_offsets??!1,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=pi,this.text_encoder=new TextEncoder}pre_tokenize_text(e,t){return this.add_prefix_space&&!e.startsWith(` `)&&(e=` `+e),(this.use_regex?e.match(this.pattern)||[]:[e]).map(e=>Array.from(this.text_encoder.encode(e),e=>this.byte_encoder[e]).join(``))}},Zi=class extends Yi{pre_tokenize_text(e,t){return e.match(/\w+|[^\w\s]+/g)||[]}},Qi=class extends Yi{constructor(e){super(),this.replacement=e.replacement??`▁`,this.str_rep=e.str_rep||this.replacement,this.prepend_scheme=e.prepend_scheme??`always`}pre_tokenize_text(e,t){let{section_index:n=void 0}=t??{},r=e.replaceAll(` `,this.str_rep);return!r.startsWith(this.replacement)&&(this.prepend_scheme===`always`||this.prepend_scheme===`first`&&n===0)&&(r=this.str_rep+r),[r]}},$i=class extends Yi{constructor(e){super(),this.config=e,this.pattern=yi(this.config.pattern??{},this.config.invert??!0)}pre_tokenize_text(e){return this.pattern===null?[]:this.config.invert?e.match(this.pattern)||[]:this.config.behavior?.toLowerCase()===`removed`?e.split(this.pattern).filter(e=>e):Oi(e,this.pattern)}},ea=class extends Yi{constructor(e){super(),this.config=e,this.pattern=RegExp(`[^${_i}]+|[${_i}]+`,`gu`)}pre_tokenize_text(e){return e.match(this.pattern)||[]}},ta=class extends Yi{constructor(e){super(),this.config=e;let t=`[^\\d]+|\\d${this.config.individual_digits?``:`+`}`;this.pattern=new RegExp(t,`gu`)}pre_tokenize_text(e){return e.match(this.pattern)||[]}},na=class extends Yi{constructor(){super(),this.pattern=RegExp(`[^\\s${_i}]+|[${_i}]`,`gu`)}pre_tokenize_text(e,t){return e.trim().match(this.pattern)||[]}},ra=class extends Yi{constructor(e){super(),this.config=e,this.pattern=yi(this.config.pattern??{}),this.content=this.config.content??``}pre_tokenize_text(e){return this.pattern===null?[e]:[e.replaceAll(this.pattern,this.config.content??``)]}},ia=class extends Yi{constructor(e){super(),this.tokenizers=(e.pretokenizers??[]).map(e=>F(e))}pre_tokenize_text(e,t){return this.tokenizers.reduce((e,n)=>n?n.pre_tokenize(e,t):e,[e])}},P=class extends Yi{pre_tokenize_text(e){return ji(e)}},aa=class extends Yi{constructor(e){super(),this.config=e,this._length=e.length}pre_tokenize_text(e){let t=[];for(let n=0;nthis.max_input_chars_per_word){t.push(this.unk_token);continue}let r=!1,i=0,a=[];for(;i0&&(r=this.config.continuing_subword_prefix+r),this.tokens_to_ids.has(r)){n=r;break}--t}if(n===null){r=!0;break}a.push(n),i=t}r?t.push(this.unk_token):t.push(...a)}return t}},ca=class e{constructor(e,t){this.is_leaf=e,this.children=t}static default(){return new e(!1,new Map)}},la=class{constructor(){this.root=ca.default()}extend(e){for(let t of e)this.push(t)}push(e){let t=this.root;for(let n of e){let e=t.children.get(n);e===void 0&&(e=ca.default(),t.children.set(n,e)),t=e}t.is_leaf=!0}*common_prefix_search(e){let t=this.root;if(t===void 0)return;let n=``;for(let r of e){if(n+=r,t=t.children.get(r),t===void 0)return;t.is_leaf&&(yield n)}}},ua=class e{constructor(e,t,n,r,i){this.token_id=e,this.node_id=t,this.pos=n,this.length=r,this.score=i,this.prev=null,this.backtrace_score=0}clone(){let t=new e(this.token_id,this.node_id,this.pos,this.length,this.score);return t.prev=this.prev,t.backtrace_score=this.backtrace_score,t}},da=class{constructor(e,t,n){this.chars=Array.from(e),this.len=this.chars.length,this.bos_token_id=t,this.eos_token_id=n,this.nodes=[],this.begin_nodes=Array.from({length:this.len+1},()=>[]),this.end_nodes=Array.from({length:this.len+1},()=>[]);let r=new ua(this.bos_token_id??0,0,0,0,0),i=new ua(this.eos_token_id??0,1,this.len,0,0);this.nodes.push(r.clone()),this.nodes.push(i.clone()),this.begin_nodes[this.len].push(i),this.end_nodes[0].push(r)}insert(e,t,n,r){let i=this.nodes.length,a=new ua(r,i,e,t,n);this.begin_nodes[e].push(a),this.end_nodes[e+t].push(a),this.nodes.push(a)}viterbi(){let e=this.len,t=0;for(;t<=e;){if(this.begin_nodes[t].length==0)return[];for(let e of this.begin_nodes[t]){e.prev=null;let n=0,r=null;for(let i of this.end_nodes[t]){let t=i.backtrace_score+e.score;(r===null||t>n)&&(r=i.clone(),n=t)}if(r!==null)e.prev=r,e.backtrace_score=n;else return[]}++t}let n=[],r=this.begin_nodes[e][0].prev;if(r===null)return[];let i=r.clone();for(;i.prev!==null;)n.push(i.clone()),i=i.clone().prev.clone();return n.reverse(),n}piece(e){return this.chars.slice(e.pos,e.pos+e.length).join(``)}tokens(){return this.viterbi().map(e=>this.piece(e))}token_ids(){return this.viterbi().map(e=>e.token_id)}};function fa(e){if(e.length===0)throw Error(`Array must not be empty`);let t=e[0],n=0;for(let r=1;r[e,t])),this.bos_token=` `,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.unk_token=this.vocab[this.unk_token_id],this.min_score=fa(this.scores)[0],this.unk_score=this.min_score-10,this.scores[this.unk_token_id]=this.unk_score,this.trie=new la,this.trie.extend(this.vocab),this.fuse_unk=!0}populate_nodes(e){let t=e.chars,n=0;for(;ne>t,t=1/0){this._heap=[],this._comparator=e,this._max_size=t}get size(){return this._heap.length}is_empty(){return this.size===0}peek(){return this._heap[0]}push(...e){return this.extend(e)}extend(e){for(let t of e)if(this.size0&&this._swap(0,t),this._heap.pop(),this._sift_down(),e}replace(e){let t=this.peek();return this._heap[0]=e,this._sift_down(),t}_parent(e){return(e+1>>>1)-1}_left(e){return(e<<1)+1}_right(e){return e+1<<1}_greater(e,t){return this._comparator(this._heap[e],this._heap[t])}_swap(e,t){let n=this._heap[e];this._heap[e]=this._heap[t],this._heap[t]=n}_sift_up(){this._sift_up_from(this.size-1)}_sift_up_from(e){for(;e>0&&this._greater(e,this._parent(e));)this._swap(e,this._parent(e)),e=this._parent(e)}_sift_down(){let e=0;for(;this._left(e)this.capacity&&this.cache.delete(this.cache.keys().next().value)}clear(){this.cache.clear()}},ga=class extends sa{constructor(e){super(e),this.tokens_to_ids=Di(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e;let t=Array.isArray(e.merges[0]);this.merges=t?e.merges:e.merges.map(e=>e.split(` `,2)),this.bpe_ranks=new Map(this.merges.map((e,t)=>[JSON.stringify(e),t])),this.end_of_word_suffix=e.end_of_word_suffix,this.continuing_subword_suffix=e.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.max_length_to_cache=256,this.cache_capacity=1e4,this.cache=new ha(this.cache_capacity)}clear_cache(){this.cache.clear()}bpe(e){if(e.length===0)return[];let t=this.cache.get(e);if(t!==void 0)return t;let n=Array.from(e);this.end_of_word_suffix&&(n[n.length-1]+=this.end_of_word_suffix);let r=[];if(n.length>1){let e=new ma((e,t)=>e.score`<0x${e.toString(16).toUpperCase().padStart(2,`0`)}>`);e.every(e=>this.tokens_to_ids.has(e))?t.push(...e):this.unk_token!=null&&t.push(this.unk_token)}else this.unk_token!=null&&t.push(this.unk_token)}return t}},_a=class extends sa{constructor(e,t){super(e);let n=e.vocab;this.tokens_to_ids=Di(t.target_lang?n[t.target_lang]:n),this.bos_token=t.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=t.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=t.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){return e}};function va(e,t){switch(e.type){case`WordPiece`:return new I(e);case`Unigram`:return new pa(e,t.eos_token);case`BPE`:return new ga(e);default:if(e.vocab)return Array.isArray(e.vocab)?new pa(e,t.eos_token):Object.hasOwn(e,`continuing_subword_prefix`)&&Object.hasOwn(e,`unk_token`)?Object.hasOwn(e,`merges`)?new ga(e):new I(e):new _a(e,{target_lang:t.target_lang,bos_token:t.bos_token,eos_token:t.eos_token,pad_token:t.pad_token,unk_token:t.unk_token});throw Error(`Unknown TokenizerModel type: ${e?.type}`)}}var ya=va,ba=class extends Mi{constructor(e){super(),this.config=e}_call(e,...t){return this.post_process(e,...t)}},xa=class extends ba{post_process(e,t=null,n=!0){let r=t===null?this.config.single:this.config.pair,i=[],a=[];for(let o of r)`SpecialToken`in o?n&&(i.push(o.SpecialToken.id),a.push(o.SpecialToken.type_id)):`Sequence`in o&&(o.Sequence.id===`A`?(i=Ei(i,e),a=Ei(a,Array(e.length).fill(o.Sequence.type_id))):o.Sequence.id===`B`&&(i=Ei(i,t),a=Ei(a,Array(t.length).fill(o.Sequence.type_id))));return{tokens:i,token_type_ids:a}}},Sa=class extends ba{post_process(e,t=null){return{tokens:e,tokens_pair:t}}},Ca=class extends ba{constructor(e){super(e),this.sep=e.sep,this.cls=e.cls}post_process(e,t=null,n=!0){n&&(e=Ei([this.cls[0]],e,[this.sep[0]]));let r=Array(e.length).fill(0);if(t){let i=[],a=n?[this.sep[0]]:[];e=Ei(e,i,t,a),r=Ei(r,Array(t.length+i.length+a.length).fill(1))}return{tokens:e,token_type_ids:r}}},wa=class extends ba{constructor(e){super(e),this.sep=e.sep,this.cls=e.cls}post_process(e,t,n=!0){n&&(e=Ei([this.cls[0]],e,[this.sep[0]]));let r=Array(e.length).fill(0);if(t){let i=n?[this.sep[0]]:[],a=n?[this.sep[0]]:[];e=Ei(e,i,t,a),r=Ei(r,Array(t.length+i.length+a.length).fill(1))}return{tokens:e,token_type_ids:r}}},Ta=class extends ba{constructor(e){super(e),this.processors=(e.processors??[]).map(e=>Da(e))}post_process(e,t=null,n=!0){let r={tokens:e,tokens_pair:t};for(let e of this.processors)r=e.post_process(r.tokens,r.tokens_pair,n);return r}};function Ea(e){if(e===null)return null;switch(e.type){case`TemplateProcessing`:return new xa(e);case`ByteLevel`:return new Sa(e);case`BertProcessing`:return new Ca(e);case`RobertaProcessing`:return new wa(e);case`Sequence`:return new Ta(e);default:throw Error(`Unknown PostProcessor type: ${e.type}`)}}var Da=Ea,Oa=class extends Mi{constructor(e){super(),this.config=e,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=`trim_offsets`in e?e.trim_offsets:!1}_call(e){return this.decode(e)}decode(e){return this.decode_chain(e).join(``)}},ka=class extends Oa{constructor(e){super(e),this.byte_decoder=mi,this.text_decoder=new TextDecoder(`utf-8`,{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(e){let t=e.join(``),n=new Uint8Array([...t].map(e=>this.byte_decoder[e]));return this.text_decoder.decode(n)}decode_chain(e){let t=[],n=[];for(let r of e)this.added_tokens.find(e=>e.content===r)===void 0?n.push(r):(n.length>0&&(t.push(this.convert_tokens_to_string(n)),n=[]),t.push(r));return n.length>0&&t.push(this.convert_tokens_to_string(n)),t}},Aa=class extends Oa{constructor(e){super(e),this.cleanup=e.cleanup}decode_chain(e){return e.map((e,t)=>{if(t!==0){let t=this.config.prefix;e=t&&e.startsWith(t)?e.replace(t,``):` `+e}return this.cleanup&&(e=vi(e)),e})}},ja=class extends Oa{constructor(e){super(e),this.replacement=e.replacement??`▁`}decode_chain(e){let t=[];for(let n=0;nt.replaceAll(this.suffix,n===e.length-1?``:` `))}},Na=class extends Oa{constructor(e){super(e),this.pad_token=e.pad_token??``,this.word_delimiter_token=e.word_delimiter_token??``,this.cleanup=e.cleanup}convert_tokens_to_string(e){if(e.length===0)return``;let t=[e[0]];for(let n=1;ne!==this.pad_token).join(``);return this.cleanup&&(n=vi(n).replaceAll(this.word_delimiter_token,` `).trim()),n}decode_chain(e){return[this.convert_tokens_to_string(e)]}},Pa=class extends Oa{constructor(e){super(e),this.decoders=(e.decoders??[]).map(e=>Ba(e))}decode_chain(e){return this.decoders.reduce((e,t)=>t.decode_chain(e),e)}},Fa=class extends Oa{decode_chain(e){let t=yi(this.config.pattern),n=this.config.content??``;return t===null?e:e.map(e=>e.replaceAll(t,n))}},Ia=class extends Oa{decode_chain(e){return[e.join(``)]}},La=class extends Oa{constructor(e){super(e),this.content=e.content??``,this.start=e.start??0,this.stop=e.stop??0}decode_chain(e){return e.map(e=>{let t=0;for(let n=0;n`)){let t=parseInt(r.slice(3,5),16);isNaN(t)||(e=t)}if(e!==null)n.push(e);else{if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}t.push(r)}}if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}return t}};function za(e){if(e===null)return null;switch(e.type){case`ByteLevel`:return new ka(e);case`WordPiece`:return new Aa(e);case`Metaspace`:return new ja(e);case`BPEDecoder`:return new Ma(e);case`CTC`:return new Na(e);case`Sequence`:return new Pa(e);case`Replace`:return new Fa(e);case`Fuse`:return new Ia(e);case`Strip`:return new La(e);case`ByteFallback`:return new Ra(e);default:throw Error(`Unknown Decoder type: ${e.type}`)}}var Ba=za,Va=class{constructor(e,t){let n=Ai(e,`Tokenizer`,[`model`,`decoder`,`post_processor`,`pre_tokenizer`,`normalizer`]);if(n)throw Error(n);let r=Ai(t,`Config`);if(r)throw Error(r);this.tokenizer=e,this.config=t,this.normalizer=Ji(this.tokenizer.normalizer),this.pre_tokenizer=F(this.tokenizer.pre_tokenizer),this.model=ya(this.tokenizer.model,this.config),this.post_processor=Da(this.tokenizer.post_processor),this.decoder=Ba(this.tokenizer.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];let i=[],a=[];this.added_tokens_map=new Map;for(let e of this.tokenizer.added_tokens){let t=new fi(e);if(this.added_tokens.push(t),this.model.tokens_to_ids.set(t.content,t.id),this.model.vocab[t.id]=t.content,t.special&&(this.special_tokens.push(t.content),this.all_special_ids.push(t.id)),this.added_tokens_map.set(t.content,t),t.normalized&&this.normalizer!==null){let e=this.normalizer(t.content);a.push(e),this.added_tokens_map.set(e,t)}else i.push(t.content)}(this.config.additional_special_tokens??[]).forEach(e=>{this.special_tokens.includes(e)||this.special_tokens.push(e)}),this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.splitter_unnormalized=new di(i),this.splitter_normalized=new di(a),this.remove_space=this.config.remove_space,this.clean_up_tokenization_spaces=this.config.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=this.config.do_lowercase_and_remove_accent??!1}encode(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){let{tokens:i,token_type_ids:a}=this.tokenize_helper(e,{text_pair:t,add_special_tokens:n}),o=i.map(e=>this.added_tokens_map.get(e)?.id??this.model.tokens_to_ids.get(e)??this.model.unk_token_id),s={ids:o,tokens:i,attention_mask:Array(o.length).fill(1)};return r&&a&&(s.token_type_ids=a),s}decode(e,t={}){if(!Array.isArray(e)||e.length===0||!Ci(e[0]))throw Error(`token_ids must be a non-empty array of integers.`);let n=e.map(e=>this.model.vocab[Number(e)]??this.model.unk_token);t.skip_special_tokens&&(n=n.filter(e=>!this.special_tokens.includes(e)));let r=this.decoder?this.decoder(n):n.join(` `);return this.decoder&&this.decoder.end_of_word_suffix&&(r=r.replaceAll(this.decoder.end_of_word_suffix,` `),t.skip_special_tokens&&(r=r.trim())),(t.clean_up_tokenization_spaces??this.clean_up_tokenization_spaces)&&(r=vi(r)),r}tokenize(e,{text_pair:t=null,add_special_tokens:n=!1}={}){return this.tokenize_helper(e,{text_pair:t,add_special_tokens:n}).tokens}encode_text(e){if(e===null)return null;let t=this.splitter_unnormalized.split(e);return t.forEach((e,n)=>{let r=this.added_tokens_map.get(e);r&&(r.lstrip&&n>0&&(t[n-1]=t[n-1].trimEnd()),r.rstrip&&n{if(e.length===0)return[];if(this.added_tokens_map.has(e))return[e];if(this.remove_space===!0&&(e=e.trim().split(/\s+/).join(` `)),this.do_lowercase_and_remove_accent&&(e=Ti(e)),this.normalizer!==null&&(e=this.normalizer(e)),e.length===0)return[];let n=this.splitter_normalized.split(e);return n.forEach((e,t)=>{let r=this.added_tokens_map.get(e);r&&(r.lstrip&&t>0&&(n[t-1]=n[t-1].trimEnd()),r.rstrip&&t{if(e.length===0)return[];if(this.added_tokens_map.has(e))return[e];let n=this.pre_tokenizer===null?[e]:this.pre_tokenizer(e,{section_index:t});return this.model(n)})})}tokenize_helper(e,{text_pair:t=null,add_special_tokens:n=!0}){let r=this.encode_text(e),i=this.encode_text(t||null);return this.post_processor?this.post_processor(r,i,n):{tokens:Ei(r??[],i??[])}}token_to_id(e){return this.model.tokens_to_ids.get(e)}id_to_token(e){return this.model.vocab[e]}get_added_tokens_decoder(){let e=new Map;for(let t of this.added_tokens)e.set(t.id,t);return e}get_vocab(e=!0){let t=new Map;for(let n=0;n=`,L.ComparisonBinaryOperator],[`==`,L.ComparisonBinaryOperator],[`!=`,L.ComparisonBinaryOperator],[`<`,L.ComparisonBinaryOperator],[`>`,L.ComparisonBinaryOperator],[`+`,L.AdditiveBinaryOperator],[`-`,L.AdditiveBinaryOperator],[`~`,L.AdditiveBinaryOperator],[`*`,L.MultiplicativeBinaryOperator],[`/`,L.MultiplicativeBinaryOperator],[`%`,L.MultiplicativeBinaryOperator],[`=`,L.Equals]],qa=new Map([[`n`,` +`],[`t`,` `],[`r`,`\r`],[`b`,`\b`],[`f`,`\f`],[`v`,`\v`],[`'`,`'`],[`"`,`"`],[`\\`,`\\`]]);function Ja(e,t={}){return e.endsWith(` +`)&&(e=e.slice(0,-1)),t.lstrip_blocks&&(e=e.replace(/^[ \t]*({[#%-])/gm,`$1`)),t.trim_blocks&&(e=e.replace(/([#%-]})\n/g,`$1`)),e.replace(/{%\s*(end)?generation\s*%}/gs,``)}function Ya(e,t={}){let n=[],r=Ja(e,t),i=0,a=0,o=e=>{let t=``;for(;e(r[i]);){if(r[i]===`\\`){if(++i,i>=r.length)throw SyntaxError(`Unexpected end of input`);let e=r[i++],n=qa.get(e);if(n===void 0)throw SyntaxError(`Unexpected escaped character: ${e}`);t+=n;continue}if(t+=r[i++],i>=r.length)throw SyntaxError(`Unexpected end of input`)}return t},s=()=>{let e=n.at(-1);e&&e.type===L.Text&&(e.value=e.value.trimEnd(),e.value===``&&n.pop())},c=()=>{for(;i0){n.push(new Ha(e,L.Text));continue}}if(r[i]===`{`&&r[i+1]===`#`){i+=2;let e=r[i]===`-`;e&&++i;let t=``;for(;r[i]!==`#`||r[i+1]!==`}`;){if(i+2>=r.length)throw SyntaxError(`Missing end of comment tag`);t+=r[i++]}let a=t.endsWith(`-`);a&&(t=t.slice(0,-1)),e&&s(),n.push(new Ha(t,L.Comment)),i+=2,a&&c();continue}if(r.slice(i,i+3)===`{%-`){s(),n.push(new Ha(`{%`,L.OpenStatement)),i+=3;continue}if(r.slice(i,i+3)===`{{-`){s(),n.push(new Ha(`{{`,L.OpenExpression)),a=0,i+=3;continue}if(o(Ga),r.slice(i,i+3)===`-%}`){n.push(new Ha(`%}`,L.CloseStatement)),i+=3,c();continue}if(r.slice(i,i+3)===`-}}`){n.push(new Ha(`}}`,L.CloseExpression)),i+=3,c();continue}let t=r[i];if(t===`-`||t===`+`){let e=n.at(-1)?.type;if(e===L.Text||e===void 0)throw SyntaxError(`Unexpected character: ${t}`);switch(e){case L.Identifier:case L.NumericLiteral:case L.StringLiteral:case L.CloseParen:case L.CloseSquareBracket:break;default:{++i;let e=o(Wa);n.push(new Ha(`${t}${e}`,e.length>0?L.NumericLiteral:L.UnaryOperator));continue}}}for(let[e,t]of Ka)if(!(e===`}}`&&a>0)&&r.slice(i,i+e.length)===e){n.push(new Ha(e,t)),t===L.OpenExpression?a=0:t===L.OpenCurlyBracket?++a:t===L.CloseCurlyBracket&&--a,i+=e.length;continue main}if(t===`'`||t===`"`){++i;let e=o(e=>e!==t);n.push(new Ha(e,L.StringLiteral)),++i;continue}if(Wa(t)){let e=o(Wa);if(r[i]===`.`&&Wa(r[i+1])){++i;let t=o(Wa);e=`${e}.${t}`}n.push(new Ha(e,L.NumericLiteral));continue}if(Ua(t)){let e=o(Ua);n.push(new Ha(e,L.Identifier));continue}throw SyntaxError(`Unexpected character: ${t}`)}return n}var Xa=class{type=`Statement`},Za=class extends Xa{constructor(e){super(),this.body=e}type=`Program`},Qa=class extends Xa{constructor(e,t,n){super(),this.test=e,this.body=t,this.alternate=n}type=`If`},$a=class extends Xa{constructor(e,t,n,r){super(),this.loopvar=e,this.iterable=t,this.body=n,this.defaultBlock=r}type=`For`},eo=class extends Xa{type=`Break`},to=class extends Xa{type=`Continue`},no=class extends Xa{constructor(e,t,n){super(),this.assignee=e,this.value=t,this.body=n}type=`Set`},ro=class extends Xa{constructor(e,t,n){super(),this.name=e,this.args=t,this.body=n}type=`Macro`},io=class extends Xa{constructor(e){super(),this.value=e}type=`Comment`},ao=class extends Xa{type=`Expression`},oo=class extends ao{constructor(e,t,n){super(),this.object=e,this.property=t,this.computed=n}type=`MemberExpression`},so=class extends ao{constructor(e,t){super(),this.callee=e,this.args=t}type=`CallExpression`},co=class extends ao{constructor(e){super(),this.value=e}type=`Identifier`},lo=class extends ao{constructor(e){super(),this.value=e}type=`Literal`},uo=class extends lo{type=`IntegerLiteral`},fo=class extends lo{type=`FloatLiteral`},po=class extends lo{type=`StringLiteral`},mo=class extends lo{type=`ArrayLiteral`},ho=class extends lo{type=`TupleLiteral`},go=class extends lo{type=`ObjectLiteral`},_o=class extends ao{constructor(e,t,n){super(),this.operator=e,this.left=t,this.right=n}type=`BinaryExpression`},vo=class extends ao{constructor(e,t){super(),this.operand=e,this.filter=t}type=`FilterExpression`},yo=class extends Xa{constructor(e,t){super(),this.filter=e,this.body=t}type=`FilterStatement`},bo=class extends ao{constructor(e,t){super(),this.lhs=e,this.test=t}type=`SelectExpression`},xo=class extends ao{constructor(e,t,n){super(),this.operand=e,this.negate=t,this.test=n}type=`TestExpression`},So=class extends ao{constructor(e,t){super(),this.operator=e,this.argument=t}type=`UnaryExpression`},Co=class extends ao{constructor(e=void 0,t=void 0,n=void 0){super(),this.start=e,this.stop=t,this.step=n}type=`SliceExpression`},wo=class extends ao{constructor(e,t){super(),this.key=e,this.value=t}type=`KeywordArgumentExpression`},To=class extends ao{constructor(e){super(),this.argument=e}type=`SpreadExpression`},Eo=class extends Xa{constructor(e,t,n){super(),this.call=e,this.callerArgs=t,this.body=n}type=`CallStatement`},Do=class extends ao{constructor(e,t,n){super(),this.condition=e,this.trueExpr=t,this.falseExpr=n}type=`Ternary`};function Oo(e){let t=new Za([]),n=0;function r(t,r){let i=e[n++];if(!i||i.type!==t)throw Error(`Parser Error: ${r}. ${i.type} !== ${t}.`);return i}function i(e){if(!c(e))throw SyntaxError(`Expected ${e}`);++n}function a(){switch(e[n].type){case L.Comment:return new io(e[n++].value);case L.Text:return l();case L.OpenStatement:return u();case L.OpenExpression:return d();default:throw SyntaxError(`Unexpected token type: ${e[n].type}`)}}function o(...t){return n+t.length<=e.length&&t.every((t,r)=>t===e[n+r].type)}function s(...t){return e[n]?.type===L.OpenStatement&&e[n+1]?.type===L.Identifier&&t.includes(e[n+1]?.value)}function c(...t){return n+t.length<=e.length&&t.every((t,r)=>e[n+r].type===`Identifier`&&t===e[n+r].value)}function l(){return new po(r(L.Text,`Expected text token`).value)}function u(){if(r(L.OpenStatement,`Expected opening statement token`),e[n].type!==L.Identifier)throw SyntaxError(`Unknown statement, got ${e[n].type}`);let t=e[n].value,c;switch(t){case`set`:++n,c=f();break;case`if`:++n,c=p(),r(L.OpenStatement,`Expected {% token`),i(`endif`),r(L.CloseStatement,`Expected %} token`);break;case`macro`:++n,c=m(),r(L.OpenStatement,`Expected {% token`),i(`endmacro`),r(L.CloseStatement,`Expected %} token`);break;case`for`:++n,c=g(),r(L.OpenStatement,`Expected {% token`),i(`endfor`),r(L.CloseStatement,`Expected %} token`);break;case`call`:{++n;let e=null;o(L.OpenParen)&&(e=w());let t=oe();if(t.type!==`Identifier`)throw SyntaxError(`Expected identifier following call statement`);let l=w();r(L.CloseStatement,`Expected closing statement token`);let u=[];for(;!s(`endcall`);)u.push(a());r(L.OpenStatement,`Expected '{%'`),i(`endcall`),r(L.CloseStatement,`Expected closing statement token`),c=new Eo(new so(t,l),e,u);break}case`break`:++n,r(L.CloseStatement,`Expected closing statement token`),c=new eo;break;case`continue`:++n,r(L.CloseStatement,`Expected closing statement token`),c=new to;break;case`filter`:{++n;let e=oe();e instanceof co&&o(L.OpenParen)&&(e=C(e)),r(L.CloseStatement,`Expected closing statement token`);let t=[];for(;!s(`endfilter`);)t.push(a());r(L.OpenStatement,`Expected '{%'`),i(`endfilter`),r(L.CloseStatement,`Expected '%}'`),c=new yo(e,t);break}default:throw SyntaxError(`Unknown statement type: ${t}`)}return c}function d(){r(L.OpenExpression,`Expected opening expression token`);let e=_();return r(L.CloseExpression,`Expected closing expression token`),e}function f(){let e=h(),t=null,c=[];if(o(L.Equals))++n,t=h();else{for(r(L.CloseStatement,`Expected %} token`);!s(`endset`);)c.push(a());r(L.OpenStatement,`Expected {% token`),i(`endset`)}return r(L.CloseStatement,`Expected closing statement token`),new no(e,t,c)}function p(){let e=_();r(L.CloseStatement,`Expected closing statement token`);let t=[],i=[];for(;!s(`elif`,`else`,`endif`);)t.push(a());if(s(`elif`)){++n,++n;let e=p();i.push(e)}else if(s(`else`))for(++n,++n,r(L.CloseStatement,`Expected closing statement token`);!s(`endif`);)i.push(a());return new Qa(e,t,i)}function m(){let e=oe();if(e.type!==`Identifier`)throw SyntaxError(`Expected identifier following macro statement`);let t=w();r(L.CloseStatement,`Expected closing statement token`);let n=[];for(;!s(`endmacro`);)n.push(a());return new ro(e,t,n)}function h(e=!1){let t=e?oe:_,r=[t()],i=o(L.Comma);for(;i&&(++n,r.push(t()),o(L.Comma)););return i?new ho(r):r[0]}function g(){let e=h(!0);if(!(e instanceof co||e instanceof ho))throw SyntaxError(`Expected identifier/tuple for the loop variable, got ${e.type} instead`);if(!c(`in`))throw SyntaxError("Expected `in` keyword following loop variable");++n;let t=_();r(L.CloseStatement,`Expected closing statement token`);let i=[];for(;!s(`endfor`,`else`);)i.push(a());let o=[];if(s(`else`))for(++n,++n,r(L.CloseStatement,`Expected closing statement token`);!s(`endfor`);)o.push(a());return new $a(e,t,i,o)}function _(){return v()}function v(){let e=y();if(c(`if`)){++n;let t=y();return c(`else`)?(++n,new Do(t,e,v())):new bo(e,t)}return e}function y(){let t=b();for(;c(`or`);){let r=e[n];++n;let i=b();t=new _o(r,t,i)}return t}function b(){let t=x();for(;c(`and`);){let r=e[n];++n;let i=x();t=new _o(r,t,i)}return t}function x(){let t;for(;c(`not`);){let r=e[n];++n,t=new So(r,x())}return t??ee()}function ee(){let t=S();for(;;){let r;if(c(`not`,`in`))r=new Ha(`not in`,L.Identifier),n+=2;else if(c(`in`))r=e[n++];else if(o(L.ComparisonBinaryOperator))r=e[n++];else break;let i=S();t=new _o(r,t,i)}return t}function S(){let t=E();for(;o(L.AdditiveBinaryOperator);){let r=e[n];++n;let i=E();t=new _o(r,t,i)}return t}function te(){let e=T(oe());return o(L.OpenParen)?C(e):e}function C(e){let t=new so(e,w());return t=T(t),o(L.OpenParen)&&(t=C(t)),t}function w(){r(L.OpenParen,`Expected opening parenthesis for arguments list`);let e=ne();return r(L.CloseParen,`Expected closing parenthesis for arguments list`),e}function ne(){let t=[];for(;!o(L.CloseParen);){let r;if(e[n].type===L.MultiplicativeBinaryOperator&&e[n].value===`*`)++n,r=new To(_());else if(r=_(),o(L.Equals)){if(++n,!(r instanceof co))throw SyntaxError(`Expected identifier for keyword argument`);let e=_();r=new wo(r,e)}t.push(r),o(L.Comma)&&++n}return t}function re(){let e=[],t=!1;for(;!o(L.CloseSquareBracket);)o(L.Colon)?(e.push(void 0),++n,t=!0):(e.push(_()),o(L.Colon)&&(++n,t=!0));if(e.length===0)throw SyntaxError(`Expected at least one argument for member/slice expression`);if(t){if(e.length>3)throw SyntaxError(`Expected 0-3 arguments for slice expression`);return new Co(...e)}return e[0]}function T(t){for(;o(L.Dot)||o(L.OpenSquareBracket);){let i=e[n];++n;let a,o=i.type===L.OpenSquareBracket;if(o)a=re(),r(L.CloseSquareBracket,`Expected closing square bracket`);else if(a=oe(),a.type!==`Identifier`)throw SyntaxError(`Expected identifier following dot operator`);t=new oo(t,a,o)}return t}function E(){let t=ie();for(;o(L.MultiplicativeBinaryOperator);){let r=e[n++],i=ie();t=new _o(r,t,i)}return t}function ie(){let e=ae();for(;c(`is`);){++n;let t=c(`not`);t&&++n;let r=oe();if(!(r instanceof co))throw SyntaxError(`Expected identifier for the test`);e=new xo(e,t,r)}return e}function ae(){let e=te();for(;o(L.Pipe);){++n;let t=oe();if(!(t instanceof co))throw SyntaxError(`Expected identifier for the filter`);o(L.OpenParen)&&(t=C(t)),e=new vo(e,t)}return e}function oe(){let t=e[n++];switch(t.type){case L.NumericLiteral:{let e=t.value;return e.includes(`.`)?new fo(Number(e)):new uo(Number(e))}case L.StringLiteral:{let r=t.value;for(;o(L.StringLiteral);)r+=e[n++].value;return new po(r)}case L.Identifier:return new co(t.value);case L.OpenParen:{let e=h();return r(L.CloseParen,"Expected closing parenthesis, got ${tokens[current].type} instead."),e}case L.OpenSquareBracket:{let e=[];for(;!o(L.CloseSquareBracket);)e.push(_()),o(L.Comma)&&++n;return++n,new mo(e)}case L.OpenCurlyBracket:{let e=new Map;for(;!o(L.CloseCurlyBracket);){let t=_();r(L.Colon,`Expected colon between key and value in object literal`);let i=_();e.set(t,i),o(L.Comma)&&++n}return++n,new go(e)}default:throw SyntaxError(`Unexpected token: ${t.type}`)}}for(;n0)for(let i=e;it;i+=n)r.push(i);return r}function Ao(e,t,n,r=1){let i=Math.sign(r);i>=0?(t=(t??=0)<0?Math.max(e.length+t,0):Math.min(t,e.length),n=(n??=e.length)<0?Math.max(e.length+n,0):Math.min(n,e.length)):(t=(t??=e.length-1)<0?Math.max(e.length+t,-1):Math.min(t,e.length-1),n=(n??=-1)<-1?Math.max(e.length+n,-1):Math.min(n,e.length-1));let a=[];for(let o=t;i*oe.toUpperCase())}function Mo(e){return No(new Date,e)}function No(e,t){let n=new Intl.DateTimeFormat(void 0,{month:`long`}),r=new Intl.DateTimeFormat(void 0,{month:`short`}),i=e=>e<10?`0`+e:e.toString();return t.replace(/%[YmdbBHM%]/g,t=>{switch(t){case`%Y`:return e.getFullYear().toString();case`%m`:return i(e.getMonth()+1);case`%d`:return i(e.getDate());case`%b`:return r.format(e);case`%B`:return n.format(e);case`%H`:return i(e.getHours());case`%M`:return i(e.getMinutes());case`%%`:return`%`;default:return t}})}function Po(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Fo(e,t,n,r){if(r===0)return e;let i=r==null||r<0?1/0:r,a=t.length===0?RegExp(`(?=)`,`gu`):new RegExp(Po(t),`gu`);return e.replaceAll(a,e=>i>0?(--i,n):e)}var Io=class extends Error{},Lo=class extends Error{},Ro=class{type=`RuntimeValue`;value;builtins=new Map;constructor(e=void 0){this.value=e}__bool__(){return new B(!!this.value)}toString(){return String(this.value)}},R=class extends Ro{type=`IntegerValue`},zo=class extends Ro{type=`FloatValue`;toString(){return this.value%1==0?this.value.toFixed(1):this.value.toString()}},z=class extends Ro{type=`StringValue`;builtins=new Map([[`upper`,new Ko(()=>new z(this.value.toUpperCase()))],[`lower`,new Ko(()=>new z(this.value.toLowerCase()))],[`strip`,new Ko(()=>new z(this.value.trim()))],[`title`,new Ko(()=>new z(jo(this.value)))],[`capitalize`,new Ko(()=>new z(this.value.charAt(0).toUpperCase()+this.value.slice(1)))],[`length`,new R(this.value.length)],[`rstrip`,new Ko(()=>new z(this.value.trimEnd()))],[`lstrip`,new Ko(()=>new z(this.value.trimStart()))],[`startswith`,new Ko(e=>{if(e.length===0)throw Error(`startswith() requires at least one argument`);let t=e[0];if(t instanceof z)return new B(this.value.startsWith(t.value));if(t instanceof V){for(let e of t.value){if(!(e instanceof z))throw Error(`startswith() tuple elements must be strings`);if(this.value.startsWith(e.value))return new B(!0)}return new B(!1)}throw Error(`startswith() argument must be a string or tuple of strings`)})],[`endswith`,new Ko(e=>{if(e.length===0)throw Error(`endswith() requires at least one argument`);let t=e[0];if(t instanceof z)return new B(this.value.endsWith(t.value));if(t instanceof V){for(let e of t.value){if(!(e instanceof z))throw Error(`endswith() tuple elements must be strings`);if(this.value.endsWith(e.value))return new B(!0)}return new B(!1)}throw Error(`endswith() argument must be a string or tuple of strings`)})],[`split`,new Ko(e=>{let t=e[0]??new qo;if(!(t instanceof z||t instanceof qo))throw Error(`sep argument must be a string or null`);let n=e[1]??new R(-1);if(!(n instanceof R))throw Error(`maxsplit argument must be a number`);let r=[];if(t instanceof qo){let e=this.value.trimStart();for(let{0:t,index:i}of e.matchAll(/\S+/g)){if(n.value!==-1&&r.length>=n.value&&i!==void 0){r.push(t+e.slice(i+t.length));break}r.push(t)}}else{if(t.value===``)throw Error(`empty separator`);r=this.value.split(t.value),n.value!==-1&&r.length>n.value&&r.push(r.splice(n.value).join(t.value))}return new V(r.map(e=>new z(e)))})],[`replace`,new Ko(e=>{if(e.length<2)throw Error(`replace() requires at least two arguments`);let t=e[0],n=e[1];if(!(t instanceof z&&n instanceof z))throw Error(`replace() arguments must be strings`);let r;if(r=e.length>2?e[2].type===`KeywordArgumentsValue`?e[2].value.get(`count`)??new qo:e[2]:new qo,!(r instanceof R||r instanceof qo))throw Error(`replace() count argument must be a number or null`);return new z(Fo(this.value,t.value,n.value,r.value))})]])},B=class extends Ro{type=`BooleanValue`},Bo=/[\x7f-\uffff]/g;function Vo(e){return e.replace(Bo,e=>`\\u`+e.charCodeAt(0).toString(16).padStart(4,`0`))}function Ho(e,t={},n=0,r=!0){let{indent:i=null,ensureAscii:a=!1,separators:o=null,sortKeys:s=!1}=t,c,l;switch(o?[c,l]=o:i?(c=`,`,l=`: `):(c=`, `,l=`: `),e.type){case`NullValue`:return`null`;case`UndefinedValue`:return r?`null`:`undefined`;case`IntegerValue`:case`FloatValue`:case`BooleanValue`:return JSON.stringify(e.value);case`StringValue`:{let t=JSON.stringify(e.value);return a&&(t=Vo(t)),t}case`ArrayValue`:case`ObjectValue`:{let o=i?` `.repeat(i):``,u=` +`+o.repeat(n),d=u+o;if(e.type===`ArrayValue`){let a=e.value.map(e=>Ho(e,t,n+1,r));return i?`[${d}${a.join(`${c}${d}`)}${u}]`:`[${a.join(c)}]`}else{let o=Array.from(e.value.entries());s&&(o=o.sort(([e],[t])=>e.localeCompare(t)));let f=o.map(([e,o])=>{let s=JSON.stringify(e);a&&(s=Vo(s));let c=`${s}${l}${Ho(o,t,n+1,r)}`;return i?`${d}${c}`:c});return i?`{${f.join(c)}${u}}`:`{${f.join(c)}}`}}default:throw Error(`Cannot convert to JSON: ${e.type}`)}}var Uo=class extends Ro{type=`ObjectValue`;__bool__(){return new B(this.value.size>0)}builtins=new Map([[`get`,new Ko(([e,t])=>{if(!(e instanceof z))throw Error(`Object key must be a string: got ${e.type}`);return this.value.get(e.value)??t??new qo})],[`items`,new Ko(()=>this.items())],[`keys`,new Ko(()=>this.keys())],[`values`,new Ko(()=>this.values())],[`dictsort`,new Ko(e=>{let t=new Map,n=e.filter(e=>e instanceof Wo?(t=e.value,!1):!0),r=n.at(0)??t.get(`case_sensitive`)??new B(!1);if(!(r instanceof B))throw Error(`case_sensitive must be a boolean`);let i=n.at(1)??t.get(`by`)??new z(`key`);if(!(i instanceof z))throw Error(`by must be a string`);if(![`key`,`value`].includes(i.value))throw Error(`by must be either 'key' or 'value'`);let a=n.at(2)??t.get(`reverse`)??new B(!1);if(!(a instanceof B))throw Error(`reverse must be a boolean`);return new V(Array.from(this.value.entries()).map(([e,t])=>new V([new z(e),t])).sort((e,t)=>{let n=i.value===`key`?0:1,o=e.value[n],s=t.value[n],c=Qo(o,s,r.value);return a.value?-c:c}))})]]);items(){return new V(Array.from(this.value.entries()).map(([e,t])=>new V([new z(e),t])))}keys(){return new V(Array.from(this.value.keys()).map(e=>new z(e)))}values(){return new V(Array.from(this.value.values()))}toString(){return Ho(this,{},0,!1)}},Wo=class extends Uo{type=`KeywordArgumentsValue`},V=class extends Ro{type=`ArrayValue`;builtins=new Map([[`length`,new R(this.value.length)]]);__bool__(){return new B(this.value.length>0)}toString(){return Ho(this,{},0,!1)}},Go=class extends V{type=`TupleValue`},Ko=class extends Ro{type=`FunctionValue`},qo=class extends Ro{type=`NullValue`},Jo=class extends Ro{type=`UndefinedValue`},Yo=class{constructor(e){this.parent=e}variables=new Map([[`namespace`,new Ko(e=>{if(e.length===0)return new Uo(new Map);if(e.length!==1||!(e[0]instanceof Uo))throw Error("`namespace` expects either zero arguments or a single object argument");return e[0]})]]);tests=new Map([[`boolean`,e=>e.type===`BooleanValue`],[`callable`,e=>e instanceof Ko],[`odd`,e=>{if(!(e instanceof R))throw Error(`cannot odd on ${e.type}`);return e.value%2!=0}],[`even`,e=>{if(!(e instanceof R))throw Error(`cannot even on ${e.type}`);return e.value%2==0}],[`false`,e=>e.type===`BooleanValue`&&!e.value],[`true`,e=>e.type===`BooleanValue`&&e.value],[`none`,e=>e.type===`NullValue`],[`string`,e=>e.type===`StringValue`],[`number`,e=>e instanceof R||e instanceof zo],[`integer`,e=>e instanceof R],[`iterable`,e=>e.type===`ArrayValue`||e.type===`StringValue`],[`mapping`,e=>e instanceof Uo],[`sequence`,e=>e instanceof V||e instanceof Uo||e instanceof z],[`lower`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toLowerCase()}],[`upper`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toUpperCase()}],[`none`,e=>e.type===`NullValue`],[`defined`,e=>e.type!==`UndefinedValue`],[`undefined`,e=>e.type===`UndefinedValue`],[`equalto`,(e,t)=>e.value===t.value],[`eq`,(e,t)=>e.value===t.value]]);set(e,t){return this.declareVariable(e,es(t))}declareVariable(e,t){if(this.variables.has(e))throw SyntaxError(`Variable already declared: ${e}`);return this.variables.set(e,t),t}setVariable(e,t){return this.variables.set(e,t),t}resolve(e){if(this.variables.has(e))return this;if(this.parent)return this.parent.resolve(e);throw Error(`Unknown variable: ${e}`)}lookupVariable(e){try{return this.resolve(e).variables.get(e)??new Jo}catch{return new Jo}}};function Xo(e){e.set(`false`,!1),e.set(`true`,!0),e.set(`none`,null),e.set(`raise_exception`,e=>{throw Error(e)}),e.set(`range`,ko),e.set(`strftime_now`,Mo),e.set(`True`,!0),e.set(`False`,!1),e.set(`None`,null)}function Zo(e,t){let n=t.split(`.`),r=e;for(let e of n)if(r instanceof Uo)r=r.value.get(e)??new Jo;else if(r instanceof V){let t=parseInt(e,10);if(!isNaN(t)&&t>=0&&te instanceof R||e instanceof zo||e instanceof B,i=e=>e instanceof B?+!!e.value:e.value;if(r(e)&&r(t)){let n=i(e),r=i(t);return nr)}if(e.type!==t.type)throw Error(`Cannot compare different types: ${e.type} and ${t.type}`);switch(e.type){case`StringValue`:{let r=e.value,i=t.value;return n||(r=r.toLowerCase(),i=i.toLowerCase()),ri)}default:throw Error(`Cannot compare type: ${e.type}`)}}var $o=class{global;constructor(e){this.global=e??new Yo}run(e){return this.evaluate(e,this.global)}evaluateBinaryExpression(e,t){let n=this.evaluate(e.left,t);switch(e.operator.value){case`and`:return n.__bool__().value?this.evaluate(e.right,t):n;case`or`:return n.__bool__().value?n:this.evaluate(e.right,t)}let r=this.evaluate(e.right,t);switch(e.operator.value){case`==`:return new B(n.value==r.value);case`!=`:return new B(n.value!=r.value)}if(n instanceof Jo||r instanceof Jo){if(r instanceof Jo&&[`in`,`not in`].includes(e.operator.value))return new B(e.operator.value===`not in`);throw Error(`Cannot perform operation ${e.operator.value} on undefined values`)}else if(n instanceof qo||r instanceof qo)throw Error(`Cannot perform operation on null values`);else if(e.operator.value===`~`)return new z(n.value.toString()+r.value.toString());else if((n instanceof R||n instanceof zo)&&(r instanceof R||r instanceof zo)){let t=n.value,i=r.value;switch(e.operator.value){case`+`:case`-`:case`*`:{let a=e.operator.value===`+`?t+i:e.operator.value===`-`?t-i:t*i;return n instanceof zo||r instanceof zo?new zo(a):new R(a)}case`/`:return new zo(t/i);case`%`:{let e=t%i;return n instanceof zo||r instanceof zo?new zo(e):new R(e)}case`<`:return new B(t`:return new B(t>i);case`>=`:return new B(t>=i);case`<=`:return new B(t<=i)}}else if(n instanceof V&&r instanceof V)switch(e.operator.value){case`+`:return new V(n.value.concat(r.value))}else if(r instanceof V){let t=r.value.find(e=>e.value===n.value)!==void 0;switch(e.operator.value){case`in`:return new B(t);case`not in`:return new B(!t)}}if(n instanceof z||r instanceof z)switch(e.operator.value){case`+`:return new z(n.value.toString()+r.value.toString())}if(n instanceof z&&r instanceof z)switch(e.operator.value){case`in`:return new B(r.value.includes(n.value));case`not in`:return new B(!r.value.includes(n.value))}if(n instanceof z&&r instanceof Uo)switch(e.operator.value){case`in`:return new B(r.value.has(n.value));case`not in`:return new B(!r.value.has(n.value))}throw SyntaxError(`Unknown operator "${e.operator.value}" between ${n.type} and ${r.type}`)}evaluateArguments(e,t){let n=[],r=new Map;for(let i of e)if(i.type===`SpreadExpression`){let e=i,r=this.evaluate(e.argument,t);if(!(r instanceof V))throw Error(`Cannot unpack non-iterable type: ${r.type}`);for(let e of r.value)n.push(e)}else if(i.type===`KeywordArgumentExpression`){let e=i;r.set(e.key.value,this.evaluate(e.value,t))}else{if(r.size>0)throw Error(`Positional arguments must come before keyword arguments`);n.push(this.evaluate(i,t))}return[n,r]}applyFilter(e,t,n){if(t.type===`Identifier`){let r=t;if(r.value===`safe`)return e;if(r.value===`tojson`)return new z(Ho(e,{}));if(e instanceof V)switch(r.value){case`list`:return e;case`first`:return e.value[0];case`last`:return e.value[e.value.length-1];case`length`:return new R(e.value.length);case`reverse`:return new V(e.value.slice().reverse());case`sort`:return new V(e.value.slice().sort((e,t)=>Qo(e,t,!1)));case`join`:return new z(e.value.map(e=>e.value).join(``));case`string`:return new z(Ho(e,{},0,!1));case`unique`:{let t=new Set,n=[];for(let r of e.value)t.has(r.value)||(t.add(r.value),n.push(r));return new V(n)}default:throw Error(`Unknown ArrayValue filter: ${r.value}`)}else if(e instanceof z)switch(r.value){case`length`:case`upper`:case`lower`:case`title`:case`capitalize`:{let t=e.builtins.get(r.value);if(t instanceof Ko)return t.value([],n);if(t instanceof R)return t;throw Error(`Unknown StringValue filter: ${r.value}`)}case`trim`:return new z(e.value.trim());case`indent`:return new z(e.value.split(` +`).map((e,t)=>t===0||e.length===0?e:` `+e).join(` +`));case`join`:case`string`:return e;case`int`:{let t=parseInt(e.value,10);return new R(isNaN(t)?0:t)}case`float`:{let t=parseFloat(e.value);return new zo(isNaN(t)?0:t)}default:throw Error(`Unknown StringValue filter: ${r.value}`)}else if(e instanceof R||e instanceof zo)switch(r.value){case`abs`:return e instanceof R?new R(Math.abs(e.value)):new zo(Math.abs(e.value));case`int`:return new R(Math.floor(e.value));case`float`:return new zo(e.value);case`string`:return new z(e.toString());default:throw Error(`Unknown NumericValue filter: ${r.value}`)}else if(e instanceof Uo)switch(r.value){case`items`:return new V(Array.from(e.value.entries()).map(([e,t])=>new V([new z(e),t])));case`length`:return new R(e.value.size);default:{let t=e.builtins.get(r.value);if(t)return t instanceof Ko?t.value([],n):t;throw Error(`Unknown ObjectValue filter: ${r.value}`)}}else if(e instanceof B)switch(r.value){case`bool`:return new B(e.value);case`int`:return new R(+!!e.value);case`float`:return new zo(+!!e.value);case`string`:return new z(e.value?`true`:`false`);default:throw Error(`Unknown BooleanValue filter: ${r.value}`)}throw Error(`Cannot apply filter "${r.value}" to type: ${e.type}`)}else if(t.type===`CallExpression`){let r=t;if(r.callee.type!==`Identifier`)throw Error(`Unknown filter: ${r.callee.type}`);let i=r.callee.value;if(i===`tojson`){let[,t]=this.evaluateArguments(r.args,n),i=t.get(`indent`)??new qo;if(!(i instanceof R||i instanceof qo))throw Error(`If set, indent must be a number`);let a=t.get(`ensure_ascii`)??new B(!1);if(!(a instanceof B))throw Error(`If set, ensure_ascii must be a boolean`);let o=t.get(`sort_keys`)??new B(!1);if(!(o instanceof B))throw Error(`If set, sort_keys must be a boolean`);let s=t.get(`separators`)??new qo,c=null;if(s instanceof V||s instanceof Go){if(s.value.length!==2)throw Error(`separators must be a tuple of two strings`);let[e,t]=s.value;if(!(e instanceof z)||!(t instanceof z))throw Error(`separators must be a tuple of two strings`);c=[e.value,t.value]}else if(!(s instanceof qo))throw Error(`If set, separators must be a tuple of two strings`);return new z(Ho(e,{indent:i.value,ensureAscii:a.value,sortKeys:o.value,separators:c}))}else if(i===`join`){let t;if(e instanceof z)t=Array.from(e.value);else if(e instanceof V)t=e.value.map(e=>e.value);else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`);let[a,o]=this.evaluateArguments(r.args,n),s=a.at(0)??o.get(`separator`)??new z(``);if(!(s instanceof z))throw Error(`separator must be a string`);return new z(t.join(s.value))}else if(i===`int`||i===`float`){let[t,a]=this.evaluateArguments(r.args,n),o=t.at(0)??a.get(`default`)??(i===`int`?new R(0):new zo(0));if(e instanceof z){let t=i===`int`?parseInt(e.value,10):parseFloat(e.value);return isNaN(t)?o:i===`int`?new R(t):new zo(t)}else if(e instanceof R||e instanceof zo)return e;else if(e instanceof B)return i===`int`?new R(+!!e.value):new zo(+!!e.value);else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`)}else if(i==="default"){let[t,i]=this.evaluateArguments(r.args,n),a=t[0]??new z(``),o=t[1]??i.get(`boolean`)??new B(!1);if(!(o instanceof B))throw Error("`default` filter flag must be a boolean");return e instanceof Jo||o.value&&!e.__bool__().value?a:e}if(e instanceof V){switch(i){case`sort`:{let[t,i]=this.evaluateArguments(r.args,n),a=t.at(0)??i.get(`reverse`)??new B(!1);if(!(a instanceof B))throw Error(`reverse must be a boolean`);let o=t.at(1)??i.get(`case_sensitive`)??new B(!1);if(!(o instanceof B))throw Error(`case_sensitive must be a boolean`);let s=t.at(2)??i.get(`attribute`)??new qo;if(!(s instanceof z||s instanceof R||s instanceof qo))throw Error(`attribute must be a string, integer, or null`);let c=e=>s instanceof qo?e:Zo(e,s instanceof R?String(s.value):s.value);return new V(e.value.slice().sort((e,t)=>{let n=Qo(c(e),c(t),o.value);return a.value?-n:n}))}case`selectattr`:case`rejectattr`:{let t=i===`selectattr`;if(e.value.some(e=>!(e instanceof Uo)))throw Error(`\`${i}\` can only be applied to array of objects`);if(r.args.some(e=>e.type!==`StringLiteral`))throw Error(`arguments of \`${i}\` must be strings`);let[a,o,s]=r.args.map(e=>this.evaluate(e,n)),c;if(o){let e=n.tests.get(o.value);if(!e)throw Error(`Unknown test: ${o.value}`);c=e}else c=(...e)=>e[0].__bool__().value;return new V(e.value.filter(e=>{let n=e.value.get(a.value),r=n?c(n,s):!1;return t?r:!r}))}case`map`:{let[,t]=this.evaluateArguments(r.args,n);if(t.has(`attribute`)){let n=t.get(`attribute`);if(!(n instanceof z))throw Error(`attribute must be a string`);let r=t.get(`default`);return new V(e.value.map(e=>{if(!(e instanceof Uo))throw Error(`items in map must be an object`);let t=Zo(e,n.value);return t instanceof Jo?r??new Jo:t}))}else throw Error("`map` expressions without `attribute` set are not currently supported.")}}throw Error(`Unknown ArrayValue filter: ${i}`)}else if(e instanceof z){switch(i){case`indent`:{let[t,i]=this.evaluateArguments(r.args,n),a=t.at(0)??i.get(`width`)??new R(4);if(!(a instanceof R))throw Error(`width must be a number`);let o=t.at(1)??i.get(`first`)??new B(!1),s=t.at(2)??i.get(`blank`)??new B(!1),c=e.value.split(` +`),l=` `.repeat(a.value);return new z(c.map((e,t)=>!o.value&&t===0||!s.value&&e.length===0?e:l+e).join(` +`))}case`replace`:{let t=e.builtins.get(`replace`);if(!(t instanceof Ko))throw Error(`replace filter not available`);let[i,a]=this.evaluateArguments(r.args,n);return t.value([...i,new Wo(a)],n)}}throw Error(`Unknown StringValue filter: ${i}`)}else if(e instanceof Uo){let t=e.builtins.get(i);if(t&&t instanceof Ko){let[e,i]=this.evaluateArguments(r.args,n);return i.size>0&&e.push(new Wo(i)),t.value(e,n)}throw Error(`Unknown ObjectValue filter: ${i}`)}else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`)}throw Error(`Unknown filter: ${t.type}`)}evaluateFilterExpression(e,t){let n=this.evaluate(e.operand,t);return this.applyFilter(n,e.filter,t)}evaluateTestExpression(e,t){let n=this.evaluate(e.operand,t),r=t.tests.get(e.test.value);if(!r)throw Error(`Unknown test: ${e.test.value}`);let i=r(n);return new B(e.negate?!i:i)}evaluateSelectExpression(e,t){return this.evaluate(e.test,t).__bool__().value?this.evaluate(e.lhs,t):new Jo}evaluateUnaryExpression(e,t){let n=this.evaluate(e.argument,t);switch(e.operator.value){case`not`:return new B(!n.value);default:throw SyntaxError(`Unknown operator: ${e.operator.value}`)}}evaluateTernaryExpression(e,t){return this.evaluate(e.condition,t).__bool__().value?this.evaluate(e.trueExpr,t):this.evaluate(e.falseExpr,t)}evalProgram(e,t){return this.evaluateBlock(e.body,t)}evaluateBlock(e,t){let n=``;for(let r of e){let e=this.evaluate(r,t);e.type!==`NullValue`&&e.type!==`UndefinedValue`&&(n+=e.toString())}return new z(n)}evaluateIdentifier(e,t){return t.lookupVariable(e.value)}evaluateCallExpression(e,t){let[n,r]=this.evaluateArguments(e.args,t);r.size>0&&n.push(new Wo(r));let i=this.evaluate(e.callee,t);if(i.type!==`FunctionValue`)throw Error(`Cannot call something that is not a function: got ${i.type}`);return i.value(n,t)}evaluateSliceExpression(e,t,n){if(!(e instanceof V||e instanceof z))throw Error(`Slice object must be an array or string`);let r=this.evaluate(t.start,n),i=this.evaluate(t.stop,n),a=this.evaluate(t.step,n);if(!(r instanceof R||r instanceof Jo))throw Error(`Slice start must be numeric or undefined`);if(!(i instanceof R||i instanceof Jo))throw Error(`Slice stop must be numeric or undefined`);if(!(a instanceof R||a instanceof Jo))throw Error(`Slice step must be numeric or undefined`);return e instanceof V?new V(Ao(e.value,r.value,i.value,a.value)):new z(Ao(Array.from(e.value),r.value,i.value,a.value).join(``))}evaluateMemberExpression(e,t){let n=this.evaluate(e.object,t),r;if(e.computed){if(e.property.type===`SliceExpression`)return this.evaluateSliceExpression(n,e.property,t);r=this.evaluate(e.property,t)}else r=new z(e.property.value);let i;if(n instanceof Uo){if(!(r instanceof z))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.value.get(r.value)??n.builtins.get(r.value)}else if(n instanceof V||n instanceof z)if(r instanceof R)i=n.value.at(r.value),n instanceof z&&(i=new z(n.value.at(r.value)));else if(r instanceof z)i=n.builtins.get(r.value);else throw Error(`Cannot access property with non-string/non-number: got ${r.type}`);else{if(!(r instanceof z))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.builtins.get(r.value)}return i instanceof Ro?i:new Jo}evaluateSet(e,t){let n=e.value?this.evaluate(e.value,t):this.evaluateBlock(e.body,t);if(e.assignee.type===`Identifier`){let r=e.assignee.value;t.setVariable(r,n)}else if(e.assignee.type===`TupleLiteral`){let r=e.assignee;if(!(n instanceof V))throw Error(`Cannot unpack non-iterable type in set: ${n.type}`);let i=n.value;if(i.length!==r.value.length)throw Error(`Too ${r.value.length>i.length?`few`:`many`} items to unpack in set`);for(let e=0;et.setVariable(e.loopvar.value,c);else if(e.loopvar.type===`TupleLiteral`){let t=e.loopvar;if(c.type!==`ArrayValue`)throw Error(`Cannot unpack non-iterable type: ${c.type}`);let n=c;if(t.value.length!==n.value.length)throw Error(`Too ${t.value.length>n.value.length?`few`:`many`} items to unpack`);l=e=>{for(let r=0;r0?a[t-1]:new Jo],[`nextitem`,t{let r=new Yo(n);t=t.slice();let i;t.at(-1)?.type===`KeywordArgumentsValue`&&(i=t.pop());for(let n=0;n{let r=new Yo(n);if(e.callerArgs)for(let n=0;nthis.evaluate(e,t)));case`TupleLiteral`:return new Go(e.value.map(e=>this.evaluate(e,t)));case`ObjectLiteral`:{let n=new Map;for(let[r,i]of e.value){let e=this.evaluate(r,t);if(!(e instanceof z))throw Error(`Object keys must be strings: got ${e.type}`);n.set(e.value,this.evaluate(i,t))}return new Uo(n)}case`Identifier`:return this.evaluateIdentifier(e,t);case`CallExpression`:return this.evaluateCallExpression(e,t);case`MemberExpression`:return this.evaluateMemberExpression(e,t);case`UnaryExpression`:return this.evaluateUnaryExpression(e,t);case`BinaryExpression`:return this.evaluateBinaryExpression(e,t);case`FilterExpression`:return this.evaluateFilterExpression(e,t);case`FilterStatement`:return this.evaluateFilterStatement(e,t);case`TestExpression`:return this.evaluateTestExpression(e,t);case`SelectExpression`:return this.evaluateSelectExpression(e,t);case`Ternary`:return this.evaluateTernaryExpression(e,t);case`Comment`:return new qo;default:throw SyntaxError(`Unknown node type: ${e.type}`)}}};function es(e){switch(typeof e){case`number`:return Number.isInteger(e)?new R(e):new zo(e);case`string`:return new z(e);case`boolean`:return new B(e);case`undefined`:return new Jo;case`object`:return e===null?new qo:Array.isArray(e)?new V(e.map(es)):new Uo(new Map(Object.entries(e).map(([e,t])=>[e,es(t)])));case`function`:return new Ko((t,n)=>es(e(...t.map(e=>e.value))??null));default:throw Error(`Cannot convert to runtime value: ${e}`)}}var ts=` +`,ns=`{%- `,rs=` -%}`;function is(e){switch(e.operator.type){case`MultiplicativeBinaryOperator`:return 4;case`AdditiveBinaryOperator`:return 3;case`ComparisonBinaryOperator`:return 2;case`Identifier`:return e.operator.value===`and`?1:e.operator.value===`in`||e.operator.value===`not in`?2:0}return 0}function as(e,t=` `){let n=typeof t==`number`?` `.repeat(t):t;return ss(e.body,0,n).replace(/\n$/,``)}function os(...e){return ns+e.join(` `)+rs}function ss(e,t,n){return e.map(e=>cs(e,t,n)).join(ts)}function cs(e,t,n){let r=n.repeat(t);switch(e.type){case`Program`:return ss(e.body,t,n);case`If`:return ls(e,t,n);case`For`:return us(e,t,n);case`Set`:return ds(e,t,n);case`Macro`:return fs(e,t,n);case`Break`:return r+os(`break`);case`Continue`:return r+os(`continue`);case`CallStatement`:return ps(e,t,n);case`FilterStatement`:return ms(e,t,n);case`Comment`:return r+`{# `+e.value+` #}`;default:return r+`{{- `+H(e)+` -}}`}}function ls(e,t,n){let r=n.repeat(t),i=[],a=e;for(;a&&(i.push({test:a.test,body:a.body}),a.alternate.length===1&&a.alternate[0].type===`If`);)a=a.alternate[0];let o=r+os(`if`,H(i[0].test))+ts+ss(i[0].body,t+1,n);for(let e=1;e0&&(o+=ts+r+os(`else`)+ts+ss(a.alternate,t+1,n)),o+=ts+r+os(`endif`),o}function us(e,t,n){let r=n.repeat(t),i=``;if(e.iterable.type===`SelectExpression`){let t=e.iterable;i=`${H(t.lhs)} if ${H(t.test)}`}else i=H(e.iterable);let a=r+os(`for`,H(e.loopvar),`in`,i)+ts+ss(e.body,t+1,n);return e.defaultBlock.length>0&&(a+=ts+r+os(`else`)+ts+ss(e.defaultBlock,t+1,n)),a+=ts+r+os(`endfor`),a}function ds(e,t,n){let r=n.repeat(t),i=H(e.assignee),a=e.value?H(e.value):``,o=r+os(`set`,`${i}${e.value?` = `+a:``}`);return e.body.length===0?o:o+ts+ss(e.body,t+1,n)+ts+r+os(`endset`)}function fs(e,t,n){let r=n.repeat(t),i=e.args.map(H).join(`, `);return r+os(`macro`,`${e.name.value}(${i})`)+ts+ss(e.body,t+1,n)+ts+r+os(`endmacro`)}function ps(e,t,n){let r=n.repeat(t),i=e.callerArgs&&e.callerArgs.length>0?`(${e.callerArgs.map(H).join(`, `)})`:``,a=H(e.call),o=r+os(`call${i}`,a)+ts;return o+=ss(e.body,t+1,n)+ts,o+=r+os(`endcall`),o}function ms(e,t,n){let r=n.repeat(t),i=r+os(`filter`,e.filter.type===`Identifier`?e.filter.value:H(e.filter))+ts;return i+=ss(e.body,t+1,n)+ts,i+=r+os(`endfilter`),i}function H(e,t=-1){switch(e.type){case`SpreadExpression`:return`*${H(e.argument)}`;case`Identifier`:return e.value;case`IntegerLiteral`:return`${e.value}`;case`FloatLiteral`:return`${e.value}`;case`StringLiteral`:return JSON.stringify(e.value);case`BinaryExpression`:{let n=e,r=is(n),i=H(n.left,r),a=H(n.right,r+1),o=`${i} ${n.operator.value} ${a}`;return r`${H(e)}: ${H(t)}`).join(`, `)}}`;case`SliceExpression`:{let t=e;return`${t.start?H(t.start):``}:${t.stop?H(t.stop):``}${t.step?`:${H(t.step)}`:``}`}case`KeywordArgumentExpression`:{let t=e;return`${t.key.value}=${H(t.value)}`}case`Ternary`:{let n=e,r=`${H(n.trueExpr)} if ${H(n.condition,0)} else ${H(n.falseExpr)}`;return t>-1?`(${r})`:r}default:throw Error(`Unknown expression type: ${e.type}`)}}var hs=class{parsed;constructor(e){let t=Ya(e,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=Oo(t)}render(e){let t=new Yo;if(Xo(t),e)for(let[n,r]of Object.entries(e))t.set(n,r);return new $o(t).run(this.parsed).value}format(e){return as(this.parsed,e?.indent||` `)}},gs={txt:`text/plain`,html:`text/html`,css:`text/css`,js:`text/javascript`,json:`application/json`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`},_s=class e{constructor(e){if(this.filePath=e,this.headers=new Headers,this.exists=wr.existsSync(e),this.exists){this.status=200,this.statusText=`OK`;let t=wr.statSync(e);this.headers.set(`content-length`,t.size.toString()),this.updateContentType();let n=wr.createReadStream(e);this.body=new ReadableStream({start(e){n.on(`data`,t=>e.enqueue(t)),n.on(`end`,()=>e.close()),n.on(`error`,t=>e.error(t))},cancel(){n.destroy()}})}else this.status=404,this.statusText=`Not Found`,this.body=null}updateContentType(){let e=this.filePath.toString().split(`.`).pop().toLowerCase();this.headers.set(`content-type`,gs[e]??`application/octet-stream`)}clone(){let t=new e(this.filePath);return t.exists=this.exists,t.status=this.status,t.statusText=this.statusText,t.headers=new Headers(this.headers),t}async arrayBuffer(){return(await wr.promises.readFile(this.filePath)).buffer}async blob(){let e=await wr.promises.readFile(this.filePath);return new Blob([e],{type:this.headers.get(`content-type`)})}async text(){return await wr.promises.readFile(this.filePath,`utf8`)}async json(){return JSON.parse(await this.text())}},vs=class{constructor(e){this._mt=new Uint32Array(624),this._idx=625,this._gauss_next=null,this._random_fn=this.random.bind(this),this.seed(e)}seed(e){if(e==null)if(j.IS_CRYPTO_AVAILABLE){let t=new Uint32Array(1);crypto.getRandomValues(t),e=t[0]}else e=Date.now()>>>0;let t=this._mt,n=(e,t)=>Math.imul(e,t)>>>0,r=[];for(let t=e||0;t>0;t=Math.floor(t/4294967296))r.push(t&4294967295);r.length||r.push(0),t[0]=19650218;for(let e=1;e<624;++e)t[e]=n(1812433253,t[e-1]^t[e-1]>>>30)+e>>>0;let i=1,a=0;for(let e=Math.max(624,r.length);e>0;--e,++i,++a)i>=624&&(t[0]=t[623],i=1),a>=r.length&&(a=0),t[i]=(t[i]^n(t[i-1]^t[i-1]>>>30,1664525))+r[a]+a>>>0;for(let e=623;e>0;--e,++i)i>=624&&(t[0]=t[623],i=1),t[i]=(t[i]^n(t[i-1]^t[i-1]>>>30,1566083941))-i>>>0;t[0]=2147483648,this._idx=624,this._gauss_next=null}_int32(){let e=this._mt;if(this._idx>=624){for(let t=0;t<624;++t){let n=e[t]&2147483648|e[(t+1)%624]&2147483647;e[t]=(e[(t+397)%624]^n>>>1^(n&1?2567483615:0))>>>0}this._idx=0}let t=e[this._idx++];return t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0}random(){return((this._int32()>>>5)*67108864+(this._int32()>>>6))/9007199254740992}gauss(e=0,t=1){let n=this._gauss_next;if(this._gauss_next=null,n===null){let e=this.random()*2*Math.PI,t=Math.sqrt(-2*Math.log(1-this.random()));n=Math.cos(e)*t,this._gauss_next=Math.sin(e)*t}return e+n*t}shuffle(e){for(let t=e.length-1;t>0;--t){let n=32-Math.clz32(t+1),r=this._int32()>>>32-n;for(;r>t;)r=this._int32()>>>32-n;let i=e[t];e[t]=e[r],e[r]=i}}choices(e,t){return e[ys(this._random_fn,t)]}};function ys(e,t){let n=0;for(let e=0;eys(xs.random,e),Cs=new vs,ws=class{constructor(e){this.path=e}async match(e){let t=new _s(Tr.join(this.path,e));if(t.exists)return t}async put(e,t,n=void 0){let r=Tr.join(this.path,e),i=r+`.tmp.${j.IS_PROCESS_AVAILABLE?process.pid:Date.now()}.${Cs._int32().toString(36)}`;try{let e=t.headers.get(`Content-Length`),a=parseInt(e??`0`),o=0;await wr.promises.mkdir(Tr.dirname(r),{recursive:!0});let s=wr.createWriteStream(i),c=t.body.getReader();for(;;){let{done:e,value:t}=await c.read();if(e)break;await new Promise((e,n)=>{s.write(t,t=>{if(t){n(t);return}e()})}),o+=t.length;let r=a?o/a*100:0;n?.({progress:r,loaded:o,total:a})}await new Promise((e,t)=>{s.close(n=>n?t(n):e())}),await wr.promises.rename(i,r)}catch(e){try{await wr.promises.unlink(i)}catch{}throw e}}async delete(e){let t=Tr.join(this.path,e);try{return await wr.promises.unlink(t),!0}catch{return!1}}},Ts={400:`Bad request error occurred while trying to load file`,401:`Unauthorized access to file`,403:`Forbidden access to file`,404:`Could not locate file`,408:`Request timeout error occurred while trying to load file`,500:`Internal server error error occurred while trying to load file`,502:`Bad gateway error occurred while trying to load file`,503:`Service unavailable error occurred while trying to load file`,504:`Gateway timeout error occurred while trying to load file`},Es=100,Ds=/^(\b[\w\-.]+\b\/)?\b[\w\-.]{1,96}\b$/;function Os(...e){return e=e.map((t,n)=>(n&&(t=t.replace(RegExp(`^/`),``)),n!==e.length-1&&(t=t.replace(RegExp(`/$`),``)),t)),e.join(`/`)}function ks(e,t=null,n=null){let r;try{r=new URL(e)}catch{return!1}return!(t&&!t.includes(r.protocol)||n&&!n.includes(r.hostname))}function As(e){return!(!Ds.test(e)||e.includes(`..`)||e.includes(`--`)||e.endsWith(`.git`)||e.endsWith(`.ipynb`))}function js(e,t,n){if(!n)return null;let r=Ts[e]??`Error (${e}) occurred while trying to load file`;throw Error(`${r}: "${t}".`)}async function Ms(e,t,n){let r=e.headers.get(`Content-Length`),i=r?parseInt(r,10):n??0;r===null&&!n&&N.warn(`Unable to determine content-length from response headers. Will expand buffer when needed.`);let a=new Uint8Array(i),o=0,s=e.body.getReader();async function c(){let{done:e,value:n}=await s.read();if(e)return;let r=o+n.length;if(r>i){i=r;let e=new Uint8Array(i);e.set(a),a=e}return a.set(n,o),o=r,t({progress:o/i*100,loaded:o,total:i}),c()}return await c(),a}function Ns(e){return ks(e,[`blob:`])}function Ps(e){let t;if(typeof location<`u`&&location.href)t=location.href;else if(xr!==void 0&&self.location.href)t=self.location.href;else return e;return new URL(e,t).href}var Fs=`SHA-256`,Is=`experimental_transformers-hash-cache`,Ls=e=>({algorithm:Fs,value:e}),Rs=class{#e=null;_getHashCache=()=>(this.#e??=caches.open(Is),this.#e);static isAvailable=()=>typeof navigator<`u`&&`crossOriginStorage`in navigator;match=async e=>{let t=await this._getFileHash(e);if(t)try{let[e]=await navigator.crossOriginStorage.requestFileHandles([Ls(t)]),n=await e.getFile();return new Response(n,{headers:{"Content-Length":String(n.size)}})}catch{return}};put=async(e,t)=>{let n=await this._getFileHash(e);if(n){let e=await t.blob();await this._storeBlobInCOS(e,n)}else this._processAndStore(e,t.body)};_storeBlobInCOS=async(e,t)=>{let[n]=await navigator.crossOriginStorage.requestFileHandles([Ls(t)],{create:!0}),r=await n.createWritable();await r.write(e),await r.close()};_processAndStore=async(e,t)=>{try{let n=[];for await(let e of t)n.push(e);let r=new Blob(n),i=await this._getBlobHash(r);await this._storeBlobInCOS(r,i);try{await(await this._getHashCache()).put(e,new Response(i))}catch{}}catch{}};delete=async e=>{try{return await(await this._getHashCache()).delete(e)}catch{return!1}};_getFileHash=async e=>{try{let t=await this._getHashCache(),n=await t.match(e);if(n)return n.text();let r=await this._getLfsFileHash(e);return r?(await t.put(e,new Response(r)),r):null}catch{return null}};_getLfsFileHash=async e=>{if(!e.includes(`/resolve/`))return null;let t=e.replace(`/resolve/`,`/raw/`);try{let e=(await fetch(t).then(e=>e.text())).match(/^oid sha256:([0-9a-f]+)$/m);return e?e[1]:null}catch{return null}};_getBlobHash=async e=>{let t=await e.arrayBuffer(),n=await crypto.subtle.digest(Fs,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}};async function zs(e=null){let t=null;if(M.useCustomCache){if(!M.customCache)throw Error("`env.useCustomCache=true`, but `env.customCache` is not defined.");if(!M.customCache.match||!M.customCache.put)throw Error("`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache");t=M.customCache}if(!t&&M.experimental_useCrossOriginStorage&&Rs.isAvailable()&&(t=new Rs),!t&&M.useBrowserCache){if(typeof caches>`u`)throw Error(`Browser cache is not available in this environment.`);try{t=await caches.open(M.cacheKey)}catch(e){N.warn(`An error occurred while opening the browser cache:`,e)}}if(!t&&M.useFSCache){if(!j.IS_FS_AVAILABLE)throw Error(`File System Cache is not available in this environment.`);t=new ws(e??M.cacheDir)}return t}async function Bs(e,...t){for(let n of t)try{let t=await e.match(n);if(t)return t}catch{continue}}var Vs=new class{#e;#t;constructor(e){this.#e=e,this.#t=new Map}get(e){if(!this.#t.has(e))return;let t=this.#t.get(e);return this.#t.delete(e),this.#t.set(e,t),t}put(e,t){this.#t.has(e)&&this.#t.delete(e),this.#t.set(e,t),this.#t.size>this.#e&&this.#t.delete(this.#t.keys().next().value)}delete(e){return this.#t.delete(e)}clear(){this.#t.clear()}}(100);function Hs(e,t){let n=Vs.get(e);if(n!==void 0)return n;let r=t().then(e=>e,t=>(Vs.delete(e),Promise.reject(t)));return Vs.put(e,r),r}async function Us(e){if(!ks(e,[`http:`,`https:`]))return null;let t=qs(e);return t.set(`Range`,`bytes=0-0`),M.fetch(e,{method:`GET`,headers:t,cache:`no-store`})}function Ws(e,t,n={}){return Hs(JSON.stringify([e,t,n?.revision,n?.cache_dir,n?.local_files_only]),()=>Gs(e,t,n))}async function Gs(e,t,n){let r=await zs(n?.cache_dir),{localPath:i,remoteURL:a,proposedCacheKey:o,validModelId:s}=Js(e,t,n,r),c=await Ys(r,i,o);if(c!==void 0&&typeof c!=`string`){let e=c.headers.get(`content-length`),t=c.headers.get(`content-type`);return{exists:!0,size:e?parseInt(e,10):void 0,contentType:t||void 0,fromCache:!0}}if(M.allowLocalModels&&!ks(i,[`http:`,`https:`]))try{let e=await Ks(i);if(typeof e!=`string`&&e.status!==404){let t=e.headers.get(`content-length`),n=e.headers.get(`content-type`);return{exists:!0,size:t?parseInt(t,10):void 0,contentType:n||void 0,fromCache:!1}}}catch{}if(M.allowRemoteModels&&!n.local_files_only&&s)try{let e=await Us(a);if(e&&e.status>=200&&e.status<300){let t,n=e.headers.get(`content-type`);if(e.status===206){let n=e.headers.get(`content-range`);if(n){let e=n.match(/bytes \d+-\d+\/(\d+)/);e&&(t=parseInt(e[1],10))}}else if(e.status===200)try{await e.body?.cancel()}catch{}if(t===void 0){let n=e.headers.get(`content-length`);t=n?parseInt(n,10):void 0}return{exists:!0,size:t,contentType:n||void 0,fromCache:!1}}}catch(e){N.warn(`Unable to fetch file metadata for "${a}": ${e}`)}return{exists:!1,fromCache:!1}}async function Ks(e){return M.useFS&&!ks(e,[`http:`,`https:`,`blob:`])?new _s(e instanceof URL?e.protocol===`file:`?e.pathname:e.toString():e):M.fetch(e,{headers:qs(e)})}function qs(e){let t=typeof process<`u`&&process?.release?.name===`node`,n=new Headers;if(t){let t=!!{}.TESTING_REMOTELY,r=M.version;if(n.set(`User-Agent`,`transformers.js/${r}; is_ci/${t};`),ks(e,[`http:`,`https:`],[`huggingface.co`,`hf.co`])){let e={}.HF_TOKEN??{}.HF_ACCESS_TOKEN;e&&n.set(`Authorization`,`Bearer ${e}`)}}return n}function Js(e,t,n={},r=null){let i=n.revision??`main`,a=Os(e,t),o=As(e),s=o?Os(M.localModelPath,a):a,c=Os(M.remoteHost,M.remotePathTemplate.replaceAll(`{model}`,e).replaceAll(`{revision}`,encodeURIComponent(i)),t);return{requestURL:a,localPath:s,remoteURL:c,proposedCacheKey:r instanceof ws?i===`main`?a:Os(e,i,t):c,validModelId:o}}async function Ys(e,t,n){if(e)return await Bs(e,t,n)}async function Xs(e,t,n,r,i,a,o={}){if(await n.match(r)===void 0){if(!a){let a=o.progress_callback?n=>ti(o.progress_callback,{status:`progress`,name:e,file:t,...n}):void 0;await n.put(r,i,a)}else if(typeof i!=`string`){let e=new Headers(i.headers);e.set(`content-length`,a.byteLength.toString()),await n.put(r,new Response(a,{headers:e})).catch(e=>{N.warn(`Unable to add response to browser cache: ${e}.`)})}}}async function Zs(e,t,n=!0,r={},i=!1,a=null){let{requestURL:o,localPath:s,remoteURL:c,proposedCacheKey:l,validModelId:u}=Js(e,t,r,a),d,f=!1,p;p=await Ys(a,s,l);let m=p!==void 0;if(m)d=l;else{if(M.allowLocalModels){if(!ks(o,[`http:`,`https:`]))try{p=await Ks(s),d=s}catch(e){N.warn(`Unable to load from local path "${s}": "${e}"`)}else if(r.local_files_only)throw Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${o}.`);else if(!M.allowRemoteModels)throw Error(`\`env.allowRemoteModels=false\`, but attempted to load a remote file from: ${o}.`)}if(p===void 0||typeof p!=`string`&&p.status===404){if(r.local_files_only||!M.allowRemoteModels){if(n)throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${s}".`);return null}if(!u)throw Error(`Local file missing at "${s}" and download aborted due to invalid model ID "${e}".`);if(p=await Ks(c),p.status!==200)return js(p.status,c,n);d=l}f=a&&typeof Response<`u`&&p instanceof Response&&p.status===200}ti(r.progress_callback,{status:`download`,name:e,file:t});let h;if(!(j.IS_NODE_ENV&&i)){let n;if(typeof p!=`string`)if(!r.progress_callback)n=new Uint8Array(await p.arrayBuffer());else if(m&&typeof navigator<`u`&&/firefox/i.test(navigator.userAgent))n=new Uint8Array(await p.arrayBuffer()),ti(r.progress_callback,{status:`progress`,name:e,file:t,progress:100,loaded:n.length,total:n.length});else{let i,a=p.headers.get(`content-length`);if(a)i=parseInt(a,10);else try{let n=await Ws(e,t,r);n.size&&(i=n.size)}catch{}n=await Ms(p,n=>{ti(r.progress_callback,{status:`progress`,name:e,file:t,...n})},i)}h=n}if(f&&d&&typeof p!=`string`&&await Xs(e,t,a,d,p,h,r),j.IS_NODE_ENV&&i&&r.progress_callback&&typeof p!=`string`){let n=parseInt(p.headers.get(`content-length`),10)||0;ti(r.progress_callback,{status:`progress`,name:e,file:t,progress:100,loaded:n,total:n})}if(ti(r.progress_callback,{status:`done`,name:e,file:t}),h){if(!j.IS_NODE_ENV&&i)throw Error(`Cannot return path in a browser environment.`);return h}if(p instanceof _s)return p.filePath;let g=await a?.match(d);if(g instanceof _s)return g.filePath;if(g instanceof Response)return new Uint8Array(await g.arrayBuffer());if(typeof g==`string`)return g;throw Error(`Unable to get model file path or buffer.`)}var Qs=new Map;async function $s(e,t,n=!0,r={},i=!1){if(!M.allowLocalModels){if(r.local_files_only)throw Error("Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).");if(!M.allowRemoteModels)throw Error("Invalid configuration detected: both local and remote models are disabled. Fix by setting `env.allowLocalModels` or `env.allowRemoteModels` to `true`.")}ti(r.progress_callback,{status:`initiate`,name:e,file:t});let a=`${e}::${t}`,o=Qs.get(a);return o||(o=Zs(e,t,n,r,i,await zs(r?.cache_dir)).then(e=>(Qs.delete(a),e),e=>{throw Qs.delete(a),e}),Qs.set(a,o)),await o}async function ec(e,t,n=!0,r={}){let i=await $s(e,t,n,r,!1);return i===null?null:new TextDecoder(`utf-8`).decode(i)}async function tc(e,t,n=!0,r={}){let i=await ec(e,t,n,r);return i===null?{}:JSON.parse(i)}function nc(e,[t,n,r],[i,a],o=`bilinear`,s=!1){let c=a/r,l=i/n,u=new e.constructor(i*a*t),d=n*r,f=i*a;for(let o=0;o=0;--e)i[e]=a,r[e]=t[n[e]],a*=r[e];let a=n.map((e,t)=>i[n.indexOf(t)]),o=new e.constructor(e.length);for(let n=0;n=0;--e)r+=i%t[e]*a[e],i=Math.floor(i/t[e]);o[r]=e[n]}return[o,r]}function ic(e){let t=sc(e)[0],n=e.map(e=>Math.exp(e-t)),r=n.reduce((e,t)=>e+t,0);return n.map(e=>e/r)}function ac(e){let t=sc(e)[0],n=0;for(let r=0;re-t-r)}function oc(e){if(e.length===0)throw Error(`Array must not be empty`);let t=e[0],n=0;for(let r=1;rt&&(t=e[r],n=r);return[t,n]}function cc(e){return e>0&&(e&e-1)==0}var lc=class{constructor(e){if(this.size=e|0,this.size<=1||!cc(this.size))throw Error(`FFT size must be a power of two larger than 1`);this._csize=e<<1,this.table=new Float64Array(this.size*2);for(let e=0;ee;e<<=1)++t;this._width=t%2==0?t-1:t,this._bitrev=new Int32Array(1<>>t&3)<>>1);for(let t=0;t>>1]=e[t];return n}toComplexArray(e,t){let n=t||this.createComplexArray();for(let t=0;t>>1],n[t+1]=0;return n}transform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._transform4(e,t,1)}realTransform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._realTransform4(e,t,1)}inverseTransform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._transform4(e,t,-1);for(let t=0;t>=2;i>=2;i>>=2){a=r/i<<1;let t=a>>>2;for(o=0;o>>1,i>>>1)}else for(o=0,s=0;o>>1,i>>>1,n)}let l=this.table;for(i>>=2;i>=2;i>>=2){a=r/i<<1;let t=a>>>1,s=t>>>1,c=s>>>1;for(o=0;o>>1;for(let t=2;t>1;++t){let n=(t+1-e)**2/2,r=Math.sqrt(s**2+c**2)**n,o=n*Math.atan2(c,s),l=2*t;i[l]=r*Math.cos(o),i[l+1]=r*Math.sin(o),a[l]=i[l],a[l+1]=-i[l+1]}this._slicedChirpBuffer=i.subarray(t,n),this._f=new lc(r>>1),this._f.transform(this._chirpBuffer,a)}_transform(e,t,n){let r=this._buffer1,i=this._buffer2,a=this._outBuffer1,o=this._outBuffer2,s=this._chirpBuffer,c=this._slicedChirpBuffer,l=this._a;if(n)for(let e=0;e>1];r[e]=i*c[e],r[n]=i*c[n]}else for(let e=0;e=e.length&&(i=2*(e.length-1)-i),r[a++]=e[i]}r.sort(),n[t]=r[i]}return n}function pc(e,t){let n=10**t;return Math.round(e*n)/n}function mc(e){let t=Math.round(e);return Math.abs(e)%1==.5?t%2==0?t:t-1:t}function hc(e){let t=e.length,n=e[0].length,r=[t+1,n+1],i=Array.from({length:r[0]},()=>Array(r[1]).fill(1/0));i[0][0]=0;let a=Array.from({length:r[0]},()=>Array(r[1]).fill(-1));for(let t=1;t0||s>0;)switch(c.push(o-1),l.push(s-1),a[o][s]){case 0:--o,--s;break;case 1:--o;break;case 2:--s;break;default:throw Error(`Internal error in dynamic time warping. Unexpected trace[${o}, ${s}]. Please file a bug report.`)}return c.reverse(),l.reverse(),[c,l]}var gc=(function(){let e=null;return function(t){if(!e){e=new Float32Array(65536);let t=new ArrayBuffer(4),n=new Uint32Array(t),r=new Float32Array(t);for(let t=0;t>10,s=t&1023;if(o===31)i=a|2139095040|s<<13;else if(o===0)if(s===0)i=a;else{let e=113;for(;!(s&1024);)s<<=1,--e;s&=-1025,i=a|e<<23|s<<13}else i=a|o+112<<23|s<<13;n[0]=i,e[t]=r[0]}}let n=t.length,r=e,i=new Float32Array(n);for(let e=0;evc});var vc={};async function yc(e){let t=e.split(`/`).pop(),n;try{if(n=await zs(),n){let t=await n.match(e);if(t)return t}}catch(e){N.warn(`Failed to load ${t} from cache:`,e)}let r=await M.fetch(e);if(!r.ok)throw Error(`Failed to fetch ${t}: ${r.status} ${r.statusText}`);if(n)try{await n.put(e,r.clone())}catch(e){N.warn(`Failed to cache ${t}:`,e)}return r}async function bc(e){let t=await yc(e);if(!t||typeof t==`string`)return null;try{return await t.arrayBuffer()}catch(e){return N.warn(`Failed to read WASM binary:`,e),null}}async function xc(e){if(j.IS_SERVICE_WORKER_ENV||j.IS_CHROME_AVAILABLE)return e;let t=await yc(e);if(!t||typeof t==`string`)return null;try{let e=await t.text();e=e.replaceAll(`globalThis.process?.versions?.node`,`false`);let n=new Blob([e],{type:`text/javascript`});return URL.createObjectURL(n)}catch(e){return N.warn(`Failed to read WASM factory:`,e),null}}var Sc=Object.freeze({auto:null,gpu:null,cpu:`cpu`,wasm:`wasm`,webgpu:`webgpu`,cuda:`cuda`,dml:`dml`,coreml:`coreml`,webnn:{name:`webnn`,deviceType:`cpu`},"webnn-npu":{name:`webnn`,deviceType:`npu`},"webnn-gpu":{name:`webnn`,deviceType:`gpu`},"webnn-cpu":{name:`webnn`,deviceType:`cpu`}});function Cc(e){return e<=Zr.DEBUG?0:e<=Zr.INFO?2:e<=Zr.WARNING||e<=Zr.ERROR?3:4}var wc={0:`verbose`,1:`info`,2:`warning`,3:`error`,4:`fatal`},Tc=[],Ec,Dc,Oc=Symbol.for(`onnxruntime`);if(Oc in globalThis)Dc=globalThis[Oc];else if(j.IS_NODE_ENV){switch(Dc=_c,process.platform){case`win32`:Tc.push(`dml`);break;case`linux`:process.arch===`x64`&&Tc.push(`cuda`);break;case`darwin`:Tc.push(`coreml`);break}Tc.push(`webgpu`),Tc.push(`cpu`),Ec=[`cpu`]}else Dc=t,j.IS_WEBNN_AVAILABLE&&Tc.push(`webnn-npu`,`webnn-gpu`,`webnn-cpu`,`webnn`),j.IS_WEBGPU_AVAILABLE&&Tc.push(`webgpu`),Tc.push(`wasm`),Ec=[`wasm`];var kc=Dc.InferenceSession;function Ac(e=null){if(!e)return Ec;switch(e){case`auto`:return Tc;case`gpu`:return Tc.filter(e=>[`webgpu`,`cuda`,`dml`,`webnn-gpu`].includes(e))}if(Tc.includes(e))return[Sc[e]??e];throw Error(`Unsupported device: "${e}". Should be one of: ${Tc.join(`, `)}.`)}var jc=Promise.resolve(),Mc=null;async function Nc(){if(Mc)return Mc;if(!(M.useWasmCache&&typeof Rc?.wasm?.wasmPaths==`object`&&Rc?.wasm?.wasmPaths?.wasm&&Rc?.wasm?.wasmPaths?.mjs)){if(j.IS_DENO_WEB_RUNTIME)throw Error(`env.useWasmCache=false is not supported in Deno's web runtime. Remove the useWasmCache override.`);return Mc=Promise.resolve(),Mc}return Mc=(async()=>{let e=Rc.wasm.wasmPaths,t=!1;await Promise.all([e.wasm&&!Ns(e.wasm)?(async()=>{try{let n=await bc(Ps(e.wasm));n&&(Rc.wasm.wasmBinary=n,t=!0)}catch(e){N.warn(`Failed to pre-load WASM binary:`,e)}})():Promise.resolve(),e.mjs&&!Ns(e.mjs)?(async()=>{try{let t=await xc(Ps(e.mjs));t&&(Rc.wasm.wasmPaths.mjs=t)}catch(e){N.warn(`Failed to pre-load WASM factory:`,e)}})():Promise.resolve()]),t||(Rc.wasm.wasmPaths.mjs=e.mjs)})(),Mc}async function Pc(e,t,n){await Nc();let r=Cc(M.logLevel??Zr.WARNING),i=()=>kc.create(e,{logSeverityLevel:r,...t}),a=await(j.IS_WEB_ENV?jc=jc.then(i):i());return a.config=n,a}var Fc=Promise.resolve();async function Ic(e,t){let n=()=>e.run(t);return j.IS_WEB_ENV?Fc=Fc.then(n):n()}function Lc(e){return e instanceof Dc.Tensor}var Rc=Dc?.env;function zc(){return Rc?.wasm?.proxy}if(Rc){let e=function(e){Rc.logLevel=wc[Cc(e)]};if(Rc.wasm){if(!(typeof ServiceWorkerGlobalScope<`u`&&self instanceof ServiceWorkerGlobalScope)&&Rc.versions?.web&&!Rc.wasm.wasmPaths){let e=`https://cdn.jsdelivr.net/npm/onnxruntime-web@${Rc.versions.web}/dist/`;Rc.wasm.wasmPaths=j.IS_SAFARI?{mjs:`${e}ort-wasm-simd-threaded.mjs`,wasm:`${e}ort-wasm-simd-threaded.wasm`}:{mjs:`${e}ort-wasm-simd-threaded.asyncify.mjs`,wasm:`${e}ort-wasm-simd-threaded.asyncify.wasm`}}Rc.wasm.proxy=!1}Rc.webgpu&&(Rc.webgpu.powerPreference=`high-performance`),e(M.logLevel??Zr.WARNING),M.backends.onnx={...Rc,setLogLevel:e}}var Bc=async(e,t,n)=>{let r=await Pc(new Uint8Array(e),t);return(async e=>{let t=zc(),i=await Ic(r,Object.fromEntries(Object.entries(e).map(([e,n])=>[e,(t?n.clone():n).ort_tensor])));return Array.isArray(n)?n.map(e=>new U(i[e])):new U(i[n])})},Vc=class{static session_options={};static get nearest_interpolate_4d(){return this._nearest_interpolate_4d||=Bc([8,10,18,0,58,129,1,10,41,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,18,10,4,109,111,100,101,34,7,110,101,97,114,101,115,116,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,21],this.session_options,`y`),this._nearest_interpolate_4d}static get bilinear_interpolate_4d(){return this._bilinear_interpolate_4d||=Bc([8,9,18,0,58,128,1,10,40,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,17,10,4,109,111,100,101,34,6,108,105,110,101,97,114,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,`y`),this._bilinear_interpolate_4d}static get bicubic_interpolate_4d(){return this._bicubic_interpolate_4d||=Bc([8,9,18,0,58,127,10,39,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,16,10,4,109,111,100,101,34,5,99,117,98,105,99,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,`y`),this._bicubic_interpolate_4d}static get matmul(){return this._matmul||=Bc([8,9,18,0,58,55,10,17,10,1,97,10,1,98,18,1,99,34,6,77,97,116,77,117,108,18,1,114,90,9,10,1,97,18,4,10,2,8,1,90,9,10,1,98,18,4,10,2,8,1,98,9,10,1,99,18,4,10,2,8,1,66,2,16,20],this.session_options,`c`),this._matmul}static get stft(){return this._stft||=Bc([8,7,18,0,58,148,1,10,38,10,1,115,10,1,106,10,1,119,10,1,108,18,1,111,34,4,83,84,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,115,90,26,10,1,115,18,21,10,19,8,1,18,15,10,3,18,1,98,10,3,18,1,115,10,3,18,1,99,90,11,10,1,106,18,6,10,4,8,7,18,0,90,16,10,1,119,18,11,10,9,8,1,18,5,10,3,18,1,119,90,11,10,1,108,18,6,10,4,8,7,18,0,98,31,10,1,111,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,102,10,3,18,1,100,10,3,18,1,99,66,2,16,17],this.session_options,`o`),this._stft}static get rfft(){return this._rfft||=Bc([8,9,18,0,58,97,10,33,10,1,120,10,0,10,1,97,18,1,121,34,3,68,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,100,90,21,10,1,120,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,90,11,10,1,97,18,6,10,4,8,7,18,0,98,21,10,1,121,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,66,2,16,20],this.session_options,`y`),this._rfft}static get top_k(){return this._top_k||=Bc([8,10,18,0,58,73,10,18,10,1,120,10,1,107,18,1,118,18,1,105,34,4,84,111,112,75,18,1,116,90,9,10,1,120,18,4,10,2,8,1,90,15,10,1,107,18,10,10,8,8,7,18,4,10,2,8,1,98,9,10,1,118,18,4,10,2,8,1,98,9,10,1,105,18,4,10,2,8,7,66,2,16,21],this.session_options,[`v`,`i`]),this._top_k}static get slice(){return this._slice||=Bc([8,7,18,0,58,96,10,25,10,1,120,10,1,115,10,1,101,10,1,97,10,1,116,18,1,121,34,5,83,108,105,99,101,18,1,114,90,9,10,1,120,18,4,10,2,8,1,90,9,10,1,115,18,4,10,2,8,7,90,9,10,1,101,18,4,10,2,8,7,90,9,10,1,97,18,4,10,2,8,7,90,9,10,1,116,18,4,10,2,8,7,98,9,10,1,121,18,4,10,2,8,1,66,2,16,13],this.session_options,`y`),this._slice}},Hc=Object.freeze({auto:`auto`,gpu:`gpu`,cpu:`cpu`,wasm:`wasm`,webgpu:`webgpu`,cuda:`cuda`,dml:`dml`,coreml:`coreml`,webnn:`webnn`,"webnn-npu":`webnn-npu`,"webnn-gpu":`webnn-gpu`,"webnn-cpu":`webnn-cpu`}),Uc=j.IS_NODE_ENV?`cpu`:`wasm`;function Wc(e,t,{warn:n}={}){return e?typeof e==`string`?e:e.hasOwnProperty(t)?e[t]:(n&&n(`device not specified for "${t}". Using the default device (${Uc}).`),Uc):Uc}var Gc=(function(){let e;return async function(){if(e===void 0)if(!j.IS_WEBGPU_AVAILABLE)e=!1;else try{e=(await navigator.gpu.requestAdapter()).features.has(`shader-f16`)}catch{e=!1}return e}})(),Kc=Object.freeze({auto:`auto`,fp32:`fp32`,fp16:`fp16`,q8:`q8`,int8:`int8`,uint8:`uint8`,q4:`q4`,bnb4:`bnb4`,q4f16:`q4f16`,q2:`q2`,q2f16:`q2f16`,q1:`q1`,q1f16:`q1f16`}),qc=Kc.fp32,Jc=Object.freeze({[Hc.wasm]:Kc.q8}),Yc=Object.freeze({[Kc.fp32]:``,[Kc.fp16]:`_fp16`,[Kc.int8]:`_int8`,[Kc.uint8]:`_uint8`,[Kc.q8]:`_quantized`,[Kc.q4]:`_q4`,[Kc.q2]:`_q2`,[Kc.q1]:`_q1`,[Kc.q4f16]:`_q4f16`,[Kc.q2f16]:`_q2f16`,[Kc.q1f16]:`_q1f16`,[Kc.bnb4]:`_bnb4`});function Xc(e,t,n,{configDtype:r=null,warn:i}={}){let a,o=!1;e&&typeof e!=`string`?e.hasOwnProperty(t)?a=e[t]:(a=null,o=!0):a=e;let s;if(a===Kc.auto){if(r){let e=typeof r==`string`?r:r?.[t];if(e&&e!==Kc.auto&&Kc.hasOwnProperty(e))return e}s=Jc[n]??qc}else s=a&&Kc.hasOwnProperty(a)?a:Jc[n]??qc;return o&&i&&i(`dtype not specified for "${t}". Using the default dtype (${s}) for this device (${n}).`),s}var Zc=Object.freeze({float32:Float32Array,float16:typeof Float16Array<`u`?Float16Array:Uint16Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array,uint4:Uint8Array,int4:Int8Array}),U=class e{get dims(){return this.ort_tensor.dims}set dims(e){this.ort_tensor.dims=e}get type(){return this.ort_tensor.type}get data(){return this.ort_tensor.data}get size(){return this.ort_tensor.size}get location(){return this.ort_tensor.location}ort_tensor;constructor(...e){return Lc(e[0])?this.ort_tensor=e[0]:this.ort_tensor=new A(e[0],e[1],e[2]),new Proxy(this,{get:(e,t)=>{if(typeof t==`string`){let n=Number(t);if(Number.isInteger(n))return e._getitem(n)}return e[t]},set:(e,t,n)=>e[t]=n})}dispose(){this.ort_tensor.dispose()}*[Symbol.iterator](){let[e,...t]=this.dims;if(t.length>0){let n=t.reduce((e,t)=>e*t);for(let r=0;r0){let e=r.reduce((e,t)=>e*t);return this._subarray(t,e,r)}else return new e(this.type,[this.data[t]],r)}indexOf(e){let t=this.data;for(let n=0;na)throw Error(`Invalid slice: ${i}`);let o=[Math.max(t,0),Math.min(a,this.dims[e])];r.push(o),n.push(o[1]-o[0])}else throw Error(`Invalid slice: ${i}`)}let i=r.map(([e,t])=>t-e),a=i.reduce((e,t)=>e*t),o=this.data,s=new o.constructor(a),c=this.stride(),l=!0;for(let e=1;e=0;--n){let e=i[n];t+=(a%e+r[n][0])*c[n],a=Math.floor(a/e)}s[e]=o[t]}return new e(this.type,s,n)}permute(...e){return $c(this,e)}transpose(...e){return this.permute(...e)}sum(e=null,t=!1){return this.norm(1,e,t)}norm(t=`fro`,n=null,r=!1){if(t===`fro`)t=2;else if(typeof t==`string`)throw Error(`Unsupported norm: ${t}`);let i=this.data,a=i instanceof BigInt64Array||i instanceof BigUint64Array;if(a&&t!==1)throw Error(`Expected a floating point tensor as input. Got ${this.type}`);let o,s;if(a?(o=(e,t)=>e+t,s=0n):(o=(e,n)=>e+n**t,s=0),n===null){let n=i.reduce(o,s);return t!==1&&(n**=1/t),new e(this.type,[n],[])}let[c,l,u]=fl(o,this,n,r);if(t!==1)for(let e=0;e=0;--r){let e=this.dims[r];if(r!==t){let t=i%e;n+=t*a,a*=this.dims[r]}i=Math.floor(i/e)}r[e]/=i[n]}return this}normalize(e=2,t=1){return this.clone().normalize_(e,t)}stride(){return hl(this.dims)}squeeze(t=null){return new e(this.type,this.data,sl(this.dims,t))}squeeze_(e=null){return this.dims=sl(this.dims,e),this}unsqueeze(t){return new e(this.type,this.data,cl(this.dims,t))}unsqueeze_(e){return this.dims=cl(this.dims,e),this}flatten_(e=0,t=-1){t=(t+this.dims.length)%this.dims.length;let n=this.dims.slice(0,e),r=this.dims.slice(e,t+1),i=this.dims.slice(t+1);return this.dims=[...n,r.reduce((e,t)=>e*t,1),...i],this}flatten(e=0,t=-1){return this.clone().flatten_(e,t)}view(...t){let n=-1;for(let e=0;er===n?e:e*t,1);t[n]=r.length/e}return new e(this.type,r,t)}neg_(){let e=this.data;for(let t=0;tt);return new e(`bool`,n,this.dims)}lt(t){let n=new Uint8Array(this.data.length),r=this.data;for(let e=0;eMath.min(e,t),this,t,n,1/0);return new e(r,i,a)}max(t=null,n=!1){if(t===null){let t=sc(this.data)[0];return new e(this.type,[t],[])}let[r,i,a]=fl((e,t)=>Math.max(e,t),this,t,n,-1/0);return new e(r,i,a)}argmin(t=null,n=!1){if(t!==null)throw Error("`dim !== null` not yet implemented.");let r=oc(this.data)[1];return new e(`int64`,[BigInt(r)],[])}argmax(t=null,n=!1){if(t!==null)throw Error("`dim !== null` not yet implemented.");let r=sc(this.data)[1];return new e(`int64`,[BigInt(r)],[])}repeat(...t){if(t.lengthe===1)){if(t.length===this.dims.length)return this.clone();let n=t.length-this.dims.length,r=Array(n).fill(1).concat(this.dims);return new e(this.type,this.data.slice(),r)}let n=t.length-this.dims.length,r=Array(n).fill(1).concat(this.dims),i=r.map((e,n)=>e*t[n]),a=i.reduce((e,t)=>e*t,1),o=this.data,s=new o.constructor(a),c=hl(r),l=hl(i);for(let e=0;eBigInt(Math.floor(e)):BigInt;else if(this.type===`float16`&&t==`float32`&&this.data instanceof Uint16Array)return new e(t,gc(this.data),this.dims);return new e(t,Zc[t].from(this.data,n),this.dims)}};function Qc(e,t){let n=e.length;if(n!==t.reduce((e,t)=>e*t))throw Error(`cannot reshape array of size ${n} into shape (${t})`);let r=e;for(let e=t.length-1;e>=0;e--)r=r.reduce((n,r)=>{let i=n[n.length-1];return i.lengthnew U(`int64`,e,[e.length]);async function al(e,t,n,r,i){return await(await Vc.slice)({x:e,s:il(t),e:il(n),a:il(r),t:il(i??Array(r.length).fill(1))})}function ol(e,t){let n=e.data,r=t.data,i=[e.dims[0],e.dims[2]],a=new n.constructor(i[0]*i[1]),[o,s,c]=e.dims,l=0;for(let e=0;ee!==1):typeof t==`number`?e[t]===1&&e.splice(t,1):Array.isArray(t)&&(e=e.filter((e,n)=>e!==1||!t.includes(n))),e}function cl(e,t){return t=ll(t,e.length+1),e=e.slice(),e.splice(t,0,1),e}function ll(e,t,n=null,r=!0){if(e<-t||e>=t){if(r)throw Error(`IndexError: index ${e} is out of bounds for dimension${n===null?``:` `+n} with size ${t}`);return e<-t?0:t}return e<0&&(e=(e%t+t)%t),e}function ul(e,t=0){t=ll(t,e[0].dims.length);let n=e[0].dims.slice();n[t]=e.reduce((e,n)=>e+n.dims[t],0);let r=n.reduce((e,t)=>e*t,1),i=new e[0].data.constructor(r),a=e[0].type;if(t===0){let t=0;for(let n of e){let e=n.data;i.set(e,t),t+=e.length}}else{let r=0;for(let a=0;a=0;--i){let e=s[i],l=o%e;i===t&&(l+=r),a+=l*c,c*=n[i],o=Math.floor(o/e)}i[a]=o[e]}r+=s[t]}}return new U(a,i,n)}function dl(e,t=0){return ul(e.map(e=>e.unsqueeze(t)),t)}function fl(e,t,n,r=!1,i=null){let a=t.data,o=t.dims;n=ll(n,o.length);let s=o.slice();s[n]=1;let c=new a.constructor(a.length/o[n]);i!==null&&c.fill(i);for(let t=0;t=0;--e){let t=o[e];if(e!==n){let n=i%t;r+=n*a,a*=s[e]}i=Math.floor(i/t)}c[r]=e(c[r],a[t],t,r)}return r||s.splice(n,1),[t.type,c,s]}function pl(e,t=null,n=1,r=!1){let i=e.data,a=e.dims;if(t===null){let t=i.reduce((e,t)=>e+t,0)/i.length,r=Math.sqrt(i.reduce((e,n)=>e+(n-t)**2,0)/(i.length-n)),a=new U(e.type,[t],[]);return[new U(e.type,[r],[]),a]}t=ll(t,a.length);let o=ml(e,t,r),s=o.data,[c,l,u]=fl((e,t,n,r)=>e+(t-s[r])**2,e,t,r);for(let e=0;ee+t,0);return new U(e.type,[t/i.length],[])}t=ll(t,r.length);let[a,o,s]=fl((e,t)=>e+t,e,t,n);if(r[t]!==1)for(let e=0;e=0;--n)t[n]=r,r*=e[n];return t}function gl(e,t,n,r){return new U(n,new r(e.reduce((e,t)=>e*t,1)).fill(t),e)}function _l(e,t){let n,r;if(typeof t==`number`)n=`float32`,r=Float32Array;else if(typeof t==`bigint`)n=`int64`,r=BigInt64Array;else if(typeof t==`boolean`)n=`bool`,r=Uint8Array;else throw Error(`Unsupported data type: ${typeof t}`);return gl(e,t,n,r)}function vl(e,t){return _l(e.dims,t)}function yl(e){return gl(e,1n,`int64`,BigInt64Array)}function bl(e){return yl(e.dims)}function xl(e){return gl(e,0n,`int64`,BigInt64Array)}function Sl(e){return xl(e.dims)}function Cl(e){let t=e.reduce((e,t)=>e*t,1);return new U(`float32`,Float32Array.from({length:t},()=>xs.gauss()),e)}function wl(e,t){if(e.dims.length!==2)throw Error(`The tensor must have 2 dimensions`);if(e.dims.at(-1)%8!=0)throw Error(`The last dimension of the tensor must be a multiple of 8`);if(![`binary`,`ubinary`].includes(t))throw Error(`The precision must be either 'binary' or 'ubinary'`);let n=t===`binary`,r=n?`int8`:`uint8`,i=n?Int8Array:Uint8Array,a=e.data,o=new i(a.length/8);for(let e=0;e0),r=Math.floor(e/8),i=e%8;o[r]|=t<<7-i,n&&i===0&&(o[r]-=128)}return new U(r,o,[e.dims[0],e.dims[1]/8])}async function Tl(e){if(!e)throw Error(`modelId is required for get_tokenizer_files`);return(await Ws(e,`tokenizer_config.json`,{})).exists?[`tokenizer.json`,`tokenizer_config.json`]:[]}async function El(e,t){let n=await Tl(e);return await Promise.all(n.map(n=>tc(e,n,!0,t)))}function Dl(e){let t=e.dims;switch(t.length){case 1:return e.tolist();case 2:if(t[0]!==1)throw Error("Unable to decode tensor with `batch size !== 1`. Use `tokenizer.batch_decode(...)` for batched inputs.");return e.tolist()[0];default:throw Error(`Expected tensor to have 1-2 dimensions, got ${t.length}.`)}}var Ol=[`bos_token`,`eos_token`,`unk_token`,`sep_token`,`pad_token`,`cls_token`,`mask_token`];function kl(e,t,n,r){for(let i of Object.keys(e)){let a=t-e[i].length,o=n(i),s=Array(a).fill(o);e[i]=r===`right`?oi(e[i],s):oi(s,e[i])}}function Al(e,t){for(let n of Object.keys(e))e[n].length=t}function jl(e,...t){for(let n of t){if(!Object.hasOwn(e,n))continue;let t=e[n];if(t)if(typeof t==`object`){if(t.__type===`AddedToken`)return t.content;throw Error(`Unknown token: ${t}`)}else return t}return null}function Ml(e){let t=[];for(let n of e.get_added_tokens_decoder().values())n.special&&t.push(n);return t}var W=class extends ei{return_token_type_ids=!1;padding_side=`right`;constructor(e,t){if(super(),this._tokenizerJSON=e,this._tokenizerConfig=t,this._tokenizer=new Va(e,t),this.config=t,this.padding_side=t.padding_side??this.padding_side,this.mask_token=jl(t,`mask_token`),this.mask_token_id=this._tokenizer.token_to_id(this.mask_token),this.pad_token=jl(t,`pad_token`,`eos_token`),this.pad_token_id=this._tokenizer.token_to_id(this.pad_token),this.sep_token=jl(t,`sep_token`),this.sep_token_id=this._tokenizer.token_to_id(this.sep_token),this.unk_token=jl(t,`unk_token`),this.unk_token_id=this._tokenizer.token_to_id(this.unk_token),this.bos_token=jl(t,`bos_token`),this.bos_token_id=this._tokenizer.token_to_id(this.bos_token),this.eos_token=jl(t,`eos_token`),this.eos_token_id=this._tokenizer.token_to_id(this.eos_token),this.chat_template=t.chat_template??null,Array.isArray(this.chat_template)){let e=Object.create(null);for(let{name:t,template:n}of this.chat_template){if(typeof t!=`string`||typeof n!=`string`)throw Error(`Chat template must be a list of objects with "name" and "template" properties`);e[t]=n}this.chat_template=e}this._compiled_template_cache=new Map;let n=Ml(this._tokenizer);this.all_special_ids=n.map(e=>e.id),this.all_special_tokens=n.map(e=>e.content)}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`}={}){let o=await El(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a});return new this(...o)}get_vocab(){return this._tokenizer.get_vocab()}get model_max_length(){return this._tokenizerConfig.model_max_length??1/0}get add_eos_token(){return this._tokenizerConfig.add_eos_token}get add_bos_token(){return this._tokenizerConfig.add_bos_token}convert_tokens_to_ids(e){return typeof e==`string`?this._tokenizer.token_to_id(e):e.map(e=>this._tokenizer.token_to_id(e))}_call(e,t={}){let{text_pair:n=null,add_special_tokens:r=!0,padding:i=!1,return_token_type_ids:a=null}=t,{truncation:o=null,max_length:s=null}=t,c=t.return_tensor??!0,l=Array.isArray(e),u;if(l){if(e.length===0)throw Error(`text array must be non-empty`);if(n!==null){if(!Array.isArray(n))throw Error(`text_pair must also be an array`);if(e.length!==n.length)throw Error(`text and text_pair must have the same length`);u=e.map((e,t)=>this._encode_plus(e,{text_pair:n[t],add_special_tokens:r,return_token_type_ids:a}))}else u=e.map(e=>this._encode_plus(e,{add_special_tokens:r,return_token_type_ids:a}))}else{if(e==null)throw Error(`text may not be null or undefined`);if(Array.isArray(n))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");u=[this._encode_plus(e,{text_pair:n,add_special_tokens:r,return_token_type_ids:a})]}if(s===null?s=this.model_max_length:o===null&&(i===!0?(N.warn("`max_length` is ignored when `padding: true` and there is no truncation strategy. To pad to max length, use `padding: 'max_length'`."),s=this.model_max_length):i===!1&&(N.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation: true` to explicitly truncate examples to max length."),o=!0)),i===!0&&(s=Math.min(sc(u.map(e=>e.input_ids.length))[0],s??1/0)),s=Math.min(s,this.model_max_length??1/0),i||o)for(let e=0;es?o&&Al(u[e],s):i&&kl(u[e],s,e=>e===`input_ids`?this.pad_token_id:0,this.padding_side);let d={};if(c){if(!(i&&o)&&u.some(e=>{for(let t of Object.keys(e))if(e[t].length!==u[0][t]?.length)return!0;return!1}))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.`);let e=[u.length,u[0].input_ids.length];for(let t of Object.keys(u[0]))d[t]=new U(`int64`,BigInt64Array.from(u.flatMap(e=>e[t]).map(BigInt)),e)}else{for(let e of Object.keys(u[0]))d[e]=u.map(t=>t[e]);if(!l)for(let e of Object.keys(d))d[e]=d[e][0]}return d}_encode_text(e){return e===null?null:this._tokenizer.encode(e).tokens}_encode_plus(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){let{ids:i,attention_mask:a,token_type_ids:o}=this._tokenizer.encode(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:r??this.return_token_type_ids});return{input_ids:i,attention_mask:a,...o?{token_type_ids:o}:{}}}tokenize(e,{pair:t=null,add_special_tokens:n=!1}={}){return this._tokenizer.tokenize(e,{text_pair:t,add_special_tokens:n})}encode(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){return this._tokenizer.encode(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:r}).ids}batch_decode(e,t={}){return e instanceof U&&(e=e.tolist()),e.map(e=>this.decode(e,t))}decode(e,t={}){if(e instanceof U&&(e=Dl(e)),!Array.isArray(e)||e.length===0||!ri(e[0]))throw Error(`token_ids must be a non-empty array of integers.`);return this.decode_single(e,t)}decode_single(e,{skip_special_tokens:t=!1,clean_up_tokenization_spaces:n=null}){return this._tokenizer.decode(e,{skip_special_tokens:t,clean_up_tokenization_spaces:n})}get_chat_template({chat_template:e=null,tools:t=null}={}){if(this.chat_template&&typeof this.chat_template==`object`){let n=this.chat_template;if(e!==null&&Object.hasOwn(n,e))e=n[e];else if(e===null)if(t!==null&&`tool_use`in n)e=n.tool_use;else if(`default`in n)e=n.default;else throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(n).sort()}.`)}else if(e===null)if(this.chat_template)e=this.chat_template;else throw Error(`Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co/docs/transformers/main/en/chat_templating`);return e}apply_chat_template(e,t={}){let{tools:n=null,documents:r=null,chat_template:i=null,add_generation_prompt:a=!1,tokenize:o=!0,padding:s=!1,truncation:c=!1,max_length:l=null,return_tensor:u=!0,return_dict:d=!0,tokenizer_kwargs:f={},...p}=t;if(i=this.get_chat_template({chat_template:i,tools:n}),typeof i!=`string`)throw Error(`chat_template must be a string, but got ${typeof i}`);let m=this._compiled_template_cache.get(i);m===void 0&&(m=new hs(i),this._compiled_template_cache.set(i,m));let h=Object.create(null);for(let e of Ol){let t=jl(this.config,e);t&&(h[e]=t)}let g=m.render({messages:e,add_generation_prompt:a,tools:n,documents:r,...h,...p});if(o){let e=this._call(g,{add_special_tokens:!1,padding:s,truncation:c,max_length:l,return_tensor:u,...f});return d?e:e.input_ids}return g}};function Nl(e,t,n,r){if(!(`language_codes`in e)||!Array.isArray(e.language_codes))throw Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!(`languageRegex`in e)||!(e.languageRegex instanceof RegExp))throw Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!(`lang_to_token`in e)||typeof e.lang_to_token!=`function`)throw Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");let i=r.src_lang,a=r.tgt_lang;if(!e.language_codes.includes(a))throw Error(`Target language code "${a}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);if(i!==void 0){if(!e.language_codes.includes(i))throw Error(`Source language code "${i}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);for(let t of e._tokenizer.post_processor.config.single)if(`SpecialToken`in t&&e.languageRegex.test(t.SpecialToken.id)){t.SpecialToken.id=e.lang_to_token(i);break}}return r.forced_bos_token_id=e._tokenizer.token_to_id(e.lang_to_token(a)),e._call(t,n)}var Pl={};Cr(Pl,{AlbertTokenizer:()=>Fl,AutoTokenizer:()=>G,BartTokenizer:()=>Il,BertTokenizer:()=>Ll,BlenderbotSmallTokenizer:()=>Rl,BlenderbotTokenizer:()=>zl,BloomTokenizer:()=>Bl,CLIPTokenizer:()=>Hl,CamembertTokenizer:()=>Vl,CodeGenTokenizer:()=>Wl,CodeLlamaTokenizer:()=>Ul,CohereAsrTokenizer:()=>Kl,CohereTokenizer:()=>Gl,ConvBertTokenizer:()=>ql,DebertaTokenizer:()=>Yl,DebertaV2Tokenizer:()=>Jl,DistilBertTokenizer:()=>Xl,ElectraTokenizer:()=>Zl,EsmTokenizer:()=>Ql,FalconTokenizer:()=>$l,GPT2Tokenizer:()=>nu,GPTNeoXTokenizer:()=>tu,GemmaTokenizer:()=>eu,HerbertTokenizer:()=>ru,LlamaTokenizer:()=>iu,M2M100Tokenizer:()=>au,MBart50Tokenizer:()=>cu,MBartTokenizer:()=>su,MPNetTokenizer:()=>du,MarianTokenizer:()=>ou,MgpstrTokenizer:()=>lu,MobileBertTokenizer:()=>uu,NllbTokenizer:()=>fu,NougatTokenizer:()=>pu,PreTrainedTokenizer:()=>W,Qwen2Tokenizer:()=>mu,RoFormerTokenizer:()=>gu,RobertaTokenizer:()=>hu,SiglipTokenizer:()=>_u,SpeechT5Tokenizer:()=>vu,SqueezeBertTokenizer:()=>yu,T5Tokenizer:()=>bu,TokenizersBackend:()=>W,VitsTokenizer:()=>Su,Wav2Vec2CTCTokenizer:()=>Cu,WhisperTokenizer:()=>Au,XLMRobertaTokenizer:()=>ju,XLMTokenizer:()=>Mu});var Fl=class extends W{return_token_type_ids=!0},Il=class extends W{},Ll=class extends W{return_token_type_ids=!0},Rl=class extends W{},zl=class extends W{},Bl=class extends W{},Vl=class extends W{},Hl=class extends W{},Ul=class extends W{},Wl=class extends W{},Gl=class extends W{},Kl=class extends W{},ql=class extends W{return_token_type_ids=!0},Jl=class extends W{return_token_type_ids=!0},Yl=class extends W{return_token_type_ids=!0},Xl=class extends W{},Zl=class extends W{return_token_type_ids=!0},Ql=class extends W{},$l=class extends W{},eu=class extends W{},tu=class extends W{},nu=class extends W{},ru=class extends W{return_token_type_ids=!0},iu=class extends W{padding_side=`left`},au=class extends W{constructor(e,t){super(e,t),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.all_special_tokens.filter(e=>this.languageRegex.test(e)).map(e=>e.slice(2,-2)),this.lang_to_token=e=>`__${e}__`}_build_translation_inputs(e,t,n){return Nl(this,e,t,n)}},ou=class extends W{constructor(e,t){super(e,t),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=Array.from(this.get_vocab().keys()).filter(e=>this.languageRegex.test(e)),N.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(e){if(e===null)return null;let[t,...n]=e.trim().split(this.languageRegex);if(n.length===0)return super._encode_text(t);if(n.length===2){let[e,t]=n;return this.supported_language_codes.includes(e)||N.warn(`Unsupported language code "${e}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),oi([e],super._encode_text(t))}}},su=class extends W{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.all_special_tokens.filter(e=>this.languageRegex.test(e)).map(e=>e),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return Nl(this,e,t,n)}},cu=class extends su{},lu=class extends W{},uu=class extends W{return_token_type_ids=!0},du=class extends W{},fu=class extends W{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.all_special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return Nl(this,e,t,n)}},pu=class extends W{},mu=class extends W{},hu=class extends W{},gu=class extends W{return_token_type_ids=!0},_u=class extends W{},vu=class extends W{},yu=class extends W{return_token_type_ids=!0},bu=class extends W{},xu=class extends Oa{decode_chain(e){let t=``;for(let n=1;n[t,e]),[`burmese`,`my`],[`valencian`,`ca`],[`flemish`,`nl`],[`haitian`,`ht`],[`letzeburgesch`,`lb`],[`pushto`,`ps`],[`panjabi`,`pa`],[`moldavian`,`ro`],[`moldovan`,`ro`],[`sinhalese`,`si`],[`castilian`,`es`]]);function Du(e){e=e.toLowerCase();let t=Eu.get(e);if(t===void 0){let n=e.match(/^<\|([a-z]{2})\|>$/);if(n&&(e=n[1]),Tu.has(e))t=e;else{let t=e.length===2?Tu.keys():Tu.values();throw Error(`Language "${e}" is not supported. Must be one of: ${JSON.stringify(Array.from(t))}`)}}return t}var Ou=RegExp(`^[\\p{P}\\u0021-\\u002F\\u003A-\\u0040\\u005B-\\u0060\\u007B-\\u007E]+$`,`gu`),ku=.1,Au=class extends W{get timestamp_begin(){return this._tokenizer.token_to_id(`<|notimestamps|>`)+1}_decode_asr(e,{return_timestamps:t=!1,return_language:n=!1,time_precision:r=null,force_full_sequences:i=!0}={}){if(r===null)throw Error(`Must specify time_precision`);let a=null,o=t===`word`;function s(){return{language:a,timestamp:[null,null],text:``}}let c=[],l=s(),u=0,d=this.timestamp_begin,f=d+1500,p=[],m=[],h=!1,g=null,_=new Set(this.all_special_ids);for(let n of e){let e=n.tokens,i=o?n.token_timestamps:null,v=null,y=d;if(`stride`in n){let[t,i,a]=n.stride;if(u-=i,g=t-a,i&&(y=i/r+d),a)for(let t=e.length-1;t>=0;--t){let n=Number(e[t]);if(n>=d){if(v!==null&&(n-d)*r=d&&g<=f){let e=pc((g-d)*r+u,2);if(v!==null&&g>=v)h=!0;else if(h||p.length>0&&g0&&l.timestamp[1]!==null))for(let e of l.words)e.timestamp[1]>l.timestamp[1]&&l.timestamp[1]>=e.timestamp[0]&&(e.timestamp[1]=l.timestamp[1]);c.push(l),p=[],b=[],m=[],x=[],l=s()}}else if(b.push(g),o){let e=pc(i[n]+u,2),t;if(n+10?(p.push(b),o&&m.push(x)):p.every(e=>e.length===0)&&(l=s(),p=[],b=[],m=[],x=[])}if(p.length>0){if(i&&t)throw Error(`Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.`);let[e,n]=this.findLongestCommonSequence(p,m),r=this.decode(e);l.text=r,o&&(l.words=this.collateWordTimestamps(e,n,a)),c.push(l)}let v=Object.create(null),y=c.map(e=>e.text).join(``);if(t||n){for(let e=0;e0,o=a?[]:null,s=a?t[0]:null;for(let c=1;ce===g[n]&&s[i+n][0]-ku<=t[c][m+n][0]).length:p.filter((e,t)=>e===g[t]).length;let v=e/1e4,y=_/e+v;_>1&&y>u&&(u=y,d=[i,o,m,h])}let[p,m,h,g]=d,_=Math.floor((m+p)/2),v=Math.floor((g+h)/2);if(a&&u===0&&r>0){let e=s[r-1][0],n=t[c].findIndex(t=>t[0]>=e);v=n===-1?l.length:n}i.push(...n.slice(0,_)),n=l.slice(v),r=n.length,a&&(o.push(...s.slice(0,_)),s=t[c].slice(v))}return i.push(...n),a?(o.push(...s),[i,o]):[i,[]]}collateWordTimestamps(e,t,n){let[r,i,a]=this.combineTokensIntoWords(e,n),o=[];for(let e=0;e=r){let e=((t-r)*n).toFixed(2);i.push(`<|${e}|>`),i.push([])}else i[i.length-1].push(t);return i=i.map(e=>typeof e==`string`?e:super.decode(e,t)),i.join(``)}splitTokensOnUnicode(e){let t=this.decode(e,{decode_with_timestamps:!0}),n=[],r=[],i=[],a=[],o=[],s=0;for(let c=0;c=this._tokenizer.token_to_id(`<|endoftext|>`),d=s.startsWith(` `),f=s.trim(),p=Ou.test(f);if(u||d||p||i.length===0)i.push(s),a.push(c),o.push(l);else{let e=i.length-1;i[e]+=s,a[e].push(...c),o[e].push(...l)}}return[i,a,o]}mergePunctuations(e,t,n,r,i){let a=structuredClone(e),o=structuredClone(t),s=structuredClone(n),c=a.length-2,l=a.length-1;for(;c>=0;)a[c].startsWith(` `)&&r.includes(a[c].trim())?(a[l]=a[c]+a[l],o[l]=oi(o[c],o[l]),s[l]=oi(s[c],s[l]),a[c]=``,o[c]=[],s[c]=[]):l=c,--c;for(c=0,l=1;le),o.filter(e=>e.length>0),s.filter(e=>e.length>0)]}},ju=class extends W{},Mu=class extends W{return_token_type_ids=!0;constructor(e,t){super(e,t),N.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}},G=class{static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`}={}){let[o,s]=await El(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a}),c=s.tokenizer_class?.replace(/Fast$/,``)??`PreTrainedTokenizer`,l=Pl[c];return l||=(N.warn(`Unknown tokenizer class "${c}", attempting to construct from base class.`),W),new l(o,s)}},Nu=`https://github.com/huggingface/transformers.js/issues/new/choose`,Pu=`preprocessor_config.json`,Fu=Pu,Iu=`processor_config.json`,Lu=`chat_template.jinja`,K=class extends ei{static classes=[`image_processor_class`,`tokenizer_class`,`feature_extractor_class`];static uses_processor_config=!1;static uses_chat_template_file=!1;constructor(e,t,n){super(),this.config=e,this.components=t,this.chat_template=n}get image_processor(){return this.components.image_processor}get tokenizer(){return this.components.tokenizer}get feature_extractor(){return this.components.feature_extractor}apply_chat_template(e,t={}){if(!this.tokenizer)throw Error(`Unable to apply chat template without a tokenizer.`);return this.tokenizer.apply_chat_template(e,{tokenize:!1,chat_template:this.chat_template??void 0,...t})}batch_decode(...e){if(!this.tokenizer)throw Error(`Unable to decode without a tokenizer.`);return this.tokenizer.batch_decode(...e)}decode(...e){if(!this.tokenizer)throw Error(`Unable to decode without a tokenizer.`);return this.tokenizer.decode(...e)}async _call(e,...t){for(let n of[this.image_processor,this.feature_extractor,this.tokenizer])if(n)return n(e,...t);throw Error(`No image processor, feature extractor, or tokenizer found.`)}static async from_pretrained(e,t={}){let[n,r,i]=await Promise.all([this.uses_processor_config?tc(e,Iu,!0,t):{},Promise.all(this.classes.filter(e=>e in this).map(async n=>{let r=await this[n].from_pretrained(e,t);return[n.replace(/_class$/,``),r]})).then(Object.fromEntries),this.uses_chat_template_file?ec(e,Lu,!0,t):null]);return new this(n,r,i)}};Cr({},{ChatterboxProcessor:()=>jd,CohereAsrProcessor:()=>Nd,Florence2Processor:()=>Sp,Gemma3Processor:()=>Cp,Gemma3nProcessor:()=>wp,Gemma4Processor:()=>Tp,Glm46VProcessor:()=>Dp,GraniteSpeechProcessor:()=>Op,GroundingDinoProcessor:()=>Ap,Idefics3Processor:()=>Pp,JinaCLIPProcessor:()=>Ip,Lfm2VlProcessor:()=>Lp,LlavaProcessor:()=>Rp,MgpstrProcessor:()=>Bp,MoonshineProcessor:()=>Vp,OwlViTProcessor:()=>Hp,PaliGemmaProcessor:()=>Gp,Phi3VProcessor:()=>Jp,PixtralProcessor:()=>Yp,Processor:()=>K,PyAnnoteProcessor:()=>Xp,Qwen2VLProcessor:()=>Ep,Qwen2_5_VLProcessor:()=>Zp,Qwen3VLProcessor:()=>Qp,Sam2Processor:()=>em,Sam2VideoProcessor:()=>tm,SamProcessor:()=>$p,SmolVLMProcessor:()=>Pp,SpeechT5Processor:()=>nm,UltravoxProcessor:()=>rm,VLChatProcessor:()=>Fp,VoxtralProcessor:()=>cm,VoxtralRealtimeProcessor:()=>mm,Wav2Vec2Processor:()=>hm,Wav2Vec2ProcessorWithLM:()=>gm,WhisperProcessor:()=>_m});var Ru=class extends ei{constructor(e){super(),this.config=e}static async from_pretrained(e,t={}){let n=await tc(e,Pu,!0,t);return new this(n)}};function zu(e,t){if(!(e instanceof Float32Array||e instanceof Float64Array))throw Error(`${t} expects input to be a Float32Array or a Float64Array, but got ${e?.constructor?.name??typeof e} instead. If using the feature extractor directly, remember to use \`read_audio(url, sampling_rate)\` to obtain the raw audio data of the file/url.`)}var Bu={};Cr(Bu,{ASTFeatureExtractor:()=>ud,ChatterboxFeatureExtractor:()=>fd,ClapFeatureExtractor:()=>pd,CohereAsrFeatureExtractor:()=>gd,DacFeatureExtractor:()=>_d,EncodecFeatureExtractor:()=>dd,FeatureExtractor:()=>Ru,Gemma3nAudioFeatureExtractor:()=>vd,Gemma4AudioFeatureExtractor:()=>yd,GraniteSpeechFeatureExtractor:()=>bd,MoonshineFeatureExtractor:()=>xd,ParakeetFeatureExtractor:()=>hd,PyAnnoteFeatureExtractor:()=>Sd,SeamlessM4TFeatureExtractor:()=>Cd,SnacFeatureExtractor:()=>wd,SpeechT5FeatureExtractor:()=>Td,VoxtralRealtimeFeatureExtractor:()=>Od,Wav2Vec2FeatureExtractor:()=>Ed,WeSpeakerFeatureExtractor:()=>Dd,WhisperFeatureExtractor:()=>kd});var Vu={fromWeb:()=>{}};async function Hu(e,t){if(j.IS_BROWSER_ENV){if(j.IS_WEBWORKER_ENV)throw Error(`Unable to save a file from a Web Worker.`);let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e,r.click(),r.remove(),URL.revokeObjectURL(n)}else if(j.IS_FS_AVAILABLE){let n=t.stream();await(Vu.fromWeb(n),wr.createWriteStream(e),void 0)}else throw Error(`Unable to save because filesystem is disabled in this environment.`)}async function Uu(e,t){if(typeof AudioContext>`u`)throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing.");let n=await(await Ks(e)).arrayBuffer(),r=new AudioContext({sampleRate:t});t===void 0&&N.warn(`No sampling rate provided, using default of ${r.sampleRate}Hz.`);let i=await r.decodeAudioData(n),a;if(i.numberOfChannels===2){let e=Math.sqrt(2),t=i.getChannelData(0),n=i.getChannelData(1);a=new Float32Array(t.length);for(let r=0;r2595*Math.log10(1+e/700),kaldi:e=>1127*Math.log(1+e/700),slaney:(e,t=1e3,n=15,r=27/Math.log(6.4))=>e>=t?n+Math.log(e/t)*r:3*e/200};function Yu(e,t=`htk`){let n=Ju[t];if(!n)throw Error(`mel_scale should be one of "htk", "slaney" or "kaldi".`);return typeof e==`number`?n(e):e.map(e=>n(e))}var Xu={htk:e=>700*(10**(e/2595)-1),kaldi:e=>700*(Math.exp(e/1127)-1),slaney:(e,t=1e3,n=15,r=Math.log(6.4)/27)=>e>=n?t*Math.exp(r*(e-n)):200*e/3};function Zu(e,t=`htk`){let n=Xu[t];if(!n)throw Error(`mel_scale should be one of "htk", "slaney" or "kaldi".`);return typeof e==`number`?n(e):e.map(e=>n(e))}function Qu(e,t){let n=Float64Array.from({length:t.length-1},(e,n)=>t[n+1]-t[n]),r=Array.from({length:e.length},()=>Array(t.length));for(let n=0;nArray(e.length));for(let t=0;te+r*n)}function ed(e,t,n,r,i,a=null,o=`htk`,s=!1){if(a!==null&&a!==`slaney`)throw Error(`norm must be one of null or "slaney"`);if(e<2)throw Error(`Require num_frequency_bins: ${e} >= 2`);if(n>r)throw Error(`Require min_frequency: ${n} <= max_frequency: ${r}`);let c=$u(Yu(n,o),Yu(r,o),t+2),l=Zu(c,o),u;if(s){let t=i/((e-1)*2);u=Yu(Float64Array.from({length:e},(e,n)=>n*t),o),l=c}else u=$u(0,Math.floor(i/2),e);let d=Qu(u,l);if(a!==null&&a===`slaney`)for(let n=0;ni)throw Error(`frame_length (${n}) may not be larger than fft_length (${i})`);if(C!==n)throw Error(`Length of the window (${C}) must equal frame_length (${n})`);if(r<=0)throw Error(`hop_length must be greater than zero`);if(a===null&&d!==null)throw Error("You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram. Specify `power` to fix this issue.");if(!u)throw Error("`preemphasis_htk_flavor=false` is not currently supported.");if(o){let t=Math.floor(n/2);switch(s){case`reflect`:e=td(e,t,t);break;case`constant`:{let n=new e.constructor(e.length+2*t);n.set(e,t),e=n;break}case`semicausal`:{let n=new e.constructor(e.length+t);n.set(e,t),e=n;break}default:throw Error(`pad_mode="${s}" not implemented yet.`)}}let w=Math.floor(1+Math.floor((e.length-n)/r));y!==null&&ww?x&&(T=b):T=re=b);let E=new dc(i),ie=new Float64Array(i),ae=new Float64Array(E.outputBufferSize),oe=new Float32Array(ne*T);for(let i=0;i=1;--e)ie[e]-=l*ie[e-1];ie[0]*=1-l}for(let e=0;ee**.85);break;default:throw Error(`Unknown window type ${t}.`)}if(n&&(o=o.subarray(0,e)),r===null||e===r)return o;if(e>r)throw Error(`Length of the window (${e}) may not be larger than frame_length (${r})`);let s=new Float64Array(r),c=i?Math.floor((r-e)/2):0;return s.set(o,c),s}function sd(e,t){let n=e.reduce((e,t)=>e+t.length,0),r=new ArrayBuffer(44),i=new DataView(r);return cd(i,0,`RIFF`),i.setUint32(4,36+n*4,!0),cd(i,8,`WAVE`),cd(i,12,`fmt `),i.setUint32(16,16,!0),i.setUint16(20,3,!0),i.setUint16(22,1,!0),i.setUint32(24,t,!0),i.setUint32(28,t*4,!0),i.setUint16(32,4,!0),i.setUint16(34,32,!0),cd(i,36,`data`),i.setUint32(40,n*4,!0),new Blob([r,...e.map(e=>e.buffer)],{type:`audio/wav`})}function cd(e,t,n){for(let r=0;re+t.length,0),t=new Float32Array(e),n=0;for(let e of this.audio)t.set(e,n),n+=e.length;return t}else return this.audio}toBlob(){let e=this.audio;return e instanceof Float32Array&&(e=[e]),sd(e,this.sampling_rate)}async save(e){return Hu(e,this.toBlob())}},ud=class extends Ru{constructor(e){super(e);let t=this.config.sampling_rate,n=ed(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0);this.mel_filters=n,this.window=od(400,`hann`,{periodic:!1}),this.mean=this.config.mean,this.std=this.config.std}async _extract_fbank_features(e,t){return ad(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,max_num_frames:t,transpose:!0})}async _call(e){zu(e,`ASTFeatureExtractor`);let t=await this._extract_fbank_features(e,this.config.max_length);if(this.config.do_normalize){let e=this.std*2,n=t.data;for(let t=0;t0)if(n===`rand_trunc`){let n=Math.floor(xs.random()*(a+1));e=e.subarray(n,n+t),i=await this._extract_fbank_features(e,this.mel_filters_slaney,this.config.nb_max_samples)}else throw Error(`Truncation strategy "${n}" not implemented`);else{if(a<0){let n=new Float64Array(t);if(n.set(e),r===`repeat`)for(let r=e.length;r=1;--n)e[n]-=t*e[n-1];return await ad(e,this.window,this.window.length,this.config.hop_length,{fft_length:this.config.n_fft,power:2,mel_filters:this.config.mel_filters,log_mel:`log`,mel_floor:-1/0,pad_mode:`constant`,center:!0,transpose:!0,mel_offset:2**-24})}async _call(e){zu(e,`ParakeetFeatureExtractor`);let t=await this._extract_fbank_features(e),n=Math.floor((e.length+Math.floor(this.config.n_fft/2)*2-this.config.n_fft)/this.config.hop_length),r=t.data;r.fill(0,n*t.dims[1]);let[i,a]=t.dims,o=new Float64Array(a),s=new Float64Array(a);for(let e=0;e1?n-1:1;for(let e=0;e=l){s.push(e.slice(c,l));break}let t=Math.max(c,c+a-o),n=Math.min(c+a,l),i;i=n<=t?c+a:this._find_split_point_energy(e,t,n,r),i=Math.max(c+1,Math.min(i,l)),s.push(e.slice(c,i)),c=i}return s}_find_split_point_energy(e,t,n,r){let i=n-t;if(i<=r)return Math.floor((t+n)/2);let a=1/0,o=t,s=i-r;for(let n=0;n<=s;n+=r){let i=0;for(let a=0;at&&(e=e.slice(0,t)),r&&e.length%i!==0){let t=i-e.length%i,n=new Float64Array(e.length+t);n.set(e),this.config.padding_value!==0&&n.fill(this.config.padding_value,e.length),e=n}let a=await this._extract_fbank_features(e,this.config.max_length),o=_l([1,a.dims[0]],!0);return{input_features:a.unsqueeze_(0),input_features_mask:o}}},yd=class extends vd{async _extract_fbank_features(e,t){let{frame_length:n,hop_length:r,fft_length:i}=this.config,a=Math.floor(n/2),o=Math.floor((e.length+a-(n+1))/r)+1;return ad(e,this.window,n,r,{fft_length:i,center:!0,pad_mode:`semicausal`,onesided:!0,preemphasis:this.config.preemphasis,preemphasis_htk_flavor:this.config.preemphasis_htk_flavor,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:this.config.mel_floor,mel_floor_mode:`add`,remove_dc_offset:!1,transpose:!0,max_num_frames:o})}async _call(e,t={}){zu(e,`Gemma4AudioFeatureExtractor`);let n=e.length,r=await super._call(e,t),{input_features:i}=r,[,a,o]=i.dims,{frame_length:s,hop_length:c}=this.config,l=Math.floor(s/2),u=s+1,d=new Uint8Array(n+l+(t.pad_to_multiple_of??128));d.fill(1,l,l+n);let f=new Uint8Array(a);for(let e=0;e({id:e,start:t*n,end:r*n,confidence:i/(r-t)})))}return r}},Cd=class extends Ru{constructor(e){super(e);let t=this.config.sampling_rate,n=ed(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0);this.mel_filters=n,this.window=od(400,`povey`,{periodic:!1})}async _extract_fbank_features(e,t){return e=e.map(e=>e*32768),ad(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,max_num_frames:t,transpose:!0})}async _call(e,{padding:t=!0,pad_to_multiple_of:n=2,do_normalize_per_mel_bins:r=!0,return_attention_mask:i=!0}={}){zu(e,`SeamlessM4TFeatureExtractor`);let a=await this._extract_fbank_features(e,this.config.max_length);if(r){let[e,t]=a.dims,n=a.data;for(let r=0;r0){let n=new Float32Array(t*(e+s));n.set(r),n.fill(this.config.padding_value,r.length);let c=e+s;a=new U(a.type,n,[c,t]),i&&(o=new U(`int64`,new BigInt64Array(c),[1,c]),o.data.fill(1n,0,e))}}let[s,c]=a.dims,l=this.config.stride;if(s%l!==0)throw Error(`The number of frames (${s}) must be a multiple of the stride (${l}).`);let u=a.view(1,Math.floor(s/l),c*l),d={input_features:u};if(i){let e=u.dims[1],t=new BigInt64Array(e);if(o){let e=o.data;for(let n=1,r=0;ne+t,0)/e.length,n=e.reduce((e,n)=>e+(n-t)**2,0)/e.length;return e.map(e=>(e-t)/Math.sqrt(n+1e-7))}async _call(e){zu(e,`Wav2Vec2FeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=e;this.config.do_normalize&&(t=this._zero_mean_unit_var_norm(t));let n=[1,t.length];return{input_values:new U(`float32`,t,n),attention_mask:new U(`int64`,new BigInt64Array(t.length).fill(1n),n)}}},Dd=class extends Ru{constructor(e){super(e);let t=this.config.sampling_rate,n=ed(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0);this.mel_filters=n,this.window=od(400,`hamming`,{periodic:!1}),this.min_num_frames=this.config.min_num_frames}async _extract_fbank_features(e){return e=e.map(e=>e*32768),ad(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,transpose:!0,min_num_frames:this.min_num_frames})}async _call(e){zu(e,`WeSpeakerFeatureExtractor`);let t=(await this._extract_fbank_features(e)).unsqueeze_(0);if(this.config.fbank_centering_span===null){let e=t.mean(1).data,n=t.data,[r,i,a]=t.dims;for(let t=0;tr?(e.length>this.config.n_samples&&N.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`."),n=e.slice(0,r)):(n=new Float32Array(r),n.set(e)),{input_features:(await this._extract_fbank_features(n)).unsqueeze_(0)}}},Ad=class{static async from_pretrained(e,t={}){let n=await tc(e,Pu,!0,t),r=n.feature_extractor_type,i=Bu[r];if(!i)throw Error(`Unknown feature_extractor_type: '${r}'. Please report this at ${Nu}.`);return new i(n)}},jd=class extends K{static tokenizer_class=G;static feature_extractor_class=Ad;async _call(e,t=null){let n=this.tokenizer(e),r=t?await this.feature_extractor(t):{};return{...n,...r}}},Md=new Set([`ja`,`zh`]),Nd=class extends K{static tokenizer_class=G;static feature_extractor_class=Ad;static uses_processor_config=!0;get_decoder_prompt_ids(e=`en`){let t=[`▁`,`<|startofcontext|>`,`<|startoftranscript|>`,`<|emo:undefined|>`,`<|${e}|>`,`<|${e}|>`,`<|pnc|>`,`<|noitn|>`,`<|notimestamp|>`,`<|nodiarize|>`];return this.tokenizer.convert_tokens_to_ids(t)}static join_chunks(e,t=`en`){let n=e.filter(e=>e&&e.trim());if(n.length===0)return``;let r=Md.has(t)?``:` `;return[n[0].trimEnd(),...n.slice(1).map(e=>e.trim())].join(r)}async _call(e){return await this.feature_extractor(e)}},Pd={},Fd,Id,Ld;if(j.IS_WEB_ENV)Fd=(e,t)=>{if(!self.OffscreenCanvas)throw Error(`OffscreenCanvas not supported by this environment.`);return new self.OffscreenCanvas(e,t)},Ld=self.createImageBitmap,Id=self.ImageData;else if(Pd)Ld=async e=>{let t=(await e.metadata()).channels,{data:n,info:r}=await e.rotate().raw().toBuffer({resolveWithObject:!0}),i=new Bd(new Uint8ClampedArray(n),r.width,r.height,r.channels);return t!==void 0&&t!==r.channels&&i.convert(t),i};else throw Error(`Unable to load image processing library.`);var Rd={0:`nearest`,1:`lanczos`,2:`bilinear`,3:`bicubic`,4:`box`,5:`hamming`},zd=new Map([[`png`,`image/png`],[`jpg`,`image/jpeg`],[`jpeg`,`image/jpeg`],[`gif`,`image/gif`]]),Bd=class e{constructor(e,t,n,r){this.data=e,this.width=t,this.height=n,this.channels=r}get size(){return[this.width,this.height]}static async read(t){if(t instanceof e)return t;if(typeof t==`string`||t instanceof URL)return await this.fromURL(t);if(t instanceof Blob)return await this.fromBlob(t);if(typeof HTMLCanvasElement<`u`&&t instanceof HTMLCanvasElement||typeof OffscreenCanvas<`u`&&t instanceof OffscreenCanvas)return this.fromCanvas(t);throw Error(`Unsupported input type: ${typeof t}`)}static fromCanvas(t){if(!j.IS_WEB_ENV)throw Error(`fromCanvas() is only supported in browser environments.`);let n=t.getContext(`2d`).getImageData(0,0,t.width,t.height).data;return new e(n,t.width,t.height,4)}static async fromURL(e){let t=await Ks(e);if(t.status!==200)throw Error(`Unable to read image from "${e}" (${t.status} ${t.statusText})`);let n=await t.blob();return this.fromBlob(n)}static async fromBlob(e){if(j.IS_WEB_ENV){let t=await Ld(e),n=Fd(t.width,t.height).getContext(`2d`);return n.drawImage(t,0,0),new this(n.getImageData(0,0,t.width,t.height).data,t.width,t.height,4)}else{let t=Pd(await e.arrayBuffer());return await Ld(t)}}static fromTensor(t,n=`CHW`){if(t.dims.length!==3)throw Error(`Tensor should have 3 dimensions, but has ${t.dims.length} dimensions.`);if(n===`CHW`)t=t.transpose(1,2,0);else if(n!==`HWC`)throw Error(`Unsupported channel format: ${n}`);if(!(t.data instanceof Uint8ClampedArray||t.data instanceof Uint8Array))throw Error(`Unsupported tensor type: ${t.type}`);switch(t.dims[2]){case 1:case 2:case 3:case 4:return new e(t.data,t.dims[1],t.dims[0],t.dims[2]);default:throw Error(`Unsupported number of channels: ${t.dims[2]}`)}}grayscale(){if(this.channels===1)return this;let e=new Uint8ClampedArray(this.width*this.height*1);switch(this.channels){case 3:case 4:for(let t=0,n=0;t=0?c=r:u=-r,i>=0?l=i:d=-i,s.drawImage(o,c,l,t,n,u,d,t,n),new e(s.getImageData(0,0,t,n).data,t,n,4).convert(a)}else{let e=this.toSharp();if(r>=0&&i>=0)e=e.extract({left:Math.floor(r),top:Math.floor(i),width:t,height:n});else if(r<=0&&i<=0){let a=Math.floor(-i),o=Math.floor(-r);e=e.extend({top:a,left:o,right:t-this.width-o,bottom:n-this.height-a})}else{let a=[0,0],o=0;i<0?(a[0]=Math.floor(-i),a[1]=n-this.height-a[0]):o=Math.floor(i);let s=[0,0],c=0;r<0?(s[0]=Math.floor(-r),s[1]=t-this.width-s[0]):c=Math.floor(r),e=e.extend({top:a[0],bottom:a[1],left:s[0],right:s[1]}).extract({left:c,top:o,width:t,height:n})}return await Ld(e)}}async toBlob(e=`image/png`,t=1){if(!j.IS_WEB_ENV)throw Error(`toBlob() is only supported in browser environments.`);return await this.toCanvas().convertToBlob({type:e,quality:t})}toTensor(e=`CHW`){let t=new U(`uint8`,new Uint8Array(this.data),[this.height,this.width,this.channels]);if(e!==`HWC`)if(e===`CHW`)t=t.permute(2,0,1);else throw Error(`Unsupported channel format: ${e}`);return t}toCanvas(){if(!j.IS_WEB_ENV)throw Error(`toCanvas() is only supported in browser environments.`);let e=this.clone().rgba(),t=Fd(e.width,e.height),n=new Id(e.data,e.width,e.height);return t.getContext(`2d`).putImageData(n,0,0),t}split(){let{data:t,width:n,height:r,channels:i}=this,a=t.constructor,o=t.length/i,s=Array.from({length:i},()=>new a(o));for(let e=0;enew e(t,n,r,1))}_update(e,t,n,r=null){return this.data=e,this.width=t,this.height=n,r!==null&&(this.channels=r),this}clone(){return new e(this.data.slice(),this.width,this.height,this.channels)}convert(e){if(this.channels===e)return this;switch(e){case 1:this.grayscale();break;case 3:this.rgb();break;case 4:this.rgba();break;default:throw Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this}async save(e){if(j.IS_WEB_ENV){if(j.IS_WEBWORKER_ENV)throw Error(`Unable to save an image from a Web Worker.`);let t=e.split(`.`).pop().toLowerCase(),n=zd.get(t)??`image/png`;return Hu(e,await this.toBlob(n))}else if(j.IS_FS_AVAILABLE)await this.toSharp().toFile(e);else throw Error(`Unable to save the image because filesystem is disabled in this environment.`)}toSharp(){if(j.IS_WEB_ENV)throw Error(`toSharp() is only supported in server-side environments.`);return Pd(this.data,{raw:{width:this.width,height:this.height,channels:this.channels}})}};Bd.read.bind(Bd);function Vd(e,t,n=0,r=null){let i=e/t,a=mc(i)*t;return r!==null&&a>r&&(a=Math.floor(i)*t),at&&i.push(e)}else{let e=sc(n.data)[1];if(e===c-1||(a=ic(n.data),a[e]e*o[(t+1)%2])),u.boxes.push(n),u.classes.push(t),u.scores.push(a[t])}}l.push(u)}return l}function Gd(e,t=null){let n=e.logits,r=n.dims[0];if(t!==null&&t.length!==r)throw Error(`Make sure that you pass in as many target sizes as the batch dimension of the logits`);let i=[];for(let e=0;el[n]&&(l[n]=t[n],u[n]=e)}let d=Array(a.dims[0]);for(let e=0;ee!==void 0);i.push({segmentation:c,labels:f})}return i}function Kd(e,t,n,r){let i=[],a=[],o=[];for(let s=0;sn&&(i.push(l),a.push(d),o.push(u))}return[i,a,o]}function qd(e,t,n,r=.5,i=.8){let a=[],o=0,s=0,c=t[n].data;for(let t=0;t=r&&++s;let l=o>0&&s>0;return l&&=o/s>i,[l,a]}function Jd(e,t,n,r,i,a=null,o=null){let[s,c]=o??e[0].dims,l=new U(`int32`,new Int32Array(s*c),[s,c]),u=[];if(o!==null)for(let t=0;tf[e]&&(d[e]=n,f[e]=i[e])}let p=0,m=l.data;for(let a=0;a200)throw Error(`absolute aspect ratio must be smaller than 200, got ${Math.max(e,t)/Math.min(e,t)}`);let o=Math.round(e/n)*n,s=Math.round(t/n)*n;if(a*o*s>i){let r=Math.sqrt(a*e*t/i);o=Math.max(n,Math.floor(e/r/n)*n),s=Math.max(n,Math.floor(t/r/n)*n)}else if(a*o*si?c=Math.floor(i*s/r):i>r&&(s=Math.floor(r*c/i)),await e.resize(c,s,{resample:n}))}async crop_margin(e,t=200){let n=e.clone().grayscale(),r=oc(n.data)[0],i=sc(n.data)[0]-r;if(i===0)return e;let a=t/255,o=n.width,s=n.height,c=0,l=0,u=n.data;for(let e=0;ethis.preprocess(e)));return{pixel_values:dl(n.map(e=>e.pixel_values),0),original_sizes:n.map(e=>e.original_size),reshaped_input_sizes:n.map(e=>e.reshaped_input_size)}}static async from_pretrained(e,t={}){let n=await tc(e,Fu,!0,t);return new this(n)}},Qd={};Cr(Qd,{BeitFeatureExtractor:()=>$d,BitImageProcessor:()=>ef,CHMv2ImageProcessor:()=>nf,CLIPFeatureExtractor:()=>af,CLIPImageProcessor:()=>rf,ChineseCLIPFeatureExtractor:()=>tf,ConvNextFeatureExtractor:()=>sf,ConvNextImageProcessor:()=>of,DINOv3ViTImageProcessor:()=>ff,DPTFeatureExtractor:()=>gf,DPTImageProcessor:()=>hf,DeiTFeatureExtractor:()=>lf,DeiTImageProcessor:()=>cf,DetrFeatureExtractor:()=>df,DetrImageProcessor:()=>uf,DonutFeatureExtractor:()=>mf,DonutImageProcessor:()=>pf,EfficientNetImageProcessor:()=>_f,GLPNFeatureExtractor:()=>wf,Gemma3ImageProcessor:()=>vf,Gemma4ImageProcessor:()=>xf,Glm46VImageProcessor:()=>Cf,GroundingDinoImageProcessor:()=>Tf,Idefics3ImageProcessor:()=>Ef,ImageFeatureExtractor:()=>q,ImageProcessor:()=>q,JinaCLIPImageProcessor:()=>Of,Lfm2VlImageProcessor:()=>Pf,LlavaOnevisionImageProcessor:()=>Ff,Mask2FormerImageProcessor:()=>Rf,MaskFormerFeatureExtractor:()=>Lf,MaskFormerImageProcessor:()=>If,MobileNetV1FeatureExtractor:()=>Bf,MobileNetV1ImageProcessor:()=>zf,MobileNetV2FeatureExtractor:()=>Hf,MobileNetV2ImageProcessor:()=>Vf,MobileNetV3FeatureExtractor:()=>Wf,MobileNetV3ImageProcessor:()=>Uf,MobileNetV4FeatureExtractor:()=>Kf,MobileNetV4ImageProcessor:()=>Gf,MobileViTFeatureExtractor:()=>Jf,MobileViTImageProcessor:()=>qf,NougatImageProcessor:()=>Yf,OwlViTFeatureExtractor:()=>Zf,OwlViTImageProcessor:()=>Xf,Owlv2ImageProcessor:()=>Qf,Phi3VImageProcessor:()=>ip,PixtralImageProcessor:()=>ap,PvtImageProcessor:()=>op,Qwen2VLImageProcessor:()=>Sf,RTDetrImageProcessor:()=>sp,Sam2ImageProcessor:()=>cp,Sam3ImageProcessor:()=>cp,SamImageProcessor:()=>cp,SapiensFeatureExtractor:()=>up,SapiensImageProcessor:()=>lp,SegformerFeatureExtractor:()=>fp,SegformerImageProcessor:()=>dp,SiglipImageProcessor:()=>pp,SmolVLMImageProcessor:()=>Ef,Swin2SRImageProcessor:()=>mp,VLMImageProcessor:()=>Df,ViTFeatureExtractor:()=>gp,ViTImageProcessor:()=>hp,VitMatteImageProcessor:()=>_p,VitPoseImageProcessor:()=>vp,YolosFeatureExtractor:()=>bp,YolosImageProcessor:()=>yp});var $d=class extends q{},ef=class extends q{},tf=class extends q{},nf=class extends q{},rf=class extends q{},af=class extends rf{},of=class extends q{constructor(e){super(e),this.crop_pct=this.config.crop_pct??224/256}async resize(e){let t=this.size?.shortest_edge;if(t===void 0)throw Error(`Size dictionary must contain 'shortest_edge' key.`);if(t<384){let n=Math.floor(t/this.crop_pct),[r,i]=this.get_resize_output_image_size(e,{shortest_edge:n});e=await e.resize(r,i,{resample:this.resample}),e=await e.center_crop(t,t)}else e=await e.resize(t,t,{resample:this.resample});return e}},sf=class extends of{},cf=class extends q{},lf=class extends cf{},uf=class extends q{async _call(e){let t=await super._call(e),n=_l([t.pixel_values.dims[0],64,64],1n);return{...t,pixel_mask:n}}post_process_object_detection(...e){return Wd(...e)}post_process_panoptic_segmentation(...e){return Xd(...e)}post_process_instance_segmentation(...e){return Zd(...e)}},df=class extends uf{},ff=class extends q{},pf=class extends q{pad_image(e,t,n,r={}){let[i,a,o]=t,s=this.image_mean;Array.isArray(this.image_mean)||(s=Array(o).fill(s));let c=this.image_std;Array.isArray(c)||(c=Array(o).fill(s));let l=s.map((e,t)=>-e/c[t]);return super.pad_image(e,t,n,{center:!0,constant_values:l,...r})}},mf=class extends pf{},hf=class extends q{},gf=class extends hf{},_f=class extends q{constructor(e){super(e),this.include_top=this.config.include_top??!0,this.include_top&&(this.image_std=this.image_std.map(e=>e*e))}},vf=class extends q{};function yf(e,t,n,r,i){let a=r*n**2,o=Math.sqrt(a/(e*t)),s=i*n,c=Math.floor(o*e/s)*s,l=Math.floor(o*t/s)*s;if(c===0&&l===0)throw Error(`Attempting to resize to a 0 x 0 image. Resized height should be divisible by \`pooling_kernel_size * patch_size\`=${s}.`);let u=Math.floor(r/i**2)*s;return c===0?(c=s,l=Math.min(Math.floor(t/e)*s,u)):l===0&&(l=s,c=Math.min(Math.floor(e/t)*s,u)),[c,l]}function bf(e,t,n,r,i,a,o){let s=Math.floor(t/i),c=Math.floor(n/i),l=s*c,u=i*i*r,d=new Float32Array(a*u),f=0;for(let t=0;ta),0));let l=a.dims[0]/o,u=a.dims[1],d=Math.floor(a.dims[2]/c),f=Math.floor(a.dims[3]/c);return{pixel_values:a.view(l,o,u,Math.floor(d/s),s,c,Math.floor(f/s),s,c).permute(0,3,6,4,7,2,1,5,8).view(l*d*f,u*o*c*c),image_grid_thw:new U(`int64`,[l,d,f],[1,3]),original_sizes:r,reshaped_input_sizes:i}}},Cf=class extends Sf{get_resize_output_image_size(e,t){let n=this.patch_size*this.merge_size,r=this.config.temporal_patch_size??2;return Yd(e.height,e.width,n,this.min_pixels,this.max_pixels,r)}},wf=class extends q{},Tf=class extends q{async _call(e){let t=await super._call(e),n=t.pixel_values.dims,r=yl([n[0],n[2],n[3]]);return{...t,pixel_mask:r}}},Ef=class extends q{constructor(e){super(e),this.do_image_splitting=e.do_image_splitting??!0,this.max_image_size=e.max_image_size}get_resize_for_vision_encoder(e,t){let[n,r]=e.dims.slice(-2),i=r/n;return r>=n?(r=Math.ceil(r/t)*t,n=Math.floor(r/i),n=Math.ceil(n/t)*t):(n=Math.ceil(n/t)*t,r=Math.floor(n*i),r=Math.ceil(r/t)*t),{height:n,width:r}}async _call(e,{do_image_splitting:t=null,return_row_col_info:n=!1}={}){let r;if(!Array.isArray(e))r=[[e]];else{if(e.length===0||!e[0])throw Error(`No images provided.`);r=Array.isArray(e[0])?e:[e]}let i=[],a=[],o=[],s=[],c=[];for(let e of r){let n=await Promise.all(e.map(e=>this.preprocess(e)));s.push(...n.map(e=>e.original_size)),c.push(...n.map(e=>e.reshaped_input_size)),n.forEach(e=>e.pixel_values.unsqueeze_(0));let{longest_edge:r}=this.max_image_size,l;if(t??this.do_image_splitting){let e=Array(n.length),t=Array(n.length);l=await Promise.all(n.map(async(n,i)=>{let a=this.get_resize_for_vision_encoder(n.pixel_values,r),o=await tl(n.pixel_values,{size:[a.height,a.width]}),{frames:s,num_splits_h:c,num_splits_w:l}=await this.split_image(o,this.max_image_size);return e[i]=c,t[i]=l,ul(s,0)})),a.push(e),o.push(t)}else{let e=[r,r];l=await Promise.all(n.map(t=>tl(t.pixel_values,{size:e}))),a.push(Array(n.length).fill(0)),o.push(Array(n.length).fill(0))}i.push(ul(l,0))}let l=i.length,[u,d,f,p]=i[0].dims,m,h;if(l===1)m=i[0].unsqueeze_(0),h=_l([l,u,f,p],!0);else{let e=Math.max(...i.map(e=>e.dims.at(0)));h=_l([l,e,f,p],!0);let t=h.data,n=e*f*p;for(let r=0;rn||o>r){s=Math.ceil(a/n),c=Math.ceil(o/r);let t=Math.ceil(a/s),l=Math.ceil(o/c);for(let n=0;ne*this.rescale_factor)}pad_image(e,t,n,r){return super.pad_image(e,t,n,{constant_values:this.constant_values,center:!0,...r})}},Of=class extends q{constructor(e){let{resize_mode:t,fill_color:n,interpolation:r,size:i,...a}=e,o=t===`squash`?{width:i,height:i}:t===`shortest`?{shortest_edge:i}:{longest_edge:i},s=r===`bicubic`?3:2;super({...a,size:o,resample:s,do_center_crop:!0,crop_size:i,do_normalize:!0})}};function kf(e,t){return Math.round(e/t)*t}function Af(e,t,n,r,i){let a=1/0,o=[1,1],s=n*r;for(let n of t){let t=Math.abs(e-n[0]/n[1]);t.5*i*i*n[0]*n[1]&&(o=n)}return o}function jf(e,t){let n=[],r=new Set;for(let i=e;i<=t;++i)for(let a=1;a<=i;++a)for(let o=1;o<=i;++o){let i=a*o;if(i>=e&&i<=t){let e=a<<16|o;r.has(e)||(r.add(e),n.push([a,o]))}}return n.sort((e,t)=>e[0]*e[1]-t[0]*t[1])}function Mf(e,t){let[n,r,i,a]=e.dims,o=Math.floor(i/t),s=Math.floor(a/t),c=t*t*r,l=e.data,u=new Float32Array(n*o*s*c),d=i*a;for(let e=0;ethis.max_image_tokens*(this.encoder_patch_size*this.downsample_factor)**2*this.max_pixels_tolerance}_get_grid_layout(e,t){let n=jf(this.min_tiles,this.max_tiles),[r,i]=Af(t/e,n,t,e,this.tile_size);return{grid_width:r,grid_height:i,target_width:this.tile_size*r,target_height:this.tile_size*i}}async _call(e,{return_row_col_info:t=null}={}){let n;n=Array.isArray(e)?Array.isArray(e[0])?e:[e]:[[e]];let r=[],i=[],a=[],o=[],s=[],c=[];for(let e of n){let t=await Promise.all(e.map(e=>this.preprocess(e,{do_pad:!1})));for(let{pixel_values:e}of t){let[,t,n]=e.dims,l=e.unsqueeze_(0),u=this.encoder_patch_size*this.downsample_factor,d=u**2,[f,p]=Yd(Math.max(u,t),Math.max(u,n),u,this.min_image_tokens*d,this.max_image_tokens*d).map(e=>Math.max(u,e)),m,h=1,g=1,_=this._is_image_too_large(t,n),v=this.do_image_splitting&&!(this.min_tiles===1&&this.max_tiles===1);if(_&&v){let{grid_width:e,grid_height:r,target_width:i,target_height:a}=this._get_grid_layout(t,n);h=r,g=e;let o=await tl(l,{size:[a,i]});m=[];for(let t=0;t(e-this.image_mean[t])/this.image_std[t]);return super.pad_image(e,t,{width:s,height:o},{center:!0,constant_values:c,...r})}async _call(e,{num_crops:t=null}={}){if(this._num_crops=t??=this.config.num_crops,t<4||rp(t)%1!=0)throw Error(`num_crops must be a square number >= 4`);Array.isArray(e)||(e=[e]);let n=e.length,r=await Promise.all(e.map(e=>this.preprocess(e))),i=r.map(e=>e.original_size),a=r.map(e=>e.reshaped_input_size),o=[];for(let{pixel_values:e}of r){e.unsqueeze_(0);let[n,r]=e.dims.slice(-2),i=await tl(e,{size:[$f,$f],mode:`bicubic`});if(t>0){let a=[],s=rp(t),c=np(r/s),l=np(n/s);for(let t=0;te.map(e=>$f*tp(e/$f)));return{pixel_values:s,original_sizes:i,reshaped_input_sizes:a,image_sizes:new U(`int64`,c.flat(),[n,2]),num_img_tokens:c.map(([e,t])=>this.calc_num_image_tokens_from_image_size(t,e))}}},ap=class extends q{get_resize_output_image_size(e,t){let{longest_edge:n}=t;if(n===void 0)throw Error(`size must contain 'longest_edge'`);let[r,i]=e.size,a=Math.max(r,i)/n,o=r,s=i;a>1&&(o=Math.floor(r/a),s=Math.floor(i/a));let{patch_size:c,spatial_merge_size:l}=this.config;if(!l)throw Error(`config must contain 'spatial_merge_size'`);let u=c*l,d=Math.floor((o-1)/u)+1,f=Math.floor((s-1)/u)+1;return[d*u,f*u]}},op=class extends q{},sp=class extends q{post_process_object_detection(...e){return Wd(...e)}},cp=class extends q{reshape_input_points(e,t,n,r=!1){e=structuredClone(e);let i=ai(e);if(i.length===3)r||(i=[1,...i]),e=[e];else if(i.length!==4)throw Error("The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.");for(let r=0;re!==t.dims[n]))throw Error(`The first ${n.length} dimensions of 'input_points' and 'input_labels' must be the same.`);return new U(`int64`,e.flat(1/0).map(BigInt),n)}async _call(e,{input_points:t=null,input_labels:n=null,input_boxes:r=null}={}){let i=await super._call(e);if(t&&(i.input_points=this.reshape_input_points(t,i.original_sizes,i.reshaped_input_sizes)),n){if(!i.input_points)throw Error("`input_points` must be provided if `input_labels` are provided.");i.input_labels=this.add_input_labels(n,i.input_points)}return r&&(i.input_boxes=this.reshape_input_points(r,i.original_sizes,i.reshaped_input_sizes,!0)),i}async post_process_masks(e,t,n,{mask_threshold:r=0,binarize:i=!0,pad_size:a=null}={}){let o=[];a=a??this.pad_size??this.size;let s=[a.height,a.width];for(let a=0;ar&&(t[n]=1);u=new U(`bool`,t,u.dims)}o.push(u)}return o}generate_crop_boxes(e,t,{crop_n_layers:n=0,overlap_ratio:r=512/1500,points_per_crop:i=32,crop_n_points_downscale_factor:a=1}={}){}},lp=class extends q{post_process_semantic_segmentation(...e){return Gd(...e)}},up=class extends lp{},dp=class extends q{post_process_semantic_segmentation(...e){return Gd(...e)}},fp=class extends dp{},pp=class extends q{},mp=class extends q{pad_image(e,t,n,r={}){let[i,a,o]=t;return super.pad_image(e,t,{width:a+(n-a%n)%n,height:i+(n-i%n)%n},{mode:`symmetric`,center:!1,constant_values:-1,...r})}},hp=class extends q{},gp=class extends hp{},_p=class extends q{async _call(e,t){Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]);let n=await Promise.all(e.map(e=>this.preprocess(e))),r=await Promise.all(t.map(e=>this.preprocess(e,{do_normalize:!1,do_convert_rgb:!1,do_convert_grayscale:!0})));return{pixel_values:dl(n.map((e,t)=>ul([e.pixel_values,r[t].pixel_values],0)),0),original_sizes:n.map(e=>e.original_size),reshaped_input_sizes:n.map(e=>e.reshaped_input_size)}}},vp=class extends q{post_process_pose_estimation(e,t,{threshold:n=null}={}){let r=e.tolist(),[i,a,o,s]=e.dims,c=[];for(let e=0;e/gm,bboxes:/([^<]+)?/gm},this.size_per_bin=1e3}construct_prompts(e){typeof e==`string`&&(e=[e]);let t=[];for(let n of e)if(this.task_prompts_without_inputs.has(n))t.push(this.task_prompts_without_inputs.get(n));else{for(let[e,r]of this.task_prompts_with_input)if(n.includes(e)){t.push(r.replaceAll(`{input}`,n).replaceAll(e,``));break}t.length!==e.length&&t.push(n)}return t}post_process_generation(e,t,n){let r=this.tasks_answer_post_processing_type.get(t)??`pure_text`;e=e.replaceAll(``,``).replaceAll(``,``);let i;switch(r){case`pure_text`:i=e;break;case`description_with_bboxes`:case`bboxes`:case`phrase_grounding`:case`ocr`:let a=r===`ocr`?`quad_boxes`:`bboxes`,o=e.matchAll(this.regexes[a]),s=[],c=[];for(let[e,t,...r]of o)s.push(t?t.trim():s.at(-1)??``),c.push(r.map((e,t)=>(Number(e)+.5)/this.size_per_bin*n[t%2]));i={labels:s,[a]:c};break;default:throw Error(`Task "${t}" (of type "${r}") not yet implemented.`)}return{[t]:i}}async _call(e,t=null,n={}){if(!e&&!t)throw Error(`Either text or images must be provided`);let r=await this.image_processor(e,n),i=t?this.tokenizer(this.construct_prompts(t),n):{};return{...r,...i}}},Cp=class extends K{static tokenizer_class=G;static image_processor_class=xp;static uses_processor_config=!0;static uses_chat_template_file=!0;constructor(e,t,n){super(e,t,n),this.image_seq_length=this.config.image_seq_length;let{boi_token:r,image_token:i,eoi_token:a}=this.tokenizer.config;this.boi_token=r,this.image_token=i,this.eoi_token=a;let o=i.repeat(this.image_seq_length);this.full_image_sequence=` + +${r}${o}${a} + +`}async _call(e,t=null,n={}){typeof e==`string`&&(e=[e]);let r;return t&&(r=await this.image_processor(t,n),e=e.map(e=>e.replaceAll(this.boi_token,this.full_image_sequence))),{...this.tokenizer(e,n),...r}}},wp=class extends K{static image_processor_class=xp;static feature_extractor_class=Ad;static tokenizer_class=G;static uses_processor_config=!0;static uses_chat_template_file=!0;constructor(e,t,n){super(e,t,n),this.audio_seq_length=this.config.audio_seq_length,this.image_seq_length=this.config.image_seq_length;let{audio_token_id:r,boa_token:i,audio_token:a,eoa_token:o,image_token_id:s,boi_token:c,image_token:l,eoi_token:u}=this.tokenizer.config;this.audio_token_id=r,this.boa_token=i,this.audio_token=a;let d=a.repeat(this.audio_seq_length);this.full_audio_sequence=` + +${i}${d}${o} + +`,this.image_token_id=s,this.boi_token=c,this.image_token=l;let f=l.repeat(this.image_seq_length);this.full_image_sequence=` + +${c}${f}${u} + +`}async _call(e,t=null,n=null,r={}){typeof e==`string`&&(e=[e]);let i;n&&(i=await this.feature_extractor(n,r),e=e.map(e=>e.replaceAll(this.audio_token,this.full_audio_sequence)));let a;return t&&(a=await this.image_processor(t,r),e=e.map(e=>e.replaceAll(this.image_token,this.full_image_sequence))),{...this.tokenizer(e,r),...a,...i}}},Tp=class extends K{static uses_processor_config=!0;static uses_chat_template_file=!0;constructor(e,t,n){super(e,t,n),this.audio_ms_per_token=this.config.audio_ms_per_token??40,this.audio_seq_length=this.config.audio_seq_length??750,this.image_seq_length=this.config.image_seq_length??280;let{audio_token:r,boa_token:i,eoa_token:a,image_token:o,boi_token:s,eoi_token:c}=this.tokenizer.config;this.audio_token=r,this.boa_token=i,this.eoa_token=a,this.image_token=o,this.boi_token=s,this.eoi_token=c}static async from_pretrained(e,t={}){let[n,r,i]=await Promise.all([tc(e,Iu,!0,t),G.from_pretrained(e,t),ec(e,Lu,!1,t)]),a={tokenizer:r};return n.image_processor&&(a.image_processor=new xf(n.image_processor)),n.feature_extractor&&(a.feature_extractor=new yd(n.feature_extractor)),new this(n,a,i)}_compute_audio_num_tokens(e,t){let n=Math.round(t*20/1e3),r=Math.round(t*10/1e3),i=Math.floor(n/2),a=Math.floor((e+i-n-1)/r)+1;if(a<=0)return 0;for(let e=0;e<2;++e)a=Math.floor((a-1)/2)+1;return Math.min(a,this.audio_seq_length)}async _call(e,t=null,n=null,r={}){typeof e==`string`&&(e=[e]);let i;if(t){i=await this.image_processor(t,r);let n=i.num_soft_tokens_per_image,a=0;e=e.map(e=>e.replaceAll(this.image_token,()=>` + +${this.boi_token}${this.image_token.repeat(n[a++])}${this.eoi_token} + +`))}let a;if(n){let t=Array.isArray(n)?n:[n];a=await this.feature_extractor(t[0],r);let i=this.feature_extractor.config.sampling_rate??16e3,o=0;e=e.map(e=>e.replaceAll(this.audio_token,()=>` + +${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(t[o++].length,i))}${this.eoa_token} + +`))}return{...this.tokenizer(e,r),...i,...a}}},Ep=class extends K{static image_processor_class=xp;static tokenizer_class=G;static image_token=`<|image_pad|>`;async _call(e,t=null,...n){Array.isArray(e)||(e=[e]);let r,i;if(t&&(r=await this.image_processor(t),i=r.image_grid_thw),i){let t=this.image_processor.config.merge_size**2,n=0,r=this.constructor.image_token,a=i.tolist();e=e.map(e=>{for(;e.includes(r);){let i=Number(a[n++].reduce((e,t)=>e*t,1n));e=e.replace(r,`<|placeholder|>`.repeat(Math.floor(i/t)))}return e.replaceAll(`<|placeholder|>`,r)})}return{...this.tokenizer(e),...r}}},Dp=class extends Ep{static image_token=`<|image|>`},Op=class extends K{static tokenizer_class=G;static feature_extractor_class=Ad;static uses_processor_config=!0;_get_num_audio_features(e){let{hop_length:t}=this.feature_extractor.config.melspec_kwargs,{projector_window_size:n,projector_downsample_rate:r}=this.feature_extractor.config,i=Math.floor(n/r),a=Math.floor(e/t)+1,o=Math.floor(a/2);return Math.ceil(o/n)*i}async _call(e,t=null,n={}){if(Array.isArray(e))throw Error(`Batched inputs are not supported yet.`);let r={};if(t){let{input_features:n}=await this.feature_extractor(t);r.input_features=n;let i=this._get_num_audio_features(t.length);r.input_features_mask=new U(`bool`,new Uint8Array(i).fill(1),[1,i]);let a=this.config.audio_token??`<|audio|>`;if(!e.includes(a))throw Error(`The input text does not contain the audio token ${a}.`);e=e.replaceAll(a,a.repeat(i))}return{...this.tokenizer(e,{add_special_tokens:!1,...n}),...r}}};function kp(e,t){let n=e.dims.at(-1)-1,r=e.tolist();r.fill(!1,0,1),r.fill(!1,n);let i=t.tolist();return r.map((e,t)=>e?t:null).filter(e=>e!==null).map(e=>i[e])}var Ap=class extends K{static tokenizer_class=G;static image_processor_class=xp;async _call(e,t,n={}){let r=e?await this.image_processor(e,n):{};return{...t?this.tokenizer(t,n):{},...r}}post_process_grounded_object_detection(e,t,{box_threshold:n=.25,text_threshold:r=.25,target_sizes:i=null}={}){let{logits:a,pred_boxes:o}=e,s=a.dims[0];if(i!==null&&i.length!==s)throw Error(`Make sure that you pass in as many target sizes as the batch dimension of the logits`);let c=a.dims.at(1),l=a.sigmoid(),u=l.max(-1).tolist(),d=o.tolist().map(e=>e.map(e=>Ud(e))),f=[];for(let e=0;ee.map((e,t)=>e*a[(t+1)%2])));let o=u[e],s=[],p=[],m=[];for(let i=0;i`+i.repeat(e);o+=` +`}return o+=` +${r}${a}`+i.repeat(e)+`${r}`,o}function Mp(e,t,n,r){return`${t}${r}`+n.repeat(e)+`${t}`}function Np(e,t,n,r,i,a){return e===0&&t===0?Mp(n,r,i,a):jp(n,e,t,r,i,a)}var Pp=class extends K{static image_processor_class=xp;static tokenizer_class=G;static uses_processor_config=!0;fake_image_token=``;image_token=``;global_img_token=``;async _call(e,t=null,n={}){n.return_row_col_info??=!0;let r;t&&(r=await this.image_processor(t,n)),Array.isArray(e)||(e=[e]);let i=r.rows??[Array(e.length).fill(0)],a=r.cols??[Array(e.length).fill(0)],o=this.config.image_seq_len,s=[],c=[];for(let t=0;tNp(e,l[t],o,this.fake_image_token,this.image_token,this.global_img_token)),d=n.split(this.image_token);if(d.length===0)throw Error(`The image token should be present in the text.`);let f=d[0];for(let e=0;ee.images).flatMap(e=>e.images).map(e=>Bd.read(e)));let r=this.tokenizer,i=r.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0,chat_template:n}),a=e=>r.encode(e,{add_special_tokens:!1}),o=i.split(this.image_tag),s=o.length-1;if(t.length!==s)throw Error(`Number of images provided (${t.length}) does not match number of "${this.image_tag}" image tags (${s})`);let[c,l,u]=r.convert_tokens_to_ids([this.image_tag,this.image_start_tag,this.image_end_tag]),d=a(o[0]),f=Array(d.length).fill(!1);for(let e=1;e0){let e=await this.image_processor(t);return e.pixel_values.unsqueeze_(0),{...m,...e}}return m}},Ip=class extends K{static tokenizer_class=G;static image_processor_class=xp;async _call(e=null,t=null,n={}){if(!e&&!t)throw Error(`Either text or images must be provided`);let r=e?this.tokenizer(e,n):{},i=t?await this.image_processor(t,n):{};return{...r,...i}}},Lp=class extends K{static tokenizer_class=G;static image_processor_class=xp;async _call(e,t=null,n={}){let{image_rows:r,image_cols:i,image_sizes:a,...o}=await this.image_processor(e,{...n,return_row_col_info:!0});if(t){let e=this.config.image_token??``,{tile_size:n=512,downsample_factor:o=2,encoder_patch_size:s=16,use_thumbnail:c=!0}=this.image_processor.config,l=e=>Math.ceil(Math.floor(e/s)/o),u=l(n)**2,d=this.config.image_start_token??`<|image_start|>`,f=this.config.image_end_token??`<|image_end|>`,p=this.config.image_thumbnail??`<|img_thumbnail|>`;Array.isArray(t)||(t=[t]);let m=0;t=t.map(t=>{let n=t.split(e);return n[0]+n.slice(1).map(t=>{let n=m++,[o,s]=a[n],h=r[n],g=i[n],_=l(o)*l(s),v=d;if(h>1||g>1){let t=e.repeat(u);for(let e=0;e`+t;c&&(v+=p+e.repeat(_))}else v+=e.repeat(_);return v+f+t}).join(``)})}return{...o,...t?this.tokenizer(t,n):{}}}},Rp=class extends K{static tokenizer_class=G;static image_processor_class=xp;static uses_processor_config=!0;async _call(e,t=null,n={}){let r=await this.image_processor(e,n);if(t){let[e,n]=r.pixel_values.dims.slice(-2),{image_token:i,patch_size:a,num_additional_image_tokens:o}=this.config,s=Math.floor(e/a)*Math.floor(n/a)+o;t=structuredClone(t),Array.isArray(t)||(t=[t]);for(let e=0;e0?i.reduce((e,t)=>e*t,1):0;c.push(n),s.push(a)}return[i(c),s]}char_decode(e){return this.char_tokenizer.batch_decode(e).map(e=>e.replaceAll(` `,``))}bpe_decode(e){return this.bpe_tokenizer.batch_decode(e)}wp_decode(e){return this.wp_tokenizer.batch_decode(e).map(e=>e.replaceAll(` `,``))}batch_decode([e,t,n]){let[r,i]=this._decode_helper(e,`char`),[a,o]=this._decode_helper(t,`bpe`),[s,c]=this._decode_helper(n,`wp`),l=[],u=[];for(let e=0;e`;function Wp(e,t,n,r,i){return`${r.repeat(n*i)}${t}${e} +`}var Gp=class extends K{static tokenizer_class=G;static image_processor_class=xp;static uses_processor_config=!1;async _call(e,t=null,n={}){t||=(N.warn(`You are using PaliGemma without a text prefix. It will perform as a picture-captioning model.`),``),Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]);let r=this.tokenizer.bos_token,i=this.image_processor.config.image_seq_length,a;t.some(e=>e.includes(Up))?a=t.map(e=>{let t=e.replaceAll(Up,Up.repeat(i)),n=t.lastIndexOf(Up),a=n===-1?0:n+Up.length;return t.slice(0,a)+r+t.slice(a)+` +`}):(N.warn("You are passing both `text` and `images` to `PaliGemmaProcessor`. The processor expects special image tokens in the text, as many tokens as there are images per each text. It is recommended to add `` tokens in the very beginning of your text. For this call, we will infer how many images each text has and add special tokens."),a=t.map(t=>Wp(t,r,i,Up,e.length)));let o=this.tokenizer(a,n);return{...await this.image_processor(e,n),...o}}},Kp=`<|image|>`,qp=/<\|image_\d+\|>/g,Jp=class extends K{static image_processor_class=xp;static tokenizer_class=G;async _call(e,t=null,{padding:n=!0,truncation:r=!0,num_crops:i=null}={}){Array.isArray(e)||(e=[e]);let a,o;if(t){o=await this.image_processor(t,{num_crops:i});let{num_img_tokens:s}=o,c=e.map((e,t)=>e.split(qp).join(Kp.repeat(s[t])));a=this.tokenizer(c,{padding:n,truncation:r});let l=this.tokenizer._tokenizer.token_to_id(Kp);a.input_ids.map_(e=>e==l?-e:e)}else a=this.tokenizer(e);return{...a,...o}}},Yp=class extends K{static tokenizer_class=G;static image_processor_class=xp;static uses_processor_config=!0;async _call(e,t=null,n={}){let r=await this.image_processor(e,n);if(t){let[e,n]=r.pixel_values.dims.slice(-2),{image_token:i,image_break_token:a,image_end_token:o,patch_size:s,spatial_merge_size:c}=this.config,l=s*c,u=Math.floor(e/l),d=Math.floor(n/l);t=structuredClone(t),Array.isArray(t)||(t=[t]);for(let e=0;esm(e,o)),c=s.map(e=>e.length),l=s.flat(),u=(await Promise.all(l.map(e=>this.feature_extractor(e,n)))).map(e=>e.input_features);r.audio_values=u.length>1?ul(u,0):u[0];let d=i[0];for(let e=0;e0){if(l>Es)throw Error(`The number of external data chunks (${l}) exceeds the maximum allowed value (${Es}).`);let t=Tm(o,l);for(let n of t){let t=`${r.subfolder??``}/${n}`;c.push(new Promise(async(i,a)=>{let o=await $s(e,t,!0,r,s);i(o instanceof Uint8Array?{path:n,data:o}:n)}))}}else a.externalData!==void 0&&(c=a.externalData.map(async t=>{if(typeof t.data==`string`){let n=await $s(e,t.data,!0,r);return{...t,data:n}}return t}));return Promise.all(c)}async function Om(e,t,n,r=!1,i=void 0){let a=n.config?.[`transformers.js_config`]??{},o=Wc(n.device??a.device,t,{warn:e=>N.info(e)}),s=Ac(o),c=a.device_config??{};c.hasOwnProperty(o)&&(a={...a,...c[o]});let l=Xc(n.dtype??a.dtype,t,o,{configDtype:a.dtype,warn:e=>N.info(e)});if(!Yc.hasOwnProperty(l))throw Error(`Invalid dtype: ${l}. Should be one of: ${Object.keys(Kc).join(`, `)}`);if(o===`webgpu`&&!j.IS_NODE_ENV&&l===Kc.fp16&&!await Gc())throw Error(`The device (${o}) does not support fp16.`);let u=Yc[l],d={...n.session_options};d.executionProviders??=s;let f=a.free_dimension_overrides;f?d.freeDimensionOverrides??=f:o.startsWith(`webnn`)&&!d.freeDimensionOverrides&&N.warn(`WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config["transformers.js_config"]["device_config"]["${o}"]. When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`);let p=Em(e,t,n,u),m=await Dm(e,t,u,n,n.use_external_data_format??a.use_external_data_format,d);if(m.length>0&&(!j.IS_NODE_ENV||m.some(e=>typeof e!=`string`))&&(d.externalData=m),r&&o===`webgpu`){let e=bm(n.config,{prefix:`present`,session_name:i});if(e.size>0&&!zc()){let t={};for(let n of e)t[n]=`gpu-buffer`;d.preferredOutputLocation=t}}return{buffer_or_path:await p,session_options:d,session_config:{dtype:l,device:o}}}async function km(e,t,n,r=void 0){return Object.fromEntries(await Promise.all(Object.keys(t).map(async i=>{let a=r?.[i]??!1,{buffer_or_path:o,session_options:s,session_config:c}=await Om(e,t[i],n,a,i);return[i,await Pc(o,s,c)]})))}function Am(e){for(let t in e)Lc(e[t])?e[t]=new U(e[t]):typeof e[t]==`object`&&Am(e[t]);return e}async function J(e,t){let n=jm(e,t);try{return Am(await Ic(e,Object.fromEntries(Object.entries(n).map(([e,t])=>{let n=t.ort_tensor;return j.IS_NODE_ENV&&typeof Float16Array<`u`&&n.cpuData instanceof Float16Array&&(n.cpuData=new Uint16Array(n.cpuData.buffer)),[e,n]}))))}catch(e){let t=Object.fromEntries(Object.entries(n).map(([e,t])=>{let n={type:t.type,dims:t.dims,location:t.location};return n.location!==`gpu-buffer`&&(n.data=t.data),[e,n]}));throw N.error(`An error occurred during model execution: "${e}".`),N.error(`Inputs given to model:`,t),e}}function jm(e,t){let n=Object.create(null),r=[];for(let i of e.inputNames){let e=t[i];if(!(e instanceof U)){r.push(i);continue}n[i]=zc()?e.clone():e}if(r.length>0)throw Error(`An error occurred during model execution: "Missing the following inputs: ${r.join(`, `)}.`);let i=Object.keys(t).length,a=e.inputNames.length;if(i>a){let n=Object.keys(t).filter(t=>!e.inputNames.includes(t));N.warn(`WARNING: Too many inputs were provided (${i} > ${a}). The following inputs will be ignored: "${n.join(`, `)}".`)}return n}var Mm=class{},Y=class extends Mm{constructor({logits:e,...t}){super(),this.logits=e;let n=Object.values(t);n.length>0&&(this.attentions=n)}},Nm=class extends Mm{constructor({logits:e}){super(),this.logits=e}},Pm=class extends Mm{constructor({logits:e}){super(),this.logits=e}},Fm=class extends Mm{constructor({start_logits:e,end_logits:t}){super(),this.start_logits=e,this.end_logits=t}},Im=class extends Mm{constructor({logits:e}){super(),this.logits=e}},Lm=class extends Mm{constructor({alphas:e}){super(),this.alphas=e}},Rm=class extends ei{_call(e,t){throw Error("`_call` should be implemented in a subclass")}},zm=class extends ei{_call(e,t){throw Error("`_call` should be implemented in a subclass")}},Bm=class extends ei{constructor(){super(),this.processors=[]}push(e){this.processors.push(e)}extend(e){this.processors.push(...e)}_call(e,t){let n=t;for(let t of this.processors)n=t(e,n);return n}[Symbol.iterator](){return this.processors.values()}},Vm=class extends Rm{constructor(e){super(),this.bos_token_id=e}_call(e,t){for(let n=0;n=1&&i[i.length-1]>=this.timestamp_begin,o=i.length<2||i[i.length-2]>=this.timestamp_begin;if(a&&(o?r.subarray(this.timestamp_begin).fill(-1/0):r.subarray(0,this.eos_token_id).fill(-1/0)),e[n].length===this.begin_index&&this.max_initial_timestamp_index!==null){let e=this.timestamp_begin+this.max_initial_timestamp_index;r.subarray(e+1).fill(-1/0)}let s=ac(r);Math.log(s.subarray(this.timestamp_begin).map(Math.exp).reduce((e,t)=>e+t))>sc(s.subarray(0,this.timestamp_begin))[0]&&r.subarray(0,this.timestamp_begin).fill(-1/0)}return t}},Km=class extends Rm{constructor(e){super(),this.no_repeat_ngram_size=e}getNgrams(e){let t=e.length,n=[];for(let r=0;r1 to use the classifier free guidance processor, got guidance scale ${e}.`);this.guidance_scale=e}_call(e,t){if(t.dims[0]!==2*e.length)throw Error(`Logits should have twice the batch size of the input ids, the first half of batches corresponding to the conditional inputs, and the second half of batches corresponding to the unconditional inputs. Got batch size ${t.dims[0]} for the logits and ${e.length} for the input ids.`);let n=e.length,r=t.slice([0,n],null),i=t.slice([n,t.dims[0]],null);for(let e=0;ee.length>=this.max_length)}},rh=class extends eh{constructor(e){super(),Array.isArray(e)||(e=[e]),this.eos_token_id=e}_call(e,t){return e.map(e=>{let t=e.at(-1);return this.eos_token_id.some(e=>t==e)})}},ih=class extends eh{constructor(){super(),this.interrupted=!1}interrupt(){this.interrupted=!0}reset(){this.interrupted=!1}_call(e,t){return Array(e.length).fill(this.interrupted)}},ah=class extends ei{constructor(e){super(),this.generation_config=e}async _call(e){return this.sample(e)}async sample(e){throw Error(`sample should be implemented in subclasses.`)}getLogits(e,t){let n=e.dims.at(-1),r=e.data;if(t===-1)r=r.slice(-n);else{let e=t*n;r=r.slice(e,e+n)}return r}randomSelect(e){return Ss(e)}static getSampler(e){if(e.do_sample)return new sh(e);if(e.num_beams>1)return new ch(e);if(e.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${e.num_return_sequences}.`);return new oh(e)}},oh=class extends ah{async sample(e){let t=sc(e.data)[1];return[[BigInt(t),0]]}},sh=class extends ah{async sample(e){let t=e.dims.at(-1);this.generation_config.top_k>0&&(t=Math.min(this.generation_config.top_k,t));let[n,r]=await rl(e,t),i=ic(n.data);return Array.from({length:this.generation_config.num_beams},()=>{let e=this.randomSelect(i);return[r.data[e],Math.log(i[e])]})}},ch=class extends ah{async sample(e){let t=e.dims.at(-1);this.generation_config.top_k>0&&(t=Math.min(this.generation_config.top_k,t));let[n,r]=await rl(e,t),i=ic(n.data);return Array.from({length:this.generation_config.num_beams},(e,t)=>[r.data[t],Math.log(i[t])])}},lh=class{constructor(e){if(e)for(let t in e){if(t in this)throw TypeError(`Key "${t}" conflicts with an existing property on DynamicCache`);let n=e[t];if(!(n instanceof U))throw TypeError(`Expected a Tensor for key "${t}", got ${typeof n}`);this[t]=n}}get_seq_length(){let e=this;if(Object.keys(e).length===0)return 0;for(let t in e)if(t.startsWith(`past_key_values.`))return e[t].dims.at(-2);throw Error(`Unable to determine sequence length from the cache.`)}update(e){for(let t in e){let n=this[t],r=e[t];n&&n!==r&&n.location===`gpu-buffer`&&n.dispose(),this[t]=r}}async dispose(){let e=[];for(let t of Object.values(this))t.location===`gpu-buffer`&&e.push(t.dispose());await Promise.all(e)}},X={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,DecoderOnlyWithoutHead:5,MaskGeneration:6,ImageTextToText:7,Musicgen:8,MultiModality:9,Phi3V:10,AudioTextToText:11,AutoEncoder:12,ImageAudioTextToText:13,Supertonic:14,Chatterbox:15,VoxtralRealtime:16},uh={[X.DecoderOnly]:{sessions:(e,t)=>({model:t.model_file_name??`model`}),cache_sessions:{model:!0},optional_configs:{generation_config:`generation_config.json`}},[X.DecoderOnlyWithoutHead]:{sessions:(e,t)=>({model:t.model_file_name??`model`})},[X.Seq2Seq]:{sessions:()=>({model:`encoder_model`,decoder_model_merged:`decoder_model_merged`}),cache_sessions:{decoder_model_merged:!0},optional_configs:{generation_config:`generation_config.json`}},[X.Vision2Seq]:{sessions:()=>({model:`encoder_model`,decoder_model_merged:`decoder_model_merged`}),cache_sessions:{decoder_model_merged:!0},optional_configs:{generation_config:`generation_config.json`}},[X.Musicgen]:{sessions:()=>({model:`text_encoder`,decoder_model_merged:`decoder_model_merged`,encodec_decode:`encodec_decode`}),cache_sessions:{decoder_model_merged:!0},optional_configs:{generation_config:`generation_config.json`}},[X.EncoderDecoder]:{sessions:()=>({model:`encoder_model`,decoder_model_merged:`decoder_model_merged`}),cache_sessions:{decoder_model_merged:!0}},[X.MaskGeneration]:{sessions:()=>({model:`vision_encoder`,prompt_encoder_mask_decoder:`prompt_encoder_mask_decoder`})},[X.ImageTextToText]:{text_only_sessions:{embed_tokens:`embed_tokens`,decoder_model_merged:`decoder_model_merged`},sessions:(e,t,n)=>{let r={...uh[X.ImageTextToText].text_only_sessions};return n||(r.vision_encoder=`vision_encoder`),e.is_encoder_decoder&&(r.model=`encoder_model`),r},cache_sessions:{decoder_model_merged:!0},optional_configs:{generation_config:`generation_config.json`}},[X.AudioTextToText]:{text_only_sessions:{embed_tokens:`embed_tokens`,decoder_model_merged:`decoder_model_merged`},sessions:(e,t,n)=>{let r={...uh[X.AudioTextToText].text_only_sessions};return n||(r.audio_encoder=`audio_encoder`),r},cache_sessions:{decoder_model_merged:!0},optional_configs:{generation_config:`generation_config.json`}},[X.ImageAudioTextToText]:{text_only_sessions:{embed_tokens:`embed_tokens`,decoder_model_merged:`decoder_model_merged`},sessions:(e,t,n)=>{let r={...uh[X.ImageAudioTextToText].text_only_sessions};return n||(r.audio_encoder=`audio_encoder`,r.vision_encoder=`vision_encoder`),r},optional_configs:{generation_config:`generation_config.json`}},[X.Phi3V]:{sessions:()=>({prepare_inputs_embeds:`prepare_inputs_embeds`,model:`model`,vision_encoder:`vision_encoder`}),cache_sessions:{model:!0},optional_configs:{generation_config:`generation_config.json`}},[X.MultiModality]:{sessions:()=>({prepare_inputs_embeds:`prepare_inputs_embeds`,model:`language_model`,lm_head:`lm_head`,gen_head:`gen_head`,gen_img_embeds:`gen_img_embeds`,image_decode:`image_decode`}),cache_sessions:{model:!0},optional_configs:{generation_config:`generation_config.json`}},[X.AutoEncoder]:{sessions:()=>({encoder_model:`encoder_model`,decoder_model:`decoder_model`})},[X.Supertonic]:{sessions:()=>({text_encoder:`text_encoder`,latent_denoiser:`latent_denoiser`,voice_decoder:`voice_decoder`})},[X.Chatterbox]:{sessions:()=>({embed_tokens:`embed_tokens`,speech_encoder:`speech_encoder`,model:`language_model`,conditional_decoder:`conditional_decoder`}),cache_sessions:{model:!0},optional_configs:{generation_config:`generation_config.json`}},[X.VoxtralRealtime]:{text_only_sessions:{embed_tokens:`embed_tokens`,decoder_model_merged:`decoder_model_merged`},sessions:(e,t,n)=>{let r={...uh[X.VoxtralRealtime].text_only_sessions};return n||(r.audio_encoder=`audio_encoder`),r},cache_sessions:{decoder_model_merged:!0,audio_encoder:!0},optional_configs:{generation_config:`generation_config.json`}},default:{sessions:(e,t)=>({model:t.model_file_name??`model`})}};function dh(e,t,n={}){let r=uh[e]??uh.default;return{sessions:r.sessions(t,n,n.textOnly??!1),cache_sessions:r.cache_sessions,optional_configs:r.optional_configs}}function fh(e,{warn:t=!0}={}){let n=e.architectures||[];for(let e of n){let t=xh.get(e);if(t!==void 0)return t}if(e.model_type){let t=xh.get(e.model_type);if(t!==void 0)return t;for(let t of Object.values(hh))if(t.has(e.model_type)){let n=xh.get(t.get(e.model_type));if(n!==void 0)return n}}if(t){let t=n.length>0?n.join(`, `):`(none)`;N.warn(`[resolve_model_type] Architecture(s) not found in MODEL_TYPE_MAPPING: [${t}] for model type '${e.model_type}'. Falling back to EncoderOnly (single model.onnx file). If you encounter issues, please report at: ${Nu}`)}return X.EncoderOnly}function ph(e,{config:t=null,cache_dir:n=null,local_files_only:r=!1,revision:i=`main`}={}){return t===null?Hs(JSON.stringify([e,n,r,i]),()=>Cm.from_pretrained(e,{config:t,cache_dir:n,local_files_only:r,revision:i})):Cm.from_pretrained(e,{config:t,cache_dir:n,local_files_only:r,revision:i})}async function mh(e,{config:t=null,dtype:n=null,device:r=null,model_file_name:i=null}={}){t=await ph(e,{config:t});let a=[`config.json`],o=t[`transformers.js_config`]??{},s=o.use_external_data_format,c=`onnx`,l=r??o.device,u=n??o.dtype,d=fh(t),f=(e,t=null)=>{t??=e;let n=Yc[Xc(u,e,Wc(l,e))]??``,r=`${t}${n}.onnx`,i=`${c}/${r}`;a.push(i);let o=wm(s,r,e);for(let e of Tm(r,o)){let t=`${c}/${e}`;a.push(t)}},{sessions:p,optional_configs:m}=dh(d,t,{model_file_name:i});for(let[e,t]of Object.entries(p))f(e,t);if(m)for(let e of Object.values(m))a.push(e);return a}var hh=null;function gh(e){hh=e}function _h(e){if(e instanceof U)return e;if(e.length===0)throw Error(`items must be non-empty`);if(Array.isArray(e[0])){if(e.some(t=>t.length!==e[0].length))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.`);return new U(`int64`,BigInt64Array.from(e.flat().map(e=>BigInt(e))),[e.length,e[0].length])}else return new U(`int64`,BigInt64Array.from(e.map(e=>BigInt(e))),[1,e.length])}function vh(e){return new U(`bool`,[e],[1])}var yh={[X.DecoderOnly]:{can_generate:!0,forward:jh,prepare_inputs:Lh},[X.DecoderOnlyWithoutHead]:{can_generate:!1,forward:jh,prepare_inputs:Lh},[X.Seq2Seq]:{can_generate:!0,forward:wh,prepare_inputs:Rh},[X.Vision2Seq]:{can_generate:!0,forward:wh,prepare_inputs:Rh},[X.Musicgen]:{can_generate:!0,forward:wh},[X.EncoderDecoder]:{can_generate:!1,forward:wh},[X.ImageTextToText]:{can_generate:!0,forward:Ph,prepare_inputs:zh},[X.AudioTextToText]:{can_generate:!0,forward:Nh,prepare_inputs:zh},[X.ImageAudioTextToText]:{can_generate:!0,prepare_inputs:zh},[X.Phi3V]:{can_generate:!0,prepare_inputs:zh},[X.MultiModality]:{can_generate:!0},[X.AutoEncoder]:{can_generate:!1,forward:Eh},[X.Chatterbox]:{can_generate:!0,forward:Th},[X.VoxtralRealtime]:{can_generate:!0,prepare_inputs:Lh},default:{can_generate:!1,forward:Th}};function bh(e,t){let n=xh.get(e),r=!1,i=t?.architectures?.[0];if(i&&i!==e&&e?.endsWith(`ForCausalLM`)&&i.endsWith(`ForConditionalGeneration`)){let e=xh.get(i);e!==void 0&&(n=e,r=!0)}let a=yh[n]??yh.default,o=uh[n]??uh.default;return{typeConfig:{...a,...o},textOnly:r,modelType:n}}var xh=new Map,Sh=new Map,Ch=new Map,Z=class extends ei{main_input_name=`input_ids`;forward_params=[`input_ids`,`attention_mask`];_return_dict_in_generate_keys=null;constructor(e,t,n){super(),this.config=e,this.sessions=t,this.configs=n;let{typeConfig:r}=bh(Ch.get(this.constructor),e);this.can_generate=r.can_generate,this._forward=r.forward,this._prepare_inputs_for_generation=r.prepare_inputs,this.can_generate&&this.forward_params.push(`past_key_values`),this.custom_config=this.config[`transformers.js_config`]??{}}async dispose(){let e=[];for(let t of Object.values(this.sessions))e.push(t.release?.());return await Promise.all(e)}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,model_file_name:o=null,subfolder:s=`onnx`,device:c=null,dtype:l=null,use_external_data_format:u=null,session_options:d={}}={}){let f={progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,model_file_name:o,subfolder:s,device:c,dtype:l,use_external_data_format:u,session_options:d},p=Ch.get(this);n=f.config=await Cm.from_pretrained(e,f);let{typeConfig:m,textOnly:h,modelType:g}=bh(p,n);if(g===void 0){let e=p??n?.model_type;e!==`custom`&&N.warn(`Model type for '${e}' not found, assuming encoder-only architecture. Please report this at ${Nu}.`)}if(t&&!(t instanceof ni)){let r={};try{let t=await mh(e,{config:n,dtype:l,device:c,model_file_name:o});(await Promise.all(t.map(t=>Ws(e,t,f)))).forEach((e,n)=>{if(e.exists){let i=t[n]===`config.json`;r[t[n]]={loaded:i?e.size??0:0,total:e.size??0}}})}catch(e){N.warn(`Unable to fetch model file metadata for total progress tracking: ${e}`)}Object.keys(r).length>0&&(f.progress_callback=new ni(t,r))}let _=[km(e,m.sessions(n,f,h),f,m.cache_sessions)];m.optional_configs&&_.push(Uh(e,m.optional_configs,f));let v=await Promise.all(_);return new this(n,...v)}async _call(e){return await this.forward(e)}async forward(e){return await this._forward(this,e)}get generation_config(){return this.configs?.generation_config??null}_get_logits_processor(e,t,n=null){let r=new Bm;if(e.repetition_penalty!==null&&e.repetition_penalty!==1&&r.push(new qm(e.repetition_penalty)),e.no_repeat_ngram_size!==null&&e.no_repeat_ngram_size>0&&r.push(new Km(e.no_repeat_ngram_size)),e.bad_words_ids!==null&&r.push(new Xm(e.bad_words_ids,e.eos_token_id)),e.min_length!==null&&e.eos_token_id!==null&&e.min_length>0&&r.push(new Jm(e.min_length,e.eos_token_id)),e.min_new_tokens!==null&&e.eos_token_id!==null&&e.min_new_tokens>0&&r.push(new Ym(t,e.min_new_tokens,e.eos_token_id)),e.forced_bos_token_id!==null&&r.push(new Vm(e.forced_bos_token_id)),e.forced_eos_token_id!==null&&r.push(new Hm(e.max_length,e.forced_eos_token_id)),e.suppress_tokens!==null&&r.push(new Um(e.suppress_tokens)),e.begin_suppress_tokens!==null){let n=t>1||e.forced_bos_token_id===null?t:t+1;r.push(new Wm(e.begin_suppress_tokens,n))}return e.guidance_scale!==null&&e.guidance_scale>1&&r.push(new Zm(e.guidance_scale)),e.temperature===0&&e.do_sample&&(N.warn("`do_sample` changed to false because `temperature: 0` implies greedy sampling (always selecting the most likely token), which is incompatible with `do_sample: true`."),e.do_sample=!1),e.do_sample&&e.temperature!==null&&e.temperature!==1&&r.push(new Qm(e.temperature)),n!==null&&r.extend(n),r}_prepare_generation_config(e,t,n=$m){let r={...this.config};for(let e of[`decoder`,`generator`,`text_config`])e in r&&Object.assign(r,r[e]);let i=new n(r);return Object.assign(i,this.generation_config??{}),e&&Object.assign(i,e),t&&Object.assign(i,li(t,Object.getOwnPropertyNames(i))),i}_get_stopping_criteria(e,t=null){let n=new th;return e.max_length!==null&&n.push(new nh(e.max_length,this.config.max_position_embeddings??null)),e.eos_token_id!==null&&n.push(new rh(e.eos_token_id)),t&&n.extend(t),n}_validate_model_class(){if(!this.can_generate){let e=[hh.MODEL_FOR_CAUSAL_LM_MAPPING_NAMES,hh.MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES,hh.MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES,hh.MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES].filter(Boolean),t=Ch.get(this.constructor),n=new Set,r=this.config.model_type;for(let t of e){let e=t?.get(r);e&&n.add(e)}let i=`The current model class (${t}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;throw n.size>0&&(i+=` Please use the following class instead: ${[...n].join(`, `)}`),Error(i)}}prepare_inputs_for_generation(...e){if(!this._prepare_inputs_for_generation)throw Error(`prepare_inputs_for_generation is not implemented for this model.`);return this._prepare_inputs_for_generation(this,...e)}_update_model_kwargs_for_generation({generated_input_ids:e,outputs:t,model_inputs:n,is_encoder_decoder:r}){return n.past_key_values=Dh(t,n.past_key_values),n.input_ids=new U(`int64`,e.flat(),[e.length,1]),r?`decoder_attention_mask`in n&&(n.decoder_attention_mask=ul([n.decoder_attention_mask,yl([n.decoder_attention_mask.dims[0],1])],1)):n.attention_mask=ul([n.attention_mask,yl([n.attention_mask.dims[0],1])],1),n.position_ids=null,n}_prepare_model_inputs({inputs:e,bos_token_id:t,model_kwargs:n}){let r=li(n,this.forward_params),i=this.main_input_name;if(i in r){if(e)throw Error("`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. Make sure to either pass {inputs} or {input_name}=...")}else r[i]=e;return{inputs_tensor:r[i],model_inputs:r,model_input_name:i}}async _prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:e,model_inputs:t,model_input_name:n,generation_config:r}){if(this.sessions.model.inputNames.includes(`inputs_embeds`)&&!t.inputs_embeds&&`_prepare_inputs_embeds`in this){let{input_ids:e,pixel_values:n,attention_mask:r,...i}=t,a=await this._prepare_inputs_embeds(t);t={...i,...li(a,[`inputs_embeds`,`attention_mask`])}}let{last_hidden_state:i}=await Th(this,t);if(r.guidance_scale!==null&&r.guidance_scale>1)i=ul([i,vl(i,0)],0),`attention_mask`in t&&(t.attention_mask=ul([t.attention_mask,Sl(t.attention_mask)],0));else if(t.decoder_input_ids){let e=_h(t.decoder_input_ids).dims[0];if(e!==i.dims[0]){if(i.dims[0]!==1)throw Error(`The encoder outputs have a different batch size (${i.dims[0]}) than the decoder inputs (${e}).`);i=ul(Array.from({length:e},()=>i),0)}}return t.encoder_outputs=i,t}_prepare_decoder_input_ids_for_generation({batch_size:e,model_input_name:t,model_kwargs:n,decoder_start_token_id:r,bos_token_id:i,generation_config:a}){let{decoder_input_ids:o,...s}=n;if(!(o instanceof U)){if(o)Array.isArray(o[0])||(o=Array.from({length:e},()=>o));else if(r??=i,this.config.model_type===`musicgen`)o=Array.from({length:e*this.config.decoder.num_codebooks},()=>[r]);else if(Array.isArray(r)){if(r.length!==e)throw Error(`\`decoder_start_token_id\` expcted to have length ${e} but got ${r.length}`);o=r}else o=Array.from({length:e},()=>[r]);o=_h(o)}return s.decoder_attention_mask=bl(o),{input_ids:o,model_inputs:s}}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,streamer:i=null,...a}){this._validate_model_class(),t=this._prepare_generation_config(t,a);let{inputs_tensor:o,model_inputs:s,model_input_name:c}=this._prepare_model_inputs({inputs:e,model_kwargs:a}),l=this.config.is_encoder_decoder;l&&(`encoder_outputs`in s||(s=await this._prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:o,model_inputs:s,model_input_name:c,generation_config:t})));let u;l?{input_ids:u,model_inputs:s}=this._prepare_decoder_input_ids_for_generation({batch_size:s[c].dims.at(0),model_input_name:c,model_kwargs:s,decoder_start_token_id:t.decoder_start_token_id,bos_token_id:t.bos_token_id,generation_config:t}):u=s[c];let d=u.dims.at(-1);t.max_new_tokens!==null&&(t.max_length=d+t.max_new_tokens);let f=this._get_logits_processor(t,d,n),p=this._get_stopping_criteria(t,r),m=s[c].dims.at(0),h=ah.getSampler(t),g=Array(m).fill(0),_=u.tolist();i&&i.put(_);let v,y={},b={};for(;;){if(s=this.prepare_inputs_for_generation(_,s,t),v=await this.forward(s),t.return_dict_in_generate)if(t.output_attentions){let e=Oh(v);for(let t in e)t in y||(y[t]=[]),y[t].push(e[t])}else this._return_dict_in_generate_keys&&Object.assign(b,li(v,this._return_dict_in_generate_keys));let e=f(_,v.logits.slice(null,-1,null).to(`float32`)),n=[];for(let t=0;te))break;s=this._update_model_kwargs_for_generation({generated_input_ids:n,outputs:v,model_inputs:s,is_encoder_decoder:l})}i&&i.end();let x=new U(`int64`,_.flat(),[_.length,_[0].length]),ee=Dh(v,s.past_key_values),S=new Set(Object.values(ee));for(let e of Object.values(v))e.location===`gpu-buffer`&&!S.has(e)&&e.dispose();return`past_key_values`in a||t.return_dict_in_generate||await ee.dispose(),t.return_dict_in_generate?{sequences:x,past_key_values:ee,...y,...b}:x}async _encode_input(e,t,n){if(!Object.hasOwn(this.sessions,e))throw Error(`Model does not have a ${e} session.`);let r=this.sessions[e];return(await J(r,li(t,r.inputNames)))[n]}async encode_image(e){return this._encode_input(`vision_encoder`,e,`image_features`)}async encode_text(e){return this._encode_input(`embed_tokens`,e,`inputs_embeds`)}async encode_audio(e){return this._encode_input(`audio_encoder`,e,`audio_features`)}};async function wh(e,t){let{encoder_outputs:n,input_ids:r,decoder_input_ids:i,decoder_attention_mask:a,...o}=t;return n||=(await Th(e,li(t,e.sessions.model.inputNames))).last_hidden_state,o.input_ids=i,o.encoder_hidden_states=n,e.sessions.decoder_model_merged.inputNames.includes(`encoder_attention_mask`)&&(o.encoder_attention_mask=t.attention_mask),a&&!o.attention_mask&&(o.attention_mask=a),await jh(e,o,!0)}async function Th(e,t){let n=e.sessions.model,r=li(t,n.inputNames);if(n.inputNames.includes(`inputs_embeds`)&&!r.inputs_embeds){if(!t.input_ids)throw Error("Both `input_ids` and `inputs_embeds` are missing in the model inputs.");r.inputs_embeds=await e.encode_text({input_ids:t.input_ids})}if(n.inputNames.includes(`token_type_ids`)&&!r.token_type_ids){if(!r.input_ids)throw Error("Both `input_ids` and `token_type_ids` are missing in the model inputs.");r.token_type_ids=Sl(r.input_ids)}if(n.inputNames.includes(`pixel_mask`)&&!r.pixel_mask){if(!r.pixel_values)throw Error("Both `pixel_values` and `pixel_mask` are missing in the model inputs.");let e=r.pixel_values.dims;r.pixel_mask=yl([e[0],e[2],e[3]])}return await J(n,r)}async function Eh(e,t){let n=await e.encode(t);return await e.decode(n)}function Dh(e,t){let n=Object.create(null);for(let r in e)if(r.startsWith(`present`)){let i=r.replace(`present_ssm`,`past_ssm`).replace(`present_conv`,`past_conv`).replace(`present_recurrent`,`past_recurrent`).replace(`present`,`past_key_values`);r.includes(`encoder`)&&t?n[i]=t[i]:n[i]=e[r]}return t?(t.update(n),t):new lh(n)}function Oh(e){let t={};for(let n of[`cross_attentions`,`encoder_attentions`,`decoder_attentions`])for(let r in e)r.startsWith(n)&&(n in t||(t[n]=[]),t[n].push(e[r]));return t}function kh(e,t){return e.map(e=>typeof e==`number`?e:t[e]??0)}function Ah(e,t,n){if(n&&Object.keys(n).length>0)return Object.assign(t,n),n;let r=e.sessions.decoder_model_merged??e.sessions.model,i=(t[e.main_input_name]??t.attention_mask)?.dims?.[0]??1,a=bm(e.config),o=e.config?.normalized_config?.num_heads,s={batch_size:i};typeof o==`number`&&(s[`batch_size x num_heads`]=i*o);let c=Object.create(null);for(let e of r.inputMetadata){if(!a.has(e.name))continue;let n=kh(e.shape,s),r=n.reduce((e,t)=>e*t,1),i=Zc[e.type],o=new U(e.type,new i(r),n);t[e.name]=o,c[e.name]=o}return n?(n.update(c),n):new lh(c)}async function jh(e,t,n=!1){let r=e.sessions[n?`decoder_model_merged`:`model`],{past_key_values:i,...a}=t;return r.inputNames.includes(`use_cache_branch`)&&(a.use_cache_branch=vh(i!=null&&Object.keys(i).length>0)),r.inputNames.includes(`position_ids`)&&a.attention_mask&&!a.position_ids&&(a.position_ids=Ih(a,i,+!![`paligemma`,`gemma3_text`,`gemma3`].includes(e.config.model_type))),r.inputNames.includes(`num_logits_to_keep`)&&!a.num_logits_to_keep&&(a.num_logits_to_keep=new U(`int64`,[0n],[])),Ah(e,a,i),await J(r,li(a,r.inputNames))}async function Mh(e,{encode_function:t,merge_function:n,modality_input_names:r,modality_output_name:i,input_ids:a=null,attention_mask:o=null,position_ids:s=null,inputs_embeds:c=null,past_key_values:l=null,generation_config:u=null,logits_processor:d=null,...f}){if(!c){c=await e.encode_text({input_ids:a,...f});let s=li(f,r);if(Object.keys(s).length>0){if(a.dims[1]!==1){let e=await t({...s,...f});({inputs_embeds:c,attention_mask:o}=n({[i]:e,inputs_embeds:c,input_ids:a,attention_mask:o}))}else if(l&&a.dims[1]===1){let e=a.dims[1],t=l.get_seq_length();o=ul([yl([a.dims[0],t]),o.slice(null,[o.dims[1]-e,o.dims[1]])],1)}}}if(!s&&[`qwen2_vl`,`qwen2_vl_text`,`qwen2_5_vl`,`qwen2_5_vl_text`,`qwen3_vl`,`qwen3_vl_text`,`qwen3_vl_moe`,`qwen3_vl_moe_text`,`qwen3_5`,`qwen3_5_text`,`qwen3_5_moe`,`qwen3_5_moe_text`,`glm_ocr`,`glm_ocr_text`].includes(e.config.model_type)){let{image_grid_thw:t,video_grid_thw:n}=f;[s]=e.get_rope_index(a,t,n,o)}return await jh(e,{inputs_embeds:c,past_key_values:l,attention_mask:o,position_ids:s,generation_config:u,logits_processor:d},!0)}async function Nh(e,t){return await Mh(e,{...t,modality_input_names:[`audio_values`,`input_features`],modality_output_name:`audio_features`,encode_function:e.encode_audio.bind(e),merge_function:e._merge_input_ids_with_audio_features.bind(e)})}async function Ph(e,t){return await Mh(e,{...t,modality_input_names:[`pixel_values`],modality_output_name:`image_features`,encode_function:e.encode_image.bind(e),merge_function:e._merge_input_ids_with_image_features.bind(e)})}function Fh(e,t=0){let[n,r]=e.dims,i=e.data,a=new BigInt64Array(i.length);for(let e=0;ee.dims[1]||i[e.at(-1)])),{...n,decoder_input_ids:_h(t)}}function zh(e,...t){return e.config.is_encoder_decoder?Rh(e,...t):Lh(e,...t)}function Bh({modality_token_id:e,inputs_embeds:t,modality_features:n,input_ids:r,attention_mask:i}){let a=r.tolist().map(t=>t.reduce((t,n,r)=>(n==e&&t.push(r),t),[])),o=a.reduce((e,t)=>e+t.length,0),s=n.dims[0];if(o!==s)throw Error(`Number of tokens and features do not match: tokens: ${o}, features ${s}`);let c=0;for(let e=0;e[r,await tc(e,t[r],!1,n)])))}var Wh={};Cr(Wh,{ASTForAudioClassification:()=>sg,ASTModel:()=>og,ASTPreTrainedModel:()=>ag,AfmoeForCausalLM:()=>tg,AfmoeModel:()=>eg,AfmoePreTrainedModel:()=>$h,AlbertForMaskedLM:()=>Yh,AlbertForQuestionAnswering:()=>Jh,AlbertForSequenceClassification:()=>qh,AlbertModel:()=>Kh,AlbertPreTrainedModel:()=>Gh,ApertusForCausalLM:()=>Qh,ApertusModel:()=>Zh,ApertusPreTrainedModel:()=>Xh,ArceeForCausalLM:()=>ig,ArceeModel:()=>rg,ArceePreTrainedModel:()=>ng,BartForConditionalGeneration:()=>ug,BartForSequenceClassification:()=>dg,BartModel:()=>lg,BartPretrainedModel:()=>cg,BeitForImageClassification:()=>mg,BeitModel:()=>pg,BeitPreTrainedModel:()=>fg,BertForMaskedLM:()=>_g,BertForQuestionAnswering:()=>bg,BertForSequenceClassification:()=>vg,BertForTokenClassification:()=>yg,BertModel:()=>gg,BertPreTrainedModel:()=>hg,BlenderbotForConditionalGeneration:()=>Cg,BlenderbotModel:()=>Sg,BlenderbotPreTrainedModel:()=>xg,BlenderbotSmallForConditionalGeneration:()=>Eg,BlenderbotSmallModel:()=>Tg,BlenderbotSmallPreTrainedModel:()=>wg,BloomForCausalLM:()=>kg,BloomModel:()=>Og,BloomPreTrainedModel:()=>Dg,CHMv2ForDepthEstimation:()=>Ug,CHMv2PreTrainedModel:()=>Hg,CLIPModel:()=>Yg,CLIPPreTrainedModel:()=>Jg,CLIPSegForImageSegmentation:()=>n_,CLIPSegModel:()=>t_,CLIPSegPreTrainedModel:()=>e_,CLIPTextModel:()=>Xg,CLIPTextModelWithProjection:()=>Zg,CLIPVisionModel:()=>Qg,CLIPVisionModelWithProjection:()=>$g,CamembertForMaskedLM:()=>Mg,CamembertForQuestionAnswering:()=>Fg,CamembertForSequenceClassification:()=>Ng,CamembertForTokenClassification:()=>Pg,CamembertModel:()=>jg,CamembertPreTrainedModel:()=>Ag,ChatterboxModel:()=>zg,ChatterboxPreTrainedModel:()=>Rg,ChineseCLIPModel:()=>Vg,ChineseCLIPPreTrainedModel:()=>Bg,ClapAudioModelWithProjection:()=>qg,ClapModel:()=>Gg,ClapPreTrainedModel:()=>Wg,ClapTextModelWithProjection:()=>Kg,CodeGenForCausalLM:()=>a_,CodeGenModel:()=>i_,CodeGenPreTrainedModel:()=>r_,Cohere2ForCausalLM:()=>d_,Cohere2Model:()=>u_,Cohere2PreTrainedModel:()=>l_,CohereAsrForConditionalGeneration:()=>m_,CohereAsrModel:()=>p_,CohereAsrPreTrainedModel:()=>f_,CohereForCausalLM:()=>c_,CohereModel:()=>s_,CoherePreTrainedModel:()=>o_,ConvBertForMaskedLM:()=>__,ConvBertForQuestionAnswering:()=>b_,ConvBertForSequenceClassification:()=>v_,ConvBertForTokenClassification:()=>y_,ConvBertModel:()=>g_,ConvBertPreTrainedModel:()=>h_,ConvNextForImageClassification:()=>C_,ConvNextModel:()=>S_,ConvNextPreTrainedModel:()=>x_,ConvNextV2ForImageClassification:()=>E_,ConvNextV2Model:()=>T_,ConvNextV2PreTrainedModel:()=>w_,DFineForObjectDetection:()=>N_,DFineModel:()=>M_,DFinePreTrainedModel:()=>j_,DINOv3ConvNextModel:()=>Cv,DINOv3ConvNextPreTrainedModel:()=>Sv,DINOv3ViTModel:()=>Tv,DINOv3ViTPreTrainedModel:()=>wv,DPTForDepthEstimation:()=>Iv,DPTModel:()=>Fv,DPTPreTrainedModel:()=>Pv,DacDecoderModel:()=>z_,DacDecoderOutput:()=>F_,DacEncoderModel:()=>R_,DacEncoderOutput:()=>P_,DacModel:()=>L_,DacPreTrainedModel:()=>I_,DebertaForMaskedLM:()=>H_,DebertaForQuestionAnswering:()=>G_,DebertaForSequenceClassification:()=>U_,DebertaForTokenClassification:()=>W_,DebertaModel:()=>V_,DebertaPreTrainedModel:()=>B_,DebertaV2ForMaskedLM:()=>Z_,DebertaV2ForQuestionAnswering:()=>ev,DebertaV2ForSequenceClassification:()=>Q_,DebertaV2ForTokenClassification:()=>$_,DebertaV2Model:()=>X_,DebertaV2PreTrainedModel:()=>Y_,DecisionTransformerModel:()=>nv,DecisionTransformerPreTrainedModel:()=>tv,DeepseekV3ForCausalLM:()=>J_,DeepseekV3Model:()=>q_,DeepseekV3PreTrainedModel:()=>K_,DeiTForImageClassification:()=>av,DeiTModel:()=>iv,DeiTPreTrainedModel:()=>rv,DepthAnythingForDepthEstimation:()=>sv,DepthAnythingPreTrainedModel:()=>ov,DepthProForDepthEstimation:()=>lv,DepthProPreTrainedModel:()=>cv,DetrForObjectDetection:()=>fv,DetrForSegmentation:()=>pv,DetrModel:()=>dv,DetrObjectDetectionOutput:()=>mv,DetrPreTrainedModel:()=>uv,DetrSegmentationOutput:()=>hv,Dinov2ForImageClassification:()=>vv,Dinov2Model:()=>_v,Dinov2PreTrainedModel:()=>gv,Dinov2WithRegistersForImageClassification:()=>xv,Dinov2WithRegistersModel:()=>bv,Dinov2WithRegistersPreTrainedModel:()=>yv,DistilBertForMaskedLM:()=>jv,DistilBertForQuestionAnswering:()=>Av,DistilBertForSequenceClassification:()=>Ov,DistilBertForTokenClassification:()=>kv,DistilBertModel:()=>Dv,DistilBertPreTrainedModel:()=>Ev,DonutSwinModel:()=>Nv,DonutSwinPreTrainedModel:()=>Mv,EdgeTamModel:()=>pT,EfficientNetForImageClassification:()=>zv,EfficientNetModel:()=>Rv,EfficientNetPreTrainedModel:()=>Lv,ElectraForMaskedLM:()=>Hv,ElectraForQuestionAnswering:()=>Gv,ElectraForSequenceClassification:()=>Uv,ElectraForTokenClassification:()=>Wv,ElectraModel:()=>Vv,ElectraPreTrainedModel:()=>Bv,Ernie4_5ForCausalLM:()=>Jv,Ernie4_5Model:()=>qv,Ernie4_5PretrainedModel:()=>Kv,EsmForMaskedLM:()=>Zv,EsmForSequenceClassification:()=>Qv,EsmForTokenClassification:()=>$v,EsmModel:()=>Xv,EsmPreTrainedModel:()=>Yv,EuroBertForMaskedLM:()=>ny,EuroBertForSequenceClassification:()=>ry,EuroBertForTokenClassification:()=>iy,EuroBertModel:()=>ty,EuroBertPreTrainedModel:()=>ey,ExaoneForCausalLM:()=>sy,ExaoneModel:()=>oy,ExaonePreTrainedModel:()=>ay,FalconForCausalLM:()=>uy,FalconH1ForCausalLM:()=>py,FalconH1Model:()=>fy,FalconH1PreTrainedModel:()=>dy,FalconModel:()=>ly,FalconPreTrainedModel:()=>cy,FastViTForImageClassification:()=>gy,FastViTModel:()=>hy,FastViTPreTrainedModel:()=>my,Florence2ForConditionalGeneration:()=>vy,Florence2PreTrainedModel:()=>_y,GLPNForDepthEstimation:()=>Qy,GLPNModel:()=>Zy,GLPNPreTrainedModel:()=>Xy,GPT2LMHeadModel:()=>pb,GPT2Model:()=>fb,GPT2PreTrainedModel:()=>db,GPTBigCodeForCausalLM:()=>tb,GPTBigCodeModel:()=>eb,GPTBigCodePreTrainedModel:()=>$y,GPTJForCausalLM:()=>gb,GPTJModel:()=>hb,GPTJPreTrainedModel:()=>mb,GPTNeoForCausalLM:()=>ib,GPTNeoModel:()=>rb,GPTNeoPreTrainedModel:()=>nb,GPTNeoXForCausalLM:()=>sb,GPTNeoXModel:()=>ob,GPTNeoXPreTrainedModel:()=>ab,Gemma2ForCausalLM:()=>wy,Gemma2Model:()=>Cy,Gemma2PreTrainedModel:()=>Sy,Gemma3ForCausalLM:()=>My,Gemma3ForConditionalGeneration:()=>jy,Gemma3Model:()=>Ay,Gemma3PreTrainedModel:()=>ky,Gemma3nForCausalLM:()=>Fy,Gemma3nForConditionalGeneration:()=>Py,Gemma3nPreTrainedModel:()=>Ny,Gemma4ForCausalLM:()=>Ly,Gemma4ForConditionalGeneration:()=>Iy,GemmaForCausalLM:()=>xy,GemmaModel:()=>by,GemmaPreTrainedModel:()=>yy,GlmForCausalLM:()=>By,GlmModel:()=>zy,GlmMoeDsaForCausalLM:()=>Uy,GlmMoeDsaModel:()=>Hy,GlmMoeDsaPreTrainedModel:()=>Vy,GlmOcrForConditionalGeneration:()=>Yy,GlmPreTrainedModel:()=>Ry,GptOssForCausalLM:()=>ub,GptOssModel:()=>lb,GptOssPreTrainedModel:()=>cb,GraniteForCausalLM:()=>yb,GraniteModel:()=>vb,GraniteMoeHybridForCausalLM:()=>Sb,GraniteMoeHybridModel:()=>xb,GraniteMoeHybridPreTrainedModel:()=>bb,GranitePreTrainedModel:()=>_b,GraniteSpeechForConditionalGeneration:()=>Tb,GroundingDinoForObjectDetection:()=>Db,GroundingDinoPreTrainedModel:()=>Eb,GroupViTModel:()=>kb,GroupViTPreTrainedModel:()=>Ob,HeliumForCausalLM:()=>Mb,HeliumModel:()=>jb,HeliumPreTrainedModel:()=>Ab,HieraForImageClassification:()=>Fb,HieraModel:()=>Pb,HieraPreTrainedModel:()=>Nb,HubertForCTC:()=>Ub,HubertForSequenceClassification:()=>Wb,HubertModel:()=>Hb,HubertPreTrainedModel:()=>Vb,HunYuanDenseV1ForCausalLM:()=>qb,HunYuanDenseV1Model:()=>Kb,HunYuanDenseV1PreTrainedModel:()=>Gb,IJepaForImageClassification:()=>Zb,IJepaModel:()=>Xb,IJepaPreTrainedModel:()=>Yb,Idefics3ForConditionalGeneration:()=>Jb,JAISLMHeadModel:()=>ex,JAISModel:()=>$b,JAISPreTrainedModel:()=>Qb,JinaCLIPModel:()=>nx,JinaCLIPPreTrainedModel:()=>tx,JinaCLIPTextModel:()=>rx,JinaCLIPVisionModel:()=>ix,Lfm2ForCausalLM:()=>sx,Lfm2Model:()=>ox,Lfm2MoeForCausalLM:()=>dx,Lfm2MoeModel:()=>ux,Lfm2MoePreTrainedModel:()=>lx,Lfm2PreTrainedModel:()=>ax,Lfm2VlForConditionalGeneration:()=>fx,LightOnOcrForConditionalGeneration:()=>cx,LiteWhisperForConditionalGeneration:()=>SD,Llama4ForCausalLM:()=>_x,Llama4PreTrainedModel:()=>gx,LlamaForCausalLM:()=>hx,LlamaModel:()=>mx,LlamaPreTrainedModel:()=>px,LlavaForConditionalGeneration:()=>Ey,LlavaOnevisionForConditionalGeneration:()=>Ey,LlavaPreTrainedModel:()=>Ty,LlavaQwen2ForCausalLM:()=>Oy,LongT5ForConditionalGeneration:()=>bx,LongT5Model:()=>yx,LongT5PreTrainedModel:()=>vx,M2M100ForConditionalGeneration:()=>Cx,M2M100Model:()=>Sx,M2M100PreTrainedModel:()=>xx,MBartForCausalLM:()=>Px,MBartForConditionalGeneration:()=>Mx,MBartForSequenceClassification:()=>Nx,MBartModel:()=>jx,MBartPreTrainedModel:()=>Ax,MPNetForMaskedLM:()=>US,MPNetForQuestionAnswering:()=>KS,MPNetForSequenceClassification:()=>WS,MPNetForTokenClassification:()=>GS,MPNetModel:()=>HS,MPNetPreTrainedModel:()=>VS,MT5ForConditionalGeneration:()=>QS,MT5Model:()=>ZS,MT5PreTrainedModel:()=>XS,MarianMTModel:()=>Ex,MarianModel:()=>Tx,MarianPreTrainedModel:()=>wx,MaskFormerForInstanceSegmentation:()=>kx,MaskFormerModel:()=>Ox,MaskFormerPreTrainedModel:()=>Dx,Metric3DForDepthEstimation:()=>Ix,Metric3DPreTrainedModel:()=>Fx,Metric3Dv2ForDepthEstimation:()=>Rx,Metric3Dv2PreTrainedModel:()=>Lx,MgpstrForSceneTextRecognition:()=>Vx,MgpstrModelOutput:()=>zx,MgpstrPreTrainedModel:()=>Bx,MimiDecoderModel:()=>qx,MimiDecoderOutput:()=>Ux,MimiEncoderModel:()=>Kx,MimiEncoderOutput:()=>Hx,MimiModel:()=>Gx,MimiPreTrainedModel:()=>Wx,Mistral4ForCausalLM:()=>$x,Mistral4Model:()=>Qx,Mistral4PreTrainedModel:()=>Zx,MistralForCausalLM:()=>Xx,MistralModel:()=>Yx,MistralPreTrainedModel:()=>Jx,MobileBertForMaskedLM:()=>nS,MobileBertForQuestionAnswering:()=>iS,MobileBertForSequenceClassification:()=>rS,MobileBertModel:()=>tS,MobileBertPreTrainedModel:()=>eS,MobileLLMForCausalLM:()=>sS,MobileLLMModel:()=>oS,MobileLLMPreTrainedModel:()=>aS,MobileNetV1ForImageClassification:()=>uS,MobileNetV1ForSemanticSegmentation:()=>dS,MobileNetV1Model:()=>lS,MobileNetV1PreTrainedModel:()=>cS,MobileNetV2ForImageClassification:()=>mS,MobileNetV2ForSemanticSegmentation:()=>hS,MobileNetV2Model:()=>pS,MobileNetV2PreTrainedModel:()=>fS,MobileNetV3ForImageClassification:()=>vS,MobileNetV3ForSemanticSegmentation:()=>yS,MobileNetV3Model:()=>_S,MobileNetV3PreTrainedModel:()=>gS,MobileNetV4ForImageClassification:()=>SS,MobileNetV4ForSemanticSegmentation:()=>CS,MobileNetV4Model:()=>xS,MobileNetV4PreTrainedModel:()=>bS,MobileViTForImageClassification:()=>ES,MobileViTModel:()=>TS,MobileViTPreTrainedModel:()=>wS,MobileViTV2ForImageClassification:()=>kS,MobileViTV2Model:()=>OS,MobileViTV2PreTrainedModel:()=>DS,ModernBertDecoderForCausalLM:()=>LS,ModernBertDecoderModel:()=>IS,ModernBertDecoderPreTrainedModel:()=>FS,ModernBertForMaskedLM:()=>MS,ModernBertForSequenceClassification:()=>NS,ModernBertForTokenClassification:()=>PS,ModernBertModel:()=>jS,ModernBertPreTrainedModel:()=>AS,Moondream1ForConditionalGeneration:()=>Dy,MoonshineForConditionalGeneration:()=>BS,MoonshineModel:()=>zS,MoonshinePreTrainedModel:()=>RS,MptForCausalLM:()=>YS,MptModel:()=>JS,MptPreTrainedModel:()=>qS,MultiModalityCausalLM:()=>eC,MultiModalityPreTrainedModel:()=>$S,MusicgenForCausalLM:()=>rC,MusicgenForConditionalGeneration:()=>iC,MusicgenModel:()=>nC,MusicgenPreTrainedModel:()=>tC,NanoChatForCausalLM:()=>sC,NanoChatModel:()=>oC,NanoChatPreTrainedModel:()=>aC,NemotronHForCausalLM:()=>uC,NemotronHModel:()=>lC,NemotronHPreTrainedModel:()=>cC,NeoBertForMaskedLM:()=>pC,NeoBertForQuestionAnswering:()=>gC,NeoBertForSequenceClassification:()=>mC,NeoBertForTokenClassification:()=>hC,NeoBertModel:()=>fC,NeoBertPreTrainedModel:()=>dC,NomicBertModel:()=>vC,NomicBertPreTrainedModel:()=>_C,OPTForCausalLM:()=>zC,OPTModel:()=>RC,OPTPreTrainedModel:()=>LC,Olmo2ForCausalLM:()=>wC,Olmo2Model:()=>CC,Olmo2PreTrainedModel:()=>SC,Olmo3ForCausalLM:()=>DC,Olmo3Model:()=>EC,Olmo3PreTrainedModel:()=>TC,OlmoForCausalLM:()=>xC,OlmoHybridForCausalLM:()=>AC,OlmoHybridModel:()=>kC,OlmoHybridPreTrainedModel:()=>OC,OlmoModel:()=>bC,OlmoPreTrainedModel:()=>yC,OpenAIPrivacyFilterForTokenClassification:()=>NC,OpenAIPrivacyFilterModel:()=>MC,OpenAIPrivacyFilterPreTrainedModel:()=>jC,OpenELMForCausalLM:()=>IC,OpenELMModel:()=>FC,OpenELMPreTrainedModel:()=>PC,OwlViTForObjectDetection:()=>GC,OwlViTModel:()=>WC,OwlViTPreTrainedModel:()=>UC,Owlv2ForObjectDetection:()=>HC,Owlv2Model:()=>VC,Owlv2PreTrainedModel:()=>BC,PaliGemmaForConditionalGeneration:()=>KC,ParakeetForCTC:()=>JC,ParakeetPreTrainedModel:()=>qC,PatchTSMixerForPrediction:()=>ZC,PatchTSMixerModel:()=>XC,PatchTSMixerPreTrainedModel:()=>YC,PatchTSTForPrediction:()=>ew,PatchTSTModel:()=>$C,PatchTSTPreTrainedModel:()=>QC,Phi3ForCausalLM:()=>ow,Phi3Model:()=>aw,Phi3PreTrainedModel:()=>iw,Phi3VForCausalLM:()=>cw,Phi3VPreTrainedModel:()=>sw,PhiForCausalLM:()=>rw,PhiModel:()=>nw,PhiPreTrainedModel:()=>tw,PreTrainedModel:()=>Z,PvtForImageClassification:()=>dw,PvtModel:()=>uw,PvtPreTrainedModel:()=>lw,PyAnnoteForAudioFrameClassification:()=>mw,PyAnnoteModel:()=>pw,PyAnnotePreTrainedModel:()=>fw,Qwen2ForCausalLM:()=>_w,Qwen2Model:()=>gw,Qwen2MoeForCausalLM:()=>bw,Qwen2MoeModel:()=>yw,Qwen2MoePreTrainedModel:()=>vw,Qwen2PreTrainedModel:()=>hw,Qwen2VLForCausalLM:()=>Ky,Qwen2VLForConditionalGeneration:()=>Gy,Qwen2VLPreTrainedModel:()=>Wy,Qwen2_5_VLForCausalLM:()=>Jy,Qwen2_5_VLForConditionalGeneration:()=>qy,Qwen3ForCausalLM:()=>Cw,Qwen3Model:()=>Sw,Qwen3MoeForCausalLM:()=>Ew,Qwen3MoeModel:()=>Tw,Qwen3MoePreTrainedModel:()=>ww,Qwen3NextForCausalLM:()=>kw,Qwen3NextModel:()=>Ow,Qwen3NextPreTrainedModel:()=>Dw,Qwen3PreTrainedModel:()=>xw,Qwen3VLForCausalLM:()=>jw,Qwen3VLForConditionalGeneration:()=>Aw,Qwen3VLMoeForCausalLM:()=>Nw,Qwen3VLMoeForConditionalGeneration:()=>Mw,Qwen3_5ForCausalLM:()=>Fw,Qwen3_5ForConditionalGeneration:()=>Pw,Qwen3_5MoeForCausalLM:()=>Lw,Qwen3_5MoeForConditionalGeneration:()=>Iw,RFDetrForObjectDetection:()=>Uw,RFDetrModel:()=>Hw,RFDetrObjectDetectionOutput:()=>Ww,RFDetrPreTrainedModel:()=>Vw,RTDetrForObjectDetection:()=>k_,RTDetrModel:()=>O_,RTDetrObjectDetectionOutput:()=>A_,RTDetrPreTrainedModel:()=>D_,RTDetrV2ForObjectDetection:()=>aT,RTDetrV2Model:()=>iT,RTDetrV2ObjectDetectionOutput:()=>oT,RTDetrV2PreTrainedModel:()=>rT,ResNetForImageClassification:()=>Bw,ResNetModel:()=>zw,ResNetPreTrainedModel:()=>Rw,RoFormerForMaskedLM:()=>$w,RoFormerForQuestionAnswering:()=>nT,RoFormerForSequenceClassification:()=>eT,RoFormerForTokenClassification:()=>tT,RoFormerModel:()=>Qw,RoFormerPreTrainedModel:()=>Zw,RobertaForMaskedLM:()=>qw,RobertaForQuestionAnswering:()=>Xw,RobertaForSequenceClassification:()=>Jw,RobertaForTokenClassification:()=>Yw,RobertaModel:()=>Kw,RobertaPreTrainedModel:()=>Gw,Sam2ImageSegmentationOutput:()=>uT,Sam2Model:()=>fT,Sam2PreTrainedModel:()=>dT,Sam3TrackerModel:()=>mT,SamImageSegmentationOutput:()=>sT,SamModel:()=>lT,SamPreTrainedModel:()=>cT,SapiensForDepthEstimation:()=>_T,SapiensForNormalEstimation:()=>vT,SapiensForSemanticSegmentation:()=>gT,SapiensPreTrainedModel:()=>hT,SegformerForImageClassification:()=>xT,SegformerForSemanticSegmentation:()=>ST,SegformerModel:()=>bT,SegformerPreTrainedModel:()=>yT,SiglipModel:()=>wT,SiglipPreTrainedModel:()=>CT,SiglipTextModel:()=>TT,SiglipVisionModel:()=>ET,SmolLM3ForCausalLM:()=>kT,SmolLM3Model:()=>OT,SmolLM3PreTrainedModel:()=>DT,SmolVLMForConditionalGeneration:()=>AT,SnacDecoderModel:()=>PT,SnacEncoderModel:()=>NT,SnacModel:()=>MT,SnacPreTrainedModel:()=>jT,SolarOpenForCausalLM:()=>LT,SolarOpenModel:()=>IT,SolarOpenPreTrainedModel:()=>FT,SpeechT5ForSpeechToText:()=>BT,SpeechT5ForTextToSpeech:()=>VT,SpeechT5HifiGan:()=>HT,SpeechT5Model:()=>zT,SpeechT5PreTrainedModel:()=>RT,SqueezeBertForMaskedLM:()=>GT,SqueezeBertForQuestionAnswering:()=>qT,SqueezeBertForSequenceClassification:()=>KT,SqueezeBertModel:()=>WT,SqueezeBertPreTrainedModel:()=>UT,StableLmForCausalLM:()=>XT,StableLmModel:()=>YT,StableLmPreTrainedModel:()=>JT,Starcoder2ForCausalLM:()=>$T,Starcoder2Model:()=>QT,Starcoder2PreTrainedModel:()=>ZT,StyleTextToSpeech2Model:()=>tE,StyleTextToSpeech2PreTrainedModel:()=>eE,SupertonicForConditionalGeneration:()=>rE,SupertonicPreTrainedModel:()=>nE,Swin2SRForImageSuperResolution:()=>uE,Swin2SRModel:()=>lE,Swin2SRPreTrainedModel:()=>cE,SwinForImageClassification:()=>oE,SwinForSemanticSegmentation:()=>sE,SwinModel:()=>aE,SwinPreTrainedModel:()=>iE,T5ForConditionalGeneration:()=>pE,T5Model:()=>fE,T5PreTrainedModel:()=>dE,TableTransformerForObjectDetection:()=>gE,TableTransformerModel:()=>hE,TableTransformerObjectDetectionOutput:()=>_E,TableTransformerPreTrainedModel:()=>mE,TrOCRForCausalLM:()=>yE,TrOCRPreTrainedModel:()=>vE,UltravoxModel:()=>wb,UltravoxPreTrainedModel:()=>Cb,UniSpeechForCTC:()=>SE,UniSpeechForSequenceClassification:()=>CE,UniSpeechModel:()=>xE,UniSpeechPreTrainedModel:()=>bE,UniSpeechSatForAudioFrameClassification:()=>OE,UniSpeechSatForCTC:()=>EE,UniSpeechSatForSequenceClassification:()=>DE,UniSpeechSatModel:()=>TE,UniSpeechSatPreTrainedModel:()=>wE,VaultGemmaForCausalLM:()=>jE,VaultGemmaModel:()=>AE,VaultGemmaPreTrainedModel:()=>kE,ViTForImageClassification:()=>FE,ViTMAEModel:()=>LE,ViTMAEPreTrainedModel:()=>IE,ViTMSNForImageClassification:()=>BE,ViTMSNModel:()=>zE,ViTMSNPreTrainedModel:()=>RE,ViTModel:()=>PE,ViTPreTrainedModel:()=>NE,VisionEncoderDecoderModel:()=>ME,VitMatteForImageMatting:()=>HE,VitMattePreTrainedModel:()=>VE,VitPoseForPoseEstimation:()=>WE,VitPosePreTrainedModel:()=>UE,VitsModel:()=>qE,VitsModelOutput:()=>GE,VitsPreTrainedModel:()=>KE,VoxtralForConditionalGeneration:()=>JE,VoxtralRealtimeForConditionalGeneration:()=>iD,VoxtralRealtimePreTrainedModel:()=>rD,Wav2Vec2BertForCTC:()=>sD,Wav2Vec2BertForSequenceClassification:()=>cD,Wav2Vec2BertModel:()=>oD,Wav2Vec2BertPreTrainedModel:()=>aD,Wav2Vec2ForAudioFrameClassification:()=>Bb,Wav2Vec2ForCTC:()=>Rb,Wav2Vec2ForSequenceClassification:()=>zb,Wav2Vec2Model:()=>Lb,Wav2Vec2PreTrainedModel:()=>Ib,WavLMForAudioFrameClassification:()=>hD,WavLMForCTC:()=>fD,WavLMForSequenceClassification:()=>pD,WavLMForXVector:()=>mD,WavLMModel:()=>dD,WavLMPreTrainedModel:()=>uD,WeSpeakerResNetModel:()=>_D,WeSpeakerResNetPreTrainedModel:()=>gD,WhisperForConditionalGeneration:()=>xD,WhisperModel:()=>bD,WhisperPreTrainedModel:()=>yD,XLMForQuestionAnswering:()=>OD,XLMForSequenceClassification:()=>ED,XLMForTokenClassification:()=>DD,XLMModel:()=>wD,XLMPreTrainedModel:()=>CD,XLMRobertaForMaskedLM:()=>jD,XLMRobertaForQuestionAnswering:()=>PD,XLMRobertaForSequenceClassification:()=>MD,XLMRobertaForTokenClassification:()=>ND,XLMRobertaModel:()=>AD,XLMRobertaPreTrainedModel:()=>kD,XLMWithLMHeadModel:()=>TD,XVectorOutput:()=>lD,YolosForObjectDetection:()=>LD,YolosModel:()=>ID,YolosObjectDetectionOutput:()=>RD,YolosPreTrainedModel:()=>FD,YoutuForCausalLM:()=>VD,YoutuModel:()=>BD,YoutuPreTrainedModel:()=>zD});var Gh=class extends Z{},Kh=class extends Gh{},qh=class extends Gh{async _call(e){return new Y(await super._call(e))}},Jh=class extends Gh{async _call(e){return new Fm(await super._call(e))}},Yh=class extends Gh{async _call(e){return new Pm(await super._call(e))}},Xh=class extends Z{},Zh=class extends Xh{},Qh=class extends Xh{},$h=class extends Z{},eg=class extends $h{},tg=class extends $h{},ng=class extends Z{},rg=class extends ng{},ig=class extends ng{},ag=class extends Z{},og=class extends ag{},sg=class extends ag{},cg=class extends Z{},lg=class extends cg{},ug=class extends cg{},dg=class extends cg{async _call(e){return new Y(await super._call(e))}},fg=class extends Z{},pg=class extends fg{},mg=class extends fg{async _call(e){return new Y(await super._call(e))}},hg=class extends Z{},gg=class extends hg{},_g=class extends hg{async _call(e){return new Pm(await super._call(e))}},vg=class extends hg{async _call(e){return new Y(await super._call(e))}},yg=class extends hg{async _call(e){return new Nm(await super._call(e))}},bg=class extends hg{async _call(e){return new Fm(await super._call(e))}},xg=class extends Z{},Sg=class extends xg{},Cg=class extends xg{},wg=class extends Z{},Tg=class extends wg{},Eg=class extends wg{},Dg=class extends Z{},Og=class extends Dg{},kg=class extends Dg{},Ag=class extends Z{},jg=class extends Ag{},Mg=class extends Ag{async _call(e){return new Pm(await super._call(e))}},Ng=class extends Ag{async _call(e){return new Y(await super._call(e))}},Pg=class extends Ag{async _call(e){return new Nm(await super._call(e))}},Fg=class extends Ag{async _call(e){return new Fm(await super._call(e))}},Ig=4299n,Lg=6561n,Rg=class extends Z{forward_params=[`input_ids`,`inputs_embeds`,`attention_mask`,`position_ids`,`audio_values`,`exaggeration`,`audio_features`,`audio_tokens`,`speaker_embeddings`,`speaker_features`,`past_key_values`];main_input_name=`input_ids`;_return_dict_in_generate_keys=[`audio_tokens`,`speaker_embeddings`,`speaker_features`]},zg=class extends Rg{async encode_speech(e){return J(this.sessions.speech_encoder,{audio_values:e})}async forward({input_ids:e=null,attention_mask:t=null,audio_values:n=null,exaggeration:r=null,position_ids:i=null,inputs_embeds:a=null,past_key_values:o=null,generation_config:s=null,logits_processor:c=null,audio_features:l=null,audio_tokens:u=null,speaker_embeddings:d=null,speaker_features:f=null,...p}){let m;if(!a){let s=this.sessions.embed_tokens.inputNames,c={input_ids:e};if(s.includes(`exaggeration`)){if(!(r instanceof U)){let t=e.dims[0];if(r==null)r=_l([t],.5);else if(typeof r==`number`)r=_l([t],r);else if(Array.isArray(r))r=new U(`float32`,r,[t]);else throw Error("Unsupported type for `exaggeration` input")}c.exaggeration=r}if(s.includes(`position_ids`)&&(c.position_ids=i),{inputs_embeds:a}=await J(this.sessions.embed_tokens,c),l&&u&&d&&f&&(m={audio_features:l,audio_tokens:u,speaker_embeddings:d,speaker_features:f}),m||n)m??=await this.encode_speech(n),a=ul([m.audio_features,a],1),t=yl([a.dims[0],a.dims[1]]);else{let e=a.dims[1];if(!o||e!==1)throw Error(`Incorrect state encountered during generation.`);let n=o.get_seq_length();t=yl([a.dims[0],n+e])}}return{...await jh(this,{inputs_embeds:a,past_key_values:o,attention_mask:t,generation_config:s,logits_processor:c},!1),...m}}prepare_inputs_for_generation(e,t,n){return!t.position_ids&&this.sessions.embed_tokens.inputNames.includes(`position_ids`)&&(t.input_ids.dims[1]===1?t.position_ids=new U(`int64`,Array.from({length:e.length},(t,n)=>e[n].length-e[n].findLastIndex(e=>e==Lg)-1),[e.length,1]):t.position_ids=new U(`int64`,t.input_ids.tolist().map(e=>{let t=0;return e.map(e=>e>=Lg?0:t++)}).flat(),t.input_ids.dims)),t.input_ids.dims[1]===1&&(delete t.audio_values,delete t.audio_features,delete t.audio_tokens,delete t.speaker_embeddings,delete t.speaker_features),Lh(this,e,t,n)}async generate(e){let{sequences:t,audio_tokens:n,speaker_embeddings:r,speaker_features:i}=await super.generate({...e,return_dict_in_generate:!0}),a=t.slice(null,[e.input_ids.dims[1],-1]),o=ul([n,a,_l([a.dims[0],3],Ig)],1),{waveform:s}=await J(this.sessions.conditional_decoder,{speech_tokens:o,speaker_features:i,speaker_embeddings:r});return s}},Bg=class extends Z{},Vg=class extends Bg{},Hg=class extends Z{},Ug=class extends Hg{},Wg=class extends Z{},Gg=class extends Wg{},Kg=class extends Wg{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}},qg=class extends Wg{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`audio_model`})}},Jg=class extends Z{},Yg=class extends Jg{},Xg=class extends Jg{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}},Zg=class extends Jg{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}},Qg=class extends Jg{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`vision_model`})}},$g=class extends Jg{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`vision_model`})}},e_=class extends Z{},t_=class extends e_{},n_=class extends e_{},r_=class extends Z{},i_=class extends r_{},a_=class extends r_{},o_=class extends Z{},s_=class extends o_{},c_=class extends o_{},l_=class extends Z{},u_=class extends l_{},d_=class extends l_{},f_=class extends Z{requires_attention_mask=!1;main_input_name=`input_features`;forward_params=[`input_features`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`]},p_=class extends f_{},m_=class extends f_{},h_=class extends Z{},g_=class extends h_{},__=class extends h_{async _call(e){return new Pm(await super._call(e))}},v_=class extends h_{async _call(e){return new Y(await super._call(e))}},y_=class extends h_{async _call(e){return new Nm(await super._call(e))}},b_=class extends h_{async _call(e){return new Fm(await super._call(e))}},x_=class extends Z{},S_=class extends x_{},C_=class extends x_{async _call(e){return new Y(await super._call(e))}},w_=class extends Z{},T_=class extends w_{},E_=class extends w_{async _call(e){return new Y(await super._call(e))}},D_=class extends Z{},O_=class extends D_{},k_=class extends D_{async _call(e){return new A_(await super._call(e))}},A_=class extends Mm{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}},j_=class extends Z{},M_=class extends j_{},N_=class extends j_{async _call(e){return new A_(await super._call(e))}},P_=class extends Mm{constructor({audio_codes:e}){super(),this.audio_codes=e}},F_=class extends Mm{constructor({audio_values:e}){super(),this.audio_values=e}},I_=class extends Z{main_input_name=`input_values`;forward_params=[`input_values`]},L_=class extends I_{async encode(e){return new P_(await J(this.sessions.encoder_model,e))}async decode(e){return new F_(await J(this.sessions.decoder_model,e))}},R_=class extends I_{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}},z_=class extends I_{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}},B_=class extends Z{},V_=class extends B_{},H_=class extends B_{async _call(e){return new Pm(await super._call(e))}},U_=class extends B_{async _call(e){return new Y(await super._call(e))}},W_=class extends B_{async _call(e){return new Nm(await super._call(e))}},G_=class extends B_{async _call(e){return new Fm(await super._call(e))}},K_=class extends Z{},q_=class extends K_{},J_=class extends K_{},Y_=class extends Z{},X_=class extends Y_{},Z_=class extends Y_{async _call(e){return new Pm(await super._call(e))}},Q_=class extends Y_{async _call(e){return new Y(await super._call(e))}},$_=class extends Y_{async _call(e){return new Nm(await super._call(e))}},ev=class extends Y_{async _call(e){return new Fm(await super._call(e))}},tv=class extends Z{},nv=class extends tv{},rv=class extends Z{},iv=class extends rv{},av=class extends rv{async _call(e){return new Y(await super._call(e))}},ov=class extends Z{},sv=class extends ov{},cv=class extends Z{},lv=class extends cv{},uv=class extends Z{},dv=class extends uv{},fv=class extends uv{async _call(e){return new mv(await super._call(e))}},pv=class extends uv{async _call(e){return new hv(await super._call(e))}},mv=class extends Mm{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}},hv=class extends Mm{constructor({logits:e,pred_boxes:t,pred_masks:n}){super(),this.logits=e,this.pred_boxes=t,this.pred_masks=n}},gv=class extends Z{},_v=class extends gv{},vv=class extends gv{async _call(e){return new Y(await super._call(e))}},yv=class extends Z{},bv=class extends yv{},xv=class extends yv{async _call(e){return new Y(await super._call(e))}},Sv=class extends Z{},Cv=class extends Sv{},wv=class extends Z{},Tv=class extends wv{},Ev=class extends Z{},Dv=class extends Ev{},Ov=class extends Ev{async _call(e){return new Y(await super._call(e))}},kv=class extends Ev{async _call(e){return new Nm(await super._call(e))}},Av=class extends Ev{async _call(e){return new Fm(await super._call(e))}},jv=class extends Ev{async _call(e){return new Pm(await super._call(e))}},Mv=class extends Z{},Nv=class extends Mv{},Pv=class extends Z{},Fv=class extends Pv{},Iv=class extends Pv{},Lv=class extends Z{},Rv=class extends Lv{},zv=class extends Lv{async _call(e){return new Y(await super._call(e))}},Bv=class extends Z{},Vv=class extends Bv{},Hv=class extends Bv{async _call(e){return new Pm(await super._call(e))}},Uv=class extends Bv{async _call(e){return new Y(await super._call(e))}},Wv=class extends Bv{async _call(e){return new Nm(await super._call(e))}},Gv=class extends Bv{async _call(e){return new Fm(await super._call(e))}},Kv=class extends Z{},qv=class extends Kv{},Jv=class extends Kv{},Yv=class extends Z{},Xv=class extends Yv{},Zv=class extends Yv{async _call(e){return new Pm(await super._call(e))}},Qv=class extends Yv{async _call(e){return new Y(await super._call(e))}},$v=class extends Yv{async _call(e){return new Nm(await super._call(e))}},ey=class extends Z{},ty=class extends ey{},ny=class extends ey{async _call(e){return new Pm(await super._call(e))}},ry=class extends ey{async _call(e){return new Y(await super._call(e))}},iy=class extends ey{async _call(e){return new Nm(await super._call(e))}},ay=class extends Z{},oy=class extends ay{},sy=class extends ay{},cy=class extends Z{},ly=class extends cy{},uy=class extends cy{},dy=class extends Z{},fy=class extends dy{},py=class extends dy{},my=class extends Z{},hy=class extends my{},gy=class extends my{async _call(e){return new Y(await super._call(e))}},_y=class extends Z{forward_params=[`input_ids`,`inputs_embeds`,`attention_mask`,`pixel_values`,`encoder_outputs`,`decoder_input_ids`,`decoder_inputs_embeds`,`decoder_attention_mask`,`past_key_values`];main_input_name=`inputs_embeds`},vy=class extends _y{_merge_input_ids_with_image_features({inputs_embeds:e,image_features:t,input_ids:n,attention_mask:r}){return{inputs_embeds:ul([t,e],1),attention_mask:ul([yl(t.dims.slice(0,2)),r],1)}}async _prepare_inputs_embeds({input_ids:e,pixel_values:t,inputs_embeds:n,attention_mask:r}){if(!e&&!t)throw Error("Either `input_ids` or `pixel_values` should be provided.");let i,a;return e&&(i=await this.encode_text({input_ids:e})),t&&(a=await this.encode_image({pixel_values:t})),i&&a?{inputs_embeds:n,attention_mask:r}=this._merge_input_ids_with_image_features({inputs_embeds:i,image_features:a,input_ids:e,attention_mask:r}):n=i||a,{inputs_embeds:n,attention_mask:r}}async forward({input_ids:e,pixel_values:t,attention_mask:n,decoder_input_ids:r,decoder_attention_mask:i,encoder_outputs:a,past_key_values:o,inputs_embeds:s,decoder_inputs_embeds:c}){if(s||({inputs_embeds:s,attention_mask:n}=await this._prepare_inputs_embeds({input_ids:e,pixel_values:t,inputs_embeds:s,attention_mask:n})),!a){let{last_hidden_state:e}=await Th(this,{inputs_embeds:s,attention_mask:n});a=e}if(!c){if(!r)throw Error("Either `decoder_input_ids` or `decoder_inputs_embeds` should be provided.");c=await this.encode_text({input_ids:r})}let l={inputs_embeds:c,attention_mask:i,encoder_attention_mask:n,encoder_hidden_states:a,past_key_values:o};return await jh(this,l,!0)}},yy=class extends Z{},by=class extends yy{},xy=class extends yy{},Sy=class extends Z{},Cy=class extends Sy{},wy=class extends Sy{},Ty=class extends Z{forward_params=[`input_ids`,`attention_mask`,`pixel_values`,`position_ids`,`past_key_values`]},Ey=class extends Ty{_merge_input_ids_with_image_features(e){let t=e.image_features.dims.at(-1),n=e.image_features.view(-1,t);return Vh({image_token_id:this.config.image_token_index??this.config.image_token_id,...e,image_features:n})}},Dy=class extends Ey{},Oy=class extends Ey{},ky=class extends Z{},Ay=class extends ky{},jy=class extends Ey{},My=class extends jy{},Ny=class extends Z{forward_params=[`input_ids`,`attention_mask`,`inputs_embeds`,`per_layer_inputs`,`position_ids`,`pixel_values`,`input_features`,`input_features_mask`,`past_key_values`]},Py=class extends Ny{async forward({input_ids:e=null,attention_mask:t=null,pixel_values:n=null,input_features:r=null,input_features_mask:i=null,position_ids:a=null,inputs_embeds:o=null,per_layer_inputs:s=null,past_key_values:c=null,generation_config:l=null,logits_processor:u=null,...d}){if((!o||!s)&&({inputs_embeds:o,per_layer_inputs:s}=await J(this.sessions.embed_tokens,{input_ids:e}),e.dims[1]!==1)){if(n){let{image_features:r}=await this._encode_vision({pixel_values:n,...d});({inputs_embeds:o,attention_mask:t}=this._merge_input_ids_with_image_features({image_features:r,inputs_embeds:o,input_ids:e,attention_mask:t}))}if(r){let{audio_features:n}=await J(this.sessions.audio_encoder,{input_features:r,input_features_mask:i});({inputs_embeds:o,attention_mask:t}=this._merge_input_ids_with_audio_features({audio_features:n,inputs_embeds:o,input_ids:e,attention_mask:t}))}}return await jh(this,{inputs_embeds:o,per_layer_inputs:s,past_key_values:c,attention_mask:t,position_ids:a,generation_config:l,logits_processor:u},!0)}_encode_vision(e){return J(this.sessions.vision_encoder,{pixel_values:e.pixel_values})}_merge_input_ids_with_image_features(e){let t=e.image_features.dims.at(-1),n=e.image_features.view(-1,t);return Vh({image_token_id:this.config.image_token_id,...e,image_features:n})}_merge_input_ids_with_audio_features(e){let t=e.audio_features.dims.at(-1),n=e.audio_features.view(-1,t);return Hh({audio_token_id:this.config.audio_token_id,...e,audio_features:n})}},Fy=class extends Py{},Iy=class extends Py{forward_params=[`input_ids`,`attention_mask`,`inputs_embeds`,`per_layer_inputs`,`position_ids`,`pixel_values`,`image_position_ids`,`input_features`,`input_features_mask`,`past_key_values`];_encode_vision(e){return J(this.sessions.vision_encoder,{pixel_values:e.pixel_values,pixel_position_ids:e.image_position_ids})}},Ly=class extends Iy{},Ry=class extends Z{},zy=class extends Ry{},By=class extends Ry{},Vy=class extends Z{},Hy=class extends Vy{},Uy=class extends Vy{},Wy=class extends Z{forward_params=[`input_ids`,`attention_mask`,`position_ids`,`past_key_values`,`pixel_values`,`image_grid_thw`]},Gy=class extends Wy{image_grid_thw_name=`grid_thw`;_get_text_only_rope_index(e,t){if(t){let{data:e,dims:n}=Fh(t),r=BigInt64Array.from({length:3*e.length},(t,n)=>e[n%e.length]),i=Array.from({length:n[0]},(t,r)=>sc(e.subarray(n[1]*r,n[1]*(r+1)))[0]+1n+BigInt(n[1]));return[new U(`int64`,r,[3,...n]),new U(`int64`,i,[i.length,1])]}else{let[t,n]=e.dims;return[new U(`int64`,BigInt64Array.from({length:3*t*n},(e,r)=>BigInt(Math.floor(r%n/t))),[3,...e.dims]),xl([t,1])]}}_reorder_and_write_positions(e,t,n,r){let i=e.reduce((e,t)=>e+t.length,0),a=Array(i),o=0;for(let t=0;t<3;++t)for(let n of e){let e=n.length/3;for(let r=t*e;r<(t+1)*e;++r)a[o++]=n[r]}let s=0;for(let e=0;e(t==s&&e.push(n),e),[]).map(e=>c[e+1]),u=l.filter(e=>e==a).length,d=l.filter(e=>e==o).length,f=[],p=0,m=u,h=d;for(let e=0;et>p&&e==a),s=c.findIndex((e,t)=>t>p&&e==o),l=m>0&&e!==-1?e:c.length+1,u=h>0&&s!==-1?s:c.length+1,d,g,_,v;l0?sc(f.at(-1))[0]+1:0;f.push(Array.from({length:3*ee},(e,t)=>S+t%ee));let te=ee+S,C=y*b*x,w=Array.from({length:C},(e,t)=>te+Math.floor(t/(b*x))),ne=Array.from({length:C},(e,t)=>te+Math.floor(t/x)%b),re=Array.from({length:C},(e,t)=>te+t%x);f.push([w,ne,re].flat()),p=d+C}if(p0?sc(f.at(-1))[0]+1:0,t=c.length-p;f.push(Array.from({length:3*t},(n,r)=>e+r%t))}return f}get_rope_index(e,t,n,r){let{vision_config:i}=this.config,a=i.spatial_merge_size??2;if(t||n){let i=e.tolist();r||=bl(e);let o=r.tolist(),s=Array.from({length:3},()=>Array.from({length:e.dims[0]},()=>Array.from({length:e.dims[1]},()=>0))),c=t?t.tolist():[],l=n?n.tolist():[],u={image_index:0,video_index:0},d=[];for(let e=0;eo[e][n]==1),n=this._get_multimodal_rope_positions({filtered_ids:t,image_grid_thw_list:c,video_grid_thw_list:l,spatial_merge_size:a,state:u}),r=this._reorder_and_write_positions(n,o[e],s,e);d.push(sc(r)[0]+1-i[e].length)}return[new U(`int64`,s.flat(1/0),[3,e.dims[0],e.dims[1]]),new U(`int64`,d,[d.length,1])]}else return this._get_text_only_rope_index(e,r)}async encode_image({pixel_values:e,image_grid_thw:t}){return(await J(this.sessions.vision_encoder,{pixel_values:e,[this.image_grid_thw_name]:t})).image_features}_merge_input_ids_with_image_features(e){return Vh({image_token_id:this.config.image_token_id,...e})}prepare_inputs_for_generation(e,t,n){if(!t.attention_mask||t.position_ids||!(this.sessions.decoder_model_merged??this.sessions.model).inputNames.includes(`position_ids`))return t;if(!t.past_key_values)[t.position_ids,t.rope_deltas]=this.get_rope_index(t.input_ids,t.image_grid_thw,t.video_grid_thw,t.attention_mask);else{t.pixel_values=null;let e=t.past_key_values.get_seq_length();if(en+e);t.position_ids=dl([r,r,r],0)}}return t}},Ky=class extends Gy{},qy=class extends Gy{image_grid_thw_name=`image_grid_thw`},Jy=class extends Ky{image_grid_thw_name=`image_grid_thw`},Yy=class extends qy{get_vision_position_ids(e,t,n,r){let i=Math.floor(t[0]/n),a=Math.floor(t[1]/r),o=Math.floor(t[2]/r),s=a*o*i,c=Array.from({length:s},()=>e),l=Array.from({length:s},(t,n)=>e+Math.floor(n/(o*i))),u=Array.from({length:s},(t,n)=>e+n%o);return[...c,...l,...u]}_get_multimodal_rope_positions({filtered_ids:e,image_grid_thw_list:t,video_grid_thw_list:n,spatial_merge_size:r,state:i}){let{image_token_id:a}=this.config,o=[],s=0,c=+(e[0]==a);for(let t=1;t<=e.length;++t){let n=tl+n%e)),l+=e}else{let e=t[i.image_index++].map(Number),n=e[0];u.push(this.get_vision_position_ids(l,e,n,r)),l+=Math.max(e[1],e[2])/r}return u}},Xy=class extends Z{},Zy=class extends Xy{},Qy=class extends Xy{},$y=class extends Z{},eb=class extends $y{},tb=class extends $y{},nb=class extends Z{},rb=class extends nb{},ib=class extends nb{},ab=class extends Z{},ob=class extends ab{},sb=class extends ab{},cb=class extends Z{},lb=class extends cb{},ub=class extends cb{},db=class extends Z{},fb=class extends db{},pb=class extends db{},mb=class extends Z{},hb=class extends mb{},gb=class extends mb{},_b=class extends Z{},vb=class extends _b{},yb=class extends _b{},bb=class extends Z{},xb=class extends bb{},Sb=class extends bb{},Cb=class extends Z{forward_params=[`input_ids`,`attention_mask`,`position_ids`,`audio_values`,`past_key_values`]},wb=class extends Cb{_merge_input_ids_with_audio_features(e){let t=e.audio_features.dims.at(-1),n=e.audio_features.view(-1,t);return Hh({audio_token_id:this.config.ignore_index??this.config.audio_token_id??this.config.audio_token_index,...e,audio_features:n})}},Tb=class extends wb{forward_params=[`input_ids`,`attention_mask`,`input_features`,`past_key_values`]},Eb=class extends Z{},Db=class extends Eb{},Ob=class extends Z{},kb=class extends Ob{},Ab=class extends Z{},jb=class extends Ab{},Mb=class extends Ab{},Nb=class extends Z{},Pb=class extends Nb{},Fb=class extends Nb{async _call(e){return new Y(await super._call(e))}},Ib=class extends Z{},Lb=class extends Ib{},Rb=class extends Ib{async _call(e){return new Im(await super._call(e))}},zb=class extends Ib{async _call(e){return new Y(await super._call(e))}},Bb=class extends Ib{async _call(e){return new Nm(await super._call(e))}},Vb=class extends Z{},Hb=class extends Ib{},Ub=class extends Ib{async _call(e){return new Im(await super._call(e))}},Wb=class extends Ib{async _call(e){return new Y(await super._call(e))}},Gb=class extends Z{},Kb=class extends Gb{},qb=class extends Gb{},Jb=class extends Ey{forward_params=[`input_ids`,`attention_mask`,`pixel_values`,`pixel_attention_mask`,`position_ids`,`past_key_values`]},Yb=class extends Z{},Xb=class extends Yb{},Zb=class extends Yb{async _call(e){return new Y(await super._call(e))}},Qb=class extends Z{},$b=class extends Qb{},ex=class extends Qb{},tx=class extends Z{},nx=class extends tx{async forward(e){let t=!e.input_ids,n=!e.pixel_values;if(t&&n)throw Error("Either `input_ids` or `pixel_values` should be provided.");if(t&&(e.input_ids=yl([e.pixel_values.dims[0],1])),n){let{image_size:t}=this.config.vision_config;e.pixel_values=_l([0,3,t,t],0)}let{text_embeddings:r,image_embeddings:i,l2norm_text_embeddings:a,l2norm_image_embeddings:o}=await super.forward(e),s={};return t||(s.text_embeddings=r,s.l2norm_text_embeddings=a),n||(s.image_embeddings=i,s.l2norm_image_embeddings=o),s}},rx=class extends tx{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}},ix=class extends tx{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`vision_model`})}},ax=class extends Z{},ox=class extends ax{},sx=class extends ax{},cx=class extends Ey{},lx=class extends Z{},ux=class extends lx{},dx=class extends lx{},fx=class extends Ey{forward_params=[`input_ids`,`attention_mask`,`pixel_values`,`pixel_attention_mask`,`spatial_shapes`,`position_ids`,`past_key_values`]},px=class extends Z{},mx=class extends px{},hx=class extends px{},gx=class extends Z{},_x=class extends gx{},vx=class extends Z{},yx=class extends vx{},bx=class extends vx{},xx=class extends Z{},Sx=class extends xx{},Cx=class extends xx{},wx=class extends Z{},Tx=class extends wx{},Ex=class extends wx{},Dx=class extends Z{},Ox=class extends Dx{},kx=class extends Dx{},Ax=class extends Z{},jx=class extends Ax{},Mx=class extends Ax{},Nx=class extends Ax{async _call(e){return new Y(await super._call(e))}},Px=class extends Ax{},Fx=class extends Z{},Ix=class extends Fx{},Lx=class extends Z{},Rx=class extends Lx{},zx=class extends Mm{constructor({char_logits:e,bpe_logits:t,wp_logits:n}){super(),this.char_logits=e,this.bpe_logits=t,this.wp_logits=n}get logits(){return[this.char_logits,this.bpe_logits,this.wp_logits]}},Bx=class extends Z{},Vx=class extends Bx{async _call(e){return new zx(await super._call(e))}},Hx=class extends Mm{constructor({audio_codes:e}){super(),this.audio_codes=e}},Ux=class extends Mm{constructor({audio_values:e}){super(),this.audio_values=e}},Wx=class extends Z{main_input_name=`input_values`;forward_params=[`input_values`]},Gx=class extends Wx{async encode(e){return new Hx(await J(this.sessions.encoder_model,e))}async decode(e){return new Ux(await J(this.sessions.decoder_model,e))}},Kx=class extends Wx{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}},qx=class extends Wx{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}},Jx=class extends Z{},Yx=class extends Jx{},Xx=class extends Jx{},Zx=class extends Z{},Qx=class extends Zx{},$x=class extends Zx{},eS=class extends Z{},tS=class extends eS{},nS=class extends eS{async _call(e){return new Pm(await super._call(e))}},rS=class extends eS{async _call(e){return new Y(await super._call(e))}},iS=class extends eS{async _call(e){return new Fm(await super._call(e))}},aS=class extends Z{},oS=class extends aS{},sS=class extends aS{},cS=class extends Z{},lS=class extends cS{},uS=class extends cS{async _call(e){return new Y(await super._call(e))}},dS=class extends cS{},fS=class extends Z{},pS=class extends fS{},mS=class extends fS{async _call(e){return new Y(await super._call(e))}},hS=class extends fS{},gS=class extends Z{},_S=class extends gS{},vS=class extends gS{async _call(e){return new Y(await super._call(e))}},yS=class extends gS{},bS=class extends Z{},xS=class extends bS{},SS=class extends bS{async _call(e){return new Y(await super._call(e))}},CS=class extends bS{},wS=class extends Z{},TS=class extends wS{},ES=class extends wS{async _call(e){return new Y(await super._call(e))}},DS=class extends Z{},OS=class extends DS{},kS=class extends DS{async _call(e){return new Y(await super._call(e))}},AS=class extends Z{},jS=class extends AS{},MS=class extends AS{async _call(e){return new Pm(await super._call(e))}},NS=class extends AS{async _call(e){return new Y(await super._call(e))}},PS=class extends AS{async _call(e){return new Nm(await super._call(e))}},FS=class extends Z{},IS=class extends FS{},LS=class extends FS{},RS=class extends Z{requires_attention_mask=!1;main_input_name=`input_values`;forward_params=[`input_values`,`decoder_input_ids`,`past_key_values`]},zS=class extends RS{},BS=class extends RS{},VS=class extends Z{},HS=class extends VS{},US=class extends VS{async _call(e){return new Pm(await super._call(e))}},WS=class extends VS{async _call(e){return new Y(await super._call(e))}},GS=class extends VS{async _call(e){return new Nm(await super._call(e))}},KS=class extends VS{async _call(e){return new Fm(await super._call(e))}},qS=class extends Z{},JS=class extends qS{},YS=class extends qS{},XS=class extends Z{},ZS=class extends XS{},QS=class extends XS{},$S=class extends Z{},eC=class extends $S{forward_params=[`input_ids`,`pixel_values`,`images_seq_mask`,`images_emb_mask`,`attention_mask`,`position_ids`,`past_key_values`];constructor(...e){super(...e),this._generation_mode=`text`}async forward(e){let t=this._generation_mode??`text`,n;if(t===`text`||!e.past_key_values){let t=this.sessions.prepare_inputs_embeds;n=await J(t,li(e,t.inputNames))}else{let t=this.sessions.gen_img_embeds;n=await J(t,li({image_ids:e.input_ids},t.inputNames))}let r={...e,...n},i=await jh(this,r),a=this.sessions[t===`text`?`lm_head`:`gen_head`];if(!a)throw Error(`Unable to find "${a}" generation head`);let o=await J(a,li(i,a.inputNames));return{...n,...i,...o}}prepare_inputs_for_generation(e,t,n){let r=!!t.past_key_values;return n.guidance_scale!==null&&n.guidance_scale>1&&(r?t.input_ids=ul([t.input_ids,t.input_ids],0):(t.input_ids=ul([t.input_ids,vl(t.input_ids,BigInt(n.pad_token_id))],0),t.attention_mask=ul([t.attention_mask,vl(t.attention_mask,0n)],0))),(r||!t.pixel_values)&&(t.pixel_values=_l([0,0,3,384,384],1)),r&&(t.images_seq_mask=new U(`bool`,[,].fill(!0).fill(!1,0,1),[1,1]),t.images_emb_mask=new U(`bool`,[].fill(!1),[1,1,0])),t}async generate(e){return this._generation_mode=`text`,super.generate(e)}async generate_images(e){this._generation_mode=`image`;let t=(e.inputs??e[this.main_input_name]).dims[1],n=(await super.generate(e)).slice(null,[t,null]),r=this.sessions.image_decode,{decoded_image:i}=await J(r,{generated_tokens:n}),a=i.add_(1).mul_(255/2).clamp_(0,255).to(`uint8`),o=[];for(let e of a){let t=Bd.fromTensor(e);o.push(t)}return o}},tC=class extends Z{},nC=class extends tC{},rC=class extends tC{},iC=class extends Z{forward_params=[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`];_apply_and_filter_by_delay_pattern_mask(e){let[t,n]=e.dims,r=this.config.decoder.num_codebooks,i=n-r,a=0;for(let t=0;t0&&o<=i&&(e.data[a++]=e.data[t])}let o=Math.floor(t/r),s=a/(o*r);return new U(e.type,e.data.slice(0,a),[o,r,s])}prepare_inputs_for_generation(e,t,n){let r=BigInt(this.config.decoder.pad_token_id),i=structuredClone(e);for(let e=0;e=t&&(i[e][t]=r);return n.guidance_scale!==null&&n.guidance_scale>1&&(i=i.concat(i)),Rh(this,i,t,n)}async generate(e){let t=await super.generate(e),n=this._apply_and_filter_by_delay_pattern_mask(t).unsqueeze_(0),{audio_values:r}=await J(this.sessions.encodec_decode,{audio_codes:n});return r}},aC=class extends Z{},oC=class extends aC{},sC=class extends aC{},cC=class extends Z{},lC=class extends cC{},uC=class extends cC{},dC=class extends Z{},fC=class extends dC{},pC=class extends dC{async _call(e){return new Pm(await super._call(e))}},mC=class extends dC{async _call(e){return new Y(await super._call(e))}},hC=class extends dC{async _call(e){return new Nm(await super._call(e))}},gC=class extends dC{async _call(e){return new Fm(await super._call(e))}},_C=class extends Z{},vC=class extends _C{},yC=class extends Z{},bC=class extends yC{},xC=class extends yC{},SC=class extends Z{},CC=class extends SC{},wC=class extends SC{},TC=class extends Z{},EC=class extends TC{},DC=class extends TC{},OC=class extends Z{},kC=class extends OC{},AC=class extends OC{},jC=class extends Z{},MC=class extends jC{},NC=class extends jC{async _call(e){return new Y(await super._call(e))}},PC=class extends Z{},FC=class extends PC{},IC=class extends PC{},LC=class extends Z{},RC=class extends LC{},zC=class extends LC{},BC=class extends Z{},VC=class extends BC{},HC=class extends BC{},UC=class extends Z{},WC=class extends UC{},GC=class extends UC{},KC=class extends Ey{},qC=class extends Z{},JC=class extends qC{async _call(e){return new Im(await super._call(e))}},YC=class extends Z{},XC=class extends YC{},ZC=class extends YC{},QC=class extends Z{},$C=class extends QC{},ew=class extends QC{},tw=class extends Z{},nw=class extends tw{},rw=class extends tw{},iw=class extends Z{},aw=class extends iw{},ow=class extends iw{},sw=class extends Z{forward_params=[`input_ids`,`inputs_embeds`,`attention_mask`,`position_ids`,`pixel_values`,`image_sizes`,`past_key_values`]},cw=class extends sw{async forward({input_ids:e=null,attention_mask:t=null,pixel_values:n=null,image_sizes:r=null,position_ids:i=null,inputs_embeds:a=null,past_key_values:o=null,generation_config:s=null,logits_processor:c=null,...l}){if(!a){let t;if(n&&e.dims[1]!==1){if(!r)throw Error("`image_sizes` must be provided when `pixel_values` is provided.");({image_features:t}=await J(this.sessions.vision_encoder,{pixel_values:n,image_sizes:r}))}else{let e=this.config.normalized_config.hidden_size;t=new U(`float32`,[],[0,e])}({inputs_embeds:a}=await J(this.sessions.prepare_inputs_embeds,{input_ids:e,image_features:t}))}return await jh(this,{inputs_embeds:a,past_key_values:o,attention_mask:t,position_ids:i,generation_config:s,logits_processor:c},!1)}},lw=class extends Z{},uw=class extends lw{},dw=class extends lw{async _call(e){return new Y(await super._call(e))}},fw=class extends Z{},pw=class extends fw{},mw=class extends fw{async _call(e){return new Nm(await super._call(e))}},hw=class extends Z{},gw=class extends hw{},_w=class extends hw{},vw=class extends Z{},yw=class extends vw{},bw=class extends vw{},xw=class extends Z{},Sw=class extends xw{},Cw=class extends xw{},ww=class extends Z{},Tw=class extends ww{},Ew=class extends ww{},Dw=class extends Z{},Ow=class extends Dw{},kw=class extends Dw{},Aw=class extends qy{},jw=class extends Jy{},Mw=class extends Aw{},Nw=class extends jw{},Pw=class extends Aw{},Fw=class extends Pw{},Iw=class extends Pw{},Lw=class extends Fw{},Rw=class extends Z{},zw=class extends Rw{},Bw=class extends Rw{async _call(e){return new Y(await super._call(e))}},Vw=class extends Z{},Hw=class extends Vw{},Uw=class extends Vw{async _call(e){return new Ww(await super._call(e))}},Ww=class extends A_{},Gw=class extends Z{},Kw=class extends Gw{},qw=class extends Gw{async _call(e){return new Pm(await super._call(e))}},Jw=class extends Gw{async _call(e){return new Y(await super._call(e))}},Yw=class extends Gw{async _call(e){return new Nm(await super._call(e))}},Xw=class extends Gw{async _call(e){return new Fm(await super._call(e))}},Zw=class extends Z{},Qw=class extends Zw{},$w=class extends Zw{async _call(e){return new Pm(await super._call(e))}},eT=class extends Zw{async _call(e){return new Y(await super._call(e))}},tT=class extends Zw{async _call(e){return new Nm(await super._call(e))}},nT=class extends Zw{async _call(e){return new Fm(await super._call(e))}},rT=class extends Z{},iT=class extends rT{},aT=class extends rT{async _call(e){return new oT(await super._call(e))}},oT=class extends A_{},sT=class extends Mm{constructor({iou_scores:e,pred_masks:t}){super(),this.iou_scores=e,this.pred_masks=t}},cT=class extends Z{},lT=class extends cT{async get_image_embeddings({pixel_values:e}){return await Th(this,{pixel_values:e})}async forward(e){e=!e.image_embeddings||!e.image_positional_embeddings?{...e,...await this.get_image_embeddings(e)}:{...e},e.input_labels??=yl(e.input_points.dims.slice(0,-1));let t={image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings};return e.input_points&&(t.input_points=e.input_points),e.input_labels&&(t.input_labels=e.input_labels),e.input_boxes&&(t.input_boxes=e.input_boxes),await J(this.sessions.prompt_encoder_mask_decoder,t)}async _call(e){return new sT(await super._call(e))}},uT=class extends Mm{constructor({iou_scores:e,pred_masks:t,object_score_logits:n}){super(),this.iou_scores=e,this.pred_masks=t,this.object_score_logits=n}},dT=class extends Z{},fT=class extends dT{async get_image_embeddings({pixel_values:e}){return await Th(this,{pixel_values:e})}async forward(e){let{num_feature_levels:t}=this.config.vision_config;if(e=Array.from({length:t},(e,t)=>`image_embeddings.${t}`).some(t=>!e[t])?{...e,...await this.get_image_embeddings(e)}:{...e},e.input_points){if(e.input_boxes&&e.input_boxes.dims[1]!==1)throw Error("When both `input_points` and `input_boxes` are provided, the number of boxes per image must be 1.");let t=e.input_points.dims;e.input_labels??=yl(t.slice(0,-1)),e.input_boxes??=_l([t[0],0,4],0)}else if(e.input_boxes){let t=e.input_boxes.dims;e.input_labels=_l([t[0],t[1],0],-1n),e.input_points=_l([t[0],1,0,2],0)}else throw Error("At least one of `input_points` or `input_boxes` must be provided.");let n=this.sessions.prompt_encoder_mask_decoder;return await J(n,li(e,n.inputNames))}async _call(e){return new uT(await super._call(e))}},pT=class extends fT{},mT=class extends fT{},hT=class extends Z{},gT=class extends hT{},_T=class extends hT{},vT=class extends hT{},yT=class extends Z{},bT=class extends yT{},xT=class extends yT{},ST=class extends yT{},CT=class extends Z{},wT=class extends CT{},TT=class extends CT{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}},ET=class extends Jg{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`vision_model`})}},DT=class extends Z{},OT=class extends DT{},kT=class extends DT{},AT=class extends Jb{},jT=class extends Z{main_input_name=`input_values`;forward_params=[`input_values`]},MT=class extends jT{async encode(e){return await J(this.sessions.encoder_model,e)}async decode(e){return await J(this.sessions.decoder_model,e)}},NT=class extends jT{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}},PT=class extends jT{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}},FT=class extends Z{},IT=class extends FT{},LT=class extends FT{},RT=class extends Z{},zT=class extends RT{},BT=class extends RT{},VT=class extends RT{async generate_speech(e,t,{threshold:n=.5,minlenratio:r=0,maxlenratio:i=20,vocoder:a=null}={}){let o={input_ids:e},{encoder_outputs:s,encoder_attention_mask:c}=await Th(this,o),l=s.dims[1]/this.config.reduction_factor,u=Math.floor(l*i),d=Math.floor(l*r),f=this.config.num_mel_bins,p=[],m=null,h=null,g=0;for(;;){++g;let e=vh(!!h),r;r=h?h.output_sequence_out:new U(`float32`,new Float32Array(f),[1,1,f]);let i={use_cache_branch:e,output_sequence:r,encoder_attention_mask:c,speaker_embeddings:t,encoder_hidden_states:s};Ah(this,i,m),h=await J(this.sessions.decoder_model_merged,i),m=Dh(h,m);let{prob:a,spectrum:o}=h;if(p.push(o),g>=d&&(Array.from(a.data).filter(e=>e>=n).length>0||g>=u))break}let _=ul(p),{waveform:v}=await J(a.sessions.model,{spectrogram:_});return{spectrogram:_,waveform:v}}},HT=class extends Z{main_input_name=`spectrogram`},UT=class extends Z{},WT=class extends UT{},GT=class extends UT{async _call(e){return new Pm(await super._call(e))}},KT=class extends UT{async _call(e){return new Y(await super._call(e))}},qT=class extends UT{async _call(e){return new Fm(await super._call(e))}},JT=class extends Z{},YT=class extends JT{},XT=class extends JT{},ZT=class extends Z{},QT=class extends ZT{},$T=class extends ZT{},eE=class extends Z{},tE=class extends eE{},nE=class extends Z{},rE=class extends nE{async generate_speech({input_ids:e,attention_mask:t,style:n,num_inference_steps:r=5,speed:i=1.05}){let{sampling_rate:a,chunk_compress_factor:o,base_chunk_size:s,latent_dim:c}=this.config,{last_hidden_state:l,durations:u}=await J(this.sessions.text_encoder,{input_ids:e,attention_mask:t,style:n}),d=u.div(i).mul_(a),f=s*o,p=d.data,m=Int32Array.from(p,e=>Math.ceil(e/f)),h=Math.max(...m),g=e.dims[0],_=new BigInt64Array(g*h);for(let e=0;ee*t,1),r=Zc[e.type];c[e.name]=new U(e.type,new r(n),t)}let f=Zc[d],p=new U(d,new f(s*YE),[1,s,YE]),m=t[Symbol.asyncIterator]?.()??t[Symbol.iterator]?.();if(!m)throw Error(`input_features must be iterable or async iterable`);return{encoder_session:i,enc_kv_cache:c,enc_padding_cache:p,enc_past_seq_len:0,audio_embed_queue:[],audio_embed_total_tokens:0,audio_queue_offset:0,audio_consumed:0,stream_exhausted:!1,chunks_iter:m,text_hidden_size:n.hidden_size}}async function $E(e,t){let n=t.dims[2],r=Math.floor((XE+n-3)/2)+1,i=new U(`int64`,BigInt64Array.from({length:r},(t,n)=>BigInt(e.enc_past_seq_len+n)),[1,r]),a=e.enc_past_seq_len+r,o=yl([1,a]),{audio_embeds:s,present_padding_cache:c,...l}=await J(e.encoder_session,{input_features:t,attention_mask:o,position_ids:i,past_padding_cache:e.enc_padding_cache,...e.enc_kv_cache});e.enc_padding_cache.location===`gpu-buffer`&&e.enc_padding_cache.dispose(),e.enc_padding_cache=c;for(let t in l)if(t.startsWith(`present.`)){let n=t.replace(`present`,`past_key_values`),r=e.enc_kv_cache[n];r?.location===`gpu-buffer`&&r.dispose(),e.enc_kv_cache[n]=l[t]}return e.enc_past_seq_len=a,s}async function eD(e,t){for(;e.audio_embed_total_tokens0&&e.audio_embed_queue.length>0;){let t=e.audio_embed_queue[0],n=t.tokens-e.audio_queue_offset,o=Math.min(a,n),s=e.audio_queue_offset*e.text_hidden_size;for(let n=0;n=t.tokens&&(e.audio_embed_queue.shift(),e.audio_queue_offset=0)}e.audio_consumed+=n-a}var nD=class extends eh{constructor(e){super(),this._s=e}_call(e){let t=this._s.stream_exhausted&&this._s.audio_embed_queue.length===0;return e.map(()=>t)}},rD=class extends Z{forward_params=[`input_ids`,`attention_mask`,`position_ids`,`past_key_values`]},iD=class extends rD{async forward({input_ids:e,past_key_values:t,...n}){let r=e.dims[1],i=ZE.get(this);i&&await eD(i,i.audio_consumed+r);let{inputs_embeds:a}=await J(this.sessions.embed_tokens,{input_ids:e});i&&tD(i,a,r);let o={inputs_embeds:a,...n};Ah(this,o,t);let s=this.sessions.decoder_model_merged;return await J(s,li(o,s.inputNames))}async generate({input_features:e,stopping_criteria:t,...n}){if(!e)throw Error(`input_features (generator/iterable) must be provided`);let r=QE(this,e);ZE.set(this,r);let i=new th;i.push(new nD(r)),t&&i.extend(t);try{return await super.generate({...n,stopping_criteria:i})}finally{r.enc_kv_cache.dispose(),ZE.delete(this)}}},aD=class extends Z{},oD=class extends aD{},sD=class extends aD{async _call(e){return new Im(await super._call(e))}},cD=class extends aD{async _call(e){return new Y(await super._call(e))}},lD=class extends Mm{constructor({logits:e,embeddings:t}){super(),this.logits=e,this.embeddings=t}},uD=class extends Z{},dD=class extends uD{},fD=class extends uD{async _call(e){return new Im(await super._call(e))}},pD=class extends uD{async _call(e){return new Y(await super._call(e))}},mD=class extends uD{async _call(e){return new lD(await super._call(e))}},hD=class extends uD{async _call(e){return new Nm(await super._call(e))}},gD=class extends Z{},_D=class extends gD{},vD=class extends $m{return_timestamps=null;return_token_timestamps=null;num_frames=null;alignment_heads=null;task=null;language=null;no_timestamps_token_id=null;prompt_ids=null;is_multilingual=null;lang_to_id=null;task_to_id=null;max_initial_timestamp_index=1},yD=class extends Z{requires_attention_mask=!1;main_input_name=`input_features`;forward_params=[`input_features`,`attention_mask`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`]},bD=class extends yD{},xD=class extends yD{_prepare_generation_config(e,t){return super._prepare_generation_config(e,t,vD)}_retrieve_init_tokens(e){let t=[e.decoder_start_token_id],n=e.language,r=e.task;if(e.is_multilingual){n||=(N.warn(`No language specified - defaulting to English (en).`),`en`);let i=`<|${Du(n)}|>`;t.push(e.lang_to_id[i]),t.push(e.task_to_id[r??`transcribe`])}else if(n||r)throw Error("Cannot specify `task` or `language` for an English-only model. If the model is intended to be multilingual, pass `is_multilingual=true` to generate, or update the generation config.");return!e.return_timestamps&&e.no_timestamps_token_id&&t.at(-1)!==e.no_timestamps_token_id?t.push(e.no_timestamps_token_id):e.return_timestamps&&t.at(-1)===e.no_timestamps_token_id&&(N.warn("<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`."),t.pop()),t.filter(e=>e!=null)}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,...i}){t=this._prepare_generation_config(t,i);let a=i.decoder_input_ids instanceof U?Dl(i.decoder_input_ids):i.decoder_input_ids??this._retrieve_init_tokens(t);if(t.return_timestamps&&(n??=new Bm,n.push(new Gm(t,a))),t.begin_suppress_tokens&&(n??=new Bm,n.push(new Wm(t.begin_suppress_tokens,a.length))),t.return_token_timestamps){if(!t.alignment_heads)throw Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");t.task===`translate`&&N.warn(`Token-level timestamps may not be reliable for task 'translate'.`),t.output_attentions=!0,t.return_dict_in_generate=!0}if(t.return_timestamps&&!i.max_new_tokens)return this._generate_with_seek({inputs:e,generation_config:t,logits_processor:n,init_tokens:a,kwargs:i});let o=await super.generate({inputs:e,generation_config:t,logits_processor:n,decoder_input_ids:a,...i});return t.return_token_timestamps&&(o.token_timestamps=this._extract_token_timestamps(o,t.alignment_heads,t.num_frames,.02,a.length)),o}async _generate_with_seek({inputs:e,generation_config:t,logits_processor:n,init_tokens:r,kwargs:i}){let a=t.no_timestamps_token_id+1,o=Array.isArray(t.eos_token_id)?t.eos_token_id[0]:t.eos_token_id,s=t.return_token_timestamps,c=e,l=c.dims[2],u=2*this.config.max_source_positions,d=0,f=[],p=[];for(;de+n)}if(v.length>0&&v.at(-1)===o&&v.pop(),v.length===0)break;let b=v.map(e=>e>=a),x=v.length>=2&&b[v.length-1]&&!b[v.length-2],ee=[];for(let e=0;e0)if(x)S=e-d;else{let e=ee.at(-1);S=(v[e-1]-a)*2,te=e}else S=e-d;let C=Math.floor(d/2),w=a+1500;for(let e=0;e=a&&(v[e]=Math.min(v[e]+C,w));f.push(...v.slice(0,te)),y&&p.push(...y.slice(0,te)),d+=S}f.push(o);let m=[...r,...f];if(s){let e=new U(`int64`,m.map(BigInt),[1,m.length]),t=[...Array(r.length).fill(0),...p,0];return{sequences:e,token_timestamps:new U(`float32`,new Float32Array(t),[1,t.length])}}return new U(`int64`,m.map(BigInt),[1,m.length])}_extract_token_timestamps(e,t,n=null,r=.02,i=0){if(!e.cross_attentions)throw Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");n??N.warn("`num_frames` has not been set, meaning the entire audio will be analyzed. This may lead to inaccurate token-level timestamps for short audios (< 30 seconds).");let a=this.config.median_filter_width;a===void 0&&(N.warn("Model config has no `median_filter_width`, using default value of 7."),a=7);let o=e.cross_attentions,s=Array.from({length:this.config.decoder_layers},(e,t)=>ul(o.map(e=>e[t]),2)),c=dl(t.map(([e,t])=>{if(e>=s.length)throw Error(`Layer index ${e} is out of bounds for cross attentions (length ${s.length}).`);return n?s[e].slice(null,t,null,[0,n]):s[e].slice(null,t)})).transpose(1,0,2,3),[l,u]=pl(c,-2,0,!0),d=c.clone();for(let e=0;e0?d.slice(null,null,[i,d.dims[2]],null):d,1)],p=e.sequences.dims,m=new U(`float32`,new Float32Array(p[0]*p[1]),p);for(let e=0;et[n+1]-t[n])).map(e=>!!e),o=[];for(let e=0;e0&&s.push(o.at(-1)),m[e].data.set(s)}return m}},SD=class extends xD{},CD=class extends Z{},wD=class extends CD{},TD=class extends CD{async _call(e){return new Pm(await super._call(e))}},ED=class extends CD{async _call(e){return new Y(await super._call(e))}},DD=class extends CD{async _call(e){return new Nm(await super._call(e))}},OD=class extends CD{async _call(e){return new Fm(await super._call(e))}},kD=class extends Z{},AD=class extends kD{},jD=class extends kD{async _call(e){return new Pm(await super._call(e))}},MD=class extends kD{async _call(e){return new Y(await super._call(e))}},ND=class extends kD{async _call(e){return new Nm(await super._call(e))}},PD=class extends kD{async _call(e){return new Fm(await super._call(e))}},FD=class extends Z{},ID=class extends FD{},LD=class extends FD{async _call(e){return new RD(await super._call(e))}},RD=class extends Mm{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}},zD=class extends Z{},BD=class extends zD{},VD=class extends zD{},HD=new Map([[`bert`,`BertModel`],[`eurobert`,`EuroBertModel`],[`neobert`,`NeoBertModel`],[`modernbert`,`ModernBertModel`],[`nomic_bert`,`NomicBertModel`],[`roformer`,`RoFormerModel`],[`electra`,`ElectraModel`],[`esm`,`EsmModel`],[`convbert`,`ConvBertModel`],[`camembert`,`CamembertModel`],[`deberta`,`DebertaModel`],[`deberta-v2`,`DebertaV2Model`],[`mpnet`,`MPNetModel`],[`albert`,`AlbertModel`],[`distilbert`,`DistilBertModel`],[`roberta`,`RobertaModel`],[`xlm`,`XLMModel`],[`xlm-roberta`,`XLMRobertaModel`],[`clap`,`ClapModel`],[`clip`,`CLIPModel`],[`clipseg`,`CLIPSegModel`],[`chinese_clip`,`ChineseCLIPModel`],[`siglip`,`SiglipModel`],[`jina_clip`,`JinaCLIPModel`],[`mobilebert`,`MobileBertModel`],[`squeezebert`,`SqueezeBertModel`],[`wav2vec2`,`Wav2Vec2Model`],[`wav2vec2-bert`,`Wav2Vec2BertModel`],[`unispeech`,`UniSpeechModel`],[`unispeech-sat`,`UniSpeechSatModel`],[`hubert`,`HubertModel`],[`wavlm`,`WavLMModel`],[`audio-spectrogram-transformer`,`ASTModel`],[`vits`,`VitsModel`],[`pyannote`,`PyAnnoteModel`],[`wespeaker-resnet`,`WeSpeakerResNetModel`],[`detr`,`DetrModel`],[`rt_detr`,`RTDetrModel`],[`rt_detr_v2`,`RTDetrV2Model`],[`rf_detr`,`RFDetrModel`],[`d_fine`,`DFineModel`],[`table-transformer`,`TableTransformerModel`],[`vit`,`ViTModel`],[`ijepa`,`IJepaModel`],[`pvt`,`PvtModel`],[`vit_msn`,`ViTMSNModel`],[`vit_mae`,`ViTMAEModel`],[`groupvit`,`GroupViTModel`],[`fastvit`,`FastViTModel`],[`mobilevit`,`MobileViTModel`],[`mobilevitv2`,`MobileViTV2Model`],[`owlvit`,`OwlViTModel`],[`owlv2`,`Owlv2Model`],[`beit`,`BeitModel`],[`deit`,`DeiTModel`],[`hiera`,`HieraModel`],[`convnext`,`ConvNextModel`],[`convnextv2`,`ConvNextV2Model`],[`dinov2`,`Dinov2Model`],[`dinov2_with_registers`,`Dinov2WithRegistersModel`],[`dinov3_vit`,`DINOv3ViTModel`],[`dinov3_convnext`,`DINOv3ConvNextModel`],[`resnet`,`ResNetModel`],[`swin`,`SwinModel`],[`swin2sr`,`Swin2SRModel`],[`donut-swin`,`DonutSwinModel`],[`yolos`,`YolosModel`],[`dpt`,`DPTModel`],[`glpn`,`GLPNModel`],[`hifigan`,`SpeechT5HifiGan`],[`efficientnet`,`EfficientNetModel`],[`decision_transformer`,`DecisionTransformerModel`],[`patchtst`,`PatchTSTModel`],[`patchtsmixer`,`PatchTSMixerModel`],[`mobilenet_v1`,`MobileNetV1Model`],[`mobilenet_v2`,`MobileNetV2Model`],[`mobilenet_v3`,`MobileNetV3Model`],[`mobilenet_v4`,`MobileNetV4Model`],[`maskformer`,`MaskFormerModel`],[`mgp-str`,`MgpstrForSceneTextRecognition`],[`style_text_to_speech_2`,`StyleTextToSpeech2Model`],[`openai_privacy_filter`,`OpenAIPrivacyFilterModel`]]),UD=new Map([[`t5`,`T5Model`],[`longt5`,`LongT5Model`],[`mt5`,`MT5Model`],[`bart`,`BartModel`],[`mbart`,`MBartModel`],[`marian`,`MarianModel`],[`whisper`,`WhisperModel`],[`cohere_asr`,`CohereAsrModel`],[`m2m_100`,`M2M100Model`],[`blenderbot`,`BlenderbotModel`],[`blenderbot-small`,`BlenderbotSmallModel`]]),WD=new Map([[`mimi`,`MimiModel`],[`dac`,`DacModel`],[`snac`,`SnacModel`]]),GD=new Map([[`bloom`,`BloomModel`],[`jais`,`JAISModel`],[`gpt2`,`GPT2Model`],[`gpt_oss`,`GptOssModel`],[`gptj`,`GPTJModel`],[`gpt_bigcode`,`GPTBigCodeModel`],[`gpt_neo`,`GPTNeoModel`],[`gpt_neox`,`GPTNeoXModel`],[`codegen`,`CodeGenModel`],[`llama`,`LlamaModel`],[`apertus`,`ApertusModel`],[`nanochat`,`NanoChatModel`],[`arcee`,`ArceeModel`],[`afmoe`,`AfmoeModel`],[`lfm2`,`Lfm2Model`],[`lfm2_moe`,`Lfm2MoeModel`],[`smollm3`,`SmolLM3Model`],[`exaone`,`ExaoneModel`],[`olmo`,`OlmoModel`],[`olmo2`,`Olmo2Model`],[`olmo3`,`Olmo3Model`],[`olmo_hybrid`,`OlmoHybridModel`],[`mobilellm`,`MobileLLMModel`],[`granite`,`GraniteModel`],[`granitemoehybrid`,`GraniteMoeHybridModel`],[`cohere`,`CohereModel`],[`cohere2`,`Cohere2Model`],[`gemma`,`GemmaModel`],[`gemma2`,`Gemma2Model`],[`vaultgemma`,`VaultGemmaModel`],[`gemma3_text`,`Gemma3Model`],[`helium`,`HeliumModel`],[`glm`,`GlmModel`],[`glm_moe_dsa`,`GlmMoeDsaModel`],[`openelm`,`OpenELMModel`],[`qwen2`,`Qwen2Model`],[`qwen2_moe`,`Qwen2MoeModel`],[`qwen3`,`Qwen3Model`],[`qwen3_moe`,`Qwen3MoeModel`],[`qwen3_next`,`Qwen3NextModel`],[`phi`,`PhiModel`],[`phi3`,`Phi3Model`],[`mpt`,`MptModel`],[`opt`,`OPTModel`],[`mistral`,`MistralModel`],[`mistral4`,`Mistral4Model`],[`ministral`,`MinistralModel`],[`ministral3`,`Ministral3Model`],[`ernie4_5`,`Ernie4_5ForCausalLM`],[`starcoder2`,`Starcoder2Model`],[`deepseek_v3`,`DeepseekV3Model`],[`falcon`,`FalconModel`],[`falcon_h1`,`FalconH1Model`],[`nemotron_h`,`NemotronHModel`],[`solar_open`,`SolarOpenModel`],[`stablelm`,`StableLmModel`],[`modernbert-decoder`,`ModernBertDecoderModel`],[`hunyuan_v1_dense`,`HunYuanDenseV1Model`],[`youtu`,`YoutuModel`]]),KD=new Map([[`speecht5`,`SpeechT5ForSpeechToText`],[`whisper`,`WhisperForConditionalGeneration`],[`lite-whisper`,`LiteWhisperForConditionalGeneration`],[`moonshine`,`MoonshineForConditionalGeneration`],[`cohere_asr`,`CohereAsrForConditionalGeneration`]]),qD=new Map([[`speecht5`,`SpeechT5ForTextToSpeech`]]),JD=new Map([[`vits`,`VitsModel`],[`musicgen`,`MusicgenForConditionalGeneration`],[`supertonic`,`SupertonicForConditionalGeneration`]]),YD=new Map([[`bert`,`BertForSequenceClassification`],[`eurobert`,`EuroBertForSequenceClassification`],[`neobert`,`NeoBertForSequenceClassification`],[`modernbert`,`ModernBertForSequenceClassification`],[`roformer`,`RoFormerForSequenceClassification`],[`electra`,`ElectraForSequenceClassification`],[`esm`,`EsmForSequenceClassification`],[`convbert`,`ConvBertForSequenceClassification`],[`camembert`,`CamembertForSequenceClassification`],[`deberta`,`DebertaForSequenceClassification`],[`deberta-v2`,`DebertaV2ForSequenceClassification`],[`mpnet`,`MPNetForSequenceClassification`],[`albert`,`AlbertForSequenceClassification`],[`distilbert`,`DistilBertForSequenceClassification`],[`roberta`,`RobertaForSequenceClassification`],[`xlm`,`XLMForSequenceClassification`],[`xlm-roberta`,`XLMRobertaForSequenceClassification`],[`bart`,`BartForSequenceClassification`],[`mbart`,`MBartForSequenceClassification`],[`mobilebert`,`MobileBertForSequenceClassification`],[`squeezebert`,`SqueezeBertForSequenceClassification`]]),XD=new Map([[`bert`,`BertForTokenClassification`],[`eurobert`,`EuroBertForTokenClassification`],[`neobert`,`NeoBertForTokenClassification`],[`modernbert`,`ModernBertForTokenClassification`],[`roformer`,`RoFormerForTokenClassification`],[`electra`,`ElectraForTokenClassification`],[`esm`,`EsmForTokenClassification`],[`convbert`,`ConvBertForTokenClassification`],[`camembert`,`CamembertForTokenClassification`],[`deberta`,`DebertaForTokenClassification`],[`deberta-v2`,`DebertaV2ForTokenClassification`],[`mpnet`,`MPNetForTokenClassification`],[`distilbert`,`DistilBertForTokenClassification`],[`roberta`,`RobertaForTokenClassification`],[`xlm`,`XLMForTokenClassification`],[`xlm-roberta`,`XLMRobertaForTokenClassification`],[`openai_privacy_filter`,`OpenAIPrivacyFilterForTokenClassification`]]),ZD=new Map([[`t5`,`T5ForConditionalGeneration`],[`longt5`,`LongT5ForConditionalGeneration`],[`mt5`,`MT5ForConditionalGeneration`],[`bart`,`BartForConditionalGeneration`],[`mbart`,`MBartForConditionalGeneration`],[`marian`,`MarianMTModel`],[`m2m_100`,`M2M100ForConditionalGeneration`],[`blenderbot`,`BlenderbotForConditionalGeneration`],[`blenderbot-small`,`BlenderbotSmallForConditionalGeneration`]]),QD=new Map([[`bloom`,`BloomForCausalLM`],[`gpt2`,`GPT2LMHeadModel`],[`gpt_oss`,`GptOssForCausalLM`],[`jais`,`JAISLMHeadModel`],[`gptj`,`GPTJForCausalLM`],[`gpt_bigcode`,`GPTBigCodeForCausalLM`],[`gpt_neo`,`GPTNeoForCausalLM`],[`gpt_neox`,`GPTNeoXForCausalLM`],[`codegen`,`CodeGenForCausalLM`],[`llama`,`LlamaForCausalLM`],[`nanochat`,`NanoChatForCausalLM`],[`apertus`,`ApertusForCausalLM`],[`llama4_text`,`Llama4ForCausalLM`],[`arcee`,`ArceeForCausalLM`],[`afmoe`,`AfmoeForCausalLM`],[`lfm2`,`Lfm2ForCausalLM`],[`lfm2_moe`,`Lfm2MoeForCausalLM`],[`smollm3`,`SmolLM3ForCausalLM`],[`exaone`,`ExaoneForCausalLM`],[`olmo`,`OlmoForCausalLM`],[`olmo2`,`Olmo2ForCausalLM`],[`olmo3`,`Olmo3ForCausalLM`],[`olmo_hybrid`,`OlmoHybridForCausalLM`],[`mobilellm`,`MobileLLMForCausalLM`],[`granite`,`GraniteForCausalLM`],[`granitemoehybrid`,`GraniteMoeHybridForCausalLM`],[`cohere`,`CohereForCausalLM`],[`cohere2`,`Cohere2ForCausalLM`],[`gemma`,`GemmaForCausalLM`],[`gemma2`,`Gemma2ForCausalLM`],[`vaultgemma`,`VaultGemmaForCausalLM`],[`gemma3_text`,`Gemma3ForCausalLM`],[`gemma3`,`Gemma3ForCausalLM`],[`helium`,`HeliumForCausalLM`],[`glm`,`GlmForCausalLM`],[`glm_moe_dsa`,`GlmMoeDsaForCausalLM`],[`openelm`,`OpenELMForCausalLM`],[`qwen2`,`Qwen2ForCausalLM`],[`qwen2_moe`,`Qwen2MoeForCausalLM`],[`qwen3`,`Qwen3ForCausalLM`],[`qwen3_moe`,`Qwen3MoeForCausalLM`],[`qwen3_next`,`Qwen3NextForCausalLM`],[`qwen2_vl`,`Qwen2VLForCausalLM`],[`qwen2_5_vl`,`Qwen2_5_VLForCausalLM`],[`qwen3_vl`,`Qwen3VLForCausalLM`],[`qwen3_vl_moe`,`Qwen3VLMoeForCausalLM`],[`qwen3_5`,`Qwen3_5ForCausalLM`],[`qwen3_5_text`,`Qwen3_5ForCausalLM`],[`qwen3_5_moe`,`Qwen3_5MoeForCausalLM`],[`gemma3n`,`Gemma3nForCausalLM`],[`gemma4`,`Gemma4ForCausalLM`],[`phi`,`PhiForCausalLM`],[`phi3`,`Phi3ForCausalLM`],[`mpt`,`MptForCausalLM`],[`opt`,`OPTForCausalLM`],[`mbart`,`MBartForCausalLM`],[`mistral`,`MistralForCausalLM`],[`mistral4`,`Mistral4ForCausalLM`],[`ministral`,`MinistralForCausalLM`],[`ministral3`,`Ministral3ForCausalLM`],[`ernie4_5`,`Ernie4_5ForCausalLM`],[`starcoder2`,`Starcoder2ForCausalLM`],[`deepseek_v3`,`DeepseekV3ForCausalLM`],[`falcon`,`FalconForCausalLM`],[`falcon_h1`,`FalconH1ForCausalLM`],[`nemotron_h`,`NemotronHForCausalLM`],[`trocr`,`TrOCRForCausalLM`],[`solar_open`,`SolarOpenForCausalLM`],[`stablelm`,`StableLmForCausalLM`],[`modernbert-decoder`,`ModernBertDecoderForCausalLM`],[`hunyuan_v1_dense`,`HunYuanDenseV1ForCausalLM`],[`youtu`,`YoutuForCausalLM`],[`phi3_v`,`Phi3VForCausalLM`]]),$D=new Map([[`multi_modality`,`MultiModalityCausalLM`]]),eO=new Map([[`bert`,`BertForMaskedLM`],[`eurobert`,`EuroBertForMaskedLM`],[`neobert`,`NeoBertForMaskedLM`],[`modernbert`,`ModernBertForMaskedLM`],[`roformer`,`RoFormerForMaskedLM`],[`electra`,`ElectraForMaskedLM`],[`esm`,`EsmForMaskedLM`],[`convbert`,`ConvBertForMaskedLM`],[`camembert`,`CamembertForMaskedLM`],[`deberta`,`DebertaForMaskedLM`],[`deberta-v2`,`DebertaV2ForMaskedLM`],[`mpnet`,`MPNetForMaskedLM`],[`albert`,`AlbertForMaskedLM`],[`distilbert`,`DistilBertForMaskedLM`],[`roberta`,`RobertaForMaskedLM`],[`xlm`,`XLMWithLMHeadModel`],[`xlm-roberta`,`XLMRobertaForMaskedLM`],[`mobilebert`,`MobileBertForMaskedLM`],[`squeezebert`,`SqueezeBertForMaskedLM`]]),tO=new Map([[`bert`,`BertForQuestionAnswering`],[`neobert`,`NeoBertForQuestionAnswering`],[`roformer`,`RoFormerForQuestionAnswering`],[`electra`,`ElectraForQuestionAnswering`],[`convbert`,`ConvBertForQuestionAnswering`],[`camembert`,`CamembertForQuestionAnswering`],[`deberta`,`DebertaForQuestionAnswering`],[`deberta-v2`,`DebertaV2ForQuestionAnswering`],[`mpnet`,`MPNetForQuestionAnswering`],[`albert`,`AlbertForQuestionAnswering`],[`distilbert`,`DistilBertForQuestionAnswering`],[`roberta`,`RobertaForQuestionAnswering`],[`xlm`,`XLMForQuestionAnswering`],[`xlm-roberta`,`XLMRobertaForQuestionAnswering`],[`mobilebert`,`MobileBertForQuestionAnswering`],[`squeezebert`,`SqueezeBertForQuestionAnswering`]]),nO=new Map([[`vision-encoder-decoder`,`VisionEncoderDecoderModel`],[`idefics3`,`Idefics3ForConditionalGeneration`],[`smolvlm`,`SmolVLMForConditionalGeneration`]]),rO=new Map([[`llava`,`LlavaForConditionalGeneration`],[`llava_onevision`,`LlavaOnevisionForConditionalGeneration`],[`moondream1`,`Moondream1ForConditionalGeneration`],[`florence2`,`Florence2ForConditionalGeneration`],[`qwen2_vl`,`Qwen2VLForConditionalGeneration`],[`qwen2_5_vl`,`Qwen2_5_VLForConditionalGeneration`],[`qwen3_vl`,`Qwen3VLForConditionalGeneration`],[`qwen3_vl_moe`,`Qwen3VLMoeForConditionalGeneration`],[`qwen3_5`,`Qwen3_5ForConditionalGeneration`],[`qwen3_5_moe`,`Qwen3_5MoeForConditionalGeneration`],[`lfm2_vl`,`Lfm2VlForConditionalGeneration`],[`idefics3`,`Idefics3ForConditionalGeneration`],[`smolvlm`,`SmolVLMForConditionalGeneration`],[`paligemma`,`PaliGemmaForConditionalGeneration`],[`llava_qwen2`,`LlavaQwen2ForCausalLM`],[`gemma3`,`Gemma3ForConditionalGeneration`],[`gemma3n`,`Gemma3nForConditionalGeneration`],[`gemma4`,`Gemma4ForConditionalGeneration`],[`mistral3`,`Mistral3ForConditionalGeneration`],[`lighton_ocr`,`LightOnOcrForConditionalGeneration`],[`glm_ocr`,`GlmOcrForConditionalGeneration`]]),iO=new Map([[`granite_speech`,`GraniteSpeechForConditionalGeneration`],[`ultravox`,`UltravoxModel`],[`voxtral`,`VoxtralForConditionalGeneration`],[`voxtral_realtime`,`VoxtralRealtimeForConditionalGeneration`]]),aO=new Map([[`vision-encoder-decoder`,`VisionEncoderDecoderModel`]]),oO=new Map([[`vit`,`ViTForImageClassification`],[`ijepa`,`IJepaForImageClassification`],[`pvt`,`PvtForImageClassification`],[`vit_msn`,`ViTMSNForImageClassification`],[`fastvit`,`FastViTForImageClassification`],[`mobilevit`,`MobileViTForImageClassification`],[`mobilevitv2`,`MobileViTV2ForImageClassification`],[`beit`,`BeitForImageClassification`],[`deit`,`DeiTForImageClassification`],[`hiera`,`HieraForImageClassification`],[`convnext`,`ConvNextForImageClassification`],[`convnextv2`,`ConvNextV2ForImageClassification`],[`dinov2`,`Dinov2ForImageClassification`],[`dinov2_with_registers`,`Dinov2WithRegistersForImageClassification`],[`resnet`,`ResNetForImageClassification`],[`swin`,`SwinForImageClassification`],[`segformer`,`SegformerForImageClassification`],[`efficientnet`,`EfficientNetForImageClassification`],[`mobilenet_v1`,`MobileNetV1ForImageClassification`],[`mobilenet_v2`,`MobileNetV2ForImageClassification`],[`mobilenet_v3`,`MobileNetV3ForImageClassification`],[`mobilenet_v4`,`MobileNetV4ForImageClassification`]]),sO=new Map([[`detr`,`DetrForObjectDetection`],[`rt_detr`,`RTDetrForObjectDetection`],[`rt_detr_v2`,`RTDetrV2ForObjectDetection`],[`rf_detr`,`RFDetrForObjectDetection`],[`d_fine`,`DFineForObjectDetection`],[`table-transformer`,`TableTransformerForObjectDetection`],[`yolos`,`YolosForObjectDetection`]]),cO=new Map([[`owlvit`,`OwlViTForObjectDetection`],[`owlv2`,`Owlv2ForObjectDetection`],[`grounding-dino`,`GroundingDinoForObjectDetection`]]),lO=new Map([[`detr`,`DetrForSegmentation`],[`clipseg`,`CLIPSegForImageSegmentation`]]),uO=new Map([[`segformer`,`SegformerForSemanticSegmentation`],[`sapiens`,`SapiensForSemanticSegmentation`],[`swin`,`SwinForSemanticSegmentation`],[`mobilenet_v1`,`MobileNetV1ForSemanticSegmentation`],[`mobilenet_v2`,`MobileNetV2ForSemanticSegmentation`],[`mobilenet_v3`,`MobileNetV3ForSemanticSegmentation`],[`mobilenet_v4`,`MobileNetV4ForSemanticSegmentation`]]),dO=new Map([[`detr`,`DetrForSegmentation`],[`maskformer`,`MaskFormerForInstanceSegmentation`]]),fO=new Map([[`sam`,`SamModel`],[`sam2`,`Sam2Model`],[`edgetam`,`EdgeTamModel`],[`sam3_tracker`,`Sam3TrackerModel`]]),pO=new Map([[`wav2vec2`,`Wav2Vec2ForCTC`],[`wav2vec2-bert`,`Wav2Vec2BertForCTC`],[`unispeech`,`UniSpeechForCTC`],[`unispeech-sat`,`UniSpeechSatForCTC`],[`wavlm`,`WavLMForCTC`],[`hubert`,`HubertForCTC`],[`parakeet_ctc`,`ParakeetForCTC`]]),mO=new Map([[`wav2vec2`,`Wav2Vec2ForSequenceClassification`],[`wav2vec2-bert`,`Wav2Vec2BertForSequenceClassification`],[`unispeech`,`UniSpeechForSequenceClassification`],[`unispeech-sat`,`UniSpeechSatForSequenceClassification`],[`wavlm`,`WavLMForSequenceClassification`],[`hubert`,`HubertForSequenceClassification`],[`audio-spectrogram-transformer`,`ASTForAudioClassification`]]),hO=new Map([[`wavlm`,`WavLMForXVector`]]),gO=new Map([[`unispeech-sat`,`UniSpeechSatForAudioFrameClassification`],[`wavlm`,`WavLMForAudioFrameClassification`],[`wav2vec2`,`Wav2Vec2ForAudioFrameClassification`],[`pyannote`,`PyAnnoteForAudioFrameClassification`]]),_O=new Map([[`vitmatte`,`VitMatteForImageMatting`]]),vO=new Map([[`patchtst`,`PatchTSTForPrediction`],[`patchtsmixer`,`PatchTSMixerForPrediction`]]),yO=new Map([[`swin2sr`,`Swin2SRForImageSuperResolution`]]),bO=new Map([[`chmv2`,`CHMv2ForDepthEstimation`],[`dpt`,`DPTForDepthEstimation`],[`depth_anything`,`DepthAnythingForDepthEstimation`],[`glpn`,`GLPNForDepthEstimation`],[`sapiens`,`SapiensForDepthEstimation`],[`depth_pro`,`DepthProForDepthEstimation`],[`metric3d`,`Metric3DForDepthEstimation`],[`metric3dv2`,`Metric3Dv2ForDepthEstimation`]]),xO=new Map([[`sapiens`,`SapiensForNormalEstimation`]]),SO=new Map([[`vitpose`,`VitPoseForPoseEstimation`]]),CO=new Map([[`clip`,`CLIPVisionModelWithProjection`],[`siglip`,`SiglipVisionModel`],[`jina_clip`,`JinaCLIPVisionModel`]]),wO=[[HD,X.EncoderOnly],[UD,X.EncoderDecoder],[GD,X.DecoderOnlyWithoutHead],[WD,X.AutoEncoder],[YD,X.EncoderOnly],[XD,X.EncoderOnly],[ZD,X.Seq2Seq],[KD,X.Seq2Seq],[QD,X.DecoderOnly],[$D,X.MultiModality],[eO,X.EncoderOnly],[tO,X.EncoderOnly],[nO,X.Vision2Seq],[rO,X.ImageTextToText],[iO,X.AudioTextToText],[oO,X.EncoderOnly],[lO,X.EncoderOnly],[dO,X.EncoderOnly],[uO,X.EncoderOnly],[_O,X.EncoderOnly],[vO,X.EncoderOnly],[yO,X.EncoderOnly],[bO,X.EncoderOnly],[xO,X.EncoderOnly],[SO,X.EncoderOnly],[sO,X.EncoderOnly],[cO,X.EncoderOnly],[fO,X.MaskGeneration],[pO,X.EncoderOnly],[mO,X.EncoderOnly],[qD,X.Seq2Seq],[JD,X.EncoderOnly],[hO,X.EncoderOnly],[gO,X.EncoderOnly],[CO,X.EncoderOnly]];for(let[e,t]of wO)for(let n of e.values()){xh.set(n,t);let e=Wh[n];Ch.set(e,n),Sh.set(n,e)}var TO=[[`MusicgenForConditionalGeneration`,iC,X.Musicgen],[`Phi3VForCausalLM`,cw,X.Phi3V],[`CLIPTextModelWithProjection`,Zg,X.EncoderOnly],[`SiglipTextModel`,TT,X.EncoderOnly],[`JinaCLIPTextModel`,rx,X.EncoderOnly],[`ClapTextModelWithProjection`,Kg,X.EncoderOnly],[`ClapAudioModelWithProjection`,qg,X.EncoderOnly],[`DacEncoderModel`,R_,X.EncoderOnly],[`DacDecoderModel`,z_,X.EncoderOnly],[`MimiEncoderModel`,Kx,X.EncoderOnly],[`MimiDecoderModel`,qx,X.EncoderOnly],[`SnacEncoderModel`,NT,X.EncoderOnly],[`SnacDecoderModel`,PT,X.EncoderOnly],[`Gemma3nForConditionalGeneration`,Py,X.ImageAudioTextToText],[`Gemma4ForConditionalGeneration`,Iy,X.ImageAudioTextToText],[`SupertonicForConditionalGeneration`,rE,X.Supertonic],[`ChatterboxModel`,zg,X.Chatterbox],[`VoxtralRealtimeForConditionalGeneration`,iD,X.VoxtralRealtime]];for(let[e,t,n]of TO)xh.set(e,n),Ch.set(t,e),Sh.set(e,t);var EO=new Map([[`modnet`,lO],[`birefnet`,lO],[`isnet`,lO],[`ben`,lO]]);for(let[e,t]of EO.entries())t.set(e,`PreTrainedModel`),xh.set(e,X.EncoderOnly),Sh.set(e,Z);var DO=new Set(EO.keys());xh.set(`PreTrainedModel`,X.EncoderOnly),Ch.set(Z,`PreTrainedModel`);var Q={MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES:YD,MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES:XD,MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES:qD,MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES:JD,MODEL_FOR_MASKED_LM_MAPPING_NAMES:eO,MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES:tO,MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES:oO,MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES:lO,MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES:uO,MODEL_FOR_UNIVERSAL_SEGMENTATION_MAPPING_NAMES:dO,MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES:sO,MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES:cO,MODEL_FOR_MASK_GENERATION_MAPPING_NAMES:fO,MODEL_FOR_CTC_MAPPING_NAMES:pO,MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES:mO,MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES:hO,MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES:gO,MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES:aO,MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES:_O,MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES:yO,MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES:bO,MODEL_FOR_NORMAL_ESTIMATION_MAPPING_NAMES:xO,MODEL_FOR_POSE_ESTIMATION_MAPPING_NAMES:SO,MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES:CO,MODEL_FOR_IMAGE_TEXT_TO_TEXT_MAPPING_NAMES:rO,MODEL_FOR_AUDIO_TEXT_TO_TEXT_MAPPING_NAMES:iO,MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES:ZD,MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES:KD,MODEL_FOR_CAUSAL_LM_MAPPING_NAMES:QD,MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES:nO};gh(Q);var $=class{static MODEL_CLASS_MAPPINGS=null;static BASE_IF_FAIL=!1;static supports(e){if(!this.MODEL_CLASS_MAPPINGS)return!1;for(let t of this.MODEL_CLASS_MAPPINGS)if(t.has(e))return!0;return this.BASE_IF_FAIL}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,model_file_name:o=null,subfolder:s=`onnx`,device:c=null,dtype:l=null,use_external_data_format:u=null,session_options:d={}}={}){let f={progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,model_file_name:o,subfolder:s,device:c,dtype:l,use_external_data_format:u,session_options:d};if(f.config=await Cm.from_pretrained(e,f),!this.MODEL_CLASS_MAPPINGS)throw Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);let{model_type:p}=f.config;for(let t of this.MODEL_CLASS_MAPPINGS){let n=t.get(p);if(!n){for(let e of t.values())if(e[0]===p){n=e;break}if(!n)continue}return await Wh[n].from_pretrained(e,f)}if(this.BASE_IF_FAIL)return DO.has(p)||N.warn(`Unknown model class "${p}", attempting to construct from base class.`),await Z.from_pretrained(e,f);throw Error(`Unsupported model type: ${p}`)}},OO=class extends ${static MODEL_CLASS_MAPPINGS=wO.map(e=>e[0]);static BASE_IF_FAIL=!0},kO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES]},AO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES]},jO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES]},MO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES]},NO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES]},PO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES]},FO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_CAUSAL_LM_MAPPING_NAMES]},IO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_MASKED_LM_MAPPING_NAMES]},LO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES]},RO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES]},zO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES]},BO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES]},VO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES]},HO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_UNIVERSAL_SEGMENTATION_MAPPING_NAMES]},UO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES]},WO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES]};(class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_MASK_GENERATION_MAPPING_NAMES]});var GO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_CTC_MAPPING_NAMES]},KO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES]};(class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES]}),class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES]};var qO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES]};(class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES]});var JO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES]},YO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES]};(class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_NORMAL_ESTIMATION_MAPPING_NAMES]}),class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_POSE_ESTIMATION_MAPPING_NAMES]};var XO=class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES]};(class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_IMAGE_TEXT_TO_TEXT_MAPPING_NAMES]}),class extends ${static MODEL_CLASS_MAPPINGS=[Q.MODEL_FOR_AUDIO_TEXT_TO_TEXT_MAPPING_NAMES]};async function ZO(e){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>Bd.read(e)))}async function QO(e,t){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>typeof e==`string`||e instanceof URL?Wu(e,t):e instanceof Float64Array?new Float32Array(e):e))}function $O(e,t){t&&(e=e.map(e=>e|0));let[n,r,i,a]=e;return{xmin:n,ymin:r,xmax:i,ymax:a}}var ek=class extends ei{constructor({task:e,model:t,tokenizer:n=null,processor:r=null}){super(),this.task=e,this.model=t,this.tokenizer=n,this.processor=r}async dispose(){await this.model.dispose()}},tk=class extends ek{async _call(e,{top_k:t=1}={}){let n=this.tokenizer(e,{padding:!0,truncation:!0}),r=await this.model(n),{problem_type:i,id2label:a}=this.model.config,o=i===`multi_label_classification`?e=>e.sigmoid():e=>new U(`float32`,ic(e.data),e.dims),s=[];for(let e of r.logits){let n=await rl(o(e),t),r=n[0].tolist(),i=n[1].tolist().map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:r[t]}));t===1?s.push(...i):s.push(i)}return Array.isArray(e)||t===1?s:s[0]}},nk=class extends ek{async _call(e,{ignore_labels:t=[`O`],aggregation_strategy:n=`none`}={}){if(n!==`none`&&n!==`simple`)throw Error(`Invalid aggregation_strategy: "${n}". Must be one of "none" or "simple".`);let r=Array.isArray(e),i=this.tokenizer(r?e:[e],{padding:!0,truncation:!0}),a=(await this.model(i)).logits,o=this.model.config.id2label,s=[];for(let e=0;e{let o=0,s=[];for(let n=i;ne==u),i=a[e].tolist(),f=o[e].tolist();for(let n=1;ne==t[n])!==-1)&&(i[n]=-1/0,f[n]=-1/0);let p=ic(i).map((e,t)=>[e,t]),m=ic(f).map((e,t)=>[e,t]);p[0][0]=0,m[0][0]=0;let h=si(p,m).filter(e=>e[0][1]<=e[1][1]).map(e=>[e[0][1],e[1][1],e[0][0]*e[1][0]]).sort((e,t)=>t[2]-e[2]),g=[];for(let e=0;ee==n);if(c===-1)throw Error(`Mask token (${r}) not found in text.`);let l=a[e][c],u=await rl(new U(`float32`,ic(l.data),l.dims),t),d=u[0].tolist(),f=u[1].tolist();o.push(f.map((e,t)=>{let n=i.slice();return n[c]=e,{score:d[t],token:Number(e),token_str:this.tokenizer.decode([e]),sequence:this.tokenizer.decode(n,{skip_special_tokens:!0})}}))}return Array.isArray(e)?o:o[0]}},sk=class extends ek{_default_generation_config={max_new_tokens:256};_key=`generated_text`;async _call(e,t={}){Array.isArray(e)||(e=[e]),this.model.config.prefix&&(e=e.map(e=>this.model.config.prefix+e));let n=this.model.config.task_specific_params;n&&n[this.task]&&n[this.task].prefix&&(e=e.map(e=>n[this.task].prefix+e));let r=this.tokenizer,i={padding:!0,truncation:!0},a;a=this.task===`translation`&&`_build_translation_inputs`in r?r._build_translation_inputs(e,i,t):r(e,i);let o=await this.model.generate({...a,...this._default_generation_config,...t});return r.batch_decode(o,{skip_special_tokens:!0}).map(e=>({[this._key]:e}))}},ck=class extends sk{_key=`summary_text`},lk=class extends sk{_key=`translation_text`};function uk(e){return Array.isArray(e)&&e.every(e=>`role`in e&&`content`in e)}var dk=class extends ek{_default_generation_config={max_new_tokens:256};async _call(e,t={}){let{add_special_tokens:n,return_full_text:r,tools:i,documents:a,chat_template:o,tokenizer_encode_kwargs:s,...c}=t,l=!1,u=!1,d=n??(this.tokenizer.add_bos_token||this.tokenizer.add_eos_token)??!1,f=s,p;if(typeof e==`string`)p=e=[e];else if(Array.isArray(e)&&e.every(e=>typeof e==`string`))l=!0,p=e;else{if(uk(e))e=[e];else if(Array.isArray(e)&&e.every(uk))l=!0;else throw Error(`Input must be a string, an array of strings, a Chat, or an array of Chats`);u=!0;let t={tokenize:!1,add_generation_prompt:!0,...li({tools:i,documents:a,chat_template:o},[`tools`,`documents`,`chat_template`]),...f};p=e.map(e=>this.tokenizer.apply_chat_template(e,t)),d=!1,f=void 0}let m=u?!1:r??!0;this.tokenizer.padding_side=`left`;let h=this.tokenizer(p,{add_special_tokens:d,padding:!0,truncation:!0,...f}),g=await this.model.generate({...h,...this._default_generation_config,...c}),_=this.tokenizer.batch_decode(g,{skip_special_tokens:!0}),v;!m&&h.input_ids.dims.at(-1)>0&&(v=this.tokenizer.batch_decode(h.input_ids,{skip_special_tokens:!0}).map(e=>e.length));let y=Array.from({length:e.length},e=>[]);for(let t=0;t<_.length;++t){let n=Math.floor(t/g.dims[0]*e.length);v&&(_[t]=_[t].slice(v[n])),y[n].push({generated_text:u?[...e[n],{role:`assistant`,content:_[t]}]:_[t]})}return!l&&y.length===1?y[0]:y}},fk=class extends ek{constructor(e){super(e),this.label2id=Object.fromEntries(Object.entries(this.model.config.label2id).map(([e,t])=>[e.toLowerCase(),t])),this.entailment_id=this.label2id.entailment,this.entailment_id===void 0&&(N.warn(`Could not find 'entailment' in label2id mapping. Using 2 as entailment_id.`),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,this.contradiction_id===void 0&&(N.warn(`Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id.`),this.contradiction_id=0)}async _call(e,t,{hypothesis_template:n=`This example is {}.`,multi_label:r=!1}={}){let i=Array.isArray(e);i||(e=[e]),Array.isArray(t)||(t=[t]);let a=t.map(e=>n.replace(`{}`,e)),o=r||t.length===1,s=[];for(let n of e){let e=[];for(let t of a){let r=this.tokenizer(n,{text_pair:t,padding:!0,truncation:!0}),i=await this.model(r);o?e.push([i.logits.data[this.contradiction_id],i.logits.data[this.entailment_id]]):e.push(i.logits.data[this.entailment_id])}let r=(o?e.map(e=>ic(e)[1]):ic(e)).map((e,t)=>[e,t]).sort((e,t)=>t[0]-e[0]);s.push({sequence:n,labels:r.map(e=>t[e[1]]),scores:r.map(e=>e[0])})}return i?s:s[0]}},pk=class extends ek{async _call(e,{top_k:t=5}={}){let n=this.processor.feature_extractor.config.sampling_rate,r=await QO(e,n),i=this.model.config.id2label,a=[];for(let e of r){let n=await this.processor(e),r=(await this.model(n)).logits[0],o=await rl(new U(`float32`,ic(r.data),r.dims),t),s=o[0].tolist(),c=o[1].tolist().map((e,t)=>({label:i?i[e]:`LABEL_${e}`,score:s[t]}));a.push(c)}return Array.isArray(e)?a:a[0]}},mk=class extends ek{async _call(e,t,{hypothesis_template:n=`This is a sound of {}.`}={}){let r=!Array.isArray(e);r&&(e=[e]);let i=t.map(e=>n.replace(`{}`,e)),a=this.tokenizer(i,{padding:!0,truncation:!0}),o=this.processor.feature_extractor.config.sampling_rate,s=await QO(e,o),c=[];for(let e of s){let n=await this.processor(e),r=ic((await this.model({...a,...n})).logits_per_audio.data);c.push([...r].map((e,n)=>({score:e,label:t[n]})))}return r?c[0]:c}},hk=class extends ek{_default_generation_config={};async _call(e,t={}){switch(t={...this._default_generation_config,...t},this.model.config.model_type){case`whisper`:case`lite-whisper`:return this._call_whisper(e,t);case`wav2vec2`:case`wav2vec2-bert`:case`unispeech`:case`unispeech-sat`:case`hubert`:case`parakeet_ctc`:return this._call_wav2vec2(e,t);case`moonshine`:return this._call_moonshine(e,t);case`cohere_asr`:return this._call_cohere_asr(e,t);default:throw Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(e,t){t.language&&N.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),t.task&&N.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');let n=!Array.isArray(e),r=n?[e]:e,i=this.processor.feature_extractor.config.sampling_rate,a=await QO(r,i),o=[];for(let e of a){let t=await this.processor(e),n=(await this.model(t)).logits[0],r=[];for(let e of n)r.push(sc(e.data)[1]);let i=this.tokenizer.decode(r,{skip_special_tokens:!0}).trim();o.push({text:i})}return n?o[0]:o}async _call_whisper(e,t){let n=t.return_timestamps??!1,r=t.chunk_length_s??0,i=t.force_full_sequences??!1,a=t.stride_length_s??null,o={...t};n===`word`&&(o.return_token_timestamps=!0,o.return_timestamps=!0);let s=!Array.isArray(e),c=s?[e]:e,l=this.processor.feature_extractor.config,u=l.chunk_length/this.model.config.max_source_positions,d=l.hop_length,f=l.sampling_rate,p=await QO(c,f),m=[];for(let e of p){let t=[];if(r>0){if(a===null)a=r/6;else if(r<=a)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");let n=f*r,i=f*a,o=n-2*i,s=0;for(;;){let r=s+n,a=e.subarray(s,r),c=await this.processor(a),l=s===0,u=r>=e.length;if(t.push({stride:[a.length,l?0:i,u?0:i],input_features:c.input_features,is_last:u}),u)break;s+=o}}else t=[{stride:[e.length,0,0],input_features:(await this.processor(e)).input_features,is_last:!0}];for(let e of t){o.num_frames=Math.floor(e.stride[0]/d);let t=await this.model.generate({inputs:e.input_features,...o});if(n===`word`){let n=t.sequences.tolist()[0],r=t.token_timestamps.tolist()[0],i=this.tokenizer.timestamp_begin,a=Math.max(n.findIndex(e=>Number(e)>=i),0);e.tokens=n.slice(a),e.token_timestamps=r.slice(a).map(e=>pc(e,2))}else e.tokens=t[0].tolist();e.stride=e.stride.map(e=>e/f)}let[s,c]=this.tokenizer._decode_asr(t,{time_precision:u,return_timestamps:n,force_full_sequences:i});m.push({text:s,...c})}return s?m[0]:m}async _call_moonshine(e,t){let n=!Array.isArray(e),r=n?[e]:e,i=this.processor.feature_extractor.config.sampling_rate,a=await QO(r,i),o=[];for(let e of a){let n=await this.processor(e),r=Math.floor(e.length/i)*6,a=await this.model.generate({max_new_tokens:r,...t,...n}),s=this.processor.batch_decode(a,{skip_special_tokens:!0})[0];o.push({text:s})}return n?o[0]:o}async _call_cohere_asr(e,t){let n=!Array.isArray(e),r=n?[e]:e,i=this.processor.feature_extractor,a=i.config.sampling_rate,o=await QO(r,a),s=t.language??`en`,c=this.processor.get_decoder_prompt_ids(s),l=[];for(let e of o){let n=i.split_audio(e),r=[];for(let e of n){let n=await this.processor(e),i=await this.model.generate({...n,decoder_input_ids:c,...t}),a=this.tokenizer.decode(i[0].tolist(),{skip_special_tokens:!0}).trim();r.push(a)}let a=this.processor.constructor.join_chunks(r,s);l.push({text:a})}return n?l[0]:l}},gk=class extends ek{DEFAULT_VOCODER_ID=`Xenova/speecht5_hifigan`;constructor(e){super(e),this.vocoder=e.vocoder??null}async _prepare_speaker_embeddings(e,t){if((typeof e==`string`||e instanceof URL)&&(e=new Float32Array(await(await M.fetch(e)).arrayBuffer())),e instanceof Float32Array)e=new U(`float32`,e,[e.length]);else if(!(e instanceof U))throw Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");if(t>1){if(e.dims[0]===1)e=e.repeat(t,1);else if(e.dims[0]!==t)throw Error(`Expected speaker embeddings batch size to be 1 or ${t}, but got ${e.dims[0]}.`)}return e}_postprocess_waveform(e,t,n,r=null){let i=t.data,[a,o]=t.dims,s=r?r.data:null,c=[];for(let e=0;e({generated_text:e.trim()}));a.push(r)}return n?a:a[0]}},vk=class extends ek{async _call(e,{top_k:t=5}={}){let n=await ZO(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),{id2label:a}=this.model.config,o=[];for(let e of i.logits){let n=await rl(new U(`float32`,ic(e.data),e.dims),t),r=n[0].tolist(),i=n[1].tolist().map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:r[t]}));o.push(i)}return Array.isArray(e)?o:o[0]}},yk={panoptic:`post_process_panoptic_segmentation`,instance:`post_process_instance_segmentation`,semantic:`post_process_semantic_segmentation`},bk=class extends ek{async _call(e,{threshold:t=.5,mask_threshold:n=.5,overlap_mask_area_threshold:r=.8,label_ids_to_fuse:i=null,target_sizes:a=null,subtask:o=null}={}){if(Array.isArray(e)&&e.length!==1)throw Error(`Image segmentation pipeline currently only supports a batch size of 1.`);let s=await ZO(e),c=s.map(e=>[e.height,e.width]),l=await this.processor(s),{inputNames:u,outputNames:d}=this.model.sessions.model;if(!u.includes(`pixel_values`)){if(u.length!==1)throw Error(`Expected a single input name, but got ${u.length} inputs: ${u}.`);let e=u[0];if(e in l)throw Error(`Input name ${e} already exists in the inputs.`);l[e]=l.pixel_values}let f=await this.model(l),p=null;if(o!==null)p=yk[o];else if(this.processor.image_processor){for(let[e,t]of Object.entries(yk))if(t in this.processor.image_processor){p=this.processor.image_processor[t].bind(this.processor.image_processor),o=e;break}}let m=this.model.config.id2label,h=[];if(!o){let e=f[d[0]];for(let t=0;te<-1e-5||e>1.00001)&&r.sigmoid_();let i=await Bd.fromTensor(r.mul_(255).to(`uint8`)).resize(n[1],n[0]);h.push({label:null,score:null,mask:i})}}else if(o===`panoptic`||o===`instance`){let e=p(f,t,n,r,i,a??c)[0],o=e.segmentation;for(let t of e.segments_info){let e=new Uint8ClampedArray(o.data.length);for(let n=0;n{let n=e.clone();return n.putAlpha(r[t].mask),n});return Array.isArray(e)?i:i[0]}},model:[BO,VO,HO],default:{model:`Xenova/modnet`},type:`image`},"zero-shot-image-classification":{pipeline:class extends ek{async _call(e,t,{hypothesis_template:n=`This is a photo of {}`}={}){let r=Array.isArray(e),i=await ZO(e),a=t.map(e=>n.replace(`{}`,e)),o=this.tokenizer(a,{padding:this.model.config.model_type===`siglip`?`max_length`:!0,truncation:!0}),{pixel_values:s}=await this.processor(i),c=await this.model({...o,pixel_values:s}),l=this.model.config.model_type===`siglip`?e=>e.sigmoid().data:e=>ic(e.data),u=[];for(let e of c.logits_per_image){let n=[...l(e)].map((e,n)=>({score:e,label:t[n]}));n.sort((e,t)=>t.score-e.score),u.push(n)}return r?u:u[0]}},model:OO,default:{model:`Xenova/clip-vit-base-patch32`},type:`multimodal`},"object-detection":{pipeline:class extends ek{async _call(e,{threshold:t=.9,percentage:n=!1}={}){let r=Array.isArray(e);if(r&&e.length!==1)throw Error(`Object detection pipeline currently only supports a batch size of 1.`);let i=await ZO(e),a=n?null:i.map(e=>[e.height,e.width]),{pixel_values:o,pixel_mask:s}=await this.processor(i),c=await this.model({pixel_values:o,pixel_mask:s}),l=this.processor.image_processor.post_process_object_detection(c,t,a),{id2label:u}=this.model.config,d=l.map(e=>e.boxes.map((t,r)=>({score:e.scores[r],label:u[e.classes[r]],box:$O(t,!n)})));return r?d:d[0]}},model:UO,default:{model:`Xenova/detr-resnet-50`},type:`multimodal`},"zero-shot-object-detection":{pipeline:class extends ek{async _call(e,t,{threshold:n=.1,top_k:r=null,percentage:i=!1}={}){let a=Array.isArray(e),o=await ZO(e),s=this.tokenizer(t,{padding:!0,truncation:!0}),c=await this.processor(o),l=[];for(let e=0;e({score:e.scores[n],label:e.labels[n],box:$O(t,!i)}))}else{let e=this.processor.image_processor.post_process_object_detection(f,n,u,!0)[0];p=e.boxes.map((n,r)=>({score:e.scores[r],label:t[e.classes[r]],box:$O(n,!i)}))}p.sort((e,t)=>t.score-e.score),r!==null&&(p=p.slice(0,r)),l.push(p)}return a?l:l[0]}},model:WO,default:{model:`Xenova/owlvit-base-patch32`},type:`multimodal`},"document-question-answering":{pipeline:class extends ek{_default_generation_config={max_new_tokens:256};async _call(e,t,n={}){if(Array.isArray(e)){if(e.length!==1)throw Error(`Document Question Answering pipeline currently only supports a batch size of 1.`);e=e[0]}let r=(await ZO(e))[0],{pixel_values:i}=await this.processor(r),a=`${t}`,o=this.tokenizer(a,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,s=await this.model.generate({inputs:i,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:o,...this._default_generation_config,...n}),c=this.tokenizer.batch_decode(s)[0].match(/(.*?)<\/s_answer>/),l=null;return c&&c.length>=2&&(l=c[1].trim()),[{answer:l}]}},model:qO,default:{model:`Xenova/donut-base-finetuned-docvqa`},type:`multimodal`},"image-to-image":{pipeline:class extends ek{async _call(e){let t=await ZO(e),n=await this.processor(t),r=await this.model(n),i=[];for(let e of r.reconstruction){let t=e.squeeze().clamp_(0,1).mul_(255).round_().to(`uint8`);i.push(Bd.fromTensor(t))}return Array.isArray(e)?i:i[0]}},model:JO,default:{model:`Xenova/swin2SR-classical-sr-x2-64`},type:`image`},"depth-estimation":{pipeline:class extends ek{async _call(e){let t=await ZO(e),n=await this.processor(t),{predicted_depth:r}=await this.model(n),i=[];for(let e=0;ee>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103,Sk=class{put(e){throw Error(`Not implemented`)}end(){throw Error(`Not implemented`)}},Ck=j.IS_PROCESS_AVAILABLE?e=>process.stdout.write(e):e=>console.log(e),wk=class extends Sk{constructor(e,{skip_prompt:t=!1,callback_function:n=null,token_callback_function:r=null,skip_special_tokens:i=!0,decode_kwargs:a={},...o}={}){super(),this.tokenizer=e,this.skip_prompt=t,this.callback_function=n??Ck,this.token_callback_function=r,this.decode_kwargs={skip_special_tokens:i,...a,...o},this.token_cache=[],this.print_len=0,this.next_tokens_are_prompt=!0,this.special_ids=new Set(this.tokenizer.all_special_ids.map(BigInt))}put(e){if(e.length>1)throw Error(`TextStreamer only supports batch size of 1`);let t=this.next_tokens_are_prompt;if(t&&(this.next_tokens_are_prompt=!1,this.skip_prompt))return;let n=e[0];if(this.token_callback_function?.(n),n.length===1&&this.special_ids.has(n[0])){if(this.decode_kwargs.skip_special_tokens)return;if(this.token_cache.length>0){let e=this.tokenizer.decode(this.token_cache,this.decode_kwargs).slice(this.print_len);this.on_finalized_text(e,!1),this.token_cache=[],this.print_len=0}let e=this.tokenizer.decode(n,this.decode_kwargs);this.on_finalized_text(e,!1);return}this.token_cache=oi(this.token_cache,n);let r=this.tokenizer.decode(this.token_cache,this.decode_kwargs),i;t||r.endsWith(` +`)?(i=r.slice(this.print_len),this.token_cache=[],this.print_len=0):r.length>0&&xk(r.charCodeAt(r.length-1))?(i=r.slice(this.print_len),this.print_len+=i.length):(i=r.slice(this.print_len,r.lastIndexOf(` `)+1),this.print_len+=i.length),this.on_finalized_text(i,!1)}end(){let e;this.token_cache.length>0?(e=this.tokenizer.decode(this.token_cache,this.decode_kwargs).slice(this.print_len),this.token_cache=[],this.print_len=0):e=``,this.next_tokens_are_prompt=!0,this.on_finalized_text(e,!0)}on_finalized_text(e,t){e.length>0&&this.callback_function?.(e),t&&this.callback_function===Ck&&j.IS_PROCESS_AVAILABLE&&this.callback_function?.(` +`)}};Object.keys(Yc),M.useBrowserCache=!0,M.allowLocalModels=!1;let Tk=`onnx-community/gemma-4-E2B-it-ONNX`,Ek=null,Dk=null,Ok=new ih,kk=e=>self.postMessage(e);async function Ak(){let e=e=>kk({type:`progress`,data:e});Ek??=await G.from_pretrained(Tk,{progress_callback:e}),Dk??=await FO.from_pretrained(Tk,{dtype:`q4f16`,device:`webgpu`,progress_callback:e});let t=Ek.apply_chat_template([{role:`user`,content:`hi`}],{add_generation_prompt:!0,return_dict:!0});await Dk.generate({...t,max_new_tokens:1}),kk({type:`ready`})}async function jk(e){if(!Ek||!Dk)throw Error(`model not loaded`);Ok.reset();let t=Ek.apply_chat_template(e,{add_generation_prompt:!0,return_dict:!0}),n=new wk(Ek,{skip_prompt:!0,skip_special_tokens:!0,callback_function:e=>kk({type:`token`,data:e})});kk({type:`start`}),await Dk.generate({...t,max_new_tokens:128,do_sample:!1,streamer:n,stopping_criteria:Ok}),kk({type:`done`})}self.addEventListener(`message`,async e=>{let{type:t,data:n}=e.data??{};try{t===`load`?await Ak():t===`generate`?await jk(n):t===`interrupt`&&Ok.interrupt()}catch(e){kk({type:`error`,data:String(e?.message??e)})}})})(); \ No newline at end of file diff --git a/sites/demo/dist/assets/ort-wasm-simd-threaded.asyncify-DMmc6YqF.wasm b/sites/demo/dist/assets/ort-wasm-simd-threaded.asyncify-DMmc6YqF.wasm new file mode 100644 index 00000000..0e2d339e Binary files /dev/null and b/sites/demo/dist/assets/ort-wasm-simd-threaded.asyncify-DMmc6YqF.wasm differ diff --git a/sites/demo/dist/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm b/sites/demo/dist/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm new file mode 100644 index 00000000..b05d1adc Binary files /dev/null and b/sites/demo/dist/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm differ diff --git a/sites/demo/dist/assets/speech.worker-DS1vd6BU.js b/sites/demo/dist/assets/speech.worker-DS1vd6BU.js new file mode 100644 index 00000000..efbd54cb --- /dev/null +++ b/sites/demo/dist/assets/speech.worker-DS1vd6BU.js @@ -0,0 +1,4156 @@ +(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=s({InferenceSession:()=>Ce,TRACE:()=>V,TRACE_EVENT_BEGIN:()=>ve,TRACE_EVENT_END:()=>ye,TRACE_FUNC_BEGIN:()=>ge,TRACE_FUNC_END:()=>_e,Tensor:()=>pe,default:()=>er,env:()=>M,registerBackend:()=>S}),d=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,h=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){ +/*! +* ONNX Runtime Web v1.26.0-dev.20260416-b7804b056c +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT License. +*/ +if(typeof require<`u`)return require.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),g=(e,t)=>()=>(e&&(t=e(e=0)),t),_=(e,t)=>{for(var n in t)d(e,n,{get:t[n],enumerable:!0})},v=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of p(t))!m.call(e,i)&&i!==n&&d(e,i,{get:()=>t[i],enumerable:!(r=f(t,i))||r.enumerable});return e},y=e=>v(d({},`__esModule`,{value:!0}),e),b,x,S,C,w,T=g(()=>{"use strict";b=new Map,x=[],S=(e,t,n)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let r=b.get(e);if(r===void 0)b.set(e,{backend:t,priority:n});else{if(r.priority>n)return;if(r.priority===n&&r.backend!==t)throw Error(`cannot register backend "${e}" using priority ${n}`)}if(n>=0){let t=x.indexOf(e);t!==-1&&x.splice(t,1);for(let t=0;t{let t=b.get(e);if(!t)return`backend not found.`;if(t.initialized)return t.backend;if(t.aborted)return t.error;{let n=!!t.initPromise;try{return n||(t.initPromise=t.backend.init(e)),await t.initPromise,t.initialized=!0,t.backend}catch(e){return n||(t.error=`${e}`,t.aborted=!0),t.error}finally{delete t.initPromise}}},w=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),r=n.length===0?x:n,i,a=[],o=new Set;for(let e of r){let t=await C(e);typeof t==`string`?a.push({name:e,err:t}):(i||=t,i===t&&o.add(e))}if(!i)throw Error(`no available backend found. ERR: ${a.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of a)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let s=t.filter(e=>o.has(typeof e==`string`?e:e.name));return[i,new Proxy(e,{get:(e,t)=>t===`executionProviders`?s:Reflect.get(e,t)})]}}),E=g(()=>{"use strict";T()}),D,O=g(()=>{"use strict";D=`1.24.0-dev.20251116-b39e144322`}),k,A,j=g(()=>{"use strict";O(),k=`warning`,A={wasm:{},webgl:{},webgpu:{},versions:{common:D},set logLevel(e){if(e!==void 0){if(typeof e!=`string`||[`verbose`,`info`,`warning`,`error`,`fatal`].indexOf(e)===-1)throw Error(`Unsupported logging level: ${e}`);k=e}},get logLevel(){return k}},Object.defineProperty(A,"logLevel",{enumerable:!0})}),M,N=g(()=>{"use strict";j(),M=A}),P,F,I=g(()=>{"use strict";P=(e,t)=>{let n=typeof document<`u`?document.createElement(`canvas`):new OffscreenCanvas(1,1);n.width=e.dims[3],n.height=e.dims[2];let r=n.getContext(`2d`);if(r!=null){let i,a;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[3]):(i=e.dims[3],a=e.dims[2]);let o=t?.format===void 0?`RGB`:t.format,s=t?.norm,c,l;s===void 0||s.mean===void 0?c=[255,255,255,255]:typeof s.mean==`number`?c=[s.mean,s.mean,s.mean,s.mean]:(c=[s.mean[0],s.mean[1],s.mean[2],0],s.mean[3]!==void 0&&(c[3]=s.mean[3])),s===void 0||s.bias===void 0?l=[0,0,0,0]:typeof s.bias==`number`?l=[s.bias,s.bias,s.bias,s.bias]:(l=[s.bias[0],s.bias[1],s.bias[2],0],s.bias[3]!==void 0&&(l[3]=s.bias[3]));let u=a*i,d=0,f=u,p=u*2,m=-1;o===`RGBA`?(d=0,f=u,p=u*2,m=u*3):o===`RGB`?(d=0,f=u,p=u*2):o===`RBG`&&(d=0,p=u,f=u*2);for(let t=0;t{let n=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):new OffscreenCanvas(1,1).getContext(`2d`),r;if(n!=null){let i,a,o;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[1],o=e.dims[3]):(i=e.dims[3],a=e.dims[2],o=e.dims[1]);let s=t!==void 0&&t.format!==void 0?t.format:`RGB`,c=t?.norm,l,u;c===void 0||c.mean===void 0?l=[255,255,255,255]:typeof c.mean==`number`?l=[c.mean,c.mean,c.mean,c.mean]:(l=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(l[3]=c.mean[3])),c===void 0||c.bias===void 0?u=[0,0,0,0]:typeof c.bias==`number`?u=[c.bias,c.bias,c.bias,c.bias]:(u=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(u[3]=c.bias[3]));let d=a*i;if(t!==void 0&&(t.format!==void 0&&o===4&&t.format!==`RGBA`||o===3&&t.format!==`RGB`&&t.format!==`BGR`))throw Error(`Tensor format doesn't match input tensor dims`);let f=0,p=1,m=2,h=3,g=0,_=d,v=d*2,y=-1;s===`RGBA`?(g=0,_=d,v=d*2,y=d*3):s===`RGB`?(g=0,_=d,v=d*2):s===`RBG`&&(g=0,v=d,_=d*2),r=n.createImageData(i,a);for(let t=0;t{"use strict";fe(),L=(e,t)=>{if(e===void 0)throw Error(`Image buffer must be defined`);if(t.height===void 0||t.width===void 0)throw Error(`Image height and width must be defined`);if(t.tensorLayout===`NHWC`)throw Error(`NHWC Tensor layout is not supported yet`);let{height:n,width:r}=t,i=t.norm??{mean:255,bias:0},a,o;a=typeof i.mean==`number`?[i.mean,i.mean,i.mean,i.mean]:[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],o=typeof i.bias==`number`?[i.bias,i.bias,i.bias,i.bias]:[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let s=t.format===void 0?`RGBA`:t.format,c=t.tensorFormat!==void 0&&t.tensorFormat!==void 0?t.tensorFormat:`RGB`,l=n*r,u=c===`RGBA`?new Float32Array(l*4):new Float32Array(l*3),d=4,f=0,p=1,m=2,h=3,g=0,_=l,v=l*2,y=-1;s===`RGB`&&(d=3,f=0,p=1,m=2,h=-1),c===`RGBA`?y=l*3:c===`RBG`?(g=0,v=l,_=l*2):c===`BGR`&&(v=0,_=l,g=l*2);for(let t=0;t{let n=typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement,r=typeof ImageData<`u`&&e instanceof ImageData,i=typeof ImageBitmap<`u`&&e instanceof ImageBitmap,a=typeof e==`string`,o,s=t??{},c=()=>{if(typeof document<`u`)return document.createElement(`canvas`);if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(1,1);throw Error(`Canvas is not supported`)},l=e=>typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas?e.getContext(`2d`):null;if(n){let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let n=e.height,i=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(n=t.resizedHeight,i=t.resizedWidth),t!==void 0){if(s=t,t.tensorFormat!==void 0)throw Error(`Image input config format must be RGBA for HTMLImageElement`);s.tensorFormat=`RGBA`,s.height=n,s.width=i}else s.tensorFormat=`RGBA`,s.height=n,s.width=i;r.drawImage(e,0,0),o=r.getImageData(0,0,i,n).data}else throw Error(`Can not access image data`)}else if(r){let n,r;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(n=t.resizedHeight,r=t.resizedWidth):(n=e.height,r=e.width),t!==void 0&&(s=t),s.format=`RGBA`,s.height=n,s.width=r,t!==void 0){let t=c();t.width=r,t.height=n;let i=l(t);if(i!=null)i.putImageData(e,0,0),o=i.getImageData(0,0,r,n).data;else throw Error(`Can not access image data`)}else o=e.data}else if(i){if(t===void 0)throw Error(`Please provide image config with format for Imagebitmap`);let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let t=e.height,n=e.width;return r.drawImage(e,0,0,n,t),o=r.getImageData(0,0,n,t).data,s.height=t,s.width=n,L(o,s)}else throw Error(`Can not access image data`)}else{if(a)return new Promise((t,n)=>{let r=c(),i=l(r);if(!e||!i)return n();let a=new Image;a.crossOrigin=`Anonymous`,a.src=e,a.onload=()=>{r.width=a.width,r.height=a.height,i.drawImage(a,0,0,r.width,r.height);let e=i.getImageData(0,0,r.width,r.height);s.height=r.height,s.width=r.width,t(L(e.data,s))}});throw Error(`Input data provided is not supported - aborted tensor creation`)}if(o!==void 0)return L(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},te=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t;return new de({location:`texture`,type:`float32`,texture:e,dims:[1,r,n,4],download:i,dispose:a})},R=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new de({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},ne=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new de({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},re=(e,t,n)=>new de({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]})}),ae,z,oe,se,B=g(()=>{"use strict";ae=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),z=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]),oe=!1,se=()=>{if(!oe){oe=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=typeof n<`u`&&n.from;e&&(ae.set(`int64`,BigInt64Array),z.set(BigInt64Array,`int64`)),t&&(ae.set(`uint64`,BigUint64Array),z.set(BigUint64Array,`uint64`)),r?(ae.set(`float16`,n),z.set(n,`float16`)):ae.set(`float16`,Uint16Array)}}}),ce,le,ue=g(()=>{"use strict";fe(),ce=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new de(e.type,e.data,t);case`cpu-pinned`:return new de({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new de({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new de({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new de({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),de,fe=g(()=>{"use strict";I(),ie(),B(),ue(),de=class{constructor(e,t,n){se();let r,i;if(typeof e==`object`&&`location`in e)switch(this.dataLocation=e.location,r=e.type,i=e.dims,e.location){case`cpu-pinned`:{let t=ae.get(r);if(!t)throw TypeError(`unsupported type "${r}" to create tensor from pinned buffer`);if(!(e.data instanceof t))throw TypeError(`buffer should be of type ${t.name}`);this.cpuData=e.data;break}case`texture`:if(r!==`float32`)throw TypeError(`unsupported type "${r}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break;case`gpu-buffer`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break;case`ml-tensor`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint64`&&r!==`int8`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break;default:throw Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,o;if(typeof e==`string`)if(r=e,o=n,e===`string`){if(!Array.isArray(t))throw TypeError(`A string tensor's data must be a string array.`);a=t}else{let n=ae.get(e);if(n===void 0)throw TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t)){if(e===`float16`&&n===Uint16Array||e===`uint4`||e===`int4`)throw TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${n.name} as data.`);a=e===`uint64`||e===`int64`?n.from(t,BigInt):n.from(t)}else if(t instanceof n)a=t;else if(t instanceof Uint8ClampedArray)if(e===`uint8`)a=Uint8Array.from(t);else throw TypeError(`A Uint8ClampedArray tensor's data must be type of uint8`);else if(e===`float16`&&t instanceof Uint16Array&&n!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw TypeError(`A ${r} tensor's data must be type of ${n}`)}else if(o=t,Array.isArray(e)){if(e.length===0)throw TypeError(`Tensor type cannot be inferred from an empty array.`);let t=typeof e[0];if(t===`string`)r=`string`,a=e;else if(t===`boolean`)r=`bool`,a=Uint8Array.from(e);else throw TypeError(`Invalid element type of data array: ${t}.`)}else if(e instanceof Uint8ClampedArray)r=`uint8`,a=Uint8Array.from(e);else{let t=z.get(e.constructor);if(t===void 0)throw TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,a=e}if(o===void 0)o=[a.length];else if(!Array.isArray(o))throw TypeError(`A tensor's dims must be a number array`);i=o,this.cpuData=a,this.dataLocation=`cpu`}let a=ce(i);if(this.cpuData&&a!==this.cpuData.length&&!((r===`uint4`||r===`int4`)&&Math.ceil(a/2)===this.cpuData.length))throw Error(`Tensor's size(${a}) does not match data length(${this.cpuData.length}).`);this.type=r,this.dims=i,this.size=a}static async fromImage(e,t){return ee(e,t)}static fromTexture(e,t){return te(e,t)}static fromGpuBuffer(e,t){return R(e,t)}static fromMLTensor(e,t){return ne(e,t)}static fromPinnedBuffer(e,t,n){return re(e,t,n)}toDataURL(e){return P(this,e)}toImageData(e){return F(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw Error(`The data is not stored as a WebGL texture.`);return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw Error(`The data is not stored as a WebGPU buffer.`);return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw Error(`The data is not stored as a WebNN MLTensor.`);return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case`cpu`:case`cpu-pinned`:return this.data;case`texture`:case`gpu-buffer`:case`ml-tensor`:if(!this.downloader)throw Error(`The current tensor is not created with a specified data downloader.`);if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);try{this.isDownloading=!0;let t=await this.downloader();return this.downloader=void 0,this.dataLocation=`cpu`,this.cpuData=t,e&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}default:throw Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);this.disposer&&=(this.disposer(),void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation=`none`}ensureValid(){if(this.dataLocation===`none`)throw Error(`The tensor is disposed.`)}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw Error(`Cannot reshape a tensor that owns GPU resource.`);return le(this,e)}}}),pe,me=g(()=>{"use strict";fe(),pe=de}),V,he,ge,_e,ve,ye,be=g(()=>{"use strict";j(),V=(e,t)=>{(typeof A.trace>`u`?!A.wasm.trace:!A.trace)||console.timeStamp(`${e}::ORT::${t}`)},he=(e,t)=>{let n=Error().stack?.split(/\r\n|\r|\n/g)||[],r=!1;for(let i=0;i{(typeof A.trace>`u`?!A.wasm.trace:!A.trace)||he(`BEGIN`,e)},_e=e=>{(typeof A.trace>`u`?!A.wasm.trace:!A.trace)||he(`END`,e)},ve=e=>{(typeof A.trace>`u`?!A.wasm.trace:!A.trace)||console.time(`ORT::${e}`)},ye=e=>{(typeof A.trace>`u`?!A.wasm.trace:!A.trace)||console.timeEnd(`ORT::${e}`)}}),xe,Se=g(()=>{"use strict";T(),me(),be(),xe=class e{constructor(e){this.handler=e}async run(e,t,n){ge(),ve(`InferenceSession.run`);let r={},i={};if(typeof e!=`object`||!e||e instanceof pe||Array.isArray(e))throw TypeError(`'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.`);let a=!0;if(typeof t==`object`){if(t===null)throw TypeError(`Unexpected argument[1]: cannot be null.`);if(t instanceof pe)throw TypeError(`'fetches' cannot be a Tensor`);if(Array.isArray(t)){if(t.length===0)throw TypeError(`'fetches' cannot be an empty array.`);a=!1;for(let e of t){if(typeof e!=`string`)throw TypeError(`'fetches' must be a string array or an object.`);if(this.outputNames.indexOf(e)===-1)throw RangeError(`'fetches' contains invalid output name: ${e}.`);r[e]=null}if(typeof n==`object`&&n)i=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else{let e=!1,o=Object.getOwnPropertyNames(t);for(let n of this.outputNames)if(o.indexOf(n)!==-1){let i=t[n];(i===null||i instanceof pe)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else i=t}}else if(typeof t<`u`)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(typeof e[t]>`u`)throw Error(`input '${t}' is missing in 'feeds'.`);if(a)for(let e of this.outputNames)r[e]=null;let o=await this.handler.run(e,r,i),s={};for(let e in o)if(Object.hasOwnProperty.call(o,e)){let t=o[e];t instanceof pe?s[e]=t:s[e]=new pe(t.type,t.data,t.dims)}return ye(`InferenceSession.run`),_e(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){ge(),ve(`InferenceSession.create`);let a,o={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer){let e=t,s=0,c=t.byteLength;if(typeof n==`object`&&n)o=n;else if(typeof n==`number`){if(s=n,!Number.isSafeInteger(s))throw RangeError(`'byteOffset' must be an integer.`);if(s<0||s>=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(c=t.byteLength-s,typeof r==`number`){if(c=r,!Number.isSafeInteger(c))throw RangeError(`'byteLength' must be an integer.`);if(c<=0||s+c>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-s}].`);if(typeof i==`object`&&i)o=i;else if(typeof i<`u`)throw TypeError(`'options' must be an object.`)}else if(typeof r<`u`)throw TypeError(`'byteLength' must be a number.`)}else if(typeof n<`u`)throw TypeError(`'options' must be an object.`);a=new Uint8Array(e,s,c)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let[s,c]=await w(o),l=await s.createInferenceSessionHandler(a,c);return ye(`InferenceSession.create`),_e(),new e(l)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}}}),Ce,we=g(()=>{"use strict";Se(),Ce=xe}),Te=g(()=>{"use strict";}),Ee=g(()=>{"use strict";}),De=g(()=>{"use strict";}),Oe=g(()=>{"use strict";}),ke={};_(ke,{InferenceSession:()=>Ce,TRACE:()=>V,TRACE_EVENT_BEGIN:()=>ve,TRACE_EVENT_END:()=>ye,TRACE_FUNC_BEGIN:()=>ge,TRACE_FUNC_END:()=>_e,Tensor:()=>pe,env:()=>M,registerBackend:()=>S});var Ae=g(()=>{"use strict";E(),N(),we(),me(),Te(),Ee(),be(),De(),Oe()}),je=g(()=>{"use strict";}),Me={};_(Me,{default:()=>Fe});var Ne,Pe,Fe,Ie=g(()=>{"use strict";Tn(),ft(),nt(),Ne=`ort-wasm-proxy-worker`,Pe=globalThis.self?.name===Ne,Pe&&(self.onmessage=e=>{let{type:t,in:n}=e.data;try{switch(t){case`init-wasm`:ut(n.wasm).then(()=>{pn(n).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})})},e=>{postMessage({type:t,err:e})});break;case`init-ep`:{let{epName:e,env:r}=n;mn(r,e).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})});break}case`copy-from`:{let{buffer:e}=n,r=vn(e);postMessage({type:t,out:r});break}case`create`:{let{model:e,options:r}=n;yn(e,r).then(e=>{postMessage({type:t,out:e})},e=>{postMessage({type:t,err:e})});break}case`release`:bn(n),postMessage({type:t});break;case`run`:{let{sessionId:e,inputIndices:r,inputs:i,outputIndices:a,options:o}=n;Sn(e,r,i,a,Array(a.length).fill(null),o).then(e=>{e.some(e=>e[3]!==`cpu`)?postMessage({type:t,err:`Proxy does not support non-cpu tensor location.`}):postMessage({type:t,out:e},wn([...i,...e]))},e=>{postMessage({type:t,err:e})});break}case`end-profiling`:Cn(n),postMessage({type:t});break;default:}}catch(e){postMessage({type:t,err:e})}}),Fe=Pe?null:e=>new Worker(e??Ge,{type:`module`,name:Ne})}),Le={};_(Le,{default:()=>ze});async function Re(e={}){var t=e,n=!!globalThis.window,r=!!globalThis.WorkerGlobalScope,i=r&&self.name?.startsWith(`em-pthread`);t.mountExternalData=(e,n)=>{e.startsWith(`./`)&&(e=e.substring(2)),(t.Uc||=new Map).set(e,n)},t.unmountExternalData=()=>{delete t.Uc},globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,shared:!0}).buffer.constructor;let a=()=>{let e=e=>(...t)=>{let n=Zt;return t=e(...t),Zt==n?t:new Promise((e,t)=>{an={resolve:e,reject:t}})};(()=>{for(let n of[`_OrtAppendExecutionProvider`,`_OrtCreateSession`,`_OrtRun`,`_OrtRunWithBinding`,`_OrtBindInput`])t[n]=e(t[n])})(),typeof jsepRunAsync<`u`&&(t._OrtRun=jsepRunAsync(t._OrtRun),t._OrtRunWithBinding=jsepRunAsync(t._OrtRunWithBinding)),a=void 0};t.asyncInit=()=>{a?.()};var o,s,c=(e,t)=>{throw t},l=self.location.href,u=``;if(n||r){try{u=new URL(`.`,l).href}catch{}r&&(s=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),o=async e=>{if(S(e))return new Promise((t,n)=>{var r=new XMLHttpRequest;r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onload=()=>{r.status==200||r.status==0&&r.response?t(r.response):n(r.status)},r.onerror=n,r.send(null)});var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)}}var d,f,p,m,h,g,_=console.log.bind(console),v=console.error.bind(console),y=_,b=v,x=!1,S=e=>e.startsWith(`file://`);function C(){ye.buffer!=T.buffer&&L()}if(i){let e=function(n){try{var r=n.data,i=r.Oc;if(i===`load`){let n=[];self.onmessage=e=>n.push(e),g=()=>{postMessage({Oc:`loaded`});for(let t of n)e(t);self.onmessage=e};for(let e of r.ce)t[e]&&!t[e].proxy||(t[e]=(...t)=>{postMessage({Oc:`callHandler`,be:e,args:t})},e==`print`&&(y=t[e]),e==`printErr`&&(b=t[e]));ye=r.ie,L(),f=r.je,ne(),Ao()}else if(i===`run`){(function(e){var t=(C(),A)[e+52>>>2>>>0];e=(C(),A)[e+56>>>2>>>0],Zi(t,t-e),Qi(t)})(r.Nc),Vi(r.Nc,0,0,1,0,0),ge(),Bt(r.Nc),w||=(vi(),!0);try{be(r.ge,r.Wc)}catch(e){if(e!=`unwind`)throw e}}else r.target!==`setimmediate`&&(i===`checkMailbox`?w&&Vt():i&&(b(`worker: received unknown command ${i}`),b(r)))}catch(e){throw Hi(),e}};var w=!1;self.onunhandledrejection=e=>{throw e.reason||e},self.onmessage=e}var T,E,D,O,k,A,j,M,N,P,F,I=!1;function L(){var e=ye.buffer;t.HEAP8=T=new Int8Array(e),D=new Int16Array(e),t.HEAPU8=E=new Uint8Array(e),O=new Uint16Array(e),t.HEAP32=k=new Int32Array(e),t.HEAPU32=A=new Uint32Array(e),j=new Float32Array(e),M=new Float64Array(e),N=new BigInt64Array(e),P=new BigUint64Array(e)}function ee(){I=!0,i?g():Ga._b()}function te(e){throw b(e=`Aborted(`+e+`)`),x=!0,e=new WebAssembly.RuntimeError(e+`. Build with -sASSERTIONS for more info.`),h?.(e),e}function R(){return{a:{f:we,J:Ee,k:je,p:Me,l:Ne,sa:Pe,b:Fe,ca:Ie,Ja:Re,q:ze,da:We,Za:Ge,Fa:Ke,Ha:qe,_a:Je,Xa:Ye,Qa:Xe,Wa:Ze,oa:Qe,Ga:$e,Xb:et,Ya:tt,Yb:nt,db:rt,Da:dt,Sb:ft,Qb:bt,Ca:St,M:Ct,I:wt,Rb:Dt,ja:Ft,Tb:It,Ta:Lt,Vb:Ht,Ka:Wt,Ob:Gt,ka:Kt,Sa:Bt,ab:qt,U:cn,n:hn,c:ht,rb:gn,w:_n,L:vn,z:yn,j:bn,o:xn,sb:Sn,G:Cn,T:wn,h:Tn,u:En,m:Dn,i:On,Na:kn,Oa:Nn,Pa:Pn,La:Fn,Ma:In,Pb:Rn,eb:zn,cb:Hn,Y:Gn,qb:Kn,la:qn,bb:Bn,fb:Jn,$a:Yn,Wb:Xn,N:H,gb:Zn,X:Qn,Ub:$n,nb:br,C:xr,ra:Sr,qa:Cr,pb:wr,W:Tr,v:Er,mb:Dr,lb:Or,kb:kr,ob:Ar,jb:jr,ib:Mr,hb:Nr,Ua:Lr,Va:Rr,Ia:de,V:zr,na:Br,Ra:Vr,ma:Ur,Cb:Oo,xa:So,Db:Do,ya:xo,F:lo,e:Za,s:Ya,x:Ja,B:oo,Fb:vo,ba:_o,D:eo,za:yo,$:Co,ga:go,Gb:ho,Hb:mo,Ba:uo,Aa:po,Ib:fo,wa:Eo,aa:bo,d:Xa,A:$a,r:Qa,Bb:ko,t:no,y:so,H:to,E:ro,K:co,R:wo,ia:ao,_:To,Jb:W,Kb:io,g:Wr,a:ye,Nb:le,Eb:Gr,ha:Kr,O:qr,pa:Jr,Lb:Yr,ta:Xr,Q:Zr,yb:Qr,zb:$r,ua:ei,ea:ti,P:ni,Ea:ri,va:ii,Z:ai,wb:oi,Zb:si,S:ci,Ab:li,tb:ui,ub:fi,vb:pi,fa:mi,xb:hi,Mb:gi}}}async function ne(){function e(e,n){var r=Ga=e.exports;e={};for(let[t,n]of Object.entries(r))typeof n==`function`?(r=Yt(n),e[t]=r):e[t]=n;return Ga=e,Ga=function(){var e=Ga,t=e=>t=>e(t)>>>0,n=e=>()=>e()>>>0;return(e=Object.assign({},e)).$b=t(e.$b),e.Cc=n(e.Cc),e.Ec=t(e.Ec),e.rd=(e=>(t,n)=>e(t,n)>>>0)(e.rd),e.wd=t(e.wd),e.xd=n(e.xd),e.Bd=t(e.Bd),e}(),me.push(Ga.id),_i=(e=Ga).$b,vi=e.ac,t._OrtInit=e.bc,t._OrtGetLastError=e.cc,t._OrtCreateSessionOptions=e.dc,t._OrtAppendExecutionProvider=e.ec,t._OrtAddFreeDimensionOverride=e.fc,t._OrtAddSessionConfigEntry=e.gc,t._OrtReleaseSessionOptions=e.hc,t._OrtCreateSession=e.ic,t._OrtReleaseSession=e.jc,t._OrtGetInputOutputCount=e.kc,t._OrtGetInputOutputMetadata=e.lc,t._OrtFree=e.mc,t._OrtCreateTensor=e.nc,t._OrtGetTensorData=e.oc,t._OrtReleaseTensor=e.pc,t._OrtCreateRunOptions=e.qc,t._OrtAddRunConfigEntry=e.rc,t._OrtReleaseRunOptions=e.sc,t._OrtCreateBinding=e.tc,t._OrtBindInput=e.uc,t._OrtBindOutput=e.vc,t._OrtClearBoundOutputs=e.wc,t._OrtReleaseBinding=e.xc,t._OrtRunWithBinding=e.yc,t._OrtRun=e.zc,t._OrtEndProfiling=e.Ac,yi=t._OrtGetWebGpuDevice=e.Bc,bi=e.Cc,xi=t._free=e.Dc,Si=t._malloc=e.Ec,Ci=t._wgpuBufferRelease=e.Fc,wi=t._wgpuCreateInstance=e.Gc,Ti=e.Hc,Ei=e.Ic,Di=e.Jc,Oi=e.Kc,ki=e.Lc,Ai=e.Pc,ji=e.Zc,Mi=e._c,Ni=e.$c,Pi=e.bd,Fi=e.cd,Ii=e.dd,Li=e.ed,Ri=e.fd,zi=e.gd,Bi=e.hd,Vi=e.kd,Hi=e.ld,Ui=e.md,Wi=e.nd,Gi=e.od,Ki=e.pd,qi=e.qd,Ji=e.rd,Yi=e.sd,Xi=e.td,Zi=e.ud,Qi=e.vd,$i=e.wd,ea=e.xd,ta=e.yd,na=e.zd,ra=e.Ad,ia=e.Bd,aa=e.Cd,oa=e.Dd,sa=e.Ed,ca=e.Fd,la=e.Gd,ua=e.Hd,da=e.Id,fa=e.Jd,pa=e.Kd,ma=e.Ld,ha=e.Md,ga=e.Nd,_a=e.Od,va=e.Pd,ya=e.Qd,ba=e.Rd,xa=e.Td,Sa=e.Ud,Ca=e.Vd,wa=e.Wd,Ta=e.Yd,Ea=e.Zd,Da=e._d,Oa=e.$d,ka=e.ae,Aa=e.oe,ja=e.pe,Ma=e.qe,Na=e.re,Pa=e.se,Fa=e.te,Ia=e.ue,La=e.ve,Ra=e.we,za=e.xe,Ba=e.ye,Va=e.Ye,Ha=e.Ze,Ua=e._e,Wa=e.$e,f=n,Ga}var n,r=R();return t.instantiateWasm?new Promise(n=>{t.instantiateWasm(r,(t,r)=>{n(e(t,r))})}):i?e(new WebAssembly.Instance(f,R()),f):(F??=t.locateFile?t.locateFile?t.locateFile(`ort-wasm-simd-threaded.asyncify.wasm`,u):u+`ort-wasm-simd-threaded.asyncify.wasm`:new URL(`/demo/assets/ort-wasm-simd-threaded.asyncify-DMmc6YqF.wasm`,``+self.location.href).href,n=await async function(e){var t=F;if(!d&&!S(t))try{var n=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(n,e)}catch(e){b(`wasm streaming compile failed: ${e}`),b(`falling back to ArrayBuffer instantiation`)}return async function(e,t){try{var n=await async function(e){if(!d)try{var t=await o(e);return new Uint8Array(t)}catch{}if(e==F&&d)e=new Uint8Array(d);else{if(!s)throw`both async and sync fetching of the wasm failed`;e=s(e)}return e}(e);return await WebAssembly.instantiate(n,t)}catch(e){b(`failed to asynchronously prepare wasm: ${e}`),te(e)}}(t,e)}(r),e(n.instance,n.module))}class re{name=`ExitStatus`;constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var ie=e=>{e.terminate(),e.onmessage=()=>{}},ae=[],z=0,oe=null,se=e=>{fe.length==0&&(ve(),_e(fe[0]));var t=fe.pop();if(!t)return 6;pe.push(t),V[e.Nc]=t,t.Nc=e.Nc;var n={Oc:`run`,ge:e.fe,Wc:e.Wc,Nc:e.Nc};return t.postMessage(n,e.Yc),0},B=0,ce=(e,t,...n)=>{var r,i=16*n.length,a=ea(),o=$i(i),s=o>>>3;for(r of n)typeof r==`bigint`?((C(),N)[s++>>>0]=1n,(C(),N)[s++>>>0]=r):((C(),N)[s++>>>0]=0n,(C(),M)[s++>>>0]=r);return e=Ui(e,0,i,o,t),Qi(a),e};function le(e){if(i)return ce(0,1,e);if(p=e,!(0{if(p=e,i)throw ue(e),`unwind`;le(e)},fe=[],pe=[],me=[],V={},he=e=>{var t=e.Nc;delete V[t],fe.push(e),pe.splice(pe.indexOf(e),1),e.Nc=0,Wi(t)};function ge(){me.forEach(e=>e())}var _e=e=>new Promise(n=>{e.onmessage=r=>{var i=r.data;if(r=i.Oc,i.Vc&&i.Vc!=bi()){var a=V[i.Vc];a?a.postMessage(i,i.Yc):b(`Internal error! Worker sent a message "${r}" to target pthread ${i.Vc}, but that thread no longer exists!`)}else r===`checkMailbox`?Vt():r===`spawnThread`?se(i):r===`cleanupThread`?Rt(()=>{he(V[i.he])}):r===`loaded`?(e.loaded=!0,n(e)):i.target===`setimmediate`?e.postMessage(i):r===`uncaughtException`?e.onerror(i.error):r===`callHandler`?t[i.be](...i.args):r&&b(`worker sent an unknown command ${r}`)},e.onerror=e=>{throw b(`worker sent an error! ${e.filename}:${e.lineno}: ${e.message}`),e};var r,i=[];for(r of[])t.propertyIsEnumerable(r)&&i.push(r);e.postMessage({Oc:`load`,ce:i,ie:ye,je:f})});function ve(){var e=new Worker((()=>{let e=URL;return self.location.href>`file:`&&self.location.href<`file;`?new e(`ort.webgpu.bundle.min.mjs`,self.location.href):new URL(self.location.href)})(),{type:`module`,workerData:`em-pthread`,name:`em-pthread`});fe.push(e)}var ye,be=(e,t)=>{B=0,e=oa(e,t),0-9007199254740992>e||9007199254740992>>=0);return(C(),T)[t.Qc+12>>>0]==0&&(De(t,!0),Se--),Oe(t,!1),xe.push(t),ia(e)}var Te=0,Ee=()=>{Yi(0,0);var e=xe.pop();ta(e.Xc),Te=0};function De(e,t){t=+!!t,(C(),T)[e.Qc+12>>>0]=t}function Oe(e,t){t=+!!t,(C(),T)[e.Qc+13>>>0]=t}class ke{constructor(e){this.Xc=e,this.Qc=e-24}}var Ae=e=>{var t=Te;if(!t)return Xi(0),0;var n=new ke(t);(C(),A)[n.Qc+16>>>2>>>0]=t;var r=(C(),A)[n.Qc+4>>>2>>>0];if(!r)return Xi(0),t;for(var i of e){if(i===0||i===r)break;if(ra(i,r,n.Qc+16))return Xi(i),t}return Xi(r),t};function je(){return Ae([])}function Me(e){return Ae([e>>>0])}function Ne(e,t,n,r){return Ae([e>>>0,t>>>0,n>>>0,r>>>0])}var Pe=()=>{var e=xe.pop();e||te(`no exception to throw`);var t=e.Xc;throw(C(),T)[e.Qc+13>>>0]==0&&(xe.push(e),Oe(e,!0),De(e,!1),Se++),na(t),Te=t};function Fe(e,t,n){var r=new ke(e>>>=0);throw t>>>=0,n>>>=0,(C(),A)[r.Qc+16>>>2>>>0]=0,(C(),A)[r.Qc+4>>>2>>>0]=t,(C(),A)[r.Qc+8>>>2>>>0]=n,na(e),Se++,Te=e}var Ie=()=>Se;function Le(e,t,n,r){return i?ce(2,1,e,t,n,r):Re(e,t,n,r)}function Re(e,t,n,r){if(e>>>=0,t>>>=0,n>>>=0,r>>>=0,!globalThis.SharedArrayBuffer)return 6;var a=[];return i&&a.length===0?Le(e,t,n,r):(e={fe:n,Nc:e,Wc:r,Yc:a},i?(e.Oc=`spawnThread`,postMessage(e,a),0):se(e))}function ze(e){throw Te||=e>>>0,Te}var Be=globalThis.TextDecoder&&new TextDecoder,Ve=(e,t,n,r)=>{if(n=t+n,r)return n;for(;e[t]&&!(t>=n);)++t;return t},He=(e,t=0,n,r)=>{if(16<(n=Ve(e,t>>>=0,n,r))-t&&e.buffer&&Be)return Be.decode(e.buffer instanceof ArrayBuffer?e.subarray(t,n):e.slice(t,n));for(r=``;t(i=(240&i)==224?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r},Ue=(e,t,n)=>(e>>>=0)?He((C(),E),e,t,n):``;function We(e,t,n){return i?ce(3,1,e,t,n):0}function Ge(e,t){if(i)return ce(4,1,e,t)}function Ke(e,t){if(i)return ce(5,1,e,t)}function qe(e,t,n){if(i)return ce(6,1,e,t,n)}function Je(e,t,n){return i?ce(7,1,e,t,n):0}function Ye(e,t){if(i)return ce(8,1,e,t)}function Xe(e,t,n){if(i)return ce(9,1,e,t,n)}function Ze(e,t,n,r){if(i)return ce(10,1,e,t,n,r)}function Qe(e,t,n,r){if(i)return ce(11,1,e,t,n,r)}function $e(e,t,n,r){if(i)return ce(12,1,e,t,n,r)}function et(e){if(i)return ce(13,1,e)}function tt(e,t){if(i)return ce(14,1,e,t)}function nt(e,t,n){if(i)return ce(15,1,e,t,n)}var rt=()=>te(``),it=e=>{e>>>=0;for(var t=``;;){var n=(C(),E)[e++>>>0];if(!n)return t;t+=String.fromCharCode(n)}},at={},ot={},st={},ct=class extends Error{constructor(e){super(e),this.name=`BindingError`}};function lt(e,t,n={}){return function(e,t,n={}){var r=t.name;if(!e)throw new ct(`type "${r}" must have a positive integer typeid pointer`);if(ot.hasOwnProperty(e)){if(n.de)return;throw new ct(`Cannot register type '${r}' twice`)}ot[e]=t,delete st[e],at.hasOwnProperty(e)&&(t=at[e],delete at[e],t.forEach(e=>e()))}(e,t,n)}var ut=(e,t,n)=>{switch(t){case 1:return n?e=>(C(),T)[e>>>0]:e=>(C(),E)[e>>>0];case 2:return n?e=>(C(),D)[e>>>1>>>0]:e=>(C(),O)[e>>>1>>>0];case 4:return n?e=>(C(),k)[e>>>2>>>0]:e=>(C(),A)[e>>>2>>>0];case 8:return n?e=>(C(),N)[e>>>3>>>0]:e=>(C(),P)[e>>>3>>>0];default:throw TypeError(`invalid integer width (${t}): ${e}`)}};function dt(e,t,n,r,i){e>>>=0,n>>>=0,t=it(t>>>0);let a=e=>e;if(r=r===0n){let e=8*n;a=t=>BigInt.asUintN(e,t),i=a(i)}lt(e,{name:t,Mc:a,Sc:(e,t)=>(typeof t==`number`&&(t=BigInt(t)),t),Rc:ut(t,n,!r),Tc:null})}function ft(e,t,n,r){lt(e>>>=0,{name:t=it(t>>>0),Mc:function(e){return!!e},Sc:function(e,t){return t?n:r},Rc:function(e){return this.Mc((C(),E)[e>>>0])},Tc:null})}var pt=[],mt=[0,1,,1,null,1,!0,1,!1,1];function ht(e){9<(e>>>=0)&&--mt[e+1]==0&&(mt[e]=void 0,pt.push(e))}var gt=e=>{if(!e)throw new ct(`Cannot use deleted val. handle = ${e}`);return mt[e]},_t=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=pt.pop()||mt.length;return mt[t]=e,mt[t+1]=1,t}};function vt(e){return this.Mc((C(),A)[e>>>2>>>0])}var yt={name:`emscripten::val`,Mc:e=>{var t=gt(e);return ht(e),t},Sc:(e,t)=>_t(t),Rc:vt,Tc:null};function bt(e){return lt(e>>>0,yt)}var xt=(e,t)=>{switch(t){case 4:return function(e){return this.Mc((C(),j)[e>>>2>>>0])};case 8:return function(e){return this.Mc((C(),M)[e>>>3>>>0])};default:throw TypeError(`invalid float width (${t}): ${e}`)}};function St(e,t,n){n>>>=0,lt(e>>>=0,{name:t=it(t>>>0),Mc:e=>e,Sc:(e,t)=>t,Rc:xt(t,n),Tc:null})}function Ct(e,t,n,r,i){e>>>=0,n>>>=0,t=it(t>>>0);let a=e=>e;if(r===0){var o=32-8*n;a=e=>e<>>o,i=a(i)}lt(e,{name:t,Mc:a,Sc:(e,t)=>t,Rc:ut(t,n,r!==0),Tc:null})}function wt(e,t,n){function r(e){var t=(C(),A)[e>>>2>>>0];return e=(C(),A)[e+4>>>2>>>0],new i((C(),T).buffer,e,t)}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];lt(e>>>=0,{name:n=it(n>>>0),Mc:r,Rc:r},{de:!0})}var Tt=(e,t,n)=>{var r=(C(),E);if(t>>>=0,0=o){if(t>=n)break;r[t++>>>0]=o}else if(2047>=o){if(t+1>=n)break;r[t++>>>0]=192|o>>6,r[t++>>>0]=128|63&o}else if(65535>=o){if(t+2>=n)break;r[t++>>>0]=224|o>>12,r[t++>>>0]=128|o>>6&63,r[t++>>>0]=128|63&o}else{if(t+3>=n)break;r[t++>>>0]=240|o>>18,r[t++>>>0]=128|o>>12&63,r[t++>>>0]=128|o>>6&63,r[t++>>>0]=128|63&o,a++}}r[t>>>0]=0,e=t-i}else e=0;return e},Et=e=>{for(var t=0,n=0;n=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t};function Dt(e,t){lt(e>>>=0,{name:t=it(t>>>0),Mc(e){var t=(C(),A)[e>>>2>>>0];return t=Ue(e+4,t,!0),xi(e),t},Sc(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n=typeof t==`string`;if(!(n||ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT==1))throw new ct(`Cannot pass non-string to std::string`);var r=n?Et(t):t.length,i=Si(4+r+1),a=i+4;return(C(),A)[i>>>2>>>0]=r,n?Tt(t,a,r+1):(C(),E).set(t,a>>>0),e!==null&&e.push(xi,i),i},Rc:vt,Tc(e){xi(e)}})}var Ot=globalThis.TextDecoder?new TextDecoder(`utf-16le`):void 0,kt=(e,t,n)=>{if(e>>>=1,16<(t=Ve((C(),O),e,t/2,n))-e&&Ot)return Ot.decode((C(),O).slice(e,t));for(n=``;e>>0];n+=String.fromCharCode(r)}return n},At=(e,t,n)=>{if(n??=2147483647,2>n)return 0;var r=t;n=(n-=2)<2*e.length?n/2:e.length;for(var i=0;i>>1>>>0]=a,t+=2}return(C(),D)[t>>>1>>>0]=0,t-r},jt=e=>2*e.length,Mt=(e,t,n)=>{var r=``;e>>>=2;for(var i=0;!(i>=t/4);i++){var a=(C(),A)[e+i>>>0];if(!a&&!n)break;r+=String.fromCodePoint(a)}return r},Nt=(e,t,n)=>{if(t>>>=0,n??=2147483647,4>n)return 0;var r=t;n=r+n-4;for(var i=0;i>>2>>>0]=a,(t+=4)+4>n)break}return(C(),k)[t>>>2>>>0]=0,t-r},Pt=e=>{for(var t=0,n=0;n>>=0,t>>>=0,n=it(n>>>=0),t===2)var r=kt,i=At,a=jt;else r=Mt,i=Nt,a=Pt;lt(e,{name:n,Mc:e=>{var n=(C(),A)[e>>>2>>>0];return n=r(e+4,n*t,!0),xi(e),n},Sc:(e,r)=>{if(typeof r!=`string`)throw new ct(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=Si(4+o+t);return(C(),A)[s>>>2>>>0]=o/t,i(r,s+4,o+t),e!==null&&e.push(xi,s),s},Rc:vt,Tc(e){xi(e)}})}function It(e,t){lt(e>>>=0,{ee:!0,name:t=it(t>>>0),Mc:()=>{},Sc:()=>{}})}function Lt(e){Vi(e>>>0,!r,1,!n,131072,!1),ge()}var Rt=e=>{if(!x)try{if(e(),!(0Number((navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)||[])[2]);function Bt(e){e>>>=0,zt||(Atomics.waitAsync((C(),k),e>>>2,e).value.then(Vt),e+=128,Atomics.store((C(),k),e>>>2,1))}var Vt=()=>Rt(()=>{var e=bi();e&&(Bt(e),qi())});function Ht(e,t){(e>>>=0)==t>>>0?setTimeout(Vt):i?postMessage({Vc:e,Oc:`checkMailbox`}):(e=V[e])&&e.postMessage({Oc:`checkMailbox`})}var Ut=[];function Wt(e,t,n,r,i){for(t>>>=0,i>>>=0,Ut.length=0,n=i>>>3,r=i+r>>>3;n>>0]?(C(),N)[n++>>>0]:(C(),M)[n++>>>0];Ut.push(a)}return(t?qa[t]:Ka[e])(...Ut)}var Gt=()=>{B=0};function Kt(e){e>>>=0,i?postMessage({Oc:`cleanupThread`,he:e}):he(V[e])}function qt(e){}var Jt=e=>{try{e()}catch(e){te(e)}};function Yt(e){var t=(...t)=>{$t.push(e);try{return e(...t)}finally{x||($t.pop(),Zt&&Xt===1&&$t.length===0&&(Xt=0,B+=1,Jt(Ha),typeof Fibers<`u`&&Fibers.Be()))}};return nn.set(e,t),t}var Xt=0,Zt=null,Qt=0,$t=[],en=new Map,tn=new Map,nn=new Map,rn=0,an=null,on=[],sn=e=>function(e){if(!x){if(Xt===0){var t=!1,n=!1;e((e=0)=>{if(!x&&(Qt=e,t=!0,n)){Xt=2,Jt(()=>Ua(Zt)),typeof MainLoop<`u`&&MainLoop.Xd&&MainLoop.resume(),e=!1;try{var r=function(){var e=(C(),k)[Zt+8>>>2>>>0];return e=tn.get(e),e=nn.get(e),--B,e()}()}catch(t){r=t,e=!0}var i=!1;if(!Zt){var a=an;a&&(an=null,(e?a.reject:a.resolve)(r),i=!0)}if(e&&!i)throw r}}),n=!0,t||(Xt=1,Zt=function(){var e=Si(65548),t=e+12;if((C(),A)[e>>>2>>>0]=t,(C(),A)[e+4>>>2>>>0]=t+65536,t=$t[0],!en.has(t)){var n=rn++;en.set(t,n),tn.set(n,t)}return t=en.get(t),(C(),k)[e+8>>>2>>>0]=t,e}(),typeof MainLoop<`u`&&MainLoop.Xd&&MainLoop.pause(),Jt(()=>Va(Zt)))}else Xt===2?(Xt=0,Jt(Wa),xi(Zt),Zt=null,on.forEach(Rt)):te(`invalid state: ${Xt}`);return Qt}}(t=>{e().then(t)});function cn(e){return e>>>=0,sn(async()=>_t(await gt(e)))}var ln=[],un=e=>{var t=ln.length;return ln.push(e),t},dn=(e,t)=>{for(var n=Array(e),r=0;r>>2>>>0],o=ot[a];if(o===void 0)throw e=`parameter ${r}`,a=_i(a),t=it(a),xi(a),new ct(`${e} has unknown type ${t}`);n[i]=o}return n},fn=(e,t,n)=>{var r=[];return e=e(r,n),r.length&&((C(),A)[t>>>2>>>0]=_t(r)),e},pn={},mn=e=>{var t=pn[e];return t===void 0?it(e):t};function hn(e,t,n){var[r,...i]=dn(e,t>>>0);t=r.Sc.bind(r);var a=i.map(e=>e.Rc.bind(e));e--;var o={toValue:gt};switch(e=a.map((e,t)=>{var n=`argFromPtr${t}`;return o[n]=e,`${n}(args${t?`+`+8*t:``})`}),n){case 0:var s=`toValue(handle)`;break;case 2:s=`new (toValue(handle))`;break;case 3:s=``;break;case 1:o.getStringOrSymbol=mn,s=`toValue(handle)[getStringOrSymbol(methodName)]`}return s+=`(${e})`,r.ee||(o.toReturnWire=t,o.emval_returnValue=fn,s=`return emval_returnValue(toReturnWire, destructorsRef, ${s})`),s=`return function (handle, methodName, destructorsRef, args) { + ${s} + }`,n=Function(Object.keys(o),s)(...Object.values(o)),s=`methodCaller<(${i.map(e=>e.name)}) => ${r.name}>`,un(Object.defineProperty(n,"name",{value:s}))}function gn(e,t){return t>>>=0,(e=gt(e>>>0))==gt(t)}function _n(e){return(e>>>=0)?(e=mn(e),_t(globalThis[e])):_t(globalThis)}function vn(e){return e=mn(e>>>0),_t(t[e])}function yn(e,t){return t>>>=0,e=gt(e>>>0),t=gt(t),_t(e[t])}function bn(e){9<(e>>>=0)&&(mt[e+1]+=1)}function xn(e,t,n,r,i){return ln[e>>>0](t>>>0,n>>>0,r>>>0,i>>>0)}function Sn(e,t,n,r,i){return xn(e>>>0,t>>>0,n>>>0,r>>>0,i>>>0)}function Cn(){return _t([])}function wn(e){e=gt(e>>>0);for(var t=Array(e.length),n=0;n>>0))}function En(){return _t({})}function Dn(e){for(var t=gt(e>>>=0);t.length;){var n=t.pop();t.pop()(n)}ht(e)}function On(e,t,n){t>>>=0,n>>>=0,e=gt(e>>>0),t=gt(t),n=gt(n),e[t]=n}function kn(e,t){e=Ce(e),t>>>=0,e=new Date(1e3*e),(C(),k)[t>>>2>>>0]=e.getUTCSeconds(),(C(),k)[t+4>>>2>>>0]=e.getUTCMinutes(),(C(),k)[t+8>>>2>>>0]=e.getUTCHours(),(C(),k)[t+12>>>2>>>0]=e.getUTCDate(),(C(),k)[t+16>>>2>>>0]=e.getUTCMonth(),(C(),k)[t+20>>>2>>>0]=e.getUTCFullYear()-1900,(C(),k)[t+24>>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,(C(),k)[t+28>>>2>>>0]=e}var An=e=>e%4==0&&(e%100!=0||e%400==0),jn=[0,31,60,91,121,152,182,213,244,274,305,335],Mn=[0,31,59,90,120,151,181,212,243,273,304,334];function Nn(e,t){e=Ce(e),t>>>=0,e=new Date(1e3*e),(C(),k)[t>>>2>>>0]=e.getSeconds(),(C(),k)[t+4>>>2>>>0]=e.getMinutes(),(C(),k)[t+8>>>2>>>0]=e.getHours(),(C(),k)[t+12>>>2>>>0]=e.getDate(),(C(),k)[t+16>>>2>>>0]=e.getMonth(),(C(),k)[t+20>>>2>>>0]=e.getFullYear()-1900,(C(),k)[t+24>>>2>>>0]=e.getDay();var n=(An(e.getFullYear())?jn:Mn)[e.getMonth()]+e.getDate()-1|0;(C(),k)[t+28>>>2>>>0]=n,(C(),k)[t+36>>>2>>>0]=-60*e.getTimezoneOffset(),n=new Date(e.getFullYear(),6,1).getTimezoneOffset();var r=new Date(e.getFullYear(),0,1).getTimezoneOffset();e=0|(n!=r&&e.getTimezoneOffset()==Math.min(r,n)),(C(),k)[t+32>>>2>>>0]=e}function Pn(e){e>>>=0;var t=new Date((C(),k)[e+20>>>2>>>0]+1900,(C(),k)[e+16>>>2>>>0],(C(),k)[e+12>>>2>>>0],(C(),k)[e+8>>>2>>>0],(C(),k)[e+4>>>2>>>0],(C(),k)[e>>>2>>>0],0),n=(C(),k)[e+32>>>2>>>0],r=t.getTimezoneOffset(),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=new Date(t.getFullYear(),0,1).getTimezoneOffset(),o=Math.min(a,i);return 0>n?(C(),k)[e+32>>>2>>>0]=+(i!=a&&o==r):0>>2>>>0]=t.getDay(),n=(An(t.getFullYear())?jn:Mn)[t.getMonth()]+t.getDate()-1|0,(C(),k)[e+28>>>2>>>0]=n,(C(),k)[e>>>2>>>0]=t.getSeconds(),(C(),k)[e+4>>>2>>>0]=t.getMinutes(),(C(),k)[e+8>>>2>>>0]=t.getHours(),(C(),k)[e+12>>>2>>>0]=t.getDate(),(C(),k)[e+16>>>2>>>0]=t.getMonth(),(C(),k)[e+20>>>2>>>0]=t.getYear(),e=t.getTime(),BigInt(isNaN(e)?-1:e/1e3)}function Fn(e,t,n,r,a,o,s){return i?ce(16,1,e,t,n,r,a,o,s):-52}function In(e,t,n,r,a,o){if(i)return ce(17,1,e,t,n,r,a,o)}var Ln={},H=()=>performance.timeOrigin+performance.now();function Rn(e,t){return i?ce(18,1,e,t):(Ln[e]&&(clearTimeout(Ln[e].id),delete Ln[e]),t&&(Ln[e]={id:setTimeout(()=>{delete Ln[e],Rt(()=>Ki(e,performance.timeOrigin+performance.now()))},t),Ae:t}),0)}function zn(e,t,n,r){e>>>=0,t>>>=0,n>>>=0,r>>>=0;var i=new Date().getFullYear(),a=new Date(i,0,1).getTimezoneOffset();i=new Date(i,6,1).getTimezoneOffset();var o=Math.max(a,i);(C(),A)[e>>>2>>>0]=60*o,(C(),k)[t>>>2>>>0]=+(a!=i),e=(t=e=>{var t=Math.abs(e);return`UTC${0<=e?`-`:`+`}${String(Math.floor(t/60)).padStart(2,`0`)}${String(t%60).padStart(2,`0`)}`})(a),t=t(i),iDate.now(),Vn=1;function Hn(e,t,n){if(n>>>=0,!(0<=e&&3>=e))return 28;if(e===0)e=Date.now();else{if(!Vn)return 52;e=performance.timeOrigin+performance.now()}return e=Math.round(1e6*e),(C(),N)[n>>>3>>>0]=BigInt(e),0}var Un=[],Wn=(e,t)=>{Un.length=0;for(var n;n=(C(),E)[e++>>>0];){var r=n!=105;t+=(r&=n!=112)&&t%8?4:0,Un.push(n==112?(C(),A)[t>>>2>>>0]:n==106?(C(),N)[t>>>3>>>0]:n==105?(C(),k)[t>>>2>>>0]:(C(),M)[t>>>3>>>0]),t+=r?8:4}return Un};function Gn(e,t,n){return e>>>=0,t=Wn(t>>>0,n>>>0),qa[e](...t)}function Kn(e,t,n){return e>>>=0,t=Wn(t>>>0,n>>>0),qa[e](...t)}var qn=()=>{};function Jn(e,t){return b(Ue(e>>>0,t>>>0))}var Yn=()=>{throw B+=1,`unwind`};function Xn(){return 4294901760}var Zn=()=>1,Qn=()=>navigator.hardwareConcurrency;function $n(e){e>>>=0;var t=(C(),E).length;if(e<=t||4294901760=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);e:{r=(Math.min(4294901760,65536*Math.ceil(Math.max(e,r)/65536))-ye.buffer.byteLength+65535)/65536|0;try{ye.grow(r),L();var i=1;break e}catch{}i=void 0}if(i)return!0}return!1}var er=e=>{var t=Et(e)+1,n=$i(t);return Tt(e,n,t),n},U=(e,t)=>{(C(),A)[e>>>2>>>0]=t;var n=(C(),A)[e>>>2>>>0];(C(),A)[e+4>>>2>>>0]=(t-n)/4294967296},tr=e=>(C(),A)[e>>>2>>>0]+4294967296*(C(),k)[e+4>>>2>>>0],nr=[],rr=(e,t)=>{nr[e>>>0]=t},ir=[],ar=[],or=(e,t)=>{ar[e]=new Promise(n=>t.finally(()=>n(e)))},sr=e=>{if(e)return nr[e>>>0]},cr=(e,t)=>{for(e=(C(),A)[e>>>2>>>0];e;e=(C(),A)[e>>>2>>>0])t[(C(),k)[e+4>>>2>>>0]](e)},lr=(e,t,n)=>{(C(),A)[e>>>2>>>0]=t,(C(),A)[e+4>>>2>>>0]=n},ur=e=>{var t=(C(),A)[e>>>2>>>0];return e=(C(),A)[e+4>>>2>>>0],Ue(t,e)},dr=e=>{var t=(C(),A)[e>>>2>>>0];return e=(C(),A)[e+4>>>2>>>0],t?Ue(t,e):e===0?``:void 0},fr=e=>{var t=dr(e+4),n=(n=(C(),A)[e+12>>>2>>>0])?sr(n):`auto`;if(e+=16){var r=sr((C(),A)[e+4>>>2>>>0]),i=(C(),A)[e+16>>>2>>>0],a=(C(),A)[e+20>>>2>>>0];if(i){for(var o={},s=0;s>>3>>>0]}i=o}else i=void 0;e={module:r,constants:i,entryPoint:dr(e+8)}}else e=void 0;return{label:t,layout:n,compute:e}},pr=(e,t)=>{function n(n,r){n=e[n],(C(),A)[t+r>>>2>>>0]=n}n(`maxTextureDimension1D`,4),n(`maxTextureDimension2D`,8),n(`maxTextureDimension3D`,12),n(`maxTextureArrayLayers`,16),n(`maxBindGroups`,20),n(`maxBindGroupsPlusVertexBuffers`,24),n(`maxBindingsPerBindGroup`,28),n(`maxDynamicUniformBuffersPerPipelineLayout`,32),n(`maxDynamicStorageBuffersPerPipelineLayout`,36),n(`maxSampledTexturesPerShaderStage`,40),n(`maxSamplersPerShaderStage`,44),n(`maxStorageBuffersPerShaderStage`,48),n(`maxStorageTexturesPerShaderStage`,52),n(`maxUniformBuffersPerShaderStage`,56),n(`minUniformBufferOffsetAlignment`,80),n(`minStorageBufferOffsetAlignment`,84),U(t+64,e.maxUniformBufferBindingSize),U(t+72,e.maxStorageBufferBindingSize),n(`maxVertexBuffers`,88),U(t+96,e.maxBufferSize),n(`maxVertexAttributes`,104),n(`maxVertexBufferArrayStride`,108),n(`maxInterStageShaderVariables`,112),n(`maxColorAttachments`,116),n(`maxColorAttachmentBytesPerSample`,120),n(`maxComputeWorkgroupStorageSize`,124),n(`maxComputeInvocationsPerWorkgroup`,128),n(`maxComputeWorkgroupSizeX`,132),n(`maxComputeWorkgroupSizeY`,136),n(`maxComputeWorkgroupSizeZ`,140),n(`maxComputeWorkgroupsPerDimension`,144),e.ze!==void 0&&n(`maxImmediateSize`,148)},mr=[,`validation`,`out-of-memory`,`internal`],hr=[,`compatibility`,`core`],gr={1:`core-features-and-limits`,2:`depth-clip-control`,3:`depth32float-stencil8`,4:`texture-compression-bc`,5:`texture-compression-bc-sliced-3d`,6:`texture-compression-etc2`,7:`texture-compression-astc`,8:`texture-compression-astc-sliced-3d`,9:`timestamp-query`,10:`indirect-first-instance`,11:`shader-f16`,12:`rg11b10ufloat-renderable`,13:`bgra8unorm-storage`,14:`float32-filterable`,15:`float32-blendable`,16:`clip-distances`,17:`dual-source-blending`,18:`subgroups`,19:`texture-formats-tier1`,20:`texture-formats-tier2`,21:`primitive-index`,22:`texture-component-swizzle`,327692:`chromium-experimental-unorm16-texture-formats`,327729:`chromium-experimental-multi-draw-indirect`},_r=[,`low-power`,`high-performance`],vr=[,`occlusion`,`timestamp`],yr={undefined:1,unknown:1,destroyed:2};function br(e,t,n,r,i,a){t=Ce(t),n=Ce(n),r>>>=0,i>>>=0,a>>>=0;var o=sr(e>>>0);if(e={},a){var s=(C(),A)[a+12>>>2>>>0];if(s){var c=(C(),A)[a+16>>>2>>>0];e.requiredFeatures=Array.from((C(),A).subarray(c>>>2>>>0,c+4*s>>>2>>>0),e=>gr[e])}var l=(C(),A)[a+20>>>2>>>0];if(l){let t=function(e,t,n=!1){t=l+t,(t=(C(),A)[t>>>2>>>0])==4294967295||n&&t==0||(u[e]=t)},n=function(e,t){t=l+t;var n=(C(),A)[t>>>2>>>0],r=(C(),A)[t+4>>>2>>>0];n==4294967295&&r==4294967295||(u[e]=tr(t))};var u={};t(`maxTextureDimension1D`,4),t(`maxTextureDimension2D`,8),t(`maxTextureDimension3D`,12),t(`maxTextureArrayLayers`,16),t(`maxBindGroups`,20),t(`maxBindGroupsPlusVertexBuffers`,24),t(`maxDynamicUniformBuffersPerPipelineLayout`,32),t(`maxDynamicStorageBuffersPerPipelineLayout`,36),t(`maxSampledTexturesPerShaderStage`,40),t(`maxSamplersPerShaderStage`,44),t(`maxStorageBuffersPerShaderStage`,48),t(`maxStorageTexturesPerShaderStage`,52),t(`maxUniformBuffersPerShaderStage`,56),t(`minUniformBufferOffsetAlignment`,80),t(`minStorageBufferOffsetAlignment`,84),n(`maxUniformBufferBindingSize`,64),n(`maxStorageBufferBindingSize`,72),t(`maxVertexBuffers`,88),n(`maxBufferSize`,96),t(`maxVertexAttributes`,104),t(`maxVertexBufferArrayStride`,108),t(`maxInterStageShaderVariables`,112),t(`maxColorAttachments`,116),t(`maxColorAttachmentBytesPerSample`,120),t(`maxComputeWorkgroupStorageSize`,124),t(`maxComputeInvocationsPerWorkgroup`,128),t(`maxComputeWorkgroupSizeX`,132),t(`maxComputeWorkgroupSizeY`,136),t(`maxComputeWorkgroupSizeZ`,140),t(`maxComputeWorkgroupsPerDimension`,144),t(`maxImmediateSize`,148,!0),e.requiredLimits=u}(s=(C(),A)[a+24>>>2>>>0])&&(s={label:dr(s+4)},e.defaultQueue=s),e.label=dr(a+4)}B+=1,or(t,o.requestDevice(e).then(e=>{--B,Rt(()=>{nr[i>>>0]=e.queue,nr[r>>>0]=e,B+=1,or(n,e.lost.then(t=>{Rt(()=>{e.onuncapturederror=()=>{};var r=ea(),i=er(t.message);Fi(n,yr[t.reason],i),Qi(r)}),--B})),e.onuncapturederror=e=>{var t=5;e.error instanceof GPUValidationError?t=2:e.error instanceof GPUOutOfMemoryError?t=3:e.error instanceof GPUInternalError&&(t=4);var n=ea();e=er(e.error.message),Bi(r,t,e),Qi(n)},`adapterInfo`in e||(e.adapterInfo=o.info),zi(t,1,r,0)})},e=>{--B,Rt(()=>{var i=ea(),a=er(e.message);zi(t,3,r,a),n&&Fi(n,4,a),Qi(i)})}))}function xr(e){var t=sr(e>>>=0),n=ir[e];if(n){for(var r=0;r>>=0;var r=sr(e>>>=0);n==4294967295&&(n=void 0);try{var i=r.getMappedRange(t>>>0,n)}catch{return 0}var a=Ji(16,i.byteLength);return(C(),E).set(new Uint8Array(i),a>>>0),ir[e].push(()=>xi(a)),a}function Cr(e,t,n){n>>>=0;var r=sr(e>>>=0);n==4294967295&&(n=void 0);try{var i=r.getMappedRange(t>>>0,n)}catch{return 0}var a=Ji(16,i.byteLength);return(C(),E).fill(0,a,i.byteLength),ir[e].push(()=>{new Uint8Array(i).set((C(),E).subarray(a>>>0,a+i.byteLength>>>0)),xi(a)}),a}function wr(e,t,n,r,i){e>>>=0,t=Ce(t),n=Ce(n),i>>>=0;var a=sr(e);ir[e]=[],i==4294967295&&(i=void 0),B+=1,or(t,a.mapAsync(n,r>>>0,i).then(()=>{--B,Rt(()=>{Ii(t,1,0)})},n=>{--B,Rt(()=>{ea();var r=er(n.message);Ii(t,n.name===`AbortError`?4:n.name===`OperationError`?3:0,r),delete ir[e]})}))}function Tr(e){var t=sr(e>>>=0),n=ir[e];if(n){for(var r=0;r>>0]}function Dr(e,t,n){e>>>=0,t>>>=0,n>>>=0;var r=!!(C(),A)[t+32>>>2>>>0];t={label:dr(t+4),usage:(C(),A)[t+16>>>2>>>0],size:tr(t+24),mappedAtCreation:r},e=sr(e);try{var i=e.createBuffer(t)}catch{return!1}return nr[n>>>0]=i,r&&(ir[n]=[]),!0}function Or(e,t,n,r){e>>>=0,t=Ce(t),r>>>=0,n=fr(n>>>0),e=sr(e),B+=1,or(t,e.createComputePipelineAsync(n).then(e=>{--B,Rt(()=>{nr[r>>>0]=e,Pi(t,1,r,0)})},e=>{--B,Rt(()=>{var n=ea(),i=er(e.message);Pi(t,e.reason===`validation`?3:e.reason===`internal`?4:0,r,i),Qi(n)})}))}function kr(e,t,n){e>>>=0,t>>>=0,n>>>=0;var r=(C(),A)[t>>>2>>>0],i=(C(),k)[r+4>>>2>>>0];t={label:dr(t+4),code:``},i===2&&(t.code=ur(r+8)),e=sr(e).createShaderModule(t),nr[n>>>0]=e}var Ar=e=>{(e=sr(e)).onuncapturederror=null,e.destroy()};function jr(e,t){t=Ce(t),e=sr(e>>>0),B+=1,or(t,e.popErrorScope().then(e=>{--B,Rt(()=>{var n=5;e?e instanceof GPUValidationError?n=2:e instanceof GPUOutOfMemoryError?n=3:e instanceof GPUInternalError&&(n=4):n=1;var r=ea(),i=e?er(e.message):0;Li(t,1,n,i),Qi(r)})},e=>{--B,Rt(()=>{var n=ea(),r=er(e.message);Li(t,1,5,r),Qi(n)})}))}function Mr(e,t,n,r){if(t=Ce(t),r>>>=0,n>>>=0){var i={featureLevel:hr[(C(),k)[n+4>>>2>>>0]],powerPreference:_r[(C(),k)[n+8>>>2>>>0]],forceFallbackAdapter:!!(C(),A)[n+12>>>2>>>0]};(e=(C(),A)[n>>>2>>>0])!==0&&(C(),i.De=!!(C(),A)[e+8>>>2>>>0])}`gpu`in navigator?(B+=1,or(t,navigator.gpu.requestAdapter(i).then(e=>{--B,Rt(()=>{if(e)nr[r>>>0]=e,Ri(t,1,r,0);else{var n=ea(),i=er(`WebGPU not available on this browser (requestAdapter returned null)`);Ri(t,3,r,i),Qi(n)}})},e=>{--B,Rt(()=>{var n=ea(),i=er(e.message);Ri(t,4,r,i),Qi(n)})}))):(i=ea(),e=er(`WebGPU not available on this browser (navigator.gpu is not available)`),Ri(t,3,r,e),Qi(i))}function Nr(e,t,n){return e>>>=0,t>>>=0,n>>>=0,sn(async()=>{var r=[];if(n){var i=(C(),k)[n>>>2>>>0];r.length=t+1,r[t]=new Promise(e=>setTimeout(e,i,0))}else r.length=t;for(var a=0;a{if(!Pr){var e,t={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(globalThis.navigator?.language??`C`).replace(`-`,`_`)+`.UTF-8`,_:`./this.program`};for(e in Fr)Fr[e]===void 0?delete t[e]:t[e]=Fr[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);Pr=n}return Pr};function Lr(e,t){if(i)return ce(19,1,e,t);e>>>=0,t>>>=0;var n,r=0,a=0;for(n of Ir()){var o=t+r;(C(),A)[e+a>>>2>>>0]=o,r+=Tt(n,o,1/0)+1,a+=4}return 0}function Rr(e,t){if(i)return ce(20,1,e,t);e>>>=0,t>>>=0;var n=Ir();for(var r of((C(),A)[e>>>2>>>0]=n.length,e=0,n))e+=Et(r)+1;return(C(),A)[t>>>2>>>0]=e,0}function zr(e){return i?ce(21,1,e):52}function Br(e,t,n,r){return i?ce(22,1,e,t,n,r):52}function Vr(e,t,n,r){return i?ce(23,1,e,t,n,r):70}var Hr=[null,[],[]];function Ur(e,t,n,r){if(i)return ce(24,1,e,t,n,r);t>>>=0,n>>>=0,r>>>=0;for(var a=0,o=0;o>>2>>>0],c=(C(),A)[t+4>>>2>>>0];t+=8;for(var l=0;l>>0],f=Hr[u];d===0||d===10?((u===1?y:b)(He(f)),f.length=0):f.push(d)}a+=c}return(C(),A)[r>>>2>>>0]=a,0}function Wr(e){return e>>>0}function Gr(e,t){return pr(sr(e>>>0).limits,t>>>0),1}function Kr(e,t){return sr(e>>>0).features.has(gr[t])}function qr(e){return BigInt(sr(e>>>0).size)}function Jr(e){return BigInt(sr(e>>>0).usage)}function Yr(e,t){if(e>>>=0,t>>>=0){var n=dr(t+4);n={label:n,timestampWrites:t=(t=(C(),A)[t+12>>>2>>>0])===0?void 0:{querySet:sr((C(),A)[t+4>>>2>>>0]),beginningOfPassWriteIndex:(C(),A)[t+8>>>2>>>0],endOfPassWriteIndex:(C(),A)[t+12>>>2>>>0]}}}return t=sr(e),e=ki(0),n=t.beginComputePass(n),nr[e>>>0]=n,e}function Xr(e,t,n,r){n=Ce(n),(r=Ce(r))==-1&&(r=void 0),(e=sr(e>>>0)).clearBuffer(sr(t>>>0),n,r)}function Zr(e,t,n,r,i,a){n=Ce(n),i=Ce(i),a=Ce(a),sr(e>>>0).copyBufferToBuffer(sr(t>>>0),n,sr(r>>>0),i,a)}function Qr(e){var t=sr(e>>>0);return e=Di(0),t=t.finish(),nr[e>>>0]=t,e}function $r(e,t,n,r,i,a){a=Ce(a),sr(e>>>0).resolveQuerySet(sr(t>>>0),n,r,sr(i>>>0),a)}function ei(e,t,n,r){sr(e>>>0).dispatchWorkgroups(t,n,r)}function ti(e,t,n){n=Ce(n),sr(e>>>0).dispatchWorkgroupsIndirect(sr(t>>>0),n)}function ni(e){sr(e>>>0).end()}function ri(e,t,n,r,i){r>>>=0,i>>>=0,e=sr(e>>>0),n=sr(n>>>0),r==0?e.setBindGroup(t,n):e.setBindGroup(t,n,(C(),A),i>>>2,r)}function ii(e,t){sr(e>>>0).setPipeline(sr(t>>>0))}function ai(e,t,n){sr(e>>>0).Ce(sr(t>>>0),n)}function oi(e,t){var n=sr(e>>>0);return e=Ei(0),t=n.getBindGroupLayout(t),nr[e>>>0]=t,e}function si(e,t){function n(e){var t=(C(),A)[e+8>>>2>>>0],n=(C(),A)[e+32>>>2>>>0],r=(C(),A)[e+36>>>2>>>0],i=0;return cr(e,{327681:e=>{i=(C(),A)[e+8>>>2>>>0]}}),t?((n=tr(e+24))==-1&&(n=void 0),t={buffer:sr(t),offset:tr(e+16),size:n}):t=sr(n||r||i),{binding:(C(),A)[e+4>>>2>>>0],resource:t}}e>>>=0,t={label:dr(4+(t>>>=0)),layout:sr((C(),A)[t+12>>>2>>>0]),entries:function(e,t){for(var r=[],i=0;i>>2>>>0],(C(),A)[t+20>>>2>>>0])},e=sr(e);var r=Ti(0);return rr(r,e.createBindGroup(t)),r}function ci(e,t){var n;return e>>>=0,(t>>>=0)&&(n={label:dr(t+4)}),t=sr(e),e=Oi(0),n=t.createCommandEncoder(n),nr[e>>>0]=n,e}function li(e,t){e>>>=0,t>>>=0,t={type:vr[(C(),k)[t+12>>>2>>>0]],count:(C(),A)[t+16>>>2>>>0]};var n=sr(e);return e=Ai(0),t=n.createQuerySet(t),nr[e>>>0]=t,e}function ui(e,t){e=sr(e>>>0).adapterInfo,t>>>=0,(C(),A)[t+52>>>2>>>0]=e.subgroupMinSize,(C(),A)[t+56>>>2>>>0]=e.subgroupMaxSize;var n=e.vendor+e.architecture+e.device+e.description,r=Et(n)+1,i=Si(r);return i&&Tt(n,i,r),n=i,r=Et(e.vendor),lr(t+4,n,r),n+=r,r=Et(e.architecture),lr(t+12,n,r),n+=r,r=Et(e.device),lr(t+20,n,r),lr(t+28,n+r,Et(e.description)),(C(),k)[t+36>>>2>>>0]=2,e=e.isFallbackAdapter?3:4,(C(),k)[t+40>>>2>>>0]=e,(C(),A)[t+44>>>2>>>0]=0,(C(),A)[t+48>>>2>>>0]=0,1}var di={"core-features-and-limits":1,"depth-clip-control":2,"depth32float-stencil8":3,"texture-compression-bc":4,"texture-compression-bc-sliced-3d":5,"texture-compression-etc2":6,"texture-compression-astc":7,"texture-compression-astc-sliced-3d":8,"timestamp-query":9,"indirect-first-instance":10,"shader-f16":11,"rg11b10ufloat-renderable":12,"bgra8unorm-storage":13,"float32-filterable":14,"float32-blendable":15,"clip-distances":16,"dual-source-blending":17,subgroups:18,"texture-formats-tier1":19,"texture-formats-tier2":20,"primitive-index":21,"texture-component-swizzle":22,"chromium-experimental-unorm16-texture-formats":327692,"chromium-experimental-multi-draw-indirect":327729};function fi(e,t){t>>>=0;var n=sr(e>>>0);e=Si(4*n.features.size);var r=0,i=0;for(let t of n.features)0<=(n=di[t])&&((C(),k)[e+r>>>2>>>0]=n,r+=4,i++);(C(),A)[t+4>>>2>>>0]=e,(C(),A)[t>>>2>>>0]=i}function pi(e,t){return pr(sr(e>>>0).limits,t>>>0),1}function mi(e,t){sr(e>>>0).pushErrorScope(mr[t])}function hi(e,t,n){t>>>=0,n>>>=0,e=sr(e>>>0),t=Array.from((C(),k).subarray(n>>>2>>>0,n+4*t>>>2>>>0),e=>sr(e)),e.submit(t)}function gi(e,t,n,r,i){n=Ce(n),r>>>=0,i>>>=0,e=sr(e>>>0),t=sr(t>>>0),r=(C(),E).subarray(r>>>0,r+i>>>0),e.writeBuffer(t,n,r,0,i)}i||function(){for(var e=t.numThreads-1;e--;)ve();ae.push(async()=>{var e=async function(){if(!i)return Promise.all(fe.map(_e))}();z++,await e,--z==0&&oe&&(e=oe,oe=null,e())})}(),i||(ye=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),L()),t.wasmBinary&&(d=t.wasmBinary),t.stackSave=()=>ea(),t.stackRestore=e=>Qi(e),t.stackAlloc=e=>$i(e),t.setValue=function(e,t,n=`i8`){switch(n.endsWith(`*`)&&(n=`*`),n){case`i1`:case`i8`:(C(),T)[e>>>0]=t;break;case`i16`:(C(),D)[e>>>1>>>0]=t;break;case`i32`:(C(),k)[e>>>2>>>0]=t;break;case`i64`:(C(),N)[e>>>3>>>0]=BigInt(t);break;case`float`:(C(),j)[e>>>2>>>0]=t;break;case`double`:(C(),M)[e>>>3>>>0]=t;break;case`*`:(C(),A)[e>>>2>>>0]=t;break;default:te(`invalid type for setValue: ${n}`)}},t.getValue=function(e,t=`i8`){switch(t.endsWith(`*`)&&(t=`*`),t){case`i1`:case`i8`:return(C(),T)[e>>>0];case`i16`:return(C(),D)[e>>>1>>>0];case`i32`:return(C(),k)[e>>>2>>>0];case`i64`:return(C(),N)[e>>>3>>>0];case`float`:return(C(),j)[e>>>2>>>0];case`double`:return(C(),M)[e>>>3>>>0];case`*`:return(C(),A)[e>>>2>>>0];default:te(`invalid type for getValue: ${t}`)}},t.UTF8ToString=Ue,t.stringToUTF8=Tt,t.lengthBytesUTF8=Et;var _i,vi,yi,bi,xi,Si,Ci,wi,Ti,Ei,Di,Oi,ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa,Ga,Ka=[le,ue,Le,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,Fn,In,Rn,Lr,Rr,zr,Br,Vr,Ur],qa={970348:(e,n,r,i,a)=>{if(t===void 0||!t.Uc)return 1;if((e=Ue(Number(e>>>0))).startsWith(`./`)&&(e=e.substring(2)),!(e=t.Uc.get(e)))return 2;if(n=Number(n>>>0),r=Number(r>>>0),i=Number(i>>>0),n+r>e.byteLength)return 3;try{let o=e.subarray(n,n+r);switch(a){case 0:(C(),E).set(o,i>>>0);break;case 1:t.ad?t.ad(i,o):t.ne(i,o);break;default:return 4}return 0}catch{return 4}},971172:(e,n,r)=>{t.Sd(e,(C(),E).subarray(n>>>0,n+r>>>0))},971236:()=>t.le(),971278:e=>{t.jd(e)},971315:()=>typeof wasmOffsetConverter<`u`};function Ja(e,t,n,r){var i=ea();try{return ma(e,t,n,r)}catch(e){if(Qi(i),e!==e+0)throw e;Yi(1,0)}}function Ya(e,t,n){var r=ea();try{return da(e,t,n)}catch(e){if(Qi(r),e!==e+0)throw e;Yi(1,0)}}function Xa(e){var t=ea();try{sa(e)}catch(e){if(Qi(t),e!==e+0)throw e;Yi(1,0)}}function Za(e,t){var n=ea();try{return oa(e,t)}catch(e){if(Qi(n),e!==e+0)throw e;Yi(1,0)}}function Qa(e,t,n){var r=ea();try{aa(e,t,n)}catch(e){if(Qi(r),e!==e+0)throw e;Yi(1,0)}}function $a(e,t){var n=ea();try{ha(e,t)}catch(e){if(Qi(n),e!==e+0)throw e;Yi(1,0)}}function eo(e,t,n,r,i,a,o){var s=ea();try{return ua(e,t,n,r,i,a,o)}catch(e){if(Qi(s),e!==e+0)throw e;Yi(1,0)}}function to(e,t,n,r,i,a){var o=ea();try{ca(e,t,n,r,i,a)}catch(e){if(Qi(o),e!==e+0)throw e;Yi(1,0)}}function no(e,t,n,r){var i=ea();try{pa(e,t,n,r)}catch(e){if(Qi(i),e!==e+0)throw e;Yi(1,0)}}function ro(e,t,n,r,i,a,o){var s=ea();try{_a(e,t,n,r,i,a,o)}catch(e){if(Qi(s),e!==e+0)throw e;Yi(1,0)}}function io(e,t,n,r,i,a,o){var s=ea();try{va(e,t,n,r,i,a,o)}catch(e){if(Qi(s),e!==e+0)throw e;Yi(1,0)}}function W(e,t,n,r,i,a,o,s){var c=ea();try{Da(e,t,n,r,i,a,o,s)}catch(e){if(Qi(c),e!==e+0)throw e;Yi(1,0)}}function ao(e,t,n,r,i,a,o,s,c,l,u,d){var f=ea();try{ya(e,t,n,r,i,a,o,s,c,l,u,d)}catch(e){if(Qi(f),e!==e+0)throw e;Yi(1,0)}}function oo(e,t,n,r,i){var a=ea();try{return ga(e,t,n,r,i)}catch(e){if(Qi(a),e!==e+0)throw e;Yi(1,0)}}function so(e,t,n,r,i){var a=ea();try{la(e,t,n,r,i)}catch(e){if(Qi(a),e!==e+0)throw e;Yi(1,0)}}function co(e,t,n,r,i,a,o,s){var c=ea();try{fa(e,t,n,r,i,a,o,s)}catch(e){if(Qi(c),e!==e+0)throw e;Yi(1,0)}}function lo(e){var t=ea();try{return Oa(e)}catch(e){if(Qi(t),e!==e+0)throw e;Yi(1,0)}}function uo(e,t,n){var r=ea();try{return ka(e,t,n)}catch(e){if(Qi(r),e!==e+0)throw e;Yi(1,0)}}function fo(e,t){var n=ea();try{return Ba(e,t)}catch(e){if(Qi(n),e!==e+0)throw e;return Yi(1,0),0n}}function po(e){var t=ea();try{return ba(e)}catch(e){if(Qi(t),e!==e+0)throw e;return Yi(1,0),0n}}function mo(e,t,n,r){var i=ea();try{return Aa(e,t,n,r)}catch(e){if(Qi(i),e!==e+0)throw e;Yi(1,0)}}function ho(e,t,n,r,i){var a=ea();try{return ja(e,t,n,r,i)}catch(e){if(Qi(a),e!==e+0)throw e;Yi(1,0)}}function go(e,t,n,r,i,a){var o=ea();try{return Ma(e,t,n,r,i,a)}catch(e){if(Qi(o),e!==e+0)throw e;Yi(1,0)}}function _o(e,t,n,r,i,a){var o=ea();try{return Ta(e,t,n,r,i,a)}catch(e){if(Qi(o),e!==e+0)throw e;Yi(1,0)}}function vo(e,t,n,r,i,a){var o=ea();try{return Na(e,t,n,r,i,a)}catch(e){if(Qi(o),e!==e+0)throw e;Yi(1,0)}}function yo(e,t,n,r,i,a,o,s){var c=ea();try{return Ea(e,t,n,r,i,a,o,s)}catch(e){if(Qi(c),e!==e+0)throw e;Yi(1,0)}}function bo(e,t,n,r,i){var a=ea();try{return Pa(e,t,n,r,i)}catch(e){if(Qi(a),e!==e+0)throw e;return Yi(1,0),0n}}function xo(e,t,n,r){var i=ea();try{return Fa(e,t,n,r)}catch(e){if(Qi(i),e!==e+0)throw e;Yi(1,0)}}function So(e,t,n,r){var i=ea();try{return Ia(e,t,n,r)}catch(e){if(Qi(i),e!==e+0)throw e;Yi(1,0)}}function Co(e,t,n,r,i,a,o,s,c,l,u,d){var f=ea();try{return La(e,t,n,r,i,a,o,s,c,l,u,d)}catch(e){if(Qi(f),e!==e+0)throw e;Yi(1,0)}}function wo(e,t,n,r,i,a,o,s,c,l,u){var d=ea();try{Ra(e,t,n,r,i,a,o,s,c,l,u)}catch(e){if(Qi(d),e!==e+0)throw e;Yi(1,0)}}function To(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g=ea();try{za(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}catch(e){if(Qi(g),e!==e+0)throw e;Yi(1,0)}}function Eo(e,t,n){var r=ea();try{return Sa(e,t,n)}catch(e){if(Qi(r),e!==e+0)throw e;return Yi(1,0),0n}}function Do(e,t,n){var r=ea();try{return xa(e,t,n)}catch(e){if(Qi(r),e!==e+0)throw e;Yi(1,0)}}function Oo(e,t,n){var r=ea();try{return Ca(e,t,n)}catch(e){if(Qi(r),e!==e+0)throw e;Yi(1,0)}}function ko(e,t,n,r){var i=ea();try{wa(e,t,n,r)}catch(e){if(Qi(i),e!==e+0)throw e;Yi(1,0)}}function Ao(){if(0{let n=new WeakMap,r,i,a=1;t.webgpuRegisterDevice=e=>{if(i!==void 0)throw Error(`another WebGPU EP inference session is being created.`);if(e){var t=n.get(e);if(!t){let r=((e,t=0)=>{var n=Ni(t);return t=Mi(t,n),nr[n>>>0]=e.queue,nr[t>>>0]=e,t})(e,t=wi(0));t=[a++,t,r],n.set(e,t)}return r=e,i=t[0],t}r=void 0,i=0};let o=new Map;t.webgpuOnCreateSession=t=>{if(i!==void 0){var n=i;if(i=void 0,t){let i=yi(n);o.set(t,i),n===0&&e(r??sr(i))}r=void 0}},t.webgpuOnReleaseSession=e=>{o.delete(e)};let s=Symbol(`gpuBufferMetadata`);t.webgpuRegisterBuffer=(e,t,n)=>{if(n)return e[s]=[n,NaN],n;if(n=e[s])return n[1]++,n[0];if((t=o.get(t))===void 0)throw Error(`Invalid session handle passed to webgpuRegisterBuffer`);return t=((e,t=0)=>(e.mapState===`unmapped`||te(),t=ji(t),nr[t>>>0]=e,t))(e,t),e[s]=[t,1],t},t.webgpuUnregisterBuffer=e=>{let t=e[s];if(!t)throw Error(`Buffer is not registered`);t[1]--,t[1]===0&&(Ci(t[0]),delete e[s])},t.webgpuGetBuffer=e=>sr(e),t.webgpuCreateDownloader=(e,t,n)=>{if((n=o.get(n))===void 0)throw Error(`Invalid session handle passed to webgpuRegisterBuffer`);let r=sr(n),i=16*Math.ceil(Number(t)/16);return async()=>{let n=r.createBuffer({size:i,usage:9});try{let a=r.createCommandEncoder();return a.copyBufferToBuffer(e,0,n,0,i),r.queue.submit([a.finish()]),await n.mapAsync(GPUMapMode.READ),n.getMappedRange().slice(0,t)}finally{n.destroy()}}},t.ad=(e,t)=>{var n=t.buffer;let a=t.byteOffset,o=t.byteLength;if(t=16*Math.ceil(Number(o)/16),e=sr(e),!r){var s=yi(i);r=sr(s)}let c=(s=r.createBuffer({mappedAtCreation:!0,size:t,usage:6})).getMappedRange();new Uint8Array(c).set(new Uint8Array(n,a,o)),s.unmap(),(n=r.createCommandEncoder()).copyBufferToBuffer(s,0,e,0,t),r.queue.submit([n.finish()]),s.destroy()}},t.webnnInit=e=>{let n=e[0];[t.le,t.jd,t.webnnEnsureTensor,t.Sd,t.webnnDownloadTensor,t.ke,t.webnnEnableTraceEvent]=e.slice(1),t.webnnReleaseTensorId=t.jd,t.webnnUploadTensor=t.Sd,t.webnnRegisterMLContext=t.ke,t.webnnOnRunStart=e=>n.onRunStart(e),t.webnnOnRunEnd=n.onRunEnd.bind(n),t.webnnOnReleaseSession=e=>{n.onReleaseSession(e)},t.webnnCreateMLTensorDownloader=(e,t)=>n.createMLTensorDownloader(e,t),t.webnnRegisterMLTensor=(e,t,r,i)=>n.registerMLTensor(e,t,r,i),t.webnnCreateMLContext=e=>n.createMLContext(e),t.webnnRegisterMLConstant=(e,r,i,a,o,s)=>n.registerMLConstant(e,r,i,a,o,t.Uc,s),t.webnnRegisterGraphInput=n.registerGraphInput.bind(n),t.webnnIsGraphInput=n.isGraphInput.bind(n),t.webnnRegisterGraphOutput=n.registerGraphOutput.bind(n),t.webnnIsGraphOutput=n.isGraphOutput.bind(n),t.webnnCreateTemporaryTensor=n.createTemporaryTensor.bind(n),t.webnnIsGraphInputOutputTypeSupported=n.isGraphInputOutputTypeSupported.bind(n)},I?t:new Promise((e,t)=>{m=e,h=t})}var ze,Be,Ve=g(()=>{"use strict";ze=Re,Be=globalThis.self?.name?.startsWith(`em-pthread`),Be&&Re()}),He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt=g(()=>{"use strict";je(),He=typeof location>`u`?void 0:location.origin,Ue=self.location.href>`file:`&&self.location.href<`file;`,We=()=>Ue?new URL(new URL(`ort.webgpu.bundle.min.mjs`,self.location.href).href,He).href:self.location.href,Ge=We(),Ke=()=>{if(Ge&&!Ge.startsWith(`blob:`))return Ge.substring(0,Ge.lastIndexOf(`/`)+1)},qe=(e,t)=>{try{let n=t??Ge;return(n?new URL(e,n):new URL(e)).origin===He}catch{return!1}},Je=(e,t)=>{let n=t??Ge;try{return(n?new URL(e,n):new URL(e)).href}catch{return}},Ye=(e,t)=>`${t??`./`}${e}`,Xe=async e=>{let t=await(await fetch(e,{credentials:`same-origin`})).blob();return URL.createObjectURL(t)},Ze=async e=>(await import(e)).default,Qe=(Ie(),y(Me)).default,$e=async()=>{if(!Ge)throw Error(`Failed to load proxy worker: cannot determine the script source URL.`);if(qe(Ge))return[void 0,Qe()];let e=await Xe(Ge);return[e,Qe(e)]},et=(Ve(),y(Le)).default,tt=async(e,t,n,r)=>{let i=et&&!(e||t);if(i)if(Ge)i=qe(Ge)||r&&!n;else if(r&&!n)i=!0;else throw Error(`cannot determine the script source URL.`);if(i)return[void 0,et];{let r=`ort-wasm-simd-threaded.asyncify.mjs`,i=e??Je(r,t),a=n&&i&&!qe(i,t),o=a?await Xe(i):i??Ye(r,t);return[a?o:void 0,await Ze(o)]}}}),rt,it,at,ot,st,ct,lt,ut,dt,ft=g(()=>{"use strict";nt(),it=!1,at=!1,ot=!1,st=()=>{if(typeof SharedArrayBuffer>`u`)return!1;try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch{return!1}},ct=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}},lt=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},ut=async e=>{if(it)return Promise.resolve();if(at)throw Error(`multiple calls to 'initializeWebAssembly()' detected.`);if(ot)throw Error(`previous call to 'initializeWebAssembly()' failed.`);at=!0;let t=e.initTimeout,n=e.numThreads;if(e.simd!==!1){if(e.simd===`relaxed`){if(!lt())throw Error(`Relaxed WebAssembly SIMD is not supported in the current environment.`)}else if(!ct())throw Error(`WebAssembly SIMD is not supported in the current environment.`)}let r=st();n>1&&!r&&(typeof self<`u`&&!self.crossOriginIsolated&&console.warn(`env.wasm.numThreads is set to `+n+`, but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info.`),console.warn(`WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading.`),e.numThreads=n=1);let i=e.wasmPaths,a=typeof i==`string`?i:void 0,o=i?.mjs,s=o?.href??o,c=i?.wasm,l=c?.href??c,u=e.wasmBinary,[d,f]=await tt(s,a,n>1,!!u||!!l),p=!1,m=[];if(t>0&&m.push(new Promise(e=>{setTimeout(()=>{p=!0,e()},t)})),m.push(new Promise((e,t)=>{let r={numThreads:n};if(u)r.wasmBinary=u,r.locateFile=e=>e;else if(l||a)r.locateFile=e=>l??a+e;else if(s&&s.indexOf(`blob:`)!==0)r.locateFile=e=>new URL(e,s).href;else if(d){let e=Ke();e&&(r.locateFile=t=>e+t)}f(r).then(t=>{at=!1,it=!0,rt=t,e(),d&&URL.revokeObjectURL(d)},e=>{at=!1,ot=!0,t(e)})})),await Promise.race(m),p)throw Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},dt=()=>{if(it&&rt)return rt;throw Error(`WebAssembly is not initialized yet.`)}}),pt,mt,ht,gt=g(()=>{"use strict";ft(),pt=(e,t)=>{let n=dt(),r=n.lengthBytesUTF8(e)+1,i=n._malloc(r);return n.stringToUTF8(e,i,r),t.push(i),i},mt=(e,t,n,r)=>{if(typeof e==`object`&&e){if(n.has(e))throw Error(`Circular reference in options`);n.add(e)}Object.entries(e).forEach(([e,i])=>{let a=t?t+e:e;if(typeof i==`object`)mt(i,a+`.`,n,r);else if(typeof i==`string`||typeof i==`number`)r(a,i.toString());else if(typeof i==`boolean`)r(a,i?`1`:`0`);else throw Error(`Can't handle extra config type: ${typeof i}`)})},ht=e=>{let t=dt(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetLastError(r,r+n);let i=Number(t.getValue(r,n===4?`i32`:`i64`)),a=t.getValue(r+n,`*`),o=a?t.UTF8ToString(a):``;throw Error(`${e} ERROR_CODE: ${i}, ERROR_MESSAGE: ${o}`)}finally{t.stackRestore(n)}}}),_t,vt=g(()=>{"use strict";ft(),gt(),_t=e=>{let t=dt(),n=0,r=[],i=e||{};try{if(e?.logSeverityLevel===void 0)i.logSeverityLevel=2;else if(typeof e.logSeverityLevel!=`number`||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw Error(`log severity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)i.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!=`number`||!Number.isInteger(e.logVerbosityLevel))throw Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&(i.terminate=!1);let a=0;return e?.tag!==void 0&&(a=pt(e.tag,r)),n=t._OrtCreateRunOptions(i.logSeverityLevel,i.logVerbosityLevel,!!i.terminate,a),n===0&&ht(`Can't create run options.`),e?.extra!==void 0&&mt(e.extra,``,new WeakSet,(e,i)=>{let a=pt(e,r),o=pt(i,r);t._OrtAddRunConfigEntry(n,a,o)!==0&&ht(`Can't set a run config entry: ${e} - ${i}.`)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseRunOptions(n),r.forEach(e=>t._free(e)),e}}}),yt,bt,xt,St,Ct,wt,Tt,Et=g(()=>{"use strict";ft(),gt(),yt=e=>{switch(e){case`disabled`:return 0;case`basic`:return 1;case`extended`:return 2;case`layout`:return 3;case`all`:return 99;default:throw Error(`unsupported graph optimization level: ${e}`)}},bt=e=>{switch(e){case`sequential`:return 0;case`parallel`:return 1;default:throw Error(`unsupported execution mode: ${e}`)}},xt=e=>{e.extra||={},e.extra.session||(e.extra.session={});let t=e.extra.session;t.use_ort_model_bytes_directly||=`1`,e.executionProviders&&e.executionProviders.some(e=>(typeof e==`string`?e:e.name)===`webgpu`)&&(e.enableMemPattern=!1)},St=(e,t,n,r)=>{let i=pt(t,r),a=pt(n,r);dt()._OrtAddSessionConfigEntry(e,i,a)!==0&&ht(`Can't set a session config entry: ${t} - ${n}.`)},Ct=(e,t,n,r)=>{let i=pt(t,r),a=pt(n,r);e.push([i,a])},wt=async(e,t,n)=>{let r=t.executionProviders;for(let i of r){let r=typeof i==`string`?i:i.name,a=[];switch(r){case`webnn`:if(r=`WEBNN`,typeof i!=`string`){let t=i?.deviceType;t&&St(e,`deviceType`,t,n)}break;case`webgpu`:{r=`WebGPU`;let e;if(typeof i!=`string`){let r=i;if(r.device)if(typeof GPUDevice<`u`&&r.device instanceof GPUDevice)e=r.device;else throw Error(`Invalid GPU device set in WebGPU EP options.`);let{enableGraphCapture:o}=t;if(typeof o==`boolean`&&o&&Ct(a,`enableGraphCapture`,`1`,n),typeof r.preferredLayout==`string`&&Ct(a,`preferredLayout`,r.preferredLayout,n),r.forceCpuNodeNames){let e=Array.isArray(r.forceCpuNodeNames)?r.forceCpuNodeNames:[r.forceCpuNodeNames];Ct(a,`forceCpuNodeNames`,e.join(` +`),n)}r.validationMode&&Ct(a,`validationMode`,r.validationMode,n)}let o=dt().webgpuRegisterDevice(e);if(o){let[e,t,r]=o;Ct(a,`deviceId`,e.toString(),n),Ct(a,`webgpuInstance`,t.toString(),n),Ct(a,`webgpuDevice`,r.toString(),n)}}break;case`wasm`:case`cpu`:continue;default:throw Error(`not supported execution provider: ${r}`)}let o=pt(r,n),s=a.length,c=0,l=0;if(s>0){c=dt()._malloc(s*dt().PTR_SIZE),n.push(c),l=dt()._malloc(s*dt().PTR_SIZE),n.push(l);for(let e=0;e{let t=dt(),n=0,r=[],i=e||{};xt(i);try{let e=yt(i.graphOptimizationLevel??`all`),a=bt(i.executionMode??`sequential`),o=typeof i.logId==`string`?pt(i.logId,r):0,s=i.logSeverityLevel??2;if(!Number.isInteger(s)||s<0||s>4)throw Error(`log severity level is not valid: ${s}`);let c=i.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw Error(`log verbosity level is not valid: ${c}`);let l=typeof i.optimizedModelFilePath==`string`?pt(i.optimizedModelFilePath,r):0;if(n=t._OrtCreateSessionOptions(e,!!i.enableCpuMemArena,!!i.enableMemPattern,a,!!i.enableProfiling,0,o,s,c,l),n===0&&ht(`Can't create session options.`),i.executionProviders&&await wt(n,i,r),i.enableGraphCapture!==void 0){if(typeof i.enableGraphCapture!=`boolean`)throw Error(`enableGraphCapture must be a boolean value: ${i.enableGraphCapture}`);St(n,`enableGraphCapture`,i.enableGraphCapture.toString(),r)}if(i.freeDimensionOverrides)for(let[e,a]of Object.entries(i.freeDimensionOverrides)){if(typeof e!=`string`)throw Error(`free dimension override name must be a string: ${e}`);if(typeof a!=`number`||!Number.isInteger(a)||a<0)throw Error(`free dimension override value must be a non-negative integer: ${a}`);let i=pt(e,r);t._OrtAddFreeDimensionOverride(n,i,a)!==0&&ht(`Can't set a free dimension override: ${e} - ${a}.`)}return i.extra!==void 0&&mt(i.extra,``,new WeakSet,(e,t)=>{St(n,e,t,r)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseSessionOptions(n)!==0&&ht(`Can't release session options.`),r.forEach(e=>t._free(e)),e}}}),Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft=g(()=>{"use strict";Dt=e=>{switch(e){case`int8`:return 3;case`uint8`:return 2;case`bool`:return 9;case`int16`:return 5;case`uint16`:return 4;case`int32`:return 6;case`uint32`:return 12;case`float16`:return 10;case`float32`:return 1;case`float64`:return 11;case`string`:return 8;case`int64`:return 7;case`uint64`:return 13;case`int4`:return 22;case`uint4`:return 21;default:throw Error(`unsupported data type: ${e}`)}},Ot=e=>{switch(e){case 3:return`int8`;case 2:return`uint8`;case 9:return`bool`;case 5:return`int16`;case 4:return`uint16`;case 6:return`int32`;case 12:return`uint32`;case 10:return`float16`;case 1:return`float32`;case 11:return`float64`;case 8:return`string`;case 7:return`int64`;case 13:return`uint64`;case 22:return`int4`;case 21:return`uint4`;default:throw Error(`unsupported data type: ${e}`)}},kt=(e,t)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],r=typeof t==`number`?t:t.reduce((e,t)=>e*t,1);return n>0?Math.ceil(r*n):void 0},At=e=>{switch(e){case`float16`:return typeof Float16Array<`u`&&Float16Array.from?Float16Array:Uint16Array;case`float32`:return Float32Array;case`uint8`:return Uint8Array;case`int8`:return Int8Array;case`uint16`:return Uint16Array;case`int16`:return Int16Array;case`int32`:return Int32Array;case`bool`:return Uint8Array;case`float64`:return Float64Array;case`uint32`:return Uint32Array;case`int64`:return BigInt64Array;case`uint64`:return BigUint64Array;default:throw Error(`unsupported type: ${e}`)}},jt=e=>{switch(e){case`verbose`:return 0;case`info`:return 1;case`warning`:return 2;case`error`:return 3;case`fatal`:return 4;default:throw Error(`unsupported logging level: ${e}`)}},Mt=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,Nt=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint64`||e===`int8`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,Pt=e=>{switch(e){case`none`:return 0;case`cpu`:return 1;case`cpu-pinned`:return 2;case`texture`:return 3;case`gpu-buffer`:return 4;case`ml-tensor`:return 5;default:throw Error(`unsupported data location: ${e}`)}}}),It,Lt=g(()=>{"use strict";je(),It=async e=>{if(typeof e==`string`){let t=await fetch(e);if(!t.ok)throw Error(`failed to load external data file: ${e}`);let n=t.headers.get(`Content-Length`),r=n?parseInt(n,10):0;if(r<1073741824)return new Uint8Array(await t.arrayBuffer());{if(!t.body)throw Error(`failed to load external data file: ${e}, no response body.`);let n=t.body.getReader(),i;try{i=new ArrayBuffer(r)}catch(e){if(e instanceof RangeError){let e=Math.ceil(r/65536);i=new WebAssembly.Memory({initial:e,maximum:e}).buffer}else throw e}let a=0;for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=t.byteLength;new Uint8Array(i,a,r).set(t),a+=r}return new Uint8Array(i,0,r)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),Rt,zt=g(()=>{"use strict";Ft(),Rt=(e,t)=>new(At(t))(e)}),Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt=g(()=>{"use strict";Ft(),Bt=[`V`,`I`,`W`,`E`,`F`],Vt=(e,t)=>{console.log(`[${Bt[e]},${new Date().toISOString()}]${t}`)},Wt=(e,t)=>{Ht=e,Ut=t},Gt=(e,t)=>{let n=jt(e);n>=jt(Ht)&&Vt(n,typeof t==`function`?t():t)},Kt=(...e)=>{Ut&&Gt(...e)}}),Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on=g(()=>{"use strict";Ft(),qt(),Jt=new Map([[`float32`,32],[`float16`,16],[`int32`,32],[`uint32`,32],[`int64`,64],[`uint64`,64],[`int8`,8],[`uint8`,8],[`int4`,4],[`uint4`,4]]),Yt=(e,t)=>{if(t===`int32`)return e;let n=Jt.get(t);if(!n)throw Error(`WebNN backend does not support data type: ${t}`);let r=n/8;if(e.byteLength%r!==0)throw Error(`Invalid Uint8Array length - must be a multiple of ${r}.`);let i=e.byteLength/r,a=new(At(t))(e.buffer,e.byteOffset,i);switch(t){case`int64`:case`uint64`:{let e=new Int32Array(i);for(let t=0;t2147483647n||n<-2147483648n)throw Error(`Can not convert int64 data to int32 - value out of range.`);e[t]=Number(n)}return new Uint8Array(e.buffer)}case`int8`:case`uint8`:case`uint32`:{if(t===`uint32`&&a.some(e=>e>2147483647))throw Error(`Can not convert uint32 data to int32 - value out of range.`);let e=Int32Array.from(a,Number);return new Uint8Array(e.buffer)}default:throw Error(`Unsupported data conversion from ${t} to 'int32'`)}},Xt=(e,t)=>{if(t===`int32`)return e;if(e.byteLength%4!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 4 (int32).`);let n=e.byteLength/4,r=new Int32Array(e.buffer,e.byteOffset,n);switch(t){case`int64`:{let e=BigInt64Array.from(r,BigInt);return new Uint8Array(e.buffer)}case`uint64`:{if(r.some(e=>e<0))throw Error(`Can not convert int32 data to uin64 - negative value found.`);let e=BigUint64Array.from(r,BigInt);return new Uint8Array(e.buffer)}case`int8`:{if(r.some(e=>e<-128||e>127))throw Error(`Can not convert int32 data to int8 - value out of range.`);let e=Int8Array.from(r,Number);return new Uint8Array(e.buffer)}case`uint8`:if(r.some(e=>e<0||e>255))throw Error(`Can not convert int32 data to uint8 - value out of range.`);return Uint8Array.from(r,Number);case`uint32`:{if(r.some(e=>e<0))throw Error(`Can not convert int32 data to uint32 - negative value found.`);let e=Uint32Array.from(r,Number);return new Uint8Array(e.buffer)}default:throw Error(`Unsupported data conversion from 'int32' to ${t}`)}},Zt=1,Qt=()=>Zt++,$t=new Map([[`int8`,`int32`],[`uint8`,`int32`],[`uint32`,`int32`],[`int64`,`int32`]]),en=(e,t)=>{let n=Jt.get(e);if(!n)throw Error(`WebNN backend does not support data type: ${e}`);return t.length>0?Math.ceil(t.reduce((e,t)=>e*t)*n/8):0},tn=class{constructor(e){this.isDataConverted=!1;let{sessionId:t,context:n,tensor:r,dataType:i,shape:a,fallbackDataType:o}=e;this.sessionId=t,this.mlContext=n,this.mlTensor=r,this.dataType=i,this.tensorShape=a,this.fallbackDataType=o}get tensor(){return this.mlTensor}get type(){return this.dataType}get fallbackType(){return this.fallbackDataType}get shape(){return this.tensorShape}get byteLength(){return en(this.dataType,this.tensorShape)}destroy(){Kt(`verbose`,()=>`[WebNN] TensorWrapper.destroy`),this.mlTensor.destroy()}write(e){this.mlContext.writeTensor(this.mlTensor,e)}async read(e){if(this.fallbackDataType){let t=await this.mlContext.readTensor(this.mlTensor),n=Xt(new Uint8Array(t),this.dataType);if(e){(e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).set(n);return}else return n.buffer}else return e?this.mlContext.readTensor(this.mlTensor,e):this.mlContext.readTensor(this.mlTensor)}canReuseTensor(e,t,n){return this.mlContext===e&&this.dataType===t&&this.tensorShape.length===n.length&&this.tensorShape.every((e,t)=>e===n[t])}setIsDataConverted(e){this.isDataConverted=e}},nn=class{constructor(e,t){this.tensorManager=e,this.wrapper=t}get tensorWrapper(){return this.wrapper}releaseTensor(){this.tensorWrapper&&(this.tensorManager.releaseTensor(this.tensorWrapper),this.wrapper=void 0)}async ensureTensor(e,t,n,r){let i=this.tensorManager.getMLContext(e),a=this.tensorManager.getMLOpSupportLimits(e),o;if(!a?.input.dataTypes.includes(t)){if(o=$t.get(t),!o||a?.input.dataTypes.includes(o))throw Error(`WebNN backend does not support data type: ${t}`);Kt(`verbose`,()=>`[WebNN] TensorIdTracker.ensureTensor: fallback dataType from ${t} to ${o}`)}if(this.wrapper){if(this.wrapper.canReuseTensor(i,t,n))return this.wrapper.tensor;if(r){if(this.wrapper.byteLength!==en(t,n))throw Error(`Unable to copy data to tensor with different size.`);this.activeUpload=new Uint8Array(await this.wrapper.read())}this.tensorManager.releaseTensor(this.wrapper)}let s=typeof MLTensorUsage>`u`?void 0:MLTensorUsage.READ|MLTensorUsage.WRITE;return this.wrapper=await this.tensorManager.getCachedTensor(e,t,n,s,!0,!0,o),r&&this.activeUpload&&(this.wrapper.write(this.activeUpload),this.activeUpload=void 0),this.wrapper.tensor}upload(e){let t=e;if(this.wrapper){if(this.wrapper.fallbackType)if(this.wrapper.fallbackType===`int32`)t=Yt(e,this.wrapper.type),this.wrapper.setIsDataConverted(!0);else throw Error(`Unsupported fallback data type: ${this.wrapper.fallbackType}`);if(e.byteLength===this.wrapper.byteLength){this.wrapper.write(t);return}else Kt(`verbose`,()=>`Data size does not match tensor size. Releasing tensor.`),this.releaseTensor()}this.activeUpload?this.activeUpload.set(t):this.activeUpload=new Uint8Array(t)}async download(e){if(this.activeUpload){let t=this.wrapper?.isDataConverted?Xt(this.activeUpload,this.wrapper?.type):this.activeUpload;if(e){e instanceof ArrayBuffer?new Uint8Array(e).set(t):new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(t);return}else return t.buffer}if(!this.wrapper)throw Error(`Tensor has not been created.`);return e?this.wrapper.read(e):this.wrapper.read()}},rn=class{constructor(e){this.backend=e,this.tensorTrackersById=new Map,this.freeTensors=[],this.externalTensors=new Set}getMLContext(e){let t=this.backend.getMLContext(e);if(!t)throw Error(`MLContext not found for session.`);return t}getMLOpSupportLimits(e){return this.backend.getMLOpSupportLimits(e)}reserveTensorId(){let e=Qt();return this.tensorTrackersById.set(e,new nn(this)),e}releaseTensorId(e){let t=this.tensorTrackersById.get(e);t&&(this.tensorTrackersById.delete(e),t.tensorWrapper&&this.releaseTensor(t.tensorWrapper))}async ensureTensor(e,t,n,r,i){Kt(`verbose`,()=>`[WebNN] TensorManager.ensureTensor {tensorId: ${t}, dataType: ${n}, shape: ${r}, copyOld: ${i}}`);let a=this.tensorTrackersById.get(t);if(!a)throw Error(`Tensor not found.`);return a.ensureTensor(e,n,r,i)}upload(e,t){let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);n.upload(t)}async download(e,t){Kt(`verbose`,()=>`[WebNN] TensorManager.download {tensorId: ${e}, dstBuffer: ${t?.byteLength}}`);let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);return n.download(t)}releaseTensorsForSession(e){for(let t of this.freeTensors)t.sessionId===e&&t.destroy();this.freeTensors=this.freeTensors.filter(t=>t.sessionId!==e)}registerTensor(e,t,n,r){let i=this.getMLContext(e),a=Qt(),o=new tn({sessionId:e,context:i,tensor:t,dataType:n,shape:r});return this.tensorTrackersById.set(a,new nn(this,o)),this.externalTensors.add(o),a}async getCachedTensor(e,t,n,r,i,a,o){let s=this.getMLContext(e);for(let[r,i]of this.freeTensors.entries())if(i.canReuseTensor(s,t,n)){Kt(`verbose`,()=>`[WebNN] Reusing tensor {dataType: ${t}, ${o?`fallbackDataType: ${o},`:``} shape: ${n}`);let i=this.freeTensors.splice(r,1)[0];return i.sessionId=e,i}Kt(`verbose`,()=>`[WebNN] MLContext.createTensor {dataType: ${t}, ${o?`fallbackDataType: ${o},`:``} shape: ${n}}`);let c=await s.createTensor({dataType:o??t,shape:n,dimensions:n,usage:r,writable:i,readable:a});return new tn({sessionId:e,context:s,tensor:c,dataType:t,shape:n,fallbackDataType:o})}releaseTensor(e){this.externalTensors.has(e)&&this.externalTensors.delete(e),this.freeTensors.push(e)}},an=(...e)=>new rn(...e)}),sn={};_(sn,{WebNNBackend:()=>un});var cn,ln,un,dn=g(()=>{"use strict";Ft(),ft(),zt(),on(),qt(),cn=new Map([[1,`float32`],[10,`float16`],[6,`int32`],[12,`uint32`],[7,`int64`],[13,`uint64`],[22,`int4`],[21,`uint4`],[3,`int8`],[2,`uint8`],[9,`uint8`]]),ln=(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((n,i)=>n===r[i]&&e[n]===t[n])},un=class{constructor(e){this.tensorManager=an(this),this.mlContextBySessionId=new Map,this.sessionIdsByMLContext=new Map,this.mlContextCache=[],this.sessionGraphInputs=new Map,this.sessionGraphOutputs=new Map,this.temporaryGraphInputs=[],this.temporaryGraphOutputs=[],this.temporarySessionTensorIds=new Map,this.mlOpSupportLimitsBySessionId=new Map,Wt(e.logLevel,!!e.debug)}get currentSessionId(){if(this.activeSessionId===void 0)throw Error(`No active session`);return this.activeSessionId}onRunStart(e){Kt(`verbose`,()=>`[WebNN] onRunStart {sessionId: ${e}}`),this.activeSessionId=e}onRunEnd(e){Kt(`verbose`,()=>`[WebNN] onRunEnd {sessionId: ${e}}`);let t=this.temporarySessionTensorIds.get(e);if(t){for(let e of t)Kt(`verbose`,()=>`[WebNN] releasing temporary tensor {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e);this.temporarySessionTensorIds.delete(e),this.activeSessionId=void 0}}async createMLContext(e){if(e instanceof GPUDevice){let t=this.mlContextCache.findIndex(t=>t.gpuDevice===e);if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({gpuDevice:e,mlContext:t}),t}}else if(e===void 0){let e=this.mlContextCache.findIndex(e=>e.options===void 0&&e.gpuDevice===void 0);if(e!==-1)return this.mlContextCache[e].mlContext;{let e=await navigator.ml.createContext();return this.mlContextCache.push({mlContext:e}),e}}let t=this.mlContextCache.findIndex(t=>ln(t.options,e));if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({options:e,mlContext:t}),t}}registerMLContext(e,t){this.mlContextBySessionId.set(e,t);let n=this.sessionIdsByMLContext.get(t);n||(n=new Set,this.sessionIdsByMLContext.set(t,n)),n.add(e),this.mlOpSupportLimitsBySessionId.has(e)||this.mlOpSupportLimitsBySessionId.set(e,t.opSupportLimits()),this.temporaryGraphInputs.length>0&&(this.sessionGraphInputs.set(e,this.temporaryGraphInputs),this.temporaryGraphInputs=[]),this.temporaryGraphOutputs.length>0&&(this.sessionGraphOutputs.set(e,this.temporaryGraphOutputs),this.temporaryGraphOutputs=[])}onReleaseSession(e){this.sessionGraphInputs.delete(e),this.sessionGraphOutputs.delete(e);let t=this.mlContextBySessionId.get(e);if(!t)return;this.tensorManager.releaseTensorsForSession(e),this.mlContextBySessionId.delete(e),this.mlOpSupportLimitsBySessionId.delete(e);let n=this.sessionIdsByMLContext.get(t);if(n.delete(e),n.size===0){this.sessionIdsByMLContext.delete(t);let e=this.mlContextCache.findIndex(e=>e.mlContext===t);e!==-1&&this.mlContextCache.splice(e,1)}}getMLContext(e){return this.mlContextBySessionId.get(e)}getMLOpSupportLimits(e){return this.mlOpSupportLimitsBySessionId.get(e)}reserveTensorId(){return this.tensorManager.reserveTensorId()}releaseTensorId(e){Kt(`verbose`,()=>`[WebNN] releaseTensorId {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e)}async ensureTensor(e,t,n,r,i){let a=cn.get(n);if(!a)throw Error(`Unsupported ONNX data type: ${n}`);return this.tensorManager.ensureTensor(e??this.currentSessionId,t,a,r,i)}async createTemporaryTensor(e,t,n){Kt(`verbose`,()=>`[WebNN] createTemporaryTensor {onnxDataType: ${t}, shape: ${n}}`);let r=cn.get(t);if(!r)throw Error(`Unsupported ONNX data type: ${t}`);let i=this.tensorManager.reserveTensorId();await this.tensorManager.ensureTensor(e,i,r,n,!1);let a=this.temporarySessionTensorIds.get(e);return a?a.push(i):this.temporarySessionTensorIds.set(e,[i]),i}uploadTensor(e,t){if(!dt().shouldTransferToMLTensor)throw Error(`Trying to upload to a MLTensor while shouldTransferToMLTensor is false`);Kt(`verbose`,()=>`[WebNN] uploadTensor {tensorId: ${e}, data: ${t.byteLength}}`),this.tensorManager.upload(e,t)}async downloadTensor(e,t){return this.tensorManager.download(e,t)}createMLTensorDownloader(e,t){return async()=>{let n=await this.tensorManager.download(e);return Rt(n,t)}}registerMLTensor(e,t,n,r){let i=cn.get(n);if(!i)throw Error(`Unsupported ONNX data type: ${n}`);let a=this.tensorManager.registerTensor(e,t,i,r);return Kt(`verbose`,()=>`[WebNN] registerMLTensor {tensor: ${t}, dataType: ${i}, dimensions: ${r}} -> {tensorId: ${a}}`),a}registerMLConstant(e,t,n,r,i,a,o=!1){if(!a)throw Error(`External mounted files are not available.`);let s=e;e.startsWith(`./`)&&(s=e.substring(2));let c=a.get(s);if(!c)throw Error(`File with name ${s} not found in preloaded files.`);if(t+n>c.byteLength)throw Error(`Out of bounds: data offset and length exceed the external file data size.`);let l=c.slice(t,t+n).buffer,u;switch(i.dataType){case`float32`:u=new Float32Array(l);break;case`float16`:u=typeof Float16Array<`u`&&Float16Array.from?new Float16Array(l):new Uint16Array(l);break;case`int32`:u=new Int32Array(l);break;case`uint32`:u=new Uint32Array(l);break;case`int64`:if(o){let e=Yt(new Uint8Array(l),`int64`);u=new Int32Array(e.buffer),i.dataType=`int32`}else u=new BigInt64Array(l);break;case`uint64`:u=new BigUint64Array(l);break;case`int8`:u=new Int8Array(l);break;case`int4`:case`uint4`:case`uint8`:u=new Uint8Array(l);break;default:throw Error(`Unsupported data type: ${i.dataType} in creating WebNN Constant from external data.`)}return Kt(`verbose`,()=>`[WebNN] registerMLConstant {dataType: ${i.dataType}, shape: ${i.shape}}} ${o?`(Note: it was int64 data type and registered to int32 as workaround)`:``}`),r.constant(i,u)}registerGraphInput(e){this.temporaryGraphInputs.push(e)}registerGraphOutput(e){this.temporaryGraphOutputs.push(e)}isGraphInput(e,t){let n=this.sessionGraphInputs.get(e);return n?n.includes(t):!1}isGraphOutput(e,t){let n=this.sessionGraphOutputs.get(e);return n?n.includes(t):!1}isGraphInputOutputTypeSupported(e,t,n=!0){let r=cn.get(Dt(t)),i=this.mlOpSupportLimitsBySessionId.get(e);return typeof r>`u`?!1:n?!!i?.input.dataTypes.includes(r):!!i?.output.dataTypes.includes(r)}flush(){}}}),fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn=g(()=>{"use strict";Ae(),vt(),Et(),Ft(),ft(),gt(),Lt(),fn=(e,t)=>{dt()._OrtInit(e,t)!==0&&ht(`Can't initialize onnxruntime.`)},pn=async e=>{fn(e.wasm.numThreads,jt(e.logLevel))},mn=async(e,t)=>{dt().asyncInit?.();let n=e.webgpu.adapter;if(t===`webgpu`){if(typeof navigator>`u`||!navigator.gpu)throw Error(`WebGPU is not supported in current environment`);if(n){if(typeof n.limits!=`object`||typeof n.features!=`object`||typeof n.requestDevice!=`function`)throw Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let t=e.webgpu.powerPreference;if(t!==void 0&&t!==`low-power`&&t!==`high-performance`)throw Error(`Invalid powerPreference setting: "${t}"`);let r=e.webgpu.forceFallbackAdapter;if(r!==void 0&&typeof r!=`boolean`)throw Error(`Invalid forceFallbackAdapter setting: "${r}"`);if(n=await navigator.gpu.requestAdapter({powerPreference:t,forceFallbackAdapter:r}),!n)throw Error(`Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.`)}}if(t===`webnn`&&(typeof navigator>`u`||!navigator.ml))throw Error(`WebNN is not supported in current environment`);if(t===`webgpu`&&dt().webgpuInit(t=>{e.webgpu.device=t}),t===`webnn`){let t=new(dn(),y(sn)).WebNNBackend(e);dt().webnnInit([t,()=>t.reserveTensorId(),e=>t.releaseTensorId(e),async(e,n,r,i,a)=>t.ensureTensor(e,n,r,i,a),(e,n)=>{t.uploadTensor(e,n)},async(e,n)=>t.downloadTensor(e,n),(e,n)=>t.registerMLContext(e,n),!!e.trace])}},hn=new Map,gn=e=>{let t=dt(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetInputOutputCount(e,r,r+n)!==0&&ht(`Can't get session input/output count.`);let i=n===4?`i32`:`i64`;return[Number(t.getValue(r,i)),Number(t.getValue(r+n,i))]}finally{t.stackRestore(n)}},_n=(e,t)=>{let n=dt(),r=n.stackSave(),i=0;try{let r=n.PTR_SIZE,a=n.stackAlloc(2*r);n._OrtGetInputOutputMetadata(e,t,a,a+r)!==0&&ht(`Can't get session input/output metadata.`);let o=Number(n.getValue(a,`*`));i=Number(n.getValue(a+r,`*`));let s=n.HEAP32[i/4];if(s===0)return[o,0];let c=n.HEAPU32[i/4+1],l=[];for(let e=0;e{let t=dt(),n=t._malloc(e.byteLength);if(n===0)throw Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return t.HEAPU8.set(e,n),[n,e.byteLength]},yn=async(e,t)=>{let n,r,i=dt();Array.isArray(e)?[n,r]=e:e.buffer===i.HEAPU8.buffer?[n,r]=[e.byteOffset,e.byteLength]:[n,r]=vn(e);let a=0,o=0,s=0,c=[],l=[],u=[];try{if([o,c]=await Tt(t),t?.externalData&&i.mountExternalData){let e=[];for(let n of t.externalData){let t=typeof n==`string`?n:n.path;e.push(It(typeof n==`string`?n:n.data).then(e=>{i.mountExternalData(t,e)}))}await Promise.all(e)}for(let e of t?.executionProviders??[])if((typeof e==`string`?e:e.name)===`webnn`){if(i.shouldTransferToMLTensor=!1,typeof e!=`string`){let t=e,n=t?.context,r=t?.gpuDevice,a=t?.deviceType,o=t?.powerPreference;n?i.currentContext=n:r?i.currentContext=await i.webnnCreateMLContext(r):i.currentContext=await i.webnnCreateMLContext({deviceType:a,powerPreference:o})}else i.currentContext=await i.webnnCreateMLContext();break}a=await i._OrtCreateSession(n,r,o),i.webgpuOnCreateSession?.(a),a===0&&ht(`Can't create a session.`),i.jsepOnCreateSession?.(),i.currentContext&&(i.webnnRegisterMLContext(a,i.currentContext),i.currentContext=void 0,i.shouldTransferToMLTensor=!0);let[e,d]=gn(a),f=!!t?.enableGraphCapture,p=[],m=[],h=[],g=[],_=[];for(let t=0;te===`gpu-buffer`||e===`ml-tensor`||e===`ml-tensor-cpu-output`)&&(s=i._OrtCreateBinding(a),s===0&&ht(`Can't create IO binding.`),v={handle:s,outputPreferredLocations:_,outputPreferredLocationsEncoded:_.map(e=>e===`ml-tensor-cpu-output`?`ml-tensor`:e).map(e=>Pt(e))}),hn.set(a,[a,l,u,v,f,!1]),[a,p,m,h,g]}catch(e){throw l.forEach(e=>i._OrtFree(e)),u.forEach(e=>i._OrtFree(e)),s!==0&&i._OrtReleaseBinding(s)!==0&&ht(`Can't release IO binding.`),a!==0&&i._OrtReleaseSession(a)!==0&&ht(`Can't release session.`),e}finally{i._free(n),o!==0&&i._OrtReleaseSessionOptions(o)!==0&&ht(`Can't release session options.`),c.forEach(e=>i._free(e)),i.unmountExternalData?.()}},bn=e=>{let t=dt(),n=hn.get(e);if(!n)throw Error(`cannot release session. invalid session id: ${e}`);let[r,i,a,o,s]=n;o&&(s&&t._OrtClearBoundOutputs(o.handle)!==0&&ht(`Can't clear bound outputs.`),t._OrtReleaseBinding(o.handle)!==0&&ht(`Can't release IO binding.`)),t.jsepOnReleaseSession?.(e),t.webnnOnReleaseSession?.(e),t.webgpuOnReleaseSession?.(e),i.forEach(e=>t._OrtFree(e)),a.forEach(e=>t._OrtFree(e)),t._OrtReleaseSession(r)!==0&&ht(`Can't release session.`),hn.delete(e)},xn=async(e,t,n,r,i,a,o=!1)=>{if(!e){t.push(0);return}let s=dt(),c=s.PTR_SIZE,l=e[0],u=e[1],d=e[3],f=d,p,m;if(l===`string`&&(d===`gpu-buffer`||d===`ml-tensor`))throw Error(`String tensor is not supported on GPU.`);if(o&&d!==`gpu-buffer`)throw Error(`External buffer must be provided for input/output index ${a} when enableGraphCapture is true.`);if(d===`gpu-buffer`){let t=e[2].gpuBuffer;m=kt(Dt(l),u);{let e=s.webgpuRegisterBuffer;if(!e)throw Error(`Tensor location "gpu-buffer" is not supported without using WebGPU.`);p=e(t,r)}}else if(d===`ml-tensor`){let t=e[2].mlTensor;m=kt(Dt(l),u);let n=s.webnnRegisterMLTensor;if(!n)throw Error(`Tensor location "ml-tensor" is not supported without using WebNN.`);p=n(r,t,Dt(l),u)}else{let t=e[2];if(Array.isArray(t)){m=c*t.length,p=s._malloc(m),n.push(p);for(let e=0;es.setValue(g+t*c,e,c===4?`i32`:`i64`));let e=s._OrtCreateTensor(Dt(l),p,m,g,u.length,Pt(f));e===0&&ht(`Can't create tensor for input/output. session=${r}, index=${a}.`),t.push(e)}finally{s.stackRestore(h)}},Sn=async(e,t,n,r,i,a)=>{let o=dt(),s=o.PTR_SIZE,c=hn.get(e);if(!c)throw Error(`cannot run inference. invalid session id: ${e}`);let l=c[0],u=c[1],d=c[2],f=c[3],p=c[4],m=c[5],h=t.length,g=r.length,_=0,v=[],y=[],b=[],x=[],S=[],C=o.stackSave(),w=o.stackAlloc(h*s),T=o.stackAlloc(h*s),E=o.stackAlloc(g*s),D=o.stackAlloc(g*s);try{[_,v]=_t(a),ve(`wasm prepareInputOutputTensor`);for(let r=0;re*t,1);u=Ot(a);let _=f?.outputPreferredLocations[r[t]];if(u===`string`){if(_===`gpu-buffer`||_===`ml-tensor`)throw Error(`String tensor is not supported on GPU.`);let e=[];for(let t=0;t0){let t=o.webgpuGetBuffer;if(!t)throw Error(`preferredLocation "gpu-buffer" is not supported without using WebGPU.`);let r=t(d),i=kt(a,g);if(i===void 0||!Mt(u))throw Error(`Unsupported data type: ${u}`);l=!0;{o.webgpuRegisterBuffer(r,e,d);let t=o.webgpuCreateDownloader(r,i,e);C.push([u,h,{gpuBuffer:r,download:async()=>{let e=await t();return new(At(u))(e)},dispose:()=>{o._OrtReleaseTensor(n)!==0&&ht(`Can't release tensor.`)}},`gpu-buffer`])}}else if(_===`ml-tensor`&&g>0){let t=o.webnnEnsureTensor,r=o.webnnIsGraphInputOutputTypeSupported;if(!t||!r)throw Error(`preferredLocation "ml-tensor" is not supported without using WebNN.`);if(kt(a,g)===void 0||!Nt(u))throw Error(`Unsupported data type: ${u}`);if(!r(e,u,!1))throw Error(`preferredLocation "ml-tensor" for ${u} output is not supported by current WebNN Context.`);let i=await t(e,d,a,h,!1);l=!0,C.push([u,h,{mlTensor:i,download:o.webnnCreateMLTensorDownloader(d,u),dispose:()=>{o.webnnReleaseTensorId(d),o._OrtReleaseTensor(n)}},`ml-tensor`])}else if(_===`ml-tensor-cpu-output`&&g>0){let e=o.webnnCreateMLTensorDownloader(d,u)(),t=C.length;l=!0,O.push((async()=>{let r=[t,await e];return o.webnnReleaseTensorId(d),o._OrtReleaseTensor(n),r})()),C.push([u,h,[],`cpu`])}else{let e=new(At(u))(g);new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(o.HEAPU8.subarray(d,d+e.byteLength)),C.push([u,h,e,`cpu`])}}finally{o.stackRestore(a),u===`string`&&d&&o._free(d),l||o._OrtReleaseTensor(n)}}f&&!p&&(o._OrtClearBoundOutputs(f.handle)!==0&&ht(`Can't clear bound outputs.`),hn.set(e,[l,u,d,f,p,!1]));for(let[e,t]of await Promise.all(O))C[e][2]=t;return ye(`wasm ProcessOutputTensor`),C}finally{o.webnnOnRunEnd?.(l),o.stackRestore(C),n.forEach(e=>{e&&e[3]===`gpu-buffer`&&o.webgpuUnregisterBuffer(e[2].gpuBuffer)}),i.forEach(e=>{e&&e[3]===`gpu-buffer`&&o.webgpuUnregisterBuffer(e[2].gpuBuffer)}),y.forEach(e=>o._OrtReleaseTensor(e)),b.forEach(e=>o._OrtReleaseTensor(e)),x.forEach(e=>o._free(e)),_!==0&&o._OrtReleaseRunOptions(_),v.forEach(e=>o._free(e))}},Cn=e=>{let t=dt(),n=hn.get(e);if(!n)throw Error(`invalid session id`);let r=n[0],i=t._OrtEndProfiling(r);i===0&&ht(`Can't get an profile file name.`),t._OrtFree(i)},wn=e=>{let t=[];for(let n of e){let e=n[2];!Array.isArray(e)&&`buffer`in e&&t.push(e.buffer)}return t}}),En,Dn,On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,H,Rn,zn,Bn,Vn,Hn,Un=g(()=>{"use strict";Ae(),Tn(),ft(),nt(),En=()=>!!M.wasm.proxy&&typeof document<`u`,On=!1,kn=!1,An=!1,Nn=new Map,Pn=(e,t)=>{let n=Nn.get(e);n?n.push(t):Nn.set(e,[t])},Fn=()=>{if(On||!kn||An||!Dn)throw Error(`worker not ready`)},In=e=>{switch(e.data.type){case`init-wasm`:On=!1,e.data.err?(An=!0,Mn[1](e.data.err)):(kn=!0,Mn[0]()),jn&&=(URL.revokeObjectURL(jn),void 0);break;case`init-ep`:case`copy-from`:case`create`:case`release`:case`run`:case`end-profiling`:{let t=Nn.get(e.data.type);e.data.err?t.shift()[1](e.data.err):t.shift()[0](e.data.out);break}default:}},Ln=async()=>{if(!kn){if(On)throw Error(`multiple calls to 'initWasm()' detected.`);if(An)throw Error(`previous call to 'initWasm()' failed.`);if(On=!0,En())return new Promise((e,t)=>{Dn?.terminate(),$e().then(([n,r])=>{try{Dn=r,Dn.onerror=e=>t(e),Dn.onmessage=In,Mn=[e,t];let i={type:`init-wasm`,in:M};!i.in.wasm.wasmPaths&&(n||Ue)&&(i.in.wasm.wasmPaths={wasm:new URL(`/demo/assets/ort-wasm-simd-threaded.asyncify-DMmc6YqF.wasm`,``+self.location.href).href}),Dn.postMessage(i),jn=n}catch(e){t(e)}},t)});try{await ut(M.wasm),await pn(M),kn=!0}catch(e){throw An=!0,e}finally{On=!1}}},H=async e=>{if(En())return Fn(),new Promise((t,n)=>{Pn(`init-ep`,[t,n]);let r={type:`init-ep`,in:{epName:e,env:M}};Dn.postMessage(r)});await mn(M,e)},Rn=async e=>En()?(Fn(),new Promise((t,n)=>{Pn(`copy-from`,[t,n]);let r={type:`copy-from`,in:{buffer:e}};Dn.postMessage(r,[e.buffer])})):vn(e),zn=async(e,t)=>{if(En()){if(t?.preferredOutputLocation)throw Error(`session option "preferredOutputLocation" is not supported for proxy.`);return Fn(),new Promise((n,r)=>{Pn(`create`,[n,r]);let i={type:`create`,in:{model:e,options:{...t}}},a=[];e instanceof Uint8Array&&a.push(e.buffer),Dn.postMessage(i,a)})}else return yn(e,t)},Bn=async e=>{if(En())return Fn(),new Promise((t,n)=>{Pn(`release`,[t,n]);let r={type:`release`,in:e};Dn.postMessage(r)});bn(e)},Vn=async(e,t,n,r,i,a)=>{if(En()){if(n.some(e=>e[3]!==`cpu`))throw Error(`input tensor on GPU is not supported for proxy.`);if(i.some(e=>e))throw Error(`pre-allocated output tensor is not supported for proxy.`);return Fn(),new Promise((i,o)=>{Pn(`run`,[i,o]);let s=n,c={type:`run`,in:{sessionId:e,inputIndices:t,inputs:s,outputIndices:r,options:a}};Dn.postMessage(c,wn(s))})}else return Sn(e,t,n,r,i,a)},Hn=async e=>{if(En())return Fn(),new Promise((t,n)=>{Pn(`end-profiling`,[t,n]);let r={type:`end-profiling`,in:e};Dn.postMessage(r)});Cn(e)}}),Wn,Gn,Kn,qn=g(()=>{"use strict";Ae(),Un(),Ft(),je(),Lt(),Wn=(e,t)=>{switch(e.location){case`cpu`:return[e.type,e.dims,e.data,`cpu`];case`gpu-buffer`:return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},`gpu-buffer`];case`ml-tensor`:return[e.type,e.dims,{mlTensor:e.mlTensor},`ml-tensor`];default:throw Error(`invalid data location: ${e.location} for ${t()}`)}},Gn=e=>{switch(e[3]){case`cpu`:return new pe(e[0],e[2],e[1]);case`gpu-buffer`:{let t=e[0];if(!Mt(t))throw Error(`not supported data type: ${t} for deserializing GPU tensor`);let{gpuBuffer:n,download:r,dispose:i}=e[2];return pe.fromGpuBuffer(n,{dataType:t,dims:e[1],download:r,dispose:i})}case`ml-tensor`:{let t=e[0];if(!Nt(t))throw Error(`not supported data type: ${t} for deserializing MLTensor tensor`);let{mlTensor:n,download:r,dispose:i}=e[2];return pe.fromMLTensor(n,{dataType:t,dims:e[1],download:r,dispose:i})}default:throw Error(`invalid data location: ${e[3]}`)}},Kn=class{async fetchModelAndCopyToWasmMemory(e){return Rn(await It(e))}async loadModel(e,t){ge();let n;n=typeof e==`string`?await this.fetchModelAndCopyToWasmMemory(e):e,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await zn(n,t),_e()}async dispose(){return Bn(this.sessionId)}async run(e,t,n){ge();let r=[],i=[];Object.entries(e).forEach(e=>{let t=e[0],n=e[1],a=this.inputNames.indexOf(t);if(a===-1)throw Error(`invalid input '${t}'`);r.push(n),i.push(a)});let a=[],o=[];Object.entries(t).forEach(e=>{let t=e[0],n=e[1],r=this.outputNames.indexOf(t);if(r===-1)throw Error(`invalid output '${t}'`);a.push(n),o.push(r)});let s=r.map((e,t)=>Wn(e,()=>`input "${this.inputNames[i[t]]}"`)),c=a.map((e,t)=>e?Wn(e,()=>`output "${this.outputNames[o[t]]}"`):null),l=await Vn(this.sessionId,i,s,o,c,n),u={};for(let e=0;eXn,initializeFlags:()=>Yn,wasmBackend:()=>Zn});var Yn,Xn,Zn,Qn=g(()=>{"use strict";Ae(),Un(),qn(),Yn=()=>{(typeof M.wasm.initTimeout!=`number`||M.wasm.initTimeout<0)&&(M.wasm.initTimeout=0);let e=M.wasm.simd;if(typeof e!=`boolean`&&e!==void 0&&e!==`fixed`&&e!==`relaxed`&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${e}". Reset it to \`false\` and ignore SIMD feature checking.`),M.wasm.simd=!1),typeof M.wasm.proxy!=`boolean`&&(M.wasm.proxy=!1),typeof M.wasm.trace!=`boolean`&&(M.wasm.trace=!1),typeof M.wasm.numThreads!=`number`||!Number.isInteger(M.wasm.numThreads)||M.wasm.numThreads<=0)if(typeof self<`u`&&!self.crossOriginIsolated)M.wasm.numThreads=1;else{let e=typeof navigator>`u`?h(`node:os`).cpus().length:navigator.hardwareConcurrency;M.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},Xn=class{async init(e){Yn(),await Ln(),await H(e)}async createInferenceSessionHandler(e,t){let n=new Kn;return await n.loadModel(e,t),n}},Zn=new Xn});Ae(),Ae(),Ae();var $n=`1.26.0-dev.20260416-b7804b056c`,er=ke;{let e=(Qn(),y(Jn)).wasmBackend;S(`webgpu`,e,5),S(`webnn`,e,5),S(`cpu`,e,10),S(`wasm`,e,10)}Object.defineProperty(M.versions,"web",{value:$n,enumerable:!0});let U=new Map,tr=[],nr=(e,t,n)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let r=U.get(e);if(r===void 0)U.set(e,{backend:t,priority:n});else if(r.priority>n)return;else if(r.priority===n&&r.backend!==t)throw Error(`cannot register backend "${e}" using priority ${n}`);if(n>=0){let t=tr.indexOf(e);t!==-1&&tr.splice(t,1);for(let t=0;t{let t=U.get(e);if(!t)return`backend not found.`;if(t.initialized)return t.backend;if(t.aborted)return t.error;{let n=!!t.initPromise;try{return n||(t.initPromise=t.backend.init(e)),await t.initPromise,t.initialized=!0,t.backend}catch(e){return n||(t.error=`${e}`,t.aborted=!0),t.error}finally{delete t.initPromise}}},ir=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),r=n.length===0?tr:n,i,a=[],o=new Set;for(let e of r){let t=await rr(e);typeof t==`string`?a.push({name:e,err:t}):(i||=t,i===t&&o.add(e))}if(!i)throw Error(`no available backend found. ERR: ${a.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of a)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let s=t.filter(e=>o.has(typeof e==`string`?e:e.name));return[i,new Proxy(e,{get:(e,t)=>t===`executionProviders`?s:Reflect.get(e,t)})]},ar=`warning`,or={wasm:{},webgl:{},webgpu:{},versions:{common:`1.24.3`},set logLevel(e){if(e!==void 0){if(typeof e!=`string`||[`verbose`,`info`,`warning`,`error`,`fatal`].indexOf(e)===-1)throw Error(`Unsupported logging level: ${e}`);ar=e}},get logLevel(){return ar}};Object.defineProperty(or,"logLevel",{enumerable:!0});let sr=or,cr=(e,t)=>{let n=typeof document<`u`?document.createElement(`canvas`):new OffscreenCanvas(1,1);n.width=e.dims[3],n.height=e.dims[2];let r=n.getContext(`2d`);if(r!=null){let i,a;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[3]):(i=e.dims[3],a=e.dims[2]);let o=t?.format===void 0?`RGB`:t.format,s=t?.norm,c,l;s===void 0||s.mean===void 0?c=[255,255,255,255]:typeof s.mean==`number`?c=[s.mean,s.mean,s.mean,s.mean]:(c=[s.mean[0],s.mean[1],s.mean[2],0],s.mean[3]!==void 0&&(c[3]=s.mean[3])),s===void 0||s.bias===void 0?l=[0,0,0,0]:typeof s.bias==`number`?l=[s.bias,s.bias,s.bias,s.bias]:(l=[s.bias[0],s.bias[1],s.bias[2],0],s.bias[3]!==void 0&&(l[3]=s.bias[3]));let u=a*i,d=0,f=u,p=u*2,m=-1;o===`RGBA`?(d=0,f=u,p=u*2,m=u*3):o===`RGB`?(d=0,f=u,p=u*2):o===`RBG`&&(d=0,p=u,f=u*2);for(let t=0;t{let n=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):new OffscreenCanvas(1,1).getContext(`2d`),r;if(n!=null){let i,a,o;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[1],o=e.dims[3]):(i=e.dims[3],a=e.dims[2],o=e.dims[1]);let s=t===void 0||t.format===void 0?`RGB`:t.format,c=t?.norm,l,u;c===void 0||c.mean===void 0?l=[255,255,255,255]:typeof c.mean==`number`?l=[c.mean,c.mean,c.mean,c.mean]:(l=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(l[3]=c.mean[3])),c===void 0||c.bias===void 0?u=[0,0,0,0]:typeof c.bias==`number`?u=[c.bias,c.bias,c.bias,c.bias]:(u=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(u[3]=c.bias[3]));let d=a*i;if(t!==void 0&&(t.format!==void 0&&o===4&&t.format!==`RGBA`||o===3&&t.format!==`RGB`&&t.format!==`BGR`))throw Error(`Tensor format doesn't match input tensor dims`);let f=0,p=1,m=2,h=3,g=0,_=d,v=d*2,y=-1;s===`RGBA`?(g=0,_=d,v=d*2,y=d*3):s===`RGB`?(g=0,_=d,v=d*2):s===`RBG`&&(g=0,v=d,_=d*2),r=n.createImageData(i,a);for(let t=0;t{if(e===void 0)throw Error(`Image buffer must be defined`);if(t.height===void 0||t.width===void 0)throw Error(`Image height and width must be defined`);if(t.tensorLayout===`NHWC`)throw Error(`NHWC Tensor layout is not supported yet`);let{height:n,width:r}=t,i=t.norm??{mean:255,bias:0},a,o;a=typeof i.mean==`number`?[i.mean,i.mean,i.mean,i.mean]:[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],o=typeof i.bias==`number`?[i.bias,i.bias,i.bias,i.bias]:[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let s=t.format===void 0?`RGBA`:t.format,c=t.tensorFormat===void 0||t.tensorFormat===void 0?`RGB`:t.tensorFormat,l=n*r,u=c===`RGBA`?new Float32Array(l*4):new Float32Array(l*3),d=4,f=0,p=1,m=2,h=3,g=0,_=l,v=l*2,y=-1;s===`RGB`&&(d=3,f=0,p=1,m=2,h=-1),c===`RGBA`?y=l*3:c===`RBG`?(g=0,v=l,_=l*2):c===`BGR`&&(v=0,_=l,g=l*2);for(let t=0;t{let n=typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement,r=typeof ImageData<`u`&&e instanceof ImageData,i=typeof ImageBitmap<`u`&&e instanceof ImageBitmap,a=typeof e==`string`,o,s=t??{},c=()=>{if(typeof document<`u`)return document.createElement(`canvas`);if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(1,1);throw Error(`Canvas is not supported`)},l=e=>typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas?e.getContext(`2d`):null;if(n){let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let n=e.height,i=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(n=t.resizedHeight,i=t.resizedWidth),t!==void 0){if(s=t,t.tensorFormat!==void 0)throw Error(`Image input config format must be RGBA for HTMLImageElement`);s.tensorFormat=`RGBA`,s.height=n,s.width=i}else s.tensorFormat=`RGBA`,s.height=n,s.width=i;r.drawImage(e,0,0),o=r.getImageData(0,0,i,n).data}else throw Error(`Can not access image data`)}else if(r){let n,r;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(n=t.resizedHeight,r=t.resizedWidth):(n=e.height,r=e.width),t!==void 0&&(s=t),s.format=`RGBA`,s.height=n,s.width=r,t!==void 0){let t=c();t.width=r,t.height=n;let i=l(t);if(i!=null)i.putImageData(e,0,0),o=i.getImageData(0,0,r,n).data;else throw Error(`Can not access image data`)}else o=e.data}else if(i){if(t===void 0)throw Error(`Please provide image config with format for Imagebitmap`);let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let t=e.height,n=e.width;return r.drawImage(e,0,0,n,t),o=r.getImageData(0,0,n,t).data,s.height=t,s.width=n,ur(o,s)}else throw Error(`Can not access image data`)}else if(a)return new Promise((t,n)=>{let r=c(),i=l(r);if(!e||!i)return n();let a=new Image;a.crossOrigin=`Anonymous`,a.src=e,a.onload=()=>{r.width=a.width,r.height=a.height,i.drawImage(a,0,0,r.width,r.height);let e=i.getImageData(0,0,r.width,r.height);s.height=r.height,s.width=r.width,t(ur(e.data,s))}});else throw Error(`Input data provided is not supported - aborted tensor creation`);if(o!==void 0)return ur(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},fr=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t;return new Sr({location:`texture`,type:`float32`,texture:e,dims:[1,r,n,4],download:i,dispose:a})},pr=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new Sr({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},mr=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new Sr({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},hr=(e,t,n)=>new Sr({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]}),gr=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),_r=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]),vr=!1,yr=()=>{if(!vr){vr=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=n!==void 0&&n.from;e&&(gr.set(`int64`,BigInt64Array),_r.set(BigInt64Array,`int64`)),t&&(gr.set(`uint64`,BigUint64Array),_r.set(BigUint64Array,`uint64`)),r?(gr.set(`float16`,n),_r.set(n,`float16`)):gr.set(`float16`,Uint16Array)}},br=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new Sr(e.type,e.data,t);case`cpu-pinned`:return new Sr({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new Sr({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new Sr({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new Sr({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}};var Sr=class{constructor(e,t,n){yr();let r,i;if(typeof e==`object`&&`location`in e)switch(this.dataLocation=e.location,r=e.type,i=e.dims,e.location){case`cpu-pinned`:{let t=gr.get(r);if(!t)throw TypeError(`unsupported type "${r}" to create tensor from pinned buffer`);if(!(e.data instanceof t))throw TypeError(`buffer should be of type ${t.name}`);this.cpuData=e.data;break}case`texture`:if(r!==`float32`)throw TypeError(`unsupported type "${r}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break;case`gpu-buffer`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break;case`ml-tensor`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint64`&&r!==`int8`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break;default:throw Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,o;if(typeof e==`string`)if(r=e,o=n,e===`string`){if(!Array.isArray(t))throw TypeError(`A string tensor's data must be a string array.`);a=t}else{let n=gr.get(e);if(n===void 0)throw TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t)){if(e===`float16`&&n===Uint16Array||e===`uint4`||e===`int4`)throw TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${n.name} as data.`);a=e===`uint64`||e===`int64`?n.from(t,BigInt):n.from(t)}else if(t instanceof n)a=t;else if(t instanceof Uint8ClampedArray)if(e===`uint8`)a=Uint8Array.from(t);else throw TypeError(`A Uint8ClampedArray tensor's data must be type of uint8`);else if(e===`float16`&&t instanceof Uint16Array&&n!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw TypeError(`A ${r} tensor's data must be type of ${n}`)}else if(o=t,Array.isArray(e)){if(e.length===0)throw TypeError(`Tensor type cannot be inferred from an empty array.`);let t=typeof e[0];if(t===`string`)r=`string`,a=e;else if(t===`boolean`)r=`bool`,a=Uint8Array.from(e);else throw TypeError(`Invalid element type of data array: ${t}.`)}else if(e instanceof Uint8ClampedArray)r=`uint8`,a=Uint8Array.from(e);else{let t=_r.get(e.constructor);if(t===void 0)throw TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,a=e}if(o===void 0)o=[a.length];else if(!Array.isArray(o))throw TypeError(`A tensor's dims must be a number array`);i=o,this.cpuData=a,this.dataLocation=`cpu`}let a=br(i);if(this.cpuData&&a!==this.cpuData.length&&!((r===`uint4`||r===`int4`)&&Math.ceil(a/2)===this.cpuData.length))throw Error(`Tensor's size(${a}) does not match data length(${this.cpuData.length}).`);this.type=r,this.dims=i,this.size=a}static async fromImage(e,t){return dr(e,t)}static fromTexture(e,t){return fr(e,t)}static fromGpuBuffer(e,t){return pr(e,t)}static fromMLTensor(e,t){return mr(e,t)}static fromPinnedBuffer(e,t,n){return hr(e,t,n)}toDataURL(e){return cr(this,e)}toImageData(e){return lr(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw Error(`The data is not stored as a WebGL texture.`);return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw Error(`The data is not stored as a WebGPU buffer.`);return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw Error(`The data is not stored as a WebNN MLTensor.`);return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case`cpu`:case`cpu-pinned`:return this.data;case`texture`:case`gpu-buffer`:case`ml-tensor`:if(!this.downloader)throw Error(`The current tensor is not created with a specified data downloader.`);if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);try{this.isDownloading=!0;let t=await this.downloader();return this.downloader=void 0,this.dataLocation=`cpu`,this.cpuData=t,e&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}default:throw Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);this.disposer&&=(this.disposer(),void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation=`none`}ensureValid(){if(this.dataLocation===`none`)throw Error(`The tensor is disposed.`)}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw Error(`Cannot reshape a tensor that owns GPU resource.`);return xr(this,e)}};let Cr=Sr,wr=(e,t)=>{(or.trace===void 0?!or.wasm.trace:!or.trace)||console.timeStamp(`${e}::ORT::${t}`)},Tr=(e,t)=>{let n=Error().stack?.split(/\r\n|\r|\n/g)||[],r=!1;for(let i=0;i{(or.trace===void 0?!or.wasm.trace:!or.trace)||Tr(`BEGIN`,e)},Dr=e=>{(or.trace===void 0?!or.wasm.trace:!or.trace)||Tr(`END`,e)},Or=e=>{(or.trace===void 0?!or.wasm.trace:!or.trace)||console.time(`ORT::${e}`)},kr=e=>{(or.trace===void 0?!or.wasm.trace:!or.trace)||console.timeEnd(`ORT::${e}`)},Ar=class e{constructor(e){this.handler=e}async run(e,t,n){Er(),Or(`InferenceSession.run`);let r={},i={};if(typeof e!=`object`||!e||e instanceof Cr||Array.isArray(e))throw TypeError(`'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.`);let a=!0;if(typeof t==`object`){if(t===null)throw TypeError(`Unexpected argument[1]: cannot be null.`);if(t instanceof Cr)throw TypeError(`'fetches' cannot be a Tensor`);if(Array.isArray(t)){if(t.length===0)throw TypeError(`'fetches' cannot be an empty array.`);a=!1;for(let e of t){if(typeof e!=`string`)throw TypeError(`'fetches' must be a string array or an object.`);if(this.outputNames.indexOf(e)===-1)throw RangeError(`'fetches' contains invalid output name: ${e}.`);r[e]=null}if(typeof n==`object`&&n)i=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else{let e=!1,o=Object.getOwnPropertyNames(t);for(let n of this.outputNames)if(o.indexOf(n)!==-1){let i=t[n];(i===null||i instanceof Cr)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else i=t}}else if(t!==void 0)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(e[t]===void 0)throw Error(`input '${t}' is missing in 'feeds'.`);if(a)for(let e of this.outputNames)r[e]=null;let o=await this.handler.run(e,r,i),s={};for(let e in o)if(Object.hasOwnProperty.call(o,e)){let t=o[e];t instanceof Cr?s[e]=t:s[e]=new Cr(t.type,t.data,t.dims)}return kr(`InferenceSession.run`),Dr(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){Er(),Or(`InferenceSession.create`);let a,o={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)o=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)o=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer){let e=t,s=0,c=t.byteLength;if(typeof n==`object`&&n)o=n;else if(typeof n==`number`){if(s=n,!Number.isSafeInteger(s))throw RangeError(`'byteOffset' must be an integer.`);if(s<0||s>=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(c=t.byteLength-s,typeof r==`number`){if(c=r,!Number.isSafeInteger(c))throw RangeError(`'byteLength' must be an integer.`);if(c<=0||s+c>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-s}].`);if(typeof i==`object`&&i)o=i;else if(i!==void 0)throw TypeError(`'options' must be an object.`)}else if(r!==void 0)throw TypeError(`'byteLength' must be a number.`)}else if(n!==void 0)throw TypeError(`'options' must be an object.`);a=new Uint8Array(e,s,c)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let[s,c]=await ir(o),l=await s.createInferenceSessionHandler(a,c);return kr(`InferenceSession.create`),Dr(),new e(l)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}};var jr=s({InferenceSession:()=>Ar,TRACE:()=>wr,TRACE_EVENT_BEGIN:()=>Or,TRACE_EVENT_END:()=>kr,TRACE_FUNC_BEGIN:()=>Er,TRACE_FUNC_END:()=>Dr,Tensor:()=>Cr,env:()=>sr,registerBackend:()=>nr}),Mr={url:self.location.href},Nr=Object.defineProperty,Pr=(e,t)=>{for(var n in t)Nr(e,n,{get:t[n],enumerable:!0})},Fr={},Ir={},Lr={},Rr=`4.2.0`,zr=typeof self<`u`,Br=!fi(Fr),Vr=!fi(Ir),Hr=zr&&`caches`in self,Ur=globalThis.Deno!==void 0;globalThis.Bun;var Wr=Ur&&Hr&&!Br,Gr=typeof process<`u`,Kr=Gr&&process?.release?.name===`node`&&!Wr,qr=typeof window<`u`&&window.document!==void 0,Jr=zr&&[`DedicatedWorkerGlobalScope`,`ServiceWorkerGlobalScope`,`SharedWorkerGlobalScope`].includes(self.constructor?.name),Yr=qr||Jr||Wr,Xr=Kr||typeof navigator<`u`&&`gpu`in navigator,Zr=typeof navigator<`u`&&`ml`in navigator,Qr=typeof crypto<`u`&&typeof crypto.getRandomValues==`function`,$r=typeof chrome<`u`&&chrome.runtime!==void 0&&typeof chrome.runtime.id==`string`,ei=typeof ServiceWorkerGlobalScope<`u`&&zr&&self instanceof ServiceWorkerGlobalScope,ti=(()=>{if(typeof navigator>`u`)return!1;let e=navigator.userAgent,t=(navigator.vendor||``).indexOf(`Apple`)>-1,n=!e.match(/CriOS|FxiOS|EdgiOS|OPiOS|mercury|brave/i)&&!e.includes(`Chrome`)&&!e.includes(`Android`);return t&&n})(),ni=Object.freeze({IS_BROWSER_ENV:qr,IS_WEBWORKER_ENV:Jr,IS_WEB_ENV:Yr,IS_SERVICE_WORKER_ENV:ei,IS_DENO_WEB_RUNTIME:Wr,IS_WEB_CACHE_AVAILABLE:Hr,IS_WEBGPU_AVAILABLE:Xr,IS_WEBNN_AVAILABLE:Zr,IS_SAFARI:ti,IS_PROCESS_AVAILABLE:Gr,IS_NODE_ENV:Kr,IS_FS_AVAILABLE:Br,IS_PATH_AVAILABLE:Vr,IS_CRYPTO_AVAILABLE:Qr,IS_CHROME_AVAILABLE:$r}),ri=Br&&Vr,ii=`./`;if(ri){let e=Object(Mr).url;e?ii=Ir.dirname(Ir.dirname(Lr.fileURLToPath(e))):typeof __dirname<`u`&&(ii=Ir.dirname(__dirname))}var ai=ri?Ir.join(ii,`/.cache/`):null,oi=`/models/`,si=ri?Ir.join(ii,oi):oi,ci=typeof globalThis.fetch==`function`?globalThis.fetch.bind(globalThis):void 0,li=Object.freeze({DEBUG:10,INFO:20,WARNING:30,ERROR:40,NONE:50}),ui=li.WARNING,di={version:Rr,backends:{onnx:{}},get logLevel(){return ui},set logLevel(e){ui=e,di.backends.onnx?.setLogLevel?.(e)},allowRemoteModels:!0,remoteHost:`https://huggingface.co/`,remotePathTemplate:`{model}/resolve/{revision}/`,allowLocalModels:!(qr||Jr||Wr),localModelPath:si,useFS:Br,useBrowserCache:Hr,useFSCache:Br,cacheDir:ai,useCustomCache:!1,customCache:null,useWasmCache:Hr||Br,cacheKey:`transformers-cache`,experimental_useCrossOriginStorage:!1,fetch:ci};function fi(e){return Object.keys(e).length===0}var pi=class{constructor(){let e=function(...t){return e._call(...t)};return Object.setPrototypeOf(e,new.target.prototype)}_call(...e){throw Error(`Must implement _call method in subclass`)}};function mi(e,t){e&&e(t)}var hi=class extends pi{constructor(e,t){super(),this.callback=e,this.files_loading=t}_call(e){if(e.status===`progress`){this.files_loading[e.file]={loaded:e.loaded,total:e.total};let t=Object.values(this.files_loading).reduce((e,t)=>e+t.loaded,0),n=Object.values(this.files_loading).reduce((e,t)=>e+t.total,0),r=n>0?t/n*100:0;this.callback({status:`progress_total`,name:e.name,progress:r,loaded:t,total:n,files:structuredClone(this.files_loading)})}this.callback(e)}};function gi(e){return Number.isInteger(e)||typeof e==`bigint`}function _i(e){return e==null||e===-1}function vi(e){let t=[],n=e;for(;Array.isArray(n);)t.push(n.length),n=n[0];return t}function yi(...e){return Array.prototype.concat.apply([],e)}function bi(...e){return e.reduce((e,t)=>e.flatMap(e=>t.map(t=>[e,t])))}function xi(e,t){return Math.abs((e+t)%(2*t)-t)}function Si(e,t){return Object.assign({},...t.map(t=>{if(e[t]!==void 0)return{[t]:e[t]}}))}function Ci(e,t){let n=0;for(let r of e)r===t&&++n;return n}var wi={error(...e){di.logLevel<=li.ERROR&&console.error(...e)},warn(...e){di.logLevel<=li.WARNING&&console.warn(...e)},info(...e){di.logLevel<=li.INFO&&console.log(...e)},debug(...e){di.logLevel<=li.DEBUG&&console.log(...e)},log(...e){this.info(...e)}},Ti=class{constructor(e){this.trie=this._build_trie(e)}_build_trie(e){let t=Object.create(null);for(let n of e){let e=t;for(let t=0;tr&&t.push(e.slice(r,i)),t.push(o),i+=o.length,r=i):++i}return r{let e=[...Array.from({length:94},(e,t)=>t+33),...Array.from({length:12},(e,t)=>t+161),...Array.from({length:82},(e,t)=>t+174)],t=e.slice(),n=0;for(let r=0;r<256;++r)e.includes(r)||(e.push(r),t.push(256+n),n+=1);let r=t.map(e=>String.fromCharCode(e));return Object.fromEntries(e.map((e,t)=>[e,r[t]]))})(),Oi=(e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[t,e])))(Di),ki=`.,!?…。,、।۔،`,Ai=new Map([[`(?i:'s|'t|'re|'ve|'m|'ll|'d)`,`(?:'([sS]|[tT]|[rR][eE]|[vV][eE]|[mM]|[lL][lL]|[dD]))`],[`(?i:[sdmt]|ll|ve|re)`,`(?:[sS]|[dD]|[mM]|[tT]|[lL][lL]|[vV][eE]|[rR][eE])`],[`[^\\r\\n\\p{L}\\p{N}]?+`,`[^\\r\\n\\p{L}\\p{N}]?`],[`[^\\s\\p{L}\\p{N}]++`,`[^\\s\\p{L}\\p{N}]+`],[`(?>\\p{Nd}{510})`,`(?:\\p{Nd}{510})`],[`\\p{Nd}{3}+`,`(?:\\p{Nd}{3})+`],[`\\G`,``],[` ?[^(\\s|[${ki}])]+`,` ?[^\\s${ki}]+`]]),ji=`\\p{P}\\u0021-\\u002F\\u003A-\\u0040\\u005B-\\u0060\\u007B-\\u007E`,Mi=e=>e.replace(/ \./g,`.`).replace(/ \?/g,`?`).replace(/ \!/g,`!`).replace(/ ,/g,`,`).replace(/ \' /g,`'`).replace(/ n't/g,`n't`).replace(/ 'm/g,`'m`).replace(/ 's/g,`'s`).replace(/ 've/g,`'ve`).replace(/ 're/g,`'re`),Ni=(e,t=!0)=>{if(e.Regex!==void 0){let t=e.Regex.replace(/\\([#&~])/g,`$1`);t=t.replace(/\\A/g,`^`).replace(/\\z/g,`$`).replace(/\\Z/g,`(?=\\r?\\n?$)`);for(let[e,n]of Ai)t=t.replaceAll(e,n);try{return new RegExp(t,`gu`)}catch(e){if(!(e instanceof SyntaxError)||!e.message.toLowerCase().includes(`invalid property name`))throw e;let n=!1,r=t.replace(/(\\[pP])\{([^}=]+)\}/g,(e,t,r)=>{try{return RegExp(`\\p{${r}}`,`u`),`${t}{${r}}`}catch{return n=!0,`${t}{Script=${r}}`}});if(!n)throw e;try{return new RegExp(r,`gu`)}catch{throw e}}}else if(e.String!==void 0){let n=Pi(e.String);return new RegExp(t?n:`(${n})`,`gu`)}else return console.warn(`Unknown pattern type:`,e),null},Pi=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),Fi=(e,t,n)=>{let r=[],i=0;for(;ie>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103,Li=e=>Number.isInteger(e)||typeof e==`bigint`,Ri=e=>{let t=0;for(let n of e)++t;return t},zi=e=>Ui(e.toLowerCase()),Bi=(...e)=>Array.prototype.concat.apply([],e),Vi=e=>new Map(Object.entries(e)),Hi=(e,t)=>{let n=[],r=0;for(let i of e.matchAll(t)){let t=i[0];r0&&n.push(t),r=i.index+t.length}return re.replace(/\p{M}/gu,``),Wi=(e,t,n=[])=>{if(!e||Array.isArray(e)||typeof e!=`object`)return`${t} must be a valid object`;for(let r of n)if(!(r in e))return`${t} must contain a "${r}" property`;return null},Gi=e=>e.match(/\S+/g)||[],Ki=class{constructor(){let e=function(...t){return e._call(...t)};return Object.setPrototypeOf(e,new.target.prototype)}},qi=class extends Ki{constructor(e){super(),this.config=e}_call(e){return this.normalize(e)}},Ji=class extends qi{tokenize_chinese_chars(e){let t=[];for(let n=0;ne.normalize(`NFKC`)).join(`~`):e.normalize(`NFKC`),e}},Xi=class extends qi{constructor(e){super(e),this.normalizers=(e.normalizers??[]).map(e=>ca(e))}normalize(e){return this.normalizers.reduce((e,t)=>t?t.normalize(e):e,e)}},Zi=class extends qi{normalize(e){let t=Ni(this.config.pattern??{});return t===null?e:e.replaceAll(t,this.config.content??``)}},Qi=class extends qi{constructor(){super(...arguments),this.form=`NFC`}normalize(e){return e=e.normalize(this.form),e}},$i=class extends Qi{constructor(){super(...arguments),this.form=`NFC`}},ea=class extends Qi{constructor(){super(...arguments),this.form=`NFD`}},ta=class extends Qi{constructor(){super(...arguments),this.form=`NFKC`}},na=class extends Qi{constructor(){super(...arguments),this.form=`NFKD`}},ra=class extends qi{normalize(e){return this.config.strip_left&&this.config.strip_right?e=e.trim():(this.config.strip_left&&(e=e.trimStart()),this.config.strip_right&&(e=e.trimEnd())),e}},ia=class extends qi{normalize(e){return Ui(e)}},aa=class extends qi{normalize(e){return e.toLowerCase()}},oa=class extends qi{normalize(e){return e=this.config.prepend+e,e}};function sa(e){if(e===null)return null;switch(e.type){case`BertNormalizer`:return new Ji(e);case`Precompiled`:return new Yi(e);case`Sequence`:return new Xi(e);case`Replace`:return new Zi(e);case`NFC`:return new $i(e);case`NFD`:return new ea(e);case`NFKC`:return new ta(e);case`NFKD`:return new na(e);case`Strip`:return new ra(e);case`StripAccents`:return new ia(e);case`Lowercase`:return new aa(e);case`Prepend`:return new oa(e);default:throw Error(`Unknown Normalizer type: ${e.type}`)}}var ca=sa,la=class extends Ki{pre_tokenize(e,t){return(Array.isArray(e)?e.map(e=>this.pre_tokenize_text(e,t)):this.pre_tokenize_text(e,t)).flat()}_call(e,t){return this.pre_tokenize(e,t)}},ua=class extends la{constructor(e){super(),this.config=e,this.add_prefix_space=this.config.add_prefix_space??!1,this.trim_offsets=this.config.trim_offsets??!1,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=Di,this.text_encoder=new TextEncoder}pre_tokenize_text(e,t){return this.add_prefix_space&&!e.startsWith(` `)&&(e=` `+e),(this.use_regex?e.match(this.pattern)||[]:[e]).map(e=>Array.from(this.text_encoder.encode(e),e=>this.byte_encoder[e]).join(``))}},da=class extends la{pre_tokenize_text(e,t){return e.match(/\w+|[^\w\s]+/g)||[]}},fa=class extends la{constructor(e){super(),this.replacement=e.replacement??`▁`,this.str_rep=e.str_rep||this.replacement,this.prepend_scheme=e.prepend_scheme??`always`}pre_tokenize_text(e,t){let{section_index:n=void 0}=t??{},r=e.replaceAll(` `,this.str_rep);return!r.startsWith(this.replacement)&&(this.prepend_scheme===`always`||this.prepend_scheme===`first`&&n===0)&&(r=this.str_rep+r),[r]}},pa=class extends la{constructor(e){super(),this.config=e,this.pattern=Ni(this.config.pattern??{},this.config.invert??!0)}pre_tokenize_text(e){return this.pattern===null?[]:this.config.invert?e.match(this.pattern)||[]:this.config.behavior?.toLowerCase()===`removed`?e.split(this.pattern).filter(e=>e):Hi(e,this.pattern)}},ma=class extends la{constructor(e){super(),this.config=e,this.pattern=RegExp(`[^${ji}]+|[${ji}]+`,`gu`)}pre_tokenize_text(e){return e.match(this.pattern)||[]}},ha=class extends la{constructor(e){super(),this.config=e;let t=`[^\\d]+|\\d${this.config.individual_digits?``:`+`}`;this.pattern=new RegExp(t,`gu`)}pre_tokenize_text(e){return e.match(this.pattern)||[]}},ga=class extends la{constructor(){super(),this.pattern=RegExp(`[^\\s${ji}]+|[${ji}]`,`gu`)}pre_tokenize_text(e,t){return e.trim().match(this.pattern)||[]}},_a=class extends la{constructor(e){super(),this.config=e,this.pattern=Ni(this.config.pattern??{}),this.content=this.config.content??``}pre_tokenize_text(e){return this.pattern===null?[e]:[e.replaceAll(this.pattern,this.config.content??``)]}},va=class extends la{constructor(e){super(),this.tokenizers=(e.pretokenizers??[]).map(e=>Sa(e))}pre_tokenize_text(e,t){return this.tokenizers.reduce((e,n)=>n?n.pre_tokenize(e,t):e,[e])}},ya=class extends la{pre_tokenize_text(e){return Gi(e)}},ba=class extends la{constructor(e){super(),this.config=e,this._length=e.length}pre_tokenize_text(e){let t=[];for(let n=0;nthis.max_input_chars_per_word){t.push(this.unk_token);continue}let r=!1,i=0,a=[];for(;i0&&(r=this.config.continuing_subword_prefix+r),this.tokens_to_ids.has(r)){n=r;break}--t}if(n===null){r=!0;break}a.push(n),i=t}r?t.push(this.unk_token):t.push(...a)}return t}},Ta=class e{constructor(e,t){this.is_leaf=e,this.children=t}static default(){return new e(!1,new Map)}},Ea=class{constructor(){this.root=Ta.default()}extend(e){for(let t of e)this.push(t)}push(e){let t=this.root;for(let n of e){let e=t.children.get(n);e===void 0&&(e=Ta.default(),t.children.set(n,e)),t=e}t.is_leaf=!0}*common_prefix_search(e){let t=this.root;if(t===void 0)return;let n=``;for(let r of e){if(n+=r,t=t.children.get(r),t===void 0)return;t.is_leaf&&(yield n)}}},Da=class e{constructor(e,t,n,r,i){this.token_id=e,this.node_id=t,this.pos=n,this.length=r,this.score=i,this.prev=null,this.backtrace_score=0}clone(){let t=new e(this.token_id,this.node_id,this.pos,this.length,this.score);return t.prev=this.prev,t.backtrace_score=this.backtrace_score,t}},Oa=class{constructor(e,t,n){this.chars=Array.from(e),this.len=this.chars.length,this.bos_token_id=t,this.eos_token_id=n,this.nodes=[],this.begin_nodes=Array.from({length:this.len+1},()=>[]),this.end_nodes=Array.from({length:this.len+1},()=>[]);let r=new Da(this.bos_token_id??0,0,0,0,0),i=new Da(this.eos_token_id??0,1,this.len,0,0);this.nodes.push(r.clone()),this.nodes.push(i.clone()),this.begin_nodes[this.len].push(i),this.end_nodes[0].push(r)}insert(e,t,n,r){let i=this.nodes.length,a=new Da(r,i,e,t,n);this.begin_nodes[e].push(a),this.end_nodes[e+t].push(a),this.nodes.push(a)}viterbi(){let e=this.len,t=0;for(;t<=e;){if(this.begin_nodes[t].length==0)return[];for(let e of this.begin_nodes[t]){e.prev=null;let n=0,r=null;for(let i of this.end_nodes[t]){let t=i.backtrace_score+e.score;(r===null||t>n)&&(r=i.clone(),n=t)}if(r!==null)e.prev=r,e.backtrace_score=n;else return[]}++t}let n=[],r=this.begin_nodes[e][0].prev;if(r===null)return[];let i=r.clone();for(;i.prev!==null;)n.push(i.clone()),i=i.clone().prev.clone();return n.reverse(),n}piece(e){return this.chars.slice(e.pos,e.pos+e.length).join(``)}tokens(){return this.viterbi().map(e=>this.piece(e))}token_ids(){return this.viterbi().map(e=>e.token_id)}};function ka(e){if(e.length===0)throw Error(`Array must not be empty`);let t=e[0],n=0;for(let r=1;r[e,t])),this.bos_token=` `,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.unk_token=this.vocab[this.unk_token_id],this.min_score=ka(this.scores)[0],this.unk_score=this.min_score-10,this.scores[this.unk_token_id]=this.unk_score,this.trie=new Ea,this.trie.extend(this.vocab),this.fuse_unk=!0}populate_nodes(e){let t=e.chars,n=0;for(;ne>t,t=1/0){this._heap=[],this._comparator=e,this._max_size=t}get size(){return this._heap.length}is_empty(){return this.size===0}peek(){return this._heap[0]}push(...e){return this.extend(e)}extend(e){for(let t of e)if(this.size0&&this._swap(0,t),this._heap.pop(),this._sift_down(),e}replace(e){let t=this.peek();return this._heap[0]=e,this._sift_down(),t}_parent(e){return(e+1>>>1)-1}_left(e){return(e<<1)+1}_right(e){return e+1<<1}_greater(e,t){return this._comparator(this._heap[e],this._heap[t])}_swap(e,t){let n=this._heap[e];this._heap[e]=this._heap[t],this._heap[t]=n}_sift_up(){this._sift_up_from(this.size-1)}_sift_up_from(e){for(;e>0&&this._greater(e,this._parent(e));)this._swap(e,this._parent(e)),e=this._parent(e)}_sift_down(){let e=0;for(;this._left(e)this.capacity&&this.cache.delete(this.cache.keys().next().value)}clear(){this.cache.clear()}},Na=class extends Ca{constructor(e){super(e),this.tokens_to_ids=Vi(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e;let t=Array.isArray(e.merges[0]);this.merges=t?e.merges:e.merges.map(e=>e.split(` `,2)),this.bpe_ranks=new Map(this.merges.map((e,t)=>[JSON.stringify(e),t])),this.end_of_word_suffix=e.end_of_word_suffix,this.continuing_subword_suffix=e.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.max_length_to_cache=256,this.cache_capacity=1e4,this.cache=new Ma(this.cache_capacity)}clear_cache(){this.cache.clear()}bpe(e){if(e.length===0)return[];let t=this.cache.get(e);if(t!==void 0)return t;let n=Array.from(e);this.end_of_word_suffix&&(n[n.length-1]+=this.end_of_word_suffix);let r=[];if(n.length>1){let e=new ja((e,t)=>e.score`<0x${e.toString(16).toUpperCase().padStart(2,`0`)}>`);e.every(e=>this.tokens_to_ids.has(e))?t.push(...e):this.unk_token!=null&&t.push(this.unk_token)}else this.unk_token!=null&&t.push(this.unk_token)}return t}},Pa=class extends Ca{constructor(e,t){super(e);let n=e.vocab;this.tokens_to_ids=Vi(t.target_lang?n[t.target_lang]:n),this.bos_token=t.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=t.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=t.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){return e}};function Fa(e,t){switch(e.type){case`WordPiece`:return new wa(e);case`Unigram`:return new Aa(e,t.eos_token);case`BPE`:return new Na(e);default:if(e.vocab)return Array.isArray(e.vocab)?new Aa(e,t.eos_token):Object.hasOwn(e,`continuing_subword_prefix`)&&Object.hasOwn(e,`unk_token`)?Object.hasOwn(e,`merges`)?new Na(e):new wa(e):new Pa(e,{target_lang:t.target_lang,bos_token:t.bos_token,eos_token:t.eos_token,pad_token:t.pad_token,unk_token:t.unk_token});throw Error(`Unknown TokenizerModel type: ${e?.type}`)}}var Ia=Fa,La=class extends Ki{constructor(e){super(),this.config=e}_call(e,...t){return this.post_process(e,...t)}},Ra=class extends La{post_process(e,t=null,n=!0){let r=t===null?this.config.single:this.config.pair,i=[],a=[];for(let o of r)`SpecialToken`in o?n&&(i.push(o.SpecialToken.id),a.push(o.SpecialToken.type_id)):`Sequence`in o&&(o.Sequence.id===`A`?(i=Bi(i,e),a=Bi(a,Array(e.length).fill(o.Sequence.type_id))):o.Sequence.id===`B`&&(i=Bi(i,t),a=Bi(a,Array(t.length).fill(o.Sequence.type_id))));return{tokens:i,token_type_ids:a}}},za=class extends La{post_process(e,t=null){return{tokens:e,tokens_pair:t}}},Ba=class extends La{constructor(e){super(e),this.sep=e.sep,this.cls=e.cls}post_process(e,t=null,n=!0){n&&(e=Bi([this.cls[0]],e,[this.sep[0]]));let r=Array(e.length).fill(0);if(t){let i=[],a=n?[this.sep[0]]:[];e=Bi(e,i,t,a),r=Bi(r,Array(t.length+i.length+a.length).fill(1))}return{tokens:e,token_type_ids:r}}},Va=class extends La{constructor(e){super(e),this.sep=e.sep,this.cls=e.cls}post_process(e,t,n=!0){n&&(e=Bi([this.cls[0]],e,[this.sep[0]]));let r=Array(e.length).fill(0);if(t){let i=n?[this.sep[0]]:[],a=n?[this.sep[0]]:[];e=Bi(e,i,t,a),r=Bi(r,Array(t.length+i.length+a.length).fill(1))}return{tokens:e,token_type_ids:r}}},Ha=class extends La{constructor(e){super(e),this.processors=(e.processors??[]).map(e=>Wa(e))}post_process(e,t=null,n=!0){let r={tokens:e,tokens_pair:t};for(let e of this.processors)r=e.post_process(r.tokens,r.tokens_pair,n);return r}};function Ua(e){if(e===null)return null;switch(e.type){case`TemplateProcessing`:return new Ra(e);case`ByteLevel`:return new za(e);case`BertProcessing`:return new Ba(e);case`RobertaProcessing`:return new Va(e);case`Sequence`:return new Ha(e);default:throw Error(`Unknown PostProcessor type: ${e.type}`)}}var Wa=Ua,Ga=class extends Ki{constructor(e){super(),this.config=e,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=`trim_offsets`in e?e.trim_offsets:!1}_call(e){return this.decode(e)}decode(e){return this.decode_chain(e).join(``)}},Ka=class extends Ga{constructor(e){super(e),this.byte_decoder=Oi,this.text_decoder=new TextDecoder(`utf-8`,{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(e){let t=e.join(``),n=new Uint8Array([...t].map(e=>this.byte_decoder[e]));return this.text_decoder.decode(n)}decode_chain(e){let t=[],n=[];for(let r of e)this.added_tokens.find(e=>e.content===r)===void 0?n.push(r):(n.length>0&&(t.push(this.convert_tokens_to_string(n)),n=[]),t.push(r));return n.length>0&&t.push(this.convert_tokens_to_string(n)),t}},qa=class extends Ga{constructor(e){super(e),this.cleanup=e.cleanup}decode_chain(e){return e.map((e,t)=>{if(t!==0){let t=this.config.prefix;e=t&&e.startsWith(t)?e.replace(t,``):` `+e}return this.cleanup&&(e=Mi(e)),e})}},Ja=class extends Ga{constructor(e){super(e),this.replacement=e.replacement??`▁`}decode_chain(e){let t=[];for(let n=0;nt.replaceAll(this.suffix,n===e.length-1?``:` `))}},Xa=class extends Ga{constructor(e){super(e),this.pad_token=e.pad_token??``,this.word_delimiter_token=e.word_delimiter_token??``,this.cleanup=e.cleanup}convert_tokens_to_string(e){if(e.length===0)return``;let t=[e[0]];for(let n=1;ne!==this.pad_token).join(``);return this.cleanup&&(n=Mi(n).replaceAll(this.word_delimiter_token,` `).trim()),n}decode_chain(e){return[this.convert_tokens_to_string(e)]}},Za=class extends Ga{constructor(e){super(e),this.decoders=(e.decoders??[]).map(e=>ro(e))}decode_chain(e){return this.decoders.reduce((e,t)=>t.decode_chain(e),e)}},Qa=class extends Ga{decode_chain(e){let t=Ni(this.config.pattern),n=this.config.content??``;return t===null?e:e.map(e=>e.replaceAll(t,n))}},$a=class extends Ga{decode_chain(e){return[e.join(``)]}},eo=class extends Ga{constructor(e){super(e),this.content=e.content??``,this.start=e.start??0,this.stop=e.stop??0}decode_chain(e){return e.map(e=>{let t=0;for(let n=0;n`)){let t=parseInt(r.slice(3,5),16);isNaN(t)||(e=t)}if(e!==null)n.push(e);else{if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}t.push(r)}}if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}return t}};function no(e){if(e===null)return null;switch(e.type){case`ByteLevel`:return new Ka(e);case`WordPiece`:return new qa(e);case`Metaspace`:return new Ja(e);case`BPEDecoder`:return new Ya(e);case`CTC`:return new Xa(e);case`Sequence`:return new Za(e);case`Replace`:return new Qa(e);case`Fuse`:return new $a(e);case`Strip`:return new eo(e);case`ByteFallback`:return new to(e);default:throw Error(`Unknown Decoder type: ${e.type}`)}}var ro=no,io=class{constructor(e,t){let n=Wi(e,`Tokenizer`,[`model`,`decoder`,`post_processor`,`pre_tokenizer`,`normalizer`]);if(n)throw Error(n);let r=Wi(t,`Config`);if(r)throw Error(r);this.tokenizer=e,this.config=t,this.normalizer=ca(this.tokenizer.normalizer),this.pre_tokenizer=Sa(this.tokenizer.pre_tokenizer),this.model=Ia(this.tokenizer.model,this.config),this.post_processor=Wa(this.tokenizer.post_processor),this.decoder=ro(this.tokenizer.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];let i=[],a=[];this.added_tokens_map=new Map;for(let e of this.tokenizer.added_tokens){let t=new Ei(e);if(this.added_tokens.push(t),this.model.tokens_to_ids.set(t.content,t.id),this.model.vocab[t.id]=t.content,t.special&&(this.special_tokens.push(t.content),this.all_special_ids.push(t.id)),this.added_tokens_map.set(t.content,t),t.normalized&&this.normalizer!==null){let e=this.normalizer(t.content);a.push(e),this.added_tokens_map.set(e,t)}else i.push(t.content)}(this.config.additional_special_tokens??[]).forEach(e=>{this.special_tokens.includes(e)||this.special_tokens.push(e)}),this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.splitter_unnormalized=new Ti(i),this.splitter_normalized=new Ti(a),this.remove_space=this.config.remove_space,this.clean_up_tokenization_spaces=this.config.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=this.config.do_lowercase_and_remove_accent??!1}encode(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){let{tokens:i,token_type_ids:a}=this.tokenize_helper(e,{text_pair:t,add_special_tokens:n}),o=i.map(e=>this.added_tokens_map.get(e)?.id??this.model.tokens_to_ids.get(e)??this.model.unk_token_id),s={ids:o,tokens:i,attention_mask:Array(o.length).fill(1)};return r&&a&&(s.token_type_ids=a),s}decode(e,t={}){if(!Array.isArray(e)||e.length===0||!Li(e[0]))throw Error(`token_ids must be a non-empty array of integers.`);let n=e.map(e=>this.model.vocab[Number(e)]??this.model.unk_token);t.skip_special_tokens&&(n=n.filter(e=>!this.special_tokens.includes(e)));let r=this.decoder?this.decoder(n):n.join(` `);return this.decoder&&this.decoder.end_of_word_suffix&&(r=r.replaceAll(this.decoder.end_of_word_suffix,` `),t.skip_special_tokens&&(r=r.trim())),(t.clean_up_tokenization_spaces??this.clean_up_tokenization_spaces)&&(r=Mi(r)),r}tokenize(e,{text_pair:t=null,add_special_tokens:n=!1}={}){return this.tokenize_helper(e,{text_pair:t,add_special_tokens:n}).tokens}encode_text(e){if(e===null)return null;let t=this.splitter_unnormalized.split(e);return t.forEach((e,n)=>{let r=this.added_tokens_map.get(e);r&&(r.lstrip&&n>0&&(t[n-1]=t[n-1].trimEnd()),r.rstrip&&n{if(e.length===0)return[];if(this.added_tokens_map.has(e))return[e];if(this.remove_space===!0&&(e=e.trim().split(/\s+/).join(` `)),this.do_lowercase_and_remove_accent&&(e=zi(e)),this.normalizer!==null&&(e=this.normalizer(e)),e.length===0)return[];let n=this.splitter_normalized.split(e);return n.forEach((e,t)=>{let r=this.added_tokens_map.get(e);r&&(r.lstrip&&t>0&&(n[t-1]=n[t-1].trimEnd()),r.rstrip&&t{if(e.length===0)return[];if(this.added_tokens_map.has(e))return[e];let n=this.pre_tokenizer===null?[e]:this.pre_tokenizer(e,{section_index:t});return this.model(n)})})}tokenize_helper(e,{text_pair:t=null,add_special_tokens:n=!0}){let r=this.encode_text(e),i=this.encode_text(t||null);return this.post_processor?this.post_processor(r,i,n):{tokens:Bi(r??[],i??[])}}token_to_id(e){return this.model.tokens_to_ids.get(e)}id_to_token(e){return this.model.vocab[e]}get_added_tokens_decoder(){let e=new Map;for(let t of this.added_tokens)e.set(t.id,t);return e}get_vocab(e=!0){let t=new Map;for(let n=0;n=`,W.ComparisonBinaryOperator],[`==`,W.ComparisonBinaryOperator],[`!=`,W.ComparisonBinaryOperator],[`<`,W.ComparisonBinaryOperator],[`>`,W.ComparisonBinaryOperator],[`+`,W.AdditiveBinaryOperator],[`-`,W.AdditiveBinaryOperator],[`~`,W.AdditiveBinaryOperator],[`*`,W.MultiplicativeBinaryOperator],[`/`,W.MultiplicativeBinaryOperator],[`%`,W.MultiplicativeBinaryOperator],[`=`,W.Equals]],uo=new Map([[`n`,` +`],[`t`,` `],[`r`,`\r`],[`b`,`\b`],[`f`,`\f`],[`v`,`\v`],[`'`,`'`],[`"`,`"`],[`\\`,`\\`]]);function fo(e,t={}){return e.endsWith(` +`)&&(e=e.slice(0,-1)),t.lstrip_blocks&&(e=e.replace(/^[ \t]*({[#%-])/gm,`$1`)),t.trim_blocks&&(e=e.replace(/([#%-]})\n/g,`$1`)),e.replace(/{%\s*(end)?generation\s*%}/gs,``)}function po(e,t={}){let n=[],r=fo(e,t),i=0,a=0,o=e=>{let t=``;for(;e(r[i]);){if(r[i]===`\\`){if(++i,i>=r.length)throw SyntaxError(`Unexpected end of input`);let e=r[i++],n=uo.get(e);if(n===void 0)throw SyntaxError(`Unexpected escaped character: ${e}`);t+=n;continue}if(t+=r[i++],i>=r.length)throw SyntaxError(`Unexpected end of input`)}return t},s=()=>{let e=n.at(-1);e&&e.type===W.Text&&(e.value=e.value.trimEnd(),e.value===``&&n.pop())},c=()=>{for(;i0){n.push(new ao(e,W.Text));continue}}if(r[i]===`{`&&r[i+1]===`#`){i+=2;let e=r[i]===`-`;e&&++i;let t=``;for(;r[i]!==`#`||r[i+1]!==`}`;){if(i+2>=r.length)throw SyntaxError(`Missing end of comment tag`);t+=r[i++]}let a=t.endsWith(`-`);a&&(t=t.slice(0,-1)),e&&s(),n.push(new ao(t,W.Comment)),i+=2,a&&c();continue}if(r.slice(i,i+3)===`{%-`){s(),n.push(new ao(`{%`,W.OpenStatement)),i+=3;continue}if(r.slice(i,i+3)===`{{-`){s(),n.push(new ao(`{{`,W.OpenExpression)),a=0,i+=3;continue}if(o(co),r.slice(i,i+3)===`-%}`){n.push(new ao(`%}`,W.CloseStatement)),i+=3,c();continue}if(r.slice(i,i+3)===`-}}`){n.push(new ao(`}}`,W.CloseExpression)),i+=3,c();continue}let t=r[i];if(t===`-`||t===`+`){let e=n.at(-1)?.type;if(e===W.Text||e===void 0)throw SyntaxError(`Unexpected character: ${t}`);switch(e){case W.Identifier:case W.NumericLiteral:case W.StringLiteral:case W.CloseParen:case W.CloseSquareBracket:break;default:{++i;let e=o(so);n.push(new ao(`${t}${e}`,e.length>0?W.NumericLiteral:W.UnaryOperator));continue}}}for(let[e,t]of lo)if(!(e===`}}`&&a>0)&&r.slice(i,i+e.length)===e){n.push(new ao(e,t)),t===W.OpenExpression?a=0:t===W.OpenCurlyBracket?++a:t===W.CloseCurlyBracket&&--a,i+=e.length;continue main}if(t===`'`||t===`"`){++i;let e=o(e=>e!==t);n.push(new ao(e,W.StringLiteral)),++i;continue}if(so(t)){let e=o(so);if(r[i]===`.`&&so(r[i+1])){++i;let t=o(so);e=`${e}.${t}`}n.push(new ao(e,W.NumericLiteral));continue}if(oo(t)){let e=o(oo);n.push(new ao(e,W.Identifier));continue}throw SyntaxError(`Unexpected character: ${t}`)}return n}var mo=class{type=`Statement`},ho=class extends mo{constructor(e){super(),this.body=e}type=`Program`},go=class extends mo{constructor(e,t,n){super(),this.test=e,this.body=t,this.alternate=n}type=`If`},_o=class extends mo{constructor(e,t,n,r){super(),this.loopvar=e,this.iterable=t,this.body=n,this.defaultBlock=r}type=`For`},vo=class extends mo{type=`Break`},yo=class extends mo{type=`Continue`},bo=class extends mo{constructor(e,t,n){super(),this.assignee=e,this.value=t,this.body=n}type=`Set`},xo=class extends mo{constructor(e,t,n){super(),this.name=e,this.args=t,this.body=n}type=`Macro`},So=class extends mo{constructor(e){super(),this.value=e}type=`Comment`},Co=class extends mo{type=`Expression`},wo=class extends Co{constructor(e,t,n){super(),this.object=e,this.property=t,this.computed=n}type=`MemberExpression`},To=class extends Co{constructor(e,t){super(),this.callee=e,this.args=t}type=`CallExpression`},Eo=class extends Co{constructor(e){super(),this.value=e}type=`Identifier`},Do=class extends Co{constructor(e){super(),this.value=e}type=`Literal`},Oo=class extends Do{type=`IntegerLiteral`},ko=class extends Do{type=`FloatLiteral`},Ao=class extends Do{type=`StringLiteral`},jo=class extends Do{type=`ArrayLiteral`},Mo=class extends Do{type=`TupleLiteral`},No=class extends Do{type=`ObjectLiteral`},Po=class extends Co{constructor(e,t,n){super(),this.operator=e,this.left=t,this.right=n}type=`BinaryExpression`},Fo=class extends Co{constructor(e,t){super(),this.operand=e,this.filter=t}type=`FilterExpression`},Io=class extends mo{constructor(e,t){super(),this.filter=e,this.body=t}type=`FilterStatement`},Lo=class extends Co{constructor(e,t){super(),this.lhs=e,this.test=t}type=`SelectExpression`},Ro=class extends Co{constructor(e,t,n){super(),this.operand=e,this.negate=t,this.test=n}type=`TestExpression`},zo=class extends Co{constructor(e,t){super(),this.operator=e,this.argument=t}type=`UnaryExpression`},Bo=class extends Co{constructor(e=void 0,t=void 0,n=void 0){super(),this.start=e,this.stop=t,this.step=n}type=`SliceExpression`},Vo=class extends Co{constructor(e,t){super(),this.key=e,this.value=t}type=`KeywordArgumentExpression`},Ho=class extends Co{constructor(e){super(),this.argument=e}type=`SpreadExpression`},Uo=class extends mo{constructor(e,t,n){super(),this.call=e,this.callerArgs=t,this.body=n}type=`CallStatement`},Wo=class extends Co{constructor(e,t,n){super(),this.condition=e,this.trueExpr=t,this.falseExpr=n}type=`Ternary`};function Go(e){let t=new ho([]),n=0;function r(t,r){let i=e[n++];if(!i||i.type!==t)throw Error(`Parser Error: ${r}. ${i.type} !== ${t}.`);return i}function i(e){if(!c(e))throw SyntaxError(`Expected ${e}`);++n}function a(){switch(e[n].type){case W.Comment:return new So(e[n++].value);case W.Text:return l();case W.OpenStatement:return u();case W.OpenExpression:return d();default:throw SyntaxError(`Unexpected token type: ${e[n].type}`)}}function o(...t){return n+t.length<=e.length&&t.every((t,r)=>t===e[n+r].type)}function s(...t){return e[n]?.type===W.OpenStatement&&e[n+1]?.type===W.Identifier&&t.includes(e[n+1]?.value)}function c(...t){return n+t.length<=e.length&&t.every((t,r)=>e[n+r].type===`Identifier`&&t===e[n+r].value)}function l(){return new Ao(r(W.Text,`Expected text token`).value)}function u(){if(r(W.OpenStatement,`Expected opening statement token`),e[n].type!==W.Identifier)throw SyntaxError(`Unknown statement, got ${e[n].type}`);let t=e[n].value,c;switch(t){case`set`:++n,c=f();break;case`if`:++n,c=p(),r(W.OpenStatement,`Expected {% token`),i(`endif`),r(W.CloseStatement,`Expected %} token`);break;case`macro`:++n,c=m(),r(W.OpenStatement,`Expected {% token`),i(`endmacro`),r(W.CloseStatement,`Expected %} token`);break;case`for`:++n,c=g(),r(W.OpenStatement,`Expected {% token`),i(`endfor`),r(W.CloseStatement,`Expected %} token`);break;case`call`:{++n;let e=null;o(W.OpenParen)&&(e=E());let t=N();if(t.type!==`Identifier`)throw SyntaxError(`Expected identifier following call statement`);let l=E();r(W.CloseStatement,`Expected closing statement token`);let u=[];for(;!s(`endcall`);)u.push(a());r(W.OpenStatement,`Expected '{%'`),i(`endcall`),r(W.CloseStatement,`Expected closing statement token`),c=new Uo(new To(t,l),e,u);break}case`break`:++n,r(W.CloseStatement,`Expected closing statement token`),c=new vo;break;case`continue`:++n,r(W.CloseStatement,`Expected closing statement token`),c=new yo;break;case`filter`:{++n;let e=N();e instanceof Eo&&o(W.OpenParen)&&(e=T(e)),r(W.CloseStatement,`Expected closing statement token`);let t=[];for(;!s(`endfilter`);)t.push(a());r(W.OpenStatement,`Expected '{%'`),i(`endfilter`),r(W.CloseStatement,`Expected '%}'`),c=new Io(e,t);break}default:throw SyntaxError(`Unknown statement type: ${t}`)}return c}function d(){r(W.OpenExpression,`Expected opening expression token`);let e=_();return r(W.CloseExpression,`Expected closing expression token`),e}function f(){let e=h(),t=null,c=[];if(o(W.Equals))++n,t=h();else{for(r(W.CloseStatement,`Expected %} token`);!s(`endset`);)c.push(a());r(W.OpenStatement,`Expected {% token`),i(`endset`)}return r(W.CloseStatement,`Expected closing statement token`),new bo(e,t,c)}function p(){let e=_();r(W.CloseStatement,`Expected closing statement token`);let t=[],i=[];for(;!s(`elif`,`else`,`endif`);)t.push(a());if(s(`elif`)){++n,++n;let e=p();i.push(e)}else if(s(`else`))for(++n,++n,r(W.CloseStatement,`Expected closing statement token`);!s(`endif`);)i.push(a());return new go(e,t,i)}function m(){let e=N();if(e.type!==`Identifier`)throw SyntaxError(`Expected identifier following macro statement`);let t=E();r(W.CloseStatement,`Expected closing statement token`);let n=[];for(;!s(`endmacro`);)n.push(a());return new xo(e,t,n)}function h(e=!1){let t=e?N:_,r=[t()],i=o(W.Comma);for(;i&&(++n,r.push(t()),o(W.Comma)););return i?new Mo(r):r[0]}function g(){let e=h(!0);if(!(e instanceof Eo||e instanceof Mo))throw SyntaxError(`Expected identifier/tuple for the loop variable, got ${e.type} instead`);if(!c(`in`))throw SyntaxError("Expected `in` keyword following loop variable");++n;let t=_();r(W.CloseStatement,`Expected closing statement token`);let i=[];for(;!s(`endfor`,`else`);)i.push(a());let o=[];if(s(`else`))for(++n,++n,r(W.CloseStatement,`Expected closing statement token`);!s(`endfor`);)o.push(a());return new _o(e,t,i,o)}function _(){return v()}function v(){let e=y();if(c(`if`)){++n;let t=y();return c(`else`)?(++n,new Wo(t,e,v())):new Lo(e,t)}return e}function y(){let t=b();for(;c(`or`);){let r=e[n];++n;let i=b();t=new Po(r,t,i)}return t}function b(){let t=x();for(;c(`and`);){let r=e[n];++n;let i=x();t=new Po(r,t,i)}return t}function x(){let t;for(;c(`not`);){let r=e[n];++n,t=new zo(r,x())}return t??S()}function S(){let t=C();for(;;){let r;if(c(`not`,`in`))r=new ao(`not in`,W.Identifier),n+=2;else if(c(`in`))r=e[n++];else if(o(W.ComparisonBinaryOperator))r=e[n++];else break;let i=C();t=new Po(r,t,i)}return t}function C(){let t=A();for(;o(W.AdditiveBinaryOperator);){let r=e[n];++n;let i=A();t=new Po(r,t,i)}return t}function w(){let e=k(N());return o(W.OpenParen)?T(e):e}function T(e){let t=new To(e,E());return t=k(t),o(W.OpenParen)&&(t=T(t)),t}function E(){r(W.OpenParen,`Expected opening parenthesis for arguments list`);let e=D();return r(W.CloseParen,`Expected closing parenthesis for arguments list`),e}function D(){let t=[];for(;!o(W.CloseParen);){let r;if(e[n].type===W.MultiplicativeBinaryOperator&&e[n].value===`*`)++n,r=new Ho(_());else if(r=_(),o(W.Equals)){if(++n,!(r instanceof Eo))throw SyntaxError(`Expected identifier for keyword argument`);let e=_();r=new Vo(r,e)}t.push(r),o(W.Comma)&&++n}return t}function O(){let e=[],t=!1;for(;!o(W.CloseSquareBracket);)o(W.Colon)?(e.push(void 0),++n,t=!0):(e.push(_()),o(W.Colon)&&(++n,t=!0));if(e.length===0)throw SyntaxError(`Expected at least one argument for member/slice expression`);if(t){if(e.length>3)throw SyntaxError(`Expected 0-3 arguments for slice expression`);return new Bo(...e)}return e[0]}function k(t){for(;o(W.Dot)||o(W.OpenSquareBracket);){let i=e[n];++n;let a,o=i.type===W.OpenSquareBracket;if(o)a=O(),r(W.CloseSquareBracket,`Expected closing square bracket`);else if(a=N(),a.type!==`Identifier`)throw SyntaxError(`Expected identifier following dot operator`);t=new wo(t,a,o)}return t}function A(){let t=j();for(;o(W.MultiplicativeBinaryOperator);){let r=e[n++],i=j();t=new Po(r,t,i)}return t}function j(){let e=M();for(;c(`is`);){++n;let t=c(`not`);t&&++n;let r=N();if(!(r instanceof Eo))throw SyntaxError(`Expected identifier for the test`);e=new Ro(e,t,r)}return e}function M(){let e=w();for(;o(W.Pipe);){++n;let t=N();if(!(t instanceof Eo))throw SyntaxError(`Expected identifier for the filter`);o(W.OpenParen)&&(t=T(t)),e=new Fo(e,t)}return e}function N(){let t=e[n++];switch(t.type){case W.NumericLiteral:{let e=t.value;return e.includes(`.`)?new ko(Number(e)):new Oo(Number(e))}case W.StringLiteral:{let r=t.value;for(;o(W.StringLiteral);)r+=e[n++].value;return new Ao(r)}case W.Identifier:return new Eo(t.value);case W.OpenParen:{let e=h();return r(W.CloseParen,"Expected closing parenthesis, got ${tokens[current].type} instead."),e}case W.OpenSquareBracket:{let e=[];for(;!o(W.CloseSquareBracket);)e.push(_()),o(W.Comma)&&++n;return++n,new jo(e)}case W.OpenCurlyBracket:{let e=new Map;for(;!o(W.CloseCurlyBracket);){let t=_();r(W.Colon,`Expected colon between key and value in object literal`);let i=_();e.set(t,i),o(W.Comma)&&++n}return++n,new No(e)}default:throw SyntaxError(`Unexpected token: ${t.type}`)}}for(;n0)for(let i=e;it;i+=n)r.push(i);return r}function qo(e,t,n,r=1){let i=Math.sign(r);i>=0?(t=(t??=0)<0?Math.max(e.length+t,0):Math.min(t,e.length),n=(n??=e.length)<0?Math.max(e.length+n,0):Math.min(n,e.length)):(t=(t??=e.length-1)<0?Math.max(e.length+t,-1):Math.min(t,e.length-1),n=(n??=-1)<-1?Math.max(e.length+n,-1):Math.min(n,e.length-1));let a=[];for(let o=t;i*oe.toUpperCase())}function Yo(e){return Xo(new Date,e)}function Xo(e,t){let n=new Intl.DateTimeFormat(void 0,{month:`long`}),r=new Intl.DateTimeFormat(void 0,{month:`short`}),i=e=>e<10?`0`+e:e.toString();return t.replace(/%[YmdbBHM%]/g,t=>{switch(t){case`%Y`:return e.getFullYear().toString();case`%m`:return i(e.getMonth()+1);case`%d`:return i(e.getDate());case`%b`:return r.format(e);case`%B`:return n.format(e);case`%H`:return i(e.getHours());case`%M`:return i(e.getMinutes());case`%%`:return`%`;default:return t}})}function Zo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Qo(e,t,n,r){if(r===0)return e;let i=r==null||r<0?1/0:r,a=t.length===0?RegExp(`(?=)`,`gu`):new RegExp(Zo(t),`gu`);return e.replaceAll(a,e=>i>0?(--i,n):e)}var $o=class extends Error{},es=class extends Error{},ts=class{type=`RuntimeValue`;value;builtins=new Map;constructor(e=void 0){this.value=e}__bool__(){return new as(!!this.value)}toString(){return String(this.value)}},ns=class extends ts{type=`IntegerValue`},rs=class extends ts{type=`FloatValue`;toString(){return this.value%1==0?this.value.toFixed(1):this.value.toString()}},is=class extends ts{type=`StringValue`;builtins=new Map([[`upper`,new ps(()=>new is(this.value.toUpperCase()))],[`lower`,new ps(()=>new is(this.value.toLowerCase()))],[`strip`,new ps(()=>new is(this.value.trim()))],[`title`,new ps(()=>new is(Jo(this.value)))],[`capitalize`,new ps(()=>new is(this.value.charAt(0).toUpperCase()+this.value.slice(1)))],[`length`,new ns(this.value.length)],[`rstrip`,new ps(()=>new is(this.value.trimEnd()))],[`lstrip`,new ps(()=>new is(this.value.trimStart()))],[`startswith`,new ps(e=>{if(e.length===0)throw Error(`startswith() requires at least one argument`);let t=e[0];if(t instanceof is)return new as(this.value.startsWith(t.value));if(t instanceof ds){for(let e of t.value){if(!(e instanceof is))throw Error(`startswith() tuple elements must be strings`);if(this.value.startsWith(e.value))return new as(!0)}return new as(!1)}throw Error(`startswith() argument must be a string or tuple of strings`)})],[`endswith`,new ps(e=>{if(e.length===0)throw Error(`endswith() requires at least one argument`);let t=e[0];if(t instanceof is)return new as(this.value.endsWith(t.value));if(t instanceof ds){for(let e of t.value){if(!(e instanceof is))throw Error(`endswith() tuple elements must be strings`);if(this.value.endsWith(e.value))return new as(!0)}return new as(!1)}throw Error(`endswith() argument must be a string or tuple of strings`)})],[`split`,new ps(e=>{let t=e[0]??new ms;if(!(t instanceof is||t instanceof ms))throw Error(`sep argument must be a string or null`);let n=e[1]??new ns(-1);if(!(n instanceof ns))throw Error(`maxsplit argument must be a number`);let r=[];if(t instanceof ms){let e=this.value.trimStart();for(let{0:t,index:i}of e.matchAll(/\S+/g)){if(n.value!==-1&&r.length>=n.value&&i!==void 0){r.push(t+e.slice(i+t.length));break}r.push(t)}}else{if(t.value===``)throw Error(`empty separator`);r=this.value.split(t.value),n.value!==-1&&r.length>n.value&&r.push(r.splice(n.value).join(t.value))}return new ds(r.map(e=>new is(e)))})],[`replace`,new ps(e=>{if(e.length<2)throw Error(`replace() requires at least two arguments`);let t=e[0],n=e[1];if(!(t instanceof is&&n instanceof is))throw Error(`replace() arguments must be strings`);let r;if(r=e.length>2?e[2].type===`KeywordArgumentsValue`?e[2].value.get(`count`)??new ms:e[2]:new ms,!(r instanceof ns||r instanceof ms))throw Error(`replace() count argument must be a number or null`);return new is(Qo(this.value,t.value,n.value,r.value))})]])},as=class extends ts{type=`BooleanValue`},os=/[\x7f-\uffff]/g;function ss(e){return e.replace(os,e=>`\\u`+e.charCodeAt(0).toString(16).padStart(4,`0`))}function cs(e,t={},n=0,r=!0){let{indent:i=null,ensureAscii:a=!1,separators:o=null,sortKeys:s=!1}=t,c,l;switch(o?[c,l]=o:i?(c=`,`,l=`: `):(c=`, `,l=`: `),e.type){case`NullValue`:return`null`;case`UndefinedValue`:return r?`null`:`undefined`;case`IntegerValue`:case`FloatValue`:case`BooleanValue`:return JSON.stringify(e.value);case`StringValue`:{let t=JSON.stringify(e.value);return a&&(t=ss(t)),t}case`ArrayValue`:case`ObjectValue`:{let o=i?` `.repeat(i):``,u=` +`+o.repeat(n),d=u+o;if(e.type===`ArrayValue`){let a=e.value.map(e=>cs(e,t,n+1,r));return i?`[${d}${a.join(`${c}${d}`)}${u}]`:`[${a.join(c)}]`}else{let o=Array.from(e.value.entries());s&&(o=o.sort(([e],[t])=>e.localeCompare(t)));let f=o.map(([e,o])=>{let s=JSON.stringify(e);a&&(s=ss(s));let c=`${s}${l}${cs(o,t,n+1,r)}`;return i?`${d}${c}`:c});return i?`{${f.join(c)}${u}}`:`{${f.join(c)}}`}}default:throw Error(`Cannot convert to JSON: ${e.type}`)}}var ls=class extends ts{type=`ObjectValue`;__bool__(){return new as(this.value.size>0)}builtins=new Map([[`get`,new ps(([e,t])=>{if(!(e instanceof is))throw Error(`Object key must be a string: got ${e.type}`);return this.value.get(e.value)??t??new ms})],[`items`,new ps(()=>this.items())],[`keys`,new ps(()=>this.keys())],[`values`,new ps(()=>this.values())],[`dictsort`,new ps(e=>{let t=new Map,n=e.filter(e=>e instanceof us?(t=e.value,!1):!0),r=n.at(0)??t.get(`case_sensitive`)??new as(!1);if(!(r instanceof as))throw Error(`case_sensitive must be a boolean`);let i=n.at(1)??t.get(`by`)??new is(`key`);if(!(i instanceof is))throw Error(`by must be a string`);if(![`key`,`value`].includes(i.value))throw Error(`by must be either 'key' or 'value'`);let a=n.at(2)??t.get(`reverse`)??new as(!1);if(!(a instanceof as))throw Error(`reverse must be a boolean`);return new ds(Array.from(this.value.entries()).map(([e,t])=>new ds([new is(e),t])).sort((e,t)=>{let n=i.value===`key`?0:1,o=e.value[n],s=t.value[n],c=ys(o,s,r.value);return a.value?-c:c}))})]]);items(){return new ds(Array.from(this.value.entries()).map(([e,t])=>new ds([new is(e),t])))}keys(){return new ds(Array.from(this.value.keys()).map(e=>new is(e)))}values(){return new ds(Array.from(this.value.values()))}toString(){return cs(this,{},0,!1)}},us=class extends ls{type=`KeywordArgumentsValue`},ds=class extends ts{type=`ArrayValue`;builtins=new Map([[`length`,new ns(this.value.length)]]);__bool__(){return new as(this.value.length>0)}toString(){return cs(this,{},0,!1)}},fs=class extends ds{type=`TupleValue`},ps=class extends ts{type=`FunctionValue`},ms=class extends ts{type=`NullValue`},hs=class extends ts{type=`UndefinedValue`},gs=class{constructor(e){this.parent=e}variables=new Map([[`namespace`,new ps(e=>{if(e.length===0)return new ls(new Map);if(e.length!==1||!(e[0]instanceof ls))throw Error("`namespace` expects either zero arguments or a single object argument");return e[0]})]]);tests=new Map([[`boolean`,e=>e.type===`BooleanValue`],[`callable`,e=>e instanceof ps],[`odd`,e=>{if(!(e instanceof ns))throw Error(`cannot odd on ${e.type}`);return e.value%2!=0}],[`even`,e=>{if(!(e instanceof ns))throw Error(`cannot even on ${e.type}`);return e.value%2==0}],[`false`,e=>e.type===`BooleanValue`&&!e.value],[`true`,e=>e.type===`BooleanValue`&&e.value],[`none`,e=>e.type===`NullValue`],[`string`,e=>e.type===`StringValue`],[`number`,e=>e instanceof ns||e instanceof rs],[`integer`,e=>e instanceof ns],[`iterable`,e=>e.type===`ArrayValue`||e.type===`StringValue`],[`mapping`,e=>e instanceof ls],[`sequence`,e=>e instanceof ds||e instanceof ls||e instanceof is],[`lower`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toLowerCase()}],[`upper`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toUpperCase()}],[`none`,e=>e.type===`NullValue`],[`defined`,e=>e.type!==`UndefinedValue`],[`undefined`,e=>e.type===`UndefinedValue`],[`equalto`,(e,t)=>e.value===t.value],[`eq`,(e,t)=>e.value===t.value]]);set(e,t){return this.declareVariable(e,xs(t))}declareVariable(e,t){if(this.variables.has(e))throw SyntaxError(`Variable already declared: ${e}`);return this.variables.set(e,t),t}setVariable(e,t){return this.variables.set(e,t),t}resolve(e){if(this.variables.has(e))return this;if(this.parent)return this.parent.resolve(e);throw Error(`Unknown variable: ${e}`)}lookupVariable(e){try{return this.resolve(e).variables.get(e)??new hs}catch{return new hs}}};function _s(e){e.set(`false`,!1),e.set(`true`,!0),e.set(`none`,null),e.set(`raise_exception`,e=>{throw Error(e)}),e.set(`range`,Ko),e.set(`strftime_now`,Yo),e.set(`True`,!0),e.set(`False`,!1),e.set(`None`,null)}function vs(e,t){let n=t.split(`.`),r=e;for(let e of n)if(r instanceof ls)r=r.value.get(e)??new hs;else if(r instanceof ds){let t=parseInt(e,10);if(!isNaN(t)&&t>=0&&te instanceof ns||e instanceof rs||e instanceof as,i=e=>e instanceof as?+!!e.value:e.value;if(r(e)&&r(t)){let n=i(e),r=i(t);return nr)}if(e.type!==t.type)throw Error(`Cannot compare different types: ${e.type} and ${t.type}`);switch(e.type){case`StringValue`:{let r=e.value,i=t.value;return n||(r=r.toLowerCase(),i=i.toLowerCase()),ri)}default:throw Error(`Cannot compare type: ${e.type}`)}}var bs=class{global;constructor(e){this.global=e??new gs}run(e){return this.evaluate(e,this.global)}evaluateBinaryExpression(e,t){let n=this.evaluate(e.left,t);switch(e.operator.value){case`and`:return n.__bool__().value?this.evaluate(e.right,t):n;case`or`:return n.__bool__().value?n:this.evaluate(e.right,t)}let r=this.evaluate(e.right,t);switch(e.operator.value){case`==`:return new as(n.value==r.value);case`!=`:return new as(n.value!=r.value)}if(n instanceof hs||r instanceof hs){if(r instanceof hs&&[`in`,`not in`].includes(e.operator.value))return new as(e.operator.value===`not in`);throw Error(`Cannot perform operation ${e.operator.value} on undefined values`)}else if(n instanceof ms||r instanceof ms)throw Error(`Cannot perform operation on null values`);else if(e.operator.value===`~`)return new is(n.value.toString()+r.value.toString());else if((n instanceof ns||n instanceof rs)&&(r instanceof ns||r instanceof rs)){let t=n.value,i=r.value;switch(e.operator.value){case`+`:case`-`:case`*`:{let a=e.operator.value===`+`?t+i:e.operator.value===`-`?t-i:t*i;return n instanceof rs||r instanceof rs?new rs(a):new ns(a)}case`/`:return new rs(t/i);case`%`:{let e=t%i;return n instanceof rs||r instanceof rs?new rs(e):new ns(e)}case`<`:return new as(t`:return new as(t>i);case`>=`:return new as(t>=i);case`<=`:return new as(t<=i)}}else if(n instanceof ds&&r instanceof ds)switch(e.operator.value){case`+`:return new ds(n.value.concat(r.value))}else if(r instanceof ds){let t=r.value.find(e=>e.value===n.value)!==void 0;switch(e.operator.value){case`in`:return new as(t);case`not in`:return new as(!t)}}if(n instanceof is||r instanceof is)switch(e.operator.value){case`+`:return new is(n.value.toString()+r.value.toString())}if(n instanceof is&&r instanceof is)switch(e.operator.value){case`in`:return new as(r.value.includes(n.value));case`not in`:return new as(!r.value.includes(n.value))}if(n instanceof is&&r instanceof ls)switch(e.operator.value){case`in`:return new as(r.value.has(n.value));case`not in`:return new as(!r.value.has(n.value))}throw SyntaxError(`Unknown operator "${e.operator.value}" between ${n.type} and ${r.type}`)}evaluateArguments(e,t){let n=[],r=new Map;for(let i of e)if(i.type===`SpreadExpression`){let e=i,r=this.evaluate(e.argument,t);if(!(r instanceof ds))throw Error(`Cannot unpack non-iterable type: ${r.type}`);for(let e of r.value)n.push(e)}else if(i.type===`KeywordArgumentExpression`){let e=i;r.set(e.key.value,this.evaluate(e.value,t))}else{if(r.size>0)throw Error(`Positional arguments must come before keyword arguments`);n.push(this.evaluate(i,t))}return[n,r]}applyFilter(e,t,n){if(t.type===`Identifier`){let r=t;if(r.value===`safe`)return e;if(r.value===`tojson`)return new is(cs(e,{}));if(e instanceof ds)switch(r.value){case`list`:return e;case`first`:return e.value[0];case`last`:return e.value[e.value.length-1];case`length`:return new ns(e.value.length);case`reverse`:return new ds(e.value.slice().reverse());case`sort`:return new ds(e.value.slice().sort((e,t)=>ys(e,t,!1)));case`join`:return new is(e.value.map(e=>e.value).join(``));case`string`:return new is(cs(e,{},0,!1));case`unique`:{let t=new Set,n=[];for(let r of e.value)t.has(r.value)||(t.add(r.value),n.push(r));return new ds(n)}default:throw Error(`Unknown ArrayValue filter: ${r.value}`)}else if(e instanceof is)switch(r.value){case`length`:case`upper`:case`lower`:case`title`:case`capitalize`:{let t=e.builtins.get(r.value);if(t instanceof ps)return t.value([],n);if(t instanceof ns)return t;throw Error(`Unknown StringValue filter: ${r.value}`)}case`trim`:return new is(e.value.trim());case`indent`:return new is(e.value.split(` +`).map((e,t)=>t===0||e.length===0?e:` `+e).join(` +`));case`join`:case`string`:return e;case`int`:{let t=parseInt(e.value,10);return new ns(isNaN(t)?0:t)}case`float`:{let t=parseFloat(e.value);return new rs(isNaN(t)?0:t)}default:throw Error(`Unknown StringValue filter: ${r.value}`)}else if(e instanceof ns||e instanceof rs)switch(r.value){case`abs`:return e instanceof ns?new ns(Math.abs(e.value)):new rs(Math.abs(e.value));case`int`:return new ns(Math.floor(e.value));case`float`:return new rs(e.value);case`string`:return new is(e.toString());default:throw Error(`Unknown NumericValue filter: ${r.value}`)}else if(e instanceof ls)switch(r.value){case`items`:return new ds(Array.from(e.value.entries()).map(([e,t])=>new ds([new is(e),t])));case`length`:return new ns(e.value.size);default:{let t=e.builtins.get(r.value);if(t)return t instanceof ps?t.value([],n):t;throw Error(`Unknown ObjectValue filter: ${r.value}`)}}else if(e instanceof as)switch(r.value){case`bool`:return new as(e.value);case`int`:return new ns(+!!e.value);case`float`:return new rs(+!!e.value);case`string`:return new is(e.value?`true`:`false`);default:throw Error(`Unknown BooleanValue filter: ${r.value}`)}throw Error(`Cannot apply filter "${r.value}" to type: ${e.type}`)}else if(t.type===`CallExpression`){let r=t;if(r.callee.type!==`Identifier`)throw Error(`Unknown filter: ${r.callee.type}`);let i=r.callee.value;if(i===`tojson`){let[,t]=this.evaluateArguments(r.args,n),i=t.get(`indent`)??new ms;if(!(i instanceof ns||i instanceof ms))throw Error(`If set, indent must be a number`);let a=t.get(`ensure_ascii`)??new as(!1);if(!(a instanceof as))throw Error(`If set, ensure_ascii must be a boolean`);let o=t.get(`sort_keys`)??new as(!1);if(!(o instanceof as))throw Error(`If set, sort_keys must be a boolean`);let s=t.get(`separators`)??new ms,c=null;if(s instanceof ds||s instanceof fs){if(s.value.length!==2)throw Error(`separators must be a tuple of two strings`);let[e,t]=s.value;if(!(e instanceof is)||!(t instanceof is))throw Error(`separators must be a tuple of two strings`);c=[e.value,t.value]}else if(!(s instanceof ms))throw Error(`If set, separators must be a tuple of two strings`);return new is(cs(e,{indent:i.value,ensureAscii:a.value,sortKeys:o.value,separators:c}))}else if(i===`join`){let t;if(e instanceof is)t=Array.from(e.value);else if(e instanceof ds)t=e.value.map(e=>e.value);else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`);let[a,o]=this.evaluateArguments(r.args,n),s=a.at(0)??o.get(`separator`)??new is(``);if(!(s instanceof is))throw Error(`separator must be a string`);return new is(t.join(s.value))}else if(i===`int`||i===`float`){let[t,a]=this.evaluateArguments(r.args,n),o=t.at(0)??a.get(`default`)??(i===`int`?new ns(0):new rs(0));if(e instanceof is){let t=i===`int`?parseInt(e.value,10):parseFloat(e.value);return isNaN(t)?o:i===`int`?new ns(t):new rs(t)}else if(e instanceof ns||e instanceof rs)return e;else if(e instanceof as)return i===`int`?new ns(+!!e.value):new rs(+!!e.value);else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`)}else if(i==="default"){let[t,i]=this.evaluateArguments(r.args,n),a=t[0]??new is(``),o=t[1]??i.get(`boolean`)??new as(!1);if(!(o instanceof as))throw Error("`default` filter flag must be a boolean");return e instanceof hs||o.value&&!e.__bool__().value?a:e}if(e instanceof ds){switch(i){case`sort`:{let[t,i]=this.evaluateArguments(r.args,n),a=t.at(0)??i.get(`reverse`)??new as(!1);if(!(a instanceof as))throw Error(`reverse must be a boolean`);let o=t.at(1)??i.get(`case_sensitive`)??new as(!1);if(!(o instanceof as))throw Error(`case_sensitive must be a boolean`);let s=t.at(2)??i.get(`attribute`)??new ms;if(!(s instanceof is||s instanceof ns||s instanceof ms))throw Error(`attribute must be a string, integer, or null`);let c=e=>s instanceof ms?e:vs(e,s instanceof ns?String(s.value):s.value);return new ds(e.value.slice().sort((e,t)=>{let n=ys(c(e),c(t),o.value);return a.value?-n:n}))}case`selectattr`:case`rejectattr`:{let t=i===`selectattr`;if(e.value.some(e=>!(e instanceof ls)))throw Error(`\`${i}\` can only be applied to array of objects`);if(r.args.some(e=>e.type!==`StringLiteral`))throw Error(`arguments of \`${i}\` must be strings`);let[a,o,s]=r.args.map(e=>this.evaluate(e,n)),c;if(o){let e=n.tests.get(o.value);if(!e)throw Error(`Unknown test: ${o.value}`);c=e}else c=(...e)=>e[0].__bool__().value;return new ds(e.value.filter(e=>{let n=e.value.get(a.value),r=n?c(n,s):!1;return t?r:!r}))}case`map`:{let[,t]=this.evaluateArguments(r.args,n);if(t.has(`attribute`)){let n=t.get(`attribute`);if(!(n instanceof is))throw Error(`attribute must be a string`);let r=t.get(`default`);return new ds(e.value.map(e=>{if(!(e instanceof ls))throw Error(`items in map must be an object`);let t=vs(e,n.value);return t instanceof hs?r??new hs:t}))}else throw Error("`map` expressions without `attribute` set are not currently supported.")}}throw Error(`Unknown ArrayValue filter: ${i}`)}else if(e instanceof is){switch(i){case`indent`:{let[t,i]=this.evaluateArguments(r.args,n),a=t.at(0)??i.get(`width`)??new ns(4);if(!(a instanceof ns))throw Error(`width must be a number`);let o=t.at(1)??i.get(`first`)??new as(!1),s=t.at(2)??i.get(`blank`)??new as(!1),c=e.value.split(` +`),l=` `.repeat(a.value);return new is(c.map((e,t)=>!o.value&&t===0||!s.value&&e.length===0?e:l+e).join(` +`))}case`replace`:{let t=e.builtins.get(`replace`);if(!(t instanceof ps))throw Error(`replace filter not available`);let[i,a]=this.evaluateArguments(r.args,n);return t.value([...i,new us(a)],n)}}throw Error(`Unknown StringValue filter: ${i}`)}else if(e instanceof ls){let t=e.builtins.get(i);if(t&&t instanceof ps){let[e,i]=this.evaluateArguments(r.args,n);return i.size>0&&e.push(new us(i)),t.value(e,n)}throw Error(`Unknown ObjectValue filter: ${i}`)}else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`)}throw Error(`Unknown filter: ${t.type}`)}evaluateFilterExpression(e,t){let n=this.evaluate(e.operand,t);return this.applyFilter(n,e.filter,t)}evaluateTestExpression(e,t){let n=this.evaluate(e.operand,t),r=t.tests.get(e.test.value);if(!r)throw Error(`Unknown test: ${e.test.value}`);let i=r(n);return new as(e.negate?!i:i)}evaluateSelectExpression(e,t){return this.evaluate(e.test,t).__bool__().value?this.evaluate(e.lhs,t):new hs}evaluateUnaryExpression(e,t){let n=this.evaluate(e.argument,t);switch(e.operator.value){case`not`:return new as(!n.value);default:throw SyntaxError(`Unknown operator: ${e.operator.value}`)}}evaluateTernaryExpression(e,t){return this.evaluate(e.condition,t).__bool__().value?this.evaluate(e.trueExpr,t):this.evaluate(e.falseExpr,t)}evalProgram(e,t){return this.evaluateBlock(e.body,t)}evaluateBlock(e,t){let n=``;for(let r of e){let e=this.evaluate(r,t);e.type!==`NullValue`&&e.type!==`UndefinedValue`&&(n+=e.toString())}return new is(n)}evaluateIdentifier(e,t){return t.lookupVariable(e.value)}evaluateCallExpression(e,t){let[n,r]=this.evaluateArguments(e.args,t);r.size>0&&n.push(new us(r));let i=this.evaluate(e.callee,t);if(i.type!==`FunctionValue`)throw Error(`Cannot call something that is not a function: got ${i.type}`);return i.value(n,t)}evaluateSliceExpression(e,t,n){if(!(e instanceof ds||e instanceof is))throw Error(`Slice object must be an array or string`);let r=this.evaluate(t.start,n),i=this.evaluate(t.stop,n),a=this.evaluate(t.step,n);if(!(r instanceof ns||r instanceof hs))throw Error(`Slice start must be numeric or undefined`);if(!(i instanceof ns||i instanceof hs))throw Error(`Slice stop must be numeric or undefined`);if(!(a instanceof ns||a instanceof hs))throw Error(`Slice step must be numeric or undefined`);return e instanceof ds?new ds(qo(e.value,r.value,i.value,a.value)):new is(qo(Array.from(e.value),r.value,i.value,a.value).join(``))}evaluateMemberExpression(e,t){let n=this.evaluate(e.object,t),r;if(e.computed){if(e.property.type===`SliceExpression`)return this.evaluateSliceExpression(n,e.property,t);r=this.evaluate(e.property,t)}else r=new is(e.property.value);let i;if(n instanceof ls){if(!(r instanceof is))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.value.get(r.value)??n.builtins.get(r.value)}else if(n instanceof ds||n instanceof is)if(r instanceof ns)i=n.value.at(r.value),n instanceof is&&(i=new is(n.value.at(r.value)));else if(r instanceof is)i=n.builtins.get(r.value);else throw Error(`Cannot access property with non-string/non-number: got ${r.type}`);else{if(!(r instanceof is))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.builtins.get(r.value)}return i instanceof ts?i:new hs}evaluateSet(e,t){let n=e.value?this.evaluate(e.value,t):this.evaluateBlock(e.body,t);if(e.assignee.type===`Identifier`){let r=e.assignee.value;t.setVariable(r,n)}else if(e.assignee.type===`TupleLiteral`){let r=e.assignee;if(!(n instanceof ds))throw Error(`Cannot unpack non-iterable type in set: ${n.type}`);let i=n.value;if(i.length!==r.value.length)throw Error(`Too ${r.value.length>i.length?`few`:`many`} items to unpack in set`);for(let e=0;et.setVariable(e.loopvar.value,c);else if(e.loopvar.type===`TupleLiteral`){let t=e.loopvar;if(c.type!==`ArrayValue`)throw Error(`Cannot unpack non-iterable type: ${c.type}`);let n=c;if(t.value.length!==n.value.length)throw Error(`Too ${t.value.length>n.value.length?`few`:`many`} items to unpack`);l=e=>{for(let r=0;r0?a[t-1]:new hs],[`nextitem`,t{let r=new gs(n);t=t.slice();let i;t.at(-1)?.type===`KeywordArgumentsValue`&&(i=t.pop());for(let n=0;n{let r=new gs(n);if(e.callerArgs)for(let n=0;nthis.evaluate(e,t)));case`TupleLiteral`:return new fs(e.value.map(e=>this.evaluate(e,t)));case`ObjectLiteral`:{let n=new Map;for(let[r,i]of e.value){let e=this.evaluate(r,t);if(!(e instanceof is))throw Error(`Object keys must be strings: got ${e.type}`);n.set(e.value,this.evaluate(i,t))}return new ls(n)}case`Identifier`:return this.evaluateIdentifier(e,t);case`CallExpression`:return this.evaluateCallExpression(e,t);case`MemberExpression`:return this.evaluateMemberExpression(e,t);case`UnaryExpression`:return this.evaluateUnaryExpression(e,t);case`BinaryExpression`:return this.evaluateBinaryExpression(e,t);case`FilterExpression`:return this.evaluateFilterExpression(e,t);case`FilterStatement`:return this.evaluateFilterStatement(e,t);case`TestExpression`:return this.evaluateTestExpression(e,t);case`SelectExpression`:return this.evaluateSelectExpression(e,t);case`Ternary`:return this.evaluateTernaryExpression(e,t);case`Comment`:return new ms;default:throw SyntaxError(`Unknown node type: ${e.type}`)}}};function xs(e){switch(typeof e){case`number`:return Number.isInteger(e)?new ns(e):new rs(e);case`string`:return new is(e);case`boolean`:return new as(e);case`undefined`:return new hs;case`object`:return e===null?new ms:Array.isArray(e)?new ds(e.map(xs)):new ls(new Map(Object.entries(e).map(([e,t])=>[e,xs(t)])));case`function`:return new ps((t,n)=>xs(e(...t.map(e=>e.value))??null));default:throw Error(`Cannot convert to runtime value: ${e}`)}}var Ss=` +`,Cs=`{%- `,ws=` -%}`;function Ts(e){switch(e.operator.type){case`MultiplicativeBinaryOperator`:return 4;case`AdditiveBinaryOperator`:return 3;case`ComparisonBinaryOperator`:return 2;case`Identifier`:return e.operator.value===`and`?1:e.operator.value===`in`||e.operator.value===`not in`?2:0}return 0}function Es(e,t=` `){let n=typeof t==`number`?` `.repeat(t):t;return Os(e.body,0,n).replace(/\n$/,``)}function Ds(...e){return Cs+e.join(` `)+ws}function Os(e,t,n){return e.map(e=>ks(e,t,n)).join(Ss)}function ks(e,t,n){let r=n.repeat(t);switch(e.type){case`Program`:return Os(e.body,t,n);case`If`:return As(e,t,n);case`For`:return js(e,t,n);case`Set`:return Ms(e,t,n);case`Macro`:return Ns(e,t,n);case`Break`:return r+Ds(`break`);case`Continue`:return r+Ds(`continue`);case`CallStatement`:return Ps(e,t,n);case`FilterStatement`:return Fs(e,t,n);case`Comment`:return r+`{# `+e.value+` #}`;default:return r+`{{- `+Is(e)+` -}}`}}function As(e,t,n){let r=n.repeat(t),i=[],a=e;for(;a&&(i.push({test:a.test,body:a.body}),a.alternate.length===1&&a.alternate[0].type===`If`);)a=a.alternate[0];let o=r+Ds(`if`,Is(i[0].test))+Ss+Os(i[0].body,t+1,n);for(let e=1;e0&&(o+=Ss+r+Ds(`else`)+Ss+Os(a.alternate,t+1,n)),o+=Ss+r+Ds(`endif`),o}function js(e,t,n){let r=n.repeat(t),i=``;if(e.iterable.type===`SelectExpression`){let t=e.iterable;i=`${Is(t.lhs)} if ${Is(t.test)}`}else i=Is(e.iterable);let a=r+Ds(`for`,Is(e.loopvar),`in`,i)+Ss+Os(e.body,t+1,n);return e.defaultBlock.length>0&&(a+=Ss+r+Ds(`else`)+Ss+Os(e.defaultBlock,t+1,n)),a+=Ss+r+Ds(`endfor`),a}function Ms(e,t,n){let r=n.repeat(t),i=Is(e.assignee),a=e.value?Is(e.value):``,o=r+Ds(`set`,`${i}${e.value?` = `+a:``}`);return e.body.length===0?o:o+Ss+Os(e.body,t+1,n)+Ss+r+Ds(`endset`)}function Ns(e,t,n){let r=n.repeat(t),i=e.args.map(Is).join(`, `);return r+Ds(`macro`,`${e.name.value}(${i})`)+Ss+Os(e.body,t+1,n)+Ss+r+Ds(`endmacro`)}function Ps(e,t,n){let r=n.repeat(t),i=e.callerArgs&&e.callerArgs.length>0?`(${e.callerArgs.map(Is).join(`, `)})`:``,a=Is(e.call),o=r+Ds(`call${i}`,a)+Ss;return o+=Os(e.body,t+1,n)+Ss,o+=r+Ds(`endcall`),o}function Fs(e,t,n){let r=n.repeat(t),i=r+Ds(`filter`,e.filter.type===`Identifier`?e.filter.value:Is(e.filter))+Ss;return i+=Os(e.body,t+1,n)+Ss,i+=r+Ds(`endfilter`),i}function Is(e,t=-1){switch(e.type){case`SpreadExpression`:return`*${Is(e.argument)}`;case`Identifier`:return e.value;case`IntegerLiteral`:return`${e.value}`;case`FloatLiteral`:return`${e.value}`;case`StringLiteral`:return JSON.stringify(e.value);case`BinaryExpression`:{let n=e,r=Ts(n),i=Is(n.left,r),a=Is(n.right,r+1),o=`${i} ${n.operator.value} ${a}`;return r`${Is(e)}: ${Is(t)}`).join(`, `)}}`;case`SliceExpression`:{let t=e;return`${t.start?Is(t.start):``}:${t.stop?Is(t.stop):``}${t.step?`:${Is(t.step)}`:``}`}case`KeywordArgumentExpression`:{let t=e;return`${t.key.value}=${Is(t.value)}`}case`Ternary`:{let n=e,r=`${Is(n.trueExpr)} if ${Is(n.condition,0)} else ${Is(n.falseExpr)}`;return t>-1?`(${r})`:r}default:throw Error(`Unknown expression type: ${e.type}`)}}var Ls=class{parsed;constructor(e){let t=po(e,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=Go(t)}render(e){let t=new gs;if(_s(t),e)for(let[n,r]of Object.entries(e))t.set(n,r);return new bs(t).run(this.parsed).value}format(e){return Es(this.parsed,e?.indent||` `)}},Rs={txt:`text/plain`,html:`text/html`,css:`text/css`,js:`text/javascript`,json:`application/json`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`},zs=class e{constructor(e){if(this.filePath=e,this.headers=new Headers,this.exists=Fr.existsSync(e),this.exists){this.status=200,this.statusText=`OK`;let t=Fr.statSync(e);this.headers.set(`content-length`,t.size.toString()),this.updateContentType();let n=Fr.createReadStream(e);this.body=new ReadableStream({start(e){n.on(`data`,t=>e.enqueue(t)),n.on(`end`,()=>e.close()),n.on(`error`,t=>e.error(t))},cancel(){n.destroy()}})}else this.status=404,this.statusText=`Not Found`,this.body=null}updateContentType(){let e=this.filePath.toString().split(`.`).pop().toLowerCase();this.headers.set(`content-type`,Rs[e]??`application/octet-stream`)}clone(){let t=new e(this.filePath);return t.exists=this.exists,t.status=this.status,t.statusText=this.statusText,t.headers=new Headers(this.headers),t}async arrayBuffer(){return(await Fr.promises.readFile(this.filePath)).buffer}async blob(){let e=await Fr.promises.readFile(this.filePath);return new Blob([e],{type:this.headers.get(`content-type`)})}async text(){return await Fr.promises.readFile(this.filePath,`utf8`)}async json(){return JSON.parse(await this.text())}},Bs=class{constructor(e){this._mt=new Uint32Array(624),this._idx=625,this._gauss_next=null,this._random_fn=this.random.bind(this),this.seed(e)}seed(e){if(e==null)if(ni.IS_CRYPTO_AVAILABLE){let t=new Uint32Array(1);crypto.getRandomValues(t),e=t[0]}else e=Date.now()>>>0;let t=this._mt,n=(e,t)=>Math.imul(e,t)>>>0,r=[];for(let t=e||0;t>0;t=Math.floor(t/4294967296))r.push(t&4294967295);r.length||r.push(0),t[0]=19650218;for(let e=1;e<624;++e)t[e]=n(1812433253,t[e-1]^t[e-1]>>>30)+e>>>0;let i=1,a=0;for(let e=Math.max(624,r.length);e>0;--e,++i,++a)i>=624&&(t[0]=t[623],i=1),a>=r.length&&(a=0),t[i]=(t[i]^n(t[i-1]^t[i-1]>>>30,1664525))+r[a]+a>>>0;for(let e=623;e>0;--e,++i)i>=624&&(t[0]=t[623],i=1),t[i]=(t[i]^n(t[i-1]^t[i-1]>>>30,1566083941))-i>>>0;t[0]=2147483648,this._idx=624,this._gauss_next=null}_int32(){let e=this._mt;if(this._idx>=624){for(let t=0;t<624;++t){let n=e[t]&2147483648|e[(t+1)%624]&2147483647;e[t]=(e[(t+397)%624]^n>>>1^(n&1?2567483615:0))>>>0}this._idx=0}let t=e[this._idx++];return t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0}random(){return((this._int32()>>>5)*67108864+(this._int32()>>>6))/9007199254740992}gauss(e=0,t=1){let n=this._gauss_next;if(this._gauss_next=null,n===null){let e=this.random()*2*Math.PI,t=Math.sqrt(-2*Math.log(1-this.random()));n=Math.cos(e)*t,this._gauss_next=Math.sin(e)*t}return e+n*t}shuffle(e){for(let t=e.length-1;t>0;--t){let n=32-Math.clz32(t+1),r=this._int32()>>>32-n;for(;r>t;)r=this._int32()>>>32-n;let i=e[t];e[t]=e[r],e[r]=i}}choices(e,t){return e[Vs(this._random_fn,t)]}};function Vs(e,t){let n=0;for(let e=0;eVs(Us.random,e),Gs=new Bs,Ks=class{constructor(e){this.path=e}async match(e){let t=new zs(Ir.join(this.path,e));if(t.exists)return t}async put(e,t,n=void 0){let r=Ir.join(this.path,e),i=r+`.tmp.${ni.IS_PROCESS_AVAILABLE?process.pid:Date.now()}.${Gs._int32().toString(36)}`;try{let e=t.headers.get(`Content-Length`),a=parseInt(e??`0`),o=0;await Fr.promises.mkdir(Ir.dirname(r),{recursive:!0});let s=Fr.createWriteStream(i),c=t.body.getReader();for(;;){let{done:e,value:t}=await c.read();if(e)break;await new Promise((e,n)=>{s.write(t,t=>{if(t){n(t);return}e()})}),o+=t.length;let r=a?o/a*100:0;n?.({progress:r,loaded:o,total:a})}await new Promise((e,t)=>{s.close(n=>n?t(n):e())}),await Fr.promises.rename(i,r)}catch(e){try{await Fr.promises.unlink(i)}catch{}throw e}}async delete(e){let t=Ir.join(this.path,e);try{return await Fr.promises.unlink(t),!0}catch{return!1}}},qs={400:`Bad request error occurred while trying to load file`,401:`Unauthorized access to file`,403:`Forbidden access to file`,404:`Could not locate file`,408:`Request timeout error occurred while trying to load file`,500:`Internal server error error occurred while trying to load file`,502:`Bad gateway error occurred while trying to load file`,503:`Service unavailable error occurred while trying to load file`,504:`Gateway timeout error occurred while trying to load file`},Js=100,Ys=/^(\b[\w\-.]+\b\/)?\b[\w\-.]{1,96}\b$/;function Xs(...e){return e=e.map((t,n)=>(n&&(t=t.replace(RegExp(`^/`),``)),n!==e.length-1&&(t=t.replace(RegExp(`/$`),``)),t)),e.join(`/`)}function Zs(e,t=null,n=null){let r;try{r=new URL(e)}catch{return!1}return!(t&&!t.includes(r.protocol)||n&&!n.includes(r.hostname))}function Qs(e){return!(!Ys.test(e)||e.includes(`..`)||e.includes(`--`)||e.endsWith(`.git`)||e.endsWith(`.ipynb`))}function $s(e,t,n){if(!n)return null;let r=qs[e]??`Error (${e}) occurred while trying to load file`;throw Error(`${r}: "${t}".`)}async function ec(e,t,n){let r=e.headers.get(`Content-Length`),i=r?parseInt(r,10):n??0;r===null&&!n&&wi.warn(`Unable to determine content-length from response headers. Will expand buffer when needed.`);let a=new Uint8Array(i),o=0,s=e.body.getReader();async function c(){let{done:e,value:n}=await s.read();if(e)return;let r=o+n.length;if(r>i){i=r;let e=new Uint8Array(i);e.set(a),a=e}return a.set(n,o),o=r,t({progress:o/i*100,loaded:o,total:i}),c()}return await c(),a}function tc(e){return Zs(e,[`blob:`])}function nc(e){let t;if(typeof location<`u`&&location.href)t=location.href;else if(Mr!==void 0&&self.location.href)t=self.location.href;else return e;return new URL(e,t).href}var rc=`SHA-256`,ic=`experimental_transformers-hash-cache`,ac=e=>({algorithm:rc,value:e}),oc=class{#e=null;_getHashCache=()=>(this.#e??=caches.open(ic),this.#e);static isAvailable=()=>typeof navigator<`u`&&`crossOriginStorage`in navigator;match=async e=>{let t=await this._getFileHash(e);if(t)try{let[e]=await navigator.crossOriginStorage.requestFileHandles([ac(t)]),n=await e.getFile();return new Response(n,{headers:{"Content-Length":String(n.size)}})}catch{return}};put=async(e,t)=>{let n=await this._getFileHash(e);if(n){let e=await t.blob();await this._storeBlobInCOS(e,n)}else this._processAndStore(e,t.body)};_storeBlobInCOS=async(e,t)=>{let[n]=await navigator.crossOriginStorage.requestFileHandles([ac(t)],{create:!0}),r=await n.createWritable();await r.write(e),await r.close()};_processAndStore=async(e,t)=>{try{let n=[];for await(let e of t)n.push(e);let r=new Blob(n),i=await this._getBlobHash(r);await this._storeBlobInCOS(r,i);try{await(await this._getHashCache()).put(e,new Response(i))}catch{}}catch{}};delete=async e=>{try{return await(await this._getHashCache()).delete(e)}catch{return!1}};_getFileHash=async e=>{try{let t=await this._getHashCache(),n=await t.match(e);if(n)return n.text();let r=await this._getLfsFileHash(e);return r?(await t.put(e,new Response(r)),r):null}catch{return null}};_getLfsFileHash=async e=>{if(!e.includes(`/resolve/`))return null;let t=e.replace(`/resolve/`,`/raw/`);try{let e=(await fetch(t).then(e=>e.text())).match(/^oid sha256:([0-9a-f]+)$/m);return e?e[1]:null}catch{return null}};_getBlobHash=async e=>{let t=await e.arrayBuffer(),n=await crypto.subtle.digest(rc,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}};async function sc(e=null){let t=null;if(di.useCustomCache){if(!di.customCache)throw Error("`env.useCustomCache=true`, but `env.customCache` is not defined.");if(!di.customCache.match||!di.customCache.put)throw Error("`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache");t=di.customCache}if(!t&&di.experimental_useCrossOriginStorage&&oc.isAvailable()&&(t=new oc),!t&&di.useBrowserCache){if(typeof caches>`u`)throw Error(`Browser cache is not available in this environment.`);try{t=await caches.open(di.cacheKey)}catch(e){wi.warn(`An error occurred while opening the browser cache:`,e)}}if(!t&&di.useFSCache){if(!ni.IS_FS_AVAILABLE)throw Error(`File System Cache is not available in this environment.`);t=new Ks(e??di.cacheDir)}return t}async function cc(e,...t){for(let n of t)try{let t=await e.match(n);if(t)return t}catch{continue}}var lc=new class{#e;#t;constructor(e){this.#e=e,this.#t=new Map}get(e){if(!this.#t.has(e))return;let t=this.#t.get(e);return this.#t.delete(e),this.#t.set(e,t),t}put(e,t){this.#t.has(e)&&this.#t.delete(e),this.#t.set(e,t),this.#t.size>this.#e&&this.#t.delete(this.#t.keys().next().value)}delete(e){return this.#t.delete(e)}clear(){this.#t.clear()}}(100);function uc(e,t){let n=lc.get(e);if(n!==void 0)return n;let r=t().then(e=>e,t=>(lc.delete(e),Promise.reject(t)));return lc.put(e,r),r}async function dc(e){if(!Zs(e,[`http:`,`https:`]))return null;let t=hc(e);return t.set(`Range`,`bytes=0-0`),di.fetch(e,{method:`GET`,headers:t,cache:`no-store`})}function fc(e,t,n={}){return uc(JSON.stringify([e,t,n?.revision,n?.cache_dir,n?.local_files_only]),()=>pc(e,t,n))}async function pc(e,t,n){let r=await sc(n?.cache_dir),{localPath:i,remoteURL:a,proposedCacheKey:o,validModelId:s}=gc(e,t,n,r),c=await _c(r,i,o);if(c!==void 0&&typeof c!=`string`){let e=c.headers.get(`content-length`),t=c.headers.get(`content-type`);return{exists:!0,size:e?parseInt(e,10):void 0,contentType:t||void 0,fromCache:!0}}if(di.allowLocalModels&&!Zs(i,[`http:`,`https:`]))try{let e=await mc(i);if(typeof e!=`string`&&e.status!==404){let t=e.headers.get(`content-length`),n=e.headers.get(`content-type`);return{exists:!0,size:t?parseInt(t,10):void 0,contentType:n||void 0,fromCache:!1}}}catch{}if(di.allowRemoteModels&&!n.local_files_only&&s)try{let e=await dc(a);if(e&&e.status>=200&&e.status<300){let t,n=e.headers.get(`content-type`);if(e.status===206){let n=e.headers.get(`content-range`);if(n){let e=n.match(/bytes \d+-\d+\/(\d+)/);e&&(t=parseInt(e[1],10))}}else if(e.status===200)try{await e.body?.cancel()}catch{}if(t===void 0){let n=e.headers.get(`content-length`);t=n?parseInt(n,10):void 0}return{exists:!0,size:t,contentType:n||void 0,fromCache:!1}}}catch(e){wi.warn(`Unable to fetch file metadata for "${a}": ${e}`)}return{exists:!1,fromCache:!1}}async function mc(e){return di.useFS&&!Zs(e,[`http:`,`https:`,`blob:`])?new zs(e instanceof URL?e.protocol===`file:`?e.pathname:e.toString():e):di.fetch(e,{headers:hc(e)})}function hc(e){let t=typeof process<`u`&&process?.release?.name===`node`,n=new Headers;if(t){let t=!!{}.TESTING_REMOTELY,r=di.version;if(n.set(`User-Agent`,`transformers.js/${r}; is_ci/${t};`),Zs(e,[`http:`,`https:`],[`huggingface.co`,`hf.co`])){let e={}.HF_TOKEN??{}.HF_ACCESS_TOKEN;e&&n.set(`Authorization`,`Bearer ${e}`)}}return n}function gc(e,t,n={},r=null){let i=n.revision??`main`,a=Xs(e,t),o=Qs(e),s=o?Xs(di.localModelPath,a):a,c=Xs(di.remoteHost,di.remotePathTemplate.replaceAll(`{model}`,e).replaceAll(`{revision}`,encodeURIComponent(i)),t);return{requestURL:a,localPath:s,remoteURL:c,proposedCacheKey:r instanceof Ks?i===`main`?a:Xs(e,i,t):c,validModelId:o}}async function _c(e,t,n){if(e)return await cc(e,t,n)}async function vc(e,t,n,r,i,a,o={}){if(await n.match(r)===void 0){if(!a){let a=o.progress_callback?n=>mi(o.progress_callback,{status:`progress`,name:e,file:t,...n}):void 0;await n.put(r,i,a)}else if(typeof i!=`string`){let e=new Headers(i.headers);e.set(`content-length`,a.byteLength.toString()),await n.put(r,new Response(a,{headers:e})).catch(e=>{wi.warn(`Unable to add response to browser cache: ${e}.`)})}}}async function yc(e,t,n=!0,r={},i=!1,a=null){let{requestURL:o,localPath:s,remoteURL:c,proposedCacheKey:l,validModelId:u}=gc(e,t,r,a),d,f=!1,p;p=await _c(a,s,l);let m=p!==void 0;if(m)d=l;else{if(di.allowLocalModels){if(!Zs(o,[`http:`,`https:`]))try{p=await mc(s),d=s}catch(e){wi.warn(`Unable to load from local path "${s}": "${e}"`)}else if(r.local_files_only)throw Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${o}.`);else if(!di.allowRemoteModels)throw Error(`\`env.allowRemoteModels=false\`, but attempted to load a remote file from: ${o}.`)}if(p===void 0||typeof p!=`string`&&p.status===404){if(r.local_files_only||!di.allowRemoteModels){if(n)throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${s}".`);return null}if(!u)throw Error(`Local file missing at "${s}" and download aborted due to invalid model ID "${e}".`);if(p=await mc(c),p.status!==200)return $s(p.status,c,n);d=l}f=a&&typeof Response<`u`&&p instanceof Response&&p.status===200}mi(r.progress_callback,{status:`download`,name:e,file:t});let h;if(!(ni.IS_NODE_ENV&&i)){let n;if(typeof p!=`string`)if(!r.progress_callback)n=new Uint8Array(await p.arrayBuffer());else if(m&&typeof navigator<`u`&&/firefox/i.test(navigator.userAgent))n=new Uint8Array(await p.arrayBuffer()),mi(r.progress_callback,{status:`progress`,name:e,file:t,progress:100,loaded:n.length,total:n.length});else{let i,a=p.headers.get(`content-length`);if(a)i=parseInt(a,10);else try{let n=await fc(e,t,r);n.size&&(i=n.size)}catch{}n=await ec(p,n=>{mi(r.progress_callback,{status:`progress`,name:e,file:t,...n})},i)}h=n}if(f&&d&&typeof p!=`string`&&await vc(e,t,a,d,p,h,r),ni.IS_NODE_ENV&&i&&r.progress_callback&&typeof p!=`string`){let n=parseInt(p.headers.get(`content-length`),10)||0;mi(r.progress_callback,{status:`progress`,name:e,file:t,progress:100,loaded:n,total:n})}if(mi(r.progress_callback,{status:`done`,name:e,file:t}),h){if(!ni.IS_NODE_ENV&&i)throw Error(`Cannot return path in a browser environment.`);return h}if(p instanceof zs)return p.filePath;let g=await a?.match(d);if(g instanceof zs)return g.filePath;if(g instanceof Response)return new Uint8Array(await g.arrayBuffer());if(typeof g==`string`)return g;throw Error(`Unable to get model file path or buffer.`)}var bc=new Map;async function xc(e,t,n=!0,r={},i=!1){if(!di.allowLocalModels){if(r.local_files_only)throw Error("Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).");if(!di.allowRemoteModels)throw Error("Invalid configuration detected: both local and remote models are disabled. Fix by setting `env.allowLocalModels` or `env.allowRemoteModels` to `true`.")}mi(r.progress_callback,{status:`initiate`,name:e,file:t});let a=`${e}::${t}`,o=bc.get(a);return o||(o=yc(e,t,n,r,i,await sc(r?.cache_dir)).then(e=>(bc.delete(a),e),e=>{throw bc.delete(a),e}),bc.set(a,o)),await o}async function Sc(e,t,n=!0,r={}){let i=await xc(e,t,n,r,!1);return i===null?null:new TextDecoder(`utf-8`).decode(i)}async function Cc(e,t,n=!0,r={}){let i=await Sc(e,t,n,r);return i===null?{}:JSON.parse(i)}function wc(e,[t,n,r],[i,a],o=`bilinear`,s=!1){let c=a/r,l=i/n,u=new e.constructor(i*a*t),d=n*r,f=i*a;for(let o=0;o=0;--e)i[e]=a,r[e]=t[n[e]],a*=r[e];let a=n.map((e,t)=>i[n.indexOf(t)]),o=new e.constructor(e.length);for(let n=0;n=0;--e)r+=i%t[e]*a[e],i=Math.floor(i/t[e]);o[r]=e[n]}return[o,r]}function Ec(e){let t=kc(e)[0],n=e.map(e=>Math.exp(e-t)),r=n.reduce((e,t)=>e+t,0);return n.map(e=>e/r)}function Dc(e){let t=kc(e)[0],n=0;for(let r=0;re-t-r)}function Oc(e){if(e.length===0)throw Error(`Array must not be empty`);let t=e[0],n=0;for(let r=1;rt&&(t=e[r],n=r);return[t,n]}function Ac(e){return e>0&&(e&e-1)==0}var jc=class{constructor(e){if(this.size=e|0,this.size<=1||!Ac(this.size))throw Error(`FFT size must be a power of two larger than 1`);this._csize=e<<1,this.table=new Float64Array(this.size*2);for(let e=0;ee;e<<=1)++t;this._width=t%2==0?t-1:t,this._bitrev=new Int32Array(1<>>t&3)<>>1);for(let t=0;t>>1]=e[t];return n}toComplexArray(e,t){let n=t||this.createComplexArray();for(let t=0;t>>1],n[t+1]=0;return n}transform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._transform4(e,t,1)}realTransform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._realTransform4(e,t,1)}inverseTransform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._transform4(e,t,-1);for(let t=0;t>=2;i>=2;i>>=2){a=r/i<<1;let t=a>>>2;for(o=0;o>>1,i>>>1)}else for(o=0,s=0;o>>1,i>>>1,n)}let l=this.table;for(i>>=2;i>=2;i>>=2){a=r/i<<1;let t=a>>>1,s=t>>>1,c=s>>>1;for(o=0;o>>1;for(let t=2;t>1;++t){let n=(t+1-e)**2/2,r=Math.sqrt(s**2+c**2)**n,o=n*Math.atan2(c,s),l=2*t;i[l]=r*Math.cos(o),i[l+1]=r*Math.sin(o),a[l]=i[l],a[l+1]=-i[l+1]}this._slicedChirpBuffer=i.subarray(t,n),this._f=new jc(r>>1),this._f.transform(this._chirpBuffer,a)}_transform(e,t,n){let r=this._buffer1,i=this._buffer2,a=this._outBuffer1,o=this._outBuffer2,s=this._chirpBuffer,c=this._slicedChirpBuffer,l=this._a;if(n)for(let e=0;e>1];r[e]=i*c[e],r[n]=i*c[n]}else for(let e=0;e=e.length&&(i=2*(e.length-1)-i),r[a++]=e[i]}r.sort(),n[t]=r[i]}return n}function Fc(e,t){let n=10**t;return Math.round(e*n)/n}function Ic(e){let t=Math.round(e);return Math.abs(e)%1==.5?t%2==0?t:t-1:t}function Lc(e){let t=e.length,n=e[0].length,r=[t+1,n+1],i=Array.from({length:r[0]},()=>Array(r[1]).fill(1/0));i[0][0]=0;let a=Array.from({length:r[0]},()=>Array(r[1]).fill(-1));for(let t=1;t0||s>0;)switch(c.push(o-1),l.push(s-1),a[o][s]){case 0:--o,--s;break;case 1:--o;break;case 2:--s;break;default:throw Error(`Internal error in dynamic time warping. Unexpected trace[${o}, ${s}]. Please file a bug report.`)}return c.reverse(),l.reverse(),[c,l]}var Rc=(function(){let e=null;return function(t){if(!e){e=new Float32Array(65536);let t=new ArrayBuffer(4),n=new Uint32Array(t),r=new Float32Array(t);for(let t=0;t>10,s=t&1023;if(o===31)i=a|2139095040|s<<13;else if(o===0)if(s===0)i=a;else{let e=113;for(;!(s&1024);)s<<=1,--e;s&=-1025,i=a|e<<23|s<<13}else i=a|o+112<<23|s<<13;n[0]=i,e[t]=r[0]}}let n=t.length,r=e,i=new Float32Array(n);for(let e=0;eBc});var Bc={};async function Vc(e){let t=e.split(`/`).pop(),n;try{if(n=await sc(),n){let t=await n.match(e);if(t)return t}}catch(e){wi.warn(`Failed to load ${t} from cache:`,e)}let r=await di.fetch(e);if(!r.ok)throw Error(`Failed to fetch ${t}: ${r.status} ${r.statusText}`);if(n)try{await n.put(e,r.clone())}catch(e){wi.warn(`Failed to cache ${t}:`,e)}return r}async function Hc(e){let t=await Vc(e);if(!t||typeof t==`string`)return null;try{return await t.arrayBuffer()}catch(e){return wi.warn(`Failed to read WASM binary:`,e),null}}async function Uc(e){if(ni.IS_SERVICE_WORKER_ENV||ni.IS_CHROME_AVAILABLE)return e;let t=await Vc(e);if(!t||typeof t==`string`)return null;try{let e=await t.text();e=e.replaceAll(`globalThis.process?.versions?.node`,`false`);let n=new Blob([e],{type:`text/javascript`});return URL.createObjectURL(n)}catch(e){return wi.warn(`Failed to read WASM factory:`,e),null}}var Wc=Object.freeze({auto:null,gpu:null,cpu:`cpu`,wasm:`wasm`,webgpu:`webgpu`,cuda:`cuda`,dml:`dml`,coreml:`coreml`,webnn:{name:`webnn`,deviceType:`cpu`},"webnn-npu":{name:`webnn`,deviceType:`npu`},"webnn-gpu":{name:`webnn`,deviceType:`gpu`},"webnn-cpu":{name:`webnn`,deviceType:`cpu`}});function Gc(e){return e<=li.DEBUG?0:e<=li.INFO?2:e<=li.WARNING||e<=li.ERROR?3:4}var Kc={0:`verbose`,1:`info`,2:`warning`,3:`error`,4:`fatal`},qc=[],Jc,Yc,Xc=Symbol.for(`onnxruntime`);if(Xc in globalThis)Yc=globalThis[Xc];else if(ni.IS_NODE_ENV){switch(Yc=zc,process.platform){case`win32`:qc.push(`dml`);break;case`linux`:process.arch===`x64`&&qc.push(`cuda`);break;case`darwin`:qc.push(`coreml`);break}qc.push(`webgpu`),qc.push(`cpu`),Jc=[`cpu`]}else Yc=u,ni.IS_WEBNN_AVAILABLE&&qc.push(`webnn-npu`,`webnn-gpu`,`webnn-cpu`,`webnn`),ni.IS_WEBGPU_AVAILABLE&&qc.push(`webgpu`),qc.push(`wasm`),Jc=[`wasm`];var Zc=Yc.InferenceSession;function Qc(e=null){if(!e)return Jc;switch(e){case`auto`:return qc;case`gpu`:return qc.filter(e=>[`webgpu`,`cuda`,`dml`,`webnn-gpu`].includes(e))}if(qc.includes(e))return[Wc[e]??e];throw Error(`Unsupported device: "${e}". Should be one of: ${qc.join(`, `)}.`)}var $c=Promise.resolve(),el=null;async function tl(){if(el)return el;if(!(di.useWasmCache&&typeof ol?.wasm?.wasmPaths==`object`&&ol?.wasm?.wasmPaths?.wasm&&ol?.wasm?.wasmPaths?.mjs)){if(ni.IS_DENO_WEB_RUNTIME)throw Error(`env.useWasmCache=false is not supported in Deno's web runtime. Remove the useWasmCache override.`);return el=Promise.resolve(),el}return el=(async()=>{let e=ol.wasm.wasmPaths,t=!1;await Promise.all([e.wasm&&!tc(e.wasm)?(async()=>{try{let n=await Hc(nc(e.wasm));n&&(ol.wasm.wasmBinary=n,t=!0)}catch(e){wi.warn(`Failed to pre-load WASM binary:`,e)}})():Promise.resolve(),e.mjs&&!tc(e.mjs)?(async()=>{try{let t=await Uc(nc(e.mjs));t&&(ol.wasm.wasmPaths.mjs=t)}catch(e){wi.warn(`Failed to pre-load WASM factory:`,e)}})():Promise.resolve()]),t||(ol.wasm.wasmPaths.mjs=e.mjs)})(),el}async function nl(e,t,n){await tl();let r=Gc(di.logLevel??li.WARNING),i=()=>Zc.create(e,{logSeverityLevel:r,...t}),a=await(ni.IS_WEB_ENV?$c=$c.then(i):i());return a.config=n,a}var rl=Promise.resolve();async function il(e,t){let n=()=>e.run(t);return ni.IS_WEB_ENV?rl=rl.then(n):n()}function al(e){return e instanceof Yc.Tensor}var ol=Yc?.env;function sl(){return ol?.wasm?.proxy}if(ol){let e=function(e){ol.logLevel=Kc[Gc(e)]};if(ol.wasm){if(!(typeof ServiceWorkerGlobalScope<`u`&&self instanceof ServiceWorkerGlobalScope)&&ol.versions?.web&&!ol.wasm.wasmPaths){let e=`https://cdn.jsdelivr.net/npm/onnxruntime-web@${ol.versions.web}/dist/`;ol.wasm.wasmPaths=ni.IS_SAFARI?{mjs:`${e}ort-wasm-simd-threaded.mjs`,wasm:`${e}ort-wasm-simd-threaded.wasm`}:{mjs:`${e}ort-wasm-simd-threaded.asyncify.mjs`,wasm:`${e}ort-wasm-simd-threaded.asyncify.wasm`}}ol.wasm.proxy=!1}ol.webgpu&&(ol.webgpu.powerPreference=`high-performance`),e(di.logLevel??li.WARNING),di.backends.onnx={...ol,setLogLevel:e}}var cl=async(e,t,n)=>{let r=await nl(new Uint8Array(e),t);return(async e=>{let t=sl(),i=await il(r,Object.fromEntries(Object.entries(e).map(([e,n])=>[e,(t?n.clone():n).ort_tensor])));return Array.isArray(n)?n.map(e=>new G(i[e])):new G(i[n])})},ll=class{static session_options={};static get nearest_interpolate_4d(){return this._nearest_interpolate_4d||=cl([8,10,18,0,58,129,1,10,41,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,18,10,4,109,111,100,101,34,7,110,101,97,114,101,115,116,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,21],this.session_options,`y`),this._nearest_interpolate_4d}static get bilinear_interpolate_4d(){return this._bilinear_interpolate_4d||=cl([8,9,18,0,58,128,1,10,40,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,17,10,4,109,111,100,101,34,6,108,105,110,101,97,114,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,`y`),this._bilinear_interpolate_4d}static get bicubic_interpolate_4d(){return this._bicubic_interpolate_4d||=cl([8,9,18,0,58,127,10,39,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,16,10,4,109,111,100,101,34,5,99,117,98,105,99,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,`y`),this._bicubic_interpolate_4d}static get matmul(){return this._matmul||=cl([8,9,18,0,58,55,10,17,10,1,97,10,1,98,18,1,99,34,6,77,97,116,77,117,108,18,1,114,90,9,10,1,97,18,4,10,2,8,1,90,9,10,1,98,18,4,10,2,8,1,98,9,10,1,99,18,4,10,2,8,1,66,2,16,20],this.session_options,`c`),this._matmul}static get stft(){return this._stft||=cl([8,7,18,0,58,148,1,10,38,10,1,115,10,1,106,10,1,119,10,1,108,18,1,111,34,4,83,84,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,115,90,26,10,1,115,18,21,10,19,8,1,18,15,10,3,18,1,98,10,3,18,1,115,10,3,18,1,99,90,11,10,1,106,18,6,10,4,8,7,18,0,90,16,10,1,119,18,11,10,9,8,1,18,5,10,3,18,1,119,90,11,10,1,108,18,6,10,4,8,7,18,0,98,31,10,1,111,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,102,10,3,18,1,100,10,3,18,1,99,66,2,16,17],this.session_options,`o`),this._stft}static get rfft(){return this._rfft||=cl([8,9,18,0,58,97,10,33,10,1,120,10,0,10,1,97,18,1,121,34,3,68,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,100,90,21,10,1,120,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,90,11,10,1,97,18,6,10,4,8,7,18,0,98,21,10,1,121,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,66,2,16,20],this.session_options,`y`),this._rfft}static get top_k(){return this._top_k||=cl([8,10,18,0,58,73,10,18,10,1,120,10,1,107,18,1,118,18,1,105,34,4,84,111,112,75,18,1,116,90,9,10,1,120,18,4,10,2,8,1,90,15,10,1,107,18,10,10,8,8,7,18,4,10,2,8,1,98,9,10,1,118,18,4,10,2,8,1,98,9,10,1,105,18,4,10,2,8,7,66,2,16,21],this.session_options,[`v`,`i`]),this._top_k}static get slice(){return this._slice||=cl([8,7,18,0,58,96,10,25,10,1,120,10,1,115,10,1,101,10,1,97,10,1,116,18,1,121,34,5,83,108,105,99,101,18,1,114,90,9,10,1,120,18,4,10,2,8,1,90,9,10,1,115,18,4,10,2,8,7,90,9,10,1,101,18,4,10,2,8,7,90,9,10,1,97,18,4,10,2,8,7,90,9,10,1,116,18,4,10,2,8,7,98,9,10,1,121,18,4,10,2,8,1,66,2,16,13],this.session_options,`y`),this._slice}},ul=Object.freeze({auto:`auto`,gpu:`gpu`,cpu:`cpu`,wasm:`wasm`,webgpu:`webgpu`,cuda:`cuda`,dml:`dml`,coreml:`coreml`,webnn:`webnn`,"webnn-npu":`webnn-npu`,"webnn-gpu":`webnn-gpu`,"webnn-cpu":`webnn-cpu`}),dl=ni.IS_NODE_ENV?`cpu`:`wasm`;function fl(e,t,{warn:n}={}){return e?typeof e==`string`?e:e.hasOwnProperty(t)?e[t]:(n&&n(`device not specified for "${t}". Using the default device (${dl}).`),dl):dl}var pl=(function(){let e;return async function(){if(e===void 0)if(!ni.IS_WEBGPU_AVAILABLE)e=!1;else try{e=(await navigator.gpu.requestAdapter()).features.has(`shader-f16`)}catch{e=!1}return e}})(),ml=Object.freeze({auto:`auto`,fp32:`fp32`,fp16:`fp16`,q8:`q8`,int8:`int8`,uint8:`uint8`,q4:`q4`,bnb4:`bnb4`,q4f16:`q4f16`,q2:`q2`,q2f16:`q2f16`,q1:`q1`,q1f16:`q1f16`}),hl=ml.fp32,gl=Object.freeze({[ul.wasm]:ml.q8}),_l=Object.freeze({[ml.fp32]:``,[ml.fp16]:`_fp16`,[ml.int8]:`_int8`,[ml.uint8]:`_uint8`,[ml.q8]:`_quantized`,[ml.q4]:`_q4`,[ml.q2]:`_q2`,[ml.q1]:`_q1`,[ml.q4f16]:`_q4f16`,[ml.q2f16]:`_q2f16`,[ml.q1f16]:`_q1f16`,[ml.bnb4]:`_bnb4`});function vl(e,t,n,{configDtype:r=null,warn:i}={}){let a,o=!1;e&&typeof e!=`string`?e.hasOwnProperty(t)?a=e[t]:(a=null,o=!0):a=e;let s;if(a===ml.auto){if(r){let e=typeof r==`string`?r:r?.[t];if(e&&e!==ml.auto&&ml.hasOwnProperty(e))return e}s=gl[n]??hl}else s=a&&ml.hasOwnProperty(a)?a:gl[n]??hl;return o&&i&&i(`dtype not specified for "${t}". Using the default dtype (${s}) for this device (${n}).`),s}var yl=Object.freeze({float32:Float32Array,float16:typeof Float16Array<`u`?Float16Array:Uint16Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array,uint4:Uint8Array,int4:Int8Array}),G=class e{get dims(){return this.ort_tensor.dims}set dims(e){this.ort_tensor.dims=e}get type(){return this.ort_tensor.type}get data(){return this.ort_tensor.data}get size(){return this.ort_tensor.size}get location(){return this.ort_tensor.location}ort_tensor;constructor(...e){return al(e[0])?this.ort_tensor=e[0]:this.ort_tensor=new Cr(e[0],e[1],e[2]),new Proxy(this,{get:(e,t)=>{if(typeof t==`string`){let n=Number(t);if(Number.isInteger(n))return e._getitem(n)}return e[t]},set:(e,t,n)=>e[t]=n})}dispose(){this.ort_tensor.dispose()}*[Symbol.iterator](){let[e,...t]=this.dims;if(t.length>0){let n=t.reduce((e,t)=>e*t);for(let r=0;r0){let e=r.reduce((e,t)=>e*t);return this._subarray(t,e,r)}else return new e(this.type,[this.data[t]],r)}indexOf(e){let t=this.data;for(let n=0;na)throw Error(`Invalid slice: ${i}`);let o=[Math.max(t,0),Math.min(a,this.dims[e])];r.push(o),n.push(o[1]-o[0])}else throw Error(`Invalid slice: ${i}`)}let i=r.map(([e,t])=>t-e),a=i.reduce((e,t)=>e*t),o=this.data,s=new o.constructor(a),c=this.stride(),l=!0;for(let e=1;e=0;--n){let e=i[n];t+=(a%e+r[n][0])*c[n],a=Math.floor(a/e)}s[e]=o[t]}return new e(this.type,s,n)}permute(...e){return xl(this,e)}transpose(...e){return this.permute(...e)}sum(e=null,t=!1){return this.norm(1,e,t)}norm(t=`fro`,n=null,r=!1){if(t===`fro`)t=2;else if(typeof t==`string`)throw Error(`Unsupported norm: ${t}`);let i=this.data,a=i instanceof BigInt64Array||i instanceof BigUint64Array;if(a&&t!==1)throw Error(`Expected a floating point tensor as input. Got ${this.type}`);let o,s;if(a?(o=(e,t)=>e+t,s=0n):(o=(e,n)=>e+n**t,s=0),n===null){let n=i.reduce(o,s);return t!==1&&(n**=1/t),new e(this.type,[n],[])}let[c,l,u]=Pl(o,this,n,r);if(t!==1)for(let e=0;e=0;--r){let e=this.dims[r];if(r!==t){let t=i%e;n+=t*a,a*=this.dims[r]}i=Math.floor(i/e)}r[e]/=i[n]}return this}normalize(e=2,t=1){return this.clone().normalize_(e,t)}stride(){return Ll(this.dims)}squeeze(t=null){return new e(this.type,this.data,kl(this.dims,t))}squeeze_(e=null){return this.dims=kl(this.dims,e),this}unsqueeze(t){return new e(this.type,this.data,Al(this.dims,t))}unsqueeze_(e){return this.dims=Al(this.dims,e),this}flatten_(e=0,t=-1){t=(t+this.dims.length)%this.dims.length;let n=this.dims.slice(0,e),r=this.dims.slice(e,t+1),i=this.dims.slice(t+1);return this.dims=[...n,r.reduce((e,t)=>e*t,1),...i],this}flatten(e=0,t=-1){return this.clone().flatten_(e,t)}view(...t){let n=-1;for(let e=0;er===n?e:e*t,1);t[n]=r.length/e}return new e(this.type,r,t)}neg_(){let e=this.data;for(let t=0;tt);return new e(`bool`,n,this.dims)}lt(t){let n=new Uint8Array(this.data.length),r=this.data;for(let e=0;eMath.min(e,t),this,t,n,1/0);return new e(r,i,a)}max(t=null,n=!1){if(t===null){let t=kc(this.data)[0];return new e(this.type,[t],[])}let[r,i,a]=Pl((e,t)=>Math.max(e,t),this,t,n,-1/0);return new e(r,i,a)}argmin(t=null,n=!1){if(t!==null)throw Error("`dim !== null` not yet implemented.");let r=Oc(this.data)[1];return new e(`int64`,[BigInt(r)],[])}argmax(t=null,n=!1){if(t!==null)throw Error("`dim !== null` not yet implemented.");let r=kc(this.data)[1];return new e(`int64`,[BigInt(r)],[])}repeat(...t){if(t.lengthe===1)){if(t.length===this.dims.length)return this.clone();let n=t.length-this.dims.length,r=Array(n).fill(1).concat(this.dims);return new e(this.type,this.data.slice(),r)}let n=t.length-this.dims.length,r=Array(n).fill(1).concat(this.dims),i=r.map((e,n)=>e*t[n]),a=i.reduce((e,t)=>e*t,1),o=this.data,s=new o.constructor(a),c=Ll(r),l=Ll(i);for(let e=0;eBigInt(Math.floor(e)):BigInt;else if(this.type===`float16`&&t==`float32`&&this.data instanceof Uint16Array)return new e(t,Rc(this.data),this.dims);return new e(t,yl[t].from(this.data,n),this.dims)}};function bl(e,t){let n=e.length;if(n!==t.reduce((e,t)=>e*t))throw Error(`cannot reshape array of size ${n} into shape (${t})`);let r=e;for(let e=t.length-1;e>=0;e--)r=r.reduce((n,r)=>{let i=n[n.length-1];return i.lengthnew G(`int64`,e,[e.length]);async function Dl(e,t,n,r,i){return await(await ll.slice)({x:e,s:El(t),e:El(n),a:El(r),t:El(i??Array(r.length).fill(1))})}function Ol(e,t){let n=e.data,r=t.data,i=[e.dims[0],e.dims[2]],a=new n.constructor(i[0]*i[1]),[o,s,c]=e.dims,l=0;for(let e=0;ee!==1):typeof t==`number`?e[t]===1&&e.splice(t,1):Array.isArray(t)&&(e=e.filter((e,n)=>e!==1||!t.includes(n))),e}function Al(e,t){return t=jl(t,e.length+1),e=e.slice(),e.splice(t,0,1),e}function jl(e,t,n=null,r=!0){if(e<-t||e>=t){if(r)throw Error(`IndexError: index ${e} is out of bounds for dimension${n===null?``:` `+n} with size ${t}`);return e<-t?0:t}return e<0&&(e=(e%t+t)%t),e}function Ml(e,t=0){t=jl(t,e[0].dims.length);let n=e[0].dims.slice();n[t]=e.reduce((e,n)=>e+n.dims[t],0);let r=n.reduce((e,t)=>e*t,1),i=new e[0].data.constructor(r),a=e[0].type;if(t===0){let t=0;for(let n of e){let e=n.data;i.set(e,t),t+=e.length}}else{let r=0;for(let a=0;a=0;--i){let e=s[i],l=o%e;i===t&&(l+=r),a+=l*c,c*=n[i],o=Math.floor(o/e)}i[a]=o[e]}r+=s[t]}}return new G(a,i,n)}function Nl(e,t=0){return Ml(e.map(e=>e.unsqueeze(t)),t)}function Pl(e,t,n,r=!1,i=null){let a=t.data,o=t.dims;n=jl(n,o.length);let s=o.slice();s[n]=1;let c=new a.constructor(a.length/o[n]);i!==null&&c.fill(i);for(let t=0;t=0;--e){let t=o[e];if(e!==n){let n=i%t;r+=n*a,a*=s[e]}i=Math.floor(i/t)}c[r]=e(c[r],a[t],t,r)}return r||s.splice(n,1),[t.type,c,s]}function Fl(e,t=null,n=1,r=!1){let i=e.data,a=e.dims;if(t===null){let t=i.reduce((e,t)=>e+t,0)/i.length,r=Math.sqrt(i.reduce((e,n)=>e+(n-t)**2,0)/(i.length-n)),a=new G(e.type,[t],[]);return[new G(e.type,[r],[]),a]}t=jl(t,a.length);let o=Il(e,t,r),s=o.data,[c,l,u]=Pl((e,t,n,r)=>e+(t-s[r])**2,e,t,r);for(let e=0;ee+t,0);return new G(e.type,[t/i.length],[])}t=jl(t,r.length);let[a,o,s]=Pl((e,t)=>e+t,e,t,n);if(r[t]!==1)for(let e=0;e=0;--n)t[n]=r,r*=e[n];return t}function Rl(e,t,n,r){return new G(n,new r(e.reduce((e,t)=>e*t,1)).fill(t),e)}function zl(e,t){let n,r;if(typeof t==`number`)n=`float32`,r=Float32Array;else if(typeof t==`bigint`)n=`int64`,r=BigInt64Array;else if(typeof t==`boolean`)n=`bool`,r=Uint8Array;else throw Error(`Unsupported data type: ${typeof t}`);return Rl(e,t,n,r)}function Bl(e,t){return zl(e.dims,t)}function Vl(e){return Rl(e,1n,`int64`,BigInt64Array)}function Hl(e){return Vl(e.dims)}function Ul(e){return Rl(e,0n,`int64`,BigInt64Array)}function Wl(e){return Ul(e.dims)}function Gl(e){let t=e.reduce((e,t)=>e*t,1);return new G(`float32`,Float32Array.from({length:t},()=>Us.gauss()),e)}function Kl(e,t){if(e.dims.length!==2)throw Error(`The tensor must have 2 dimensions`);if(e.dims.at(-1)%8!=0)throw Error(`The last dimension of the tensor must be a multiple of 8`);if(![`binary`,`ubinary`].includes(t))throw Error(`The precision must be either 'binary' or 'ubinary'`);let n=t===`binary`,r=n?`int8`:`uint8`,i=n?Int8Array:Uint8Array,a=e.data,o=new i(a.length/8);for(let e=0;e0),r=Math.floor(e/8),i=e%8;o[r]|=t<<7-i,n&&i===0&&(o[r]-=128)}return new G(r,o,[e.dims[0],e.dims[1]/8])}async function ql(e){if(!e)throw Error(`modelId is required for get_tokenizer_files`);return(await fc(e,`tokenizer_config.json`,{})).exists?[`tokenizer.json`,`tokenizer_config.json`]:[]}async function Jl(e,t){let n=await ql(e);return await Promise.all(n.map(n=>Cc(e,n,!0,t)))}function Yl(e){let t=e.dims;switch(t.length){case 1:return e.tolist();case 2:if(t[0]!==1)throw Error("Unable to decode tensor with `batch size !== 1`. Use `tokenizer.batch_decode(...)` for batched inputs.");return e.tolist()[0];default:throw Error(`Expected tensor to have 1-2 dimensions, got ${t.length}.`)}}var Xl=[`bos_token`,`eos_token`,`unk_token`,`sep_token`,`pad_token`,`cls_token`,`mask_token`];function Zl(e,t,n,r){for(let i of Object.keys(e)){let a=t-e[i].length,o=n(i),s=Array(a).fill(o);e[i]=r===`right`?yi(e[i],s):yi(s,e[i])}}function Ql(e,t){for(let n of Object.keys(e))e[n].length=t}function $l(e,...t){for(let n of t){if(!Object.hasOwn(e,n))continue;let t=e[n];if(t)if(typeof t==`object`){if(t.__type===`AddedToken`)return t.content;throw Error(`Unknown token: ${t}`)}else return t}return null}function eu(e){let t=[];for(let n of e.get_added_tokens_decoder().values())n.special&&t.push(n);return t}var tu=class extends pi{return_token_type_ids=!1;padding_side=`right`;constructor(e,t){if(super(),this._tokenizerJSON=e,this._tokenizerConfig=t,this._tokenizer=new io(e,t),this.config=t,this.padding_side=t.padding_side??this.padding_side,this.mask_token=$l(t,`mask_token`),this.mask_token_id=this._tokenizer.token_to_id(this.mask_token),this.pad_token=$l(t,`pad_token`,`eos_token`),this.pad_token_id=this._tokenizer.token_to_id(this.pad_token),this.sep_token=$l(t,`sep_token`),this.sep_token_id=this._tokenizer.token_to_id(this.sep_token),this.unk_token=$l(t,`unk_token`),this.unk_token_id=this._tokenizer.token_to_id(this.unk_token),this.bos_token=$l(t,`bos_token`),this.bos_token_id=this._tokenizer.token_to_id(this.bos_token),this.eos_token=$l(t,`eos_token`),this.eos_token_id=this._tokenizer.token_to_id(this.eos_token),this.chat_template=t.chat_template??null,Array.isArray(this.chat_template)){let e=Object.create(null);for(let{name:t,template:n}of this.chat_template){if(typeof t!=`string`||typeof n!=`string`)throw Error(`Chat template must be a list of objects with "name" and "template" properties`);e[t]=n}this.chat_template=e}this._compiled_template_cache=new Map;let n=eu(this._tokenizer);this.all_special_ids=n.map(e=>e.id),this.all_special_tokens=n.map(e=>e.content)}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`}={}){let o=await Jl(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a});return new this(...o)}get_vocab(){return this._tokenizer.get_vocab()}get model_max_length(){return this._tokenizerConfig.model_max_length??1/0}get add_eos_token(){return this._tokenizerConfig.add_eos_token}get add_bos_token(){return this._tokenizerConfig.add_bos_token}convert_tokens_to_ids(e){return typeof e==`string`?this._tokenizer.token_to_id(e):e.map(e=>this._tokenizer.token_to_id(e))}_call(e,t={}){let{text_pair:n=null,add_special_tokens:r=!0,padding:i=!1,return_token_type_ids:a=null}=t,{truncation:o=null,max_length:s=null}=t,c=t.return_tensor??!0,l=Array.isArray(e),u;if(l){if(e.length===0)throw Error(`text array must be non-empty`);if(n!==null){if(!Array.isArray(n))throw Error(`text_pair must also be an array`);if(e.length!==n.length)throw Error(`text and text_pair must have the same length`);u=e.map((e,t)=>this._encode_plus(e,{text_pair:n[t],add_special_tokens:r,return_token_type_ids:a}))}else u=e.map(e=>this._encode_plus(e,{add_special_tokens:r,return_token_type_ids:a}))}else{if(e==null)throw Error(`text may not be null or undefined`);if(Array.isArray(n))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");u=[this._encode_plus(e,{text_pair:n,add_special_tokens:r,return_token_type_ids:a})]}if(s===null?s=this.model_max_length:o===null&&(i===!0?(wi.warn("`max_length` is ignored when `padding: true` and there is no truncation strategy. To pad to max length, use `padding: 'max_length'`."),s=this.model_max_length):i===!1&&(wi.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation: true` to explicitly truncate examples to max length."),o=!0)),i===!0&&(s=Math.min(kc(u.map(e=>e.input_ids.length))[0],s??1/0)),s=Math.min(s,this.model_max_length??1/0),i||o)for(let e=0;es?o&&Ql(u[e],s):i&&Zl(u[e],s,e=>e===`input_ids`?this.pad_token_id:0,this.padding_side);let d={};if(c){if(!(i&&o)&&u.some(e=>{for(let t of Object.keys(e))if(e[t].length!==u[0][t]?.length)return!0;return!1}))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.`);let e=[u.length,u[0].input_ids.length];for(let t of Object.keys(u[0]))d[t]=new G(`int64`,BigInt64Array.from(u.flatMap(e=>e[t]).map(BigInt)),e)}else{for(let e of Object.keys(u[0]))d[e]=u.map(t=>t[e]);if(!l)for(let e of Object.keys(d))d[e]=d[e][0]}return d}_encode_text(e){return e===null?null:this._tokenizer.encode(e).tokens}_encode_plus(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){let{ids:i,attention_mask:a,token_type_ids:o}=this._tokenizer.encode(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:r??this.return_token_type_ids});return{input_ids:i,attention_mask:a,...o?{token_type_ids:o}:{}}}tokenize(e,{pair:t=null,add_special_tokens:n=!1}={}){return this._tokenizer.tokenize(e,{text_pair:t,add_special_tokens:n})}encode(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){return this._tokenizer.encode(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:r}).ids}batch_decode(e,t={}){return e instanceof G&&(e=e.tolist()),e.map(e=>this.decode(e,t))}decode(e,t={}){if(e instanceof G&&(e=Yl(e)),!Array.isArray(e)||e.length===0||!gi(e[0]))throw Error(`token_ids must be a non-empty array of integers.`);return this.decode_single(e,t)}decode_single(e,{skip_special_tokens:t=!1,clean_up_tokenization_spaces:n=null}){return this._tokenizer.decode(e,{skip_special_tokens:t,clean_up_tokenization_spaces:n})}get_chat_template({chat_template:e=null,tools:t=null}={}){if(this.chat_template&&typeof this.chat_template==`object`){let n=this.chat_template;if(e!==null&&Object.hasOwn(n,e))e=n[e];else if(e===null)if(t!==null&&`tool_use`in n)e=n.tool_use;else if(`default`in n)e=n.default;else throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(n).sort()}.`)}else if(e===null)if(this.chat_template)e=this.chat_template;else throw Error(`Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co/docs/transformers/main/en/chat_templating`);return e}apply_chat_template(e,t={}){let{tools:n=null,documents:r=null,chat_template:i=null,add_generation_prompt:a=!1,tokenize:o=!0,padding:s=!1,truncation:c=!1,max_length:l=null,return_tensor:u=!0,return_dict:d=!0,tokenizer_kwargs:f={},...p}=t;if(i=this.get_chat_template({chat_template:i,tools:n}),typeof i!=`string`)throw Error(`chat_template must be a string, but got ${typeof i}`);let m=this._compiled_template_cache.get(i);m===void 0&&(m=new Ls(i),this._compiled_template_cache.set(i,m));let h=Object.create(null);for(let e of Xl){let t=$l(this.config,e);t&&(h[e]=t)}let g=m.render({messages:e,add_generation_prompt:a,tools:n,documents:r,...h,...p});if(o){let e=this._call(g,{add_special_tokens:!1,padding:s,truncation:c,max_length:l,return_tensor:u,...f});return d?e:e.input_ids}return g}};function nu(e,t,n,r){if(!(`language_codes`in e)||!Array.isArray(e.language_codes))throw Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!(`languageRegex`in e)||!(e.languageRegex instanceof RegExp))throw Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!(`lang_to_token`in e)||typeof e.lang_to_token!=`function`)throw Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");let i=r.src_lang,a=r.tgt_lang;if(!e.language_codes.includes(a))throw Error(`Target language code "${a}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);if(i!==void 0){if(!e.language_codes.includes(i))throw Error(`Source language code "${i}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);for(let t of e._tokenizer.post_processor.config.single)if(`SpecialToken`in t&&e.languageRegex.test(t.SpecialToken.id)){t.SpecialToken.id=e.lang_to_token(i);break}}return r.forced_bos_token_id=e._tokenizer.token_to_id(e.lang_to_token(a)),e._call(t,n)}var ru={};Pr(ru,{AlbertTokenizer:()=>iu,AutoTokenizer:()=>nd,BartTokenizer:()=>au,BertTokenizer:()=>ou,BlenderbotSmallTokenizer:()=>su,BlenderbotTokenizer:()=>cu,BloomTokenizer:()=>lu,CLIPTokenizer:()=>du,CamembertTokenizer:()=>uu,CodeGenTokenizer:()=>pu,CodeLlamaTokenizer:()=>fu,CohereAsrTokenizer:()=>hu,CohereTokenizer:()=>mu,ConvBertTokenizer:()=>gu,DebertaTokenizer:()=>vu,DebertaV2Tokenizer:()=>_u,DistilBertTokenizer:()=>yu,ElectraTokenizer:()=>bu,EsmTokenizer:()=>xu,FalconTokenizer:()=>Su,GPT2Tokenizer:()=>Tu,GPTNeoXTokenizer:()=>wu,GemmaTokenizer:()=>Cu,HerbertTokenizer:()=>Eu,LlamaTokenizer:()=>Du,M2M100Tokenizer:()=>Ou,MBart50Tokenizer:()=>ju,MBartTokenizer:()=>Au,MPNetTokenizer:()=>Pu,MarianTokenizer:()=>ku,MgpstrTokenizer:()=>Mu,MobileBertTokenizer:()=>Nu,NllbTokenizer:()=>Fu,NougatTokenizer:()=>Iu,PreTrainedTokenizer:()=>tu,Qwen2Tokenizer:()=>Lu,RoFormerTokenizer:()=>zu,RobertaTokenizer:()=>Ru,SiglipTokenizer:()=>Bu,SpeechT5Tokenizer:()=>Vu,SqueezeBertTokenizer:()=>Hu,T5Tokenizer:()=>Uu,TokenizersBackend:()=>tu,VitsTokenizer:()=>Gu,Wav2Vec2CTCTokenizer:()=>Ku,WhisperTokenizer:()=>$u,XLMRobertaTokenizer:()=>ed,XLMTokenizer:()=>td});var iu=class extends tu{return_token_type_ids=!0},au=class extends tu{},ou=class extends tu{return_token_type_ids=!0},su=class extends tu{},cu=class extends tu{},lu=class extends tu{},uu=class extends tu{},du=class extends tu{},fu=class extends tu{},pu=class extends tu{},mu=class extends tu{},hu=class extends tu{},gu=class extends tu{return_token_type_ids=!0},_u=class extends tu{return_token_type_ids=!0},vu=class extends tu{return_token_type_ids=!0},yu=class extends tu{},bu=class extends tu{return_token_type_ids=!0},xu=class extends tu{},Su=class extends tu{},Cu=class extends tu{},wu=class extends tu{},Tu=class extends tu{},Eu=class extends tu{return_token_type_ids=!0},Du=class extends tu{padding_side=`left`},Ou=class extends tu{constructor(e,t){super(e,t),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.all_special_tokens.filter(e=>this.languageRegex.test(e)).map(e=>e.slice(2,-2)),this.lang_to_token=e=>`__${e}__`}_build_translation_inputs(e,t,n){return nu(this,e,t,n)}},ku=class extends tu{constructor(e,t){super(e,t),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=Array.from(this.get_vocab().keys()).filter(e=>this.languageRegex.test(e)),wi.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(e){if(e===null)return null;let[t,...n]=e.trim().split(this.languageRegex);if(n.length===0)return super._encode_text(t);if(n.length===2){let[e,t]=n;return this.supported_language_codes.includes(e)||wi.warn(`Unsupported language code "${e}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),yi([e],super._encode_text(t))}}},Au=class extends tu{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.all_special_tokens.filter(e=>this.languageRegex.test(e)).map(e=>e),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return nu(this,e,t,n)}},ju=class extends Au{},Mu=class extends tu{},Nu=class extends tu{return_token_type_ids=!0},Pu=class extends tu{},Fu=class extends tu{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.all_special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return nu(this,e,t,n)}},Iu=class extends tu{},Lu=class extends tu{},Ru=class extends tu{},zu=class extends tu{return_token_type_ids=!0},Bu=class extends tu{},Vu=class extends tu{},Hu=class extends tu{return_token_type_ids=!0},Uu=class extends tu{},Wu=class extends Ga{decode_chain(e){let t=``;for(let n=1;n[t,e]),[`burmese`,`my`],[`valencian`,`ca`],[`flemish`,`nl`],[`haitian`,`ht`],[`letzeburgesch`,`lb`],[`pushto`,`ps`],[`panjabi`,`pa`],[`moldavian`,`ro`],[`moldovan`,`ro`],[`sinhalese`,`si`],[`castilian`,`es`]]);function Xu(e){e=e.toLowerCase();let t=Yu.get(e);if(t===void 0){let n=e.match(/^<\|([a-z]{2})\|>$/);if(n&&(e=n[1]),Ju.has(e))t=e;else{let t=e.length===2?Ju.keys():Ju.values();throw Error(`Language "${e}" is not supported. Must be one of: ${JSON.stringify(Array.from(t))}`)}}return t}var Zu=RegExp(`^[\\p{P}\\u0021-\\u002F\\u003A-\\u0040\\u005B-\\u0060\\u007B-\\u007E]+$`,`gu`),Qu=.1,$u=class extends tu{get timestamp_begin(){return this._tokenizer.token_to_id(`<|notimestamps|>`)+1}_decode_asr(e,{return_timestamps:t=!1,return_language:n=!1,time_precision:r=null,force_full_sequences:i=!0}={}){if(r===null)throw Error(`Must specify time_precision`);let a=null,o=t===`word`;function s(){return{language:a,timestamp:[null,null],text:``}}let c=[],l=s(),u=0,d=this.timestamp_begin,f=d+1500,p=[],m=[],h=!1,g=null,_=new Set(this.all_special_ids);for(let n of e){let e=n.tokens,i=o?n.token_timestamps:null,v=null,y=d;if(`stride`in n){let[t,i,a]=n.stride;if(u-=i,g=t-a,i&&(y=i/r+d),a)for(let t=e.length-1;t>=0;--t){let n=Number(e[t]);if(n>=d){if(v!==null&&(n-d)*r=d&&g<=f){let e=Fc((g-d)*r+u,2);if(v!==null&&g>=v)h=!0;else if(h||p.length>0&&g0&&l.timestamp[1]!==null))for(let e of l.words)e.timestamp[1]>l.timestamp[1]&&l.timestamp[1]>=e.timestamp[0]&&(e.timestamp[1]=l.timestamp[1]);c.push(l),p=[],b=[],m=[],x=[],l=s()}}else if(b.push(g),o){let e=Fc(i[n]+u,2),t;if(n+10?(p.push(b),o&&m.push(x)):p.every(e=>e.length===0)&&(l=s(),p=[],b=[],m=[],x=[])}if(p.length>0){if(i&&t)throw Error(`Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.`);let[e,n]=this.findLongestCommonSequence(p,m),r=this.decode(e);l.text=r,o&&(l.words=this.collateWordTimestamps(e,n,a)),c.push(l)}let v=Object.create(null),y=c.map(e=>e.text).join(``);if(t||n){for(let e=0;e0,o=a?[]:null,s=a?t[0]:null;for(let c=1;ce===g[n]&&s[i+n][0]-Qu<=t[c][m+n][0]).length:p.filter((e,t)=>e===g[t]).length;let v=e/1e4,y=_/e+v;_>1&&y>u&&(u=y,d=[i,o,m,h])}let[p,m,h,g]=d,_=Math.floor((m+p)/2),v=Math.floor((g+h)/2);if(a&&u===0&&r>0){let e=s[r-1][0],n=t[c].findIndex(t=>t[0]>=e);v=n===-1?l.length:n}i.push(...n.slice(0,_)),n=l.slice(v),r=n.length,a&&(o.push(...s.slice(0,_)),s=t[c].slice(v))}return i.push(...n),a?(o.push(...s),[i,o]):[i,[]]}collateWordTimestamps(e,t,n){let[r,i,a]=this.combineTokensIntoWords(e,n),o=[];for(let e=0;e=r){let e=((t-r)*n).toFixed(2);i.push(`<|${e}|>`),i.push([])}else i[i.length-1].push(t);return i=i.map(e=>typeof e==`string`?e:super.decode(e,t)),i.join(``)}splitTokensOnUnicode(e){let t=this.decode(e,{decode_with_timestamps:!0}),n=[],r=[],i=[],a=[],o=[],s=0;for(let c=0;c=this._tokenizer.token_to_id(`<|endoftext|>`),d=s.startsWith(` `),f=s.trim(),p=Zu.test(f);if(u||d||p||i.length===0)i.push(s),a.push(c),o.push(l);else{let e=i.length-1;i[e]+=s,a[e].push(...c),o[e].push(...l)}}return[i,a,o]}mergePunctuations(e,t,n,r,i){let a=structuredClone(e),o=structuredClone(t),s=structuredClone(n),c=a.length-2,l=a.length-1;for(;c>=0;)a[c].startsWith(` `)&&r.includes(a[c].trim())?(a[l]=a[c]+a[l],o[l]=yi(o[c],o[l]),s[l]=yi(s[c],s[l]),a[c]=``,o[c]=[],s[c]=[]):l=c,--c;for(c=0,l=1;le),o.filter(e=>e.length>0),s.filter(e=>e.length>0)]}},ed=class extends tu{},td=class extends tu{return_token_type_ids=!0;constructor(e,t){super(e,t),wi.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}},nd=class{static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`}={}){let[o,s]=await Jl(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a}),c=s.tokenizer_class?.replace(/Fast$/,``)??`PreTrainedTokenizer`,l=ru[c];return l||=(wi.warn(`Unknown tokenizer class "${c}", attempting to construct from base class.`),tu),new l(o,s)}},rd=`https://github.com/huggingface/transformers.js/issues/new/choose`,id=`preprocessor_config.json`,ad=id,od=`processor_config.json`,sd=`chat_template.jinja`,cd=class extends pi{static classes=[`image_processor_class`,`tokenizer_class`,`feature_extractor_class`];static uses_processor_config=!1;static uses_chat_template_file=!1;constructor(e,t,n){super(),this.config=e,this.components=t,this.chat_template=n}get image_processor(){return this.components.image_processor}get tokenizer(){return this.components.tokenizer}get feature_extractor(){return this.components.feature_extractor}apply_chat_template(e,t={}){if(!this.tokenizer)throw Error(`Unable to apply chat template without a tokenizer.`);return this.tokenizer.apply_chat_template(e,{tokenize:!1,chat_template:this.chat_template??void 0,...t})}batch_decode(...e){if(!this.tokenizer)throw Error(`Unable to decode without a tokenizer.`);return this.tokenizer.batch_decode(...e)}decode(...e){if(!this.tokenizer)throw Error(`Unable to decode without a tokenizer.`);return this.tokenizer.decode(...e)}async _call(e,...t){for(let n of[this.image_processor,this.feature_extractor,this.tokenizer])if(n)return n(e,...t);throw Error(`No image processor, feature extractor, or tokenizer found.`)}static async from_pretrained(e,t={}){let[n,r,i]=await Promise.all([this.uses_processor_config?Cc(e,od,!0,t):{},Promise.all(this.classes.filter(e=>e in this).map(async n=>{let r=await this[n].from_pretrained(e,t);return[n.replace(/_class$/,``),r]})).then(Object.fromEntries),this.uses_chat_template_file?Sc(e,sd,!0,t):null]);return new this(n,r,i)}},ld={};Pr(ld,{ChatterboxProcessor:()=>rf,CohereAsrProcessor:()=>of,Florence2Processor:()=>Yp,Gemma3Processor:()=>Xp,Gemma3nProcessor:()=>Zp,Gemma4Processor:()=>Qp,Glm46VProcessor:()=>em,GraniteSpeechProcessor:()=>tm,GroundingDinoProcessor:()=>rm,Idefics3Processor:()=>sm,JinaCLIPProcessor:()=>lm,Lfm2VlProcessor:()=>um,LlavaProcessor:()=>dm,MgpstrProcessor:()=>pm,MoonshineProcessor:()=>mm,OwlViTProcessor:()=>hm,PaliGemmaProcessor:()=>vm,Phi3VProcessor:()=>xm,PixtralProcessor:()=>Sm,Processor:()=>cd,PyAnnoteProcessor:()=>Cm,Qwen2VLProcessor:()=>$p,Qwen2_5_VLProcessor:()=>wm,Qwen3VLProcessor:()=>Tm,Sam2Processor:()=>Dm,Sam2VideoProcessor:()=>Om,SamProcessor:()=>Em,SmolVLMProcessor:()=>sm,SpeechT5Processor:()=>km,UltravoxProcessor:()=>Am,VLChatProcessor:()=>cm,VoxtralProcessor:()=>Fm,VoxtralRealtimeProcessor:()=>Vm,Wav2Vec2Processor:()=>Hm,Wav2Vec2ProcessorWithLM:()=>Um,WhisperProcessor:()=>Wm});var ud=class extends pi{constructor(e){super(),this.config=e}static async from_pretrained(e,t={}){let n=await Cc(e,id,!0,t);return new this(n)}};function dd(e,t){if(!(e instanceof Float32Array||e instanceof Float64Array))throw Error(`${t} expects input to be a Float32Array or a Float64Array, but got ${e?.constructor?.name??typeof e} instead. If using the feature extractor directly, remember to use \`read_audio(url, sampling_rate)\` to obtain the raw audio data of the file/url.`)}var fd={};Pr(fd,{ASTFeatureExtractor:()=>Id,ChatterboxFeatureExtractor:()=>Rd,ClapFeatureExtractor:()=>zd,CohereAsrFeatureExtractor:()=>Hd,DacFeatureExtractor:()=>Ud,EncodecFeatureExtractor:()=>Ld,FeatureExtractor:()=>ud,Gemma3nAudioFeatureExtractor:()=>Wd,Gemma4AudioFeatureExtractor:()=>Gd,GraniteSpeechFeatureExtractor:()=>Kd,MoonshineFeatureExtractor:()=>qd,ParakeetFeatureExtractor:()=>Vd,PyAnnoteFeatureExtractor:()=>Jd,SeamlessM4TFeatureExtractor:()=>Yd,SnacFeatureExtractor:()=>Xd,SpeechT5FeatureExtractor:()=>Zd,VoxtralRealtimeFeatureExtractor:()=>ef,Wav2Vec2FeatureExtractor:()=>Qd,WeSpeakerFeatureExtractor:()=>$d,WhisperFeatureExtractor:()=>tf});var pd={fromWeb:()=>{}};async function md(e,t){if(ni.IS_BROWSER_ENV){if(ni.IS_WEBWORKER_ENV)throw Error(`Unable to save a file from a Web Worker.`);let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e,r.click(),r.remove(),URL.revokeObjectURL(n)}else if(ni.IS_FS_AVAILABLE){let n=t.stream();await(pd.fromWeb(n),Fr.createWriteStream(e),void 0)}else throw Error(`Unable to save because filesystem is disabled in this environment.`)}async function hd(e,t){if(typeof AudioContext>`u`)throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing.");let n=await(await mc(e)).arrayBuffer(),r=new AudioContext({sampleRate:t});t===void 0&&wi.warn(`No sampling rate provided, using default of ${r.sampleRate}Hz.`);let i=await r.decodeAudioData(n),a;if(i.numberOfChannels===2){let e=Math.sqrt(2),t=i.getChannelData(0),n=i.getChannelData(1);a=new Float32Array(t.length);for(let r=0;r2595*Math.log10(1+e/700),kaldi:e=>1127*Math.log(1+e/700),slaney:(e,t=1e3,n=15,r=27/Math.log(6.4))=>e>=t?n+Math.log(e/t)*r:3*e/200};function xd(e,t=`htk`){let n=bd[t];if(!n)throw Error(`mel_scale should be one of "htk", "slaney" or "kaldi".`);return typeof e==`number`?n(e):e.map(e=>n(e))}var Sd={htk:e=>700*(10**(e/2595)-1),kaldi:e=>700*(Math.exp(e/1127)-1),slaney:(e,t=1e3,n=15,r=Math.log(6.4)/27)=>e>=n?t*Math.exp(r*(e-n)):200*e/3};function Cd(e,t=`htk`){let n=Sd[t];if(!n)throw Error(`mel_scale should be one of "htk", "slaney" or "kaldi".`);return typeof e==`number`?n(e):e.map(e=>n(e))}function wd(e,t){let n=Float64Array.from({length:t.length-1},(e,n)=>t[n+1]-t[n]),r=Array.from({length:e.length},()=>Array(t.length));for(let n=0;nArray(e.length));for(let t=0;te+r*n)}function Ed(e,t,n,r,i,a=null,o=`htk`,s=!1){if(a!==null&&a!==`slaney`)throw Error(`norm must be one of null or "slaney"`);if(e<2)throw Error(`Require num_frequency_bins: ${e} >= 2`);if(n>r)throw Error(`Require min_frequency: ${n} <= max_frequency: ${r}`);let c=Td(xd(n,o),xd(r,o),t+2),l=Cd(c,o),u;if(s){let t=i/((e-1)*2);u=xd(Float64Array.from({length:e},(e,n)=>n*t),o),l=c}else u=Td(0,Math.floor(i/2),e);let d=wd(u,l);if(a!==null&&a===`slaney`)for(let n=0;ni)throw Error(`frame_length (${n}) may not be larger than fft_length (${i})`);if(T!==n)throw Error(`Length of the window (${T}) must equal frame_length (${n})`);if(r<=0)throw Error(`hop_length must be greater than zero`);if(a===null&&d!==null)throw Error("You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram. Specify `power` to fix this issue.");if(!u)throw Error("`preemphasis_htk_flavor=false` is not currently supported.");if(o){let t=Math.floor(n/2);switch(s){case`reflect`:e=Dd(e,t,t);break;case`constant`:{let n=new e.constructor(e.length+2*t);n.set(e,t),e=n;break}case`semicausal`:{let n=new e.constructor(e.length+t);n.set(e,t),e=n;break}default:throw Error(`pad_mode="${s}" not implemented yet.`)}}let E=Math.floor(1+Math.floor((e.length-n)/r));y!==null&&EE?x&&(k=b):k=O=b);let A=new Nc(i),j=new Float64Array(i),M=new Float64Array(A.outputBufferSize),N=new Float32Array(D*k);for(let i=0;i=1;--e)j[e]-=l*j[e-1];j[0]*=1-l}for(let e=0;ee**.85);break;default:throw Error(`Unknown window type ${t}.`)}if(n&&(o=o.subarray(0,e)),r===null||e===r)return o;if(e>r)throw Error(`Length of the window (${e}) may not be larger than frame_length (${r})`);let s=new Float64Array(r),c=i?Math.floor((r-e)/2):0;return s.set(o,c),s}function Nd(e,t){let n=e.reduce((e,t)=>e+t.length,0),r=new ArrayBuffer(44),i=new DataView(r);return Pd(i,0,`RIFF`),i.setUint32(4,36+n*4,!0),Pd(i,8,`WAVE`),Pd(i,12,`fmt `),i.setUint32(16,16,!0),i.setUint16(20,3,!0),i.setUint16(22,1,!0),i.setUint32(24,t,!0),i.setUint32(28,t*4,!0),i.setUint16(32,4,!0),i.setUint16(34,32,!0),Pd(i,36,`data`),i.setUint32(40,n*4,!0),new Blob([r,...e.map(e=>e.buffer)],{type:`audio/wav`})}function Pd(e,t,n){for(let r=0;re+t.length,0),t=new Float32Array(e),n=0;for(let e of this.audio)t.set(e,n),n+=e.length;return t}else return this.audio}toBlob(){let e=this.audio;return e instanceof Float32Array&&(e=[e]),Nd(e,this.sampling_rate)}async save(e){return md(e,this.toBlob())}},Id=class extends ud{constructor(e){super(e);let t=this.config.sampling_rate,n=Ed(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0);this.mel_filters=n,this.window=Md(400,`hann`,{periodic:!1}),this.mean=this.config.mean,this.std=this.config.std}async _extract_fbank_features(e,t){return jd(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,max_num_frames:t,transpose:!0})}async _call(e){dd(e,`ASTFeatureExtractor`);let t=await this._extract_fbank_features(e,this.config.max_length);if(this.config.do_normalize){let e=this.std*2,n=t.data;for(let t=0;t0)if(n===`rand_trunc`){let n=Math.floor(Us.random()*(a+1));e=e.subarray(n,n+t),i=await this._extract_fbank_features(e,this.mel_filters_slaney,this.config.nb_max_samples)}else throw Error(`Truncation strategy "${n}" not implemented`);else{if(a<0){let n=new Float64Array(t);if(n.set(e),r===`repeat`)for(let r=e.length;r=1;--n)e[n]-=t*e[n-1];return await jd(e,this.window,this.window.length,this.config.hop_length,{fft_length:this.config.n_fft,power:2,mel_filters:this.config.mel_filters,log_mel:`log`,mel_floor:-1/0,pad_mode:`constant`,center:!0,transpose:!0,mel_offset:2**-24})}async _call(e){dd(e,`ParakeetFeatureExtractor`);let t=await this._extract_fbank_features(e),n=Math.floor((e.length+Math.floor(this.config.n_fft/2)*2-this.config.n_fft)/this.config.hop_length),r=t.data;r.fill(0,n*t.dims[1]);let[i,a]=t.dims,o=new Float64Array(a),s=new Float64Array(a);for(let e=0;e1?n-1:1;for(let e=0;e=l){s.push(e.slice(c,l));break}let t=Math.max(c,c+a-o),n=Math.min(c+a,l),i;i=n<=t?c+a:this._find_split_point_energy(e,t,n,r),i=Math.max(c+1,Math.min(i,l)),s.push(e.slice(c,i)),c=i}return s}_find_split_point_energy(e,t,n,r){let i=n-t;if(i<=r)return Math.floor((t+n)/2);let a=1/0,o=t,s=i-r;for(let n=0;n<=s;n+=r){let i=0;for(let a=0;at&&(e=e.slice(0,t)),r&&e.length%i!==0){let t=i-e.length%i,n=new Float64Array(e.length+t);n.set(e),this.config.padding_value!==0&&n.fill(this.config.padding_value,e.length),e=n}let a=await this._extract_fbank_features(e,this.config.max_length),o=zl([1,a.dims[0]],!0);return{input_features:a.unsqueeze_(0),input_features_mask:o}}},Gd=class extends Wd{async _extract_fbank_features(e,t){let{frame_length:n,hop_length:r,fft_length:i}=this.config,a=Math.floor(n/2),o=Math.floor((e.length+a-(n+1))/r)+1;return jd(e,this.window,n,r,{fft_length:i,center:!0,pad_mode:`semicausal`,onesided:!0,preemphasis:this.config.preemphasis,preemphasis_htk_flavor:this.config.preemphasis_htk_flavor,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:this.config.mel_floor,mel_floor_mode:`add`,remove_dc_offset:!1,transpose:!0,max_num_frames:o})}async _call(e,t={}){dd(e,`Gemma4AudioFeatureExtractor`);let n=e.length,r=await super._call(e,t),{input_features:i}=r,[,a,o]=i.dims,{frame_length:s,hop_length:c}=this.config,l=Math.floor(s/2),u=s+1,d=new Uint8Array(n+l+(t.pad_to_multiple_of??128));d.fill(1,l,l+n);let f=new Uint8Array(a);for(let e=0;e({id:e,start:t*n,end:r*n,confidence:i/(r-t)})))}return r}},Yd=class extends ud{constructor(e){super(e);let t=this.config.sampling_rate,n=Ed(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0);this.mel_filters=n,this.window=Md(400,`povey`,{periodic:!1})}async _extract_fbank_features(e,t){return e=e.map(e=>e*32768),jd(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,max_num_frames:t,transpose:!0})}async _call(e,{padding:t=!0,pad_to_multiple_of:n=2,do_normalize_per_mel_bins:r=!0,return_attention_mask:i=!0}={}){dd(e,`SeamlessM4TFeatureExtractor`);let a=await this._extract_fbank_features(e,this.config.max_length);if(r){let[e,t]=a.dims,n=a.data;for(let r=0;r0){let n=new Float32Array(t*(e+s));n.set(r),n.fill(this.config.padding_value,r.length);let c=e+s;a=new G(a.type,n,[c,t]),i&&(o=new G(`int64`,new BigInt64Array(c),[1,c]),o.data.fill(1n,0,e))}}let[s,c]=a.dims,l=this.config.stride;if(s%l!==0)throw Error(`The number of frames (${s}) must be a multiple of the stride (${l}).`);let u=a.view(1,Math.floor(s/l),c*l),d={input_features:u};if(i){let e=u.dims[1],t=new BigInt64Array(e);if(o){let e=o.data;for(let n=1,r=0;ne+t,0)/e.length,n=e.reduce((e,n)=>e+(n-t)**2,0)/e.length;return e.map(e=>(e-t)/Math.sqrt(n+1e-7))}async _call(e){dd(e,`Wav2Vec2FeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=e;this.config.do_normalize&&(t=this._zero_mean_unit_var_norm(t));let n=[1,t.length];return{input_values:new G(`float32`,t,n),attention_mask:new G(`int64`,new BigInt64Array(t.length).fill(1n),n)}}},$d=class extends ud{constructor(e){super(e);let t=this.config.sampling_rate,n=Ed(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0);this.mel_filters=n,this.window=Md(400,`hamming`,{periodic:!1}),this.min_num_frames=this.config.min_num_frames}async _extract_fbank_features(e){return e=e.map(e=>e*32768),jd(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,transpose:!0,min_num_frames:this.min_num_frames})}async _call(e){dd(e,`WeSpeakerFeatureExtractor`);let t=(await this._extract_fbank_features(e)).unsqueeze_(0);if(this.config.fbank_centering_span===null){let e=t.mean(1).data,n=t.data,[r,i,a]=t.dims;for(let t=0;tr?(e.length>this.config.n_samples&&wi.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`."),n=e.slice(0,r)):(n=new Float32Array(r),n.set(e)),{input_features:(await this._extract_fbank_features(n)).unsqueeze_(0)}}},nf=class{static async from_pretrained(e,t={}){let n=await Cc(e,id,!0,t),r=n.feature_extractor_type,i=fd[r];if(!i)throw Error(`Unknown feature_extractor_type: '${r}'. Please report this at ${rd}.`);return new i(n)}},rf=class extends cd{static tokenizer_class=nd;static feature_extractor_class=nf;async _call(e,t=null){let n=this.tokenizer(e),r=t?await this.feature_extractor(t):{};return{...n,...r}}},af=new Set([`ja`,`zh`]),of=class extends cd{static tokenizer_class=nd;static feature_extractor_class=nf;static uses_processor_config=!0;get_decoder_prompt_ids(e=`en`){let t=[`▁`,`<|startofcontext|>`,`<|startoftranscript|>`,`<|emo:undefined|>`,`<|${e}|>`,`<|${e}|>`,`<|pnc|>`,`<|noitn|>`,`<|notimestamp|>`,`<|nodiarize|>`];return this.tokenizer.convert_tokens_to_ids(t)}static join_chunks(e,t=`en`){let n=e.filter(e=>e&&e.trim());if(n.length===0)return``;let r=af.has(t)?``:` `;return[n[0].trimEnd(),...n.slice(1).map(e=>e.trim())].join(r)}async _call(e){return await this.feature_extractor(e)}},sf={},cf,lf,uf;if(ni.IS_WEB_ENV)cf=(e,t)=>{if(!self.OffscreenCanvas)throw Error(`OffscreenCanvas not supported by this environment.`);return new self.OffscreenCanvas(e,t)},uf=self.createImageBitmap,lf=self.ImageData;else if(sf)uf=async e=>{let t=(await e.metadata()).channels,{data:n,info:r}=await e.rotate().raw().toBuffer({resolveWithObject:!0}),i=new pf(new Uint8ClampedArray(n),r.width,r.height,r.channels);return t!==void 0&&t!==r.channels&&i.convert(t),i};else throw Error(`Unable to load image processing library.`);var df={0:`nearest`,1:`lanczos`,2:`bilinear`,3:`bicubic`,4:`box`,5:`hamming`},ff=new Map([[`png`,`image/png`],[`jpg`,`image/jpeg`],[`jpeg`,`image/jpeg`],[`gif`,`image/gif`]]),pf=class e{constructor(e,t,n,r){this.data=e,this.width=t,this.height=n,this.channels=r}get size(){return[this.width,this.height]}static async read(t){if(t instanceof e)return t;if(typeof t==`string`||t instanceof URL)return await this.fromURL(t);if(t instanceof Blob)return await this.fromBlob(t);if(typeof HTMLCanvasElement<`u`&&t instanceof HTMLCanvasElement||typeof OffscreenCanvas<`u`&&t instanceof OffscreenCanvas)return this.fromCanvas(t);throw Error(`Unsupported input type: ${typeof t}`)}static fromCanvas(t){if(!ni.IS_WEB_ENV)throw Error(`fromCanvas() is only supported in browser environments.`);let n=t.getContext(`2d`).getImageData(0,0,t.width,t.height).data;return new e(n,t.width,t.height,4)}static async fromURL(e){let t=await mc(e);if(t.status!==200)throw Error(`Unable to read image from "${e}" (${t.status} ${t.statusText})`);let n=await t.blob();return this.fromBlob(n)}static async fromBlob(e){if(ni.IS_WEB_ENV){let t=await uf(e),n=cf(t.width,t.height).getContext(`2d`);return n.drawImage(t,0,0),new this(n.getImageData(0,0,t.width,t.height).data,t.width,t.height,4)}else{let t=sf(await e.arrayBuffer());return await uf(t)}}static fromTensor(t,n=`CHW`){if(t.dims.length!==3)throw Error(`Tensor should have 3 dimensions, but has ${t.dims.length} dimensions.`);if(n===`CHW`)t=t.transpose(1,2,0);else if(n!==`HWC`)throw Error(`Unsupported channel format: ${n}`);if(!(t.data instanceof Uint8ClampedArray||t.data instanceof Uint8Array))throw Error(`Unsupported tensor type: ${t.type}`);switch(t.dims[2]){case 1:case 2:case 3:case 4:return new e(t.data,t.dims[1],t.dims[0],t.dims[2]);default:throw Error(`Unsupported number of channels: ${t.dims[2]}`)}}grayscale(){if(this.channels===1)return this;let e=new Uint8ClampedArray(this.width*this.height*1);switch(this.channels){case 3:case 4:for(let t=0,n=0;t=0?c=r:u=-r,i>=0?l=i:d=-i,s.drawImage(o,c,l,t,n,u,d,t,n),new e(s.getImageData(0,0,t,n).data,t,n,4).convert(a)}else{let e=this.toSharp();if(r>=0&&i>=0)e=e.extract({left:Math.floor(r),top:Math.floor(i),width:t,height:n});else if(r<=0&&i<=0){let a=Math.floor(-i),o=Math.floor(-r);e=e.extend({top:a,left:o,right:t-this.width-o,bottom:n-this.height-a})}else{let a=[0,0],o=0;i<0?(a[0]=Math.floor(-i),a[1]=n-this.height-a[0]):o=Math.floor(i);let s=[0,0],c=0;r<0?(s[0]=Math.floor(-r),s[1]=t-this.width-s[0]):c=Math.floor(r),e=e.extend({top:a[0],bottom:a[1],left:s[0],right:s[1]}).extract({left:c,top:o,width:t,height:n})}return await uf(e)}}async toBlob(e=`image/png`,t=1){if(!ni.IS_WEB_ENV)throw Error(`toBlob() is only supported in browser environments.`);return await this.toCanvas().convertToBlob({type:e,quality:t})}toTensor(e=`CHW`){let t=new G(`uint8`,new Uint8Array(this.data),[this.height,this.width,this.channels]);if(e!==`HWC`)if(e===`CHW`)t=t.permute(2,0,1);else throw Error(`Unsupported channel format: ${e}`);return t}toCanvas(){if(!ni.IS_WEB_ENV)throw Error(`toCanvas() is only supported in browser environments.`);let e=this.clone().rgba(),t=cf(e.width,e.height),n=new lf(e.data,e.width,e.height);return t.getContext(`2d`).putImageData(n,0,0),t}split(){let{data:t,width:n,height:r,channels:i}=this,a=t.constructor,o=t.length/i,s=Array.from({length:i},()=>new a(o));for(let e=0;enew e(t,n,r,1))}_update(e,t,n,r=null){return this.data=e,this.width=t,this.height=n,r!==null&&(this.channels=r),this}clone(){return new e(this.data.slice(),this.width,this.height,this.channels)}convert(e){if(this.channels===e)return this;switch(e){case 1:this.grayscale();break;case 3:this.rgb();break;case 4:this.rgba();break;default:throw Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this}async save(e){if(ni.IS_WEB_ENV){if(ni.IS_WEBWORKER_ENV)throw Error(`Unable to save an image from a Web Worker.`);let t=e.split(`.`).pop().toLowerCase(),n=ff.get(t)??`image/png`;return md(e,await this.toBlob(n))}else if(ni.IS_FS_AVAILABLE)await this.toSharp().toFile(e);else throw Error(`Unable to save the image because filesystem is disabled in this environment.`)}toSharp(){if(ni.IS_WEB_ENV)throw Error(`toSharp() is only supported in server-side environments.`);return sf(this.data,{raw:{width:this.width,height:this.height,channels:this.channels}})}};pf.read.bind(pf);function mf(e,t,n=0,r=null){let i=e/t,a=Ic(i)*t;return r!==null&&a>r&&(a=Math.floor(i)*t),at&&i.push(e)}else{let e=kc(n.data)[1];if(e===c-1||(a=Ec(n.data),a[e]e*o[(t+1)%2])),u.boxes.push(n),u.classes.push(t),u.scores.push(a[t])}}l.push(u)}return l}function vf(e,t=null){let n=e.logits,r=n.dims[0];if(t!==null&&t.length!==r)throw Error(`Make sure that you pass in as many target sizes as the batch dimension of the logits`);let i=[];for(let e=0;el[n]&&(l[n]=t[n],u[n]=e)}let d=Array(a.dims[0]);for(let e=0;ee!==void 0);i.push({segmentation:c,labels:f})}return i}function yf(e,t,n,r){let i=[],a=[],o=[];for(let s=0;sn&&(i.push(l),a.push(d),o.push(u))}return[i,a,o]}function bf(e,t,n,r=.5,i=.8){let a=[],o=0,s=0,c=t[n].data;for(let t=0;t=r&&++s;let l=o>0&&s>0;return l&&=o/s>i,[l,a]}function xf(e,t,n,r,i,a=null,o=null){let[s,c]=o??e[0].dims,l=new G(`int32`,new Int32Array(s*c),[s,c]),u=[];if(o!==null)for(let t=0;tf[e]&&(d[e]=n,f[e]=i[e])}let p=0,m=l.data;for(let a=0;a200)throw Error(`absolute aspect ratio must be smaller than 200, got ${Math.max(e,t)/Math.min(e,t)}`);let o=Math.round(e/n)*n,s=Math.round(t/n)*n;if(a*o*s>i){let r=Math.sqrt(a*e*t/i);o=Math.max(n,Math.floor(e/r/n)*n),s=Math.max(n,Math.floor(t/r/n)*n)}else if(a*o*si?c=Math.floor(i*s/r):i>r&&(s=Math.floor(r*c/i)),await e.resize(c,s,{resample:n}))}async crop_margin(e,t=200){let n=e.clone().grayscale(),r=Oc(n.data)[0],i=kc(n.data)[0]-r;if(i===0)return e;let a=t/255,o=n.width,s=n.height,c=0,l=0,u=n.data;for(let e=0;ethis.preprocess(e)));return{pixel_values:Nl(n.map(e=>e.pixel_values),0),original_sizes:n.map(e=>e.original_size),reshaped_input_sizes:n.map(e=>e.reshaped_input_size)}}static async from_pretrained(e,t={}){let n=await Cc(e,ad,!0,t);return new this(n)}},Ef={};Pr(Ef,{BeitFeatureExtractor:()=>Df,BitImageProcessor:()=>Of,CHMv2ImageProcessor:()=>Af,CLIPFeatureExtractor:()=>Mf,CLIPImageProcessor:()=>jf,ChineseCLIPFeatureExtractor:()=>kf,ConvNextFeatureExtractor:()=>Pf,ConvNextImageProcessor:()=>Nf,DINOv3ViTImageProcessor:()=>zf,DPTFeatureExtractor:()=>Uf,DPTImageProcessor:()=>Hf,DeiTFeatureExtractor:()=>If,DeiTImageProcessor:()=>Ff,DetrFeatureExtractor:()=>Rf,DetrImageProcessor:()=>Lf,DonutFeatureExtractor:()=>Vf,DonutImageProcessor:()=>Bf,EfficientNetImageProcessor:()=>Wf,GLPNFeatureExtractor:()=>Zf,Gemma3ImageProcessor:()=>Gf,Gemma4ImageProcessor:()=>Jf,Glm46VImageProcessor:()=>Xf,GroundingDinoImageProcessor:()=>Qf,Idefics3ImageProcessor:()=>$f,ImageFeatureExtractor:()=>Tf,ImageProcessor:()=>Tf,JinaCLIPImageProcessor:()=>tp,Lfm2VlImageProcessor:()=>sp,LlavaOnevisionImageProcessor:()=>cp,Mask2FormerImageProcessor:()=>dp,MaskFormerFeatureExtractor:()=>up,MaskFormerImageProcessor:()=>lp,MobileNetV1FeatureExtractor:()=>pp,MobileNetV1ImageProcessor:()=>fp,MobileNetV2FeatureExtractor:()=>hp,MobileNetV2ImageProcessor:()=>mp,MobileNetV3FeatureExtractor:()=>_p,MobileNetV3ImageProcessor:()=>gp,MobileNetV4FeatureExtractor:()=>yp,MobileNetV4ImageProcessor:()=>vp,MobileViTFeatureExtractor:()=>xp,MobileViTImageProcessor:()=>bp,NougatImageProcessor:()=>Sp,OwlViTFeatureExtractor:()=>wp,OwlViTImageProcessor:()=>Cp,Owlv2ImageProcessor:()=>Tp,Phi3VImageProcessor:()=>jp,PixtralImageProcessor:()=>Mp,PvtImageProcessor:()=>Np,Qwen2VLImageProcessor:()=>Yf,RTDetrImageProcessor:()=>Pp,Sam2ImageProcessor:()=>Fp,Sam3ImageProcessor:()=>Fp,SamImageProcessor:()=>Fp,SapiensFeatureExtractor:()=>Lp,SapiensImageProcessor:()=>Ip,SegformerFeatureExtractor:()=>zp,SegformerImageProcessor:()=>Rp,SiglipImageProcessor:()=>Bp,SmolVLMImageProcessor:()=>$f,Swin2SRImageProcessor:()=>Vp,VLMImageProcessor:()=>ep,ViTFeatureExtractor:()=>Up,ViTImageProcessor:()=>Hp,VitMatteImageProcessor:()=>Wp,VitPoseImageProcessor:()=>Gp,YolosFeatureExtractor:()=>qp,YolosImageProcessor:()=>Kp});var Df=class extends Tf{},Of=class extends Tf{},kf=class extends Tf{},Af=class extends Tf{},jf=class extends Tf{},Mf=class extends jf{},Nf=class extends Tf{constructor(e){super(e),this.crop_pct=this.config.crop_pct??224/256}async resize(e){let t=this.size?.shortest_edge;if(t===void 0)throw Error(`Size dictionary must contain 'shortest_edge' key.`);if(t<384){let n=Math.floor(t/this.crop_pct),[r,i]=this.get_resize_output_image_size(e,{shortest_edge:n});e=await e.resize(r,i,{resample:this.resample}),e=await e.center_crop(t,t)}else e=await e.resize(t,t,{resample:this.resample});return e}},Pf=class extends Nf{},Ff=class extends Tf{},If=class extends Ff{},Lf=class extends Tf{async _call(e){let t=await super._call(e),n=zl([t.pixel_values.dims[0],64,64],1n);return{...t,pixel_mask:n}}post_process_object_detection(...e){return _f(...e)}post_process_panoptic_segmentation(...e){return Cf(...e)}post_process_instance_segmentation(...e){return wf(...e)}},Rf=class extends Lf{},zf=class extends Tf{},Bf=class extends Tf{pad_image(e,t,n,r={}){let[i,a,o]=t,s=this.image_mean;Array.isArray(this.image_mean)||(s=Array(o).fill(s));let c=this.image_std;Array.isArray(c)||(c=Array(o).fill(s));let l=s.map((e,t)=>-e/c[t]);return super.pad_image(e,t,n,{center:!0,constant_values:l,...r})}},Vf=class extends Bf{},Hf=class extends Tf{},Uf=class extends Hf{},Wf=class extends Tf{constructor(e){super(e),this.include_top=this.config.include_top??!0,this.include_top&&(this.image_std=this.image_std.map(e=>e*e))}},Gf=class extends Tf{};function Kf(e,t,n,r,i){let a=r*n**2,o=Math.sqrt(a/(e*t)),s=i*n,c=Math.floor(o*e/s)*s,l=Math.floor(o*t/s)*s;if(c===0&&l===0)throw Error(`Attempting to resize to a 0 x 0 image. Resized height should be divisible by \`pooling_kernel_size * patch_size\`=${s}.`);let u=Math.floor(r/i**2)*s;return c===0?(c=s,l=Math.min(Math.floor(t/e)*s,u)):l===0&&(l=s,c=Math.min(Math.floor(e/t)*s,u)),[c,l]}function qf(e,t,n,r,i,a,o){let s=Math.floor(t/i),c=Math.floor(n/i),l=s*c,u=i*i*r,d=new Float32Array(a*u),f=0;for(let t=0;ta),0));let l=a.dims[0]/o,u=a.dims[1],d=Math.floor(a.dims[2]/c),f=Math.floor(a.dims[3]/c);return{pixel_values:a.view(l,o,u,Math.floor(d/s),s,c,Math.floor(f/s),s,c).permute(0,3,6,4,7,2,1,5,8).view(l*d*f,u*o*c*c),image_grid_thw:new G(`int64`,[l,d,f],[1,3]),original_sizes:r,reshaped_input_sizes:i}}},Xf=class extends Yf{get_resize_output_image_size(e,t){let n=this.patch_size*this.merge_size,r=this.config.temporal_patch_size??2;return Sf(e.height,e.width,n,this.min_pixels,this.max_pixels,r)}},Zf=class extends Tf{},Qf=class extends Tf{async _call(e){let t=await super._call(e),n=t.pixel_values.dims,r=Vl([n[0],n[2],n[3]]);return{...t,pixel_mask:r}}},$f=class extends Tf{constructor(e){super(e),this.do_image_splitting=e.do_image_splitting??!0,this.max_image_size=e.max_image_size}get_resize_for_vision_encoder(e,t){let[n,r]=e.dims.slice(-2),i=r/n;return r>=n?(r=Math.ceil(r/t)*t,n=Math.floor(r/i),n=Math.ceil(n/t)*t):(n=Math.ceil(n/t)*t,r=Math.floor(n*i),r=Math.ceil(r/t)*t),{height:n,width:r}}async _call(e,{do_image_splitting:t=null,return_row_col_info:n=!1}={}){let r;if(!Array.isArray(e))r=[[e]];else{if(e.length===0||!e[0])throw Error(`No images provided.`);r=Array.isArray(e[0])?e:[e]}let i=[],a=[],o=[],s=[],c=[];for(let e of r){let n=await Promise.all(e.map(e=>this.preprocess(e)));s.push(...n.map(e=>e.original_size)),c.push(...n.map(e=>e.reshaped_input_size)),n.forEach(e=>e.pixel_values.unsqueeze_(0));let{longest_edge:r}=this.max_image_size,l;if(t??this.do_image_splitting){let e=Array(n.length),t=Array(n.length);l=await Promise.all(n.map(async(n,i)=>{let a=this.get_resize_for_vision_encoder(n.pixel_values,r),o=await Cl(n.pixel_values,{size:[a.height,a.width]}),{frames:s,num_splits_h:c,num_splits_w:l}=await this.split_image(o,this.max_image_size);return e[i]=c,t[i]=l,Ml(s,0)})),a.push(e),o.push(t)}else{let e=[r,r];l=await Promise.all(n.map(t=>Cl(t.pixel_values,{size:e}))),a.push(Array(n.length).fill(0)),o.push(Array(n.length).fill(0))}i.push(Ml(l,0))}let l=i.length,[u,d,f,p]=i[0].dims,m,h;if(l===1)m=i[0].unsqueeze_(0),h=zl([l,u,f,p],!0);else{let e=Math.max(...i.map(e=>e.dims.at(0)));h=zl([l,e,f,p],!0);let t=h.data,n=e*f*p;for(let r=0;rn||o>r){s=Math.ceil(a/n),c=Math.ceil(o/r);let t=Math.ceil(a/s),l=Math.ceil(o/c);for(let n=0;ne*this.rescale_factor)}pad_image(e,t,n,r){return super.pad_image(e,t,n,{constant_values:this.constant_values,center:!0,...r})}},tp=class extends Tf{constructor(e){let{resize_mode:t,fill_color:n,interpolation:r,size:i,...a}=e,o=t===`squash`?{width:i,height:i}:t===`shortest`?{shortest_edge:i}:{longest_edge:i},s=r===`bicubic`?3:2;super({...a,size:o,resample:s,do_center_crop:!0,crop_size:i,do_normalize:!0})}};function np(e,t){return Math.round(e/t)*t}function rp(e,t,n,r,i){let a=1/0,o=[1,1],s=n*r;for(let n of t){let t=Math.abs(e-n[0]/n[1]);t.5*i*i*n[0]*n[1]&&(o=n)}return o}function ip(e,t){let n=[],r=new Set;for(let i=e;i<=t;++i)for(let a=1;a<=i;++a)for(let o=1;o<=i;++o){let i=a*o;if(i>=e&&i<=t){let e=a<<16|o;r.has(e)||(r.add(e),n.push([a,o]))}}return n.sort((e,t)=>e[0]*e[1]-t[0]*t[1])}function ap(e,t){let[n,r,i,a]=e.dims,o=Math.floor(i/t),s=Math.floor(a/t),c=t*t*r,l=e.data,u=new Float32Array(n*o*s*c),d=i*a;for(let e=0;ethis.max_image_tokens*(this.encoder_patch_size*this.downsample_factor)**2*this.max_pixels_tolerance}_get_grid_layout(e,t){let n=ip(this.min_tiles,this.max_tiles),[r,i]=rp(t/e,n,t,e,this.tile_size);return{grid_width:r,grid_height:i,target_width:this.tile_size*r,target_height:this.tile_size*i}}async _call(e,{return_row_col_info:t=null}={}){let n;n=Array.isArray(e)?Array.isArray(e[0])?e:[e]:[[e]];let r=[],i=[],a=[],o=[],s=[],c=[];for(let e of n){let t=await Promise.all(e.map(e=>this.preprocess(e,{do_pad:!1})));for(let{pixel_values:e}of t){let[,t,n]=e.dims,l=e.unsqueeze_(0),u=this.encoder_patch_size*this.downsample_factor,d=u**2,[f,p]=Sf(Math.max(u,t),Math.max(u,n),u,this.min_image_tokens*d,this.max_image_tokens*d).map(e=>Math.max(u,e)),m,h=1,g=1,_=this._is_image_too_large(t,n),v=this.do_image_splitting&&!(this.min_tiles===1&&this.max_tiles===1);if(_&&v){let{grid_width:e,grid_height:r,target_width:i,target_height:a}=this._get_grid_layout(t,n);h=r,g=e;let o=await Cl(l,{size:[a,i]});m=[];for(let t=0;t(e-this.image_mean[t])/this.image_std[t]);return super.pad_image(e,t,{width:s,height:o},{center:!0,constant_values:c,...r})}async _call(e,{num_crops:t=null}={}){if(this._num_crops=t??=this.config.num_crops,t<4||Ap(t)%1!=0)throw Error(`num_crops must be a square number >= 4`);Array.isArray(e)||(e=[e]);let n=e.length,r=await Promise.all(e.map(e=>this.preprocess(e))),i=r.map(e=>e.original_size),a=r.map(e=>e.reshaped_input_size),o=[];for(let{pixel_values:e}of r){e.unsqueeze_(0);let[n,r]=e.dims.slice(-2),i=await Cl(e,{size:[Ep,Ep],mode:`bicubic`});if(t>0){let a=[],s=Ap(t),c=kp(r/s),l=kp(n/s);for(let t=0;te.map(e=>Ep*Op(e/Ep)));return{pixel_values:s,original_sizes:i,reshaped_input_sizes:a,image_sizes:new G(`int64`,c.flat(),[n,2]),num_img_tokens:c.map(([e,t])=>this.calc_num_image_tokens_from_image_size(t,e))}}},Mp=class extends Tf{get_resize_output_image_size(e,t){let{longest_edge:n}=t;if(n===void 0)throw Error(`size must contain 'longest_edge'`);let[r,i]=e.size,a=Math.max(r,i)/n,o=r,s=i;a>1&&(o=Math.floor(r/a),s=Math.floor(i/a));let{patch_size:c,spatial_merge_size:l}=this.config;if(!l)throw Error(`config must contain 'spatial_merge_size'`);let u=c*l,d=Math.floor((o-1)/u)+1,f=Math.floor((s-1)/u)+1;return[d*u,f*u]}},Np=class extends Tf{},Pp=class extends Tf{post_process_object_detection(...e){return _f(...e)}},Fp=class extends Tf{reshape_input_points(e,t,n,r=!1){e=structuredClone(e);let i=vi(e);if(i.length===3)r||(i=[1,...i]),e=[e];else if(i.length!==4)throw Error("The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.");for(let r=0;re!==t.dims[n]))throw Error(`The first ${n.length} dimensions of 'input_points' and 'input_labels' must be the same.`);return new G(`int64`,e.flat(1/0).map(BigInt),n)}async _call(e,{input_points:t=null,input_labels:n=null,input_boxes:r=null}={}){let i=await super._call(e);if(t&&(i.input_points=this.reshape_input_points(t,i.original_sizes,i.reshaped_input_sizes)),n){if(!i.input_points)throw Error("`input_points` must be provided if `input_labels` are provided.");i.input_labels=this.add_input_labels(n,i.input_points)}return r&&(i.input_boxes=this.reshape_input_points(r,i.original_sizes,i.reshaped_input_sizes,!0)),i}async post_process_masks(e,t,n,{mask_threshold:r=0,binarize:i=!0,pad_size:a=null}={}){let o=[];a=a??this.pad_size??this.size;let s=[a.height,a.width];for(let a=0;ar&&(t[n]=1);u=new G(`bool`,t,u.dims)}o.push(u)}return o}generate_crop_boxes(e,t,{crop_n_layers:n=0,overlap_ratio:r=512/1500,points_per_crop:i=32,crop_n_points_downscale_factor:a=1}={}){}},Ip=class extends Tf{post_process_semantic_segmentation(...e){return vf(...e)}},Lp=class extends Ip{},Rp=class extends Tf{post_process_semantic_segmentation(...e){return vf(...e)}},zp=class extends Rp{},Bp=class extends Tf{},Vp=class extends Tf{pad_image(e,t,n,r={}){let[i,a,o]=t;return super.pad_image(e,t,{width:a+(n-a%n)%n,height:i+(n-i%n)%n},{mode:`symmetric`,center:!1,constant_values:-1,...r})}},Hp=class extends Tf{},Up=class extends Hp{},Wp=class extends Tf{async _call(e,t){Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]);let n=await Promise.all(e.map(e=>this.preprocess(e))),r=await Promise.all(t.map(e=>this.preprocess(e,{do_normalize:!1,do_convert_rgb:!1,do_convert_grayscale:!0})));return{pixel_values:Nl(n.map((e,t)=>Ml([e.pixel_values,r[t].pixel_values],0)),0),original_sizes:n.map(e=>e.original_size),reshaped_input_sizes:n.map(e=>e.reshaped_input_size)}}},Gp=class extends Tf{post_process_pose_estimation(e,t,{threshold:n=null}={}){let r=e.tolist(),[i,a,o,s]=e.dims,c=[];for(let e=0;e/gm,bboxes:/([^<]+)?/gm},this.size_per_bin=1e3}construct_prompts(e){typeof e==`string`&&(e=[e]);let t=[];for(let n of e)if(this.task_prompts_without_inputs.has(n))t.push(this.task_prompts_without_inputs.get(n));else{for(let[e,r]of this.task_prompts_with_input)if(n.includes(e)){t.push(r.replaceAll(`{input}`,n).replaceAll(e,``));break}t.length!==e.length&&t.push(n)}return t}post_process_generation(e,t,n){let r=this.tasks_answer_post_processing_type.get(t)??`pure_text`;e=e.replaceAll(``,``).replaceAll(``,``);let i;switch(r){case`pure_text`:i=e;break;case`description_with_bboxes`:case`bboxes`:case`phrase_grounding`:case`ocr`:let a=r===`ocr`?`quad_boxes`:`bboxes`,o=e.matchAll(this.regexes[a]),s=[],c=[];for(let[e,t,...r]of o)s.push(t?t.trim():s.at(-1)??``),c.push(r.map((e,t)=>(Number(e)+.5)/this.size_per_bin*n[t%2]));i={labels:s,[a]:c};break;default:throw Error(`Task "${t}" (of type "${r}") not yet implemented.`)}return{[t]:i}}async _call(e,t=null,n={}){if(!e&&!t)throw Error(`Either text or images must be provided`);let r=await this.image_processor(e,n),i=t?this.tokenizer(this.construct_prompts(t),n):{};return{...r,...i}}},Xp=class extends cd{static tokenizer_class=nd;static image_processor_class=Jp;static uses_processor_config=!0;static uses_chat_template_file=!0;constructor(e,t,n){super(e,t,n),this.image_seq_length=this.config.image_seq_length;let{boi_token:r,image_token:i,eoi_token:a}=this.tokenizer.config;this.boi_token=r,this.image_token=i,this.eoi_token=a;let o=i.repeat(this.image_seq_length);this.full_image_sequence=` + +${r}${o}${a} + +`}async _call(e,t=null,n={}){typeof e==`string`&&(e=[e]);let r;return t&&(r=await this.image_processor(t,n),e=e.map(e=>e.replaceAll(this.boi_token,this.full_image_sequence))),{...this.tokenizer(e,n),...r}}},Zp=class extends cd{static image_processor_class=Jp;static feature_extractor_class=nf;static tokenizer_class=nd;static uses_processor_config=!0;static uses_chat_template_file=!0;constructor(e,t,n){super(e,t,n),this.audio_seq_length=this.config.audio_seq_length,this.image_seq_length=this.config.image_seq_length;let{audio_token_id:r,boa_token:i,audio_token:a,eoa_token:o,image_token_id:s,boi_token:c,image_token:l,eoi_token:u}=this.tokenizer.config;this.audio_token_id=r,this.boa_token=i,this.audio_token=a;let d=a.repeat(this.audio_seq_length);this.full_audio_sequence=` + +${i}${d}${o} + +`,this.image_token_id=s,this.boi_token=c,this.image_token=l;let f=l.repeat(this.image_seq_length);this.full_image_sequence=` + +${c}${f}${u} + +`}async _call(e,t=null,n=null,r={}){typeof e==`string`&&(e=[e]);let i;n&&(i=await this.feature_extractor(n,r),e=e.map(e=>e.replaceAll(this.audio_token,this.full_audio_sequence)));let a;return t&&(a=await this.image_processor(t,r),e=e.map(e=>e.replaceAll(this.image_token,this.full_image_sequence))),{...this.tokenizer(e,r),...a,...i}}},Qp=class extends cd{static uses_processor_config=!0;static uses_chat_template_file=!0;constructor(e,t,n){super(e,t,n),this.audio_ms_per_token=this.config.audio_ms_per_token??40,this.audio_seq_length=this.config.audio_seq_length??750,this.image_seq_length=this.config.image_seq_length??280;let{audio_token:r,boa_token:i,eoa_token:a,image_token:o,boi_token:s,eoi_token:c}=this.tokenizer.config;this.audio_token=r,this.boa_token=i,this.eoa_token=a,this.image_token=o,this.boi_token=s,this.eoi_token=c}static async from_pretrained(e,t={}){let[n,r,i]=await Promise.all([Cc(e,od,!0,t),nd.from_pretrained(e,t),Sc(e,sd,!1,t)]),a={tokenizer:r};return n.image_processor&&(a.image_processor=new Jf(n.image_processor)),n.feature_extractor&&(a.feature_extractor=new Gd(n.feature_extractor)),new this(n,a,i)}_compute_audio_num_tokens(e,t){let n=Math.round(t*20/1e3),r=Math.round(t*10/1e3),i=Math.floor(n/2),a=Math.floor((e+i-n-1)/r)+1;if(a<=0)return 0;for(let e=0;e<2;++e)a=Math.floor((a-1)/2)+1;return Math.min(a,this.audio_seq_length)}async _call(e,t=null,n=null,r={}){typeof e==`string`&&(e=[e]);let i;if(t){i=await this.image_processor(t,r);let n=i.num_soft_tokens_per_image,a=0;e=e.map(e=>e.replaceAll(this.image_token,()=>` + +${this.boi_token}${this.image_token.repeat(n[a++])}${this.eoi_token} + +`))}let a;if(n){let t=Array.isArray(n)?n:[n];a=await this.feature_extractor(t[0],r);let i=this.feature_extractor.config.sampling_rate??16e3,o=0;e=e.map(e=>e.replaceAll(this.audio_token,()=>` + +${this.boa_token}${this.audio_token.repeat(this._compute_audio_num_tokens(t[o++].length,i))}${this.eoa_token} + +`))}return{...this.tokenizer(e,r),...i,...a}}},$p=class extends cd{static image_processor_class=Jp;static tokenizer_class=nd;static image_token=`<|image_pad|>`;async _call(e,t=null,...n){Array.isArray(e)||(e=[e]);let r,i;if(t&&(r=await this.image_processor(t),i=r.image_grid_thw),i){let t=this.image_processor.config.merge_size**2,n=0,r=this.constructor.image_token,a=i.tolist();e=e.map(e=>{for(;e.includes(r);){let i=Number(a[n++].reduce((e,t)=>e*t,1n));e=e.replace(r,`<|placeholder|>`.repeat(Math.floor(i/t)))}return e.replaceAll(`<|placeholder|>`,r)})}return{...this.tokenizer(e),...r}}},em=class extends $p{static image_token=`<|image|>`},tm=class extends cd{static tokenizer_class=nd;static feature_extractor_class=nf;static uses_processor_config=!0;_get_num_audio_features(e){let{hop_length:t}=this.feature_extractor.config.melspec_kwargs,{projector_window_size:n,projector_downsample_rate:r}=this.feature_extractor.config,i=Math.floor(n/r),a=Math.floor(e/t)+1,o=Math.floor(a/2);return Math.ceil(o/n)*i}async _call(e,t=null,n={}){if(Array.isArray(e))throw Error(`Batched inputs are not supported yet.`);let r={};if(t){let{input_features:n}=await this.feature_extractor(t);r.input_features=n;let i=this._get_num_audio_features(t.length);r.input_features_mask=new G(`bool`,new Uint8Array(i).fill(1),[1,i]);let a=this.config.audio_token??`<|audio|>`;if(!e.includes(a))throw Error(`The input text does not contain the audio token ${a}.`);e=e.replaceAll(a,a.repeat(i))}return{...this.tokenizer(e,{add_special_tokens:!1,...n}),...r}}};function nm(e,t){let n=e.dims.at(-1)-1,r=e.tolist();r.fill(!1,0,1),r.fill(!1,n);let i=t.tolist();return r.map((e,t)=>e?t:null).filter(e=>e!==null).map(e=>i[e])}var rm=class extends cd{static tokenizer_class=nd;static image_processor_class=Jp;async _call(e,t,n={}){let r=e?await this.image_processor(e,n):{};return{...t?this.tokenizer(t,n):{},...r}}post_process_grounded_object_detection(e,t,{box_threshold:n=.25,text_threshold:r=.25,target_sizes:i=null}={}){let{logits:a,pred_boxes:o}=e,s=a.dims[0];if(i!==null&&i.length!==s)throw Error(`Make sure that you pass in as many target sizes as the batch dimension of the logits`);let c=a.dims.at(1),l=a.sigmoid(),u=l.max(-1).tolist(),d=o.tolist().map(e=>e.map(e=>gf(e))),f=[];for(let e=0;ee.map((e,t)=>e*a[(t+1)%2])));let o=u[e],s=[],p=[],m=[];for(let i=0;i`+i.repeat(e);o+=` +`}return o+=` +${r}${a}`+i.repeat(e)+`${r}`,o}function am(e,t,n,r){return`${t}${r}`+n.repeat(e)+`${t}`}function om(e,t,n,r,i,a){return e===0&&t===0?am(n,r,i,a):im(n,e,t,r,i,a)}var sm=class extends cd{static image_processor_class=Jp;static tokenizer_class=nd;static uses_processor_config=!0;fake_image_token=``;image_token=``;global_img_token=``;async _call(e,t=null,n={}){n.return_row_col_info??=!0;let r;t&&(r=await this.image_processor(t,n)),Array.isArray(e)||(e=[e]);let i=r.rows??[Array(e.length).fill(0)],a=r.cols??[Array(e.length).fill(0)],o=this.config.image_seq_len,s=[],c=[];for(let t=0;tom(e,l[t],o,this.fake_image_token,this.image_token,this.global_img_token)),d=n.split(this.image_token);if(d.length===0)throw Error(`The image token should be present in the text.`);let f=d[0];for(let e=0;ee.images).flatMap(e=>e.images).map(e=>pf.read(e)));let r=this.tokenizer,i=r.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0,chat_template:n}),a=e=>r.encode(e,{add_special_tokens:!1}),o=i.split(this.image_tag),s=o.length-1;if(t.length!==s)throw Error(`Number of images provided (${t.length}) does not match number of "${this.image_tag}" image tags (${s})`);let[c,l,u]=r.convert_tokens_to_ids([this.image_tag,this.image_start_tag,this.image_end_tag]),d=a(o[0]),f=Array(d.length).fill(!1);for(let e=1;e0){let e=await this.image_processor(t);return e.pixel_values.unsqueeze_(0),{...m,...e}}return m}},lm=class extends cd{static tokenizer_class=nd;static image_processor_class=Jp;async _call(e=null,t=null,n={}){if(!e&&!t)throw Error(`Either text or images must be provided`);let r=e?this.tokenizer(e,n):{},i=t?await this.image_processor(t,n):{};return{...r,...i}}},um=class extends cd{static tokenizer_class=nd;static image_processor_class=Jp;async _call(e,t=null,n={}){let{image_rows:r,image_cols:i,image_sizes:a,...o}=await this.image_processor(e,{...n,return_row_col_info:!0});if(t){let e=this.config.image_token??``,{tile_size:n=512,downsample_factor:o=2,encoder_patch_size:s=16,use_thumbnail:c=!0}=this.image_processor.config,l=e=>Math.ceil(Math.floor(e/s)/o),u=l(n)**2,d=this.config.image_start_token??`<|image_start|>`,f=this.config.image_end_token??`<|image_end|>`,p=this.config.image_thumbnail??`<|img_thumbnail|>`;Array.isArray(t)||(t=[t]);let m=0;t=t.map(t=>{let n=t.split(e);return n[0]+n.slice(1).map(t=>{let n=m++,[o,s]=a[n],h=r[n],g=i[n],_=l(o)*l(s),v=d;if(h>1||g>1){let t=e.repeat(u);for(let e=0;e`+t;c&&(v+=p+e.repeat(_))}else v+=e.repeat(_);return v+f+t}).join(``)})}return{...o,...t?this.tokenizer(t,n):{}}}},dm=class extends cd{static tokenizer_class=nd;static image_processor_class=Jp;static uses_processor_config=!0;async _call(e,t=null,n={}){let r=await this.image_processor(e,n);if(t){let[e,n]=r.pixel_values.dims.slice(-2),{image_token:i,patch_size:a,num_additional_image_tokens:o}=this.config,s=Math.floor(e/a)*Math.floor(n/a)+o;t=structuredClone(t),Array.isArray(t)||(t=[t]);for(let e=0;e0?i.reduce((e,t)=>e*t,1):0;c.push(n),s.push(a)}return[i(c),s]}char_decode(e){return this.char_tokenizer.batch_decode(e).map(e=>e.replaceAll(` `,``))}bpe_decode(e){return this.bpe_tokenizer.batch_decode(e)}wp_decode(e){return this.wp_tokenizer.batch_decode(e).map(e=>e.replaceAll(` `,``))}batch_decode([e,t,n]){let[r,i]=this._decode_helper(e,`char`),[a,o]=this._decode_helper(t,`bpe`),[s,c]=this._decode_helper(n,`wp`),l=[],u=[];for(let e=0;e`;function _m(e,t,n,r,i){return`${r.repeat(n*i)}${t}${e} +`}var vm=class extends cd{static tokenizer_class=nd;static image_processor_class=Jp;static uses_processor_config=!1;async _call(e,t=null,n={}){t||=(wi.warn(`You are using PaliGemma without a text prefix. It will perform as a picture-captioning model.`),``),Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]);let r=this.tokenizer.bos_token,i=this.image_processor.config.image_seq_length,a;t.some(e=>e.includes(gm))?a=t.map(e=>{let t=e.replaceAll(gm,gm.repeat(i)),n=t.lastIndexOf(gm),a=n===-1?0:n+gm.length;return t.slice(0,a)+r+t.slice(a)+` +`}):(wi.warn("You are passing both `text` and `images` to `PaliGemmaProcessor`. The processor expects special image tokens in the text, as many tokens as there are images per each text. It is recommended to add `` tokens in the very beginning of your text. For this call, we will infer how many images each text has and add special tokens."),a=t.map(t=>_m(t,r,i,gm,e.length)));let o=this.tokenizer(a,n);return{...await this.image_processor(e,n),...o}}},ym=`<|image|>`,bm=/<\|image_\d+\|>/g,xm=class extends cd{static image_processor_class=Jp;static tokenizer_class=nd;async _call(e,t=null,{padding:n=!0,truncation:r=!0,num_crops:i=null}={}){Array.isArray(e)||(e=[e]);let a,o;if(t){o=await this.image_processor(t,{num_crops:i});let{num_img_tokens:s}=o,c=e.map((e,t)=>e.split(bm).join(ym.repeat(s[t])));a=this.tokenizer(c,{padding:n,truncation:r});let l=this.tokenizer._tokenizer.token_to_id(ym);a.input_ids.map_(e=>e==l?-e:e)}else a=this.tokenizer(e);return{...a,...o}}},Sm=class extends cd{static tokenizer_class=nd;static image_processor_class=Jp;static uses_processor_config=!0;async _call(e,t=null,n={}){let r=await this.image_processor(e,n);if(t){let[e,n]=r.pixel_values.dims.slice(-2),{image_token:i,image_break_token:a,image_end_token:o,patch_size:s,spatial_merge_size:c}=this.config,l=s*c,u=Math.floor(e/l),d=Math.floor(n/l);t=structuredClone(t),Array.isArray(t)||(t=[t]);for(let e=0;ePm(e,o)),c=s.map(e=>e.length),l=s.flat(),u=(await Promise.all(l.map(e=>this.feature_extractor(e,n)))).map(e=>e.input_features);r.audio_values=u.length>1?Ml(u,0):u[0];let d=i[0];for(let e=0;e0){if(l>Js)throw Error(`The number of external data chunks (${l}) exceeds the maximum allowed value (${Js}).`);let t=$m(o,l);for(let n of t){let t=`${r.subfolder??``}/${n}`;c.push(new Promise(async(i,a)=>{let o=await xc(e,t,!0,r,s);i(o instanceof Uint8Array?{path:n,data:o}:n)}))}}else a.externalData!==void 0&&(c=a.externalData.map(async t=>{if(typeof t.data==`string`){let n=await xc(e,t.data,!0,r);return{...t,data:n}}return t}));return Promise.all(c)}async function nh(e,t,n,r=!1,i=void 0){let a=n.config?.[`transformers.js_config`]??{},o=fl(n.device??a.device,t,{warn:e=>wi.info(e)}),s=Qc(o),c=a.device_config??{};c.hasOwnProperty(o)&&(a={...a,...c[o]});let l=vl(n.dtype??a.dtype,t,o,{configDtype:a.dtype,warn:e=>wi.info(e)});if(!_l.hasOwnProperty(l))throw Error(`Invalid dtype: ${l}. Should be one of: ${Object.keys(ml).join(`, `)}`);if(o===`webgpu`&&!ni.IS_NODE_ENV&&l===ml.fp16&&!await pl())throw Error(`The device (${o}) does not support fp16.`);let u=_l[l],d={...n.session_options};d.executionProviders??=s;let f=a.free_dimension_overrides;f?d.freeDimensionOverrides??=f:o.startsWith(`webnn`)&&!d.freeDimensionOverrides&&wi.warn(`WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config["transformers.js_config"]["device_config"]["${o}"]. When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`);let p=eh(e,t,n,u),m=await th(e,t,u,n,n.use_external_data_format??a.use_external_data_format,d);if(m.length>0&&(!ni.IS_NODE_ENV||m.some(e=>typeof e!=`string`))&&(d.externalData=m),r&&o===`webgpu`){let e=Jm(n.config,{prefix:`present`,session_name:i});if(e.size>0&&!sl()){let t={};for(let n of e)t[n]=`gpu-buffer`;d.preferredOutputLocation=t}}return{buffer_or_path:await p,session_options:d,session_config:{dtype:l,device:o}}}async function rh(e,t,n,r=void 0){return Object.fromEntries(await Promise.all(Object.keys(t).map(async i=>{let a=r?.[i]??!1,{buffer_or_path:o,session_options:s,session_config:c}=await nh(e,t[i],n,a,i);return[i,await nl(o,s,c)]})))}function ih(e){for(let t in e)al(e[t])?e[t]=new G(e[t]):typeof e[t]==`object`&&ih(e[t]);return e}async function ah(e,t){let n=oh(e,t);try{return ih(await il(e,Object.fromEntries(Object.entries(n).map(([e,t])=>{let n=t.ort_tensor;return ni.IS_NODE_ENV&&typeof Float16Array<`u`&&n.cpuData instanceof Float16Array&&(n.cpuData=new Uint16Array(n.cpuData.buffer)),[e,n]}))))}catch(e){let t=Object.fromEntries(Object.entries(n).map(([e,t])=>{let n={type:t.type,dims:t.dims,location:t.location};return n.location!==`gpu-buffer`&&(n.data=t.data),[e,n]}));throw wi.error(`An error occurred during model execution: "${e}".`),wi.error(`Inputs given to model:`,t),e}}function oh(e,t){let n=Object.create(null),r=[];for(let i of e.inputNames){let e=t[i];if(!(e instanceof G)){r.push(i);continue}n[i]=sl()?e.clone():e}if(r.length>0)throw Error(`An error occurred during model execution: "Missing the following inputs: ${r.join(`, `)}.`);let i=Object.keys(t).length,a=e.inputNames.length;if(i>a){let n=Object.keys(t).filter(t=>!e.inputNames.includes(t));wi.warn(`WARNING: Too many inputs were provided (${i} > ${a}). The following inputs will be ignored: "${n.join(`, `)}".`)}return n}var sh=class{},ch=class extends sh{constructor({logits:e,...t}){super(),this.logits=e;let n=Object.values(t);n.length>0&&(this.attentions=n)}},lh=class extends sh{constructor({logits:e}){super(),this.logits=e}},uh=class extends sh{constructor({logits:e}){super(),this.logits=e}},dh=class extends sh{constructor({start_logits:e,end_logits:t}){super(),this.start_logits=e,this.end_logits=t}},fh=class extends sh{constructor({logits:e}){super(),this.logits=e}},ph=class extends sh{constructor({alphas:e}){super(),this.alphas=e}},mh=class extends pi{_call(e,t){throw Error("`_call` should be implemented in a subclass")}},hh=class extends pi{_call(e,t){throw Error("`_call` should be implemented in a subclass")}},gh=class extends pi{constructor(){super(),this.processors=[]}push(e){this.processors.push(e)}extend(e){this.processors.push(...e)}_call(e,t){let n=t;for(let t of this.processors)n=t(e,n);return n}[Symbol.iterator](){return this.processors.values()}},_h=class extends mh{constructor(e){super(),this.bos_token_id=e}_call(e,t){for(let n=0;n=1&&i[i.length-1]>=this.timestamp_begin,o=i.length<2||i[i.length-2]>=this.timestamp_begin;if(a&&(o?r.subarray(this.timestamp_begin).fill(-1/0):r.subarray(0,this.eos_token_id).fill(-1/0)),e[n].length===this.begin_index&&this.max_initial_timestamp_index!==null){let e=this.timestamp_begin+this.max_initial_timestamp_index;r.subarray(e+1).fill(-1/0)}let s=Dc(r);Math.log(s.subarray(this.timestamp_begin).map(Math.exp).reduce((e,t)=>e+t))>kc(s.subarray(0,this.timestamp_begin))[0]&&r.subarray(0,this.timestamp_begin).fill(-1/0)}return t}},Sh=class extends mh{constructor(e){super(),this.no_repeat_ngram_size=e}getNgrams(e){let t=e.length,n=[];for(let r=0;r1 to use the classifier free guidance processor, got guidance scale ${e}.`);this.guidance_scale=e}_call(e,t){if(t.dims[0]!==2*e.length)throw Error(`Logits should have twice the batch size of the input ids, the first half of batches corresponding to the conditional inputs, and the second half of batches corresponding to the unconditional inputs. Got batch size ${t.dims[0]} for the logits and ${e.length} for the input ids.`);let n=e.length,r=t.slice([0,n],null),i=t.slice([n,t.dims[0]],null);for(let e=0;ee.length>=this.max_length)}},Nh=class extends Ah{constructor(e){super(),Array.isArray(e)||(e=[e]),this.eos_token_id=e}_call(e,t){return e.map(e=>{let t=e.at(-1);return this.eos_token_id.some(e=>t==e)})}},Ph=class extends pi{constructor(e){super(),this.generation_config=e}async _call(e){return this.sample(e)}async sample(e){throw Error(`sample should be implemented in subclasses.`)}getLogits(e,t){let n=e.dims.at(-1),r=e.data;if(t===-1)r=r.slice(-n);else{let e=t*n;r=r.slice(e,e+n)}return r}randomSelect(e){return Ws(e)}static getSampler(e){if(e.do_sample)return new Ih(e);if(e.num_beams>1)return new Lh(e);if(e.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${e.num_return_sequences}.`);return new Fh(e)}},Fh=class extends Ph{async sample(e){let t=kc(e.data)[1];return[[BigInt(t),0]]}},Ih=class extends Ph{async sample(e){let t=e.dims.at(-1);this.generation_config.top_k>0&&(t=Math.min(this.generation_config.top_k,t));let[n,r]=await Tl(e,t),i=Ec(n.data);return Array.from({length:this.generation_config.num_beams},()=>{let e=this.randomSelect(i);return[r.data[e],Math.log(i[e])]})}},Lh=class extends Ph{async sample(e){let t=e.dims.at(-1);this.generation_config.top_k>0&&(t=Math.min(this.generation_config.top_k,t));let[n,r]=await Tl(e,t),i=Ec(n.data);return Array.from({length:this.generation_config.num_beams},(e,t)=>[r.data[t],Math.log(i[t])])}},Rh=class{constructor(e){if(e)for(let t in e){if(t in this)throw TypeError(`Key "${t}" conflicts with an existing property on DynamicCache`);let n=e[t];if(!(n instanceof G))throw TypeError(`Expected a Tensor for key "${t}", got ${typeof n}`);this[t]=n}}get_seq_length(){let e=this;if(Object.keys(e).length===0)return 0;for(let t in e)if(t.startsWith(`past_key_values.`))return e[t].dims.at(-2);throw Error(`Unable to determine sequence length from the cache.`)}update(e){for(let t in e){let n=this[t],r=e[t];n&&n!==r&&n.location===`gpu-buffer`&&n.dispose(),this[t]=r}}async dispose(){let e=[];for(let t of Object.values(this))t.location===`gpu-buffer`&&e.push(t.dispose());await Promise.all(e)}},K={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,DecoderOnlyWithoutHead:5,MaskGeneration:6,ImageTextToText:7,Musicgen:8,MultiModality:9,Phi3V:10,AudioTextToText:11,AutoEncoder:12,ImageAudioTextToText:13,Supertonic:14,Chatterbox:15,VoxtralRealtime:16},zh={[K.DecoderOnly]:{sessions:(e,t)=>({model:t.model_file_name??`model`}),cache_sessions:{model:!0},optional_configs:{generation_config:`generation_config.json`}},[K.DecoderOnlyWithoutHead]:{sessions:(e,t)=>({model:t.model_file_name??`model`})},[K.Seq2Seq]:{sessions:()=>({model:`encoder_model`,decoder_model_merged:`decoder_model_merged`}),cache_sessions:{decoder_model_merged:!0},optional_configs:{generation_config:`generation_config.json`}},[K.Vision2Seq]:{sessions:()=>({model:`encoder_model`,decoder_model_merged:`decoder_model_merged`}),cache_sessions:{decoder_model_merged:!0},optional_configs:{generation_config:`generation_config.json`}},[K.Musicgen]:{sessions:()=>({model:`text_encoder`,decoder_model_merged:`decoder_model_merged`,encodec_decode:`encodec_decode`}),cache_sessions:{decoder_model_merged:!0},optional_configs:{generation_config:`generation_config.json`}},[K.EncoderDecoder]:{sessions:()=>({model:`encoder_model`,decoder_model_merged:`decoder_model_merged`}),cache_sessions:{decoder_model_merged:!0}},[K.MaskGeneration]:{sessions:()=>({model:`vision_encoder`,prompt_encoder_mask_decoder:`prompt_encoder_mask_decoder`})},[K.ImageTextToText]:{text_only_sessions:{embed_tokens:`embed_tokens`,decoder_model_merged:`decoder_model_merged`},sessions:(e,t,n)=>{let r={...zh[K.ImageTextToText].text_only_sessions};return n||(r.vision_encoder=`vision_encoder`),e.is_encoder_decoder&&(r.model=`encoder_model`),r},cache_sessions:{decoder_model_merged:!0},optional_configs:{generation_config:`generation_config.json`}},[K.AudioTextToText]:{text_only_sessions:{embed_tokens:`embed_tokens`,decoder_model_merged:`decoder_model_merged`},sessions:(e,t,n)=>{let r={...zh[K.AudioTextToText].text_only_sessions};return n||(r.audio_encoder=`audio_encoder`),r},cache_sessions:{decoder_model_merged:!0},optional_configs:{generation_config:`generation_config.json`}},[K.ImageAudioTextToText]:{text_only_sessions:{embed_tokens:`embed_tokens`,decoder_model_merged:`decoder_model_merged`},sessions:(e,t,n)=>{let r={...zh[K.ImageAudioTextToText].text_only_sessions};return n||(r.audio_encoder=`audio_encoder`,r.vision_encoder=`vision_encoder`),r},optional_configs:{generation_config:`generation_config.json`}},[K.Phi3V]:{sessions:()=>({prepare_inputs_embeds:`prepare_inputs_embeds`,model:`model`,vision_encoder:`vision_encoder`}),cache_sessions:{model:!0},optional_configs:{generation_config:`generation_config.json`}},[K.MultiModality]:{sessions:()=>({prepare_inputs_embeds:`prepare_inputs_embeds`,model:`language_model`,lm_head:`lm_head`,gen_head:`gen_head`,gen_img_embeds:`gen_img_embeds`,image_decode:`image_decode`}),cache_sessions:{model:!0},optional_configs:{generation_config:`generation_config.json`}},[K.AutoEncoder]:{sessions:()=>({encoder_model:`encoder_model`,decoder_model:`decoder_model`})},[K.Supertonic]:{sessions:()=>({text_encoder:`text_encoder`,latent_denoiser:`latent_denoiser`,voice_decoder:`voice_decoder`})},[K.Chatterbox]:{sessions:()=>({embed_tokens:`embed_tokens`,speech_encoder:`speech_encoder`,model:`language_model`,conditional_decoder:`conditional_decoder`}),cache_sessions:{model:!0},optional_configs:{generation_config:`generation_config.json`}},[K.VoxtralRealtime]:{text_only_sessions:{embed_tokens:`embed_tokens`,decoder_model_merged:`decoder_model_merged`},sessions:(e,t,n)=>{let r={...zh[K.VoxtralRealtime].text_only_sessions};return n||(r.audio_encoder=`audio_encoder`),r},cache_sessions:{decoder_model_merged:!0,audio_encoder:!0},optional_configs:{generation_config:`generation_config.json`}},default:{sessions:(e,t)=>({model:t.model_file_name??`model`})}};function Bh(e){return zh[e]?.text_only_sessions??null}function Vh(e,t,n={}){let r=zh[e]??zh.default;return{sessions:r.sessions(t,n,n.textOnly??!1),cache_sessions:r.cache_sessions,optional_configs:r.optional_configs}}function Hh(e,{warn:t=!0}={}){let n=e.architectures||[];for(let e of n){let t=Zh.get(e);if(t!==void 0)return t}if(e.model_type){let t=Zh.get(e.model_type);if(t!==void 0)return t;for(let t of Object.values(Gh))if(t.has(e.model_type)){let n=Zh.get(t.get(e.model_type));if(n!==void 0)return n}}if(t){let t=n.length>0?n.join(`, `):`(none)`;wi.warn(`[resolve_model_type] Architecture(s) not found in MODEL_TYPE_MAPPING: [${t}] for model type '${e.model_type}'. Falling back to EncoderOnly (single model.onnx file). If you encounter issues, please report at: ${rd}`)}return K.EncoderOnly}function Uh(e,{config:t=null,cache_dir:n=null,local_files_only:r=!1,revision:i=`main`}={}){return t===null?uc(JSON.stringify([e,n,r,i]),()=>Zm.from_pretrained(e,{config:t,cache_dir:n,local_files_only:r,revision:i})):Zm.from_pretrained(e,{config:t,cache_dir:n,local_files_only:r,revision:i})}async function Wh(e,{config:t=null,dtype:n=null,device:r=null,model_file_name:i=null}={}){t=await Uh(e,{config:t});let a=[`config.json`],o=t[`transformers.js_config`]??{},s=o.use_external_data_format,c=`onnx`,l=r??o.device,u=n??o.dtype,d=Hh(t),f=(e,t=null)=>{t??=e;let n=_l[vl(u,e,fl(l,e))]??``,r=`${t}${n}.onnx`,i=`${c}/${r}`;a.push(i);let o=Qm(s,r,e);for(let e of $m(r,o)){let t=`${c}/${e}`;a.push(t)}},{sessions:p,optional_configs:m}=Vh(d,t,{model_file_name:i});for(let[e,t]of Object.entries(p))f(e,t);if(m)for(let e of Object.values(m))a.push(e);return a}var Gh=null;function Kh(e){Gh=e}function qh(e){if(e instanceof G)return e;if(e.length===0)throw Error(`items must be non-empty`);if(Array.isArray(e[0])){if(e.some(t=>t.length!==e[0].length))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.`);return new G(`int64`,BigInt64Array.from(e.flat().map(e=>BigInt(e))),[e.length,e[0].length])}else return new G(`int64`,BigInt64Array.from(e.map(e=>BigInt(e))),[1,e.length])}function Jh(e){return new G(`bool`,[e],[1])}var Yh={[K.DecoderOnly]:{can_generate:!0,forward:sg,prepare_inputs:pg},[K.DecoderOnlyWithoutHead]:{can_generate:!1,forward:sg,prepare_inputs:pg},[K.Seq2Seq]:{can_generate:!0,forward:eg,prepare_inputs:mg},[K.Vision2Seq]:{can_generate:!0,forward:eg,prepare_inputs:mg},[K.Musicgen]:{can_generate:!0,forward:eg},[K.EncoderDecoder]:{can_generate:!1,forward:eg},[K.ImageTextToText]:{can_generate:!0,forward:ug,prepare_inputs:hg},[K.AudioTextToText]:{can_generate:!0,forward:lg,prepare_inputs:hg},[K.ImageAudioTextToText]:{can_generate:!0,prepare_inputs:hg},[K.Phi3V]:{can_generate:!0,prepare_inputs:hg},[K.MultiModality]:{can_generate:!0},[K.AutoEncoder]:{can_generate:!1,forward:ng},[K.Chatterbox]:{can_generate:!0,forward:tg},[K.VoxtralRealtime]:{can_generate:!0,prepare_inputs:pg},default:{can_generate:!1,forward:tg}};function Xh(e,t){let n=Zh.get(e),r=!1,i=t?.architectures?.[0];if(i&&i!==e&&e?.endsWith(`ForCausalLM`)&&i.endsWith(`ForConditionalGeneration`)){let e=Zh.get(i);e!==void 0&&(n=e,r=!0)}let a=Yh[n]??Yh.default,o=zh[n]??zh.default;return{typeConfig:{...a,...o},textOnly:r,modelType:n}}var Zh=new Map,Qh=new Map,$h=new Map,q=class extends pi{main_input_name=`input_ids`;forward_params=[`input_ids`,`attention_mask`];_return_dict_in_generate_keys=null;constructor(e,t,n){super(),this.config=e,this.sessions=t,this.configs=n;let{typeConfig:r}=Xh($h.get(this.constructor),e);this.can_generate=r.can_generate,this._forward=r.forward,this._prepare_inputs_for_generation=r.prepare_inputs,this.can_generate&&this.forward_params.push(`past_key_values`),this.custom_config=this.config[`transformers.js_config`]??{}}async dispose(){let e=[];for(let t of Object.values(this.sessions))e.push(t.release?.());return await Promise.all(e)}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,model_file_name:o=null,subfolder:s=`onnx`,device:c=null,dtype:l=null,use_external_data_format:u=null,session_options:d={}}={}){let f={progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,model_file_name:o,subfolder:s,device:c,dtype:l,use_external_data_format:u,session_options:d},p=$h.get(this);n=f.config=await Zm.from_pretrained(e,f);let{typeConfig:m,textOnly:h,modelType:g}=Xh(p,n);if(g===void 0){let e=p??n?.model_type;e!==`custom`&&wi.warn(`Model type for '${e}' not found, assuming encoder-only architecture. Please report this at ${rd}.`)}if(t&&!(t instanceof hi)){let r={};try{let t=await Wh(e,{config:n,dtype:l,device:c,model_file_name:o});(await Promise.all(t.map(t=>fc(e,t,f)))).forEach((e,n)=>{if(e.exists){let i=t[n]===`config.json`;r[t[n]]={loaded:i?e.size??0:0,total:e.size??0}}})}catch(e){wi.warn(`Unable to fetch model file metadata for total progress tracking: ${e}`)}Object.keys(r).length>0&&(f.progress_callback=new hi(t,r))}let _=[rh(e,m.sessions(n,f,h),f,m.cache_sessions)];m.optional_configs&&_.push(yg(e,m.optional_configs,f));let v=await Promise.all(_);return new this(n,...v)}async _call(e){return await this.forward(e)}async forward(e){return await this._forward(this,e)}get generation_config(){return this.configs?.generation_config??null}_get_logits_processor(e,t,n=null){let r=new gh;if(e.repetition_penalty!==null&&e.repetition_penalty!==1&&r.push(new Ch(e.repetition_penalty)),e.no_repeat_ngram_size!==null&&e.no_repeat_ngram_size>0&&r.push(new Sh(e.no_repeat_ngram_size)),e.bad_words_ids!==null&&r.push(new Eh(e.bad_words_ids,e.eos_token_id)),e.min_length!==null&&e.eos_token_id!==null&&e.min_length>0&&r.push(new wh(e.min_length,e.eos_token_id)),e.min_new_tokens!==null&&e.eos_token_id!==null&&e.min_new_tokens>0&&r.push(new Th(t,e.min_new_tokens,e.eos_token_id)),e.forced_bos_token_id!==null&&r.push(new _h(e.forced_bos_token_id)),e.forced_eos_token_id!==null&&r.push(new vh(e.max_length,e.forced_eos_token_id)),e.suppress_tokens!==null&&r.push(new yh(e.suppress_tokens)),e.begin_suppress_tokens!==null){let n=t>1||e.forced_bos_token_id===null?t:t+1;r.push(new bh(e.begin_suppress_tokens,n))}return e.guidance_scale!==null&&e.guidance_scale>1&&r.push(new Dh(e.guidance_scale)),e.temperature===0&&e.do_sample&&(wi.warn("`do_sample` changed to false because `temperature: 0` implies greedy sampling (always selecting the most likely token), which is incompatible with `do_sample: true`."),e.do_sample=!1),e.do_sample&&e.temperature!==null&&e.temperature!==1&&r.push(new Oh(e.temperature)),n!==null&&r.extend(n),r}_prepare_generation_config(e,t,n=kh){let r={...this.config};for(let e of[`decoder`,`generator`,`text_config`])e in r&&Object.assign(r,r[e]);let i=new n(r);return Object.assign(i,this.generation_config??{}),e&&Object.assign(i,e),t&&Object.assign(i,Si(t,Object.getOwnPropertyNames(i))),i}_get_stopping_criteria(e,t=null){let n=new jh;return e.max_length!==null&&n.push(new Mh(e.max_length,this.config.max_position_embeddings??null)),e.eos_token_id!==null&&n.push(new Nh(e.eos_token_id)),t&&n.extend(t),n}_validate_model_class(){if(!this.can_generate){let e=[Gh.MODEL_FOR_CAUSAL_LM_MAPPING_NAMES,Gh.MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES,Gh.MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES,Gh.MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES].filter(Boolean),t=$h.get(this.constructor),n=new Set,r=this.config.model_type;for(let t of e){let e=t?.get(r);e&&n.add(e)}let i=`The current model class (${t}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;throw n.size>0&&(i+=` Please use the following class instead: ${[...n].join(`, `)}`),Error(i)}}prepare_inputs_for_generation(...e){if(!this._prepare_inputs_for_generation)throw Error(`prepare_inputs_for_generation is not implemented for this model.`);return this._prepare_inputs_for_generation(this,...e)}_update_model_kwargs_for_generation({generated_input_ids:e,outputs:t,model_inputs:n,is_encoder_decoder:r}){return n.past_key_values=rg(t,n.past_key_values),n.input_ids=new G(`int64`,e.flat(),[e.length,1]),r?`decoder_attention_mask`in n&&(n.decoder_attention_mask=Ml([n.decoder_attention_mask,Vl([n.decoder_attention_mask.dims[0],1])],1)):n.attention_mask=Ml([n.attention_mask,Vl([n.attention_mask.dims[0],1])],1),n.position_ids=null,n}_prepare_model_inputs({inputs:e,bos_token_id:t,model_kwargs:n}){let r=Si(n,this.forward_params),i=this.main_input_name;if(i in r){if(e)throw Error("`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. Make sure to either pass {inputs} or {input_name}=...")}else r[i]=e;return{inputs_tensor:r[i],model_inputs:r,model_input_name:i}}async _prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:e,model_inputs:t,model_input_name:n,generation_config:r}){if(this.sessions.model.inputNames.includes(`inputs_embeds`)&&!t.inputs_embeds&&`_prepare_inputs_embeds`in this){let{input_ids:e,pixel_values:n,attention_mask:r,...i}=t,a=await this._prepare_inputs_embeds(t);t={...i,...Si(a,[`inputs_embeds`,`attention_mask`])}}let{last_hidden_state:i}=await tg(this,t);if(r.guidance_scale!==null&&r.guidance_scale>1)i=Ml([i,Bl(i,0)],0),`attention_mask`in t&&(t.attention_mask=Ml([t.attention_mask,Wl(t.attention_mask)],0));else if(t.decoder_input_ids){let e=qh(t.decoder_input_ids).dims[0];if(e!==i.dims[0]){if(i.dims[0]!==1)throw Error(`The encoder outputs have a different batch size (${i.dims[0]}) than the decoder inputs (${e}).`);i=Ml(Array.from({length:e},()=>i),0)}}return t.encoder_outputs=i,t}_prepare_decoder_input_ids_for_generation({batch_size:e,model_input_name:t,model_kwargs:n,decoder_start_token_id:r,bos_token_id:i,generation_config:a}){let{decoder_input_ids:o,...s}=n;if(!(o instanceof G)){if(o)Array.isArray(o[0])||(o=Array.from({length:e},()=>o));else if(r??=i,this.config.model_type===`musicgen`)o=Array.from({length:e*this.config.decoder.num_codebooks},()=>[r]);else if(Array.isArray(r)){if(r.length!==e)throw Error(`\`decoder_start_token_id\` expcted to have length ${e} but got ${r.length}`);o=r}else o=Array.from({length:e},()=>[r]);o=qh(o)}return s.decoder_attention_mask=Hl(o),{input_ids:o,model_inputs:s}}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,streamer:i=null,...a}){this._validate_model_class(),t=this._prepare_generation_config(t,a);let{inputs_tensor:o,model_inputs:s,model_input_name:c}=this._prepare_model_inputs({inputs:e,model_kwargs:a}),l=this.config.is_encoder_decoder;l&&(`encoder_outputs`in s||(s=await this._prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:o,model_inputs:s,model_input_name:c,generation_config:t})));let u;l?{input_ids:u,model_inputs:s}=this._prepare_decoder_input_ids_for_generation({batch_size:s[c].dims.at(0),model_input_name:c,model_kwargs:s,decoder_start_token_id:t.decoder_start_token_id,bos_token_id:t.bos_token_id,generation_config:t}):u=s[c];let d=u.dims.at(-1);t.max_new_tokens!==null&&(t.max_length=d+t.max_new_tokens);let f=this._get_logits_processor(t,d,n),p=this._get_stopping_criteria(t,r),m=s[c].dims.at(0),h=Ph.getSampler(t),g=Array(m).fill(0),_=u.tolist();i&&i.put(_);let v,y={},b={};for(;;){if(s=this.prepare_inputs_for_generation(_,s,t),v=await this.forward(s),t.return_dict_in_generate)if(t.output_attentions){let e=ig(v);for(let t in e)t in y||(y[t]=[]),y[t].push(e[t])}else this._return_dict_in_generate_keys&&Object.assign(b,Si(v,this._return_dict_in_generate_keys));let e=f(_,v.logits.slice(null,-1,null).to(`float32`)),n=[];for(let t=0;te))break;s=this._update_model_kwargs_for_generation({generated_input_ids:n,outputs:v,model_inputs:s,is_encoder_decoder:l})}i&&i.end();let x=new G(`int64`,_.flat(),[_.length,_[0].length]),S=rg(v,s.past_key_values),C=new Set(Object.values(S));for(let e of Object.values(v))e.location===`gpu-buffer`&&!C.has(e)&&e.dispose();return`past_key_values`in a||t.return_dict_in_generate||await S.dispose(),t.return_dict_in_generate?{sequences:x,past_key_values:S,...y,...b}:x}async _encode_input(e,t,n){if(!Object.hasOwn(this.sessions,e))throw Error(`Model does not have a ${e} session.`);let r=this.sessions[e];return(await ah(r,Si(t,r.inputNames)))[n]}async encode_image(e){return this._encode_input(`vision_encoder`,e,`image_features`)}async encode_text(e){return this._encode_input(`embed_tokens`,e,`inputs_embeds`)}async encode_audio(e){return this._encode_input(`audio_encoder`,e,`audio_features`)}};async function eg(e,t){let{encoder_outputs:n,input_ids:r,decoder_input_ids:i,decoder_attention_mask:a,...o}=t;return n||=(await tg(e,Si(t,e.sessions.model.inputNames))).last_hidden_state,o.input_ids=i,o.encoder_hidden_states=n,e.sessions.decoder_model_merged.inputNames.includes(`encoder_attention_mask`)&&(o.encoder_attention_mask=t.attention_mask),a&&!o.attention_mask&&(o.attention_mask=a),await sg(e,o,!0)}async function tg(e,t){let n=e.sessions.model,r=Si(t,n.inputNames);if(n.inputNames.includes(`inputs_embeds`)&&!r.inputs_embeds){if(!t.input_ids)throw Error("Both `input_ids` and `inputs_embeds` are missing in the model inputs.");r.inputs_embeds=await e.encode_text({input_ids:t.input_ids})}if(n.inputNames.includes(`token_type_ids`)&&!r.token_type_ids){if(!r.input_ids)throw Error("Both `input_ids` and `token_type_ids` are missing in the model inputs.");r.token_type_ids=Wl(r.input_ids)}if(n.inputNames.includes(`pixel_mask`)&&!r.pixel_mask){if(!r.pixel_values)throw Error("Both `pixel_values` and `pixel_mask` are missing in the model inputs.");let e=r.pixel_values.dims;r.pixel_mask=Vl([e[0],e[2],e[3]])}return await ah(n,r)}async function ng(e,t){let n=await e.encode(t);return await e.decode(n)}function rg(e,t){let n=Object.create(null);for(let r in e)if(r.startsWith(`present`)){let i=r.replace(`present_ssm`,`past_ssm`).replace(`present_conv`,`past_conv`).replace(`present_recurrent`,`past_recurrent`).replace(`present`,`past_key_values`);r.includes(`encoder`)&&t?n[i]=t[i]:n[i]=e[r]}return t?(t.update(n),t):new Rh(n)}function ig(e){let t={};for(let n of[`cross_attentions`,`encoder_attentions`,`decoder_attentions`])for(let r in e)r.startsWith(n)&&(n in t||(t[n]=[]),t[n].push(e[r]));return t}function ag(e,t){return e.map(e=>typeof e==`number`?e:t[e]??0)}function og(e,t,n){if(n&&Object.keys(n).length>0)return Object.assign(t,n),n;let r=e.sessions.decoder_model_merged??e.sessions.model,i=(t[e.main_input_name]??t.attention_mask)?.dims?.[0]??1,a=Jm(e.config),o=e.config?.normalized_config?.num_heads,s={batch_size:i};typeof o==`number`&&(s[`batch_size x num_heads`]=i*o);let c=Object.create(null);for(let e of r.inputMetadata){if(!a.has(e.name))continue;let n=ag(e.shape,s),r=n.reduce((e,t)=>e*t,1),i=yl[e.type],o=new G(e.type,new i(r),n);t[e.name]=o,c[e.name]=o}return n?(n.update(c),n):new Rh(c)}async function sg(e,t,n=!1){let r=e.sessions[n?`decoder_model_merged`:`model`],{past_key_values:i,...a}=t;return r.inputNames.includes(`use_cache_branch`)&&(a.use_cache_branch=Jh(i!=null&&Object.keys(i).length>0)),r.inputNames.includes(`position_ids`)&&a.attention_mask&&!a.position_ids&&(a.position_ids=fg(a,i,+!![`paligemma`,`gemma3_text`,`gemma3`].includes(e.config.model_type))),r.inputNames.includes(`num_logits_to_keep`)&&!a.num_logits_to_keep&&(a.num_logits_to_keep=new G(`int64`,[0n],[])),og(e,a,i),await ah(r,Si(a,r.inputNames))}async function cg(e,{encode_function:t,merge_function:n,modality_input_names:r,modality_output_name:i,input_ids:a=null,attention_mask:o=null,position_ids:s=null,inputs_embeds:c=null,past_key_values:l=null,generation_config:u=null,logits_processor:d=null,...f}){if(!c){c=await e.encode_text({input_ids:a,...f});let s=Si(f,r);if(Object.keys(s).length>0){if(a.dims[1]!==1){let e=await t({...s,...f});({inputs_embeds:c,attention_mask:o}=n({[i]:e,inputs_embeds:c,input_ids:a,attention_mask:o}))}else if(l&&a.dims[1]===1){let e=a.dims[1],t=l.get_seq_length();o=Ml([Vl([a.dims[0],t]),o.slice(null,[o.dims[1]-e,o.dims[1]])],1)}}}if(!s&&[`qwen2_vl`,`qwen2_vl_text`,`qwen2_5_vl`,`qwen2_5_vl_text`,`qwen3_vl`,`qwen3_vl_text`,`qwen3_vl_moe`,`qwen3_vl_moe_text`,`qwen3_5`,`qwen3_5_text`,`qwen3_5_moe`,`qwen3_5_moe_text`,`glm_ocr`,`glm_ocr_text`].includes(e.config.model_type)){let{image_grid_thw:t,video_grid_thw:n}=f;[s]=e.get_rope_index(a,t,n,o)}return await sg(e,{inputs_embeds:c,past_key_values:l,attention_mask:o,position_ids:s,generation_config:u,logits_processor:d},!0)}async function lg(e,t){return await cg(e,{...t,modality_input_names:[`audio_values`,`input_features`],modality_output_name:`audio_features`,encode_function:e.encode_audio.bind(e),merge_function:e._merge_input_ids_with_audio_features.bind(e)})}async function ug(e,t){return await cg(e,{...t,modality_input_names:[`pixel_values`],modality_output_name:`image_features`,encode_function:e.encode_image.bind(e),merge_function:e._merge_input_ids_with_image_features.bind(e)})}function dg(e,t=0){let[n,r]=e.dims,i=e.data,a=new BigInt64Array(i.length);for(let e=0;ee.dims[1]||i[e.at(-1)])),{...n,decoder_input_ids:qh(t)}}function hg(e,...t){return e.config.is_encoder_decoder?mg(e,...t):pg(e,...t)}function gg({modality_token_id:e,inputs_embeds:t,modality_features:n,input_ids:r,attention_mask:i}){let a=r.tolist().map(t=>t.reduce((t,n,r)=>(n==e&&t.push(r),t),[])),o=a.reduce((e,t)=>e+t.length,0),s=n.dims[0];if(o!==s)throw Error(`Number of tokens and features do not match: tokens: ${o}, features ${s}`);let c=0;for(let e=0;e[r,await Cc(e,t[r],!1,n)])))}var bg={};Pr(bg,{ASTForAudioClassification:()=>Lg,ASTModel:()=>Ig,ASTPreTrainedModel:()=>Fg,AfmoeForCausalLM:()=>jg,AfmoeModel:()=>Ag,AfmoePreTrainedModel:()=>kg,AlbertForMaskedLM:()=>Tg,AlbertForQuestionAnswering:()=>wg,AlbertForSequenceClassification:()=>Cg,AlbertModel:()=>Sg,AlbertPreTrainedModel:()=>xg,ApertusForCausalLM:()=>Og,ApertusModel:()=>Dg,ApertusPreTrainedModel:()=>Eg,ArceeForCausalLM:()=>Pg,ArceeModel:()=>Ng,ArceePreTrainedModel:()=>Mg,BartForConditionalGeneration:()=>Bg,BartForSequenceClassification:()=>Vg,BartModel:()=>zg,BartPretrainedModel:()=>Rg,BeitForImageClassification:()=>Wg,BeitModel:()=>Ug,BeitPreTrainedModel:()=>Hg,BertForMaskedLM:()=>qg,BertForQuestionAnswering:()=>Xg,BertForSequenceClassification:()=>Jg,BertForTokenClassification:()=>Yg,BertModel:()=>Kg,BertPreTrainedModel:()=>Gg,BlenderbotForConditionalGeneration:()=>$g,BlenderbotModel:()=>Qg,BlenderbotPreTrainedModel:()=>Zg,BlenderbotSmallForConditionalGeneration:()=>n_,BlenderbotSmallModel:()=>t_,BlenderbotSmallPreTrainedModel:()=>e_,BloomForCausalLM:()=>a_,BloomModel:()=>i_,BloomPreTrainedModel:()=>r_,CHMv2ForDepthEstimation:()=>y_,CHMv2PreTrainedModel:()=>v_,CLIPModel:()=>T_,CLIPPreTrainedModel:()=>w_,CLIPSegForImageSegmentation:()=>M_,CLIPSegModel:()=>j_,CLIPSegPreTrainedModel:()=>A_,CLIPTextModel:()=>E_,CLIPTextModelWithProjection:()=>D_,CLIPVisionModel:()=>O_,CLIPVisionModelWithProjection:()=>k_,CamembertForMaskedLM:()=>c_,CamembertForQuestionAnswering:()=>d_,CamembertForSequenceClassification:()=>l_,CamembertForTokenClassification:()=>u_,CamembertModel:()=>s_,CamembertPreTrainedModel:()=>o_,ChatterboxModel:()=>h_,ChatterboxPreTrainedModel:()=>m_,ChineseCLIPModel:()=>__,ChineseCLIPPreTrainedModel:()=>g_,ClapAudioModelWithProjection:()=>C_,ClapModel:()=>x_,ClapPreTrainedModel:()=>b_,ClapTextModelWithProjection:()=>S_,CodeGenForCausalLM:()=>F_,CodeGenModel:()=>P_,CodeGenPreTrainedModel:()=>N_,Cohere2ForCausalLM:()=>V_,Cohere2Model:()=>B_,Cohere2PreTrainedModel:()=>z_,CohereAsrForConditionalGeneration:()=>W_,CohereAsrModel:()=>U_,CohereAsrPreTrainedModel:()=>H_,CohereForCausalLM:()=>R_,CohereModel:()=>L_,CoherePreTrainedModel:()=>I_,ConvBertForMaskedLM:()=>q_,ConvBertForQuestionAnswering:()=>X_,ConvBertForSequenceClassification:()=>J_,ConvBertForTokenClassification:()=>Y_,ConvBertModel:()=>K_,ConvBertPreTrainedModel:()=>G_,ConvNextForImageClassification:()=>$_,ConvNextModel:()=>Q_,ConvNextPreTrainedModel:()=>Z_,ConvNextV2ForImageClassification:()=>rv,ConvNextV2Model:()=>nv,ConvNextV2PreTrainedModel:()=>tv,DFineForObjectDetection:()=>uv,DFineModel:()=>lv,DFinePreTrainedModel:()=>cv,DINOv3ConvNextModel:()=>ey,DINOv3ConvNextPreTrainedModel:()=>$v,DINOv3ViTModel:()=>ny,DINOv3ViTPreTrainedModel:()=>ty,DPTForDepthEstimation:()=>py,DPTModel:()=>fy,DPTPreTrainedModel:()=>dy,DacDecoderModel:()=>gv,DacDecoderOutput:()=>fv,DacEncoderModel:()=>hv,DacEncoderOutput:()=>dv,DacModel:()=>mv,DacPreTrainedModel:()=>pv,DebertaForMaskedLM:()=>yv,DebertaForQuestionAnswering:()=>Sv,DebertaForSequenceClassification:()=>bv,DebertaForTokenClassification:()=>xv,DebertaModel:()=>vv,DebertaPreTrainedModel:()=>_v,DebertaV2ForMaskedLM:()=>Ov,DebertaV2ForQuestionAnswering:()=>jv,DebertaV2ForSequenceClassification:()=>kv,DebertaV2ForTokenClassification:()=>Av,DebertaV2Model:()=>Dv,DebertaV2PreTrainedModel:()=>Ev,DecisionTransformerModel:()=>Nv,DecisionTransformerPreTrainedModel:()=>Mv,DeepseekV3ForCausalLM:()=>Tv,DeepseekV3Model:()=>wv,DeepseekV3PreTrainedModel:()=>Cv,DeiTForImageClassification:()=>Iv,DeiTModel:()=>Fv,DeiTPreTrainedModel:()=>Pv,DepthAnythingForDepthEstimation:()=>Rv,DepthAnythingPreTrainedModel:()=>Lv,DepthProForDepthEstimation:()=>Bv,DepthProPreTrainedModel:()=>zv,DetrForObjectDetection:()=>Uv,DetrForSegmentation:()=>Wv,DetrModel:()=>Hv,DetrObjectDetectionOutput:()=>Gv,DetrPreTrainedModel:()=>Vv,DetrSegmentationOutput:()=>Kv,Dinov2ForImageClassification:()=>Yv,Dinov2Model:()=>Jv,Dinov2PreTrainedModel:()=>qv,Dinov2WithRegistersForImageClassification:()=>Qv,Dinov2WithRegistersModel:()=>Zv,Dinov2WithRegistersPreTrainedModel:()=>Xv,DistilBertForMaskedLM:()=>cy,DistilBertForQuestionAnswering:()=>sy,DistilBertForSequenceClassification:()=>ay,DistilBertForTokenClassification:()=>oy,DistilBertModel:()=>iy,DistilBertPreTrainedModel:()=>ry,DonutSwinModel:()=>uy,DonutSwinPreTrainedModel:()=>ly,EdgeTamModel:()=>WT,EfficientNetForImageClassification:()=>gy,EfficientNetModel:()=>hy,EfficientNetPreTrainedModel:()=>my,ElectraForMaskedLM:()=>yy,ElectraForQuestionAnswering:()=>Sy,ElectraForSequenceClassification:()=>by,ElectraForTokenClassification:()=>xy,ElectraModel:()=>vy,ElectraPreTrainedModel:()=>_y,Ernie4_5ForCausalLM:()=>Ty,Ernie4_5Model:()=>wy,Ernie4_5PretrainedModel:()=>Cy,EsmForMaskedLM:()=>Oy,EsmForSequenceClassification:()=>ky,EsmForTokenClassification:()=>Ay,EsmModel:()=>Dy,EsmPreTrainedModel:()=>Ey,EuroBertForMaskedLM:()=>Ny,EuroBertForSequenceClassification:()=>Py,EuroBertForTokenClassification:()=>Fy,EuroBertModel:()=>My,EuroBertPreTrainedModel:()=>jy,ExaoneForCausalLM:()=>Ry,ExaoneModel:()=>Ly,ExaonePreTrainedModel:()=>Iy,FalconForCausalLM:()=>Vy,FalconH1ForCausalLM:()=>Wy,FalconH1Model:()=>Uy,FalconH1PreTrainedModel:()=>Hy,FalconModel:()=>By,FalconPreTrainedModel:()=>zy,FastViTForImageClassification:()=>qy,FastViTModel:()=>Ky,FastViTPreTrainedModel:()=>Gy,Florence2ForConditionalGeneration:()=>Yy,Florence2PreTrainedModel:()=>Jy,GLPNForDepthEstimation:()=>kb,GLPNModel:()=>Ob,GLPNPreTrainedModel:()=>Db,GPT2LMHeadModel:()=>Wb,GPT2Model:()=>Ub,GPT2PreTrainedModel:()=>Hb,GPTBigCodeForCausalLM:()=>Mb,GPTBigCodeModel:()=>jb,GPTBigCodePreTrainedModel:()=>Ab,GPTJForCausalLM:()=>qb,GPTJModel:()=>Kb,GPTJPreTrainedModel:()=>Gb,GPTNeoForCausalLM:()=>Fb,GPTNeoModel:()=>Pb,GPTNeoPreTrainedModel:()=>Nb,GPTNeoXForCausalLM:()=>Rb,GPTNeoXModel:()=>Lb,GPTNeoXPreTrainedModel:()=>Ib,Gemma2ForCausalLM:()=>tb,Gemma2Model:()=>eb,Gemma2PreTrainedModel:()=>$y,Gemma3ForCausalLM:()=>lb,Gemma3ForConditionalGeneration:()=>cb,Gemma3Model:()=>sb,Gemma3PreTrainedModel:()=>ob,Gemma3nForCausalLM:()=>fb,Gemma3nForConditionalGeneration:()=>db,Gemma3nPreTrainedModel:()=>ub,Gemma4ForCausalLM:()=>mb,Gemma4ForConditionalGeneration:()=>pb,GemmaForCausalLM:()=>Qy,GemmaModel:()=>Zy,GemmaPreTrainedModel:()=>Xy,GlmForCausalLM:()=>_b,GlmModel:()=>gb,GlmMoeDsaForCausalLM:()=>bb,GlmMoeDsaModel:()=>yb,GlmMoeDsaPreTrainedModel:()=>vb,GlmOcrForConditionalGeneration:()=>Eb,GlmPreTrainedModel:()=>hb,GptOssForCausalLM:()=>Vb,GptOssModel:()=>Bb,GptOssPreTrainedModel:()=>zb,GraniteForCausalLM:()=>Xb,GraniteModel:()=>Yb,GraniteMoeHybridForCausalLM:()=>$b,GraniteMoeHybridModel:()=>Qb,GraniteMoeHybridPreTrainedModel:()=>Zb,GranitePreTrainedModel:()=>Jb,GraniteSpeechForConditionalGeneration:()=>nx,GroundingDinoForObjectDetection:()=>ix,GroundingDinoPreTrainedModel:()=>rx,GroupViTModel:()=>ox,GroupViTPreTrainedModel:()=>ax,HeliumForCausalLM:()=>lx,HeliumModel:()=>cx,HeliumPreTrainedModel:()=>sx,HieraForImageClassification:()=>fx,HieraModel:()=>dx,HieraPreTrainedModel:()=>ux,HubertForCTC:()=>bx,HubertForSequenceClassification:()=>xx,HubertModel:()=>yx,HubertPreTrainedModel:()=>vx,HunYuanDenseV1ForCausalLM:()=>wx,HunYuanDenseV1Model:()=>Cx,HunYuanDenseV1PreTrainedModel:()=>Sx,IJepaForImageClassification:()=>Ox,IJepaModel:()=>Dx,IJepaPreTrainedModel:()=>Ex,Idefics3ForConditionalGeneration:()=>Tx,JAISLMHeadModel:()=>jx,JAISModel:()=>Ax,JAISPreTrainedModel:()=>kx,JinaCLIPModel:()=>Nx,JinaCLIPPreTrainedModel:()=>Mx,JinaCLIPTextModel:()=>Px,JinaCLIPVisionModel:()=>Fx,Lfm2ForCausalLM:()=>Rx,Lfm2Model:()=>Lx,Lfm2MoeForCausalLM:()=>Hx,Lfm2MoeModel:()=>Vx,Lfm2MoePreTrainedModel:()=>Bx,Lfm2PreTrainedModel:()=>Ix,Lfm2VlForConditionalGeneration:()=>Ux,LightOnOcrForConditionalGeneration:()=>zx,LiteWhisperForConditionalGeneration:()=>$D,Llama4ForCausalLM:()=>Jx,Llama4PreTrainedModel:()=>qx,LlamaForCausalLM:()=>Kx,LlamaModel:()=>Gx,LlamaPreTrainedModel:()=>Wx,LlavaForConditionalGeneration:()=>rb,LlavaOnevisionForConditionalGeneration:()=>rb,LlavaPreTrainedModel:()=>nb,LlavaQwen2ForCausalLM:()=>ab,LongT5ForConditionalGeneration:()=>Zx,LongT5Model:()=>Xx,LongT5PreTrainedModel:()=>Yx,M2M100ForConditionalGeneration:()=>eS,M2M100Model:()=>$x,M2M100PreTrainedModel:()=>Qx,MBartForCausalLM:()=>dS,MBartForConditionalGeneration:()=>lS,MBartForSequenceClassification:()=>uS,MBartModel:()=>cS,MBartPreTrainedModel:()=>sS,MPNetForMaskedLM:()=>bC,MPNetForQuestionAnswering:()=>CC,MPNetForSequenceClassification:()=>xC,MPNetForTokenClassification:()=>SC,MPNetModel:()=>yC,MPNetPreTrainedModel:()=>vC,MT5ForConditionalGeneration:()=>kC,MT5Model:()=>OC,MT5PreTrainedModel:()=>DC,MarianMTModel:()=>rS,MarianModel:()=>nS,MarianPreTrainedModel:()=>tS,MaskFormerForInstanceSegmentation:()=>oS,MaskFormerModel:()=>aS,MaskFormerPreTrainedModel:()=>iS,Metric3DForDepthEstimation:()=>pS,Metric3DPreTrainedModel:()=>fS,Metric3Dv2ForDepthEstimation:()=>hS,Metric3Dv2PreTrainedModel:()=>mS,MgpstrForSceneTextRecognition:()=>vS,MgpstrModelOutput:()=>gS,MgpstrPreTrainedModel:()=>_S,MimiDecoderModel:()=>wS,MimiDecoderOutput:()=>bS,MimiEncoderModel:()=>CS,MimiEncoderOutput:()=>yS,MimiModel:()=>SS,MimiPreTrainedModel:()=>xS,Mistral4ForCausalLM:()=>AS,Mistral4Model:()=>kS,Mistral4PreTrainedModel:()=>OS,MistralForCausalLM:()=>DS,MistralModel:()=>ES,MistralPreTrainedModel:()=>TS,MobileBertForMaskedLM:()=>NS,MobileBertForQuestionAnswering:()=>FS,MobileBertForSequenceClassification:()=>PS,MobileBertModel:()=>MS,MobileBertPreTrainedModel:()=>jS,MobileLLMForCausalLM:()=>RS,MobileLLMModel:()=>LS,MobileLLMPreTrainedModel:()=>IS,MobileNetV1ForImageClassification:()=>VS,MobileNetV1ForSemanticSegmentation:()=>HS,MobileNetV1Model:()=>BS,MobileNetV1PreTrainedModel:()=>zS,MobileNetV2ForImageClassification:()=>GS,MobileNetV2ForSemanticSegmentation:()=>KS,MobileNetV2Model:()=>WS,MobileNetV2PreTrainedModel:()=>US,MobileNetV3ForImageClassification:()=>YS,MobileNetV3ForSemanticSegmentation:()=>XS,MobileNetV3Model:()=>JS,MobileNetV3PreTrainedModel:()=>qS,MobileNetV4ForImageClassification:()=>$S,MobileNetV4ForSemanticSegmentation:()=>eC,MobileNetV4Model:()=>QS,MobileNetV4PreTrainedModel:()=>ZS,MobileViTForImageClassification:()=>rC,MobileViTModel:()=>nC,MobileViTPreTrainedModel:()=>tC,MobileViTV2ForImageClassification:()=>oC,MobileViTV2Model:()=>aC,MobileViTV2PreTrainedModel:()=>iC,ModernBertDecoderForCausalLM:()=>mC,ModernBertDecoderModel:()=>pC,ModernBertDecoderPreTrainedModel:()=>fC,ModernBertForMaskedLM:()=>lC,ModernBertForSequenceClassification:()=>uC,ModernBertForTokenClassification:()=>dC,ModernBertModel:()=>cC,ModernBertPreTrainedModel:()=>sC,Moondream1ForConditionalGeneration:()=>ib,MoonshineForConditionalGeneration:()=>_C,MoonshineModel:()=>gC,MoonshinePreTrainedModel:()=>hC,MptForCausalLM:()=>EC,MptModel:()=>TC,MptPreTrainedModel:()=>wC,MultiModalityCausalLM:()=>jC,MultiModalityPreTrainedModel:()=>AC,MusicgenForCausalLM:()=>PC,MusicgenForConditionalGeneration:()=>FC,MusicgenModel:()=>NC,MusicgenPreTrainedModel:()=>MC,NanoChatForCausalLM:()=>RC,NanoChatModel:()=>LC,NanoChatPreTrainedModel:()=>IC,NemotronHForCausalLM:()=>VC,NemotronHModel:()=>BC,NemotronHPreTrainedModel:()=>zC,NeoBertForMaskedLM:()=>WC,NeoBertForQuestionAnswering:()=>qC,NeoBertForSequenceClassification:()=>GC,NeoBertForTokenClassification:()=>KC,NeoBertModel:()=>UC,NeoBertPreTrainedModel:()=>HC,NomicBertModel:()=>YC,NomicBertPreTrainedModel:()=>JC,OPTForCausalLM:()=>gw,OPTModel:()=>hw,OPTPreTrainedModel:()=>mw,Olmo2ForCausalLM:()=>tw,Olmo2Model:()=>ew,Olmo2PreTrainedModel:()=>$C,Olmo3ForCausalLM:()=>iw,Olmo3Model:()=>rw,Olmo3PreTrainedModel:()=>nw,OlmoForCausalLM:()=>QC,OlmoHybridForCausalLM:()=>sw,OlmoHybridModel:()=>ow,OlmoHybridPreTrainedModel:()=>aw,OlmoModel:()=>ZC,OlmoPreTrainedModel:()=>XC,OpenAIPrivacyFilterForTokenClassification:()=>uw,OpenAIPrivacyFilterModel:()=>lw,OpenAIPrivacyFilterPreTrainedModel:()=>cw,OpenELMForCausalLM:()=>pw,OpenELMModel:()=>fw,OpenELMPreTrainedModel:()=>dw,OwlViTForObjectDetection:()=>Sw,OwlViTModel:()=>xw,OwlViTPreTrainedModel:()=>bw,Owlv2ForObjectDetection:()=>yw,Owlv2Model:()=>vw,Owlv2PreTrainedModel:()=>_w,PaliGemmaForConditionalGeneration:()=>Cw,ParakeetForCTC:()=>Tw,ParakeetPreTrainedModel:()=>ww,PatchTSMixerForPrediction:()=>Ow,PatchTSMixerModel:()=>Dw,PatchTSMixerPreTrainedModel:()=>Ew,PatchTSTForPrediction:()=>jw,PatchTSTModel:()=>Aw,PatchTSTPreTrainedModel:()=>kw,Phi3ForCausalLM:()=>Lw,Phi3Model:()=>Iw,Phi3PreTrainedModel:()=>Fw,Phi3VForCausalLM:()=>zw,Phi3VPreTrainedModel:()=>Rw,PhiForCausalLM:()=>Pw,PhiModel:()=>Nw,PhiPreTrainedModel:()=>Mw,PreTrainedModel:()=>q,PvtForImageClassification:()=>Hw,PvtModel:()=>Vw,PvtPreTrainedModel:()=>Bw,PyAnnoteForAudioFrameClassification:()=>Gw,PyAnnoteModel:()=>Ww,PyAnnotePreTrainedModel:()=>Uw,Qwen2ForCausalLM:()=>Jw,Qwen2Model:()=>qw,Qwen2MoeForCausalLM:()=>Zw,Qwen2MoeModel:()=>Xw,Qwen2MoePreTrainedModel:()=>Yw,Qwen2PreTrainedModel:()=>Kw,Qwen2VLForCausalLM:()=>Cb,Qwen2VLForConditionalGeneration:()=>Sb,Qwen2VLPreTrainedModel:()=>xb,Qwen2_5_VLForCausalLM:()=>Tb,Qwen2_5_VLForConditionalGeneration:()=>wb,Qwen3ForCausalLM:()=>eT,Qwen3Model:()=>$w,Qwen3MoeForCausalLM:()=>rT,Qwen3MoeModel:()=>nT,Qwen3MoePreTrainedModel:()=>tT,Qwen3NextForCausalLM:()=>oT,Qwen3NextModel:()=>aT,Qwen3NextPreTrainedModel:()=>iT,Qwen3PreTrainedModel:()=>Qw,Qwen3VLForCausalLM:()=>cT,Qwen3VLForConditionalGeneration:()=>sT,Qwen3VLMoeForCausalLM:()=>uT,Qwen3VLMoeForConditionalGeneration:()=>lT,Qwen3_5ForCausalLM:()=>fT,Qwen3_5ForConditionalGeneration:()=>dT,Qwen3_5MoeForCausalLM:()=>mT,Qwen3_5MoeForConditionalGeneration:()=>pT,RFDetrForObjectDetection:()=>bT,RFDetrModel:()=>yT,RFDetrObjectDetectionOutput:()=>xT,RFDetrPreTrainedModel:()=>vT,RTDetrForObjectDetection:()=>ov,RTDetrModel:()=>av,RTDetrObjectDetectionOutput:()=>sv,RTDetrPreTrainedModel:()=>iv,RTDetrV2ForObjectDetection:()=>IT,RTDetrV2Model:()=>FT,RTDetrV2ObjectDetectionOutput:()=>LT,RTDetrV2PreTrainedModel:()=>PT,ResNetForImageClassification:()=>_T,ResNetModel:()=>gT,ResNetPreTrainedModel:()=>hT,RoFormerForMaskedLM:()=>AT,RoFormerForQuestionAnswering:()=>NT,RoFormerForSequenceClassification:()=>jT,RoFormerForTokenClassification:()=>MT,RoFormerModel:()=>kT,RoFormerPreTrainedModel:()=>OT,RobertaForMaskedLM:()=>wT,RobertaForQuestionAnswering:()=>DT,RobertaForSequenceClassification:()=>TT,RobertaForTokenClassification:()=>ET,RobertaModel:()=>CT,RobertaPreTrainedModel:()=>ST,Sam2ImageSegmentationOutput:()=>VT,Sam2Model:()=>UT,Sam2PreTrainedModel:()=>HT,Sam3TrackerModel:()=>GT,SamImageSegmentationOutput:()=>RT,SamModel:()=>BT,SamPreTrainedModel:()=>zT,SapiensForDepthEstimation:()=>JT,SapiensForNormalEstimation:()=>YT,SapiensForSemanticSegmentation:()=>qT,SapiensPreTrainedModel:()=>KT,SegformerForImageClassification:()=>QT,SegformerForSemanticSegmentation:()=>$T,SegformerModel:()=>ZT,SegformerPreTrainedModel:()=>XT,SiglipModel:()=>tE,SiglipPreTrainedModel:()=>eE,SiglipTextModel:()=>nE,SiglipVisionModel:()=>rE,SmolLM3ForCausalLM:()=>oE,SmolLM3Model:()=>aE,SmolLM3PreTrainedModel:()=>iE,SmolVLMForConditionalGeneration:()=>sE,SnacDecoderModel:()=>dE,SnacEncoderModel:()=>uE,SnacModel:()=>lE,SnacPreTrainedModel:()=>cE,SolarOpenForCausalLM:()=>mE,SolarOpenModel:()=>pE,SolarOpenPreTrainedModel:()=>fE,SpeechT5ForSpeechToText:()=>_E,SpeechT5ForTextToSpeech:()=>vE,SpeechT5HifiGan:()=>yE,SpeechT5Model:()=>gE,SpeechT5PreTrainedModel:()=>hE,SqueezeBertForMaskedLM:()=>SE,SqueezeBertForQuestionAnswering:()=>wE,SqueezeBertForSequenceClassification:()=>CE,SqueezeBertModel:()=>xE,SqueezeBertPreTrainedModel:()=>bE,StableLmForCausalLM:()=>DE,StableLmModel:()=>EE,StableLmPreTrainedModel:()=>TE,Starcoder2ForCausalLM:()=>AE,Starcoder2Model:()=>kE,Starcoder2PreTrainedModel:()=>OE,StyleTextToSpeech2Model:()=>ME,StyleTextToSpeech2PreTrainedModel:()=>jE,SupertonicForConditionalGeneration:()=>PE,SupertonicPreTrainedModel:()=>NE,Swin2SRForImageSuperResolution:()=>VE,Swin2SRModel:()=>BE,Swin2SRPreTrainedModel:()=>zE,SwinForImageClassification:()=>LE,SwinForSemanticSegmentation:()=>RE,SwinModel:()=>IE,SwinPreTrainedModel:()=>FE,T5ForConditionalGeneration:()=>WE,T5Model:()=>UE,T5PreTrainedModel:()=>HE,TableTransformerForObjectDetection:()=>qE,TableTransformerModel:()=>KE,TableTransformerObjectDetectionOutput:()=>JE,TableTransformerPreTrainedModel:()=>GE,TrOCRForCausalLM:()=>XE,TrOCRPreTrainedModel:()=>YE,UltravoxModel:()=>tx,UltravoxPreTrainedModel:()=>ex,UniSpeechForCTC:()=>$E,UniSpeechForSequenceClassification:()=>eD,UniSpeechModel:()=>QE,UniSpeechPreTrainedModel:()=>ZE,UniSpeechSatForAudioFrameClassification:()=>aD,UniSpeechSatForCTC:()=>rD,UniSpeechSatForSequenceClassification:()=>iD,UniSpeechSatModel:()=>nD,UniSpeechSatPreTrainedModel:()=>tD,VaultGemmaForCausalLM:()=>cD,VaultGemmaModel:()=>sD,VaultGemmaPreTrainedModel:()=>oD,ViTForImageClassification:()=>fD,ViTMAEModel:()=>mD,ViTMAEPreTrainedModel:()=>pD,ViTMSNForImageClassification:()=>_D,ViTMSNModel:()=>gD,ViTMSNPreTrainedModel:()=>hD,ViTModel:()=>dD,ViTPreTrainedModel:()=>uD,VisionEncoderDecoderModel:()=>lD,VitMatteForImageMatting:()=>yD,VitMattePreTrainedModel:()=>vD,VitPoseForPoseEstimation:()=>xD,VitPosePreTrainedModel:()=>bD,VitsModel:()=>wD,VitsModelOutput:()=>SD,VitsPreTrainedModel:()=>CD,VoxtralForConditionalGeneration:()=>TD,VoxtralRealtimeForConditionalGeneration:()=>FD,VoxtralRealtimePreTrainedModel:()=>PD,Wav2Vec2BertForCTC:()=>RD,Wav2Vec2BertForSequenceClassification:()=>zD,Wav2Vec2BertModel:()=>LD,Wav2Vec2BertPreTrainedModel:()=>ID,Wav2Vec2ForAudioFrameClassification:()=>_x,Wav2Vec2ForCTC:()=>hx,Wav2Vec2ForSequenceClassification:()=>gx,Wav2Vec2Model:()=>mx,Wav2Vec2PreTrainedModel:()=>px,WavLMForAudioFrameClassification:()=>KD,WavLMForCTC:()=>UD,WavLMForSequenceClassification:()=>WD,WavLMForXVector:()=>GD,WavLMModel:()=>HD,WavLMPreTrainedModel:()=>VD,WeSpeakerResNetModel:()=>JD,WeSpeakerResNetPreTrainedModel:()=>qD,WhisperForConditionalGeneration:()=>QD,WhisperModel:()=>ZD,WhisperPreTrainedModel:()=>XD,XLMForQuestionAnswering:()=>aO,XLMForSequenceClassification:()=>rO,XLMForTokenClassification:()=>iO,XLMModel:()=>tO,XLMPreTrainedModel:()=>eO,XLMRobertaForMaskedLM:()=>cO,XLMRobertaForQuestionAnswering:()=>dO,XLMRobertaForSequenceClassification:()=>lO,XLMRobertaForTokenClassification:()=>uO,XLMRobertaModel:()=>sO,XLMRobertaPreTrainedModel:()=>oO,XLMWithLMHeadModel:()=>nO,XVectorOutput:()=>BD,YolosForObjectDetection:()=>mO,YolosModel:()=>pO,YolosObjectDetectionOutput:()=>hO,YolosPreTrainedModel:()=>fO,YoutuForCausalLM:()=>vO,YoutuModel:()=>_O,YoutuPreTrainedModel:()=>gO});var xg=class extends q{},Sg=class extends xg{},Cg=class extends xg{async _call(e){return new ch(await super._call(e))}},wg=class extends xg{async _call(e){return new dh(await super._call(e))}},Tg=class extends xg{async _call(e){return new uh(await super._call(e))}},Eg=class extends q{},Dg=class extends Eg{},Og=class extends Eg{},kg=class extends q{},Ag=class extends kg{},jg=class extends kg{},Mg=class extends q{},Ng=class extends Mg{},Pg=class extends Mg{},Fg=class extends q{},Ig=class extends Fg{},Lg=class extends Fg{},Rg=class extends q{},zg=class extends Rg{},Bg=class extends Rg{},Vg=class extends Rg{async _call(e){return new ch(await super._call(e))}},Hg=class extends q{},Ug=class extends Hg{},Wg=class extends Hg{async _call(e){return new ch(await super._call(e))}},Gg=class extends q{},Kg=class extends Gg{},qg=class extends Gg{async _call(e){return new uh(await super._call(e))}},Jg=class extends Gg{async _call(e){return new ch(await super._call(e))}},Yg=class extends Gg{async _call(e){return new lh(await super._call(e))}},Xg=class extends Gg{async _call(e){return new dh(await super._call(e))}},Zg=class extends q{},Qg=class extends Zg{},$g=class extends Zg{},e_=class extends q{},t_=class extends e_{},n_=class extends e_{},r_=class extends q{},i_=class extends r_{},a_=class extends r_{},o_=class extends q{},s_=class extends o_{},c_=class extends o_{async _call(e){return new uh(await super._call(e))}},l_=class extends o_{async _call(e){return new ch(await super._call(e))}},u_=class extends o_{async _call(e){return new lh(await super._call(e))}},d_=class extends o_{async _call(e){return new dh(await super._call(e))}},f_=4299n,p_=6561n,m_=class extends q{forward_params=[`input_ids`,`inputs_embeds`,`attention_mask`,`position_ids`,`audio_values`,`exaggeration`,`audio_features`,`audio_tokens`,`speaker_embeddings`,`speaker_features`,`past_key_values`];main_input_name=`input_ids`;_return_dict_in_generate_keys=[`audio_tokens`,`speaker_embeddings`,`speaker_features`]},h_=class extends m_{async encode_speech(e){return ah(this.sessions.speech_encoder,{audio_values:e})}async forward({input_ids:e=null,attention_mask:t=null,audio_values:n=null,exaggeration:r=null,position_ids:i=null,inputs_embeds:a=null,past_key_values:o=null,generation_config:s=null,logits_processor:c=null,audio_features:l=null,audio_tokens:u=null,speaker_embeddings:d=null,speaker_features:f=null,...p}){let m;if(!a){let s=this.sessions.embed_tokens.inputNames,c={input_ids:e};if(s.includes(`exaggeration`)){if(!(r instanceof G)){let t=e.dims[0];if(r==null)r=zl([t],.5);else if(typeof r==`number`)r=zl([t],r);else if(Array.isArray(r))r=new G(`float32`,r,[t]);else throw Error("Unsupported type for `exaggeration` input")}c.exaggeration=r}if(s.includes(`position_ids`)&&(c.position_ids=i),{inputs_embeds:a}=await ah(this.sessions.embed_tokens,c),l&&u&&d&&f&&(m={audio_features:l,audio_tokens:u,speaker_embeddings:d,speaker_features:f}),m||n)m??=await this.encode_speech(n),a=Ml([m.audio_features,a],1),t=Vl([a.dims[0],a.dims[1]]);else{let e=a.dims[1];if(!o||e!==1)throw Error(`Incorrect state encountered during generation.`);let n=o.get_seq_length();t=Vl([a.dims[0],n+e])}}return{...await sg(this,{inputs_embeds:a,past_key_values:o,attention_mask:t,generation_config:s,logits_processor:c},!1),...m}}prepare_inputs_for_generation(e,t,n){return!t.position_ids&&this.sessions.embed_tokens.inputNames.includes(`position_ids`)&&(t.input_ids.dims[1]===1?t.position_ids=new G(`int64`,Array.from({length:e.length},(t,n)=>e[n].length-e[n].findLastIndex(e=>e==p_)-1),[e.length,1]):t.position_ids=new G(`int64`,t.input_ids.tolist().map(e=>{let t=0;return e.map(e=>e>=p_?0:t++)}).flat(),t.input_ids.dims)),t.input_ids.dims[1]===1&&(delete t.audio_values,delete t.audio_features,delete t.audio_tokens,delete t.speaker_embeddings,delete t.speaker_features),pg(this,e,t,n)}async generate(e){let{sequences:t,audio_tokens:n,speaker_embeddings:r,speaker_features:i}=await super.generate({...e,return_dict_in_generate:!0}),a=t.slice(null,[e.input_ids.dims[1],-1]),o=Ml([n,a,zl([a.dims[0],3],f_)],1),{waveform:s}=await ah(this.sessions.conditional_decoder,{speech_tokens:o,speaker_features:i,speaker_embeddings:r});return s}},g_=class extends q{},__=class extends g_{},v_=class extends q{},y_=class extends v_{},b_=class extends q{},x_=class extends b_{},S_=class extends b_{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}},C_=class extends b_{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`audio_model`})}},w_=class extends q{},T_=class extends w_{},E_=class extends w_{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}},D_=class extends w_{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}},O_=class extends w_{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`vision_model`})}},k_=class extends w_{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`vision_model`})}},A_=class extends q{},j_=class extends A_{},M_=class extends A_{},N_=class extends q{},P_=class extends N_{},F_=class extends N_{},I_=class extends q{},L_=class extends I_{},R_=class extends I_{},z_=class extends q{},B_=class extends z_{},V_=class extends z_{},H_=class extends q{requires_attention_mask=!1;main_input_name=`input_features`;forward_params=[`input_features`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`]},U_=class extends H_{},W_=class extends H_{},G_=class extends q{},K_=class extends G_{},q_=class extends G_{async _call(e){return new uh(await super._call(e))}},J_=class extends G_{async _call(e){return new ch(await super._call(e))}},Y_=class extends G_{async _call(e){return new lh(await super._call(e))}},X_=class extends G_{async _call(e){return new dh(await super._call(e))}},Z_=class extends q{},Q_=class extends Z_{},$_=class extends Z_{async _call(e){return new ch(await super._call(e))}},tv=class extends q{},nv=class extends tv{},rv=class extends tv{async _call(e){return new ch(await super._call(e))}},iv=class extends q{},av=class extends iv{},ov=class extends iv{async _call(e){return new sv(await super._call(e))}},sv=class extends sh{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}},cv=class extends q{},lv=class extends cv{},uv=class extends cv{async _call(e){return new sv(await super._call(e))}},dv=class extends sh{constructor({audio_codes:e}){super(),this.audio_codes=e}},fv=class extends sh{constructor({audio_values:e}){super(),this.audio_values=e}},pv=class extends q{main_input_name=`input_values`;forward_params=[`input_values`]},mv=class extends pv{async encode(e){return new dv(await ah(this.sessions.encoder_model,e))}async decode(e){return new fv(await ah(this.sessions.decoder_model,e))}},hv=class extends pv{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}},gv=class extends pv{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}},_v=class extends q{},vv=class extends _v{},yv=class extends _v{async _call(e){return new uh(await super._call(e))}},bv=class extends _v{async _call(e){return new ch(await super._call(e))}},xv=class extends _v{async _call(e){return new lh(await super._call(e))}},Sv=class extends _v{async _call(e){return new dh(await super._call(e))}},Cv=class extends q{},wv=class extends Cv{},Tv=class extends Cv{},Ev=class extends q{},Dv=class extends Ev{},Ov=class extends Ev{async _call(e){return new uh(await super._call(e))}},kv=class extends Ev{async _call(e){return new ch(await super._call(e))}},Av=class extends Ev{async _call(e){return new lh(await super._call(e))}},jv=class extends Ev{async _call(e){return new dh(await super._call(e))}},Mv=class extends q{},Nv=class extends Mv{},Pv=class extends q{},Fv=class extends Pv{},Iv=class extends Pv{async _call(e){return new ch(await super._call(e))}},Lv=class extends q{},Rv=class extends Lv{},zv=class extends q{},Bv=class extends zv{},Vv=class extends q{},Hv=class extends Vv{},Uv=class extends Vv{async _call(e){return new Gv(await super._call(e))}},Wv=class extends Vv{async _call(e){return new Kv(await super._call(e))}},Gv=class extends sh{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}},Kv=class extends sh{constructor({logits:e,pred_boxes:t,pred_masks:n}){super(),this.logits=e,this.pred_boxes=t,this.pred_masks=n}},qv=class extends q{},Jv=class extends qv{},Yv=class extends qv{async _call(e){return new ch(await super._call(e))}},Xv=class extends q{},Zv=class extends Xv{},Qv=class extends Xv{async _call(e){return new ch(await super._call(e))}},$v=class extends q{},ey=class extends $v{},ty=class extends q{},ny=class extends ty{},ry=class extends q{},iy=class extends ry{},ay=class extends ry{async _call(e){return new ch(await super._call(e))}},oy=class extends ry{async _call(e){return new lh(await super._call(e))}},sy=class extends ry{async _call(e){return new dh(await super._call(e))}},cy=class extends ry{async _call(e){return new uh(await super._call(e))}},ly=class extends q{},uy=class extends ly{},dy=class extends q{},fy=class extends dy{},py=class extends dy{},my=class extends q{},hy=class extends my{},gy=class extends my{async _call(e){return new ch(await super._call(e))}},_y=class extends q{},vy=class extends _y{},yy=class extends _y{async _call(e){return new uh(await super._call(e))}},by=class extends _y{async _call(e){return new ch(await super._call(e))}},xy=class extends _y{async _call(e){return new lh(await super._call(e))}},Sy=class extends _y{async _call(e){return new dh(await super._call(e))}},Cy=class extends q{},wy=class extends Cy{},Ty=class extends Cy{},Ey=class extends q{},Dy=class extends Ey{},Oy=class extends Ey{async _call(e){return new uh(await super._call(e))}},ky=class extends Ey{async _call(e){return new ch(await super._call(e))}},Ay=class extends Ey{async _call(e){return new lh(await super._call(e))}},jy=class extends q{},My=class extends jy{},Ny=class extends jy{async _call(e){return new uh(await super._call(e))}},Py=class extends jy{async _call(e){return new ch(await super._call(e))}},Fy=class extends jy{async _call(e){return new lh(await super._call(e))}},Iy=class extends q{},Ly=class extends Iy{},Ry=class extends Iy{},zy=class extends q{},By=class extends zy{},Vy=class extends zy{},Hy=class extends q{},Uy=class extends Hy{},Wy=class extends Hy{},Gy=class extends q{},Ky=class extends Gy{},qy=class extends Gy{async _call(e){return new ch(await super._call(e))}},Jy=class extends q{forward_params=[`input_ids`,`inputs_embeds`,`attention_mask`,`pixel_values`,`encoder_outputs`,`decoder_input_ids`,`decoder_inputs_embeds`,`decoder_attention_mask`,`past_key_values`];main_input_name=`inputs_embeds`},Yy=class extends Jy{_merge_input_ids_with_image_features({inputs_embeds:e,image_features:t,input_ids:n,attention_mask:r}){return{inputs_embeds:Ml([t,e],1),attention_mask:Ml([Vl(t.dims.slice(0,2)),r],1)}}async _prepare_inputs_embeds({input_ids:e,pixel_values:t,inputs_embeds:n,attention_mask:r}){if(!e&&!t)throw Error("Either `input_ids` or `pixel_values` should be provided.");let i,a;return e&&(i=await this.encode_text({input_ids:e})),t&&(a=await this.encode_image({pixel_values:t})),i&&a?{inputs_embeds:n,attention_mask:r}=this._merge_input_ids_with_image_features({inputs_embeds:i,image_features:a,input_ids:e,attention_mask:r}):n=i||a,{inputs_embeds:n,attention_mask:r}}async forward({input_ids:e,pixel_values:t,attention_mask:n,decoder_input_ids:r,decoder_attention_mask:i,encoder_outputs:a,past_key_values:o,inputs_embeds:s,decoder_inputs_embeds:c}){if(s||({inputs_embeds:s,attention_mask:n}=await this._prepare_inputs_embeds({input_ids:e,pixel_values:t,inputs_embeds:s,attention_mask:n})),!a){let{last_hidden_state:e}=await tg(this,{inputs_embeds:s,attention_mask:n});a=e}if(!c){if(!r)throw Error("Either `decoder_input_ids` or `decoder_inputs_embeds` should be provided.");c=await this.encode_text({input_ids:r})}let l={inputs_embeds:c,attention_mask:i,encoder_attention_mask:n,encoder_hidden_states:a,past_key_values:o};return await sg(this,l,!0)}},Xy=class extends q{},Zy=class extends Xy{},Qy=class extends Xy{},$y=class extends q{},eb=class extends $y{},tb=class extends $y{},nb=class extends q{forward_params=[`input_ids`,`attention_mask`,`pixel_values`,`position_ids`,`past_key_values`]},rb=class extends nb{_merge_input_ids_with_image_features(e){let t=e.image_features.dims.at(-1),n=e.image_features.view(-1,t);return _g({image_token_id:this.config.image_token_index??this.config.image_token_id,...e,image_features:n})}},ib=class extends rb{},ab=class extends rb{},ob=class extends q{},sb=class extends ob{},cb=class extends rb{},lb=class extends cb{},ub=class extends q{forward_params=[`input_ids`,`attention_mask`,`inputs_embeds`,`per_layer_inputs`,`position_ids`,`pixel_values`,`input_features`,`input_features_mask`,`past_key_values`]},db=class extends ub{async forward({input_ids:e=null,attention_mask:t=null,pixel_values:n=null,input_features:r=null,input_features_mask:i=null,position_ids:a=null,inputs_embeds:o=null,per_layer_inputs:s=null,past_key_values:c=null,generation_config:l=null,logits_processor:u=null,...d}){if((!o||!s)&&({inputs_embeds:o,per_layer_inputs:s}=await ah(this.sessions.embed_tokens,{input_ids:e}),e.dims[1]!==1)){if(n){let{image_features:r}=await this._encode_vision({pixel_values:n,...d});({inputs_embeds:o,attention_mask:t}=this._merge_input_ids_with_image_features({image_features:r,inputs_embeds:o,input_ids:e,attention_mask:t}))}if(r){let{audio_features:n}=await ah(this.sessions.audio_encoder,{input_features:r,input_features_mask:i});({inputs_embeds:o,attention_mask:t}=this._merge_input_ids_with_audio_features({audio_features:n,inputs_embeds:o,input_ids:e,attention_mask:t}))}}return await sg(this,{inputs_embeds:o,per_layer_inputs:s,past_key_values:c,attention_mask:t,position_ids:a,generation_config:l,logits_processor:u},!0)}_encode_vision(e){return ah(this.sessions.vision_encoder,{pixel_values:e.pixel_values})}_merge_input_ids_with_image_features(e){let t=e.image_features.dims.at(-1),n=e.image_features.view(-1,t);return _g({image_token_id:this.config.image_token_id,...e,image_features:n})}_merge_input_ids_with_audio_features(e){let t=e.audio_features.dims.at(-1),n=e.audio_features.view(-1,t);return vg({audio_token_id:this.config.audio_token_id,...e,audio_features:n})}},fb=class extends db{},pb=class extends db{forward_params=[`input_ids`,`attention_mask`,`inputs_embeds`,`per_layer_inputs`,`position_ids`,`pixel_values`,`image_position_ids`,`input_features`,`input_features_mask`,`past_key_values`];_encode_vision(e){return ah(this.sessions.vision_encoder,{pixel_values:e.pixel_values,pixel_position_ids:e.image_position_ids})}},mb=class extends pb{},hb=class extends q{},gb=class extends hb{},_b=class extends hb{},vb=class extends q{},yb=class extends vb{},bb=class extends vb{},xb=class extends q{forward_params=[`input_ids`,`attention_mask`,`position_ids`,`past_key_values`,`pixel_values`,`image_grid_thw`]},Sb=class extends xb{image_grid_thw_name=`grid_thw`;_get_text_only_rope_index(e,t){if(t){let{data:e,dims:n}=dg(t),r=BigInt64Array.from({length:3*e.length},(t,n)=>e[n%e.length]),i=Array.from({length:n[0]},(t,r)=>kc(e.subarray(n[1]*r,n[1]*(r+1)))[0]+1n+BigInt(n[1]));return[new G(`int64`,r,[3,...n]),new G(`int64`,i,[i.length,1])]}else{let[t,n]=e.dims;return[new G(`int64`,BigInt64Array.from({length:3*t*n},(e,r)=>BigInt(Math.floor(r%n/t))),[3,...e.dims]),Ul([t,1])]}}_reorder_and_write_positions(e,t,n,r){let i=e.reduce((e,t)=>e+t.length,0),a=Array(i),o=0;for(let t=0;t<3;++t)for(let n of e){let e=n.length/3;for(let r=t*e;r<(t+1)*e;++r)a[o++]=n[r]}let s=0;for(let e=0;e(t==s&&e.push(n),e),[]).map(e=>c[e+1]),u=l.filter(e=>e==a).length,d=l.filter(e=>e==o).length,f=[],p=0,m=u,h=d;for(let e=0;et>p&&e==a),s=c.findIndex((e,t)=>t>p&&e==o),l=m>0&&e!==-1?e:c.length+1,u=h>0&&s!==-1?s:c.length+1,d,g,_,v;l0?kc(f.at(-1))[0]+1:0;f.push(Array.from({length:3*S},(e,t)=>C+t%S));let w=S+C,T=y*b*x,E=Array.from({length:T},(e,t)=>w+Math.floor(t/(b*x))),D=Array.from({length:T},(e,t)=>w+Math.floor(t/x)%b),O=Array.from({length:T},(e,t)=>w+t%x);f.push([E,D,O].flat()),p=d+T}if(p0?kc(f.at(-1))[0]+1:0,t=c.length-p;f.push(Array.from({length:3*t},(n,r)=>e+r%t))}return f}get_rope_index(e,t,n,r){let{vision_config:i}=this.config,a=i.spatial_merge_size??2;if(t||n){let i=e.tolist();r||=Hl(e);let o=r.tolist(),s=Array.from({length:3},()=>Array.from({length:e.dims[0]},()=>Array.from({length:e.dims[1]},()=>0))),c=t?t.tolist():[],l=n?n.tolist():[],u={image_index:0,video_index:0},d=[];for(let e=0;eo[e][n]==1),n=this._get_multimodal_rope_positions({filtered_ids:t,image_grid_thw_list:c,video_grid_thw_list:l,spatial_merge_size:a,state:u}),r=this._reorder_and_write_positions(n,o[e],s,e);d.push(kc(r)[0]+1-i[e].length)}return[new G(`int64`,s.flat(1/0),[3,e.dims[0],e.dims[1]]),new G(`int64`,d,[d.length,1])]}else return this._get_text_only_rope_index(e,r)}async encode_image({pixel_values:e,image_grid_thw:t}){return(await ah(this.sessions.vision_encoder,{pixel_values:e,[this.image_grid_thw_name]:t})).image_features}_merge_input_ids_with_image_features(e){return _g({image_token_id:this.config.image_token_id,...e})}prepare_inputs_for_generation(e,t,n){if(!t.attention_mask||t.position_ids||!(this.sessions.decoder_model_merged??this.sessions.model).inputNames.includes(`position_ids`))return t;if(!t.past_key_values)[t.position_ids,t.rope_deltas]=this.get_rope_index(t.input_ids,t.image_grid_thw,t.video_grid_thw,t.attention_mask);else{t.pixel_values=null;let e=t.past_key_values.get_seq_length();if(en+e);t.position_ids=Nl([r,r,r],0)}}return t}},Cb=class extends Sb{},wb=class extends Sb{image_grid_thw_name=`image_grid_thw`},Tb=class extends Cb{image_grid_thw_name=`image_grid_thw`},Eb=class extends wb{get_vision_position_ids(e,t,n,r){let i=Math.floor(t[0]/n),a=Math.floor(t[1]/r),o=Math.floor(t[2]/r),s=a*o*i,c=Array.from({length:s},()=>e),l=Array.from({length:s},(t,n)=>e+Math.floor(n/(o*i))),u=Array.from({length:s},(t,n)=>e+n%o);return[...c,...l,...u]}_get_multimodal_rope_positions({filtered_ids:e,image_grid_thw_list:t,video_grid_thw_list:n,spatial_merge_size:r,state:i}){let{image_token_id:a}=this.config,o=[],s=0,c=+(e[0]==a);for(let t=1;t<=e.length;++t){let n=tl+n%e)),l+=e}else{let e=t[i.image_index++].map(Number),n=e[0];u.push(this.get_vision_position_ids(l,e,n,r)),l+=Math.max(e[1],e[2])/r}return u}},Db=class extends q{},Ob=class extends Db{},kb=class extends Db{},Ab=class extends q{},jb=class extends Ab{},Mb=class extends Ab{},Nb=class extends q{},Pb=class extends Nb{},Fb=class extends Nb{},Ib=class extends q{},Lb=class extends Ib{},Rb=class extends Ib{},zb=class extends q{},Bb=class extends zb{},Vb=class extends zb{},Hb=class extends q{},Ub=class extends Hb{},Wb=class extends Hb{},Gb=class extends q{},Kb=class extends Gb{},qb=class extends Gb{},Jb=class extends q{},Yb=class extends Jb{},Xb=class extends Jb{},Zb=class extends q{},Qb=class extends Zb{},$b=class extends Zb{},ex=class extends q{forward_params=[`input_ids`,`attention_mask`,`position_ids`,`audio_values`,`past_key_values`]},tx=class extends ex{_merge_input_ids_with_audio_features(e){let t=e.audio_features.dims.at(-1),n=e.audio_features.view(-1,t);return vg({audio_token_id:this.config.ignore_index??this.config.audio_token_id??this.config.audio_token_index,...e,audio_features:n})}},nx=class extends tx{forward_params=[`input_ids`,`attention_mask`,`input_features`,`past_key_values`]},rx=class extends q{},ix=class extends rx{},ax=class extends q{},ox=class extends ax{},sx=class extends q{},cx=class extends sx{},lx=class extends sx{},ux=class extends q{},dx=class extends ux{},fx=class extends ux{async _call(e){return new ch(await super._call(e))}},px=class extends q{},mx=class extends px{},hx=class extends px{async _call(e){return new fh(await super._call(e))}},gx=class extends px{async _call(e){return new ch(await super._call(e))}},_x=class extends px{async _call(e){return new lh(await super._call(e))}},vx=class extends q{},yx=class extends px{},bx=class extends px{async _call(e){return new fh(await super._call(e))}},xx=class extends px{async _call(e){return new ch(await super._call(e))}},Sx=class extends q{},Cx=class extends Sx{},wx=class extends Sx{},Tx=class extends rb{forward_params=[`input_ids`,`attention_mask`,`pixel_values`,`pixel_attention_mask`,`position_ids`,`past_key_values`]},Ex=class extends q{},Dx=class extends Ex{},Ox=class extends Ex{async _call(e){return new ch(await super._call(e))}},kx=class extends q{},Ax=class extends kx{},jx=class extends kx{},Mx=class extends q{},Nx=class extends Mx{async forward(e){let t=!e.input_ids,n=!e.pixel_values;if(t&&n)throw Error("Either `input_ids` or `pixel_values` should be provided.");if(t&&(e.input_ids=Vl([e.pixel_values.dims[0],1])),n){let{image_size:t}=this.config.vision_config;e.pixel_values=zl([0,3,t,t],0)}let{text_embeddings:r,image_embeddings:i,l2norm_text_embeddings:a,l2norm_image_embeddings:o}=await super.forward(e),s={};return t||(s.text_embeddings=r,s.l2norm_text_embeddings=a),n||(s.image_embeddings=i,s.l2norm_image_embeddings=o),s}},Px=class extends Mx{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}},Fx=class extends Mx{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`vision_model`})}},Ix=class extends q{},Lx=class extends Ix{},Rx=class extends Ix{},zx=class extends rb{},Bx=class extends q{},Vx=class extends Bx{},Hx=class extends Bx{},Ux=class extends rb{forward_params=[`input_ids`,`attention_mask`,`pixel_values`,`pixel_attention_mask`,`spatial_shapes`,`position_ids`,`past_key_values`]},Wx=class extends q{},Gx=class extends Wx{},Kx=class extends Wx{},qx=class extends q{},Jx=class extends qx{},Yx=class extends q{},Xx=class extends Yx{},Zx=class extends Yx{},Qx=class extends q{},$x=class extends Qx{},eS=class extends Qx{},tS=class extends q{},nS=class extends tS{},rS=class extends tS{},iS=class extends q{},aS=class extends iS{},oS=class extends iS{},sS=class extends q{},cS=class extends sS{},lS=class extends sS{},uS=class extends sS{async _call(e){return new ch(await super._call(e))}},dS=class extends sS{},fS=class extends q{},pS=class extends fS{},mS=class extends q{},hS=class extends mS{},gS=class extends sh{constructor({char_logits:e,bpe_logits:t,wp_logits:n}){super(),this.char_logits=e,this.bpe_logits=t,this.wp_logits=n}get logits(){return[this.char_logits,this.bpe_logits,this.wp_logits]}},_S=class extends q{},vS=class extends _S{async _call(e){return new gS(await super._call(e))}},yS=class extends sh{constructor({audio_codes:e}){super(),this.audio_codes=e}},bS=class extends sh{constructor({audio_values:e}){super(),this.audio_values=e}},xS=class extends q{main_input_name=`input_values`;forward_params=[`input_values`]},SS=class extends xS{async encode(e){return new yS(await ah(this.sessions.encoder_model,e))}async decode(e){return new bS(await ah(this.sessions.decoder_model,e))}},CS=class extends xS{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}},wS=class extends xS{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}},TS=class extends q{},ES=class extends TS{},DS=class extends TS{},OS=class extends q{},kS=class extends OS{},AS=class extends OS{},jS=class extends q{},MS=class extends jS{},NS=class extends jS{async _call(e){return new uh(await super._call(e))}},PS=class extends jS{async _call(e){return new ch(await super._call(e))}},FS=class extends jS{async _call(e){return new dh(await super._call(e))}},IS=class extends q{},LS=class extends IS{},RS=class extends IS{},zS=class extends q{},BS=class extends zS{},VS=class extends zS{async _call(e){return new ch(await super._call(e))}},HS=class extends zS{},US=class extends q{},WS=class extends US{},GS=class extends US{async _call(e){return new ch(await super._call(e))}},KS=class extends US{},qS=class extends q{},JS=class extends qS{},YS=class extends qS{async _call(e){return new ch(await super._call(e))}},XS=class extends qS{},ZS=class extends q{},QS=class extends ZS{},$S=class extends ZS{async _call(e){return new ch(await super._call(e))}},eC=class extends ZS{},tC=class extends q{},nC=class extends tC{},rC=class extends tC{async _call(e){return new ch(await super._call(e))}},iC=class extends q{},aC=class extends iC{},oC=class extends iC{async _call(e){return new ch(await super._call(e))}},sC=class extends q{},cC=class extends sC{},lC=class extends sC{async _call(e){return new uh(await super._call(e))}},uC=class extends sC{async _call(e){return new ch(await super._call(e))}},dC=class extends sC{async _call(e){return new lh(await super._call(e))}},fC=class extends q{},pC=class extends fC{},mC=class extends fC{},hC=class extends q{requires_attention_mask=!1;main_input_name=`input_values`;forward_params=[`input_values`,`decoder_input_ids`,`past_key_values`]},gC=class extends hC{},_C=class extends hC{},vC=class extends q{},yC=class extends vC{},bC=class extends vC{async _call(e){return new uh(await super._call(e))}},xC=class extends vC{async _call(e){return new ch(await super._call(e))}},SC=class extends vC{async _call(e){return new lh(await super._call(e))}},CC=class extends vC{async _call(e){return new dh(await super._call(e))}},wC=class extends q{},TC=class extends wC{},EC=class extends wC{},DC=class extends q{},OC=class extends DC{},kC=class extends DC{},AC=class extends q{},jC=class extends AC{forward_params=[`input_ids`,`pixel_values`,`images_seq_mask`,`images_emb_mask`,`attention_mask`,`position_ids`,`past_key_values`];constructor(...e){super(...e),this._generation_mode=`text`}async forward(e){let t=this._generation_mode??`text`,n;if(t===`text`||!e.past_key_values){let t=this.sessions.prepare_inputs_embeds;n=await ah(t,Si(e,t.inputNames))}else{let t=this.sessions.gen_img_embeds;n=await ah(t,Si({image_ids:e.input_ids},t.inputNames))}let r={...e,...n},i=await sg(this,r),a=this.sessions[t===`text`?`lm_head`:`gen_head`];if(!a)throw Error(`Unable to find "${a}" generation head`);let o=await ah(a,Si(i,a.inputNames));return{...n,...i,...o}}prepare_inputs_for_generation(e,t,n){let r=!!t.past_key_values;return n.guidance_scale!==null&&n.guidance_scale>1&&(r?t.input_ids=Ml([t.input_ids,t.input_ids],0):(t.input_ids=Ml([t.input_ids,Bl(t.input_ids,BigInt(n.pad_token_id))],0),t.attention_mask=Ml([t.attention_mask,Bl(t.attention_mask,0n)],0))),(r||!t.pixel_values)&&(t.pixel_values=zl([0,0,3,384,384],1)),r&&(t.images_seq_mask=new G(`bool`,[,].fill(!0).fill(!1,0,1),[1,1]),t.images_emb_mask=new G(`bool`,[].fill(!1),[1,1,0])),t}async generate(e){return this._generation_mode=`text`,super.generate(e)}async generate_images(e){this._generation_mode=`image`;let t=(e.inputs??e[this.main_input_name]).dims[1],n=(await super.generate(e)).slice(null,[t,null]),r=this.sessions.image_decode,{decoded_image:i}=await ah(r,{generated_tokens:n}),a=i.add_(1).mul_(255/2).clamp_(0,255).to(`uint8`),o=[];for(let e of a){let t=pf.fromTensor(e);o.push(t)}return o}},MC=class extends q{},NC=class extends MC{},PC=class extends MC{},FC=class extends q{forward_params=[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`];_apply_and_filter_by_delay_pattern_mask(e){let[t,n]=e.dims,r=this.config.decoder.num_codebooks,i=n-r,a=0;for(let t=0;t0&&o<=i&&(e.data[a++]=e.data[t])}let o=Math.floor(t/r),s=a/(o*r);return new G(e.type,e.data.slice(0,a),[o,r,s])}prepare_inputs_for_generation(e,t,n){let r=BigInt(this.config.decoder.pad_token_id),i=structuredClone(e);for(let e=0;e=t&&(i[e][t]=r);return n.guidance_scale!==null&&n.guidance_scale>1&&(i=i.concat(i)),mg(this,i,t,n)}async generate(e){let t=await super.generate(e),n=this._apply_and_filter_by_delay_pattern_mask(t).unsqueeze_(0),{audio_values:r}=await ah(this.sessions.encodec_decode,{audio_codes:n});return r}},IC=class extends q{},LC=class extends IC{},RC=class extends IC{},zC=class extends q{},BC=class extends zC{},VC=class extends zC{},HC=class extends q{},UC=class extends HC{},WC=class extends HC{async _call(e){return new uh(await super._call(e))}},GC=class extends HC{async _call(e){return new ch(await super._call(e))}},KC=class extends HC{async _call(e){return new lh(await super._call(e))}},qC=class extends HC{async _call(e){return new dh(await super._call(e))}},JC=class extends q{},YC=class extends JC{},XC=class extends q{},ZC=class extends XC{},QC=class extends XC{},$C=class extends q{},ew=class extends $C{},tw=class extends $C{},nw=class extends q{},rw=class extends nw{},iw=class extends nw{},aw=class extends q{},ow=class extends aw{},sw=class extends aw{},cw=class extends q{},lw=class extends cw{},uw=class extends cw{async _call(e){return new ch(await super._call(e))}},dw=class extends q{},fw=class extends dw{},pw=class extends dw{},mw=class extends q{},hw=class extends mw{},gw=class extends mw{},_w=class extends q{},vw=class extends _w{},yw=class extends _w{},bw=class extends q{},xw=class extends bw{},Sw=class extends bw{},Cw=class extends rb{},ww=class extends q{},Tw=class extends ww{async _call(e){return new fh(await super._call(e))}},Ew=class extends q{},Dw=class extends Ew{},Ow=class extends Ew{},kw=class extends q{},Aw=class extends kw{},jw=class extends kw{},Mw=class extends q{},Nw=class extends Mw{},Pw=class extends Mw{},Fw=class extends q{},Iw=class extends Fw{},Lw=class extends Fw{},Rw=class extends q{forward_params=[`input_ids`,`inputs_embeds`,`attention_mask`,`position_ids`,`pixel_values`,`image_sizes`,`past_key_values`]},zw=class extends Rw{async forward({input_ids:e=null,attention_mask:t=null,pixel_values:n=null,image_sizes:r=null,position_ids:i=null,inputs_embeds:a=null,past_key_values:o=null,generation_config:s=null,logits_processor:c=null,...l}){if(!a){let t;if(n&&e.dims[1]!==1){if(!r)throw Error("`image_sizes` must be provided when `pixel_values` is provided.");({image_features:t}=await ah(this.sessions.vision_encoder,{pixel_values:n,image_sizes:r}))}else{let e=this.config.normalized_config.hidden_size;t=new G(`float32`,[],[0,e])}({inputs_embeds:a}=await ah(this.sessions.prepare_inputs_embeds,{input_ids:e,image_features:t}))}return await sg(this,{inputs_embeds:a,past_key_values:o,attention_mask:t,position_ids:i,generation_config:s,logits_processor:c},!1)}},Bw=class extends q{},Vw=class extends Bw{},Hw=class extends Bw{async _call(e){return new ch(await super._call(e))}},Uw=class extends q{},Ww=class extends Uw{},Gw=class extends Uw{async _call(e){return new lh(await super._call(e))}},Kw=class extends q{},qw=class extends Kw{},Jw=class extends Kw{},Yw=class extends q{},Xw=class extends Yw{},Zw=class extends Yw{},Qw=class extends q{},$w=class extends Qw{},eT=class extends Qw{},tT=class extends q{},nT=class extends tT{},rT=class extends tT{},iT=class extends q{},aT=class extends iT{},oT=class extends iT{},sT=class extends wb{},cT=class extends Tb{},lT=class extends sT{},uT=class extends cT{},dT=class extends sT{},fT=class extends dT{},pT=class extends dT{},mT=class extends fT{},hT=class extends q{},gT=class extends hT{},_T=class extends hT{async _call(e){return new ch(await super._call(e))}},vT=class extends q{},yT=class extends vT{},bT=class extends vT{async _call(e){return new xT(await super._call(e))}},xT=class extends sv{},ST=class extends q{},CT=class extends ST{},wT=class extends ST{async _call(e){return new uh(await super._call(e))}},TT=class extends ST{async _call(e){return new ch(await super._call(e))}},ET=class extends ST{async _call(e){return new lh(await super._call(e))}},DT=class extends ST{async _call(e){return new dh(await super._call(e))}},OT=class extends q{},kT=class extends OT{},AT=class extends OT{async _call(e){return new uh(await super._call(e))}},jT=class extends OT{async _call(e){return new ch(await super._call(e))}},MT=class extends OT{async _call(e){return new lh(await super._call(e))}},NT=class extends OT{async _call(e){return new dh(await super._call(e))}},PT=class extends q{},FT=class extends PT{},IT=class extends PT{async _call(e){return new LT(await super._call(e))}},LT=class extends sv{},RT=class extends sh{constructor({iou_scores:e,pred_masks:t}){super(),this.iou_scores=e,this.pred_masks=t}},zT=class extends q{},BT=class extends zT{async get_image_embeddings({pixel_values:e}){return await tg(this,{pixel_values:e})}async forward(e){e=!e.image_embeddings||!e.image_positional_embeddings?{...e,...await this.get_image_embeddings(e)}:{...e},e.input_labels??=Vl(e.input_points.dims.slice(0,-1));let t={image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings};return e.input_points&&(t.input_points=e.input_points),e.input_labels&&(t.input_labels=e.input_labels),e.input_boxes&&(t.input_boxes=e.input_boxes),await ah(this.sessions.prompt_encoder_mask_decoder,t)}async _call(e){return new RT(await super._call(e))}},VT=class extends sh{constructor({iou_scores:e,pred_masks:t,object_score_logits:n}){super(),this.iou_scores=e,this.pred_masks=t,this.object_score_logits=n}},HT=class extends q{},UT=class extends HT{async get_image_embeddings({pixel_values:e}){return await tg(this,{pixel_values:e})}async forward(e){let{num_feature_levels:t}=this.config.vision_config;if(e=Array.from({length:t},(e,t)=>`image_embeddings.${t}`).some(t=>!e[t])?{...e,...await this.get_image_embeddings(e)}:{...e},e.input_points){if(e.input_boxes&&e.input_boxes.dims[1]!==1)throw Error("When both `input_points` and `input_boxes` are provided, the number of boxes per image must be 1.");let t=e.input_points.dims;e.input_labels??=Vl(t.slice(0,-1)),e.input_boxes??=zl([t[0],0,4],0)}else if(e.input_boxes){let t=e.input_boxes.dims;e.input_labels=zl([t[0],t[1],0],-1n),e.input_points=zl([t[0],1,0,2],0)}else throw Error("At least one of `input_points` or `input_boxes` must be provided.");let n=this.sessions.prompt_encoder_mask_decoder;return await ah(n,Si(e,n.inputNames))}async _call(e){return new VT(await super._call(e))}},WT=class extends UT{},GT=class extends UT{},KT=class extends q{},qT=class extends KT{},JT=class extends KT{},YT=class extends KT{},XT=class extends q{},ZT=class extends XT{},QT=class extends XT{},$T=class extends XT{},eE=class extends q{},tE=class extends eE{},nE=class extends eE{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`text_model`})}},rE=class extends w_{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`vision_model`})}},iE=class extends q{},aE=class extends iE{},oE=class extends iE{},sE=class extends Tx{},cE=class extends q{main_input_name=`input_values`;forward_params=[`input_values`]},lE=class extends cE{async encode(e){return await ah(this.sessions.encoder_model,e)}async decode(e){return await ah(this.sessions.decoder_model,e)}},uE=class extends cE{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}},dE=class extends cE{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}},fE=class extends q{},pE=class extends fE{},mE=class extends fE{},hE=class extends q{},gE=class extends hE{},_E=class extends hE{},vE=class extends hE{async generate_speech(e,t,{threshold:n=.5,minlenratio:r=0,maxlenratio:i=20,vocoder:a=null}={}){let o={input_ids:e},{encoder_outputs:s,encoder_attention_mask:c}=await tg(this,o),l=s.dims[1]/this.config.reduction_factor,u=Math.floor(l*i),d=Math.floor(l*r),f=this.config.num_mel_bins,p=[],m=null,h=null,g=0;for(;;){++g;let e=Jh(!!h),r;r=h?h.output_sequence_out:new G(`float32`,new Float32Array(f),[1,1,f]);let i={use_cache_branch:e,output_sequence:r,encoder_attention_mask:c,speaker_embeddings:t,encoder_hidden_states:s};og(this,i,m),h=await ah(this.sessions.decoder_model_merged,i),m=rg(h,m);let{prob:a,spectrum:o}=h;if(p.push(o),g>=d&&(Array.from(a.data).filter(e=>e>=n).length>0||g>=u))break}let _=Ml(p),{waveform:v}=await ah(a.sessions.model,{spectrogram:_});return{spectrogram:_,waveform:v}}},yE=class extends q{main_input_name=`spectrogram`},bE=class extends q{},xE=class extends bE{},SE=class extends bE{async _call(e){return new uh(await super._call(e))}},CE=class extends bE{async _call(e){return new ch(await super._call(e))}},wE=class extends bE{async _call(e){return new dh(await super._call(e))}},TE=class extends q{},EE=class extends TE{},DE=class extends TE{},OE=class extends q{},kE=class extends OE{},AE=class extends OE{},jE=class extends q{},ME=class extends jE{},NE=class extends q{},PE=class extends NE{async generate_speech({input_ids:e,attention_mask:t,style:n,num_inference_steps:r=5,speed:i=1.05}){let{sampling_rate:a,chunk_compress_factor:o,base_chunk_size:s,latent_dim:c}=this.config,{last_hidden_state:l,durations:u}=await ah(this.sessions.text_encoder,{input_ids:e,attention_mask:t,style:n}),d=u.div(i).mul_(a),f=s*o,p=d.data,m=Int32Array.from(p,e=>Math.ceil(e/f)),h=Math.max(...m),g=e.dims[0],_=new BigInt64Array(g*h);for(let e=0;ee*t,1),r=yl[e.type];c[e.name]=new G(e.type,new r(n),t)}let f=yl[d],p=new G(d,new f(s*ED),[1,s,ED]),m=t[Symbol.asyncIterator]?.()??t[Symbol.iterator]?.();if(!m)throw Error(`input_features must be iterable or async iterable`);return{encoder_session:i,enc_kv_cache:c,enc_padding_cache:p,enc_past_seq_len:0,audio_embed_queue:[],audio_embed_total_tokens:0,audio_queue_offset:0,audio_consumed:0,stream_exhausted:!1,chunks_iter:m,text_hidden_size:n.hidden_size}}async function AD(e,t){let n=t.dims[2],r=Math.floor((DD+n-3)/2)+1,i=new G(`int64`,BigInt64Array.from({length:r},(t,n)=>BigInt(e.enc_past_seq_len+n)),[1,r]),a=e.enc_past_seq_len+r,o=Vl([1,a]),{audio_embeds:s,present_padding_cache:c,...l}=await ah(e.encoder_session,{input_features:t,attention_mask:o,position_ids:i,past_padding_cache:e.enc_padding_cache,...e.enc_kv_cache});e.enc_padding_cache.location===`gpu-buffer`&&e.enc_padding_cache.dispose(),e.enc_padding_cache=c;for(let t in l)if(t.startsWith(`present.`)){let n=t.replace(`present`,`past_key_values`),r=e.enc_kv_cache[n];r?.location===`gpu-buffer`&&r.dispose(),e.enc_kv_cache[n]=l[t]}return e.enc_past_seq_len=a,s}async function jD(e,t){for(;e.audio_embed_total_tokens0&&e.audio_embed_queue.length>0;){let t=e.audio_embed_queue[0],n=t.tokens-e.audio_queue_offset,o=Math.min(a,n),s=e.audio_queue_offset*e.text_hidden_size;for(let n=0;n=t.tokens&&(e.audio_embed_queue.shift(),e.audio_queue_offset=0)}e.audio_consumed+=n-a}var ND=class extends Ah{constructor(e){super(),this._s=e}_call(e){let t=this._s.stream_exhausted&&this._s.audio_embed_queue.length===0;return e.map(()=>t)}},PD=class extends q{forward_params=[`input_ids`,`attention_mask`,`position_ids`,`past_key_values`]},FD=class extends PD{async forward({input_ids:e,past_key_values:t,...n}){let r=e.dims[1],i=OD.get(this);i&&await jD(i,i.audio_consumed+r);let{inputs_embeds:a}=await ah(this.sessions.embed_tokens,{input_ids:e});i&&MD(i,a,r);let o={inputs_embeds:a,...n};og(this,o,t);let s=this.sessions.decoder_model_merged;return await ah(s,Si(o,s.inputNames))}async generate({input_features:e,stopping_criteria:t,...n}){if(!e)throw Error(`input_features (generator/iterable) must be provided`);let r=kD(this,e);OD.set(this,r);let i=new jh;i.push(new ND(r)),t&&i.extend(t);try{return await super.generate({...n,stopping_criteria:i})}finally{r.enc_kv_cache.dispose(),OD.delete(this)}}},ID=class extends q{},LD=class extends ID{},RD=class extends ID{async _call(e){return new fh(await super._call(e))}},zD=class extends ID{async _call(e){return new ch(await super._call(e))}},BD=class extends sh{constructor({logits:e,embeddings:t}){super(),this.logits=e,this.embeddings=t}},VD=class extends q{},HD=class extends VD{},UD=class extends VD{async _call(e){return new fh(await super._call(e))}},WD=class extends VD{async _call(e){return new ch(await super._call(e))}},GD=class extends VD{async _call(e){return new BD(await super._call(e))}},KD=class extends VD{async _call(e){return new lh(await super._call(e))}},qD=class extends q{},JD=class extends qD{},YD=class extends kh{return_timestamps=null;return_token_timestamps=null;num_frames=null;alignment_heads=null;task=null;language=null;no_timestamps_token_id=null;prompt_ids=null;is_multilingual=null;lang_to_id=null;task_to_id=null;max_initial_timestamp_index=1},XD=class extends q{requires_attention_mask=!1;main_input_name=`input_features`;forward_params=[`input_features`,`attention_mask`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`]},ZD=class extends XD{},QD=class extends XD{_prepare_generation_config(e,t){return super._prepare_generation_config(e,t,YD)}_retrieve_init_tokens(e){let t=[e.decoder_start_token_id],n=e.language,r=e.task;if(e.is_multilingual){n||=(wi.warn(`No language specified - defaulting to English (en).`),`en`);let i=`<|${Xu(n)}|>`;t.push(e.lang_to_id[i]),t.push(e.task_to_id[r??`transcribe`])}else if(n||r)throw Error("Cannot specify `task` or `language` for an English-only model. If the model is intended to be multilingual, pass `is_multilingual=true` to generate, or update the generation config.");return!e.return_timestamps&&e.no_timestamps_token_id&&t.at(-1)!==e.no_timestamps_token_id?t.push(e.no_timestamps_token_id):e.return_timestamps&&t.at(-1)===e.no_timestamps_token_id&&(wi.warn("<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`."),t.pop()),t.filter(e=>e!=null)}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,...i}){t=this._prepare_generation_config(t,i);let a=i.decoder_input_ids instanceof G?Yl(i.decoder_input_ids):i.decoder_input_ids??this._retrieve_init_tokens(t);if(t.return_timestamps&&(n??=new gh,n.push(new xh(t,a))),t.begin_suppress_tokens&&(n??=new gh,n.push(new bh(t.begin_suppress_tokens,a.length))),t.return_token_timestamps){if(!t.alignment_heads)throw Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");t.task===`translate`&&wi.warn(`Token-level timestamps may not be reliable for task 'translate'.`),t.output_attentions=!0,t.return_dict_in_generate=!0}if(t.return_timestamps&&!i.max_new_tokens)return this._generate_with_seek({inputs:e,generation_config:t,logits_processor:n,init_tokens:a,kwargs:i});let o=await super.generate({inputs:e,generation_config:t,logits_processor:n,decoder_input_ids:a,...i});return t.return_token_timestamps&&(o.token_timestamps=this._extract_token_timestamps(o,t.alignment_heads,t.num_frames,.02,a.length)),o}async _generate_with_seek({inputs:e,generation_config:t,logits_processor:n,init_tokens:r,kwargs:i}){let a=t.no_timestamps_token_id+1,o=Array.isArray(t.eos_token_id)?t.eos_token_id[0]:t.eos_token_id,s=t.return_token_timestamps,c=e,l=c.dims[2],u=2*this.config.max_source_positions,d=0,f=[],p=[];for(;de+n)}if(v.length>0&&v.at(-1)===o&&v.pop(),v.length===0)break;let b=v.map(e=>e>=a),x=v.length>=2&&b[v.length-1]&&!b[v.length-2],S=[];for(let e=0;e0)if(x)C=e-d;else{let e=S.at(-1);C=(v[e-1]-a)*2,w=e}else C=e-d;let T=Math.floor(d/2),E=a+1500;for(let e=0;e=a&&(v[e]=Math.min(v[e]+T,E));f.push(...v.slice(0,w)),y&&p.push(...y.slice(0,w)),d+=C}f.push(o);let m=[...r,...f];if(s){let e=new G(`int64`,m.map(BigInt),[1,m.length]),t=[...Array(r.length).fill(0),...p,0];return{sequences:e,token_timestamps:new G(`float32`,new Float32Array(t),[1,t.length])}}return new G(`int64`,m.map(BigInt),[1,m.length])}_extract_token_timestamps(e,t,n=null,r=.02,i=0){if(!e.cross_attentions)throw Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");n??wi.warn("`num_frames` has not been set, meaning the entire audio will be analyzed. This may lead to inaccurate token-level timestamps for short audios (< 30 seconds).");let a=this.config.median_filter_width;a===void 0&&(wi.warn("Model config has no `median_filter_width`, using default value of 7."),a=7);let o=e.cross_attentions,s=Array.from({length:this.config.decoder_layers},(e,t)=>Ml(o.map(e=>e[t]),2)),c=Nl(t.map(([e,t])=>{if(e>=s.length)throw Error(`Layer index ${e} is out of bounds for cross attentions (length ${s.length}).`);return n?s[e].slice(null,t,null,[0,n]):s[e].slice(null,t)})).transpose(1,0,2,3),[l,u]=Fl(c,-2,0,!0),d=c.clone();for(let e=0;e0?d.slice(null,null,[i,d.dims[2]],null):d,1)],p=e.sequences.dims,m=new G(`float32`,new Float32Array(p[0]*p[1]),p);for(let e=0;et[n+1]-t[n])).map(e=>!!e),o=[];for(let e=0;e0&&s.push(o.at(-1)),m[e].data.set(s)}return m}},$D=class extends QD{},eO=class extends q{},tO=class extends eO{},nO=class extends eO{async _call(e){return new uh(await super._call(e))}},rO=class extends eO{async _call(e){return new ch(await super._call(e))}},iO=class extends eO{async _call(e){return new lh(await super._call(e))}},aO=class extends eO{async _call(e){return new dh(await super._call(e))}},oO=class extends q{},sO=class extends oO{},cO=class extends oO{async _call(e){return new uh(await super._call(e))}},lO=class extends oO{async _call(e){return new ch(await super._call(e))}},uO=class extends oO{async _call(e){return new lh(await super._call(e))}},dO=class extends oO{async _call(e){return new dh(await super._call(e))}},fO=class extends q{},pO=class extends fO{},mO=class extends fO{async _call(e){return new hO(await super._call(e))}},hO=class extends sh{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}},gO=class extends q{},_O=class extends gO{},vO=class extends gO{},yO=new Map([[`bert`,`BertModel`],[`eurobert`,`EuroBertModel`],[`neobert`,`NeoBertModel`],[`modernbert`,`ModernBertModel`],[`nomic_bert`,`NomicBertModel`],[`roformer`,`RoFormerModel`],[`electra`,`ElectraModel`],[`esm`,`EsmModel`],[`convbert`,`ConvBertModel`],[`camembert`,`CamembertModel`],[`deberta`,`DebertaModel`],[`deberta-v2`,`DebertaV2Model`],[`mpnet`,`MPNetModel`],[`albert`,`AlbertModel`],[`distilbert`,`DistilBertModel`],[`roberta`,`RobertaModel`],[`xlm`,`XLMModel`],[`xlm-roberta`,`XLMRobertaModel`],[`clap`,`ClapModel`],[`clip`,`CLIPModel`],[`clipseg`,`CLIPSegModel`],[`chinese_clip`,`ChineseCLIPModel`],[`siglip`,`SiglipModel`],[`jina_clip`,`JinaCLIPModel`],[`mobilebert`,`MobileBertModel`],[`squeezebert`,`SqueezeBertModel`],[`wav2vec2`,`Wav2Vec2Model`],[`wav2vec2-bert`,`Wav2Vec2BertModel`],[`unispeech`,`UniSpeechModel`],[`unispeech-sat`,`UniSpeechSatModel`],[`hubert`,`HubertModel`],[`wavlm`,`WavLMModel`],[`audio-spectrogram-transformer`,`ASTModel`],[`vits`,`VitsModel`],[`pyannote`,`PyAnnoteModel`],[`wespeaker-resnet`,`WeSpeakerResNetModel`],[`detr`,`DetrModel`],[`rt_detr`,`RTDetrModel`],[`rt_detr_v2`,`RTDetrV2Model`],[`rf_detr`,`RFDetrModel`],[`d_fine`,`DFineModel`],[`table-transformer`,`TableTransformerModel`],[`vit`,`ViTModel`],[`ijepa`,`IJepaModel`],[`pvt`,`PvtModel`],[`vit_msn`,`ViTMSNModel`],[`vit_mae`,`ViTMAEModel`],[`groupvit`,`GroupViTModel`],[`fastvit`,`FastViTModel`],[`mobilevit`,`MobileViTModel`],[`mobilevitv2`,`MobileViTV2Model`],[`owlvit`,`OwlViTModel`],[`owlv2`,`Owlv2Model`],[`beit`,`BeitModel`],[`deit`,`DeiTModel`],[`hiera`,`HieraModel`],[`convnext`,`ConvNextModel`],[`convnextv2`,`ConvNextV2Model`],[`dinov2`,`Dinov2Model`],[`dinov2_with_registers`,`Dinov2WithRegistersModel`],[`dinov3_vit`,`DINOv3ViTModel`],[`dinov3_convnext`,`DINOv3ConvNextModel`],[`resnet`,`ResNetModel`],[`swin`,`SwinModel`],[`swin2sr`,`Swin2SRModel`],[`donut-swin`,`DonutSwinModel`],[`yolos`,`YolosModel`],[`dpt`,`DPTModel`],[`glpn`,`GLPNModel`],[`hifigan`,`SpeechT5HifiGan`],[`efficientnet`,`EfficientNetModel`],[`decision_transformer`,`DecisionTransformerModel`],[`patchtst`,`PatchTSTModel`],[`patchtsmixer`,`PatchTSMixerModel`],[`mobilenet_v1`,`MobileNetV1Model`],[`mobilenet_v2`,`MobileNetV2Model`],[`mobilenet_v3`,`MobileNetV3Model`],[`mobilenet_v4`,`MobileNetV4Model`],[`maskformer`,`MaskFormerModel`],[`mgp-str`,`MgpstrForSceneTextRecognition`],[`style_text_to_speech_2`,`StyleTextToSpeech2Model`],[`openai_privacy_filter`,`OpenAIPrivacyFilterModel`]]),bO=new Map([[`t5`,`T5Model`],[`longt5`,`LongT5Model`],[`mt5`,`MT5Model`],[`bart`,`BartModel`],[`mbart`,`MBartModel`],[`marian`,`MarianModel`],[`whisper`,`WhisperModel`],[`cohere_asr`,`CohereAsrModel`],[`m2m_100`,`M2M100Model`],[`blenderbot`,`BlenderbotModel`],[`blenderbot-small`,`BlenderbotSmallModel`]]),xO=new Map([[`mimi`,`MimiModel`],[`dac`,`DacModel`],[`snac`,`SnacModel`]]),SO=new Map([[`bloom`,`BloomModel`],[`jais`,`JAISModel`],[`gpt2`,`GPT2Model`],[`gpt_oss`,`GptOssModel`],[`gptj`,`GPTJModel`],[`gpt_bigcode`,`GPTBigCodeModel`],[`gpt_neo`,`GPTNeoModel`],[`gpt_neox`,`GPTNeoXModel`],[`codegen`,`CodeGenModel`],[`llama`,`LlamaModel`],[`apertus`,`ApertusModel`],[`nanochat`,`NanoChatModel`],[`arcee`,`ArceeModel`],[`afmoe`,`AfmoeModel`],[`lfm2`,`Lfm2Model`],[`lfm2_moe`,`Lfm2MoeModel`],[`smollm3`,`SmolLM3Model`],[`exaone`,`ExaoneModel`],[`olmo`,`OlmoModel`],[`olmo2`,`Olmo2Model`],[`olmo3`,`Olmo3Model`],[`olmo_hybrid`,`OlmoHybridModel`],[`mobilellm`,`MobileLLMModel`],[`granite`,`GraniteModel`],[`granitemoehybrid`,`GraniteMoeHybridModel`],[`cohere`,`CohereModel`],[`cohere2`,`Cohere2Model`],[`gemma`,`GemmaModel`],[`gemma2`,`Gemma2Model`],[`vaultgemma`,`VaultGemmaModel`],[`gemma3_text`,`Gemma3Model`],[`helium`,`HeliumModel`],[`glm`,`GlmModel`],[`glm_moe_dsa`,`GlmMoeDsaModel`],[`openelm`,`OpenELMModel`],[`qwen2`,`Qwen2Model`],[`qwen2_moe`,`Qwen2MoeModel`],[`qwen3`,`Qwen3Model`],[`qwen3_moe`,`Qwen3MoeModel`],[`qwen3_next`,`Qwen3NextModel`],[`phi`,`PhiModel`],[`phi3`,`Phi3Model`],[`mpt`,`MptModel`],[`opt`,`OPTModel`],[`mistral`,`MistralModel`],[`mistral4`,`Mistral4Model`],[`ministral`,`MinistralModel`],[`ministral3`,`Ministral3Model`],[`ernie4_5`,`Ernie4_5ForCausalLM`],[`starcoder2`,`Starcoder2Model`],[`deepseek_v3`,`DeepseekV3Model`],[`falcon`,`FalconModel`],[`falcon_h1`,`FalconH1Model`],[`nemotron_h`,`NemotronHModel`],[`solar_open`,`SolarOpenModel`],[`stablelm`,`StableLmModel`],[`modernbert-decoder`,`ModernBertDecoderModel`],[`hunyuan_v1_dense`,`HunYuanDenseV1Model`],[`youtu`,`YoutuModel`]]),CO=new Map([[`speecht5`,`SpeechT5ForSpeechToText`],[`whisper`,`WhisperForConditionalGeneration`],[`lite-whisper`,`LiteWhisperForConditionalGeneration`],[`moonshine`,`MoonshineForConditionalGeneration`],[`cohere_asr`,`CohereAsrForConditionalGeneration`]]),wO=new Map([[`speecht5`,`SpeechT5ForTextToSpeech`]]),TO=new Map([[`vits`,`VitsModel`],[`musicgen`,`MusicgenForConditionalGeneration`],[`supertonic`,`SupertonicForConditionalGeneration`]]),EO=new Map([[`bert`,`BertForSequenceClassification`],[`eurobert`,`EuroBertForSequenceClassification`],[`neobert`,`NeoBertForSequenceClassification`],[`modernbert`,`ModernBertForSequenceClassification`],[`roformer`,`RoFormerForSequenceClassification`],[`electra`,`ElectraForSequenceClassification`],[`esm`,`EsmForSequenceClassification`],[`convbert`,`ConvBertForSequenceClassification`],[`camembert`,`CamembertForSequenceClassification`],[`deberta`,`DebertaForSequenceClassification`],[`deberta-v2`,`DebertaV2ForSequenceClassification`],[`mpnet`,`MPNetForSequenceClassification`],[`albert`,`AlbertForSequenceClassification`],[`distilbert`,`DistilBertForSequenceClassification`],[`roberta`,`RobertaForSequenceClassification`],[`xlm`,`XLMForSequenceClassification`],[`xlm-roberta`,`XLMRobertaForSequenceClassification`],[`bart`,`BartForSequenceClassification`],[`mbart`,`MBartForSequenceClassification`],[`mobilebert`,`MobileBertForSequenceClassification`],[`squeezebert`,`SqueezeBertForSequenceClassification`]]),DO=new Map([[`bert`,`BertForTokenClassification`],[`eurobert`,`EuroBertForTokenClassification`],[`neobert`,`NeoBertForTokenClassification`],[`modernbert`,`ModernBertForTokenClassification`],[`roformer`,`RoFormerForTokenClassification`],[`electra`,`ElectraForTokenClassification`],[`esm`,`EsmForTokenClassification`],[`convbert`,`ConvBertForTokenClassification`],[`camembert`,`CamembertForTokenClassification`],[`deberta`,`DebertaForTokenClassification`],[`deberta-v2`,`DebertaV2ForTokenClassification`],[`mpnet`,`MPNetForTokenClassification`],[`distilbert`,`DistilBertForTokenClassification`],[`roberta`,`RobertaForTokenClassification`],[`xlm`,`XLMForTokenClassification`],[`xlm-roberta`,`XLMRobertaForTokenClassification`],[`openai_privacy_filter`,`OpenAIPrivacyFilterForTokenClassification`]]),OO=new Map([[`t5`,`T5ForConditionalGeneration`],[`longt5`,`LongT5ForConditionalGeneration`],[`mt5`,`MT5ForConditionalGeneration`],[`bart`,`BartForConditionalGeneration`],[`mbart`,`MBartForConditionalGeneration`],[`marian`,`MarianMTModel`],[`m2m_100`,`M2M100ForConditionalGeneration`],[`blenderbot`,`BlenderbotForConditionalGeneration`],[`blenderbot-small`,`BlenderbotSmallForConditionalGeneration`]]),kO=new Map([[`bloom`,`BloomForCausalLM`],[`gpt2`,`GPT2LMHeadModel`],[`gpt_oss`,`GptOssForCausalLM`],[`jais`,`JAISLMHeadModel`],[`gptj`,`GPTJForCausalLM`],[`gpt_bigcode`,`GPTBigCodeForCausalLM`],[`gpt_neo`,`GPTNeoForCausalLM`],[`gpt_neox`,`GPTNeoXForCausalLM`],[`codegen`,`CodeGenForCausalLM`],[`llama`,`LlamaForCausalLM`],[`nanochat`,`NanoChatForCausalLM`],[`apertus`,`ApertusForCausalLM`],[`llama4_text`,`Llama4ForCausalLM`],[`arcee`,`ArceeForCausalLM`],[`afmoe`,`AfmoeForCausalLM`],[`lfm2`,`Lfm2ForCausalLM`],[`lfm2_moe`,`Lfm2MoeForCausalLM`],[`smollm3`,`SmolLM3ForCausalLM`],[`exaone`,`ExaoneForCausalLM`],[`olmo`,`OlmoForCausalLM`],[`olmo2`,`Olmo2ForCausalLM`],[`olmo3`,`Olmo3ForCausalLM`],[`olmo_hybrid`,`OlmoHybridForCausalLM`],[`mobilellm`,`MobileLLMForCausalLM`],[`granite`,`GraniteForCausalLM`],[`granitemoehybrid`,`GraniteMoeHybridForCausalLM`],[`cohere`,`CohereForCausalLM`],[`cohere2`,`Cohere2ForCausalLM`],[`gemma`,`GemmaForCausalLM`],[`gemma2`,`Gemma2ForCausalLM`],[`vaultgemma`,`VaultGemmaForCausalLM`],[`gemma3_text`,`Gemma3ForCausalLM`],[`gemma3`,`Gemma3ForCausalLM`],[`helium`,`HeliumForCausalLM`],[`glm`,`GlmForCausalLM`],[`glm_moe_dsa`,`GlmMoeDsaForCausalLM`],[`openelm`,`OpenELMForCausalLM`],[`qwen2`,`Qwen2ForCausalLM`],[`qwen2_moe`,`Qwen2MoeForCausalLM`],[`qwen3`,`Qwen3ForCausalLM`],[`qwen3_moe`,`Qwen3MoeForCausalLM`],[`qwen3_next`,`Qwen3NextForCausalLM`],[`qwen2_vl`,`Qwen2VLForCausalLM`],[`qwen2_5_vl`,`Qwen2_5_VLForCausalLM`],[`qwen3_vl`,`Qwen3VLForCausalLM`],[`qwen3_vl_moe`,`Qwen3VLMoeForCausalLM`],[`qwen3_5`,`Qwen3_5ForCausalLM`],[`qwen3_5_text`,`Qwen3_5ForCausalLM`],[`qwen3_5_moe`,`Qwen3_5MoeForCausalLM`],[`gemma3n`,`Gemma3nForCausalLM`],[`gemma4`,`Gemma4ForCausalLM`],[`phi`,`PhiForCausalLM`],[`phi3`,`Phi3ForCausalLM`],[`mpt`,`MptForCausalLM`],[`opt`,`OPTForCausalLM`],[`mbart`,`MBartForCausalLM`],[`mistral`,`MistralForCausalLM`],[`mistral4`,`Mistral4ForCausalLM`],[`ministral`,`MinistralForCausalLM`],[`ministral3`,`Ministral3ForCausalLM`],[`ernie4_5`,`Ernie4_5ForCausalLM`],[`starcoder2`,`Starcoder2ForCausalLM`],[`deepseek_v3`,`DeepseekV3ForCausalLM`],[`falcon`,`FalconForCausalLM`],[`falcon_h1`,`FalconH1ForCausalLM`],[`nemotron_h`,`NemotronHForCausalLM`],[`trocr`,`TrOCRForCausalLM`],[`solar_open`,`SolarOpenForCausalLM`],[`stablelm`,`StableLmForCausalLM`],[`modernbert-decoder`,`ModernBertDecoderForCausalLM`],[`hunyuan_v1_dense`,`HunYuanDenseV1ForCausalLM`],[`youtu`,`YoutuForCausalLM`],[`phi3_v`,`Phi3VForCausalLM`]]),AO=new Map([[`multi_modality`,`MultiModalityCausalLM`]]),jO=new Map([[`bert`,`BertForMaskedLM`],[`eurobert`,`EuroBertForMaskedLM`],[`neobert`,`NeoBertForMaskedLM`],[`modernbert`,`ModernBertForMaskedLM`],[`roformer`,`RoFormerForMaskedLM`],[`electra`,`ElectraForMaskedLM`],[`esm`,`EsmForMaskedLM`],[`convbert`,`ConvBertForMaskedLM`],[`camembert`,`CamembertForMaskedLM`],[`deberta`,`DebertaForMaskedLM`],[`deberta-v2`,`DebertaV2ForMaskedLM`],[`mpnet`,`MPNetForMaskedLM`],[`albert`,`AlbertForMaskedLM`],[`distilbert`,`DistilBertForMaskedLM`],[`roberta`,`RobertaForMaskedLM`],[`xlm`,`XLMWithLMHeadModel`],[`xlm-roberta`,`XLMRobertaForMaskedLM`],[`mobilebert`,`MobileBertForMaskedLM`],[`squeezebert`,`SqueezeBertForMaskedLM`]]),MO=new Map([[`bert`,`BertForQuestionAnswering`],[`neobert`,`NeoBertForQuestionAnswering`],[`roformer`,`RoFormerForQuestionAnswering`],[`electra`,`ElectraForQuestionAnswering`],[`convbert`,`ConvBertForQuestionAnswering`],[`camembert`,`CamembertForQuestionAnswering`],[`deberta`,`DebertaForQuestionAnswering`],[`deberta-v2`,`DebertaV2ForQuestionAnswering`],[`mpnet`,`MPNetForQuestionAnswering`],[`albert`,`AlbertForQuestionAnswering`],[`distilbert`,`DistilBertForQuestionAnswering`],[`roberta`,`RobertaForQuestionAnswering`],[`xlm`,`XLMForQuestionAnswering`],[`xlm-roberta`,`XLMRobertaForQuestionAnswering`],[`mobilebert`,`MobileBertForQuestionAnswering`],[`squeezebert`,`SqueezeBertForQuestionAnswering`]]),NO=new Map([[`vision-encoder-decoder`,`VisionEncoderDecoderModel`],[`idefics3`,`Idefics3ForConditionalGeneration`],[`smolvlm`,`SmolVLMForConditionalGeneration`]]),PO=new Map([[`llava`,`LlavaForConditionalGeneration`],[`llava_onevision`,`LlavaOnevisionForConditionalGeneration`],[`moondream1`,`Moondream1ForConditionalGeneration`],[`florence2`,`Florence2ForConditionalGeneration`],[`qwen2_vl`,`Qwen2VLForConditionalGeneration`],[`qwen2_5_vl`,`Qwen2_5_VLForConditionalGeneration`],[`qwen3_vl`,`Qwen3VLForConditionalGeneration`],[`qwen3_vl_moe`,`Qwen3VLMoeForConditionalGeneration`],[`qwen3_5`,`Qwen3_5ForConditionalGeneration`],[`qwen3_5_moe`,`Qwen3_5MoeForConditionalGeneration`],[`lfm2_vl`,`Lfm2VlForConditionalGeneration`],[`idefics3`,`Idefics3ForConditionalGeneration`],[`smolvlm`,`SmolVLMForConditionalGeneration`],[`paligemma`,`PaliGemmaForConditionalGeneration`],[`llava_qwen2`,`LlavaQwen2ForCausalLM`],[`gemma3`,`Gemma3ForConditionalGeneration`],[`gemma3n`,`Gemma3nForConditionalGeneration`],[`gemma4`,`Gemma4ForConditionalGeneration`],[`mistral3`,`Mistral3ForConditionalGeneration`],[`lighton_ocr`,`LightOnOcrForConditionalGeneration`],[`glm_ocr`,`GlmOcrForConditionalGeneration`]]),FO=new Map([[`granite_speech`,`GraniteSpeechForConditionalGeneration`],[`ultravox`,`UltravoxModel`],[`voxtral`,`VoxtralForConditionalGeneration`],[`voxtral_realtime`,`VoxtralRealtimeForConditionalGeneration`]]),IO=new Map([[`vision-encoder-decoder`,`VisionEncoderDecoderModel`]]),LO=new Map([[`vit`,`ViTForImageClassification`],[`ijepa`,`IJepaForImageClassification`],[`pvt`,`PvtForImageClassification`],[`vit_msn`,`ViTMSNForImageClassification`],[`fastvit`,`FastViTForImageClassification`],[`mobilevit`,`MobileViTForImageClassification`],[`mobilevitv2`,`MobileViTV2ForImageClassification`],[`beit`,`BeitForImageClassification`],[`deit`,`DeiTForImageClassification`],[`hiera`,`HieraForImageClassification`],[`convnext`,`ConvNextForImageClassification`],[`convnextv2`,`ConvNextV2ForImageClassification`],[`dinov2`,`Dinov2ForImageClassification`],[`dinov2_with_registers`,`Dinov2WithRegistersForImageClassification`],[`resnet`,`ResNetForImageClassification`],[`swin`,`SwinForImageClassification`],[`segformer`,`SegformerForImageClassification`],[`efficientnet`,`EfficientNetForImageClassification`],[`mobilenet_v1`,`MobileNetV1ForImageClassification`],[`mobilenet_v2`,`MobileNetV2ForImageClassification`],[`mobilenet_v3`,`MobileNetV3ForImageClassification`],[`mobilenet_v4`,`MobileNetV4ForImageClassification`]]),RO=new Map([[`detr`,`DetrForObjectDetection`],[`rt_detr`,`RTDetrForObjectDetection`],[`rt_detr_v2`,`RTDetrV2ForObjectDetection`],[`rf_detr`,`RFDetrForObjectDetection`],[`d_fine`,`DFineForObjectDetection`],[`table-transformer`,`TableTransformerForObjectDetection`],[`yolos`,`YolosForObjectDetection`]]),zO=new Map([[`owlvit`,`OwlViTForObjectDetection`],[`owlv2`,`Owlv2ForObjectDetection`],[`grounding-dino`,`GroundingDinoForObjectDetection`]]),BO=new Map([[`detr`,`DetrForSegmentation`],[`clipseg`,`CLIPSegForImageSegmentation`]]),VO=new Map([[`segformer`,`SegformerForSemanticSegmentation`],[`sapiens`,`SapiensForSemanticSegmentation`],[`swin`,`SwinForSemanticSegmentation`],[`mobilenet_v1`,`MobileNetV1ForSemanticSegmentation`],[`mobilenet_v2`,`MobileNetV2ForSemanticSegmentation`],[`mobilenet_v3`,`MobileNetV3ForSemanticSegmentation`],[`mobilenet_v4`,`MobileNetV4ForSemanticSegmentation`]]),HO=new Map([[`detr`,`DetrForSegmentation`],[`maskformer`,`MaskFormerForInstanceSegmentation`]]),UO=new Map([[`sam`,`SamModel`],[`sam2`,`Sam2Model`],[`edgetam`,`EdgeTamModel`],[`sam3_tracker`,`Sam3TrackerModel`]]),WO=new Map([[`wav2vec2`,`Wav2Vec2ForCTC`],[`wav2vec2-bert`,`Wav2Vec2BertForCTC`],[`unispeech`,`UniSpeechForCTC`],[`unispeech-sat`,`UniSpeechSatForCTC`],[`wavlm`,`WavLMForCTC`],[`hubert`,`HubertForCTC`],[`parakeet_ctc`,`ParakeetForCTC`]]),GO=new Map([[`wav2vec2`,`Wav2Vec2ForSequenceClassification`],[`wav2vec2-bert`,`Wav2Vec2BertForSequenceClassification`],[`unispeech`,`UniSpeechForSequenceClassification`],[`unispeech-sat`,`UniSpeechSatForSequenceClassification`],[`wavlm`,`WavLMForSequenceClassification`],[`hubert`,`HubertForSequenceClassification`],[`audio-spectrogram-transformer`,`ASTForAudioClassification`]]),KO=new Map([[`wavlm`,`WavLMForXVector`]]),qO=new Map([[`unispeech-sat`,`UniSpeechSatForAudioFrameClassification`],[`wavlm`,`WavLMForAudioFrameClassification`],[`wav2vec2`,`Wav2Vec2ForAudioFrameClassification`],[`pyannote`,`PyAnnoteForAudioFrameClassification`]]),JO=new Map([[`vitmatte`,`VitMatteForImageMatting`]]),YO=new Map([[`patchtst`,`PatchTSTForPrediction`],[`patchtsmixer`,`PatchTSMixerForPrediction`]]),XO=new Map([[`swin2sr`,`Swin2SRForImageSuperResolution`]]),ZO=new Map([[`chmv2`,`CHMv2ForDepthEstimation`],[`dpt`,`DPTForDepthEstimation`],[`depth_anything`,`DepthAnythingForDepthEstimation`],[`glpn`,`GLPNForDepthEstimation`],[`sapiens`,`SapiensForDepthEstimation`],[`depth_pro`,`DepthProForDepthEstimation`],[`metric3d`,`Metric3DForDepthEstimation`],[`metric3dv2`,`Metric3Dv2ForDepthEstimation`]]),QO=new Map([[`sapiens`,`SapiensForNormalEstimation`]]),$O=new Map([[`vitpose`,`VitPoseForPoseEstimation`]]),ek=new Map([[`clip`,`CLIPVisionModelWithProjection`],[`siglip`,`SiglipVisionModel`],[`jina_clip`,`JinaCLIPVisionModel`]]),tk=[[yO,K.EncoderOnly],[bO,K.EncoderDecoder],[SO,K.DecoderOnlyWithoutHead],[xO,K.AutoEncoder],[EO,K.EncoderOnly],[DO,K.EncoderOnly],[OO,K.Seq2Seq],[CO,K.Seq2Seq],[kO,K.DecoderOnly],[AO,K.MultiModality],[jO,K.EncoderOnly],[MO,K.EncoderOnly],[NO,K.Vision2Seq],[PO,K.ImageTextToText],[FO,K.AudioTextToText],[LO,K.EncoderOnly],[BO,K.EncoderOnly],[HO,K.EncoderOnly],[VO,K.EncoderOnly],[JO,K.EncoderOnly],[YO,K.EncoderOnly],[XO,K.EncoderOnly],[ZO,K.EncoderOnly],[QO,K.EncoderOnly],[$O,K.EncoderOnly],[RO,K.EncoderOnly],[zO,K.EncoderOnly],[UO,K.MaskGeneration],[WO,K.EncoderOnly],[GO,K.EncoderOnly],[wO,K.Seq2Seq],[TO,K.EncoderOnly],[KO,K.EncoderOnly],[qO,K.EncoderOnly],[ek,K.EncoderOnly]];for(let[e,t]of tk)for(let n of e.values()){Zh.set(n,t);let e=bg[n];$h.set(e,n),Qh.set(n,e)}var nk=[[`MusicgenForConditionalGeneration`,FC,K.Musicgen],[`Phi3VForCausalLM`,zw,K.Phi3V],[`CLIPTextModelWithProjection`,D_,K.EncoderOnly],[`SiglipTextModel`,nE,K.EncoderOnly],[`JinaCLIPTextModel`,Px,K.EncoderOnly],[`ClapTextModelWithProjection`,S_,K.EncoderOnly],[`ClapAudioModelWithProjection`,C_,K.EncoderOnly],[`DacEncoderModel`,hv,K.EncoderOnly],[`DacDecoderModel`,gv,K.EncoderOnly],[`MimiEncoderModel`,CS,K.EncoderOnly],[`MimiDecoderModel`,wS,K.EncoderOnly],[`SnacEncoderModel`,uE,K.EncoderOnly],[`SnacDecoderModel`,dE,K.EncoderOnly],[`Gemma3nForConditionalGeneration`,db,K.ImageAudioTextToText],[`Gemma4ForConditionalGeneration`,pb,K.ImageAudioTextToText],[`SupertonicForConditionalGeneration`,PE,K.Supertonic],[`ChatterboxModel`,h_,K.Chatterbox],[`VoxtralRealtimeForConditionalGeneration`,FD,K.VoxtralRealtime]];for(let[e,t,n]of nk)Zh.set(e,n),$h.set(t,e),Qh.set(e,t);var rk=new Map([[`modnet`,BO],[`birefnet`,BO],[`isnet`,BO],[`ben`,BO]]);for(let[e,t]of rk.entries())t.set(e,`PreTrainedModel`),Zh.set(e,K.EncoderOnly),Qh.set(e,q);var ik=new Set(rk.keys());Zh.set(`PreTrainedModel`,K.EncoderOnly),$h.set(q,`PreTrainedModel`);var ak={MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES:EO,MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES:DO,MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES:wO,MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES:TO,MODEL_FOR_MASKED_LM_MAPPING_NAMES:jO,MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES:MO,MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES:LO,MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES:BO,MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES:VO,MODEL_FOR_UNIVERSAL_SEGMENTATION_MAPPING_NAMES:HO,MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES:RO,MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES:zO,MODEL_FOR_MASK_GENERATION_MAPPING_NAMES:UO,MODEL_FOR_CTC_MAPPING_NAMES:WO,MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES:GO,MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES:KO,MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES:qO,MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES:IO,MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES:JO,MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES:XO,MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES:ZO,MODEL_FOR_NORMAL_ESTIMATION_MAPPING_NAMES:QO,MODEL_FOR_POSE_ESTIMATION_MAPPING_NAMES:$O,MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES:ek,MODEL_FOR_IMAGE_TEXT_TO_TEXT_MAPPING_NAMES:PO,MODEL_FOR_AUDIO_TEXT_TO_TEXT_MAPPING_NAMES:FO,MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES:OO,MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES:CO,MODEL_FOR_CAUSAL_LM_MAPPING_NAMES:kO,MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES:NO};Kh(ak);var ok=class{static MODEL_CLASS_MAPPINGS=null;static BASE_IF_FAIL=!1;static supports(e){if(!this.MODEL_CLASS_MAPPINGS)return!1;for(let t of this.MODEL_CLASS_MAPPINGS)if(t.has(e))return!0;return this.BASE_IF_FAIL}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,model_file_name:o=null,subfolder:s=`onnx`,device:c=null,dtype:l=null,use_external_data_format:u=null,session_options:d={}}={}){let f={progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,model_file_name:o,subfolder:s,device:c,dtype:l,use_external_data_format:u,session_options:d};if(f.config=await Zm.from_pretrained(e,f),!this.MODEL_CLASS_MAPPINGS)throw Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);let{model_type:p}=f.config;for(let t of this.MODEL_CLASS_MAPPINGS){let n=t.get(p);if(!n){for(let e of t.values())if(e[0]===p){n=e;break}if(!n)continue}return await bg[n].from_pretrained(e,f)}if(this.BASE_IF_FAIL)return ik.has(p)||wi.warn(`Unknown model class "${p}", attempting to construct from base class.`),await q.from_pretrained(e,f);throw Error(`Unsupported model type: ${p}`)}},sk=class extends ok{static MODEL_CLASS_MAPPINGS=tk.map(e=>e[0]);static BASE_IF_FAIL=!0},ck=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES]},lk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES]},uk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES]},dk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES]},fk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES]},pk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES]},mk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_CAUSAL_LM_MAPPING_NAMES]},hk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_MASKED_LM_MAPPING_NAMES]},gk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES]},_k=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES]},vk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES]},yk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES]},bk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES]},xk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_UNIVERSAL_SEGMENTATION_MAPPING_NAMES]},Sk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES]},Ck=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES]};(class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_MASK_GENERATION_MAPPING_NAMES]});var wk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_CTC_MAPPING_NAMES]},Tk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES]};(class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES]}),class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES]};var Ek=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES]};(class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES]});var Dk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES]},Ok=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES]};(class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_NORMAL_ESTIMATION_MAPPING_NAMES]}),class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_POSE_ESTIMATION_MAPPING_NAMES]};var kk=class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES]};(class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_IMAGE_TEXT_TO_TEXT_MAPPING_NAMES]}),class extends ok{static MODEL_CLASS_MAPPINGS=[ak.MODEL_FOR_AUDIO_TEXT_TO_TEXT_MAPPING_NAMES]};async function Ak(e){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>pf.read(e)))}async function jk(e,t){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>typeof e==`string`||e instanceof URL?gd(e,t):e instanceof Float64Array?new Float32Array(e):e))}function Mk(e,t){t&&(e=e.map(e=>e|0));let[n,r,i,a]=e;return{xmin:n,ymin:r,xmax:i,ymax:a}}var Nk=class extends pi{constructor({task:e,model:t,tokenizer:n=null,processor:r=null}){super(),this.task=e,this.model=t,this.tokenizer=n,this.processor=r}async dispose(){await this.model.dispose()}},Pk=class extends Nk{async _call(e,{top_k:t=1}={}){let n=this.tokenizer(e,{padding:!0,truncation:!0}),r=await this.model(n),{problem_type:i,id2label:a}=this.model.config,o=i===`multi_label_classification`?e=>e.sigmoid():e=>new G(`float32`,Ec(e.data),e.dims),s=[];for(let e of r.logits){let n=await Tl(o(e),t),r=n[0].tolist(),i=n[1].tolist().map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:r[t]}));t===1?s.push(...i):s.push(i)}return Array.isArray(e)||t===1?s:s[0]}},Fk=class extends Nk{async _call(e,{ignore_labels:t=[`O`],aggregation_strategy:n=`none`}={}){if(n!==`none`&&n!==`simple`)throw Error(`Invalid aggregation_strategy: "${n}". Must be one of "none" or "simple".`);let r=Array.isArray(e),i=this.tokenizer(r?e:[e],{padding:!0,truncation:!0}),a=(await this.model(i)).logits,o=this.model.config.id2label,s=[];for(let e=0;e{let o=0,s=[];for(let n=i;ne==u),i=a[e].tolist(),f=o[e].tolist();for(let n=1;ne==t[n])!==-1)&&(i[n]=-1/0,f[n]=-1/0);let p=Ec(i).map((e,t)=>[e,t]),m=Ec(f).map((e,t)=>[e,t]);p[0][0]=0,m[0][0]=0;let h=bi(p,m).filter(e=>e[0][1]<=e[1][1]).map(e=>[e[0][1],e[1][1],e[0][0]*e[1][0]]).sort((e,t)=>t[2]-e[2]),g=[];for(let e=0;ee==n);if(c===-1)throw Error(`Mask token (${r}) not found in text.`);let l=a[e][c],u=await Tl(new G(`float32`,Ec(l.data),l.dims),t),d=u[0].tolist(),f=u[1].tolist();o.push(f.map((e,t)=>{let n=i.slice();return n[c]=e,{score:d[t],token:Number(e),token_str:this.tokenizer.decode([e]),sequence:this.tokenizer.decode(n,{skip_special_tokens:!0})}}))}return Array.isArray(e)?o:o[0]}},Bk=class extends Nk{_default_generation_config={max_new_tokens:256};_key=`generated_text`;async _call(e,t={}){Array.isArray(e)||(e=[e]),this.model.config.prefix&&(e=e.map(e=>this.model.config.prefix+e));let n=this.model.config.task_specific_params;n&&n[this.task]&&n[this.task].prefix&&(e=e.map(e=>n[this.task].prefix+e));let r=this.tokenizer,i={padding:!0,truncation:!0},a;a=this.task===`translation`&&`_build_translation_inputs`in r?r._build_translation_inputs(e,i,t):r(e,i);let o=await this.model.generate({...a,...this._default_generation_config,...t});return r.batch_decode(o,{skip_special_tokens:!0}).map(e=>({[this._key]:e}))}},Vk=class extends Bk{_key=`summary_text`},Hk=class extends Bk{_key=`translation_text`};function Uk(e){return Array.isArray(e)&&e.every(e=>`role`in e&&`content`in e)}var Wk=class extends Nk{_default_generation_config={max_new_tokens:256};async _call(e,t={}){let{add_special_tokens:n,return_full_text:r,tools:i,documents:a,chat_template:o,tokenizer_encode_kwargs:s,...c}=t,l=!1,u=!1,d=n??(this.tokenizer.add_bos_token||this.tokenizer.add_eos_token)??!1,f=s,p;if(typeof e==`string`)p=e=[e];else if(Array.isArray(e)&&e.every(e=>typeof e==`string`))l=!0,p=e;else{if(Uk(e))e=[e];else if(Array.isArray(e)&&e.every(Uk))l=!0;else throw Error(`Input must be a string, an array of strings, a Chat, or an array of Chats`);u=!0;let t={tokenize:!1,add_generation_prompt:!0,...Si({tools:i,documents:a,chat_template:o},[`tools`,`documents`,`chat_template`]),...f};p=e.map(e=>this.tokenizer.apply_chat_template(e,t)),d=!1,f=void 0}let m=u?!1:r??!0;this.tokenizer.padding_side=`left`;let h=this.tokenizer(p,{add_special_tokens:d,padding:!0,truncation:!0,...f}),g=await this.model.generate({...h,...this._default_generation_config,...c}),_=this.tokenizer.batch_decode(g,{skip_special_tokens:!0}),v;!m&&h.input_ids.dims.at(-1)>0&&(v=this.tokenizer.batch_decode(h.input_ids,{skip_special_tokens:!0}).map(e=>e.length));let y=Array.from({length:e.length},e=>[]);for(let t=0;t<_.length;++t){let n=Math.floor(t/g.dims[0]*e.length);v&&(_[t]=_[t].slice(v[n])),y[n].push({generated_text:u?[...e[n],{role:`assistant`,content:_[t]}]:_[t]})}return!l&&y.length===1?y[0]:y}},Gk=class extends Nk{constructor(e){super(e),this.label2id=Object.fromEntries(Object.entries(this.model.config.label2id).map(([e,t])=>[e.toLowerCase(),t])),this.entailment_id=this.label2id.entailment,this.entailment_id===void 0&&(wi.warn(`Could not find 'entailment' in label2id mapping. Using 2 as entailment_id.`),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,this.contradiction_id===void 0&&(wi.warn(`Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id.`),this.contradiction_id=0)}async _call(e,t,{hypothesis_template:n=`This example is {}.`,multi_label:r=!1}={}){let i=Array.isArray(e);i||(e=[e]),Array.isArray(t)||(t=[t]);let a=t.map(e=>n.replace(`{}`,e)),o=r||t.length===1,s=[];for(let n of e){let e=[];for(let t of a){let r=this.tokenizer(n,{text_pair:t,padding:!0,truncation:!0}),i=await this.model(r);o?e.push([i.logits.data[this.contradiction_id],i.logits.data[this.entailment_id]]):e.push(i.logits.data[this.entailment_id])}let r=(o?e.map(e=>Ec(e)[1]):Ec(e)).map((e,t)=>[e,t]).sort((e,t)=>t[0]-e[0]);s.push({sequence:n,labels:r.map(e=>t[e[1]]),scores:r.map(e=>e[0])})}return i?s:s[0]}},Kk=class extends Nk{async _call(e,{top_k:t=5}={}){let n=this.processor.feature_extractor.config.sampling_rate,r=await jk(e,n),i=this.model.config.id2label,a=[];for(let e of r){let n=await this.processor(e),r=(await this.model(n)).logits[0],o=await Tl(new G(`float32`,Ec(r.data),r.dims),t),s=o[0].tolist(),c=o[1].tolist().map((e,t)=>({label:i?i[e]:`LABEL_${e}`,score:s[t]}));a.push(c)}return Array.isArray(e)?a:a[0]}},qk=class extends Nk{async _call(e,t,{hypothesis_template:n=`This is a sound of {}.`}={}){let r=!Array.isArray(e);r&&(e=[e]);let i=t.map(e=>n.replace(`{}`,e)),a=this.tokenizer(i,{padding:!0,truncation:!0}),o=this.processor.feature_extractor.config.sampling_rate,s=await jk(e,o),c=[];for(let e of s){let n=await this.processor(e),r=Ec((await this.model({...a,...n})).logits_per_audio.data);c.push([...r].map((e,n)=>({score:e,label:t[n]})))}return r?c[0]:c}},Jk=class extends Nk{_default_generation_config={};async _call(e,t={}){switch(t={...this._default_generation_config,...t},this.model.config.model_type){case`whisper`:case`lite-whisper`:return this._call_whisper(e,t);case`wav2vec2`:case`wav2vec2-bert`:case`unispeech`:case`unispeech-sat`:case`hubert`:case`parakeet_ctc`:return this._call_wav2vec2(e,t);case`moonshine`:return this._call_moonshine(e,t);case`cohere_asr`:return this._call_cohere_asr(e,t);default:throw Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(e,t){t.language&&wi.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),t.task&&wi.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');let n=!Array.isArray(e),r=n?[e]:e,i=this.processor.feature_extractor.config.sampling_rate,a=await jk(r,i),o=[];for(let e of a){let t=await this.processor(e),n=(await this.model(t)).logits[0],r=[];for(let e of n)r.push(kc(e.data)[1]);let i=this.tokenizer.decode(r,{skip_special_tokens:!0}).trim();o.push({text:i})}return n?o[0]:o}async _call_whisper(e,t){let n=t.return_timestamps??!1,r=t.chunk_length_s??0,i=t.force_full_sequences??!1,a=t.stride_length_s??null,o={...t};n===`word`&&(o.return_token_timestamps=!0,o.return_timestamps=!0);let s=!Array.isArray(e),c=s?[e]:e,l=this.processor.feature_extractor.config,u=l.chunk_length/this.model.config.max_source_positions,d=l.hop_length,f=l.sampling_rate,p=await jk(c,f),m=[];for(let e of p){let t=[];if(r>0){if(a===null)a=r/6;else if(r<=a)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");let n=f*r,i=f*a,o=n-2*i,s=0;for(;;){let r=s+n,a=e.subarray(s,r),c=await this.processor(a),l=s===0,u=r>=e.length;if(t.push({stride:[a.length,l?0:i,u?0:i],input_features:c.input_features,is_last:u}),u)break;s+=o}}else t=[{stride:[e.length,0,0],input_features:(await this.processor(e)).input_features,is_last:!0}];for(let e of t){o.num_frames=Math.floor(e.stride[0]/d);let t=await this.model.generate({inputs:e.input_features,...o});if(n===`word`){let n=t.sequences.tolist()[0],r=t.token_timestamps.tolist()[0],i=this.tokenizer.timestamp_begin,a=Math.max(n.findIndex(e=>Number(e)>=i),0);e.tokens=n.slice(a),e.token_timestamps=r.slice(a).map(e=>Fc(e,2))}else e.tokens=t[0].tolist();e.stride=e.stride.map(e=>e/f)}let[s,c]=this.tokenizer._decode_asr(t,{time_precision:u,return_timestamps:n,force_full_sequences:i});m.push({text:s,...c})}return s?m[0]:m}async _call_moonshine(e,t){let n=!Array.isArray(e),r=n?[e]:e,i=this.processor.feature_extractor.config.sampling_rate,a=await jk(r,i),o=[];for(let e of a){let n=await this.processor(e),r=Math.floor(e.length/i)*6,a=await this.model.generate({max_new_tokens:r,...t,...n}),s=this.processor.batch_decode(a,{skip_special_tokens:!0})[0];o.push({text:s})}return n?o[0]:o}async _call_cohere_asr(e,t){let n=!Array.isArray(e),r=n?[e]:e,i=this.processor.feature_extractor,a=i.config.sampling_rate,o=await jk(r,a),s=t.language??`en`,c=this.processor.get_decoder_prompt_ids(s),l=[];for(let e of o){let n=i.split_audio(e),r=[];for(let e of n){let n=await this.processor(e),i=await this.model.generate({...n,decoder_input_ids:c,...t}),a=this.tokenizer.decode(i[0].tolist(),{skip_special_tokens:!0}).trim();r.push(a)}let a=this.processor.constructor.join_chunks(r,s);l.push({text:a})}return n?l[0]:l}},Yk=class extends Nk{DEFAULT_VOCODER_ID=`Xenova/speecht5_hifigan`;constructor(e){super(e),this.vocoder=e.vocoder??null}async _prepare_speaker_embeddings(e,t){if((typeof e==`string`||e instanceof URL)&&(e=new Float32Array(await(await di.fetch(e)).arrayBuffer())),e instanceof Float32Array)e=new G(`float32`,e,[e.length]);else if(!(e instanceof G))throw Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");if(t>1){if(e.dims[0]===1)e=e.repeat(t,1);else if(e.dims[0]!==t)throw Error(`Expected speaker embeddings batch size to be 1 or ${t}, but got ${e.dims[0]}.`)}return e}_postprocess_waveform(e,t,n,r=null){let i=t.data,[a,o]=t.dims,s=r?r.data:null,c=[];for(let e=0;e({generated_text:e.trim()}));a.push(r)}return n?a:a[0]}},Zk=class extends Nk{async _call(e,{top_k:t=5}={}){let n=await Ak(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),{id2label:a}=this.model.config,o=[];for(let e of i.logits){let n=await Tl(new G(`float32`,Ec(e.data),e.dims),t),r=n[0].tolist(),i=n[1].tolist().map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:r[t]}));o.push(i)}return Array.isArray(e)?o:o[0]}},Qk={panoptic:`post_process_panoptic_segmentation`,instance:`post_process_instance_segmentation`,semantic:`post_process_semantic_segmentation`},$k=class extends Nk{async _call(e,{threshold:t=.5,mask_threshold:n=.5,overlap_mask_area_threshold:r=.8,label_ids_to_fuse:i=null,target_sizes:a=null,subtask:o=null}={}){if(Array.isArray(e)&&e.length!==1)throw Error(`Image segmentation pipeline currently only supports a batch size of 1.`);let s=await Ak(e),c=s.map(e=>[e.height,e.width]),l=await this.processor(s),{inputNames:u,outputNames:d}=this.model.sessions.model;if(!u.includes(`pixel_values`)){if(u.length!==1)throw Error(`Expected a single input name, but got ${u.length} inputs: ${u}.`);let e=u[0];if(e in l)throw Error(`Input name ${e} already exists in the inputs.`);l[e]=l.pixel_values}let f=await this.model(l),p=null;if(o!==null)p=Qk[o];else if(this.processor.image_processor){for(let[e,t]of Object.entries(Qk))if(t in this.processor.image_processor){p=this.processor.image_processor[t].bind(this.processor.image_processor),o=e;break}}let m=this.model.config.id2label,h=[];if(!o){let e=f[d[0]];for(let t=0;te<-1e-5||e>1.00001)&&r.sigmoid_();let i=await pf.fromTensor(r.mul_(255).to(`uint8`)).resize(n[1],n[0]);h.push({label:null,score:null,mask:i})}}else if(o===`panoptic`||o===`instance`){let e=p(f,t,n,r,i,a??c)[0],o=e.segmentation;for(let t of e.segments_info){let e=new Uint8ClampedArray(o.data.length);for(let n=0;n{let n=e.clone();return n.putAlpha(r[t].mask),n});return Array.isArray(e)?i:i[0]}},model:[yk,bk,xk],default:{model:`Xenova/modnet`},type:`image`},"zero-shot-image-classification":{pipeline:class extends Nk{async _call(e,t,{hypothesis_template:n=`This is a photo of {}`}={}){let r=Array.isArray(e),i=await Ak(e),a=t.map(e=>n.replace(`{}`,e)),o=this.tokenizer(a,{padding:this.model.config.model_type===`siglip`?`max_length`:!0,truncation:!0}),{pixel_values:s}=await this.processor(i),c=await this.model({...o,pixel_values:s}),l=this.model.config.model_type===`siglip`?e=>e.sigmoid().data:e=>Ec(e.data),u=[];for(let e of c.logits_per_image){let n=[...l(e)].map((e,n)=>({score:e,label:t[n]}));n.sort((e,t)=>t.score-e.score),u.push(n)}return r?u:u[0]}},model:sk,default:{model:`Xenova/clip-vit-base-patch32`},type:`multimodal`},"object-detection":{pipeline:class extends Nk{async _call(e,{threshold:t=.9,percentage:n=!1}={}){let r=Array.isArray(e);if(r&&e.length!==1)throw Error(`Object detection pipeline currently only supports a batch size of 1.`);let i=await Ak(e),a=n?null:i.map(e=>[e.height,e.width]),{pixel_values:o,pixel_mask:s}=await this.processor(i),c=await this.model({pixel_values:o,pixel_mask:s}),l=this.processor.image_processor.post_process_object_detection(c,t,a),{id2label:u}=this.model.config,d=l.map(e=>e.boxes.map((t,r)=>({score:e.scores[r],label:u[e.classes[r]],box:Mk(t,!n)})));return r?d:d[0]}},model:Sk,default:{model:`Xenova/detr-resnet-50`},type:`multimodal`},"zero-shot-object-detection":{pipeline:class extends Nk{async _call(e,t,{threshold:n=.1,top_k:r=null,percentage:i=!1}={}){let a=Array.isArray(e),o=await Ak(e),s=this.tokenizer(t,{padding:!0,truncation:!0}),c=await this.processor(o),l=[];for(let e=0;e({score:e.scores[n],label:e.labels[n],box:Mk(t,!i)}))}else{let e=this.processor.image_processor.post_process_object_detection(f,n,u,!0)[0];p=e.boxes.map((n,r)=>({score:e.scores[r],label:t[e.classes[r]],box:Mk(n,!i)}))}p.sort((e,t)=>t.score-e.score),r!==null&&(p=p.slice(0,r)),l.push(p)}return a?l:l[0]}},model:Ck,default:{model:`Xenova/owlvit-base-patch32`},type:`multimodal`},"document-question-answering":{pipeline:class extends Nk{_default_generation_config={max_new_tokens:256};async _call(e,t,n={}){if(Array.isArray(e)){if(e.length!==1)throw Error(`Document Question Answering pipeline currently only supports a batch size of 1.`);e=e[0]}let r=(await Ak(e))[0],{pixel_values:i}=await this.processor(r),a=`${t}`,o=this.tokenizer(a,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,s=await this.model.generate({inputs:i,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:o,...this._default_generation_config,...n}),c=this.tokenizer.batch_decode(s)[0].match(/(.*?)<\/s_answer>/),l=null;return c&&c.length>=2&&(l=c[1].trim()),[{answer:l}]}},model:Ek,default:{model:`Xenova/donut-base-finetuned-docvqa`},type:`multimodal`},"image-to-image":{pipeline:class extends Nk{async _call(e){let t=await Ak(e),n=await this.processor(t),r=await this.model(n),i=[];for(let e of r.reconstruction){let t=e.squeeze().clamp_(0,1).mul_(255).round_().to(`uint8`);i.push(pf.fromTensor(t))}return Array.isArray(e)?i:i[0]}},model:Dk,default:{model:`Xenova/swin2SR-classical-sr-x2-64`},type:`image`},"depth-estimation":{pipeline:class extends Nk{async _call(e){let t=await Ak(e),n=await this.processor(t),{predicted_depth:r}=await this.model(n),i=[];for(let e=0;e`onnx/${e}`);return s.filter(e=>!e.startsWith(`onnx/`)||t.some(t=>e.startsWith(t)))}}return s}async function aA(e,t=null,{progress_callback:n=null,config:r=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,device:s=null,dtype:c=null,subfolder:l=`onnx`,use_external_data_format:u=null,model_file_name:d=null,session_options:f={}}={}){e=tA[e]??e;let p=eA[e.split(`_`,1)[0]];if(!p)throw Error(`Unsupported pipeline: ${e}. Must be one of [${Object.keys(eA)}]`);t||(t=p.default.model,wi.info(`No model specified. Using default model: "${t}".`),!c&&p.default.dtype&&(c=p.default.dtype));let m=await iA(e,t,{device:s,dtype:c}),h={};n&&(await Promise.all(m.map(async e=>fc(t,e)))).forEach((e,t)=>{e.exists&&(h[m[t]]={loaded:0,total:e.size??0})});let g={progress_callback:n?new hi(n,h):void 0,config:r,cache_dir:i,local_files_only:a,revision:o,device:s,dtype:c,subfolder:l,use_external_data_format:u,model_file_name:d,session_options:f},_=m.includes(`tokenizer.json`),v=m.includes(`preprocessor_config.json`),y=p.model,b;if(Array.isArray(y)){let n=r??await Zm.from_pretrained(t,g),{model_type:i}=n,a=y.find(e=>e.supports(i));if(!a)throw Error(`Unsupported model type "${i}" for task "${e}". None of the candidate model classes support this type.`);b=a.from_pretrained(t,{...g,config:n})}else b=y.from_pretrained(t,g);let[x,S,C]=await Promise.all([_?nd.from_pretrained(t,g):null,v?Gm.from_pretrained(t,g):null,b]),w={task:e,model:C};x&&(w.tokenizer=x),S&&(w.processor=S),mi(n,{status:`ready`,task:e,model:t});let T=p.pipeline;return new T(w)}ni.IS_PROCESS_AVAILABLE,Object.keys(_l);var oA=s({InferenceSession:()=>ij,TRACE:()=>ZA,TRACE_FUNC_BEGIN:()=>$A,TRACE_FUNC_END:()=>ej,Tensor:()=>YA,default:()=>xH,env:()=>DA,registerBackend:()=>_A}),sA=Object.defineProperty,cA=Object.getOwnPropertyDescriptor,lA=Object.getOwnPropertyNames,uA=Object.prototype.hasOwnProperty,dA=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){ +/*! +* ONNX Runtime Web v1.22.0-dev.20250409-89f8206ba4 +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT License. +*/ +if(typeof require<`u`)return require.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),J=(e,t)=>()=>(e&&(t=e(e=0)),t),fA=(e,t)=>{for(var n in t)sA(e,n,{get:t[n],enumerable:!0})},pA=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of lA(t))!uA.call(e,i)&&i!==n&&sA(e,i,{get:()=>t[i],enumerable:!(r=cA(t,i))||r.enumerable});return e},mA=e=>pA(sA({},`__esModule`,{value:!0}),e),hA,gA,_A,vA,yA,bA=J(()=>{"use strict";hA=new Map,gA=[],_A=(e,t,n)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let r=hA.get(e);if(r===void 0)hA.set(e,{backend:t,priority:n});else{if(r.priority>n)return;if(r.priority===n&&r.backend!==t)throw Error(`cannot register backend "${e}" using priority ${n}`)}if(n>=0){let t=gA.indexOf(e);t!==-1&&gA.splice(t,1);for(let t=0;t{let t=hA.get(e);if(!t)return`backend not found.`;if(t.initialized)return t.backend;if(t.aborted)return t.error;{let n=!!t.initPromise;try{return n||(t.initPromise=t.backend.init(e)),await t.initPromise,t.initialized=!0,t.backend}catch(e){return n||(t.error=`${e}`,t.aborted=!0),t.error}finally{delete t.initPromise}}},yA=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),r=n.length===0?gA:n,i,a=[],o=new Set;for(let e of r){let t=await vA(e);typeof t==`string`?a.push({name:e,err:t}):(i||=t,i===t&&o.add(e))}if(!i)throw Error(`no available backend found. ERR: ${a.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of a)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let s=t.filter(e=>o.has(typeof e==`string`?e:e.name));return[i,new Proxy(e,{get:(e,t)=>t===`executionProviders`?s:Reflect.get(e,t)})]}}),xA=J(()=>{"use strict";bA()}),SA,CA=J(()=>{"use strict";SA=`1.22.0-dev.20250409-89f8206ba4`}),wA,TA,EA=J(()=>{"use strict";CA(),wA=`warning`,TA={wasm:{},webgl:{},webgpu:{},versions:{common:SA},set logLevel(e){if(e!==void 0){if(typeof e!=`string`||[`verbose`,`info`,`warning`,`error`,`fatal`].indexOf(e)===-1)throw Error(`Unsupported logging level: ${e}`);wA=e}},get logLevel(){return wA}},Object.defineProperty(TA,"logLevel",{enumerable:!0})}),DA,OA=J(()=>{"use strict";EA(),DA=TA}),kA,AA,jA=J(()=>{"use strict";kA=(e,t)=>{let n=typeof document<`u`?document.createElement(`canvas`):new OffscreenCanvas(1,1);n.width=e.dims[3],n.height=e.dims[2];let r=n.getContext(`2d`);if(r!=null){let i,a;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[3]):(i=e.dims[3],a=e.dims[2]);let o=t?.format===void 0?`RGB`:t.format,s=t?.norm,c,l;s===void 0||s.mean===void 0?c=[255,255,255,255]:typeof s.mean==`number`?c=[s.mean,s.mean,s.mean,s.mean]:(c=[s.mean[0],s.mean[1],s.mean[2],0],s.mean[3]!==void 0&&(c[3]=s.mean[3])),s===void 0||s.bias===void 0?l=[0,0,0,0]:typeof s.bias==`number`?l=[s.bias,s.bias,s.bias,s.bias]:(l=[s.bias[0],s.bias[1],s.bias[2],0],s.bias[3]!==void 0&&(l[3]=s.bias[3]));let u=a*i,d=0,f=u,p=u*2,m=-1;o===`RGBA`?(d=0,f=u,p=u*2,m=u*3):o===`RGB`?(d=0,f=u,p=u*2):o===`RBG`&&(d=0,p=u,f=u*2);for(let t=0;t{let n=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):new OffscreenCanvas(1,1).getContext(`2d`),r;if(n!=null){let i,a,o;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[1],o=e.dims[3]):(i=e.dims[3],a=e.dims[2],o=e.dims[1]);let s=t!==void 0&&t.format!==void 0?t.format:`RGB`,c=t?.norm,l,u;c===void 0||c.mean===void 0?l=[255,255,255,255]:typeof c.mean==`number`?l=[c.mean,c.mean,c.mean,c.mean]:(l=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(l[3]=c.mean[3])),c===void 0||c.bias===void 0?u=[0,0,0,0]:typeof c.bias==`number`?u=[c.bias,c.bias,c.bias,c.bias]:(u=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(u[3]=c.bias[3]));let d=a*i;if(t!==void 0&&(t.format!==void 0&&o===4&&t.format!==`RGBA`||o===3&&t.format!==`RGB`&&t.format!==`BGR`))throw Error(`Tensor format doesn't match input tensor dims`);let f=0,p=1,m=2,h=3,g=0,_=d,v=d*2,y=-1;s===`RGBA`?(g=0,_=d,v=d*2,y=d*3):s===`RGB`?(g=0,_=d,v=d*2):s===`RBG`&&(g=0,v=d,_=d*2),r=n.createImageData(i,a);for(let t=0;t{"use strict";JA(),MA=(e,t)=>{if(e===void 0)throw Error(`Image buffer must be defined`);if(t.height===void 0||t.width===void 0)throw Error(`Image height and width must be defined`);if(t.tensorLayout===`NHWC`)throw Error(`NHWC Tensor layout is not supported yet`);let{height:n,width:r}=t,i=t.norm??{mean:255,bias:0},a,o;a=typeof i.mean==`number`?[i.mean,i.mean,i.mean,i.mean]:[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],o=typeof i.bias==`number`?[i.bias,i.bias,i.bias,i.bias]:[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let s=t.format===void 0?`RGBA`:t.format,c=t.tensorFormat!==void 0&&t.tensorFormat!==void 0?t.tensorFormat:`RGB`,l=n*r,u=c===`RGBA`?new Float32Array(l*4):new Float32Array(l*3),d=4,f=0,p=1,m=2,h=3,g=0,_=l,v=l*2,y=-1;s===`RGB`&&(d=3,f=0,p=1,m=2,h=-1),c===`RGBA`?y=l*3:c===`RBG`?(g=0,v=l,_=l*2):c===`BGR`&&(v=0,_=l,g=l*2);for(let t=0;t{let n=typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement,r=typeof ImageData<`u`&&e instanceof ImageData,i=typeof ImageBitmap<`u`&&e instanceof ImageBitmap,a=typeof e==`string`,o,s=t??{},c=()=>{if(typeof document<`u`)return document.createElement(`canvas`);if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(1,1);throw Error(`Canvas is not supported`)},l=e=>typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas?e.getContext(`2d`):null;if(n){let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let n=e.height,i=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(n=t.resizedHeight,i=t.resizedWidth),t!==void 0){if(s=t,t.tensorFormat!==void 0)throw Error(`Image input config format must be RGBA for HTMLImageElement`);s.tensorFormat=`RGBA`,s.height=n,s.width=i}else s.tensorFormat=`RGBA`,s.height=n,s.width=i;r.drawImage(e,0,0),o=r.getImageData(0,0,i,n).data}else throw Error(`Can not access image data`)}else if(r){let n,r;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(n=t.resizedHeight,r=t.resizedWidth):(n=e.height,r=e.width),t!==void 0&&(s=t),s.format=`RGBA`,s.height=n,s.width=r,t!==void 0){let t=c();t.width=r,t.height=n;let i=l(t);if(i!=null)i.putImageData(e,0,0),o=i.getImageData(0,0,r,n).data;else throw Error(`Can not access image data`)}else o=e.data}else if(i){if(t===void 0)throw Error(`Please provide image config with format for Imagebitmap`);let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let t=e.height,n=e.width;return r.drawImage(e,0,0,n,t),o=r.getImageData(0,0,n,t).data,s.height=t,s.width=n,MA(o,s)}else throw Error(`Can not access image data`)}else{if(a)return new Promise((t,n)=>{let r=c(),i=l(r);if(!e||!i)return n();let a=new Image;a.crossOrigin=`Anonymous`,a.src=e,a.onload=()=>{r.width=a.width,r.height=a.height,i.drawImage(a,0,0,r.width,r.height);let e=i.getImageData(0,0,r.width,r.height);s.height=r.height,s.width=r.width,t(MA(e.data,s))}});throw Error(`Input data provided is not supported - aborted tensor creation`)}if(o!==void 0)return MA(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},PA=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t;return new qA({location:`texture`,type:`float32`,texture:e,dims:[1,r,n,4],download:i,dispose:a})},FA=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new qA({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},IA=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new qA({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},LA=(e,t,n)=>new qA({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]})}),zA,BA,VA,HA,UA=J(()=>{"use strict";zA=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),BA=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]),VA=!1,HA=()=>{if(!VA){VA=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=typeof n<`u`&&n.from;e&&(zA.set(`int64`,BigInt64Array),BA.set(BigInt64Array,`int64`)),t&&(zA.set(`uint64`,BigUint64Array),BA.set(BigUint64Array,`uint64`)),r?(zA.set(`float16`,n),BA.set(n,`float16`)):zA.set(`float16`,Uint16Array)}}}),WA,GA,KA=J(()=>{"use strict";JA(),WA=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new qA(e.type,e.data,t);case`cpu-pinned`:return new qA({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new qA({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new qA({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new qA({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),qA,JA=J(()=>{"use strict";jA(),RA(),UA(),KA(),qA=class{constructor(e,t,n){HA();let r,i;if(typeof e==`object`&&`location`in e)switch(this.dataLocation=e.location,r=e.type,i=e.dims,e.location){case`cpu-pinned`:{let t=zA.get(r);if(!t)throw TypeError(`unsupported type "${r}" to create tensor from pinned buffer`);if(!(e.data instanceof t))throw TypeError(`buffer should be of type ${t.name}`);this.cpuData=e.data;break}case`texture`:if(r!==`float32`)throw TypeError(`unsupported type "${r}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break;case`gpu-buffer`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break;case`ml-tensor`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint64`&&r!==`int8`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break;default:throw Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,o;if(typeof e==`string`)if(r=e,o=n,e===`string`){if(!Array.isArray(t))throw TypeError(`A string tensor's data must be a string array.`);a=t}else{let n=zA.get(e);if(n===void 0)throw TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t)){if(e===`float16`&&n===Uint16Array||e===`uint4`||e===`int4`)throw TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${n.name} as data.`);a=e===`uint64`||e===`int64`?n.from(t,BigInt):n.from(t)}else if(t instanceof n)a=t;else if(t instanceof Uint8ClampedArray)if(e===`uint8`)a=Uint8Array.from(t);else throw TypeError(`A Uint8ClampedArray tensor's data must be type of uint8`);else if(e===`float16`&&t instanceof Uint16Array&&n!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw TypeError(`A ${r} tensor's data must be type of ${n}`)}else if(o=t,Array.isArray(e)){if(e.length===0)throw TypeError(`Tensor type cannot be inferred from an empty array.`);let t=typeof e[0];if(t===`string`)r=`string`,a=e;else if(t===`boolean`)r=`bool`,a=Uint8Array.from(e);else throw TypeError(`Invalid element type of data array: ${t}.`)}else if(e instanceof Uint8ClampedArray)r=`uint8`,a=Uint8Array.from(e);else{let t=BA.get(e.constructor);if(t===void 0)throw TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,a=e}if(o===void 0)o=[a.length];else if(!Array.isArray(o))throw TypeError(`A tensor's dims must be a number array`);i=o,this.cpuData=a,this.dataLocation=`cpu`}let a=WA(i);if(this.cpuData&&a!==this.cpuData.length&&!((r===`uint4`||r===`int4`)&&Math.ceil(a/2)===this.cpuData.length))throw Error(`Tensor's size(${a}) does not match data length(${this.cpuData.length}).`);this.type=r,this.dims=i,this.size=a}static async fromImage(e,t){return NA(e,t)}static fromTexture(e,t){return PA(e,t)}static fromGpuBuffer(e,t){return FA(e,t)}static fromMLTensor(e,t){return IA(e,t)}static fromPinnedBuffer(e,t,n){return LA(e,t,n)}toDataURL(e){return kA(this,e)}toImageData(e){return AA(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw Error(`The data is not stored as a WebGL texture.`);return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw Error(`The data is not stored as a WebGPU buffer.`);return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw Error(`The data is not stored as a WebNN MLTensor.`);return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case`cpu`:case`cpu-pinned`:return this.data;case`texture`:case`gpu-buffer`:case`ml-tensor`:if(!this.downloader)throw Error(`The current tensor is not created with a specified data downloader.`);if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);try{this.isDownloading=!0;let t=await this.downloader();return this.downloader=void 0,this.dataLocation=`cpu`,this.cpuData=t,e&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}default:throw Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);this.disposer&&=(this.disposer(),void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation=`none`}ensureValid(){if(this.dataLocation===`none`)throw Error(`The tensor is disposed.`)}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw Error(`Cannot reshape a tensor that owns GPU resource.`);return GA(this,e)}}}),YA,XA=J(()=>{"use strict";JA(),YA=qA}),ZA,QA,$A,ej,tj=J(()=>{"use strict";EA(),ZA=(e,t)=>{(typeof TA.trace>`u`?!TA.wasm.trace:!TA.trace)||console.timeStamp(`${e}::ORT::${t}`)},QA=(e,t)=>{let n=Error().stack?.split(/\r\n|\r|\n/g)||[],r=!1;for(let i=0;i{(typeof TA.trace>`u`?!TA.wasm.trace:!TA.trace)||QA(`BEGIN`,e)},ej=e=>{(typeof TA.trace>`u`?!TA.wasm.trace:!TA.trace)||QA(`END`,e)}}),nj,rj=J(()=>{"use strict";bA(),XA(),tj(),nj=class e{constructor(e){this.handler=e}async run(e,t,n){$A();let r={},i={};if(typeof e!=`object`||!e||e instanceof YA||Array.isArray(e))throw TypeError(`'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.`);let a=!0;if(typeof t==`object`){if(t===null)throw TypeError(`Unexpected argument[1]: cannot be null.`);if(t instanceof YA)throw TypeError(`'fetches' cannot be a Tensor`);if(Array.isArray(t)){if(t.length===0)throw TypeError(`'fetches' cannot be an empty array.`);a=!1;for(let e of t){if(typeof e!=`string`)throw TypeError(`'fetches' must be a string array or an object.`);if(this.outputNames.indexOf(e)===-1)throw RangeError(`'fetches' contains invalid output name: ${e}.`);r[e]=null}if(typeof n==`object`&&n)i=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else{let e=!1,o=Object.getOwnPropertyNames(t);for(let n of this.outputNames)if(o.indexOf(n)!==-1){let i=t[n];(i===null||i instanceof YA)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else i=t}}else if(typeof t<`u`)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(typeof e[t]>`u`)throw Error(`input '${t}' is missing in 'feeds'.`);if(a)for(let e of this.outputNames)r[e]=null;let o=await this.handler.run(e,r,i),s={};for(let e in o)if(Object.hasOwnProperty.call(o,e)){let t=o[e];t instanceof YA?s[e]=t:s[e]=new YA(t.type,t.data,t.dims)}return ej(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){$A();let a,o={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)o=n;else if(typeof n<`u`)throw TypeError(`'options' must be an object.`)}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer){let e=t,s=0,c=t.byteLength;if(typeof n==`object`&&n)o=n;else if(typeof n==`number`){if(s=n,!Number.isSafeInteger(s))throw RangeError(`'byteOffset' must be an integer.`);if(s<0||s>=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(c=t.byteLength-s,typeof r==`number`){if(c=r,!Number.isSafeInteger(c))throw RangeError(`'byteLength' must be an integer.`);if(c<=0||s+c>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-s}].`);if(typeof i==`object`&&i)o=i;else if(typeof i<`u`)throw TypeError(`'options' must be an object.`)}else if(typeof r<`u`)throw TypeError(`'byteLength' must be a number.`)}else if(typeof n<`u`)throw TypeError(`'options' must be an object.`);a=new Uint8Array(e,s,c)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let[s,c]=await yA(o),l=await s.createInferenceSessionHandler(a,c);return ej(),new e(l)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}}}),ij,aj=J(()=>{"use strict";rj(),ij=nj}),oj=J(()=>{"use strict";}),sj=J(()=>{"use strict";}),cj=J(()=>{"use strict";}),lj=J(()=>{"use strict";}),uj={};fA(uj,{InferenceSession:()=>ij,TRACE:()=>ZA,TRACE_FUNC_BEGIN:()=>$A,TRACE_FUNC_END:()=>ej,Tensor:()=>YA,env:()=>DA,registerBackend:()=>_A});var dj=J(()=>{"use strict";xA(),OA(),aj(),XA(),oj(),sj(),tj(),cj(),lj()}),fj=J(()=>{"use strict";}),pj={};fA(pj,{default:()=>gj});var mj,hj,gj,_j=J(()=>{"use strict";GV(),Jj(),Rj(),mj=`ort-wasm-proxy-worker`,hj=globalThis.self?.name===mj,hj&&(self.onmessage=e=>{let{type:t,in:n}=e.data;try{switch(t){case`init-wasm`:Kj(n.wasm).then(()=>{NV(n).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})})},e=>{postMessage({type:t,err:e})});break;case`init-ep`:{let{epName:e,env:r}=n;PV(r,e).then(()=>{postMessage({type:t})},e=>{postMessage({type:t,err:e})});break}case`copy-from`:{let{buffer:e}=n,r=RV(e);postMessage({type:t,out:r});break}case`create`:{let{model:e,options:r}=n;zV(e,r).then(e=>{postMessage({type:t,out:e})},e=>{postMessage({type:t,err:e})});break}case`release`:BV(n),postMessage({type:t});break;case`run`:{let{sessionId:e,inputIndices:r,inputs:i,outputIndices:a,options:o}=n;HV(e,r,i,a,Array(a.length).fill(null),o).then(e=>{e.some(e=>e[3]!==`cpu`)?postMessage({type:t,err:`Proxy does not support non-cpu tensor location.`}):postMessage({type:t,out:e},WV([...i,...e]))},e=>{postMessage({type:t,err:e})});break}case`end-profiling`:UV(n),postMessage({type:t});break;default:}}catch(e){postMessage({type:t,err:e})}}),gj=hj?null:e=>new Worker(e??Dj,{type:`module`,name:mj})}),vj={};fA(vj,{default:()=>xj});var yj,bj,xj,Sj,Cj=J(()=>{"use strict";bj=(yj=self.location.href,async function(e={}){var t,n,r=e,i=new Promise((e,r)=>{t=e,n=r}),a=typeof window==`object`,o=typeof WorkerGlobalScope<`u`,s=o&&self.name?.startsWith(`em-pthread`);r.mountExternalData=(e,t)=>{e.startsWith(`./`)&&(e=e.substring(2)),(r.Eb||=new Map).set(e,t)},r.unmountExternalData=()=>{delete r.Eb};var c=globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,pc:!0}).buffer.constructor;let l=e=>async(...t)=>{try{if(r.Fb)throw Error(`Session already started`);let n=r.Fb={dc:t[0],errors:[]},i=await e(...t);if(r.Fb!==n)throw Error(`Session mismatch`);r.Jb?.flush();let a=n.errors;if(0e),0{if(e===`webgpu`){[r.Jb,r.Ub,r.Yb,r.Kb,r.Xb,r.jb,r.Zb,r.ac,r.Vb,r.Wb,r.$b]=t;let e=r.Jb;r.jsepRegisterBuffer=(t,n,r,i)=>e.registerBuffer(t,n,r,i),r.jsepGetBuffer=t=>e.getBuffer(t),r.jsepCreateDownloader=(t,n,r)=>e.createDownloader(t,n,r),r.jsepOnCreateSession=t=>{e.onCreateSession(t)},r.jsepOnReleaseSession=t=>{e.onReleaseSession(t)},r.jsepOnRunStart=t=>e.onRunStart(t),r.bc=(t,n)=>{e.upload(t,n)}}else if(e===`webnn`){let e=t[0];[r.nc,r.Nb,r.webnnEnsureTensor,r.Ob,r.webnnDownloadTensor]=t.slice(1),r.webnnReleaseTensorId=r.Nb,r.webnnUploadTensor=r.Ob,r.webnnOnRunStart=t=>e.onRunStart(t),r.webnnOnRunEnd=e.onRunEnd.bind(e),r.webnnRegisterMLContext=(t,n)=>{e.registerMLContext(t,n)},r.webnnOnReleaseSession=t=>{e.onReleaseSession(t)},r.webnnCreateMLTensorDownloader=(t,n)=>e.createMLTensorDownloader(t,n),r.webnnRegisterMLTensor=(t,n,r,i)=>e.registerMLTensor(t,n,r,i),r.webnnCreateMLContext=t=>e.createMLContext(t),r.webnnRegisterMLConstant=(t,n,i,a,o,s)=>e.registerMLConstant(t,n,i,a,o,r.Eb,s),r.webnnRegisterGraphInput=e.registerGraphInput.bind(e),r.webnnIsGraphInput=e.isGraphInput.bind(e),r.webnnCreateTemporaryTensor=e.createTemporaryTensor.bind(e),r.webnnIsInt64Supported=e.isInt64Supported.bind(e)}};let u=()=>{let e=(e,t,n)=>(...r)=>{let i=Qt,a=t?.();r=e(...r);let o=t?.();return a!==o&&(e=o,n(a),t=n=null),Qt==i?r:new Promise((e,t)=>{an={resolve:e,reject:t}})};(()=>{for(let t of[`_OrtAppendExecutionProvider`,`_OrtCreateSession`,`_OrtRun`,`_OrtRunWithBinding`,`_OrtBindInput`])r[t]=e(r[t],()=>r[t],e=>r[t]=e)})(),l!==void 0&&(r._OrtRun=l(r._OrtRun),r._OrtRunWithBinding=l(r._OrtRunWithBinding)),u=void 0};r.asyncInit=()=>{u?.()};var d,f,p=Object.assign({},r),m=(e,t)=>{throw t},h=``;(a||o)&&(o?h=self.location.href:typeof document<`u`&&document.currentScript&&(h=document.currentScript.src),yj&&(h=yj),h=h.startsWith(`blob:`)?``:h.slice(0,h.replace(/[?#].*/,``).lastIndexOf(`/`)+1),o&&(f=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),d=async e=>{if(F(e))return new Promise((t,n)=>{var r=new XMLHttpRequest;r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onload=()=>{r.status==200||r.status==0&&r.response?t(r.response):n(r.status)},r.onerror=n,r.send(null)});var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)});var g=console.log.bind(console),_=console.error.bind(console),v=g,y=_;Object.assign(r,p),p=null;var b,x,S,C,w,T,E,D,O,k,A,j,M,N=r.wasmBinary,P=!1,F=e=>e.startsWith(`file://`);function I(){return b.buffer!=C.buffer&&oe(),C}function L(){return b.buffer!=C.buffer&&oe(),w}function ee(){return b.buffer!=C.buffer&&oe(),T}function te(){return b.buffer!=C.buffer&&oe(),E}function R(){return b.buffer!=C.buffer&&oe(),D}function ne(){return b.buffer!=C.buffer&&oe(),O}function re(){return b.buffer!=C.buffer&&oe(),k}function ie(){return b.buffer!=C.buffer&&oe(),M}if(s){let e=function(t){try{var n=t.data,i=n.Bb;if(i===`load`){let t=[];self.onmessage=e=>t.push(e),self.startWorker=()=>{postMessage({Bb:`loaded`});for(let n of t)e(n);self.onmessage=e};for(let e of n.Rb)r[e]&&!r[e].proxy||(r[e]=(...t)=>{postMessage({Bb:`callHandler`,Qb:e,args:t})},e==`print`&&(v=r[e]),e==`printErr`&&(y=r[e]));b=n.kc,oe(),ae(n.lc)}else if(i===`run`){Me(n.Ab),wr(n.Ab,0,0,1,0,0),ke(),Rt(n.Ab),z||=(br(),!0);try{Ne(n.fc,n.Hb)}catch(e){if(e!=`unwind`)throw e}}else n.target!==`setimmediate`&&(i===`checkMailbox`?z&&zt():i&&(y(`worker: received unknown command ${i}`),y(n)))}catch(e){throw Tr(),e}};var ae,z=!1;y=function(...e){e=e.join(` `),console.error(e)},self.alert=function(...e){postMessage({Bb:`alert`,text:e.join(` `),ic:xr()})},self.onunhandledrejection=e=>{throw e.reason||e},self.onmessage=e}function oe(){var e=b.buffer;r.HEAP8=C=new Int8Array(e),r.HEAP16=T=new Int16Array(e),r.HEAPU8=w=new Uint8Array(e),r.HEAPU16=E=new Uint16Array(e),r.HEAP32=D=new Int32Array(e),r.HEAPU32=O=new Uint32Array(e),r.HEAPF32=k=new Float32Array(e),r.HEAPF64=M=new Float64Array(e),r.HEAP64=A=new BigInt64Array(e),r.HEAPU64=j=new BigUint64Array(e)}function se(){s?startWorker(r):_r.Ca()}s||(b=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),oe());var B,ce=0,le=null;function ue(){if(--ce==0&&le){var e=le;le=null,e()}}function de(e){throw y(e=`Aborted(`+e+`)`),P=!0,e=new WebAssembly.RuntimeError(e+`. Build with -sASSERTIONS for more info.`),n(e),e}function fe(){return{a:{L:V,Aa:me,b:Fe,$:Le,A:Ve,pa:He,X:Ge,Z:Ke,qa:qe,na:Je,ga:Ye,ma:Xe,J:Ze,Y:Qe,V:$e,oa:et,W:tt,va:it,E:dt,Q:pt,O:xt,D:Ct,u:wt,r:Tt,P:Et,z:Pt,R:Ft,ja:It,T:Bt,aa:Ht,M:Ut,F:Wt,ia:Rt,sa:Gt,t:Jt,Ba:Yt,w:cn,o:un,l:pn,c:gt,n:hn,j:yn,v:bn,p:xn,f:Sn,s:Cn,m:wn,e:Tn,k:En,i:Dn,g:On,d:kn,da:An,ea:Pn,fa:Fn,ba:In,ca:Ln,N:zn,xa:Bn,ua:Un,h:Kn,C:qn,G:Jn,ta:Vn,x:Yn,ra:Xn,U:Zn,q:Rn,y:Qn,K:$n,S:er,za:rr,ya:ir,ka:cr,la:lr,_:Ce,B:ur,I:dr,ha:fr,H:mr,a:b,wa:xe}}}var pe={829644:(e,t,n,i,a)=>{if(r===void 0||!r.Eb)return 1;if((e=Be(Number(e>>>0))).startsWith(`./`)&&(e=e.substring(2)),!(e=r.Eb.get(e)))return 2;if(t=Number(t>>>0),n=Number(n>>>0),i=Number(i>>>0),t+n>e.byteLength)return 3;try{let o=e.subarray(t,t+n);switch(a){case 0:L().set(o,i>>>0);break;case 1:r.mc?r.mc(i,o):r.bc(i,o);break;default:return 4}return 0}catch{return 4}},830468:(e,t,n)=>{r.Ob(e,L().subarray(t>>>0,t+n>>>0))},830532:()=>r.nc(),830574:e=>{r.Nb(e)},830611:()=>{r.Vb()},830642:()=>{r.Wb()},830671:()=>{r.$b()},830696:e=>r.Ub(e),830729:e=>r.Yb(e),830761:(e,t,n)=>{r.Kb(Number(e),Number(t),Number(n),!0)},830824:(e,t,n)=>{r.Kb(Number(e),Number(t),Number(n))},830881:()=>typeof wasmOffsetConverter<`u`,830938:e=>{r.jb(`Abs`,e,void 0)},830989:e=>{r.jb(`Neg`,e,void 0)},831040:e=>{r.jb(`Floor`,e,void 0)},831093:e=>{r.jb(`Ceil`,e,void 0)},831145:e=>{r.jb(`Reciprocal`,e,void 0)},831203:e=>{r.jb(`Sqrt`,e,void 0)},831255:e=>{r.jb(`Exp`,e,void 0)},831306:e=>{r.jb(`Erf`,e,void 0)},831357:e=>{r.jb(`Sigmoid`,e,void 0)},831412:(e,t,n)=>{r.jb(`HardSigmoid`,e,{alpha:t,beta:n})},831491:e=>{r.jb(`Log`,e,void 0)},831542:e=>{r.jb(`Sin`,e,void 0)},831593:e=>{r.jb(`Cos`,e,void 0)},831644:e=>{r.jb(`Tan`,e,void 0)},831695:e=>{r.jb(`Asin`,e,void 0)},831747:e=>{r.jb(`Acos`,e,void 0)},831799:e=>{r.jb(`Atan`,e,void 0)},831851:e=>{r.jb(`Sinh`,e,void 0)},831903:e=>{r.jb(`Cosh`,e,void 0)},831955:e=>{r.jb(`Asinh`,e,void 0)},832008:e=>{r.jb(`Acosh`,e,void 0)},832061:e=>{r.jb(`Atanh`,e,void 0)},832114:e=>{r.jb(`Tanh`,e,void 0)},832166:e=>{r.jb(`Not`,e,void 0)},832217:(e,t,n)=>{r.jb(`Clip`,e,{min:t,max:n})},832286:e=>{r.jb(`Clip`,e,void 0)},832338:(e,t)=>{r.jb(`Elu`,e,{alpha:t})},832396:e=>{r.jb(`Gelu`,e,void 0)},832448:e=>{r.jb(`Relu`,e,void 0)},832500:(e,t)=>{r.jb(`LeakyRelu`,e,{alpha:t})},832564:(e,t)=>{r.jb(`ThresholdedRelu`,e,{alpha:t})},832634:(e,t)=>{r.jb(`Cast`,e,{to:t})},832692:e=>{r.jb(`Add`,e,void 0)},832743:e=>{r.jb(`Sub`,e,void 0)},832794:e=>{r.jb(`Mul`,e,void 0)},832845:e=>{r.jb(`Div`,e,void 0)},832896:e=>{r.jb(`Pow`,e,void 0)},832947:e=>{r.jb(`Equal`,e,void 0)},833e3:e=>{r.jb(`Greater`,e,void 0)},833055:e=>{r.jb(`GreaterOrEqual`,e,void 0)},833117:e=>{r.jb(`Less`,e,void 0)},833169:e=>{r.jb(`LessOrEqual`,e,void 0)},833228:(e,t,n,i,a)=>{r.jb(`ReduceMean`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(R().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833403:(e,t,n,i,a)=>{r.jb(`ReduceMax`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(R().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833577:(e,t,n,i,a)=>{r.jb(`ReduceMin`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(R().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833751:(e,t,n,i,a)=>{r.jb(`ReduceProd`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(R().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},833926:(e,t,n,i,a)=>{r.jb(`ReduceSum`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(R().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834100:(e,t,n,i,a)=>{r.jb(`ReduceL1`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(R().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834273:(e,t,n,i,a)=>{r.jb(`ReduceL2`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(R().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834446:(e,t,n,i,a)=>{r.jb(`ReduceLogSum`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(R().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834623:(e,t,n,i,a)=>{r.jb(`ReduceSumSquare`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(R().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834803:(e,t,n,i,a)=>{r.jb(`ReduceLogSumExp`,e,{keepDims:!!t,noopWithEmptyAxes:!!n,axes:i?Array.from(R().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},834983:e=>{r.jb(`Where`,e,void 0)},835036:(e,t,n)=>{r.jb(`Transpose`,e,{perm:t?Array.from(R().subarray(Number(t)>>>0,Number(n)>>>0)):[]})},835160:(e,t,n,i)=>{r.jb(`DepthToSpace`,e,{blocksize:t,mode:Be(n),format:i?`NHWC`:`NCHW`})},835293:(e,t,n,i)=>{r.jb(`DepthToSpace`,e,{blocksize:t,mode:Be(n),format:i?`NHWC`:`NCHW`})},835426:(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h)=>{r.jb(`ConvTranspose`,e,{format:l?`NHWC`:`NCHW`,autoPad:t,dilations:[n],group:i,kernelShape:[a],pads:[o,s],strides:[c],wIsConst:()=>!!I()[u>>>0],outputPadding:d?Array.from(R().subarray(Number(d)>>>0,Number(f)>>>0)):[],outputShape:p?Array.from(R().subarray(Number(p)>>>0,Number(m)>>>0)):[],activation:Be(h)})},835859:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`ConvTranspose`,e,{format:c?`NHWC`:`NCHW`,autoPad:t,dilations:Array.from(R().subarray(Number(n)>>>0,2+(Number(n)>>>0)>>>0)),group:i,kernelShape:Array.from(R().subarray(Number(a)>>>0,2+(Number(a)>>>0)>>>0)),pads:Array.from(R().subarray(Number(o)>>>0,4+(Number(o)>>>0)>>>0)),strides:Array.from(R().subarray(Number(s)>>>0,2+(Number(s)>>>0)>>>0)),wIsConst:()=>!!I()[l>>>0],outputPadding:u?Array.from(R().subarray(Number(u)>>>0,Number(d)>>>0)):[],outputShape:f?Array.from(R().subarray(Number(f)>>>0,Number(p)>>>0)):[],activation:Be(m)})},836520:(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h)=>{r.jb(`ConvTranspose`,e,{format:l?`NHWC`:`NCHW`,autoPad:t,dilations:[n],group:i,kernelShape:[a],pads:[o,s],strides:[c],wIsConst:()=>!!I()[u>>>0],outputPadding:d?Array.from(R().subarray(Number(d)>>>0,Number(f)>>>0)):[],outputShape:p?Array.from(R().subarray(Number(p)>>>0,Number(m)>>>0)):[],activation:Be(h)})},836953:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`ConvTranspose`,e,{format:c?`NHWC`:`NCHW`,autoPad:t,dilations:Array.from(R().subarray(Number(n)>>>0,2+(Number(n)>>>0)>>>0)),group:i,kernelShape:Array.from(R().subarray(Number(a)>>>0,2+(Number(a)>>>0)>>>0)),pads:Array.from(R().subarray(Number(o)>>>0,4+(Number(o)>>>0)>>>0)),strides:Array.from(R().subarray(Number(s)>>>0,2+(Number(s)>>>0)>>>0)),wIsConst:()=>!!I()[l>>>0],outputPadding:u?Array.from(R().subarray(Number(u)>>>0,Number(d)>>>0)):[],outputShape:f?Array.from(R().subarray(Number(f)>>>0,Number(p)>>>0)):[],activation:Be(m)})},837614:(e,t)=>{r.jb(`GlobalAveragePool`,e,{format:t?`NHWC`:`NCHW`})},837705:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`AveragePool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(R().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(R().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(R().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(R().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},838184:(e,t)=>{r.jb(`GlobalAveragePool`,e,{format:t?`NHWC`:`NCHW`})},838275:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`AveragePool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(R().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(R().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(R().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(R().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},838754:(e,t)=>{r.jb(`GlobalMaxPool`,e,{format:t?`NHWC`:`NCHW`})},838841:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`MaxPool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(R().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(R().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(R().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(R().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},839316:(e,t)=>{r.jb(`GlobalMaxPool`,e,{format:t?`NHWC`:`NCHW`})},839403:(e,t,n,i,a,o,s,c,l,u,d,f,p,m)=>{r.jb(`MaxPool`,e,{format:m?`NHWC`:`NCHW`,auto_pad:t,ceil_mode:n,count_include_pad:i,storage_order:a,dilations:o?Array.from(R().subarray(Number(o)>>>0,Number(s)>>>0)):[],kernel_shape:c?Array.from(R().subarray(Number(c)>>>0,Number(l)>>>0)):[],pads:u?Array.from(R().subarray(Number(u)>>>0,Number(d)>>>0)):[],strides:f?Array.from(R().subarray(Number(f)>>>0,Number(p)>>>0)):[]})},839878:(e,t,n,i,a)=>{r.jb(`Gemm`,e,{alpha:t,beta:n,transA:i,transB:a})},839982:e=>{r.jb(`MatMul`,e,void 0)},840036:(e,t,n,i)=>{r.jb(`ArgMax`,e,{keepDims:!!t,selectLastIndex:!!n,axis:i})},840144:(e,t,n,i)=>{r.jb(`ArgMin`,e,{keepDims:!!t,selectLastIndex:!!n,axis:i})},840252:(e,t)=>{r.jb(`Softmax`,e,{axis:t})},840315:(e,t)=>{r.jb(`Concat`,e,{axis:t})},840375:(e,t,n,i,a)=>{r.jb(`Split`,e,{axis:t,numOutputs:n,splitSizes:i?Array.from(R().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},840531:e=>{r.jb(`Expand`,e,void 0)},840585:(e,t)=>{r.jb(`Gather`,e,{axis:Number(t)})},840656:(e,t)=>{r.jb(`GatherElements`,e,{axis:Number(t)})},840735:(e,t)=>{r.jb(`GatherND`,e,{batch_dims:Number(t)})},840814:(e,t,n,i,a,o,s,c,l,u,d)=>{r.jb(`Resize`,e,{antialias:t,axes:n?Array.from(R().subarray(Number(n)>>>0,Number(i)>>>0)):[],coordinateTransformMode:Be(a),cubicCoeffA:o,excludeOutside:s,extrapolationValue:c,keepAspectRatioPolicy:Be(l),mode:Be(u),nearestMode:Be(d)})},841176:(e,t,n,i,a,o,s)=>{r.jb(`Slice`,e,{starts:t?Array.from(R().subarray(Number(t)>>>0,Number(n)>>>0)):[],ends:i?Array.from(R().subarray(Number(i)>>>0,Number(a)>>>0)):[],axes:o?Array.from(R().subarray(Number(o)>>>0,Number(s)>>>0)):[]})},841440:e=>{r.jb(`Tile`,e,void 0)},841492:(e,t,n)=>{r.jb(`InstanceNormalization`,e,{epsilon:t,format:n?`NHWC`:`NCHW`})},841606:(e,t,n)=>{r.jb(`InstanceNormalization`,e,{epsilon:t,format:n?`NHWC`:`NCHW`})},841720:e=>{r.jb(`Range`,e,void 0)},841773:(e,t)=>{r.jb(`Einsum`,e,{equation:Be(t)})},841854:(e,t,n,i,a)=>{r.jb(`Pad`,e,{mode:t,value:n,pads:i?Array.from(R().subarray(Number(i)>>>0,Number(a)>>>0)):[]})},841997:(e,t,n,i,a,o)=>{r.jb(`BatchNormalization`,e,{epsilon:t,momentum:n,spatial:!!a,trainingMode:!!i,format:o?`NHWC`:`NCHW`})},842166:(e,t,n,i,a,o)=>{r.jb(`BatchNormalization`,e,{epsilon:t,momentum:n,spatial:!!a,trainingMode:!!i,format:o?`NHWC`:`NCHW`})},842335:(e,t,n)=>{r.jb(`CumSum`,e,{exclusive:Number(t),reverse:Number(n)})},842432:(e,t,n)=>{r.jb(`DequantizeLinear`,e,{axis:t,blockSize:n})},842522:(e,t,n,i,a)=>{r.jb(`GridSample`,e,{align_corners:t,mode:Be(n),padding_mode:Be(i),format:a?`NHWC`:`NCHW`})},842692:(e,t,n,i,a)=>{r.jb(`GridSample`,e,{align_corners:t,mode:Be(n),padding_mode:Be(i),format:a?`NHWC`:`NCHW`})},842862:(e,t)=>{r.jb(`ScatterND`,e,{reduction:Be(t)})},842947:(e,t,n,i,a,o,s,c,l)=>{r.jb(`Attention`,e,{numHeads:t,isUnidirectional:n,maskFilterValue:i,scale:a,doRotary:o,qkvHiddenSizes:s?Array.from(R().subarray(Number(c)>>>0,Number(c)+s>>>0)):[],pastPresentShareBuffer:!!l})},843219:e=>{r.jb(`BiasAdd`,e,void 0)},843274:e=>{r.jb(`BiasSplitGelu`,e,void 0)},843335:e=>{r.jb(`FastGelu`,e,void 0)},843391:(e,t,n,i,a,o,s,c,l,u,d,f,p,m,h,g)=>{r.jb(`Conv`,e,{format:f?`NHWC`:`NCHW`,auto_pad:t,dilations:n?Array.from(R().subarray(Number(n)>>>0,Number(i)>>>0)):[],group:a,kernel_shape:o?Array.from(R().subarray(Number(o)>>>0,Number(s)>>>0)):[],pads:c?Array.from(R().subarray(Number(c)>>>0,Number(l)>>>0)):[],strides:u?Array.from(R().subarray(Number(u)>>>0,Number(d)>>>0)):[],w_is_const:()=>!!I()[Number(p)>>>0],activation:Be(m),activation_params:h?Array.from(re().subarray(Number(h)>>>0,Number(g)>>>0)):[]})},843975:e=>{r.jb(`Gelu`,e,void 0)},844027:(e,t,n,i,a,o,s,c,l)=>{r.jb(`GroupQueryAttention`,e,{numHeads:t,kvNumHeads:n,scale:i,softcap:a,doRotary:o,rotaryInterleaved:s,smoothSoftmax:c,localWindowSize:l})},844244:(e,t,n,i)=>{r.jb(`LayerNormalization`,e,{axis:t,epsilon:n,simplified:!!i})},844355:(e,t,n,i)=>{r.jb(`LayerNormalization`,e,{axis:t,epsilon:n,simplified:!!i})},844466:(e,t,n,i,a,o)=>{r.jb(`MatMulNBits`,e,{k:t,n,accuracyLevel:i,bits:a,blockSize:o})},844593:(e,t,n,i,a,o)=>{r.jb(`MultiHeadAttention`,e,{numHeads:t,isUnidirectional:n,maskFilterValue:i,scale:a,doRotary:o})},844752:(e,t)=>{r.jb(`QuickGelu`,e,{alpha:t})},844816:(e,t,n,i,a)=>{r.jb(`RotaryEmbedding`,e,{interleaved:!!t,numHeads:n,rotaryEmbeddingDim:i,scale:a})},844955:(e,t,n)=>{r.jb(`SkipLayerNormalization`,e,{epsilon:t,simplified:!!n})},845057:(e,t,n)=>{r.jb(`SkipLayerNormalization`,e,{epsilon:t,simplified:!!n})},845159:(e,t,n,i)=>{r.jb(`GatherBlockQuantized`,e,{gatherAxis:t,quantizeAxis:n,blockSize:i})},845280:e=>{r.Zb(e)},845314:(e,t)=>r.ac(Number(e),Number(t),r.Fb.dc,r.Fb.errors)};function me(e,t,n){return sn(async()=>{await r.Xb(Number(e),Number(t),Number(n))})}function V(){return typeof wasmOffsetConverter<`u`}class he{name=`ExitStatus`;constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var ge=e=>{e.terminate(),e.onmessage=()=>{}},_e=[],ve=e=>{we.length==0&&(je(),Ae(we[0]));var t=we.pop();if(!t)return 6;Te.push(t),De[e.Ab]=t,t.Ab=e.Ab;var n={Bb:`run`,fc:e.ec,Hb:e.Hb,Ab:e.Ab};return t.postMessage(n,e.Mb),0},ye=0,be=(e,t,...n)=>{for(var r=2*n.length,i=Pr(),a=Nr(8*r),o=a>>>3,s=0;s>>0]=c)}return e=Er(e,0,r,a,t),Mr(i),e};function xe(e){if(s)return be(0,1,e);if(S=e,!(0{if(S=e,s)throw Se(e),`unwind`;xe(e)},we=[],Te=[],Ee=[],De={},Oe=e=>{var t=e.Ab;delete De[t],we.push(e),Te.splice(Te.indexOf(e),1),e.Ab=0,Dr(t)};function ke(){Ee.forEach(e=>e())}var Ae=e=>new Promise(t=>{e.onmessage=n=>{var i=(n=n.data).Bb;if(n.Gb&&n.Gb!=xr()){var a=De[n.Gb];a?a.postMessage(n,n.Mb):y(`Internal error! Worker sent a message "${i}" to target pthread ${n.Gb}, but that thread no longer exists!`)}else i===`checkMailbox`?zt():i===`spawnThread`?ve(n):i===`cleanupThread`?Oe(De[n.hc]):i===`loaded`?(e.loaded=!0,t(e)):i===`alert`?alert(`Thread ${n.ic}: ${n.text}`):n.target===`setimmediate`?e.postMessage(n):i===`callHandler`?r[n.Qb](...n.args):i&&y(`worker sent an unknown command ${i}`)},e.onerror=e=>{throw y(`worker sent an error! ${e.filename}:${e.lineno}: ${e.message}`),e};var n,i=[];for(n of[])r.propertyIsEnumerable(n)&&i.push(n);e.postMessage({Bb:`load`,Rb:i,kc:b,lc:x})});function je(){var e=new Worker((()=>{let e=URL;return self.location.href>`file:`&&self.location.href<`file;`?new e(`ort.bundle.min.mjs`,self.location.href):new URL(self.location.href)})(),{type:`module`,workerData:`em-pthread`,name:`em-pthread`});we.push(e)}var Me=e=>{oe();var t=ne()[e+52>>>2>>>0];e=ne()[e+56>>>2>>>0],jr(t,t-e),Mr(t)},Ne=(e,t)=>{ye=0,e=Fr(e,t),0>>=0);throw t>>>=0,n>>>=0,ne()[r.Ib+16>>>2>>>0]=0,ne()[r.Ib+4>>>2>>>0]=t,ne()[r.Ib+8>>>2>>>0]=n,e}function Ie(e,t,n,r){return s?be(2,1,e,t,n,r):Le(e,t,n,r)}function Le(e,t,n,r){if(e>>>=0,n>>>=0,r>>>=0,c===void 0)return 6;var i=[];return s&&i.length===0?Ie(e,t>>>=0,n,r):(e={ec:n,Ab:e,Hb:r,Mb:i},s?(e.Bb=`spawnThread`,postMessage(e,i),0):ve(e))}var Re=typeof TextDecoder<`u`?new TextDecoder:void 0,ze=(e,t=0,n=NaN)=>{var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16(i=(240&i)==224?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r},Be=(e,t)=>(e>>>=0)?ze(L(),e,t):``;function Ve(e,t,n){return s?be(3,1,e,t,n):0}function He(e,t){if(s)return be(4,1,e,t)}var Ue=e=>{for(var t=0,n=0;n=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t},We=(e,t,n)=>{var r=L();if(t>>>=0,0=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),127>=o){if(t>=n)break;r[t++>>>0]=o}else{if(2047>=o){if(t+1>=n)break;r[t++>>>0]=192|o>>6}else{if(65535>=o){if(t+2>=n)break;r[t++>>>0]=224|o>>12}else{if(t+3>=n)break;r[t++>>>0]=240|o>>18,r[t++>>>0]=128|o>>12&63}r[t++>>>0]=128|o>>6&63}r[t++>>>0]=128|63&o}}r[t>>>0]=0,e=t-i}else e=0;return e};function Ge(e,t){if(s)return be(5,1,e,t)}function Ke(e,t,n){if(s)return be(6,1,e,t,n)}function qe(e,t,n){return s?be(7,1,e,t,n):0}function Je(e,t){if(s)return be(8,1,e,t)}function Ye(e,t,n){if(s)return be(9,1,e,t,n)}function Xe(e,t,n,r){if(s)return be(10,1,e,t,n,r)}function Ze(e,t,n,r){if(s)return be(11,1,e,t,n,r)}function Qe(e,t,n,r){if(s)return be(12,1,e,t,n,r)}function $e(e){if(s)return be(13,1,e)}function et(e,t){if(s)return be(14,1,e,t)}function tt(e,t,n){if(s)return be(15,1,e,t,n)}var nt,rt,it=()=>de(``),at=e=>{for(var t=``;L()[e>>>0];)t+=nt[L()[e++>>>0]];return t},ot={},st={},ct={};function lt(e,t,n={}){return function(e,t,n={}){var r=t.name;if(!e)throw new rt(`type "${r}" must have a positive integer typeid pointer`);if(st.hasOwnProperty(e)){if(n.Sb)return;throw new rt(`Cannot register type '${r}' twice`)}st[e]=t,delete ct[e],ot.hasOwnProperty(e)&&(t=ot[e],delete ot[e],t.forEach(e=>e()))}(e,t,n)}var ut=(e,t,n)=>{switch(t){case 1:return n?e=>I()[e>>>0]:e=>L()[e>>>0];case 2:return n?e=>ee()[e>>>1>>>0]:e=>te()[e>>>1>>>0];case 4:return n?e=>R()[e>>>2>>>0]:e=>ne()[e>>>2>>>0];case 8:return n?e=>A[e>>>3]:e=>j[e>>>3];default:throw TypeError(`invalid integer width (${t}): ${e}`)}};function dt(e,t,n){n>>>=0,lt(e>>>=0,{name:t=at(t>>>0),fromWireType:e=>e,toWireType:function(e,t){if(typeof t!=`bigint`&&typeof t!=`number`)throw t=t===null?`null`:(e=typeof t)==`object`||e===`array`||e===`function`?t.toString():``+t,TypeError(`Cannot convert "${t}" to ${this.name}`);return typeof t==`number`&&(t=BigInt(t)),t},Cb:ft,readValueFromPointer:ut(t,n,t.indexOf(`u`)==-1),Db:null})}var ft=8;function pt(e,t,n,r){lt(e>>>=0,{name:t=at(t>>>0),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},Cb:ft,readValueFromPointer:function(e){return this.fromWireType(L()[e>>>0])},Db:null})}var mt=[],ht=[];function gt(e){9<(e>>>=0)&&--ht[e+1]==0&&(ht[e]=void 0,mt.push(e))}var _t=e=>{if(!e)throw new rt(`Cannot use deleted val. handle = `+e);return ht[e]},vt=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=mt.pop()||ht.length;return ht[t]=e,ht[t+1]=1,t}};function yt(e){return this.fromWireType(ne()[e>>>2>>>0])}var bt={name:`emscripten::val`,fromWireType:e=>{var t=_t(e);return gt(e),t},toWireType:(e,t)=>vt(t),Cb:ft,readValueFromPointer:yt,Db:null};function xt(e){return lt(e>>>0,bt)}var St=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(re()[e>>>2>>>0])};case 8:return function(e){return this.fromWireType(ie()[e>>>3>>>0])};default:throw TypeError(`invalid float width (${t}): ${e}`)}};function Ct(e,t,n){n>>>=0,lt(e>>>=0,{name:t=at(t>>>0),fromWireType:e=>e,toWireType:(e,t)=>t,Cb:ft,readValueFromPointer:St(t,n),Db:null})}function wt(e,t,n,r,i){if(e>>>=0,n>>>=0,t=at(t>>>0),i===-1&&(i=4294967295),i=e=>e,r===0){var a=32-8*n;i=e=>e<>>a}var o=t.includes(`unsigned`)?function(e,t){return t>>>0}:function(e,t){return t};lt(e,{name:t,fromWireType:i,toWireType:o,Cb:ft,readValueFromPointer:ut(t,n,r!==0),Db:null})}function Tt(e,t,n){function r(e){var t=ne()[e>>>2>>>0];return e=ne()[e+4>>>2>>>0],new i(I().buffer,e,t)}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];lt(e>>>=0,{name:n=at(n>>>0),fromWireType:r,Cb:ft,readValueFromPointer:r},{Sb:!0})}function Et(e,t){lt(e>>>=0,{name:t=at(t>>>0),fromWireType:function(e){for(var t,n=ne()[e>>>2>>>0],r=e+4,i=r,a=0;a<=n;++a){var o=r+a;a!=n&&L()[o>>>0]!=0||(i=Be(i,o-i),t===void 0?t=i:(t+=`\0`,t+=i),i=o+1)}return Sr(e),t},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n=typeof t==`string`;if(!(n||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array))throw new rt(`Cannot pass non-string to std::string`);var r=n?Ue(t):t.length,i=Cr(4+r+1),a=i+4;if(ne()[i>>>2>>>0]=r,n)We(t,a,r+1);else if(n)for(n=0;n>>0]=o}else for(n=0;n>>0]=t[n];return e!==null&&e.push(Sr,i),i},Cb:ft,readValueFromPointer:yt,Db(e){Sr(e)}})}var Dt=typeof TextDecoder<`u`?new TextDecoder(`utf-16le`):void 0,Ot=(e,t)=>{for(var n=e>>1,r=n+t/2;!(n>=r)&&te()[n>>>0];)++n;if(32<(n<<=1)-e&&Dt)return Dt.decode(L().slice(e,n));for(n=``,r=0;!(r>=t/2);++r){var i=ee()[e+2*r>>>1>>>0];if(i==0)break;n+=String.fromCharCode(i)}return n},kt=(e,t,n)=>{if(n??=2147483647,2>n)return 0;var r=t;n=(n-=2)<2*e.length?n/2:e.length;for(var i=0;i>>1>>>0]=a,t+=2}return ee()[t>>>1>>>0]=0,t-r},At=e=>2*e.length,jt=(e,t)=>{for(var n=0,r=``;!(n>=t/4);){var i=R()[e+4*n>>>2>>>0];if(i==0)break;++n,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}return r},Mt=(e,t,n)=>{if(t>>>=0,n??=2147483647,4>n)return 0;var r=t;n=r+n-4;for(var i=0;i=a&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),R()[t>>>2>>>0]=a,(t+=4)+4>n)break}return R()[t>>>2>>>0]=0,t-r},Nt=e=>{for(var t=0,n=0;n=r&&++n,t+=4}return t};function Pt(e,t,n){if(e>>>=0,t>>>=0,n=at(n>>>=0),t===2)var r=Ot,i=kt,a=At,o=e=>te()[e>>>1>>>0];else t===4&&(r=jt,i=Mt,a=Nt,o=e=>ne()[e>>>2>>>0]);lt(e,{name:n,fromWireType:e=>{for(var n,i=ne()[e>>>2>>>0],a=e+4,s=0;s<=i;++s){var c=e+4+s*t;s!=i&&o(c)!=0||(a=r(a,c-a),n===void 0?n=a:(n+=`\0`,n+=a),a=c+t)}return Sr(e),n},toWireType:(e,r)=>{if(typeof r!=`string`)throw new rt(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=Cr(4+o+t);return ne()[s>>>2>>>0]=o/t,i(r,s+4,o+t),e!==null&&e.push(Sr,s),s},Cb:ft,readValueFromPointer:yt,Db(e){Sr(e)}})}function Ft(e,t){lt(e>>>=0,{Tb:!0,name:t=at(t>>>0),Cb:0,fromWireType:()=>{},toWireType:()=>{}})}function It(e){wr(e>>>0,!o,1,!a,131072,!1),ke()}var Lt=e=>{if(!P)try{if(e(),!(0>>=0,typeof Atomics.jc==`function`&&(Atomics.jc(R(),e>>>2,e).value.then(zt),e+=128,Atomics.store(R(),e>>>2,1))}var zt=()=>{var e=xr();e&&(Rt(e),Lt(Ar))};function Bt(e,t){(e>>>=0)==t>>>0?setTimeout(zt):s?postMessage({Gb:e,Bb:`checkMailbox`}):(e=De[e])&&e.postMessage({Bb:`checkMailbox`})}var Vt=[];function Ht(e,t,n,r,i){for(t>>>=0,r/=2,Vt.length=r,n=i>>>0>>>3,i=0;i>>0];return(t?pe[t]:vr[e])(...Vt)}var Ut=()=>{ye=0};function Wt(e){e>>>=0,s?postMessage({Bb:`cleanupThread`,hc:e}):Oe(De[e])}function Gt(e){}var Kt=(e,t)=>{var n=st[e];if(n===void 0)throw e=yr(e),n=at(e),Sr(e),new rt(`${t} has unknown type ${n}`);return n},qt=(e,t,n)=>{var r=[];return e=e.toWireType(r,n),r.length&&(ne()[t>>>2>>>0]=vt(r)),e};function Jt(e,t,n){return t>>>=0,n>>>=0,e=_t(e>>>0),t=Kt(t,`emval::as`),qt(t,n,e)}function Yt(e,t){return t>>>=0,e=_t(e>>>0),(t=Kt(t,`emval::as`)).toWireType(null,e)}var Xt=e=>{try{e()}catch(e){de(e)}},Zt=0,Qt=null,$t=0,en=[],tn={},nn={},rn=0,an=null,on=[];function sn(e){return function(e){if(!P){if(Zt===0){var t=!1,n=!1;e((e=0)=>{if(!P&&($t=e,t=!0,n)){Zt=2,Xt(()=>Rr(Qt)),typeof MainLoop<`u`&&MainLoop.Pb&&MainLoop.resume(),e=!1;try{var r=function(){var e=R()[Qt+8>>>2>>>0];return e=_r[nn[e]],--ye,e()}()}catch(t){r=t,e=!0}var i=!1;if(!Qt){var a=an;a&&(an=null,(e?a.reject:a.resolve)(r),i=!0)}if(e&&!i)throw r}}),n=!0,t||(Zt=1,Qt=function(){var e=Cr(65548),t=e+12;ne()[e>>>2>>>0]=t,ne()[e+4>>>2>>>0]=t+65536,t=en[0];var n=tn[t];return n===void 0&&(n=rn++,tn[t]=n,nn[n]=t),t=n,R()[e+8>>>2>>>0]=t,e}(),typeof MainLoop<`u`&&MainLoop.Pb&&MainLoop.pause(),Xt(()=>Ir(Qt)))}else Zt===2?(Zt=0,Xt(zr),Sr(Qt),Qt=null,on.forEach(Lt)):de(`invalid state: ${Zt}`);return $t}}(t=>{e().then(t)})}function cn(e){return e>>>=0,sn(async()=>vt(await _t(e)))}var ln=[];function un(e,t,n,r){return n>>>=0,r>>>=0,(e=ln[e>>>0])(null,t=_t(t>>>0),n,r)}var dn={},fn=e=>{var t=dn[e];return t===void 0?at(e):t};function pn(e,t,n,r,i){return n>>>=0,r>>>=0,i>>>=0,(e=ln[e>>>0])(t=_t(t>>>0),t[n=fn(n)],r,i)}var mn=()=>typeof globalThis==`object`?globalThis:Function(`return this`)();function hn(e){return(e>>>=0)==0?vt(mn()):(e=fn(e),vt(mn()[e]))}var gn=e=>{var t=ln.length;return ln.push(e),t},_n=(e,t)=>{for(var n=Array(e),r=0;r>>2>>>0],`parameter `+r);return n},vn=(e,t)=>Object.defineProperty(t,"name",{value:e});function yn(e,t,n){var r=(t=_n(e,t>>>0)).shift();e--;var i=`return function (obj, func, destructorsRef, args) { +`,a=0,o=[];n===0&&o.push(`obj`);for(var s=[`retType`],c=[r],l=0;le.name).join(`, `)}) => ${r.name}>`,gn(vn(n,e))}function bn(e){return e=fn(e>>>0),vt(r[e])}function xn(e,t){return t>>>=0,e=_t(e>>>0),t=_t(t),vt(e[t])}function Sn(e){9<(e>>>=0)&&(ht[e+1]+=1)}function Cn(){return vt([])}function wn(e){e=_t(e>>>0);for(var t=Array(e.length),n=0;n>>0))}function En(){return vt({})}function Dn(e){for(var t=_t(e>>>=0);t.length;){var n=t.pop();t.pop()(n)}gt(e)}function On(e,t,n){t>>>=0,n>>>=0,e=_t(e>>>0),t=_t(t),n=_t(n),e[t]=n}function kn(e,t){return t>>>=0,e=(e=Kt(e>>>0,`_emval_take_value`)).readValueFromPointer(t),vt(e)}function An(e,t){e=-9007199254740992>e||9007199254740992>>=0,e=new Date(1e3*e),R()[t>>>2>>>0]=e.getUTCSeconds(),R()[t+4>>>2>>>0]=e.getUTCMinutes(),R()[t+8>>>2>>>0]=e.getUTCHours(),R()[t+12>>>2>>>0]=e.getUTCDate(),R()[t+16>>>2>>>0]=e.getUTCMonth(),R()[t+20>>>2>>>0]=e.getUTCFullYear()-1900,R()[t+24>>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,R()[t+28>>>2>>>0]=e}var jn=e=>e%4==0&&(e%100!=0||e%400==0),Mn=[0,31,60,91,121,152,182,213,244,274,305,335],Nn=[0,31,59,90,120,151,181,212,243,273,304,334];function Pn(e,t){e=-9007199254740992>e||9007199254740992>>=0,e=new Date(1e3*e),R()[t>>>2>>>0]=e.getSeconds(),R()[t+4>>>2>>>0]=e.getMinutes(),R()[t+8>>>2>>>0]=e.getHours(),R()[t+12>>>2>>>0]=e.getDate(),R()[t+16>>>2>>>0]=e.getMonth(),R()[t+20>>>2>>>0]=e.getFullYear()-1900,R()[t+24>>>2>>>0]=e.getDay();var n=(jn(e.getFullYear())?Mn:Nn)[e.getMonth()]+e.getDate()-1|0;R()[t+28>>>2>>>0]=n,R()[t+36>>>2>>>0]=-60*e.getTimezoneOffset(),n=new Date(e.getFullYear(),6,1).getTimezoneOffset();var r=new Date(e.getFullYear(),0,1).getTimezoneOffset();e=0|(n!=r&&e.getTimezoneOffset()==Math.min(r,n)),R()[t+32>>>2>>>0]=e}function Fn(e){e>>>=0;var t=new Date(R()[e+20>>>2>>>0]+1900,R()[e+16>>>2>>>0],R()[e+12>>>2>>>0],R()[e+8>>>2>>>0],R()[e+4>>>2>>>0],R()[e>>>2>>>0],0),n=R()[e+32>>>2>>>0],r=t.getTimezoneOffset(),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=new Date(t.getFullYear(),0,1).getTimezoneOffset(),o=Math.min(a,i);return 0>n?R()[e+32>>>2>>>0]=+(i!=a&&o==r):0>>2>>>0]=t.getDay(),n=(jn(t.getFullYear())?Mn:Nn)[t.getMonth()]+t.getDate()-1|0,R()[e+28>>>2>>>0]=n,R()[e>>>2>>>0]=t.getSeconds(),R()[e+4>>>2>>>0]=t.getMinutes(),R()[e+8>>>2>>>0]=t.getHours(),R()[e+12>>>2>>>0]=t.getDate(),R()[e+16>>>2>>>0]=t.getMonth(),R()[e+20>>>2>>>0]=t.getYear(),e=t.getTime(),BigInt(isNaN(e)?-1:e/1e3)}function In(e,t,n,r,i,a,o){return s?be(16,1,e,t,n,r,i,a,o):-52}function Ln(e,t,n,r,i,a){if(s)return be(17,1,e,t,n,r,i,a)}var H={},Rn=()=>performance.timeOrigin+performance.now();function zn(e,t){return s?be(18,1,e,t):(H[e]&&(clearTimeout(H[e].id),delete H[e]),t&&(H[e]={id:setTimeout(()=>{delete H[e],Lt(()=>kr(e,performance.timeOrigin+performance.now()))},t),qc:t}),0)}function Bn(e,t,n,r){e>>>=0,t>>>=0,n>>>=0,r>>>=0;var i=new Date().getFullYear(),a=new Date(i,0,1).getTimezoneOffset();i=new Date(i,6,1).getTimezoneOffset();var o=Math.max(a,i);ne()[e>>>2>>>0]=60*o,R()[t>>>2>>>0]=+(a!=i),e=(t=e=>{var t=Math.abs(e);return`UTC${0<=e?`-`:`+`}${String(Math.floor(t/60)).padStart(2,`0`)}${String(t%60).padStart(2,`0`)}`})(a),t=t(i),iDate.now(),Hn=1;function Un(e,t,n){if(!(0<=e&&3>=e))return 28;if(e===0)e=Date.now();else{if(!Hn)return 52;e=performance.timeOrigin+performance.now()}return A[n>>>0>>>3]=BigInt(Math.round(1e6*e)),0}var Wn=[],Gn=(e,t)=>{Wn.length=0;for(var n;n=L()[e++>>>0];){var r=n!=105;t+=(r&=n!=112)&&t%8?4:0,Wn.push(n==112?ne()[t>>>2>>>0]:n==106?A[t>>>3]:n==105?R()[t>>>2>>>0]:ie()[t>>>3>>>0]),t+=r?8:4}return Wn};function Kn(e,t,n){return e>>>=0,t=Gn(t>>>0,n>>>0),pe[e](...t)}function qn(e,t,n){return e>>>=0,t=Gn(t>>>0,n>>>0),pe[e](...t)}var Jn=()=>{};function Yn(e,t){return y(Be(e>>>0,t>>>0))}var Xn=()=>{throw ye+=1,`unwind`};function Zn(){return 4294901760}var Qn=()=>navigator.hardwareConcurrency;function $n(){return de(`Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER`),0}function er(e){e>>>=0;var t=L().length;if(e<=t||4294901760=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);e:{r=(Math.min(4294901760,65536*Math.ceil(Math.max(e,r)/65536))-b.buffer.byteLength+65535)/65536|0;try{b.grow(r),oe();var i=1;break e}catch{}i=void 0}if(i)return!0}return!1}var U=()=>(de(`Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER`),0),tr={},nr=e=>{e.forEach(e=>{var t=U();t&&(tr[t]=e)})};function rr(){var e=Error().stack.toString().split(` +`);return e[0]==`Error`&&e.shift(),nr(e),tr.Lb=U(),tr.cc=e,tr.Lb}function ir(e,t,n){if(e>>>=0,t>>>=0,tr.Lb==e)var r=tr.cc;else(r=Error().stack.toString().split(` +`))[0]==`Error`&&r.shift(),nr(r);for(var i=3;r[i]&&U()!=e;)++i;for(e=0;e>>2>>>0]=U();return e}var ar,or={},sr=()=>{if(!ar){var e,t={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(typeof navigator==`object`&&navigator.languages&&navigator.languages[0]||`C`).replace(`-`,`_`)+`.UTF-8`,_:`./this.program`};for(e in or)or[e]===void 0?delete t[e]:t[e]=or[e];var n=[];for(e in t)n.push(`${e}=${t[e]}`);ar=n}return ar};function cr(e,t){if(s)return be(19,1,e,t);e>>>=0,t>>>=0;var n=0;return sr().forEach((r,i)=>{var a=t+n;for(i=ne()[e+4*i>>>2>>>0]=a,a=0;a>>0]=r.charCodeAt(a);I()[i>>>0]=0,n+=r.length+1}),0}function lr(e,t){if(s)return be(20,1,e,t);e>>>=0,t>>>=0;var n=sr();ne()[e>>>2>>>0]=n.length;var r=0;return n.forEach(e=>r+=e.length+1),ne()[t>>>2>>>0]=r,0}function ur(e){return s?be(21,1,e):52}function dr(e,t,n,r){return s?be(22,1,e,t,n,r):52}function fr(e,t,n,r){return s?be(23,1,e,t,n,r):70}var pr=[null,[],[]];function mr(e,t,n,r){if(s)return be(24,1,e,t,n,r);t>>>=0,n>>>=0,r>>>=0;for(var i=0,a=0;a>>2>>>0],c=ne()[t+4>>>2>>>0];t+=8;for(var l=0;l>>0],d=pr[e];u===0||u===10?((e===1?v:y)(ze(d)),d.length=0):d.push(u)}i+=c}return ne()[r>>>2>>>0]=i,0}s||function(){for(var e=r.numThreads-1;e--;)je();_e.unshift(()=>{ce++,function(e){s?e():Promise.all(we.map(Ae)).then(e)}(()=>ue())})}();for(var hr=Array(256),gr=0;256>gr;++gr)hr[gr]=String.fromCharCode(gr);nt=hr,rt=r.BindingError=class extends Error{constructor(e){super(e),this.name=`BindingError`}},r.InternalError=class extends Error{constructor(e){super(e),this.name=`InternalError`}},ht.push(0,1,void 0,1,null,1,!0,1,!1,1),r.count_emval_handles=()=>ht.length/2-5-mt.length;var _r,vr=[xe,Se,Ie,Ve,He,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,In,Ln,zn,cr,lr,ur,dr,fr,mr];(async function(){function e(e,t){return _r=e.exports,_r=function(){var e=_r,t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`function`?(...e)=>{en.push(n);try{return r(...e)}finally{P||(en.pop(),Qt&&Zt===1&&en.length===0&&(Zt=0,ye+=1,Xt(Lr),typeof Fibers<`u`&&Fibers.rc()))}}:r;return t}(),_r=function(){var e=_r,t=e=>t=>e(t)>>>0,n=e=>()=>e()>>>0;return(e=Object.assign({},e)).Da=t(e.Da),e.fb=n(e.fb),e.hb=t(e.hb),e.tb=t(e.tb),e.ub=n(e.ub),e.__cxa_get_exception_ptr=t(e.__cxa_get_exception_ptr),e}(),Ee.push(_r.ib),x=t,ue(),_r}ce++;var t=fe();if(r.instantiateWasm)return new Promise(n=>{r.instantiateWasm(t,(t,r)=>{e(t,r),n(t.exports)})});if(s)return new Promise(t=>{ae=n=>{t(e(new WebAssembly.Instance(n,fe()),n))}});B??=r.locateFile?r.locateFile?r.locateFile(`ort-wasm-simd-threaded.jsep.wasm`,h):h+`ort-wasm-simd-threaded.jsep.wasm`:new URL(`/demo/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm`,``+self.location.href).href;try{var i=await async function(e){var t=B;if(!N&&typeof WebAssembly.instantiateStreaming==`function`&&!F(t))try{var n=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(n,e)}catch(e){y(`wasm streaming compile failed: ${e}`),y(`falling back to ArrayBuffer instantiation`)}return async function(e,t){try{var n=await async function(e){if(!N)try{var t=await d(e);return new Uint8Array(t)}catch{}if(e==B&&N)e=new Uint8Array(N);else{if(!f)throw`both async and sync fetching of the wasm failed`;e=f(e)}return e}(e);return await WebAssembly.instantiate(n,t)}catch(e){y(`failed to asynchronously prepare wasm: ${e}`),de(e)}}(t,e)}(t);return e(i.instance,i.module)}catch(e){return n(e),Promise.reject(e)}})();var yr=e=>(yr=_r.Da)(e),br=()=>(br=_r.Ea)();r._OrtInit=(e,t)=>(r._OrtInit=_r.Fa)(e,t),r._OrtGetLastError=(e,t)=>(r._OrtGetLastError=_r.Ga)(e,t),r._OrtCreateSessionOptions=(e,t,n,i,a,o,s,c,l,u)=>(r._OrtCreateSessionOptions=_r.Ha)(e,t,n,i,a,o,s,c,l,u),r._OrtAppendExecutionProvider=(e,t,n,i,a)=>(r._OrtAppendExecutionProvider=_r.Ia)(e,t,n,i,a),r._OrtAddFreeDimensionOverride=(e,t,n)=>(r._OrtAddFreeDimensionOverride=_r.Ja)(e,t,n),r._OrtAddSessionConfigEntry=(e,t,n)=>(r._OrtAddSessionConfigEntry=_r.Ka)(e,t,n),r._OrtReleaseSessionOptions=e=>(r._OrtReleaseSessionOptions=_r.La)(e),r._OrtCreateSession=(e,t,n)=>(r._OrtCreateSession=_r.Ma)(e,t,n),r._OrtReleaseSession=e=>(r._OrtReleaseSession=_r.Na)(e),r._OrtGetInputOutputCount=(e,t,n)=>(r._OrtGetInputOutputCount=_r.Oa)(e,t,n),r._OrtGetInputOutputMetadata=(e,t,n,i)=>(r._OrtGetInputOutputMetadata=_r.Pa)(e,t,n,i),r._OrtFree=e=>(r._OrtFree=_r.Qa)(e),r._OrtCreateTensor=(e,t,n,i,a,o)=>(r._OrtCreateTensor=_r.Ra)(e,t,n,i,a,o),r._OrtGetTensorData=(e,t,n,i,a)=>(r._OrtGetTensorData=_r.Sa)(e,t,n,i,a),r._OrtReleaseTensor=e=>(r._OrtReleaseTensor=_r.Ta)(e),r._OrtCreateRunOptions=(e,t,n,i)=>(r._OrtCreateRunOptions=_r.Ua)(e,t,n,i),r._OrtAddRunConfigEntry=(e,t,n)=>(r._OrtAddRunConfigEntry=_r.Va)(e,t,n),r._OrtReleaseRunOptions=e=>(r._OrtReleaseRunOptions=_r.Wa)(e),r._OrtCreateBinding=e=>(r._OrtCreateBinding=_r.Xa)(e),r._OrtBindInput=(e,t,n)=>(r._OrtBindInput=_r.Ya)(e,t,n),r._OrtBindOutput=(e,t,n,i)=>(r._OrtBindOutput=_r.Za)(e,t,n,i),r._OrtClearBoundOutputs=e=>(r._OrtClearBoundOutputs=_r._a)(e),r._OrtReleaseBinding=e=>(r._OrtReleaseBinding=_r.$a)(e),r._OrtRunWithBinding=(e,t,n,i,a)=>(r._OrtRunWithBinding=_r.ab)(e,t,n,i,a),r._OrtRun=(e,t,n,i,a,o,s,c)=>(r._OrtRun=_r.bb)(e,t,n,i,a,o,s,c),r._OrtEndProfiling=e=>(r._OrtEndProfiling=_r.cb)(e),r._JsepOutput=(e,t,n)=>(r._JsepOutput=_r.db)(e,t,n),r._JsepGetNodeName=e=>(r._JsepGetNodeName=_r.eb)(e);var xr=()=>(xr=_r.fb)(),Sr=r._free=e=>(Sr=r._free=_r.gb)(e),Cr=r._malloc=e=>(Cr=r._malloc=_r.hb)(e),wr=(e,t,n,r,i,a)=>(wr=_r.kb)(e,t,n,r,i,a),Tr=()=>(Tr=_r.lb)(),Er=(e,t,n,r,i)=>(Er=_r.mb)(e,t,n,r,i),Dr=e=>(Dr=_r.nb)(e),Or=e=>(Or=_r.ob)(e),kr=(e,t)=>(kr=_r.pb)(e,t),Ar=()=>(Ar=_r.qb)(),jr=(e,t)=>(jr=_r.rb)(e,t),Mr=e=>(Mr=_r.sb)(e),Nr=e=>(Nr=_r.tb)(e),Pr=()=>(Pr=_r.ub)(),Fr=r.dynCall_ii=(e,t)=>(Fr=r.dynCall_ii=_r.vb)(e,t),Ir=e=>(Ir=_r.wb)(e),Lr=()=>(Lr=_r.xb)(),Rr=e=>(Rr=_r.yb)(e),zr=()=>(zr=_r.zb)();return r.stackSave=()=>Pr(),r.stackRestore=e=>Mr(e),r.stackAlloc=e=>Nr(e),r.setValue=function(e,t,n=`i8`){switch(n.endsWith(`*`)&&(n=`*`),n){case`i1`:case`i8`:I()[e>>>0]=t;break;case`i16`:ee()[e>>>1>>>0]=t;break;case`i32`:R()[e>>>2>>>0]=t;break;case`i64`:A[e>>>3]=BigInt(t);break;case`float`:re()[e>>>2>>>0]=t;break;case`double`:ie()[e>>>3>>>0]=t;break;case`*`:ne()[e>>>2>>>0]=t;break;default:de(`invalid type for setValue: ${n}`)}},r.getValue=function(e,t=`i8`){switch(t.endsWith(`*`)&&(t=`*`),t){case`i1`:case`i8`:return I()[e>>>0];case`i16`:return ee()[e>>>1>>>0];case`i32`:return R()[e>>>2>>>0];case`i64`:return A[e>>>3];case`float`:return re()[e>>>2>>>0];case`double`:return ie()[e>>>3>>>0];case`*`:return ne()[e>>>2>>>0];default:de(`invalid type for getValue: ${t}`)}},r.UTF8ToString=Be,r.stringToUTF8=We,r.lengthBytesUTF8=Ue,function e(){if(0{"use strict";fj(),wj=typeof location>`u`?void 0:location.origin,Tj=self.location.href>`file:`&&self.location.href<`file;`,Ej=()=>Tj?new URL(new URL(`ort.bundle.min.mjs`,self.location.href).href,wj).href:self.location.href,Dj=Ej(),Oj=()=>{if(Dj&&!Dj.startsWith(`blob:`))return Dj.substring(0,Dj.lastIndexOf(`/`)+1)},kj=(e,t)=>{try{let n=t??Dj;return(n?new URL(e,n):new URL(e)).origin===wj}catch{return!1}},Aj=(e,t)=>{let n=t??Dj;try{return(n?new URL(e,n):new URL(e)).href}catch{return}},jj=(e,t)=>`${t??`./`}${e}`,Mj=async e=>{let t=await(await fetch(e,{credentials:`same-origin`})).blob();return URL.createObjectURL(t)},Nj=async e=>(await import(e)).default,Pj=(_j(),mA(pj)).default,Fj=async()=>{if(!Dj)throw Error(`Failed to load proxy worker: cannot determine the script source URL.`);if(kj(Dj))return[void 0,Pj()];let e=await Mj(Dj);return[e,Pj(e)]},Ij=(Cj(),mA(vj)).default,Lj=async(e,t,n)=>{if(!e&&!t&&Ij&&Dj&&kj(Dj))return[void 0,Ij];{let r=`ort-wasm-simd-threaded.jsep.mjs`,i=e??Aj(r,t),a=n&&i&&!kj(i,t),o=a?await Mj(i):i??jj(r,t);return[a?o:void 0,await Nj(o)]}}}),zj,Bj,Vj,Hj,Uj,Wj,Gj,Kj,qj,Jj=J(()=>{"use strict";Rj(),Bj=!1,Vj=!1,Hj=!1,Uj=()=>{if(typeof SharedArrayBuffer>`u`)return!1;try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch{return!1}},Wj=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}},Gj=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},Kj=async e=>{if(Bj)return Promise.resolve();if(Vj)throw Error(`multiple calls to 'initializeWebAssembly()' detected.`);if(Hj)throw Error(`previous call to 'initializeWebAssembly()' failed.`);Vj=!0;let t=e.initTimeout,n=e.numThreads;if(e.simd!==!1){if(e.simd===`relaxed`){if(!Gj())throw Error(`Relaxed WebAssembly SIMD is not supported in the current environment.`)}else if(!Wj())throw Error(`WebAssembly SIMD is not supported in the current environment.`)}let r=Uj();n>1&&!r&&(typeof self<`u`&&!self.crossOriginIsolated&&console.warn(`env.wasm.numThreads is set to `+n+`, but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info.`),console.warn(`WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading.`),e.numThreads=n=1);let i=e.wasmPaths,a=typeof i==`string`?i:void 0,o=i?.mjs,s=o?.href??o,c=i?.wasm,l=c?.href??c,u=e.wasmBinary,[d,f]=await Lj(s,a,n>1),p=!1,m=[];if(t>0&&m.push(new Promise(e=>{setTimeout(()=>{p=!0,e()},t)})),m.push(new Promise((e,t)=>{let r={numThreads:n};if(u)r.wasmBinary=u;else if(l||a)r.locateFile=e=>l??a+e;else if(s&&s.indexOf(`blob:`)!==0)r.locateFile=e=>new URL(e,s).href;else if(d){let e=Oj();e&&(r.locateFile=t=>e+t)}f(r).then(t=>{Vj=!1,Bj=!0,zj=t,e(),d&&URL.revokeObjectURL(d)},e=>{Vj=!1,Hj=!0,t(e)})})),await Promise.race(m),p)throw Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},qj=()=>{if(Bj&&zj)return zj;throw Error(`WebAssembly is not initialized yet.`)}}),Yj,Xj,Zj,Qj=J(()=>{"use strict";Jj(),Yj=(e,t)=>{let n=qj(),r=n.lengthBytesUTF8(e)+1,i=n._malloc(r);return n.stringToUTF8(e,i,r),t.push(i),i},Xj=(e,t,n,r)=>{if(typeof e==`object`&&e){if(n.has(e))throw Error(`Circular reference in options`);n.add(e)}Object.entries(e).forEach(([e,i])=>{let a=t?t+e:e;if(typeof i==`object`)Xj(i,a+`.`,n,r);else if(typeof i==`string`||typeof i==`number`)r(a,i.toString());else if(typeof i==`boolean`)r(a,i?`1`:`0`);else throw Error(`Can't handle extra config type: ${typeof i}`)})},Zj=e=>{let t=qj(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetLastError(r,r+n);let i=Number(t.getValue(r,n===4?`i32`:`i64`)),a=t.getValue(r+n,`*`),o=a?t.UTF8ToString(a):``;throw Error(`${e} ERROR_CODE: ${i}, ERROR_MESSAGE: ${o}`)}finally{t.stackRestore(n)}}}),$j,eM=J(()=>{"use strict";Jj(),Qj(),$j=e=>{let t=qj(),n=0,r=[],i=e||{};try{if(e?.logSeverityLevel===void 0)i.logSeverityLevel=2;else if(typeof e.logSeverityLevel!=`number`||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(e?.logVerbosityLevel===void 0)i.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!=`number`||!Number.isInteger(e.logVerbosityLevel))throw Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);e?.terminate===void 0&&(i.terminate=!1);let a=0;return e?.tag!==void 0&&(a=Yj(e.tag,r)),n=t._OrtCreateRunOptions(i.logSeverityLevel,i.logVerbosityLevel,!!i.terminate,a),n===0&&Zj(`Can't create run options.`),e?.extra!==void 0&&Xj(e.extra,``,new WeakSet,(e,i)=>{let a=Yj(e,r),o=Yj(i,r);t._OrtAddRunConfigEntry(n,a,o)!==0&&Zj(`Can't set a run config entry: ${e} - ${i}.`)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseRunOptions(n),r.forEach(e=>t._free(e)),e}}}),tM,nM,rM,iM,aM,oM,sM=J(()=>{"use strict";Jj(),Qj(),tM=e=>{switch(e){case`disabled`:return 0;case`basic`:return 1;case`extended`:return 2;case`all`:return 99;default:throw Error(`unsupported graph optimization level: ${e}`)}},nM=e=>{switch(e){case`sequential`:return 0;case`parallel`:return 1;default:throw Error(`unsupported execution mode: ${e}`)}},rM=e=>{e.extra||={},e.extra.session||(e.extra.session={});let t=e.extra.session;t.use_ort_model_bytes_directly||=`1`,e.executionProviders&&e.executionProviders.some(e=>(typeof e==`string`?e:e.name)===`webgpu`)&&(e.enableMemPattern=!1)},iM=(e,t,n,r)=>{let i=Yj(t,r),a=Yj(n,r);qj()._OrtAddSessionConfigEntry(e,i,a)!==0&&Zj(`Can't set a session config entry: ${t} - ${n}.`)},aM=async(e,t,n)=>{for(let r of t){let t=typeof r==`string`?r:r.name,i=[];switch(t){case`webnn`:if(t=`WEBNN`,typeof r!=`string`){let t=r?.deviceType;t&&iM(e,`deviceType`,t,n)}break;case`webgpu`:if(t=`JS`,typeof r!=`string`){let t=r;if(t?.preferredLayout){if(t.preferredLayout!==`NCHW`&&t.preferredLayout!==`NHWC`)throw Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${t.preferredLayout}`);iM(e,`preferredLayout`,t.preferredLayout,n)}}break;case`wasm`:case`cpu`:continue;default:throw Error(`not supported execution provider: ${t}`)}let a=Yj(t,n),o=i.length,s=0,c=0;if(o>0){s=qj()._malloc(o*qj().PTR_SIZE),n.push(s),c=qj()._malloc(o*qj().PTR_SIZE),n.push(c);for(let e=0;e{let t=qj(),n=0,r=[],i=e||{};rM(i);try{let e=tM(i.graphOptimizationLevel??`all`),a=nM(i.executionMode??`sequential`),o=typeof i.logId==`string`?Yj(i.logId,r):0,s=i.logSeverityLevel??2;if(!Number.isInteger(s)||s<0||s>4)throw Error(`log serverity level is not valid: ${s}`);let c=i.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw Error(`log verbosity level is not valid: ${c}`);let l=typeof i.optimizedModelFilePath==`string`?Yj(i.optimizedModelFilePath,r):0;if(n=t._OrtCreateSessionOptions(e,!!i.enableCpuMemArena,!!i.enableMemPattern,a,!!i.enableProfiling,0,o,s,c,l),n===0&&Zj(`Can't create session options.`),i.executionProviders&&await aM(n,i.executionProviders,r),i.enableGraphCapture!==void 0){if(typeof i.enableGraphCapture!=`boolean`)throw Error(`enableGraphCapture must be a boolean value: ${i.enableGraphCapture}`);iM(n,`enableGraphCapture`,i.enableGraphCapture.toString(),r)}if(i.freeDimensionOverrides)for(let[e,a]of Object.entries(i.freeDimensionOverrides)){if(typeof e!=`string`)throw Error(`free dimension override name must be a string: ${e}`);if(typeof a!=`number`||!Number.isInteger(a)||a<0)throw Error(`free dimension override value must be a non-negative integer: ${a}`);let i=Yj(e,r);t._OrtAddFreeDimensionOverride(n,i,a)!==0&&Zj(`Can't set a free dimension override: ${e} - ${a}.`)}return i.extra!==void 0&&Xj(i.extra,``,new WeakSet,(e,t)=>{iM(n,e,t,r)}),[n,r]}catch(e){throw n!==0&&t._OrtReleaseSessionOptions(n)!==0&&Zj(`Can't release session options.`),r.forEach(e=>t._free(e)),e}}}),cM,lM,uM,dM,fM,pM,mM,hM,gM=J(()=>{"use strict";cM=e=>{switch(e){case`int8`:return 3;case`uint8`:return 2;case`bool`:return 9;case`int16`:return 5;case`uint16`:return 4;case`int32`:return 6;case`uint32`:return 12;case`float16`:return 10;case`float32`:return 1;case`float64`:return 11;case`string`:return 8;case`int64`:return 7;case`uint64`:return 13;case`int4`:return 22;case`uint4`:return 21;default:throw Error(`unsupported data type: ${e}`)}},lM=e=>{switch(e){case 3:return`int8`;case 2:return`uint8`;case 9:return`bool`;case 5:return`int16`;case 4:return`uint16`;case 6:return`int32`;case 12:return`uint32`;case 10:return`float16`;case 1:return`float32`;case 11:return`float64`;case 8:return`string`;case 7:return`int64`;case 13:return`uint64`;case 22:return`int4`;case 21:return`uint4`;default:throw Error(`unsupported data type: ${e}`)}},uM=(e,t)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],r=typeof t==`number`?t:t.reduce((e,t)=>e*t,1);return n>0?Math.ceil(r*n):void 0},dM=e=>{switch(e){case`float16`:return typeof Float16Array<`u`&&Float16Array.from?Float16Array:Uint16Array;case`float32`:return Float32Array;case`uint8`:return Uint8Array;case`int8`:return Int8Array;case`uint16`:return Uint16Array;case`int16`:return Int16Array;case`int32`:return Int32Array;case`bool`:return Uint8Array;case`float64`:return Float64Array;case`uint32`:return Uint32Array;case`int64`:return BigInt64Array;case`uint64`:return BigUint64Array;default:throw Error(`unsupported type: ${e}`)}},fM=e=>{switch(e){case`verbose`:return 0;case`info`:return 1;case`warning`:return 2;case`error`:return 3;case`fatal`:return 4;default:throw Error(`unsupported logging level: ${e}`)}},pM=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,mM=e=>e===`float32`||e===`float16`||e===`int32`||e===`int64`||e===`uint32`||e===`uint64`||e===`int8`||e===`uint8`||e===`bool`||e===`uint4`||e===`int4`,hM=e=>{switch(e){case`none`:return 0;case`cpu`:return 1;case`cpu-pinned`:return 2;case`texture`:return 3;case`gpu-buffer`:return 4;case`ml-tensor`:return 5;default:throw Error(`unsupported data location: ${e}`)}}}),_M,vM=J(()=>{"use strict";fj(),_M=async e=>{if(typeof e==`string`){let t=await fetch(e);if(!t.ok)throw Error(`failed to load external data file: ${e}`);let n=t.headers.get(`Content-Length`),r=n?parseInt(n,10):0;if(r<1073741824)return new Uint8Array(await t.arrayBuffer());{if(!t.body)throw Error(`failed to load external data file: ${e}, no response body.`);let n=t.body.getReader(),i;try{i=new ArrayBuffer(r)}catch(e){if(e instanceof RangeError){let e=Math.ceil(r/65536);i=new WebAssembly.Memory({initial:e,maximum:e}).buffer}else throw e}let a=0;for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=t.byteLength;new Uint8Array(i,a,r).set(t),a+=r}return new Uint8Array(i,0,r)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),yM,bM,xM,SM,CM,wM,TM,EM=J(()=>{"use strict";gM(),yM=[`V`,`I`,`W`,`E`,`F`],bM=(e,t)=>{console.log(`[${yM[e]},${new Date().toISOString()}]${t}`)},CM=(e,t)=>{xM=e,SM=t},wM=(e,t)=>{let n=fM(e);n>=fM(xM)&&bM(n,typeof t==`function`?t():t)},TM=(...e)=>{SM&&wM(...e)}}),DM,OM,Y,kM,AM,jM,MM,NM=J(()=>{"use strict";DM=class{static calcMatMulShape(e,t){return e[1]===t[0]?[e[0],t[1]]:void 0}},OM=class{static calcShape(e,t,n=!1){let r=e.length,i=t.length;if(r===0)return t;if(i===0)return e;let a=Math.max(e.length,t.length),o=Array(a);if(n){if(r<2||i<2)return;let n=DM.calcMatMulShape([e[r-2],e[r-1]],[t[i-2],t[i-1]]);if(n===void 0)return;[o[a-2],o[a-1]]=n}for(let s=n?3:1;s<=a;s++){let n=r-s<0?1:e[r-s],c=i-s<0?1:t[i-s];if(n!==c&&n>1&&c>1)return;let l=Math.max(n,c);if(n&&c)o[a-s]=Math.max(n,c);else{if(l>1)return;o[a-s]=0}}return o}static isValidBroadcast(e,t){let n=e.length,r=t.length;if(n>r)return!1;for(let i=1;i<=n;i++)if(e[n-i]!==1&&e[n-i]!==t[r-i])return!1;return!0}},Y=class e{static size(t){return e.getSizeFromDimensionRange(t,0,t.length)}static convertShape(e,t=4){let n=e.length;if(n===0)return[];let r=Array(n),i=n-1;for(;i>=0;){if(e[i]%t===0){r[i]=e[i]/t;break}if(t%e[i]!==0)throw Error(`cannot convert shape`);r[i]=1,t/=e[i],i--}for(i--;i>=0;i--)r[i]=e[i];return r}static sizeFromDimension(t,n){if(n<0||n>t.length)throw Error(`invalid dimension of ${n} for sizeFromDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,n,t.length)}static sizeToDimension(t,n){if(n<0||n>t.length)throw Error(`invalid dimension of ${n} for sizeToDimension as Tensor has ${t.length} dimensions.`);return e.getSizeFromDimensionRange(t,0,n)}static getSizeFromDimensionRange(e,t,n){let r=1;for(let i=t;i=0;--r)n[r]=n[r+1]*e[r+1];return n}static normalizeAxis(e,t){if(e<-t&&e>=t)throw Error(`unsupported axis for this operation.`);return e<0?e+t:e}static normalizeAxes(e,t){return e.map(n=>this.normalizeAxis(n,t??e.length))}static sortBasedOnPerm(e,t){return t?t.map(t=>e[t]):e.slice().reverse()}static padShape(e,t){let n=e.length;return e.map((e,r)=>e+t[r]+t[r+n])}static areEqual(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}},kM=class e{static adjustPoolAttributes(e,t,n,r,i,a){if(!e&&n.length!==t.length-2)throw Error(`length of specified kernel shapes should be 2 less than length of input dimensions`);if(e)for(let e=0;e=n.length?n.push(t[e+2]):n[e]=t[e+2];for(let e=0;e=n[e]||a[e+n.length]>=n[e])throw Error(`pads should be smaller than kernel`)}}static adjustPadsBasedOnAutoPad(t,n,r,i,a,o,s){if(s){if(a.length!==2*(t.length-2))throw Error(`length of pads should be twice the length of data dimensions`);if(n.length!==t.length-2)throw Error(`length of strides should be the length of data dimensions`);if(i.length!==t.length-2)throw Error(`length of kernel shapes should be the length of data dimensions`);for(let c=0;c{"use strict";gM(),PM=(e,t)=>new(dM(t))(e)}),IM,LM,RM,zM,BM,VM,HM,UM,WM,GM,KM=J(()=>{"use strict";EM(),IM=(e,t=!0)=>{if(e.byteLength%8!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 8 (BigInt).`);let n=e.byteLength/8,r=new BigInt64Array(e.buffer,e.byteOffset,n),i=new Int32Array(n);for(let e=0;e2147483647n||t<-2147483648n)throw Error(`Overflow occurred when converting BigInt to Int32 at index ${e}: ${t}`);i[e]=Number(t)}return t?new Uint8Array(i.buffer):i},LM=(e,t=!0)=>{if(e.byteLength%4!=0)throw Error(`Invalid Uint8Array length - must be a multiple of 4 (Int32).`);let n=e.byteLength/4,r=new Int32Array(e.buffer,e.byteOffset,n),i=BigInt64Array.from(r,BigInt);return t?new Uint8Array(i.buffer):i},RM=1,zM=()=>RM++,BM=new Map([[`float32`,32],[`float16`,16],[`int32`,32],[`uint32`,32],[`int64`,64],[`uint64`,64],[`int8`,8],[`uint8`,8],[`int4`,4],[`uint4`,4]]),VM=(e,t)=>{let n=BM.get(e);if(!n)throw Error(`Unsupported data type.`);return t.length>0?Math.ceil(t.reduce((e,t)=>e*t)*n/8):0},HM=class{constructor(e){this.shouldConvertInt64toInt32=!1,this.isInt64ToInt32Converted=!1;let{sessionId:t,context:n,tensor:r,dataType:i,shape:a,shouldConvertInt64toInt32:o=!1}=e;this.sessionId=t,this.mlContext=n,this.mlTensor=r,this.dataType=i,this.tensorShape=a,this.shouldConvertInt64toInt32=o}get tensor(){return this.mlTensor}get type(){return this.dataType}get shape(){return this.tensorShape}get byteLength(){return VM(this.dataType,this.tensorShape)}destroy(){TM(`verbose`,()=>`[WebNN] TensorWrapper.destroy`),this.mlTensor.destroy()}write(e){this.mlContext.writeTensor(this.mlTensor,e)}async read(e,t){if(e){let e=await this.mlContext.readTensor(this.mlTensor),n=LM(new Uint8Array(e));if(t){(t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).set(n);return}else return n.buffer}else return t?this.mlContext.readTensor(this.mlTensor,t):this.mlContext.readTensor(this.mlTensor)}canReuseTensor(e,t,n){return this.mlContext===e&&this.dataType===t&&this.tensorShape.length===n.length&&this.tensorShape.every((e,t)=>e===n[t])}setIsInt64ToInt32Converted(e){this.isInt64ToInt32Converted=e}},UM=class{constructor(e,t){this.tensorManager=e,this.wrapper=t}get tensorWrapper(){return this.wrapper}releaseTensor(){this.tensorWrapper&&(this.tensorManager.releaseTensor(this.tensorWrapper),this.wrapper=void 0)}async ensureTensor(e,t,n,r){let i=t,a=this.tensorManager.getMLContext(e),o=i===`int64`&&!a.opSupportLimits().input.dataTypes.includes(`int64`);if(o&&(i=`int32`,TM(`verbose`,()=>`[WebNN] TensorIdTracker.ensureTensor: convert dataType from int64 to int32`)),this.wrapper){if(this.wrapper.canReuseTensor(a,i,n))return this.wrapper.tensor;if(r){if(this.wrapper.byteLength!==VM(i,n))throw Error(`Unable to copy data to tensor with different size.`);this.activeUpload=new Uint8Array(await this.wrapper.read())}this.tensorManager.releaseTensor(this.wrapper)}let s=typeof MLTensorUsage>`u`?void 0:MLTensorUsage.READ|MLTensorUsage.WRITE;return this.wrapper=await this.tensorManager.getCachedTensor(e,i,n,s,!0,!0,o),r&&this.activeUpload&&(this.wrapper.write(this.activeUpload),this.activeUpload=void 0),this.wrapper.tensor}upload(e){let t=e;if(this.wrapper)if(this.wrapper.shouldConvertInt64toInt32&&(t=IM(e,!0),this.wrapper.setIsInt64ToInt32Converted(!0)),t.byteLength===this.wrapper.byteLength){this.wrapper.write(t);return}else TM(`verbose`,()=>`Data size does not match tensor size. Releasing tensor.`),this.releaseTensor();this.activeUpload?this.activeUpload.set(t):this.activeUpload=new Uint8Array(t)}async download(e){if(this.activeUpload){let t=this.wrapper?.isInt64ToInt32Converted?LM(this.activeUpload):this.activeUpload;if(e){e instanceof ArrayBuffer?new Uint8Array(e).set(t):new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(t);return}else return t.buffer}if(!this.wrapper)throw Error(`Tensor has not been created.`);return e?this.wrapper.read(this.wrapper?.shouldConvertInt64toInt32,e):this.wrapper.read(this.wrapper?.shouldConvertInt64toInt32)}},WM=class{constructor(e){this.backend=e,this.tensorTrackersById=new Map,this.freeTensors=[],this.externalTensors=new Set}getMLContext(e){let t=this.backend.getMLContext(e);if(!t)throw Error(`MLContext not found for session.`);return t}reserveTensorId(){let e=zM();return this.tensorTrackersById.set(e,new UM(this)),e}releaseTensorId(e){let t=this.tensorTrackersById.get(e);t&&(this.tensorTrackersById.delete(e),t.tensorWrapper&&this.releaseTensor(t.tensorWrapper))}async ensureTensor(e,t,n,r,i){TM(`verbose`,()=>`[WebNN] TensorManager.ensureTensor {tensorId: ${t}, dataType: ${n}, shape: ${r}, copyOld: ${i}}`);let a=this.tensorTrackersById.get(t);if(!a)throw Error(`Tensor not found.`);return a.ensureTensor(e,n,r,i)}upload(e,t){let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);n.upload(t)}async download(e,t){TM(`verbose`,()=>`[WebNN] TensorManager.download {tensorId: ${e}, dstBuffer: ${t?.byteLength}}`);let n=this.tensorTrackersById.get(e);if(!n)throw Error(`Tensor not found.`);return n.download(t)}releaseTensorsForSession(e){for(let t of this.freeTensors)t.sessionId===e&&t.destroy();this.freeTensors=this.freeTensors.filter(t=>t.sessionId!==e)}registerTensor(e,t,n,r){let i=this.getMLContext(e),a=zM(),o=new HM({sessionId:e,context:i,tensor:t,dataType:n,shape:r});return this.tensorTrackersById.set(a,new UM(this,o)),this.externalTensors.add(o),a}async getCachedTensor(e,t,n,r,i,a,o=!1){let s=this.getMLContext(e);for(let[r,i]of this.freeTensors.entries())if(i.canReuseTensor(s,t,n)){TM(`verbose`,()=>`[WebNN] Reusing tensor {dataType: ${t}, shape: ${n}}`);let i=this.freeTensors.splice(r,1)[0];return i.sessionId=e,i}TM(`verbose`,()=>`[WebNN] MLContext.createTensor {dataType: ${t}, shape: ${n}}`);let c=await s.createTensor({dataType:t,shape:n,dimensions:n,usage:r,writable:i,readable:a});return new HM({sessionId:e,context:s,tensor:c,dataType:t,shape:n,shouldConvertInt64toInt32:o})}releaseTensor(e){this.externalTensors.has(e)&&this.externalTensors.delete(e),this.freeTensors.push(e)}},GM=(...e)=>new WM(...e)}),qM,JM,YM,XM=J(()=>{"use strict";gM(),Jj(),FM(),KM(),EM(),qM=new Map([[1,`float32`],[10,`float16`],[6,`int32`],[12,`uint32`],[7,`int64`],[13,`uint64`],[22,`int4`],[21,`uint4`],[3,`int8`],[2,`uint8`],[9,`uint8`]]),JM=(e,t)=>{if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((n,i)=>n===r[i]&&e[n]===t[n])},YM=class{constructor(e){this.tensorManager=GM(this),this.mlContextBySessionId=new Map,this.sessionIdsByMLContext=new Map,this.mlContextCache=[],this.sessionGraphInputs=new Map,this.temporaryGraphInputs=[],this.temporarySessionTensorIds=new Map,CM(e.logLevel,!!e.debug)}get currentSessionId(){if(this.activeSessionId===void 0)throw Error(`No active session`);return this.activeSessionId}onRunStart(e){TM(`verbose`,()=>`[WebNN] onRunStart {sessionId: ${e}}`),this.activeSessionId=e}onRunEnd(e){TM(`verbose`,()=>`[WebNN] onRunEnd {sessionId: ${e}}`);let t=this.temporarySessionTensorIds.get(e);if(t){for(let e of t)TM(`verbose`,()=>`[WebNN] releasing temporary tensor {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e);this.temporarySessionTensorIds.delete(e),this.activeSessionId=void 0}}async createMLContext(e){if(e instanceof GPUDevice){let t=this.mlContextCache.findIndex(t=>t.gpuDevice===e);if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({gpuDevice:e,mlContext:t}),t}}else if(e===void 0){let e=this.mlContextCache.findIndex(e=>e.options===void 0&&e.gpuDevice===void 0);if(e!==-1)return this.mlContextCache[e].mlContext;{let e=await navigator.ml.createContext();return this.mlContextCache.push({mlContext:e}),e}}let t=this.mlContextCache.findIndex(t=>JM(t.options,e));if(t!==-1)return this.mlContextCache[t].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({options:e,mlContext:t}),t}}registerMLContext(e,t){this.mlContextBySessionId.set(e,t);let n=this.sessionIdsByMLContext.get(t);n||(n=new Set,this.sessionIdsByMLContext.set(t,n)),n.add(e),this.temporaryGraphInputs.length>0&&(this.sessionGraphInputs.set(e,this.temporaryGraphInputs),this.temporaryGraphInputs=[])}onReleaseSession(e){this.sessionGraphInputs.delete(e);let t=this.mlContextBySessionId.get(e);if(!t)return;this.tensorManager.releaseTensorsForSession(e),this.mlContextBySessionId.delete(e);let n=this.sessionIdsByMLContext.get(t);if(n.delete(e),n.size===0){this.sessionIdsByMLContext.delete(t);let e=this.mlContextCache.findIndex(e=>e.mlContext===t);e!==-1&&this.mlContextCache.splice(e,1)}}getMLContext(e){return this.mlContextBySessionId.get(e)}reserveTensorId(){return this.tensorManager.reserveTensorId()}releaseTensorId(e){TM(`verbose`,()=>`[WebNN] releaseTensorId {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e)}async ensureTensor(e,t,n,r,i){let a=qM.get(n);if(!a)throw Error(`Unsupported ONNX data type: ${n}`);return this.tensorManager.ensureTensor(e??this.currentSessionId,t,a,r,i)}async createTemporaryTensor(e,t,n){TM(`verbose`,()=>`[WebNN] createTemporaryTensor {onnxDataType: ${t}, shape: ${n}}`);let r=qM.get(t);if(!r)throw Error(`Unsupported ONNX data type: ${t}`);let i=this.tensorManager.reserveTensorId();await this.tensorManager.ensureTensor(e,i,r,n,!1);let a=this.temporarySessionTensorIds.get(e);return a?a.push(i):this.temporarySessionTensorIds.set(e,[i]),i}uploadTensor(e,t){if(!qj().shouldTransferToMLTensor)throw Error(`Trying to upload to a MLTensor while shouldTransferToMLTensor is false`);TM(`verbose`,()=>`[WebNN] uploadTensor {tensorId: ${e}, data: ${t.byteLength}}`),this.tensorManager.upload(e,t)}async downloadTensor(e,t){return this.tensorManager.download(e,t)}createMLTensorDownloader(e,t){return async()=>{let n=await this.tensorManager.download(e);return PM(n,t)}}registerMLTensor(e,t,n,r){let i=qM.get(n);if(!i)throw Error(`Unsupported ONNX data type: ${n}`);let a=this.tensorManager.registerTensor(e,t,i,r);return TM(`verbose`,()=>`[WebNN] registerMLTensor {tensor: ${t}, dataType: ${i}, dimensions: ${r}} -> {tensorId: ${a}}`),a}registerMLConstant(e,t,n,r,i,a,o=!1){if(!a)throw Error(`External mounted files are not available.`);let s=e;e.startsWith(`./`)&&(s=e.substring(2));let c=a.get(s);if(!c)throw Error(`File with name ${s} not found in preloaded files.`);if(t+n>c.byteLength)throw Error(`Out of bounds: data offset and length exceed the external file data size.`);let l=c.slice(t,t+n).buffer,u;switch(i.dataType){case`float32`:u=new Float32Array(l);break;case`float16`:u=typeof Float16Array<`u`&&Float16Array.from?new Float16Array(l):new Uint16Array(l);break;case`int32`:u=new Int32Array(l);break;case`uint32`:u=new Uint32Array(l);break;case`int64`:o?(u=IM(new Uint8Array(l),!1),i.dataType=`int32`):u=new BigInt64Array(l);break;case`uint64`:u=new BigUint64Array(l);break;case`int8`:u=new Int8Array(l);break;case`int4`:case`uint4`:case`uint8`:u=new Uint8Array(l);break;default:throw Error(`Unsupported data type: ${i.dataType} in creating WebNN Constant from external data.`)}return TM(`verbose`,()=>`[WebNN] registerMLConstant {dataType: ${i.dataType}, shape: ${i.shape}}} ${o?`(Note: it was int64 data type and registered to int32 as workaround)`:``}`),r.constant(i,u)}registerGraphInput(e){this.temporaryGraphInputs.push(e)}isGraphInput(e,t){let n=this.sessionGraphInputs.get(e);return n?n.includes(t):!1}isInt64Supported(e){return!!this.mlContextBySessionId.get(e)?.opSupportLimits().input.dataTypes.includes(`int64`)}flush(){}}}),ZM=J(()=>{"use strict";}),QM,$M,eN,tN,nN,rN,iN,aN,oN,sN=J(()=>{"use strict";EM(),ZM(),QM=new Map([[64,250],[128,200],[256,200],[512,200],[2048,230],[4096,200],[8192,50],[16384,50],[32768,50],[65536,50],[131072,50],[262144,50],[524288,50],[1048576,50],[2097152,30],[4194304,20],[8388608,10],[12582912,10],[16777216,10],[26214400,15],[33554432,22],[44236800,2],[58982400,6],[67108864,6],[134217728,6],[167772160,6]]),$M=[],eN=e=>Math.ceil(Number(e)/16)*16,tN=e=>{for(let t=0;t<$M.length;t++){let n=$M[t];if(e<=n)return n}return Math.ceil(e/16)*16},nN=1,rN=()=>nN++,iN=async(e,t,n,r)=>{let i=eN(n),a=e.device.createBuffer({size:i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});try{let o=e.getCommandEncoder();e.endComputePass(),o.copyBufferToBuffer(t,0,a,0,i),e.flush(),await a.mapAsync(GPUMapMode.READ);let s=a.getMappedRange();if(r){let e=r();return e.set(new Uint8Array(s,0,n)),e}else return new Uint8Array(s.slice(0,n))}finally{a.destroy()}},aN=class{constructor(e){this.backend=e,this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.buffersPending=[],this.capturedPendingBuffers=new Map;for(let[e]of QM)$M.push(e),this.freeBuffers.set(e,[]),this.freeUniformBuffers.set(e,[]);this.sessionCount=0}upload(e,t){let n=t.buffer,r=t.byteOffset,i=t.byteLength,a=eN(i),o=this.storageCache.get(e);if(!o)throw Error(`gpu data for uploading does not exist`);if(Number(o.originalSize)!==i)throw Error(`inconsistent data size. gpu data size=${o.originalSize}, data size=${i}`);let s=this.backend.device.createBuffer({mappedAtCreation:!0,size:a,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),c=s.getMappedRange();new Uint8Array(c).set(new Uint8Array(n,r,i)),s.unmap();let l=this.backend.device.createCommandEncoder();l.copyBufferToBuffer(s,0,o.gpuData.buffer,0,a),this.backend.device.queue.submit([l.finish()]),s.destroy(),TM(`verbose`,()=>`[WebGPU] GpuDataManager.upload(id=${e})`)}memcpy(e,t){let n=this.storageCache.get(e);if(!n)throw Error(`source gpu data for memcpy does not exist`);let r=this.storageCache.get(t);if(!r)throw Error(`destination gpu data for memcpy does not exist`);if(n.originalSize!==r.originalSize)throw Error(`inconsistent source and destination gpu data size`);let i=eN(n.originalSize),a=this.backend.getCommandEncoder();this.backend.endComputePass(),a.copyBufferToBuffer(n.gpuData.buffer,0,r.gpuData.buffer,0,i)}registerExternalBuffer(e,t,n){let r;if(n){if(r=n[0],e===n[1])return TM(`verbose`,()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${r}, buffer is the same, skip.`),r;if(this.backend.capturedCommandList.has(this.backend.currentSessionId))throw Error(`Registering a different external buffer under graph capture mode is not supported yet. + Please use the previous external buffer!`)}else r=rN();return this.storageCache.set(r,{gpuData:{id:r,type:0,buffer:e},originalSize:t}),TM(`verbose`,()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${t}) => id=${r}, registered.`),r}unregisterExternalBuffer(e){e!==void 0&&(this.storageCache.delete(e),TM(`verbose`,()=>`[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${e}`))}create(e,t=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){let n=tN(e),r,i=(t&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE,a=(t&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM;if(i||a){let e=(i?this.freeBuffers:this.freeUniformBuffers).get(n);r=e&&e.length>0?e.pop():this.backend.device.createBuffer({size:n,usage:t})}else r=this.backend.device.createBuffer({size:n,usage:t});let o={id:rN(),type:0,buffer:r};return this.storageCache.set(o.id,{gpuData:o,originalSize:Number(e)}),TM(`verbose`,()=>`[WebGPU] GpuDataManager.create(size=${e}) => id=${o.id}`),o}get(e){return this.storageCache.get(e)?.gpuData}release(e){let t=typeof e==`bigint`?Number(e):e,n=this.storageCache.get(t);if(!n){if(this.storageCache.size===0)return 0;throw Error(`releasing data does not exist`)}return TM(`verbose`,()=>`[WebGPU] GpuDataManager.release(id=${t}), gpuDataId=${n.gpuData.id}`),this.storageCache.delete(t),this.buffersPending.push(n.gpuData.buffer),n.originalSize}async download(e,t){let n=this.storageCache.get(Number(e));if(!n)throw Error(`data does not exist`);await iN(this.backend,n.gpuData.buffer,n.originalSize,t)}refreshPendingBuffers(){if(this.buffersPending.length!==0)if(this.backend.sessionStatus==="default"){for(let e of this.buffersPending){let t=QM.get(e.size);if((e.usage&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE){let n=this.freeBuffers.get(e.size)||[];t===void 0||n.length>=t?e.destroy():n.push(e)}else if((e.usage&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM){let n=this.freeUniformBuffers.get(e.size)||[];t===void 0||n.length>=t?e.destroy():n.push(e)}else e.destroy()}this.buffersPending=[]}else{let e=this.capturedPendingBuffers.get(this.backend.currentSessionId);e||(e=[],this.capturedPendingBuffers.set(this.backend.currentSessionId,e));for(let t of this.buffersPending)e.push(t);this.buffersPending=[]}}dispose(){this.freeBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.freeUniformBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.capturedPendingBuffers.forEach(e=>{e.forEach(e=>{e.destroy()})}),this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.capturedPendingBuffers=new Map}onCreateSession(){this.sessionCount+=1}onReleaseSession(e){let t=this.capturedPendingBuffers.get(e);t&&(t.forEach(e=>{e.destroy()}),this.capturedPendingBuffers.delete(e)),--this.sessionCount,this.sessionCount===0&&(TM(`warning`,()=>`[WebGPU] Clearing webgpu buffer cache`),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.storageCache=new Map)}},oN=(...e)=>new aN(...e)}),cN,lN,uN=J(()=>{"use strict";cN=class{constructor(e){Object.assign(this,e)}get cacheKey(){return this.key||=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(`;`),this.key}},lN=e=>new cN(e)}),dN,fN,pN,mN,hN,gN,_N,vN,yN,bN,xN,X,SN,CN,wN,TN,EN,DN=J(()=>{"use strict";gM(),NM(),dN=64,fN=(e,t)=>{if(t===3)throw Error(`vec3 has same alignment as vec4, use vec4 instead`);switch(Number(e)){case 10:return t>1?`vec${t}`:`f16`;case 1:return t>1?`vec${t}`:`f32`;case 6:return t>1?`vec${t}`:`i32`;case 12:return t>1?`vec${t}`:`u32`;case 7:if(t>1)throw Error(`currently not supported vecX of uint64 yet`);return[`vec2`,`i32`];case 13:if(t>1)throw Error(`currently not supported vecX of uint64 yet`);return[`vec2`,`u32`];case 9:if(t!==4)throw Error(`bool must be vec4`);return[`u32`,`vec4`];case 22:return`i32`;case 21:return`u32`;default:throw Error(`Unknown data type: ${e}`)}},pN=(e,t=1)=>{let n=fN(e,t);return typeof n==`string`?n:n[0]},mN=(e,t=1)=>{let n=fN(e,t);return typeof n==`string`?n:n[1]},hN=(...e)=>{let t=[];return e.forEach(e=>{e.length!==0&&t.push({type:12,data:e},{type:12,data:Y.computeStrides(e)})}),t},gN=e=>e%4==0?4:e%2==0?2:1,_N=(e=`f32`,t,n=`0`)=>!t||t===1?`${e}(${n})`:`vec${t}<${e}>(${n})`,vN=(e,t,n)=>e===`f32`?n:t===1?`f32(${n})`:`vec${t}(${n})`,yN=(e,t)=>t===4?`(${e}.x + ${e}.y + ${e}.z + ${e}.w)`:t===2?`(${e}.x + ${e}.y)`:t===3?`(${e}.x + ${e}.y + ${e}.z)`:e,bN=(e,t,n,r)=>e.startsWith(`uniforms.`)&&n>4?typeof t==`string`?r===`f16`?`${e}[(${t}) / 8][(${t}) % 8 / 4][(${t}) % 8 % 4]`:`${e}[(${t}) / 4][(${t}) % 4]`:r===`f16`?`${e}[${Math.floor(t/8)}][${Math.floor(t%8/4)}][${t%8%4}]`:`${e}[${Math.floor(t/4)}][${t%4}]`:n>1?`${e}[${t}]`:e,xN=(e,t,n,r,i)=>{let a=typeof n==`number`,o=a?n:n.length,s=[...Array(o).keys()],c=o<2?`u32`:o<=4?`vec${o}`:`array`,l=fN(t,i),u=typeof l==`string`?l:l[1],d={indices:c,value:u,storage:typeof l==`string`?l:l[0],tensor:t},f=e=>typeof e==`string`?e:`${e}u`,p={offsetToIndices:!1,indicesToOffset:!1,broadcastedIndicesToOffset:!1,set:!1,setByIndices:!1,get:!1,getByIndices:!1},m=a?`uniforms.`:``,h=`${m}${e}_shape`,g=`${m}${e}_strides`,_=``;for(let e=0;e ${d.indices} { + var indices: ${d.indices}; + var current = offset; + ${_} + return indices; + }`,y=t=>(p.offsetToIndices=!0,o<2?t:`o2i_${e}(${t})`),b=[];if(o>=2)for(let e=o-1;e>=0;e--)b.push(`${bN(g,e,o)} * (indices[${e}])`);let x=o<2?``:` + fn i2o_${e}(indices: ${d.indices}) -> u32 { + return ${b.join(`+`)}; + }`,S=t=>(p.indicesToOffset=!0,o<2?t:`i2o_${e}(${t})`),C=(...e)=>o===0?`0u`:`${d.indices}(${e.map(f).join(`,`)})`,w=(e,t)=>o<2?`${e}`:`${bN(e,t,o)}`,T=(e,t,n)=>o<2?`${e}=${n};`:`${bN(e,t,o)}=${n};`,E={},D=(t,n)=>{p.broadcastedIndicesToOffset=!0;let r=`${n.name}broadcastedIndicesTo${e}Offset`;if(r in E)return`${r}(${t})`;let i=[];for(let e=o-1;e>=0;e--){let t=n.indicesGet(`outputIndices`,e+n.rank-o);i.push(`${w(g,e)} * (${t} % ${w(h,e)})`)}return E[r]=`fn ${r}(outputIndices: ${n.type.indices}) -> u32 { + return ${i.length>0?i.join(`+`):`0u`}; + }`,`${r}(${t})`},O=(t,n)=>(()=>{if(d.storage===d.value)return`${e}[${t}]=${n};`;if(d.storage===`vec2`&&d.value===`i32`)return`${e}[${t}]=vec2(u32(${n}), select(0u, 0xFFFFFFFFu, ${n} < 0));`;if(d.storage===`vec2`&&d.value===`u32`)return`${e}[${t}]=vec2(u32(${n}), 0u);`;if(d.storage===`u32`&&d.value===`vec4`)return`${e}[${t}]=dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(${n}));`;throw Error(`not supported combination of storage type ${d.storage} and value type ${d.value} yet`)})(),k=t=>(()=>{if(d.storage===d.value)return`${e}[${t}]`;if(d.storage===`vec2`&&d.value===`i32`)return`i32(${e}[${t}].x)`;if(d.storage===`vec2`&&d.value===`u32`)return`u32(${e}[${t}].x)`;if(d.storage===`u32`&&d.value===`vec4`)return`vec4(bool(${e}[${t}] & 0xFFu), bool(${e}[${t}] & 0xFF00u), bool(${e}[${t}] & 0xFF0000u), bool(${e}[${t}] & 0xFF000000u))`;throw Error(`not supported combination of storage type ${d.storage} and value type ${d.value} yet`)})(),A=o<2?``:` + fn get_${e}ByIndices(indices: ${d.indices}) -> ${u} { + return ${k(`i2o_${e}(indices)`)}; + }`,j=o<2?``:` + fn get_${e}(${s.map(e=>`d${e}: u32`).join(`, `)}) -> ${u} { + return get_${e}ByIndices(${C(s.map(e=>`d${e}`).join(`, `))}); + }`,M=(...t)=>{if(t.length!==o)throw Error(`indices length must be ${o}`);let n=t.map(f).join(`,`);return o===0?k(`0u`):o===1?k(n[0]):(p.get=!0,p.getByIndices=!0,p.indicesToOffset=!0,`get_${e}(${n})`)},N=t=>o<2?k(t):(p.getByIndices=!0,p.indicesToOffset=!0,`get_${e}ByIndices(${t})`),P=o<2?``:` + fn set_${e}ByIndices(indices: ${d.indices}, value: ${u}) { + ${O(`i2o_${e}(indices)`,`value`)} + }`,F=o<2?``:` + fn set_${e}(${s.map(e=>`d${e}: u32`).join(`, `)}, value: ${u}) { + set_${e}ByIndices(${C(s.map(e=>`d${e}`).join(`, `))}, value); + }`;return{impl:()=>{let e=[],t=!1;return p.offsetToIndices&&(e.push(v),t=!0),p.indicesToOffset&&(e.push(x),t=!0),p.broadcastedIndicesToOffset&&(Object.values(E).forEach(t=>e.push(t)),t=!0),p.set&&(e.push(F),t=!0),p.setByIndices&&(e.push(P),t=!0),p.get&&(e.push(j),t=!0),p.getByIndices&&(e.push(A),t=!0),!a&&t&&e.unshift(`const ${h} = ${d.indices}(${n.join(`,`)});`,`const ${g} = ${d.indices}(${Y.computeStrides(n).join(`,`)});`),e.join(` +`)},type:d,offsetToIndices:y,indicesToOffset:S,broadcastedIndicesToOffset:D,indices:C,indicesGet:w,indicesSet:T,set:(...t)=>{if(t.length!==o+1)throw Error(`indices length must be ${o}`);let n=t[o];if(typeof n!=`string`)throw Error(`value must be string`);let r=t.slice(0,o).map(f).join(`,`);return o===0?O(`0u`,n):o===1?O(r[0],n):(p.set=!0,p.setByIndices=!0,p.indicesToOffset=!0,`set_${e}(${r}, ${n})`)},setByOffset:O,setByIndices:(t,n)=>o<2?O(t,n):(p.setByIndices=!0,p.indicesToOffset=!0,`set_${e}ByIndices(${t}, ${n});`),get:M,getByOffset:k,getByIndices:N,usage:r,name:e,strides:g,shape:h,rank:o}},X=(e,t,n,r=1)=>xN(e,t,n,`input`,r),SN=(e,t,n,r=1)=>xN(e,t,n,`output`,r),CN=(e,t,n)=>xN(e,t,n,`atomicOutput`,1),wN=(e,t,n,r=1)=>xN(e,t,n,`internal`,r),TN=class{constructor(e,t){this.normalizedDispatchGroup=e,this.limits=t,this.internalVariables=[],this.variables=[],this.uniforms=[],this.variableIndex=0}guardAgainstOutOfBoundsWorkgroupSizes(e){return`if (global_idx >= ${typeof e==`number`?`${e}u`:e}) { return; }`}mainStart(e=dN){let t=typeof e==`number`?e:e[0],n=typeof e==`number`?1:e[1],r=typeof e==`number`?1:e[2];if(t>this.limits.maxComputeWorkgroupSizeX||n>this.limits.maxComputeWorkgroupSizeY||r>this.limits.maxComputeWorkgroupSizeZ)throw Error(`workgroup size [${t}, ${n}, ${r}] exceeds the maximum workgroup size [${this.limits.maxComputeWorkgroupSizeX}, ${this.limits.maxComputeWorkgroupSizeY}, ${this.limits.maxComputeWorkgroupSizeZ}].`);if(t*n*r>this.limits.maxComputeInvocationsPerWorkgroup)throw Error(`workgroup size [${t}, ${n}, ${r}] exceeds the maximum workgroup invocations ${this.limits.maxComputeInvocationsPerWorkgroup}.`);let i=this.normalizedDispatchGroup[1]===1&&this.normalizedDispatchGroup[2]===1;return`@compute @workgroup_size(${t}, ${n}, ${r}) + fn main(${i?`@builtin(global_invocation_id) global_id : vec3, + @builtin(workgroup_id) workgroup_id : vec3, + @builtin(local_invocation_index) local_idx : u32, + @builtin(local_invocation_id) local_id : vec3`:`@builtin(global_invocation_id) global_id : vec3, + @builtin(local_invocation_id) local_id : vec3, + @builtin(local_invocation_index) local_idx : u32, + @builtin(workgroup_id) workgroup_id : vec3, + @builtin(num_workgroups) num_workgroups : vec3`}) { + ${i?`let global_idx = global_id.x; + let workgroup_index = workgroup_id.x;`:`let workgroup_index = workgroup_id.z * num_workgroups[0] * num_workgroups[1] + + workgroup_id.y * num_workgroups[0] + workgroup_id.x; + let global_idx = workgroup_index * ${t*n*r}u + local_idx;`} + `}appendVariableUniforms(e){e.rank!==0&&(e.shape.startsWith(`uniforms.`)&&this.uniforms.push({name:e.shape.replace(`uniforms.`,``),type:`u32`,length:e.rank}),e.strides.startsWith(`uniforms.`)&&this.uniforms.push({name:e.strides.replace(`uniforms.`,``),type:`u32`,length:e.rank}))}declareVariable(e,t){if(e.usage===`internal`)throw Error(`cannot use internal variable with declareVariable(). use registerInternalVariables() instead.`);this.variables.push(e),this.appendVariableUniforms(e);let n=e.usage===`input`?`read`:`read_write`,r=e.usage===`atomicOutput`?`atomic`:e.type.storage;return`@group(0) @binding(${t}) var ${e.name}: array<${r}>;`}declareVariables(...e){return e.map(e=>this.declareVariable(e,this.variableIndex++)).join(` +`)}registerInternalVariable(e){if(e.usage!==`internal`)throw Error(`cannot use input or output variable with registerInternalVariable(). use declareVariables() instead.`);this.internalVariables.push(e),this.appendVariableUniforms(e)}registerInternalVariables(...e){return e.forEach(e=>this.registerInternalVariable(e)),this}registerUniform(e,t,n=1){return this.uniforms.push({name:e,type:t,length:n}),this}registerUniforms(e){return this.uniforms=this.uniforms.concat(e),this}uniformDeclaration(){if(this.uniforms.length===0)return``;let e=[];for(let{name:t,type:n,length:r}of this.uniforms)if(r&&r>4)n===`f16`?e.push(`@align(16) ${t}:array, ${Math.ceil(r/8)}>`):e.push(`${t}:array, ${Math.ceil(r/4)}>`);else{let i=r==null||r===1?n:`vec${r}<${n}>`;e.push(`${t}:${i}`)}return` + struct Uniforms { ${e.join(`, `)} }; + @group(0) @binding(${this.variableIndex}) var uniforms: Uniforms;`}get additionalImplementations(){return this.uniformDeclaration()+this.variables.map(e=>e.impl()).join(` +`)+this.internalVariables.map(e=>e.impl()).join(` +`)}get variablesInfo(){if(this.uniforms.length===0)return;let e=e=>[12,10,1,6][[`u32`,`f16`,`f32`,`i32`].indexOf(e)];return this.uniforms.map(t=>[e(t.type),t.length??1])}},EN=(e,t)=>new TN(e,t)}),ON,kN,AN,jN,MN,NN,PN,FN,IN,LN=J(()=>{"use strict";gM(),NM(),uN(),DN(),ON=(e,t)=>{if(!e||e.length!==1)throw Error(`Transpose requires 1 input.`);if(t.length!==0&&t.length!==e[0].dims.length)throw Error(`perm size ${t.length} does not match input rank ${e[0].dims.length}`)},kN=(e,t)=>t.length===0?[...Array(e).keys()].reverse():t,AN=(e,t)=>Y.sortBasedOnPerm(e,kN(e.length,t)),jN=(e,t,n,r)=>{let i=`fn perm(i: ${r.type.indices}) -> ${n.type.indices} { + var a: ${n.type.indices};`;for(let n=0;n{let n=[],r=[];for(let i=0;i{let n=0;for(let r=0;r{let n=e.dataType,r=e.dims.length,i=kN(r,t),a=AN(e.dims,i),o=e.dims,s=a,c=r<2||NN(i,e.dims),l;if(c)return l=e=>{let t=X(`input`,n,o,4),r=SN(`output`,n,s,4);return` + ${e.registerUniform(`output_size`,`u32`).declareVariables(t,r)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + output[global_idx] = input[global_idx]; + }`},{name:`TransposeCopy`,shaderCache:{inputDependencies:[`type`]},getRunData:()=>{let t=Y.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(t/64/4)},programUniforms:[{type:12,data:Math.ceil(t/4)}]}},getShaderSource:l};let{newShape:u,newPerm:d}=MN(e.dims,i),f=Y.areEqual(d,[2,3,1]),p=Y.areEqual(d,[3,1,2]);return u.length===2||f||p?(o=f?[u[0],u[1]*u[2]]:p?[u[0]*u[1],u[2]]:u,s=[o[1],o[0]],l=e=>{let t=X(`a`,n,o.length),r=SN(`output`,n,s.length);return` + ${e.registerUniform(`output_size`,`u32`).declareVariables(t,r)} + var tile : array, 16>; + ${e.mainStart([16,16,1])} + let stride = (uniforms.output_shape[1] - 1) / 16 + 1; + let workgroup_id_x = workgroup_index % stride; + let workgroup_id_y = workgroup_index / stride; + let input_col = workgroup_id_y * 16u + local_id.x; + let input_row = workgroup_id_x * 16u + local_id.y; + if (input_row < uniforms.a_shape[0] && input_col < uniforms.a_shape[1]) { + tile[local_id.y][local_id.x] = ${t.getByIndices(`${t.type.indices}(input_row, input_col)`)}; + } + workgroupBarrier(); + + let output_col = workgroup_id_x * 16u + local_id.x; + let output_row = workgroup_id_y * 16u + local_id.y; + if (output_row < uniforms.output_shape[0] && output_col < uniforms.output_shape[1]) { + ${r.setByIndices(`${r.type.indices}(output_row, output_col)`,`tile[local_id.x][local_id.y]`)} + } + }`},{name:`TransposeShared`,shaderCache:{inputDependencies:[`type`]},getRunData:()=>{let t=Y.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(s[1]/16),y:Math.ceil(s[0]/16)},programUniforms:[{type:12,data:t},...hN(o,s)]}},getShaderSource:l}):(l=e=>{let t=X(`a`,n,o.length),a=SN(`output`,n,s.length);return` + ${e.registerUniform(`output_size`,`u32`).declareVariables(t,a)} + + ${jN(i,r,t,a)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + + let indices = ${a.offsetToIndices(`global_idx`)}; + let aIndices = perm(indices); + + ${a.setByOffset(`global_idx`,t.getByIndices(`aIndices`))} + }`},{name:`Transpose`,shaderCache:{hint:`${t}`,inputDependencies:[`rank`]},getRunData:()=>{let t=Y.size(a);return{outputs:[{dims:a,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(t/64)},programUniforms:[{type:12,data:t},...hN(o,s)]}},getShaderSource:l})},FN=(e,t)=>{ON(e.inputs,t.perm),e.compute(PN(e.inputs[0],t.perm))},IN=e=>lN({perm:e.perm})}),RN,zN,BN,VN,HN,UN,WN,GN,KN,qN,JN,YN,XN,ZN,QN,$N,eP,tP,nP,rP,iP,aP=J(()=>{"use strict";gM(),NM(),DN(),MP(),LN(),RN={max:`select(bestValue, candidate, candidate > bestValue)`,min:`select(bestValue, candidate, candidate < bestValue)`,mean:`bestValue + candidate`,sum:`bestValue + candidate`,prod:`bestValue * candidate`,sumSquare:`bestValue + candidate * candidate`,logSumExp:`bestValue + exp(candidate)`,l1:`bestValue + abs(candidate)`,l2:`bestValue + candidate * candidate`,logSum:`bestValue + candidate`},zN={max:`select(bestValue, candidate, candidate > bestValue)`,min:`select(bestValue, candidate, candidate < bestValue)`,mean:`bestValue + candidate`,sum:`bestValue + candidate`,prod:`bestValue * candidate`,sumSquare:`bestValue + candidate`,logSumExp:`bestValue + candidate`,l1:`bestValue + candidate`,l2:`bestValue + candidate`,logSum:`bestValue + candidate`},BN={max:`_A[offset]`,min:`_A[offset]`,mean:`0`,sum:`0`,prod:`1`,sumSquare:`0`,logSumExp:`0`,l1:`0`,l2:`0`,logSum:`0`},VN={max:`bestValue`,min:`bestValue`,sum:`bestValue`,prod:`bestValue`,sumSquare:`bestValue`,logSumExp:`log(bestValue)`,l1:`bestValue`,l2:`sqrt(bestValue)`,logSum:`log(bestValue)`},HN=(e,t)=>{let n=[];for(let r=t-e;r{let n=[],r=e.length;for(let i=0;ie[t])]},WN=(e,t)=>{let n=e.length+t.length,r=[],i=0;for(let a=0;a{for(let n=0;n{let n=[];if(!GN(e,t)){for(let r=0;rn.push(e))}return n},qN=(e,t,n,r,i,a,o)=>{let s=n[0].dims,c=Y.size(a),l=Y.size(o),u=X(`_A`,n[0].dataType,s),d=SN(`output`,i,a),f=64;c===1&&(f=256);let p=` + var aBestValues : array; + `;return{name:e,shaderCache:{hint:`${t};${f}`,inputDependencies:[`type`]},getShaderSource:e=>` + ${e.registerUniform(`reduceSize`,`u32`).declareVariables(u,d)} + ${p} + fn DIV_CEIL(a : u32, b : u32) -> u32 { + return ((a - 1u) / b + 1u); + } + ${e.mainStart(f)} + + let outputIndex = global_idx / ${f}; + let offset = outputIndex * uniforms.reduceSize; + + var bestValue = f32(${BN[r]}); + let Length = uniforms.reduceSize; + for (var k = local_idx; k < Length; k = k + ${f}) { + let candidate = f32(${u.getByOffset(`offset + k`)}); + bestValue = ${RN[r]}; + } + aBestValues[local_idx] = bestValue; + workgroupBarrier(); + + var reduceSize = min(Length, ${f}u); + for (var currentSize = reduceSize / 2u; reduceSize > 1u; + currentSize = reduceSize / 2u) { + let interval = DIV_CEIL(reduceSize, 2u); + if (local_idx < currentSize) { + let candidate = aBestValues[local_idx + interval]; + bestValue = ${zN[r]}; + aBestValues[local_idx] = bestValue; + } + reduceSize = interval; + workgroupBarrier(); + } + + if (local_idx == 0u) { + ${d.setByOffset(`outputIndex`,`${r===`mean`?`${d.type.storage}(bestValue / f32(uniforms.reduceSize))`:`${d.type.storage}(${VN[r]})`}`)}; + } + }`,getRunData:()=>({outputs:[{dims:a,dataType:i}],dispatchGroup:{x:c},programUniforms:[{type:12,data:l}]})}},JN=(e,t,n,r)=>{let i=e.inputs.length===1?n:lP(e.inputs,n),a=i.axes;a.length===0&&!i.noopWithEmptyAxes&&(a=e.inputs[0].dims.map((e,t)=>t));let o=Y.normalizeAxes(a,e.inputs[0].dims.length),s=o,c=e.inputs[0],l=KN(s,e.inputs[0].dims.length);l.length>0&&(c=e.compute(PN(e.inputs[0],l),{inputs:[0],outputs:[-1]})[0],s=HN(s.length,c.dims.length));let[u,d]=UN(c.dims,s),f=u;i.keepDims&&(f=WN(u,o)),e.compute(qN(t,i.cacheKey,[c],r,e.inputs[0].dataType,f,d),{inputs:[c]})},YN=(e,t)=>{JN(e,`ReduceMeanShared`,t,`mean`)},XN=(e,t)=>{JN(e,`ReduceL1Shared`,t,`l1`)},ZN=(e,t)=>{JN(e,`ReduceL2Shared`,t,`l2`)},QN=(e,t)=>{JN(e,`ReduceLogSumExpShared`,t,`logSumExp`)},$N=(e,t)=>{JN(e,`ReduceMaxShared`,t,`max`)},eP=(e,t)=>{JN(e,`ReduceMinShared`,t,`min`)},tP=(e,t)=>{JN(e,`ReduceProdShared`,t,`prod`)},nP=(e,t)=>{JN(e,`ReduceSumShared`,t,`sum`)},rP=(e,t)=>{JN(e,`ReduceSumSquareShared`,t,`sumSquare`)},iP=(e,t)=>{JN(e,`ReduceLogSumShared`,t,`logSum`)}}),oP,sP,cP,lP,uP,dP,fP,pP,mP,hP,gP,_P,vP,yP,bP,xP,SP,CP,wP,TP,EP,DP,OP,kP,AP,jP,MP=J(()=>{"use strict";gM(),NM(),uN(),DN(),aP(),oP=e=>{if(!e||e.length===0||e.length>2)throw Error(`Reduce op requires 1 or 2 inputs.`);if(e.length===2&&e[1].dims.length!==1)throw Error(`Invalid axes input dims.`)},sP=e=>[``,``,`var value = ${e.getByIndices(`input_indices`)};`,``],cP=(e,t,n,r,i,a,o=!1,s=!1)=>{let c=[],l=n[0].dims,u=l.length,d=Y.normalizeAxes(i,u),f=!s&&d.length===0;l.forEach((e,t)=>{f||d.indexOf(t)>=0?o&&c.push(1):c.push(e)});let p=c.length,m=Y.size(c);return{name:e,shaderCache:t,getShaderSource:e=>{let t=[],i=X(`_A`,n[0].dataType,u),s=SN(`output`,a,p),c=r(i,s,d),m=c[2];for(let e=0,n=0;e=0?(o&&n++,m=`for(var j${e}: u32 = 0; j${e} < ${l[e]}; j${e}++) { + ${c[2].includes(`last_index`)?`let last_index = j${e};`:``} + ${i.indicesSet(`input_indices`,e,`j${e}`)} + ${m} + }`):(t.push(`${i.indicesSet(`input_indices`,e,s.indicesGet(`output_indices`,n))};`),n++);return` + + ${e.registerUniform(`output_size`,`u32`).declareVariables(i,s)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + var input_indices: ${i.type.indices}; + let output_indices = ${s.offsetToIndices(`global_idx`)}; + + ${t.join(` +`)} + ${c[0]} // init ops for reduce max/min + ${c[1]} + ${m} + ${c[3]} + ${c.length===4?s.setByOffset(`global_idx`,`value`):c.slice(4).join(` +`)} + }`},getRunData:()=>({outputs:[{dims:c,dataType:a}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:[{type:12,data:m},...hN(l,c)]})}},lP=(e,t)=>{let n=[];return e[1].dims[0]>0&&e[1].getBigInt64Array().forEach(e=>n.push(Number(e))),lN({axes:n,keepDims:t.keepDims,noopWithEmptyAxes:t.noopWithEmptyAxes})},uP=(e,t,n,r)=>{let i=e.inputs,a=i.length===1?n:lP(i,n);e.compute(cP(t,{hint:a.cacheKey,inputDependencies:[`rank`]},[i[0]],a.noopWithEmptyAxes&&a.axes.length===0?sP:r,a.axes,i[0].dataType,a.keepDims,a.noopWithEmptyAxes),{inputs:[0]})},dP=(e,t)=>{oP(e.inputs),uP(e,`ReduceLogSum`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += ${e.getByIndices(`input_indices`)};`,`value = log(value);`])},fP=(e,t)=>{oP(e.inputs),uP(e,`ReduceL1`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += abs(${e.getByIndices(`input_indices`)});`,``])},pP=(e,t)=>{oP(e.inputs),uP(e,`ReduceL2`,t,(e,t)=>[`var t = ${t.type.value}(0); var value = ${t.type.value}(0);`,``,`t = ${e.getByIndices(`input_indices`)}; value += (t * t);`,`value = sqrt(value);`])},mP=(e,t)=>{oP(e.inputs),uP(e,`ReduceLogSumExp`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += exp(${e.getByIndices(`input_indices`)});`,`value = log(value);`])},hP=(e,t)=>{oP(e.inputs),uP(e,`ReduceMax`,t,(e,t,n)=>{let r=[];for(let t=0;t=0||n.length===0)&&r.push(e.indicesSet(`input_indices`,t,0));return[`${r.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)};`,`value = max(value, ${e.getByIndices(`input_indices`)});`,``]})},gP=(e,t)=>{oP(e.inputs),uP(e,`ReduceMean`,t,(t,n,r)=>{let i=1;for(let n=0;n=0||r.length===0)&&(i*=e.inputs[0].dims[n]);return[`var sum = f32(0);`,``,`sum += f32(${t.getByIndices(`input_indices`)});`,`let value = ${n.type.value}(sum / ${i});`]})},_P=(e,t)=>{oP(e.inputs),uP(e,`ReduceMin`,t,(e,t,n)=>{let r=[];for(let t=0;t=0||n.length===0)&&r.push(`input_indices[${t}] = 0;`);return[`${r.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)};`,`value = min(value, ${e.getByIndices(`input_indices`)});`,``]})},vP=(e,t)=>{oP(e.inputs),uP(e,`ReduceProd`,t,(e,t)=>[`var value = ${t.type.storage}(1);`,``,`value *= ${e.getByIndices(`input_indices`)};`,``])},yP=(e,t)=>{oP(e.inputs),uP(e,`ReduceSum`,t,(e,t)=>[`var value = ${t.type.storage}(0);`,``,`value += ${e.getByIndices(`input_indices`)};`,``])},bP=(e,t)=>{oP(e.inputs),uP(e,`ReduceSumSquare`,t,(e,t)=>[`var t = ${t.type.value}(0); var value = ${t.type.value}(0);`,``,`t = ${e.getByIndices(`input_indices`)}; value += t * t;`,``])},xP=(e,t,n)=>{if(t.length===0)return n;let r=1,i=1;for(let n=0;n1024},SP=(e,t)=>{xP(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?gP(e,t):YN(e,t)},CP=(e,t)=>{xP(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?fP(e,t):XN(e,t)},wP=(e,t)=>{xP(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?pP(e,t):ZN(e,t)},TP=(e,t)=>{xP(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?mP(e,t):QN(e,t)},EP=(e,t)=>{xP(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?hP(e,t):$N(e,t)},DP=(e,t)=>{xP(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?_P(e,t):eP(e,t)},OP=(e,t)=>{xP(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?vP(e,t):tP(e,t)},kP=(e,t)=>{xP(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?yP(e,t):nP(e,t)},AP=(e,t)=>{xP(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?bP(e,t):rP(e,t)},jP=(e,t)=>{xP(e.inputs[0].dims,t.axes,t.noopWithEmptyAxes)?dP(e,t):iP(e,t)}}),NP,PP,FP,IP,LP=J(()=>{"use strict";gM(),uN(),MP(),NP=e=>{if(!e||e.length===0||e.length>2)throw Error(`ArgMinMaxOp op requires 1 or 2 inputs.`);if(e[0].dataType!==1)throw Error(`Invalid input type.`)},PP=(e,t)=>{NP(e.inputs),e.compute(cP(`ArgMin`,{hint:t.cacheKey,inputDependencies:[`rank`]},[e.inputs[0]],(e,n,r)=>{let i=[];for(let t=0;t=0||r.length===0)&&i.push(`input_indices[${t}] = 0;`);return[`${i.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)}; +var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLastIndex>0?`<=`:`<`} value) { + value = ${e.getByIndices(`input_indices`)}; + best_index = i32(last_index); + }`,``,n.setByOffset(`global_idx`,`best_index`)]},[t.axis],7,t.keepDims),{inputs:[0]})},FP=(e,t)=>{NP(e.inputs),e.compute(cP(`argMax`,{hint:t.cacheKey,inputDependencies:[`rank`]},[e.inputs[0]],(e,n,r)=>{let i=[];for(let t=0;t=0||r.length===0)&&i.push(`input_indices[${t}] = 0;`);return[`${i.join(` +`)}`,`var value = ${e.getByIndices(`input_indices`)}; +var best_index : i32 = 0;`,`if (${e.getByIndices(`input_indices`)} ${t.selectLastIndex>0?`>=`:`>`} value) { + value = ${e.getByIndices(`input_indices`)}; + best_index = i32(last_index); + }`,``,n.setByOffset(`global_idx`,`best_index`)]},[t.axis],7,t.keepDims),{inputs:[0]})},IP=e=>lN(e)}),RP,zP,BP,VP,HP,UP,WP,GP,KP=J(()=>{"use strict";gM(),NM(),ZM(),DN(),RP=(e,t)=>{let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5];if(o&&s)throw Error(`Attention cannot have both past and attention_bias`);if(n.dims.length!==3)throw Error(`Input "input" must have 3 dimensions`);let c=n.dims[0],l=n.dims[1],u=n.dims[2];if(i.dims.length!==1)throw Error(`Input "bias" is expected to have 1 dimensions`);if(r.dims.length!==2)throw Error(`Input "weights" is expected to have 2 dimensions`);if(r.dims[0]!==u)throw Error(`Input 1 dimension 0 should have same length as dimension 2 of input 0`);if(i.dims[0]!==r.dims[1])throw Error(`Input "bias" dimension 0 should have same length as dimension 1 of input "weights"`);let d=i.dims[0]/3,f=d,p=f;if(t.qkvHiddenSizes.length>0){if(t.qkvHiddenSizes.length!==3)throw Error(`qkv_hidden_sizes attribute should have 3 elements`);for(let e of t.qkvHiddenSizes)if(e%t.numHeads!==0)throw Error(`qkv_hidden_sizes should be divisible by num_heads`);d=t.qkvHiddenSizes[0],f=t.qkvHiddenSizes[1],p=t.qkvHiddenSizes[2]}let m=l;if(d!==f)throw Error(`qkv_hidden_sizes first element should be same as the second`);if(i.dims[0]!==d+f+p)throw Error(`Input "bias" dimension 0 should have same length as sum of Q/K/V hidden sizes`);let h=0;if(o){if(f!==p)throw Error(`Input "past" expect k_hidden_size == v_hidden_size`);if(o.dims.length!==5)throw Error(`Input "past" must have 5 dimensions`);if(o.dims[0]!==2)throw Error(`Input "past" first dimension must be 2`);if(o.dims[1]!==c)throw Error(`Input "past" second dimension must be batch_size`);if(o.dims[2]!==t.numHeads)throw Error(`Input "past" third dimension must be num_heads`);if(o.dims[4]!==f/t.numHeads)throw Error(`Input "past" fifth dimension must be k_hidden_size / num_heads`);t.pastPresentShareBuffer||(h=o.dims[3])}let g=m+h;if(a)throw Error(`Mask not supported`);if(o)throw Error(`past is not supported`);if(s){if(s.dims.length!==4)throw Error(`Input "attention_bias" must have 4 dimensions`);if(s.dims[0]!==c||s.dims[1]!==t.numHeads||s.dims[2]!==l||s.dims[3]!==g)throw Error(`Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)`)}return{batchSize:c,sequenceLength:l,pastSequenceLength:h,kvSequenceLength:m,totalSequenceLength:g,maxSequenceLength:-1,inputHiddenSize:u,hiddenSize:d,vHiddenSize:p,headSize:Math.floor(d/t.numHeads),vHeadSize:Math.floor(p/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:0,scale:t.scale,broadcastResPosBias:!1,passPastInKv:!1,qkvFormat:1}},zP=(e,t,n)=>t&&e?` + let total_sequence_length_input = u32(${t.getByOffset(`0`)}); + let present_sequence_length = max(total_sequence_length_input, uniforms.past_sequence_length); + let is_subsequent_prompt: bool = sequence_length > 1 && sequence_length != total_sequence_length_input; + let is_first_prompt: bool = is_subsequent_prompt == false && sequence_length == total_sequence_length_input; + total_sequence_length = u32(${e?.getByOffset(`batchIdx`)}) + 1; + var past_sequence_length: u32 = 0; + if (is_first_prompt == false) { + past_sequence_length = total_sequence_length - sequence_length; + } + `:` + ${n?`let past_sequence_length = uniforms.past_sequence_length`:``}; + let present_sequence_length = total_sequence_length; + `,BP=(e,t,n,r,i,a,o,s)=>{let c=gN(o?1:a),l=64,u=a/c;u{let n=SN(`x`,e.dataType,e.dims,c),r=[n],i=o?X(`seq_lens`,o.dataType,o.dims):void 0;i&&r.push(i);let a=s?X(`total_sequence_length_input`,s.dataType,s.dims):void 0;a&&r.push(a);let u=mN(e.dataType);return` + var thread_max: array; + var thread_sum: array; + ${t.registerUniforms([{name:`batch_size`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`past_sequence_length`,type:`u32`},{name:`sequence_length`,type:`u32`},{name:`total_sequence_length`,type:`u32`},{name:`elements_per_thread`,type:`u32`}]).declareVariables(...r)} + ${t.mainStart([l,1,1])} + let batchIdx = workgroup_id.z / uniforms.num_heads; + let headIdx = workgroup_id.z % uniforms.num_heads; + let sequence_length = uniforms.sequence_length; + var total_sequence_length = uniforms.total_sequence_length; + ${zP(i,a,!1)} + let local_offset = local_idx * uniforms.elements_per_thread; + let offset = (global_idx / ${l}) * uniforms.total_sequence_length + local_offset; + let seq_causal_length = ${o?`u32(past_sequence_length + workgroup_id.y + 1)`:`total_sequence_length`}; + var thread_max_vector = ${m}(-3.402823e+38f); + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + thread_max_vector = max(${m}(x[offset + i]), thread_max_vector); + } + thread_max[local_idx] = ${(()=>{switch(c){case 1:return`thread_max_vector`;case 2:return`max(thread_max_vector.x, thread_max_vector.y)`;case 4:return`max(max(thread_max_vector.x, thread_max_vector.y), max(thread_max_vector.z, thread_max_vector.w))`;default:throw Error(`Unsupported components: ${c}`)}})()}; + workgroupBarrier(); + + var max_value = f32(-3.402823e+38f); + for (var i = 0u; i < ${l}; i++) { + max_value = max(thread_max[i], max_value); + } + + var sum_vector = ${m}(0); + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + sum_vector += exp(${m}(x[offset + i]) - max_value); + } + thread_sum[local_idx] = ${(()=>{switch(c){case 1:return`sum_vector`;case 2:return`sum_vector.x + sum_vector.y`;case 4:return`sum_vector.x + sum_vector.y + sum_vector.z + sum_vector.w`;default:throw Error(`Unsupported components: ${c}`)}})()}; + workgroupBarrier(); + + var sum: f32 = 0; + for (var i = 0u; i < ${l}; i++) { + sum += thread_sum[i]; + } + + if (sum == 0) { + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + x[offset + i] = ${n.type.value}(${u}(1.0) / ${u}(seq_causal_length)); + } + } else { + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + var f32input = ${m}(x[offset + i]); + x[offset + i] = ${n.type.value}(exp(f32input - max_value) / sum); + } + } + ${o?` + for (var total_seq_id: u32 = seq_causal_length; total_seq_id + local_offset < uniforms.total_sequence_length; total_seq_id++) { + x[offset + total_seq_id] = ${n.type.value}(${u}(0)); + }`:``}; + }`},getRunData:()=>({outputs:[],dispatchGroup:{x:1,y:i,z:t*n},programUniforms:f})}},VP=(e,t,n,r,i,a,o,s,c)=>{let l=o+a.kvSequenceLength,u=[a.batchSize,a.numHeads,a.sequenceLength,l],d=e>1&&r,f=a.kvNumHeads?a.kvNumHeads:a.numHeads,p=d?[a.batchSize,f,l,a.headSize]:void 0,m=a.nReps?a.nReps:1,h=a.scale===0?1/Math.sqrt(a.headSize):a.scale,g=gN(a.headSize),_=a.headSize/g,v={x:Math.ceil(l/12),y:Math.ceil(a.sequenceLength/12),z:a.batchSize*a.numHeads},y=[{type:12,data:a.sequenceLength},{type:12,data:_},{type:12,data:l},{type:12,data:a.numHeads},{type:12,data:a.headSize},{type:1,data:h},{type:12,data:o},{type:12,data:a.kvSequenceLength},{type:12,data:m}],b=d&&r&&Y.size(r.dims)>0,x=[`type`,`type`];b&&x.push(`type`),i&&x.push(`type`),s&&x.push(`type`),c&&x.push(`type`);let S=[{dims:u,dataType:t.dataType,gpuDataType:0}];return d&&S.push({dims:p,dataType:t.dataType,gpuDataType:0}),{name:`AttentionProbs`,shaderCache:{hint:`${g};${i!==void 0};${r!==void 0};${e}`,inputDependencies:x},getRunData:()=>({outputs:S,dispatchGroup:v,programUniforms:y}),getShaderSource:e=>{let a=X(`q`,t.dataType,t.dims,g),o=[a,X(`key`,n.dataType,n.dims,g)];if(b){let e=X(`past_key`,r.dataType,r.dims,g);o.push(e)}i&&o.push(X(`attention_bias`,i.dataType,i.dims));let l=s?X(`seq_lens`,s.dataType,s.dims):void 0;l&&o.push(l);let f=c?X(`total_sequence_length_input`,c.dataType,c.dims):void 0;f&&o.push(f);let h=SN(`output`,t.dataType,u),_=[h];d&&_.push(SN(`present_key`,t.dataType,p,g));let v=mN(1,g);return` + const TILE_SIZE = 12u; + + var tileQ: array<${a.type.storage}, 144>; + var tileK: array<${a.type.storage}, 144>; + ${e.registerUniforms([{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`alpha`,type:`f32`},{name:`past_sequence_length`,type:`u32`},{name:`kv_sequence_length`,type:`u32`},{name:`n_reps`,type:`u32`}]).declareVariables(...o,..._)} + ${e.mainStart([12,12,1])} + // x holds the N and y holds the M + let headIdx = workgroup_id.z % uniforms.num_heads; + let kvHeadIdx = ${m===1?`headIdx`:`headIdx / uniforms.n_reps`}; + let kv_num_heads = ${m===1?`uniforms.num_heads`:`uniforms.num_heads / uniforms.n_reps`}; + let batchIdx = workgroup_id.z / uniforms.num_heads; + let m = workgroup_id.y * TILE_SIZE; + let n = workgroup_id.x * TILE_SIZE; + let sequence_length = uniforms.M; + var total_sequence_length = uniforms.N; + ${zP(l,f,!0)} + let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; + let qOffset = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; + ${b&&d?`let pastKeyOffset = absKvHeadIdx * uniforms.past_sequence_length * uniforms.K;`:``}; + let kOffset = absKvHeadIdx * uniforms.kv_sequence_length * uniforms.K; + ${d?`let presentKeyOffset = absKvHeadIdx * uniforms.N * uniforms.K;`:``} + var value = ${v}(0); + for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { + if (global_id.y < uniforms.M && w + local_id.x < uniforms.K) { + tileQ[TILE_SIZE * local_id.y + local_id.x] = q[qOffset + local_id.y * uniforms.K + w + local_id.x]; + } + if (n + local_id.y < uniforms.N && w + local_id.x < uniforms.K) { + var idx = TILE_SIZE * local_id.y + local_id.x; + ${b&&d?` + if (n + local_id.y < past_sequence_length) { + tileK[idx] = past_key[pastKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x]; + } else if (n + local_id.y - past_sequence_length < uniforms.kv_sequence_length) { + tileK[idx] = key[kOffset + (n + local_id.y - past_sequence_length) * uniforms.K + w + local_id.x]; + }`:` + if (n + local_id.y < uniforms.kv_sequence_length) { + tileK[idx] = key[kOffset + (n + local_id.y) * uniforms.K + w + local_id.x]; + }`} + ${d?`if (n + local_id.y < present_sequence_length) { + present_key[presentKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x] = tileK[idx]; + }`:``} + } + workgroupBarrier(); + + for (var k: u32 = 0u; k < TILE_SIZE && w+k < uniforms.K; k++) { + value += ${v}(tileQ[TILE_SIZE * local_id.y + k] * tileK[TILE_SIZE * local_id.x + k]); + } + + workgroupBarrier(); + } + + if (global_id.y < uniforms.M && global_id.x < total_sequence_length) { + let headOffset = workgroup_id.z * uniforms.M * uniforms.N; + let outputIdx = headOffset + global_id.y * uniforms.N + global_id.x; + var sum: f32 = ${(()=>{switch(g){case 1:return`value`;case 2:return`value.x + value.y`;case 4:return`value.x + value.y + value.z + value.w`;default:throw Error(`Unsupported components: ${g}`)}})()}; + output[outputIdx] = ${h.type.value} (sum * uniforms.alpha) + ${i?`attention_bias[outputIdx]`:`0.0`}; + } + }`}}},HP=(e,t,n,r,i,a,o=void 0,s=void 0)=>{let c=a+i.kvSequenceLength,l=i.nReps?i.nReps:1,u=i.vHiddenSize*l,d=e>1&&r,f=i.kvNumHeads?i.kvNumHeads:i.numHeads,p=d?[i.batchSize,f,c,i.headSize]:void 0,m=[i.batchSize,i.sequenceLength,u],h={x:Math.ceil(i.vHeadSize/12),y:Math.ceil(i.sequenceLength/12),z:i.batchSize*i.numHeads},g=[{type:12,data:i.sequenceLength},{type:12,data:c},{type:12,data:i.vHeadSize},{type:12,data:i.numHeads},{type:12,data:i.headSize},{type:12,data:u},{type:12,data:a},{type:12,data:i.kvSequenceLength},{type:12,data:l}],_=d&&r&&Y.size(r.dims)>0,v=[`type`,`type`];_&&v.push(`type`),o&&v.push(`type`),s&&v.push(`type`);let y=[{dims:m,dataType:t.dataType,gpuDataType:0}];return d&&y.push({dims:p,dataType:t.dataType,gpuDataType:0}),{name:`AttentionScore`,shaderCache:{hint:`${r!==void 0};${e}`,inputDependencies:v},getRunData:()=>({outputs:y,dispatchGroup:h,programUniforms:g}),getShaderSource:e=>{let i=X(`probs`,t.dataType,t.dims),a=[i,X(`v`,n.dataType,n.dims)];_&&a.push(X(`past_value`,r.dataType,r.dims));let c=o?X(`seq_lens`,o.dataType,o.dims):void 0;o&&a.push(c);let u=s?X(`total_sequence_length_input`,s.dataType,s.dims):void 0;s&&a.push(u);let f=[SN(`output`,t.dataType,m)];return d&&f.push(SN(`present_value`,t.dataType,p)),` + const TILE_SIZE = 12u; + var tileQ: array<${i.type.value}, 144>; + var tileV: array<${i.type.value}, 144>; + ${e.registerUniforms([{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`v_hidden_size`,type:`u32`},{name:`past_sequence_length`,type:`u32`},{name:`kv_sequence_length`,type:`u32`},{name:`n_reps`,type:`u32`}]).declareVariables(...a,...f)} + ${e.mainStart([12,12,1])} + let headIdx = workgroup_id.z % uniforms.num_heads; + let batchIdx = workgroup_id.z / uniforms.num_heads; + let kvHeadIdx = ${l===1?`headIdx`:`headIdx / uniforms.n_reps`}; + let kv_num_heads = ${l===1?`uniforms.num_heads`:`uniforms.num_heads / uniforms.n_reps`}; + let m = global_id.y; + let n = global_id.x; + let sequence_length = uniforms.M; + var total_sequence_length = uniforms.K; + ${zP(c,u,!0)} + let offsetA = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; + let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; // kvHeadIdx is relative to the batch + ${_&&d?`let pastValueOffset = absKvHeadIdx * uniforms.N * uniforms.past_sequence_length + n;`:``}; + let vOffset = absKvHeadIdx * uniforms.N * uniforms.kv_sequence_length + n; + ${d?`let presentValueOffset = absKvHeadIdx * uniforms.N * uniforms.K + n;`:``} + var value = ${i.type.storage}(0); + for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { + if (m < uniforms.M && w + local_id.x < uniforms.K) { + tileQ[TILE_SIZE * local_id.y + local_id.x] = probs[offsetA + w + local_id.x]; + } + if (n < uniforms.N && w + local_id.y < uniforms.K) { + var idx = TILE_SIZE * local_id.y + local_id.x; + ${_&&d?` + if (w + local_id.y < past_sequence_length) { + tileV[idx] = past_value[pastValueOffset + (w + local_id.y) * uniforms.N]; + } else if (w + local_id.y - past_sequence_length < uniforms.kv_sequence_length) { + tileV[idx] = v[vOffset + (w + local_id.y - past_sequence_length) * uniforms.N]; + } + `:` + if (w + local_id.y < uniforms.kv_sequence_length) { + tileV[idx] = v[vOffset + (w + local_id.y) * uniforms.N]; + }`} + ${d?` + if (w + local_id.y < present_sequence_length) { + present_value[presentValueOffset + (w + local_id.y) * uniforms.N] = tileV[idx]; + }`:``} + } + workgroupBarrier(); + for (var k: u32 = 0u; k < TILE_SIZE && w+k < total_sequence_length; k++) { + value += tileQ[TILE_SIZE * local_id.y + k] * tileV[TILE_SIZE * k + local_id.x]; + } + workgroupBarrier(); + } + + // we need to transpose output from BNSH_v to BSND_v + if (m < uniforms.M && n < uniforms.N) { + let outputIdx = batchIdx * uniforms.M * uniforms.v_hidden_size + m * uniforms.v_hidden_size + + headIdx * uniforms.N + n; + output[outputIdx] = value; + } + }`}}},UP=(e,t,n,r,i,a,o,s,c,l,u=void 0,d=void 0)=>{let f=Math.min(e.outputCount,1+ +!!o+ +!!s),p=f>1?l.pastSequenceLength:0,m=p+l.kvSequenceLength,h=c&&Y.size(c.dims)>0?c:void 0,g=[t,n];f>1&&o&&Y.size(o.dims)>0&&g.push(o),h&&g.push(h),u&&g.push(u),d&&g.push(d);let _=e.compute(VP(f,t,n,o,h,l,p,u,d),{inputs:g,outputs:f>1?[-1,1]:[-1]})[0];e.compute(BP(_,l.batchSize,l.numHeads,p,l.sequenceLength,m,u,d),{inputs:u&&d?[_,u,d]:[_],outputs:[]});let v=[_,r];f>1&&s&&Y.size(s.dims)>0&&v.push(s),u&&v.push(u),d&&v.push(d),e.compute(HP(f,_,r,s,l,p,u,d),{inputs:v,outputs:f>1?[0,2]:[0]})},WP=(e,t)=>{let n=[t.batchSize,t.numHeads,t.sequenceLength,t.headSize],r=t.sequenceLength,i=t.inputHiddenSize,a=t.headSize,o={x:Math.ceil(t.headSize/12),y:Math.ceil(t.sequenceLength/12),z:t.batchSize*t.numHeads},s=[e.inputs[0],e.inputs[1],e.inputs[2]],c=[{type:12,data:r},{type:12,data:i},{type:12,data:a},{type:12,data:t.numHeads},{type:12,data:t.headSize},{type:12,data:t.hiddenSize},{type:12,data:t.hiddenSize+t.hiddenSize+t.vHiddenSize}];return e.compute({name:`AttentionPrepare`,shaderCache:{inputDependencies:[`type`,`type`,`type`]},getRunData:()=>({outputs:[{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:n,dataType:e.inputs[0].dataType,gpuDataType:0}],dispatchGroup:o,programUniforms:c}),getShaderSource:e=>{let t=SN(`output_q`,s[0].dataType,n),r=SN(`output_k`,s[0].dataType,n),i=SN(`output_v`,s[0].dataType,n),a=X(`input`,s[0].dataType,s[0].dims),o=X(`weight`,s[1].dataType,s[1].dims),c=X(`bias`,s[2].dataType,s[2].dims),l=a.type.storage;return` + const TILE_SIZE = 12u; + var tileInput: array<${l}, 144>; + var tileWeightQ: array<${l}, 144>; + var tileWeightK: array<${l}, 144>; + var tileWeightV: array<${l}, 144>; + ${e.registerUniforms([{name:`M`,type:`u32`},{name:`K`,type:`u32`},{name:`N`,type:`u32`},{name:`num_heads`,type:`u32`},{name:`head_size`,type:`u32`},{name:`hidden_size`,type:`u32`},{name:`ldb`,type:`u32`}]).declareVariables(a,o,c,t,r,i)} + ${e.mainStart([12,12,1])} + let batchIndex = workgroup_id.z / uniforms.num_heads; + let headNumber = workgroup_id.z % uniforms.num_heads; + let m = global_id.y; + let n = global_id.x; + + let inputOffset = batchIndex * (uniforms.M * uniforms.K) + m * uniforms.K; + let biasOffsetQ = headNumber * uniforms.head_size; + let biasOffsetK = uniforms.hidden_size + biasOffsetQ; + let biasOffsetV = uniforms.hidden_size + biasOffsetK; + + var valueQ = ${l}(0); + var valueK = ${l}(0); + var valueV = ${l}(0); + for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { + if (m < uniforms.M && w + local_id.x < uniforms.K) { + tileInput[TILE_SIZE * local_id.y + local_id.x] = input[inputOffset + w + local_id.x]; + } + if (n < uniforms.N && w + local_id.y < uniforms.K) { + let offset = n + (w + local_id.y) * uniforms.ldb; + tileWeightQ[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetQ + offset]; + tileWeightK[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetK + offset]; + tileWeightV[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetV + offset]; + } + workgroupBarrier(); + for (var k: u32 = 0u; k{let n=RP(e.inputs,t),[r,i,a]=WP(e,n);return UP(e,r,i,a,e.inputs[4],void 0,void 0,void 0,e.inputs[5],n)}}),qP,JP,YP,XP,ZP=J(()=>{"use strict";dj(),gM(),NM(),uN(),DN(),qP=(e,t)=>{if(!e||e.length!==5)throw Error(`BatchNormalization requires 5 inputs`);let n=(e,t,n)=>{let r=t.length;if(r!==e.length)throw Error(`${n}: num dimensions != ${r}`);t.forEach((t,r)=>{if(t!==e[r])throw Error(`${n}: dim[${r}] do not match`)})};if(e[0].dims.length>1){let r=t.format===`NHWC`?t.spatial?e[0].dims.slice(-1):e[0].dims.slice(-1).concat(e[0].dims.slice(1,e[0].dims.length-1)):e[0].dims.slice(1,t.spatial?2:void 0);n(e[1].dims,r,`Invalid input scale`),n(e[2].dims,r,`Invalid input B`),n(e[3].dims,r,`Invalid input mean`),n(e[4].dims,r,`Invalid input var`)}else n(e[1].dims,[1],`Invalid input scale`),n(e[2].dims,[1],`Invalid input B`),n(e[3].dims,[1],`Invalid input mean`),n(e[4].dims,[1],`Invalid input var`)},JP=(e,t)=>{let{epsilon:n,spatial:r,format:i}=t,a=e[0].dims,o=r?gN(a[a.length-1]):1,s=i===`NHWC`&&a.length>1?o:1,c=Y.size(a)/o,l=r,u=l?a.length:a,d=X(`x`,e[0].dataType,e[0].dims,o),f=X(`scale`,e[1].dataType,e[1].dims,s),p=X(`bias`,e[2].dataType,e[2].dims,s),m=X(`inputMean`,e[3].dataType,e[3].dims,s),h=X(`inputVar`,e[4].dataType,e[4].dims,s),g=SN(`y`,e[0].dataType,u,o),_=()=>{let e=``;if(r)e=`let cOffset = ${a.length===1?`0u`:i===`NHWC`?`outputIndices[${a.length-1}] / ${o}`:`outputIndices[1]`};`;else if(i===`NCHW`)e=` + ${g.indicesSet(`outputIndices`,`0`,`0`)} + let cOffset = ${g.indicesToOffset(`outputIndices`)};`;else{e=`var cIndices = ${f.type.indices}(0); + cIndices[0] = outputIndices[${a.length-1}];`;for(let t=1;t` + const epsilon = ${n}; + ${e.registerUniform(`outputSize`,`u32`).declareVariables(d,f,p,m,h,g)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + var outputIndices = ${g.offsetToIndices(`global_idx * ${o}`)}; + ${_()} + let scale = ${f.getByOffset(`cOffset`)}; + let bias = ${p.getByOffset(`cOffset`)}; + let inputMean = ${m.getByOffset(`cOffset`)}; + let inputVar = ${h.getByOffset(`cOffset`)}; + let x = ${d.getByOffset(`global_idx`)}; + let value = (x - inputMean) * inverseSqrt(inputVar + epsilon) * scale + bias; + ${g.setByOffset(`global_idx`,`value`)} + }`,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:l?[{type:12,data:c},...hN(a)]:[{type:12,data:c}]})}},YP=e=>lN(e),XP=(e,t)=>{let{inputs:n,outputCount:r}=e,i=YP({...t,outputCount:r});if(DA.webgpu.validateInputContent&&qP(n,i),t.trainingMode)throw Error(`BatchNormalization trainingMode is not supported yet.`);e.compute(JP(n,i))}}),QP,$P,eF,tF=J(()=>{"use strict";NM(),DN(),QP=e=>{if(e[0].dims.length!==3)throw Error(`input should have 3 dimensions`);if(![320,640,1280].includes(e[0].dims[2]))throw Error(`number of channels should be 320, 640 or 1280`);if(e[1].dims.length!==1)throw Error(`bias is expected to have 1 dimensions`);if(e[0].dims[2]!==e[1].dims[0])throw Error(`last dimension of input and bias are not the same`)},$P=e=>{let t=e[0].dims,n=e[0].dims[2],r=Y.size(t)/4,i=e[0].dataType,a=X(`input`,i,t,4),o=X(`bias`,i,[n],4),s=X(`residual`,i,t,4),c=SN(`output`,i,t,4);return{name:`BiasAdd`,getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(r/64)}}),getShaderSource:e=>` + const channels = ${n}u / 4; + ${e.declareVariables(a,o,s,c)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(r)} + let value = ${a.getByOffset(`global_idx`)} + + ${o.getByOffset(`global_idx % channels`)} + ${s.getByOffset(`global_idx`)}; + ${c.setByOffset(`global_idx`,`value`)} + }`}},eF=e=>{QP(e.inputs),e.compute($P(e.inputs))}}),nF,rF,iF,aF,oF,sF,cF,lF,uF,dF,fF,pF,mF,hF,gF,_F,vF,yF,bF,xF,SF,CF,wF,TF,EF,DF,OF,kF,AF,jF,MF,NF,PF,FF,IF,LF,RF,zF,BF,VF,HF,UF,WF,GF,KF,qF=J(()=>{"use strict";gM(),NM(),uN(),DN(),nF=(e,t,n,r,i,a,o)=>{let s=Math.ceil(t/4),c=``;c=typeof i==`string`?`${i}(a)`:i(`a`);let l=X(`inputData`,n,[s],4),u=SN(`outputData`,r,[s],4),d=[{name:`vec_size`,type:`u32`}];return o&&d.push(...o),` + ${e.registerUniforms(d).declareVariables(l,u)} + + ${a??``} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} + + let a = ${l.getByOffset(`global_idx`)}; + ${u.setByOffset(`global_idx`,c)} + }`},rF=(e,t,n,r,i,a=e.dataType,o,s)=>{let c=[{type:12,data:Math.ceil(Y.size(e.dims)/4)}];return o&&c.push(...o),{name:t,shaderCache:{hint:i,inputDependencies:[`type`]},getShaderSource:t=>nF(t,Y.size(e.dims),e.dataType,a,n,r,s),getRunData:t=>({outputs:[{dims:e.dims,dataType:a}],dispatchGroup:{x:Math.ceil(Y.size(t[0].dims)/64/4)},programUniforms:c})}},iF=e=>{e.compute(rF(e.inputs[0],`Abs`,`abs`))},aF=e=>{e.compute(rF(e.inputs[0],`Acos`,`acos`))},oF=e=>{e.compute(rF(e.inputs[0],`Acosh`,`acosh`))},sF=e=>{e.compute(rF(e.inputs[0],`Asin`,`asin`))},cF=e=>{e.compute(rF(e.inputs[0],`Asinh`,`asinh`))},lF=e=>{e.compute(rF(e.inputs[0],`Atan`,`atan`))},uF=e=>{e.compute(rF(e.inputs[0],`Atanh`,`atanh`))},dF=e=>lN(e),fF=(e,t)=>{let n;switch(t.to){case 10:n=`vec4`;break;case 1:n=`vec4`;break;case 12:n=`vec4`;break;case 6:n=`vec4`;break;case 9:n=`vec4`;break;default:throw RangeError(`not supported type (specified in attribute 'to' from 'Cast' operator): ${t.to}`)}e.compute(rF(e.inputs[0],`Cast`,n,void 0,t.cacheKey,t.to))},pF=e=>{let t,n,r=e.length>=2&&e[1].data!==0,i=e.length>=3&&e[2].data!==0;switch(e[0].dataType){case 1:t=r?e[1].getFloat32Array()[0]:-34028234663852886e22,n=i?e[2].getFloat32Array()[0]:34028234663852886e22;break;case 10:t=r?e[1].getUint16Array()[0]:64511,n=i?e[2].getUint16Array()[0]:31743;break;default:throw Error(`Unsupport data type`)}return lN({min:t,max:n})},mF=(e,t)=>{let n=t||pF(e.inputs),r=mN(e.inputs[0].dataType);e.compute(rF(e.inputs[0],`Clip`,e=>`clamp(${e}, vec4<${r}>(uniforms.min), vec4<${r}>(uniforms.max))`,void 0,n.cacheKey,void 0,[{type:e.inputs[0].dataType,data:n.min},{type:e.inputs[0].dataType,data:n.max}],[{name:`min`,type:r},{name:`max`,type:r}]),{inputs:[0]})},hF=e=>{e.compute(rF(e.inputs[0],`Ceil`,`ceil`))},gF=e=>{e.compute(rF(e.inputs[0],`Cos`,`cos`))},_F=e=>{e.compute(rF(e.inputs[0],`Cosh`,`cosh`))},vF=e=>lN(e),yF=(e,t)=>{let n=mN(e.inputs[0].dataType);e.compute(rF(e.inputs[0],`Elu`,e=>`elu_vf32(${e})`,` + const elu_alpha_ = ${n}(${t.alpha}); + + fn elu_f32(a: ${n}) -> ${n} { + return select((exp(a) - 1.0) * elu_alpha_, a, a >= 0.0); + } + + fn elu_vf32(v: vec4<${n}>) -> vec4<${n}> { + return vec4(elu_f32(v.x), elu_f32(v.y), elu_f32(v.z), elu_f32(v.w)); + }`,t.cacheKey))},bF=(e=`f32`)=>` +const r0: ${e} = 0.3275911; +const r1: ${e} = 0.254829592; +const r2: ${e} = -0.284496736; +const r3: ${e} = 1.421413741; +const r4: ${e} = -1.453152027; +const r5: ${e} = 1.061405429; + +fn erf_vf32(v: vec4<${e}>) -> vec4<${e}> { + let absv = abs(v); + let x = 1.0 / (1.0 + r0 * absv); + return sign(v) * (1.0 - ((((r5 * x + r4) * x + r3) * x + r2) * x + r1) * x * exp(-absv * absv)); +}`,xF=e=>{let t=mN(e.inputs[0].dataType);e.compute(rF(e.inputs[0],`Erf`,e=>`erf_vf32(${e})`,bF(t)))},SF=e=>{e.compute(rF(e.inputs[0],`Exp`,`exp`))},CF=e=>{e.compute(rF(e.inputs[0],`Floor`,`floor`))},wF=e=>{let t=mN(e.inputs[0].dataType);e.compute(rF(e.inputs[0],`Gelu`,e=>`0.5 * ${e} * (1.0 + erf_vf32(${e} * 0.7071067811865475))`,bF(t)))},TF=(e,t)=>{let n=mN(e.inputs[0].dataType);e.compute(rF(e.inputs[0],`LeakyRelu`,e=>`select(leaky_relu_alpha_ * ${e}, ${e}, ${e} >= vec4<${n}>(0.0))`,`const leaky_relu_alpha_ = ${n}(${t.alpha});`,t.cacheKey))},EF=e=>{e.compute(rF(e.inputs[0],`Not`,e=>`!${e}`))},DF=e=>{e.compute(rF(e.inputs[0],`Neg`,e=>`-${e}`))},OF=e=>{e.compute(rF(e.inputs[0],`Reciprocal`,e=>`1.0/${e}`))},kF=e=>{let t=mN(e.inputs[0].dataType);e.compute(rF(e.inputs[0],`Relu`,e=>`select(vec4<${t}>(0.0), ${e}, ${e} > vec4<${t}>(0.0))`))},AF=e=>{e.compute(rF(e.inputs[0],`Sigmoid`,e=>`(1.0 / (1.0 + exp(-${e})))`))},jF=e=>lN(e),MF=(e,t)=>{let n=mN(e.inputs[0].dataType);e.compute(rF(e.inputs[0],`HardSigmoid`,e=>`max(vec4<${n}>(0.0), min(vec4<${n}>(1.0), ${t.alpha} * ${e} + vec4<${n}>(${t.beta})))`,void 0,t.cacheKey))},NF=e=>{e.compute(rF(e.inputs[0],`Sin`,`sin`))},PF=e=>{e.compute(rF(e.inputs[0],`Sinh`,`sinh`))},FF=e=>{e.compute(rF(e.inputs[0],`Sqrt`,`sqrt`))},IF=e=>{e.compute(rF(e.inputs[0],`Tan`,`tan`))},LF=e=>`sign(${e}) * (1 - exp(-2 * abs(${e}))) / (1 + exp(-2 * abs(${e})))`,RF=e=>{e.compute(rF(e.inputs[0],`Tanh`,LF))},zF=(e=`f32`)=>` +const fast_gelu_a: ${e} = 0.5; +const fast_gelu_b: ${e} = 0.7978845608028654; +const fast_gelu_c: ${e} = 0.035677408136300125; + +fn tanh_v(v: vec4<${e}>) -> vec4<${e}> { + return ${LF(`v`)}; +} +`,BF=e=>`(fast_gelu_a + fast_gelu_a * tanh_v(${e} * (fast_gelu_c * ${e} * ${e} + fast_gelu_b))) * ${e}`,VF=e=>{let t=mN(e.inputs[0].dataType);e.compute(rF(e.inputs[0],`FastGelu`,BF,zF(t),void 0,e.inputs[0].dataType))},HF=(e,t)=>{let n=mN(e.inputs[0].dataType);return e.compute(rF(e.inputs[0],`ThresholdedRelu`,e=>`select(vec4<${n}>(0.0), ${e}, ${e} > thresholded_relu_alpha_)`,`const thresholded_relu_alpha_ = vec4<${n}>(${t.alpha});`,t.cacheKey)),0},UF=e=>{e.compute(rF(e.inputs[0],`Log`,`log`))},WF=(e,t)=>` +const alpha = vec4<${e}>(${t}); +const one = ${e}(1.0); +const zero = ${e}(0.0); + +fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { + let v = x *alpha; + var x1 : vec4<${e}>; + for (var i = 0; i < 4; i = i + 1) { + if (v[i] >= zero) { + x1[i] = one / (one + exp(-v[i])); + } else { + x1[i] = one - one / (one + exp(v[i])); + } + } + return x * x1; +} +`,GF=e=>`quick_gelu_impl(${e})`,KF=(e,t)=>{let n=mN(e.inputs[0].dataType);e.compute(rF(e.inputs[0],`QuickGelu`,GF,WF(n,t.alpha),t.cacheKey,e.inputs[0].dataType))}}),JF,YF,XF,ZF=J(()=>{"use strict";NM(),DN(),qF(),JF=e=>{if(e[0].dims.length!==3)throw Error(`input should have 3 dimensions`);if(![2560,5120,10240].includes(e[0].dims[2]))throw Error(`hidden state should be 2560, 5120 or 10240`);if(e[1].dims.length!==1)throw Error(`bias is expected to have 1 dimensions`);if(e[0].dims[2]!==e[1].dims[0])throw Error(`last dimension of input and bias are not the same`)},YF=e=>{let t=e[0].dims.slice();t[2]/=2;let n=X(`input`,e[0].dataType,e[0].dims,4),r=X(`bias`,e[0].dataType,[e[0].dims[2]],4),i=SN(`output`,e[0].dataType,t,4),a=Y.size(t)/4,o=pN(e[0].dataType);return{name:`BiasSplitGelu`,getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)}}),getShaderSource:t=>` + const M_SQRT2 = sqrt(2.0); + const halfChannels = ${e[0].dims[2]/4/2}u; + + ${t.declareVariables(n,r,i)} + + ${bF(o)} + + ${t.mainStart()} + ${t.guardAgainstOutOfBoundsWorkgroupSizes(a)} + let biasIdx = global_idx % halfChannels; + let batchIndex = global_idx / halfChannels; + let inputOffset = biasIdx + batchIndex * halfChannels * 2; + let valueLeft = input[inputOffset] + bias[biasIdx]; + let valueRight = input[inputOffset + halfChannels] + bias[biasIdx + halfChannels]; + let geluRight = valueRight * 0.5 * (erf_vf32(valueRight / M_SQRT2) + 1); + + ${i.setByOffset(`global_idx`,`valueLeft * geluRight`)} + }`}},XF=e=>{JF(e.inputs),e.compute(YF(e.inputs))}}),QF,$F,eI,tI,nI,rI,iI,aI,oI,sI,cI,lI,uI,dI=J(()=>{"use strict";gM(),NM(),DN(),QF=(e,t,n,r,i,a,o,s,c,l,u,d)=>{let f,p;typeof s==`string`?f=p=(e,t)=>`${s}((${e}),(${t}))`:typeof s==`function`?f=p=s:(f=s.scalar,p=s.vector);let m=SN(`outputData`,u,r.length,4),h=X(`aData`,c,t.length,4),g=X(`bData`,l,n.length,4),_;if(i)if(a){let e=Y.size(t)===1,r=Y.size(n)===1,i=t.length>0&&t[t.length-1]%4==0,a=n.length>0&&n[n.length-1]%4==0;_=e||r?m.setByOffset(`global_idx`,p(e?`${h.type.value}(${h.getByOffset(`0`)}.x)`:h.getByOffset(`global_idx`),r?`${g.type.value}(${g.getByOffset(`0`)}.x)`:g.getByOffset(`global_idx`))):` + let outputIndices = ${m.offsetToIndices(`global_idx * 4u`)}; + let offsetA = ${h.broadcastedIndicesToOffset(`outputIndices`,m)}; + let offsetB = ${g.broadcastedIndicesToOffset(`outputIndices`,m)}; + ${m.setByOffset(`global_idx`,p(o||i?h.getByOffset(`offsetA / 4u`):`${h.type.value}(${h.getByOffset(`offsetA / 4u`)}[offsetA % 4u])`,o||a?g.getByOffset(`offsetB / 4u`):`${g.type.value}(${g.getByOffset(`offsetB / 4u`)}[offsetB % 4u])`))} + `}else _=m.setByOffset(`global_idx`,p(h.getByOffset(`global_idx`),g.getByOffset(`global_idx`)));else{if(!a)throw Error(`no necessary to use scalar implementation for element-wise binary op implementation.`);let e=(e,t,n=``)=>{let r=`aData[indexA${t}][componentA${t}]`,i=`bData[indexB${t}][componentB${t}]`;return` + let outputIndices${t} = ${m.offsetToIndices(`global_idx * 4u + ${t}u`)}; + let offsetA${t} = ${h.broadcastedIndicesToOffset(`outputIndices${t}`,m)}; + let offsetB${t} = ${g.broadcastedIndicesToOffset(`outputIndices${t}`,m)}; + let indexA${t} = offsetA${t} / 4u; + let indexB${t} = offsetB${t} / 4u; + let componentA${t} = offsetA${t} % 4u; + let componentB${t} = offsetB${t} % 4u; + ${e}[${t}] = ${n}(${f(r,i)}); + `};_=u===9?` + var data = vec4(0); + ${e(`data`,0,`u32`)} + ${e(`data`,1,`u32`)} + ${e(`data`,2,`u32`)} + ${e(`data`,3,`u32`)} + outputData[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:` + ${e(`outputData[global_idx]`,0)} + ${e(`outputData[global_idx]`,1)} + ${e(`outputData[global_idx]`,2)} + ${e(`outputData[global_idx]`,3)} + `}return` + ${e.registerUniform(`vec_size`,`u32`).declareVariables(h,g,m)} + + ${d??``} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} + ${_} + }`},$F=(e,t,n,r,i,a,o=n.dataType)=>{let s=n.dims.map(e=>Number(e)??1),c=r.dims.map(e=>Number(e)??1),l=!Y.areEqual(s,c),u=s,d=Y.size(s),f=!1,p=!1,m=[l];if(l){let e=OM.calcShape(s,c,!1);if(!e)throw Error(`Can't perform binary op on the given tensors`);u=e.slice(),d=Y.size(u);let t=Y.size(s)===1,n=Y.size(c)===1,r=s.length>0&&s[s.length-1]%4==0,i=c.length>0&&c[c.length-1]%4==0;m.push(t),m.push(n),m.push(r),m.push(i);let a=1;for(let e=1;ee.toString()).join(`_`),inputDependencies:[`rank`,`rank`]},getShaderSource:e=>QF(e,s,c,u,f,l,p,i,n.dataType,r.dataType,o,a),getRunData:()=>({outputs:[{dims:u,dataType:o}],dispatchGroup:{x:Math.ceil(d/64/4)},programUniforms:[{type:12,data:Math.ceil(Y.size(u)/4)},...hN(s,c,u)]})}},eI=(e,t,n,r,i,a)=>{e.compute($F(t,i??``,e.inputs[0],e.inputs[1],n,r,a))},tI=e=>{eI(e,`Add`,(e,t)=>`${e}+${t}`)},nI=e=>{eI(e,`Div`,(e,t)=>`${e}/${t}`)},rI=e=>{eI(e,`Equal`,{scalar:(e,t)=>`u32(${e}==${t})`,vector:(e,t)=>`vec4(${e}==${t})`},void 0,void 0,9)},iI=e=>{eI(e,`Mul`,(e,t)=>`${e}*${t}`)},aI=e=>{let t=X(`input`,e.inputs[0].dataType,e.inputs[0].dims).type.value;eI(e,`Pow`,{scalar:(e,t)=>`pow_custom(${e},${t})`,vector:(e,t)=>`pow_vector_custom(${e},${t})`},` + fn pow_custom(a : ${t}, b : ${t}) -> ${t} { + if (b == ${t}(0.0)) { + return ${t}(1.0); + } else if (a < ${t}(0.0) && f32(b) != floor(f32(b))) { + return ${t}(pow(f32(a), f32(b))); // NaN + } + return select(sign(a), ${t}(1.0), round(f32(abs(b) % ${t}(2.0))) != 1.0) * ${t}(${t===`i32`?`round`:``}(pow(f32(abs(a)), f32(b)))); + } + fn pow_vector_custom(a : vec4<${t}>, b : vec4<${t}>) -> vec4<${t}> { + // TODO: implement vectorized pow + return vec4<${t}>(pow_custom(a.x, b.x), pow_custom(a.y, b.y), pow_custom(a.z, b.z), pow_custom(a.w, b.w)); + } + `)},oI=e=>{eI(e,`Sub`,(e,t)=>`${e}-${t}`)},sI=e=>{eI(e,`Greater`,{scalar:(e,t)=>`u32(${e}>${t})`,vector:(e,t)=>`vec4(${e}>${t})`},void 0,void 0,9)},cI=e=>{eI(e,`Less`,{scalar:(e,t)=>`u32(${e}<${t})`,vector:(e,t)=>`vec4(${e}<${t})`},void 0,void 0,9)},lI=e=>{eI(e,`GreaterOrEqual`,{scalar:(e,t)=>`u32(${e}>=${t})`,vector:(e,t)=>`vec4(${e}>=${t})`},void 0,void 0,9)},uI=e=>{eI(e,`LessOrEqual`,{scalar:(e,t)=>`u32(${e}<=${t})`,vector:(e,t)=>`vec4(${e}<=${t})`},void 0,void 0,9)}}),fI,pI,mI,hI,gI,_I,vI=J(()=>{"use strict";gM(),NM(),uN(),DN(),fI=(e,t)=>{if(!e||e.length<1)throw Error(`too few inputs`);let n=e[0],r=n.dataType,i=n.dims.length;e.forEach((e,a)=>{if(a!==0){if(e.dataType!==r)throw Error(`input tensors should be one type`);if(e.dims.length!==i)throw Error(`input tensors should have the same shape`);e.dims.forEach((e,r)=>{if(r!==t&&e!==n.dims[r])throw Error(`non concat dimensions must match`)})}})},pI=(e,t)=>` + fn calculateInputIndex(index: u32) -> u32 { + let sizeInConcatAxis = array(${t}); + for (var i: u32 = 0u; i < ${e}; i += 1u ) { + if (index < sizeInConcatAxis[i]) { + return i; + } + } + return ${e}u; + }`,mI=(e,t)=>{let n=e.length,r=[];for(let i=0;i{let i=Y.size(n),a=Array(e.length),o=Array(e.length),s=0,c=[],l=[],u=[{type:12,data:i}];for(let n=0;n`uniforms.sizeInConcatAxis${e}`).join(`,`);return{name:`Concat`,shaderCache:{hint:`${t}`,inputDependencies:c},getRunData:()=>({outputs:[{dims:n,dataType:r}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:u}),getShaderSource:t=>` + + ${(()=>{t.registerUniform(`outputSize`,`u32`);for(let n=0;n(${p}); + ${f} -= sizeInConcatAxis[inputIndex - 1u]; + } + + ${mI(o,d)} + }`}},gI=(e,t)=>{let n=e.inputs,r=n[0].dims,i=Y.normalizeAxis(t.axis,r.length);fI(n,i);let a=r.slice();a[i]=n.reduce((e,t)=>e+(t.dims.length>i?t.dims[i]:0),0);let o=n.filter(e=>Y.size(e.dims)>0);e.compute(hI(o,i,a,n[0].dataType),{inputs:o})},_I=e=>lN({axis:e.axis})}),yI,bI,xI,SI,CI=J(()=>{"use strict";gM(),NM(),yI=(e,t,n=`f32`)=>{switch(e.activation){case`Relu`:return`value = max(value, ${t}(0.0));`;case`Sigmoid`:return`value = (${t}(1.0) / (${t}(1.0) + exp(-value)));`;case`Clip`:return`value = clamp(value, ${t}(${n}(uniforms.clip_min)), ${t}(${n}(uniforms.clip_max)));`;case`HardSigmoid`:return`value = max(${t}(0.0), min(${t}(1.0), ${n}(uniforms.alpha) * value + ${n}(uniforms.beta)));`;case`LeakyRelu`:return`value = select(${n}(uniforms.alpha) * value, value, value >= ${t}(0.0));`;case`Tanh`:return`let e2x = exp(-2.0 * abs(value)); + value = sign(value) * (1.0 - e2x) / (1.0 + e2x); + `;case``:return``;default:throw Error(`Unsupported activation ${e.activation}`)}},bI=(e,t)=>{e.activation===`Clip`?t.push({type:1,data:e.clipMax},{type:1,data:e.clipMin}):e.activation===`HardSigmoid`?t.push({type:1,data:e.alpha},{type:1,data:e.beta}):e.activation===`LeakyRelu`&&t.push({type:1,data:e.alpha})},xI=(e,t)=>{e.activation===`Clip`?t.push({name:`clip_max`,type:`f32`},{name:`clip_min`,type:`f32`}):e.activation===`HardSigmoid`?t.push({name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}):e.activation===`LeakyRelu`&&t.push({name:`alpha`,type:`f32`})},SI=e=>{let t=e?.activation||``;if(t===`HardSigmoid`){let[n,r]=e?.activation_params||[.2,.5];return{activation:t,alpha:n,beta:r}}else if(t===`Clip`){let[n,r]=e?.activation_params||[jM,MM];return{activation:t,clipMax:r,clipMin:n}}else if(t===`LeakyRelu`){let[n]=e?.activation_params||[.01];return{activation:t,alpha:n}}return{activation:t}}}),wI,TI,EI=J(()=>{"use strict";wI=(e,t)=>{switch(e){case 1:return t;case 2:return`vec2<${t}>`;case 3:return`vec3<${t}>`;case 4:return`vec4<${t}>`;default:throw Error(`${e}-component is not supported.`)}},TI=e=>` + ${e?`value = value + getBiasByOutputCoords(coords);`:``} + `}),DI,OI=J(()=>{"use strict";DI=e=>` +fn getIndexFromCoords4D(coords : vec4, shape : vec4) -> i32 { + return dot(coords, vec4( + shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1)); +} +fn getOutputIndexFromCoords(coords : vec4) -> i32 { + return dot(coords, vec4( + i32(${e}.x), i32(${e}.y), i32(${e}.z), 1)); +} +`}),kI,AI,jI=J(()=>{"use strict";gM(),NM(),DN(),CI(),kI=(e,t,n,r,i)=>{let a=r-n;return` + ${Array.from({length:n}).map((n,o)=>` + if (${bN(t.shape,o,t.rank)} != 1) { + ${t.indicesSet(e,o,bN(i,o+a,r))} + } else { + ${t.indicesSet(e,o,0)} + }`).join(``)} +`},AI=(e,t,n,r,i=!1,a)=>{let o=e[0].dims,s=e[1].dims,c=o[o.length-2],l=s[s.length-1],u=o[o.length-1],d=gN(l),f=gN(u),p=gN(c),m=Y.size(n)/d/p,h=e.length>2,g=r?r.slice(0,-2):n.slice(0,-2),_=[Y.size(g),c,l],v=[{type:12,data:m},{type:12,data:c},{type:12,data:l},{type:12,data:u}];return bI(t,v),v.push(...hN(g,o,s)),h&&v.push(...hN(e[2].dims)),v.push(...hN(_)),{name:`MatMulNaive`,shaderCache:{hint:`${t.activation};${d};${f};${p};${i}`,inputDependencies:h?[`rank`,`rank`,`rank`]:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:a?a(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(m/64)},programUniforms:v}),getShaderSource:r=>{let a=wN(`batch_dims`,e[0].dataType,g.length),c=X(`a`,e[0].dataType,o.length,f),l=X(`b`,e[1].dataType,s.length,d),u=SN(`output`,e[0].dataType,_.length,d),m=pN(u.type.tensor),v=yI(t,u.type.value,m),y=[c,l],b=``;if(h){let t=i?d:1;y.push(X(`bias`,e[2].dataType,e[2].dims.length,t)),b=`${i?`value += bias[col / ${t}];`:`value += ${u.type.value}(bias[row + i]);`}`}let x=[{name:`output_size`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`}];xI(t,x);let S=()=>{let e=`var a_data: ${c.type.value};`;for(let t=0;t; + for (var k: u32 = 0u; k < uniforms.K; k = k + ${f}) { + ${S()} + } + for (var i = 0u; i < ${p}u; i++) { + var value = values[i]; + ${b} + ${v} + let cur_indices = ${u.type.indices}(batch, row + i, col); + let offset = ${u.indicesToOffset(`cur_indices`)}; + ${u.setByOffset(`offset / ${d}`,`value`)}; + } + } + `}}}}),MI,NI,PI,FI,II,LI,RI,zI,BI=J(()=>{"use strict";gM(),NM(),DN(),CI(),jI(),EI(),MI=(e,t)=>e?` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + kStart + inputRow, + globalRowStart / innerElementSize + inputCol${t?`, batchIndices`:``}); + `:` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + globalRow + innerRow, + kStart / innerElementSize + inputCol${t?`, batchIndices`:``}); + `,NI=(e,t)=>e?` + let ACached0 = mm_Asub[k * innerElementSize][localRow]; + let ACached1 = mm_Asub[k * innerElementSize + 1][localRow]; + let ACached2 = mm_Asub[k * innerElementSize + 2][localRow]; + ${t===3?``:`let ACached3 = mm_Asub[k * innerElementSize + 3][localRow];`} + for (var i = 0; i < rowPerThread; i = i + 1) { + acc[i] = BCached0 * ACached0[i] + acc[i]; + acc[i] = BCached1 * ACached1[i] + acc[i]; + acc[i] = BCached2 * ACached2[i] + acc[i]; + ${t===3?``:`acc[i] = BCached3 * ACached3[i] + acc[i];`} + }`:` + for (var i = 0; i < rowPerThread; i = i + 1) { + let ACached = mm_Asub[tileRow + i][k]; + acc[i] = BCached0 * ACached.x + acc[i]; + acc[i] = BCached1 * ACached.y + acc[i]; + acc[i] = BCached2 * ACached.z + acc[i]; + ${t===3?``:`acc[i] = BCached3 * ACached.w + acc[i];`} + }`,PI=(e,t,n=`f32`,r,i=!1,a=32,o=!1,s=32)=>{let c=t[1]*e[1],l=t[0]*e[0],u=i?c:a,d=i?a:c,f=u/t[0],p=a/t[1];if(!((i&&f===4&&e[1]===4||!i&&(f===3||f===4))&&u%t[0]===0&&a%t[1]===0&&e[0]===4))throw Error(`If transposeA ${i} is true, innerElementSize ${f} and workPerThread[1] ${e[1]} must be 4. + Otherwise, innerElementSize ${f} must be 3 or 4. + tileAWidth ${u} must be divisible by workgroupSize[0]${t[0]}. tileInner ${a} must be divisible by workgroupSize[1] ${t[1]}. colPerThread ${e[0]} must be 4.`);return` +var mm_Asub: array, ${u/f}>, ${d}>; +var mm_Bsub: array, ${l/e[0]}>, ${a}>; + +const rowPerThread = ${e[1]}; +const colPerThread = ${e[0]}; +const innerElementSize = ${f}; +const tileInner = ${a}; + +@compute @workgroup_size(${t[0]}, ${t[1]}, ${t[2]}) +fn main(@builtin(local_invocation_id) localId : vec3, + @builtin(global_invocation_id) globalId : vec3, + @builtin(workgroup_id) workgroupId : vec3) { + let localRow = i32(localId.y); + let tileRow = localRow * rowPerThread; + let tileCol = i32(localId.x); + + let globalRow =i32(globalId.y) * rowPerThread; + let globalCol = i32(globalId.x); + let batch = ${o?`0`:`i32(globalId.z)`}; + ${r?`let batchIndices = ${r.offsetToIndices(`u32(batch)`)};`:``} + let globalRowStart = i32(workgroupId.y) * ${c}; + + let num_tiles = ${o?`${Math.ceil(s/a)}`:`(uniforms.dim_inner - 1) / tileInner + 1`}; + var kStart = ${o?`i32(globalId.z) * ${s}`:`0`}; + + var acc: array, rowPerThread>; + + // Loop over shared dimension. + let tileRowB = localRow * ${p}; + for (var t = 0; t < num_tiles; t = t + 1) { + // Load one tile of A into local memory. + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + let inputRow = tileRow + innerRow; + let inputCol = tileCol; + ${MI(i,r)} + } + + // Load one tile of B into local memory. + for (var innerRow = 0; innerRow < ${p}; innerRow = innerRow + 1) { + let inputRow = tileRowB + innerRow; + let inputCol = tileCol; + mm_Bsub[inputRow][inputCol] = mm_readB(batch, kStart + inputRow, globalCol${r?`, batchIndices`:``}); + } + kStart = kStart + tileInner; + workgroupBarrier(); + + // Compute acc values for a single thread. + for (var k = 0; k < tileInner / innerElementSize; k = k + 1) { + let BCached0 = mm_Bsub[k * innerElementSize][tileCol]; + let BCached1 = mm_Bsub[k * innerElementSize + 1][tileCol]; + let BCached2 = mm_Bsub[k * innerElementSize + 2][tileCol]; + ${f===3?``:`let BCached3 = mm_Bsub[k * innerElementSize + 3][tileCol];`} + + ${NI(i,f)} + } + + workgroupBarrier(); + } + + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]); + } +}`},FI=(e,t)=>e?` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + kStart + inputRow, + globalRowStart + inputCol${t?`, batchIndices`:``}); + `:` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + globalRowStart + inputRow, + kStart + inputCol${t?`, batchIndices`:``}); + `,II=e=>e?`let ACached = mm_Asub[k][tileRow + innerRow];`:`let ACached = mm_Asub[tileRow + innerRow][k];`,LI=(e,t,n=`f32`,r,i=!1,a=32,o=!1,s=32,c=!1)=>{let l=e[1]*t[1],u=e[0]*t[0],d=i?l:a,f=i?a:l;if(!(f%t[1]===0&&d%t[0]===0&&a%t[1]===0))throw Error(`tileAHight ${f} must be divisible by workgroupSize[1]${t[1]}, tileAWidth ${d} must be divisible by workgroupSize[0]${t[0]}, tileInner ${a} must be divisible by workgroupSize[1]${t[1]}`);let p=f/t[1],m=d/t[0],h=a/t[1],g=c?` + let localRow = i32(localId.y); + let localCol = i32(localId.x); + let globalRowStart = i32(workgroupId.y) * ${l}; + let globalColStart = i32(workgroupId.x) * ${u}; + + // Loop over shared dimension. + for (var t = 0; t < num_tiles; t = t + 1) { + // Load one tile of A into local memory. + for (var inputRow = localRow; inputRow < ${f}; inputRow = inputRow + ${t[1]}) { + for (var inputCol = localCol; inputCol < ${d}; inputCol = inputCol + ${t[0]}) { + ${FI(i,r)} + } + } + // Load one tile of B into local memory. + for (var inputRow = localRow; inputRow < ${a}; inputRow = inputRow + ${t[1]}) { + for (var inputCol = localCol; inputCol < ${u}; inputCol = inputCol + ${t[0]}) { + mm_Bsub[inputRow][inputCol] = mm_readB(batch, + kStart + inputRow, + globalColStart + inputCol${r?`, batchIndices`:``}); + } + } + kStart = kStart + tileInner; + workgroupBarrier(); + + // Compute acc values for a single thread. + var BCached : array<${n}, colPerThread>; + for (var k = 0; k < tileInner; k = k + 1) { + for (var inner = 0; inner < colPerThread; inner = inner + 1) { + BCached[inner] = mm_Bsub[k][localCol + inner * ${t[0]}]; + } + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + let ACached = ${i?`mm_Asub[k][localRow + innerRow * ${t[1]}];`:`mm_Asub[localRow + innerRow * ${t[1]}][k];`} + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + acc[innerRow][innerCol] = acc[innerRow][innerCol] + + ACached * BCached[innerCol]; + } + } + } + workgroupBarrier(); + } + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + let gRow = globalRowStart + localRow + innerRow * ${t[1]}; + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + let gCol = globalColStart + localCol + innerCol * ${t[0]}; + mm_write(batch, gRow, gCol, acc[innerRow][innerCol]); + } + } + `:` +let tileRow = i32(localId.y) * rowPerThread; +let tileCol = i32(localId.x) * colPerThread; + +let globalRow = i32(globalId.y) * rowPerThread; +let globalCol = i32(globalId.x) * colPerThread; +let globalRowStart = i32(workgroupId.y) * ${l}; + +let tileRowA = i32(localId.y) * ${p}; +let tileColA = i32(localId.x) * ${m}; +let tileRowB = i32(localId.y) * ${h}; +// Loop over shared dimension. +for (var t = 0; t < num_tiles; t = t + 1) { + // Load one tile of A into local memory. + for (var innerRow = 0; innerRow < ${p}; innerRow = innerRow + 1) { + for (var innerCol = 0; innerCol < ${m}; innerCol = innerCol + 1) { + let inputRow = tileRowA + innerRow; + let inputCol = tileColA + innerCol; + ${FI(i,r)} + } + } + + // Load one tile of B into local memory. + for (var innerRow = 0; innerRow < ${h}; innerRow = innerRow + 1) { + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + let inputRow = tileRowB + innerRow; + let inputCol = tileCol + innerCol; + mm_Bsub[inputRow][inputCol] = mm_readB(batch, + kStart + inputRow, + globalCol + innerCol${r?`, batchIndices`:``}); + } + } + kStart = kStart + tileInner; + workgroupBarrier(); + + // Compute acc values for a single thread. + var BCached : array<${n}, colPerThread>; + for (var k = 0; k < tileInner; k = k + 1) { + for (var inner = 0; inner < colPerThread; inner = inner + 1) { + BCached[inner] = mm_Bsub[k][tileCol + inner]; + } + + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + ${II(i)} + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + acc[innerRow][innerCol] = acc[innerRow][innerCol] + ACached * BCached[innerCol]; + } + } + } + + workgroupBarrier(); +} + +for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + mm_write(batch, globalRow + innerRow, globalCol + innerCol, + acc[innerRow][innerCol]); + } +} +`;return` + var mm_Asub : array, ${f}>; + var mm_Bsub : array, ${a}>; + const rowPerThread = ${e[1]}; + const colPerThread = ${e[0]}; + const tileInner = ${a}; + +@compute @workgroup_size(${t[0]}, ${t[1]}, ${t[2]}) +fn main(@builtin(local_invocation_id) localId : vec3, + @builtin(global_invocation_id) globalId : vec3, + @builtin(workgroup_id) workgroupId : vec3) { + let batch = ${o?`0`:`i32(globalId.z)`}; + ${r?`let batchIndices = ${r.offsetToIndices(`u32(batch)`)};`:``} + let num_tiles = ${o?`${Math.ceil(s/a)}`:`(uniforms.dim_inner - 1) / tileInner + 1`}; + var kStart = ${o?`i32(globalId.z) * ${s}`:`0`}; + + var acc : array, rowPerThread>; + ${g} + } +`},RI=(e,t,n,r,i=!1)=>{let[a,o,s,c]=r,l=pN(r[0].type.tensor);return` + fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${wI(e,l)} { + var value = ${wI(e,l)}(0.0); + let col = colIn * ${e}; + if(row < uniforms.dim_a_outer && col < uniforms.dim_inner) + { + var aIndices: ${o.type.indices}; + ${kI(`aIndices`,o,o.rank-2,a.rank,`batchIndices`)} + ${o.indicesSet(`aIndices`,o.rank-2,`u32(row)`)} + ${o.indicesSet(`aIndices`,o.rank-1,`u32(colIn)`)} + value = ${o.getByIndices(`aIndices`)}; + } + return value; + } + + fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${a.type.indices}) -> ${wI(e,l)} { + var value = ${wI(e,l)}(0.0); + let col = colIn * ${e}; + if(row < uniforms.dim_inner && col < uniforms.dim_b_outer) + { + var bIndices: ${s.type.indices}; + ${kI(`bIndices`,s,s.rank-2,a.rank,`batchIndices`)} + ${s.indicesSet(`bIndices`,s.rank-2,`u32(row)`)} + ${s.indicesSet(`bIndices`,s.rank-1,`u32(colIn)`)} + value = ${s.getByIndices(`bIndices`)}; + } + return value; + } + + fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${wI(e,l)}) { + let col = colIn * ${e}; + if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) { + var value = valueIn; + let coords = vec3(batch, row, colIn); + ${t?`value = value + ${i?`bias[colIn]`:`${wI(e,l)}(bias[row])`};`:``} + ${n} + ${c.setByIndices(`vec3(coords)`,`value`)} + } + } + `},zI=(e,t,n,r,i=!1,a)=>{let o=e[0].dims,s=e[1].dims,c=o.slice(0,-2),l=s.slice(0,-2),u=r?r.slice(0,-2):n.slice(0,-2),d=Y.size(u),f=o[o.length-2],p=o[o.length-1],m=s[s.length-1],h=p%4==0&&m%4==0,g=f<=8?[4,1,1]:[4,4,1],_=[8,8,1],v=[Math.ceil(m/_[0]/g[0]),Math.ceil(f/_[1]/g[1]),Math.ceil(d/_[2]/g[2])],y=h?4:1,b=[...c,f,p/y],x=b.length,S=[...l,p,m/y],C=S.length,w=[d,f,m/y],T=[{type:6,data:f},{type:6,data:m},{type:6,data:p}];bI(t,T),T.push(...hN(u,b,S));let E=[`rank`,`rank`],D=e.length>2;return D&&(T.push(...hN(e[2].dims)),E.push(`rank`)),T.push(...hN(w)),{name:`MatMul`,shaderCache:{hint:`${g};${t.activation};${h};${i}`,inputDependencies:E},getRunData:()=>({outputs:[{dims:a?a(n):n,dataType:e[0].dataType}],dispatchGroup:{x:v[0],y:v[1],z:v[2]},programUniforms:T}),getShaderSource:n=>{let r=u.length,a=wN(`batchDims`,e[0].dataType,r,1),o=pN(e[0].dataType),s=X(`a`,e[0].dataType,x,y),c=X(`b`,e[1].dataType,C,y),l=SN(`result`,e[0].dataType,w.length,y),d=[s,c];if(D){let t=i?y:1;d.push(X(`bias`,e[2].dataType,e[2].dims.length,t))}let f=[{name:`dim_a_outer`,type:`i32`},{name:`dim_b_outer`,type:`i32`},{name:`dim_inner`,type:`i32`}];xI(t,f);let p=pN(l.type.tensor),m=yI(t,l.type.value,p),v=RI(y,D,m,[a,s,c,l],i);return` + ${n.registerUniforms(f).registerInternalVariables(a).declareVariables(...d,l)} + ${v} + ${h?PI(g,_,o,a):LI(g,_,o,a)} + `}}}}),VI,HI,UI=J(()=>{"use strict";gM(),EM(),DN(),CI(),EI(),OI(),BI(),VI=(e,t,n,r,i=!1,a,o=4,s=4,c=4,l=`f32`)=>{let u=e=>{switch(e){case 1:return`resData = x[xIndex];`;case 3:return`resData = vec3<${l}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;case 4:return`resData = x[xIndex / 4];`;default:throw Error(`innerElementSize ${e} is not supported.`)}},d=e=>{switch(e){case 1:return`return w[row * i32(uniforms.w_shape[3]) + colIn];`;case 4:return`return w[row * i32(uniforms.w_shape[3]) / 4 + colIn];`;default:throw Error(`innerElementSize ${e} is not supported.`)}},f=e?` + let coord = vec4(batch, xRow, xCol, xCh); + `:` + let coord = vec4(batch, xCh, xRow, xCol); + `,p=e?` + let coords = vec4( + batch, + row / outWidth, + row % outWidth, + col); + `:` + let coords = vec4( + batch, + row, + col / outWidth, + col % outWidth); + `,m=e?`i32(uniforms.x_shape[1])`:`i32(uniforms.x_shape[2])`,h=e?`i32(uniforms.x_shape[2])`:`i32(uniforms.x_shape[3])`,g=e?`row`:`col`,_=e?`col`:`row`,v=` + let inChannels = i32(uniforms.w_shape[2]); + let outWidth = ${e?`i32(uniforms.result_shape[2])`:`i32(uniforms.result_shape[3])`}; + let outRow = ${g} / outWidth; + let outCol = ${g} % outWidth; + + let WRow = ${_} / (i32(uniforms.w_shape[1]) * inChannels); + let WCol = ${_} / inChannels % i32(uniforms.w_shape[1]); + let xRow = outRow * uniforms.stride[0] + uniforms.dilation[0] * WRow - uniforms.pad[0]; + let xCol = outCol * uniforms.stride[1] + uniforms.dilation[1] * WCol - uniforms.pad[1]; + let xCh = ${_} % inChannels; + var resData = ${wI(o,l)}(0.0); + // The bounds checking is always needed since we use it to pad zero for + // the 'same' padding type. + if (xRow >= 0 && xRow < ${m} && xCol >= 0 && xCol < ${h}) { + ${f} + let xIndex = getIndexFromCoords4D(coord, vec4(uniforms.x_shape)); + ${u(o)} + } + return resData;`,y=e?t&&r?` + let col = colIn * ${o}; + ${v}`:` + let col = colIn * ${o}; + if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) { + ${v} + } + return ${wI(o,l)}(0.0);`:r&&n?` + let col = colIn * ${o}; + ${v}`:` + let col = colIn * ${o}; + if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { + ${v} + } + return ${wI(o,l)}(0.0);`,b=e?r&&n?d(s):` + let col = colIn * ${s}; + if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { + ${d(s)} + } + return ${wI(s,l)}(0.0);`:` + let col = colIn * ${s}; + if (row < uniforms.dim_inner && col < uniforms.dim_a_outer) { + ${d(s)} + } + return ${wI(s,l)}(0.0);`,x=wI(c,l),S=wI(e?o:s,l),C=wI(e?s:o,l),w=yI(a,x,l);return` + fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${S} { + ${e?y:b} + } + + fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${C} { + ${e?b:y} + } + + fn mm_write(batch: i32, row : i32, colIn : i32, valueIn : ${x}) { + let col = colIn * ${c}; + if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) + { + var value = valueIn; + let outWidth = ${e?`i32(uniforms.result_shape[2])`:`i32(uniforms.result_shape[3])`}; + ${p} + ${TI(i)} + ${w} + setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); + } + }`},HI=(e,t,n,r,i,a,o,s,c)=>{let l=t.format===`NHWC`,u=l?e[0].dims[3]:e[0].dims[1],d=n[0],f=l?n[2]:n[3],p=l?n[1]:n[2],m=l?n[3]:n[1],h=l&&(u%4==0||u%3==0)&&m%4==0,g=l?m:f*p,_=l?f*p:m,v=[8,8,1],y=r<=8?[4,1,1]:[4,4,1],b=[Math.ceil(g/v[0]/y[0]),Math.ceil(_/v[1]/y[1]),Math.ceil(d/v[2]/y[2])];TM(`verbose`,()=>`[conv2d_mm_webgpu] dispatch = ${b}`);let x=h?l&&u%4!=0?3:4:1,S=v[1]*y[1],C=v[0]*y[0],w=Math.max(v[0]*x,v[1]),T=r%S===0,E=i%C===0,D=a%w===0,O=h?[x,4,4]:[1,1,1],k=[{type:6,data:r},{type:6,data:i},{type:6,data:a},{type:6,data:[t.pads[0],t.pads[1]]},{type:6,data:t.strides},{type:6,data:t.dilations}];bI(t,k),k.push(...hN(e[0].dims,e[1].dims));let A=[`rank`,`rank`];return o&&(k.push(...hN(e[2].dims)),A.push(`rank`)),k.push(...hN(n)),{name:`Conv2DMatMul`,shaderCache:{hint:`${t.cacheKey};${x};${h};${T};${E};${D};${S};${C};${w}`,inputDependencies:A},getRunData:()=>({outputs:[{dims:c?c(n):n,dataType:e[0].dataType}],dispatchGroup:{x:b[0],y:b[1],z:b[2]},programUniforms:k}),getShaderSource:r=>{let i=[{name:`dim_a_outer`,type:`i32`},{name:`dim_b_outer`,type:`i32`},{name:`dim_inner`,type:`i32`},{name:`pad`,type:`i32`,length:2},{name:`stride`,type:`i32`,length:2},{name:`dilation`,type:`i32`,length:2}];xI(t,i);let a=h?4:1,c=pN(e[0].dataType),u=` + fn setOutputAtIndex(flatIndex : i32, value : ${h?`vec4<${c}>`:c}) { + result[flatIndex] = ${h?`vec4<${c}>`:c}(value); + } + fn setOutputAtCoords(d0 : i32, d1 : i32, d2 : i32, d3 : i32, value : ${h?`vec4<${c}>`:c}) { + let flatIndex = getOutputIndexFromCoords(vec4(d0, d1, d2, d3)); + setOutputAtIndex(flatIndex ${h?`/ 4`:``}, value); + }`,d=[X(`x`,e[0].dataType,e[0].dims.length,x===3?1:x),X(`w`,e[1].dataType,e[1].dims.length,a)],f=SN(`result`,e[0].dataType,n.length,a);if(o){let t=X(`bias`,e[2].dataType,e[2].dims.length,a);d.push(t),u+=` + fn getBiasByOutputCoords(coords : vec4) -> ${h?`vec4<${c}>`:c} { + return bias[coords.${l?`w`:`y`}${h?`/ 4`:``}]; + }`}return` + ${DI(`uniforms.result_strides`)} + //struct Uniforms { xShape : vec4, wShape : vec4, outShape : vec4, + // outShapeStrides: vec3, filterDims : vec2, pad : vec2, stride : vec2, + // dilation : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32 }; + ${r.registerUniforms(i).declareVariables(...d,f)} + ${u} + ${VI(l,T,E,D,o,t,O[0],O[1],O[2],c)} + ${h?PI(y,v,c,void 0,!l,w):LI(y,v,c,void 0,!l,w,!1,void 0,s)}`}}}}),WI,GI,KI,qI,JI,YI,XI,ZI,QI=J(()=>{"use strict";gM(),EM(),NM(),DN(),CI(),EI(),WI=e=>{let t=1;for(let n=0;ntypeof e==`number`?[e,e,e]:e,KI=(e,t)=>t<=1?e:e+(e-1)*(t-1),qI=(e,t,n,r=1)=>{let i=KI(t,r);return Math.floor((e[0]*(n-1)-n+i)/2)},JI=(e,t,n,r,i)=>{i??=qI(e,t[0],r[0]);let a=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*i>=t[n]&&(a[n]=Math.trunc((e[n]-t[n]+2*i)/r[n]+1));return a},YI=(e,t,n,r,i,a,o,s,c,l)=>{let u,d,f,p;if(e===`VALID`&&(e=0),typeof e==`number`){u={top:e,bottom:e,left:e,right:e,front:e,back:e};let m=JI([t,n,r,1],[s,c,l],1,[i,a,o],e);d=m[0],f=m[1],p=m[2]}else if(Array.isArray(e)){if(!e.every((e,t,n)=>e===n[0]))throw Error(`Unsupported padding parameter: ${e}`);u={top:e[0],bottom:e[1],left:e[2],right:e[3],front:e[4],back:e[5]};let m=JI([t,n,r,1],[s,c,l],1,[i,a,o],e[0]);d=m[0],f=m[1],p=m[2]}else if(e===`SAME_UPPER`){d=Math.ceil(t/i),f=Math.ceil(n/a),p=Math.ceil(r/o);let e=(d-1)*i+s-t,m=(f-1)*a+c-n,h=(p-1)*o+l-r,g=Math.floor(e/2),_=e-g,v=Math.floor(m/2),y=m-v,b=Math.floor(h/2);u={top:v,bottom:y,left:b,right:h-b,front:g,back:_}}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:u,outDepth:d,outHeight:f,outWidth:p}},XI=(e,t,n,r,i,a=!1,o=`channelsLast`)=>{let s,c,l,u,d;if(o===`channelsLast`)[s,c,l,u,d]=e;else if(o===`channelsFirst`)[s,d,c,l,u]=e;else throw Error(`Unknown dataFormat ${o}`);let[f,,p,m,h]=t,[g,_,v]=GI(n),[y,b,x]=GI(r),S=KI(p,y),C=KI(m,b),w=KI(h,x),{padInfo:T,outDepth:E,outHeight:D,outWidth:O}=YI(i,c,l,u,g,_,v,S,C,w),k=a?f*d:f,A=[0,0,0,0,0];return o===`channelsFirst`?A=[s,k,E,D,O]:o===`channelsLast`&&(A=[s,E,D,O,k]),{batchSize:s,dataFormat:o,inDepth:c,inHeight:l,inWidth:u,inChannels:d,outDepth:E,outHeight:D,outWidth:O,outChannels:k,padInfo:T,strideDepth:g,strideHeight:_,strideWidth:v,filterDepth:p,filterHeight:m,filterWidth:h,effectiveFilterDepth:S,effectiveFilterHeight:C,effectiveFilterWidth:w,dilationDepth:y,dilationHeight:b,dilationWidth:x,inShape:e,outShape:A,filterShape:t}},ZI=(e,t,n,r,i,a)=>{let o=a===`channelsLast`;o?e[0].dims[3]:e[0].dims[1];let s=[64,1,1],c={x:n.map((e,t)=>t)},l=[Math.ceil(WI(c.x.map(e=>n[e]))/s[0]),1,1];TM(`verbose`,()=>`[conv3d_naive_webgpu] dispatch = ${l}`);let u=[{type:12,data:Y.size(n)},{type:12,data:r},{type:12,data:i},{type:12,data:t.strides},{type:12,data:t.dilations}];bI(t,u),u.push(...hN(e[0].dims,e[1].dims));let d=[`rank`,`rank`],f=e.length===3;return f&&(u.push(...hN(e[2].dims)),d.push(`rank`)),u.push(...hN(n)),{name:`Conv3DNaive`,shaderCache:{hint:`${t.cacheKey};${o};1;${f}`,inputDependencies:d},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:l[0],y:l[1],z:l[2]},programUniforms:u}),getShaderSource:a=>{let s=[{name:`output_size`,type:`u32`},{name:`filter_dims`,type:`u32`,length:r.length},{name:`pads`,type:`u32`,length:i.length},{name:`strides`,type:`u32`,length:t.strides.length},{name:`dilations`,type:`u32`,length:t.dilations.length}];xI(t,s);let c=pN(e[0].dataType),l=X(`x`,e[0].dataType,e[0].dims.length,1),u=X(`W`,e[1].dataType,e[1].dims.length,1),d=[l,u],p=SN(`result`,e[0].dataType,n.length,1),m=``;if(f){let t=X(`bias`,e[2].dataType,e[2].dims.length,1);d.push(t),m+=` + fn getBiasByOutputCoords(coords : array) -> ${c} { + return bias[${o?bN(`coords`,4,5):bN(`coords`,1,5)}]; + }`}let h=wI(1,c),g=yI(t,h,c);return` + ${m} + fn getX(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { + let aIndices = array(d0, d1, d2, d3, d4); + return ${l.getByIndices(`aIndices`)}; + } + fn getW(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { + let aIndices = array(d0, d1, d2, d3, d4); + return ${u.getByIndices(`aIndices`)}; + } + ${a.registerUniforms(s).declareVariables(...d,p)} + ${a.mainStart()} + ${a.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let coords = ${p.offsetToIndices(`global_idx`)}; + let batch = ${bN(`coords`,0,l.rank)}; + let d2 = ${o?bN(`coords`,l.rank-1,l.rank):bN(`coords`,1,l.rank)}; + let xFRCCorner = vec3(${o?bN(`coords`,1,l.rank):bN(`coords`,2,l.rank)}, + ${o?bN(`coords`,2,l.rank):bN(`coords`,3,l.rank)}, + ${o?bN(`coords`,3,l.rank):bN(`coords`,4,l.rank)}) * uniforms.strides - uniforms.pads; + let xFCorner = xFRCCorner.x; + let xRCorner = xFRCCorner.y; + let xCCorner = xFRCCorner.z; + let xShapeY = ${o?bN(`uniforms.x_shape`,1,l.rank):bN(`uniforms.x_shape`,2,l.rank)}; + let xShapeZ = ${o?bN(`uniforms.x_shape`,2,l.rank):bN(`uniforms.x_shape`,3,l.rank)}; + let xShapeW = ${o?bN(`uniforms.x_shape`,3,l.rank):bN(`uniforms.x_shape`,4,l.rank)}; + let xShapeU = ${o?bN(`uniforms.x_shape`,4,l.rank):bN(`uniforms.x_shape`,1,l.rank)}; + let inputDepthNearestVec4 = (xShapeU / 4) * 4; + let inputDepthVec4Remainder = xShapeU % 4; + + var value = 0.0; + for (var wF = 0u; wF < uniforms.filter_dims[0]; wF++) { + let xF = xFCorner + wF * uniforms.dilations[0]; + if (xF < 0 || xF >= xShapeY) { + continue; + } + + for (var wR = 0u; wR < uniforms.filter_dims[1]; wR++) { + let xR = xRCorner + wR * uniforms.dilations[1]; + if (xR < 0 || xR >= xShapeZ) { + continue; + } + + for (var wC = 0u; wC < uniforms.filter_dims[2]; wC++) { + let xC = xCCorner + wC * uniforms.dilations[2]; + if (xC < 0 || xC >= xShapeW) { + continue; + } + + for (var d1 = 0u; d1 < inputDepthNearestVec4; d1 += 4) { + ${o?`let xValues = vec4( + getX(batch, xF, xR, xC, d1), + getX(batch, xF, xR, xC, d1 + 1), + getX(batch, xF, xR, xC, d1 + 2), + getX(batch, xF, xR, xC, d1 + 3)); + `:`let xValues = vec4( + getX(batch, d1, xF, xR, xC), + getX(batch, d1 + 1, xF, xR, xC), + getX(batch, d1 + 2, xF, xR, xC), + getX(batch, d1 + 3, xF, xR, xC)); + `} + let wValues = vec4( + getW(d2, d1, wF, wR, wC), + getW(d2, d1 + 1, wF, wR, wC), + getW(d2, d1 + 2, wF, wR, wC), + getW(d2, d1 + 3, wF, wR, wC)); + value += dot(xValues, wValues); + } + if (inputDepthVec4Remainder == 1) { + ${o?`value += getX(batch, xF, xR, xC, inputDepthNearestVec4) + * getW(d2, inputDepthNearestVec4, wF, wR, wC);`:`value += getX(batch, inputDepthNearestVec4, xF, xR, xC) + * getW(d2, inputDepthNearestVec4, wF, wR, wC);`} + } else if (inputDepthVec4Remainder == 2) { + ${o?`let xValues = vec2( + getX(batch, xF, xR, xC, inputDepthNearestVec4), + getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1)); + `:`let xValues = vec2( + getX(batch, inputDepthNearestVec4, xF, xR, xC), + getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC)); + `} + let wValues = vec2( + getW(d2, inputDepthNearestVec4, wF, wR, wC), + getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC)); + value += dot(xValues, wValues); + } else if (inputDepthVec4Remainder == 3) { + ${o?`let xValues = vec3( + getX(batch, xF, xR, xC, inputDepthNearestVec4), + getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1), + getX(batch, xF, xR, xC, inputDepthNearestVec4 + 2)); + `:`let xValues = vec3( + getX(batch, inputDepthNearestVec4, xF, xR, xC), + getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC), + getX(batch, inputDepthNearestVec4 + 2, xF, xR, xC)); + `} + let wValues = vec3( + getW(d2, inputDepthNearestVec4, wF, wR, wC), + getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC), + getW(d2, inputDepthNearestVec4 + 2, wF, wR, wC)); + value += dot(xValues, wValues); + } + } + } + } + ${f?`value = value + getBiasByOutputCoords(coords)`:``}; + ${g} + result[global_idx] = f32(value); + }`}}}}),$I,eL,tL=J(()=>{"use strict";gM(),NM(),DN(),CI(),$I=(e,t,n,r)=>{let i=e.length>2,a=i?`value += b[output_channel];`:``,o=e[0].dims,s=e[1].dims,c=t.format===`NHWC`,l=c?n[3]:n[1],u=l/t.group,d=c&&u>=4?gN(l):1,f=Y.size(n)/d,p=[{type:12,data:f},{type:12,data:t.dilations},{type:12,data:[t.strides[0],t.strides[1]]},{type:12,data:[t.pads[0],t.pads[1]]},{type:12,data:u}];bI(t,p),p.push(...hN(o,[s[0],s[1],s[2],s[3]/d]));let m=i?[`rank`,`rank`,`rank`]:[`rank`,`rank`];return p.push(...hN([n[0],n[1],n[2],n[3]/d])),{name:`GroupedConv`,shaderCache:{hint:`${t.cacheKey}_${d}`,inputDependencies:m},getRunData:()=>({outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:p}),getShaderSource:r=>{let l=SN(`output`,e[0].dataType,n.length,d),u=pN(l.type.tensor),f=yI(t,l.type.value,u),p=X(`x`,e[0].dataType,o.length),m=X(`w`,e[1].dataType,s.length,d),h=[p,m];i&&h.push(X(`b`,e[2].dataType,e[2].dims,d));let g=[{name:`output_size`,type:`u32`},{name:`dilations`,type:`u32`,length:t.dilations.length},{name:`strides`,type:`u32`,length:2},{name:`pads`,type:`u32`,length:2},{name:`output_channels_per_group`,type:`u32`}];xI(t,g);let _=c?` + for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[0]; wHeight++) { + let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; + + if (xHeight < 0u || xHeight >= uniforms.x_shape[1]) { + continue; + } + + for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[1]; wWidth++) { + let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1]; + if (xWidth < 0u || xWidth >= uniforms.x_shape[2]) { + continue; + } + + for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[2]; wInChannel++) { + let input_channel = in_channel_offset + wInChannel; + let xVal = ${p.get(`batch`,`xHeight`,`xWidth`,`input_channel`)}; + let wVal = ${m.get(`wHeight`,`wWidth`,`wInChannel`,`output_channel`)}; + value += xVal * wVal; + } + } + } + `:` + for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[1]; wInChannel++) { + let input_channel = in_channel_offset + wInChannel; + for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[2]; wHeight++) { + let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; + + if (xHeight < 0u || xHeight >= uniforms.x_shape[2]) { + continue; + } + + for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[3]; wWidth++) { + let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1]; + if (xWidth < 0u || xWidth >= uniforms.x_shape[3]) { + continue; + } + + let xVal = ${p.get(`batch`,`input_channel`,`xHeight`,`xWidth`)}; + let wVal = ${m.get(`output_channel`,`wInChannel`,`wHeight`,`wWidth`)}; + value += xVal * wVal; + } + } + } + `;return` + ${r.registerUniforms(g).declareVariables(...h,l)} + + ${r.mainStart()} + ${r.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + + let outputIndices = ${l.offsetToIndices(`global_idx`)}; + let batch: u32 = outputIndices[0]; + let output_channel: u32 = outputIndices[${c?3:1}]; + let xRCCorner: vec2 = vec2(outputIndices[${c?1:2}], outputIndices[${c?2:3}]) * uniforms.strides - uniforms.pads; + let group_id: u32 = output_channel * ${d} / uniforms.output_channels_per_group; + var in_channel_offset = group_id * uniforms.w_shape[${c?2:1}]; + + var value: ${l.type.value} = ${l.type.value}(0); + ${_} + ${a} + ${f} + ${l.setByOffset(`global_idx`,`value`)} + }`}}},eL=(e,t,n,r)=>{let i=e.length>2,a=gN(n[3]),o=gN(n[2]),s=Y.size(n)/a/o,c=[e[0].dims[0],e[0].dims[1],e[0].dims[2],e[0].dims[3]/a],l=[e[1].dims[0],e[1].dims[1],e[1].dims[2],e[1].dims[3]/a],u=[n[0],n[1],n[2],n[3]/a],d=[{type:12,data:s},{type:6,data:[t.strides[0],t.strides[1]]},{type:6,data:[t.pads[0],t.pads[1]]}];bI(t,d),d.push(...hN(c,l,u));let f=(o-1)*t.strides[1]+l[1];return{name:`GroupedConv-Vectorize`,shaderCache:{hint:`${t.cacheKey};${a};${o};${f};${l[0]};${l[1]}`,inputDependencies:i?[`rank`,`rank`,`type`]:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:r?r(n):n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:d}),getShaderSource:n=>{let r=SN(`output`,e[0].dataType,u.length,a),s=pN(r.type.tensor),d=yI(t,r.type.value,s),p=X(`x`,e[0].dataType,c.length,a),m=X(`w`,e[1].dataType,l.length,a),h=[p,m];i&&h.push(X(`b`,e[2].dataType,e[2].dims,a));let g=i?`value += b[output_channel];`:``,_=[{name:`output_size`,type:`u32`},{name:`strides`,type:`i32`,length:2},{name:`pads`,type:`i32`,length:2}];return xI(t,_),` + ${n.registerUniforms(_).declareVariables(...h,r)} + ${n.mainStart()} + ${n.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let width0 = uniforms.output_shape[3]; + let output_channel = global_idx % width0; + var index1 = global_idx / width0; + let width1 = uniforms.output_shape[2] / ${o}u; + let col = (index1 % width1) * ${o}u; + index1 = index1 / width1; + let row = index1 % uniforms.output_shape[1]; + let batch = index1 / uniforms.output_shape[1]; + + let x_corner = vec2(i32(row), i32(col)) * uniforms.strides - uniforms.pads; + + var x_vals: array<${p.type.value}, ${f}>; + var values: array<${r.type.value}, ${o}>; + let input_channel = output_channel; + // Use constant instead of uniform can give better performance for w's height/width. + for (var w_height: u32 = 0u; w_height < ${l[0]}; w_height++) { + let x_height = x_corner.x + i32(w_height); + if (x_height >= 0 && u32(x_height) < uniforms.x_shape[1]) { + for (var i = 0; i < ${f}; i++) { + let x_width = x_corner.y + i; + if (x_width >= 0 && u32(x_width) < uniforms.x_shape[2]) { + x_vals[i] = ${p.get(`batch`,`u32(x_height)`,`u32(x_width)`,`input_channel`)}; + } else { + x_vals[i] = ${p.type.value}(0); + } + } + for (var w_width: u32 = 0u; w_width < ${l[1]}; w_width++) { + let w_val = ${m.get(`w_height`,`w_width`,`0`,`output_channel`)}; + for (var i = 0u; i < ${o}u; i++) { + values[i] = fma(x_vals[i * u32(uniforms.strides[1]) + w_width], w_val, values[i]); + } + } + } + } + + for (var i = 0u; i < ${o}u; i++) { + var value = values[i]; + ${g} + ${d} + ${r.set(`batch`,`row`,`col + i`,`output_channel`,`value`)}; + } + }`}}}}),nL,rL,iL,aL,oL,sL,cL,lL,uL,dL=J(()=>{"use strict";NM(),UI(),QI(),BI(),tL(),CI(),jI(),LN(),nL=(e,t,n,r,i,a)=>{let o=e[0],s=e.slice(a?1:2,a?3:4),c=s.length,l=t[0],u=t.slice(2).map((e,t)=>e+(e-1)*(n[t]-1)),d=s.map((e,t)=>e+r[t]+r[t+c]).map((e,t)=>Math.floor((e-u[t]+i[t])/i[t]));return d.splice(0,0,o),d.splice(a?3:1,0,l),d},rL=[2,3,1,0],iL=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(e[0].dims.length>5)throw Error(`greater than 5D is not supported`);if(e[0].dims.length!==e[1].dims.length)throw Error(`filter does not have same dimension as input`);if(e[0].dims[t.format===`NHWC`?e[0].dims.length-1:1]!==e[1].dims[1]*t.group)throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);if(e.length===3&&(e[2].dims.length!==1||e[1].dims[0]!==e[2].dims[0]))throw Error(`invalid bias`);let n=e[0].dims.length-2;if(t.dilations.length!==n)throw Error(`dilations should be ${n}D`);if(t.strides.length!==n)throw Error(`strides should be ${n}D`);if(t.pads.length!==n*2)throw Error(`pads should be ${n*2}D`);if(t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw Error(`invalid kernel shape`)},aL=(e,t)=>{let n=e.kernelShape.slice();n.length{let t=SI(e),n=e.format;return{autoPad:[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][e.auto_pad],format:n,dilations:e.dilations,group:e.group,kernelShape:e.kernel_shape,pads:e.pads,strides:e.strides,wIsConst:e.w_is_const(),...t,cacheKey:`${e.format};${t.activation};`}},sL=(e,t,n,r)=>{let i=n.format===`NHWC`,a=nL(t[0].dims,t[1].dims,n.dilations,n.pads,n.strides,i);if(n.group!==1){let o=[t[0]];if(i){let r=e.kernelCustomData.wT??e.compute(PN(t[1],rL),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=r),o.push(r)}else o.push(t[1]);t.length===3&&o.push(t[2]),!e.adapterInfo.isArchitecture(`ampere`)&&i&&t[1].dims[0]===n.group&&t[1].dims[1]===1&&n.dilations[0]===1&&n.dilations[1]===1?e.compute(eL(o,n,a,r),{inputs:o}):e.compute($I(o,n,a,r),{inputs:o});return}let o=t.length===3,s=t[0].dims[i?1:2],c=t[0].dims[i?2:3],l=t[0].dims[i?3:1],u=t[1].dims[2],d=t[1].dims[3],f=a[i?1:2],p=a[i?2:3],m=a[i?3:1],h=i&&u===s&&d===c&&n.pads[0]===0&&n.pads[1]===0;if(h||u===1&&d===1&&n.dilations[0]===1&&n.dilations[1]===1&&n.strides[0]===1&&n.strides[1]===1&&n.pads[0]===0&&n.pads[1]===0){let u=a[0],d,g,_,v=[];if(i){let r=e.kernelCustomData.wT??e.compute(PN(t[1],rL),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];if(n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=r),h){let e=s*c*l;d=t[0].reshape([1,u,e]),g=r.reshape([1,e,m]),_=[1,u,m]}else d=t[0].reshape([u,s*c,l]),g=r.reshape([1,l,m]),_=[u,f*p,m];v.push(d),v.push(g)}else d=t[0].reshape([u,l,s*c]),g=t[1].reshape([1,m,l]),_=[u,m,f*p],v.push(g),v.push(d);o&&v.push(t[2]);let y=_[2],b=v[0].dims[v[0].dims.length-1];y<8&&b<8?e.compute(AI(v,n,a,_,i,r),{inputs:v}):e.compute(zI(v,n,a,_,i,r),{inputs:v});return}let g=e.kernelCustomData.wT??e.compute(PN(t[1],rL),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=g);let _=[t[0],g];o&&_.push(t[2]);let v=i?f*p:m,y=i?m:f*p,b=u*d*l;e.compute(HI(_,n,a,v,y,b,o,!0,r),{inputs:_})},cL=(e,t)=>{let n=t.format===`NHWC`,r=[e.inputs[0].reshape(n?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&r.push(e.inputs[2]);let i=[0,t.pads[0],0,t.pads[1]],a=[1].concat(t.strides),o=[1].concat(t.dilations),s=[1].concat(t.kernelShape),c=aL({...t,pads:i,strides:a,dilations:o,kernelShape:s},r);sL(e,r,c,e=>n?[e[0],e[2],e[3]]:[e[0],e[1],e[3]])},lL=(e,t,n)=>{let r=n.format===`NHWC`?`channelsLast`:`channelsFirst`,i=aL(n,t),a=n.autoPad===`NOTSET`?n.pads:n.autoPad,o=XI(t[0].dims,t[1].dims,n.strides,n.dilations,a,!1,r);e.compute(ZI(t,i,o.outShape,[o.filterDepth,o.filterHeight,o.filterWidth],[o.padInfo.front,o.padInfo.top,o.padInfo.left],r))},uL=(e,t)=>{if(iL(e.inputs,t),e.inputs[0].dims.length===3)cL(e,t);else if(e.inputs[0].dims.length===5)lL(e,e.inputs,t);else{let n=aL(t,e.inputs);sL(e,e.inputs,n)}}}),fL,pL=J(()=>{"use strict";gM(),EM(),NM(),DN(),fL=(e,t,n)=>{let r=e.length>2,i=t.outputShape,a=t.format===`NHWC`,o=t.group,s=e[1].dims,c=s[2]/o,l=s[3],u=a?gN(c):1,d=a&&l===1&&c>=4,f=d?Math.floor(c/4)*4:Math.floor(c/u)*u,p=c-f,m=a?gN(l):1,h=a?l===1?u:m:1,g=Y.size(i)/m,_=[Math.ceil(g/64),1,1];TM(`verbose`,()=>`[conv2d_backprop_webgpu] dispatch = ${_}`);let v=[`rank`,`rank`],y=[t.strides[0],t.strides[1]],b=[t.kernelShape[a?1:2],t.kernelShape[a?2:3]],x=[t.dilations[0],t.dilations[1]],S=[b[0]+(t.dilations[0]<=1?0:(t.kernelShape[a?1:2]-1)*(t.dilations[0]-1)),b[1]+(t.dilations[1]<=1?0:(t.kernelShape[a?2:3]-1)*(t.dilations[1]-1))],C=[S[0]-1-Math.floor((t.pads[0]+t.pads[2])/2),S[1]-1-Math.floor((t.pads[1]+t.pads[3])/2)],w=[{type:12,data:g},{type:12,data:y},{type:12,data:b},{type:12,data:x},{type:12,data:S},{type:6,data:C},{type:12,data:f},{type:12,data:c},{type:12,data:l},...hN(e[0].dims,e[1].dims)];return r&&(w.push(...hN(e[2].dims)),v.push(`rank`)),w.push(...hN(i)),{name:`ConvTranspose2D`,shaderCache:{hint:`${t.cacheKey};${u}${h}${m}${d}${p}`,inputDependencies:v},getRunData:()=>({dispatchGroup:{x:_[0],y:_[1],z:_[2]},outputs:[{dims:n?n(i):i,dataType:e[0].dataType}],programUniforms:w}),getShaderSource:t=>{let n=[{name:`output_size`,type:`u32`},{name:`strides`,type:`u32`,length:y.length},{name:`filter_dims`,type:`u32`,length:b.length},{name:`dilations`,type:`u32`,length:b.length},{name:`effective_filter_dims`,type:`u32`,length:S.length},{name:`pads`,type:`i32`,length:C.length},{name:`input_channels_per_group_int`,type:`u32`},{name:`input_channels_per_group`,type:`u32`},{name:`output_channels_per_group`,type:`u32`}],o=pN(e[0].dataType),s=a?1:2,c=a?2:3,l=a?3:1,f=X(`W`,e[1].dataType,e[1].dims.length,h),g=X(`Dy`,e[0].dataType,e[0].dims.length,u),_=[g,f];r&&_.push(X(`bias`,e[2].dataType,[i[l]].length,m));let v=SN(`result`,e[0].dataType,i.length,m),x=` + let outputIndices = ${v.offsetToIndices(`global_idx * ${m}`)}; + let batch = ${v.indicesGet(`outputIndices`,0)}; + let d1 = ${v.indicesGet(`outputIndices`,l)}; + let r = ${v.indicesGet(`outputIndices`,s)}; + let c = ${v.indicesGet(`outputIndices`,c)}; + let dyCorner = vec2(i32(r), i32(c)) - uniforms.pads; + let dyRCorner = dyCorner.x; + let dyCCorner = dyCorner.y; + let groupId = d1 / uniforms.output_channels_per_group; + let wOutChannel = d1 - groupId * uniforms.output_channels_per_group; + // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1). + // ? = to be determined. : = across all values in that axis. + var dotProd = ${v.type.value}(0.0); + var wR: u32 = 0; + if (uniforms.dilations.x == 1) { + // Minimum wR >= 0 that satisfies (dyRCorner + wR) % (uniforms.strides.x) == 0 + wR = u32(((dyRCorner + i32(uniforms.strides.x) - 1) / i32(uniforms.strides.x)) * i32(uniforms.strides.x) - dyRCorner); + } + for (; wR < uniforms.effective_filter_dims.x; wR = wR + 1) { + if (wR % uniforms.dilations.x != 0) { + continue; + } + let dyR = (${o}(dyRCorner) + ${o}(wR)) / ${o}(uniforms.strides[0]); + let wRPerm = uniforms.filter_dims.x - 1 - wR / uniforms.dilations.x; + if (dyR < 0.0 || dyR >= ${o}(uniforms.Dy_shape[${s}]) || fract(dyR) > 0.0 || + wRPerm < 0) { + continue; + } + let idyR: u32 = u32(dyR); + var wC: u32 = 0; + if (uniforms.dilations.y == 1) { + // Minimum wC >= 0 that satisfies (dyCCorner + wC) % (uniforms.strides.y) == 0 + wC = u32(((dyCCorner + i32(uniforms.strides.y) - 1) / i32(uniforms.strides.y)) * i32(uniforms.strides.y) - dyCCorner); + } + for (; wC < uniforms.effective_filter_dims.y; wC = wC + 1) { + if (wC % uniforms.dilations.y != 0) { + continue; + } + let dyC = (${o}(dyCCorner) + ${o}(wC)) / ${o}(uniforms.strides.y); + let wCPerm = uniforms.filter_dims.y - 1 - wC / uniforms.dilations.y; + if (dyC < 0.0 || dyC >= ${o}(uniforms.Dy_shape[${c}]) || + fract(dyC) > 0.0 || wCPerm < 0) { + continue; + } + let idyC: u32 = u32(dyC); + var inputChannel = groupId * uniforms.input_channels_per_group; + ${d?` + var x_offset = ${g.indicesToOffset(`${g.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${u}; + var w_offset = ${f.indicesToOffset(`${f.type.indices}(wRPerm, wCPerm, inputChannel, wOutChannel)`)} / ${h}; + `:``} + for (var d2: u32 = 0; d2 < uniforms.input_channels_per_group_int; d2 = d2 + ${d?4:u}) { + ${(()=>{let e=``;if(d)u===4?e+=` + let xValue = ${g.getByOffset(`x_offset`)}; + let wValue = ${f.getByOffset(`w_offset`)}; + dotProd = dotProd + dot(xValue, wValue); + x_offset += 1u; + w_offset += 1u;`:u===2?e+=` + dotProd = dotProd + dot(vec4<${o}>(${g.getByOffset(`x_offset`)}, ${g.getByOffset(`x_offset + 1u`)}), vec4<${o}>(${f.getByOffset(`w_offset`)}, ${f.getByOffset(`w_offset + 1u`)})); + x_offset += 2u; + w_offset += 2u;`:u===1&&(e+=` + dotProd = dotProd + dot(vec4<${o}>(${g.getByOffset(`x_offset`)}, ${g.getByOffset(`x_offset + 1u`)}, ${g.getByOffset(`x_offset + 2u`)}, ${g.getByOffset(`x_offset + 3u`)}), vec4<${o}>(${f.getByOffset(`w_offset`)}, ${f.getByOffset(`w_offset + 1u`)}, ${f.getByOffset(`w_offset + 2u`)}, ${f.getByOffset(`w_offset + 3u`)})); + x_offset += 4u; + w_offset += 4u;`);else if(e+=` + let xValue = ${a?g.getByOffset(`${g.indicesToOffset(`${g.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${u}`):g.get(`batch`,`inputChannel`,`idyR`,`idyC`)}; + `,u===1)e+=` + let w_offset = ${f.indicesToOffset(`${f.type.indices}(u32(wRPerm), u32(wCPerm), inputChannel, wOutChannel)`)}; + let wValue = ${f.getByOffset(`w_offset / ${h}`)}; + dotProd = dotProd + xValue * wValue;`;else for(let t=0;t{if(p===0)return``;if(!d)throw Error(`packInputAs4 ${d} is not true.`);let e=``;if(u===1){e+=`dotProd = dotProd`;for(let t=0;t{"use strict";pL(),CI(),LN(),mL=(e,t,n,r,i,a)=>(e-1)*t+n+(r-1)*i+1-a,hL=(e,t,n,r,i)=>{let a=Math.floor(e/2);t===`SAME_UPPER`?(n[r]=a,n[i]=e-a):t===`SAME_LOWER`&&(n[r]=e-a,n[i]=a)},gL=(e,t,n,r,i,a,o,s,c,l)=>{let u=e.length-2,d=l.length===0;c.length{let n=e.kernelShape.slice();if(e.kernelShape.length===0||e.kernelShape.reduce((e,t)=>e*t,1)===0){n.length=0;for(let e=2;ee+t,0)===0){let e=t[0].dims.length-2;c=Array(e).fill(1)}let l=e.strides.slice();if(l.reduce((e,t)=>e+t,0)===0){let e=t[0].dims.length-2;l=Array(e).fill(1)}gL(s,n,c,e.autoPad,e.group,i,l,r,o,a);let u=Object.assign({},e);return Object.assign(u,{kernelShape:n,pads:i,outputPadding:o,outputShape:a,dilations:c,strides:l}),u},vL=e=>{let t=SI(e),n=e.format,r=[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][typeof e.autoPad>`u`?0:e.autoPad],i=e.dilations,a=e.group,o=e.kernelShape,s=e.pads,c=e.strides,l=e.wIsConst();return{autoPad:r,format:n,dilations:i,group:a,kernelShape:o,outputPadding:e.outputPadding,outputShape:e.outputShape,pads:s,strides:c,wIsConst:l,...t,cacheKey:`${e.format};${t.activation};`}},yL=(e,t)=>{if(!e||e.length!==2&&e.length!==3)throw Error(`Conv requires 2 or 3 inputs`);if(e[0].dims.length!==4&&e[0].dims.length!==3)throw Error(`currently only support 2-dimensional conv`);if(e[0].dims.length!==e[1].dims.length)throw Error(`filter does not have same dimension as input`);if(e[0].dims[t.format===`NHWC`?e[0].dims.length-1:1]!==e[1].dims[0])throw Error(`FILTER_IN_CHANNEL should be equal to DATA_CHANNEL`);let n=e[1].dims[1]*t.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==n))throw Error(`invalid bias`);let r=e[0].dims.length-2;if(t.dilations.reduce((e,t)=>e+t,0)>0&&t.dilations.length!==r)throw Error(`dilations should be ${r}D`);if(t.strides.reduce((e,t)=>e+t,0)>0&&t.strides.length!==r)throw Error(`strides should be ${r}D`);if(t.pads.reduce((e,t)=>e+t,0)>0&&t.pads.length!==r*2)throw Error(`pads should be ${r*2}D`);if(t.outputPadding.length!==r&&t.outputPadding.length!==0)throw Error(`output_padding should be ${r}D`);if(t.kernelShape.reduce((e,t)=>e+t,0)>0&&t.kernelShape.length!==0&&t.kernelShape.length!==e[1].dims.length-2)throw Error(`invalid kernel shape`);if(t.outputShape.length!==0&&t.outputShape.length!==e[0].dims.length-2)throw Error(`invalid output shape`)},bL=(e,t,n,r)=>{let i=e.kernelCustomData.wT??e.compute(PN(t[1],[2,3,0,1]),{inputs:[1],outputs:[n.wIsConst?-2:-1]})[0];n.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=i);let a=[t[0],i];t.length===3&&a.push(t[2]),e.compute(fL(a,n,r),{inputs:a})},xL=(e,t)=>{let n=t.format===`NHWC`,r=[e.inputs[0].reshape(n?[e.inputs[0].dims[0],1,e.inputs[0].dims[1],e.inputs[0].dims[2]]:[e.inputs[0].dims[0],e.inputs[0].dims[1],1,e.inputs[0].dims[2]]),e.inputs[1].reshape([e.inputs[1].dims[0],e.inputs[1].dims[1],1,e.inputs[1].dims[2]])];e.inputs.length===3&&r.push(e.inputs[2]);let i=t.kernelShape;(i.length===0||i[0]===0)&&(i=[e.inputs[1].dims[2]]);let a=t.dilations;(a.length===0||a[0]===0)&&(a=[1]);let o=t.strides;(o.length===0||o[0]===0)&&(o=[1]);let s=t.pads;s.length===0&&(s=[0,0]),s=[0,s[0],0,s[1]],o=[1].concat(o),a=[1].concat(a),i=[1].concat(i);let c=t.outputPadding;c=[0].concat(c);let l=_L({...t,pads:s,strides:o,dilations:a,kernelShape:i,outputPadding:c},r);bL(e,r,l,e=>n?[e[0],e[2],e[3]]:[e[0],e[1],e[3]])},SL=(e,t)=>{if(yL(e.inputs,t),e.inputs[0].dims.length===3)xL(e,t);else{let n=_L(t,e.inputs);bL(e,e.inputs,n)}}}),wL,TL,EL,DL=J(()=>{"use strict";gM(),NM(),uN(),DN(),wL=(e,t,n,r)=>{let i=Y.size(t),a=t.length,o=X(`input`,e,a),s=SN(`output`,e,a),c=n.dataType===6?n.getInt32Array()[0]:Number(n.getBigInt64Array()[0]),l=Y.normalizeAxis(c,a);return{name:`CumSum`,shaderCache:{hint:r.cacheKey,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:t,dataType:e}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:[{type:12,data:i},{type:12,data:l},...hN(t,t)]}),getShaderSource:e=>{let t=` i32(${o.indicesGet(`inputIndices`,`uniforms.axis`)}) `,n=bN(`uniforms.input_shape`,`uniforms.axis`,a),i=r.reverse?t+(r.exclusive?` + 1`:``):`0`,c=r.reverse?n:t+(r.exclusive?``:` + 1`);return` + ${e.registerUniform(`outputSize`,`u32`).registerUniform(`axis`,`u32`).declareVariables(o,s)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + var inputIndices = ${s.offsetToIndices(`global_idx`)}; + var sum = ${s.type.value}(0); + let first : i32 = ${i}; + let last : i32 = ${c}; + for (var i : i32 = first; i < last; i++) { + ${o.indicesSet(`inputIndices`,`uniforms.axis`,`u32(i)`)}; + sum = sum + ${o.getByIndices(`inputIndices`)}; + } + ${s.setByOffset(`global_idx`,`sum`)}; + }`}}},TL=(e,t)=>{let n=e.inputs[0].dims,r=e.inputs[0].dataType,i=e.inputs[1];e.compute(wL(r,n,i,t),{inputs:[0]})},EL=e=>{let t=e.exclusive===1,n=e.reverse===1;return lN({exclusive:t,reverse:n})}}),OL,kL,AL,jL,ML,NL=J(()=>{"use strict";gM(),NM(),uN(),DN(),OL=e=>{if(!e||e.length!==1)throw Error(`DepthToSpace requires 1 input.`);if(e[0].dims.length!==4)throw Error(`DepthToSpace requires 4D input.`)},kL=(e,t,n,r)=>{let i=[];i.push(`fn perm(i: ${r.type.indices}) -> ${n.type.indices} { + var a: ${n.type.indices};`);for(let r=0;r{let n,r,i,a,o,s,c=t.format===`NHWC`,l=t.blocksize,u=t.mode===`DCR`;c?([n,r,i,a]=e.dims,o=u?[n,r,i,l,l,a/l**2]:[n,r,i,a/l**2,l,l],s=u?[0,1,3,2,4,5]:[0,1,4,2,5,3]):([n,r,i,a]=[e.dims[0],e.dims[2],e.dims[3],e.dims[1]],o=u?[n,l,l,a/l**2,r,i]:[n,a/l**2,l,l,r,i],s=u?[0,3,4,1,5,2]:[0,1,4,2,5,3]);let d=e.reshape(o),f=d.dims.length,p=e.dataType,m=X(`a`,p,f),h=SN(`output`,p,f);return{name:`DepthToSpace`,shaderCache:{hint:`${e.dims};${t.blocksize};${t.mode}`,inputDependencies:[`rank`]},getRunData:e=>{let t=c?[n,r*l,i*l,a/l**2]:[n,a/l**2,r*l,i*l],o=Y.size(t),u=d.dims,f=Y.sortBasedOnPerm(u,s);return{outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:[{type:12,data:o},...hN(u,f)]}},getShaderSource:e=>` + ${e.registerUniform(`output_size`,`u32`).declareVariables(m,h)} + + ${kL(s,f,m,h)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + + let indices = ${h.offsetToIndices(`global_idx`)}; + let aIndices = perm(indices); + + ${h.setByOffset(`global_idx`,m.getByIndices(`aIndices`))} + }`}},jL=(e,t)=>{OL(e.inputs),e.compute(AL(e.inputs[0],t))},ML=e=>lN({blocksize:e.blocksize,mode:e.mode,format:e.format})}),PL,FL,IL,LL,RL,zL,BL,VL,HL,UL,WL,GL=J(()=>{"use strict";gM(),NM(),uN(),DN(),PL=`[a-zA-Z]|\\.\\.\\.`,FL=`(`+PL+`)+`,IL=`^`+FL+`$`,LL=`(`+FL+`,)*`+FL,RL=`^`+LL+`$`,zL=class{constructor(e=-1){this.symbolToIndices=new Map,this.inputIndex=e}addSymbol(e,t){let n=this.symbolToIndices.get(e);n===void 0?n=[t]:n.push(t),this.symbolToIndices.set(e,n)}},BL=class{constructor(e,t){this.equation=t,this.hasEllipsis=!1,this.symbolToInfo=new Map,this.lhs=[],this.outputDims=[];let[n,r]=t.includes(`->`)?t.split(`->`,2):[t,``];if(!n.match(RegExp(RL)))throw Error(`Invalid LHS term`);if(n.split(`,`).forEach((t,n)=>{let r=e[n].dims.slice();if(!t.match(RegExp(IL)))throw Error(`Invalid LHS term`);let i=this.processTerm(t,!0,r,n);this.lhs.push(i)}),r===``)r+=[...this.symbolToInfo.entries()].filter(([e,t])=>t.count===1||e===`...`).map(([e])=>e).join(``);else if(!r.match(RegExp(FL)))throw Error(`Invalid RHS`);r.match(RegExp(PL,`g`))?.forEach(e=>{if(e===`...`)this.outputDims=this.outputDims.concat(this.ellipsisDims);else{let t=this.symbolToInfo.get(e);if(t===void 0)throw Error(`Invalid RHS symbol`);this.outputDims.push(t.dimValue)}}),this.rhs=this.processTerm(r,!1,this.outputDims)}addSymbol(e,t,n){let r=this.symbolToInfo.get(e);if(r!==void 0){if(r.dimValue!==t&&r.count!==1)throw Error(`Dimension mismatch`);r.count++,r.inputIndices.push(n)}else r={count:1,dimValue:t,inputIndices:[n]};this.symbolToInfo.set(e,r)}processTerm(e,t,n,r=-1){let i=n.length,a=!1,o=[],s=0;if(!e.match(RegExp(IL))&&!t&&e!==``)throw Error(`Invalid LHS term`);let c=e.match(RegExp(PL,`g`)),l=new zL(r);return c?.forEach((e,u)=>{if(e===`...`){if(a)throw Error(`Only one ellipsis is allowed per input term`);a=!0;let e=i-c.length+1;if(e<0)throw Error(`Ellipsis out of bounds`);if(o=n.slice(s,s+e),this.hasEllipsis){if(this.ellipsisDims.length!==o.length||this.ellipsisDims.toString()!==o.toString())throw Error(`Ellipsis dimensions mismatch`)}else if(t)this.hasEllipsis=!0,this.ellipsisDims=o;else throw Error(`Ellipsis must be specified in the LHS`);for(let e=0;ee+`_max`,HL=(e,t,n,r)=>{let i=e.map(e=>e.length).map((e,n)=>X(`input${n}`,t,e)),a=Y.size(r),o=SN(`output`,t,r.length),s=[...n.symbolToInfo.keys()].filter(e=>!n.rhs.symbolToIndices.has(e));return{name:`Einsum`,shaderCache:{hint:n.equation,inputDependencies:e.map(()=>`rank`)},getRunData:()=>{let i=s.filter(e=>n.symbolToInfo.has(e)).map(e=>({type:12,data:n.symbolToInfo.get(e)?.dimValue||0}));i.push({type:12,data:a});let o=e.map((e,t)=>[...hN(e)]).reduce((e,t)=>e.concat(t),i);return o.push(...hN(r)),{outputs:[{dims:r,dataType:t}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:o}},getShaderSource:e=>{let t=[],r=[],a=[],c=[],l=[],u=n.symbolToInfo.size===n.rhs.symbolToIndices.size;n.symbolToInfo.forEach((e,s)=>{if(n.rhs.symbolToIndices.has(s)){let r=n.rhs.symbolToIndices.get(s)?.[0];r!==void 0&&n.lhs.forEach((n,a)=>{if(e.inputIndices.includes(a)){let e=n.symbolToIndices.get(s);if(e===void 0)throw Error(`Invalid symbol error`);e.forEach(e=>{t.push(`${i[a].indicesSet(`input${a}Indices`,e,o.indicesGet(`outputIndices`,r))}`)})}})}else n.lhs.forEach((t,n)=>{if(e.inputIndices.includes(n)){let e=t.symbolToIndices.get(s);if(e===void 0)throw Error(`Invalid symbol error`);e.forEach(e=>{r.push(`${i[n].indicesSet(`input${n}Indices`,e,`${s}`)}`)}),l.push(`prod *= ${i[n].getByIndices(`input${n}Indices`)};`)}}),a.push(`for(var ${s}: u32 = 0; ${s} < uniforms.${VL(s)}; ${s}++) {`),c.push(`}`)});let d=u?[...t,`let sum = ${i.map((e,t)=>e.getByIndices(`input${t}Indices`)).join(` * `)};`]:[...t,`var sum = 0.0;`,...a,...r,`var prod = 1.0;`,...l,`sum += prod;`,...c];return` + ${e.registerUniforms(s.map(e=>({name:`${VL(e)}`,type:`u32`}))).registerUniform(`outputSize`,`u32`).declareVariables(...i,o)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + var outputIndices = ${o.offsetToIndices(`global_idx`)}; + ${i.map((e,t)=>`var input${t}Indices: ${i[t].type.indices};`).join(` +`)} + ${d.join(` +`)}; + ${o.setByOffset(`global_idx`,`sum`)}; + }`}}},UL=(e,t)=>{let n=new BL(e.inputs,t.equation),r=n.outputDims,i=e.inputs.map((e,t)=>e.dims);e.compute(HL(i,e.inputs[0].dataType,n,r))},WL=e=>{let t=e.equation.replace(/\s+/g,``);return lN({equation:t})}}),KL,qL,JL,YL,XL,ZL=J(()=>{"use strict";gM(),NM(),DN(),KL=e=>{if(!e||e.length!==2)throw Error(`Expand requires 2 input.`);let t=e[0].dims,n=Array.from(e[1].getBigInt64Array(),Number),r=n.length{let n=e.length-t.length,r=[];for(let t=0;te.length>t.length?qL(e,t):qL(t,e),YL=e=>{let t=e[0].dims,n=Array.from(e[1].getBigInt64Array(),Number),r=JL(t,n),i=e[0].dataType,a=i===9||Y.size(t)===1,o=i===9||t.length>0&&t[t.length-1]%4==0?4:1,s=a||r.length>0&&r[r.length-1]%4==0?4:1,c=Math.ceil(Y.size(r)/s),l=e=>{let n=X(`input`,i,t.length,o),a=SN(`output`,i,r.length,s),c;if(i===9){let e=(e,t,r=``)=>` + let outputIndices${t} = ${a.offsetToIndices(`outputOffset + ${t}u`)}; + let offset${t} = ${n.broadcastedIndicesToOffset(`outputIndices${t}`,a)}; + let index${t} = offset${t} / 4u; + let component${t} = offset${t} % 4u; + ${e}[${t}] = ${r}(${n.getByOffset(`index${t}`)}[component${t}]); + `;c=` + let outputOffset = global_idx * ${s}; + var data = vec4(0); + ${e(`data`,0,`u32`)} + ${e(`data`,1,`u32`)} + ${e(`data`,2,`u32`)} + ${e(`data`,3,`u32`)} + ${a.setByOffset(`global_idx`,`data`)} + }`}else c=` + let outputIndices = ${a.offsetToIndices(`global_idx * ${s}`)}; + let inputOffset = ${n.broadcastedIndicesToOffset(`outputIndices`,a)}; + let data = ${a.type.value}(${n.getByOffset(`inputOffset / ${o}`)}); + ${a.setByOffset(`global_idx`,`data`)} + }`;return` + ${e.registerUniform(`vec_size`,`u32`).declareVariables(n,a)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} + ${c}`},u=[{type:12,data:c},...hN(t,r)];return{name:`Expand`,shaderCache:{hint:`${r.length};${o}${s}`,inputDependencies:[`rank`]},getShaderSource:l,getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:u})}},XL=e=>{KL(e.inputs),e.compute(YL(e.inputs),{inputs:[0]})}}),QL,$L,eR=J(()=>{"use strict";gM(),NM(),DN(),qF(),QL=e=>{let t=e[0].dataType,n=Y.size(e[0].dims),r=Y.size(e[1].dims),i=r%4==0;return{name:`FastGeluWithBias`,shaderCache:{hint:`${i}`,inputDependencies:[`type`,`type`]},getShaderSource:e=>{let n=X(`x`,t,[1],4),r=X(`bias`,t,[1],4),a=SN(`y`,t,[1],4),o=[{name:`output_vec_size`,type:`u32`},{name:`bias_size`,type:`u32`}],s=e=>` + let bias${e}_offset: u32 = (global_idx * 4 + ${e}) % uniforms.bias_size; + let bias${e} = ${r.getByOffset(`bias${e}_offset / 4`)}[bias${e}_offset % 4];`,c=i?` + let bias = ${r.getByOffset(`global_idx % (uniforms.bias_size / 4)`)};`:`${s(0)}${s(1)}${s(2)}${s(3)} + let bias = ${n.type.value}(bias0, bias1, bias2, bias3);`;return`${e.registerUniforms(o).declareVariables(n,r,a)} + + ${zF(mN(t))} + + ${e.mainStart(dN)} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_vec_size`)} + + let x = ${n.getByOffset(`global_idx`)}; + ${c} + let x_in = x + bias; + ${a.setByOffset(`global_idx`,BF(`x_in`))} + }`},getRunData:e=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],programUniforms:[{type:12,data:Math.ceil(n/4)},{type:12,data:r}],dispatchGroup:{x:Math.ceil(n/dN/4)}})}},$L=e=>{e.inputs.length<2||Y.size(e.inputs[1].dims)===0?VF(e):e.compute(QL(e.inputs))}}),tR,nR,rR,iR,aR=J(()=>{"use strict";gM(),NM(),uN(),DN(),tR=e=>{if(!e||e.length!==2)throw Error(`Gather requires 2 inputs.`)},nR=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n.length,a=Y.normalizeAxis(t.axis,i),o=n.slice(0);o.splice(a,1,...r);let s=n[a],c=e[0].dataType===9?4:1,l=Math.ceil(Y.size(o)/c),u=[{type:12,data:l},{type:6,data:s},{type:12,data:a},...hN(e[0].dims,e[1].dims,o)];return{name:`Gather`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:t=>{let n=X(`data`,e[0].dataType,e[0].dims.length,c),s=X(`inputIndices`,e[1].dataType,e[1].dims.length),l=SN(`output`,e[0].dataType,o.length,c),u=e=>{let t=r.length,c=`var indicesIndices${e} = ${s.type.indices}(0);`;for(let n=0;n1?`indicesIndices${e}[${n}]`:`indicesIndices${e}`} = ${o.length>1?`outputIndices${e}[uniforms.axis + ${n}]`:`outputIndices${e}`};`;c+=` + var idx${e} = ${s.getByIndices(`indicesIndices${e}`)}; + if (idx${e} < 0) { + idx${e} = idx${e} + uniforms.axisDimLimit; + } + var dataIndices${e} : ${n.type.indices}; + `;for(let n=0,r=0;n1?`dataIndices${e}[${n}]`:`dataIndices${e}`} = u32(idx${e});`,r+=t):(c+=`${i>1?`dataIndices${e}[${n}]`:`dataIndices${e}`} = ${o.length>1?`outputIndices${e}[${r}]`:`outputIndices${e}`};`,r++);return c},d;if(e[0].dataType===9){let e=(e,t,r=``)=>` + let outputIndices${t} = ${l.offsetToIndices(`outputOffset + ${t}u`)}; + ${u(t)}; + let offset${t} = ${n.indicesToOffset(`dataIndices${t}`)}; + let index${t} = offset${t} / 4u; + let component${t} = offset${t} % 4u; + ${e}[${t}] = ${r}(${n.getByOffset(`index${t}`)}[component${t}]); + `;d=` + let outputOffset = global_idx * ${c}; + var value = vec4(0); + ${e(`value`,0,`u32`)} + ${e(`value`,1,`u32`)} + ${e(`value`,2,`u32`)} + ${e(`value`,3,`u32`)} + ${l.setByOffset(`global_idx`,`value`)} + `}else d=` + let outputIndices = ${l.offsetToIndices(`global_idx`)}; + ${u(``)}; + let value = ${n.getByIndices(`dataIndices`)}; + ${l.setByOffset(`global_idx`,`value`)}; + `;return` + ${t.registerUniform(`outputSize`,`u32`).registerUniform(`axisDimLimit`,`i32`).registerUniform(`axis`,`u32`).declareVariables(n,s,l)} + ${t.mainStart()} + ${t.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + ${d} + }`}}},rR=e=>lN({axis:e.axis}),iR=(e,t)=>{let n=e.inputs;tR(n),e.compute(nR(e.inputs,t))}}),oR,sR,cR,lR=J(()=>{"use strict";gM(),NM(),DN(),oR=(e,t,n,r,i,a,o,s,c)=>{let l=[{type:12,data:a},{type:12,data:r},{type:12,data:i},{type:12,data:n},{type:12,data:o},{type:12,data:s},{type:12,data:c}],u=[a];return l.push(...hN(t.dims,u)),e.compute({name:`computeSliceOffsets`,shaderCache:{hint:`${i.length}_${n.length}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:u,dataType:e.inputs[1].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:l}),getShaderSource:e=>{let r=[X(`indices_data`,t.dataType,t.dims.length),SN(`input_slice_offsets_data`,12,1,1)],a=[{name:`output_size`,type:`u32`},{name:`batch_dims`,type:`u32`},{name:`input_dims`,type:`u32`,length:i.length},{name:`sizes_from_slice_dims_data`,type:`u32`,length:n.length},{name:`num_slices_per_batch`,type:`u32`},{name:`input_batch_stride`,type:`u32`},{name:`num_slice_dims`,type:`u32`}];return` + ${e.registerUniforms(a).declareVariables(...r)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let batch_idx = global_idx / uniforms.num_slices_per_batch; + let base_offset = batch_idx * uniforms.input_batch_stride; + + let slice_indices_base_offset = global_idx * uniforms.num_slice_dims; + var relative_slice_offset = 0; + for (var dim_idx = 0u; dim_idx < uniforms.num_slice_dims; dim_idx ++) { + var index = i32(indices_data[dim_idx + slice_indices_base_offset].x); + let input_dim_idx = uniforms.batch_dims + dim_idx; + if (index < 0) { + ${i.length===1?`index += i32(uniforms.input_dims);`:`index += i32(uniforms.input_dims[input_dim_idx]);`} + } + ${n.length===1?`relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data);`:`relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data[dim_idx]);`} + } + + input_slice_offsets_data[global_idx] = base_offset + u32(relative_slice_offset); + }`}},{inputs:[t],outputs:[-1]})[0]},sR=(e,t)=>{let n=e.inputs,r=n[0].dims,i=n[0].dataType,a=n[1].dims,o=a[a.length-1],s=Y.sizeToDimension(a,a.length-1),c=Y.sizeFromDimension(r,t.batchDims+o),l=Y.sizeToDimension(r,t.batchDims),u=Y.sizeFromDimension(r,t.batchDims),d=s/l,f=Array(o),p=c;for(let e=0;er.length)throw Error(`last dimension of indices must not be larger than rank of input tensor`);let g=a.slice(0,-1).concat(r.slice(h)),_=Y.size(g),v=[{type:12,data:_},{type:12,data:c},...hN(n[0].dims,m.dims,g)];e.compute({name:`GatherND`,shaderCache:{hint:t.cacheKey,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:g,dataType:i}],dispatchGroup:{x:Math.ceil(_/64)},programUniforms:v}),getShaderSource:e=>{let t=X(`data`,n[0].dataType,n[0].dims.length),r=X(`slice_offsets`,12,m.dims.length),i=SN(`output`,n[0].dataType,g.length);return` + ${e.registerUniform(`output_size`,`u32`).registerUniform(`slice_size`,`u32`).declareVariables(t,r,i)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let slice_offset = slice_offsets[global_idx / uniforms.slice_size]; + output[global_idx] = data[u32(slice_offset) + global_idx % uniforms.slice_size]; + }`}},{inputs:[n[0],m]})},cR=e=>({batchDims:e.batch_dims,cacheKey:``})}),uR,dR,fR,pR,mR=J(()=>{"use strict";gM(),NM(),uN(),DN(),uR=(e,t)=>{if(e.length<3||e.length>4)throw Error(`GatherBlockQuantized requires 3 or 4 inputs.`);let n=Y.normalizeAxis(t.quantizeAxis,e[0].dims.length),r=t.blockSize,i=e[0],a=e[2],o=e.length===4?e[3]:void 0;if(a.dims.length!==i.dims.length||!i.dims.map((e,t)=>t===n?Math.ceil(e/r)===a.dims[t]:e===a.dims[t]).reduce((e,t)=>e&&t,!0))throw Error(`Scales must have the same rank as the input tensor and the dims should match except on gatherAxis.`);if(o){if(o.dataType!==i.dataType)throw Error(`Zero point must have the same data type as the input tensor.`);if(o.dims.length!==a.dims.length||!o.dims.map((e,t)=>e===a.dims[t]).reduce((e,t)=>e&&t,!0))throw Error(`Zero point must have the same rank as the input tensor and the dims should match except on quantizeAxis.`)}},dR=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n.length,a=Y.normalizeAxis(t.gatherAxis,i),o=Y.normalizeAxis(t.quantizeAxis,i),s=n.slice(0);s.splice(a,1,...r);let c=Y.size(s),l=e[2].dataType,u=e[0].dataType===22,d=[{type:12,data:c},{type:12,data:o},{type:12,data:a},{type:12,data:t.blockSize},...hN(...e.map((e,t)=>e.dims),s)];return{name:`GatherBlockQuantized`,shaderCache:{hint:`${t.cacheKey};${e.filter((e,t)=>t!==1).map(e=>e.dims.join(`_`)).join(`;`)}`,inputDependencies:Array.from({length:e.length},(e,t)=>`rank`)},getRunData:()=>({outputs:[{dims:s,dataType:l}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:d}),getShaderSource:t=>{let i=X(`data`,e[0].dataType,e[0].dims.length),o=X(`inputIndices`,e[1].dataType,e[1].dims.length),c=X(`scales`,e[2].dataType,e[2].dims.length),d=e.length>3?X(`zeroPoint`,e[3].dataType,e[3].dims.length):void 0,f=SN(`output`,l,s.length),p=[i,o,c];return d&&p.push(d),` + ${t.registerUniforms([{name:`output_size`,type:`u32`},{name:`quantize_axis`,type:`u32`},{name:`gather_axis`,type:`u32`},{name:`block_size`,type:`u32`}]).declareVariables(...p,f)} + ${t.mainStart()} + let output_indices = ${f.offsetToIndices(`global_idx`)}; + var indices_indices = ${o.type.indices}(0); + ${r.length>1?` + for (var i: u32 = 0; i < ${r.length}; i++) { + let index = ${f.indicesGet(`output_indices`,`uniforms.gather_axis + i`)}; + ${o.indicesSet(`indices_indices`,`i`,`index`)}; + }`:`indices_indices = ${f.indicesGet(`output_indices`,`uniforms.gather_axis`)};`}; + var data_indices = ${i.type.indices}(0); + for (var i: u32 = 0; i < uniforms.gather_axis; i++) { + let index = ${f.indicesGet(`output_indices`,`i`)}; + ${i.indicesSet(`data_indices`,`i`,`index`)}; + } + var index_from_indices = ${o.getByIndices(`indices_indices`)}; + if (index_from_indices < 0) { + index_from_indices += ${n[a]}; + } + ${i.indicesSet(`data_indices`,`uniforms.gather_axis`,`u32(index_from_indices)`)}; + for (var i = uniforms.gather_axis + 1; i < ${s.length}; i++) { + let index = ${f.indicesGet(`output_indices`,`i + ${r.length} - 1`)}; + ${i.indicesSet(`data_indices`,`i`,`index`)}; + } + let data_offset = ${i.indicesToOffset(`data_indices`)}; + let data_index = data_offset % 8; + // Convert 4-bit packed data to 8-bit packed data. + let packed_4bit_quantized_data = ${i.getByOffset(`data_offset / 8`)}; + let packed_8bit_quantized_data = (packed_4bit_quantized_data >> (4 * (data_index % 2))) & 0x0f0f0f0f; + let quantized_data_vec = ${u?`unpack4xI8`:`unpack4xU8`}(u32(packed_8bit_quantized_data)); + let quantized_data = quantized_data_vec[data_index / 2]; + var scale_indices = data_indices; + let quantize_axis_index = ${c.indicesGet(`data_indices`,`uniforms.quantize_axis`)} / uniforms.block_size; + ${c.indicesSet(`scale_indices`,`uniforms.quantize_axis`,`quantize_axis_index`)}; + var scale = ${c.getByIndices(`scale_indices`)}; + ${d?` + let zero_point_indices = scale_indices; + let zero_point_offset = ${d.indicesToOffset(`zero_point_indices`)}; + let zero_point_index = zero_point_offset % 8; + let packed_4bit_zero_points = ${d.getByOffset(`zero_point_offset / 8`)}; + let packed_8bit_zero_points = (packed_4bit_zero_points >> (4 * (zero_point_index % 2))) & 0x0f0f0f0f; + let zero_point_vec = ${u?`unpack4xI8`:`unpack4xU8`}(u32(packed_8bit_zero_points)); + let zero_point = zero_point_vec[zero_point_index / 2];`:`var zero_point = 0`}; + let dequantized_data = ${mN(l)}(quantized_data - zero_point) * scale; + ${f.setByOffset(`global_idx`,`dequantized_data`)}; + }`}}},fR=(e,t)=>{let n=e.inputs;uR(n,t),e.compute(dR(e.inputs,t))},pR=e=>lN({blockSize:e.blockSize,gatherAxis:e.gatherAxis,quantizeAxis:e.quantizeAxis})}),hR,gR,_R,vR,yR=J(()=>{"use strict";gM(),NM(),uN(),DN(),hR=e=>{if(!e||e.length!==2)throw Error(`GatherElements requires 2 inputs.`);if(e[0].dims.length<1)throw Error(`GatherElements requires that the data input be rank >= 1.`);if(e[0].dims.length!==e[1].dims.length)throw Error(`GatherElements requires that the data input and + indices input tensors be of same rank.`)},gR=(e,t)=>{let n=e[0].dims,r=e[0].dataType,i=n.length,a=e[1].dims,o=e[1].dataType,s=Y.normalizeAxis(t.axis,i),c=n[s],l=a.slice(0),u=Y.size(l),d=X(`input`,r,i),f=X(`indicesInput`,o,a.length),p=SN(`output`,r,l.length),m=[{type:12,data:u},{type:6,data:c},{type:12,data:s}];return m.push(...hN(n,a,l)),{name:`GatherElements`,shaderCache:{inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:l,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(u/64)},programUniforms:m}),getShaderSource:e=>` + ${e.registerUniform(`outputSize`,`u32`).registerUniform(`axisDimLimit`,`i32`).registerUniform(`axis`,`u32`).declareVariables(d,f,p)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + + let outputIndices = ${p.offsetToIndices(`global_idx`)}; + + var idx = ${f.getByOffset(`global_idx`)}; + if (idx < 0) { + idx = idx + uniforms.axisDimLimit; + } + var inputIndices = ${d.type.indices}(outputIndices); + ${d.indicesSet(`inputIndices`,`uniforms.axis`,`u32(idx)`)}; + let value = ${d.getByIndices(`inputIndices`)}; + + ${p.setByOffset(`global_idx`,`value`)}; + }`}},_R=e=>lN({axis:e.axis}),vR=(e,t)=>{let n=e.inputs;hR(n),e.compute(gR(e.inputs,t))}}),bR,xR,SR,CR,wR=J(()=>{"use strict";gM(),NM(),DN(),bR=e=>{if(!e)throw Error(`Input is missing`);if(e.length<2||e.length>3)throw Error(`Invaid input number.`);if(e.length===3&&e[2].dims.length>2)throw Error(`Invalid input shape of C`);if(e[0].dataType!==e[1].dataType||e.length===3&&e[0].dataType!==e[2].dataType)throw Error(`Input types are mismatched`)},xR=(e,t)=>{let n=e[0].dims.slice(),r=e[1].dims.slice(),[i,a,o]=AM.getShapeOfGemmResult(n,t.transA,r,t.transB,e.length===3?e[2].dims:void 0),s=[i,a];if(!s)throw Error(`Can't use gemm on the given tensors`);let c=Math.ceil(a/16),l=Math.ceil(i/16);Y.size(s);let u=[{type:12,data:c},{type:12,data:i},{type:12,data:a},{type:12,data:o},{type:1,data:t.alpha},{type:1,data:t.beta}],d=[`type`,`type`];return e.length===3&&(u.push(...hN(e[2].dims)),d.push(`rank`)),u.push(...hN(s)),{name:`GemmShared`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:d},getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:c*l},programUniforms:u}),getShaderSource:n=>{let r=X(`a`,e[0].dataType,e[0].dims),i=X(`b`,e[1].dataType,e[1].dims),a=null,o=[r,i];e.length===3&&(a=X(`c`,e[2].dataType,e[2].dims.length),o.push(a));let c=SN(`output`,e[0].dataType,s.length);o.push(c);let l=[{name:`num_tile_n`,type:`u32`},{name:`M`,type:`u32`},{name:`N`,type:`u32`},{name:`K`,type:`u32`},{name:`alpha`,type:`f32`},{name:`beta`,type:`f32`}],u=``,d=``;t.transA&&t.transB?(d=` + var col = tile_row_start + local_id.x; + var row = k_start + local_id.y; + if (col < uniforms.M && row < uniforms.K) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col]; + } else { + tile_a[local_id.y][local_id.x] = ${r.type.value}(0); + } + + col = k_start + local_id.x; + row = tile_col_start + local_id.y; + if (col < uniforms.K && row < uniforms.N) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col]; + } else { + tile_b[local_id.y][local_id.x] = ${i.type.value}(0); + } + `,u=`value += tile_a[k][local_id.y] * tile_b[local_id.x][k];`):t.transA&&!t.transB?(d=` + var col = tile_row_start + local_id.x; + var row = k_start + local_id.y; + if (col < uniforms.M && row < uniforms.K) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col]; + } else { + tile_a[local_id.y][local_id.x] = ${r.type.value}(0); + } + + col = tile_col_start + local_id.x; + row = k_start + local_id.y; + if (col < uniforms.N && row < uniforms.K) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col]; + } else { + tile_b[local_id.y][local_id.x] = ${i.type.value}(0); + } + `,u=`value += tile_a[k][local_id.y] * tile_b[k][local_id.x];`):!t.transA&&t.transB?(d=` + var col = k_start + local_id.x; + var row = tile_row_start + local_id.y; + if (col < uniforms.K && row < uniforms.M) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col]; + } else { + tile_a[local_id.y][local_id.x] = ${r.type.value}(0); + } + + col = k_start + local_id.x; + row = tile_col_start + local_id.y; + if (col < uniforms.K && row < uniforms.N) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col]; + } else { + tile_b[local_id.y][local_id.x] = ${i.type.value}(0); + } + `,u=`value += tile_a[local_id.y][k] * tile_b[local_id.x][k];`):!t.transA&&!t.transB&&(d=` + var col = k_start + local_id.x; + var row = tile_row_start + local_id.y; + if (col < uniforms.K && row < uniforms.M) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col]; + } else { + tile_a[local_id.y][local_id.x] = ${r.type.value}(0); + } + + col = tile_col_start + local_id.x; + row = k_start + local_id.y; + if (col < uniforms.N && row < uniforms.K) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col]; + } else { + tile_b[local_id.y][local_id.x] = ${i.type.value}(0); + } + `,u=`value += tile_a[local_id.y][k] * tile_b[k][local_id.x];`);let f=t.alpha===1?``:`value *= uniforms.alpha;`;return` + ${n.registerUniforms(l).declareVariables(...o)} + var tile_a: array, 16>; + var tile_b: array, 16>; + ${n.mainStart([16,16,1])} + let tile_col_start = (workgroup_index % uniforms.num_tile_n) * 16; + let tile_row_start = (workgroup_index / uniforms.num_tile_n) * 16; + let num_tiles = (uniforms.K - 1) / 16 + 1; + var k_start = 0u; + var value = ${c.type.value}(0); + for (var t: u32 = 0u; t < num_tiles; t++) { + ${d} + k_start = k_start + 16; + workgroupBarrier(); + + for (var k: u32 = 0u; k < 16; k++) { + ${u} + } + workgroupBarrier(); + } + + ${f} + let m = tile_row_start + local_id.y; + let n = tile_col_start + local_id.x; + ${a==null?``:`let cOffset = ${a.broadcastedIndicesToOffset(`vec2(m, n)`,c)}; value += ${c.type.value}(uniforms.beta) * ${a.getByOffset(`cOffset`)};`} + if (m < uniforms.M && n < uniforms.N) { + output[m * uniforms.N + n] = value; + } + }`}}},SR=e=>({transA:e.transA,transB:e.transB,alpha:e.alpha,beta:e.beta,cacheKey:`${e.transA};${e.transB};${e.alpha===1}`}),CR=(e,t)=>{bR(e.inputs),e.compute(xR(e.inputs,t))}}),TR,ER,DR,OR,kR,AR,jR,MR,NR,PR,FR,IR,LR,RR,zR=J(()=>{"use strict";gM(),NM(),uN(),DN(),[TR,ER,DR,OR]=[0,1,2,3],kR=e=>{if(e[0].dims.length!==4)throw Error(`only 4-D tensor is supported.`);if(e[0].dims.length!==e[1].dims.length)throw Error(`input dimensions must be equal to grid dimensions`);if(e[0].dims.length-2!==e[1].dims[e[1].dims.length-1])throw Error(`last dimension of grid must be equal to ${e[0].dims.length-2}`);if(e[0].dims[0]!==e[1].dims[0])throw Error(`grid batch size must match input batch size`)},AR=` + fn gs_get_cubic_coeffs(x: f32) -> vec4 { + let cubic_alpha = -0.75f; + let x_abs = abs(x); + var coeffs: vec4; + coeffs[0] = (((cubic_alpha * (x_abs + 1) - 5 * cubic_alpha) * (x_abs + 1) + 8 * cubic_alpha) * (x_abs + 1) - 4 * cubic_alpha); + coeffs[1] = (((cubic_alpha + 2) * x_abs - (cubic_alpha + 3)) * x_abs * x_abs + 1); + coeffs[2] = (((cubic_alpha + 2) * (1 - x_abs) - (cubic_alpha + 3)) * (1 - x_abs) * (1 - x_abs) + 1); + coeffs[3] = (((cubic_alpha * (2 - x_abs) - 5 * cubic_alpha) * (2 - x_abs) + 8 * cubic_alpha) * (2 - x_abs) - 4 * cubic_alpha); + return coeffs; + } +`,jR=e=>` + fn gs_bicubic_interpolate(p: mat4x4<${e}>, x: f32, y: f32) -> ${e} { + var v: vec4; + var coeffs = gs_get_cubic_coeffs(x); + for (var i = 0; i < 4; i++) { + v[i] = coeffs[0] * p[i][0] + coeffs[1] * p[i][1] + coeffs[2] * p[i][2] + coeffs[3] * p[i][3]; + } + coeffs = gs_get_cubic_coeffs(y); + let pixel = ${e}(coeffs[0] * v[0] + coeffs[1] * v[1] + coeffs[2] * v[2] + coeffs[3] * v[3]); + return pixel; + } +`,MR=e=>` + fn gs_denormalize(n: f32, length: i32) -> f32 { + ${e.alignCorners===0?` + // alignCorners: false => [-1, 1] to [-0.5, length - 0.5] + return ((n + 1.0) * f32(length) - 1.0) / 2.0; + `:` + // alignCorners: true => [-1, 1] to [0, length - 1] + return (n + 1.0) / 2.0 * (f32(length - 1)); + `} + } +`,NR=e=>` + ${e.paddingMode===`reflection`?` + fn gs_reflect(x: i32, x_min: f32, x_max: f32) -> u32 { + var dx = 0.0; + var fx = f32(x); + let range = x_max - x_min; + if (fx < x_min) { + dx = x_min - fx; + let n = u32(dx / range); + let r = dx - f32(n) * range; + if (n % 2 == 0) { + fx = x_min + r; + } else { + fx = x_max - r; + } + } else if (fx > x_max) { + dx = fx - x_max; + let n = u32(dx / range); + let r = dx - f32(n) * range; + if (n % 2 == 0) { + fx = x_max - r; + } else { + fx = x_min + r; + } + } + return u32(fx); + }`:``} +`,PR=(e,t,n)=>` + fn pixel_at_grid(r: i32, c: i32, H: i32, W: i32, batch: u32, channel: u32, border: vec4) -> ${t} { + var pixel = ${t}(0); + var indices = vec4(0); + indices[${TR}] = batch; + indices[${ER}] = channel;`+(()=>{switch(n.paddingMode){case`zeros`:return` + if (r >= 0 && r < H && c >=0 && c < W) { + indices[${DR}] = u32(r); + indices[${OR}] = u32(c); + } else { + return ${t}(0); + } + `;case`border`:return` + indices[${DR}] = u32(clamp(r, 0, H - 1)); + indices[${OR}] = u32(clamp(c, 0, W - 1)); + `;case`reflection`:return` + indices[${DR}] = gs_reflect(r, border[1], border[3]); + indices[${OR}] = gs_reflect(c, border[0], border[2]); + `;default:throw Error(`padding mode ${n.paddingMode} is not supported`)}})()+` + return ${e.getByIndices(`indices`)}; + } +`,FR=(e,t,n)=>(()=>{switch(n.mode){case`nearest`:return` + let result = pixel_at_grid(i32(round(y)), i32(round(x)), H_in, W_in, indices[${TR}], indices[${ER}], border); + `;case`bilinear`:return` + let x1 = i32(floor(x)); + let y1 = i32(floor(y)); + let x2 = x1 + 1; + let y2 = y1 + 1; + + let p11 = pixel_at_grid(y1, x1, H_in, W_in, indices[${TR}], indices[${ER}], border); + let p12 = pixel_at_grid(y1, x2, H_in, W_in, indices[${TR}], indices[${ER}], border); + let p21 = pixel_at_grid(y2, x1, H_in, W_in, indices[${TR}], indices[${ER}], border); + let p22 = pixel_at_grid(y2, x2, H_in, W_in, indices[${TR}], indices[${ER}], border); + + let dx2 = ${t}(f32(x2) - x); + let dx1 = ${t}(x - f32(x1)); + let dy2 = ${t}(f32(y2) - y); + let dy1 = ${t}(y - f32(y1)); + let result = dy2 * (dx2 * p11 + dx1 * p12) + dy1 * (dx2 * p21 + dx1 * p22); + `;case`bicubic`:return` + let x0 = i32(floor(x)) - 1; + let y0 = i32(floor(y)) - 1; + var p: mat4x4<${t}>; + for (var h = 0; h < 4; h++) { + for (var w = 0; w < 4; w++) { + p[h][w] = pixel_at_grid(h + y0, w + x0, H_in, W_in, indices[${TR}], indices[${ER}], border); + } + } + + let dx = x - f32(x0 + 1); + let dy = y - f32(y0 + 1); + let result = gs_bicubic_interpolate(p, dx, dy); + `;default:throw Error(`mode ${n.mode} is not supported`)}})()+`${e.setByOffset(`global_idx`,`result`)}`,IR=(e,t)=>{let n=X(`x`,e[0].dataType,e[0].dims.length),r=[e[1].dims[0],e[1].dims[1],e[1].dims[2]],i=X(`grid`,e[1].dataType,r.length,2),a=[e[0].dims[0],e[0].dims[1],e[1].dims[1],e[1].dims[2]];t.format===`NHWC`&&(a=[e[0].dims[0],e[1].dims[1],e[1].dims[2],e[0].dims[3]],[TR,ER,DR,OR]=[0,3,1,2]);let o=SN(`output`,e[0].dataType,a.length),s=n.type.value,c=[{type:12,data:Y.size(a)},...hN(e[0].dims,r,a)];return{name:`GridSample`,shaderCache:{hint:`${t.cacheKey}`,inputDependencies:[`type`,`type`]},getRunData:e=>{let t=Y.size(a);return{outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(t/64)},programUniforms:c}},getShaderSource:e=>` + ${e.registerUniform(`output_size`,`u32`).declareVariables(n,i,o)} + ${AR} + ${jR(s)} + ${MR(t)} + ${NR(t)} + ${PR(n,s,t)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let H_in = i32(uniforms.x_shape[${DR}]); + let W_in = i32(uniforms.x_shape[${OR}]); + + ${t.alignCorners===0?` + let x_min = -0.5; + let x_max = f32(W_in) - 0.5; + let y_min = -0.5; + let y_max = f32(H_in) - 0.5; + `:` + let x_min = 0.0; + let x_max = f32(W_in) - 1.0; + let y_min = 0.0; + let y_max = f32(H_in) - 1.0; + `}; + let border = vec4(x_min, y_min, x_max, y_max); + + let indices = ${o.offsetToIndices(`global_idx`)}; + var grid_indices = vec3(indices[${TR}], indices[${DR}], indices[${OR}]); + let nxy = ${i.getByIndices(`grid_indices`)}; + var x = gs_denormalize(f32(nxy[0]), W_in); + var y = gs_denormalize(f32(nxy[1]), H_in); + + ${FR(o,s,t)} + }`}},LR=(e,t)=>{kR(e.inputs),e.compute(IR(e.inputs,t))},RR=e=>lN({alignCorners:e.align_corners,mode:e.mode,paddingMode:e.padding_mode,format:e.format})}),BR,VR,HR,UR,WR,GR,KR,qR=J(()=>{"use strict";gM(),NM(),uN(),ZM(),KP(),DN(),LN(),BR=(e,t)=>e.length>t&&e[t].dims.length>0?e[t]:void 0,VR=(e,t)=>{let n=e[0],r=BR(e,1),i=BR(e,2),a=BR(e,3),o=BR(e,4),s=BR(e,5),c=BR(e,6),l=BR(e,7);if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input query is expected to have 3 or 5 dimensions`);let u=n.dims[0],d=n.dims[1],f=n.dims.length===3?n.dims[2]:t.numHeads*n.dims[4],p=d,m=0,h=0,g=Math.floor(f/t.numHeads);if(c&&l&&Y.size(c.dims)&&Y.size(l.dims)){if(c.dims.length!==4)throw Error(`Input "past_key" is expected to have 4 dimensions`);if(c.dims[0]!==u||c.dims[1]!==t.numHeads||c.dims[3]!==g)throw Error(`Input "past_key" shape (batch_size, num_heads, past_sequence_length, head_size)`);if(l.dims[0]!==u||l.dims[1]!==t.numHeads||l.dims[3]!==g)throw Error(`Input "past_value" shape (batch_size, num_heads, past_sequence_length, head_size)`);if(c.dims[2]!==l.dims[2])throw Error(`Input "past_key" and "past_value" shall have same dim 2 (past_sequence_length)`);if(l.dims.length!==4)throw Error(`Input "past_value" is expected to have 4 dimensions`);m=c.dims[2],h=c.dims[2]}else if(c&&Y.size(c.dims)||l&&Y.size(l.dims))throw Error(`Input "past_key" and "past_value" shall be both present or both absent`);let _;if(r&&Y.size(r.dims)>0){if(n.dims.length!==3)throw Error(`Input "query" is expected to have 3 dimensions when key is given`);if(r.dims.length<3||r.dims.length>5)throw Error(`Input "key" is expected to have 3, 4, or 5 dimensions`);if(n.dims[0]!==r.dims[0])throw Error(`Input "query" and "key" shall have same dim 0 (batch size)`);if(r.dims.length===3){if(r.dims[2]!==n.dims[2])throw Error(`Input "query" and "key" shall have same dim 2 (hidden_size)`);_=2,p=r.dims[1]}else if(r.dims.length===5){if(r.dims[2]!==t.numHeads||r.dims[3]!==2||r.dims[4]!==g)throw Error(`Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv`);if(i)throw Error(`Expect "value" be none when "key" has packed kv format.`);_=5,p=r.dims[1]}else{if(r.dims[1]!==t.numHeads||r.dims[3]!==g)throw Error(`Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key`);_=0,p=r.dims[2]}}else{if(n.dims.length!==5)throw Error(`Input "query" is expected to have 5 dimensions when key is empty`);if(n.dims[2]!==t.numHeads||n.dims[3]!==3)throw Error(`Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv`);_=3}if(a&&Y.size(a.dims)>0){if(a.dims.length!==1)throw Error(`Input "bias" is expected to have 1 dimension`);if(r&&r.dims.length===5&&r.dims[3]===2)throw Error(`bias is not allowed for packed kv.`)}let v=m+p,y=0;if(o&&Y.size(o.dims)>0){y=8;let e=o.dims;throw e.length===1?e[0]===u?y=1:e[0]===3*u+2&&(y=3):e.length===2&&e[0]===u&&e[1]===v&&(y=5),Error(y===8?`Input "key_padding_mask" shape shall be (batch_size) or (batch_size, total_sequence_length)`:`Mask not supported`)}let b=!1,x=f;if(i&&Y.size(i.dims)>0){if(i.dims.length!==3&&i.dims.length!==4)throw Error(`Input "value" is expected to have 3 or 4 dimensions`);if(n.dims[0]!==i.dims[0])throw Error(`Input "query" and "value" shall have same dim 0 (batch_size)`);if(i.dims.length===3){if(p!==i.dims[1])throw Error(`Input "key" and "value" shall have the same dim 1 (kv_sequence_length)`);x=i.dims[2]}else{if(p!==i.dims[2])throw Error(`Input "key" and "value" shall have the same dim 2 (kv_sequence_length)`);x=i.dims[1]*i.dims[3],b=!0}}if(o&&Y.size(o.dims)>0)throw Error(`Key padding mask is not supported`);if(s&&Y.size(s.dims)>0){if(s.dims.length!==4)throw Error(`Input "attention_bias" is expected to have 4 dimensions`);if(s.dims[0]!==u||s.dims[1]!==t.numHeads||s.dims[2]!==d||s.dims[3]!==v)throw Error(`Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)`)}return{batchSize:u,sequenceLength:d,pastSequenceLength:m,kvSequenceLength:p,totalSequenceLength:v,maxSequenceLength:h,inputHiddenSize:0,hiddenSize:f,vHiddenSize:x,headSize:g,vHeadSize:Math.floor(x/t.numHeads),numHeads:t.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:t.maskFilterValue,maskType:y,scale:t.scale,broadcastResPosBias:!1,passPastInKv:b,qkvFormat:_}},HR=e=>lN({...e}),UR=lN({perm:[0,2,1,3]}),WR=(e,t,n,r,i,a,o)=>{let s=[r,i,a],c=Y.size(s),l=[{type:12,data:c},{type:12,data:o},{type:12,data:a}];return e.compute({name:`MultiHeadAttentionAddBias`,shaderCache:{inputDependencies:[`type`,`type`]},getRunData:()=>({outputs:[{dims:s,dataType:t.dataType,gpuDataType:0}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:l}),getShaderSource:e=>{let r=SN(`qkv_with_bias`,t.dataType,s),i=X(`qkv`,t.dataType,s),a=X(`bias`,n.dataType,s);return` + ${e.registerUniforms([{name:`output_size`,type:`u32`},{name:`bias_offset`,type:`u32`},{name:`hidden_size`,type:`u32`}]).declareVariables(i,a,r)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let bias_offset_idx = (global_idx % uniforms.hidden_size) + uniforms.bias_offset; + + qkv_with_bias[global_idx] = qkv[global_idx] + bias[bias_offset_idx]; + }`}},{inputs:[t,n],outputs:[-1]})[0]},GR=(e,t,n,r,i,a,o,s)=>{let c=a;if(o&&Y.size(o.dims)>0){if(r===1)throw Error(`AddBiasReshape is not implemented. Please export your model with packed QKV or KV`);return c=WR(e,a,o,t,r,n*i,s),c=c.reshape([t,r,n,i]),n===1||r===1?c:e.compute(PN(c,UR.perm),{inputs:[c],outputs:[-1]})[0]}else return a.dims.length===3&&(c=a.reshape([t,r,n,i])),n===1||r===1?c:e.compute(PN(c,UR.perm),{inputs:[c],outputs:[-1]})[0]},KR=(e,t)=>{let n=VR(e.inputs,t),r=e.inputs[0],i=BR(e.inputs,1),a=BR(e.inputs,2),o=BR(e.inputs,3),s=BR(e.inputs,4),c=BR(e.inputs,5),l=BR(e.inputs,6),u=BR(e.inputs,7);if(r.dims.length===5)throw Error(`Packed QKV is not implemented`);if(i?.dims.length===5)throw Error(`Packed KV is not implemented`);let d=i&&a&&i.dims.length===4&&a.dims.length===4,f=GR(e,n.batchSize,n.numHeads,n.sequenceLength,n.headSize,r,o,0);if(d)return UP(e,f,i,a,s,void 0,l,u,c,n);if(!i||!a)throw Error(`key and value must be provided`);let p=GR(e,n.batchSize,n.numHeads,n.kvSequenceLength,n.headSize,i,o,n.hiddenSize),m=GR(e,n.batchSize,n.numHeads,n.kvSequenceLength,n.vHeadSize,a,o,2*n.hiddenSize);UP(e,f,p,m,s,void 0,l,u,c,n)}}),JR,YR,XR,ZR,QR,$R,ez,tz=J(()=>{"use strict";gM(),NM(),uN(),DN(),JR=e=>{if(!e||e.length<1)throw Error(`too few inputs`)},YR=(e,t)=>{let n=[],r=t.numOutputs;return e[1].dims[0]>0&&(e[1].getBigInt64Array().forEach(e=>n.push(Number(e))),r=n.length),lN({numOutputs:r,axis:t.axis,splitSizes:n})},XR=e=>` +fn calculateOutputIndex(index: u32) -> u32 { + for (var i: u32 = 0u; i < ${e}u; i += 1u ) { + if (index < ${bN(`uniforms.size_in_split_axis`,`i`,e)}) { + return i; + } + } + return ${e}u; +}`,ZR=e=>{let t=e.length,n=[];for(let r=0;r{let n=e[0].dims,r=Y.size(n),i=e[0].dataType,a=Y.normalizeAxis(t.axis,n.length),o=Array(t.numOutputs),s=X(`input`,i,n.length),c=Array(t.numOutputs),l=[],u=[],d=0,f=[{type:12,data:r}];for(let r=0;r` + ${e.registerUniform(`input_size`,`u32`).registerUniform(`size_in_split_axis`,`u32`,c.length).declareVariables(s,...o)} + ${XR(c.length)} + ${ZR(o)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.input_size`)} + + var indices = ${s.offsetToIndices(`global_idx`)}; + var index = ${s.indicesGet(`indices`,a)}; + let output_number = calculateOutputIndex(index); + if (output_number != 0) { + index -= ${bN(`uniforms.size_in_split_axis`,`output_number - 1u`,c.length)}; + ${s.indicesSet(`indices`,a,`index`)}; + } + writeBufferData(output_number, indices, global_idx); + }`,getRunData:()=>({outputs:l,dispatchGroup:{x:Math.ceil(r/64)},programUniforms:f})}},$R=(e,t)=>{JR(e.inputs);let n=e.inputs.length===1?t:YR(e.inputs,t);e.compute(QR(e.inputs,n),{inputs:[0]})},ez=e=>{let t=e.axis,n=e.splitSizes,r=e.numOutputs<0?n.length:e.numOutputs;if(r!==n.length)throw Error(`numOutputs and splitSizes lengh must be equal`);return lN({axis:t,numOutputs:r,splitSizes:n})}}),nz,rz,iz,az=J(()=>{"use strict";gM(),NM(),uN(),DN(),nz=(e,t)=>{let[n,r,i,a]=e,{numHeads:o,rotaryEmbeddingDim:s}=t;if(n.dims.length!==3&&n.dims.length!==4)throw Error(`Input 'x' is expected to have 3 or 4 dimensions, got ${n.dims.length}`);if(!Y.areEqual(r.dims,[])&&!Y.areEqual(r.dims,[1])&&r.dims.length!==2)throw Error(`Input 'position_ids' is expected to have 0, 1, or 2 dimensions, got ${r.dims.length}`);if(i.dims.length!==2)throw Error(`Input 'cos_cache' is expected to have 2 dimensions, got ${i.dims.length}`);if(a.dims.length!==2)throw Error(`Input 'sin_cache' is expected to have 2 dimensions, got ${a.dims.length}`);if(!Y.areEqual(i.dims,a.dims))throw Error(`Inputs 'cos_cache' and 'sin_cache' are expected to have the same shape`);if(s>0&&o===0)throw Error(`num_heads must be provided if rotary_embedding_dim is specified`);let c=n.dims[0],l=n.dims[n.dims.length-2],u=i.dims[0],d=Y.sizeFromDimension(n.dims,1)/l,f=s===0?i.dims[1]*2:d/o;if(s>f)throw Error(`rotary_embedding_dim must be less than or equal to head_size`);if(r.dims.length===2){if(c!==r.dims[0])throw Error(`Input 'position_ids' dimension 0 should be of size batch_size, got ${r.dims[0]}`);if(l!==r.dims[1])throw Error(`Input 'position_ids' dimension 1 should be of size sequence_length, got ${r.dims[1]}`)}if(f/2!==i.dims[1]&&s/2!==i.dims[1])throw Error(`Input 'cos_cache' dimension 1 should be same as head_size / 2 or rotary_embedding_dim / 2, got ${i.dims[1]}`);if(l>u)throw Error(`Updating cos_cache and sin_cache in RotaryEmbedding is not currently supported`)},rz=(e,t)=>{let{interleaved:n,numHeads:r,rotaryEmbeddingDim:i,scale:a}=t,o=e[0].dims[0],s=Y.sizeFromDimension(e[0].dims,1),c=e[0].dims[e[0].dims.length-2],l=s/c,u=e[2].dims[1],d=i===0?u*2:l/r,f=[o,c,l/d,d-u],p=Y.computeStrides(f),m=[{type:1,data:a},{type:12,data:f},{type:12,data:p},...e[0].dims.length===3?Array({type:12,data:[s,l,d,1]}):[],...e[0].dims.length===4?Array({type:12,data:[s,d,c*d,1]}):[],...hN(e[0].dims,e[1].dims,e[2].dims,e[3].dims,e[0].dims)];return{name:`RotaryEmbedding`,shaderCache:{hint:lN({interleaved:n}).cacheKey,inputDependencies:[`rank`,`rank`,`rank`,`rank`]},getShaderSource:t=>{let r=X(`input`,e[0].dataType,e[0].dims.length),i=X(`position_ids`,e[1].dataType,e[1].dims.length),a=X(`cos_cache`,e[2].dataType,e[2].dims.length),o=X(`sin_cache`,e[3].dataType,e[3].dims.length),s=SN(`output`,e[0].dataType,e[0].dims.length);return t.registerUniforms([{name:`scale`,type:`f32`},{name:`global_shape`,type:`u32`,length:f.length},{name:`global_strides`,type:`u32`,length:p.length},{name:`input_output_strides`,type:`u32`,length:p.length}]),` + ${t.declareVariables(r,i,a,o,s)} + + ${t.mainStart(dN)} + let half_rotary_emb_dim = uniforms.${a.name}_shape[1]; + let bsnh = global_idx / uniforms.global_strides % uniforms.global_shape; + let size = uniforms.global_shape[0] * uniforms.global_strides[0]; + ${t.guardAgainstOutOfBoundsWorkgroupSizes(`size`)} + + if (bsnh[3] < half_rotary_emb_dim) { + let position_ids_idx = + ${i.broadcastedIndicesToOffset(`bsnh.xy`,SN(``,i.type.tensor,2))}; + let position_id = + u32(${i.getByOffset(`position_ids_idx`)}) + select(0, bsnh[1], position_ids_idx == 0); + let i = dot(bsnh, uniforms.input_output_strides) + select(0, bsnh[3], ${n}); + let j = i + select(half_rotary_emb_dim, 1, ${n}); + let re = ${r.getByOffset(`i`)} * ${a.get(`position_id`,`bsnh[3]`)} - + ${r.getByOffset(`j`)} * ${o.get(`position_id`,`bsnh[3]`)}; + ${s.setByOffset(`i`,`re`)} + let im = ${r.getByOffset(`i`)} * ${o.get(`position_id`,`bsnh[3]`)} + + ${r.getByOffset(`j`)} * ${a.get(`position_id`,`bsnh[3]`)}; + ${s.setByOffset(`j`,`im`)} + } else { + let k = dot(bsnh, uniforms.input_output_strides) + half_rotary_emb_dim; + ${s.setByOffset(`k`,r.getByOffset(`k`))} + } + }`},getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(Y.size(f)/dN)},programUniforms:m})}},iz=(e,t)=>{nz(e.inputs,t),e.compute(rz(e.inputs,t))}}),oz,sz,cz,lz,uz,dz=J(()=>{"use strict";uN(),gM(),KP(),qR(),tz(),LN(),az(),DN(),oz=(e,t)=>{if(t.doRotary&&e.length<=7)throw Error(`cos_cache and sin_cache inputs are required if do_rotary is specified`);let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4];if(t.doRotary!==0&&e.length<=7)throw Error(`cos_cast and sin_cache are expected if do_rotary attribute is non-zero`);if(t.localWindowSize!==-1)throw Error(`Local attention is not supported`);if(t.softcap!==0)throw Error(`Softcap is not supported`);if(t.rotaryInterleaved!==0)throw Error(`Rotary interleaved is not supported`);if(t.smoothSoftmax)throw Error(`Smooth softmax is not supported`);if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input query is expected to have 3 or 5 dimensions`);let s=n.dims[0],c=n.dims[1],l=n.dims.length===3?n.dims[2]:t.numHeads*n.dims[4],u=c,d=0,f=!r||r.dims.length===0,p=Math.floor(f?l/(t.numHeads+2*t.kvNumHeads):l/t.numHeads);f&&(l=p*t.numHeads);let m=a&&a.dims.length!==0,h=o&&o.dims.length!==0;if(m&&a.dims.length===4&&a.dims[0]===s&&a.dims[1]!==t.kvNumHeads&&a.dims[2]===t.kvNumHeads&&a.dims[3]===p)throw Error(`BSNH pastKey/pastValue is not supported`);if(m&&h){if(a.dims.length!==4)throw Error(`Input "past_key" is expected to have 4 dimensions`);if(o.dims.length!==4)throw Error(`Input "past_value" is expected to have 4 dimensions`);d=a.dims[2]}else if(m||h)throw Error(`Input "past_key" and "past_value" shall be both present or both absent`);let g=1;if(r&&r.dims.length>0){if(n.dims.length!==3)throw Error(`Input "query" is expected to have 3 dimensions when key is given`);if(r.dims.length<3||r.dims.length>5)throw Error(`Input "key" is expected to have 3, 4, or 5 dimensions`);if(n.dims[0]!==r.dims[0])throw Error(`Input "query" and "key" shall have same dim 0 (batch size)`);if(r.dims.length===3){if(n.dims[2]%r.dims[2]!==0)throw Error(`Dimension 2 of "query" should be a multiple of "key"`);u=r.dims[1]}else if(r.dims.length===5){if(r.dims[2]!==t.numHeads||r.dims[3]!==2||r.dims[4]!==p)throw Error(`Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv`);if(i)throw Error(`Expect "value" be none when "key" has packed kv format.`);u=r.dims[1]}else{if(r.dims[1]!==t.numHeads||r.dims[3]!==p)throw Error(`Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key`);u=r.dims[2]}}else{if(n.dims.length!==3&&n.dims.length!==5)throw Error(`Input "query" is expected to have 3 or 5 dimensions when key is empty`);if(n.dims.length===5&&(n.dims[2]!==t.numHeads||n.dims[3]!==3))throw Error(`Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv`);g=3}let _=!1,v=t.kvNumHeads?p*t.kvNumHeads:l;if(i&&i.dims.length>0){if(i.dims.length!==3&&i.dims.length!==4)throw Error(`Input "value" is expected to have 3 or 4 dimensions`);if(n.dims[0]!==i.dims[0])throw Error(`Input "query" and "value" shall have same dim 0 (batch_size)`);if(i.dims.length===3){if(u!==i.dims[1])throw Error(`Input "key" and "value" shall have the same dim 1 (kv_sequence_length)`);v=i.dims[2]}else{if(u!==i.dims[2])throw Error(`Input "past_key" and "past_value" shall have the same dim 2 (kv_sequence_length)`);v=i.dims[1]*i.dims[3],_=!0}}let y=e.length>4?e[5]:void 0;if(y&&y.dims.length!==1&&y.dims[0]!==s)throw Error(`Input "seqlens" is expected to have 1 dimension and the same dim 0 as batch_size`);return{batchSize:s,sequenceLength:c,pastSequenceLength:d,kvSequenceLength:u,totalSequenceLength:-1,maxSequenceLength:-1,inputHiddenSize:0,hiddenSize:l,vHiddenSize:v,headSize:p,vHeadSize:Math.floor(v/t.kvNumHeads),numHeads:t.numHeads,kvNumHeads:t.kvNumHeads,nReps:t.numHeads/t.kvNumHeads,pastPresentShareBuffer:!1,maskType:0,scale:t.scale,broadcastResPosBias:!1,passPastInKv:_,qkvFormat:g}},sz=lN({perm:[0,2,1,3]}),cz=(e,t,n)=>{let r=t,i=n.kvNumHeads;return t.dims.length===3&&n.kvSequenceLength!==0&&(r=t.reshape([n.batchSize,n.kvSequenceLength,i,n.headSize]),r=e.compute(PN(r,sz.perm),{inputs:[r],outputs:[-1]})[0]),r},lz=(e,t,n,r)=>{let i=[`type`,`type`],a=[e*t],o=e*t,s=[{type:12,data:o},{type:12,data:t},{type:12,data:e}];return{name:`GeneratePositionIds`,shaderCache:{hint:`${e};${t}`,inputDependencies:i},getRunData:()=>({outputs:[{dims:a,dataType:7}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:s}),getShaderSource:e=>{let t=X(`seq_lens`,n.dataType,n.dims),i=X(`total_seq_lens`,r.dataType,r.dims),o=SN(`pos_ids`,7,a);return` + ${e.registerUniforms([{name:`output_size`,type:`u32`},{name:`sequence_length`,type:`u32`},{name:`batch_size`,type:`u32`}]).declareVariables(t,i,o)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let total_sequence_length = u32(${i.getByOffset(`0`)}); + let is_subsequent_prompt = uniforms.sequence_length > 1 && uniforms.sequence_length != total_sequence_length; + let is_first_prompt = !is_subsequent_prompt && uniforms.sequence_length == total_sequence_length; + let batch_idx = global_idx / uniforms.sequence_length; + let sequence_idx = i32(global_idx % uniforms.sequence_length); + var pos_id: i32 = 0; + let seqlen = ${t.getByOffset(`batch_idx`)}; + let total_seqlen = seqlen + 1; + if (is_first_prompt) { + if (sequence_idx < total_seqlen) { + pos_id = sequence_idx; + } else { + pos_id = 1; + } + ${o.setByOffset(`global_idx`,`pos_id`)} + } else if (is_subsequent_prompt) { + let past_seqlen = total_seqlen - i32(uniforms.sequence_length); + if (past_seqlen + sequence_idx < total_seqlen) { + pos_id = past_seqlen + sequence_idx; + } else { + pos_id = 1; + } + ${o.setByOffset(`global_idx`,`pos_id`)} + } else if (global_idx < uniforms.batch_size) { + ${o.setByOffset(`global_idx`,`seqlen`)} + }; + } + `}}},uz=(e,t)=>{let n=oz(e.inputs,t);if(e.inputs[0].dims.length===5)throw Error(`Packed QKV is not implemented`);if(e.inputs[1]?.dims.length===5)throw Error(`Packed KV is not implemented`);let r=e.inputs[0],i=e.inputs[1]&&e.inputs[1].dims.length>0?e.inputs[1]:void 0,a=e.inputs[2]&&e.inputs[2].dims.length>0?e.inputs[2]:void 0,o=e.inputs[3]&&e.inputs[3].dims.length!==0?e.inputs[3]:void 0,s=e.inputs[4]&&e.inputs[4].dims.length!==0?e.inputs[4]:void 0,c=e.inputs.length>4?e.inputs[5]:void 0,l=e.inputs.length>5?e.inputs[6]:void 0,u=n.kvNumHeads?n.kvNumHeads:n.numHeads,d=lN({axis:2,numOutputs:3,splitSizes:[n.numHeads*n.headSize,u*n.headSize,u*n.headSize]}),[f,p,m]=!i&&!a?e.compute(QR([r],d),{inputs:[r],outputs:[-1,-1,-1]}):[r,i,a],h,g;if(t.doRotary){let r=e.compute(lz(n.batchSize,n.sequenceLength,c,l),{inputs:[c,l],outputs:[-1]})[0],i=e.inputs[7],a=e.inputs[8],o=lN({interleaved:t.rotaryInterleaved!==0,numHeads:n.numHeads,rotaryEmbeddingDim:0,scale:t.scale}),s=[f,r,i,a],u=[-1];h=e.compute(rz(s,o),{inputs:s,outputs:u})[0],s.splice(0,1,p);let d=lN({interleaved:t.rotaryInterleaved!==0,numHeads:n.kvNumHeads,rotaryEmbeddingDim:0,scale:t.scale});g=e.compute(rz(s,d),{inputs:s,outputs:u})[0]}let _=GR(e,n.batchSize,n.numHeads,n.sequenceLength,n.headSize,t.doRotary?h:f,void 0,0),v=cz(e,t.doRotary?g:p,n),y=cz(e,m,n);UP(e,_,v,y,void 0,void 0,o,s,void 0,n,c,l)}}),fz,pz,mz,hz,gz=J(()=>{"use strict";gM(),NM(),LN(),DN(),fz=(e,t,n,r,i,a,o,s)=>{let c=gN(a),l=c===1?`f32`:`vec${c}f`,u=c===1?`vec2f`:`mat2x${c}f`,d=i*o,f=64;d===1&&(f=256);let p=[i,o,a/c],m=[i,o,2],h=[`rank`,`type`,`type`],g=[];return g.push(...hN(p,m)),e.compute({name:`InstanceNormComputeChannelScaleShift`,shaderCache:{hint:`${c};${s};${f}`,inputDependencies:h},getRunData:()=>({outputs:[{dims:m,dataType:1}],dispatchGroup:{x:d},programUniforms:g}),getShaderSource:e=>{let i=X(`x`,t.dataType,3,c),a=[i,X(`scale`,n.dataType,n.dims),X(`bias`,r.dataType,r.dims),SN(`output`,1,3,2)];return` + var workgroup_shared : array<${u}, ${f}>; + const workgroup_size = ${f}u; + ${e.declareVariables(...a)} + ${e.mainStart(f)} + let batch = workgroup_index / uniforms.x_shape[1]; + let channel = workgroup_index % uniforms.x_shape[1]; + let hight = uniforms.x_shape[2]; + // initialize workgroup memory + var sum = ${l}(0); + var squared_sum = ${l}(0); + for (var h = local_idx; h < hight; h += workgroup_size) { + let value = ${l}(${i.get(`batch`,`channel`,`h`)}); + sum += value; + squared_sum += value * value; + } + workgroup_shared[local_idx] = ${u}(sum, squared_sum); + workgroupBarrier(); + + for (var currSize = workgroup_size >> 1; currSize > 0; currSize = currSize >> 1) { + if (local_idx < currSize) { + workgroup_shared[local_idx] = workgroup_shared[local_idx] + workgroup_shared[local_idx + currSize]; + } + workgroupBarrier(); + } + if (local_idx == 0) { + let sum_final = ${yN(`workgroup_shared[0][0]`,c)} / f32(hight * ${c}); + let squared_sum_final = ${yN(`workgroup_shared[0][1]`,c)} / f32(hight * ${c}); + + let inv_std_dev = inverseSqrt(squared_sum_final - sum_final * sum_final + f32(${s})); + let channel_scale = inv_std_dev * f32(scale[channel]); + let channel_shift = f32(bias[channel]) - sum_final * channel_scale; + output[workgroup_index] = vec2f(channel_scale, channel_shift); + } + }`}},{inputs:[t,n,r],outputs:[-1]})[0]},pz=(e,t,n)=>{let r=t[0].dims,i=r,a=r[0],o=r[1],s=Y.sizeFromDimension(r,2),c=gN(s),l=Y.size(i)/c,u=fz(e,t[0],t[1],t[2],a,s,o,n.epsilon),d=[a,o,s/c],f=[a,o];e.compute({name:`InstanceNormalization`,shaderCache:{hint:`${c}`,inputDependencies:[`type`,`none`]},getRunData:()=>({outputs:[{dims:i,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:[{type:12,data:l},...hN(d,f,d)]}),getShaderSource:e=>{let n=X(`x`,t[0].dataType,d.length,c),r=X(`scale_shift`,1,f.length,2),i=SN(`output`,t[0].dataType,d.length,c),a=[n,r,i];return` + ${e.registerUniform(`output_size`,`u32`).declareVariables(...a)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let outputIndices = ${i.offsetToIndices(`global_idx`)}; + let batch = outputIndices[0]; + let channel = outputIndices[1]; + let scale_shift = ${r.getByIndices(`vec2(batch, channel)`)}; + let value = ${n.getByOffset(`global_idx`)} * ${i.type.value}(scale_shift.x) + ${i.type.value}(scale_shift.y); + ${i.setByOffset(`global_idx`,`value`)}; + }`}},{inputs:[t[0],u]})},mz=(e,t,n)=>{let r=t[0].dims,i=r,a=r[0],o=r[r.length-1],s=Y.sizeFromDimension(r,1)/o,c=gN(o),l=Y.size(i)/c,u=[{type:12,data:s},{type:12,data:Math.floor(o/c)}],d=[`type`,`type`],f=!1,p=[0,r.length-1];for(let e=0;er[p[t]])),h=fz(e,m,t[1],t[2],a,s,o,n.epsilon);e.compute({name:`InstanceNormalizationNHWC`,shaderCache:{hint:`${c}`,inputDependencies:d},getRunData:()=>({outputs:[{dims:i,dataType:t[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:e=>{let n=pN(t[0].dataType),r=c===1?`vec2f`:`mat${c}x2f`,a=e=>{let t=e===0?`x`:`y`,r=c===1?`f32`:`vec${c}f`;switch(c){case 1:return`${n}(${r}(scale.${t}))`;case 2:return`vec2<${n}>(${r}(scale[0].${t}, scale[1].${t}))`;case 4:return`vec4<${n}>(${r}(scale[0].${t}, scale[1].${t}, scale[2].${t}, scale[3].${t}))`;default:throw Error(`Not supported compoents ${c}`)}},o=X(`input`,t[0].dataType,t[0].dims,c),s=SN(`output`,t[0].dataType,i,c);return` + @group(0) @binding(0) var input : array<${o.type.storage}>; + @group(0) @binding(1) var scale_input : array<${r}>; + @group(0) @binding(2) var output : array<${s.type.storage}>; + struct Uniforms {H: u32, C : u32}; + @group(0) @binding(3) var uniforms: Uniforms; + + ${e.mainStart()} + let current_image_number = global_idx / (uniforms.C * uniforms.H); + let current_channel_number = global_idx % uniforms.C; + + let scale_offset = current_image_number * uniforms.C + current_channel_number; + let scale = scale_input[scale_offset]; + output[global_idx] = fma(input[global_idx], ${a(0)}, ${a(1)}); + }`}},{inputs:[t[0],h]})},hz=(e,t)=>{t.format===`NHWC`?mz(e,e.inputs,t):pz(e,e.inputs,t)}}),_z,vz,yz,bz=J(()=>{"use strict";gM(),NM(),DN(),_z=e=>{if(!e||e.length<2)throw Error(`layerNorm requires at least 2 inputs.`)},vz=(e,t,n)=>{let r=t.simplified,i=e[0].dims,a=e[1],o=!r&&e[2],s=i,c=Y.normalizeAxis(t.axis,i.length),l=Y.sizeToDimension(i,c),u=Y.sizeFromDimension(i,c),d=Y.size(a.dims),f=o?Y.size(o.dims):0;if(d!==u||o&&f!==u)throw Error(`Size of X.shape()[axis:] == ${u}. + Size of scale and bias (if provided) must match this. + Got scale size of ${d} and bias size of ${f}`);let p=[];for(let e=0;e1,v=n>2,y=t=>{let n=pN(e[0].dataType),i=[X(`x`,e[0].dataType,e[0].dims,m),X(`scale`,a.dataType,a.dims,m)];return o&&i.push(X(`bias`,o.dataType,o.dims,m)),i.push(SN(`output`,e[0].dataType,s,m)),_&&i.push(SN(`mean_data_output`,1,p)),v&&i.push(SN(`inv_std_output`,1,p)),` + ${t.registerUniforms([{name:`norm_count`,type:`u32`},{name:`norm_size`,type:`f32`},{name:`norm_size_vectorized`,type:`u32`},{name:`epsilon`,type:`f32`}]).declareVariables(...i)} + ${t.mainStart()} + ${t.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.norm_count`)} + let offset = global_idx * uniforms.norm_size_vectorized; + var mean_vector = ${_N(`f32`,m)}; + var mean_square_vector = ${_N(`f32`,m)}; + + for (var h: u32 = 0u; h < uniforms.norm_size_vectorized; h++) { + let value = ${vN(n,m,`x[h + offset]`)}; + mean_vector += value; + mean_square_vector += value * value; + } + let mean = ${yN(`mean_vector`,m)} / uniforms.norm_size; + let inv_std_dev = inverseSqrt(${yN(`mean_square_vector`,m)} / uniforms.norm_size ${r?``:`- mean * mean`} + uniforms.epsilon); + + for (var j: u32 = 0; j < uniforms.norm_size_vectorized; j++) { + let f32input = ${vN(n,m,`x[j + offset]`)}; + let f32scale = ${vN(n,m,`scale[j]`)}; + output[j + offset] = ${i[0].type.value}((f32input ${r?``:`- mean`}) * inv_std_dev * f32scale + ${o?`+ ${vN(n,m,`bias[j]`)}`:``} + ); + } + + ${_?`mean_data_output[global_idx] = mean`:``}; + ${v?`inv_std_output[global_idx] = inv_std_dev`:``}; + }`},b=[{dims:s,dataType:e[0].dataType}];return _&&b.push({dims:p,dataType:1}),v&&b.push({dims:p,dataType:1}),{name:`LayerNormalization`,shaderCache:{hint:`${m};${n};${r}`,inputDependencies:h},getRunData:()=>({outputs:b,dispatchGroup:{x:Math.ceil(l/64)},programUniforms:g}),getShaderSource:y}},yz=(e,t)=>{_z(e.inputs),e.compute(vz(e.inputs,t,e.outputCount))}}),xz,Sz,Cz=J(()=>{"use strict";NM(),jI(),BI(),xz=e=>{if(!e||e.length!==2)throw Error(`MatMul requires 2 inputs.`);if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw Error(`shared dimension does not match.`)},Sz=e=>{xz(e.inputs);let t=OM.calcShape(e.inputs[0].dims,e.inputs[1].dims,!0);if(!t)throw Error(`Can't use matmul on the given tensors`);let n=t[t.length-1],r=e.inputs[0].dims[e.inputs[0].dims.length-1];if(n<8&&r<8)e.compute(AI(e.inputs,{activation:``},t));else{let i=t[t.length-2],a=Y.size(e.inputs[0].dims.slice(0,-2)),o=Y.size(e.inputs[1].dims.slice(0,-2));if(a!==1&&i===1&&o===1){let i=e.inputs[0].reshape([1,a,r]),o=e.inputs[1].reshape([1,r,n]),s=[1,a,n],c=[i,o];e.compute(zI(c,{activation:``},t,s),{inputs:c})}else e.compute(zI(e.inputs,{activation:``},t))}}}),wz,Tz,Ez,Dz,Oz,kz=J(()=>{"use strict";gM(),NM(),uN(),DN(),wz=(e,t)=>{if(e.length<3||e.length>4)throw Error(`MatMulNBits requires 3 or 4 inputs`);let n=e[0],r=n.dims.length;if(n.dims[r-1]!==t.k)throw Error(`The last dim of input shape does not match the k value`);let i=Math.floor((t.k+t.blockSize-1)/t.blockSize),a=t.blockSize/8*t.bits,o=e[1];if(!Y.areEqual(o.dims,[t.n,i,a]))throw Error(`The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize`);let s=e[2].dims;if(Y.size(s)!==t.n*i)throw Error(`scales input size error.`);if(e.length===4){let n=e[3].dims,r=t.bits>4?t.n*i:t.n*Math.floor((i+1)/2);if(Y.size(n)!==r)throw Error(`zeroPoints input size error.`)}},Tz=(e,t)=>{let n=e[0].dims,r=n.length,i=n[r-2],a=t.k,o=t.n,s=n.slice(0,r-2),c=Y.size(s),l=e[1].dims[2]/4,u=e[0].dataType,d=gN(t.k),f=gN(l),p=gN(o),m=s.concat([i,o]),h=i>1&&o/p%2==0?2:1,g=Y.size(m)/p/h,_=[],v=[c,i,a/d],y=Y.convertShape(e[1].dims).slice();y.splice(-1,1,l/f),_.push(...hN(v)),_.push(...hN(y)),_.push(...hN(e[2].dims)),e.length===4&&_.push(...hN(Y.convertShape(e[3].dims)));let b=[c,i,o/p];return _.push(...hN(b)),{name:`MatMulNBits`,shaderCache:{hint:`${t.blockSize};${t.bits};${d};${f};${p};${h};64`,inputDependencies:Array(e.length).fill(`rank`)},getRunData:()=>({outputs:[{dims:m,dataType:u}],dispatchGroup:{x:g},programUniforms:_}),getShaderSource:n=>{let r=v.length,i=X(`a`,e[0].dataType,r,d),a=X(`b`,12,y.length,f),o=X(`scales`,e[2].dataType,e[2].dims.length),s=[i,a,o],c=e.length===4?X(`zero_points`,12,e[3].dims.length):void 0;c&&s.push(c);let u=b.length,m=SN(`output`,e[0].dataType,u,p),g=pN(e[0].dataType),_=(()=>{switch(d){case 1:return`array<${g}, 8>`;case 2:return`mat4x2<${g}>`;case 4:return`mat2x4<${g}>`;default:throw Error(`${d}-component is not supported.`)}})(),x=()=>{let e=` + // reuse a data + var input_offset = ${i.indicesToOffset(`${i.type.indices}(batch, row, word_offset)`)}; + var a_data: ${_}; + for (var j: u32 = 0; j < ${8/d}; j++) { + a_data[j] = ${i.getByOffset(`input_offset`)}; + input_offset++; + } + `;for(let t=0;t> 4) & b_mask); + b_quantized_values = ${_}(${Array.from({length:4},(e,t)=>`${g}(b_value_lower[${t}]), ${g}(b_value_upper[${t}])`).join(`, `)}); + b_dequantized_values = ${d===1?`${_}(${Array.from({length:8},(e,n)=>`(b_quantized_values[${n}] - ${c?`zero_point${t}`:`zero_point`}) * scale${t}`).join(`, `)});`:`(b_quantized_values - ${_}(${Array(8).fill(`${c?`zero_point${t}`:`zero_point`}`).join(`,`)})) * scale${t};`}; + workgroup_shared[local_id.x * ${h} + ${Math.floor(t/p)}]${p>1?`[${t%p}]`:``} += ${Array.from({length:8/d},(e,t)=>`${d===1?`a_data[${t}] * b_dequantized_values[${t}]`:`dot(a_data[${t}], b_dequantized_values[${t}])`}`).join(` + `)}; + `;return e},S=()=>{let e=` + var col_index = col * ${p}; + ${c?` + let zero_point_bytes_per_col = (nBlocksPerCol + 1) / 2; + var zero_point_byte_count: u32; + var zero_point_word_index: u32; + var zero_point_byte_offset: u32; + let zero_point_nibble_offset: u32 = block & 0x1u; + var zero_point_bits_offset: u32; + var zero_point_word: u32;`:` + // The default zero point is 8 for unsigned 4-bit quantization. + let zero_point = ${g}(8);`} + `;for(let t=0;t> 0x1u); + zero_point_word_index = zero_point_byte_count >> 0x2u; + zero_point_byte_offset = zero_point_byte_count & 0x3u; + zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2); + zero_point_word = ${c.getByOffset(`zero_point_word_index`)} >> zero_point_bits_offset; + let zero_point${t} = ${g}((zero_point_word) & 0xFu);`:``} + col_index += 1;`;return e},C=()=>{let e=`col_index = col * ${p};`;for(let t=0;t; + var b_value_upper: vec4; + var b_quantized_values: ${_}; + var b_dequantized_values: ${_};`,e};return` + var workgroup_shared: array<${m.type.value}, ${h*64}>; + ${n.declareVariables(...s,m)} + ${n.mainStart([64,1,1])} + let output_indices = ${m.offsetToIndices(`(global_idx / 64) * ${h}`)}; + let col = output_indices[2]; + let row = output_indices[1]; + let batch = output_indices[0]; + let nBlocksPerCol = uniforms.b_shape[1]; + + for (var block = local_id.x; block < nBlocksPerCol; block += 64) { + //process one block + var word_offset: u32 = block * ${t.blockSize/d}; + ${S()} + for (var word: u32 = 0; word < ${l}; word += ${f}) { + ${C()} + for (var i: u32 = 0; i < ${f}; i++) { + ${x()} + word_offset += ${8/d}; + } + } + } + workgroupBarrier(); + + if (local_id.x < ${h}) { + var output_value: ${m.type.value} = ${m.type.value}(0); + var workgroup_shared_offset: u32 = local_id.x; + for (var b: u32 = 0u; b < 64u; b++) { + output_value += workgroup_shared[workgroup_shared_offset]; + workgroup_shared_offset += ${h}; + } + ${m.setByIndices(`${m.type.indices}(batch, row, col + local_id.x)`,`output_value`)}; + } + }`}}},Ez=(e,t)=>{let n=e[0].dims,r=n.length,i=n[r-2],a=t.k,o=t.n,s=n.slice(0,r-2),c=Y.size(s),l=e[1].dims[2]/4,u=e[0].dataType,d=gN(t.k),f=gN(l),p=s.concat([i,o]),m=o%8==0?8:o%4==0?4:1,h=128/m,g=h*f*8,_=g/d,v=g/t.blockSize,y=Y.size(p)/m,b=[],x=[c,i,a/d],S=Y.convertShape(e[1].dims).slice();S.splice(-1,1,l/f),b.push(...hN(x)),b.push(...hN(S)),b.push(...hN(e[2].dims)),e.length===4&&b.push(...hN(Y.convertShape(e[3].dims)));let C=[c,i,o];return b.push(...hN(C)),{name:`BlockwiseMatMulNBits32`,shaderCache:{hint:`${t.blockSize};${d};${f};${h};${m}`,inputDependencies:Array(e.length).fill(`rank`)},getRunData:()=>({outputs:[{dims:p,dataType:u}],dispatchGroup:{x:y},programUniforms:b}),getShaderSource:n=>{let r=x.length,i=X(`a`,e[0].dataType,r,d),a=X(`b`,12,S.length,f),o=X(`scales`,e[2].dataType,e[2].dims.length),s=[i,a,o],c=e.length===4?X(`zero_points`,12,e[3].dims.length):void 0;c&&s.push(c);let l=C.length,u=SN(`output`,e[0].dataType,l),p=pN(e[0].dataType),g=()=>{switch(d){case 1:return` + let a_data0 = vec4<${p}>(sub_a[word_offset], sub_a[word_offset + 1], sub_a[word_offset + 2], sub_a[word_offset + 3]); + let a_data1 = vec4<${p}>(sub_a[word_offset + 4], sub_a[word_offset + 5], sub_a[word_offset + 6], sub_a[word_offset + 7]);`;case 2:return` + let a_data0 = vec4<${p}>(sub_a[word_offset], sub_a[word_offset + 1]); + let a_data1 = vec4<${p}>(sub_a[word_offset + 2], sub_a[word_offset + 3]);`;case 4:return` + let a_data0 = sub_a[word_offset]; + let a_data1 = sub_a[word_offset + 1];`;default:throw Error(`${d}-component is not supported.`)}};return` + var sub_a: array<${i.type.value}, ${_}>; + var inter_results: array, ${m}>; + ${n.declareVariables(...s,u)} + ${n.mainStart([h,m,1])} + let output_indices = ${u.offsetToIndices(`workgroup_index * ${m}`)}; + let col = output_indices[2]; + let row = output_indices[1]; + let batch = output_indices[0]; + let n_blocks_per_col = uniforms.b_shape[1]; + let num_tiles = (n_blocks_per_col - 1) / ${v} + 1; + + // Loop over shared dimension. + for (var tile: u32 = 0; tile < num_tiles; tile += 1) { + let a_col_start = tile * ${_}; + // load one tile A data into shared memory. + for (var a_offset = local_idx; a_offset < ${_}; a_offset += 128) + { + let a_col = a_col_start + a_offset; + if (a_col < uniforms.a_shape[2]) + { + sub_a[a_offset] = ${i.getByIndices(`${i.type.indices}(batch, row, a_col)`)}; + } else { + sub_a[a_offset] = ${i.type.value}(0); + } + } + workgroupBarrier(); + + // each thread process one block + let b_row = col + local_id.y; + let block = tile * ${v} + local_id.x; + ${c?` + let zero_point_bytes_per_col = (n_blocks_per_col + 1) / 2; + let zero_point_byte_count = b_row * zero_point_bytes_per_col + (block >> 0x1u); + let zero_point_word_index = zero_point_byte_count >> 0x2u; + let zero_point_byte_offset = zero_point_byte_count & 0x3u; + let zero_point_nibble_offset: u32 = block & 0x1u; + let zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2); + let zero_point_word = ${c.getByOffset(`zero_point_word_index`)} >> zero_point_bits_offset; + let zero_point = ${p}((zero_point_word) & 0xFu);`:` + // The default zero point is 8 for unsigned 4-bit quantization. + let zero_point = ${p}(8);`} + let scale = ${o.getByOffset(`b_row * n_blocks_per_col + block`)}; + let b_data = ${a.getByIndices(`${a.type.indices}(b_row, block, 0)`)}; + var word_offset = local_id.x * ${t.blockSize/d}; + for (var i: u32 = 0; i < ${f}; i++) { + ${g()} + let b_value = ${f===1?`b_data`:`b_data[i]`}; + let b_value_lower = unpack4xU8(b_value & 0x0F0F0F0Fu); + let b_value_upper = unpack4xU8((b_value >> 4) & 0x0F0F0F0Fu); + let b_quantized_values = mat2x4<${p}>(${Array.from({length:4},(e,t)=>`${p}(b_value_lower[${t}]), ${p}(b_value_upper[${t}])`).join(`, `)}); + let b_dequantized_values = (b_quantized_values - mat2x4<${p}>(${Array(8).fill(`zero_point`).join(`,`)})) * scale; + inter_results[local_id.y][local_id.x] += ${Array.from({length:2},(e,t)=>`${`dot(a_data${t}, b_dequantized_values[${t}])`}`).join(` + `)}; + word_offset += ${8/d}; + } + workgroupBarrier(); + } + + if (local_idx < ${m}) { + var output_value: ${u.type.value} = ${u.type.value}(0); + for (var b = 0u; b < ${h}; b++) { + output_value += inter_results[local_idx][b]; + } + if (col + local_idx < uniforms.output_shape[2]) + { + ${u.setByIndices(`${u.type.indices}(batch, row, col + local_idx)`,`output_value`)} + } + } + }`}}},Dz=(e,t)=>{wz(e.inputs,t),t.blockSize===32&&e.adapterInfo.isVendor(`intel`)&&e.adapterInfo.isArchitecture(`gen-12lp`)?e.compute(Ez(e.inputs,t)):e.compute(Tz(e.inputs,t))},Oz=e=>lN(e)}),Az,jz,Mz,Nz,Pz,Fz,Iz,Lz,Rz,zz=J(()=>{"use strict";gM(),NM(),DN(),Az=e=>{if(!e||e.length<1)throw Error(`Too few inputs`);if(e[0].dataType!==1&&e[0].dataType!==10)throw Error(`Input type must be float or float16.`);if(e.length>=2){let t=e[0].dims.length*2===e[1].dims[0];if(e.length===4&&(t=e[3].dims[0]*2===e[1].dims[0]),!t)throw Error(`The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].`)}},jz=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${bN(`uniforms.pads`,i,n)}; + if (k < 0) { + break; + } + if (k >= i32(${bN(`uniforms.x_shape`,i,t)})) { + break; + } + offset += k * i32(${bN(`uniforms.x_strides`,i,t)}); + `;return` + value = ${e.type.value}(uniforms.constant_value); + for (var i = 0; i < 1; i++) { + var offset = 0; + var k = 0; + ${r} + value = x[offset]; + } + `},Mz=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${bN(`uniforms.pads`,i,n)}; + if (k < 0) { + k = -k; + } + { + let _2n_1 = 2 * (i32(${bN(`uniforms.x_shape`,i,t)}) - 1); + k = k % _2n_1; + if(k >= i32(${bN(`uniforms.x_shape`,i,t)})) { + k = _2n_1 - k; + } + } + offset += k * i32(${bN(`uniforms.x_strides`,i,t)}); + `;return` + var offset = 0; + var k = 0; + ${r} + value = x[offset]; + `},Nz=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${bN(`uniforms.pads`,i,n)}; + if (k < 0) { + k = 0; + } + if (k >= i32(${bN(`uniforms.x_shape`,i,t)})) { + k = i32(${bN(`uniforms.x_shape`,i,t)}) - 1; + } + offset += k * i32(${bN(`uniforms.x_strides`,i,t)}); + `;return` + var offset = 0; + var k = 0; + ${r} + value = x[offset]; + `},Pz=(e,t,n)=>{let r=``;for(let i=t-1;i>=0;--i)r+=` + k = i32(${e.indicesGet(`indices`,i)}) - ${bN(`uniforms.pads`,i,n)}; + if (k < 0) { + k += i32(${bN(`uniforms.x_shape`,i,t)}]); + } + if (k >= i32(${bN(`uniforms.x_shape`,i,t)})) { + k -= i32(${bN(`uniforms.x_shape`,i,t)}); + } + offset += k * i32(${bN(`uniforms.x_strides`,i,t)}); + `;return` + var offset = 0; + var k = 0; + ${r} + value = x[offset]; + `},Fz=(e,t,n)=>{switch(n.mode){case 0:return jz(e,t,n.pads.length);case 1:return Mz(e,t,n.pads.length);case 2:return Nz(e,t,n.pads.length);case 3:return Pz(e,t,n.pads.length);default:throw Error(`Invalid mode`)}},Iz=(e,t)=>{let n=Y.padShape(e[0].dims.slice(),t.pads),r=e[0].dims,i=[{type:12,data:Y.size(n)},{type:6,data:t.pads}],a=e.length>=3&&e[2].data;return t.mode===0&&i.push({type:a?e[2].dataType:1,data:t.value}),i.push(...hN(e[0].dims,n)),{name:`Pad`,shaderCache:{hint:`${t.mode}${a}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:n,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(Y.size(n)/64)},programUniforms:i}),getShaderSource:i=>{let o=SN(`output`,e[0].dataType,n.length),s=X(`x`,e[0].dataType,r.length),c=s.type.value,l=Fz(o,r.length,t),u=[{name:`output_size`,type:`u32`},{name:`pads`,type:`i32`,length:t.pads.length}];return t.mode===0&&u.push({name:`constant_value`,type:a?c:`f32`}),` + ${i.registerUniforms(u).declareVariables(s,o)} + ${i.mainStart()} + ${i.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + + let indices = ${o.offsetToIndices(`global_idx`)}; + + var value = ${c}(0); + ${l} + output[global_idx] = value; + }`}}},Lz=(e,t)=>{if(e.length>1){let n=e[1].getBigInt64Array(),r=e.length>=3&&e[2].data?e[2].dataType===10?e[2].getUint16Array()[0]:e[2].getFloat32Array()[0]:0,i=e[0].dims.length,a=new Int32Array(2*i).fill(0);if(e.length>=4){let t=e[3].getBigInt64Array();for(let e=0;ea[Number(t)]=Number(e));let o=[];return a.forEach(e=>o.push(e)),{mode:t.mode,value:r,pads:o}}else return t},Rz=(e,t)=>{Az(e.inputs);let n=Lz(e.inputs,t);e.compute(Iz(e.inputs,n),{inputs:[0]})}}),Bz,Vz,Hz,Uz,Wz,Gz,Kz,qz,Jz,Yz,Xz,Zz,Qz,$z,eB,tB,nB,rB,iB,aB=J(()=>{"use strict";dj(),gM(),NM(),DN(),Bz=e=>{if(DA.webgpu.validateInputContent&&(!e||e.length!==1))throw Error(`Pool ops requires 1 input.`)},Vz=(e,t,n)=>{let r=t.format===`NHWC`,i=e.dims.slice();r&&i.splice(1,0,i.pop());let a=Object.hasOwnProperty.call(t,`dilations`),o=t.kernelShape.slice(),s=t.strides.slice(),c=a?t.dilations.slice():[],l=t.pads.slice();kM.adjustPoolAttributes(n,i,o,s,c,l);let u=kM.computePoolOutputShape(n,i,s,c,o,l,t.autoPad),d=Object.assign({},t);a?Object.assign(d,{kernelShape:o,strides:s,pads:l,dilations:c,cacheKey:t.cacheKey}):Object.assign(d,{kernelShape:o,strides:s,pads:l,cacheKey:t.cacheKey});let f=u.slice();return f.push(f.splice(1,1)[0]),[d,r?f:u]},Hz=(e,t)=>{let n=t.format===`NHWC`,r=Y.size(e),i=Y.size(t.kernelShape),a=[{type:12,data:r},{type:12,data:i}],o=[{name:`outputSize`,type:`u32`},{name:`kernelSize`,type:`u32`}];if(t.kernelShape.length<=2){let e=t.kernelShape[t.kernelShape.length-1],n=t.strides[t.strides.length-1],r=t.pads[t.pads.length/2-1],i=t.pads[t.pads.length-1],s=!!(r+i);a.push({type:12,data:e},{type:12,data:n},{type:12,data:r},{type:12,data:i}),o.push({name:`kw`,type:`u32`},{name:`sw`,type:`u32`},{name:`pwStart`,type:`u32`},{name:`pwEnd`,type:`u32`});let c=!1;if(t.kernelShape.length===2){let e=t.kernelShape[t.kernelShape.length-2],n=t.strides[t.strides.length-2],r=t.pads[t.pads.length/2-2],i=t.pads[t.pads.length-2];c=!!(r+i),a.push({type:12,data:e},{type:12,data:n},{type:12,data:r},{type:12,data:i}),o.push({name:`kh`,type:`u32`},{name:`sh`,type:`u32`},{name:`phStart`,type:`u32`},{name:`phEnd`,type:`u32`})}return[a,o,!0,s,c]}else{if(n)throw Error(`Pooling with kernelShape.length > 2 is not supported for NHWC format.`);let e=Y.computeStrides(t.kernelShape);return a.push({type:12,data:e},{type:12,data:t.pads},{type:12,data:t.strides}),o.push({name:`kernelStrides`,type:`u32`,length:e.length},{name:`pads`,type:`u32`,length:t.pads.length},{name:`strides`,type:`u32`,length:t.strides.length}),[a,o,!!t.pads.reduce((e,t)=>e+t),!1,!1]}},Uz=(e,t,n,r,i,a,o,s,c,l,u,d)=>{let f=i.format===`NHWC`,p=t.type.value,m=SN(`output`,t.type.tensor,r);if(i.kernelShape.length<=2){let r=``,l=``,h=``,g=n-(f?2:1);if(r=u?` + for (var i: u32 = 0u; i < uniforms.kw; i++) { + xIndices[${g}] = indices[${g}] * uniforms.sw - uniforms.pwStart + i; + if (xIndices[${g}] < 0 || xIndices[${g}] + >= uniforms.x_shape[${g}]) { + pad++; + continue; + } + let x_val = x[${t.indicesToOffset(`xIndices`)}]; + ${a} + }`:` + for (var i: u32 = 0u; i < uniforms.kw; i++) { + xIndices[${g}] = indices[${g}] * uniforms.sw - uniforms.pwStart + i; + let x_val = x[${t.indicesToOffset(`xIndices`)}]; + ${a} + }`,i.kernelShape.length===2){let e=n-(f?3:2);l=d?` + for (var j: u32 = 0u; j < uniforms.kh; j++) { + xIndices[${e}] = indices[${e}] * uniforms.sh - uniforms.phStart + j; + if (xIndices[${e}] < 0 || xIndices[${e}] >= uniforms.x_shape[${e}]) { + pad += i32(uniforms.kw); + continue; + } + `:` + for (var j: u32 = 0u; j < uniforms.kh; j++) { + xIndices[${e}] = indices[${e}] * uniforms.sh - uniforms.phStart + j; + `,h=` + } + `}return` + ${e.registerUniforms(c).declareVariables(t,m)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + + let indices = ${m.offsetToIndices(`global_idx`)}; + var xIndices = ${m.offsetToIndices(`global_idx`)}; + + var value = ${p}(${s}); + var pad = 0; + ${l} + ${r} + ${h} + ${o} + + output[global_idx] = value; + }`}else{if(f)throw Error(`Pooling with kernelShape.length > 2 is not supported for NHWC format.`);let r=i.kernelShape.length,u=i.pads.length,d=``;return d=l?` + if (xIndices[j] >= uniforms.x_shape[j]) { + pad++; + isPad = true; + break; + } + } + if (!isPad) { + let x_val = x[${t.indicesToOffset(`xIndices`)}]; + ${a} + }`:` + } + let x_val = x[${t.indicesToOffset(`xIndices`)}]; + ${a} + `,` + ${e.registerUniforms(c).declareVariables(t,m)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + let indices = ${m.offsetToIndices(`global_idx`)}; + var xIndices = ${m.offsetToIndices(`global_idx`)}; + + var offsets: array; + + var value = ${p}(${s}); + var pad = 0; + var isPad = false; + + for (var i: u32 = 0u; i < uniforms.kernelSize; i++) { + var offset = i; + for (var j = 0u; j < ${r-1}u; j++) { + offsets[j] = offset / ${bN(`uniforms.kernelStrides`,`j`,r)}; + offset -= offsets[j] * ${bN(`uniforms.kernelStrides`,`j`,r)}; + } + offsets[${r-1}] = offset; + + isPad = false; + for (var j = ${n-r}u; j < ${n}u; j++) { + xIndices[j] = indices[j] * ${bN(`uniforms.strides`,`j - ${n-r}u`,r)} + + offsets[j - ${n-r}u] - ${bN(`uniforms.pads`,`j - 2u`,u)}; + ${d} + } + ${o} + + output[global_idx] = value; + }`}},Wz=e=>`${e.format};${e.ceilMode};${e.autoPad};${e.kernelShape.length}`,Gz=e=>`${Wz(e)};${e.countIncludePad}`,Kz=e=>`${Wz(e)};${e.storageOrder};${e.dilations}`,qz=e=>({format:e.format,autoPad:[`NOTSET`,`VALID`,`SAME_UPPER`,`SAME_LOWER`][e.auto_pad],ceilMode:e.ceil_mode,kernelShape:e.kernel_shape,strides:e.strides,pads:e.pads}),Jz=(e,t,n,r)=>{let[i,a]=Vz(t,r,n),o=X(`x`,t.dataType,t.dims.length),s=o.type.value,c=``;i.countIncludePad?c+=`value /= ${s}(uniforms.kernelSize);`:c+=`value /= ${s}(i32(uniforms.kernelSize) - pad);`;let[l,u,d,f,p]=Hz(a,i);return l.push(...hN(t.dims,a)),{name:e,shaderCache:{hint:`${r.cacheKey};${d};${f};${p}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(Y.size(a)/64)},programUniforms:l}),getShaderSource:e=>Uz(e,o,t.dims.length,a.length,i,`value += x_val;`,c,0,u,d,f,p)}},Yz=e=>{let t=e.count_include_pad!==0,n=qz(e);if(n.ceilMode!==0)throw Error(`using ceil() in shape computation is not yet supported for AveragePool`);let r={countIncludePad:t,...n,cacheKey:``};return{...r,cacheKey:Gz(r)}},Xz=(e,t)=>{Bz(e.inputs),e.compute(Jz(`AveragePool`,e.inputs[0],!1,t))},Zz={autoPad:``,ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[]},Qz=e=>{let t=e.format;return{format:t,...Zz,cacheKey:t}},$z=(e,t)=>{Bz(e.inputs),e.compute(Jz(`GlobalAveragePool`,e.inputs[0],!0,t))},eB=(e,t,n,r)=>{let[i,a]=Vz(t,r,n),o=X(`x`,t.dataType,t.dims.length),s=[`rank`],[c,l,u,d,f]=Hz(a,i);return c.push(...hN(t.dims,a)),{name:e,shaderCache:{hint:`${r.cacheKey};${u};${d};${f}`,inputDependencies:s},getRunData:()=>({outputs:[{dims:a,dataType:t.dataType}],dispatchGroup:{x:Math.ceil(Y.size(a)/64)},programUniforms:c}),getShaderSource:e=>Uz(e,o,t.dims.length,a.length,i,` + value = max(x_val, value); + `,``,t.dataType===10?-65504:-1e5,l,u,d,f)}},tB=(e,t)=>{Bz(e.inputs),e.compute(eB(`MaxPool`,e.inputs[0],!1,t))},nB=e=>{let t=e.storage_order,n=e.dilations,r=qz(e);if(t!==0)throw Error(`column major storage order is not yet supported for MaxPool`);if(r.ceilMode!==0)throw Error(`using ceil() in shape computation is not yet supported for MaxPool`);let i={storageOrder:t,dilations:n,...r,cacheKey:``};return{...i,cacheKey:Kz(i)}},rB=e=>{let t=e.format;return{format:t,...Zz,cacheKey:t}},iB=(e,t)=>{Bz(e.inputs),e.compute(eB(`GlobalMaxPool`,e.inputs[0],!0,t))}}),oB,sB,cB,lB,uB=J(()=>{"use strict";gM(),NM(),uN(),DN(),oB=(e,t)=>{if(e.length<2||e.length>3)throw Error(`DequantizeLinear requires 2 or 3 inputs.`);if(e.length===3&&e[1].dims===e[2].dims)throw Error(`x-scale and x-zero-point must have the same shape.`);if(e.length===3&&e[0].dataType!==e[2].dataType)throw Error(`x and x-zero-point must have the same data type.`);if(e[0].dataType===6&&e.length>2)throw Error(`In the case of dequantizing int32 there is no zero point.`);if(e[1].dims.length!==0&&e[1].dims.length!==1&&e[1].dims.length!==e[0].dims.length)throw Error(`scale input must be a scalar, a 1D tensor, or have the same rank as the input tensor.`);if(e.length>2){if(e[0].dataType!==e[2].dataType)throw Error(`x and x-zero-point must have the same data type.`);if(e[1].dims.length!==e[2].dims.length)throw Error(`scale and zero-point inputs must have the same rank.`);if(!e[1].dims.map((t,n)=>t===e[2].dims[n]).reduce((e,t)=>e&&t,!0))throw Error(`scale and zero-point inputs must have the same shape.`)}if(t.blockSize>0){if(e[1].dims.length===0||e[1].dims.length===1&&e[1].dims[0]===1)throw Error(`blockSize must be set only for block quantization.`);if(!e[1].dims.map((n,r)=>r===t.axis||n===e[0].dims[r]).reduce((e,t)=>e&&t,!0))throw Error(`For block qunatization, scale input shape to match the input shape except for the axis`);if(e[1].dims.length!==e[0].dims.length)throw Error(`For block qunatization the scale input rank must be the same as the x rank.`);let n=e[0].dims[t.axis],r=e[1].dims[t.axis];if(t.blockSizeMath.ceil(n/(r-1)-1))throw Error(`blockSize must be with in the range [ceil(dI / Si), ceil(dI / (Si - 1) - 1)].`)}},sB=(e,t)=>{let n=Y.normalizeAxis(t.axis,e[0].dims.length),r=e[0].dataType,i=r===3,a=e[0].dims,o=e[1].dataType,s=Y.size(a),c=r===3||r===2,l=c?[Math.ceil(Y.size(e[0].dims)/4)]:e[0].dims,u=e[1].dims,d=e.length>2?e[2]:void 0,f=d?c?[Math.ceil(Y.size(d.dims)/4)]:d.dims:void 0,p=u.length===0||u.length===1&&u[0]===1,m=p===!1&&u.length===1,h=gN(s),g=p&&(!c||h===4),_=g?h:1,v=g&&!c?h:1,y=X(`input`,c?12:r,l.length,v),b=X(`scale`,o,u.length),x=d?X(`zero_point`,c?12:r,f.length):void 0,S=SN(`output`,o,a.length,_),C=[y,b];x&&C.push(x);let w=[l,u];d&&w.push(f);let T=[{type:12,data:s/_},{type:12,data:n},{type:12,data:t.blockSize},...hN(...w,a)];return{name:`DequantizeLinear`,shaderCache:{hint:t.cacheKey,inputDependencies:x?[`rank`,`rank`,`rank`]:[`rank`,`rank`]},getShaderSource:e=>` + ${e.registerUniforms([{name:`output_size`,type:`u32`},{name:`axis`,type:`u32`},{name:`block_size`,type:`u32`}]).declareVariables(...C,S)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let output_indices = ${S.offsetToIndices(`global_idx`)}; + + // Set input x + ${c?` + let input = ${y.getByOffset(`global_idx / 4`)}; + let x_vec = ${i?`unpack4xI8(input)`:`unpack4xU8(input)`}; + let x_value = ${_===1?`x_vec[global_idx % 4]`:`x_vec`};`:`let x_value = ${y.getByOffset(`global_idx`)};`}; + + // Set scale input + ${p?`let scale_value= ${b.getByOffset(`0`)}`:m?` + let scale_index = ${S.indicesGet(`output_indices`,`uniforms.axis`)}; + let scale_value= ${b.getByOffset(`scale_index`)};`:` + var scale_indices: ${b.type.indices} = output_indices; + let index = ${b.indicesGet(`scale_indices`,`uniforms.axis`)} / uniforms.block_size; + ${b.indicesSet(`scale_indices`,`uniforms.axis`,`index`)}; + let scale_value= ${b.getByIndices(`scale_indices`)};`}; + + // Set zero-point input + ${x?p?c?` + let zero_point_input = ${x.getByOffset(`0`)}; + let zero_point_vec = ${i?`unpack4xI8(zero_point_input)`:`unpack4xU8(zero_point_input)`}; + let zero_point_value= zero_point_vec[0]`:`let zero_point_value = ${x.getByOffset(`0`)}`:m?c?` + let zero_point_index = ${S.indicesGet(`output_indices`,`uniforms.axis`)}; + let zero_point_input = ${x.getByOffset(`zero_point_index / 4`)}; + let zero_point_vec = ${i?`unpack4xI8(zero_point_input)`:`unpack4xU8(zero_point_input)`}; + let zero_point_value = zero_point_vec[zero_point_index % 4]`:` + let zero_point_index = ${S.indicesGet(`output_indices`,`uniforms.axis`)}; + let zero_point_value = ${x.getByOffset(`zero_point_index`)};`:c?` + let zero_point_offset = ${b.indicesToOffset(`scale_indices`)}; + let zero_point_input = ${x.getByOffset(`zero_point_offset / 4`)}; + let zero_point_vec = ${i?`unpack4xI8(zero_point_input)`:`unpack4xU8(zero_point_input)`}; + let zero_point_value = zero_point_vec[zero_point_offset % 4];`:`let zero_point_value = ${x.getByIndices(`scale_indices`)};`:`let zero_point_value = ${c?i?`i32`:`u32`:y.type.value}(0);`}; + // Compute and write output + ${S.setByOffset(`global_idx`,`${S.type.value}(x_value - zero_point_value) * scale_value`)}; + }`,getRunData:()=>({outputs:[{dims:a,dataType:o}],dispatchGroup:{x:Math.ceil(s/_/64),y:1,z:1},programUniforms:T})}},cB=(e,t)=>{oB(e.inputs,t),e.compute(sB(e.inputs,t))},lB=e=>lN({axis:e.axis,blockSize:e.blockSize})}),dB,fB,pB,mB=J(()=>{"use strict";dj(),gM(),DN(),dB=(e,t,n)=>{if(e===t||et&&n>0)throw Error(`Range these inputs' contents are invalid.`)},fB=(e,t,n,r)=>{let i=Math.abs(Math.ceil((t-e)/n)),a=[i],o=i,s=[{type:12,data:o},{type:r,data:e},{type:r,data:n},...hN(a)];return{name:`Range`,shaderCache:{hint:`${r}`},getShaderSource:e=>{let t=SN(`output`,r,a.length),n=t.type.value,i=[{name:`outputSize`,type:`u32`},{name:`start`,type:n},{name:`delta`,type:n}];return` + ${e.registerUniforms(i).declareVariables(t)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + output[global_idx] = uniforms.start + ${n}(global_idx) * uniforms.delta; + }`},getRunData:()=>({outputs:[{dims:a,dataType:r}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:s})}},pB=e=>{let t=0,n=0,r=0;e.inputs[0].dataType===6?(t=e.inputs[0].getInt32Array()[0],n=e.inputs[1].getInt32Array()[0],r=e.inputs[2].getInt32Array()[0]):e.inputs[0].dataType===1&&(t=e.inputs[0].getFloat32Array()[0],n=e.inputs[1].getFloat32Array()[0],r=e.inputs[2].getFloat32Array()[0]),DA.webgpu.validateInputContent&&dB(t,n,r),e.compute(fB(t,n,r,e.inputs[0].dataType),{inputs:[]})}}),hB,gB,_B,vB,yB,bB,xB=J(()=>{"use strict";gM(),NM(),uN(),DN(),hB=(e,t,n,r)=>{if(e!==`none`&&r!==`i32`&&r!==`u32`&&r!==`f32`)throw Error(`Input ${r} is not supported with reduction ${e}.`);let i=`{ + var oldValue = 0; + loop { + let newValueF32 =`,a=`; + let newValue = bitcast(newValueF32); + let res = atomicCompareExchangeWeak(&${t}, oldValue, newValue); + if res.exchanged { + break; + } + oldValue = res.old_value; + } + }`;switch(e){case`none`:return`${t}=${n};`;case`add`:return r===`i32`||r===`u32`?`atomicAdd(&${t}, bitcast<${r}>(${n}));`:` + ${i}bitcast<${r}>(oldValue) + (${n})${a}`;case`max`:return r===`i32`||r===`u32`?`atomicMax(&${t}, bitcast<${r}>(${n}));`:` + ${i}max(bitcast(oldValue), (${n}))${a}`;case`min`:return r===`i32`||r===`u32`?`atomicMin(&${t}, bitcast<${r}>(${n}));`:`${i}min(bitcast<${r}>(oldValue), (${n}))${a}`;case`mul`:return`${i}(bitcast<${r}>(oldValue) * (${n}))${a}`;default:throw Error(`Reduction ${e} is not supported.`)}},gB=(e,t)=>`${e===1?` + let element_count_dim = uniforms.output_strides; + let dim_value = uniforms.output_shape;`:` + let element_count_dim = uniforms.output_strides[${t?`i - indices_start`:`i`}]; + let dim_value = uniforms.output_shape[${t?`i - indices_start`:`i`} + uniforms.last_index_dimension];`} + + if (index >= 0) { + if (index >= i32(dim_value)) { + index = i32(dim_value - 1); + } + } else { + if (index < -i32(dim_value)) { + index = 0; + } else { + index += i32(dim_value); + } + } + data_offset += u32((u32(index) * element_count_dim));`,_B=(e,t,n)=>`for (var i = 0u; i < uniforms.num_updates_elements; i++) { + let value = updates[uniforms.num_updates_elements * ${n?`global_idx`:`idx`} + i]; + ${hB(e.reduction,`output[data_offset + i]`,`value`,t)} + }`,vB=(e,t)=>{let n=e[0].dims,r=e[1].dims,i=n,a=Math.ceil(Y.size(r)/1),o=r[r.length-1],s=Y.sizeFromDimension(n,o),c=Y.sizeFromDimension(r,0)/o,l=[{type:12,data:a},{type:12,data:o},{type:12,data:s},...hN(e[1].dims,e[2].dims,i)];return{name:`ScatterND`,shaderCache:{hint:`${t.cacheKey}_${t.reduction}`,inputDependencies:[`rank`,`rank`]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:l}),getShaderSource:r=>{let a=X(`indices`,e[1].dataType,e[1].dims.length),o=X(`updates`,e[2].dataType,e[2].dims.length,1),s=t.reduction!==`none`&&t.reduction!==``?CN(`output`,e[0].dataType,i.length):SN(`output`,e[0].dataType,i.length,1);return` + ${r.registerUniform(`output_size`,`u32`).registerUniform(`last_index_dimension`,`u32`).registerUniform(`num_updates_elements`,`u32`).declareVariables(a,o,s)} + ${r.mainStart()} + ${r.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + var hasDuplicates = false; + if (${t.reduction===`none`}) { + for (var i = 0; i < ${c}; i = i + 1) { + for (var j = i + 1; j < ${c}; j = j + 1) { + var index_i = i32(indices[i].x); + var index_j = i32(indices[j].x); + if (index_i == index_j) { + hasDuplicates = true; + break; + } + } + if (hasDuplicates) { + break; + } + } + } + + if (${t.reduction===`none`} && hasDuplicates) { + if (global_idx != 0u) { + return; + } + // Process each index-update pair individually when duplicates exist + for (var idx = 0u; idx < ${c}u; idx++) { + var data_offset = 0u; + for (var i = 0u; i < uniforms.last_index_dimension; i++) { + var index = i32(indices[idx * uniforms.last_index_dimension + i].x); + ${gB(n.length,!1)} + } + ${_B(t,s.type.value,!1)} + } + return; + } + + var data_offset = 0u; + var indices_start = uniforms.last_index_dimension * global_idx; + var indices_end = indices_start + uniforms.last_index_dimension; + for (var i = indices_start; i < indices_end; i++) { + var index = i32(indices[i].x); + ${gB(n.length,!0)} + } + ${_B(t,s.type.value,!0)} + }`}}},yB=e=>lN({reduction:e.reduction}),bB=(e,t)=>{e.compute(vB(e.inputs,t),{inputs:[e.inputs[1],e.inputs[2]],outputs:[]})}}),SB,CB,wB,TB,EB,DB,OB,kB,AB,jB,MB,NB,PB,FB,IB,LB,RB,zB,BB,VB,HB=J(()=>{"use strict";gM(),NM(),uN(),DN(),SB=(e,t)=>{if(e.every(e=>e>0||(()=>{throw Error(`Resize requires scales input values to be positive`)})),e.length>0){if(t.mode===`linear`){if(!(e.length===2||e.length===3||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1||e.length===5&&e[0]===1&&e[1]===1))throw Error(`For linear mode, Resize requires scales to be 2D, 3D, 4D with either two outermost or one innermost and + one outermost scale values equal to 1, or 5D with two outermost scale values equal to 1`)}else if(t.mode===`cubic`&&!(e.length===2||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1))throw Error(`Resize requires scales input size to be 2 or 4 for cubic mode`)}},CB=(e,t,n)=>{t.every(e=>e>=0&&e{throw Error(`Resize requires axes input values to be positive and less than rank`)}));let r=Array(n).fill(1);return t.forEach((t,n)=>r[t]=e[n]),r},wB=(e,t,n,r,i,a)=>{let[o,s,c]=n>10?[1,2,3]:[-1,e.length>1?1:-1,-1],l=e[0].dims.length;if(o>0&&e.length>o&&e[o].dims.length>0)e[o].getFloat32Array().forEach(e=>a.push(e));else if(t.coordinateTransformMode===`tf_crop_and_resize`)throw Error(`Resize requires RoI input to be specified when coordinateTransformMode is tfCropAndResize`);if(s>0&&e.length>s&&e[s].dims.length===1&&e[s].dims[0]>0){if(e[s].getFloat32Array().forEach(e=>r.push(e)),r.length!==0&&r.length!==l&&n>=18&&r.length!==t.axes.length)throw Error(`Resize requires scales input size to be same as input rank or axes size for opset 18 and up`);SB(r,t),t.axes.length>0&&CB(r,t.axes,l).forEach((e,t)=>r[t]=e)}if(c>0&&e.length>c&&e[c].dims.length===1&&e[c].dims[0]>0&&(e[c].getBigInt64Array().forEach(e=>i.push(Number(e))),i.length!==0&&i.length!==l&&n>=18&&i.length!==t.axes.length))throw Error(`Resize requires sizes input size to be same as input rank or axes size for opset 18 and up`);if(t.axes.length>0){if(r.length!==0&&r.length!==t.axes.length)throw Error(`Resize requires "scales" input size to be of axes rank when axes attributes is specified`);if(i.length!==0&&i.length!==t.axes.length)throw Error(`Resize requires "sizes" input size to be of rank axes rank when axes attributes is specified`)}if(typeof r<`u`&&typeof i<`u`&&r.length>0&&i.length>l)throw Error(`Resize requires only of scales or sizes to be specified`)},TB=(e,t,n,r)=>` + // The whole part and the fractional part are calculated separately due to inaccuracy of floating + // point division. As an example, f32(21) / f32(7) may evaluate to 2.99... instead of 3, causing an + // offset-by-one error later in floor(). + let big = (${e}) * (${t}); + let whole = ${r}(big / (${n})); + let fract = ${r}(big % (${n})) / ${r}(${n}); + return whole + fract; +`,EB=(e,t)=>`fn getOriginalCoordinateFromResizedCoordinate(xResized: u32, xScale: f32, lengthResized: u32, + lengthOriginal: u32, roiStart: f32, roiEnd: f32) -> ${t} { `+(()=>{switch(e){case`asymmetric`:return` + if (xScale < 1.0 || floor(xScale) != xScale) { + return ${t}(xResized) / ${t}(xScale); + } else { + ${TB(`xResized`,`lengthOriginal`,`lengthResized`,t)} + } + `;case`pytorch_half_pixel`:return`if (lengthResized > 1) { + return (${t}(xResized) + 0.5) / ${t}(xScale) - 0.5; + } else { + return 0.0; + }`;case`tf_half_pixel_for_nn`:return`return (${t}(xResized) + 0.5) / ${t}(xScale);`;case`align_corners`:return`if (lengthResized == 1) { + return 0.0; + } else { + ${TB(`xResized`,`lengthOriginal - 1`,`lengthResized - 1`,t)} + }`;case`tf_crop_and_resize`:return`if (lengthResized > 1) { + return ${t}(roiStart) * ${t}(lengthOriginal - 1) + + (${t}(xResized) * ${t}(roiEnd - roiStart) * ${t}(lengthOriginal - 1)) / + ${t}(lengthResized - 1); + } else { + return 0.5 * ${t}(roiStart + roiEnd) * ${t}(lengthOriginal - 1); + }`;case`half_pixel_symmetric`:return`const outputWidth = ${t}xScale * ${t}(lengthResized); + const adjustment = ${t}(lengthResized) / outputWidth; + const center = ${t}(lengthOriginal) / 2; + const offset = center * (1 - adjustment); + return offset + ((${t}(xResized) + 0.5) / ${t}(xScale)) - 0.5;`;case`half_pixel`:return`return ((${t}(xResized) + 0.5) / ${t}(xScale)) - 0.5;`;default:throw Error(`Coordinate transform mode ${e} is not supported`)}})()+`}`,DB=(e,t,n)=>`fn getNearestPixelFromOriginal(xOriginal: ${n}, isDownSample: bool) -> ${n} {`+(()=>{switch(e){case`round_prefer_ceil`:return`if (fract(xOriginal) == 0.5) { return ceil(xOriginal); } else { return round(xOriginal); }`;case`floor`:return`return floor(xOriginal);`;case`ceil`:return`return ceil(xOriginal);`;case`round_prefer_floor`:return`if (fract(xOriginal) == 0.5) { return floor(xOriginal); } else { return round(xOriginal); }`;default:if(t<11)return`if (isDownSample) { return ceil(xOriginal); } else { return xOriginal; }`;throw Error(`Nearest mode ${e} is not supported`)}})()+`}`,OB=(e,t,n)=>{let r=Array(n).fill(0).concat(Array(n).fill(1)),i=e.length===0?r:e.slice();return t.length>0?(t.forEach((e,a)=>{r[e]=i[a],r[a+n]=i[t.length+a]}),r):i},kB=(e,t,n,r)=>{let i=[];if(n.length>0)if(r.length>0){if(e.forEach(e=>i.push(e)),Math.max(...r)>e.length)throw Error(`axes is out of bound`);r.forEach((e,t)=>i[e]=n[t])}else n.forEach(e=>i.push(e));else{if(t.length===0)throw Error(`Resize requires either scales or sizes.`);i=e.map((e,n)=>Math.round(e*t[n]))}return i},AB=(e,t,n)=>{let r=(()=>{switch(n.keepAspectRatioPolicy){case`not_larger`:return n.axes.length>0?Math.min(...n.axes.map(e=>t[e]),Number.MAX_VALUE):Math.min(...t,Number.MAX_VALUE);case`not_smaller`:return n.axes.length>0?Math.max(...n.axes.map(e=>t[e]),Number.MIN_VALUE):Math.max(...t,Number.MIN_VALUE);default:throw Error(`Keep aspect ratio policy ${n.keepAspectRatioPolicy} is not supported`)}})();t.fill(1,0,t.length);let i=e.slice();return n.axes.length>0?(n.axes.forEach(e=>t[e]=r),n.axes.forEach(n=>i[n]=Math.round(e[n]*t[n]))):(t.fill(r,0,t.length),i.forEach((e,n)=>i[n]=Math.round(e*t[n]))),i},jB=(e,t,n,r,i)=>` + fn calculateOriginalIndicesFromOutputIndices(output_indices: ${e.type.indices}) -> array<${e.type.value}, ${n.length}> { + var original_indices: array<${e.type.value}, ${n.length}>; + for (var i:u32 = 0; i < ${n.length}; i++) { + var output_index = ${e.indicesGet(`output_indices`,`i`)}; + var scale = ${bN(`uniforms.scales`,`i`,r)}; + var roi_low = ${bN(`uniforms.roi`,`i`,i)}; + var roi_hi = ${bN(`uniforms.roi`,`i + ${t.length}`,i)}; + if (scale == 1.0) { + original_indices[i] = ${e.type.value}(output_index); + } else { + var input_shape_i = ${bN(`uniforms.input_shape`,`i`,t.length)}; + var output_shape_i = ${bN(`uniforms.output_shape`,`i`,n.length)}; + original_indices[i] = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, + input_shape_i, roi_low, roi_hi); + } + } + return original_indices; + }`,MB=(e,t,n,r,i,a,o)=>` + fn calculateInputIndicesFromOutputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} { + var input_indices: ${e.type.indices}; + for (var i:u32 = 0; i < ${r.length}; i++) { + var output_index = ${t.indicesGet(`output_indices`,`i`)}; + var input_index: u32; + var scale = ${bN(`uniforms.scales`,`i`,i)}; + if (scale == 1.0) { + input_index = output_index; + } else { + var roi_low = ${bN(`uniforms.roi`,`i`,a)}; + var roi_hi = ${bN(`uniforms.roi`,`i + ${n.length}`,a)}; + var input_shape_i = ${bN(`uniforms.input_shape`,`i`,n.length)}; + var output_shape_i = ${bN(`uniforms.output_shape`,`i`,r.length)}; + var original_idx = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, + input_shape_i, roi_low, roi_hi); + if (!${o} || (original_idx >= 0 && original_idx < ${t.type.value}(input_shape_i))) { + if (original_idx < 0) { + input_index = 0; + } else if (original_idx > ${t.type.value}(input_shape_i - 1)) { + input_index = input_shape_i - 1; + } else { + input_index = u32(getNearestPixelFromOriginal(original_idx, scale < 1)); + } + } else { + input_index = u32(original_idx); + } + } + ${e.indicesSet(`input_indices`,`i`,`input_index`)} + } + return input_indices; + }`,NB=(e,t)=>` + fn checkInputIndices(input_indices: ${e.type.indices}) -> bool { + for (var i:u32 = 0; i < ${t.length}; i++) { + var input_index = ${e.indicesGet(`input_indices`,`i`)}; + if (input_index < 0 || input_index >= ${bN(`uniforms.input_shape`,`i`,t.length)}) { + return false; + } + } + return true; + }`,PB=(e,t,n,r)=>e.rank>r?` + ${e.indicesSet(`input_indices`,t,`channel`)}; + ${e.indicesSet(`input_indices`,n,`batch`)}; +`:``,FB=(e,t,n,r,i)=>{let[a,o,s,c]=n.length===2?[-1,0,1,-1]:[0,2,3,1],l=e.type.value;return` + fn getInputValue(batch: u32, channel: u32, row: u32, col: u32) -> ${l} { + var input_indices: ${e.type.indices}; + ${e.indicesSet(`input_indices`,o,`max(0, min(row, ${n[o]} - 1))`)}; + ${e.indicesSet(`input_indices`,s,`max(0, min(col, ${n[s]} - 1))`)}; + ${PB(e,c,a,2)} + return ${e.getByIndices(`input_indices`)}; + } + + fn bilinearInterpolation(output_indices: ${t.type.indices}) -> ${l} { + var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices); + var row:${l} = originalIndices[${o}]; + var col:${l} = originalIndices[${s}]; + ${r?`if (row < 0 || row > (${n[o]} - 1) || col < 0 || col > (${n[s]} - 1)) { + return ${i}; + }`:``}; + row = max(0, min(row, ${n[o]} - 1)); + col = max(0, min(col, ${n[s]} - 1)); + var row1: u32 = u32(row); + var col1: u32 = u32(col); + var row2: u32 = u32(row + 1); + var col2: u32 = u32(col + 1); + var channel: u32 = ${n.length>2?`u32(originalIndices[${c}])`:`0`}; + var batch: u32 = ${n.length>2?`u32(originalIndices[${a}])`:`0`}; + var x11: ${l} = getInputValue(batch, channel, row1, col1); + var x12: ${l} = getInputValue(batch, channel, row1, col2); + var x21: ${l} = getInputValue(batch, channel, row2, col1); + var x22: ${l} = getInputValue(batch, channel, row2, col2); + var dx1: ${l} = abs(row - ${l}(row1)); + var dx2: ${l} = abs(${l}(row2) - row); + var dy1: ${l} = abs(col - ${l}(col1)); + var dy2: ${l} = abs(${l}(col2) - col); + if (row1 == row2) { + dx1 = 0.5; + dx2 = 0.5; + } + if (col1 == col2) { + dy1 = 0.5; + dy2 = 0.5; + } + return (x11 * dx2 * dy2 + x12 * dx2 * dy1 + x21 * dx1 * dy2 + x22 * dx1 * dy1); + }`},IB=(e,t,n,r,i,a,o,s,c,l)=>{let[u,d]=n.length===2?[0,1]:[2,3],f=e.type.value,p=o=>{let d=o===u?`row`:`col`;return` + fn ${d}CubicInterpolation(input_indices: ${e.type.indices}, output_indices: ${t.type.indices}) -> ${f} { + var output_index = ${t.indicesGet(`output_indices`,o)}; + var originalIdx: ${f} = getOriginalCoordinateFromResizedCoordinate(output_index, ${i[o]}, + ${r[o]}, ${n[o]}, ${a[o]}, ${a[o]} + ${n.length}); + var fractOriginalIdx: ${f} = originalIdx - floor(originalIdx); + var coefs = getCubicInterpolationCoefs(fractOriginalIdx); + + if (${s} && (originalIdx < 0 || originalIdx > (${n[o]} - 1))) { + return ${c}; + } + var data: array<${f}, 4> = array<${f}, 4>(0.0, 0.0, 0.0, 0.0); + for (var i: i32 = -1; i < 3; i++) { + var ${d}: ${f} = originalIdx + ${f}(i); + if (${d} < 0 || ${d} >= ${n[o]}) { + ${l?`coefs[i + 1] = 0.0; + continue;`:s?`return ${c};`:`${d} = max(0, min(${d}, ${n[o]} - 1));`}; + } + var input_indices_copy: ${e.type.indices} = input_indices; + ${e.indicesSet(`input_indices_copy`,o,`u32(${d})`)}; + data[i + 1] = ${o===u?e.getByIndices(`input_indices_copy`):`rowCubicInterpolation(input_indices_copy, output_indices)`}; + } + return cubicInterpolation1D(data, coefs); + }`};return` + ${p(u)}; + ${p(d)}; + fn getCubicInterpolationCoefs(s: ${f}) -> array<${f}, 4> { + var absS = abs(s); + var coeffs: array<${f}, 4> = array<${f}, 4>(0.0, 0.0, 0.0, 0.0); + var oneMinusAbsS: ${f} = 1.0 - absS; + var twoMinusAbsS: ${f} = 2.0 - absS; + var onePlusAbsS: ${f} = 1.0 + absS; + coeffs[0] = ((${o} * onePlusAbsS - 5 * ${o}) * onePlusAbsS + 8 * ${o}) * onePlusAbsS - 4 * ${o}; + coeffs[1] = ((${o} + 2) * absS - (${o} + 3)) * absS * absS + 1; + coeffs[2] = ((${o} + 2) * oneMinusAbsS - (${o} + 3)) * oneMinusAbsS * oneMinusAbsS + 1; + coeffs[3] = ((${o} * twoMinusAbsS - 5 * ${o}) * twoMinusAbsS + 8 * ${o}) * twoMinusAbsS - 4 * ${o}; + return coeffs; + } + + fn cubicInterpolation1D(x: array<${f}, 4>, coefs: array<${f}, 4>) -> ${f} { + var coefsSum: ${f} = coefs[0] + coefs[1] + coefs[2] + coefs[3]; + return (x[0] * coefs[0] + x[1] * coefs[1]+ x[2] * coefs[2]+ x[3] * coefs[3]) / coefsSum; + } + + fn bicubicInterpolation(output_indices: ${t.type.indices}) -> ${f} { + var input_indices: ${e.type.indices} = output_indices; + return colCubicInterpolation(input_indices, output_indices); + } + `},LB=(e,t,n,r,i)=>{let[a,o,s,c,l]=n.length===3?[-1,0,1,2,-1]:[0,2,3,4,1],u=e.type.value;return` + fn getInputValue(batch: u32, channel: u32, depth:u32, height: u32, width: u32) -> ${u} { + var input_indices: ${e.type.indices}; + ${e.indicesSet(`input_indices`,o,`max(0, min(depth, ${n[o]} - 1))`)}; + ${e.indicesSet(`input_indices`,s,`max(0, min(height, ${n[s]} - 1))`)}; + ${e.indicesSet(`input_indices`,c,`max(0, min(width, ${n[c]} - 1))`)}; + ${PB(e,l,a,3)} + return ${e.getByIndices(`input_indices`)}; + } + + fn trilinearInterpolation(output_indices: ${t.type.indices}) -> ${u} { + var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices); + var depth:${u} = originalIndices[${o}]; + var height:${u} = originalIndices[${s}]; + var width:${u} = originalIndices[${c}]; + ${r?`if (depth < 0 || depth > (${n[o]} - 1) || height < 0 || height > (${n[s]} - 1) || width < 0 || (width > ${n[c]} - 1)) { + return ${i}; + }`:``}; + + depth = max(0, min(depth, ${n[o]} - 1)); + height = max(0, min(height, ${n[s]} - 1)); + width = max(0, min(width, ${n[c]} - 1)); + var depth1: u32 = u32(depth); + var height1: u32 = u32(height); + var width1: u32 = u32(width); + var depth2: u32 = u32(depth + 1); + var height2: u32 = u32(height + 1); + var width2: u32 = u32(width + 1); + var channel: u32 = ${n.length>3?`u32(originalIndices[${l}])`:`0`}; + var batch: u32 = ${n.length>3?`u32(originalIndices[${a}])`:`0`}; + + var x111: ${u} = getInputValue(batch, channel, depth1, height1, width1); + var x112: ${u} = getInputValue(batch, channel, depth1, height1, width2); + var x121: ${u} = getInputValue(batch, channel, depth1, height2, width1); + var x122: ${u} = getInputValue(batch, channel, depth1, height2, width2); + var x211: ${u} = getInputValue(batch, channel, depth2, height1, width1); + var x212: ${u} = getInputValue(batch, channel, depth2, height1, width2); + var x221: ${u} = getInputValue(batch, channel, depth2, height2, width1); + var x222: ${u} = getInputValue(batch, channel, depth2, height2, width2); + var dx1: ${u} = abs(depth - ${u}(depth1)); + var dx2: ${u} = abs(${u}(depth2) - depth); + var dy1: ${u} = abs(height - ${u}(height1)); + var dy2: ${u} = abs(${u}(height2) - height); + var dz1: ${u} = abs(width - ${u}(width1)); + var dz2: ${u} = abs(${u}(width2) - width); + if (depth1 == depth2) { + dx1 = 0.5; + dx2 = 0.5; + } + if (height1 == height2) { + dy1 = 0.5; + dy2 = 0.5; + } + if (width1 == width2) { + dz1 = 0.5; + dz2 = 0.5; + } + return (x111 * dx2 * dy2 * dz2 + x112 * dx2 * dy2 * dz1 + x121 * dx2 * dy1 *dz2 + x122 * dx2 * dy1 * dz1 + + x211 * dx1 * dy2 * dz2 + x212 * dx1 * dy2 * dz1 + x221 * dx1 * dy1 *dz2 + x222 * dx1 * dy1 * dz1); + }`},RB=(e,t,n,r,i,a)=>{let o=e.dims,s=OB(a,t.axes,o.length),c=kB(o,r,i,t.axes),l=r.slice();r.length===0&&(l=o.map((e,t)=>e===0?1:c[t]/e),t.keepAspectRatioPolicy!==`stretch`&&(c=AB(o,l,t)));let u=SN(`output`,e.dataType,c.length),d=X(`input`,e.dataType,o.length),f=Y.size(c),p=o.length===c.length&&o.every((e,t)=>e===c[t]),m=t.coordinateTransformMode===`tf_crop_and_resize`,h=t.extrapolationValue,g=d.type.value;return{name:`Resize`,shaderCache:{hint:`${t.cacheKey}|${n}|${l.length>0?t.mode===`cubic`?l:l.length:``}|${i.length>0?i:``}|${s.length>0?s:``}|${p}|${t.mode===`nearest`?o.length:o}`,inputDependencies:[`rank`]},getShaderSource:e=>` + ${p?``:` + ${EB(t.coordinateTransformMode,g)}; + ${(()=>{switch(t.mode){case`nearest`:return` + ${NB(d,o)}; + ${DB(t.nearestMode,n,g)}; + ${MB(d,u,o,c,l.length,s.length,m)}; + `;case`linear`:return` + ${jB(u,o,c,l.length,s.length)}; + ${(()=>{if(o.length===2||o.length===4)return`${FB(d,u,o,m,h)}`;if(o.length===3||o.length===5)return`${LB(d,u,o,m,h)}`;throw Error(`Linear mode only supports input dims 2, 3, 4 and 5 are supported in linear mode.`)})()}; + `;case`cubic`:return` + ${(()=>{if(o.length===2||o.length===4)return`${IB(d,u,o,c,l,s,t.cubicCoeffA,m,t.extrapolationValue,t.excludeOutside)}`;throw Error(`Cubic mode only supports input dims 2 and 4 are supported in linear mode.`)})()}; + `;default:throw Error(`Invalid resize mode`)}})()}; + `} + ${e.registerUniform(`output_size`,`u32`).registerUniform(`scales`,`f32`,l.length).registerUniform(`roi`,`f32`,s.length).declareVariables(d,u)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + ${p?`output[global_idx] = input[global_idx];`:` + let output_indices = ${u.offsetToIndices(`global_idx`)}; + var input_indices: ${d.type.indices}; + ${(()=>{switch(t.mode){case`nearest`:return`input_indices = calculateInputIndicesFromOutputIndices(output_indices); + if (checkInputIndices(input_indices)) { + output[global_idx] = ${d.getByIndices(`input_indices`)}; + } else { + output[global_idx] = ${t.extrapolationValue}; + }`;case`linear`:return`output[global_idx] = ${o.length===2||o.length===4?`bilinearInterpolation`:`trilinearInterpolation`}(output_indices);`;case`cubic`:return`output[global_idx] = bicubicInterpolation(output_indices);`;default:throw Error(`Unsupported resize mode: ${t.mode}`)}})()}; +`} + }`,getRunData:()=>({outputs:[{dims:c,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:[{type:12,data:f},{type:1,data:l},{type:1,data:s},...hN(o,c)]})}},zB=e=>{let t=e.customDataBuffer;return new Uint32Array(t,t.byteOffset,1)[0]},BB=(e,t)=>{let n=[],r=[],i=[],a=zB(e);if(t.antialias!==0)throw Error(`Only default value (0) for Antialias attribute is supported`);wB(e.inputs,t,a,n,r,i),e.compute(RB(e.inputs[0],t,a,n,r,i),{inputs:[0]})},VB=e=>{let t=e.antialias,n=e.axes,r=e.coordinateTransformMode,i=e.cubicCoeffA,a=e.excludeOutside!==0,o=e.extrapolationValue,s=e.keepAspectRatioPolicy,c=e.mode,l=e.nearestMode===``?`simple`:e.nearestMode;return lN({antialias:t,axes:n,coordinateTransformMode:r,cubicCoeffA:i,excludeOutside:a,extrapolationValue:o,keepAspectRatioPolicy:s,mode:c,nearestMode:l})}}),UB,WB,GB,KB=J(()=>{"use strict";gM(),NM(),DN(),UB=e=>{if(!e||e.length<3)throw Error(`layerNorm requires at least 3 inputs.`);let t=e[0],n=e[1],r=e[2];if(t.dataType!==n.dataType||t.dataType!==r.dataType)throw Error(`All inputs must have the same data type`);if(t.dims.length!==3&&t.dims.length!==2)throw Error(`Input must be 2D or 3D`);if(n.dims.length!==3&&n.dims.length!==2)throw Error(`Skip must be 2D or 3D`);let i=t.dims[t.dims.length-1],a=t.dims[t.dims.length-2];if(n.dims[n.dims.length-1]!==i)throw Error(`Skip must have the same hidden size as input`);if(n.dims[n.dims.length-2]!==a)throw Error(`Skip must have the same sequence length as input`);if(r.dims.length!==1)throw Error(`Gamma must be 1D`);if(r.dims[r.dims.length-1]!==i)throw Error(`Gamma must have the same hidden size as input`);if(e.length>3){let t=e[3];if(t.dims.length!==1)throw Error(`Beta must be 1D`);if(t.dims[t.dims.length-1]!==i)throw Error(`Beta must have the same hidden size as input`)}if(e.length>4){let t=e[4];if(t.dims.length!==1)throw Error(`Bias must be 1D`);if(t.dims[t.dims.length-1]!==i)throw Error(`Bias must have the same hidden size as input`)}},WB=(e,t,n,r)=>{let i=t.simplified,a=e[0].dims,o=Y.size(a),s=a,c=o,l=a.slice(-1)[0],u=r?a.slice(0,-1).concat(1):[],d=!i&&e.length>3,f=e.length>4,p=r&&n>1,m=r&&n>2,h=n>3,g=gN(l),_=[{type:12,data:c},{type:12,data:g},{type:12,data:l},{type:1,data:t.epsilon}],v=t=>{let n=[{name:`output_size`,type:`u32`},{name:`components`,type:`u32`},{name:`hidden_size`,type:`u32`},{name:`epsilon`,type:`f32`}],r=[X(`x`,e[0].dataType,e[0].dims,g),X(`skip`,e[1].dataType,e[1].dims,g),X(`gamma`,e[2].dataType,e[2].dims,g)];d&&r.push(X(`beta`,e[3].dataType,e[3].dims,g)),f&&r.push(X(`bias`,e[4].dataType,e[4].dims,g)),r.push(SN(`output`,e[0].dataType,s,g)),p&&r.push(SN(`mean_output`,1,u)),m&&r.push(SN(`inv_std_output`,1,u)),h&&r.push(SN(`input_skip_bias_sum`,e[0].dataType,s,g));let a=pN(e[0].dataType),o=pN(1,g);return` + + ${t.registerUniforms(n).declareVariables(...r)} + var sum_shared : array<${o}, 64>; + var sum_squared_shared : array<${o}, 64>; + + ${t.mainStart([64,1,1])} + let ix = local_id.x; + let iy = global_id.x / 64; + + let hidden_size_vectorized: u32 = uniforms.hidden_size / uniforms.components; + var stride = hidden_size_vectorized / 64; + let offset = ix * stride + iy * hidden_size_vectorized; + let offset1d = stride * ix; + if (ix == 63) { + stride = hidden_size_vectorized - stride * ix; + } + for (var i: u32 = 0; i < stride; i++) { + let skip_value = skip[offset + i]; + let bias_value = ${f?`bias[offset1d + i]`:a+`(0.0)`}; + let input_value = x[offset + i]; + let value = input_value + skip_value + bias_value; + ${h?`input_skip_bias_sum[offset + i] = value;`:``} + output[offset + i] = value; + let f32_value = ${vN(a,g,`value`)}; + sum_shared[ix] += f32_value; + sum_squared_shared[ix] += f32_value * f32_value; + } + workgroupBarrier(); + + var reduce_size : u32 = 64; + for (var curr_size = reduce_size >> 1; curr_size > 0; curr_size = reduce_size >> 1) { + reduce_size = curr_size + (reduce_size & 1); + if (ix < curr_size) { + sum_shared[ix] += sum_shared[ix + reduce_size]; + sum_squared_shared[ix] += sum_squared_shared[ix + reduce_size]; + } + workgroupBarrier(); + } + + let sum = sum_shared[0]; + let square_sum = sum_squared_shared[0]; + let mean = ${yN(`sum`,g)} / f32(uniforms.hidden_size); + let inv_std_dev = inverseSqrt(${yN(`square_sum`,g)} / f32(uniforms.hidden_size) ${i?``:`- mean * mean`} + uniforms.epsilon); + ${p?`mean_output[global_idx] = mean;`:``} + ${m?`inv_std_output[global_idx] = inv_std_dev;`:``} + + for (var i: u32 = 0; i < stride; i++) { + output[offset + i] = (output[offset + i] ${i?``:`- ${a}(mean)`}) * + ${a}(inv_std_dev) * gamma[offset1d + i] + ${d?`+ beta[offset1d + i]`:``}; + } + }`},y=[{dims:s,dataType:e[0].dataType}];return n>1&&y.push({dims:u,dataType:1}),n>2&&y.push({dims:u,dataType:1}),n>3&&y.push({dims:a,dataType:e[0].dataType}),{name:`SkipLayerNormalization`,shaderCache:{hint:`${g};${p};${m};${h}`,inputDependencies:e.map((e,t)=>`type`)},getShaderSource:v,getRunData:()=>({outputs:y,dispatchGroup:{x:Math.ceil(c/l)},programUniforms:_})}},GB=(e,t)=>{UB(e.inputs);let n=[0];e.outputCount>1&&n.push(-3),e.outputCount>2&&n.push(-3),e.outputCount>3&&n.push(3),e.compute(WB(e.inputs,t,e.outputCount,!1),{outputs:n})}}),qB,JB,YB,XB,ZB,QB,$B,eV,tV=J(()=>{"use strict";gM(),NM(),uN(),DN(),qB=(e,t)=>{if(!e||e.length<1)throw Error(`too few inputs`);if(t.axes.length!==0){if(t.axes.length!==t.starts.length||t.axes.length!==t.ends.length)throw Error(`axes, starts and ends must have the same length`)}else if(t.starts.length!==t.ends.length)throw Error(`starts and ends must have the same length`);e.slice(1).forEach((t,n)=>{if(e[n+1].dataType!==6&&e[n+1].dataType!==7)throw Error(`Input ${n} must be an array of int32 or int64`)})},JB=(e,t)=>{let n=[];if(e.length>t)if(e[t].dataType===7)e[t].getBigInt64Array().forEach(e=>n.push(Number(e)));else if(e[t].dataType===6)e[t].getInt32Array().forEach(e=>n.push(Number(e)));else throw Error(`Input ${t} must be an array of int32 or int64`);return n},YB=(e,t)=>{if(e.length>1){let t=JB(e,1),n=JB(e,2),r=JB(e,3);return r.length===0&&(r=[...Array(e[0].dims.length).keys()]),lN({starts:t,ends:n,axes:r})}else return t},XB=(e,t,n,r,i)=>{let a=e;return e<0&&(a+=n[r[t]]),i[t]<0?Math.max(0,Math.min(a,n[r[t]]-1)):Math.max(0,Math.min(a,n[r[t]]))},ZB=(e,t,n)=>`fn calculateInputIndices(output_indices: ${t.type.indices}) -> ${e.type.indices} { + var input_indices: ${e.type.indices}; + var carry = 0u; + for (var i = ${n.length}; i >= 0; i--) { + let input_shape_i = ${bN(`uniforms.input_shape`,`i`,n.length)}; + let steps_i = ${bN(`uniforms.steps`,`i`,n.length)}; + let signs_i = ${bN(`uniforms.signs`,`i`,n.length)}; + let starts_i = ${bN(`uniforms.starts`,`i`,n.length)}; + var output_index = ${t.indicesGet(`output_indices`,`i`)}; + var input_index = output_index * steps_i + starts_i + carry; + carry = input_index / input_shape_i; + input_index = input_index % input_shape_i; + if (signs_i < 0) { + input_index = input_shape_i - input_index - 1u + starts_i; + } + ${e.indicesSet(`input_indices`,`i`,`input_index`)}; + } + return input_indices; + }`,QB=(e,t)=>{let n=e[0].dims,r=Y.size(n),i=t.axes.length>0?Y.normalizeAxes(t.axes,n.length):[...Array(n.length).keys()],a=JB(e,4);a.forEach(e=>e!==0||(()=>{throw Error(`step cannot be 0`)})),a.length===0&&(a=Array(i.length).fill(1));let o=t.starts.map((e,t)=>XB(e,t,n,i,a)),s=t.ends.map((e,t)=>XB(e,t,n,i,a));if(i.length!==o.length||i.length!==s.length)throw Error(`start, ends and axes should have the same number of elements`);if(i.length!==n.length)for(let e=0;eMath.sign(e));a.forEach((e,t,n)=>{if(e<0){let r=(s[t]-o[t])/e,i=o[t];o[t]=i+r*a[t],s[t]=i,n[t]=-e}});let l=n.slice(0);i.forEach((e,t)=>{l[e]=Math.ceil((s[e]-o[e])/a[e])});let u={dims:l,dataType:e[0].dataType},d=SN(`output`,e[0].dataType,l.length),f=X(`input`,e[0].dataType,e[0].dims.length),p=Y.size(l),m=[{name:`outputSize`,type:`u32`},{name:`starts`,type:`u32`,length:o.length},{name:`signs`,type:`i32`,length:c.length},{name:`steps`,type:`u32`,length:a.length}],h=[{type:12,data:p},{type:12,data:o},{type:6,data:c},{type:12,data:a},...hN(e[0].dims,l)];return{name:`Slice`,shaderCache:{hint:`${c.length}_${o.length}_${a.length}`,inputDependencies:[`rank`]},getShaderSource:e=>` + ${e.registerUniforms(m).declareVariables(f,d)} + ${ZB(f,d,n)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.outputSize`)} + let output_indices = ${d.offsetToIndices(`global_idx`)}; + let input_indices = calculateInputIndices(output_indices); + ${d.setByOffset(`global_idx`,f.getByIndices(`input_indices`))} + }`,getRunData:()=>({outputs:[u],dispatchGroup:{x:Math.ceil(r/64)},programUniforms:h})}},$B=(e,t)=>{qB(e.inputs,t);let n=YB(e.inputs,t);e.compute(QB(e.inputs,n),{inputs:[0]})},eV=e=>{let t=e.starts,n=e.ends,r=e.axes;return lN({starts:t,ends:n,axes:r})}}),nV,rV,iV,aV,oV=J(()=>{"use strict";gM(),NM(),uN(),LN(),DN(),nV=e=>{if(!e||e.length!==1)throw Error(`Softmax op requires 1 input.`)},rV=(e,t)=>{let n=e.inputs[0],r=n.dims,i=Y.size(r),a=r.length,o=Y.normalizeAxis(t.axis,a),s=ot),l[o]=a-1,l[a-1]=o,c=e.compute(PN(n,l),{inputs:[n],outputs:[-1]})[0]):c=n;let u=c.dims,d=u[a-1],f=i/d,p=gN(d),m=d/p,h=64;f===1&&(h=256);let g=(e,t)=>t===4?`max(max(${e}.x, ${e}.y), max(${e}.z, ${e}.w))`:t===2?`max(${e}.x, ${e}.y)`:t===3?`max(max(${e}.x, ${e}.y), ${e}.z)`:e,_=X(`x`,c.dataType,c.dims,p),v=SN(`result`,c.dataType,c.dims,p),y=_.type.value,b=pN(c.dataType)===`f32`?`var threadMax = ${y}(-3.402823e+38f);`:`var threadMax = ${y}(-65504.0h);`,x=e.compute({name:`Softmax`,shaderCache:{hint:`${p};${h}`,inputDependencies:[`type`]},getRunData:()=>({outputs:[{dims:u,dataType:c.dataType}],dispatchGroup:{x:f},programUniforms:[{type:6,data:m}]}),getShaderSource:e=>` + var rowMaxShared : ${y}; + var rowSumShared : ${y}; + var threadShared : array<${y}, ${h}>; + + fn getValue(row: i32, col: i32, row_stride: i32) -> ${y} { + let index = row * row_stride + col; + return x[index]; + } + + fn setValue(row: i32, col: i32, row_stride: i32, value: ${y}) { + let index = row * row_stride + col; + result[index] = value; + } + ${e.registerUniform(`packedCols`,`i32`).declareVariables(_,v)} + ${e.mainStart(h)} + let gindex = i32(global_idx); + let lindex = i32(local_idx); + const wg = ${h}; + let row = gindex / wg; + let cols = uniforms.packedCols; + let row_stride : i32 = uniforms.packedCols; + + // find the rows max + ${b} + for (var col = lindex; col < cols; col += wg) { + let value = getValue(row, col, row_stride); + threadMax = max(threadMax, value); + } + if (lindex < cols) { + threadShared[lindex] = threadMax; + } + workgroupBarrier(); + + var reduceSize = min(cols, wg); + for (var currSize = reduceSize >> 1; currSize > 0; currSize = reduceSize >> 1) { + reduceSize = currSize + (reduceSize & 1); + if (lindex < currSize) { + threadShared[lindex] = max(threadShared[lindex], threadShared[lindex + reduceSize]); + } + workgroupBarrier(); + } + if (lindex == 0) { + rowMaxShared = ${y}(${g(`threadShared[0]`,p)}); + } + workgroupBarrier(); + + // find the rows sum + var threadSum = ${y}(0.0); + for (var col = lindex; col < cols; col += wg) { + let subExp = exp(getValue(row, col, row_stride) - rowMaxShared); + threadSum += subExp; + } + threadShared[lindex] = threadSum; + workgroupBarrier(); + + for (var currSize = wg >> 1; currSize > 0; currSize = currSize >> 1) { + if (lindex < currSize) { + threadShared[lindex] = threadShared[lindex] + threadShared[lindex + currSize]; + } + workgroupBarrier(); + } + if (lindex == 0) { + rowSumShared = ${y}(${yN(`threadShared[0]`,p)}); + } + workgroupBarrier(); + + // calculate final value for each element in the row + for (var col = lindex; col < cols; col += wg) { + let value = exp(getValue(row, col, row_stride) - rowMaxShared) / rowSumShared; + setValue(row, col, row_stride, value); + } + }`},{inputs:[c],outputs:[s?-1:0]})[0];s&&e.compute(PN(x,l),{inputs:[x]})},iV=(e,t)=>{nV(e.inputs),rV(e,t)},aV=e=>lN({axis:e.axis})}),sV,cV,lV,uV,dV,fV=J(()=>{"use strict";gM(),NM(),DN(),sV=e=>Array.from(e.getBigInt64Array(),Number),cV=e=>{if(!e||e.length!==2)throw Error(`Tile requires 2 inputs.`);if(e[0].dataType!==1&&e[0].dataType!==10&&e[0].dataType!==6&&e[0].dataType!==12)throw Error(`Tile only support float, float16, int32, and uint32 data types`);if(e[1].dataType!==7)throw Error("Tile `repeats` input should be of int64 data type");if(e[1].dims.length!==1)throw Error("Tile `repeats` input should be 1-D");if(sV(e[1]).length!==e[0].dims.length)throw Error("Tile `repeats` input should have same number of elements as rank of input data tensor")},lV=(e,t)=>{let n=[];for(let r=0;r{let n=e[0].dims,r=t??sV(e[1]),i=lV(n,r),a=Y.size(i),o=e[0].dataType,s=X(`input`,o,n.length),c=SN(`output`,o,i.length);return{name:`Tile`,shaderCache:{hint:`${r}`,inputDependencies:[`rank`]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:[{type:12,data:a},...hN(e[0].dims,i)]}),getShaderSource:e=>` + const inputShape = ${s.indices(...n)}; + ${e.registerUniform(`output_size`,`u32`).declareVariables(s,c)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.output_size`)} + let output_indices = ${c.offsetToIndices(`global_idx`)}; + var input_indices: ${s.type.indices}; + for (var i = 0; i < ${n.length}; i++) { + let input_dim_i = ${s.indicesGet(`uniforms.input_shape`,`i`)}; + let input_dim_value = ${c.indicesGet(`output_indices`,`i`)} % input_dim_i; + + ${s.indicesSet(`input_indices`,`i`,`input_dim_value`)} + } + ${c.setByOffset(`global_idx`,s.getByIndices(`input_indices`))} + }`}},dV=e=>{cV(e.inputs),e.compute(uV(e.inputs),{inputs:[0]})}}),pV,mV,hV,gV=J(()=>{"use strict";gM(),NM(),DN(),pV=(e,t,n,r,i)=>{let a=SN(`output_data`,i,n.length,4),o=X(`a_data`,t[1].dataType,t[1].dims.length,4),s=X(`b_data`,t[2].dataType,t[2].dims.length,4),c=X(`c_data`,t[0].dataType,t[0].dims.length,4),l,u=(e,t,n)=>`select(${t}, ${e}, ${n})`;if(!r)l=a.setByOffset(`global_idx`,u(o.getByOffset(`global_idx`),s.getByOffset(`global_idx`),c.getByOffset(`global_idx`)));else{let e=(e,t,n=``)=>{let r=`a_data[index_a${t}][component_a${t}]`,i=`b_data[index_b${t}][component_b${t}]`,l=`bool(c_data[index_c${t}] & (0xffu << (component_c${t} * 8)))`;return` + let output_indices${t} = ${a.offsetToIndices(`global_idx * 4u + ${t}u`)}; + let offset_a${t} = ${o.broadcastedIndicesToOffset(`output_indices${t}`,a)}; + let offset_b${t} = ${s.broadcastedIndicesToOffset(`output_indices${t}`,a)}; + let offset_c${t} = ${c.broadcastedIndicesToOffset(`output_indices${t}`,a)}; + let index_a${t} = offset_a${t} / 4u; + let index_b${t} = offset_b${t} / 4u; + let index_c${t} = offset_c${t} / 4u; + let component_a${t} = offset_a${t} % 4u; + let component_b${t} = offset_b${t} % 4u; + let component_c${t} = offset_c${t} % 4u; + ${e}[${t}] = ${n}(${u(r,i,l)}); + `};l=i===9?` + var data = vec4(0); + ${e(`data`,0,`u32`)} + ${e(`data`,1,`u32`)} + ${e(`data`,2,`u32`)} + ${e(`data`,3,`u32`)} + output_data[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:` + ${e(`output_data[global_idx]`,0)} + ${e(`output_data[global_idx]`,1)} + ${e(`output_data[global_idx]`,2)} + ${e(`output_data[global_idx]`,3)} + `}return` + ${e.registerUniform(`vec_size`,`u32`).declareVariables(c,o,s,a)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes(`uniforms.vec_size`)} + ${l} + }`},mV=e=>{let t=e[1].dims,n=e[2].dims,r=e[0].dims,i=e[1].dataType,a=!(Y.areEqual(t,n)&&Y.areEqual(n,r)),o=t,s=Y.size(t);if(a){let e=OM.calcShape(OM.calcShape(t,n,!1),r,!1);if(!e)throw Error(`Can't perform where op on the given tensors`);o=e,s=Y.size(o)}let c=Math.ceil(s/4);return{name:`Where`,shaderCache:{inputDependencies:[`rank`,`rank`,`rank`]},getShaderSource:t=>pV(t,e,o,a,i),getRunData:()=>({outputs:[{dims:o,dataType:i}],dispatchGroup:{x:Math.ceil(s/64/4)},programUniforms:[{type:12,data:c},...hN(r,t,n,o)]})}},hV=e=>{e.compute(mV(e.inputs))}}),_V,vV=J(()=>{"use strict";LP(),KP(),ZP(),tF(),ZF(),dI(),vI(),dL(),CL(),DL(),NL(),GL(),ZL(),eR(),aR(),lR(),mR(),yR(),wR(),zR(),dz(),gz(),bz(),Cz(),kz(),qR(),zz(),aB(),uB(),mB(),xB(),MP(),HB(),az(),KB(),tV(),oV(),tz(),fV(),LN(),qF(),gV(),_V=new Map([[`Abs`,[iF]],[`Acos`,[aF]],[`Acosh`,[oF]],[`Add`,[tI]],[`ArgMax`,[FP,IP]],[`ArgMin`,[PP,IP]],[`Asin`,[sF]],[`Asinh`,[cF]],[`Atan`,[lF]],[`Atanh`,[uF]],[`Attention`,[GP]],[`AveragePool`,[Xz,Yz]],[`BatchNormalization`,[XP]],[`BiasAdd`,[eF]],[`BiasSplitGelu`,[XF]],[`Cast`,[fF,dF]],[`Ceil`,[hF]],[`Clip`,[mF]],[`Concat`,[gI,_I]],[`Conv`,[uL,oL]],[`ConvTranspose`,[SL,vL]],[`Cos`,[gF]],[`Cosh`,[_F]],[`CumSum`,[TL,EL]],[`DepthToSpace`,[jL,ML]],[`DequantizeLinear`,[cB,lB]],[`Div`,[nI]],[`Einsum`,[UL,WL]],[`Elu`,[yF,vF]],[`Equal`,[rI]],[`Erf`,[xF]],[`Exp`,[SF]],[`Expand`,[XL]],[`FastGelu`,[$L]],[`Floor`,[CF]],[`FusedConv`,[uL,oL]],[`Gather`,[iR,rR]],[`GatherElements`,[vR,_R]],[`GatherBlockQuantized`,[fR,pR]],[`GatherND`,[sR,cR]],[`Gelu`,[wF]],[`Gemm`,[CR,SR]],[`GlobalAveragePool`,[$z,Qz]],[`GlobalMaxPool`,[iB,rB]],[`Greater`,[sI]],[`GreaterOrEqual`,[lI]],[`GridSample`,[LR,RR]],[`GroupQueryAttention`,[uz]],[`HardSigmoid`,[MF,jF]],[`InstanceNormalization`,[hz]],[`LayerNormalization`,[yz]],[`LeakyRelu`,[TF,vF]],[`Less`,[cI]],[`LessOrEqual`,[uI]],[`Log`,[UF]],[`MatMul`,[Sz]],[`MatMulNBits`,[Dz,Oz]],[`MaxPool`,[tB,nB]],[`Mul`,[iI]],[`MultiHeadAttention`,[KR,HR]],[`Neg`,[DF]],[`Not`,[EF]],[`Pad`,[Rz]],[`Pow`,[aI]],[`QuickGelu`,[KF,vF]],[`Range`,[pB]],[`Reciprocal`,[OF]],[`ReduceMin`,[DP]],[`ReduceMean`,[SP]],[`ReduceMax`,[EP]],[`ReduceSum`,[kP]],[`ReduceProd`,[OP]],[`ReduceL1`,[CP]],[`ReduceL2`,[wP]],[`ReduceLogSum`,[jP]],[`ReduceLogSumExp`,[TP]],[`ReduceSumSquare`,[AP]],[`Relu`,[kF]],[`Resize`,[BB,VB]],[`RotaryEmbedding`,[iz]],[`ScatterND`,[bB,yB]],[`Sigmoid`,[AF]],[`Sin`,[NF]],[`Sinh`,[PF]],[`Slice`,[$B,eV]],[`SkipLayerNormalization`,[GB]],[`Split`,[$R,ez]],[`Sqrt`,[FF]],[`Softmax`,[iV,aV]],[`Sub`,[oI]],[`Tan`,[IF]],[`Tanh`,[RF]],[`ThresholdedRelu`,[HF,vF]],[`Tile`,[dV]],[`Transpose`,[FN,IN]],[`Where`,[hV]]])}),yV,bV=J(()=>{"use strict";dj(),EM(),DN(),yV=class{constructor(e){this.backend=e,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,t){this.repo.set(e,t)}run(e,t,n,r,i){$A(e.programInfo.name);let a=this.backend.device,o=this.backend.getComputePassEncoder();this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2);let s=[];for(let e of t)s.push({binding:s.length,resource:{buffer:e.buffer}});for(let e of n)s.push({binding:s.length,resource:{buffer:e.buffer}});i&&s.push({binding:s.length,resource:i});let c=a.createBindGroup({layout:e.computePipeline.getBindGroupLayout(0),entries:s,label:e.programInfo.name});if(this.backend.sessionStatus===`capturing`){let t={kernelId:this.backend.currentKernelId,computePipeline:e.computePipeline,bindGroup:c,dispatchGroup:r};this.backend.capturedCommandList.get(this.backend.currentSessionId).push(t)}o.setPipeline(e.computePipeline),o.setBindGroup(0,c),o.dispatchWorkgroups(...r),this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2+1),this.backend.pendingDispatchNumber++,(this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber||this.backend.queryType===`at-passes`)&&this.backend.endComputePass(),this.backend.pendingDispatchNumber>=this.backend.maxDispatchNumber&&this.backend.flush(),ej(e.programInfo.name)}dispose(){}build(e,t){$A(e.name);let n=this.backend.device,r=[];[{feature:`shader-f16`,extension:`f16`},{feature:`subgroups`,extension:`subgroups`}].forEach(e=>{n.features.has(e.feature)&&r.push(`enable ${e.extension};`)});let i=EN(t,this.backend.device.limits),a=e.getShaderSource(i),o=`${r.join(` +`)} +${i.additionalImplementations} +${a}`,s=n.createShaderModule({code:o,label:e.name});TM(`verbose`,()=>`[WebGPU] ${e.name} shader code: ${o}`);let c=n.createComputePipeline({compute:{module:s,entryPoint:`main`},layout:`auto`,label:e.name});return ej(e.name),{programInfo:e,computePipeline:c,uniformVariablesInfo:i.variablesInfo}}normalizeDispatchGroupSize(e){let t=typeof e==`number`?e:e.x,n=typeof e==`number`?1:e.y||1,r=typeof e==`number`?1:e.z||1,i=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(t<=i&&n<=i&&r<=i)return[t,n,r];let a=t*n*r,o=Math.ceil(Math.sqrt(a));if(o>i){if(o=Math.ceil(Math.cbrt(a)),o>i)throw Error(`Total dispatch size exceeds WebGPU maximum.`);return[o,o,o]}else return[o,o,1]}}}),xV={};fA(xV,{WebGpuBackend:()=>TV});var SV,CV,wV,TV,EV=J(()=>{"use strict";dj(),gM(),EM(),FM(),sN(),vV(),bV(),SV=(e,t)=>{if(t.length!==e.length)throw Error(`inputDependencies length ${t.length} is not equal to inputTensors length ${e.length}.`);let n=[];for(let r=0;r{let r=e.name;return e.shaderCache?.hint&&(r+=`[`+e.shaderCache.hint+`]`),r+=`:`+n+`:${SV(t,e.shaderCache?.inputDependencies??Array(t.length).fill(`dims`))}`,r},wV=class{constructor(e){e&&(this.architecture=e.architecture,this.vendor=e.vendor)}isArchitecture(e){return this.architecture===e}isVendor(e){return this.vendor===e}},TV=class{constructor(){this.currentSessionId=null,this.currentKernelId=null,this.commandEncoder=null,this.computePassEncoder=null,this.maxDispatchNumber=16,this.pendingDispatchNumber=0,this.pendingKernels=[],this.pendingQueries=new Map,this.sessionStatus=`default`,this.capturedCommandList=new Map,this.capturedPendingKernels=new Map,this.sessionExternalDataMapping=new Map}get currentKernelCustomData(){if(this.currentKernelId===null)throw Error(`currentKernelCustomData(): currentKernelId is null. (should not happen)`);let e=this.kernelCustomData.get(this.currentKernelId);return e||(e={},this.kernelCustomData.set(this.currentKernelId,e)),e}async initialize(e,t){this.env=e;let n=[],r={requiredLimits:{maxComputeWorkgroupStorageSize:t.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:t.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:t.limits.maxStorageBufferBindingSize,maxBufferSize:t.limits.maxBufferSize,maxComputeInvocationsPerWorkgroup:t.limits.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupSizeX:t.limits.maxComputeWorkgroupSizeX,maxComputeWorkgroupSizeY:t.limits.maxComputeWorkgroupSizeY,maxComputeWorkgroupSizeZ:t.limits.maxComputeWorkgroupSizeZ},requiredFeatures:n},i=e=>t.features.has(e)&&n.push(e)&&!0;i(`chromium-experimental-timestamp-query-inside-passes`)||i(`timestamp-query`),i(`shader-f16`),i(`subgroups`),this.device=await t.requestDevice(r),this.adapterInfo=new wV(t.info||await t.requestAdapterInfo()),this.gpuDataManager=oN(this),this.programManager=new yV(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,CM(e.logLevel,!!e.debug),this.device.onuncapturederror=e=>{e.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${e.error.message}`)},Object.defineProperty(this.env.webgpu,"device",{value:this.device,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(this.env.webgpu,"adapter",{value:t,writable:!1,enumerable:!0,configurable:!1}),this.setQueryType()}dispose(){typeof this.querySet<`u`&&this.querySet.destroy(),this.gpuDataManager.dispose()}getCommandEncoder(){return this.commandEncoder||=this.device.createCommandEncoder(),this.commandEncoder}getComputePassEncoder(){if(!this.computePassEncoder){let e=this.getCommandEncoder(),t={};this.queryType===`at-passes`&&(t.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:this.pendingDispatchNumber*2,endOfPassWriteIndex:this.pendingDispatchNumber*2+1}),this.computePassEncoder=e.beginComputePass(t)}return this.computePassEncoder}endComputePass(){this.computePassEncoder&&=(this.computePassEncoder.end(),null)}flush(){if(!this.commandEncoder)return;$A(),this.endComputePass();let e;this.queryType!==`none`&&(this.commandEncoder.resolveQuerySet(this.querySet,0,this.pendingDispatchNumber*2,this.queryResolveBuffer,0),e=this.device.createBuffer({size:this.pendingDispatchNumber*2*8,usage:GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST}),this.pendingQueries.set(e,this.pendingKernels),this.pendingKernels=[],this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,e,0,this.pendingDispatchNumber*2*8)),this.device.queue.submit([this.commandEncoder.finish()]),this.gpuDataManager.refreshPendingBuffers(),this.commandEncoder=null,this.pendingDispatchNumber=0,this.queryType!==`none`&&e.mapAsync(GPUMapMode.READ).then(()=>{let t=new BigUint64Array(e.getMappedRange()),n=this.pendingQueries.get(e);for(let e=0;e`u`&&(this.queryTimeBase=d);let p=Number(d-this.queryTimeBase),m=Number(f-this.queryTimeBase);if(!Number.isSafeInteger(p)||!Number.isSafeInteger(m))throw RangeError(`incorrect timestamp range`);if(this.env.webgpu.profiling?.ondata)this.env.webgpu.profiling.ondata({version:1,inputsMetadata:l.map(e=>({dims:e.dims,dataType:lM(e.dataType)})),outputsMetadata:u.map(e=>({dims:e.dims,dataType:lM(e.dataType)})),kernelId:i,kernelType:o,kernelName:s,programName:c,startTime:p,endTime:m});else{let e=``;l.forEach((t,n)=>{e+=`input[${n}]: [${t.dims}] | ${lM(t.dataType)}, `});let t=``;u.forEach((e,n)=>{t+=`output[${n}]: [${e.dims}] | ${lM(e.dataType)}, `}),console.log(`[profiling] kernel "${i}|${o}|${s}|${c}" ${e}${t}execution time: ${m-p} ns`)}ZA(`GPU`,`${c}::${d}::${f}`)}e.unmap(),this.pendingQueries.delete(e)}),ej()}run(e,t,n,r,i,a){$A(e.name);let o=[];for(let e=0;et):n;if(u.length!==s.length)throw Error(`Output size ${u.length} must be equal to ${s.length}.`);let d=[],f=[];for(let e=0;e=a)throw Error(`Invalid output index: ${u[e]}`);if(u[e]===-3)continue;let t=u[e]===-1,n=u[e]===-2,o=t||n?i(s[e].dataType,s[e].dims):r(u[e],s[e].dataType,s[e].dims);if(d.push(o),o.data===0)continue;let c=this.gpuDataManager.get(o.data);if(!c)throw Error(`no GPU data for output: ${o.data}`);if(t&&this.temporaryData.push(c),n){let e=this.kernelPersistentData.get(this.currentKernelId);e||(e=[],this.kernelPersistentData.set(this.currentKernelId,e)),e.push(c)}f.push(c)}if(o.length!==t.length||f.length!==d.length){if(f.length===0)return ej(e.name),d;throw Error(`Program ${e.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`)}let p;if(l){let e=0,t=[];l.forEach(n=>{let r=typeof n.data==`number`?[n.data]:n.data;if(r.length===0)return;let i=n.type===10?2:4,a,o;n.type===10?(o=r.length>4?16:r.length>2?8:r.length*i,a=r.length>4?16:i*r.length):(o=r.length<=2?r.length*i:16,a=16),e=Math.ceil(e/o)*o,t.push(e);let s=n.type===10?8:4;e+=r.length>4?Math.ceil(r.length/s)*a:r.length*i}),e=Math.ceil(e/16)*16;let n=new ArrayBuffer(e);l.forEach((e,r)=>{let i=t[r],a=typeof e.data==`number`?[e.data]:e.data;if(e.type===6)new Int32Array(n,i,a.length).set(a);else if(e.type===12)new Uint32Array(n,i,a.length).set(a);else if(e.type===10)new Uint16Array(n,i,a.length).set(a);else if(e.type===1)new Float32Array(n,i,a.length).set(a);else throw Error(`Unsupported uniform type: ${lM(e.type)}`)});let r=this.gpuDataManager.create(e,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);this.device.queue.writeBuffer(r.buffer,0,n,0,e),this.gpuDataManager.release(r.id),p={offset:0,size:e,buffer:r.buffer}}let m=this.programManager.normalizeDispatchGroupSize(c),h=m[1]===1&&m[2]===1,g=CV(e,t,h),_=this.programManager.getArtifact(g);if(_||(_=this.programManager.build(e,m),this.programManager.setArtifact(g,_),TM(`info`,()=>`[artifact] key: ${g}, programName: ${e.name}`)),l&&_.uniformVariablesInfo){if(l.length!==_.uniformVariablesInfo.length)throw Error(`Uniform variables count mismatch: expect ${_.uniformVariablesInfo.length}, got ${l.length} in program "${_.programInfo.name}".`);for(let e=0;e`[ProgramManager] run "${e.name}" (key=${g}) with ${m[0]}x${m[1]}x${m[2]}`),this.queryType!==`none`||this.sessionStatus===`capturing`){let e={kernelId:this.currentKernelId,programName:_.programInfo.name,inputTensorViews:t,outputTensorViews:d};this.pendingKernels.push(e),this.sessionStatus===`capturing`&&this.capturedPendingKernels.get(this.currentSessionId).push(e)}return this.programManager.run(_,o,f,m,p),ej(e.name),d}upload(e,t){this.gpuDataManager.upload(e,t)}memcpy(e,t){this.gpuDataManager.memcpy(e,t)}async download(e,t){await this.gpuDataManager.download(e,t)}alloc(e){return this.gpuDataManager.create(e).id}free(e){return this.gpuDataManager.release(e)}createKernel(e,t,n,r){let i=_V.get(e);if(!i)throw Error(`kernel not implemented: ${e}`);let a={kernelType:e,kernelName:r,kernelEntry:i[0],attributes:[i[1],n]};this.kernels.set(t,a)}releaseKernel(e){let t=this.kernelPersistentData.get(e);if(t){for(let e of t)this.gpuDataManager.release(e.id);this.kernelPersistentData.delete(e)}this.kernelCustomData.delete(e),this.kernels.delete(e)}computeKernel(e,t,n){let r=this.kernels.get(e);if(!r)throw Error(`kernel not created: ${e}`);let i=r.kernelType,a=r.kernelName,o=r.kernelEntry,s=r.attributes;if(this.currentKernelId!==null)throw Error(`kernel "[${i}] ${a}" is not allowed to be called recursively`);this.currentKernelId=e,s[0]&&=(s[1]=s[0](s[1]),void 0),TM(`info`,()=>`[WebGPU] Start to run kernel "[${i}] ${a}"...`);let c=this.env.debug;this.temporaryData=[];try{return c&&this.device.pushErrorScope(`validation`),o(t,s[1]),0}catch(e){return n.push(Promise.resolve(`[WebGPU] Kernel "[${i}] ${a}" failed. ${e}`)),1}finally{c&&n.push(this.device.popErrorScope().then(e=>e?`GPU validation error for kernel "[${i}] ${a}": ${e.message}`:null));for(let e of this.temporaryData)this.gpuDataManager.release(e.id);this.temporaryData=[],this.currentKernelId=null}}registerBuffer(e,t,n,r){let i=this.sessionExternalDataMapping.get(e);i||(i=new Map,this.sessionExternalDataMapping.set(e,i));let a=i.get(t),o=this.gpuDataManager.registerExternalBuffer(n,r,a);return i.set(t,[o,n]),o}unregisterBuffers(e){let t=this.sessionExternalDataMapping.get(e);t&&(t.forEach(e=>this.gpuDataManager.unregisterExternalBuffer(e[0])),this.sessionExternalDataMapping.delete(e))}getBuffer(e){let t=this.gpuDataManager.get(e);if(!t)throw Error(`no GPU data for buffer: ${e}`);return t.buffer}createDownloader(e,t,n){return async()=>{let r=await iN(this,e,t);return PM(r.buffer,n)}}writeTimestamp(e){this.queryType===`inside-passes`&&this.computePassEncoder.writeTimestamp(this.querySet,e)}setQueryType(){this.queryType=`none`,(this.env.webgpu.profiling?.mode==="default"||(typeof this.env.trace>`u`?this.env.wasm.trace:this.env.trace))&&(this.device.features.has(`chromium-experimental-timestamp-query-inside-passes`)?this.queryType=`inside-passes`:this.device.features.has(`timestamp-query`)&&(this.queryType=`at-passes`),this.queryType!==`none`&&typeof this.querySet>`u`&&(this.querySet=this.device.createQuerySet({type:`timestamp`,count:this.maxDispatchNumber*2}),this.queryResolveBuffer=this.device.createBuffer({size:this.maxDispatchNumber*2*8,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.QUERY_RESOLVE})))}captureBegin(){TM(`info`,`captureBegin`),this.capturedCommandList.get(this.currentSessionId)||this.capturedCommandList.set(this.currentSessionId,[]),this.capturedPendingKernels.get(this.currentSessionId)||this.capturedPendingKernels.set(this.currentSessionId,[]),this.flush(),this.sessionStatus=`capturing`}captureEnd(){TM(`info`,`captureEnd`),this.flush(),this.sessionStatus=`default`}replay(){TM(`info`,`replay`),this.sessionStatus=`replaying`;let e=this.capturedCommandList.get(this.currentSessionId),t=this.capturedPendingKernels.get(this.currentSessionId),n=e.length;this.pendingKernels=[];for(let r=0;r=this.maxDispatchNumber||this.queryType===`at-passes`)&&this.endComputePass(),this.pendingDispatchNumber>=this.maxDispatchNumber&&this.flush()}this.flush(),this.sessionStatus=`default`}onCreateSession(){this.gpuDataManager.onCreateSession()}onReleaseSession(e){this.unregisterBuffers(e),this.capturedCommandList.has(e)&&this.capturedCommandList.delete(e),this.capturedPendingKernels.has(e)&&this.capturedPendingKernels.delete(e),this.gpuDataManager.onReleaseSession(e)}onRunStart(e){this.currentSessionId=e,this.setQueryType()}}}),DV={};fA(DV,{init:()=>AV});var OV,kV,AV,jV=J(()=>{"use strict";gM(),EM(),NM(),XM(),OV=class e{constructor(e,t,n,r){this.module=e,this.dataType=t,this.data=n,this.dims=r}getFloat32Array(){if(this.dataType!==1)throw Error(`Invalid data type`);let e=Y.size(this.dims);return e===0?new Float32Array:new Float32Array(this.module.HEAP8.buffer,this.data,e)}getBigInt64Array(){if(this.dataType!==7)throw Error(`Invalid data type`);let e=Y.size(this.dims);return e===0?new BigInt64Array:new BigInt64Array(this.module.HEAP8.buffer,this.data,e)}getInt32Array(){if(this.dataType!==6)throw Error(`Invalid data type`);let e=Y.size(this.dims);return e===0?new Int32Array:new Int32Array(this.module.HEAP8.buffer,this.data,e)}getUint16Array(){if(this.dataType!==10&&this.dataType!==4)throw Error(`Invalid data type`);let e=Y.size(this.dims);return e===0?new Uint16Array:new Uint16Array(this.module.HEAP8.buffer,this.data,e)}reshape(t){if(Y.size(t)!==Y.size(this.dims))throw Error(`Invalid new shape`);return new e(this.module,this.dataType,this.data,t)}},kV=class{constructor(e,t,n){this.module=e,this.backend=t,this.customDataOffset=0,this.customDataSize=0,this.adapterInfo=t.adapterInfo;let r=e.PTR_SIZE,i=n/e.PTR_SIZE,a=r===4?`i32`:`i64`;this.opKernelContext=Number(e.getValue(r*i++,a));let o=Number(e.getValue(r*i++,a));this.outputCount=Number(e.getValue(r*i++,a)),this.customDataOffset=Number(e.getValue(r*i++,`*`)),this.customDataSize=Number(e.getValue(r*i++,a));let s=[];for(let t=0;ttypeof e==`number`?this.inputs[e]:e)??this.inputs,r=t?.outputs??[];return this.backend.run(e,n,r,(e,t,n)=>new OV(this.module,t,this.output(e,n),n),(e,t)=>{let n=uM(e,t);if(!n)throw Error(`Unsupported data type: ${e}`);let r=n>0?this.backend.gpuDataManager.create(n).id:0;return new OV(this.module,e,r,t)},this.outputCount)}output(e,t){let n=this.module.stackSave();try{let n=this.module.PTR_SIZE,r=n===4?`i32`:`i64`,i=this.module.stackAlloc((1+t.length)*n);this.module.setValue(i,t.length,r);for(let e=0;e{let i=t.jsepInit;if(!i)throw Error(`Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.`);if(e===`webgpu`){let e=(EV(),mA(xV)).WebGpuBackend,a=new e;await a.initialize(n,r),i(`webgpu`,[a,e=>a.alloc(Number(e)),e=>a.free(e),(e,n,r,i=!1)=>{if(i)TM(`verbose`,()=>`[WebGPU] jsepCopyGpuToGpu: src=${Number(e)}, dst=${Number(n)}, size=${Number(r)}`),a.memcpy(Number(e),Number(n));else{TM(`verbose`,()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${Number(e)}, gpuDataId=${Number(n)}, size=${Number(r)}`);let i=t.HEAPU8.subarray(Number(e>>>0),Number(e>>>0)+Number(r));a.upload(Number(n),i)}},async(e,n,r)=>{TM(`verbose`,()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${e}, dataOffset=${n}, size=${r}`),await a.download(Number(e),()=>t.HEAPU8.subarray(Number(n)>>>0,Number(n+r)>>>0))},(e,n,r)=>a.createKernel(e,Number(n),r,t.UTF8ToString(t._JsepGetNodeName(Number(n)))),e=>a.releaseKernel(e),(e,n,r,i)=>{TM(`verbose`,()=>`[WebGPU] jsepRun: sessionHandle=${r}, kernel=${e}, contextDataOffset=${n}`);let o=new kV(t,a,Number(n));return a.computeKernel(Number(e),o,i)},()=>a.captureBegin(),()=>a.captureEnd(),()=>a.replay()])}else{let e=new YM(n);i(`webnn`,[e,()=>e.reserveTensorId(),t=>e.releaseTensorId(t),async(t,n,r,i,a)=>e.ensureTensor(t,n,r,i,a),(t,n)=>{e.uploadTensor(t,n)},async(t,n)=>e.downloadTensor(t,n)])}}}),MV,NV,PV,FV,IV,LV,RV,zV,BV,VV,HV,UV,WV,GV=J(()=>{"use strict";eM(),sM(),gM(),Jj(),Qj(),vM(),MV=(e,t)=>{qj()._OrtInit(e,t)!==0&&Zj(`Can't initialize onnxruntime.`)},NV=async e=>{MV(e.wasm.numThreads,fM(e.logLevel))},PV=async(e,t)=>{qj().asyncInit?.();{let n=(jV(),mA(DV)).init;if(t===`webgpu`){if(typeof navigator>`u`||!navigator.gpu)throw Error(`WebGPU is not supported in current environment`);let t=e.webgpu.adapter;if(t){if(typeof t.limits!=`object`||typeof t.features!=`object`||typeof t.requestDevice!=`function`)throw Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let n=e.webgpu.powerPreference;if(n!==void 0&&n!==`low-power`&&n!==`high-performance`)throw Error(`Invalid powerPreference setting: "${n}"`);let r=e.webgpu.forceFallbackAdapter;if(r!==void 0&&typeof r!=`boolean`)throw Error(`Invalid forceFallbackAdapter setting: "${r}"`);if(t=await navigator.gpu.requestAdapter({powerPreference:n,forceFallbackAdapter:r}),!t)throw Error(`Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.`)}await n(`webgpu`,qj(),e,t)}if(t===`webnn`){if(typeof navigator>`u`||!navigator.ml)throw Error(`WebNN is not supported in current environment`);await n(`webnn`,qj(),e)}}},FV=new Map,IV=e=>{let t=qj(),n=t.stackSave();try{let n=t.PTR_SIZE,r=t.stackAlloc(2*n);t._OrtGetInputOutputCount(e,r,r+n)!==0&&Zj(`Can't get session input/output count.`);let i=n===4?`i32`:`i64`;return[Number(t.getValue(r,i)),Number(t.getValue(r+n,i))]}finally{t.stackRestore(n)}},LV=(e,t)=>{let n=qj(),r=n.stackSave(),i=0;try{let r=n.PTR_SIZE,a=n.stackAlloc(2*r);n._OrtGetInputOutputMetadata(e,t,a,a+r)!==0&&Zj(`Can't get session input/output metadata.`);let o=Number(n.getValue(a,`*`));i=Number(n.getValue(a+r,`*`));let s=n.HEAP32[i/4];if(s===0)return[o,0];let c=n.HEAPU32[i/4+1],l=[];for(let e=0;e{let t=qj(),n=t._malloc(e.byteLength);if(n===0)throw Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return t.HEAPU8.set(e,n),[n,e.byteLength]},zV=async(e,t)=>{let n,r,i=qj();Array.isArray(e)?[n,r]=e:e.buffer===i.HEAPU8.buffer?[n,r]=[e.byteOffset,e.byteLength]:[n,r]=RV(e);let a=0,o=0,s=0,c=[],l=[],u=[];try{if([o,c]=await oM(t),t?.externalData&&i.mountExternalData){let e=[];for(let n of t.externalData){let t=typeof n==`string`?n:n.path;e.push(_M(typeof n==`string`?n:n.data).then(e=>{i.mountExternalData(t,e)}))}await Promise.all(e)}for(let e of t?.executionProviders??[])if((typeof e==`string`?e:e.name)===`webnn`){if(i.shouldTransferToMLTensor=!1,typeof e!=`string`){let t=e,n=t?.context,r=t?.gpuDevice,a=t?.deviceType,o=t?.powerPreference;n?i.currentContext=n:r?i.currentContext=await i.webnnCreateMLContext(r):i.currentContext=await i.webnnCreateMLContext({deviceType:a,powerPreference:o})}else i.currentContext=await i.webnnCreateMLContext();break}a=await i._OrtCreateSession(n,r,o),i.webgpuOnCreateSession?.(a),a===0&&Zj(`Can't create a session.`),i.jsepOnCreateSession?.(),i.currentContext&&(i.webnnRegisterMLContext(a,i.currentContext),i.currentContext=void 0,i.shouldTransferToMLTensor=!0);let[e,d]=IV(a),f=!!t?.enableGraphCapture,p=[],m=[],h=[],g=[],_=[];for(let t=0;te===`gpu-buffer`||e===`ml-tensor`)&&(s=i._OrtCreateBinding(a),s===0&&Zj(`Can't create IO binding.`),v={handle:s,outputPreferredLocations:_,outputPreferredLocationsEncoded:_.map(e=>hM(e))}),FV.set(a,[a,l,u,v,f,!1]),[a,p,m,h,g]}catch(e){throw l.forEach(e=>i._OrtFree(e)),u.forEach(e=>i._OrtFree(e)),s!==0&&i._OrtReleaseBinding(s)!==0&&Zj(`Can't release IO binding.`),a!==0&&i._OrtReleaseSession(a)!==0&&Zj(`Can't release session.`),e}finally{i._free(n),o!==0&&i._OrtReleaseSessionOptions(o)!==0&&Zj(`Can't release session options.`),c.forEach(e=>i._free(e)),i.unmountExternalData?.()}},BV=e=>{let t=qj(),n=FV.get(e);if(!n)throw Error(`cannot release session. invalid session id: ${e}`);let[r,i,a,o,s]=n;o&&(s&&t._OrtClearBoundOutputs(o.handle)!==0&&Zj(`Can't clear bound outputs.`),t._OrtReleaseBinding(o.handle)!==0&&Zj(`Can't release IO binding.`)),t.jsepOnReleaseSession?.(e),t.webnnOnReleaseSession?.(e),t.webgpuOnReleaseSession?.(e),i.forEach(e=>t._OrtFree(e)),a.forEach(e=>t._OrtFree(e)),t._OrtReleaseSession(r)!==0&&Zj(`Can't release session.`),FV.delete(e)},VV=async(e,t,n,r,i,a,o=!1)=>{if(!e){t.push(0);return}let s=qj(),c=s.PTR_SIZE,l=e[0],u=e[1],d=e[3],f=d,p,m;if(l===`string`&&(d===`gpu-buffer`||d===`ml-tensor`))throw Error(`String tensor is not supported on GPU.`);if(o&&d!==`gpu-buffer`)throw Error(`External buffer must be provided for input/output index ${a} when enableGraphCapture is true.`);if(d===`gpu-buffer`){let t=e[2].gpuBuffer;m=uM(cM(l),u);{let e=s.jsepRegisterBuffer;if(!e)throw Error(`Tensor location "gpu-buffer" is not supported without using WebGPU.`);p=e(r,a,t,m)}}else if(d===`ml-tensor`){let t=e[2].mlTensor;m=uM(cM(l),u);let n=s.webnnRegisterMLTensor;if(!n)throw Error(`Tensor location "ml-tensor" is not supported without using WebNN.`);p=n(r,t,cM(l),u)}else{let t=e[2];if(Array.isArray(t)){m=c*t.length,p=s._malloc(m),n.push(p);for(let e=0;es.setValue(g+t*c,e,c===4?`i32`:`i64`));let e=s._OrtCreateTensor(cM(l),p,m,g,u.length,hM(f));e===0&&Zj(`Can't create tensor for input/output. session=${r}, index=${a}.`),t.push(e)}finally{s.stackRestore(h)}},HV=async(e,t,n,r,i,a)=>{let o=qj(),s=o.PTR_SIZE,c=FV.get(e);if(!c)throw Error(`cannot run inference. invalid session id: ${e}`);let l=c[0],u=c[1],d=c[2],f=c[3],p=c[4],m=c[5],h=t.length,g=r.length,_=0,v=[],y=[],b=[],x=[],S=o.stackSave(),C=o.stackAlloc(h*s),w=o.stackAlloc(h*s),T=o.stackAlloc(g*s),E=o.stackAlloc(g*s);try{[_,v]=$j(a);for(let r=0;re*t,1);d=lM(a);let _=f?.outputPreferredLocations[r[t]];if(d===`string`){if(_===`gpu-buffer`||_===`ml-tensor`)throw Error(`String tensor is not supported on GPU.`);let e=[];for(let t=0;t0){let e=o.jsepGetBuffer;if(!e)throw Error(`preferredLocation "gpu-buffer" is not supported without using WebGPU.`);let t=e(p),r=uM(a,g);if(r===void 0||!pM(d))throw Error(`Unsupported data type: ${d}`);u=!0,S.push([d,h,{gpuBuffer:t,download:o.jsepCreateDownloader(t,r,d),dispose:()=>{o._OrtReleaseTensor(n)!==0&&Zj(`Can't release tensor.`)}},`gpu-buffer`])}else if(_===`ml-tensor`&&g>0){let t=o.webnnEnsureTensor,r=o.webnnIsInt64Supported;if(!t||!r)throw Error(`preferredLocation "ml-tensor" is not supported without using WebNN.`);if(uM(a,g)===void 0||!mM(d))throw Error(`Unsupported data type: ${d}`);if(d===`int64`&&!r(e))throw Error(`preferredLocation "ml-tensor" for int64 output is not supported by current WebNN Context.`);let i=await t(e,p,a,h,!1);u=!0,S.push([d,h,{mlTensor:i,download:o.webnnCreateMLTensorDownloader(p,d),dispose:()=>{o.webnnReleaseTensorId(p),o._OrtReleaseTensor(n)}},`ml-tensor`])}else{let e=new(dM(d))(g);new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(o.HEAPU8.subarray(p,p+e.byteLength)),S.push([d,h,e,`cpu`])}}finally{o.stackRestore(a),d===`string`&&p&&o._free(p),u||o._OrtReleaseTensor(n),o.webnnOnRunEnd?.(l)}}return f&&!p&&(o._OrtClearBoundOutputs(f.handle)!==0&&Zj(`Can't clear bound outputs.`),FV.set(e,[l,u,d,f,p,!1])),S}finally{o.stackRestore(S),y.forEach(e=>o._OrtReleaseTensor(e)),b.forEach(e=>o._OrtReleaseTensor(e)),x.forEach(e=>o._free(e)),_!==0&&o._OrtReleaseRunOptions(_),v.forEach(e=>o._free(e))}},UV=e=>{let t=qj(),n=FV.get(e);if(!n)throw Error(`invalid session id`);let r=n[0],i=t._OrtEndProfiling(r);i===0&&Zj(`Can't get an profile file name.`),t._OrtFree(i)},WV=e=>{let t=[];for(let n of e){let e=n[2];!Array.isArray(e)&&`buffer`in e&&t.push(e.buffer)}return t}}),KV,qV,JV,YV,XV,ZV,QV,$V,eH,tH,nH,rH,iH,aH,oH,sH,cH,lH,uH=J(()=>{"use strict";dj(),GV(),Jj(),Rj(),KV=()=>!!DA.wasm.proxy&&typeof document<`u`,JV=!1,YV=!1,XV=!1,$V=new Map,eH=(e,t)=>{let n=$V.get(e);n?n.push(t):$V.set(e,[t])},tH=()=>{if(JV||!YV||XV||!qV)throw Error(`worker not ready`)},nH=e=>{switch(e.data.type){case`init-wasm`:JV=!1,e.data.err?(XV=!0,QV[1](e.data.err)):(YV=!0,QV[0]()),ZV&&=(URL.revokeObjectURL(ZV),void 0);break;case`init-ep`:case`copy-from`:case`create`:case`release`:case`run`:case`end-profiling`:{let t=$V.get(e.data.type);e.data.err?t.shift()[1](e.data.err):t.shift()[0](e.data.out);break}default:}},rH=async()=>{if(!YV){if(JV)throw Error(`multiple calls to 'initWasm()' detected.`);if(XV)throw Error(`previous call to 'initWasm()' failed.`);if(JV=!0,KV())return new Promise((e,t)=>{qV?.terminate(),Fj().then(([n,r])=>{try{qV=r,qV.onerror=e=>t(e),qV.onmessage=nH,QV=[e,t];let i={type:`init-wasm`,in:DA};!i.in.wasm.wasmPaths&&(n||Tj)&&(i.in.wasm.wasmPaths={wasm:new URL(`/demo/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm`,``+self.location.href).href}),qV.postMessage(i),ZV=n}catch(e){t(e)}},t)});try{await Kj(DA.wasm),await NV(DA),YV=!0}catch(e){throw XV=!0,e}finally{JV=!1}}},iH=async e=>{if(KV())return tH(),new Promise((t,n)=>{eH(`init-ep`,[t,n]);let r={type:`init-ep`,in:{epName:e,env:DA}};qV.postMessage(r)});await PV(DA,e)},aH=async e=>KV()?(tH(),new Promise((t,n)=>{eH(`copy-from`,[t,n]);let r={type:`copy-from`,in:{buffer:e}};qV.postMessage(r,[e.buffer])})):RV(e),oH=async(e,t)=>{if(KV()){if(t?.preferredOutputLocation)throw Error(`session option "preferredOutputLocation" is not supported for proxy.`);return tH(),new Promise((n,r)=>{eH(`create`,[n,r]);let i={type:`create`,in:{model:e,options:{...t}}},a=[];e instanceof Uint8Array&&a.push(e.buffer),qV.postMessage(i,a)})}else return zV(e,t)},sH=async e=>{if(KV())return tH(),new Promise((t,n)=>{eH(`release`,[t,n]);let r={type:`release`,in:e};qV.postMessage(r)});BV(e)},cH=async(e,t,n,r,i,a)=>{if(KV()){if(n.some(e=>e[3]!==`cpu`))throw Error(`input tensor on GPU is not supported for proxy.`);if(i.some(e=>e))throw Error(`pre-allocated output tensor is not supported for proxy.`);return tH(),new Promise((i,o)=>{eH(`run`,[i,o]);let s=n,c={type:`run`,in:{sessionId:e,inputIndices:t,inputs:s,outputIndices:r,options:a}};qV.postMessage(c,WV(s))})}else return HV(e,t,n,r,i,a)},lH=async e=>{if(KV())return tH(),new Promise((t,n)=>{eH(`end-profiling`,[t,n]);let r={type:`end-profiling`,in:e};qV.postMessage(r)});UV(e)}}),dH,fH,pH,mH=J(()=>{"use strict";dj(),uH(),gM(),fj(),vM(),dH=(e,t)=>{switch(e.location){case`cpu`:return[e.type,e.dims,e.data,`cpu`];case`gpu-buffer`:return[e.type,e.dims,{gpuBuffer:e.gpuBuffer},`gpu-buffer`];case`ml-tensor`:return[e.type,e.dims,{mlTensor:e.mlTensor},`ml-tensor`];default:throw Error(`invalid data location: ${e.location} for ${t()}`)}},fH=e=>{switch(e[3]){case`cpu`:return new YA(e[0],e[2],e[1]);case`gpu-buffer`:{let t=e[0];if(!pM(t))throw Error(`not supported data type: ${t} for deserializing GPU tensor`);let{gpuBuffer:n,download:r,dispose:i}=e[2];return YA.fromGpuBuffer(n,{dataType:t,dims:e[1],download:r,dispose:i})}case`ml-tensor`:{let t=e[0];if(!mM(t))throw Error(`not supported data type: ${t} for deserializing MLTensor tensor`);let{mlTensor:n,download:r,dispose:i}=e[2];return YA.fromMLTensor(n,{dataType:t,dims:e[1],download:r,dispose:i})}default:throw Error(`invalid data location: ${e[3]}`)}},pH=class{async fetchModelAndCopyToWasmMemory(e){return aH(await _M(e))}async loadModel(e,t){$A();let n;n=typeof e==`string`?await this.fetchModelAndCopyToWasmMemory(e):e,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await oH(n,t),ej()}async dispose(){return sH(this.sessionId)}async run(e,t,n){$A();let r=[],i=[];Object.entries(e).forEach(e=>{let t=e[0],n=e[1],a=this.inputNames.indexOf(t);if(a===-1)throw Error(`invalid input '${t}'`);r.push(n),i.push(a)});let a=[],o=[];Object.entries(t).forEach(e=>{let t=e[0],n=e[1],r=this.outputNames.indexOf(t);if(r===-1)throw Error(`invalid output '${t}'`);a.push(n),o.push(r)});let s=r.map((e,t)=>dH(e,()=>`input "${this.inputNames[i[t]]}"`)),c=a.map((e,t)=>e?dH(e,()=>`output "${this.outputNames[o[t]]}"`):null),l=await cH(this.sessionId,i,s,o,c,n),u={};for(let e=0;e_H,initializeFlags:()=>gH,wasmBackend:()=>vH});var gH,_H,vH,yH=J(()=>{"use strict";dj(),uH(),mH(),gH=()=>{(typeof DA.wasm.initTimeout!=`number`||DA.wasm.initTimeout<0)&&(DA.wasm.initTimeout=0);let e=DA.wasm.simd;if(typeof e!=`boolean`&&e!==void 0&&e!==`fixed`&&e!==`relaxed`&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${e}". Reset it to \`false\` and ignore SIMD feature checking.`),DA.wasm.simd=!1),typeof DA.wasm.proxy!=`boolean`&&(DA.wasm.proxy=!1),typeof DA.wasm.trace!=`boolean`&&(DA.wasm.trace=!1),typeof DA.wasm.numThreads!=`number`||!Number.isInteger(DA.wasm.numThreads)||DA.wasm.numThreads<=0)if(typeof self<`u`&&!self.crossOriginIsolated)DA.wasm.numThreads=1;else{let e=typeof navigator>`u`?dA(`node:os`).cpus().length:navigator.hardwareConcurrency;DA.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},_H=class{async init(e){gH(),await rH(),await iH(e)}async createInferenceSessionHandler(e,t){let n=new pH;return await n.loadModel(e,t),n}},vH=new _H});dj(),dj(),dj();var bH=`1.22.0-dev.20250409-89f8206ba4`,xH=uj;{let e=(yH(),mA(hH)).wasmBackend;_A(`webgpu`,e,5),_A(`webnn`,e,5),_A(`cpu`,e,10),_A(`wasm`,e,10)}Object.defineProperty(DA.versions,"web",{value:bH,enumerable:!0}); +/** +* @license +* Copyright 2021 Google LLC. All Rights Reserved. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================================= +*/ +/** +* @license +* Copyright 2020 Google LLC. All Rights Reserved. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================================= +*/ +/** +* @license +* Copyright 2019 Google LLC. All Rights Reserved. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================================= +*/ +var SH={url:self.location.href},CH={"onnxruntime-common":(e=>{ +/*!*************************************!*\ +!*** external "onnxruntime-common" ***! +\*************************************/ +e.exports=jr}),"onnxruntime-web":(e=>{ +/*!**********************************!*\ +!*** external "onnxruntime-web" ***! +\**********************************/ +e.exports=oA}),"?2ce3":(()=>{ +/*!**********************************!*\ +!*** onnxruntime-node (ignored) ***! +\**********************************/ +}),"?7992":(()=>{ +/*!*************************!*\ +!*** node:fs (ignored) ***! +\*************************/ +}),"?5af5":(()=>{ +/*!***************************!*\ +!*** node:path (ignored) ***! +\***************************/ +}),"?2b25":(()=>{ +/*!***********************!*\ +!*** sharp (ignored) ***! +\***********************/ +}),"?db59":(()=>{ +/*!*************************!*\ +!*** node:fs (ignored) ***! +\*************************/ +}),"?383f":(()=>{ +/*!***************************!*\ +!*** node:path (ignored) ***! +\***************************/ +}),"?fa4b":(()=>{ +/*!**************************!*\ +!*** node:url (ignored) ***! +\**************************/ +}),"./node_modules/@huggingface/jinja/dist/index.js":((e,t,n)=>{ +/*!*******************************************************!*\ +!*** ./node_modules/@huggingface/jinja/dist/index.js ***! +\*******************************************************/ +n.r(t),n.d(t,{Environment:()=>we,Interpreter:()=>Oe,Template:()=>Ge,parse:()=>ie,tokenize:()=>d});var r=Object.freeze({Text:`Text`,NumericLiteral:`NumericLiteral`,StringLiteral:`StringLiteral`,Identifier:`Identifier`,Equals:`Equals`,OpenParen:`OpenParen`,CloseParen:`CloseParen`,OpenStatement:`OpenStatement`,CloseStatement:`CloseStatement`,OpenExpression:`OpenExpression`,CloseExpression:`CloseExpression`,OpenSquareBracket:`OpenSquareBracket`,CloseSquareBracket:`CloseSquareBracket`,OpenCurlyBracket:`OpenCurlyBracket`,CloseCurlyBracket:`CloseCurlyBracket`,Comma:`Comma`,Dot:`Dot`,Colon:`Colon`,Pipe:`Pipe`,CallOperator:`CallOperator`,AdditiveBinaryOperator:`AdditiveBinaryOperator`,MultiplicativeBinaryOperator:`MultiplicativeBinaryOperator`,ComparisonBinaryOperator:`ComparisonBinaryOperator`,UnaryOperator:`UnaryOperator`,Comment:`Comment`}),i=class{constructor(e,t){this.value=e,this.type=t}};function a(e){return/\w/.test(e)}function o(e){return/[0-9]/.test(e)}function s(e){return/\s/.test(e)}var c=[[`{%`,r.OpenStatement],[`%}`,r.CloseStatement],[`{{`,r.OpenExpression],[`}}`,r.CloseExpression],[`(`,r.OpenParen],[`)`,r.CloseParen],[`{`,r.OpenCurlyBracket],[`}`,r.CloseCurlyBracket],[`[`,r.OpenSquareBracket],[`]`,r.CloseSquareBracket],[`,`,r.Comma],[`.`,r.Dot],[`:`,r.Colon],[`|`,r.Pipe],[`<=`,r.ComparisonBinaryOperator],[`>=`,r.ComparisonBinaryOperator],[`==`,r.ComparisonBinaryOperator],[`!=`,r.ComparisonBinaryOperator],[`<`,r.ComparisonBinaryOperator],[`>`,r.ComparisonBinaryOperator],[`+`,r.AdditiveBinaryOperator],[`-`,r.AdditiveBinaryOperator],[`~`,r.AdditiveBinaryOperator],[`*`,r.MultiplicativeBinaryOperator],[`/`,r.MultiplicativeBinaryOperator],[`%`,r.MultiplicativeBinaryOperator],[`=`,r.Equals]],l=new Map([[`n`,` +`],[`t`,` `],[`r`,`\r`],[`b`,`\b`],[`f`,`\f`],[`v`,`\v`],[`'`,`'`],[`"`,`"`],[`\\`,`\\`]]);function u(e,t={}){return e.endsWith(` +`)&&(e=e.slice(0,-1)),t.lstrip_blocks&&(e=e.replace(/^[ \t]*({[#%-])/gm,`$1`)),t.trim_blocks&&(e=e.replace(/([#%-]})\n/g,`$1`)),e.replace(/{%\s*(end)?generation\s*%}/gs,``)}function d(e,t={}){let n=[],d=u(e,t),f=0,p=0,m=e=>{let t=``;for(;e(d[f]);){if(d[f]===`\\`){if(++f,f>=d.length)throw SyntaxError(`Unexpected end of input`);let e=d[f++],n=l.get(e);if(n===void 0)throw SyntaxError(`Unexpected escaped character: ${e}`);t+=n;continue}if(t+=d[f++],f>=d.length)throw SyntaxError(`Unexpected end of input`)}return t},h=()=>{let e=n.at(-1);e&&e.type===r.Text&&(e.value=e.value.trimEnd(),e.value===``&&n.pop())},g=()=>{for(;f0){n.push(new i(e,r.Text));continue}}if(d[f]===`{`&&d[f+1]===`#`){f+=2;let e=d[f]===`-`;e&&++f;let t=``;for(;d[f]!==`#`||d[f+1]!==`}`;){if(f+2>=d.length)throw SyntaxError(`Missing end of comment tag`);t+=d[f++]}let a=t.endsWith(`-`);a&&(t=t.slice(0,-1)),e&&h(),n.push(new i(t,r.Comment)),f+=2,a&&g();continue}if(d.slice(f,f+3)===`{%-`){h(),n.push(new i(`{%`,r.OpenStatement)),f+=3;continue}if(d.slice(f,f+3)===`{{-`){h(),n.push(new i(`{{`,r.OpenExpression)),p=0,f+=3;continue}if(m(s),d.slice(f,f+3)===`-%}`){n.push(new i(`%}`,r.CloseStatement)),f+=3,g();continue}if(d.slice(f,f+3)===`-}}`){n.push(new i(`}}`,r.CloseExpression)),f+=3,g();continue}let t=d[f];if(t===`-`||t===`+`){let e=n.at(-1)?.type;if(e===r.Text||e===void 0)throw SyntaxError(`Unexpected character: ${t}`);switch(e){case r.Identifier:case r.NumericLiteral:case r.StringLiteral:case r.CloseParen:case r.CloseSquareBracket:break;default:{++f;let e=m(o);n.push(new i(`${t}${e}`,e.length>0?r.NumericLiteral:r.UnaryOperator));continue}}}for(let[e,t]of c)if(!(e===`}}`&&p>0)&&d.slice(f,f+e.length)===e){n.push(new i(e,t)),t===r.OpenExpression?p=0:t===r.OpenCurlyBracket?++p:t===r.CloseCurlyBracket&&--p,f+=e.length;continue main}if(t===`'`||t===`"`){++f;let e=m(e=>e!==t);n.push(new i(e,r.StringLiteral)),++f;continue}if(o(t)){let e=m(o);if(d[f]===`.`&&o(d[f+1])){++f;let t=m(o);e=`${e}.${t}`}n.push(new i(e,r.NumericLiteral));continue}if(a(t)){let e=m(a);n.push(new i(e,r.Identifier));continue}throw SyntaxError(`Unexpected character: ${t}`)}return n}var f=class{type=`Statement`},p=class extends f{constructor(e){super(),this.body=e}type=`Program`},m=class extends f{constructor(e,t,n){super(),this.test=e,this.body=t,this.alternate=n}type=`If`},h=class extends f{constructor(e,t,n,r){super(),this.loopvar=e,this.iterable=t,this.body=n,this.defaultBlock=r}type=`For`},g=class extends f{type=`Break`},_=class extends f{type=`Continue`},v=class extends f{constructor(e,t,n){super(),this.assignee=e,this.value=t,this.body=n}type=`Set`},y=class extends f{constructor(e,t,n){super(),this.name=e,this.args=t,this.body=n}type=`Macro`},b=class extends f{constructor(e){super(),this.value=e}type=`Comment`},x=class extends f{type=`Expression`},S=class extends x{constructor(e,t,n){super(),this.object=e,this.property=t,this.computed=n}type=`MemberExpression`},C=class extends x{constructor(e,t){super(),this.callee=e,this.args=t}type=`CallExpression`},w=class extends x{constructor(e){super(),this.value=e}type=`Identifier`},T=class extends x{constructor(e){super(),this.value=e}type=`Literal`},E=class extends T{type=`IntegerLiteral`},D=class extends T{type=`FloatLiteral`},O=class extends T{type=`StringLiteral`},k=class extends T{type=`ArrayLiteral`},A=class extends T{type=`TupleLiteral`},j=class extends T{type=`ObjectLiteral`},M=class extends x{constructor(e,t,n){super(),this.operator=e,this.left=t,this.right=n}type=`BinaryExpression`},N=class extends x{constructor(e,t){super(),this.operand=e,this.filter=t}type=`FilterExpression`},P=class extends f{constructor(e,t){super(),this.filter=e,this.body=t}type=`FilterStatement`},F=class extends x{constructor(e,t){super(),this.lhs=e,this.test=t}type=`SelectExpression`},I=class extends x{constructor(e,t,n){super(),this.operand=e,this.negate=t,this.test=n}type=`TestExpression`},L=class extends x{constructor(e,t){super(),this.operator=e,this.argument=t}type=`UnaryExpression`},ee=class extends x{constructor(e=void 0,t=void 0,n=void 0){super(),this.start=e,this.stop=t,this.step=n}type=`SliceExpression`},te=class extends x{constructor(e,t){super(),this.key=e,this.value=t}type=`KeywordArgumentExpression`},R=class extends x{constructor(e){super(),this.argument=e}type=`SpreadExpression`},ne=class extends f{constructor(e,t,n){super(),this.call=e,this.callerArgs=t,this.body=n}type=`CallStatement`},re=class extends x{constructor(e,t,n){super(),this.condition=e,this.trueExpr=t,this.falseExpr=n}type=`Ternary`};function ie(e){let t=new p([]),n=0;function a(t,r){let i=e[n++];if(!i||i.type!==t)throw Error(`Parser Error: ${r}. ${i.type} !== ${t}.`);return i}function o(e){if(!u(e))throw SyntaxError(`Expected ${e}`);++n}function s(){switch(e[n].type){case r.Comment:return new b(e[n++].value);case r.Text:return d();case r.OpenStatement:return f();case r.OpenExpression:return x();default:throw SyntaxError(`Unexpected token type: ${e[n].type}`)}}function c(...t){return n+t.length<=e.length&&t.every((t,r)=>t===e[n+r].type)}function l(...t){return e[n]?.type===r.OpenStatement&&e[n+1]?.type===r.Identifier&&t.includes(e[n+1]?.value)}function u(...t){return n+t.length<=e.length&&t.every((t,r)=>e[n+r].type===`Identifier`&&t===e[n+r].value)}function d(){return new O(a(r.Text,`Expected text token`).value)}function f(){if(a(r.OpenStatement,`Expected opening statement token`),e[n].type!==r.Identifier)throw SyntaxError(`Unknown statement, got ${e[n].type}`);let t=e[n].value,i;switch(t){case`set`:++n,i=T();break;case`if`:++n,i=ie(),a(r.OpenStatement,`Expected {% token`),o(`endif`),a(r.CloseStatement,`Expected %} token`);break;case`macro`:++n,i=ae(),a(r.OpenStatement,`Expected {% token`),o(`endmacro`),a(r.CloseStatement,`Expected %} token`);break;case`for`:++n,i=oe(),a(r.OpenStatement,`Expected {% token`),o(`endfor`),a(r.CloseStatement,`Expected %} token`);break;case`call`:{++n;let e=null;c(r.OpenParen)&&(e=V());let t=xe();if(t.type!==`Identifier`)throw SyntaxError(`Expected identifier following call statement`);let u=V();a(r.CloseStatement,`Expected closing statement token`);let d=[];for(;!l(`endcall`);)d.push(s());a(r.OpenStatement,`Expected '{%'`),o(`endcall`),a(r.CloseStatement,`Expected closing statement token`),i=new ne(new C(t,u),e,d);break}case`break`:++n,a(r.CloseStatement,`Expected closing statement token`),i=new g;break;case`continue`:++n,a(r.CloseStatement,`Expected closing statement token`),i=new _;break;case`filter`:{++n;let e=xe();e instanceof w&&c(r.OpenParen)&&(e=me(e)),a(r.CloseStatement,`Expected closing statement token`);let t=[];for(;!l(`endfilter`);)t.push(s());a(r.OpenStatement,`Expected '{%'`),o(`endfilter`),a(r.CloseStatement,`Expected '%}'`),i=new P(e,t);break}default:throw SyntaxError(`Unknown statement type: ${t}`)}return i}function x(){a(r.OpenExpression,`Expected opening expression token`);let e=se();return a(r.CloseExpression,`Expected closing expression token`),e}function T(){let e=z(),t=null,i=[];if(c(r.Equals))++n,t=z();else{for(a(r.CloseStatement,`Expected %} token`);!l(`endset`);)i.push(s());a(r.OpenStatement,`Expected {% token`),o(`endset`)}return a(r.CloseStatement,`Expected closing statement token`),new v(e,t,i)}function ie(){let e=se();a(r.CloseStatement,`Expected closing statement token`);let t=[],i=[];for(;!l(`elif`,`else`,`endif`);)t.push(s());if(l(`elif`)){++n,++n;let e=ie();i.push(e)}else if(l(`else`))for(++n,++n,a(r.CloseStatement,`Expected closing statement token`);!l(`endif`);)i.push(s());return new m(e,t,i)}function ae(){let e=xe();if(e.type!==`Identifier`)throw SyntaxError(`Expected identifier following macro statement`);let t=V();a(r.CloseStatement,`Expected closing statement token`);let n=[];for(;!l(`endmacro`);)n.push(s());return new y(e,t,n)}function z(e=!1){let t=e?xe:se,i=[t()],a=c(r.Comma);for(;a&&(++n,i.push(t()),c(r.Comma)););return a?new A(i):i[0]}function oe(){let e=z(!0);if(!(e instanceof w||e instanceof A))throw SyntaxError(`Expected identifier/tuple for the loop variable, got ${e.type} instead`);if(!u(`in`))throw SyntaxError("Expected `in` keyword following loop variable");++n;let t=se();a(r.CloseStatement,`Expected closing statement token`);let i=[];for(;!l(`endfor`,`else`);)i.push(s());let o=[];if(l(`else`))for(++n,++n,a(r.CloseStatement,`Expected closing statement token`);!l(`endfor`);)o.push(s());return new h(e,t,i,o)}function se(){return B()}function B(){let e=ce();if(u(`if`)){++n;let t=ce();return u(`else`)?(++n,new re(t,e,B())):new F(e,t)}return e}function ce(){let t=le();for(;u(`or`);){let r=e[n];++n;let i=le();t=new M(r,t,i)}return t}function le(){let t=ue();for(;u(`and`);){let r=e[n];++n;let i=ue();t=new M(r,t,i)}return t}function ue(){let t;for(;u(`not`);){let r=e[n];++n,t=new L(r,ue())}return t??de()}function de(){let t=fe();for(;;){let a;if(u(`not`,`in`))a=new i(`not in`,r.Identifier),n+=2;else if(u(`in`))a=e[n++];else if(c(r.ComparisonBinaryOperator))a=e[n++];else break;let o=fe();t=new M(a,t,o)}return t}function fe(){let t=ve();for(;c(r.AdditiveBinaryOperator);){let r=e[n];++n;let i=ve();t=new M(r,t,i)}return t}function pe(){let e=_e(xe());return c(r.OpenParen)?me(e):e}function me(e){let t=new C(e,V());return t=_e(t),c(r.OpenParen)&&(t=me(t)),t}function V(){a(r.OpenParen,`Expected opening parenthesis for arguments list`);let e=he();return a(r.CloseParen,`Expected closing parenthesis for arguments list`),e}function he(){let t=[];for(;!c(r.CloseParen);){let i;if(e[n].type===r.MultiplicativeBinaryOperator&&e[n].value===`*`)++n,i=new R(se());else if(i=se(),c(r.Equals)){if(++n,!(i instanceof w))throw SyntaxError(`Expected identifier for keyword argument`);let e=se();i=new te(i,e)}t.push(i),c(r.Comma)&&++n}return t}function ge(){let e=[],t=!1;for(;!c(r.CloseSquareBracket);)c(r.Colon)?(e.push(void 0),++n,t=!0):(e.push(se()),c(r.Colon)&&(++n,t=!0));if(e.length===0)throw SyntaxError(`Expected at least one argument for member/slice expression`);if(t){if(e.length>3)throw SyntaxError(`Expected 0-3 arguments for slice expression`);return new ee(...e)}return e[0]}function _e(t){for(;c(r.Dot)||c(r.OpenSquareBracket);){let i=e[n];++n;let o,s=i.type===r.OpenSquareBracket;if(s)o=ge(),a(r.CloseSquareBracket,`Expected closing square bracket`);else if(o=xe(),o.type!==`Identifier`)throw SyntaxError(`Expected identifier following dot operator`);t=new S(t,o,s)}return t}function ve(){let t=ye();for(;c(r.MultiplicativeBinaryOperator);){let r=e[n++],i=ye();t=new M(r,t,i)}return t}function ye(){let e=be();for(;u(`is`);){++n;let t=u(`not`);t&&++n;let r=xe();if(!(r instanceof w))throw SyntaxError(`Expected identifier for the test`);e=new I(e,t,r)}return e}function be(){let e=pe();for(;c(r.Pipe);){++n;let t=xe();if(!(t instanceof w))throw SyntaxError(`Expected identifier for the filter`);c(r.OpenParen)&&(t=me(t)),e=new N(e,t)}return e}function xe(){let t=e[n++];switch(t.type){case r.NumericLiteral:{let e=t.value;return e.includes(`.`)?new D(Number(e)):new E(Number(e))}case r.StringLiteral:{let i=t.value;for(;c(r.StringLiteral);)i+=e[n++].value;return new O(i)}case r.Identifier:return new w(t.value);case r.OpenParen:{let e=z();return a(r.CloseParen,"Expected closing parenthesis, got ${tokens[current].type} instead."),e}case r.OpenSquareBracket:{let e=[];for(;!c(r.CloseSquareBracket);)e.push(se()),c(r.Comma)&&++n;return++n,new k(e)}case r.OpenCurlyBracket:{let e=new Map;for(;!c(r.CloseCurlyBracket);){let t=se();a(r.Colon,`Expected colon between key and value in object literal`);let i=se();e.set(t,i),c(r.Comma)&&++n}return++n,new j(e)}default:throw SyntaxError(`Unexpected token: ${t.type}`)}}for(;n=0?(t=(t??=0)<0?Math.max(e.length+t,0):Math.min(t,e.length),n=(n??=e.length)<0?Math.max(e.length+n,0):Math.min(n,e.length)):(t=(t??=e.length-1)<0?Math.max(e.length+t,-1):Math.min(t,e.length-1),n=(n??=-1)<-1?Math.max(e.length+n,-1):Math.min(n,e.length-1));let a=[];for(let o=t;i*oe.toUpperCase())}function se(e){return B(new Date,e)}function B(e,t){let n=new Intl.DateTimeFormat(void 0,{month:`long`}),r=new Intl.DateTimeFormat(void 0,{month:`short`}),i=e=>e<10?`0`+e:e.toString();return t.replace(/%[YmdbBHM%]/g,t=>{switch(t){case`%Y`:return e.getFullYear().toString();case`%m`:return i(e.getMonth()+1);case`%d`:return i(e.getDate());case`%b`:return r.format(e);case`%B`:return n.format(e);case`%H`:return i(e.getHours());case`%M`:return i(e.getMinutes());case`%%`:return`%`;default:return t}})}function ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function le(e,t,n,r){if(r===0)return e;let i=r==null||r<0?1/0:r,a=t.length===0?RegExp(`(?=)`,`gu`):new RegExp(ce(t),`gu`);return e.replaceAll(a,e=>i>0?(--i,n):e)}var ue=class extends Error{},de=class extends Error{},fe=class{type=`RuntimeValue`;value;builtins=new Map;constructor(e=void 0){this.value=e}__bool__(){return new he(!!this.value)}toString(){return String(this.value)}},pe=class extends fe{type=`IntegerValue`},me=class extends fe{type=`FloatValue`;toString(){return this.value%1==0?this.value.toFixed(1):this.value.toString()}},V=class extends fe{type=`StringValue`;builtins=new Map([[`upper`,new xe(()=>new V(this.value.toUpperCase()))],[`lower`,new xe(()=>new V(this.value.toLowerCase()))],[`strip`,new xe(()=>new V(this.value.trim()))],[`title`,new xe(()=>new V(oe(this.value)))],[`capitalize`,new xe(()=>new V(this.value.charAt(0).toUpperCase()+this.value.slice(1)))],[`length`,new pe(this.value.length)],[`rstrip`,new xe(()=>new V(this.value.trimEnd()))],[`lstrip`,new xe(()=>new V(this.value.trimStart()))],[`startswith`,new xe(e=>{if(e.length===0)throw Error(`startswith() requires at least one argument`);let t=e[0];if(t instanceof V)return new he(this.value.startsWith(t.value));if(t instanceof ye){for(let e of t.value){if(!(e instanceof V))throw Error(`startswith() tuple elements must be strings`);if(this.value.startsWith(e.value))return new he(!0)}return new he(!1)}throw Error(`startswith() argument must be a string or tuple of strings`)})],[`endswith`,new xe(e=>{if(e.length===0)throw Error(`endswith() requires at least one argument`);let t=e[0];if(t instanceof V)return new he(this.value.endsWith(t.value));if(t instanceof ye){for(let e of t.value){if(!(e instanceof V))throw Error(`endswith() tuple elements must be strings`);if(this.value.endsWith(e.value))return new he(!0)}return new he(!1)}throw Error(`endswith() argument must be a string or tuple of strings`)})],[`split`,new xe(e=>{let t=e[0]??new Se;if(!(t instanceof V||t instanceof Se))throw Error(`sep argument must be a string or null`);let n=e[1]??new pe(-1);if(!(n instanceof pe))throw Error(`maxsplit argument must be a number`);let r=[];if(t instanceof Se){let e=this.value.trimStart();for(let{0:t,index:i}of e.matchAll(/\S+/g)){if(n.value!==-1&&r.length>=n.value&&i!==void 0){r.push(t+e.slice(i+t.length));break}r.push(t)}}else{if(t.value===``)throw Error(`empty separator`);r=this.value.split(t.value),n.value!==-1&&r.length>n.value&&r.push(r.splice(n.value).join(t.value))}return new ye(r.map(e=>new V(e)))})],[`replace`,new xe(e=>{if(e.length<2)throw Error(`replace() requires at least two arguments`);let t=e[0],n=e[1];if(!(t instanceof V&&n instanceof V))throw Error(`replace() arguments must be strings`);let r;if(r=e.length>2?e[2].type===`KeywordArgumentsValue`?e[2].value.get(`count`)??new Se:e[2]:new Se,!(r instanceof pe||r instanceof Se))throw Error(`replace() count argument must be a number or null`);return new V(le(this.value,t.value,n.value,r.value))})]])},he=class extends fe{type=`BooleanValue`};function ge(e,t,n,r=!0){let i=n??0;switch(e.type){case`NullValue`:return`null`;case`UndefinedValue`:return r?`null`:`undefined`;case`IntegerValue`:case`FloatValue`:case`StringValue`:case`BooleanValue`:return JSON.stringify(e.value);case`ArrayValue`:case`ObjectValue`:{let n=t?` `.repeat(t):``,a=` +`+n.repeat(i),o=a+n;if(e.type===`ArrayValue`){let n=e.value.map(e=>ge(e,t,i+1,r));return t?`[${o}${n.join(`,${o}`)}${a}]`:`[${n.join(`, `)}]`}else{let n=Array.from(e.value.entries()).map(([e,n])=>{let a=`"${e}": ${ge(n,t,i+1,r)}`;return t?`${o}${a}`:a});return t?`{${n.join(`,`)}${a}}`:`{${n.join(`, `)}}`}}default:throw Error(`Cannot convert to JSON: ${e.type}`)}}var _e=class extends fe{type=`ObjectValue`;__bool__(){return new he(this.value.size>0)}builtins=new Map([[`get`,new xe(([e,t])=>{if(!(e instanceof V))throw Error(`Object key must be a string: got ${e.type}`);return this.value.get(e.value)??t??new Se})],[`items`,new xe(()=>this.items())],[`keys`,new xe(()=>this.keys())],[`values`,new xe(()=>this.values())],[`dictsort`,new xe(e=>{let t=new Map,n=e.filter(e=>e instanceof ve?(t=e.value,!1):!0),r=n.at(0)??t.get(`case_sensitive`)??new he(!1);if(!(r instanceof he))throw Error(`case_sensitive must be a boolean`);let i=n.at(1)??t.get(`by`)??new V(`key`);if(!(i instanceof V))throw Error(`by must be a string`);if(![`key`,`value`].includes(i.value))throw Error(`by must be either 'key' or 'value'`);let a=n.at(2)??t.get(`reverse`)??new he(!1);if(!(a instanceof he))throw Error(`reverse must be a boolean`);return new ye(Array.from(this.value.entries()).map(([e,t])=>new ye([new V(e),t])).sort((e,t)=>{let n=i.value===`key`?0:1,o=e.value[n],s=t.value[n],c=De(o,s,r.value);return a.value?-c:c}))})]]);items(){return new ye(Array.from(this.value.entries()).map(([e,t])=>new ye([new V(e),t])))}keys(){return new ye(Array.from(this.value.keys()).map(e=>new V(e)))}values(){return new ye(Array.from(this.value.values()))}toString(){return ge(this,null,0,!1)}},ve=class extends _e{type=`KeywordArgumentsValue`},ye=class extends fe{type=`ArrayValue`;builtins=new Map([[`length`,new pe(this.value.length)]]);__bool__(){return new he(this.value.length>0)}toString(){return ge(this,null,0,!1)}},be=class extends ye{type=`TupleValue`},xe=class extends fe{type=`FunctionValue`},Se=class extends fe{type=`NullValue`},Ce=class extends fe{type=`UndefinedValue`},we=class{constructor(e){this.parent=e}variables=new Map([[`namespace`,new xe(e=>{if(e.length===0)return new _e(new Map);if(e.length!==1||!(e[0]instanceof _e))throw Error("`namespace` expects either zero arguments or a single object argument");return e[0]})]]);tests=new Map([[`boolean`,e=>e.type===`BooleanValue`],[`callable`,e=>e instanceof xe],[`odd`,e=>{if(!(e instanceof pe))throw Error(`cannot odd on ${e.type}`);return e.value%2!=0}],[`even`,e=>{if(!(e instanceof pe))throw Error(`cannot even on ${e.type}`);return e.value%2==0}],[`false`,e=>e.type===`BooleanValue`&&!e.value],[`true`,e=>e.type===`BooleanValue`&&e.value],[`none`,e=>e.type===`NullValue`],[`string`,e=>e.type===`StringValue`],[`number`,e=>e instanceof pe||e instanceof me],[`integer`,e=>e instanceof pe],[`iterable`,e=>e.type===`ArrayValue`||e.type===`StringValue`],[`mapping`,e=>e.type===`ObjectValue`],[`lower`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toLowerCase()}],[`upper`,e=>{let t=e.value;return e.type===`StringValue`&&t===t.toUpperCase()}],[`none`,e=>e.type===`NullValue`],[`defined`,e=>e.type!==`UndefinedValue`],[`undefined`,e=>e.type===`UndefinedValue`],[`equalto`,(e,t)=>e.value===t.value],[`eq`,(e,t)=>e.value===t.value]]);set(e,t){return this.declareVariable(e,ke(t))}declareVariable(e,t){if(this.variables.has(e))throw SyntaxError(`Variable already declared: ${e}`);return this.variables.set(e,t),t}setVariable(e,t){return this.variables.set(e,t),t}resolve(e){if(this.variables.has(e))return this;if(this.parent)return this.parent.resolve(e);throw Error(`Unknown variable: ${e}`)}lookupVariable(e){try{return this.resolve(e).variables.get(e)??new Ce}catch{return new Ce}}};function Te(e){e.set(`false`,!1),e.set(`true`,!0),e.set(`none`,null),e.set(`raise_exception`,e=>{throw Error(e)}),e.set(`range`,ae),e.set(`strftime_now`,se),e.set(`True`,!0),e.set(`False`,!1),e.set(`None`,null)}function Ee(e,t){let n=t.split(`.`),r=e;for(let e of n)if(r instanceof _e)r=r.value.get(e)??new Ce;else if(r instanceof ye){let t=parseInt(e,10);if(!isNaN(t)&&t>=0&&te instanceof pe||e instanceof me||e instanceof he,i=e=>e instanceof he?+!!e.value:e.value;if(r(e)&&r(t)){let n=i(e),r=i(t);return nr)}if(e.type!==t.type)throw Error(`Cannot compare different types: ${e.type} and ${t.type}`);switch(e.type){case`StringValue`:{let r=e.value,i=t.value;return n||(r=r.toLowerCase(),i=i.toLowerCase()),ri)}default:throw Error(`Cannot compare type: ${e.type}`)}}var Oe=class{global;constructor(e){this.global=e??new we}run(e){return this.evaluate(e,this.global)}evaluateBinaryExpression(e,t){let n=this.evaluate(e.left,t);switch(e.operator.value){case`and`:return n.__bool__().value?this.evaluate(e.right,t):n;case`or`:return n.__bool__().value?n:this.evaluate(e.right,t)}let r=this.evaluate(e.right,t);switch(e.operator.value){case`==`:return new he(n.value==r.value);case`!=`:return new he(n.value!=r.value)}if(n instanceof Ce||r instanceof Ce){if(r instanceof Ce&&[`in`,`not in`].includes(e.operator.value))return new he(e.operator.value===`not in`);throw Error(`Cannot perform operation ${e.operator.value} on undefined values`)}else if(n instanceof Se||r instanceof Se)throw Error(`Cannot perform operation on null values`);else if(e.operator.value===`~`)return new V(n.value.toString()+r.value.toString());else if((n instanceof pe||n instanceof me)&&(r instanceof pe||r instanceof me)){let t=n.value,i=r.value;switch(e.operator.value){case`+`:case`-`:case`*`:{let a=e.operator.value===`+`?t+i:e.operator.value===`-`?t-i:t*i;return n instanceof me||r instanceof me?new me(a):new pe(a)}case`/`:return new me(t/i);case`%`:{let e=t%i;return n instanceof me||r instanceof me?new me(e):new pe(e)}case`<`:return new he(t`:return new he(t>i);case`>=`:return new he(t>=i);case`<=`:return new he(t<=i)}}else if(n instanceof ye&&r instanceof ye)switch(e.operator.value){case`+`:return new ye(n.value.concat(r.value))}else if(r instanceof ye){let t=r.value.find(e=>e.value===n.value)!==void 0;switch(e.operator.value){case`in`:return new he(t);case`not in`:return new he(!t)}}if(n instanceof V||r instanceof V)switch(e.operator.value){case`+`:return new V(n.value.toString()+r.value.toString())}if(n instanceof V&&r instanceof V)switch(e.operator.value){case`in`:return new he(r.value.includes(n.value));case`not in`:return new he(!r.value.includes(n.value))}if(n instanceof V&&r instanceof _e)switch(e.operator.value){case`in`:return new he(r.value.has(n.value));case`not in`:return new he(!r.value.has(n.value))}throw SyntaxError(`Unknown operator "${e.operator.value}" between ${n.type} and ${r.type}`)}evaluateArguments(e,t){let n=[],r=new Map;for(let i of e)if(i.type===`SpreadExpression`){let e=i,r=this.evaluate(e.argument,t);if(!(r instanceof ye))throw Error(`Cannot unpack non-iterable type: ${r.type}`);for(let e of r.value)n.push(e)}else if(i.type===`KeywordArgumentExpression`){let e=i;r.set(e.key.value,this.evaluate(e.value,t))}else{if(r.size>0)throw Error(`Positional arguments must come before keyword arguments`);n.push(this.evaluate(i,t))}return[n,r]}applyFilter(e,t,n){if(t.type===`Identifier`){let r=t;if(r.value===`tojson`)return new V(ge(e));if(e instanceof ye)switch(r.value){case`list`:return e;case`first`:return e.value[0];case`last`:return e.value[e.value.length-1];case`length`:return new pe(e.value.length);case`reverse`:return new ye(e.value.slice().reverse());case`sort`:return new ye(e.value.slice().sort((e,t)=>De(e,t,!1)));case`join`:return new V(e.value.map(e=>e.value).join(``));case`string`:return new V(ge(e,null,0,!1));case`unique`:{let t=new Set,n=[];for(let r of e.value)t.has(r.value)||(t.add(r.value),n.push(r));return new ye(n)}default:throw Error(`Unknown ArrayValue filter: ${r.value}`)}else if(e instanceof V)switch(r.value){case`length`:case`upper`:case`lower`:case`title`:case`capitalize`:{let t=e.builtins.get(r.value);if(t instanceof xe)return t.value([],n);if(t instanceof pe)return t;throw Error(`Unknown StringValue filter: ${r.value}`)}case`trim`:return new V(e.value.trim());case`indent`:return new V(e.value.split(` +`).map((e,t)=>t===0||e.length===0?e:` `+e).join(` +`));case`join`:case`string`:return e;case`int`:{let t=parseInt(e.value,10);return new pe(isNaN(t)?0:t)}case`float`:{let t=parseFloat(e.value);return new me(isNaN(t)?0:t)}default:throw Error(`Unknown StringValue filter: ${r.value}`)}else if(e instanceof pe||e instanceof me)switch(r.value){case`abs`:return e instanceof pe?new pe(Math.abs(e.value)):new me(Math.abs(e.value));case`int`:return new pe(Math.floor(e.value));case`float`:return new me(e.value);default:throw Error(`Unknown NumericValue filter: ${r.value}`)}else if(e instanceof _e)switch(r.value){case`items`:return new ye(Array.from(e.value.entries()).map(([e,t])=>new ye([new V(e),t])));case`length`:return new pe(e.value.size);default:{let t=e.builtins.get(r.value);if(t)return t instanceof xe?t.value([],n):t;throw Error(`Unknown ObjectValue filter: ${r.value}`)}}else if(e instanceof he)switch(r.value){case`bool`:return new he(e.value);case`int`:return new pe(+!!e.value);case`float`:return new me(+!!e.value);case`string`:return new V(e.value?`true`:`false`);default:throw Error(`Unknown BooleanValue filter: ${r.value}`)}throw Error(`Cannot apply filter "${r.value}" to type: ${e.type}`)}else if(t.type===`CallExpression`){let r=t;if(r.callee.type!==`Identifier`)throw Error(`Unknown filter: ${r.callee.type}`);let i=r.callee.value;if(i===`tojson`){let[,t]=this.evaluateArguments(r.args,n),i=t.get(`indent`)??new Se;if(!(i instanceof pe||i instanceof Se))throw Error(`If set, indent must be a number`);return new V(ge(e,i.value))}else if(i===`join`){let t;if(e instanceof V)t=Array.from(e.value);else if(e instanceof ye)t=e.value.map(e=>e.value);else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`);let[a,o]=this.evaluateArguments(r.args,n),s=a.at(0)??o.get(`separator`)??new V(``);if(!(s instanceof V))throw Error(`separator must be a string`);return new V(t.join(s.value))}else if(i===`int`||i===`float`){let[t,a]=this.evaluateArguments(r.args,n),o=t.at(0)??a.get(`default`)??(i===`int`?new pe(0):new me(0));if(e instanceof V){let t=i===`int`?parseInt(e.value,10):parseFloat(e.value);return isNaN(t)?o:i===`int`?new pe(t):new me(t)}else if(e instanceof pe||e instanceof me)return e;else if(e instanceof he)return i===`int`?new pe(+!!e.value):new me(+!!e.value);else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`)}else if(i==="default"){let[t,i]=this.evaluateArguments(r.args,n),a=t[0]??new V(``),o=t[1]??i.get(`boolean`)??new he(!1);if(!(o instanceof he))throw Error("`default` filter flag must be a boolean");return e instanceof Ce||o.value&&!e.__bool__().value?a:e}if(e instanceof ye){switch(i){case`sort`:{let[t,i]=this.evaluateArguments(r.args,n),a=t.at(0)??i.get(`reverse`)??new he(!1);if(!(a instanceof he))throw Error(`reverse must be a boolean`);let o=t.at(1)??i.get(`case_sensitive`)??new he(!1);if(!(o instanceof he))throw Error(`case_sensitive must be a boolean`);let s=t.at(2)??i.get(`attribute`)??new Se;if(!(s instanceof V||s instanceof pe||s instanceof Se))throw Error(`attribute must be a string, integer, or null`);let c=e=>s instanceof Se?e:Ee(e,s instanceof pe?String(s.value):s.value);return new ye(e.value.slice().sort((e,t)=>{let n=De(c(e),c(t),o.value);return a.value?-n:n}))}case`selectattr`:case`rejectattr`:{let t=i===`selectattr`;if(e.value.some(e=>!(e instanceof _e)))throw Error(`\`${i}\` can only be applied to array of objects`);if(r.args.some(e=>e.type!==`StringLiteral`))throw Error(`arguments of \`${i}\` must be strings`);let[a,o,s]=r.args.map(e=>this.evaluate(e,n)),c;if(o){let e=n.tests.get(o.value);if(!e)throw Error(`Unknown test: ${o.value}`);c=e}else c=(...e)=>e[0].__bool__().value;return new ye(e.value.filter(e=>{let n=e.value.get(a.value),r=n?c(n,s):!1;return t?r:!r}))}case`map`:{let[,t]=this.evaluateArguments(r.args,n);if(t.has(`attribute`)){let n=t.get(`attribute`);if(!(n instanceof V))throw Error(`attribute must be a string`);let r=t.get(`default`);return new ye(e.value.map(e=>{if(!(e instanceof _e))throw Error(`items in map must be an object`);let t=Ee(e,n.value);return t instanceof Ce?r??new Ce:t}))}else throw Error("`map` expressions without `attribute` set are not currently supported.")}}throw Error(`Unknown ArrayValue filter: ${i}`)}else if(e instanceof V){switch(i){case`indent`:{let[t,i]=this.evaluateArguments(r.args,n),a=t.at(0)??i.get(`width`)??new pe(4);if(!(a instanceof pe))throw Error(`width must be a number`);let o=t.at(1)??i.get(`first`)??new he(!1),s=t.at(2)??i.get(`blank`)??new he(!1),c=e.value.split(` +`),l=` `.repeat(a.value);return new V(c.map((e,t)=>!o.value&&t===0||!s.value&&e.length===0?e:l+e).join(` +`))}case`replace`:{let t=e.builtins.get(`replace`);if(!(t instanceof xe))throw Error(`replace filter not available`);let[i,a]=this.evaluateArguments(r.args,n);return t.value([...i,new ve(a)],n)}}throw Error(`Unknown StringValue filter: ${i}`)}else if(e instanceof _e){let t=e.builtins.get(i);if(t&&t instanceof xe){let[e,i]=this.evaluateArguments(r.args,n);return i.size>0&&e.push(new ve(i)),t.value(e,n)}throw Error(`Unknown ObjectValue filter: ${i}`)}else throw Error(`Cannot apply filter "${i}" to type: ${e.type}`)}throw Error(`Unknown filter: ${t.type}`)}evaluateFilterExpression(e,t){let n=this.evaluate(e.operand,t);return this.applyFilter(n,e.filter,t)}evaluateTestExpression(e,t){let n=this.evaluate(e.operand,t),r=t.tests.get(e.test.value);if(!r)throw Error(`Unknown test: ${e.test.value}`);let i=r(n);return new he(e.negate?!i:i)}evaluateSelectExpression(e,t){return this.evaluate(e.test,t).__bool__().value?this.evaluate(e.lhs,t):new Ce}evaluateUnaryExpression(e,t){let n=this.evaluate(e.argument,t);switch(e.operator.value){case`not`:return new he(!n.value);default:throw SyntaxError(`Unknown operator: ${e.operator.value}`)}}evaluateTernaryExpression(e,t){return this.evaluate(e.condition,t).__bool__().value?this.evaluate(e.trueExpr,t):this.evaluate(e.falseExpr,t)}evalProgram(e,t){return this.evaluateBlock(e.body,t)}evaluateBlock(e,t){let n=``;for(let r of e){let e=this.evaluate(r,t);e.type!==`NullValue`&&e.type!==`UndefinedValue`&&(n+=e.toString())}return new V(n)}evaluateIdentifier(e,t){return t.lookupVariable(e.value)}evaluateCallExpression(e,t){let[n,r]=this.evaluateArguments(e.args,t);r.size>0&&n.push(new ve(r));let i=this.evaluate(e.callee,t);if(i.type!==`FunctionValue`)throw Error(`Cannot call something that is not a function: got ${i.type}`);return i.value(n,t)}evaluateSliceExpression(e,t,n){if(!(e instanceof ye||e instanceof V))throw Error(`Slice object must be an array or string`);let r=this.evaluate(t.start,n),i=this.evaluate(t.stop,n),a=this.evaluate(t.step,n);if(!(r instanceof pe||r instanceof Ce))throw Error(`Slice start must be numeric or undefined`);if(!(i instanceof pe||i instanceof Ce))throw Error(`Slice stop must be numeric or undefined`);if(!(a instanceof pe||a instanceof Ce))throw Error(`Slice step must be numeric or undefined`);return e instanceof ye?new ye(z(e.value,r.value,i.value,a.value)):new V(z(Array.from(e.value),r.value,i.value,a.value).join(``))}evaluateMemberExpression(e,t){let n=this.evaluate(e.object,t),r;if(e.computed){if(e.property.type===`SliceExpression`)return this.evaluateSliceExpression(n,e.property,t);r=this.evaluate(e.property,t)}else r=new V(e.property.value);let i;if(n instanceof _e){if(!(r instanceof V))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.value.get(r.value)??n.builtins.get(r.value)}else if(n instanceof ye||n instanceof V)if(r instanceof pe)i=n.value.at(r.value),n instanceof V&&(i=new V(n.value.at(r.value)));else if(r instanceof V)i=n.builtins.get(r.value);else throw Error(`Cannot access property with non-string/non-number: got ${r.type}`);else{if(!(r instanceof V))throw Error(`Cannot access property with non-string: got ${r.type}`);i=n.builtins.get(r.value)}return i instanceof fe?i:new Ce}evaluateSet(e,t){let n=e.value?this.evaluate(e.value,t):this.evaluateBlock(e.body,t);if(e.assignee.type===`Identifier`){let r=e.assignee.value;t.setVariable(r,n)}else if(e.assignee.type===`TupleLiteral`){let r=e.assignee;if(!(n instanceof ye))throw Error(`Cannot unpack non-iterable type in set: ${n.type}`);let i=n.value;if(i.length!==r.value.length)throw Error(`Too ${r.value.length>i.length?`few`:`many`} items to unpack in set`);for(let e=0;et.setVariable(e.loopvar.value,c);else if(e.loopvar.type===`TupleLiteral`){let t=e.loopvar;if(c.type!==`ArrayValue`)throw Error(`Cannot unpack non-iterable type: ${c.type}`);let n=c;if(t.value.length!==n.value.length)throw Error(`Too ${t.value.length>n.value.length?`few`:`many`} items to unpack`);l=e=>{for(let r=0;r0?a[t-1]:new Ce],[`nextitem`,t{let r=new we(n);t=t.slice();let i;t.at(-1)?.type===`KeywordArgumentsValue`&&(i=t.pop());for(let n=0;n{let r=new we(n);if(e.callerArgs)for(let n=0;nthis.evaluate(e,t)));case`TupleLiteral`:return new be(e.value.map(e=>this.evaluate(e,t)));case`ObjectLiteral`:{let n=new Map;for(let[r,i]of e.value){let e=this.evaluate(r,t);if(!(e instanceof V))throw Error(`Object keys must be strings: got ${e.type}`);n.set(e.value,this.evaluate(i,t))}return new _e(n)}case`Identifier`:return this.evaluateIdentifier(e,t);case`CallExpression`:return this.evaluateCallExpression(e,t);case`MemberExpression`:return this.evaluateMemberExpression(e,t);case`UnaryExpression`:return this.evaluateUnaryExpression(e,t);case`BinaryExpression`:return this.evaluateBinaryExpression(e,t);case`FilterExpression`:return this.evaluateFilterExpression(e,t);case`FilterStatement`:return this.evaluateFilterStatement(e,t);case`TestExpression`:return this.evaluateTestExpression(e,t);case`SelectExpression`:return this.evaluateSelectExpression(e,t);case`Ternary`:return this.evaluateTernaryExpression(e,t);case`Comment`:return new Se;default:throw SyntaxError(`Unknown node type: ${e.type}`)}}};function ke(e){switch(typeof e){case`number`:return Number.isInteger(e)?new pe(e):new me(e);case`string`:return new V(e);case`boolean`:return new he(e);case`undefined`:return new Ce;case`object`:return e===null?new Se:Array.isArray(e)?new ye(e.map(ke)):new _e(new Map(Object.entries(e).map(([e,t])=>[e,ke(t)])));case`function`:return new xe((t,n)=>ke(e(...t.map(e=>e.value))??null));default:throw Error(`Cannot convert to runtime value: ${e}`)}}var Ae=` +`,je=`{%- `,Me=` -%}`;function Ne(e){switch(e.operator.type){case`MultiplicativeBinaryOperator`:return 4;case`AdditiveBinaryOperator`:return 3;case`ComparisonBinaryOperator`:return 2;case`Identifier`:return e.operator.value===`and`?1:e.operator.value===`in`||e.operator.value===`not in`?2:0}return 0}function Pe(e,t=` `){let n=typeof t==`number`?` `.repeat(t):t;return Ie(e.body,0,n).replace(/\n$/,``)}function Fe(...e){return je+e.join(` `)+Me}function Ie(e,t,n){return e.map(e=>Le(e,t,n)).join(Ae)}function Le(e,t,n){let r=n.repeat(t);switch(e.type){case`Program`:return Ie(e.body,t,n);case`If`:return Re(e,t,n);case`For`:return ze(e,t,n);case`Set`:return Be(e,t,n);case`Macro`:return Ve(e,t,n);case`Break`:return r+Fe(`break`);case`Continue`:return r+Fe(`continue`);case`CallStatement`:return He(e,t,n);case`FilterStatement`:return Ue(e,t,n);case`Comment`:return r+`{# `+e.value+` #}`;default:return r+`{{- `+We(e)+` -}}`}}function Re(e,t,n){let r=n.repeat(t),i=[],a=e;for(;a&&(i.push({test:a.test,body:a.body}),a.alternate.length===1&&a.alternate[0].type===`If`);)a=a.alternate[0];let o=r+Fe(`if`,We(i[0].test))+Ae+Ie(i[0].body,t+1,n);for(let e=1;e0&&(o+=Ae+r+Fe(`else`)+Ae+Ie(a.alternate,t+1,n)),o+=Ae+r+Fe(`endif`),o}function ze(e,t,n){let r=n.repeat(t),i=``;if(e.iterable.type===`SelectExpression`){let t=e.iterable;i=`${We(t.lhs)} if ${We(t.test)}`}else i=We(e.iterable);let a=r+Fe(`for`,We(e.loopvar),`in`,i)+Ae+Ie(e.body,t+1,n);return e.defaultBlock.length>0&&(a+=Ae+r+Fe(`else`)+Ae+Ie(e.defaultBlock,t+1,n)),a+=Ae+r+Fe(`endfor`),a}function Be(e,t,n){let r=n.repeat(t),i=We(e.assignee),a=e.value?We(e.value):``,o=r+Fe(`set`,`${i}${e.value?` = `+a:``}`);return e.body.length===0?o:o+Ae+Ie(e.body,t+1,n)+Ae+r+Fe(`endset`)}function Ve(e,t,n){let r=n.repeat(t),i=e.args.map(We).join(`, `);return r+Fe(`macro`,`${e.name.value}(${i})`)+Ae+Ie(e.body,t+1,n)+Ae+r+Fe(`endmacro`)}function He(e,t,n){let r=n.repeat(t),i=e.callerArgs&&e.callerArgs.length>0?`(${e.callerArgs.map(We).join(`, `)})`:``,a=We(e.call),o=r+Fe(`call${i}`,a)+Ae;return o+=Ie(e.body,t+1,n)+Ae,o+=r+Fe(`endcall`),o}function Ue(e,t,n){let r=n.repeat(t),i=r+Fe(`filter`,e.filter.type===`Identifier`?e.filter.value:We(e.filter))+Ae;return i+=Ie(e.body,t+1,n)+Ae,i+=r+Fe(`endfilter`),i}function We(e,t=-1){switch(e.type){case`SpreadExpression`:return`*${We(e.argument)}`;case`Identifier`:return e.value;case`IntegerLiteral`:return`${e.value}`;case`FloatLiteral`:return`${e.value}`;case`StringLiteral`:return JSON.stringify(e.value);case`BinaryExpression`:{let n=e,r=Ne(n),i=We(n.left,r),a=We(n.right,r+1),o=`${i} ${n.operator.value} ${a}`;return r`${We(e)}: ${We(t)}`).join(`, `)}}`;case`SliceExpression`:{let t=e;return`${t.start?We(t.start):``}:${t.stop?We(t.stop):``}${t.step?`:${We(t.step)}`:``}`}case`KeywordArgumentExpression`:{let t=e;return`${t.key.value}=${We(t.value)}`}case`Ternary`:{let n=e,r=`${We(n.trueExpr)} if ${We(n.condition,0)} else ${We(n.falseExpr)}`;return t>-1?`(${r})`:r}default:throw Error(`Unknown expression type: ${e.type}`)}}var Ge=class{parsed;constructor(e){let t=d(e,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=ie(t)}render(e){let t=new we;if(Te(t),e)for(let[n,r]of Object.entries(e))t.set(n,r);return new Oe(t).run(this.parsed).value}format(e){return Pe(this.parsed,e?.indent||` `)}}}),"./src/backends/onnx.js":((e,t,n)=>{ +/*!******************************!*\ +!*** ./src/backends/onnx.js ***! +\******************************/ +var r;n.r(t),n.d(t,{Tensor:()=>s.Tensor,createInferenceSession:()=>g,deviceToExecutionProviders:()=>m,isONNXProxy:()=>S,isONNXTensor:()=>b,runInferenceSession:()=>y});var i=n( +/*! ../env.js */ +`./src/env.js`),a=n( +/*! onnxruntime-node */ +`?2ce3`),o=n( +/*! onnxruntime-web */ +`onnxruntime-web`),s=n( +/*! onnxruntime-common */ +`onnxruntime-common`);let c=Object.freeze({auto:null,gpu:null,cpu:`cpu`,wasm:`wasm`,webgpu:`webgpu`,cuda:`cuda`,dml:`dml`,webnn:{name:`webnn`,deviceType:`cpu`},"webnn-npu":{name:`webnn`,deviceType:`npu`},"webnn-gpu":{name:`webnn`,deviceType:`gpu`},"webnn-cpu":{name:`webnn`,deviceType:`cpu`}}),l=[],u,d,f=Symbol.for(`onnxruntime`);if(f in globalThis)d=globalThis[f];else if(i.apis.IS_NODE_ENV){switch(d=a??(r||=n.t(a,2)),process.platform){case`win32`:l.push(`dml`);break;case`linux`:process.arch===`x64`&&l.push(`cuda`);break;case`darwin`:break}l.push(`cpu`),u=[`cpu`]}else d=o,i.apis.IS_WEBNN_AVAILABLE&&l.push(`webnn-npu`,`webnn-gpu`,`webnn-cpu`,`webnn`),i.apis.IS_WEBGPU_AVAILABLE&&l.push(`webgpu`),l.push(`wasm`),u=[`wasm`];let p=d.InferenceSession;function m(e=null){if(!e)return u;switch(e){case`auto`:return l;case`gpu`:return l.filter(e=>[`webgpu`,`cuda`,`dml`,`webnn-gpu`].includes(e))}if(l.includes(e))return[c[e]??e];throw Error(`Unsupported device: "${e}". Should be one of: ${l.join(`, `)}.`)}let h=null;async function g(e,t,n){h&&await h;let r=p.create(e,t);h??=r;let i=await r;return i.config=n,i}let _=Promise.resolve(),v=i.apis.IS_BROWSER_ENV||i.apis.IS_WEBWORKER_ENV;async function y(e,t){let n=()=>e.run(t);return await(v?_=_.then(n):n())}function b(e){return e instanceof d.Tensor}let x=d?.env;x?.wasm&&(!(typeof ServiceWorkerGlobalScope<`u`&&self instanceof ServiceWorkerGlobalScope)&&!x.wasm.wasmPaths&&(x.wasm.wasmPaths=`https://cdn.jsdelivr.net/npm/@huggingface/transformers@${i.env.version}/dist/`),x.wasm.proxy=!1),x?.webgpu&&(x.webgpu.powerPreference=`high-performance`);function S(){return x?.wasm?.proxy}i.env.backends.onnx=x}),"./src/base/feature_extraction_utils.js":((e,t,n)=>{ +/*!**********************************************!*\ +!*** ./src/base/feature_extraction_utils.js ***! +\**********************************************/ +n.r(t),n.d(t,{FeatureExtractor:()=>o,validate_audio_inputs:()=>s});var r=n( +/*! ../utils/constants.js */ +`./src/utils/constants.js`),i=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`),a=n( +/*! ../utils/hub.js */ +`./src/utils/hub.js`);class o extends i.Callable{constructor(e){super(),this.config=e}static async from_pretrained(e,t={}){let n=await(0,a.getModelJSON)(e,r.FEATURE_EXTRACTOR_NAME,!0,t);return new this(n)}}function s(e,t){if(!(e instanceof Float32Array||e instanceof Float64Array))throw Error(`${t} expects input to be a Float32Array or a Float64Array, but got ${e?.constructor?.name??typeof e} instead. If using the feature extractor directly, remember to use \`read_audio(url, sampling_rate)\` to obtain the raw audio data of the file/url.`)}}),"./src/base/image_processors_utils.js":((e,t,n)=>{ +/*!********************************************!*\ +!*** ./src/base/image_processors_utils.js ***! +\********************************************/ +n.r(t),n.d(t,{ImageProcessor:()=>b,center_to_corners_format:()=>d,post_process_instance_segmentation:()=>y,post_process_object_detection:()=>f,post_process_panoptic_segmentation:()=>v,post_process_semantic_segmentation:()=>p});var r=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`),i=n( +/*! ../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../utils/maths.js */ +`./src/utils/maths.js`);n( +/*! ../utils/image.js */ +`./src/utils/image.js`);var o=n( +/*! ../utils/core.js */ +`./src/utils/core.js`),s=n( +/*! ../utils/hub.js */ +`./src/utils/hub.js`),c=n( +/*! ../utils/constants.js */ +`./src/utils/constants.js`);function l(e,t,n=0,r=null){let i=e/t,o=(0,a.bankers_round)(i)*t;return r!==null&&o>r&&(o=Math.floor(i)*t),ot&&i.push(e)}else{let e=(0,a.max)(n.data)[1];if(e===l-1||(o=(0,a.softmax)(n.data),o[e]e*s[(t+1)%2])),f.boxes.push(n),f.classes.push(t),f.scores.push(o[t])}}u.push(f)}return u}function p(e,t=null){let n=e.logits,r=n.dims[0];if(t!==null&&t.length!==r)throw Error(`Make sure that you pass in as many target sizes as the batch dimension of the logits`);let a=[];for(let e=0;eu[n]&&(u[n]=t[n],d[n]=e)}let f=Array(o.dims[0]);for(let e=0;ee!==void 0);a.push({segmentation:l,labels:p})}return a}function m(e,t,n,r){let i=[],o=[],s=[];for(let c=0;cn&&(i.push(u),o.push(f),s.push(d))}return[i,o,s]}function h(e,t,n,r=.5,i=.8){let a=[],o=0,s=0,c=t[n].data;for(let t=0;t=r&&++s;let l=o>0&&s>0;return l&&=o/s>i,[l,a]}function g(e,t,n,r,a,o=null,s=null){let[c,l]=s??e[0].dims,u=new i.Tensor(`int32`,new Int32Array(c*l),[c,l]),d=[];if(s!==null)for(let t=0;tp[e]&&(f[e]=n,p[e]=i[e])}let m=0,g=u.data;for(let i=0;i200)throw Error(`absolute aspect ratio must be smaller than 200, got ${Math.max(e,t)/Math.min(e,t)}`);let a=Math.round(e/n)*n,o=Math.round(t/n)*n;if(a*o>i){let r=Math.sqrt(e*t/i);a=Math.floor(e/r/n)*n,o=Math.floor(t/r/n)*n}else if(a*oi?c=Math.floor(i*s/r):i>r&&(s=Math.floor(r*c/i)),await e.resize(c,s,{resample:n}))}async crop_margin(e,t=200){let n=e.clone().grayscale(),r=(0,a.min)(n.data)[0],i=(0,a.max)(n.data)[0]-r;if(i===0)return e;let o=t/255,s=n.width,c=n.height,l=0,u=0,d=n.data;for(let e=0;ethis.preprocess(e)));return{pixel_values:(0,i.stack)(n.map(e=>e.pixel_values),0),original_sizes:n.map(e=>e.original_size),reshaped_input_sizes:n.map(e=>e.reshaped_input_size)}}static async from_pretrained(e,t={}){let n=await(0,s.getModelJSON)(e,c.IMAGE_PROCESSOR_NAME,!0,t);return new this(n)}}}),"./src/base/processing_utils.js":((e,t,n)=>{ +/*!**************************************!*\ +!*** ./src/base/processing_utils.js ***! +\**************************************/ +n.r(t),n.d(t,{Processor:()=>o});var r=n( +/*! ../utils/constants.js */ +`./src/utils/constants.js`),i=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`),a=n( +/*! ../utils/hub.js */ +`./src/utils/hub.js`);class o extends i.Callable{static classes=[`image_processor_class`,`tokenizer_class`,`feature_extractor_class`];static uses_processor_config=!1;static uses_chat_template_file=!1;constructor(e,t,n){super(),this.config=e,this.components=t,this.chat_template=n}get image_processor(){return this.components.image_processor}get tokenizer(){return this.components.tokenizer}get feature_extractor(){return this.components.feature_extractor}apply_chat_template(e,t={}){if(!this.tokenizer)throw Error(`Unable to apply chat template without a tokenizer.`);return this.tokenizer.apply_chat_template(e,{tokenize:!1,chat_template:this.chat_template??void 0,...t})}batch_decode(...e){if(!this.tokenizer)throw Error(`Unable to decode without a tokenizer.`);return this.tokenizer.batch_decode(...e)}decode(...e){if(!this.tokenizer)throw Error(`Unable to decode without a tokenizer.`);return this.tokenizer.decode(...e)}async _call(e,...t){for(let n of[this.image_processor,this.feature_extractor,this.tokenizer])if(n)return n(e,...t);throw Error(`No image processor, feature extractor, or tokenizer found.`)}static async from_pretrained(e,t={}){let[n,i,o]=await Promise.all([this.uses_processor_config?(0,a.getModelJSON)(e,r.PROCESSOR_NAME,!0,t):{},Promise.all(this.classes.filter(e=>e in this).map(async n=>{let r=await this[n].from_pretrained(e,t);return[n.replace(/_class$/,``),r]})).then(Object.fromEntries),this.uses_chat_template_file?(0,a.getModelText)(e,r.CHAT_TEMPLATE_NAME,!0,t):null]);return new this(n,i,o)}}}),"./src/configs.js":((e,t,n)=>{ +/*!************************!*\ +!*** ./src/configs.js ***! +\************************/ +n.r(t),n.d(t,{AutoConfig:()=>u,PretrainedConfig:()=>l,getCacheShapes:()=>s});var r=n( +/*! ./utils/core.js */ +`./src/utils/core.js`),i=n( +/*! ./utils/hub.js */ +`./src/utils/hub.js`);async function a(e,t){return await(0,i.getModelJSON)(e,`config.json`,!0,t)}function o(e){let t={},n={};switch(e.model_type){case`llava`:case`paligemma`:case`gemma3`:case`florence2`:case`llava_onevision`:case`idefics3`:case`ultravox`:case`voxtral`:case`smolvlm`:case`gemma3n`:case`mistral3`:n=o(e.text_config);break;case`moondream1`:n=o(e.phi_config);break;case`musicgen`:n=o(e.decoder);break;case`multi_modality`:n=o(e.language_config);break;case`gpt2`:case`gptj`:case`jais`:case`codegen`:case`gpt_bigcode`:t.num_heads=`n_head`,t.num_layers=`n_layer`,t.hidden_size=`n_embd`;break;case`gpt_neox`:case`stablelm`:case`opt`:case`falcon`:case`modernbert-decoder`:t.num_heads=`num_attention_heads`,t.num_layers=`num_hidden_layers`,t.hidden_size=`hidden_size`;break;case`llama`:case`llama4_text`:case`nanochat`:case`arcee`:case`lfm2`:case`smollm3`:case`olmo`:case`olmo2`:case`mobilellm`:case`granite`:case`granitemoehybrid`:case`cohere`:case`mistral`:case`starcoder2`:case`qwen2`:case`qwen2_vl`:case`phi`:case`phi3`:case`phi3_v`:case`llava_qwen2`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_hidden_layers`,t.hidden_size=`hidden_size`,t.num_attention_heads=`num_attention_heads`,t.dim_kv=`head_dim`;break;case`qwen3`:case`gemma`:case`gemma2`:case`vaultgemma`:case`gemma3_text`:case`gemma3n_text`:case`glm`:case`helium`:case`ernie4_5`:case`ministral`:case`ministral3`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_hidden_layers`,t.dim_kv=`head_dim`;break;case`openelm`:t.num_heads=`num_kv_heads`,t.num_layers=`num_transformer_layers`,t.dim_kv=`head_dim`;break;case`gpt_neo`:case`donut-swin`:t.num_heads=`num_heads`,t.num_layers=`num_layers`,t.hidden_size=`hidden_size`;break;case`bloom`:t.num_heads=`n_head`,t.num_layers=`n_layer`,t.hidden_size=`hidden_size`;break;case`mpt`:t.num_heads=`n_heads`,t.num_layers=`n_layers`,t.hidden_size=`d_model`;break;case`exaone`:t.num_heads=`num_key_value_heads`,t.num_layers=`num_layers`,t.dim_kv=`head_dim`,t.num_attention_heads=`num_attention_heads`;break;case`t5`:case`mt5`:case`longt5`:t.num_decoder_layers=`num_decoder_layers`,t.num_decoder_heads=`num_heads`,t.decoder_dim_kv=`d_kv`,t.num_encoder_layers=`num_layers`,t.num_encoder_heads=`num_heads`,t.encoder_dim_kv=`d_kv`;break;case`bart`:case`mbart`:case`marian`:case`whisper`:case`lite-whisper`:case`m2m_100`:case`blenderbot`:case`blenderbot-small`:case`florence2_language`:t.num_decoder_layers=`decoder_layers`,t.num_decoder_heads=`decoder_attention_heads`,t.decoder_hidden_size=`d_model`,t.num_encoder_layers=`encoder_layers`,t.num_encoder_heads=`encoder_attention_heads`,t.encoder_hidden_size=`d_model`;break;case`speecht5`:t.num_decoder_layers=`decoder_layers`,t.num_decoder_heads=`decoder_attention_heads`,t.decoder_hidden_size=`hidden_size`,t.num_encoder_layers=`encoder_layers`,t.num_encoder_heads=`encoder_attention_heads`,t.encoder_hidden_size=`hidden_size`;break;case`trocr`:t.num_encoder_layers=t.num_decoder_layers=`decoder_layers`,t.num_encoder_heads=t.num_decoder_heads=`decoder_attention_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`d_model`;break;case`musicgen_decoder`:t.num_encoder_layers=t.num_decoder_layers=`num_hidden_layers`,t.num_encoder_heads=t.num_decoder_heads=`num_attention_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`hidden_size`;break;case`moonshine`:t.num_decoder_layers=`decoder_num_hidden_layers`,t.num_decoder_heads=`decoder_num_key_value_heads`,t.num_encoder_layers=`encoder_num_hidden_layers`,t.num_encoder_heads=`encoder_num_key_value_heads`,t.encoder_hidden_size=t.decoder_hidden_size=`hidden_size`;break;case`vision-encoder-decoder`:let i=o(e.decoder),a=`num_decoder_layers`in i,s=(0,r.pick)(e,[`model_type`,`is_encoder_decoder`]);return a?(s.num_decoder_layers=i.num_decoder_layers,s.num_decoder_heads=i.num_decoder_heads,s.decoder_hidden_size=i.decoder_hidden_size,s.num_encoder_layers=i.num_encoder_layers,s.num_encoder_heads=i.num_encoder_heads,s.encoder_hidden_size=i.encoder_hidden_size):(s.num_layers=i.num_layers,s.num_heads=i.num_heads,s.hidden_size=i.hidden_size),s}let i={...n,...(0,r.pick)(e,[`model_type`,`multi_query`,`is_encoder_decoder`])};for(let n in t)i[n]=e[t[n]];return i}function s(e,t){if(e.model_type===`lfm2`){let n=t?.prefix??`past_key_values`,r=n===`present`?`present`:`past`,i={},{layer_types:a,num_attention_heads:o,num_key_value_heads:s,hidden_size:c,conv_L_cache:l}=e,u=c/o,d=t?.batch_size??1;for(let e=0;e{ +/*!********************!*\ +!*** ./src/env.js ***! +\********************/ +n.r(t),n.d(t,{apis:()=>g,env:()=>S});var r=n( +/*! node:fs */ +`?db59`),i=n( +/*! node:path */ +`?383f`),a=n( +/*! node:url */ +`?fa4b`);let o=typeof window<`u`&&window.document!==void 0,s=typeof self<`u`&&[`DedicatedWorkerGlobalScope`,`ServiceWorkerGlobalScope`,`SharedWorkerGlobalScope`].includes(self.constructor?.name),c=typeof self<`u`&&`caches`in self,l=typeof navigator<`u`&&`gpu`in navigator,u=typeof navigator<`u`&&`ml`in navigator,d=typeof process<`u`,f=d&&process?.release?.name===`node`,p=!C(r),m=!C(i),h=globalThis.Deno!==void 0;globalThis.Bun;let g=Object.freeze({IS_BROWSER_ENV:o,IS_WEBWORKER_ENV:s,IS_WEB_CACHE_AVAILABLE:c,IS_WEBGPU_AVAILABLE:l,IS_WEBNN_AVAILABLE:u,IS_PROCESS_AVAILABLE:d,IS_NODE_ENV:f,IS_FS_AVAILABLE:p,IS_PATH_AVAILABLE:m}),_=p&&m,v=`./`;if(_){let e=Object(SH).url;e?v=i.dirname(i.dirname(a.fileURLToPath(e))):typeof __dirname<`u`&&(v=i.dirname(__dirname))}let y=_?i.join(v,`/.cache/`):null,b=`/models/`,x=_?i.join(v,b):b,S={version:`3.8.1`,backends:{onnx:{}},allowRemoteModels:!0,remoteHost:`https://huggingface.co/`,remotePathTemplate:`{model}/resolve/{revision}/`,allowLocalModels:!(o||s),localModelPath:x,useFS:p,useBrowserCache:c&&!h,useFSCache:p,cacheDir:y,useCustomCache:!1,customCache:null};function C(e){return Object.keys(e).length===0}}),"./src/generation/configuration_utils.js":((e,t,n)=>{ +/*!***********************************************!*\ +!*** ./src/generation/configuration_utils.js ***! +\***********************************************/ +n.r(t),n.d(t,{GenerationConfig:()=>i});var r=n( +/*! ../utils/core.js */ +`./src/utils/core.js`);class i{max_length=20;max_new_tokens=null;min_length=0;min_new_tokens=null;early_stopping=!1;max_time=null;do_sample=!1;num_beams=1;num_beam_groups=1;penalty_alpha=null;use_cache=!0;temperature=1;top_k=50;top_p=1;typical_p=1;epsilon_cutoff=0;eta_cutoff=0;diversity_penalty=0;repetition_penalty=1;encoder_repetition_penalty=1;length_penalty=1;no_repeat_ngram_size=0;bad_words_ids=null;force_words_ids=null;renormalize_logits=!1;constraints=null;forced_bos_token_id=null;forced_eos_token_id=null;remove_invalid_values=!1;exponential_decay_length_penalty=null;suppress_tokens=null;streamer=null;begin_suppress_tokens=null;forced_decoder_ids=null;guidance_scale=null;num_return_sequences=1;output_attentions=!1;output_hidden_states=!1;output_scores=!1;return_dict_in_generate=!1;pad_token_id=null;bos_token_id=null;eos_token_id=null;encoder_no_repeat_ngram_size=0;decoder_start_token_id=null;generation_kwargs={};constructor(e){Object.assign(this,(0,r.pick)(e,Object.getOwnPropertyNames(this)))}}}),"./src/generation/logits_process.js":((e,t,n)=>{ +/*!******************************************!*\ +!*** ./src/generation/logits_process.js ***! +\******************************************/ +n.r(t),n.d(t,{ClassifierFreeGuidanceLogitsProcessor:()=>_,ForcedBOSTokenLogitsProcessor:()=>c,ForcedEOSTokenLogitsProcessor:()=>l,LogitsProcessor:()=>a,LogitsProcessorList:()=>s,LogitsWarper:()=>o,MinLengthLogitsProcessor:()=>m,MinNewTokensLengthLogitsProcessor:()=>h,NoBadWordsLogitsProcessor:()=>g,NoRepeatNGramLogitsProcessor:()=>f,RepetitionPenaltyLogitsProcessor:()=>p,SuppressTokensAtBeginLogitsProcessor:()=>u,TemperatureLogitsWarper:()=>v,TopKLogitsWarper:()=>b,TopPLogitsWarper:()=>y,WhisperTimeStampLogitsProcessor:()=>d});var r=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`);n( +/*! ../utils/tensor.js */ +`./src/utils/tensor.js`);var i=n( +/*! ../utils/maths.js */ +`./src/utils/maths.js`);class a extends r.Callable{_call(e,t){throw Error("`_call` should be implemented in a subclass")}}class o extends r.Callable{_call(e,t){throw Error("`_call` should be implemented in a subclass")}}class s extends r.Callable{constructor(){super(),this.processors=[]}push(e){this.processors.push(e)}extend(e){this.processors.push(...e)}_call(e,t){let n=t;for(let t of this.processors)n=t(e,n);return n}[Symbol.iterator](){return this.processors.values()}}class c extends a{constructor(e){super(),this.bos_token_id=e}_call(e,t){for(let n=0;n=1&&a[a.length-1]>=this.timestamp_begin,s=a.length<2||a[a.length-2]>=this.timestamp_begin;if(o&&(s?r.subarray(this.timestamp_begin).fill(-1/0):r.subarray(0,this.eos_token_id).fill(-1/0)),e[n].length===this.begin_index&&this.max_initial_timestamp_index!==null){let e=this.timestamp_begin+this.max_initial_timestamp_index;r.subarray(e+1).fill(-1/0)}let c=(0,i.log_softmax)(r);Math.log(c.subarray(this.timestamp_begin).map(Math.exp).reduce((e,t)=>e+t))>(0,i.max)(c.subarray(0,this.timestamp_begin))[0]&&r.subarray(0,this.timestamp_begin).fill(-1/0)}return t}}class f extends a{constructor(e){super(),this.no_repeat_ngram_size=e}getNgrams(e){let t=e.length,n=[];for(let r=0;r1 to use the classifier free guidance processor, got guidance scale ${e}.`);this.guidance_scale=e}_call(e,t){if(t.dims[0]!==2*e.length)throw Error(`Logits should have twice the batch size of the input ids, the first half of batches corresponding to the conditional inputs, and the second half of batches corresponding to the unconditional inputs. Got batch size ${t.dims[0]} for the logits and ${e.length} for the input ids.`);let n=e.length,r=t.slice([0,n],null),i=t.slice([n,t.dims[0]],null);for(let e=0;e1)throw Error(`\`top_p\` must be a float > 0 and < 1, but is ${e}`);if(!Number.isInteger(n)||n<1)throw Error(`\`min_tokens_to_keep\` must be a positive integer, but is ${n}`);this.top_p=e,this.filter_value=t,this.min_tokens_to_keep=n}}class b extends o{constructor(e,{filter_value:t=-1/0,min_tokens_to_keep:n=1}={}){if(super(),!Number.isInteger(e)||e<0)throw Error(`\`top_k\` must be a positive integer, but is ${e}`);this.top_k=Math.max(e,n),this.filter_value=t}}}),"./src/generation/logits_sampler.js":((e,t,n)=>{ +/*!******************************************!*\ +!*** ./src/generation/logits_sampler.js ***! +\******************************************/ +n.r(t),n.d(t,{LogitsSampler:()=>o});var r=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`),i=n( +/*! ../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../utils/maths.js */ +`./src/utils/maths.js`);n( +/*! ../generation/configuration_utils.js */ +`./src/generation/configuration_utils.js`);class o extends r.Callable{constructor(e){super(),this.generation_config=e}async _call(e){return this.sample(e)}async sample(e){throw Error(`sample should be implemented in subclasses.`)}getLogits(e,t){let n=e.dims.at(-1),r=e.data;if(t===-1)r=r.slice(-n);else{let e=t*n;r=r.slice(e,e+n)}return r}randomSelect(e){let t=0;for(let n=0;n1)return new l(e);if(e.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${e.num_return_sequences}.`);return new s(e)}}class s extends o{async sample(e){let t=(0,a.max)(e.data)[1];return[[BigInt(t),0]]}}class c extends o{async sample(e){let t=e.dims.at(-1);this.generation_config.top_k>0&&(t=Math.min(this.generation_config.top_k,t));let[n,r]=await(0,i.topk)(e,t),o=(0,a.softmax)(n.data);return Array.from({length:this.generation_config.num_beams},()=>{let e=this.randomSelect(o);return[r.data[e],Math.log(o[e])]})}}class l extends o{async sample(e){let t=e.dims.at(-1);this.generation_config.top_k>0&&(t=Math.min(this.generation_config.top_k,t));let[n,r]=await(0,i.topk)(e,t),o=(0,a.softmax)(n.data);return Array.from({length:this.generation_config.num_beams},(e,t)=>[r.data[t],Math.log(o[t])])}}}),"./src/generation/stopping_criteria.js":((e,t,n)=>{ +/*!*********************************************!*\ +!*** ./src/generation/stopping_criteria.js ***! +\*********************************************/ +n.r(t),n.d(t,{EosTokenCriteria:()=>s,InterruptableStoppingCriteria:()=>c,MaxLengthCriteria:()=>o,StoppingCriteria:()=>i,StoppingCriteriaList:()=>a});var r=n( +/*! ../utils/generic.js */ +`./src/utils/generic.js`);class i extends r.Callable{_call(e,t){throw Error(`StoppingCriteria needs to be subclassed`)}}class a extends r.Callable{constructor(){super(),this.criteria=[]}push(e){this.criteria.push(e)}extend(e){e instanceof a?e=e.criteria:e instanceof i&&(e=[e]),this.criteria.push(...e)}_call(e,t){let n=Array(e.length).fill(!1);for(let r of this.criteria){let i=r(e,t);for(let e=0;ee.length>=this.max_length)}}class s extends i{constructor(e){super(),Array.isArray(e)||(e=[e]),this.eos_token_id=e}_call(e,t){return e.map(e=>{let t=e.at(-1);return this.eos_token_id.some(e=>t==e)})}}class c extends i{constructor(){super(),this.interrupted=!1}interrupt(){this.interrupted=!0}reset(){this.interrupted=!1}_call(e,t){return Array(e.length).fill(this.interrupted)}}}),"./src/generation/streamers.js":((e,t,n)=>{ +/*!*************************************!*\ +!*** ./src/generation/streamers.js ***! +\*************************************/ +n.r(t),n.d(t,{BaseStreamer:()=>o,TextStreamer:()=>c,WhisperTextStreamer:()=>l});var r=n( +/*! ../utils/core.js */ +`./src/utils/core.js`),i=n( +/*! ../tokenizers.js */ +`./src/tokenizers.js`),a=n( +/*! ../env.js */ +`./src/env.js`);class o{put(e){throw Error(`Not implemented`)}end(){throw Error(`Not implemented`)}}let s=a.apis.IS_PROCESS_AVAILABLE?e=>process.stdout.write(e):e=>console.log(e);class c extends o{constructor(e,{skip_prompt:t=!1,callback_function:n=null,token_callback_function:r=null,skip_special_tokens:i=!0,decode_kwargs:a={},...o}={}){super(),this.tokenizer=e,this.skip_prompt=t,this.callback_function=n??s,this.token_callback_function=r,this.decode_kwargs={skip_special_tokens:i,...a,...o},this.token_cache=[],this.print_len=0,this.next_tokens_are_prompt=!0}put(e){if(e.length>1)throw Error(`TextStreamer only supports batch size of 1`);let t=this.next_tokens_are_prompt;if(t&&(this.next_tokens_are_prompt=!1,this.skip_prompt))return;let n=e[0];this.token_callback_function?.(n),this.token_cache=(0,r.mergeArrays)(this.token_cache,n);let a=this.tokenizer.decode(this.token_cache,this.decode_kwargs),o;t||a.endsWith(` +`)?(o=a.slice(this.print_len),this.token_cache=[],this.print_len=0):a.length>0&&(0,i.is_chinese_char)(a.charCodeAt(a.length-1))?(o=a.slice(this.print_len),this.print_len+=o.length):(o=a.slice(this.print_len,a.lastIndexOf(` `)+1),this.print_len+=o.length),this.on_finalized_text(o,!1)}end(){let e;this.token_cache.length>0?(e=this.tokenizer.decode(this.token_cache,this.decode_kwargs).slice(this.print_len),this.token_cache=[],this.print_len=0):e=``,this.next_tokens_are_prompt=!0,this.on_finalized_text(e,!0)}on_finalized_text(e,t){e.length>0&&this.callback_function?.(e),t&&this.callback_function===s&&a.apis.IS_PROCESS_AVAILABLE&&this.callback_function?.(` +`)}}class l extends c{constructor(e,{skip_prompt:t=!1,callback_function:n=null,token_callback_function:r=null,on_chunk_start:i=null,on_chunk_end:a=null,on_finalize:o=null,time_precision:s=.02,skip_special_tokens:c=!0,decode_kwargs:l={}}={}){super(e,{skip_prompt:t,skip_special_tokens:c,callback_function:n,token_callback_function:r,decode_kwargs:l}),this.timestamp_begin=e.timestamp_begin,this.on_chunk_start=i,this.on_chunk_end=a,this.on_finalize=o,this.time_precision=s,this.waiting_for_timestamp=!1}put(e){if(e.length>1)throw Error(`WhisperTextStreamer only supports batch size of 1`);let t=e[0];if(t.length===1){let e=Number(t[0])-this.timestamp_begin;if(e>=0){let n=e*this.time_precision;this.waiting_for_timestamp?this.on_chunk_end?.(n):this.on_chunk_start?.(n),this.waiting_for_timestamp=!this.waiting_for_timestamp,this.token_callback_function?.(t);return}}return super.put(e)}end(){super.end(),this.on_finalize?.()}}}),"./src/models.js":((e,t,n)=>{ +/*!***********************!*\ +!*** ./src/models.js ***! +\***********************/ +n.r(t),n.d(t,{ASTForAudioClassification:()=>In,ASTModel:()=>Fn,ASTPreTrainedModel:()=>Pn,AlbertForMaskedLM:()=>Wt,AlbertForQuestionAnswering:()=>Ut,AlbertForSequenceClassification:()=>Ht,AlbertModel:()=>Vt,AlbertPreTrainedModel:()=>Bt,ArceeForCausalLM:()=>ni,ArceeModel:()=>ti,ArceePreTrainedModel:()=>ei,AutoModel:()=>ad,AutoModelForAudioClassification:()=>wd,AutoModelForAudioFrameClassification:()=>Ed,AutoModelForAudioTextToText:()=>Fd,AutoModelForCTC:()=>Cd,AutoModelForCausalLM:()=>fd,AutoModelForDepthEstimation:()=>Ad,AutoModelForDocumentQuestionAnswering:()=>Dd,AutoModelForImageClassification:()=>gd,AutoModelForImageFeatureExtraction:()=>Nd,AutoModelForImageMatting:()=>Od,AutoModelForImageSegmentation:()=>_d,AutoModelForImageTextToText:()=>Pd,AutoModelForImageToImage:()=>kd,AutoModelForMaskGeneration:()=>Sd,AutoModelForMaskedLM:()=>pd,AutoModelForNormalEstimation:()=>jd,AutoModelForObjectDetection:()=>bd,AutoModelForPoseEstimation:()=>Md,AutoModelForQuestionAnswering:()=>md,AutoModelForSemanticSegmentation:()=>vd,AutoModelForSeq2SeqLM:()=>cd,AutoModelForSequenceClassification:()=>od,AutoModelForSpeechSeq2Seq:()=>ld,AutoModelForTextToSpectrogram:()=>ud,AutoModelForTextToWaveform:()=>dd,AutoModelForTokenClassification:()=>sd,AutoModelForUniversalSegmentation:()=>yd,AutoModelForVision2Seq:()=>hd,AutoModelForXVector:()=>Td,AutoModelForZeroShotObjectDetection:()=>xd,BartForConditionalGeneration:()=>nn,BartForSequenceClassification:()=>rn,BartModel:()=>tn,BartPretrainedModel:()=>en,BaseModelOutput:()=>le,BeitForImageClassification:()=>ro,BeitModel:()=>no,BeitPreTrainedModel:()=>to,BertForMaskedLM:()=>fe,BertForQuestionAnswering:()=>V,BertForSequenceClassification:()=>pe,BertForTokenClassification:()=>me,BertModel:()=>de,BertPreTrainedModel:()=>ue,BlenderbotForConditionalGeneration:()=>fn,BlenderbotModel:()=>dn,BlenderbotPreTrainedModel:()=>un,BlenderbotSmallForConditionalGeneration:()=>hn,BlenderbotSmallModel:()=>mn,BlenderbotSmallPreTrainedModel:()=>pn,BloomForCausalLM:()=>pa,BloomModel:()=>fa,BloomPreTrainedModel:()=>da,CLIPModel:()=>sr,CLIPPreTrainedModel:()=>or,CLIPSegForImageSegmentation:()=>wr,CLIPSegModel:()=>Cr,CLIPSegPreTrainedModel:()=>Sr,CLIPTextModel:()=>cr,CLIPTextModelWithProjection:()=>lr,CLIPVisionModel:()=>ur,CLIPVisionModelWithProjection:()=>dr,CamembertForMaskedLM:()=>Ze,CamembertForQuestionAnswering:()=>et,CamembertForSequenceClassification:()=>Qe,CamembertForTokenClassification:()=>$e,CamembertModel:()=>Xe,CamembertPreTrainedModel:()=>Ye,CausalLMOutput:()=>Hd,CausalLMOutputWithPast:()=>Ud,ChineseCLIPModel:()=>_r,ChineseCLIPPreTrainedModel:()=>gr,ClapAudioModelWithProjection:()=>ll,ClapModel:()=>sl,ClapPreTrainedModel:()=>ol,ClapTextModelWithProjection:()=>cl,CodeGenForCausalLM:()=>Gr,CodeGenModel:()=>Wr,CodeGenPreTrainedModel:()=>Ur,CohereForCausalLM:()=>Fi,CohereModel:()=>Pi,CoherePreTrainedModel:()=>Ni,ConvBertForMaskedLM:()=>ze,ConvBertForQuestionAnswering:()=>He,ConvBertForSequenceClassification:()=>Be,ConvBertForTokenClassification:()=>Ve,ConvBertModel:()=>Re,ConvBertPreTrainedModel:()=>Le,ConvNextForImageClassification:()=>gs,ConvNextModel:()=>hs,ConvNextPreTrainedModel:()=>ms,ConvNextV2ForImageClassification:()=>ys,ConvNextV2Model:()=>vs,ConvNextV2PreTrainedModel:()=>_s,DFineForObjectDetection:()=>wo,DFineModel:()=>Co,DFinePreTrainedModel:()=>So,DINOv3ConvNextModel:()=>ks,DINOv3ConvNextPreTrainedModel:()=>Os,DINOv3ViTModel:()=>Ds,DINOv3ViTPreTrainedModel:()=>Es,DPTForDepthEstimation:()=>qo,DPTModel:()=>Ko,DPTPreTrainedModel:()=>Go,DacDecoderModel:()=>mu,DacDecoderOutput:()=>du,DacEncoderModel:()=>pu,DacEncoderOutput:()=>uu,DacModel:()=>fu,DacPreTrainedModel:()=>lu,DebertaForMaskedLM:()=>rt,DebertaForQuestionAnswering:()=>ot,DebertaForSequenceClassification:()=>it,DebertaForTokenClassification:()=>at,DebertaModel:()=>nt,DebertaPreTrainedModel:()=>tt,DebertaV2ForMaskedLM:()=>lt,DebertaV2ForQuestionAnswering:()=>ft,DebertaV2ForSequenceClassification:()=>ut,DebertaV2ForTokenClassification:()=>dt,DebertaV2Model:()=>ct,DebertaV2PreTrainedModel:()=>st,DecisionTransformerModel:()=>Hl,DecisionTransformerPreTrainedModel:()=>Vl,DeiTForImageClassification:()=>jo,DeiTModel:()=>Ao,DeiTPreTrainedModel:()=>ko,DepthAnythingForDepthEstimation:()=>Yo,DepthAnythingPreTrainedModel:()=>Jo,DepthProForDepthEstimation:()=>ts,DepthProPreTrainedModel:()=>es,DetrForObjectDetection:()=>ao,DetrForSegmentation:()=>oo,DetrModel:()=>W,DetrObjectDetectionOutput:()=>so,DetrPreTrainedModel:()=>io,DetrSegmentationOutput:()=>co,Dinov2ForImageClassification:()=>Ss,Dinov2Model:()=>xs,Dinov2PreTrainedModel:()=>bs,Dinov2WithRegistersForImageClassification:()=>Ts,Dinov2WithRegistersModel:()=>ws,Dinov2WithRegistersPreTrainedModel:()=>Cs,DistilBertForMaskedLM:()=>vt,DistilBertForQuestionAnswering:()=>_t,DistilBertForSequenceClassification:()=>ht,DistilBertForTokenClassification:()=>gt,DistilBertModel:()=>mt,DistilBertPreTrainedModel:()=>pt,DonutSwinModel:()=>ps,DonutSwinPreTrainedModel:()=>fs,EdgeTamModel:()=>Hs,EfficientNetForImageClassification:()=>bl,EfficientNetModel:()=>G,EfficientNetPreTrainedModel:()=>yl,ElectraForMaskedLM:()=>Ge,ElectraForQuestionAnswering:()=>Je,ElectraForSequenceClassification:()=>Ke,ElectraForTokenClassification:()=>qe,ElectraModel:()=>We,ElectraPreTrainedModel:()=>Ue,Ernie4_5ForCausalLM:()=>$c,Ernie4_5Model:()=>Qc,Ernie4_5PreTrainedModel:()=>Zc,EsmForMaskedLM:()=>xt,EsmForSequenceClassification:()=>St,EsmForTokenClassification:()=>Ct,EsmModel:()=>bt,EsmPreTrainedModel:()=>yt,ExaoneForCausalLM:()=>_i,ExaoneModel:()=>gi,ExaonePreTrainedModel:()=>hi,FalconForCausalLM:()=>al,FalconModel:()=>il,FalconPreTrainedModel:()=>rl,FastViTForImageClassification:()=>Ba,FastViTModel:()=>za,FastViTPreTrainedModel:()=>Ra,Florence2ForConditionalGeneration:()=>Yn,Florence2PreTrainedModel:()=>Jn,GLPNForDepthEstimation:()=>ds,GLPNModel:()=>us,GLPNPreTrainedModel:()=>ls,GPT2LMHeadModel:()=>Dr,GPT2Model:()=>Er,GPT2PreTrainedModel:()=>Tr,GPTBigCodeForCausalLM:()=>Hr,GPTBigCodeModel:()=>Vr,GPTBigCodePreTrainedModel:()=>Br,GPTJForCausalLM:()=>zr,GPTJModel:()=>Rr,GPTJPreTrainedModel:()=>Lr,GPTNeoForCausalLM:()=>Nr,GPTNeoModel:()=>Mr,GPTNeoPreTrainedModel:()=>jr,GPTNeoXForCausalLM:()=>Ir,GPTNeoXModel:()=>Fr,GPTNeoXPreTrainedModel:()=>Pr,Gemma2ForCausalLM:()=>Vi,Gemma2Model:()=>Bi,Gemma2PreTrainedModel:()=>zi,Gemma3ForCausalLM:()=>qi,Gemma3Model:()=>Ki,Gemma3PreTrainedModel:()=>Gi,Gemma3nForConditionalGeneration:()=>U,Gemma3nPreTrainedModel:()=>er,GemmaForCausalLM:()=>Ri,GemmaModel:()=>Li,GemmaPreTrainedModel:()=>Ii,GlmForCausalLM:()=>mi,GlmModel:()=>pi,GlmPreTrainedModel:()=>fi,GraniteForCausalLM:()=>ki,GraniteModel:()=>Oi,GraniteMoeHybridForCausalLM:()=>Mi,GraniteMoeHybridModel:()=>ji,GraniteMoeHybridPreTrainedModel:()=>Ai,GranitePreTrainedModel:()=>Di,GroundingDinoForObjectDetection:()=>js,GroundingDinoPreTrainedModel:()=>As,GroupViTModel:()=>La,GroupViTPreTrainedModel:()=>Ia,HeliumForCausalLM:()=>di,HeliumModel:()=>ui,HeliumPreTrainedModel:()=>li,HieraForImageClassification:()=>Po,HieraModel:()=>No,HieraPreTrainedModel:()=>Mo,HubertForCTC:()=>Cc,HubertForSequenceClassification:()=>wc,HubertModel:()=>Sc,HubertPreTrainedModel:()=>xc,IJepaForImageClassification:()=>Ta,IJepaModel:()=>wa,IJepaPreTrainedModel:()=>Ca,Idefics3ForConditionalGeneration:()=>nr,Idefics3PreTrainedModel:()=>tr,ImageMattingOutput:()=>Wd,JAISLMHeadModel:()=>Ar,JAISModel:()=>kr,JAISPreTrainedModel:()=>Or,JinaCLIPModel:()=>yr,JinaCLIPPreTrainedModel:()=>vr,JinaCLIPTextModel:()=>br,JinaCLIPVisionModel:()=>xr,Lfm2ForCausalLM:()=>ai,Lfm2Model:()=>ii,Lfm2PreTrainedModel:()=>ri,LiteWhisperForConditionalGeneration:()=>zn,Llama4ForCausalLM:()=>Xr,Llama4PreTrainedModel:()=>Yr,LlamaForCausalLM:()=>Jr,LlamaModel:()=>qr,LlamaPreTrainedModel:()=>Kr,LlavaForConditionalGeneration:()=>Gn,LlavaOnevisionForConditionalGeneration:()=>Kn,LlavaPreTrainedModel:()=>Wn,LlavaQwen2ForCausalLM:()=>Qn,LongT5ForConditionalGeneration:()=>Xt,LongT5Model:()=>Yt,LongT5PreTrainedModel:()=>Jt,M2M100ForConditionalGeneration:()=>Ys,M2M100Model:()=>Js,M2M100PreTrainedModel:()=>qs,MBartForCausalLM:()=>ln,MBartForConditionalGeneration:()=>sn,MBartForSequenceClassification:()=>cn,MBartModel:()=>on,MBartPreTrainedModel:()=>an,MPNetForMaskedLM:()=>jt,MPNetForQuestionAnswering:()=>Pt,MPNetForSequenceClassification:()=>Mt,MPNetForTokenClassification:()=>Nt,MPNetModel:()=>At,MPNetPreTrainedModel:()=>kt,MT5ForConditionalGeneration:()=>$t,MT5Model:()=>Qt,MT5PreTrainedModel:()=>Zt,MarianMTModel:()=>Ks,MarianModel:()=>Gs,MarianPreTrainedModel:()=>Ws,MaskFormerForInstanceSegmentation:()=>cs,MaskFormerModel:()=>ss,MaskFormerPreTrainedModel:()=>os,MaskedLMOutput:()=>Bd,Metric3DForDepthEstimation:()=>rs,Metric3DPreTrainedModel:()=>ns,Metric3Dv2ForDepthEstimation:()=>as,Metric3Dv2PreTrainedModel:()=>is,MgpstrForSceneTextRecognition:()=>ql,MgpstrModelOutput:()=>Gl,MgpstrPreTrainedModel:()=>Kl,MimiDecoderModel:()=>cu,MimiDecoderOutput:()=>au,MimiEncoderModel:()=>su,MimiEncoderOutput:()=>iu,MimiModel:()=>ou,MimiPreTrainedModel:()=>ru,Ministral3ForCausalLM:()=>Xc,Ministral3Model:()=>Yc,Ministral3PreTrainedModel:()=>Jc,MinistralForCausalLM:()=>qc,MinistralModel:()=>Kc,MinistralPreTrainedModel:()=>Gc,Mistral3ForConditionalGeneration:()=>$n,MistralForCausalLM:()=>Wc,MistralModel:()=>Uc,MistralPreTrainedModel:()=>Hc,MobileBertForMaskedLM:()=>Et,MobileBertForQuestionAnswering:()=>Ot,MobileBertForSequenceClassification:()=>Dt,MobileBertModel:()=>Tt,MobileBertPreTrainedModel:()=>wt,MobileLLMForCausalLM:()=>bi,MobileLLMModel:()=>yi,MobileLLMPreTrainedModel:()=>vi,MobileNetV1ForImageClassification:()=>Dl,MobileNetV1ForSemanticSegmentation:()=>Ol,MobileNetV1Model:()=>El,MobileNetV1PreTrainedModel:()=>Tl,MobileNetV2ForImageClassification:()=>jl,MobileNetV2ForSemanticSegmentation:()=>Ml,MobileNetV2Model:()=>Al,MobileNetV2PreTrainedModel:()=>kl,MobileNetV3ForImageClassification:()=>Fl,MobileNetV3ForSemanticSegmentation:()=>Il,MobileNetV3Model:()=>Pl,MobileNetV3PreTrainedModel:()=>Nl,MobileNetV4ForImageClassification:()=>zl,MobileNetV4ForSemanticSegmentation:()=>Bl,MobileNetV4Model:()=>Rl,MobileNetV4PreTrainedModel:()=>Ll,MobileViTForImageClassification:()=>Ga,MobileViTModel:()=>Wa,MobileViTPreTrainedModel:()=>Ua,MobileViTV2ForImageClassification:()=>Ja,MobileViTV2Model:()=>qa,MobileViTV2PreTrainedModel:()=>Ka,ModelOutput:()=>ce,ModernBertDecoderForCausalLM:()=>Oe,ModernBertDecoderModel:()=>De,ModernBertDecoderPreTrainedModel:()=>Ee,ModernBertForMaskedLM:()=>Ce,ModernBertForSequenceClassification:()=>we,ModernBertForTokenClassification:()=>Te,ModernBertModel:()=>Se,ModernBertPreTrainedModel:()=>xe,Moondream1ForConditionalGeneration:()=>qn,MoonshineForConditionalGeneration:()=>Hn,MoonshineModel:()=>Vn,MoonshinePreTrainedModel:()=>Bn,MptForCausalLM:()=>ga,MptModel:()=>ha,MptPreTrainedModel:()=>ma,MultiModalityCausalLM:()=>Wl,MultiModalityPreTrainedModel:()=>Ul,MusicgenForCausalLM:()=>Cl,MusicgenForConditionalGeneration:()=>wl,MusicgenModel:()=>Sl,MusicgenPreTrainedModel:()=>xl,NanoChatForCausalLM:()=>$r,NanoChatModel:()=>Qr,NanoChatPreTrainedModel:()=>Zr,NeoBertForMaskedLM:()=>_e,NeoBertForQuestionAnswering:()=>be,NeoBertForSequenceClassification:()=>ve,NeoBertForTokenClassification:()=>ye,NeoBertModel:()=>ge,NeoBertPreTrainedModel:()=>he,NomicBertModel:()=>Ae,NomicBertPreTrainedModel:()=>ke,OPTForCausalLM:()=>ya,OPTModel:()=>va,OPTPreTrainedModel:()=>_a,Olmo2ForCausalLM:()=>Ei,Olmo2Model:()=>Ti,Olmo2PreTrainedModel:()=>wi,OlmoForCausalLM:()=>Ci,OlmoModel:()=>Si,OlmoPreTrainedModel:()=>xi,OpenELMForCausalLM:()=>Xi,OpenELMModel:()=>Yi,OpenELMPreTrainedModel:()=>Ji,OwlViTForObjectDetection:()=>Za,OwlViTModel:()=>Xa,OwlViTPreTrainedModel:()=>Ya,Owlv2ForObjectDetection:()=>eo,Owlv2Model:()=>$a,Owlv2PreTrainedModel:()=>Qa,PaliGemmaForConditionalGeneration:()=>Zn,PaliGemmaPreTrainedModel:()=>Xn,ParakeetForCTC:()=>nc,ParakeetPreTrainedModel:()=>tc,PatchTSMixerForPrediction:()=>$l,PatchTSMixerModel:()=>Ql,PatchTSMixerPreTrainedModel:()=>Zl,PatchTSTForPrediction:()=>Xl,PatchTSTModel:()=>Yl,PatchTSTPreTrainedModel:()=>Jl,Phi3ForCausalLM:()=>ua,Phi3Model:()=>la,Phi3PreTrainedModel:()=>ca,Phi3VForCausalLM:()=>ar,Phi3VPreTrainedModel:()=>ir,PhiForCausalLM:()=>sa,PhiModel:()=>oa,PhiPreTrainedModel:()=>aa,PreTrainedModel:()=>B,PretrainedMixin:()=>yu,PvtForImageClassification:()=>Aa,PvtModel:()=>ka,PvtPreTrainedModel:()=>Oa,PyAnnoteForAudioFrameClassification:()=>ac,PyAnnoteModel:()=>ic,PyAnnotePreTrainedModel:()=>rc,QuestionAnsweringModelOutput:()=>Vd,Qwen2ForCausalLM:()=>$i,Qwen2Model:()=>Qi,Qwen2PreTrainedModel:()=>Zi,Qwen2VLForConditionalGeneration:()=>ia,Qwen2VLPreTrainedModel:()=>ra,Qwen3ForCausalLM:()=>na,Qwen3Model:()=>ta,Qwen3PreTrainedModel:()=>ea,RFDetrForObjectDetection:()=>bo,RFDetrModel:()=>yo,RFDetrObjectDetectionOutput:()=>xo,RFDetrPreTrainedModel:()=>vo,RTDetrForObjectDetection:()=>fo,RTDetrModel:()=>uo,RTDetrObjectDetectionOutput:()=>po,RTDetrPreTrainedModel:()=>lo,RTDetrV2ForObjectDetection:()=>go,RTDetrV2Model:()=>ho,RTDetrV2ObjectDetectionOutput:()=>_o,RTDetrV2PreTrainedModel:()=>mo,ResNetForImageClassification:()=>Lo,ResNetModel:()=>Io,ResNetPreTrainedModel:()=>Fo,RoFormerForMaskedLM:()=>Ne,RoFormerForQuestionAnswering:()=>Ie,RoFormerForSequenceClassification:()=>Pe,RoFormerForTokenClassification:()=>Fe,RoFormerModel:()=>Me,RoFormerPreTrainedModel:()=>je,RobertaForMaskedLM:()=>vn,RobertaForQuestionAnswering:()=>xn,RobertaForSequenceClassification:()=>yn,RobertaForTokenClassification:()=>bn,RobertaModel:()=>_n,RobertaPreTrainedModel:()=>gn,Sam2ImageSegmentationOutput:()=>zs,Sam2Model:()=>Vs,Sam2PreTrainedModel:()=>Bs,Sam3TrackerModel:()=>Us,SamImageSegmentationOutput:()=>Rs,SamModel:()=>Ls,SamPreTrainedModel:()=>Is,SapiensForDepthEstimation:()=>Qo,SapiensForNormalEstimation:()=>$o,SapiensForSemanticSegmentation:()=>Zo,SapiensPreTrainedModel:()=>Xo,SegformerForImageClassification:()=>ml,SegformerForSemanticSegmentation:()=>hl,SegformerModel:()=>pl,SegformerPreTrainedModel:()=>fl,Seq2SeqLMOutput:()=>Id,SequenceClassifierOutput:()=>Ld,SiglipModel:()=>pr,SiglipPreTrainedModel:()=>fr,SiglipTextModel:()=>mr,SiglipVisionModel:()=>hr,SmolLM3ForCausalLM:()=>ci,SmolLM3Model:()=>si,SmolLM3PreTrainedModel:()=>oi,SmolVLMForConditionalGeneration:()=>rr,SnacDecoderModel:()=>vu,SnacEncoderModel:()=>_u,SnacModel:()=>gu,SnacPreTrainedModel:()=>hu,SpeechT5ForSpeechToText:()=>Fc,SpeechT5ForTextToSpeech:()=>Ic,SpeechT5HifiGan:()=>Lc,SpeechT5Model:()=>Pc,SpeechT5PreTrainedModel:()=>Nc,SqueezeBertForMaskedLM:()=>Lt,SqueezeBertForQuestionAnswering:()=>zt,SqueezeBertForSequenceClassification:()=>Rt,SqueezeBertModel:()=>It,SqueezeBertPreTrainedModel:()=>Ft,StableLmForCausalLM:()=>vl,StableLmModel:()=>_l,StableLmPreTrainedModel:()=>gl,Starcoder2ForCausalLM:()=>nl,Starcoder2Model:()=>tl,Starcoder2PreTrainedModel:()=>el,StyleTextToSpeech2Model:()=>Mc,StyleTextToSpeech2PreTrainedModel:()=>jc,SupertonicForConditionalGeneration:()=>zc,SupertonicPreTrainedModel:()=>Rc,Swin2SRForImageSuperResolution:()=>Wo,Swin2SRModel:()=>Uo,Swin2SRPreTrainedModel:()=>Ho,SwinForImageClassification:()=>Bo,SwinForSemanticSegmentation:()=>Vo,SwinModel:()=>zo,SwinPreTrainedModel:()=>Ro,T5ForConditionalGeneration:()=>qt,T5Model:()=>Kt,T5PreTrainedModel:()=>Gt,TableTransformerForObjectDetection:()=>Do,TableTransformerModel:()=>Eo,TableTransformerObjectDetectionOutput:()=>Oo,TableTransformerPreTrainedModel:()=>To,TokenClassifierOutput:()=>zd,TrOCRForCausalLM:()=>Vc,TrOCRPreTrainedModel:()=>Bc,UltravoxModel:()=>tu,UltravoxPreTrainedModel:()=>eu,UniSpeechForCTC:()=>uc,UniSpeechForSequenceClassification:()=>dc,UniSpeechModel:()=>lc,UniSpeechPreTrainedModel:()=>cc,UniSpeechSatForAudioFrameClassification:()=>gc,UniSpeechSatForCTC:()=>mc,UniSpeechSatForSequenceClassification:()=>hc,UniSpeechSatModel:()=>pc,UniSpeechSatPreTrainedModel:()=>fc,VaultGemmaForCausalLM:()=>Wi,VaultGemmaModel:()=>Ui,VaultGemmaPreTrainedModel:()=>Hi,ViTForImageClassification:()=>Sa,ViTMAEModel:()=>Ma,ViTMAEPreTrainedModel:()=>ja,ViTMSNForImageClassification:()=>Fa,ViTMSNModel:()=>Pa,ViTMSNPreTrainedModel:()=>Na,ViTModel:()=>xa,ViTPreTrainedModel:()=>ba,VisionEncoderDecoderModel:()=>Un,VitMatteForImageMatting:()=>Ha,VitMattePreTrainedModel:()=>Va,VitPoseForPoseEstimation:()=>Da,VitPosePreTrainedModel:()=>Ea,VitsModel:()=>dl,VitsModelOutput:()=>Gd,VitsPreTrainedModel:()=>ul,VoxtralForConditionalGeneration:()=>nu,Wav2Vec2BertForCTC:()=>yc,Wav2Vec2BertForSequenceClassification:()=>bc,Wav2Vec2BertModel:()=>vc,Wav2Vec2BertPreTrainedModel:()=>_c,Wav2Vec2ForAudioFrameClassification:()=>ec,Wav2Vec2ForCTC:()=>Qs,Wav2Vec2ForSequenceClassification:()=>$s,Wav2Vec2Model:()=>Zs,Wav2Vec2PreTrainedModel:()=>Xs,WavLMForAudioFrameClassification:()=>Ac,WavLMForCTC:()=>Dc,WavLMForSequenceClassification:()=>Oc,WavLMForXVector:()=>kc,WavLMModel:()=>Ec,WavLMPreTrainedModel:()=>Tc,WeSpeakerResNetModel:()=>sc,WeSpeakerResNetPreTrainedModel:()=>oc,WhisperForConditionalGeneration:()=>Rn,WhisperModel:()=>H,WhisperPreTrainedModel:()=>Ln,XLMForQuestionAnswering:()=>Dn,XLMForSequenceClassification:()=>Tn,XLMForTokenClassification:()=>En,XLMModel:()=>Cn,XLMPreTrainedModel:()=>Sn,XLMRobertaForMaskedLM:()=>An,XLMRobertaForQuestionAnswering:()=>Nn,XLMRobertaForSequenceClassification:()=>jn,XLMRobertaForTokenClassification:()=>Mn,XLMRobertaModel:()=>kn,XLMRobertaPreTrainedModel:()=>On,XLMWithLMHeadModel:()=>wn,XVectorOutput:()=>Rd,YolosForObjectDetection:()=>Ps,YolosModel:()=>Ns,YolosObjectDetectionOutput:()=>Fs,YolosPreTrainedModel:()=>Ms});var r=n( +/*! ./configs.js */ +`./src/configs.js`),i=n( +/*! ./backends/onnx.js */ +`./src/backends/onnx.js`),a=n( +/*! ./utils/dtypes.js */ +`./src/utils/dtypes.js`),o=n( +/*! ./utils/generic.js */ +`./src/utils/generic.js`),s=n( +/*! ./utils/core.js */ +`./src/utils/core.js`),c=n( +/*! ./utils/hub.js */ +`./src/utils/hub.js`),l=n( +/*! ./utils/constants.js */ +`./src/utils/constants.js`),u=n( +/*! ./generation/logits_process.js */ +`./src/generation/logits_process.js`),d=n( +/*! ./generation/configuration_utils.js */ +`./src/generation/configuration_utils.js`),f=n( +/*! ./utils/tensor.js */ +`./src/utils/tensor.js`),p=n( +/*! ./utils/image.js */ +`./src/utils/image.js`),m=n( +/*! ./utils/maths.js */ +`./src/utils/maths.js`),h=n( +/*! ./generation/stopping_criteria.js */ +`./src/generation/stopping_criteria.js`),g=n( +/*! ./generation/logits_sampler.js */ +`./src/generation/logits_sampler.js`),_=n( +/*! ./env.js */ +`./src/env.js`),v=n( +/*! ./models/whisper/generation_whisper.js */ +`./src/models/whisper/generation_whisper.js`),y=n( +/*! ./models/whisper/common_whisper.js */ +`./src/models/whisper/common_whisper.js`);let b={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5,ImageTextToText:6,Musicgen:7,MultiModality:8,Phi3V:9,AudioTextToText:10,AutoEncoder:11,ImageAudioTextToText:12,Supertonic:13},x=new Map,S=new Map,C=new Map;async function w(e,t,n){let o=n.config?.[`transformers.js_config`]??{},s=n.device??o.device;s&&typeof s!=`string`&&(s.hasOwnProperty(t)?s=s[t]:(console.warn(`device not specified for "${t}". Using the default device.`),s=null));let l=s??(_.apis.IS_NODE_ENV?`cpu`:`wasm`),u=(0,i.deviceToExecutionProviders)(l),d=o.device_config??{};d.hasOwnProperty(l)&&(o={...o,...d[l]});let f=n.dtype??o.dtype;if(typeof f!=`string`&&(f&&f.hasOwnProperty(t)?f=f[t]:(f=a.DEFAULT_DEVICE_DTYPE_MAPPING[l]??a.DATA_TYPES.fp32,console.warn(`dtype not specified for "${t}". Using the default dtype (${f}) for this device (${l}).`))),f===a.DATA_TYPES.auto){let e=o.dtype;typeof e!=`string`&&(e=e?.[t]),f=e&&e!==a.DATA_TYPES.auto&&a.DATA_TYPES.hasOwnProperty(e)?e:a.DEFAULT_DEVICE_DTYPE_MAPPING[l]??a.DATA_TYPES.fp32}let p=f;if(!a.DEFAULT_DTYPE_SUFFIX_MAPPING.hasOwnProperty(p))throw Error(`Invalid dtype: ${p}. Should be one of: ${Object.keys(a.DATA_TYPES).join(`, `)}`);if(p===a.DATA_TYPES.fp16&&l===`webgpu`&&!await(0,a.isWebGpuFp16Supported)())throw Error(`The device (${l}) does not support fp16.`);let m=o.kv_cache_dtype,h=m?typeof m==`string`?m:m[p]??`float32`:void 0;if(h&&![`float32`,`float16`].includes(h))throw Error(`Invalid kv_cache_dtype: ${h}. Should be one of: float32, float16`);let g={dtype:p,kv_cache_dtype:h,device:l},v=`${t}${a.DEFAULT_DTYPE_SUFFIX_MAPPING[p]}.onnx`,y=`${n.subfolder??``}/${v}`,b={...n.session_options};b.executionProviders??=u;let x=o.free_dimension_overrides;x?b.freeDimensionOverrides??=x:l.startsWith(`webnn`)&&!b.freeDimensionOverrides&&console.warn(`WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config["transformers.js_config"]["device_config"]["${l}"]. When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`);let S=_.apis.IS_NODE_ENV&&_.env.useFSCache,C=(0,c.getModelFile)(e,y,!0,n,S),w=n.use_external_data_format??o.use_external_data_format,T=[];if(w){let r;r=typeof w==`object`?w.hasOwnProperty(v)?w[v]:w.hasOwnProperty(t)?w[t]:!1:w;let i=+r;if(i>c.MAX_EXTERNAL_DATA_CHUNKS)throw Error(`The number of external data chunks (${i}) exceeds the maximum allowed value (${c.MAX_EXTERNAL_DATA_CHUNKS}).`);for(let t=0;t{let o=await(0,c.getModelFile)(e,i,!0,n,S);t(o instanceof Uint8Array?{path:r,data:o}:r)}))}}else b.externalData!==void 0&&(T=b.externalData.map(async t=>{if(typeof t.data==`string`){let r=await(0,c.getModelFile)(e,t.data,!0,n);return{...t,data:r}}return t}));if(T.length>0){let e=await Promise.all(T);_.apis.IS_NODE_ENV||(b.externalData=e)}if(l===`webgpu`){let e=(0,r.getCacheShapes)(n.config,{prefix:`present`});if(Object.keys(e).length>0&&!(0,i.isONNXProxy)()){let t={};for(let n in e)t[n]=`gpu-buffer`;b.preferredOutputLocation=t}}return{buffer_or_path:await C,session_options:b,session_config:g}}async function T(e,t,n){return Object.fromEntries(await Promise.all(Object.keys(t).map(async r=>{let{buffer_or_path:a,session_options:o,session_config:s}=await w(e,t[r],n);return[r,await(0,i.createInferenceSession)(a,o,s)]})))}async function E(e,t,n){return Object.fromEntries(await Promise.all(Object.keys(t).map(async r=>[r,await(0,c.getModelJSON)(e,t[r],!1,n)])))}function D(e,t){let n=Object.create(null),r=[];for(let a of e.inputNames){let e=t[a];if(!(e instanceof f.Tensor)){r.push(a);continue}n[a]=(0,i.isONNXProxy)()?e.clone():e}if(r.length>0)throw Error(`An error occurred during model execution: "Missing the following inputs: ${r.join(`, `)}.`);let a=Object.keys(t).length,o=e.inputNames.length;if(a>o){let n=Object.keys(t).filter(t=>!e.inputNames.includes(t));console.warn(`WARNING: Too many inputs were provided (${a} > ${o}). The following inputs will be ignored: "${n.join(`, `)}".`)}return n}async function O(e,t){let n=D(e,t);try{let t=Object.fromEntries(Object.entries(n).map(([e,t])=>[e,t.ort_tensor]));return k(await(0,i.runInferenceSession)(e,t))}catch(e){let t=Object.fromEntries(Object.entries(n).map(([e,t])=>{let n={type:t.type,dims:t.dims,location:t.location};return n.location!==`gpu-buffer`&&(n.data=t.data),[e,n]}));throw console.error(`An error occurred during model execution: "${e}".`),console.error(`Inputs given to model:`,t),e}}function k(e){for(let t in e)(0,i.isONNXTensor)(e[t])?e[t]=new f.Tensor(e[t]):typeof e[t]==`object`&&k(e[t]);return e}function A(e){if(e instanceof f.Tensor)return e;if(e.length===0)throw Error(`items must be non-empty`);if(Array.isArray(e[0])){if(e.some(t=>t.length!==e[0].length))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.`);return new f.Tensor(`int64`,BigInt64Array.from(e.flat().map(e=>BigInt(e))),[e.length,e[0].length])}else return new f.Tensor(`int64`,BigInt64Array.from(e.map(e=>BigInt(e))),[1,e.length])}function j(e){return new f.Tensor(`bool`,[e],[1])}async function M(e,t){let{encoder_outputs:n,input_ids:r,decoder_input_ids:i,...a}=t;return n||=(await N(e,(0,s.pick)(t,e.sessions.model.inputNames))).last_hidden_state,a.input_ids=i,a.encoder_hidden_states=n,e.sessions.decoder_model_merged.inputNames.includes(`encoder_attention_mask`)&&(a.encoder_attention_mask=t.attention_mask),await F(e,a,!0)}async function N(e,t){let n=e.sessions.model,r=(0,s.pick)(t,n.inputNames);if(n.inputNames.includes(`inputs_embeds`)&&!r.inputs_embeds){if(!t.input_ids)throw Error("Both `input_ids` and `inputs_embeds` are missing in the model inputs.");r.inputs_embeds=await e.encode_text({input_ids:t.input_ids})}if(n.inputNames.includes(`token_type_ids`)&&!r.token_type_ids){if(!r.input_ids)throw Error("Both `input_ids` and `token_type_ids` are missing in the model inputs.");r.token_type_ids=(0,f.zeros_like)(r.input_ids)}if(n.inputNames.includes(`pixel_mask`)&&!r.pixel_mask){if(!r.pixel_values)throw Error("Both `pixel_values` and `pixel_mask` are missing in the model inputs.");let e=r.pixel_values.dims;r.pixel_mask=(0,f.ones)([e[0],e[2],e[3]])}return await O(n,r)}async function P(e,t){let n=await e.encode(t);return await e.decode(n)}async function F(e,t,n=!1){let r=e.sessions[n?`decoder_model_merged`:`model`],{past_key_values:i,...a}=t;return r.inputNames.includes(`use_cache_branch`)&&(a.use_cache_branch=j(!!i)),r.inputNames.includes(`position_ids`)&&a.attention_mask&&!a.position_ids&&(a.position_ids=ie(a,i,+!![`paligemma`,`gemma3_text`,`gemma3`].includes(e.config.model_type))),e.addPastKeyValues(a,i),await O(r,(0,s.pick)(a,r.inputNames))}function I({modality_token_id:e,inputs_embeds:t,modality_features:n,input_ids:r,attention_mask:i}){let a=r.tolist().map(t=>t.reduce((t,n,r)=>(n==e&&t.push(r),t),[])),o=a.reduce((e,t)=>e+t.length,0),s=n.dims[0];if(o!==s)throw Error(`Number of tokens and features do not match: tokens: ${o}, features ${s}`);let c=0;for(let e=0;ee.dims[1]||i[e.at(-1)])),{...n,decoder_input_ids:A(t)}}function oe(e,...t){return e.config.is_encoder_decoder?z(e,...t):ae(e,...t)}function se(e,t,n,r){let i=!!n.past_key_values;return r.guidance_scale!==null&&r.guidance_scale>1&&(i?n.input_ids=(0,f.cat)([n.input_ids,n.input_ids],0):(n.input_ids=(0,f.cat)([n.input_ids,(0,f.full_like)(n.input_ids,BigInt(r.pad_token_id))],0),n.attention_mask=(0,f.cat)([n.attention_mask,(0,f.full_like)(n.attention_mask,0n)],0))),(i||!n.pixel_values)&&(n.pixel_values=(0,f.full)([0,0,3,384,384],1)),i&&(n.images_seq_mask=new f.Tensor(`bool`,[,].fill(!0).fill(!1,0,1),[1,1]),n.images_emb_mask=new f.Tensor(`bool`,[].fill(!1),[1,1,0])),n}class B extends o.Callable{main_input_name=`input_ids`;forward_params=[`input_ids`,`attention_mask`];constructor(e,t,n){super(),this.config=e,this.sessions=t,this.configs=n;let r=C.get(this.constructor),i=x.get(r);switch(this.can_generate=!1,this._forward=null,this._prepare_inputs_for_generation=null,i){case b.DecoderOnly:this.can_generate=!0,this._forward=F,this._prepare_inputs_for_generation=ae;break;case b.Seq2Seq:case b.Vision2Seq:case b.Musicgen:this.can_generate=!0,this._forward=M,this._prepare_inputs_for_generation=z;break;case b.EncoderDecoder:this._forward=M;break;case b.ImageTextToText:this.can_generate=!0,this._forward=ne,this._prepare_inputs_for_generation=oe;break;case b.AudioTextToText:this.can_generate=!0,this._forward=R,this._prepare_inputs_for_generation=oe;break;case b.Phi3V:case b.ImageAudioTextToText:this.can_generate=!0,this._prepare_inputs_for_generation=oe;break;case b.MultiModality:this.can_generate=!0,this._prepare_inputs_for_generation=se;break;case b.AutoEncoder:this._forward=P;break;default:this._forward=N;break}this.can_generate&&this.forward_params.push(`past_key_values`),this.custom_config=this.config[`transformers.js_config`]??{}}async dispose(){let e=[];for(let t of Object.values(this.sessions))t?.handler?.dispose&&e.push(t.handler.dispose());return await Promise.all(e)}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,model_file_name:s=null,subfolder:c=`onnx`,device:u=null,dtype:d=null,use_external_data_format:f=null,session_options:p={}}={}){let m={progress_callback:t,config:n,cache_dir:i,local_files_only:a,revision:o,model_file_name:s,subfolder:c,device:u,dtype:d,use_external_data_format:f,session_options:p},h=C.get(this),g=x.get(h);n=m.config=await r.AutoConfig.from_pretrained(e,m);let _;if(g===b.DecoderOnly)_=await Promise.all([T(e,{model:m.model_file_name??`model`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.Seq2Seq||g===b.Vision2Seq)_=await Promise.all([T(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.MaskGeneration)_=await Promise.all([T(e,{model:`vision_encoder`,prompt_encoder_mask_decoder:`prompt_encoder_mask_decoder`},m)]);else if(g===b.EncoderDecoder)_=await Promise.all([T(e,{model:`encoder_model`,decoder_model_merged:`decoder_model_merged`},m)]);else if(g===b.ImageTextToText){let t={embed_tokens:`embed_tokens`,vision_encoder:`vision_encoder`,decoder_model_merged:`decoder_model_merged`};n.is_encoder_decoder&&(t.model=`encoder_model`),_=await Promise.all([T(e,t,m),E(e,{generation_config:`generation_config.json`},m)])}else if(g===b.AudioTextToText)_=await Promise.all([T(e,{embed_tokens:`embed_tokens`,audio_encoder:`audio_encoder`,decoder_model_merged:`decoder_model_merged`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.ImageAudioTextToText)_=await Promise.all([T(e,{embed_tokens:`embed_tokens`,audio_encoder:`audio_encoder`,vision_encoder:`vision_encoder`,decoder_model_merged:`decoder_model_merged`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.Musicgen)_=await Promise.all([T(e,{model:`text_encoder`,decoder_model_merged:`decoder_model_merged`,encodec_decode:`encodec_decode`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.MultiModality)_=await Promise.all([T(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`language_model`,lm_head:`lm_head`,gen_head:`gen_head`,gen_img_embeds:`gen_img_embeds`,image_decode:`image_decode`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.Phi3V)_=await Promise.all([T(e,{prepare_inputs_embeds:`prepare_inputs_embeds`,model:`model`,vision_encoder:`vision_encoder`},m),E(e,{generation_config:`generation_config.json`},m)]);else if(g===b.AutoEncoder)_=await Promise.all([T(e,{encoder_model:`encoder_model`,decoder_model:`decoder_model`},m)]);else if(g===b.Supertonic)_=await Promise.all([T(e,{text_encoder:`text_encoder`,latent_denoiser:`latent_denoiser`,voice_decoder:`voice_decoder`},m)]);else{if(g!==b.EncoderOnly){let e=h??n?.model_type;e!==`custom`&&console.warn(`Model type for '${e}' not found, assuming encoder-only architecture. Please report this at ${l.GITHUB_ISSUE_URL}.`)}_=await Promise.all([T(e,{model:m.model_file_name??`model`},m)])}return new this(n,..._)}async _call(e){return await this.forward(e)}async forward(e){return await this._forward(this,e)}get generation_config(){return this.configs?.generation_config??null}_get_logits_processor(e,t,n=null){let r=new u.LogitsProcessorList;if(e.repetition_penalty!==null&&e.repetition_penalty!==1&&r.push(new u.RepetitionPenaltyLogitsProcessor(e.repetition_penalty)),e.no_repeat_ngram_size!==null&&e.no_repeat_ngram_size>0&&r.push(new u.NoRepeatNGramLogitsProcessor(e.no_repeat_ngram_size)),e.bad_words_ids!==null&&r.push(new u.NoBadWordsLogitsProcessor(e.bad_words_ids,e.eos_token_id)),e.min_length!==null&&e.eos_token_id!==null&&e.min_length>0&&r.push(new u.MinLengthLogitsProcessor(e.min_length,e.eos_token_id)),e.min_new_tokens!==null&&e.eos_token_id!==null&&e.min_new_tokens>0&&r.push(new u.MinNewTokensLengthLogitsProcessor(t,e.min_new_tokens,e.eos_token_id)),e.forced_bos_token_id!==null&&r.push(new u.ForcedBOSTokenLogitsProcessor(e.forced_bos_token_id)),e.forced_eos_token_id!==null&&r.push(new u.ForcedEOSTokenLogitsProcessor(e.max_length,e.forced_eos_token_id)),e.begin_suppress_tokens!==null){let n=t>1||e.forced_bos_token_id===null?t:t+1;r.push(new u.SuppressTokensAtBeginLogitsProcessor(e.begin_suppress_tokens,n))}return e.guidance_scale!==null&&e.guidance_scale>1&&r.push(new u.ClassifierFreeGuidanceLogitsProcessor(e.guidance_scale)),e.temperature===0&&e.do_sample&&(console.warn("`do_sample` changed to false because `temperature: 0` implies greedy sampling (always selecting the most likely token), which is incompatible with `do_sample: true`."),e.do_sample=!1),e.do_sample&&e.temperature!==null&&e.temperature!==1&&r.push(new u.TemperatureLogitsWarper(e.temperature)),n!==null&&r.extend(n),r}_prepare_generation_config(e,t,n=d.GenerationConfig){let r={...this.config};for(let e of[`decoder`,`generator`,`text_config`])e in r&&Object.assign(r,r[e]);let i=new n(r);return Object.assign(i,this.generation_config??{}),e&&Object.assign(i,e),t&&Object.assign(i,(0,s.pick)(t,Object.getOwnPropertyNames(i))),i}_get_stopping_criteria(e,t=null){let n=new h.StoppingCriteriaList;return e.max_length!==null&&n.push(new h.MaxLengthCriteria(e.max_length,this.config.max_position_embeddings??null)),e.eos_token_id!==null&&n.push(new h.EosTokenCriteria(e.eos_token_id)),t&&n.extend(t),n}_validate_model_class(){if(!this.can_generate){let e=[Au,Pu,ku,wu],t=C.get(this.constructor),n=new Set,r=this.config.model_type;for(let t of e){let e=t.get(r);e&&n.add(e[0])}let i=`The current model class (${t}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;throw n.size>0&&(i+=` Please use the following class instead: ${[...n].join(`, `)}`),Error(i)}}prepare_inputs_for_generation(...e){return this._prepare_inputs_for_generation(this,...e)}_update_model_kwargs_for_generation({generated_input_ids:e,outputs:t,model_inputs:n,is_encoder_decoder:r}){return n.past_key_values=this.getPastKeyValues(t,n.past_key_values),n.input_ids=new f.Tensor(`int64`,e.flat(),[e.length,1]),r?`decoder_attention_mask`in n:n.attention_mask=(0,f.cat)([n.attention_mask,(0,f.ones)([n.attention_mask.dims[0],1])],1),n.position_ids=null,n}_prepare_model_inputs({inputs:e,bos_token_id:t,model_kwargs:n}){let r=(0,s.pick)(n,this.forward_params),i=this.main_input_name;if(i in r){if(e)throw Error("`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. Make sure to either pass {inputs} or {input_name}=...")}else r[i]=e;return{inputs_tensor:r[i],model_inputs:r,model_input_name:i}}async _prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:e,model_inputs:t,model_input_name:n,generation_config:r}){if(this.sessions.model.inputNames.includes(`inputs_embeds`)&&!t.inputs_embeds&&`_prepare_inputs_embeds`in this){let{input_ids:e,pixel_values:n,attention_mask:r,...i}=t,a=await this._prepare_inputs_embeds(t);t={...i,...(0,s.pick)(a,[`inputs_embeds`,`attention_mask`])}}let{last_hidden_state:i}=await N(this,t);if(r.guidance_scale!==null&&r.guidance_scale>1)i=(0,f.cat)([i,(0,f.full_like)(i,0)],0),`attention_mask`in t&&(t.attention_mask=(0,f.cat)([t.attention_mask,(0,f.zeros_like)(t.attention_mask)],0));else if(t.decoder_input_ids){let e=A(t.decoder_input_ids).dims[0];if(e!==i.dims[0]){if(i.dims[0]!==1)throw Error(`The encoder outputs have a different batch size (${i.dims[0]}) than the decoder inputs (${e}).`);i=(0,f.cat)(Array.from({length:e},()=>i),0)}}return t.encoder_outputs=i,t}_prepare_decoder_input_ids_for_generation({batch_size:e,model_input_name:t,model_kwargs:n,decoder_start_token_id:r,bos_token_id:i,generation_config:a}){let{decoder_input_ids:o,...s}=n;if(!(o instanceof f.Tensor)){if(o)Array.isArray(o[0])||(o=Array.from({length:e},()=>o));else if(r??=i,this.config.model_type===`musicgen`)o=Array.from({length:e*this.config.decoder.num_codebooks},()=>[r]);else if(Array.isArray(r)){if(r.length!==e)throw Error(`\`decoder_start_token_id\` expcted to have length ${e} but got ${r.length}`);o=r}else o=Array.from({length:e},()=>[r]);o=A(o)}return n.decoder_attention_mask=(0,f.ones_like)(o),{input_ids:o,model_inputs:s}}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,streamer:i=null,...a}){this._validate_model_class(),t=this._prepare_generation_config(t,a);let{inputs_tensor:o,model_inputs:s,model_input_name:c}=this._prepare_model_inputs({inputs:e,model_kwargs:a}),l=this.config.is_encoder_decoder;l&&(`encoder_outputs`in s||(s=await this._prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:o,model_inputs:s,model_input_name:c,generation_config:t})));let u;l?{input_ids:u,model_inputs:s}=this._prepare_decoder_input_ids_for_generation({batch_size:s[c].dims.at(0),model_input_name:c,model_kwargs:s,decoder_start_token_id:t.decoder_start_token_id,bos_token_id:t.bos_token_id,generation_config:t}):u=s[c];let d=u.dims.at(-1);t.max_new_tokens!==null&&(t.max_length=d+t.max_new_tokens);let p=this._get_logits_processor(t,d,n),m=this._get_stopping_criteria(t,r),h=s[c].dims.at(0),_=g.LogitsSampler.getSampler(t),v=Array(h).fill(0),y=u.tolist();i&&i.put(y);let b,x={};for(;;){if(s=this.prepare_inputs_for_generation(y,s,t),b=await this.forward(s),t.output_attentions&&t.return_dict_in_generate){let e=this.getAttentions(b);for(let t in e)t in x||(x[t]=[]),x[t].push(e[t])}let e=p(y,b.logits.slice(null,-1,null)),n=[];for(let t=0;te))break;s=this._update_model_kwargs_for_generation({generated_input_ids:n,outputs:b,model_inputs:s,is_encoder_decoder:l})}i&&i.end();let S=this.getPastKeyValues(b,s.past_key_values,!0),C=new f.Tensor(`int64`,y.flat(),[y.length,y[0].length]);if(t.return_dict_in_generate)return{sequences:C,past_key_values:S,...x};for(let e of Object.values(b))e.location===`gpu-buffer`&&e.dispose();return C}getPastKeyValues(e,t,n=!1){let r=Object.create(null);for(let i in e)if(i.startsWith(`present`)){let a=i.replace(`present_conv`,`past_conv`).replace(`present`,`past_key_values`),o=i.includes(`encoder`);if(o&&t?r[a]=t[a]:r[a]=e[i],t&&(!o||n)){let e=t[a];e.location===`gpu-buffer`&&e.dispose()}}return r}getAttentions(e){let t={};for(let n of[`cross_attentions`,`encoder_attentions`,`decoder_attentions`])for(let r in e)r.startsWith(n)&&(n in t||(t[n]=[]),t[n].push(e[r]));return t}addPastKeyValues(e,t){if(t)Object.assign(e,t);else{let t=this.sessions.decoder_model_merged??this.sessions.model,n=(e[this.main_input_name]??e.attention_mask)?.dims?.[0]??1,i=t?.config?.kv_cache_dtype??`float32`,a=i===`float16`?f.DataTypeMap.float16:f.DataTypeMap.float32,o=(0,r.getCacheShapes)(this.config,{batch_size:n});for(let t in o){let n=o[t].reduce((e,t)=>e*t,1);e[t]=new f.Tensor(i,new a(n),o[t])}}}async encode_image({pixel_values:e}){return(await O(this.sessions.vision_encoder,{pixel_values:e})).image_features}async encode_text({input_ids:e}){return(await O(this.sessions.embed_tokens,{input_ids:e})).inputs_embeds}async encode_audio({audio_values:e}){return(await O(this.sessions.audio_encoder,{audio_values:e})).audio_features}}class ce{}class le extends ce{constructor({last_hidden_state:e,hidden_states:t=null,attentions:n=null}){super(),this.last_hidden_state=e,this.hidden_states=t,this.attentions=n}}class ue extends B{}class de extends ue{}class fe extends ue{async _call(e){return new Bd(await super._call(e))}}class pe extends ue{async _call(e){return new Ld(await super._call(e))}}class me extends ue{async _call(e){return new zd(await super._call(e))}}class V extends ue{async _call(e){return new Vd(await super._call(e))}}class he extends B{}class ge extends he{}class _e extends he{async _call(e){return new Bd(await super._call(e))}}class ve extends he{async _call(e){return new Ld(await super._call(e))}}class ye extends he{async _call(e){return new zd(await super._call(e))}}class be extends he{async _call(e){return new Vd(await super._call(e))}}class xe extends B{}class Se extends xe{}class Ce extends xe{async _call(e){return new Bd(await super._call(e))}}class we extends xe{async _call(e){return new Ld(await super._call(e))}}class Te extends xe{async _call(e){return new zd(await super._call(e))}}class Ee extends B{}class De extends Ee{}class Oe extends Ee{}class ke extends B{}class Ae extends ke{}class je extends B{}class Me extends je{}class Ne extends je{async _call(e){return new Bd(await super._call(e))}}class Pe extends je{async _call(e){return new Ld(await super._call(e))}}class Fe extends je{async _call(e){return new zd(await super._call(e))}}class Ie extends je{async _call(e){return new Vd(await super._call(e))}}class Le extends B{}class Re extends Le{}class ze extends Le{async _call(e){return new Bd(await super._call(e))}}class Be extends Le{async _call(e){return new Ld(await super._call(e))}}class Ve extends Le{async _call(e){return new zd(await super._call(e))}}class He extends Le{async _call(e){return new Vd(await super._call(e))}}class Ue extends B{}class We extends Ue{}class Ge extends Ue{async _call(e){return new Bd(await super._call(e))}}class Ke extends Ue{async _call(e){return new Ld(await super._call(e))}}class qe extends Ue{async _call(e){return new zd(await super._call(e))}}class Je extends Ue{async _call(e){return new Vd(await super._call(e))}}class Ye extends B{}class Xe extends Ye{}class Ze extends Ye{async _call(e){return new Bd(await super._call(e))}}class Qe extends Ye{async _call(e){return new Ld(await super._call(e))}}class $e extends Ye{async _call(e){return new zd(await super._call(e))}}class et extends Ye{async _call(e){return new Vd(await super._call(e))}}class tt extends B{}class nt extends tt{}class rt extends tt{async _call(e){return new Bd(await super._call(e))}}class it extends tt{async _call(e){return new Ld(await super._call(e))}}class at extends tt{async _call(e){return new zd(await super._call(e))}}class ot extends tt{async _call(e){return new Vd(await super._call(e))}}class st extends B{}class ct extends st{}class lt extends st{async _call(e){return new Bd(await super._call(e))}}class ut extends st{async _call(e){return new Ld(await super._call(e))}}class dt extends st{async _call(e){return new zd(await super._call(e))}}class ft extends st{async _call(e){return new Vd(await super._call(e))}}class pt extends B{}class mt extends pt{}class ht extends pt{async _call(e){return new Ld(await super._call(e))}}class gt extends pt{async _call(e){return new zd(await super._call(e))}}class _t extends pt{async _call(e){return new Vd(await super._call(e))}}class vt extends pt{async _call(e){return new Bd(await super._call(e))}}class yt extends B{}class bt extends yt{}class xt extends yt{async _call(e){return new Bd(await super._call(e))}}class St extends yt{async _call(e){return new Ld(await super._call(e))}}class Ct extends yt{async _call(e){return new zd(await super._call(e))}}class wt extends B{}class Tt extends wt{}class Et extends wt{async _call(e){return new Bd(await super._call(e))}}class Dt extends wt{async _call(e){return new Ld(await super._call(e))}}class Ot extends wt{async _call(e){return new Vd(await super._call(e))}}class kt extends B{}class At extends kt{}class jt extends kt{async _call(e){return new Bd(await super._call(e))}}class Mt extends kt{async _call(e){return new Ld(await super._call(e))}}class Nt extends kt{async _call(e){return new zd(await super._call(e))}}class Pt extends kt{async _call(e){return new Vd(await super._call(e))}}class Ft extends B{}class It extends Ft{}class Lt extends Ft{async _call(e){return new Bd(await super._call(e))}}class Rt extends Ft{async _call(e){return new Ld(await super._call(e))}}class zt extends Ft{async _call(e){return new Vd(await super._call(e))}}class Bt extends B{}class Vt extends Bt{}class Ht extends Bt{async _call(e){return new Ld(await super._call(e))}}class Ut extends Bt{async _call(e){return new Vd(await super._call(e))}}class Wt extends Bt{async _call(e){return new Bd(await super._call(e))}}class Gt extends B{forward_params=[`input_ids`,`attention_mask`,`encoder_outputs`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`]}class Kt extends Gt{}class qt extends Gt{}class Jt extends B{}class Yt extends Jt{}class Xt extends Jt{}class Zt extends B{}class Qt extends Zt{}class $t extends Zt{}class en extends B{}class tn extends en{}class nn extends en{}class rn extends en{async _call(e){return new Ld(await super._call(e))}}class an extends B{}class on extends an{}class sn extends an{}class cn extends an{async _call(e){return new Ld(await super._call(e))}}class ln extends an{}class un extends B{}class dn extends un{}class fn extends un{}class pn extends B{}class mn extends pn{}class hn extends pn{}class gn extends B{}class _n extends gn{}class vn extends gn{async _call(e){return new Bd(await super._call(e))}}class yn extends gn{async _call(e){return new Ld(await super._call(e))}}class bn extends gn{async _call(e){return new zd(await super._call(e))}}class xn extends gn{async _call(e){return new Vd(await super._call(e))}}class Sn extends B{}class Cn extends Sn{}class wn extends Sn{async _call(e){return new Bd(await super._call(e))}}class Tn extends Sn{async _call(e){return new Ld(await super._call(e))}}class En extends Sn{async _call(e){return new zd(await super._call(e))}}class Dn extends Sn{async _call(e){return new Vd(await super._call(e))}}class On extends B{}class kn extends On{}class An extends On{async _call(e){return new Bd(await super._call(e))}}class jn extends On{async _call(e){return new Ld(await super._call(e))}}class Mn extends On{async _call(e){return new zd(await super._call(e))}}class Nn extends On{async _call(e){return new Vd(await super._call(e))}}class Pn extends B{}class Fn extends Pn{}class In extends Pn{}class Ln extends B{requires_attention_mask=!1;main_input_name=`input_features`;forward_params=[`input_features`,`attention_mask`,`decoder_input_ids`,`decoder_attention_mask`,`past_key_values`]}class H extends Ln{}class Rn extends Ln{_prepare_generation_config(e,t){return super._prepare_generation_config(e,t,v.WhisperGenerationConfig)}_retrieve_init_tokens(e){let t=[e.decoder_start_token_id],n=e.language,r=e.task;if(e.is_multilingual){n||=(console.warn(`No language specified - defaulting to English (en).`),`en`);let i=`<|${(0,y.whisper_language_to_code)(n)}|>`;t.push(e.lang_to_id[i]),t.push(e.task_to_id[r??`transcribe`])}else if(n||r)throw Error("Cannot specify `task` or `language` for an English-only model. If the model is intended to be multilingual, pass `is_multilingual=true` to generate, or update the generation config.");return!e.return_timestamps&&e.no_timestamps_token_id&&t.at(-1)!==e.no_timestamps_token_id?t.push(e.no_timestamps_token_id):e.return_timestamps&&t.at(-1)===e.no_timestamps_token_id&&(console.warn("<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`."),t.pop()),t.filter(e=>e!=null)}async generate({inputs:e=null,generation_config:t=null,logits_processor:n=null,stopping_criteria:r=null,...i}){t=this._prepare_generation_config(t,i);let a=i.decoder_input_ids??this._retrieve_init_tokens(t);if(t.return_timestamps&&(n??=new u.LogitsProcessorList,n.push(new u.WhisperTimeStampLogitsProcessor(t,a))),t.begin_suppress_tokens&&(n??=new u.LogitsProcessorList,n.push(new u.SuppressTokensAtBeginLogitsProcessor(t.begin_suppress_tokens,a.length))),t.return_token_timestamps){if(!t.alignment_heads)throw Error("Model generation config has no `alignment_heads`, token-level timestamps not available. See https://gist.github.com/hollance/42e32852f24243b748ae6bc1f985b13a on how to add this property to the generation config.");t.task===`translate`&&console.warn(`Token-level timestamps may not be reliable for task 'translate'.`),t.output_attentions=!0,t.return_dict_in_generate=!0}let o=await super.generate({inputs:e,generation_config:t,logits_processor:n,decoder_input_ids:a,...i});return t.return_token_timestamps&&(o.token_timestamps=this._extract_token_timestamps(o,t.alignment_heads,t.num_frames)),o}_extract_token_timestamps(e,t,n=null,r=.02){if(!e.cross_attentions)throw Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");n??console.warn("`num_frames` has not been set, meaning the entire audio will be analyzed. This may lead to inaccurate token-level timestamps for short audios (< 30 seconds).");let i=this.config.median_filter_width;i===void 0&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),i=7);let a=e.cross_attentions,o=Array.from({length:this.config.decoder_layers},(e,t)=>(0,f.cat)(a.map(e=>e[t]),2)),c=(0,f.stack)(t.map(([e,t])=>{if(e>=o.length)throw Error(`Layer index ${e} is out of bounds for cross attentions (length ${o.length}).`);return n?o[e].slice(null,t,null,[0,n]):o[e].slice(null,t)})).transpose(1,0,2,3),[l,u]=(0,f.std_mean)(c,-2,0,!0),d=c.clone();for(let e=0;en[t+1]-n[t]),o=(0,s.mergeArrays)([1],a).map(e=>!!e),c=[];for(let e=0;eArray.from({length:e.dims[0]},t=>Array.from({length:e.dims[1]},e=>1))),p=t?t.tolist():[],h=n?n.tolist():[],g=0,_=0;for(let e=0;eu[e][n]==1),n=t.reduce((e,t,n)=>(t==s&&e.push(n),e),[]).map(e=>t[e+1]),r=n.filter(e=>e==a).length,f=n.filter(e=>e==o).length,v=[],y=0,b=r,x=f;for(let e=0;et>y&&e==a),n=t.findIndex((e,t)=>t>y&&e==o),r=b>0&&e!==-1?e:t.length+1,i=x>0&&n!==-1?n:t.length+1,s,l,u,d;r0?(0,m.max)(v.at(-1))[0]+1:0;v.push(Array.from({length:3*w},(e,t)=>T+t%w));let E=w+T,D=f*S*C,O=Array.from({length:D},(e,t)=>E+Math.floor(t/(S*C))),k=Array.from({length:D},(e,t)=>E+Math.floor(t/C)%S),A=Array.from({length:D},(e,t)=>E+t%C);v.push([O,k,A].flat()),y=s+D}if(y0?(0,m.max)(v.at(-1))[0]+1:0,n=t.length-y;v.push(Array.from({length:3*n},(t,r)=>e+r%n))}let S=v.reduce((e,t)=>e+t.length,0),C=Array(S),w=0;for(let e=0;e<3;++e)for(let t=0;te[n%e.length]),i=Array.from({length:t[0]},(n,r)=>(0,m.max)(e.subarray(t[1]*r,t[1]*(r+1)))[0]+1n+BigInt(t[1]));return[new f.Tensor(`int64`,n,[3,...t]),new f.Tensor(`int64`,i,[i.length,1])]}else{let[t,n]=e.dims,r=BigInt64Array.from({length:3*t*n},(e,r)=>BigInt(Math.floor(r%n/t)));return[new f.Tensor(`int64`,r,[3,...e.dims]),(0,f.zeros)([t,1])]}}async encode_image({pixel_values:e,image_grid_thw:t}){return(await O(this.sessions.vision_encoder,{pixel_values:e,grid_thw:t})).image_features}_merge_input_ids_with_image_features(e){return L({image_token_id:this.config.image_token_id,...e})}prepare_inputs_for_generation(e,t,n){if(t.attention_mask&&!t.position_ids)if(!t.past_key_values)[t.position_ids,t.rope_deltas]=this.get_rope_index(t.input_ids,t.image_grid_thw,t.video_grid_thw,t.attention_mask);else{t.pixel_values=null;let e=BigInt(Object.values(t.past_key_values)[0].dims.at(-2)),n=t.rope_deltas.map(t=>e+t);t.position_ids=(0,f.stack)([n,n,n],0)}return t}}class aa extends B{}class oa extends aa{}class sa extends aa{}class ca extends B{}class la extends ca{}class ua extends ca{}class da extends B{}class fa extends da{}class pa extends da{}class ma extends B{}class ha extends ma{}class ga extends ma{}class _a extends B{}class va extends _a{}class ya extends _a{}class ba extends B{}class xa extends ba{}class Sa extends ba{async _call(e){return new Ld(await super._call(e))}}class Ca extends B{}class wa extends Ca{}class Ta extends Ca{async _call(e){return new Ld(await super._call(e))}}class Ea extends B{}class Da extends Ea{}class Oa extends B{}class ka extends Oa{}class Aa extends Oa{async _call(e){return new Ld(await super._call(e))}}class ja extends B{}class Ma extends ja{}class Na extends B{}class Pa extends Na{}class Fa extends Na{async _call(e){return new Ld(await super._call(e))}}class Ia extends B{}class La extends Ia{}class Ra extends B{}class za extends Ra{}class Ba extends Ra{async _call(e){return new Ld(await super._call(e))}}class Va extends B{}class Ha extends Va{async _call(e){return new Wd(await super._call(e))}}class Ua extends B{}class Wa extends Ua{}class Ga extends Ua{async _call(e){return new Ld(await super._call(e))}}class Ka extends B{}class qa extends Ka{}class Ja extends Ka{async _call(e){return new Ld(await super._call(e))}}class Ya extends B{}class Xa extends Ya{}class Za extends Ya{}class Qa extends B{}class $a extends Qa{}class eo extends Qa{}class to extends B{}class no extends to{}class ro extends to{async _call(e){return new Ld(await super._call(e))}}class io extends B{}class W extends io{}class ao extends io{async _call(e){return new so(await super._call(e))}}class oo extends io{async _call(e){return new co(await super._call(e))}}class so extends ce{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class co extends ce{constructor({logits:e,pred_boxes:t,pred_masks:n}){super(),this.logits=e,this.pred_boxes=t,this.pred_masks=n}}class lo extends B{}class uo extends lo{}class fo extends lo{async _call(e){return new po(await super._call(e))}}class po extends ce{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class mo extends B{}class ho extends mo{}class go extends mo{async _call(e){return new _o(await super._call(e))}}class _o extends po{}class vo extends B{}class yo extends vo{}class bo extends vo{async _call(e){return new xo(await super._call(e))}}class xo extends po{}class So extends B{}class Co extends So{}class wo extends So{async _call(e){return new po(await super._call(e))}}class To extends B{}class Eo extends To{}class Do extends To{async _call(e){return new Oo(await super._call(e))}}class Oo extends so{}class ko extends B{}class Ao extends ko{}class jo extends ko{async _call(e){return new Ld(await super._call(e))}}class Mo extends B{}class No extends Mo{}class Po extends Mo{async _call(e){return new Ld(await super._call(e))}}class Fo extends B{}class Io extends Fo{}class Lo extends Fo{async _call(e){return new Ld(await super._call(e))}}class Ro extends B{}class zo extends Ro{}class Bo extends Ro{async _call(e){return new Ld(await super._call(e))}}class Vo extends Ro{}class Ho extends B{}class Uo extends Ho{}class Wo extends Ho{}class Go extends B{}class Ko extends Go{}class qo extends Go{}class Jo extends B{}class Yo extends Jo{}class Xo extends B{}class Zo extends Xo{}class Qo extends Xo{}class $o extends Xo{}class es extends B{}class ts extends es{}class ns extends B{}class rs extends ns{}class is extends B{}class as extends is{}class os extends B{}class ss extends os{}class cs extends os{}class ls extends B{}class us extends ls{}class ds extends ls{}class fs extends B{}class ps extends fs{}class ms extends B{}class hs extends ms{}class gs extends ms{async _call(e){return new Ld(await super._call(e))}}class _s extends B{}class vs extends _s{}class ys extends _s{async _call(e){return new Ld(await super._call(e))}}class bs extends B{}class xs extends bs{}class Ss extends bs{async _call(e){return new Ld(await super._call(e))}}class Cs extends B{}class ws extends Cs{}class Ts extends Cs{async _call(e){return new Ld(await super._call(e))}}class Es extends B{}class Ds extends Es{}class Os extends B{}class ks extends Os{}class As extends B{}class js extends As{}class Ms extends B{}class Ns extends Ms{}class Ps extends Ms{async _call(e){return new Fs(await super._call(e))}}class Fs extends ce{constructor({logits:e,pred_boxes:t}){super(),this.logits=e,this.pred_boxes=t}}class Is extends B{}class Ls extends Is{async get_image_embeddings({pixel_values:e}){return await N(this,{pixel_values:e})}async forward(e){e=!e.image_embeddings||!e.image_positional_embeddings?{...e,...await this.get_image_embeddings(e)}:{...e},e.input_labels??=(0,f.ones)(e.input_points.dims.slice(0,-1));let t={image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings};return e.input_points&&(t.input_points=e.input_points),e.input_labels&&(t.input_labels=e.input_labels),e.input_boxes&&(t.input_boxes=e.input_boxes),await O(this.sessions.prompt_encoder_mask_decoder,t)}async _call(e){return new Rs(await super._call(e))}}class Rs extends ce{constructor({iou_scores:e,pred_masks:t}){super(),this.iou_scores=e,this.pred_masks=t}}class zs extends ce{constructor({iou_scores:e,pred_masks:t,object_score_logits:n}){super(),this.iou_scores=e,this.pred_masks=t,this.object_score_logits=n}}class Bs extends B{}class Vs extends Bs{async get_image_embeddings({pixel_values:e}){return await N(this,{pixel_values:e})}async forward(e){let{num_feature_levels:t}=this.config.vision_config;if(e=Array.from({length:t},(e,t)=>`image_embeddings.${t}`).some(t=>!e[t])?{...e,...await this.get_image_embeddings(e)}:{...e},e.input_points){if(e.input_boxes&&e.input_boxes.dims[1]!==1)throw Error("When both `input_points` and `input_boxes` are provided, the number of boxes per image must be 1.");let t=e.input_points.dims;e.input_labels??=(0,f.ones)(t.slice(0,-1)),e.input_boxes??=(0,f.full)([t[0],0,4],0)}else if(e.input_boxes){let t=e.input_boxes.dims;e.input_labels=(0,f.full)([t[0],t[1],0],-1n),e.input_points=(0,f.full)([t[0],1,0,2],0)}else throw Error("At least one of `input_points` or `input_boxes` must be provided.");let n=this.sessions.prompt_encoder_mask_decoder;return await O(n,(0,s.pick)(e,n.inputNames))}async _call(e){return new zs(await super._call(e))}}class Hs extends Vs{}class Us extends Vs{}class Ws extends B{}class Gs extends Ws{}class Ks extends Ws{}class qs extends B{}class Js extends qs{}class Ys extends qs{}class Xs extends B{}class Zs extends Xs{}class Qs extends Xs{async _call(e){return new Hd(await super._call(e))}}class $s extends Xs{async _call(e){return new Ld(await super._call(e))}}class ec extends Xs{async _call(e){return new zd(await super._call(e))}}class tc extends B{}class nc extends tc{async _call(e){return new Hd(await super._call(e))}}class rc extends B{}class ic extends rc{}class ac extends rc{async _call(e){return new zd(await super._call(e))}}class oc extends B{}class sc extends oc{}class cc extends B{}class lc extends cc{}class uc extends cc{async _call(e){return new Hd(await super._call(e))}}class dc extends cc{async _call(e){return new Ld(await super._call(e))}}class fc extends B{}class pc extends fc{}class mc extends fc{async _call(e){return new Hd(await super._call(e))}}class hc extends fc{async _call(e){return new Ld(await super._call(e))}}class gc extends fc{async _call(e){return new zd(await super._call(e))}}class _c extends B{}class vc extends _c{}class yc extends _c{async _call(e){return new Hd(await super._call(e))}}class bc extends _c{async _call(e){return new Ld(await super._call(e))}}class xc extends B{}class Sc extends Xs{}class Cc extends Xs{async _call(e){return new Hd(await super._call(e))}}class wc extends Xs{async _call(e){return new Ld(await super._call(e))}}class Tc extends B{}class Ec extends Tc{}class Dc extends Tc{async _call(e){return new Hd(await super._call(e))}}class Oc extends Tc{async _call(e){return new Ld(await super._call(e))}}class kc extends Tc{async _call(e){return new Rd(await super._call(e))}}class Ac extends Tc{async _call(e){return new zd(await super._call(e))}}class jc extends B{}class Mc extends jc{}class Nc extends B{}class Pc extends Nc{}class Fc extends Nc{}class Ic extends Nc{async generate_speech(e,t,{threshold:n=.5,minlenratio:r=0,maxlenratio:i=20,vocoder:a=null}={}){let o={input_ids:e},{encoder_outputs:s,encoder_attention_mask:c}=await N(this,o),l=s.dims[1]/this.config.reduction_factor,u=Math.floor(l*i),d=Math.floor(l*r),p=this.config.num_mel_bins,m=[],h=null,g=null,_=0;for(;;){++_;let e=j(!!g),r;r=g?g.output_sequence_out:new f.Tensor(`float32`,new Float32Array(p),[1,1,p]);let i={use_cache_branch:e,output_sequence:r,encoder_attention_mask:c,speaker_embeddings:t,encoder_hidden_states:s};this.addPastKeyValues(i,h),g=await O(this.sessions.decoder_model_merged,i),h=this.getPastKeyValues(g,h);let{prob:a,spectrum:o}=g;if(m.push(o),_>=d&&(Array.from(a.data).filter(e=>e>=n).length>0||_>=u))break}let v=(0,f.cat)(m),{waveform:y}=await O(a.sessions.model,{spectrogram:v});return{spectrogram:v,waveform:y}}}class Lc extends B{main_input_name=`spectrogram`}class Rc extends B{}class zc extends Rc{async generate_speech({input_ids:e,attention_mask:t,style:n,num_inference_steps:r=5,speed:i=1.05}){let{sampling_rate:a,chunk_compress_factor:o,base_chunk_size:s,latent_dim:c}=this.config,{last_hidden_state:l,durations:u}=await O(this.sessions.text_encoder,{input_ids:e,attention_mask:t,style:n});u.div_(i);let d=u.max().item()*a,p=s*o,m=Math.floor((d+p-1)/p),h=e.dims[0],g=(0,f.ones)([h,m]),_=(0,f.full)([h],r),v=(0,f.randn)([h,c*o,m]);for(let e=0;e0&&o<=i&&(e.data[a++]=e.data[t])}let o=Math.floor(t/r),s=a/(o*r);return new f.Tensor(e.type,e.data.slice(0,a),[o,r,s])}prepare_inputs_for_generation(e,t,n){let r=structuredClone(e);for(let e=0;e=t&&(r[e][t]=BigInt(this.config.decoder.pad_token_id));return n.guidance_scale!==null&&n.guidance_scale>1&&(r=r.concat(r)),super.prepare_inputs_for_generation(r,t,n)}async generate(e){let t=await super.generate(e),n=this._apply_and_filter_by_delay_pattern_mask(t).unsqueeze_(0),{audio_values:r}=await O(this.sessions.encodec_decode,{audio_codes:n});return r}}class Tl extends B{}class El extends Tl{}class Dl extends Tl{async _call(e){return new Ld(await super._call(e))}}class Ol extends Tl{}class kl extends B{}class Al extends kl{}class jl extends kl{async _call(e){return new Ld(await super._call(e))}}class Ml extends kl{}class Nl extends B{}class Pl extends Nl{}class Fl extends Nl{async _call(e){return new Ld(await super._call(e))}}class Il extends Nl{}class Ll extends B{}class Rl extends Ll{}class zl extends Ll{async _call(e){return new Ld(await super._call(e))}}class Bl extends Ll{}class Vl extends B{}class Hl extends Vl{}class Ul extends B{}class Wl extends Ul{forward_params=[`input_ids`,`pixel_values`,`images_seq_mask`,`images_emb_mask`,`attention_mask`,`position_ids`,`past_key_values`];constructor(...e){super(...e),this._generation_mode=`text`}async forward(e){let t=this._generation_mode??`text`,n;if(t===`text`||!e.past_key_values){let t=this.sessions.prepare_inputs_embeds;n=await O(t,(0,s.pick)(e,t.inputNames))}else{let t=this.sessions.gen_img_embeds;n=await O(t,(0,s.pick)({image_ids:e.input_ids},t.inputNames))}let r={...e,...n},i=await F(this,r),a=this.sessions[t===`text`?`lm_head`:`gen_head`];if(!a)throw Error(`Unable to find "${a}" generation head`);let o=await O(a,(0,s.pick)(i,a.inputNames));return{...n,...i,...o}}async generate(e){return this._generation_mode=`text`,super.generate(e)}async generate_images(e){this._generation_mode=`image`;let t=(e.inputs??e[this.main_input_name]).dims[1],n=(await super.generate(e)).slice(null,[t,null]),r=this.sessions.image_decode,{decoded_image:i}=await O(r,{generated_tokens:n}),a=i.add_(1).mul_(255/2).clamp_(0,255).to(`uint8`),o=[];for(let e of a){let t=p.RawImage.fromTensor(e);o.push(t)}return o}}class Gl extends ce{constructor({char_logits:e,bpe_logits:t,wp_logits:n}){super(),this.char_logits=e,this.bpe_logits=t,this.wp_logits=n}get logits(){return[this.char_logits,this.bpe_logits,this.wp_logits]}}class Kl extends B{}class ql extends Kl{async _call(e){return new Gl(await super._call(e))}}class Jl extends B{}class Yl extends Jl{}class Xl extends Jl{}class Zl extends B{}class Ql extends Zl{}class $l extends Zl{}class eu extends B{forward_params=[`input_ids`,`attention_mask`,`position_ids`,`audio_values`,`past_key_values`]}class tu extends eu{_merge_input_ids_with_audio_features(e){let t=e.audio_features.dims.at(-1),n=e.audio_features.view(-1,t);return ee({audio_token_id:this.config.ignore_index??this.config.audio_token_id,...e,audio_features:n})}}class nu extends tu{}class ru extends B{main_input_name=`input_values`;forward_params=[`input_values`]}class iu extends ce{constructor({audio_codes:e}){super(),this.audio_codes=e}}class au extends ce{constructor({audio_values:e}){super(),this.audio_values=e}}class ou extends ru{async encode(e){return new iu(await O(this.sessions.encoder_model,e))}async decode(e){return new au(await O(this.sessions.decoder_model,e))}}class su extends ru{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class cu extends ru{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class lu extends B{main_input_name=`input_values`;forward_params=[`input_values`]}class uu extends ce{constructor({audio_codes:e}){super(),this.audio_codes=e}}class du extends ce{constructor({audio_values:e}){super(),this.audio_values=e}}class fu extends lu{async encode(e){return new uu(await O(this.sessions.encoder_model,e))}async decode(e){return new du(await O(this.sessions.decoder_model,e))}}class pu extends lu{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class mu extends lu{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class hu extends B{main_input_name=`input_values`;forward_params=[`input_values`]}class gu extends hu{async encode(e){return await O(this.sessions.encoder_model,e)}async decode(e){return await O(this.sessions.decoder_model,e)}}class _u extends hu{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`encoder_model`})}}class vu extends hu{static async from_pretrained(e,t={}){return super.from_pretrained(e,{...t,model_file_name:t.model_file_name??`decoder_model`})}}class yu{static MODEL_CLASS_MAPPINGS=null;static BASE_IF_FAIL=!1;static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,model_file_name:s=null,subfolder:c=`onnx`,device:l=null,dtype:u=null,use_external_data_format:d=null,session_options:f={}}={}){let p={progress_callback:t,config:n,cache_dir:i,local_files_only:a,revision:o,model_file_name:s,subfolder:c,device:l,dtype:u,use_external_data_format:d,session_options:f};if(p.config=await r.AutoConfig.from_pretrained(e,p),!this.MODEL_CLASS_MAPPINGS)throw Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);let m=p.config.model_type;for(let t of this.MODEL_CLASS_MAPPINGS){let n=t.get(m);if(!n){for(let e of t.values())if(e[0]===m){n=e;break}if(!n)continue}return await n[1].from_pretrained(e,p)}if(this.BASE_IF_FAIL)return id.has(m)||console.warn(`Unknown model class "${m}", attempting to construct from base class.`),await B.from_pretrained(e,p);throw Error(`Unsupported model type: ${m}`)}}let bu=new Map([[`bert`,[`BertModel`,de]],[`neobert`,[`NeoBertModel`,ge]],[`modernbert`,[`ModernBertModel`,Se]],[`nomic_bert`,[`NomicBertModel`,Ae]],[`roformer`,[`RoFormerModel`,Me]],[`electra`,[`ElectraModel`,We]],[`esm`,[`EsmModel`,bt]],[`convbert`,[`ConvBertModel`,Re]],[`camembert`,[`CamembertModel`,Xe]],[`deberta`,[`DebertaModel`,nt]],[`deberta-v2`,[`DebertaV2Model`,ct]],[`mpnet`,[`MPNetModel`,At]],[`albert`,[`AlbertModel`,Vt]],[`distilbert`,[`DistilBertModel`,mt]],[`roberta`,[`RobertaModel`,_n]],[`xlm`,[`XLMModel`,Cn]],[`xlm-roberta`,[`XLMRobertaModel`,kn]],[`clap`,[`ClapModel`,sl]],[`clip`,[`CLIPModel`,sr]],[`clipseg`,[`CLIPSegModel`,Cr]],[`chinese_clip`,[`ChineseCLIPModel`,_r]],[`siglip`,[`SiglipModel`,pr]],[`jina_clip`,[`JinaCLIPModel`,yr]],[`mobilebert`,[`MobileBertModel`,Tt]],[`squeezebert`,[`SqueezeBertModel`,It]],[`wav2vec2`,[`Wav2Vec2Model`,Zs]],[`wav2vec2-bert`,[`Wav2Vec2BertModel`,vc]],[`unispeech`,[`UniSpeechModel`,lc]],[`unispeech-sat`,[`UniSpeechSatModel`,pc]],[`hubert`,[`HubertModel`,Sc]],[`wavlm`,[`WavLMModel`,Ec]],[`audio-spectrogram-transformer`,[`ASTModel`,Fn]],[`vits`,[`VitsModel`,dl]],[`pyannote`,[`PyAnnoteModel`,ic]],[`wespeaker-resnet`,[`WeSpeakerResNetModel`,sc]],[`detr`,[`DetrModel`,W]],[`rt_detr`,[`RTDetrModel`,uo]],[`rt_detr_v2`,[`RTDetrV2Model`,ho]],[`rf_detr`,[`RFDetrModel`,yo]],[`d_fine`,[`DFineModel`,Co]],[`table-transformer`,[`TableTransformerModel`,Eo]],[`vit`,[`ViTModel`,xa]],[`ijepa`,[`IJepaModel`,wa]],[`pvt`,[`PvtModel`,ka]],[`vit_msn`,[`ViTMSNModel`,Pa]],[`vit_mae`,[`ViTMAEModel`,Ma]],[`groupvit`,[`GroupViTModel`,La]],[`fastvit`,[`FastViTModel`,za]],[`mobilevit`,[`MobileViTModel`,Wa]],[`mobilevitv2`,[`MobileViTV2Model`,qa]],[`owlvit`,[`OwlViTModel`,Xa]],[`owlv2`,[`Owlv2Model`,$a]],[`beit`,[`BeitModel`,no]],[`deit`,[`DeiTModel`,Ao]],[`hiera`,[`HieraModel`,No]],[`convnext`,[`ConvNextModel`,hs]],[`convnextv2`,[`ConvNextV2Model`,vs]],[`dinov2`,[`Dinov2Model`,xs]],[`dinov2_with_registers`,[`Dinov2WithRegistersModel`,ws]],[`dinov3_vit`,[`DINOv3ViTModel`,Ds]],[`dinov3_convnext`,[`DINOv3ConvNextModel`,ks]],[`resnet`,[`ResNetModel`,Io]],[`swin`,[`SwinModel`,zo]],[`swin2sr`,[`Swin2SRModel`,Uo]],[`donut-swin`,[`DonutSwinModel`,ps]],[`yolos`,[`YolosModel`,Ns]],[`dpt`,[`DPTModel`,Ko]],[`glpn`,[`GLPNModel`,us]],[`hifigan`,[`SpeechT5HifiGan`,Lc]],[`efficientnet`,[`EfficientNetModel`,G]],[`decision_transformer`,[`DecisionTransformerModel`,Hl]],[`patchtst`,[`PatchTSTForPrediction`,Yl]],[`patchtsmixer`,[`PatchTSMixerForPrediction`,Ql]],[`mobilenet_v1`,[`MobileNetV1Model`,El]],[`mobilenet_v2`,[`MobileNetV2Model`,Al]],[`mobilenet_v3`,[`MobileNetV3Model`,Pl]],[`mobilenet_v4`,[`MobileNetV4Model`,Rl]],[`maskformer`,[`MaskFormerModel`,ss]],[`mgp-str`,[`MgpstrForSceneTextRecognition`,ql]],[`style_text_to_speech_2`,[`StyleTextToSpeech2Model`,Mc]]]),xu=new Map([[`t5`,[`T5Model`,Kt]],[`longt5`,[`LongT5Model`,Yt]],[`mt5`,[`MT5Model`,Qt]],[`bart`,[`BartModel`,tn]],[`mbart`,[`MBartModel`,on]],[`marian`,[`MarianModel`,Gs]],[`whisper`,[`WhisperModel`,H]],[`m2m_100`,[`M2M100Model`,Js]],[`blenderbot`,[`BlenderbotModel`,dn]],[`blenderbot-small`,[`BlenderbotSmallModel`,mn]]]),Su=new Map([[`mimi`,[`MimiModel`,ou]],[`dac`,[`DacModel`,fu]],[`snac`,[`SnacModel`,gu]]]),Cu=new Map([[`bloom`,[`BloomModel`,fa]],[`jais`,[`JAISModel`,kr]],[`gpt2`,[`GPT2Model`,Er]],[`gptj`,[`GPTJModel`,Rr]],[`gpt_bigcode`,[`GPTBigCodeModel`,Vr]],[`gpt_neo`,[`GPTNeoModel`,Mr]],[`gpt_neox`,[`GPTNeoXModel`,Fr]],[`codegen`,[`CodeGenModel`,Wr]],[`llama`,[`LlamaModel`,qr]],[`nanochat`,[`NanoChatModel`,Qr]],[`arcee`,[`ArceeModel`,ti]],[`lfm2`,[`Lfm2Model`,ii]],[`smollm3`,[`SmolLM3Model`,si]],[`exaone`,[`ExaoneModel`,gi]],[`olmo`,[`OlmoModel`,Si]],[`olmo2`,[`Olmo2Model`,Ti]],[`mobilellm`,[`MobileLLMModel`,yi]],[`granite`,[`GraniteModel`,Oi]],[`granitemoehybrid`,[`GraniteMoeHybridModel`,ji]],[`cohere`,[`CohereModel`,Pi]],[`gemma`,[`GemmaModel`,Li]],[`gemma2`,[`Gemma2Model`,Bi]],[`vaultgemma`,[`VaultGemmaModel`,Ui]],[`gemma3_text`,[`Gemma3Model`,Ki]],[`helium`,[`HeliumModel`,ui]],[`glm`,[`GlmModel`,pi]],[`openelm`,[`OpenELMModel`,Yi]],[`qwen2`,[`Qwen2Model`,Qi]],[`qwen3`,[`Qwen3Model`,ta]],[`phi`,[`PhiModel`,oa]],[`phi3`,[`Phi3Model`,la]],[`mpt`,[`MptModel`,ha]],[`opt`,[`OPTModel`,va]],[`mistral`,[`MistralModel`,Uc]],[`ministral`,[`MinistralModel`,Kc]],[`ministral3`,[`Ministral3Model`,Yc]],[`ernie4_5`,[`Ernie4_5Model`,Qc]],[`starcoder2`,[`Starcoder2Model`,tl]],[`falcon`,[`FalconModel`,il]],[`stablelm`,[`StableLmModel`,_l]],[`modernbert-decoder`,[`ModernBertDecoderModel`,De]]]),wu=new Map([[`speecht5`,[`SpeechT5ForSpeechToText`,Fc]],[`whisper`,[`WhisperForConditionalGeneration`,Rn]],[`lite-whisper`,[`LiteWhisperForConditionalGeneration`,zn]],[`moonshine`,[`MoonshineForConditionalGeneration`,Hn]]]),Tu=new Map([[`speecht5`,[`SpeechT5ForTextToSpeech`,Ic]]]),Eu=new Map([[`vits`,[`VitsModel`,dl]],[`musicgen`,[`MusicgenForConditionalGeneration`,wl]],[`supertonic`,[`SupertonicForConditionalGeneration`,zc]]]),Du=new Map([[`bert`,[`BertForSequenceClassification`,pe]],[`neobert`,[`NeoBertForSequenceClassification`,ve]],[`modernbert`,[`ModernBertForSequenceClassification`,we]],[`roformer`,[`RoFormerForSequenceClassification`,Pe]],[`electra`,[`ElectraForSequenceClassification`,Ke]],[`esm`,[`EsmForSequenceClassification`,St]],[`convbert`,[`ConvBertForSequenceClassification`,Be]],[`camembert`,[`CamembertForSequenceClassification`,Qe]],[`deberta`,[`DebertaForSequenceClassification`,it]],[`deberta-v2`,[`DebertaV2ForSequenceClassification`,ut]],[`mpnet`,[`MPNetForSequenceClassification`,Mt]],[`albert`,[`AlbertForSequenceClassification`,Ht]],[`distilbert`,[`DistilBertForSequenceClassification`,ht]],[`roberta`,[`RobertaForSequenceClassification`,yn]],[`xlm`,[`XLMForSequenceClassification`,Tn]],[`xlm-roberta`,[`XLMRobertaForSequenceClassification`,jn]],[`bart`,[`BartForSequenceClassification`,rn]],[`mbart`,[`MBartForSequenceClassification`,cn]],[`mobilebert`,[`MobileBertForSequenceClassification`,Dt]],[`squeezebert`,[`SqueezeBertForSequenceClassification`,Rt]]]),Ou=new Map([[`bert`,[`BertForTokenClassification`,me]],[`neobert`,[`NeoBertForTokenClassification`,ye]],[`modernbert`,[`ModernBertForTokenClassification`,Te]],[`roformer`,[`RoFormerForTokenClassification`,Fe]],[`electra`,[`ElectraForTokenClassification`,qe]],[`esm`,[`EsmForTokenClassification`,Ct]],[`convbert`,[`ConvBertForTokenClassification`,Ve]],[`camembert`,[`CamembertForTokenClassification`,$e]],[`deberta`,[`DebertaForTokenClassification`,at]],[`deberta-v2`,[`DebertaV2ForTokenClassification`,dt]],[`mpnet`,[`MPNetForTokenClassification`,Nt]],[`distilbert`,[`DistilBertForTokenClassification`,gt]],[`roberta`,[`RobertaForTokenClassification`,bn]],[`xlm`,[`XLMForTokenClassification`,En]],[`xlm-roberta`,[`XLMRobertaForTokenClassification`,Mn]]]),ku=new Map([[`t5`,[`T5ForConditionalGeneration`,qt]],[`longt5`,[`LongT5ForConditionalGeneration`,Xt]],[`mt5`,[`MT5ForConditionalGeneration`,$t]],[`bart`,[`BartForConditionalGeneration`,nn]],[`mbart`,[`MBartForConditionalGeneration`,sn]],[`marian`,[`MarianMTModel`,Ks]],[`m2m_100`,[`M2M100ForConditionalGeneration`,Ys]],[`blenderbot`,[`BlenderbotForConditionalGeneration`,fn]],[`blenderbot-small`,[`BlenderbotSmallForConditionalGeneration`,hn]]]),Au=new Map([[`bloom`,[`BloomForCausalLM`,pa]],[`gpt2`,[`GPT2LMHeadModel`,Dr]],[`jais`,[`JAISLMHeadModel`,Ar]],[`gptj`,[`GPTJForCausalLM`,zr]],[`gpt_bigcode`,[`GPTBigCodeForCausalLM`,Hr]],[`gpt_neo`,[`GPTNeoForCausalLM`,Nr]],[`gpt_neox`,[`GPTNeoXForCausalLM`,Ir]],[`codegen`,[`CodeGenForCausalLM`,Gr]],[`llama`,[`LlamaForCausalLM`,Jr]],[`nanochat`,[`NanoChatForCausalLM`,$r]],[`llama4_text`,[`Llama4ForCausalLM`,Xr]],[`arcee`,[`ArceeForCausalLM`,ni]],[`lfm2`,[`Lfm2ForCausalLM`,ai]],[`smollm3`,[`SmolLM3ForCausalLM`,ci]],[`exaone`,[`ExaoneForCausalLM`,_i]],[`olmo`,[`OlmoForCausalLM`,Ci]],[`olmo2`,[`Olmo2ForCausalLM`,Ei]],[`mobilellm`,[`MobileLLMForCausalLM`,bi]],[`granite`,[`GraniteForCausalLM`,ki]],[`granitemoehybrid`,[`GraniteMoeHybridForCausalLM`,Mi]],[`cohere`,[`CohereForCausalLM`,Fi]],[`gemma`,[`GemmaForCausalLM`,Ri]],[`gemma2`,[`Gemma2ForCausalLM`,Vi]],[`vaultgemma`,[`VaultGemmaForCausalLM`,Wi]],[`gemma3_text`,[`Gemma3ForCausalLM`,qi]],[`helium`,[`HeliumForCausalLM`,di]],[`glm`,[`GlmForCausalLM`,mi]],[`openelm`,[`OpenELMForCausalLM`,Xi]],[`qwen2`,[`Qwen2ForCausalLM`,$i]],[`qwen3`,[`Qwen3ForCausalLM`,na]],[`phi`,[`PhiForCausalLM`,sa]],[`phi3`,[`Phi3ForCausalLM`,ua]],[`mpt`,[`MptForCausalLM`,ga]],[`opt`,[`OPTForCausalLM`,ya]],[`mbart`,[`MBartForCausalLM`,ln]],[`mistral`,[`MistralForCausalLM`,Wc]],[`ministral`,[`MinistralForCausalLM`,qc]],[`ministral3`,[`Ministral3ForCausalLM`,Xc]],[`ernie4_5`,[`Ernie4_5ForCausalLM`,$c]],[`starcoder2`,[`Starcoder2ForCausalLM`,nl]],[`falcon`,[`FalconForCausalLM`,al]],[`trocr`,[`TrOCRForCausalLM`,Vc]],[`stablelm`,[`StableLmForCausalLM`,vl]],[`modernbert-decoder`,[`ModernBertDecoderForCausalLM`,Oe]],[`phi3_v`,[`Phi3VForCausalLM`,ar]]]),ju=new Map([[`multi_modality`,[`MultiModalityCausalLM`,Wl]]]),Mu=new Map([[`bert`,[`BertForMaskedLM`,fe]],[`neobert`,[`NeoBertForMaskedLM`,_e]],[`modernbert`,[`ModernBertForMaskedLM`,Ce]],[`roformer`,[`RoFormerForMaskedLM`,Ne]],[`electra`,[`ElectraForMaskedLM`,Ge]],[`esm`,[`EsmForMaskedLM`,xt]],[`convbert`,[`ConvBertForMaskedLM`,ze]],[`camembert`,[`CamembertForMaskedLM`,Ze]],[`deberta`,[`DebertaForMaskedLM`,rt]],[`deberta-v2`,[`DebertaV2ForMaskedLM`,lt]],[`mpnet`,[`MPNetForMaskedLM`,jt]],[`albert`,[`AlbertForMaskedLM`,Wt]],[`distilbert`,[`DistilBertForMaskedLM`,vt]],[`roberta`,[`RobertaForMaskedLM`,vn]],[`xlm`,[`XLMWithLMHeadModel`,wn]],[`xlm-roberta`,[`XLMRobertaForMaskedLM`,An]],[`mobilebert`,[`MobileBertForMaskedLM`,Et]],[`squeezebert`,[`SqueezeBertForMaskedLM`,Lt]]]),Nu=new Map([[`bert`,[`BertForQuestionAnswering`,V]],[`neobert`,[`NeoBertForQuestionAnswering`,be]],[`roformer`,[`RoFormerForQuestionAnswering`,Ie]],[`electra`,[`ElectraForQuestionAnswering`,Je]],[`convbert`,[`ConvBertForQuestionAnswering`,He]],[`camembert`,[`CamembertForQuestionAnswering`,et]],[`deberta`,[`DebertaForQuestionAnswering`,ot]],[`deberta-v2`,[`DebertaV2ForQuestionAnswering`,ft]],[`mpnet`,[`MPNetForQuestionAnswering`,Pt]],[`albert`,[`AlbertForQuestionAnswering`,Ut]],[`distilbert`,[`DistilBertForQuestionAnswering`,_t]],[`roberta`,[`RobertaForQuestionAnswering`,xn]],[`xlm`,[`XLMForQuestionAnswering`,Dn]],[`xlm-roberta`,[`XLMRobertaForQuestionAnswering`,Nn]],[`mobilebert`,[`MobileBertForQuestionAnswering`,Ot]],[`squeezebert`,[`SqueezeBertForQuestionAnswering`,zt]]]),Pu=new Map([[`vision-encoder-decoder`,[`VisionEncoderDecoderModel`,Un]],[`idefics3`,[`Idefics3ForConditionalGeneration`,nr]],[`smolvlm`,[`SmolVLMForConditionalGeneration`,rr]]]),Fu=new Map([[`llava`,[`LlavaForConditionalGeneration`,Gn]],[`llava_onevision`,[`LlavaOnevisionForConditionalGeneration`,Kn]],[`moondream1`,[`Moondream1ForConditionalGeneration`,qn]],[`florence2`,[`Florence2ForConditionalGeneration`,Yn]],[`qwen2-vl`,[`Qwen2VLForConditionalGeneration`,ia]],[`idefics3`,[`Idefics3ForConditionalGeneration`,nr]],[`smolvlm`,[`SmolVLMForConditionalGeneration`,rr]],[`paligemma`,[`PaliGemmaForConditionalGeneration`,Zn]],[`llava_qwen2`,[`LlavaQwen2ForCausalLM`,Qn]],[`gemma3n`,[`Gemma3nForConditionalGeneration`,U]],[`mistral3`,[`Mistral3ForConditionalGeneration`,$n]]]),Iu=new Map([[`ultravox`,[`UltravoxModel`,tu]],[`voxtral`,[`VoxtralForConditionalGeneration`,nu]]]),Lu=new Map([[`vision-encoder-decoder`,[`VisionEncoderDecoderModel`,Un]]]),Ru=new Map([[`vit`,[`ViTForImageClassification`,Sa]],[`ijepa`,[`IJepaForImageClassification`,Ta]],[`pvt`,[`PvtForImageClassification`,Aa]],[`vit_msn`,[`ViTMSNForImageClassification`,Fa]],[`fastvit`,[`FastViTForImageClassification`,Ba]],[`mobilevit`,[`MobileViTForImageClassification`,Ga]],[`mobilevitv2`,[`MobileViTV2ForImageClassification`,Ja]],[`beit`,[`BeitForImageClassification`,ro]],[`deit`,[`DeiTForImageClassification`,jo]],[`hiera`,[`HieraForImageClassification`,Po]],[`convnext`,[`ConvNextForImageClassification`,gs]],[`convnextv2`,[`ConvNextV2ForImageClassification`,ys]],[`dinov2`,[`Dinov2ForImageClassification`,Ss]],[`dinov2_with_registers`,[`Dinov2WithRegistersForImageClassification`,Ts]],[`resnet`,[`ResNetForImageClassification`,Lo]],[`swin`,[`SwinForImageClassification`,Bo]],[`segformer`,[`SegformerForImageClassification`,ml]],[`efficientnet`,[`EfficientNetForImageClassification`,bl]],[`mobilenet_v1`,[`MobileNetV1ForImageClassification`,Dl]],[`mobilenet_v2`,[`MobileNetV2ForImageClassification`,jl]],[`mobilenet_v3`,[`MobileNetV3ForImageClassification`,Fl]],[`mobilenet_v4`,[`MobileNetV4ForImageClassification`,zl]]]),zu=new Map([[`detr`,[`DetrForObjectDetection`,ao]],[`rt_detr`,[`RTDetrForObjectDetection`,fo]],[`rt_detr_v2`,[`RTDetrV2ForObjectDetection`,go]],[`rf_detr`,[`RFDetrForObjectDetection`,bo]],[`d_fine`,[`DFineForObjectDetection`,wo]],[`table-transformer`,[`TableTransformerForObjectDetection`,Do]],[`yolos`,[`YolosForObjectDetection`,Ps]]]),Bu=new Map([[`owlvit`,[`OwlViTForObjectDetection`,Za]],[`owlv2`,[`Owlv2ForObjectDetection`,eo]],[`grounding-dino`,[`GroundingDinoForObjectDetection`,js]]]),Vu=new Map([[`detr`,[`DetrForSegmentation`,oo]],[`clipseg`,[`CLIPSegForImageSegmentation`,wr]]]),Hu=new Map([[`segformer`,[`SegformerForSemanticSegmentation`,hl]],[`sapiens`,[`SapiensForSemanticSegmentation`,Zo]],[`swin`,[`SwinForSemanticSegmentation`,Vo]],[`mobilenet_v1`,[`MobileNetV1ForSemanticSegmentation`,Ol]],[`mobilenet_v2`,[`MobileNetV2ForSemanticSegmentation`,Ml]],[`mobilenet_v3`,[`MobileNetV3ForSemanticSegmentation`,Il]],[`mobilenet_v4`,[`MobileNetV4ForSemanticSegmentation`,Bl]]]),Uu=new Map([[`detr`,[`DetrForSegmentation`,oo]],[`maskformer`,[`MaskFormerForInstanceSegmentation`,cs]]]),Wu=new Map([[`sam`,[`SamModel`,Ls]],[`sam2`,[`Sam2Model`,Vs]],[`edgetam`,[`EdgeTamModel`,Hs]],[`sam3_tracker`,[`Sam3TrackerModel`,Us]]]),Gu=new Map([[`wav2vec2`,[`Wav2Vec2ForCTC`,Qs]],[`wav2vec2-bert`,[`Wav2Vec2BertForCTC`,yc]],[`unispeech`,[`UniSpeechForCTC`,uc]],[`unispeech-sat`,[`UniSpeechSatForCTC`,mc]],[`wavlm`,[`WavLMForCTC`,Dc]],[`hubert`,[`HubertForCTC`,Cc]],[`parakeet_ctc`,[`ParakeetForCTC`,nc]]]),Ku=new Map([[`wav2vec2`,[`Wav2Vec2ForSequenceClassification`,$s]],[`wav2vec2-bert`,[`Wav2Vec2BertForSequenceClassification`,bc]],[`unispeech`,[`UniSpeechForSequenceClassification`,dc]],[`unispeech-sat`,[`UniSpeechSatForSequenceClassification`,hc]],[`wavlm`,[`WavLMForSequenceClassification`,Oc]],[`hubert`,[`HubertForSequenceClassification`,wc]],[`audio-spectrogram-transformer`,[`ASTForAudioClassification`,In]]]),qu=new Map([[`wavlm`,[`WavLMForXVector`,kc]]]),Ju=new Map([[`unispeech-sat`,[`UniSpeechSatForAudioFrameClassification`,gc]],[`wavlm`,[`WavLMForAudioFrameClassification`,Ac]],[`wav2vec2`,[`Wav2Vec2ForAudioFrameClassification`,ec]],[`pyannote`,[`PyAnnoteForAudioFrameClassification`,ac]]]),Yu=new Map([[`vitmatte`,[`VitMatteForImageMatting`,Ha]]]),Xu=new Map([[`patchtst`,[`PatchTSTForPrediction`,Xl]],[`patchtsmixer`,[`PatchTSMixerForPrediction`,$l]]]),Zu=new Map([[`swin2sr`,[`Swin2SRForImageSuperResolution`,Wo]]]),Qu=new Map([[`dpt`,[`DPTForDepthEstimation`,qo]],[`depth_anything`,[`DepthAnythingForDepthEstimation`,Yo]],[`glpn`,[`GLPNForDepthEstimation`,ds]],[`sapiens`,[`SapiensForDepthEstimation`,Qo]],[`depth_pro`,[`DepthProForDepthEstimation`,ts]],[`metric3d`,[`Metric3DForDepthEstimation`,rs]],[`metric3dv2`,[`Metric3Dv2ForDepthEstimation`,as]]]),$u=new Map([[`sapiens`,[`SapiensForNormalEstimation`,$o]]]),ed=new Map([[`vitpose`,[`VitPoseForPoseEstimation`,Da]]]),td=new Map([[`clip`,[`CLIPVisionModelWithProjection`,dr]],[`siglip`,[`SiglipVisionModel`,hr]],[`jina_clip`,[`JinaCLIPVisionModel`,xr]]]),nd=[[bu,b.EncoderOnly],[xu,b.EncoderDecoder],[Cu,b.DecoderOnly],[Su,b.AutoEncoder],[Du,b.EncoderOnly],[Ou,b.EncoderOnly],[ku,b.Seq2Seq],[wu,b.Seq2Seq],[Au,b.DecoderOnly],[ju,b.MultiModality],[Mu,b.EncoderOnly],[Nu,b.EncoderOnly],[Pu,b.Vision2Seq],[Fu,b.ImageTextToText],[Iu,b.AudioTextToText],[Ru,b.EncoderOnly],[Vu,b.EncoderOnly],[Uu,b.EncoderOnly],[Hu,b.EncoderOnly],[Yu,b.EncoderOnly],[Xu,b.EncoderOnly],[Zu,b.EncoderOnly],[Qu,b.EncoderOnly],[$u,b.EncoderOnly],[ed,b.EncoderOnly],[zu,b.EncoderOnly],[Bu,b.EncoderOnly],[Wu,b.MaskGeneration],[Gu,b.EncoderOnly],[Ku,b.EncoderOnly],[Tu,b.Seq2Seq],[Eu,b.EncoderOnly],[qu,b.EncoderOnly],[Ju,b.EncoderOnly],[td,b.EncoderOnly]];for(let[e,t]of nd)for(let[n,r]of e.values())x.set(n,t),C.set(r,n),S.set(n,r);let rd=[[`MusicgenForConditionalGeneration`,wl,b.Musicgen],[`Phi3VForCausalLM`,ar,b.Phi3V],[`CLIPTextModelWithProjection`,lr,b.EncoderOnly],[`SiglipTextModel`,mr,b.EncoderOnly],[`JinaCLIPTextModel`,br,b.EncoderOnly],[`ClapTextModelWithProjection`,cl,b.EncoderOnly],[`ClapAudioModelWithProjection`,ll,b.EncoderOnly],[`DacEncoderModel`,pu,b.EncoderOnly],[`DacDecoderModel`,mu,b.EncoderOnly],[`MimiEncoderModel`,su,b.EncoderOnly],[`MimiDecoderModel`,cu,b.EncoderOnly],[`SnacEncoderModel`,_u,b.EncoderOnly],[`SnacDecoderModel`,vu,b.EncoderOnly],[`Gemma3nForConditionalGeneration`,U,b.ImageAudioTextToText],[`SupertonicForConditionalGeneration`,zc,b.Supertonic]];for(let[e,t,n]of rd)x.set(e,n),C.set(t,e),S.set(e,t);let id=new Map([[`modnet`,Vu],[`birefnet`,Vu],[`isnet`,Vu],[`ben`,Vu]]);for(let[e,t]of id.entries())t.set(e,[`PreTrainedModel`,B]),x.set(e,b.EncoderOnly),C.set(B,e),S.set(e,B);class ad extends yu{static MODEL_CLASS_MAPPINGS=nd.map(e=>e[0]);static BASE_IF_FAIL=!0}class od extends yu{static MODEL_CLASS_MAPPINGS=[Du]}class sd extends yu{static MODEL_CLASS_MAPPINGS=[Ou]}class cd extends yu{static MODEL_CLASS_MAPPINGS=[ku]}class ld extends yu{static MODEL_CLASS_MAPPINGS=[wu]}class ud extends yu{static MODEL_CLASS_MAPPINGS=[Tu]}class dd extends yu{static MODEL_CLASS_MAPPINGS=[Eu]}class fd extends yu{static MODEL_CLASS_MAPPINGS=[Au]}class pd extends yu{static MODEL_CLASS_MAPPINGS=[Mu]}class md extends yu{static MODEL_CLASS_MAPPINGS=[Nu]}class hd extends yu{static MODEL_CLASS_MAPPINGS=[Pu]}class gd extends yu{static MODEL_CLASS_MAPPINGS=[Ru]}class _d extends yu{static MODEL_CLASS_MAPPINGS=[Vu]}class vd extends yu{static MODEL_CLASS_MAPPINGS=[Hu]}class yd extends yu{static MODEL_CLASS_MAPPINGS=[Uu]}class bd extends yu{static MODEL_CLASS_MAPPINGS=[zu]}class xd extends yu{static MODEL_CLASS_MAPPINGS=[Bu]}class Sd extends yu{static MODEL_CLASS_MAPPINGS=[Wu]}class Cd extends yu{static MODEL_CLASS_MAPPINGS=[Gu]}class wd extends yu{static MODEL_CLASS_MAPPINGS=[Ku]}class Td extends yu{static MODEL_CLASS_MAPPINGS=[qu]}class Ed extends yu{static MODEL_CLASS_MAPPINGS=[Ju]}class Dd extends yu{static MODEL_CLASS_MAPPINGS=[Lu]}class Od extends yu{static MODEL_CLASS_MAPPINGS=[Yu]}class kd extends yu{static MODEL_CLASS_MAPPINGS=[Zu]}class Ad extends yu{static MODEL_CLASS_MAPPINGS=[Qu]}class jd extends yu{static MODEL_CLASS_MAPPINGS=[$u]}class Md extends yu{static MODEL_CLASS_MAPPINGS=[ed]}class Nd extends yu{static MODEL_CLASS_MAPPINGS=[td]}class Pd extends yu{static MODEL_CLASS_MAPPINGS=[Fu]}class Fd extends yu{static MODEL_CLASS_MAPPINGS=[Iu]}class Id extends ce{constructor({logits:e,past_key_values:t,encoder_outputs:n,decoder_attentions:r=null,cross_attentions:i=null}){super(),this.logits=e,this.past_key_values=t,this.encoder_outputs=n,this.decoder_attentions=r,this.cross_attentions=i}}class Ld extends ce{constructor({logits:e,...t}){super(),this.logits=e;let n=Object.values(t);n.length>0&&(this.attentions=n)}}class Rd extends ce{constructor({logits:e,embeddings:t}){super(),this.logits=e,this.embeddings=t}}class zd extends ce{constructor({logits:e}){super(),this.logits=e}}class Bd extends ce{constructor({logits:e}){super(),this.logits=e}}class Vd extends ce{constructor({start_logits:e,end_logits:t}){super(),this.start_logits=e,this.end_logits=t}}class Hd extends ce{constructor({logits:e}){super(),this.logits=e}}class Ud extends ce{constructor({logits:e,past_key_values:t}){super(),this.logits=e,this.past_key_values=t}}class Wd extends ce{constructor({alphas:e}){super(),this.alphas=e}}class Gd extends ce{constructor({waveform:e,spectrogram:t}){super(),this.waveform=e,this.spectrogram=t}}}),"./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js":((e,t,n)=>{ +/*!******************************************************************************************************!*\ +!*** ./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js ***! +\******************************************************************************************************/ +n.r(t),n.d(t,{ASTFeatureExtractor:()=>a});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`);n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);var i=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`);class a extends r.FeatureExtractor{constructor(e){super(e);let t=this.config.sampling_rate,n=(0,i.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0);this.mel_filters=n,this.window=(0,i.window_function)(400,`hann`,{periodic:!1}),this.mean=this.config.mean,this.std=this.config.std}async _extract_fbank_features(e,t){return(0,i.spectrogram)(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,max_num_frames:t,transpose:!0})}async _call(e){(0,r.validate_audio_inputs)(e,`ASTFeatureExtractor`);let t=await this._extract_fbank_features(e,this.config.max_length);if(this.config.do_normalize){let e=this.std*2,n=t.data;for(let t=0;t{ +/*!****************************************************!*\ +!*** ./src/models/auto/feature_extraction_auto.js ***! +\****************************************************/ +n.r(t),n.d(t,{AutoFeatureExtractor:()=>o});var r=n( +/*! ../../utils/constants.js */ +`./src/utils/constants.js`),i=n( +/*! ../../utils/hub.js */ +`./src/utils/hub.js`);n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`);var a=n( +/*! ../feature_extractors.js */ +`./src/models/feature_extractors.js`);class o{static async from_pretrained(e,t={}){let n=await(0,i.getModelJSON)(e,r.FEATURE_EXTRACTOR_NAME,!0,t),o=n.feature_extractor_type,s=a[o];if(!s)throw Error(`Unknown feature_extractor_type: '${o}'. Please report this at ${r.GITHUB_ISSUE_URL}.`);return new s(n)}}}),"./src/models/auto/image_processing_auto.js":((e,t,n)=>{ +/*!**************************************************!*\ +!*** ./src/models/auto/image_processing_auto.js ***! +\**************************************************/ +n.r(t),n.d(t,{AutoImageProcessor:()=>s});var r=n( +/*! ../../utils/constants.js */ +`./src/utils/constants.js`),i=n( +/*! ../../utils/hub.js */ +`./src/utils/hub.js`),a=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),o=n( +/*! ../image_processors.js */ +`./src/models/image_processors.js`);class s{static async from_pretrained(e,t={}){let n=await(0,i.getModelJSON)(e,r.IMAGE_PROCESSOR_NAME,!0,t),s=n.image_processor_type??n.feature_extractor_type,c=o[s?.replace(/Fast$/,``)];return c||=(s!==void 0&&console.warn(`Image processor type '${s}' not found, assuming base ImageProcessor. Please report this at ${r.GITHUB_ISSUE_URL}.`),a.ImageProcessor),new c(n)}}}),"./src/models/auto/processing_auto.js":((e,t,n)=>{ +/*!********************************************!*\ +!*** ./src/models/auto/processing_auto.js ***! +\********************************************/ +n.r(t),n.d(t,{AutoProcessor:()=>l});var r=n( +/*! ../../utils/constants.js */ +`./src/utils/constants.js`),i=n( +/*! ../../utils/hub.js */ +`./src/utils/hub.js`),a=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),o=n( +/*! ../processors.js */ +`./src/models/processors.js`),s=n( +/*! ../image_processors.js */ +`./src/models/image_processors.js`),c=n( +/*! ../feature_extractors.js */ +`./src/models/feature_extractors.js`);class l{static async from_pretrained(e,t={}){let n=await(0,i.getModelJSON)(e,r.IMAGE_PROCESSOR_NAME,!0,t),{image_processor_type:l,feature_extractor_type:u,processor_class:d}=n;if(d&&o[d])return o[d].from_pretrained(e,t);if(!l&&!u)throw Error("No `image_processor_type` or `feature_extractor_type` found in the config.");let f={};if(l){let e=s[l.replace(/Fast$/,``)];if(!e)throw Error(`Unknown image_processor_type: '${l}'.`);f.image_processor=new e(n)}if(u){let e=s[u];if(e)f.image_processor=new e(n);else{let e=c[u];if(!e)throw Error(`Unknown feature_extractor_type: '${u}'.`);f.feature_extractor=new e(n)}}return new a.Processor({},f,null)}}}),"./src/models/beit/image_processing_beit.js":((e,t,n)=>{ +/*!**************************************************!*\ +!*** ./src/models/beit/image_processing_beit.js ***! +\**************************************************/ +n.r(t),n.d(t,{BeitFeatureExtractor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}}),"./src/models/bit/image_processing_bit.js":((e,t,n)=>{ +/*!************************************************!*\ +!*** ./src/models/bit/image_processing_bit.js ***! +\************************************************/ +n.r(t),n.d(t,{BitImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}}),"./src/models/chinese_clip/image_processing_chinese_clip.js":((e,t,n)=>{ +/*!******************************************************************!*\ +!*** ./src/models/chinese_clip/image_processing_chinese_clip.js ***! +\******************************************************************/ +n.r(t),n.d(t,{ChineseCLIPFeatureExtractor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}}),"./src/models/clap/feature_extraction_clap.js":((e,t,n)=>{ +/*!****************************************************!*\ +!*** ./src/models/clap/feature_extraction_clap.js ***! +\****************************************************/ +n.r(t),n.d(t,{ClapFeatureExtractor:()=>a});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`);n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);var i=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`);class a extends r.FeatureExtractor{constructor(e){super(e),this.mel_filters=(0,i.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,null,`htk`),this.mel_filters_slaney=(0,i.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,`slaney`,`slaney`),this.window=(0,i.window_function)(this.config.fft_window_size,`hann`)}async _get_input_mel(e,t,n,r){let i,a=e.length-t;if(a>0)if(n===`rand_trunc`){let n=Math.floor(Math.random()*(a+1));e=e.subarray(n,n+t),i=await this._extract_fbank_features(e,this.mel_filters_slaney,this.config.nb_max_samples)}else throw Error(`Truncation strategy "${n}" not implemented`);else{if(a<0){let n=new Float64Array(t);if(n.set(e),r===`repeat`)for(let r=e.length;r{ +/*!**************************************************!*\ +!*** ./src/models/clip/image_processing_clip.js ***! +\**************************************************/ +n.r(t),n.d(t,{CLIPFeatureExtractor:()=>a,CLIPImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}}),"./src/models/convnext/image_processing_convnext.js":((e,t,n)=>{ +/*!**********************************************************!*\ +!*** ./src/models/convnext/image_processing_convnext.js ***! +\**********************************************************/ +n.r(t),n.d(t,{ConvNextFeatureExtractor:()=>a,ConvNextImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{constructor(e){super(e),this.crop_pct=this.config.crop_pct??224/256}async resize(e){let t=this.size?.shortest_edge;if(t===void 0)throw Error(`Size dictionary must contain 'shortest_edge' key.`);if(t<384){let n=Math.floor(t/this.crop_pct),[r,i]=this.get_resize_output_image_size(e,{shortest_edge:n});e=await e.resize(r,i,{resample:this.resample}),e=await e.center_crop(t,t)}else e=await e.resize(t,t,{resample:this.resample});return e}}class a extends i{}}),"./src/models/dac/feature_extraction_dac.js":((e,t,n)=>{ +/*!**************************************************!*\ +!*** ./src/models/dac/feature_extraction_dac.js ***! +\**************************************************/ +n.r(t),n.d(t,{DacFeatureExtractor:()=>i});var r=n( +/*! ../encodec/feature_extraction_encodec.js */ +`./src/models/encodec/feature_extraction_encodec.js`);class i extends r.EncodecFeatureExtractor{}}),"./src/models/deit/image_processing_deit.js":((e,t,n)=>{ +/*!**************************************************!*\ +!*** ./src/models/deit/image_processing_deit.js ***! +\**************************************************/ +n.r(t),n.d(t,{DeiTFeatureExtractor:()=>a,DeiTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}}),"./src/models/detr/image_processing_detr.js":((e,t,n)=>{ +/*!**************************************************!*\ +!*** ./src/models/detr/image_processing_detr.js ***! +\**************************************************/ +n.r(t),n.d(t,{DetrFeatureExtractor:()=>o,DetrImageProcessor:()=>a});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.ImageProcessor{async _call(e){let t=await super._call(e),n=[t.pixel_values.dims[0],64,64],r=(0,i.full)(n,1n);return{...t,pixel_mask:r}}post_process_object_detection(...e){return(0,r.post_process_object_detection)(...e)}post_process_panoptic_segmentation(...e){return(0,r.post_process_panoptic_segmentation)(...e)}post_process_instance_segmentation(...e){return(0,r.post_process_instance_segmentation)(...e)}}class o extends a{}}),"./src/models/dinov3_vit/image_processing_dinov3_vit.js":((e,t,n)=>{ +/*!**************************************************************!*\ +!*** ./src/models/dinov3_vit/image_processing_dinov3_vit.js ***! +\**************************************************************/ +n.r(t),n.d(t,{DINOv3ViTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}}),"./src/models/donut/image_processing_donut.js":((e,t,n)=>{ +/*!****************************************************!*\ +!*** ./src/models/donut/image_processing_donut.js ***! +\****************************************************/ +n.r(t),n.d(t,{DonutFeatureExtractor:()=>a,DonutImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{pad_image(e,t,n,r={}){let[i,a,o]=t,s=this.image_mean;Array.isArray(this.image_mean)||(s=Array(o).fill(s));let c=this.image_std;Array.isArray(c)||(c=Array(o).fill(s));let l=s.map((e,t)=>-e/c[t]);return super.pad_image(e,t,n,{center:!0,constant_values:l,...r})}}class a extends i{}}),"./src/models/dpt/image_processing_dpt.js":((e,t,n)=>{ +/*!************************************************!*\ +!*** ./src/models/dpt/image_processing_dpt.js ***! +\************************************************/ +n.r(t),n.d(t,{DPTFeatureExtractor:()=>a,DPTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}}),"./src/models/efficientnet/image_processing_efficientnet.js":((e,t,n)=>{ +/*!******************************************************************!*\ +!*** ./src/models/efficientnet/image_processing_efficientnet.js ***! +\******************************************************************/ +n.r(t),n.d(t,{EfficientNetImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{constructor(e){super(e),this.include_top=this.config.include_top??!0,this.include_top&&(this.image_std=this.image_std.map(e=>e*e))}}}),"./src/models/encodec/feature_extraction_encodec.js":((e,t,n)=>{ +/*!**********************************************************!*\ +!*** ./src/models/encodec/feature_extraction_encodec.js ***! +\**********************************************************/ +n.r(t),n.d(t,{EncodecFeatureExtractor:()=>a});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.FeatureExtractor{async _call(e){(0,r.validate_audio_inputs)(e,`EncodecFeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=this.config.feature_size;if(e.length%t!==0)throw Error(`The length of the audio data must be a multiple of the number of channels (${t}).`);let n=[1,t,e.length/t];return{input_values:new i.Tensor(`float32`,e,n)}}}}),"./src/models/feature_extractors.js":((e,t,n)=>{ +/*!******************************************!*\ +!*** ./src/models/feature_extractors.js ***! +\******************************************/ +n.r(t),n.d(t,{ASTFeatureExtractor:()=>r.ASTFeatureExtractor,ClapFeatureExtractor:()=>a.ClapFeatureExtractor,DacFeatureExtractor:()=>o.DacFeatureExtractor,EncodecFeatureExtractor:()=>i.EncodecFeatureExtractor,Gemma3nAudioFeatureExtractor:()=>s.Gemma3nAudioFeatureExtractor,ImageFeatureExtractor:()=>_.ImageProcessor,MoonshineFeatureExtractor:()=>c.MoonshineFeatureExtractor,ParakeetFeatureExtractor:()=>l.ParakeetFeatureExtractor,PyAnnoteFeatureExtractor:()=>u.PyAnnoteFeatureExtractor,SeamlessM4TFeatureExtractor:()=>d.SeamlessM4TFeatureExtractor,SnacFeatureExtractor:()=>f.SnacFeatureExtractor,SpeechT5FeatureExtractor:()=>p.SpeechT5FeatureExtractor,Wav2Vec2FeatureExtractor:()=>m.Wav2Vec2FeatureExtractor,WeSpeakerFeatureExtractor:()=>h.WeSpeakerFeatureExtractor,WhisperFeatureExtractor:()=>g.WhisperFeatureExtractor});var r=n( +/*! ./audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js */ +`./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js`),i=n( +/*! ./encodec/feature_extraction_encodec.js */ +`./src/models/encodec/feature_extraction_encodec.js`),a=n( +/*! ./clap/feature_extraction_clap.js */ +`./src/models/clap/feature_extraction_clap.js`),o=n( +/*! ./dac/feature_extraction_dac.js */ +`./src/models/dac/feature_extraction_dac.js`),s=n( +/*! ./gemma3n/feature_extraction_gemma3n.js */ +`./src/models/gemma3n/feature_extraction_gemma3n.js`),c=n( +/*! ./moonshine/feature_extraction_moonshine.js */ +`./src/models/moonshine/feature_extraction_moonshine.js`),l=n( +/*! ./parakeet/feature_extraction_parakeet.js */ +`./src/models/parakeet/feature_extraction_parakeet.js`),u=n( +/*! ./pyannote/feature_extraction_pyannote.js */ +`./src/models/pyannote/feature_extraction_pyannote.js`),d=n( +/*! ./seamless_m4t/feature_extraction_seamless_m4t.js */ +`./src/models/seamless_m4t/feature_extraction_seamless_m4t.js`),f=n( +/*! ./snac/feature_extraction_snac.js */ +`./src/models/snac/feature_extraction_snac.js`),p=n( +/*! ./speecht5/feature_extraction_speecht5.js */ +`./src/models/speecht5/feature_extraction_speecht5.js`),m=n( +/*! ./wav2vec2/feature_extraction_wav2vec2.js */ +`./src/models/wav2vec2/feature_extraction_wav2vec2.js`),h=n( +/*! ./wespeaker/feature_extraction_wespeaker.js */ +`./src/models/wespeaker/feature_extraction_wespeaker.js`),g=n( +/*! ./whisper/feature_extraction_whisper.js */ +`./src/models/whisper/feature_extraction_whisper.js`),_=n( +/*! ../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`)}),"./src/models/florence2/processing_florence2.js":((e,t,n)=>{ +/*!******************************************************!*\ +!*** ./src/models/florence2/processing_florence2.js ***! +\******************************************************/ +n.r(t),n.d(t,{Florence2Processor:()=>o});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),a=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);class o extends r.Processor{static tokenizer_class=a.AutoTokenizer;static image_processor_class=i.AutoImageProcessor;constructor(e,t,n){super(e,t,n);let{tasks_answer_post_processing_type:r,task_prompts_without_inputs:i,task_prompts_with_input:a}=this.image_processor.config;this.tasks_answer_post_processing_type=new Map(Object.entries(r??{})),this.task_prompts_without_inputs=new Map(Object.entries(i??{})),this.task_prompts_with_input=new Map(Object.entries(a??{})),this.regexes={quad_boxes:/(.+?)/gm,bboxes:/([^<]+)?/gm},this.size_per_bin=1e3}construct_prompts(e){typeof e==`string`&&(e=[e]);let t=[];for(let n of e)if(this.task_prompts_without_inputs.has(n))t.push(this.task_prompts_without_inputs.get(n));else{for(let[e,r]of this.task_prompts_with_input)if(n.includes(e)){t.push(r.replaceAll(`{input}`,n).replaceAll(e,``));break}t.length!==e.length&&t.push(n)}return t}post_process_generation(e,t,n){let r=this.tasks_answer_post_processing_type.get(t)??`pure_text`;e=e.replaceAll(``,``).replaceAll(``,``);let i;switch(r){case`pure_text`:i=e;break;case`description_with_bboxes`:case`bboxes`:case`phrase_grounding`:case`ocr`:let a=r===`ocr`?`quad_boxes`:`bboxes`,o=e.matchAll(this.regexes[a]),s=[],c=[];for(let[e,t,...r]of o)s.push(t?t.trim():s.at(-1)??``),c.push(r.map((e,t)=>(Number(e)+.5)/this.size_per_bin*n[t%2]));i={labels:s,[a]:c};break;default:throw Error(`Task "${t}" (of type "${r}") not yet implemented.`)}return{[t]:i}}async _call(e,t=null,n={}){if(!e&&!t)throw Error(`Either text or images must be provided`);let r=await this.image_processor(e,n),i=t?this.tokenizer(this.construct_prompts(t),n):{};return{...r,...i}}}}),"./src/models/gemma3n/feature_extraction_gemma3n.js":((e,t,n)=>{ +/*!**********************************************************!*\ +!*** ./src/models/gemma3n/feature_extraction_gemma3n.js ***! +\**********************************************************/ +n.r(t),n.d(t,{Gemma3nAudioFeatureExtractor:()=>o});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`);class o extends r.FeatureExtractor{constructor(e){super(e);let{fft_length:t,feature_size:n,min_frequency:r,max_frequency:i,sampling_rate:o,frame_length:s}=this.config,c=(0,a.mel_filter_bank)(Math.floor(1+t/2),n,r,i,o,null,`htk`,!1);this.mel_filters=c,this.window=(0,a.window_function)(s,`hann`)}async _extract_fbank_features(e,t){return(0,a.spectrogram)(e,this.window,this.config.frame_length,this.config.hop_length,{fft_length:this.config.fft_length,center:!1,onesided:!0,preemphasis:this.config.preemphasis,preemphasis_htk_flavor:this.config.preemphasis_htk_flavor,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:this.config.mel_floor,remove_dc_offset:!1,transpose:!0})}async _call(e,{max_length:t=48e4,truncation:n=!0,padding:a=!0,pad_to_multiple_of:o=128}={}){if((0,r.validate_audio_inputs)(e,`Gemma3nAudioFeatureExtractor`),n&&e.length>t&&(e=e.slice(0,t)),a&&e.length%o!==0){let t=o-e.length%o,n=new Float64Array(e.length+t);n.set(e),this.config.padding_value!==0&&n.fill(this.config.padding_value,e.length),e=n}let s=await this._extract_fbank_features(e,this.config.max_length),c=(0,i.full)([1,s.dims[0]],!0);return{input_features:s.unsqueeze_(0),input_features_mask:c}}}}),"./src/models/gemma3n/processing_gemma3n.js":((e,t,n)=>{ +/*!**************************************************!*\ +!*** ./src/models/gemma3n/processing_gemma3n.js ***! +\**************************************************/ +n.r(t),n.d(t,{Gemma3nProcessor:()=>s});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),a=n( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),o=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`) +/*! ../../utils/image.js */ +;n(`./src/utils/image.js`),n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`);class s extends r.Processor{static image_processor_class=i.AutoImageProcessor;static feature_extractor_class=a.AutoFeatureExtractor;static tokenizer_class=o.AutoTokenizer;static uses_processor_config=!0;static uses_chat_template_file=!0;constructor(e,t,n){super(e,t,n),this.audio_seq_length=this.config.audio_seq_length,this.image_seq_length=this.config.image_seq_length;let{audio_token_id:r,boa_token:i,audio_token:a,eoa_token:o,image_token_id:s,boi_token:c,image_token:l,eoi_token:u}=this.tokenizer.config;this.audio_token_id=r,this.boa_token=i,this.audio_token=a;let d=a.repeat(this.audio_seq_length);this.full_audio_sequence=`\n\n${i}${d}${o}\n\n`,this.image_token_id=s,this.boi_token=c,this.image_token=l;let f=l.repeat(this.image_seq_length);this.full_image_sequence=`\n\n${c}${f}${u}\n\n`}async _call(e,t=null,n=null,r={}){typeof e==`string`&&(e=[e]);let i;n&&(i=await this.feature_extractor(n,r),e=e.map(e=>e.replaceAll(this.audio_token,this.full_audio_sequence)));let a;return t&&(a=await this.image_processor(t,r),e=e.map(e=>e.replaceAll(this.image_token,this.full_image_sequence))),{...this.tokenizer(e,r),...a,...i}}}}),"./src/models/glpn/image_processing_glpn.js":((e,t,n)=>{ +/*!**************************************************!*\ +!*** ./src/models/glpn/image_processing_glpn.js ***! +\**************************************************/ +n.r(t),n.d(t,{GLPNFeatureExtractor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}}),"./src/models/grounding_dino/image_processing_grounding_dino.js":((e,t,n)=>{ +/*!**********************************************************************!*\ +!*** ./src/models/grounding_dino/image_processing_grounding_dino.js ***! +\**********************************************************************/ +n.r(t),n.d(t,{GroundingDinoImageProcessor:()=>a});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.ImageProcessor{async _call(e){let t=await super._call(e),n=t.pixel_values.dims,r=(0,i.ones)([n[0],n[2],n[3]]);return{...t,pixel_mask:r}}}}),"./src/models/grounding_dino/processing_grounding_dino.js":((e,t,n)=>{ +/*!****************************************************************!*\ +!*** ./src/models/grounding_dino/processing_grounding_dino.js ***! +\****************************************************************/ +n.r(t),n.d(t,{GroundingDinoProcessor:()=>c});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),a=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),o=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);function s(e,t){let n=e.dims.at(-1)-1,r=e.tolist();r.fill(!1,0,1),r.fill(!1,n);let i=t.tolist();return r.map((e,t)=>e?t:null).filter(e=>e!==null).map(e=>i[e])}class c extends r.Processor{static tokenizer_class=a.AutoTokenizer;static image_processor_class=i.AutoImageProcessor;async _call(e,t,n={}){let r=e?await this.image_processor(e,n):{};return{...t?this.tokenizer(t,n):{},...r}}post_process_grounded_object_detection(e,t,{box_threshold:n=.25,text_threshold:r=.25,target_sizes:i=null}={}){let{logits:a,pred_boxes:c}=e,l=a.dims[0];if(i!==null&&i.length!==l)throw Error(`Make sure that you pass in as many target sizes as the batch dimension of the logits`);let u=a.dims.at(1),d=a.sigmoid(),f=d.max(-1).tolist(),p=c.tolist().map(e=>e.map(e=>(0,o.center_to_corners_format)(e))),m=[];for(let e=0;ee.map((e,t)=>e*a[(t+1)%2])));let o=f[e],c=[],l=[],h=[];for(let i=0;i{ +/*!**********************************************************!*\ +!*** ./src/models/idefics3/image_processing_idefics3.js ***! +\**********************************************************/ +n.r(t),n.d(t,{Idefics3ImageProcessor:()=>a});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.ImageProcessor{constructor(e){super(e),this.do_image_splitting=e.do_image_splitting??!0,this.max_image_size=e.max_image_size}get_resize_for_vision_encoder(e,t){let[n,r]=e.dims.slice(-2),i=r/n;return r>=n?(r=Math.ceil(r/t)*t,n=Math.floor(r/i),n=Math.ceil(n/t)*t):(n=Math.ceil(n/t)*t,r=Math.floor(n*i),r=Math.ceil(r/t)*t),{height:n,width:r}}async _call(e,{do_image_splitting:t=null,return_row_col_info:n=!1}={}){let r;if(!Array.isArray(e))r=[[e]];else{if(e.length===0||!e[0])throw Error(`No images provided.`);r=Array.isArray(e[0])?e:[e]}let a=[],o=[],s=[],c=[],l=[];for(let e of r){let n=await Promise.all(e.map(e=>this.preprocess(e)));c.push(...n.map(e=>e.original_size)),l.push(...n.map(e=>e.reshaped_input_size)),n.forEach(e=>e.pixel_values.unsqueeze_(0));let{longest_edge:r}=this.max_image_size,u;if(t??this.do_image_splitting){let e=Array(n.length),t=Array(n.length);u=await Promise.all(n.map(async(n,a)=>{let o=this.get_resize_for_vision_encoder(n.pixel_values,r),s=await(0,i.interpolate_4d)(n.pixel_values,{size:[o.height,o.width]}),{frames:c,num_splits_h:l,num_splits_w:u}=await this.split_image(s,this.max_image_size);return e[a]=l,t[a]=u,(0,i.cat)(c,0)})),o.push(e),s.push(t)}else{let e=[r,r];u=await Promise.all(n.map(t=>(0,i.interpolate_4d)(t.pixel_values,{size:e}))),o.push(Array(n.length).fill(0)),s.push(Array(n.length).fill(0))}a.push((0,i.cat)(u,0))}let u=a.length,[d,f,p,m]=a[0].dims,h,g;if(u===1)h=a[0].unsqueeze_(0),g=(0,i.full)([u,d,p,m],!0);else{let e=Math.max(...a.map(e=>e.dims.at(0)));g=(0,i.full)([u,e,p,m],!0);let t=g.data,n=e*p*m;for(let r=0;rn||s>r){c=Math.ceil(o/n),l=Math.ceil(s/r);let t=Math.ceil(o/c),u=Math.ceil(s/l);for(let n=0;n{ +/*!****************************************************!*\ +!*** ./src/models/idefics3/processing_idefics3.js ***! +\****************************************************/ +n.r(t),n.d(t,{Idefics3Processor:()=>u});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),a=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);n( +/*! ../../utils/image.js */ +`./src/utils/image.js`);var o=n( +/*! ../../utils/core.js */ +`./src/utils/core.js`);function s(e,t,n,r,i,a){let o=``;for(let a=0;a`+i.repeat(e);o+=` +`}return o+=`\n${r}${a}`+i.repeat(e)+`${r}`,o}function c(e,t,n,r){return`${t}${r}`+n.repeat(e)+`${t}`}function l(e,t,n,r,i,a){return e===0&&t===0?c(n,r,i,a):s(n,e,t,r,i,a)}class u extends r.Processor{static image_processor_class=i.AutoImageProcessor;static tokenizer_class=a.AutoTokenizer;static uses_processor_config=!0;fake_image_token=``;image_token=``;global_img_token=``;async _call(e,t=null,n={}){n.return_row_col_info??=!0;let r;t&&(r=await this.image_processor(t,n)),Array.isArray(e)||(e=[e]);let i=r.rows??[Array(e.length).fill(0)],a=r.cols??[Array(e.length).fill(0)],s=this.config.image_seq_len,c=[],u=[];for(let t=0;tl(e,d[t],s,this.fake_image_token,this.image_token,this.global_img_token)),p=n.split(this.image_token);if(p.length===0)throw Error(`The image token should be present in the text.`);let m=p[0];for(let e=0;e{ +/*!****************************************!*\ +!*** ./src/models/image_processors.js ***! +\****************************************/ +n.r(t),n.d(t,{BeitFeatureExtractor:()=>r.BeitFeatureExtractor,BitImageProcessor:()=>i.BitImageProcessor,CLIPFeatureExtractor:()=>o.CLIPFeatureExtractor,CLIPImageProcessor:()=>o.CLIPImageProcessor,ChineseCLIPFeatureExtractor:()=>a.ChineseCLIPFeatureExtractor,ConvNextFeatureExtractor:()=>s.ConvNextFeatureExtractor,ConvNextImageProcessor:()=>s.ConvNextImageProcessor,DINOv3ViTImageProcessor:()=>u.DINOv3ViTImageProcessor,DPTFeatureExtractor:()=>f.DPTFeatureExtractor,DPTImageProcessor:()=>f.DPTImageProcessor,DeiTFeatureExtractor:()=>c.DeiTFeatureExtractor,DeiTImageProcessor:()=>c.DeiTImageProcessor,DetrFeatureExtractor:()=>l.DetrFeatureExtractor,DetrImageProcessor:()=>l.DetrImageProcessor,DonutFeatureExtractor:()=>d.DonutFeatureExtractor,DonutImageProcessor:()=>d.DonutImageProcessor,EfficientNetImageProcessor:()=>p.EfficientNetImageProcessor,GLPNFeatureExtractor:()=>m.GLPNFeatureExtractor,GroundingDinoImageProcessor:()=>h.GroundingDinoImageProcessor,Idefics3ImageProcessor:()=>g.Idefics3ImageProcessor,JinaCLIPImageProcessor:()=>v.JinaCLIPImageProcessor,LlavaOnevisionImageProcessor:()=>y.LlavaOnevisionImageProcessor,Mask2FormerImageProcessor:()=>b.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>x.MaskFormerFeatureExtractor,MaskFormerImageProcessor:()=>x.MaskFormerImageProcessor,MobileNetV1FeatureExtractor:()=>S.MobileNetV1FeatureExtractor,MobileNetV1ImageProcessor:()=>S.MobileNetV1ImageProcessor,MobileNetV2FeatureExtractor:()=>C.MobileNetV2FeatureExtractor,MobileNetV2ImageProcessor:()=>C.MobileNetV2ImageProcessor,MobileNetV3FeatureExtractor:()=>w.MobileNetV3FeatureExtractor,MobileNetV3ImageProcessor:()=>w.MobileNetV3ImageProcessor,MobileNetV4FeatureExtractor:()=>T.MobileNetV4FeatureExtractor,MobileNetV4ImageProcessor:()=>T.MobileNetV4ImageProcessor,MobileViTFeatureExtractor:()=>E.MobileViTFeatureExtractor,MobileViTImageProcessor:()=>E.MobileViTImageProcessor,NougatImageProcessor:()=>D.NougatImageProcessor,OwlViTFeatureExtractor:()=>k.OwlViTFeatureExtractor,OwlViTImageProcessor:()=>k.OwlViTImageProcessor,Owlv2ImageProcessor:()=>O.Owlv2ImageProcessor,Phi3VImageProcessor:()=>A.Phi3VImageProcessor,PixtralImageProcessor:()=>j.PixtralImageProcessor,PvtImageProcessor:()=>M.PvtImageProcessor,Qwen2VLImageProcessor:()=>N.Qwen2VLImageProcessor,RTDetrImageProcessor:()=>P.RTDetrImageProcessor,Sam2ImageProcessor:()=>I.Sam2ImageProcessor,Sam3ImageProcessor:()=>L.Sam3ImageProcessor,SamImageProcessor:()=>F.SamImageProcessor,SegformerFeatureExtractor:()=>ee.SegformerFeatureExtractor,SegformerImageProcessor:()=>ee.SegformerImageProcessor,SiglipImageProcessor:()=>te.SiglipImageProcessor,SmolVLMImageProcessor:()=>R.SmolVLMImageProcessor,Swin2SRImageProcessor:()=>ne.Swin2SRImageProcessor,VLMImageProcessor:()=>_.VLMImageProcessor,ViTFeatureExtractor:()=>re.ViTFeatureExtractor,ViTImageProcessor:()=>re.ViTImageProcessor,VitMatteImageProcessor:()=>ie.VitMatteImageProcessor,VitPoseImageProcessor:()=>ae.VitPoseImageProcessor,YolosFeatureExtractor:()=>z.YolosFeatureExtractor,YolosImageProcessor:()=>z.YolosImageProcessor});var r=n( +/*! ./beit/image_processing_beit.js */ +`./src/models/beit/image_processing_beit.js`),i=n( +/*! ./bit/image_processing_bit.js */ +`./src/models/bit/image_processing_bit.js`),a=n( +/*! ./chinese_clip/image_processing_chinese_clip.js */ +`./src/models/chinese_clip/image_processing_chinese_clip.js`),o=n( +/*! ./clip/image_processing_clip.js */ +`./src/models/clip/image_processing_clip.js`),s=n( +/*! ./convnext/image_processing_convnext.js */ +`./src/models/convnext/image_processing_convnext.js`),c=n( +/*! ./deit/image_processing_deit.js */ +`./src/models/deit/image_processing_deit.js`),l=n( +/*! ./detr/image_processing_detr.js */ +`./src/models/detr/image_processing_detr.js`),u=n( +/*! ./dinov3_vit/image_processing_dinov3_vit.js */ +`./src/models/dinov3_vit/image_processing_dinov3_vit.js`),d=n( +/*! ./donut/image_processing_donut.js */ +`./src/models/donut/image_processing_donut.js`),f=n( +/*! ./dpt/image_processing_dpt.js */ +`./src/models/dpt/image_processing_dpt.js`),p=n( +/*! ./efficientnet/image_processing_efficientnet.js */ +`./src/models/efficientnet/image_processing_efficientnet.js`),m=n( +/*! ./glpn/image_processing_glpn.js */ +`./src/models/glpn/image_processing_glpn.js`),h=n( +/*! ./grounding_dino/image_processing_grounding_dino.js */ +`./src/models/grounding_dino/image_processing_grounding_dino.js`),g=n( +/*! ./idefics3/image_processing_idefics3.js */ +`./src/models/idefics3/image_processing_idefics3.js`),_=n( +/*! ./janus/image_processing_janus.js */ +`./src/models/janus/image_processing_janus.js`),v=n( +/*! ./jina_clip/image_processing_jina_clip.js */ +`./src/models/jina_clip/image_processing_jina_clip.js`),y=n( +/*! ./llava_onevision/image_processing_llava_onevision.js */ +`./src/models/llava_onevision/image_processing_llava_onevision.js`),b=n( +/*! ./mask2former/image_processing_mask2former.js */ +`./src/models/mask2former/image_processing_mask2former.js`),x=n( +/*! ./maskformer/image_processing_maskformer.js */ +`./src/models/maskformer/image_processing_maskformer.js`),S=n( +/*! ./mobilenet_v1/image_processing_mobilenet_v1.js */ +`./src/models/mobilenet_v1/image_processing_mobilenet_v1.js`),C=n( +/*! ./mobilenet_v2/image_processing_mobilenet_v2.js */ +`./src/models/mobilenet_v2/image_processing_mobilenet_v2.js`),w=n( +/*! ./mobilenet_v3/image_processing_mobilenet_v3.js */ +`./src/models/mobilenet_v3/image_processing_mobilenet_v3.js`),T=n( +/*! ./mobilenet_v4/image_processing_mobilenet_v4.js */ +`./src/models/mobilenet_v4/image_processing_mobilenet_v4.js`),E=n( +/*! ./mobilevit/image_processing_mobilevit.js */ +`./src/models/mobilevit/image_processing_mobilevit.js`),D=n( +/*! ./nougat/image_processing_nougat.js */ +`./src/models/nougat/image_processing_nougat.js`),O=n( +/*! ./owlv2/image_processing_owlv2.js */ +`./src/models/owlv2/image_processing_owlv2.js`),k=n( +/*! ./owlvit/image_processing_owlvit.js */ +`./src/models/owlvit/image_processing_owlvit.js`),A=n( +/*! ./phi3_v/image_processing_phi3_v.js */ +`./src/models/phi3_v/image_processing_phi3_v.js`),j=n( +/*! ./pixtral/image_processing_pixtral.js */ +`./src/models/pixtral/image_processing_pixtral.js`),M=n( +/*! ./pvt/image_processing_pvt.js */ +`./src/models/pvt/image_processing_pvt.js`),N=n( +/*! ./qwen2_vl/image_processing_qwen2_vl.js */ +`./src/models/qwen2_vl/image_processing_qwen2_vl.js`),P=n( +/*! ./rt_detr/image_processing_rt_detr.js */ +`./src/models/rt_detr/image_processing_rt_detr.js`),F=n( +/*! ./sam/image_processing_sam.js */ +`./src/models/sam/image_processing_sam.js`),I=n( +/*! ./sam2/image_processing_sam2.js */ +`./src/models/sam2/image_processing_sam2.js`),L=n( +/*! ./sam3/image_processing_sam3.js */ +`./src/models/sam3/image_processing_sam3.js`),ee=n( +/*! ./segformer/image_processing_segformer.js */ +`./src/models/segformer/image_processing_segformer.js`),te=n( +/*! ./siglip/image_processing_siglip.js */ +`./src/models/siglip/image_processing_siglip.js`),R=n( +/*! ./smolvlm/image_processing_smolvlm.js */ +`./src/models/smolvlm/image_processing_smolvlm.js`),ne=n( +/*! ./swin2sr/image_processing_swin2sr.js */ +`./src/models/swin2sr/image_processing_swin2sr.js`),re=n( +/*! ./vit/image_processing_vit.js */ +`./src/models/vit/image_processing_vit.js`),ie=n( +/*! ./vitmatte/image_processing_vitmatte.js */ +`./src/models/vitmatte/image_processing_vitmatte.js`),ae=n( +/*! ./vitpose/image_processing_vitpose.js */ +`./src/models/vitpose/image_processing_vitpose.js`),z=n( +/*! ./yolos/image_processing_yolos.js */ +`./src/models/yolos/image_processing_yolos.js`)}),"./src/models/janus/image_processing_janus.js":((e,t,n)=>{ +/*!****************************************************!*\ +!*** ./src/models/janus/image_processing_janus.js ***! +\****************************************************/ +n.r(t),n.d(t,{VLMImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{constructor(e){super({do_pad:!0,pad_size:{width:e.image_size,height:e.image_size},...e}),this.constant_values=this.config.background_color.map(e=>e*this.rescale_factor)}pad_image(e,t,n,r){return super.pad_image(e,t,n,{constant_values:this.constant_values,center:!0,...r})}}}),"./src/models/janus/processing_janus.js":((e,t,n)=>{ +/*!**********************************************!*\ +!*** ./src/models/janus/processing_janus.js ***! +\**********************************************/ +n.r(t),n.d(t,{VLChatProcessor:()=>l});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),a=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),o=n( +/*! ../../utils/core.js */ +`./src/utils/core.js`),s=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),c=n( +/*! ../../utils/image.js */ +`./src/utils/image.js`);class l extends r.Processor{static image_processor_class=i.AutoImageProcessor;static tokenizer_class=a.AutoTokenizer;static uses_processor_config=!0;constructor(e,t,n){super(e,t,n),this.image_tag=this.config.image_tag,this.image_start_tag=this.config.image_start_tag,this.image_end_tag=this.config.image_end_tag,this.num_image_tokens=this.config.num_image_tokens}async _call(e,{images:t=null,chat_template:n=`default`}={}){t?Array.isArray(t)||(t=[t]):t=await Promise.all(e.filter(e=>e.images).flatMap(e=>e.images).map(e=>c.RawImage.read(e)));let r=this.tokenizer,i=r.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0,chat_template:n}),a=e=>r.encode(e,{add_special_tokens:!1}),l=i.split(this.image_tag),u=l.length-1;if(t.length!==u)throw Error(`Number of images provided (${t.length}) does not match number of "${this.image_tag}" image tags (${u})`);let[d,f,p]=r.model.convert_tokens_to_ids([this.image_tag,this.image_start_tag,this.image_end_tag]),m=a(l[0]),h=Array(m.length).fill(!1);for(let e=1;e0){let e=await this.image_processor(t);return e.pixel_values.unsqueeze_(0),{..._,...e}}return _}}}),"./src/models/jina_clip/image_processing_jina_clip.js":((e,t,n)=>{ +/*!************************************************************!*\ +!*** ./src/models/jina_clip/image_processing_jina_clip.js ***! +\************************************************************/ +n.r(t),n.d(t,{JinaCLIPImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{constructor(e){let{resize_mode:t,fill_color:n,interpolation:r,size:i,...a}=e,o=t===`squash`?{width:i,height:i}:t===`shortest`?{shortest_edge:i}:{longest_edge:i},s=r===`bicubic`?3:2;super({...a,size:o,resample:s,do_center_crop:!0,crop_size:i,do_normalize:!0})}}}),"./src/models/jina_clip/processing_jina_clip.js":((e,t,n)=>{ +/*!******************************************************!*\ +!*** ./src/models/jina_clip/processing_jina_clip.js ***! +\******************************************************/ +n.r(t),n.d(t,{JinaCLIPProcessor:()=>o});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),a=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);class o extends r.Processor{static tokenizer_class=a.AutoTokenizer;static image_processor_class=i.AutoImageProcessor;async _call(e=null,t=null,n={}){if(!e&&!t)throw Error(`Either text or images must be provided`);let r=e?this.tokenizer(e,n):{},i=t?await this.image_processor(t,n):{};return{...r,...i}}}}),"./src/models/llava/processing_llava.js":((e,t,n)=>{ +/*!**********************************************!*\ +!*** ./src/models/llava/processing_llava.js ***! +\**********************************************/ +n.r(t),n.d(t,{LlavaProcessor:()=>o});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),a=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);class o extends r.Processor{static tokenizer_class=a.AutoTokenizer;static image_processor_class=i.AutoImageProcessor;static uses_processor_config=!0;async _call(e,t=null,n={}){let r=await this.image_processor(e,n);if(t){let[e,n]=r.pixel_values.dims.slice(-2),{image_token:i,patch_size:a,num_additional_image_tokens:o}=this.config,s=Math.floor(e/a)*Math.floor(n/a)+o;t=structuredClone(t),Array.isArray(t)||(t=[t]);for(let e=0;e{ +/*!************************************************************************!*\ +!*** ./src/models/llava_onevision/image_processing_llava_onevision.js ***! +\************************************************************************/ +n.r(t),n.d(t,{LlavaOnevisionImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}}),"./src/models/mask2former/image_processing_mask2former.js":((e,t,n)=>{ +/*!****************************************************************!*\ +!*** ./src/models/mask2former/image_processing_mask2former.js ***! +\****************************************************************/ +n.r(t),n.d(t,{Mask2FormerImageProcessor:()=>i});var r=n( +/*! ../maskformer/image_processing_maskformer.js */ +`./src/models/maskformer/image_processing_maskformer.js`);class i extends r.MaskFormerImageProcessor{}}),"./src/models/maskformer/image_processing_maskformer.js":((e,t,n)=>{ +/*!**************************************************************!*\ +!*** ./src/models/maskformer/image_processing_maskformer.js ***! +\**************************************************************/ +n.r(t),n.d(t,{MaskFormerFeatureExtractor:()=>a,MaskFormerImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_panoptic_segmentation(...e){return(0,r.post_process_panoptic_segmentation)(...e)}post_process_instance_segmentation(...e){return(0,r.post_process_instance_segmentation)(...e)}}class a extends i{}}),"./src/models/mgp_str/processing_mgp_str.js":((e,t,n)=>{ +/*!**************************************************!*\ +!*** ./src/models/mgp_str/processing_mgp_str.js ***! +\**************************************************/ +n.r(t),n.d(t,{MgpstrProcessor:()=>c});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),a=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),o=n( +/*! ../../utils/maths.js */ +`./src/utils/maths.js`);let s={char:[`char_decode`,1],bpe:[`bpe_decode`,2],wp:[`wp_decode`,102]};class c extends r.Processor{static tokenizer_class=a.AutoTokenizer;static image_processor_class=i.AutoImageProcessor;get char_tokenizer(){return this.components.char_tokenizer}get bpe_tokenizer(){return this.components.bpe_tokenizer}get wp_tokenizer(){return this.components.wp_tokenizer}_decode_helper(e,t){if(!s.hasOwnProperty(t))throw Error(`Format ${t} is not supported.`);let[n,r]=s[t],i=this[n].bind(this),[a,c]=e.dims,l=[],u=[],d=e.tolist();for(let e=0;e0?i.reduce((e,t)=>e*t,1):0;u.push(n),l.push(a)}return[i(u),l]}char_decode(e){return this.char_tokenizer.batch_decode(e).map(e=>e.replaceAll(` `,``))}bpe_decode(e){return this.bpe_tokenizer.batch_decode(e)}wp_decode(e){return this.wp_tokenizer.batch_decode(e).map(e=>e.replaceAll(` `,``))}batch_decode([e,t,n]){let[r,i]=this._decode_helper(e,`char`),[a,s]=this._decode_helper(t,`bpe`),[c,l]=this._decode_helper(n,`wp`),u=[],d=[];for(let e=0;e{ +/*!******************************************************************!*\ +!*** ./src/models/mobilenet_v1/image_processing_mobilenet_v1.js ***! +\******************************************************************/ +n.r(t),n.d(t,{MobileNetV1FeatureExtractor:()=>a,MobileNetV1ImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}}),"./src/models/mobilenet_v2/image_processing_mobilenet_v2.js":((e,t,n)=>{ +/*!******************************************************************!*\ +!*** ./src/models/mobilenet_v2/image_processing_mobilenet_v2.js ***! +\******************************************************************/ +n.r(t),n.d(t,{MobileNetV2FeatureExtractor:()=>a,MobileNetV2ImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}}),"./src/models/mobilenet_v3/image_processing_mobilenet_v3.js":((e,t,n)=>{ +/*!******************************************************************!*\ +!*** ./src/models/mobilenet_v3/image_processing_mobilenet_v3.js ***! +\******************************************************************/ +n.r(t),n.d(t,{MobileNetV3FeatureExtractor:()=>a,MobileNetV3ImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}}),"./src/models/mobilenet_v4/image_processing_mobilenet_v4.js":((e,t,n)=>{ +/*!******************************************************************!*\ +!*** ./src/models/mobilenet_v4/image_processing_mobilenet_v4.js ***! +\******************************************************************/ +n.r(t),n.d(t,{MobileNetV4FeatureExtractor:()=>a,MobileNetV4ImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}}),"./src/models/mobilevit/image_processing_mobilevit.js":((e,t,n)=>{ +/*!************************************************************!*\ +!*** ./src/models/mobilevit/image_processing_mobilevit.js ***! +\************************************************************/ +n.r(t),n.d(t,{MobileViTFeatureExtractor:()=>a,MobileViTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}}),"./src/models/moonshine/feature_extraction_moonshine.js":((e,t,n)=>{ +/*!**************************************************************!*\ +!*** ./src/models/moonshine/feature_extraction_moonshine.js ***! +\**************************************************************/ +n.r(t),n.d(t,{MoonshineFeatureExtractor:()=>a});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.FeatureExtractor{async _call(e){(0,r.validate_audio_inputs)(e,`MoonshineFeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=[1,e.length];return{input_values:new i.Tensor(`float32`,e,t)}}}}),"./src/models/moonshine/processing_moonshine.js":((e,t,n)=>{ +/*!******************************************************!*\ +!*** ./src/models/moonshine/processing_moonshine.js ***! +\******************************************************/ +n.r(t),n.d(t,{MoonshineProcessor:()=>o});var r=n( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),i=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),a=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`);class o extends a.Processor{static tokenizer_class=i.AutoTokenizer;static feature_extractor_class=r.AutoFeatureExtractor;async _call(e){return await this.feature_extractor(e)}}}),"./src/models/nougat/image_processing_nougat.js":((e,t,n)=>{ +/*!******************************************************!*\ +!*** ./src/models/nougat/image_processing_nougat.js ***! +\******************************************************/ +n.r(t),n.d(t,{NougatImageProcessor:()=>i});var r=n( +/*! ../donut/image_processing_donut.js */ +`./src/models/donut/image_processing_donut.js`);class i extends r.DonutImageProcessor{}}),"./src/models/owlv2/image_processing_owlv2.js":((e,t,n)=>{ +/*!****************************************************!*\ +!*** ./src/models/owlv2/image_processing_owlv2.js ***! +\****************************************************/ +n.r(t),n.d(t,{Owlv2ImageProcessor:()=>i});var r=n( +/*! ../owlvit/image_processing_owlvit.js */ +`./src/models/owlvit/image_processing_owlvit.js`);class i extends r.OwlViTImageProcessor{}}),"./src/models/owlvit/image_processing_owlvit.js":((e,t,n)=>{ +/*!******************************************************!*\ +!*** ./src/models/owlvit/image_processing_owlvit.js ***! +\******************************************************/ +n.r(t),n.d(t,{OwlViTFeatureExtractor:()=>a,OwlViTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_object_detection(...e){return(0,r.post_process_object_detection)(...e)}}class a extends i{}}),"./src/models/owlvit/processing_owlvit.js":((e,t,n)=>{ +/*!************************************************!*\ +!*** ./src/models/owlvit/processing_owlvit.js ***! +\************************************************/ +n.r(t),n.d(t,{OwlViTProcessor:()=>o});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),a=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);class o extends r.Processor{static tokenizer_class=a.AutoTokenizer;static image_processor_class=i.AutoImageProcessor}}),"./src/models/paligemma/processing_paligemma.js":((e,t,n)=>{ +/*!******************************************************!*\ +!*** ./src/models/paligemma/processing_paligemma.js ***! +\******************************************************/ +n.r(t),n.d(t,{PaliGemmaProcessor:()=>c});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),a=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);let o=``;function s(e,t,n,r,i){return`${r.repeat(n*i)}${t}${e}\n`}class c extends r.Processor{static tokenizer_class=a.AutoTokenizer;static image_processor_class=i.AutoImageProcessor;static uses_processor_config=!1;async _call(e,t=null,n={}){t||=(console.warn(`You are using PaliGemma without a text prefix. It will perform as a picture-captioning model.`),``),Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]);let r=this.tokenizer.bos_token,i=this.image_processor.config.image_seq_length,a;t.some(e=>e.includes(o))?a=t.map(e=>{let t=e.replaceAll(o,o.repeat(i)),n=t.lastIndexOf(o),a=n===-1?0:n+7;return t.slice(0,a)+r+t.slice(a)+` +`}):(console.warn("You are passing both `text` and `images` to `PaliGemmaProcessor`. The processor expects special image tokens in the text, as many tokens as there are images per each text. It is recommended to add `` tokens in the very beginning of your text. For this call, we will infer how many images each text has and add special tokens."),a=t.map(t=>s(t,r,i,o,e.length)));let c=this.tokenizer(a,n);return{...await this.image_processor(e,n),...c}}}}),"./src/models/parakeet/feature_extraction_parakeet.js":((e,t,n)=>{ +/*!************************************************************!*\ +!*** ./src/models/parakeet/feature_extraction_parakeet.js ***! +\************************************************************/ +n.r(t),n.d(t,{ParakeetFeatureExtractor:()=>o});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`);class o extends r.FeatureExtractor{constructor(e){super(e),this.config.mel_filters??=(0,a.mel_filter_bank)(Math.floor(1+this.config.n_fft/2),this.config.feature_size,0,this.config.sampling_rate/2,this.config.sampling_rate,`slaney`,`slaney`);let t=(0,a.window_function)(this.config.win_length,`hann`,{periodic:!1});this.window=new Float64Array(this.config.n_fft);let n=Math.floor((this.config.n_fft-this.config.win_length)/2);this.window.set(t,n)}async _extract_fbank_features(e){let t=this.config.preemphasis;e=new Float64Array(e);for(let n=e.length-1;n>=1;--n)e[n]-=t*e[n-1];return await(0,a.spectrogram)(e,this.window,this.window.length,this.config.hop_length,{fft_length:this.config.n_fft,power:2,mel_filters:this.config.mel_filters,log_mel:`log`,mel_floor:-1/0,pad_mode:`constant`,center:!0,transpose:!0,mel_offset:2**-24})}async _call(e){(0,r.validate_audio_inputs)(e,`ParakeetFeatureExtractor`);let t=await this._extract_fbank_features(e),n=Math.floor((e.length+Math.floor(this.config.n_fft/2)*2-this.config.n_fft)/this.config.hop_length),a=t.data;a.fill(0,n*t.dims[1]);let[o,s]=t.dims,c=new Float64Array(s),l=new Float64Array(s);for(let e=0;e1?n-1:1;for(let e=0;e{ +/*!******************************************************!*\ +!*** ./src/models/phi3_v/image_processing_phi3_v.js ***! +\******************************************************/ +n.r(t),n.d(t,{Phi3VImageProcessor:()=>l});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);let a=[2,3],{ceil:o,floor:s,sqrt:c}=Math;class l extends r.ImageProcessor{constructor(e){super({...e,do_normalize:!0,do_pad:!0,pad_size:`custom`,do_convert_rgb:!0,do_resize:!0}),this._num_crops=e.num_crops}calc_num_image_tokens_from_image_size(e,t){let{num_img_tokens:n}=this.config;return s((s(t/336)*s(e/336)+1)*n+1+(s(t/336)+1)*c(n))}get_resize_output_image_size(e,t){let n=this._num_crops,[r,i]=e.size,a=r/i,o=1;for(;o*Math.ceil(o/a)<=n;)o+=1;--o;let s=Math.floor(o*336);return[s,Math.floor(s/a)]}pad_image(e,t,n,r={}){let[i,a]=t,s=336*o(i/336),c=336*o(a/336),l=[1,1,1].map((e,t)=>(e-this.image_mean[t])/this.image_std[t]);return super.pad_image(e,t,{width:c,height:s},{center:!0,constant_values:l,...r})}async _call(e,{num_crops:t=null}={}){if(this._num_crops=t??=this.config.num_crops,t<4||c(t)%1!=0)throw Error(`num_crops must be a square number >= 4`);Array.isArray(e)||(e=[e]);let n=e.length,r=await Promise.all(e.map(e=>this.preprocess(e))),l=r.map(e=>e.original_size),u=r.map(e=>e.reshaped_input_size),d=[];for(let{pixel_values:e}of r){e.unsqueeze_(0);let[n,r]=e.dims.slice(-2),o=await(0,i.interpolate_4d)(e,{size:[336,336],mode:`bicubic`});if(t>0){let l=[],u=c(t),f=s(r/u),p=s(n/u);for(let t=0;te.map(e=>336*o(e/336)));return{pixel_values:f,original_sizes:l,reshaped_input_sizes:u,image_sizes:new i.Tensor(`int64`,p.flat(),[n,2]),num_img_tokens:p.map(([e,t])=>this.calc_num_image_tokens_from_image_size(t,e))}}}}),"./src/models/phi3_v/processing_phi3_v.js":((e,t,n)=>{ +/*!************************************************!*\ +!*** ./src/models/phi3_v/processing_phi3_v.js ***! +\************************************************/ +n.r(t),n.d(t,{Phi3VProcessor:()=>c});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),a=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);n( +/*! ../../utils/image.js */ +`./src/utils/image.js`);let o=`<|image|>`,s=/<\|image_\d+\|>/g;class c extends r.Processor{static image_processor_class=i.AutoImageProcessor;static tokenizer_class=a.AutoTokenizer;async _call(e,t=null,{padding:n=!0,truncation:r=!0,num_crops:i=null}={}){Array.isArray(e)||(e=[e]);let a,c;if(t){c=await this.image_processor(t,{num_crops:i});let{num_img_tokens:l}=c,u=e.map((e,t)=>e.split(s).join(o.repeat(l[t])));a=this.tokenizer(u,{padding:n,truncation:r});let d=this.tokenizer.model.convert_tokens_to_ids([o])[0];a.input_ids.map_(e=>e==d?-e:e)}else a=this.tokenizer(e);return{...a,...c}}}}),"./src/models/pixtral/image_processing_pixtral.js":((e,t,n)=>{ +/*!********************************************************!*\ +!*** ./src/models/pixtral/image_processing_pixtral.js ***! +\********************************************************/ +n.r(t),n.d(t,{PixtralImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{get_resize_output_image_size(e,t){let{longest_edge:n}=t;if(n===void 0)throw Error(`size must contain 'longest_edge'`);let[r,i]=e.size,a=Math.max(r,i)/n,o=r,s=i;a>1&&(o=Math.floor(r/a),s=Math.floor(i/a));let{patch_size:c,spatial_merge_size:l}=this.config;if(!l)throw Error(`config must contain 'spatial_merge_size'`);let u=c*l,d=Math.floor((o-1)/u)+1,f=Math.floor((s-1)/u)+1;return[d*u,f*u]}}}),"./src/models/pixtral/processing_pixtral.js":((e,t,n)=>{ +/*!**************************************************!*\ +!*** ./src/models/pixtral/processing_pixtral.js ***! +\**************************************************/ +n.r(t),n.d(t,{PixtralProcessor:()=>o});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),a=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);class o extends r.Processor{static tokenizer_class=a.AutoTokenizer;static image_processor_class=i.AutoImageProcessor;static uses_processor_config=!0;async _call(e,t=null,n={}){let r=await this.image_processor(e,n);if(t){let[e,n]=r.pixel_values.dims.slice(-2),{image_token:i,image_break_token:a,image_end_token:o,patch_size:s,spatial_merge_size:c}=this.config,l=s*c,u=Math.floor(e/l),d=Math.floor(n/l);t=structuredClone(t),Array.isArray(t)||(t=[t]);for(let e=0;e{ +/*!**********************************!*\ +!*** ./src/models/processors.js ***! +\**********************************/ +n.r(t),n.d(t,{Florence2Processor:()=>r.Florence2Processor,Gemma3nProcessor:()=>i.Gemma3nProcessor,GroundingDinoProcessor:()=>a.GroundingDinoProcessor,Idefics3Processor:()=>o.Idefics3Processor,JinaCLIPProcessor:()=>c.JinaCLIPProcessor,LlavaProcessor:()=>l.LlavaProcessor,MgpstrProcessor:()=>u.MgpstrProcessor,MoonshineProcessor:()=>d.MoonshineProcessor,OwlViTProcessor:()=>f.OwlViTProcessor,PaliGemmaProcessor:()=>p.PaliGemmaProcessor,Phi3VProcessor:()=>m.Phi3VProcessor,PixtralProcessor:()=>h.PixtralProcessor,PyAnnoteProcessor:()=>g.PyAnnoteProcessor,Qwen2VLProcessor:()=>_.Qwen2VLProcessor,Sam2Processor:()=>y.Sam2Processor,Sam2VideoProcessor:()=>y.Sam2VideoProcessor,SamProcessor:()=>v.SamProcessor,SmolVLMProcessor:()=>b.SmolVLMProcessor,SpeechT5Processor:()=>x.SpeechT5Processor,UltravoxProcessor:()=>S.UltravoxProcessor,VLChatProcessor:()=>s.VLChatProcessor,VoxtralProcessor:()=>C.VoxtralProcessor,Wav2Vec2Processor:()=>w.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>T.Wav2Vec2ProcessorWithLM,WhisperProcessor:()=>E.WhisperProcessor});var r=n( +/*! ./florence2/processing_florence2.js */ +`./src/models/florence2/processing_florence2.js`),i=n( +/*! ./gemma3n/processing_gemma3n.js */ +`./src/models/gemma3n/processing_gemma3n.js`),a=n( +/*! ./grounding_dino/processing_grounding_dino.js */ +`./src/models/grounding_dino/processing_grounding_dino.js`),o=n( +/*! ./idefics3/processing_idefics3.js */ +`./src/models/idefics3/processing_idefics3.js`),s=n( +/*! ./janus/processing_janus.js */ +`./src/models/janus/processing_janus.js`),c=n( +/*! ./jina_clip/processing_jina_clip.js */ +`./src/models/jina_clip/processing_jina_clip.js`),l=n( +/*! ./llava/processing_llava.js */ +`./src/models/llava/processing_llava.js`),u=n( +/*! ./mgp_str/processing_mgp_str.js */ +`./src/models/mgp_str/processing_mgp_str.js`),d=n( +/*! ./moonshine/processing_moonshine.js */ +`./src/models/moonshine/processing_moonshine.js`),f=n( +/*! ./owlvit/processing_owlvit.js */ +`./src/models/owlvit/processing_owlvit.js`),p=n( +/*! ./paligemma/processing_paligemma.js */ +`./src/models/paligemma/processing_paligemma.js`),m=n( +/*! ./phi3_v/processing_phi3_v.js */ +`./src/models/phi3_v/processing_phi3_v.js`),h=n( +/*! ./pixtral/processing_pixtral.js */ +`./src/models/pixtral/processing_pixtral.js`),g=n( +/*! ./pyannote/processing_pyannote.js */ +`./src/models/pyannote/processing_pyannote.js`),_=n( +/*! ./qwen2_vl/processing_qwen2_vl.js */ +`./src/models/qwen2_vl/processing_qwen2_vl.js`),v=n( +/*! ./sam/processing_sam.js */ +`./src/models/sam/processing_sam.js`),y=n( +/*! ./sam2/processing_sam2.js */ +`./src/models/sam2/processing_sam2.js`),b=n( +/*! ./smolvlm/processing_smolvlm.js */ +`./src/models/smolvlm/processing_smolvlm.js`),x=n( +/*! ./speecht5/processing_speecht5.js */ +`./src/models/speecht5/processing_speecht5.js`),S=n( +/*! ./ultravox/processing_ultravox.js */ +`./src/models/ultravox/processing_ultravox.js`),C=n( +/*! ./voxtral/processing_voxtral.js */ +`./src/models/voxtral/processing_voxtral.js`),w=n( +/*! ./wav2vec2/processing_wav2vec2.js */ +`./src/models/wav2vec2/processing_wav2vec2.js`),T=n( +/*! ./wav2vec2_with_lm/processing_wav2vec2_with_lm.js */ +`./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js`),E=n( +/*! ./whisper/processing_whisper.js */ +`./src/models/whisper/processing_whisper.js`)}),"./src/models/pvt/image_processing_pvt.js":((e,t,n)=>{ +/*!************************************************!*\ +!*** ./src/models/pvt/image_processing_pvt.js ***! +\************************************************/ +n.r(t),n.d(t,{PvtImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}}),"./src/models/pyannote/feature_extraction_pyannote.js":((e,t,n)=>{ +/*!************************************************************!*\ +!*** ./src/models/pyannote/feature_extraction_pyannote.js ***! +\************************************************************/ +n.r(t),n.d(t,{PyAnnoteFeatureExtractor:()=>o});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/maths.js */ +`./src/utils/maths.js`);class o extends r.FeatureExtractor{async _call(e){(0,r.validate_audio_inputs)(e,`PyAnnoteFeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=[1,1,e.length];return{input_values:new i.Tensor(`float32`,e,t)}}samples_to_frames(e){return(e-this.config.offset)/this.config.step}post_process_speaker_diarization(e,t){let n=t/this.samples_to_frames(t)/this.config.sampling_rate,r=[];for(let t of e.tolist()){let e=[],i=-1;for(let n=0;n({id:e,start:t*n,end:r*n,confidence:i/(r-t)})))}return r}}}),"./src/models/pyannote/processing_pyannote.js":((e,t,n)=>{ +/*!****************************************************!*\ +!*** ./src/models/pyannote/processing_pyannote.js ***! +\****************************************************/ +n.r(t),n.d(t,{PyAnnoteProcessor:()=>a});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ./feature_extraction_pyannote.js */ +`./src/models/pyannote/feature_extraction_pyannote.js`);class a extends r.Processor{static feature_extractor_class=i.PyAnnoteFeatureExtractor;async _call(e){return await this.feature_extractor(e)}post_process_speaker_diarization(...e){return this.feature_extractor.post_process_speaker_diarization(...e)}get sampling_rate(){return this.feature_extractor.config.sampling_rate}}}),"./src/models/qwen2_vl/image_processing_qwen2_vl.js":((e,t,n)=>{ +/*!**********************************************************!*\ +!*** ./src/models/qwen2_vl/image_processing_qwen2_vl.js ***! +\**********************************************************/ +n.r(t),n.d(t,{Qwen2VLImageProcessor:()=>a});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.ImageProcessor{async _call(e,...t){let{pixel_values:n,original_sizes:r,reshaped_input_sizes:a}=await super._call(e,...t),o=n,{temporal_patch_size:s,merge_size:c,patch_size:l}=this.config;o.dims[0]===1&&(o=(0,i.cat)(Array.from({length:s},()=>o),0));let u=o.dims[0]/s,d=o.dims[1],f=Math.floor(o.dims[2]/l),p=Math.floor(o.dims[3]/l);return{pixel_values:o.view(u,s,d,Math.floor(f/c),c,l,Math.floor(p/c),c,l).permute(0,3,6,4,7,2,1,5,8).view(u*f*p,d*s*l*l),image_grid_thw:new i.Tensor(`int64`,[u,f,p],[1,3]),original_sizes:r,reshaped_input_sizes:a}}}}),"./src/models/qwen2_vl/processing_qwen2_vl.js":((e,t,n)=>{ +/*!****************************************************!*\ +!*** ./src/models/qwen2_vl/processing_qwen2_vl.js ***! +\****************************************************/ +n.r(t),n.d(t,{Qwen2VLProcessor:()=>o});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`),a=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`);n( +/*! ../../utils/image.js */ +`./src/utils/image.js`);class o extends r.Processor{static image_processor_class=i.AutoImageProcessor;static tokenizer_class=a.AutoTokenizer;async _call(e,t=null,...n){Array.isArray(e)||(e=[e]);let r,i;if(t&&(r=await this.image_processor(t),i=r.image_grid_thw),i){let t=this.image_processor.config.merge_size**2,n=0,r=i.tolist();e=e.map(e=>{for(;e.includes(`<|image_pad|>`);){let i=Number(r[n++].reduce((e,t)=>e*t,1n));e=e.replace(`<|image_pad|>`,`<|placeholder|>`.repeat(Math.floor(i/t)))}return e.replaceAll(`<|placeholder|>`,`<|image_pad|>`)})}return{...this.tokenizer(e),...r}}}}),"./src/models/rt_detr/image_processing_rt_detr.js":((e,t,n)=>{ +/*!********************************************************!*\ +!*** ./src/models/rt_detr/image_processing_rt_detr.js ***! +\********************************************************/ +n.r(t),n.d(t,{RTDetrImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_object_detection(...e){return(0,r.post_process_object_detection)(...e)}}}),"./src/models/sam/image_processing_sam.js":((e,t,n)=>{ +/*!************************************************!*\ +!*** ./src/models/sam/image_processing_sam.js ***! +\************************************************/ +n.r(t),n.d(t,{SamImageProcessor:()=>o});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/core.js */ +`./src/utils/core.js`),a=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class o extends r.ImageProcessor{reshape_input_points(e,t,n,r=!1){e=structuredClone(e);let o=(0,i.calculateDimensions)(e);if(o.length===3)r||(o=[1,...o]),e=[e];else if(o.length!==4)throw Error("The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.");for(let r=0;re!==t.dims[n]))throw Error(`The first ${n.length} dimensions of 'input_points' and 'input_labels' must be the same.`);return new a.Tensor(`int64`,e.flat(1/0).map(BigInt),n)}async _call(e,{input_points:t=null,input_labels:n=null,input_boxes:r=null}={}){let i=await super._call(e);if(t&&(i.input_points=this.reshape_input_points(t,i.original_sizes,i.reshaped_input_sizes)),n){if(!i.input_points)throw Error("`input_points` must be provided if `input_labels` are provided.");i.input_labels=this.add_input_labels(n,i.input_points)}return r&&(i.input_boxes=this.reshape_input_points(r,i.original_sizes,i.reshaped_input_sizes,!0)),i}async post_process_masks(e,t,n,{mask_threshold:r=0,binarize:i=!0,pad_size:o=null}={}){let s=[];o=o??this.pad_size??this.size;let c=[o.height,o.width];for(let o=0;or&&(t[n]=1);d=new a.Tensor(`bool`,t,d.dims)}s.push(d)}return s}generate_crop_boxes(e,t,{crop_n_layers:n=0,overlap_ratio:r=512/1500,points_per_crop:i=32,crop_n_points_downscale_factor:a=1}={}){}}}),"./src/models/sam/processing_sam.js":((e,t,n)=>{ +/*!******************************************!*\ +!*** ./src/models/sam/processing_sam.js ***! +\******************************************/ +n.r(t),n.d(t,{SamProcessor:()=>a});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ../auto/image_processing_auto.js */ +`./src/models/auto/image_processing_auto.js`);class a extends r.Processor{static image_processor_class=i.AutoImageProcessor;async _call(...e){return await this.image_processor(...e)}post_process_masks(...e){return this.image_processor.post_process_masks(...e)}reshape_input_points(...e){return this.image_processor.reshape_input_points(...e)}}}),"./src/models/sam2/image_processing_sam2.js":((e,t,n)=>{ +/*!**************************************************!*\ +!*** ./src/models/sam2/image_processing_sam2.js ***! +\**************************************************/ +n.r(t),n.d(t,{Sam2ImageProcessor:()=>r.SamImageProcessor});var r=n( +/*! ../sam/image_processing_sam.js */ +`./src/models/sam/image_processing_sam.js`)}),"./src/models/sam2/processing_sam2.js":((e,t,n)=>{ +/*!********************************************!*\ +!*** ./src/models/sam2/processing_sam2.js ***! +\********************************************/ +n.r(t),n.d(t,{Sam2Processor:()=>i,Sam2VideoProcessor:()=>a});var r=n( +/*! ../sam/processing_sam.js */ +`./src/models/sam/processing_sam.js`);class i extends r.SamProcessor{}class a extends i{}}),"./src/models/sam3/image_processing_sam3.js":((e,t,n)=>{ +/*!**************************************************!*\ +!*** ./src/models/sam3/image_processing_sam3.js ***! +\**************************************************/ +n.r(t),n.d(t,{Sam3ImageProcessor:()=>r.Sam2ImageProcessor});var r=n( +/*! ../sam2/image_processing_sam2.js */ +`./src/models/sam2/image_processing_sam2.js`)}),"./src/models/seamless_m4t/feature_extraction_seamless_m4t.js":((e,t,n)=>{ +/*!********************************************************************!*\ +!*** ./src/models/seamless_m4t/feature_extraction_seamless_m4t.js ***! +\********************************************************************/ +n.r(t),n.d(t,{SeamlessM4TFeatureExtractor:()=>o});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`),a=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`);class o extends r.FeatureExtractor{constructor(e){super(e);let t=this.config.sampling_rate,n=(0,a.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0);this.mel_filters=n,this.window=(0,a.window_function)(400,`povey`,{periodic:!1})}async _extract_fbank_features(e,t){return e=e.map(e=>e*32768),(0,a.spectrogram)(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,max_num_frames:t,transpose:!0})}async _call(e,{padding:t=!0,pad_to_multiple_of:n=2,do_normalize_per_mel_bins:a=!0,return_attention_mask:o=!0}={}){(0,r.validate_audio_inputs)(e,`SeamlessM4TFeatureExtractor`);let s=await this._extract_fbank_features(e,this.config.max_length);if(a){let[e,t]=s.dims,n=s.data;for(let r=0;r0){let n=new Float32Array(t*(e+a));n.set(r),n.fill(this.config.padding_value,r.length);let l=e+a;s=new i.Tensor(s.type,n,[l,t]),o&&(c=new i.Tensor(`int64`,new BigInt64Array(l),[1,l]),c.data.fill(1n,0,e))}}let[l,u]=s.dims,d=this.config.stride;if(l%d!==0)throw Error(`The number of frames (${l}) must be a multiple of the stride (${d}).`);let f=s.view(1,Math.floor(l/d),u*d),p={input_features:f};if(o){let e=f.dims[1],t=new BigInt64Array(e);if(c){let e=c.data;for(let n=1,r=0;n{ +/*!************************************************************!*\ +!*** ./src/models/segformer/image_processing_segformer.js ***! +\************************************************************/ +n.r(t),n.d(t,{SegformerFeatureExtractor:()=>a,SegformerImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_semantic_segmentation(...e){return(0,r.post_process_semantic_segmentation)(...e)}}class a extends i{}}),"./src/models/siglip/image_processing_siglip.js":((e,t,n)=>{ +/*!******************************************************!*\ +!*** ./src/models/siglip/image_processing_siglip.js ***! +\******************************************************/ +n.r(t),n.d(t,{SiglipImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}}),"./src/models/smolvlm/image_processing_smolvlm.js":((e,t,n)=>{ +/*!********************************************************!*\ +!*** ./src/models/smolvlm/image_processing_smolvlm.js ***! +\********************************************************/ +n.r(t),n.d(t,{SmolVLMImageProcessor:()=>r.Idefics3ImageProcessor});var r=n( +/*! ../idefics3/image_processing_idefics3.js */ +`./src/models/idefics3/image_processing_idefics3.js`)}),"./src/models/smolvlm/processing_smolvlm.js":((e,t,n)=>{ +/*!**************************************************!*\ +!*** ./src/models/smolvlm/processing_smolvlm.js ***! +\**************************************************/ +n.r(t),n.d(t,{SmolVLMProcessor:()=>r.Idefics3Processor});var r=n( +/*! ../idefics3/processing_idefics3.js */ +`./src/models/idefics3/processing_idefics3.js`)}),"./src/models/snac/feature_extraction_snac.js":((e,t,n)=>{ +/*!****************************************************!*\ +!*** ./src/models/snac/feature_extraction_snac.js ***! +\****************************************************/ +n.r(t),n.d(t,{SnacFeatureExtractor:()=>i});var r=n( +/*! ../dac/feature_extraction_dac.js */ +`./src/models/dac/feature_extraction_dac.js`);class i extends r.DacFeatureExtractor{}}),"./src/models/speecht5/feature_extraction_speecht5.js":((e,t,n)=>{ +/*!************************************************************!*\ +!*** ./src/models/speecht5/feature_extraction_speecht5.js ***! +\************************************************************/ +n.r(t),n.d(t,{SpeechT5FeatureExtractor:()=>i});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`);class i extends r.FeatureExtractor{}}),"./src/models/speecht5/processing_speecht5.js":((e,t,n)=>{ +/*!****************************************************!*\ +!*** ./src/models/speecht5/processing_speecht5.js ***! +\****************************************************/ +n.r(t),n.d(t,{SpeechT5Processor:()=>o});var r=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),i=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),a=n( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`);class o extends r.Processor{static tokenizer_class=i.AutoTokenizer;static feature_extractor_class=a.AutoFeatureExtractor;async _call(e){return await this.feature_extractor(e)}}}),"./src/models/swin2sr/image_processing_swin2sr.js":((e,t,n)=>{ +/*!********************************************************!*\ +!*** ./src/models/swin2sr/image_processing_swin2sr.js ***! +\********************************************************/ +n.r(t),n.d(t,{Swin2SRImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{pad_image(e,t,n,r={}){let[i,a,o]=t;return super.pad_image(e,t,{width:a+(n-a%n)%n,height:i+(n-i%n)%n},{mode:`symmetric`,center:!1,constant_values:-1,...r})}}}),"./src/models/ultravox/processing_ultravox.js":((e,t,n)=>{ +/*!****************************************************!*\ +!*** ./src/models/ultravox/processing_ultravox.js ***! +\****************************************************/ +n.r(t),n.d(t,{UltravoxProcessor:()=>o});var r=n( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),i=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),a=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`);class o extends a.Processor{static tokenizer_class=i.AutoTokenizer;static feature_extractor_class=r.AutoFeatureExtractor;static uses_processor_config=!0;async _call(e,t=null,n={}){if(Array.isArray(e))throw Error(`Batched inputs are not supported yet.`);let r={};if(t){let i=t.length,{input_features:a}=await this.feature_extractor(t,{...n,max_length:i}),o=Math.round(i/this.config.encoder_ds_factor+1e-4),s=1+Math.ceil(o/this.config.stack_factor);r.audio_token_len=[s],r.audio_values=a;let c=this.config.audio_placeholder;if(!e.includes(c))throw Error(`The input text does not contain the image token ${c}.`);e=e.replaceAll(c,c.repeat(s))}return{...this.tokenizer(e,{add_special_tokens:!1,...n}),...r}}}}),"./src/models/vit/image_processing_vit.js":((e,t,n)=>{ +/*!************************************************!*\ +!*** ./src/models/vit/image_processing_vit.js ***! +\************************************************/ +n.r(t),n.d(t,{ViTFeatureExtractor:()=>a,ViTImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{}class a extends i{}}),"./src/models/vitmatte/image_processing_vitmatte.js":((e,t,n)=>{ +/*!**********************************************************!*\ +!*** ./src/models/vitmatte/image_processing_vitmatte.js ***! +\**********************************************************/ +n.r(t),n.d(t,{VitMatteImageProcessor:()=>a});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.ImageProcessor{async _call(e,t){Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]);let n=await Promise.all(e.map(e=>this.preprocess(e))),r=await Promise.all(t.map(e=>this.preprocess(e,{do_normalize:!1,do_convert_rgb:!1,do_convert_grayscale:!0})));return{pixel_values:(0,i.stack)(n.map((e,t)=>(0,i.cat)([e.pixel_values,r[t].pixel_values],0)),0),original_sizes:n.map(e=>e.original_size),reshaped_input_sizes:n.map(e=>e.reshaped_input_size)}}}}),"./src/models/vitpose/image_processing_vitpose.js":((e,t,n)=>{ +/*!********************************************************!*\ +!*** ./src/models/vitpose/image_processing_vitpose.js ***! +\********************************************************/ +n.r(t),n.d(t,{VitPoseImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_pose_estimation(e,t,{threshold:n=null}={}){let r=e.tolist(),[i,a,o,s]=e.dims,c=[];for(let e=0;e{ +/*!**************************************************!*\ +!*** ./src/models/voxtral/processing_voxtral.js ***! +\**************************************************/ +n.r(t),n.d(t,{VoxtralProcessor:()=>l});var r=n( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),i=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),a=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`),o=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);let s=`[AUDIO]`;function c(e,t){let n=[];for(let r=0;rc(e,l)),d=u.map(e=>e.length),f=u.flat(),p=(await Promise.all(f.map(e=>this.feature_extractor(e,n)))).map(e=>e.input_features);r.audio_values=p.length>1?(0,o.cat)(p,0):p[0];let m=i[0];for(let e=0;e{ +/*!************************************************************!*\ +!*** ./src/models/wav2vec2/feature_extraction_wav2vec2.js ***! +\************************************************************/ +n.r(t),n.d(t,{Wav2Vec2FeatureExtractor:()=>a});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`),i=n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);class a extends r.FeatureExtractor{_zero_mean_unit_var_norm(e){let t=e.reduce((e,t)=>e+t,0)/e.length,n=e.reduce((e,n)=>e+(n-t)**2,0)/e.length;return e.map(e=>(e-t)/Math.sqrt(n+1e-7))}async _call(e){(0,r.validate_audio_inputs)(e,`Wav2Vec2FeatureExtractor`),e instanceof Float64Array&&(e=new Float32Array(e));let t=e;this.config.do_normalize&&(t=this._zero_mean_unit_var_norm(t));let n=[1,t.length];return{input_values:new i.Tensor(`float32`,t,n),attention_mask:new i.Tensor(`int64`,new BigInt64Array(t.length).fill(1n),n)}}}}),"./src/models/wav2vec2/processing_wav2vec2.js":((e,t,n)=>{ +/*!****************************************************!*\ +!*** ./src/models/wav2vec2/processing_wav2vec2.js ***! +\****************************************************/ +n.r(t),n.d(t,{Wav2Vec2Processor:()=>o});var r=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),i=n( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),a=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`);class o extends a.Processor{static tokenizer_class=r.AutoTokenizer;static feature_extractor_class=i.AutoFeatureExtractor;async _call(e){return await this.feature_extractor(e)}}}),"./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js":((e,t,n)=>{ +/*!********************************************************************!*\ +!*** ./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js ***! +\********************************************************************/ +n.r(t),n.d(t,{Wav2Vec2ProcessorWithLM:()=>o});var r=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),i=n( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),a=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`);class o extends a.Processor{static tokenizer_class=r.AutoTokenizer;static feature_extractor_class=i.AutoFeatureExtractor;async _call(e){return await this.feature_extractor(e)}}}),"./src/models/wespeaker/feature_extraction_wespeaker.js":((e,t,n)=>{ +/*!**************************************************************!*\ +!*** ./src/models/wespeaker/feature_extraction_wespeaker.js ***! +\**************************************************************/ +n.r(t),n.d(t,{WeSpeakerFeatureExtractor:()=>a});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`);n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);var i=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`);class a extends r.FeatureExtractor{constructor(e){super(e);let t=this.config.sampling_rate,n=(0,i.mel_filter_bank)(257,this.config.num_mel_bins,20,Math.floor(t/2),t,null,`kaldi`,!0);this.mel_filters=n,this.window=(0,i.window_function)(400,`hamming`,{periodic:!1}),this.min_num_frames=this.config.min_num_frames}async _extract_fbank_features(e){return e=e.map(e=>e*32768),(0,i.spectrogram)(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:`log`,mel_floor:1.192092955078125e-7,remove_dc_offset:!0,transpose:!0,min_num_frames:this.min_num_frames})}async _call(e){(0,r.validate_audio_inputs)(e,`WeSpeakerFeatureExtractor`);let t=(await this._extract_fbank_features(e)).unsqueeze_(0);if(this.config.fbank_centering_span===null){let e=t.mean(1).data,n=t.data,[r,i,a]=t.dims;for(let t=0;t{ +/*!**********************************************!*\ +!*** ./src/models/whisper/common_whisper.js ***! +\**********************************************/ +n.r(t),n.d(t,{WHISPER_LANGUAGE_MAPPING:()=>i,WHISPER_TO_LANGUAGE_CODE_MAPPING:()=>a,whisper_language_to_code:()=>o});let r=[[`en`,`english`],[`zh`,`chinese`],[`de`,`german`],[`es`,`spanish`],[`ru`,`russian`],[`ko`,`korean`],[`fr`,`french`],[`ja`,`japanese`],[`pt`,`portuguese`],[`tr`,`turkish`],[`pl`,`polish`],[`ca`,`catalan`],[`nl`,`dutch`],[`ar`,`arabic`],[`sv`,`swedish`],[`it`,`italian`],[`id`,`indonesian`],[`hi`,`hindi`],[`fi`,`finnish`],[`vi`,`vietnamese`],[`he`,`hebrew`],[`uk`,`ukrainian`],[`el`,`greek`],[`ms`,`malay`],[`cs`,`czech`],[`ro`,`romanian`],[`da`,`danish`],[`hu`,`hungarian`],[`ta`,`tamil`],[`no`,`norwegian`],[`th`,`thai`],[`ur`,`urdu`],[`hr`,`croatian`],[`bg`,`bulgarian`],[`lt`,`lithuanian`],[`la`,`latin`],[`mi`,`maori`],[`ml`,`malayalam`],[`cy`,`welsh`],[`sk`,`slovak`],[`te`,`telugu`],[`fa`,`persian`],[`lv`,`latvian`],[`bn`,`bengali`],[`sr`,`serbian`],[`az`,`azerbaijani`],[`sl`,`slovenian`],[`kn`,`kannada`],[`et`,`estonian`],[`mk`,`macedonian`],[`br`,`breton`],[`eu`,`basque`],[`is`,`icelandic`],[`hy`,`armenian`],[`ne`,`nepali`],[`mn`,`mongolian`],[`bs`,`bosnian`],[`kk`,`kazakh`],[`sq`,`albanian`],[`sw`,`swahili`],[`gl`,`galician`],[`mr`,`marathi`],[`pa`,`punjabi`],[`si`,`sinhala`],[`km`,`khmer`],[`sn`,`shona`],[`yo`,`yoruba`],[`so`,`somali`],[`af`,`afrikaans`],[`oc`,`occitan`],[`ka`,`georgian`],[`be`,`belarusian`],[`tg`,`tajik`],[`sd`,`sindhi`],[`gu`,`gujarati`],[`am`,`amharic`],[`yi`,`yiddish`],[`lo`,`lao`],[`uz`,`uzbek`],[`fo`,`faroese`],[`ht`,`haitian creole`],[`ps`,`pashto`],[`tk`,`turkmen`],[`nn`,`nynorsk`],[`mt`,`maltese`],[`sa`,`sanskrit`],[`lb`,`luxembourgish`],[`my`,`myanmar`],[`bo`,`tibetan`],[`tl`,`tagalog`],[`mg`,`malagasy`],[`as`,`assamese`],[`tt`,`tatar`],[`haw`,`hawaiian`],[`ln`,`lingala`],[`ha`,`hausa`],[`ba`,`bashkir`],[`jw`,`javanese`],[`su`,`sundanese`]],i=new Map(r),a=new Map([...r.map(([e,t])=>[t,e]),[`burmese`,`my`],[`valencian`,`ca`],[`flemish`,`nl`],[`haitian`,`ht`],[`letzeburgesch`,`lb`],[`pushto`,`ps`],[`panjabi`,`pa`],[`moldavian`,`ro`],[`moldovan`,`ro`],[`sinhalese`,`si`],[`castilian`,`es`]]);function o(e){e=e.toLowerCase();let t=a.get(e);if(t===void 0){let n=e.match(/^<\|([a-z]{2})\|>$/);if(n&&(e=n[1]),i.has(e))t=e;else{let t=e.length===2?i.keys():i.values();throw Error(`Language "${e}" is not supported. Must be one of: ${JSON.stringify(Array.from(t))}`)}}return t}}),"./src/models/whisper/feature_extraction_whisper.js":((e,t,n)=>{ +/*!**********************************************************!*\ +!*** ./src/models/whisper/feature_extraction_whisper.js ***! +\**********************************************************/ +n.r(t),n.d(t,{WhisperFeatureExtractor:()=>o});var r=n( +/*! ../../base/feature_extraction_utils.js */ +`./src/base/feature_extraction_utils.js`);n( +/*! ../../utils/tensor.js */ +`./src/utils/tensor.js`);var i=n( +/*! ../../utils/audio.js */ +`./src/utils/audio.js`),a=n( +/*! ../../utils/maths.js */ +`./src/utils/maths.js`);class o extends r.FeatureExtractor{constructor(e){super(e),this.config.mel_filters??=(0,i.mel_filter_bank)(Math.floor(1+this.config.n_fft/2),this.config.feature_size,0,8e3,this.config.sampling_rate,`slaney`,`slaney`),this.window=(0,i.window_function)(this.config.n_fft,`hann`)}async _extract_fbank_features(e){let t=await(0,i.spectrogram)(e,this.window,this.config.n_fft,this.config.hop_length,{power:2,mel_filters:this.config.mel_filters,log_mel:`log10`,max_num_frames:Math.min(Math.floor(e.length/this.config.hop_length),this.config.nb_max_frames)}),n=t.data,r=(0,a.max)(n)[0];for(let e=0;ei?(e.length>this.config.n_samples&&console.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`."),n=e.slice(0,i)):(n=new Float32Array(i),n.set(e)),{input_features:(await this._extract_fbank_features(n)).unsqueeze_(0)}}}}),"./src/models/whisper/generation_whisper.js":((e,t,n)=>{ +/*!**************************************************!*\ +!*** ./src/models/whisper/generation_whisper.js ***! +\**************************************************/ +n.r(t),n.d(t,{WhisperGenerationConfig:()=>i});var r=n( +/*! ../../generation/configuration_utils.js */ +`./src/generation/configuration_utils.js`);class i extends r.GenerationConfig{return_timestamps=null;return_token_timestamps=null;num_frames=null;alignment_heads=null;task=null;language=null;no_timestamps_token_id=null;prompt_ids=null;is_multilingual=null;lang_to_id=null;task_to_id=null;max_initial_timestamp_index=1}}),"./src/models/whisper/processing_whisper.js":((e,t,n)=>{ +/*!**************************************************!*\ +!*** ./src/models/whisper/processing_whisper.js ***! +\**************************************************/ +n.r(t),n.d(t,{WhisperProcessor:()=>o});var r=n( +/*! ../auto/feature_extraction_auto.js */ +`./src/models/auto/feature_extraction_auto.js`),i=n( +/*! ../../tokenizers.js */ +`./src/tokenizers.js`),a=n( +/*! ../../base/processing_utils.js */ +`./src/base/processing_utils.js`);class o extends a.Processor{static tokenizer_class=i.AutoTokenizer;static feature_extractor_class=r.AutoFeatureExtractor;async _call(e){return await this.feature_extractor(e)}}}),"./src/models/yolos/image_processing_yolos.js":((e,t,n)=>{ +/*!****************************************************!*\ +!*** ./src/models/yolos/image_processing_yolos.js ***! +\****************************************************/ +n.r(t),n.d(t,{YolosFeatureExtractor:()=>a,YolosImageProcessor:()=>i});var r=n( +/*! ../../base/image_processors_utils.js */ +`./src/base/image_processors_utils.js`);class i extends r.ImageProcessor{post_process_object_detection(...e){return(0,r.post_process_object_detection)(...e)}}class a extends i{}}),"./src/ops/registry.js":((e,t,n)=>{ +/*!*****************************!*\ +!*** ./src/ops/registry.js ***! +\*****************************/ +n.r(t),n.d(t,{TensorOpRegistry:()=>o});var r=n( +/*! ../backends/onnx.js */ +`./src/backends/onnx.js`),i=n( +/*! ../utils/tensor.js */ +`./src/utils/tensor.js`);let a=async(e,t,n)=>{let a=await(0,r.createInferenceSession)(new Uint8Array(e),t);return(async e=>{let t=(0,r.isONNXProxy)(),o=Object.fromEntries(Object.entries(e).map(([e,n])=>[e,(t?n.clone():n).ort_tensor])),s=await(0,r.runInferenceSession)(a,o);return Array.isArray(n)?n.map(e=>new i.Tensor(s[e])):new i.Tensor(s[n])})};class o{static session_options={};static get nearest_interpolate_4d(){return this._nearest_interpolate_4d||=a([8,10,18,0,58,129,1,10,41,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,18,10,4,109,111,100,101,34,7,110,101,97,114,101,115,116,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,21],this.session_options,`y`),this._nearest_interpolate_4d}static get bilinear_interpolate_4d(){return this._bilinear_interpolate_4d||=a([8,9,18,0,58,128,1,10,40,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,17,10,4,109,111,100,101,34,6,108,105,110,101,97,114,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,`y`),this._bilinear_interpolate_4d}static get bicubic_interpolate_4d(){return this._bicubic_interpolate_4d||=a([8,9,18,0,58,127,10,39,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,16,10,4,109,111,100,101,34,5,99,117,98,105,99,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,`y`),this._bicubic_interpolate_4d}static get matmul(){return this._matmul||=a([8,9,18,0,58,55,10,17,10,1,97,10,1,98,18,1,99,34,6,77,97,116,77,117,108,18,1,114,90,9,10,1,97,18,4,10,2,8,1,90,9,10,1,98,18,4,10,2,8,1,98,9,10,1,99,18,4,10,2,8,1,66,2,16,20],this.session_options,`c`),this._matmul}static get stft(){return this._stft||=a([8,7,18,0,58,148,1,10,38,10,1,115,10,1,106,10,1,119,10,1,108,18,1,111,34,4,83,84,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,115,90,26,10,1,115,18,21,10,19,8,1,18,15,10,3,18,1,98,10,3,18,1,115,10,3,18,1,99,90,11,10,1,106,18,6,10,4,8,7,18,0,90,16,10,1,119,18,11,10,9,8,1,18,5,10,3,18,1,119,90,11,10,1,108,18,6,10,4,8,7,18,0,98,31,10,1,111,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,102,10,3,18,1,100,10,3,18,1,99,66,2,16,17],this.session_options,`o`),this._stft}static get rfft(){return this._rfft||=a([8,9,18,0,58,97,10,33,10,1,120,10,0,10,1,97,18,1,121,34,3,68,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,100,90,21,10,1,120,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,90,11,10,1,97,18,6,10,4,8,7,18,0,98,21,10,1,121,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,66,2,16,20],this.session_options,`y`),this._rfft}static get top_k(){return this._top_k||=a([8,10,18,0,58,73,10,18,10,1,120,10,1,107,18,1,118,18,1,105,34,4,84,111,112,75,18,1,116,90,9,10,1,120,18,4,10,2,8,1,90,15,10,1,107,18,10,10,8,8,7,18,4,10,2,8,1,98,9,10,1,118,18,4,10,2,8,1,98,9,10,1,105,18,4,10,2,8,7,66,2,16,21],this.session_options,[`v`,`i`]),this._top_k}static get slice(){return this._slice||=a([8,7,18,0,58,96,10,25,10,1,120,10,1,115,10,1,101,10,1,97,10,1,116,18,1,121,34,5,83,108,105,99,101,18,1,114,90,9,10,1,120,18,4,10,2,8,1,90,9,10,1,115,18,4,10,2,8,7,90,9,10,1,101,18,4,10,2,8,7,90,9,10,1,97,18,4,10,2,8,7,90,9,10,1,116,18,4,10,2,8,7,98,9,10,1,121,18,4,10,2,8,1,66,2,16,13],this.session_options,`y`),this._slice}}}),"./src/pipelines.js":((e,t,n)=>{ +/*!**************************!*\ +!*** ./src/pipelines.js ***! +\**************************/ +n.r(t),n.d(t,{AudioClassificationPipeline:()=>O,AutomaticSpeechRecognitionPipeline:()=>A,BackgroundRemovalPipeline:()=>P,DepthEstimationPipeline:()=>ne,DocumentQuestionAnsweringPipeline:()=>ee,FeatureExtractionPipeline:()=>E,FillMaskPipeline:()=>y,ImageClassificationPipeline:()=>M,ImageFeatureExtractionPipeline:()=>D,ImageSegmentationPipeline:()=>N,ImageToImagePipeline:()=>R,ImageToTextPipeline:()=>j,ObjectDetectionPipeline:()=>I,Pipeline:()=>h,QuestionAnsweringPipeline:()=>v,SummarizationPipeline:()=>x,Text2TextGenerationPipeline:()=>b,TextClassificationPipeline:()=>g,TextGenerationPipeline:()=>w,TextToAudioPipeline:()=>te,TokenClassificationPipeline:()=>_,TranslationPipeline:()=>S,ZeroShotAudioClassificationPipeline:()=>k,ZeroShotClassificationPipeline:()=>T,ZeroShotImageClassificationPipeline:()=>F,ZeroShotObjectDetectionPipeline:()=>L,pipeline:()=>ae});var r=n( +/*! ./tokenizers.js */ +`./src/tokenizers.js`),i=n( +/*! ./models.js */ +`./src/models.js`),a=n( +/*! ./models/auto/processing_auto.js */ +`./src/models/auto/processing_auto.js`);n( +/*! ./base/processing_utils.js */ +`./src/base/processing_utils.js`);var o=n( +/*! ./utils/generic.js */ +`./src/utils/generic.js`),s=n( +/*! ./utils/core.js */ +`./src/utils/core.js`),c=n( +/*! ./utils/maths.js */ +`./src/utils/maths.js`),l=n( +/*! ./utils/audio.js */ +`./src/utils/audio.js`),u=n( +/*! ./utils/tensor.js */ +`./src/utils/tensor.js`),d=n( +/*! ./utils/image.js */ +`./src/utils/image.js`);async function f(e){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>d.RawImage.read(e)))}async function p(e,t){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>typeof e==`string`||e instanceof URL?(0,l.read_audio)(e,t):e instanceof Float64Array?new Float32Array(e):e))}function m(e,t){t&&(e=e.map(e=>e|0));let[n,r,i,a]=e;return{xmin:n,ymin:r,xmax:i,ymax:a}}class h extends o.Callable{constructor({task:e,model:t,tokenizer:n=null,processor:r=null}){super(),this.task=e,this.model=t,this.tokenizer=n,this.processor=r}async dispose(){await this.model.dispose()}}class g extends h{constructor(e){super(e)}async _call(e,{top_k:t=1}={}){let n=this.tokenizer(e,{padding:!0,truncation:!0}),r=await this.model(n),i=this.model.config.problem_type===`multi_label_classification`?e=>e.sigmoid():e=>new u.Tensor(`float32`,(0,c.softmax)(e.data),e.dims),a=this.model.config.id2label,o=[];for(let e of r.logits){let n=i(e),r=await(0,u.topk)(n,t),s=r[0].tolist(),c=r[1].tolist().map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:s[t]}));t===1?o.push(...c):o.push(c)}return Array.isArray(e)||t===1?o:o[0]}}class _ extends h{constructor(e){super(e)}async _call(e,{ignore_labels:t=[`O`]}={}){let n=Array.isArray(e),r=this.tokenizer(n?e:[e],{padding:!0,truncation:!0}),i=(await this.model(r)).logits,a=this.model.config.id2label,o=[];for(let e=0;ee==this.tokenizer.sep_token_id);l[e].map((e,n)=>e==1&&(n===0||n>r&&u.findIndex(e=>e==t[n])===-1));let f=i[e].tolist(),p=a[e].tolist();for(let n=1;ne==t[n])!==-1)&&(f[n]=-1/0,p[n]=-1/0);let m=(0,c.softmax)(f).map((e,t)=>[e,t]),h=(0,c.softmax)(p).map((e,t)=>[e,t]);m[0][0]=0,h[0][0]=0;let g=(0,s.product)(m,h).filter(e=>e[0][1]<=e[1][1]).map(e=>[e[0][1],e[1][1],e[0][0]*e[1][0]]).sort((e,t)=>t[2]-e[2]);for(let e=0;ee==this.tokenizer.mask_token_id);if(o===-1)throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`);let s=r[e][o],l=await(0,u.topk)(new u.Tensor(`float32`,(0,c.softmax)(s.data),s.dims),t),d=l[0].tolist(),f=l[1].tolist();i.push(f.map((e,t)=>{let r=n.slice();return r[o]=e,{score:d[t],token:Number(e),token_str:this.tokenizer.decode([e]),sequence:this.tokenizer.decode(r,{skip_special_tokens:!0})}}))}return Array.isArray(e)?i:i[0]}}class b extends h{_key=`generated_text`;constructor(e){super(e)}async _call(e,t={}){Array.isArray(e)||(e=[e]),this.model.config.prefix&&(e=e.map(e=>this.model.config.prefix+e));let n=this.model.config.task_specific_params;n&&n[this.task]&&n[this.task].prefix&&(e=e.map(e=>n[this.task].prefix+e));let r=this.tokenizer,i={padding:!0,truncation:!0},a;a=this instanceof S&&`_build_translation_inputs`in r?r._build_translation_inputs(e,i,t):r(e,i);let o=await this.model.generate({...a,...t});return r.batch_decode(o,{skip_special_tokens:!0}).map(e=>({[this._key]:e}))}}class x extends b{_key=`summary_text`;constructor(e){super(e)}}class S extends b{_key=`translation_text`;constructor(e){super(e)}}function C(e){return Array.isArray(e)&&e.every(e=>`role`in e&&`content`in e)}class w extends h{constructor(e){super(e)}async _call(e,t={}){let n=!1,r=!1,i=t.add_special_tokens??(this.tokenizer.add_bos_token||this.tokenizer.add_eos_token)??!1,a;if(typeof e==`string`)a=e=[e];else if(Array.isArray(e)&&e.every(e=>typeof e==`string`))n=!0,a=e;else{if(C(e))e=[e];else if(Array.isArray(e)&&e.every(C))n=!0;else throw Error(`Input must be a string, an array of strings, a Chat, or an array of Chats`);r=!0,a=e.map(e=>this.tokenizer.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0})),i=!1}let o=r?!1:t.return_full_text??!0;this.tokenizer.padding_side=`left`;let s=this.tokenizer(a,{add_special_tokens:i,padding:!0,truncation:!0}),c=await this.model.generate({...s,...t}),l=this.tokenizer.batch_decode(c,{skip_special_tokens:!0}),u;!o&&s.input_ids.dims.at(-1)>0&&(u=this.tokenizer.batch_decode(s.input_ids,{skip_special_tokens:!0}).map(e=>e.length));let d=Array.from({length:e.length},e=>[]);for(let t=0;t[e.toLowerCase(),t])),this.entailment_id=this.label2id.entailment,this.entailment_id===void 0&&(console.warn(`Could not find 'entailment' in label2id mapping. Using 2 as entailment_id.`),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,this.contradiction_id===void 0&&(console.warn(`Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id.`),this.contradiction_id=0)}async _call(e,t,{hypothesis_template:n=`This example is {}.`,multi_label:r=!1}={}){let i=Array.isArray(e);i||(e=[e]),Array.isArray(t)||(t=[t]);let a=t.map(e=>n.replace(`{}`,e)),o=r||t.length===1,s=[];for(let n of e){let e=[];for(let t of a){let r=this.tokenizer(n,{text_pair:t,padding:!0,truncation:!0}),i=await this.model(r);o?e.push([i.logits.data[this.contradiction_id],i.logits.data[this.entailment_id]]):e.push(i.logits.data[this.entailment_id])}let r=(o?e.map(e=>(0,c.softmax)(e)[1]):(0,c.softmax)(e)).map((e,t)=>[e,t]).sort((e,t)=>t[0]-e[0]);s.push({sequence:n,labels:r.map(e=>t[e[1]]),scores:r.map(e=>e[0])})}return i?s:s[0]}}class E extends h{constructor(e){super(e)}async _call(e,{pooling:t=`none`,normalize:n=!1,quantize:r=!1,precision:i=`binary`}={}){let a=this.tokenizer(e,{padding:!0,truncation:!0}),o=await this.model(a),s=o.last_hidden_state??o.logits??o.token_embeddings;switch(t){case`none`:break;case`mean`:s=(0,u.mean_pooling)(s,a.attention_mask);break;case`first_token`:case`cls`:s=s.slice(null,0);break;case`last_token`:case`eos`:s=s.slice(null,-1);break;default:throw Error(`Pooling method '${t}' not supported.`)}return n&&(s=s.normalize(2,-1)),r&&(s=(0,u.quantize_embeddings)(s,i)),s}}class D extends h{constructor(e){super(e)}async _call(e,{pool:t=null}={}){let n=await f(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),a;if(t){if(!(`pooler_output`in i))throw Error(`No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.`);a=i.pooler_output}else a=i.last_hidden_state??i.logits??i.image_embeds;return a}}class O extends h{constructor(e){super(e)}async _call(e,{top_k:t=5}={}){let n=this.processor.feature_extractor.config.sampling_rate,r=await p(e,n),i=this.model.config.id2label,a=[];for(let e of r){let n=await this.processor(e),r=(await this.model(n)).logits[0],o=await(0,u.topk)(new u.Tensor(`float32`,(0,c.softmax)(r.data),r.dims),t),s=o[0].tolist(),l=o[1].tolist().map((e,t)=>({label:i?i[e]:`LABEL_${e}`,score:s[t]}));a.push(l)}return Array.isArray(e)?a:a[0]}}class k extends h{constructor(e){super(e)}async _call(e,t,{hypothesis_template:n=`This is a sound of {}.`}={}){let r=!Array.isArray(e);r&&(e=[e]);let i=t.map(e=>n.replace(`{}`,e)),a=this.tokenizer(i,{padding:!0,truncation:!0}),o=this.processor.feature_extractor.config.sampling_rate,s=await p(e,o),l=[];for(let e of s){let n=await this.processor(e),r=await this.model({...a,...n}),i=(0,c.softmax)(r.logits_per_audio.data);l.push([...i].map((e,n)=>({score:e,label:t[n]})))}return r?l[0]:l}}class A extends h{constructor(e){super(e)}async _call(e,t={}){switch(this.model.config.model_type){case`whisper`:case`lite-whisper`:return this._call_whisper(e,t);case`wav2vec2`:case`wav2vec2-bert`:case`unispeech`:case`unispeech-sat`:case`hubert`:case`parakeet_ctc`:return this._call_wav2vec2(e,t);case`moonshine`:return this._call_moonshine(e,t);default:throw Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(e,t){t.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),t.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');let n=!Array.isArray(e);n&&(e=[e]);let r=this.processor.feature_extractor.config.sampling_rate,i=await p(e,r),a=[];for(let e of i){let t=await this.processor(e),n=(await this.model(t)).logits[0],r=[];for(let e of n)r.push((0,c.max)(e.data)[1]);let i=this.tokenizer.decode(r,{skip_special_tokens:!0}).trim();a.push({text:i})}return n?a[0]:a}async _call_whisper(e,t){let n=t.return_timestamps??!1,r=t.chunk_length_s??0,i=t.force_full_sequences??!1,a=t.stride_length_s??null,o={...t};n===`word`&&(o.return_token_timestamps=!0,o.return_timestamps=!1);let s=!Array.isArray(e);s&&(e=[e]);let l=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,u=this.processor.feature_extractor.config.hop_length,d=this.processor.feature_extractor.config.sampling_rate,f=await p(e,d),m=[];for(let e of f){let t=[];if(r>0){if(a===null)a=r/6;else if(r<=a)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");let n=d*r,i=d*a,o=n-2*i,s=0;for(;;){let r=s+n,a=e.subarray(s,r),c=await this.processor(a),l=s===0,u=r>=e.length;if(t.push({stride:[a.length,l?0:i,u?0:i],input_features:c.input_features,is_last:u}),u)break;s+=o}}else t=[{stride:[e.length,0,0],input_features:(await this.processor(e)).input_features,is_last:!0}];for(let e of t){o.num_frames=Math.floor(e.stride[0]/u);let t=await this.model.generate({inputs:e.input_features,...o});n===`word`?(e.tokens=t.sequences.tolist()[0],e.token_timestamps=t.token_timestamps.tolist()[0].map(e=>(0,c.round)(e,2))):e.tokens=t[0].tolist(),e.stride=e.stride.map(e=>e/d)}let[s,f]=this.tokenizer._decode_asr(t,{time_precision:l,return_timestamps:n,force_full_sequences:i});m.push({text:s,...f})}return s?m[0]:m}async _call_moonshine(e,t){let n=!Array.isArray(e);n&&(e=[e]);let r=this.processor.feature_extractor.config.sampling_rate,i=await p(e,r),a=[];for(let e of i){let n=await this.processor(e),i=Math.floor(e.length/r)*6,o=await this.model.generate({max_new_tokens:i,...t,...n}),s=this.processor.batch_decode(o,{skip_special_tokens:!0})[0];a.push({text:s})}return n?a[0]:a}}class j extends h{constructor(e){super(e)}async _call(e,t={}){let n=Array.isArray(e),r=await f(e),{pixel_values:i}=await this.processor(r),a=[];for(let e of i){e.dims=[1,...e.dims];let n=await this.model.generate({inputs:e,...t}),r=this.tokenizer.batch_decode(n,{skip_special_tokens:!0}).map(e=>({generated_text:e.trim()}));a.push(r)}return n?a:a[0]}}class M extends h{constructor(e){super(e)}async _call(e,{top_k:t=5}={}){let n=await f(e),{pixel_values:r}=await this.processor(n),i=await this.model({pixel_values:r}),a=this.model.config.id2label,o=[];for(let e of i.logits){let n=await(0,u.topk)(new u.Tensor(`float32`,(0,c.softmax)(e.data),e.dims),t),r=n[0].tolist(),i=n[1].tolist().map((e,t)=>({label:a?a[e]:`LABEL_${e}`,score:r[t]}));o.push(i)}return Array.isArray(e)?o:o[0]}}class N extends h{constructor(e){super(e),this.subtasks_mapping={panoptic:`post_process_panoptic_segmentation`,instance:`post_process_instance_segmentation`,semantic:`post_process_semantic_segmentation`}}async _call(e,{threshold:t=.5,mask_threshold:n=.5,overlap_mask_area_threshold:r=.8,label_ids_to_fuse:i=null,target_sizes:a=null,subtask:o=null}={}){if(Array.isArray(e)&&e.length!==1)throw Error(`Image segmentation pipeline currently only supports a batch size of 1.`);let s=await f(e),c=s.map(e=>[e.height,e.width]),l=await this.processor(s),{inputNames:u,outputNames:p}=this.model.sessions.model;if(!u.includes(`pixel_values`)){if(u.length!==1)throw Error(`Expected a single input name, but got ${u.length} inputs: ${u}.`);let e=u[0];if(e in l)throw Error(`Input name ${e} already exists in the inputs.`);l[e]=l.pixel_values}let m=await this.model(l),h=null;if(o!==null)h=this.subtasks_mapping[o];else if(this.processor.image_processor){for(let[e,t]of Object.entries(this.subtasks_mapping))if(t in this.processor.image_processor){h=this.processor.image_processor[t].bind(this.processor.image_processor),o=e;break}}let g=this.model.config.id2label,_=[];if(!o){let e=m[p[0]];for(let t=0;te<-1e-5||e>1.00001)&&r.sigmoid_();let i=await d.RawImage.fromTensor(r.mul_(255).to(`uint8`)).resize(n[1],n[0]);_.push({label:null,score:null,mask:i})}}else if(o===`panoptic`||o===`instance`){let e=h(m,t,n,r,i,a??c)[0],o=e.segmentation;for(let t of e.segments_info){let e=new Uint8ClampedArray(o.data.length);for(let n=0;n{let n=e.clone();return n.putAlpha(r[t].mask),n})}}class F extends h{constructor(e){super(e)}async _call(e,t,{hypothesis_template:n=`This is a photo of {}`}={}){let r=Array.isArray(e),i=await f(e),a=t.map(e=>n.replace(`{}`,e)),o=this.tokenizer(a,{padding:this.model.config.model_type===`siglip`?`max_length`:!0,truncation:!0}),{pixel_values:s}=await this.processor(i),l=await this.model({...o,pixel_values:s}),u=this.model.config.model_type===`siglip`?e=>e.sigmoid().data:e=>(0,c.softmax)(e.data),d=[];for(let e of l.logits_per_image){let n=[...u(e)].map((e,n)=>({score:e,label:t[n]}));n.sort((e,t)=>t.score-e.score),d.push(n)}return r?d:d[0]}}class I extends h{constructor(e){super(e)}async _call(e,{threshold:t=.9,percentage:n=!1}={}){let r=Array.isArray(e);if(r&&e.length!==1)throw Error(`Object detection pipeline currently only supports a batch size of 1.`);let i=await f(e),a=n?null:i.map(e=>[e.height,e.width]),{pixel_values:o,pixel_mask:s}=await this.processor(i),c=await this.model({pixel_values:o,pixel_mask:s}),l=this.processor.image_processor.post_process_object_detection(c,t,a),u=this.model.config.id2label,d=l.map(e=>e.boxes.map((t,r)=>({score:e.scores[r],label:u[e.classes[r]],box:m(t,!n)})));return r?d:d[0]}}class L extends h{constructor(e){super(e)}async _call(e,t,{threshold:n=.1,top_k:r=null,percentage:i=!1}={}){let a=Array.isArray(e),o=await f(e),s=this.tokenizer(t,{padding:!0,truncation:!0}),c=await this.processor(o),l=[];for(let e=0;e({score:e.scores[n],label:e.labels[n],box:m(t,!i)}))}else{let e=this.processor.image_processor.post_process_object_detection(f,n,u,!0)[0];p=e.boxes.map((n,r)=>({score:e.scores[r],label:t[e.classes[r]],box:m(n,!i)}))}p.sort((e,t)=>t.score-e.score),r!==null&&(p=p.slice(0,r)),l.push(p)}return a?l:l[0]}}class ee extends h{constructor(e){super(e)}async _call(e,t,n={}){let r=(await f(e))[0],{pixel_values:i}=await this.processor(r),a=`${t}`,o=this.tokenizer(a,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,s=await this.model.generate({inputs:i,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:o,...n}),c=this.tokenizer.batch_decode(s)[0].match(/(.*?)<\/s_answer>/),l=null;return c&&c.length>=2&&(l=c[1].trim()),[{answer:l}]}}class te extends h{DEFAULT_VOCODER_ID=`Xenova/speecht5_hifigan`;constructor(e){super(e),this.vocoder=e.vocoder??null}async _prepare_speaker_embeddings(e){if((typeof e==`string`||e instanceof URL)&&(e=new Float32Array(await(await fetch(e)).arrayBuffer())),e instanceof Float32Array)e=new u.Tensor(`float32`,e,[e.length]);else if(!(e instanceof u.Tensor))throw Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");return e}async _call(e,{speaker_embeddings:t=null,num_inference_steps:n,speed:r}={}){return this.processor?this._call_text_to_spectrogram(e,{speaker_embeddings:t}):this.model.config.model_type===`supertonic`?this._call_supertonic(e,{speaker_embeddings:t,num_inference_steps:n,speed:r}):this._call_text_to_waveform(e)}async _call_supertonic(e,{speaker_embeddings:t,num_inference_steps:n,speed:r}){if(!t)throw Error(`Speaker embeddings must be provided for Supertonic models.`);t=await this._prepare_speaker_embeddings(t);let{sampling_rate:i,style_dim:a}=this.model.config;t=t.view(1,-1,a);let o=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:s}=await this.model.generate_speech({...o,style:t,num_inference_steps:n,speed:r});return new l.RawAudio(s.data,i)}async _call_text_to_waveform(e){let t=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:n}=await this.model(t),r=this.model.config.sampling_rate;return new l.RawAudio(n.data,r)}async _call_text_to_spectrogram(e,{speaker_embeddings:t}){this.vocoder||=(console.log(`No vocoder specified, using default HifiGan vocoder.`),await i.AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID,{dtype:`fp32`}));let{input_ids:n}=this.tokenizer(e,{padding:!0,truncation:!0});t=await this._prepare_speaker_embeddings(t),t=t.view(1,-1);let{waveform:r}=await this.model.generate_speech(n,t,{vocoder:this.vocoder}),a=this.processor.feature_extractor.config.sampling_rate;return new l.RawAudio(r.data,a)}}class R extends h{constructor(e){super(e)}async _call(e){let t=await f(e),n=await this.processor(t),r=await this.model(n),i=[];for(let e of r.reconstruction){let t=e.squeeze().clamp_(0,1).mul_(255).round_().to(`uint8`);i.push(d.RawImage.fromTensor(t))}return i.length>1?i:i[0]}}class ne extends h{constructor(e){super(e)}async _call(e){let t=await f(e),n=await this.processor(t),{predicted_depth:r}=await this.model(n),i=[];for(let e=0;e1?i:i[0]}}let re=Object.freeze({"text-classification":{tokenizer:r.AutoTokenizer,pipeline:g,model:i.AutoModelForSequenceClassification,default:{model:`Xenova/distilbert-base-uncased-finetuned-sst-2-english`},type:`text`},"token-classification":{tokenizer:r.AutoTokenizer,pipeline:_,model:i.AutoModelForTokenClassification,default:{model:`Xenova/bert-base-multilingual-cased-ner-hrl`},type:`text`},"question-answering":{tokenizer:r.AutoTokenizer,pipeline:v,model:i.AutoModelForQuestionAnswering,default:{model:`Xenova/distilbert-base-cased-distilled-squad`},type:`text`},"fill-mask":{tokenizer:r.AutoTokenizer,pipeline:y,model:i.AutoModelForMaskedLM,default:{model:`Xenova/bert-base-uncased`},type:`text`},summarization:{tokenizer:r.AutoTokenizer,pipeline:x,model:i.AutoModelForSeq2SeqLM,default:{model:`Xenova/distilbart-cnn-6-6`},type:`text`},translation:{tokenizer:r.AutoTokenizer,pipeline:S,model:i.AutoModelForSeq2SeqLM,default:{model:`Xenova/t5-small`},type:`text`},"text2text-generation":{tokenizer:r.AutoTokenizer,pipeline:b,model:i.AutoModelForSeq2SeqLM,default:{model:`Xenova/flan-t5-small`},type:`text`},"text-generation":{tokenizer:r.AutoTokenizer,pipeline:w,model:i.AutoModelForCausalLM,default:{model:`Xenova/gpt2`},type:`text`},"zero-shot-classification":{tokenizer:r.AutoTokenizer,pipeline:T,model:i.AutoModelForSequenceClassification,default:{model:`Xenova/distilbert-base-uncased-mnli`},type:`text`},"audio-classification":{pipeline:O,model:i.AutoModelForAudioClassification,processor:a.AutoProcessor,default:{model:`Xenova/wav2vec2-base-superb-ks`},type:`audio`},"zero-shot-audio-classification":{tokenizer:r.AutoTokenizer,pipeline:k,model:i.AutoModel,processor:a.AutoProcessor,default:{model:`Xenova/clap-htsat-unfused`},type:`multimodal`},"automatic-speech-recognition":{tokenizer:r.AutoTokenizer,pipeline:A,model:[i.AutoModelForSpeechSeq2Seq,i.AutoModelForCTC],processor:a.AutoProcessor,default:{model:`Xenova/whisper-tiny.en`},type:`multimodal`},"text-to-audio":{tokenizer:r.AutoTokenizer,pipeline:te,model:[i.AutoModelForTextToWaveform,i.AutoModelForTextToSpectrogram],processor:[a.AutoProcessor,null],default:{model:`Xenova/speecht5_tts`},type:`text`},"image-to-text":{tokenizer:r.AutoTokenizer,pipeline:j,model:i.AutoModelForVision2Seq,processor:a.AutoProcessor,default:{model:`Xenova/vit-gpt2-image-captioning`},type:`multimodal`},"image-classification":{pipeline:M,model:i.AutoModelForImageClassification,processor:a.AutoProcessor,default:{model:`Xenova/vit-base-patch16-224`},type:`multimodal`},"image-segmentation":{pipeline:N,model:[i.AutoModelForImageSegmentation,i.AutoModelForSemanticSegmentation,i.AutoModelForUniversalSegmentation],processor:a.AutoProcessor,default:{model:`Xenova/detr-resnet-50-panoptic`},type:`multimodal`},"background-removal":{pipeline:P,model:[i.AutoModelForImageSegmentation,i.AutoModelForSemanticSegmentation,i.AutoModelForUniversalSegmentation],processor:a.AutoProcessor,default:{model:`Xenova/modnet`},type:`image`},"zero-shot-image-classification":{tokenizer:r.AutoTokenizer,pipeline:F,model:i.AutoModel,processor:a.AutoProcessor,default:{model:`Xenova/clip-vit-base-patch32`},type:`multimodal`},"object-detection":{pipeline:I,model:i.AutoModelForObjectDetection,processor:a.AutoProcessor,default:{model:`Xenova/detr-resnet-50`},type:`multimodal`},"zero-shot-object-detection":{tokenizer:r.AutoTokenizer,pipeline:L,model:i.AutoModelForZeroShotObjectDetection,processor:a.AutoProcessor,default:{model:`Xenova/owlvit-base-patch32`},type:`multimodal`},"document-question-answering":{tokenizer:r.AutoTokenizer,pipeline:ee,model:i.AutoModelForDocumentQuestionAnswering,processor:a.AutoProcessor,default:{model:`Xenova/donut-base-finetuned-docvqa`},type:`multimodal`},"image-to-image":{pipeline:R,model:i.AutoModelForImageToImage,processor:a.AutoProcessor,default:{model:`Xenova/swin2SR-classical-sr-x2-64`},type:`image`},"depth-estimation":{pipeline:ne,model:i.AutoModelForDepthEstimation,processor:a.AutoProcessor,default:{model:`Xenova/dpt-large`},type:`image`},"feature-extraction":{tokenizer:r.AutoTokenizer,pipeline:E,model:i.AutoModel,default:{model:`Xenova/all-MiniLM-L6-v2`},type:`text`},"image-feature-extraction":{processor:a.AutoProcessor,pipeline:D,model:[i.AutoModelForImageFeatureExtraction,i.AutoModel],default:{model:`Xenova/vit-base-patch16-224-in21k`},type:`image`}}),ie=Object.freeze({"sentiment-analysis":`text-classification`,ner:`token-classification`,asr:`automatic-speech-recognition`,"text-to-speech":`text-to-audio`,embeddings:`feature-extraction`});async function ae(e,t=null,{progress_callback:n=null,config:r=null,cache_dir:i=null,local_files_only:a=!1,revision:o=`main`,device:c=null,dtype:l=null,subfolder:u=`onnx`,use_external_data_format:d=null,model_file_name:f=null,session_options:p={}}={}){e=ie[e]??e;let m=re[e.split(`_`,1)[0]];if(!m)throw Error(`Unsupported pipeline: ${e}. Must be one of [${Object.keys(re)}]`);t||(t=m.default.model,console.log(`No model specified. Using default model: "${t}".`));let h={progress_callback:n,config:r,cache_dir:i,local_files_only:a,revision:o,device:c,dtype:l,subfolder:u,use_external_data_format:d,model_file_name:f,session_options:p},g=await z(new Map([[`tokenizer`,m.tokenizer],[`model`,m.model],[`processor`,m.processor]]),t,h);g.task=e,(0,s.dispatchCallback)(n,{status:`ready`,task:e,model:t});let _=m.pipeline;return new _(g)}async function z(e,t,n){let r=Object.create(null),i=[];for(let[a,o]of e.entries()){if(!o)continue;let e;e=Array.isArray(o)?new Promise(async(e,r)=>{let i;for(let a of o){if(a===null){e(null);return}try{e(await a.from_pretrained(t,n));return}catch(e){if(e.message?.includes(`Unsupported model type`))i=e;else if(e.message?.includes(`Could not locate file`))i=e;else{r(e);return}}}r(i)}):o.from_pretrained(t,n),r[a]=e,i.push(e)}await Promise.all(i);for(let[e,t]of Object.entries(r))r[e]=await t;return r}}),"./src/tokenizers.js":((e,t,n)=>{ +/*!***************************!*\ +!*** ./src/tokenizers.js ***! +\***************************/ +n.r(t),n.d(t,{AlbertTokenizer:()=>Ve,AutoTokenizer:()=>Mt,BartTokenizer:()=>tt,BertTokenizer:()=>Be,BlenderbotSmallTokenizer:()=>Et,BlenderbotTokenizer:()=>Tt,BloomTokenizer:()=>at,CLIPTokenizer:()=>xt,CamembertTokenizer:()=>Xe,CodeGenTokenizer:()=>bt,CodeLlamaTokenizer:()=>st,CohereTokenizer:()=>At,ConvBertTokenizer:()=>qe,DebertaTokenizer:()=>We,DebertaV2Tokenizer:()=>Ge,DistilBertTokenizer:()=>Ye,ElectraTokenizer:()=>Qe,EsmTokenizer:()=>ft,FalconTokenizer:()=>ut,GPT2Tokenizer:()=>et,GPTNeoXTokenizer:()=>dt,GemmaTokenizer:()=>mt,Grok1Tokenizer:()=>ht,HerbertTokenizer:()=>Ke,LlamaTokenizer:()=>ot,M2M100Tokenizer:()=>vt,MBart50Tokenizer:()=>rt,MBartTokenizer:()=>nt,MPNetTokenizer:()=>lt,MarianTokenizer:()=>Ct,MgpstrTokenizer:()=>jt,MobileBertTokenizer:()=>He,NllbTokenizer:()=>_t,NougatTokenizer:()=>Ot,PreTrainedTokenizer:()=>ze,Qwen2Tokenizer:()=>pt,RoFormerTokenizer:()=>Je,RobertaTokenizer:()=>it,SiglipTokenizer:()=>St,SpeechT5Tokenizer:()=>Dt,SqueezeBertTokenizer:()=>Ue,T5Tokenizer:()=>$e,TokenizerModel:()=>D,VitsTokenizer:()=>kt,Wav2Vec2CTCTokenizer:()=>wt,WhisperTokenizer:()=>yt,XLMRobertaTokenizer:()=>ct,XLMTokenizer:()=>Ze,is_chinese_char:()=>y});var r=n( +/*! ./utils/generic.js */ +`./src/utils/generic.js`),i=n( +/*! ./utils/core.js */ +`./src/utils/core.js`),a=n( +/*! ./utils/hub.js */ +`./src/utils/hub.js`),o=n( +/*! ./utils/maths.js */ +`./src/utils/maths.js`),s=n( +/*! ./utils/tensor.js */ +`./src/utils/tensor.js`),c=n( +/*! ./utils/data-structures.js */ +`./src/utils/data-structures.js`),l=n( +/*! @huggingface/jinja */ +`./node_modules/@huggingface/jinja/dist/index.js`),u=n( +/*! ./models/whisper/common_whisper.js */ +`./src/models/whisper/common_whisper.js`);async function d(e,t){let n=await Promise.all([(0,a.getModelJSON)(e,`tokenizer.json`,!0,t),(0,a.getModelJSON)(e,`tokenizer_config.json`,!0,t)]);return t.legacy!==null&&(n[1].legacy=t.legacy),n}function f(e,t){let n=[],r=0;for(let i of e.matchAll(t)){let t=i[0];r0&&n.push(t),r=i.index+t.length}return r=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103}function b(e,t,n){let r=[],i=0;for(;ithis.tokens_to_ids.get(e)??this.unk_token_id)}convert_ids_to_tokens(e){return e.map(e=>this.vocab[e]??this.unk_token)}}class O extends D{constructor(e){super(e),this.tokens_to_ids=m(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.max_input_chars_per_word=e.max_input_chars_per_word??100,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){let t=[];for(let n of e){let e=[...n];if(e.length>this.max_input_chars_per_word){t.push(this.unk_token);continue}let r=!1,i=0,a=[];for(;i0&&(r=this.config.continuing_subword_prefix+r),this.tokens_to_ids.has(r)){n=r;break}--t}if(n===null){r=!0;break}a.push(n),i=t}r?t.push(this.unk_token):t.push(...a)}return t}}class k extends D{constructor(e,t){super(e);let n=e.vocab.length;this.vocab=Array(n),this.scores=Array(n);for(let t=0;t[e,t])),this.bos_token=` `,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.unk_token=this.vocab[this.unk_token_id],this.minScore=(0,o.min)(this.scores)[0],this.unk_score=this.minScore-10,this.scores[this.unk_token_id]=this.unk_score,this.trie=new c.CharTrie,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(e){let t=e.chars,n=0;for(;n{let e=[...Array.from({length:94},(e,t)=>t+33),...Array.from({length:12},(e,t)=>t+161),...Array.from({length:82},(e,t)=>t+174)],t=e.slice(),n=0;for(let r=0;r<256;++r)e.includes(r)||(e.push(r),t.push(256+n),n+=1);let r=t.map(e=>String.fromCharCode(e));return Object.fromEntries(e.map((e,t)=>[e,r[t]]))})(),j=(0,i.reverseDictionary)(A);class M extends D{constructor(e){super(e),this.tokens_to_ids=m(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e;let t=Array.isArray(e.merges[0]);this.merges=t?e.merges:e.merges.map(e=>e.split(` `,2)),this.bpe_ranks=new Map(this.merges.map((e,t)=>[JSON.stringify(e),t])),this.end_of_word_suffix=e.end_of_word_suffix,this.continuing_subword_suffix=e.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.max_length_to_cache=256,this.cache_capacity=1e4,this.cache=new c.LRUCache(this.cache_capacity)}clear_cache(){this.cache.clear()}bpe(e){if(e.length===0)return[];let t=this.cache.get(e);if(t!==void 0)return t;let n=Array.from(e);this.end_of_word_suffix&&(n[n.length-1]+=this.end_of_word_suffix);let r=[];if(n.length>1){let e=new c.PriorityQueue((e,t)=>e.score`<0x${e.toString(16).toUpperCase().padStart(2,`0`)}>`);e.every(e=>this.tokens_to_ids.has(e))?t.push(...e):t.push(this.unk_token)}else t.push(this.unk_token)}return t}}class N extends D{constructor(e,t){super(e),this.tokens_to_ids=m(t.target_lang?e.vocab[t.target_lang]:e.vocab),this.bos_token=t.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=t.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=t.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=Array(this.tokens_to_ids.size);for(let[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){return e}}class P extends r.Callable{constructor(e){super(),this.config=e}static fromConfig(e){if(e===null)return null;switch(e.type){case`BertNormalizer`:return new oe(e);case`Precompiled`:return new Ae(e);case`Sequence`:return new z(e);case`Replace`:return new F(e);case`NFC`:return new L(e);case`NFD`:return new ee(e);case`NFKC`:return new te(e);case`NFKD`:return new R(e);case`Strip`:return new ne(e);case`StripAccents`:return new re(e);case`Lowercase`:return new ie(e);case`Prepend`:return new ae(e);default:throw Error(`Unknown Normalizer type: ${e.type}`)}}normalize(e){throw Error(`normalize should be implemented in subclass.`)}_call(e){return this.normalize(e)}}class F extends P{normalize(e){let t=p(this.config.pattern);return t===null?e:e.replaceAll(t,this.config.content)}}class I extends P{form=void 0;normalize(e){return e=e.normalize(this.form),e}}class L extends I{form=`NFC`}class ee extends I{form=`NFD`}class te extends I{form=`NFKC`}class R extends I{form=`NFKD`}class ne extends P{normalize(e){return this.config.strip_left&&this.config.strip_right?e=e.trim():(this.config.strip_left&&(e=e.trimStart()),this.config.strip_right&&(e=e.trimEnd())),e}}class re extends P{normalize(e){return e=_(e),e}}class ie extends P{normalize(e){return e=e.toLowerCase(),e}}class ae extends P{normalize(e){return e=this.config.prepend+e,e}}class z extends P{constructor(e){super(e),this.normalizers=e.normalizers.map(e=>P.fromConfig(e))}normalize(e){return this.normalizers.reduce((e,t)=>t.normalize(e),e)}}class oe extends P{_tokenize_chinese_chars(e){let t=[];for(let n=0;nthis.pre_tokenize_text(e,t)):this.pre_tokenize_text(e,t)).flat()}_call(e,t){return this.pre_tokenize(e,t)}}class B extends se{constructor(e){super(),this.pattern=RegExp(`[^\\s${S}]+|[${S}]`,`gu`)}pre_tokenize_text(e,t){return e.trim().match(this.pattern)||[]}}class ce extends se{constructor(e){super(),this.config=e,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=A,this.text_encoder=new TextEncoder}pre_tokenize_text(e,t){return this.add_prefix_space&&!e.startsWith(` `)&&(e=` `+e),(this.use_regex?e.match(this.pattern)||[]:[e]).map(e=>Array.from(this.text_encoder.encode(e),e=>this.byte_encoder[e]).join(``))}}class le extends se{constructor(e){super(),this.config=e,this.pattern=p(this.config.pattern,this.config.invert)}pre_tokenize_text(e,t){return this.pattern===null?[]:this.config.invert?e.match(this.pattern)||[]:this.config.behavior?.toLowerCase()===`removed`?e.split(this.pattern).filter(e=>e):f(e,this.pattern)}}class ue extends se{constructor(e){super(),this.config=e,this.pattern=RegExp(`[^${S}]+|[${S}]+`,`gu`)}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class de extends se{constructor(e){super(),this.config=e;let t=`[^\\d]+|\\d${this.config.individual_digits?``:`+`}`;this.pattern=new RegExp(t,`gu`)}pre_tokenize_text(e,t){return e.match(this.pattern)||[]}}class fe extends r.Callable{constructor(e){super(),this.config=e}static fromConfig(e){if(e===null)return null;switch(e.type){case`TemplateProcessing`:return new V(e);case`ByteLevel`:return new he(e);case`RobertaProcessing`:return new me(e);case`BertProcessing`:return new pe(e);case`Sequence`:return new ge(e);default:throw Error(`Unknown PostProcessor type: ${e.type}`)}}post_process(e,...t){throw Error(`post_process should be implemented in subclass.`)}_call(e,...t){return this.post_process(e,...t)}}class pe extends fe{constructor(e){super(e),this.cls=e.cls[0],this.sep=e.sep[0]}post_process(e,t=null,{add_special_tokens:n=!0}={}){n&&(e=(0,i.mergeArrays)([this.cls],e,[this.sep]));let r=Array(e.length).fill(0);if(t!==null){let a=n&&this instanceof me?[this.sep]:[],o=n?[this.sep]:[];e=(0,i.mergeArrays)(e,a,t,o),r=(0,i.mergeArrays)(r,Array(t.length+a.length+o.length).fill(1))}return{tokens:e,token_type_ids:r}}}class me extends pe{}class V extends fe{constructor(e){super(e),this.single=e.single,this.pair=e.pair}post_process(e,t=null,{add_special_tokens:n=!0}={}){let r=t===null?this.single:this.pair,a=[],o=[];for(let s of r)`SpecialToken`in s?n&&(a.push(s.SpecialToken.id),o.push(s.SpecialToken.type_id)):`Sequence`in s&&(s.Sequence.id===`A`?(a=(0,i.mergeArrays)(a,e),o=(0,i.mergeArrays)(o,Array(e.length).fill(s.Sequence.type_id))):s.Sequence.id===`B`&&(a=(0,i.mergeArrays)(a,t),o=(0,i.mergeArrays)(o,Array(t.length).fill(s.Sequence.type_id))));return{tokens:a,token_type_ids:o}}}class he extends fe{post_process(e,t=null){return t&&(e=(0,i.mergeArrays)(e,t)),{tokens:e}}}class ge extends fe{constructor(e){super(e),this.processors=e.processors.map(e=>fe.fromConfig(e))}post_process(e,t=null,n={}){let r;for(let i of this.processors)if(i instanceof he)e=i.post_process(e).tokens,t&&=i.post_process(t).tokens;else{let a=i.post_process(e,t,n);e=a.tokens,r=a.token_type_ids}return{tokens:e,token_type_ids:r}}}class _e extends r.Callable{constructor(e){super(),this.config=e,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=e.trim_offsets}static fromConfig(e){if(e===null)return null;switch(e.type){case`WordPiece`:return new Se(e);case`Metaspace`:return new ke(e);case`ByteLevel`:return new Ce(e);case`Replace`:return new ve(e);case`ByteFallback`:return new ye(e);case`Fuse`:return new be(e);case`Strip`:return new xe(e);case`Sequence`:return new Te(e);case`CTC`:return new we(e);case`BPEDecoder`:return new Ee(e);default:throw Error(`Unknown Decoder type: ${e.type}`)}}_call(e){return this.decode(e)}decode(e){return this.decode_chain(e).join(``)}decode_chain(e){throw Error("`decode_chain` should be implemented in subclass.")}}class ve extends _e{decode_chain(e){let t=p(this.config.pattern);return t===null?e:e.map(e=>e.replaceAll(t,this.config.content))}}class ye extends _e{constructor(e){super(e),this.text_decoder=new TextDecoder}decode_chain(e){let t=[],n=[];for(let r of e){let e=null;if(r.length===6&&r.startsWith(`<0x`)&&r.endsWith(`>`)){let t=parseInt(r.slice(3,5),16);isNaN(t)||(e=t)}if(e!==null)n.push(e);else{if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}t.push(r)}}if(n.length>0){let e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}return t}}class be extends _e{decode_chain(e){return[e.join(``)]}}class xe extends _e{constructor(e){super(e),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(e){return e.map(e=>{let t=0;for(let n=0;n(t!==0&&(e=e.startsWith(this.config.prefix)?e.replace(this.config.prefix,``):` `+e),this.cleanup&&(e=g(e)),e))}}class Ce extends _e{constructor(e){super(e),this.byte_decoder=j,this.text_decoder=new TextDecoder(`utf-8`,{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(e){let t=e.join(``),n=new Uint8Array([...t].map(e=>this.byte_decoder[e]));return this.text_decoder.decode(n)}decode_chain(e){let t=[],n=[];for(let r of e)this.added_tokens.find(e=>e.content===r)===void 0?n.push(r):(n.length>0&&(t.push(this.convert_tokens_to_string(n)),n=[]),t.push(r));return n.length>0&&t.push(this.convert_tokens_to_string(n)),t}}class we extends _e{constructor(e){super(e),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(e){if(e.length===0)return``;let t=[e[0]];for(let n=1;ne!==this.pad_token).join(``);return this.cleanup&&(n=g(n).replaceAll(this.word_delimiter_token,` `).trim()),n}decode_chain(e){return[this.convert_tokens_to_string(e)]}}class Te extends _e{constructor(e){super(e),this.decoders=e.decoders.map(e=>_e.fromConfig(e))}decode_chain(e){return this.decoders.reduce((e,t)=>t.decode_chain(e),e)}}class Ee extends _e{constructor(e){super(e),this.suffix=this.config.suffix}decode_chain(e){return e.map((t,n)=>t.replaceAll(this.suffix,n===e.length-1?``:` `))}}class De extends _e{decode_chain(e){let t=``;for(let n=1;ne.normalize(`NFKC`)).join(`~`):e.normalize(`NFKC`),e}}class je extends se{constructor(e){super(),this.tokenizers=e.pretokenizers.map(e=>se.fromConfig(e))}pre_tokenize_text(e,t){return this.tokenizers.reduce((e,n)=>n.pre_tokenize(e,t),[e])}}class Me extends se{constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\w+|[^\w\s]+/g)||[]}}class Ne extends se{constructor(e){super()}pre_tokenize_text(e,t){return x(e)}}class Pe extends se{constructor(e){super(),this.config=e,this.pattern=p(this.config.pattern),this.content=this.config.content}pre_tokenize_text(e,t){return this.pattern===null?[e]:[e.replaceAll(this.pattern,this.config.content)]}}class Fe extends se{constructor(e){super(),this._length=e.length}pre_tokenize_text(e,t){let n=[];for(let t=0;te.content)),this.added_tokens_map=new Map(this.added_tokens.map(e=>[e.content,e])),this.mask_token=this.getToken(`mask_token`),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken(`pad_token`,`eos_token`),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken(`sep_token`),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken(`unk_token`),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.bos_token=this.getToken(`bos_token`),this.bos_token_id=this.model.tokens_to_ids.get(this.bos_token),this.eos_token=this.getToken(`eos_token`),this.eos_token_id=this.model.tokens_to_ids.get(this.eos_token),this.model_max_length=t.model_max_length,this.remove_space=t.remove_space,this.clean_up_tokenization_spaces=t.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=t.do_lowercase_and_remove_accent??!1,t.padding_side&&(this.padding_side=t.padding_side),this.add_bos_token=t.add_bos_token,this.add_eos_token=t.add_eos_token,this.legacy=!1,this.chat_template=t.chat_template??null,Array.isArray(this.chat_template)){let e=Object.create(null);for(let{name:t,template:n}of this.chat_template){if(typeof t!=`string`||typeof n!=`string`)throw Error(`Chat template must be a list of objects with "name" and "template" properties`);e[t]=n}this.chat_template=e}this._compiled_template_cache=new Map}getToken(...e){for(let t of e){let e=this.config[t];if(e)if(typeof e==`object`){if(e.__type===`AddedToken`)return e.content;throw Error(`Unknown token: ${e}`)}else return e}return null}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,legacy:o=null}={}){let s=await d(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,legacy:o});return new this(...s)}_call(e,{text_pair:t=null,add_special_tokens:n=!0,padding:r=!1,truncation:i=null,max_length:a=null,return_tensor:c=!0,return_token_type_ids:l=null}={}){let u=Array.isArray(e),d;if(u){if(e.length===0)throw Error(`text array must be non-empty`);if(t!==null){if(!Array.isArray(t))throw Error(`text_pair must also be an array`);if(e.length!==t.length)throw Error(`text and text_pair must have the same length`);d=e.map((e,r)=>this._encode_plus(e,{text_pair:t[r],add_special_tokens:n,return_token_type_ids:l}))}else d=e.map(e=>this._encode_plus(e,{add_special_tokens:n,return_token_type_ids:l}))}else{if(e==null)throw Error(`text may not be null or undefined`);if(Array.isArray(t))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");d=[this._encode_plus(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:l})]}if(a===null?a=this.model_max_length:i===null&&(r===!0?(console.warn("`max_length` is ignored when `padding: true` and there is no truncation strategy. To pad to max length, use `padding: 'max_length'`."),a=this.model_max_length):r===!1&&(console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation: true` to explicitly truncate examples to max length."),i=!0)),r===!0&&(a=Math.min((0,o.max)(d.map(e=>e.input_ids.length))[0],a??1/0)),a=Math.min(a,this.model_max_length??1/0),r||i)for(let e=0;ea?i&&Re(d[e],a):r&&Le(d[e],a,e=>e===`input_ids`?this.pad_token_id:0,this.padding_side);let f={};if(c){if(!(r&&i)&&d.some(e=>{for(let t of Object.keys(e))if(e[t].length!==d[0][t]?.length)return!0;return!1}))throw Error(`Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.`);let e=[d.length,d[0].input_ids.length];for(let t of Object.keys(d[0]))f[t]=new s.Tensor(`int64`,BigInt64Array.from(d.flatMap(e=>e[t]).map(BigInt)),e)}else{for(let e of Object.keys(d[0]))f[e]=d.map(t=>t[e]);if(!u)for(let e of Object.keys(f))f[e]=f[e][0]}return f}_encode_text(e){if(e===null)return null;let t=this.added_tokens_splitter.split(e);for(let e=0;e0&&(t[e-1]=t[e-1].trimEnd()),n.rstrip&&e{if(e.length===0)return[];if(this.added_tokens_map.has(e))return[e];if(this.remove_space===!0&&(e=e.trim().split(/\s+/).join(` `)),this.do_lowercase_and_remove_accent&&(e=v(e)),this.normalizer!==null&&(e=this.normalizer(e)),e.length===0)return[];let n=this.pre_tokenizer===null?[e]:this.pre_tokenizer(e,{section_index:t});return this.model(n)})}_encode_plus(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){let{tokens:i,token_type_ids:a}=this._tokenize_helper(e,{pair:t,add_special_tokens:n}),o=this.model.convert_tokens_to_ids(i),s={input_ids:o,attention_mask:Array(o.length).fill(1)};return(r??this.return_token_type_ids)&&a&&(s.token_type_ids=a),s}_tokenize_helper(e,{pair:t=null,add_special_tokens:n=!1}={}){let r=this._encode_text(e),a=this._encode_text(t);return this.post_processor?this.post_processor(r,a,{add_special_tokens:n}):{tokens:(0,i.mergeArrays)(r??[],a??[])}}tokenize(e,{pair:t=null,add_special_tokens:n=!1}={}){return this._tokenize_helper(e,{pair:t,add_special_tokens:n}).tokens}encode(e,{text_pair:t=null,add_special_tokens:n=!0,return_token_type_ids:r=null}={}){return this._encode_plus(e,{text_pair:t,add_special_tokens:n,return_token_type_ids:r}).input_ids}batch_decode(e,t={}){return e instanceof s.Tensor&&(e=e.tolist()),e.map(e=>this.decode(e,t))}decode(e,t={}){if(e instanceof s.Tensor&&(e=h(e)),!Array.isArray(e)||e.length===0||!(0,i.isIntegralNumber)(e[0]))throw Error(`token_ids must be a non-empty array of integers.`);return this.decode_single(e,t)}decode_single(e,{skip_special_tokens:t=!1,clean_up_tokenization_spaces:n=null}){let r=this.model.convert_ids_to_tokens(e);t&&(r=r.filter(e=>!this.special_tokens.includes(e)));let i=this.decoder?this.decoder(r):r.join(` `);return this.decoder&&this.decoder.end_of_word_suffix&&(i=i.replaceAll(this.decoder.end_of_word_suffix,` `),t&&(i=i.trim())),(n??this.clean_up_tokenization_spaces)&&(i=g(i)),i}get_chat_template({chat_template:e=null,tools:t=null}={}){if(this.chat_template&&typeof this.chat_template==`object`){let n=this.chat_template;if(e!==null&&Object.hasOwn(n,e))e=n[e];else if(e===null)if(t!==null&&`tool_use`in n)e=n.tool_use;else if(`default`in n)e=n.default;else throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(n).sort()}.`)}else if(e===null)if(this.chat_template)e=this.chat_template;else throw Error(`Cannot use apply_chat_template() because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co/docs/transformers/main/en/chat_templating`);return e}apply_chat_template(e,{tools:t=null,documents:n=null,chat_template:r=null,add_generation_prompt:i=!1,tokenize:a=!0,padding:o=!1,truncation:s=!1,max_length:c=null,return_tensor:u=!0,return_dict:d=!1,tokenizer_kwargs:f={},...p}={}){if(r=this.get_chat_template({chat_template:r,tools:t}),typeof r!=`string`)throw Error(`chat_template must be a string, but got ${typeof r}`);let m=this._compiled_template_cache.get(r);m===void 0&&(m=new l.Template(r),this._compiled_template_cache.set(r,m));let h=Object.create(null);for(let e of Ie){let t=this.getToken(e);t&&(h[e]=t)}let g=m.render({messages:e,add_generation_prompt:i,tools:t,documents:n,...h,...p});if(a){let e=this._call(g,{add_special_tokens:!1,padding:o,truncation:s,max_length:c,return_tensor:u,...f});return d?e:e.input_ids}return g}}class Be extends ze{return_token_type_ids=!0}class Ve extends ze{return_token_type_ids=!0}class He extends ze{return_token_type_ids=!0}class Ue extends ze{return_token_type_ids=!0}class We extends ze{return_token_type_ids=!0}class Ge extends ze{return_token_type_ids=!0}class Ke extends ze{return_token_type_ids=!0}class qe extends ze{return_token_type_ids=!0}class Je extends ze{return_token_type_ids=!0}class Ye extends ze{}class Xe extends ze{}class Ze extends ze{return_token_type_ids=!0;constructor(e,t){super(e,t),console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class Qe extends ze{return_token_type_ids=!0}class $e extends ze{}class et extends ze{}class tt extends ze{}class nt extends ze{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return gt(this,e,t,n)}}class rt extends nt{}class it extends ze{}class at extends ze{}class ot extends ze{padding_side=`left`;constructor(e,t){super(e,t),this.legacy=t.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new Oe({replacement:`▁`,prepend_scheme:`first`}))}_encode_text(e){if(e===null)return null;if(this.legacy||e.length===0)return super._encode_text(e);let t=super._encode_text(`▁`+e.replaceAll(`▁`,` `));return t.length>1&&t[0]===`▁`&&this.special_tokens.includes(t[1])&&(t=t.slice(1)),t}}class st extends ze{}class ct extends ze{}class lt extends ze{}class ut extends ze{}class dt extends ze{}class ft extends ze{}class pt extends ze{}class mt extends ze{}class ht extends ze{}function gt(e,t,n,r){if(!(`language_codes`in e)||!Array.isArray(e.language_codes))throw Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!(`languageRegex`in e)||!(e.languageRegex instanceof RegExp))throw Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!(`lang_to_token`in e)||typeof e.lang_to_token!=`function`)throw Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");let i=r.src_lang,a=r.tgt_lang;if(!e.language_codes.includes(a))throw Error(`Target language code "${a}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);if(i!==void 0){if(!e.language_codes.includes(i))throw Error(`Source language code "${i}" is not valid. Must be one of: {${e.language_codes.join(`, `)}}`);for(let t of e.post_processor.config.single)if(`SpecialToken`in t&&e.languageRegex.test(t.SpecialToken.id)){t.SpecialToken.id=e.lang_to_token(i);break}}return r.forced_bos_token_id=e.model.convert_tokens_to_ids([e.lang_to_token(a)])[0],e._call(t,n)}class _t extends ze{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return gt(this,e,t,n)}}class vt extends ze{constructor(e,t){super(e,t),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(e=>this.languageRegex.test(e)).map(e=>e.slice(2,-2)),this.lang_to_token=e=>`__${e}__`}_build_translation_inputs(e,t,n){return gt(this,e,t,n)}}class yt extends ze{get timestamp_begin(){return this.model.convert_tokens_to_ids([`<|notimestamps|>`])[0]+1}_decode_asr(e,{return_timestamps:t=!1,return_language:n=!1,time_precision:r=null,force_full_sequences:i=!0}={}){if(r===null)throw Error(`Must specify time_precision`);let a=null,s=t===`word`;function c(){return{language:a,timestamp:[null,null],text:``}}let l=[],d=c(),f=0,p=this.timestamp_begin,m=p+1500,h=[],g=[],_=!1,v=null,y=new Set(this.all_special_ids);for(let n of e){let e=n.tokens,i=s?n.token_timestamps:null,b=null,x=p;if(`stride`in n){let[t,i,a]=n.stride;if(f-=i,v=t-a,i&&(x=i/r+p),a)for(let t=e.length-1;t>=0;--t){let n=Number(e[t]);if(n>=p){if(b!==null&&(n-p)*r=p&&v<=m){let e=(v-p)*r+f,t=(0,o.round)(e,2);if(b!==null&&v>=b)_=!0;else if(_||h.length>0&&v0?(h.push(S),s&&g.push(w)):h.every(e=>e.length===0)&&(d=c(),h=[],S=[],g=[],w=[])}if(h.length>0){if(i&&t)throw Error(`Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.`);let[e,n]=this.findLongestCommonSequence(h,g),r=this.decode(e);d.text=r,s&&(d.words=this.collateWordTimestamps(e,n,a)),l.push(d)}let b=Object.create(null),x=l.map(e=>e.text).join(``);if(t||n){for(let e=0;e0,o=a?[]:null,s=a?t[0]:null;for(let c=1;ce===g[n]&&s[i+n]<=t[c][m+n]).length:p.filter((e,t)=>e===g[t]).length;let v=e/1e4,y=_/e+v;_>1&&y>u&&(u=y,d=[i,o,m,h])}let[p,m,h,g]=d,_=Math.floor((m+p)/2),v=Math.floor((g+h)/2);i.push(...n.slice(0,_)),n=l.slice(v),r=n.length,a&&(o.push(...s.slice(0,_)),s=t[c].slice(v))}return i.push(...n),a?(o.push(...s),[i,o]):[i,[]]}collateWordTimestamps(e,t,n){let[r,i,a]=this.combineTokensIntoWords(e,n),o=[];for(let e=0;e=r){let e=((t-r)*n).toFixed(2);i.push(`<|${e}|>`),i.push([])}else i[i.length-1].push(t);return i=i.map(e=>typeof e==`string`?e:super.decode(e,t)),i.join(``)}splitTokensOnUnicode(e){let t=this.decode(e,{decode_with_timestamps:!0}),n=[],r=[],i=[],a=[],o=[],s=0;for(let c=0;c=this.model.tokens_to_ids.get(`<|endoftext|>`),f=c.startsWith(` `),p=c.trim(),m=s.test(p);if(d||f||m||i.length===0)i.push(c),a.push(l),o.push(u);else{let e=i.length-1;i[e]+=c,a[e].push(...l),o[e].push(...u)}}return[i,a,o]}mergePunctuations(e,t,n,r,a){let o=structuredClone(e),s=structuredClone(t),c=structuredClone(n),l=o.length-2,u=o.length-1;for(;l>=0;)o[l].startsWith(` `)&&r.includes(o[l].trim())?(o[u]=o[l]+o[u],s[u]=(0,i.mergeArrays)(s[l],s[u]),c[u]=(0,i.mergeArrays)(c[l],c[u]),o[l]=``,s[l]=[],c[l]=[]):u=l,--l;for(l=0,u=1;ue),s.filter(e=>e.length>0),c.filter(e=>e.length>0)]}}class bt extends ze{}class xt extends ze{}class St extends ze{}class Ct extends ze{constructor(e,t){super(e,t),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(e=>this.languageRegex.test(e)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(e){if(e===null)return null;let[t,...n]=e.trim().split(this.languageRegex);if(n.length===0)return super._encode_text(t);if(n.length===2){let[e,t]=n;return this.supported_language_codes.includes(e)||console.warn(`Unsupported language code "${e}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,i.mergeArrays)([e],super._encode_text(t))}}}class wt extends ze{}class Tt extends ze{}class Et extends ze{}class Dt extends ze{}class Ot extends ze{}class kt extends ze{constructor(e,t){super(e,t),this.decoder=new De({})}}class At extends ze{}class jt extends ze{}class Mt{static TOKENIZER_CLASS_MAPPING={T5Tokenizer:$e,DistilBertTokenizer:Ye,CamembertTokenizer:Xe,DebertaTokenizer:We,DebertaV2Tokenizer:Ge,BertTokenizer:Be,HerbertTokenizer:Ke,ConvBertTokenizer:qe,RoFormerTokenizer:Je,XLMTokenizer:Ze,ElectraTokenizer:Qe,MobileBertTokenizer:He,SqueezeBertTokenizer:Ue,AlbertTokenizer:Ve,GPT2Tokenizer:et,BartTokenizer:tt,MBartTokenizer:nt,MBart50Tokenizer:rt,RobertaTokenizer:it,WhisperTokenizer:yt,CodeGenTokenizer:bt,CLIPTokenizer:xt,SiglipTokenizer:St,MarianTokenizer:Ct,BloomTokenizer:at,NllbTokenizer:_t,M2M100Tokenizer:vt,LlamaTokenizer:ot,CodeLlamaTokenizer:st,XLMRobertaTokenizer:ct,MPNetTokenizer:lt,FalconTokenizer:ut,GPTNeoXTokenizer:dt,EsmTokenizer:ft,Wav2Vec2CTCTokenizer:wt,BlenderbotTokenizer:Tt,BlenderbotSmallTokenizer:Et,SpeechT5Tokenizer:Dt,NougatTokenizer:Ot,VitsTokenizer:kt,Qwen2Tokenizer:pt,GemmaTokenizer:mt,Grok1Tokenizer:ht,CohereTokenizer:At,MgpstrTokenizer:jt,PreTrainedTokenizer:ze};static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:i=!1,revision:a=`main`,legacy:o=null}={}){let[s,c]=await d(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:i,revision:a,legacy:o}),l=c.tokenizer_class?.replace(/Fast$/,``)??`PreTrainedTokenizer`,u=this.TOKENIZER_CLASS_MAPPING[l];return u||=(console.warn(`Unknown tokenizer class "${l}", attempting to construct from base class.`),ze),new u(s,c)}}}),"./src/utils/audio.js":((e,t,n)=>{ +/*!****************************!*\ +!*** ./src/utils/audio.js ***! +\****************************/ +n.r(t),n.d(t,{RawAudio:()=>O,hamming:()=>f,hanning:()=>d,mel_filter_bank:()=>y,read_audio:()=>l,spectrogram:()=>w,window_function:()=>T});var r=n( +/*! ./hub.js */ +`./src/utils/hub.js`),i=n( +/*! ./maths.js */ +`./src/utils/maths.js`),a=n( +/*! ./core.js */ +`./src/utils/core.js`),o=n( +/*! ../env.js */ +`./src/env.js`),s=n( +/*! ./tensor.js */ +`./src/utils/tensor.js`),c=n( +/*! node:fs */ +`?7992`);async function l(e,t){if(typeof AudioContext>`u`)throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing.");let n=await(await(0,r.getFile)(e)).arrayBuffer(),i=new AudioContext({sampleRate:t});t===void 0&&console.warn(`No sampling rate provided, using default of ${i.sampleRate}Hz.`);let a=await i.decodeAudioData(n),o;if(a.numberOfChannels===2){let e=Math.sqrt(2),t=a.getChannelData(0),n=a.getChannelData(1);o=new Float32Array(t.length);for(let r=0;r2595*Math.log10(1+e/700),kaldi:e=>1127*Math.log(1+e/700),slaney:(e,t=1e3,n=15,r=27/Math.log(6.4))=>e>=t?n+Math.log(e/t)*r:3*e/200};function m(e,t=`htk`){let n=p[t];if(!n)throw Error(`mel_scale should be one of "htk", "slaney" or "kaldi".`);return typeof e==`number`?n(e):e.map(e=>n(e))}let h={htk:e=>700*(10**(e/2595)-1),kaldi:e=>700*(Math.exp(e/1127)-1),slaney:(e,t=1e3,n=15,r=Math.log(6.4)/27)=>e>=n?t*Math.exp(r*(e-n)):200*e/3};function g(e,t=`htk`){let n=h[t];if(!n)throw Error(`mel_scale should be one of "htk", "slaney" or "kaldi".`);return typeof e==`number`?n(e):e.map(e=>n(e))}function _(e,t){let n=Float64Array.from({length:t.length-1},(e,n)=>t[n+1]-t[n]),r=Array.from({length:e.length},()=>Array(t.length));for(let n=0;nArray(e.length));for(let t=0;te+r*n)}function y(e,t,n,r,i,a=null,o=`htk`,s=!1){if(a!==null&&a!==`slaney`)throw Error(`norm must be one of null or "slaney"`);if(e<2)throw Error(`Require num_frequency_bins: ${e} >= 2`);if(n>r)throw Error(`Require min_frequency: ${n} <= max_frequency: ${r}`);let c=v(m(n,o),m(r,o),t+2),l=g(c,o),u;if(s){let t=i/((e-1)*2);u=m(Float64Array.from({length:e},(e,n)=>n*t),o),l=c}else u=v(0,Math.floor(i/2),e);let d=_(u,l);if(a!==null&&a===`slaney`)for(let n=0;na)throw Error(`frame_length (${n}) may not be larger than fft_length (${a})`);if(O!==n)throw Error(`Length of the window (${O}) must equal frame_length (${n})`);if(r<=0)throw Error(`hop_length must be greater than zero`);if(o===null&&p!==null)throw Error("You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram. Specify `power` to fix this issue.");if(!f)throw Error("`preemphasis_htk_flavor=false` is not currently supported.");if(c)switch(l){case`reflect`:{let t=Math.floor((a-1)/2)+1;e=b(e,t,t);break}case`constant`:{let t=Math.floor(a/2),n=new e.constructor(e.length+2*t);n.set(e,t),e=n;break}default:throw Error(`pad_mode="${l}" not implemented yet.`)}let k=Math.floor(1+Math.floor((e.length-n)/r));x!==null&&kk?T&&(M=w):M=j=w);let N=new i.FFT(a),P=new Float64Array(a),F=new Float64Array(N.outputBufferSize),I=new Float32Array(A*M);for(let i=0;i=1;--e)P[e]-=d*P[e-1];P[0]*=1-d}for(let e=0;ee**.85);break;default:throw Error(`Unknown window type ${t}.`)}if(n&&(o=o.subarray(0,e)),r===null)return o;if(e>r)throw Error(`Length of the window (${e}) may not be larger than frame_length (${r})`);return o}function E(e,t){let n=44,r=new ArrayBuffer(n+e.length*4),i=new DataView(r);D(i,0,`RIFF`),i.setUint32(4,36+e.length*4,!0),D(i,8,`WAVE`),D(i,12,`fmt `),i.setUint32(16,16,!0),i.setUint16(20,3,!0),i.setUint16(22,1,!0),i.setUint32(24,t,!0),i.setUint32(28,t*4,!0),i.setUint16(32,4,!0),i.setUint16(34,32,!0),D(i,36,`data`),i.setUint32(40,e.length*4,!0);for(let t=0;t{let n=await t.arrayBuffer();c.writeFileSync(e,Buffer.from(n))};else throw Error(`Unable to save because filesystem is disabled in this environment.`);await t(e,this.toBlob())}}}),"./src/utils/constants.js":((e,t,n)=>{ +/*!********************************!*\ +!*** ./src/utils/constants.js ***! +\********************************/ +n.r(t),n.d(t,{CHAT_TEMPLATE_NAME:()=>c,CONFIG_NAME:()=>i,FEATURE_EXTRACTOR_NAME:()=>a,GENERATION_CONFIG_NAME:()=>l,GITHUB_ISSUE_URL:()=>r,IMAGE_PROCESSOR_NAME:()=>o,PROCESSOR_NAME:()=>s});let r=`https://github.com/huggingface/transformers.js/issues/new/choose`,i=`config.json`,a=`preprocessor_config.json`,o=a,s=`processor_config.json`,c=`chat_template.jinja`,l=`generation_config.json`}),"./src/utils/core.js":((e,t,n)=>{ +/*!***************************!*\ +!*** ./src/utils/core.js ***! +\***************************/ +n.r(t),n.d(t,{calculateDimensions:()=>l,calculateReflectOffset:()=>p,count:()=>_,dispatchCallback:()=>r,escapeRegExp:()=>a,isIntegralNumber:()=>s,isNullishDimension:()=>c,isTypedArray:()=>o,len:()=>g,mergeArrays:()=>d,pick:()=>h,pop:()=>u,product:()=>f,reverseDictionary:()=>i,saveBlob:()=>m});function r(e,t){e&&e(t)}function i(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[t,e]))}function a(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function o(e){return e?.prototype?.__proto__?.constructor?.name===`TypedArray`}function s(e){return Number.isInteger(e)||typeof e==`bigint`}function c(e){return e==null||e===-1}function l(e){let t=[],n=e;for(;Array.isArray(n);)t.push(n.length),n=n[0];return t}function u(e,t,n=void 0){let r=e[t];if(r!==void 0)return delete e[t],r;if(n===void 0)throw Error(`Key ${t} does not exist in object.`);return n}function d(...e){return Array.prototype.concat.apply([],e)}function f(...e){return e.reduce((e,t)=>e.flatMap(e=>t.map(t=>[e,t])))}function p(e,t){return Math.abs((e+t)%(2*t)-t)}function m(e,t){let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e,r.click(),r.remove(),URL.revokeObjectURL(n)}function h(e,t){return Object.assign({},...t.map(t=>{if(e[t]!==void 0)return{[t]:e[t]}}))}function g(e){let t=0;for(let n of e)++t;return t}function _(e,t){let n=0;for(let r of e)r===t&&++n;return n}}),"./src/utils/data-structures.js":((e,t,n)=>{ +/*!**************************************!*\ +!*** ./src/utils/data-structures.js ***! +\**************************************/ +n.r(t),n.d(t,{CharTrie:()=>i,DictionarySplitter:()=>c,LRUCache:()=>l,PriorityQueue:()=>r,TokenLattice:()=>o});class r{constructor(e=(e,t)=>e>t,t=1/0){this._heap=[],this._comparator=e,this._maxSize=t}get size(){return this._heap.length}isEmpty(){return this.size===0}peek(){return this._heap[0]}push(...e){return this.extend(e)}extend(e){for(let t of e)if(this.size0&&this._swap(0,t),this._heap.pop(),this._siftDown(),e}replace(e){let t=this.peek();return this._heap[0]=e,this._siftDown(),t}_parent(e){return(e+1>>>1)-1}_left(e){return(e<<1)+1}_right(e){return e+1<<1}_greater(e,t){return this._comparator(this._heap[e],this._heap[t])}_swap(e,t){let n=this._heap[e];this._heap[e]=this._heap[t],this._heap[t]=n}_siftUp(){this._siftUpFrom(this.size-1)}_siftUpFrom(e){for(;e>0&&this._greater(e,this._parent(e));)this._swap(e,this._parent(e)),e=this._parent(e)}_siftDown(){let e=0;for(;this._left(e)[]),this.endNodes=Array.from({length:this.len+1},()=>[]);let r=new s(this.bosTokenId,0,0,0,0),i=new s(this.eosTokenId,1,this.len,0,0);this.nodes.push(r.clone()),this.nodes.push(i.clone()),this.beginNodes[this.len].push(i),this.endNodes[0].push(r)}insert(e,t,n,r){let i=this.nodes.length,a=new s(r,i,e,t,n);this.beginNodes[e].push(a),this.endNodes[e+t].push(a),this.nodes.push(a)}viterbi(){let e=this.len,t=0;for(;t<=e;){if(this.beginNodes[t].length==0)return[];for(let e of this.beginNodes[t]){e.prev=null;let n=0,r=null;for(let i of this.endNodes[t]){let t=i.backtraceScore+e.score;(r===null||t>n)&&(r=i.clone(),n=t)}if(r!==null)e.prev=r,e.backtraceScore=n;else return[]}++t}let n=[],r=this.beginNodes[e][0].prev;if(r===null)return[];let i=r.clone();for(;i.prev!==null;)n.push(i.clone()),i=i.clone().prev.clone();return n.reverse(),n}piece(e){return this.chars.slice(e.pos,e.pos+e.length).join(``)}tokens(){return this.viterbi().map(e=>this.piece(e))}tokenIds(){return this.viterbi().map(e=>e.tokenId)}}class s{constructor(e,t,n,r,i){this.tokenId=e,this.nodeId=t,this.pos=n,this.length=r,this.score=i,this.prev=null,this.backtraceScore=0}clone(){let e=new s(this.tokenId,this.nodeId,this.pos,this.length,this.score);return e.prev=this.prev,e.backtraceScore=this.backtraceScore,e}}class c{constructor(e){this.trie=this._buildTrie(e)}_buildTrie(e){let t=Object.create(null);for(let n of e){let e=t;for(let t=0;tr&&t.push(e.slice(r,i)),t.push(o),i+=o.length,r=i):++i}return rthis.capacity&&this.cache.delete(this.cache.keys().next().value)}clear(){this.cache.clear()}}}),"./src/utils/devices.js":((e,t,n)=>{ +/*!******************************!*\ +!*** ./src/utils/devices.js ***! +\******************************/ +n.r(t),n.d(t,{DEVICE_TYPES:()=>r});let r=Object.freeze({auto:`auto`,gpu:`gpu`,cpu:`cpu`,wasm:`wasm`,webgpu:`webgpu`,cuda:`cuda`,dml:`dml`,webnn:`webnn`,"webnn-npu":`webnn-npu`,"webnn-gpu":`webnn-gpu`,"webnn-cpu":`webnn-cpu`})}),"./src/utils/dtypes.js":((e,t,n)=>{ +/*!*****************************!*\ +!*** ./src/utils/dtypes.js ***! +\*****************************/ +n.r(t),n.d(t,{DATA_TYPES:()=>o,DEFAULT_DEVICE_DTYPE_MAPPING:()=>s,DEFAULT_DTYPE_SUFFIX_MAPPING:()=>c,isWebGpuFp16Supported:()=>a});var r=n( +/*! ../env.js */ +`./src/env.js`),i=n( +/*! ./devices.js */ +`./src/utils/devices.js`);let a=(function(){let e;return async function(){if(e===void 0)if(!r.apis.IS_WEBGPU_AVAILABLE)e=!1;else try{e=(await navigator.gpu.requestAdapter()).features.has(`shader-f16`)}catch{e=!1}return e}})(),o=Object.freeze({auto:`auto`,fp32:`fp32`,fp16:`fp16`,q8:`q8`,int8:`int8`,uint8:`uint8`,q4:`q4`,bnb4:`bnb4`,q4f16:`q4f16`}),s=Object.freeze({[i.DEVICE_TYPES.wasm]:o.q8}),c=Object.freeze({[o.fp32]:``,[o.fp16]:`_fp16`,[o.int8]:`_int8`,[o.uint8]:`_uint8`,[o.q8]:`_quantized`,[o.q4]:`_q4`,[o.q4f16]:`_q4f16`,[o.bnb4]:`_bnb4`})}),"./src/utils/generic.js":((e,t,n)=>{ +/*!******************************!*\ +!*** ./src/utils/generic.js ***! +\******************************/ +n.r(t),n.d(t,{Callable:()=>r});let r=class{constructor(){let e=function(...t){return e._call(...t)};return Object.setPrototypeOf(e,new.target.prototype)}_call(...e){throw Error(`Must implement _call method in subclass`)}}}),"./src/utils/hub.js":((e,t,n)=>{ +/*!**************************!*\ +!*** ./src/utils/hub.js ***! +\**************************/ +n.r(t),n.d(t,{MAX_EXTERNAL_DATA_CHUNKS:()=>s,getFile:()=>p,getModelFile:()=>v,getModelJSON:()=>b,getModelText:()=>y});var r=n( +/*! node:fs */ +`?7992`),i=n( +/*! node:path */ +`?5af5`),a=n( +/*! ../env.js */ +`./src/env.js`),o=n( +/*! ./core.js */ +`./src/utils/core.js`);let s=100,c={txt:`text/plain`,html:`text/html`,css:`text/css`,js:`text/javascript`,json:`application/json`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`};class l{constructor(e){if(this.filePath=e,this.headers=new Headers,this.exists=r.existsSync(e),this.exists){this.status=200,this.statusText=`OK`;let t=r.statSync(e);this.headers.set(`content-length`,t.size.toString()),this.updateContentType();let n=r.createReadStream(e);this.body=new ReadableStream({start(e){n.on(`data`,t=>e.enqueue(t)),n.on(`end`,()=>e.close()),n.on(`error`,t=>e.error(t))},cancel(){n.destroy()}})}else this.status=404,this.statusText=`Not Found`,this.body=null}updateContentType(){let e=this.filePath.toString().split(`.`).pop().toLowerCase();this.headers.set(`content-type`,c[e]??`application/octet-stream`)}clone(){let e=new l(this.filePath);return e.exists=this.exists,e.status=this.status,e.statusText=this.statusText,e.headers=new Headers(this.headers),e}async arrayBuffer(){return(await r.promises.readFile(this.filePath)).buffer}async blob(){let e=await r.promises.readFile(this.filePath);return new Blob([e],{type:this.headers.get(`content-type`)})}async text(){return await r.promises.readFile(this.filePath,`utf8`)}async json(){return JSON.parse(await this.text())}}function u(e,t=null,n=null){let r;try{r=new URL(e)}catch{return!1}return!(t&&!t.includes(r.protocol)||n&&!n.includes(r.hostname))}let d=/^(\b[\w\-.]+\b\/)?\b[\w\-.]{1,96}\b$/;function f(e){return!(!d.test(e)||e.includes(`..`)||e.includes(`--`)||e.endsWith(`.git`)||e.endsWith(`.ipynb`))}async function p(e){if(a.env.useFS&&!u(e,[`http:`,`https:`,`blob:`]))return new l(e instanceof URL?e.protocol===`file:`?e.pathname:e.toString():e);if(typeof process<`u`&&process?.release?.name===`node`){let t=!!{}.TESTING_REMOTELY,n=a.env.version,r=new Headers;if(r.set(`User-Agent`,`transformers.js/${n}; is_ci/${t};`),u(e,[`http:`,`https:`],[`huggingface.co`,`hf.co`])){let e={}.HF_TOKEN??{}.HF_ACCESS_TOKEN;e&&r.set(`Authorization`,`Bearer ${e}`)}return fetch(e,{headers:r})}else return fetch(e)}let m={400:`Bad request error occurred while trying to load file`,401:`Unauthorized access to file`,403:`Forbidden access to file`,404:`Could not locate file`,408:`Request timeout error occurred while trying to load file`,500:`Internal server error error occurred while trying to load file`,502:`Bad gateway error occurred while trying to load file`,503:`Service unavailable error occurred while trying to load file`,504:`Gateway timeout error occurred while trying to load file`};function h(e,t,n){if(!n)return null;let r=m[e]??`Error (${e}) occurred while trying to load file`;throw Error(`${r}: "${t}".`)}class g{constructor(e){this.path=e}async match(e){let t=new l(i.join(this.path,e));if(t.exists)return t}async put(e,t,n=void 0){let a=i.join(this.path,e);try{let e=t.headers.get(`Content-Length`),o=parseInt(e??`0`),s=0;await r.promises.mkdir(i.dirname(a),{recursive:!0});let c=r.createWriteStream(a),l=t.body.getReader();for(;;){let{done:e,value:t}=await l.read();if(e)break;await new Promise((e,n)=>{c.write(t,t=>{if(t){n(t);return}e()})}),s+=t.length;let r=o?s/o*100:0;n?.({progress:r,loaded:s,total:o})}c.close()}catch(e){try{await r.promises.unlink(a)}catch{}throw e}}}async function _(e,...t){for(let n of t)try{let t=await e.match(n);if(t)return t}catch{continue}}async function v(e,t,n=!0,r={},i=!1){if(!a.env.allowLocalModels){if(r.local_files_only)throw Error("Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).");if(!a.env.allowRemoteModels)throw Error("Invalid configuration detected: both local and remote models are disabled. Fix by setting `env.allowLocalModels` or `env.allowRemoteModels` to `true`.")}(0,o.dispatchCallback)(r.progress_callback,{status:`initiate`,name:e,file:t});let s;if(!s&&a.env.useCustomCache){if(!a.env.customCache)throw Error("`env.useCustomCache=true`, but `env.customCache` is not defined.");if(!a.env.customCache.match||!a.env.customCache.put)throw Error("`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache");s=a.env.customCache}if(!s&&a.env.useBrowserCache){if(typeof caches>`u`)throw Error(`Browser cache is not available in this environment.`);try{s=await caches.open(`transformers-cache`)}catch(e){console.warn(`An error occurred while opening the browser cache:`,e)}}if(!s&&a.env.useFSCache){if(!a.apis.IS_FS_AVAILABLE)throw Error(`File System Cache is not available in this environment.`);s=new g(r.cache_dir??a.env.cacheDir)}let c=r.revision??`main`,d=S(e,t),m=f(e),v=m?S(a.env.localModelPath,d):d,y=S(a.env.remoteHost,a.env.remotePathTemplate.replaceAll(`{model}`,e).replaceAll(`{revision}`,encodeURIComponent(c)),t),b,C=s instanceof g?c===`main`?d:S(e,c,t):y,w=!1,T;s&&(T=await _(s,v,C));let E=T!==void 0;if(T===void 0){if(a.env.allowLocalModels){if(!u(d,[`http:`,`https:`]))try{T=await p(v),b=v}catch(e){console.warn(`Unable to load from local path "${v}": "${e}"`)}else if(r.local_files_only)throw Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${d}.`);else if(!a.env.allowRemoteModels)throw Error(`\`env.allowRemoteModels=false\`, but attempted to load a remote file from: ${d}.`)}if(T===void 0||T.status===404){if(r.local_files_only||!a.env.allowRemoteModels){if(n)throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${v}".`);return null}if(!m)throw Error(`Local file missing at "${v}" and download aborted due to invalid model ID "${e}".`);if(T=await p(y),T.status!==200)return h(T.status,y,n);b=C}w=s&&typeof Response<`u`&&T instanceof Response&&T.status===200}(0,o.dispatchCallback)(r.progress_callback,{status:`download`,name:e,file:t});let D;if(!(a.apis.IS_NODE_ENV&&i)){let n;r.progress_callback?E&&typeof navigator<`u`&&/firefox/i.test(navigator.userAgent)?(n=new Uint8Array(await T.arrayBuffer()),(0,o.dispatchCallback)(r.progress_callback,{status:`progress`,name:e,file:t,progress:100,loaded:n.length,total:n.length})):n=await x(T,n=>{(0,o.dispatchCallback)(r.progress_callback,{status:`progress`,name:e,file:t,...n})}):n=new Uint8Array(await T.arrayBuffer()),D=n}if(w&&b&&await s.match(b)===void 0)if(D)await s.put(b,new Response(D,{headers:T.headers})).catch(e=>{console.warn(`Unable to add response to browser cache: ${e}.`)});else{let n=r.progress_callback?n=>(0,o.dispatchCallback)(r.progress_callback,{status:`progress`,name:e,file:t,...n}):void 0;await s.put(b,T,n)}if((0,o.dispatchCallback)(r.progress_callback,{status:`done`,name:e,file:t}),D){if(!a.apis.IS_NODE_ENV&&i)throw Error(`Cannot return path in a browser environment.`);return D}if(T instanceof l)return T.filePath;let O=await s?.match(b);if(O instanceof l)return O.filePath;if(O instanceof Response)return new Uint8Array(await O.arrayBuffer());if(typeof O==`string`)return O;throw Error(`Unable to get model file path or buffer.`)}async function y(e,t,n=!0,r={}){let i=await v(e,t,n,r,!1);return i===null?null:new TextDecoder(`utf-8`).decode(i)}async function b(e,t,n=!0,r={}){let i=await y(e,t,n,r);return i===null?{}:JSON.parse(i)}async function x(e,t){let n=e.headers.get(`Content-Length`);n===null&&console.warn(`Unable to determine content-length from response headers. Will expand buffer when needed.`);let r=parseInt(n??`0`),i=new Uint8Array(r),a=0,o=e.body.getReader();async function s(){let{done:e,value:n}=await o.read();if(e)return;let c=a+n.length;if(c>r){r=c;let e=new Uint8Array(r);e.set(i),i=e}return i.set(n,a),a=c,t({progress:a/r*100,loaded:a,total:r}),s()}return await s(),i}function S(...e){return e=e.map((t,n)=>(n&&(t=t.replace(RegExp(`^/`),``)),n!==e.length-1&&(t=t.replace(RegExp(`/$`),``)),t)),e.join(`/`)}}),"./src/utils/image.js":((e,t,n)=>{ +/*!****************************!*\ +!*** ./src/utils/image.js ***! +\****************************/ +n.r(t),n.d(t,{RawImage:()=>m,load_image:()=>h});var r=n( +/*! ./core.js */ +`./src/utils/core.js`),i=n( +/*! ./hub.js */ +`./src/utils/hub.js`),a=n( +/*! ../env.js */ +`./src/env.js`),o=n( +/*! ./tensor.js */ +`./src/utils/tensor.js`),s=n( +/*! sharp */ +`?2b25`);let c,l,u,d=a.apis.IS_BROWSER_ENV||a.apis.IS_WEBWORKER_ENV;if(d)c=(e,t)=>{if(!self.OffscreenCanvas)throw Error(`OffscreenCanvas not supported by this browser.`);return new self.OffscreenCanvas(e,t)},u=self.createImageBitmap,l=self.ImageData;else if(s)u=async e=>{let t=(await e.metadata()).channels,{data:n,info:r}=await e.rotate().raw().toBuffer({resolveWithObject:!0}),i=new m(new Uint8ClampedArray(n),r.width,r.height,r.channels);return t!==void 0&&t!==r.channels&&i.convert(t),i};else throw Error(`Unable to load image processing library.`);let f={0:`nearest`,1:`lanczos`,2:`bilinear`,3:`bicubic`,4:`box`,5:`hamming`},p=new Map([[`png`,`image/png`],[`jpg`,`image/jpeg`],[`jpeg`,`image/jpeg`],[`gif`,`image/gif`]]);class m{constructor(e,t,n,r){this.data=e,this.width=t,this.height=n,this.channels=r}get size(){return[this.width,this.height]}static async read(e){if(e instanceof m)return e;if(typeof e==`string`||e instanceof URL)return await this.fromURL(e);if(e instanceof Blob)return await this.fromBlob(e);if(typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas)return this.fromCanvas(e);throw Error(`Unsupported input type: ${typeof e}`)}static fromCanvas(e){if(!d)throw Error(`fromCanvas() is only supported in browser environments.`);let t=e.getContext(`2d`).getImageData(0,0,e.width,e.height).data;return new m(t,e.width,e.height,4)}static async fromURL(e){let t=await(0,i.getFile)(e);if(t.status!==200)throw Error(`Unable to read image from "${e}" (${t.status} ${t.statusText})`);let n=await t.blob();return this.fromBlob(n)}static async fromBlob(e){if(d){let t=await u(e),n=c(t.width,t.height).getContext(`2d`);return n.drawImage(t,0,0),new this(n.getImageData(0,0,t.width,t.height).data,t.width,t.height,4)}else{let t=s(await e.arrayBuffer());return await u(t)}}static fromTensor(e,t=`CHW`){if(e.dims.length!==3)throw Error(`Tensor should have 3 dimensions, but has ${e.dims.length} dimensions.`);if(t===`CHW`)e=e.transpose(1,2,0);else if(t!==`HWC`)throw Error(`Unsupported channel format: ${t}`);if(!(e.data instanceof Uint8ClampedArray||e.data instanceof Uint8Array))throw Error(`Unsupported tensor type: ${e.type}`);switch(e.dims[2]){case 1:case 2:case 3:case 4:return new m(e.data,e.dims[1],e.dims[0],e.dims[2]);default:throw Error(`Unsupported number of channels: ${e.dims[2]}`)}}grayscale(){if(this.channels===1)return this;let e=new Uint8ClampedArray(this.width*this.height*1);switch(this.channels){case 3:case 4:for(let t=0,n=0;t=0?s=n:u=-n,r>=0?l=r:d=-r,o.drawImage(a,s,l,e,t,u,d,e,t),new m(o.getImageData(0,0,e,t).data,e,t,4).convert(i)}else{let i=this.toSharp();if(n>=0&&r>=0)i=i.extract({left:Math.floor(n),top:Math.floor(r),width:e,height:t});else if(n<=0&&r<=0){let a=Math.floor(-r),o=Math.floor(-n);i=i.extend({top:a,left:o,right:e-this.width-o,bottom:t-this.height-a})}else{let a=[0,0],o=0;r<0?(a[0]=Math.floor(-r),a[1]=t-this.height-a[0]):o=Math.floor(r);let s=[0,0],c=0;n<0?(s[0]=Math.floor(-n),s[1]=e-this.width-s[0]):c=Math.floor(n),i=i.extend({top:a[0],bottom:a[1],left:s[0],right:s[1]}).extract({left:c,top:o,width:e,height:t})}return await u(i)}}async toBlob(e=`image/png`,t=1){if(!d)throw Error(`toBlob() is only supported in browser environments.`);return await this.toCanvas().convertToBlob({type:e,quality:t})}toTensor(e=`CHW`){let t=new o.Tensor(`uint8`,new Uint8Array(this.data),[this.height,this.width,this.channels]);if(e!==`HWC`)if(e===`CHW`)t=t.permute(2,0,1);else throw Error(`Unsupported channel format: ${e}`);return t}toCanvas(){if(!d)throw Error(`toCanvas() is only supported in browser environments.`);let e=this.clone().rgba(),t=c(e.width,e.height),n=new l(e.data,e.width,e.height);return t.getContext(`2d`).putImageData(n,0,0),t}split(){let{data:e,width:t,height:n,channels:r}=this,i=e.constructor,a=e.length/r,o=Array.from({length:r},()=>new i(a));for(let t=0;tnew m(e,t,n,1))}_update(e,t,n,r=null){return this.data=e,this.width=t,this.height=n,r!==null&&(this.channels=r),this}clone(){return new m(this.data.slice(),this.width,this.height,this.channels)}convert(e){if(this.channels===e)return this;switch(e){case 1:this.grayscale();break;case 3:this.rgb();break;case 4:this.rgba();break;default:throw Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this}async save(e){if(d){if(a.apis.IS_WEBWORKER_ENV)throw Error(`Unable to save an image from a Web Worker.`);let t=e.split(`.`).pop().toLowerCase(),n=p.get(t)??`image/png`,i=await this.toBlob(n);(0,r.saveBlob)(e,i)}else if(a.apis.IS_FS_AVAILABLE)return await this.toSharp().toFile(e);else throw Error(`Unable to save the image because filesystem is disabled in this environment.`)}toSharp(){if(d)throw Error(`toSharp() is only supported in server-side environments.`);return s(this.data,{raw:{width:this.width,height:this.height,channels:this.channels}})}}let h=m.read.bind(m)}),"./src/utils/maths.js":((e,t,n)=>{ +/*!****************************!*\ +!*** ./src/utils/maths.js ***! +\****************************/ +n.r(t),n.d(t,{FFT:()=>h,bankers_round:()=>v,cos_sim:()=>c,dot:()=>s,dynamic_time_warping:()=>y,interpolate_data:()=>r,log_softmax:()=>o,magnitude:()=>l,max:()=>d,medianFilter:()=>g,min:()=>u,permute_data:()=>i,round:()=>_,softmax:()=>a});function r(e,[t,n,r],[i,a],o=`bilinear`,s=!1){let c=a/r,l=i/n,u=new e.constructor(i*a*t),d=n*r,f=i*a;for(let o=0;o=0;--e)i[e]=a,r[e]=t[n[e]],a*=r[e];let a=n.map((e,t)=>i[n.indexOf(t)]),o=new e.constructor(e.length);for(let n=0;n=0;--e)r+=i%t[e]*a[e],i=Math.floor(i/t[e]);o[r]=e[n]}return[o,r]}function a(e){let t=d(e)[0],n=e.map(e=>Math.exp(e-t)),r=n.reduce((e,t)=>e+t,0);return n.map(e=>e/r)}function o(e){let t=d(e)[0],n=0;for(let r=0;re-t-r)}function s(e,t){let n=0;for(let r=0;re+t*t,0))}function u(e){if(e.length===0)throw Error(`Array must not be empty`);let t=e[0],n=0;for(let r=1;rt&&(t=e[r],n=r);return[t,n]}function f(e){return e>0&&(e&e-1)==0}class p{constructor(e){if(this.size=e|0,this.size<=1||!f(this.size))throw Error(`FFT size must be a power of two larger than 1`);this._csize=e<<1,this.table=new Float64Array(this.size*2);for(let e=0;ee;e<<=1)++t;this._width=t%2==0?t-1:t,this._bitrev=new Int32Array(1<>>t&3)<>>1);for(let t=0;t>>1]=e[t];return n}toComplexArray(e,t){let n=t||this.createComplexArray();for(let t=0;t>>1],n[t+1]=0;return n}transform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._transform4(e,t,1)}realTransform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._realTransform4(e,t,1)}inverseTransform(e,t){if(e===t)throw Error(`Input and output buffers must be different`);this._transform4(e,t,-1);for(let t=0;t>=2;i>=2;i>>=2){a=r/i<<1;let t=a>>>2;for(o=0;o>>1,i>>>1)}else for(o=0,s=0;o>>1,i>>>1,n)}let l=this.table;for(i>>=2;i>=2;i>>=2){a=r/i<<1;let t=a>>>1,s=t>>>1,c=s>>>1;for(o=0;o>>1;for(let t=2;t>1;++t){let n=(t+1-e)**2/2,r=Math.sqrt(s**2+c**2)**n,o=n*Math.atan2(c,s),l=2*t;i[l]=r*Math.cos(o),i[l+1]=r*Math.sin(o),a[l]=i[l],a[l+1]=-i[l+1]}this._slicedChirpBuffer=i.subarray(t,n),this._f=new p(r>>1),this._f.transform(this._chirpBuffer,a)}_transform(e,t,n){let r=this._buffer1,i=this._buffer2,a=this._outBuffer1,o=this._outBuffer2,s=this._chirpBuffer,c=this._slicedChirpBuffer,l=this._a;if(n)for(let e=0;e>1];r[e]=i*c[e],r[n]=i*c[n]}else for(let e=0;e=e.length&&(i=2*(e.length-1)-i),r[a++]=e[i]}r.sort(),n[t]=r[i]}return n}function _(e,t){let n=10**t;return Math.round(e*n)/n}function v(e){let t=Math.round(e);return Math.abs(e)%1==.5?t%2==0?t:t-1:t}function y(e){let t=e.length,n=e[0].length,r=[t+1,n+1],i=Array.from({length:r[0]},()=>Array(r[1]).fill(1/0));i[0][0]=0;let a=Array.from({length:r[0]},()=>Array(r[1]).fill(-1));for(let t=1;t0||s>0;)switch(c.push(o-1),l.push(s-1),a[o][s]){case 0:--o,--s;break;case 1:--o;break;case 2:--s;break;default:throw Error(`Internal error in dynamic time warping. Unexpected trace[${o}, ${s}]. Please file a bug report.`)}return c.reverse(),l.reverse(),[c,l]}}),"./src/utils/tensor.js":((e,t,n)=>{ +/*!*****************************!*\ +!*** ./src/utils/tensor.js ***! +\*****************************/ +n.r(t),n.d(t,{DataTypeMap:()=>o,Tensor:()=>s,cat:()=>S,full:()=>k,full_like:()=>A,interpolate:()=>u,interpolate_4d:()=>d,layer_norm:()=>v,matmul:()=>f,mean:()=>E,mean_pooling:()=>_,ones:()=>j,ones_like:()=>M,permute:()=>l,quantize_embeddings:()=>L,rand:()=>F,randn:()=>I,rfft:()=>p,slice:()=>g,stack:()=>C,std_mean:()=>T,topk:()=>m,zeros:()=>N,zeros_like:()=>P});var r=n( +/*! ./maths.js */ +`./src/utils/maths.js`),i=n( +/*! ../backends/onnx.js */ +`./src/backends/onnx.js`),a=n( +/*! ../ops/registry.js */ +`./src/ops/registry.js`);let o=Object.freeze({float32:Float32Array,float16:typeof Float16Array<`u`?Float16Array:Uint16Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array,uint4:Uint8Array,int4:Int8Array});class s{get dims(){return this.ort_tensor.dims}set dims(e){this.ort_tensor.dims=e}get type(){return this.ort_tensor.type}get data(){return this.ort_tensor.data}get size(){return this.ort_tensor.size}get location(){return this.ort_tensor.location}ort_tensor;constructor(...e){return(0,i.isONNXTensor)(e[0])?this.ort_tensor=e[0]:this.ort_tensor=new i.Tensor(e[0],e[1],e[2]),new Proxy(this,{get:(e,t)=>{if(typeof t==`string`){let n=Number(t);if(Number.isInteger(n))return e._getitem(n)}return e[t]},set:(e,t,n)=>e[t]=n})}dispose(){this.ort_tensor.dispose()}*[Symbol.iterator](){let[e,...t]=this.dims;if(t.length>0){let n=t.reduce((e,t)=>e*t);for(let r=0;r0){let t=n.reduce((e,t)=>e*t);return this._subarray(e,t,n)}else return new s(this.type,[this.data[e]],n)}indexOf(e){let t=this.data;for(let n=0;na)throw Error(`Invalid slice: ${i}`);let o=[Math.max(e,0),Math.min(a,this.dims[r])];n.push(o),t.push(o[1]-o[0])}else throw Error(`Invalid slice: ${i}`)}let r=n.map(([e,t])=>t-e),i=r.reduce((e,t)=>e*t),a=this.data,o=new a.constructor(i),c=this.stride(),l=!0;for(let e=1;e=0;--i){let e=r[i];t+=(a%e+n[i][0])*c[i],a=Math.floor(a/e)}o[e]=a[t]}return new s(this.type,o,t)}permute(...e){return l(this,e)}transpose(...e){return this.permute(...e)}sum(e=null,t=!1){return this.norm(1,e,t)}norm(e=`fro`,t=null,n=!1){if(e===`fro`)e=2;else if(typeof e==`string`)throw Error(`Unsupported norm: ${e}`);let r=this.data,i=(t,n)=>t+n**e;if(t===null){let t=r.reduce(i,0)**(1/e);return new s(this.type,[t],[])}let[a,o,c]=w(i,this,t,n);if(e!==1)for(let t=0;t=0;--r){let e=this.dims[r];if(r!==t){let t=i%e;n+=t*a,a*=this.dims[r]}i=Math.floor(i/e)}r[e]/=i[n]}return this}normalize(e=2,t=1){return this.clone().normalize_(e,t)}stride(){return D(this.dims)}squeeze(e=null){return new s(this.type,this.data,y(this.dims,e))}squeeze_(e=null){return this.dims=y(this.dims,e),this}unsqueeze(e=null){return new s(this.type,this.data,b(this.dims,e))}unsqueeze_(e=null){return this.dims=b(this.dims,e),this}flatten_(e=0,t=-1){t=(t+this.dims.length)%this.dims.length;let n=this.dims.slice(0,e),r=this.dims.slice(e,t+1),i=this.dims.slice(t+1);return this.dims=[...n,r.reduce((e,t)=>e*t,1),...i],this}flatten(e=0,t=-1){return this.clone().flatten_(e,t)}view(...e){let t=-1;for(let n=0;nr===t?e:e*n,1);e[t]=n.length/r}return new s(this.type,n,e)}neg_(){let e=this.data;for(let t=0;te);return new s(`bool`,t,this.dims)}lt(e){let t=new Uint8Array(this.data.length),n=this.data;for(let r=0;rMath.min(e,t),this,e,t,1/0);return new s(n,i,a)}max(e=null,t=!1){if(e===null){let e=(0,r.max)(this.data)[0];return new s(this.type,[e],[])}let[n,i,a]=w((e,t)=>Math.max(e,t),this,e,t,-1/0);return new s(n,i,a)}argmin(e=null,t=!1){if(e!==null)throw Error("`dim !== null` not yet implemented.");let n=(0,r.min)(this.data)[1];return new s(`int64`,[BigInt(n)],[])}argmax(e=null,t=!1){if(e!==null)throw Error("`dim !== null` not yet implemented.");let n=(0,r.max)(this.data)[1];return new s(`int64`,[BigInt(n)],[])}to(e){if(this.type===e)return this;if(!o.hasOwnProperty(e))throw Error(`Unsupported type: ${e}`);let t,n=[`int64`,`uint64`].includes(this.type),r=[`int64`,`uint64`].includes(e);return n&&!r?t=Number:!n&&r&&(t=[`float16`,`float32`,`float64`].includes(this.type)?e=>BigInt(Math.floor(e)):BigInt),new s(e,o[e].from(this.data,t),this.dims)}}function c(e,t){let n=e.length;if(n!==t.reduce((e,t)=>e*t))throw Error(`cannot reshape array of size ${n} into shape (${t})`);let r=e;for(let e=t.length-1;e>=0;e--)r=r.reduce((n,r)=>{let i=n[n.length-1];return i.lengthnew s(`int64`,e,[e.length]);async function g(e,t,n,r,i){return await(await a.TensorOpRegistry.slice)({x:e,s:h(t),e:h(n),a:h(r),t:h(i??Array(r.length).fill(1))})}function _(e,t){let n=e.data,r=t.data,i=[e.dims[0],e.dims[2]],a=new n.constructor(i[0]*i[1]),[o,c,l]=e.dims,u=0;for(let e=0;ee!==1):typeof t==`number`?e[t]===1&&e.splice(t,1):Array.isArray(t)&&(e=e.filter((e,n)=>e!==1||!t.includes(n))),e}function b(e,t){return t=x(t,e.length+1),e=e.slice(),e.splice(t,0,1),e}function x(e,t,n=null,r=!0){if(e<-t||e>=t){if(r)throw Error(`IndexError: index ${e} is out of bounds for dimension${n===null?``:` `+n} with size ${t}`);return e<-t?0:t}return e<0&&(e=(e%t+t)%t),e}function S(e,t=0){t=x(t,e[0].dims.length);let n=e[0].dims.slice();n[t]=e.reduce((e,n)=>e+n.dims[t],0);let r=n.reduce((e,t)=>e*t,1),i=new e[0].data.constructor(r),a=e[0].type;if(t===0){let t=0;for(let n of e){let e=n.data;i.set(e,t),t+=e.length}}else{let r=0;for(let a=0;a=0;--i){let e=s[i],l=o%e;i===t&&(l+=r),a+=l*c,c*=n[i],o=Math.floor(o/e)}i[a]=o[e]}r+=s[t]}}return new s(a,i,n)}function C(e,t=0){return S(e.map(e=>e.unsqueeze(t)),t)}function w(e,t,n=null,r=!1,i=null){let a=t.data,o=t.dims;n=x(n,o.length);let s=o.slice();s[n]=1;let c=new a.constructor(a.length/o[n]);i!==null&&c.fill(i);for(let t=0;t=0;--e){let t=o[e];if(e!==n){let n=i%t;r+=n*a,a*=s[e]}i=Math.floor(i/t)}c[r]=e(c[r],a[t],t,r)}return r||s.splice(n,1),[t.type,c,s]}function T(e,t=null,n=1,r=!1){let i=e.data,a=e.dims;if(t===null){let t=i.reduce((e,t)=>e+t,0)/i.length,r=Math.sqrt(i.reduce((e,n)=>e+(n-t)**2,0)/(i.length-n)),a=new s(e.type,[t],[]);return[new s(e.type,[r],[]),a]}t=x(t,a.length);let o=E(e,t,r),c=o.data,[l,u,d]=w((e,t,n,r)=>e+(t-c[r])**2,e,t,r);for(let e=0;ee+t,0);return new s(e.type,[t/i.length],[])}t=x(t,r.length);let[a,o,c]=w((e,t)=>e+t,e,t,n);if(r[t]!==1)for(let e=0;e=0;--n)t[n]=r,r*=e[n];return t}function O(e,t,n,r){return new s(n,new r(e.reduce((e,t)=>e*t,1)).fill(t),e)}function k(e,t){let n,r;if(typeof t==`number`)n=`float32`,r=Float32Array;else if(typeof t==`bigint`)n=`int64`,r=BigInt64Array;else if(typeof t==`boolean`)n=`bool`,r=Uint8Array;else throw Error(`Unsupported data type: ${typeof t}`);return O(e,t,n,r)}function A(e,t){return k(e.dims,t)}function j(e){return O(e,1n,`int64`,BigInt64Array)}function M(e){return j(e.dims)}function N(e){return O(e,0n,`int64`,BigInt64Array)}function P(e){return N(e.dims)}function F(e){let t=e.reduce((e,t)=>e*t,1);return new s(`float32`,Float32Array.from({length:t},()=>Math.random()),e)}function I(e){let t=e.reduce((e,t)=>e*t,1);function n(){let e=1-Math.random(),t=1-Math.random();return Math.sqrt(-2*Math.log(e))*Math.cos(2*Math.PI*t)}return new s(`float32`,Float32Array.from({length:t},()=>n()),e)}function L(e,t){if(e.dims.length!==2)throw Error(`The tensor must have 2 dimensions`);if(e.dims.at(-1)%8!=0)throw Error(`The last dimension of the tensor must be a multiple of 8`);if(![`binary`,`ubinary`].includes(t))throw Error(`The precision must be either 'binary' or 'ubinary'`);let n=t===`binary`,r=n?`int8`:`uint8`,i=n?Int8Array:Uint8Array,a=e.data,o=new i(a.length/8);for(let e=0;e0),r=Math.floor(e/8),i=e%8;o[r]|=t<<7-i,n&&i===0&&(o[r]-=128)}return new s(r,o,[e.dims[0],e.dims[1]/8])}}),"./src/utils/video.js":((e,t,n)=>{ +/*!****************************!*\ +!*** ./src/utils/video.js ***! +\****************************/ +n.r(t),n.d(t,{RawVideo:()=>o,RawVideoFrame:()=>a,load_video:()=>s});var r=n( +/*! ./image.js */ +`./src/utils/image.js`),i=n( +/*! ../env.js */ +`./src/env.js`);class a{constructor(e,t){this.image=e,this.timestamp=t}}class o{constructor(e,t){e.length>0&&e[0]instanceof r.RawImage&&(e=e.map((n,r)=>new a(n,(r+1)/(e.length+1)*t))),this.frames=e,this.duration=t}get width(){return this.frames[0].image.width}get height(){return this.frames[0].image.height}get fps(){return this.frames.length/this.duration}}async function s(e,{num_frames:t=null,fps:n=null}={}){if(!i.apis.IS_BROWSER_ENV)throw Error("`load_video` is currently only supported in browser environments.");if(t==null&&n==null)throw Error(`Either num_frames or fps must be provided.`);let s=[],c=document.createElement(`video`);if(c.crossOrigin=`anonymous`,c.muted=!0,typeof e==`string`)c.src=e;else if(e instanceof Blob)c.src=URL.createObjectURL(e);else if(e instanceof HTMLVideoElement)c.src=e.src;else throw Error(`Invalid URL or video element provided.`);if(await new Promise(e=>c.onloadedmetadata=e),c.seekable.start(0)===c.seekable.end(0)){let e=await(await fetch(c.src)).blob();c.src=URL.createObjectURL(e),await new Promise(e=>c.onloadedmetadata=e)}let l=c.duration,u,d;t==null?(d=1/n,u=Math.floor(l/d)):(u=t,d=t===1?0:l/(t-1));let f=[];for(let e=0;e{c.onseeked=e}),m.drawImage(c,0,0,p.width,p.height);let t=m.getImageData(0,0,p.width,p.height),n=new a(new r.RawImage(t.data,p.width,p.height,4),e);s.push(n)}return c.remove(),new o(s,l)}})},wH={};function TH(e){var t=wH[e];if(t!==void 0)return t.exports;var n=wH[e]={exports:{}};return CH[e](n,n.exports,TH),n.exports}(()=>{var e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,t;TH.t=function(n,r){if(r&1&&(n=this(n)),r&8||typeof n==`object`&&n&&(r&4&&n.__esModule||r&16&&typeof n.then==`function`))return n;var i=Object.create(null);TH.r(i);var a={};t||=[null,e({}),e([]),e(e)];for(var o=r&2&&n;typeof o==`object`&&!~t.indexOf(o);o=e(o))Object.getOwnPropertyNames(o).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,TH.d(i,a),i}})(),TH.d=(e,t)=>{for(var n in t)TH.o(t,n)&&!TH.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},TH.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),TH.r=e=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})};var Z={} +/*!*****************************!*\ +!*** ./src/transformers.js ***! +\*****************************/ +/*! ./env.js */ +/*! ./pipelines.js */ +/*! ./models.js */ +/*! ./tokenizers.js */ +/*! ./configs.js */ +/*! ./utils/audio.js */ +/*! ./utils/image.js */ +/*! ./utils/video.js */ +/*! ./utils/tensor.js */ +/*! ./utils/maths.js */ +/*! ./base/feature_extraction_utils.js */ +/*! ./models/feature_extractors.js */ +/*! ./models/auto/feature_extraction_auto.js */ +/*! ./base/image_processors_utils.js */ +/*! ./models/image_processors.js */ +/*! ./models/auto/image_processing_auto.js */ +/*! ./base/processing_utils.js */ +/*! ./models/processors.js */ +/*! ./models/auto/processing_auto.js */ +/*! ./generation/streamers.js */ +/*! ./generation/stopping_criteria.js */ +/*! ./generation/logits_process.js */ +;(()=>{TH.r(Z),TH.d(Z,{ASTFeatureExtractor:()=>d.ASTFeatureExtractor,ASTForAudioClassification:()=>n.ASTForAudioClassification,ASTModel:()=>n.ASTModel,ASTPreTrainedModel:()=>n.ASTPreTrainedModel,AlbertForMaskedLM:()=>n.AlbertForMaskedLM,AlbertForQuestionAnswering:()=>n.AlbertForQuestionAnswering,AlbertForSequenceClassification:()=>n.AlbertForSequenceClassification,AlbertModel:()=>n.AlbertModel,AlbertPreTrainedModel:()=>n.AlbertPreTrainedModel,AlbertTokenizer:()=>r.AlbertTokenizer,ArceeForCausalLM:()=>n.ArceeForCausalLM,ArceeModel:()=>n.ArceeModel,ArceePreTrainedModel:()=>n.ArceePreTrainedModel,AudioClassificationPipeline:()=>t.AudioClassificationPipeline,AutoConfig:()=>i.AutoConfig,AutoFeatureExtractor:()=>f.AutoFeatureExtractor,AutoImageProcessor:()=>h.AutoImageProcessor,AutoModel:()=>n.AutoModel,AutoModelForAudioClassification:()=>n.AutoModelForAudioClassification,AutoModelForAudioFrameClassification:()=>n.AutoModelForAudioFrameClassification,AutoModelForAudioTextToText:()=>n.AutoModelForAudioTextToText,AutoModelForCTC:()=>n.AutoModelForCTC,AutoModelForCausalLM:()=>n.AutoModelForCausalLM,AutoModelForDepthEstimation:()=>n.AutoModelForDepthEstimation,AutoModelForDocumentQuestionAnswering:()=>n.AutoModelForDocumentQuestionAnswering,AutoModelForImageClassification:()=>n.AutoModelForImageClassification,AutoModelForImageFeatureExtraction:()=>n.AutoModelForImageFeatureExtraction,AutoModelForImageMatting:()=>n.AutoModelForImageMatting,AutoModelForImageSegmentation:()=>n.AutoModelForImageSegmentation,AutoModelForImageTextToText:()=>n.AutoModelForImageTextToText,AutoModelForImageToImage:()=>n.AutoModelForImageToImage,AutoModelForMaskGeneration:()=>n.AutoModelForMaskGeneration,AutoModelForMaskedLM:()=>n.AutoModelForMaskedLM,AutoModelForNormalEstimation:()=>n.AutoModelForNormalEstimation,AutoModelForObjectDetection:()=>n.AutoModelForObjectDetection,AutoModelForPoseEstimation:()=>n.AutoModelForPoseEstimation,AutoModelForQuestionAnswering:()=>n.AutoModelForQuestionAnswering,AutoModelForSemanticSegmentation:()=>n.AutoModelForSemanticSegmentation,AutoModelForSeq2SeqLM:()=>n.AutoModelForSeq2SeqLM,AutoModelForSequenceClassification:()=>n.AutoModelForSequenceClassification,AutoModelForSpeechSeq2Seq:()=>n.AutoModelForSpeechSeq2Seq,AutoModelForTextToSpectrogram:()=>n.AutoModelForTextToSpectrogram,AutoModelForTextToWaveform:()=>n.AutoModelForTextToWaveform,AutoModelForTokenClassification:()=>n.AutoModelForTokenClassification,AutoModelForUniversalSegmentation:()=>n.AutoModelForUniversalSegmentation,AutoModelForVision2Seq:()=>n.AutoModelForVision2Seq,AutoModelForXVector:()=>n.AutoModelForXVector,AutoModelForZeroShotObjectDetection:()=>n.AutoModelForZeroShotObjectDetection,AutoProcessor:()=>v.AutoProcessor,AutoTokenizer:()=>r.AutoTokenizer,AutomaticSpeechRecognitionPipeline:()=>t.AutomaticSpeechRecognitionPipeline,BackgroundRemovalPipeline:()=>t.BackgroundRemovalPipeline,BartForConditionalGeneration:()=>n.BartForConditionalGeneration,BartForSequenceClassification:()=>n.BartForSequenceClassification,BartModel:()=>n.BartModel,BartPretrainedModel:()=>n.BartPretrainedModel,BartTokenizer:()=>r.BartTokenizer,BaseModelOutput:()=>n.BaseModelOutput,BaseStreamer:()=>y.BaseStreamer,BeitFeatureExtractor:()=>m.BeitFeatureExtractor,BeitForImageClassification:()=>n.BeitForImageClassification,BeitModel:()=>n.BeitModel,BeitPreTrainedModel:()=>n.BeitPreTrainedModel,BertForMaskedLM:()=>n.BertForMaskedLM,BertForQuestionAnswering:()=>n.BertForQuestionAnswering,BertForSequenceClassification:()=>n.BertForSequenceClassification,BertForTokenClassification:()=>n.BertForTokenClassification,BertModel:()=>n.BertModel,BertPreTrainedModel:()=>n.BertPreTrainedModel,BertTokenizer:()=>r.BertTokenizer,BitImageProcessor:()=>m.BitImageProcessor,BlenderbotForConditionalGeneration:()=>n.BlenderbotForConditionalGeneration,BlenderbotModel:()=>n.BlenderbotModel,BlenderbotPreTrainedModel:()=>n.BlenderbotPreTrainedModel,BlenderbotSmallForConditionalGeneration:()=>n.BlenderbotSmallForConditionalGeneration,BlenderbotSmallModel:()=>n.BlenderbotSmallModel,BlenderbotSmallPreTrainedModel:()=>n.BlenderbotSmallPreTrainedModel,BlenderbotSmallTokenizer:()=>r.BlenderbotSmallTokenizer,BlenderbotTokenizer:()=>r.BlenderbotTokenizer,BloomForCausalLM:()=>n.BloomForCausalLM,BloomModel:()=>n.BloomModel,BloomPreTrainedModel:()=>n.BloomPreTrainedModel,BloomTokenizer:()=>r.BloomTokenizer,CLIPFeatureExtractor:()=>m.CLIPFeatureExtractor,CLIPImageProcessor:()=>m.CLIPImageProcessor,CLIPModel:()=>n.CLIPModel,CLIPPreTrainedModel:()=>n.CLIPPreTrainedModel,CLIPSegForImageSegmentation:()=>n.CLIPSegForImageSegmentation,CLIPSegModel:()=>n.CLIPSegModel,CLIPSegPreTrainedModel:()=>n.CLIPSegPreTrainedModel,CLIPTextModel:()=>n.CLIPTextModel,CLIPTextModelWithProjection:()=>n.CLIPTextModelWithProjection,CLIPTokenizer:()=>r.CLIPTokenizer,CLIPVisionModel:()=>n.CLIPVisionModel,CLIPVisionModelWithProjection:()=>n.CLIPVisionModelWithProjection,CamembertForMaskedLM:()=>n.CamembertForMaskedLM,CamembertForQuestionAnswering:()=>n.CamembertForQuestionAnswering,CamembertForSequenceClassification:()=>n.CamembertForSequenceClassification,CamembertForTokenClassification:()=>n.CamembertForTokenClassification,CamembertModel:()=>n.CamembertModel,CamembertPreTrainedModel:()=>n.CamembertPreTrainedModel,CamembertTokenizer:()=>r.CamembertTokenizer,CausalLMOutput:()=>n.CausalLMOutput,CausalLMOutputWithPast:()=>n.CausalLMOutputWithPast,ChineseCLIPFeatureExtractor:()=>m.ChineseCLIPFeatureExtractor,ChineseCLIPModel:()=>n.ChineseCLIPModel,ChineseCLIPPreTrainedModel:()=>n.ChineseCLIPPreTrainedModel,ClapAudioModelWithProjection:()=>n.ClapAudioModelWithProjection,ClapFeatureExtractor:()=>d.ClapFeatureExtractor,ClapModel:()=>n.ClapModel,ClapPreTrainedModel:()=>n.ClapPreTrainedModel,ClapTextModelWithProjection:()=>n.ClapTextModelWithProjection,ClassifierFreeGuidanceLogitsProcessor:()=>x.ClassifierFreeGuidanceLogitsProcessor,CodeGenForCausalLM:()=>n.CodeGenForCausalLM,CodeGenModel:()=>n.CodeGenModel,CodeGenPreTrainedModel:()=>n.CodeGenPreTrainedModel,CodeGenTokenizer:()=>r.CodeGenTokenizer,CodeLlamaTokenizer:()=>r.CodeLlamaTokenizer,CohereForCausalLM:()=>n.CohereForCausalLM,CohereModel:()=>n.CohereModel,CoherePreTrainedModel:()=>n.CoherePreTrainedModel,CohereTokenizer:()=>r.CohereTokenizer,ConvBertForMaskedLM:()=>n.ConvBertForMaskedLM,ConvBertForQuestionAnswering:()=>n.ConvBertForQuestionAnswering,ConvBertForSequenceClassification:()=>n.ConvBertForSequenceClassification,ConvBertForTokenClassification:()=>n.ConvBertForTokenClassification,ConvBertModel:()=>n.ConvBertModel,ConvBertPreTrainedModel:()=>n.ConvBertPreTrainedModel,ConvBertTokenizer:()=>r.ConvBertTokenizer,ConvNextFeatureExtractor:()=>m.ConvNextFeatureExtractor,ConvNextForImageClassification:()=>n.ConvNextForImageClassification,ConvNextImageProcessor:()=>m.ConvNextImageProcessor,ConvNextModel:()=>n.ConvNextModel,ConvNextPreTrainedModel:()=>n.ConvNextPreTrainedModel,ConvNextV2ForImageClassification:()=>n.ConvNextV2ForImageClassification,ConvNextV2Model:()=>n.ConvNextV2Model,ConvNextV2PreTrainedModel:()=>n.ConvNextV2PreTrainedModel,DFineForObjectDetection:()=>n.DFineForObjectDetection,DFineModel:()=>n.DFineModel,DFinePreTrainedModel:()=>n.DFinePreTrainedModel,DINOv3ConvNextModel:()=>n.DINOv3ConvNextModel,DINOv3ConvNextPreTrainedModel:()=>n.DINOv3ConvNextPreTrainedModel,DINOv3ViTImageProcessor:()=>m.DINOv3ViTImageProcessor,DINOv3ViTModel:()=>n.DINOv3ViTModel,DINOv3ViTPreTrainedModel:()=>n.DINOv3ViTPreTrainedModel,DPTFeatureExtractor:()=>m.DPTFeatureExtractor,DPTForDepthEstimation:()=>n.DPTForDepthEstimation,DPTImageProcessor:()=>m.DPTImageProcessor,DPTModel:()=>n.DPTModel,DPTPreTrainedModel:()=>n.DPTPreTrainedModel,DacDecoderModel:()=>n.DacDecoderModel,DacDecoderOutput:()=>n.DacDecoderOutput,DacEncoderModel:()=>n.DacEncoderModel,DacEncoderOutput:()=>n.DacEncoderOutput,DacFeatureExtractor:()=>d.DacFeatureExtractor,DacModel:()=>n.DacModel,DacPreTrainedModel:()=>n.DacPreTrainedModel,DataTypeMap:()=>c.DataTypeMap,DebertaForMaskedLM:()=>n.DebertaForMaskedLM,DebertaForQuestionAnswering:()=>n.DebertaForQuestionAnswering,DebertaForSequenceClassification:()=>n.DebertaForSequenceClassification,DebertaForTokenClassification:()=>n.DebertaForTokenClassification,DebertaModel:()=>n.DebertaModel,DebertaPreTrainedModel:()=>n.DebertaPreTrainedModel,DebertaTokenizer:()=>r.DebertaTokenizer,DebertaV2ForMaskedLM:()=>n.DebertaV2ForMaskedLM,DebertaV2ForQuestionAnswering:()=>n.DebertaV2ForQuestionAnswering,DebertaV2ForSequenceClassification:()=>n.DebertaV2ForSequenceClassification,DebertaV2ForTokenClassification:()=>n.DebertaV2ForTokenClassification,DebertaV2Model:()=>n.DebertaV2Model,DebertaV2PreTrainedModel:()=>n.DebertaV2PreTrainedModel,DebertaV2Tokenizer:()=>r.DebertaV2Tokenizer,DecisionTransformerModel:()=>n.DecisionTransformerModel,DecisionTransformerPreTrainedModel:()=>n.DecisionTransformerPreTrainedModel,DeiTFeatureExtractor:()=>m.DeiTFeatureExtractor,DeiTForImageClassification:()=>n.DeiTForImageClassification,DeiTImageProcessor:()=>m.DeiTImageProcessor,DeiTModel:()=>n.DeiTModel,DeiTPreTrainedModel:()=>n.DeiTPreTrainedModel,DepthAnythingForDepthEstimation:()=>n.DepthAnythingForDepthEstimation,DepthAnythingPreTrainedModel:()=>n.DepthAnythingPreTrainedModel,DepthEstimationPipeline:()=>t.DepthEstimationPipeline,DepthProForDepthEstimation:()=>n.DepthProForDepthEstimation,DepthProPreTrainedModel:()=>n.DepthProPreTrainedModel,DetrFeatureExtractor:()=>m.DetrFeatureExtractor,DetrForObjectDetection:()=>n.DetrForObjectDetection,DetrForSegmentation:()=>n.DetrForSegmentation,DetrImageProcessor:()=>m.DetrImageProcessor,DetrModel:()=>n.DetrModel,DetrObjectDetectionOutput:()=>n.DetrObjectDetectionOutput,DetrPreTrainedModel:()=>n.DetrPreTrainedModel,DetrSegmentationOutput:()=>n.DetrSegmentationOutput,Dinov2ForImageClassification:()=>n.Dinov2ForImageClassification,Dinov2Model:()=>n.Dinov2Model,Dinov2PreTrainedModel:()=>n.Dinov2PreTrainedModel,Dinov2WithRegistersForImageClassification:()=>n.Dinov2WithRegistersForImageClassification,Dinov2WithRegistersModel:()=>n.Dinov2WithRegistersModel,Dinov2WithRegistersPreTrainedModel:()=>n.Dinov2WithRegistersPreTrainedModel,DistilBertForMaskedLM:()=>n.DistilBertForMaskedLM,DistilBertForQuestionAnswering:()=>n.DistilBertForQuestionAnswering,DistilBertForSequenceClassification:()=>n.DistilBertForSequenceClassification,DistilBertForTokenClassification:()=>n.DistilBertForTokenClassification,DistilBertModel:()=>n.DistilBertModel,DistilBertPreTrainedModel:()=>n.DistilBertPreTrainedModel,DistilBertTokenizer:()=>r.DistilBertTokenizer,DocumentQuestionAnsweringPipeline:()=>t.DocumentQuestionAnsweringPipeline,DonutFeatureExtractor:()=>m.DonutFeatureExtractor,DonutImageProcessor:()=>m.DonutImageProcessor,DonutSwinModel:()=>n.DonutSwinModel,DonutSwinPreTrainedModel:()=>n.DonutSwinPreTrainedModel,EdgeTamModel:()=>n.EdgeTamModel,EfficientNetForImageClassification:()=>n.EfficientNetForImageClassification,EfficientNetImageProcessor:()=>m.EfficientNetImageProcessor,EfficientNetModel:()=>n.EfficientNetModel,EfficientNetPreTrainedModel:()=>n.EfficientNetPreTrainedModel,ElectraForMaskedLM:()=>n.ElectraForMaskedLM,ElectraForQuestionAnswering:()=>n.ElectraForQuestionAnswering,ElectraForSequenceClassification:()=>n.ElectraForSequenceClassification,ElectraForTokenClassification:()=>n.ElectraForTokenClassification,ElectraModel:()=>n.ElectraModel,ElectraPreTrainedModel:()=>n.ElectraPreTrainedModel,ElectraTokenizer:()=>r.ElectraTokenizer,EncodecFeatureExtractor:()=>d.EncodecFeatureExtractor,EosTokenCriteria:()=>b.EosTokenCriteria,Ernie4_5ForCausalLM:()=>n.Ernie4_5ForCausalLM,Ernie4_5Model:()=>n.Ernie4_5Model,Ernie4_5PreTrainedModel:()=>n.Ernie4_5PreTrainedModel,EsmForMaskedLM:()=>n.EsmForMaskedLM,EsmForSequenceClassification:()=>n.EsmForSequenceClassification,EsmForTokenClassification:()=>n.EsmForTokenClassification,EsmModel:()=>n.EsmModel,EsmPreTrainedModel:()=>n.EsmPreTrainedModel,EsmTokenizer:()=>r.EsmTokenizer,ExaoneForCausalLM:()=>n.ExaoneForCausalLM,ExaoneModel:()=>n.ExaoneModel,ExaonePreTrainedModel:()=>n.ExaonePreTrainedModel,FFT:()=>l.FFT,FalconForCausalLM:()=>n.FalconForCausalLM,FalconModel:()=>n.FalconModel,FalconPreTrainedModel:()=>n.FalconPreTrainedModel,FalconTokenizer:()=>r.FalconTokenizer,FastViTForImageClassification:()=>n.FastViTForImageClassification,FastViTModel:()=>n.FastViTModel,FastViTPreTrainedModel:()=>n.FastViTPreTrainedModel,FeatureExtractionPipeline:()=>t.FeatureExtractionPipeline,FeatureExtractor:()=>u.FeatureExtractor,FillMaskPipeline:()=>t.FillMaskPipeline,Florence2ForConditionalGeneration:()=>n.Florence2ForConditionalGeneration,Florence2PreTrainedModel:()=>n.Florence2PreTrainedModel,Florence2Processor:()=>_.Florence2Processor,ForcedBOSTokenLogitsProcessor:()=>x.ForcedBOSTokenLogitsProcessor,ForcedEOSTokenLogitsProcessor:()=>x.ForcedEOSTokenLogitsProcessor,GLPNFeatureExtractor:()=>m.GLPNFeatureExtractor,GLPNForDepthEstimation:()=>n.GLPNForDepthEstimation,GLPNModel:()=>n.GLPNModel,GLPNPreTrainedModel:()=>n.GLPNPreTrainedModel,GPT2LMHeadModel:()=>n.GPT2LMHeadModel,GPT2Model:()=>n.GPT2Model,GPT2PreTrainedModel:()=>n.GPT2PreTrainedModel,GPT2Tokenizer:()=>r.GPT2Tokenizer,GPTBigCodeForCausalLM:()=>n.GPTBigCodeForCausalLM,GPTBigCodeModel:()=>n.GPTBigCodeModel,GPTBigCodePreTrainedModel:()=>n.GPTBigCodePreTrainedModel,GPTJForCausalLM:()=>n.GPTJForCausalLM,GPTJModel:()=>n.GPTJModel,GPTJPreTrainedModel:()=>n.GPTJPreTrainedModel,GPTNeoForCausalLM:()=>n.GPTNeoForCausalLM,GPTNeoModel:()=>n.GPTNeoModel,GPTNeoPreTrainedModel:()=>n.GPTNeoPreTrainedModel,GPTNeoXForCausalLM:()=>n.GPTNeoXForCausalLM,GPTNeoXModel:()=>n.GPTNeoXModel,GPTNeoXPreTrainedModel:()=>n.GPTNeoXPreTrainedModel,GPTNeoXTokenizer:()=>r.GPTNeoXTokenizer,Gemma2ForCausalLM:()=>n.Gemma2ForCausalLM,Gemma2Model:()=>n.Gemma2Model,Gemma2PreTrainedModel:()=>n.Gemma2PreTrainedModel,Gemma3ForCausalLM:()=>n.Gemma3ForCausalLM,Gemma3Model:()=>n.Gemma3Model,Gemma3PreTrainedModel:()=>n.Gemma3PreTrainedModel,Gemma3nAudioFeatureExtractor:()=>d.Gemma3nAudioFeatureExtractor,Gemma3nForConditionalGeneration:()=>n.Gemma3nForConditionalGeneration,Gemma3nPreTrainedModel:()=>n.Gemma3nPreTrainedModel,Gemma3nProcessor:()=>_.Gemma3nProcessor,GemmaForCausalLM:()=>n.GemmaForCausalLM,GemmaModel:()=>n.GemmaModel,GemmaPreTrainedModel:()=>n.GemmaPreTrainedModel,GemmaTokenizer:()=>r.GemmaTokenizer,GlmForCausalLM:()=>n.GlmForCausalLM,GlmModel:()=>n.GlmModel,GlmPreTrainedModel:()=>n.GlmPreTrainedModel,GraniteForCausalLM:()=>n.GraniteForCausalLM,GraniteModel:()=>n.GraniteModel,GraniteMoeHybridForCausalLM:()=>n.GraniteMoeHybridForCausalLM,GraniteMoeHybridModel:()=>n.GraniteMoeHybridModel,GraniteMoeHybridPreTrainedModel:()=>n.GraniteMoeHybridPreTrainedModel,GranitePreTrainedModel:()=>n.GranitePreTrainedModel,Grok1Tokenizer:()=>r.Grok1Tokenizer,GroundingDinoForObjectDetection:()=>n.GroundingDinoForObjectDetection,GroundingDinoImageProcessor:()=>m.GroundingDinoImageProcessor,GroundingDinoPreTrainedModel:()=>n.GroundingDinoPreTrainedModel,GroundingDinoProcessor:()=>_.GroundingDinoProcessor,GroupViTModel:()=>n.GroupViTModel,GroupViTPreTrainedModel:()=>n.GroupViTPreTrainedModel,HeliumForCausalLM:()=>n.HeliumForCausalLM,HeliumModel:()=>n.HeliumModel,HeliumPreTrainedModel:()=>n.HeliumPreTrainedModel,HerbertTokenizer:()=>r.HerbertTokenizer,HieraForImageClassification:()=>n.HieraForImageClassification,HieraModel:()=>n.HieraModel,HieraPreTrainedModel:()=>n.HieraPreTrainedModel,HubertForCTC:()=>n.HubertForCTC,HubertForSequenceClassification:()=>n.HubertForSequenceClassification,HubertModel:()=>n.HubertModel,HubertPreTrainedModel:()=>n.HubertPreTrainedModel,IJepaForImageClassification:()=>n.IJepaForImageClassification,IJepaModel:()=>n.IJepaModel,IJepaPreTrainedModel:()=>n.IJepaPreTrainedModel,Idefics3ForConditionalGeneration:()=>n.Idefics3ForConditionalGeneration,Idefics3ImageProcessor:()=>m.Idefics3ImageProcessor,Idefics3PreTrainedModel:()=>n.Idefics3PreTrainedModel,Idefics3Processor:()=>_.Idefics3Processor,ImageClassificationPipeline:()=>t.ImageClassificationPipeline,ImageFeatureExtractionPipeline:()=>t.ImageFeatureExtractionPipeline,ImageFeatureExtractor:()=>d.ImageFeatureExtractor,ImageMattingOutput:()=>n.ImageMattingOutput,ImageProcessor:()=>p.ImageProcessor,ImageSegmentationPipeline:()=>t.ImageSegmentationPipeline,ImageToImagePipeline:()=>t.ImageToImagePipeline,ImageToTextPipeline:()=>t.ImageToTextPipeline,InterruptableStoppingCriteria:()=>b.InterruptableStoppingCriteria,JAISLMHeadModel:()=>n.JAISLMHeadModel,JAISModel:()=>n.JAISModel,JAISPreTrainedModel:()=>n.JAISPreTrainedModel,JinaCLIPImageProcessor:()=>m.JinaCLIPImageProcessor,JinaCLIPModel:()=>n.JinaCLIPModel,JinaCLIPPreTrainedModel:()=>n.JinaCLIPPreTrainedModel,JinaCLIPProcessor:()=>_.JinaCLIPProcessor,JinaCLIPTextModel:()=>n.JinaCLIPTextModel,JinaCLIPVisionModel:()=>n.JinaCLIPVisionModel,Lfm2ForCausalLM:()=>n.Lfm2ForCausalLM,Lfm2Model:()=>n.Lfm2Model,Lfm2PreTrainedModel:()=>n.Lfm2PreTrainedModel,LiteWhisperForConditionalGeneration:()=>n.LiteWhisperForConditionalGeneration,Llama4ForCausalLM:()=>n.Llama4ForCausalLM,Llama4PreTrainedModel:()=>n.Llama4PreTrainedModel,LlamaForCausalLM:()=>n.LlamaForCausalLM,LlamaModel:()=>n.LlamaModel,LlamaPreTrainedModel:()=>n.LlamaPreTrainedModel,LlamaTokenizer:()=>r.LlamaTokenizer,LlavaForConditionalGeneration:()=>n.LlavaForConditionalGeneration,LlavaOnevisionForConditionalGeneration:()=>n.LlavaOnevisionForConditionalGeneration,LlavaOnevisionImageProcessor:()=>m.LlavaOnevisionImageProcessor,LlavaPreTrainedModel:()=>n.LlavaPreTrainedModel,LlavaProcessor:()=>_.LlavaProcessor,LlavaQwen2ForCausalLM:()=>n.LlavaQwen2ForCausalLM,LogitsProcessor:()=>x.LogitsProcessor,LogitsProcessorList:()=>x.LogitsProcessorList,LogitsWarper:()=>x.LogitsWarper,LongT5ForConditionalGeneration:()=>n.LongT5ForConditionalGeneration,LongT5Model:()=>n.LongT5Model,LongT5PreTrainedModel:()=>n.LongT5PreTrainedModel,M2M100ForConditionalGeneration:()=>n.M2M100ForConditionalGeneration,M2M100Model:()=>n.M2M100Model,M2M100PreTrainedModel:()=>n.M2M100PreTrainedModel,M2M100Tokenizer:()=>r.M2M100Tokenizer,MBart50Tokenizer:()=>r.MBart50Tokenizer,MBartForCausalLM:()=>n.MBartForCausalLM,MBartForConditionalGeneration:()=>n.MBartForConditionalGeneration,MBartForSequenceClassification:()=>n.MBartForSequenceClassification,MBartModel:()=>n.MBartModel,MBartPreTrainedModel:()=>n.MBartPreTrainedModel,MBartTokenizer:()=>r.MBartTokenizer,MPNetForMaskedLM:()=>n.MPNetForMaskedLM,MPNetForQuestionAnswering:()=>n.MPNetForQuestionAnswering,MPNetForSequenceClassification:()=>n.MPNetForSequenceClassification,MPNetForTokenClassification:()=>n.MPNetForTokenClassification,MPNetModel:()=>n.MPNetModel,MPNetPreTrainedModel:()=>n.MPNetPreTrainedModel,MPNetTokenizer:()=>r.MPNetTokenizer,MT5ForConditionalGeneration:()=>n.MT5ForConditionalGeneration,MT5Model:()=>n.MT5Model,MT5PreTrainedModel:()=>n.MT5PreTrainedModel,MarianMTModel:()=>n.MarianMTModel,MarianModel:()=>n.MarianModel,MarianPreTrainedModel:()=>n.MarianPreTrainedModel,MarianTokenizer:()=>r.MarianTokenizer,Mask2FormerImageProcessor:()=>m.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>m.MaskFormerFeatureExtractor,MaskFormerForInstanceSegmentation:()=>n.MaskFormerForInstanceSegmentation,MaskFormerImageProcessor:()=>m.MaskFormerImageProcessor,MaskFormerModel:()=>n.MaskFormerModel,MaskFormerPreTrainedModel:()=>n.MaskFormerPreTrainedModel,MaskedLMOutput:()=>n.MaskedLMOutput,MaxLengthCriteria:()=>b.MaxLengthCriteria,Metric3DForDepthEstimation:()=>n.Metric3DForDepthEstimation,Metric3DPreTrainedModel:()=>n.Metric3DPreTrainedModel,Metric3Dv2ForDepthEstimation:()=>n.Metric3Dv2ForDepthEstimation,Metric3Dv2PreTrainedModel:()=>n.Metric3Dv2PreTrainedModel,MgpstrForSceneTextRecognition:()=>n.MgpstrForSceneTextRecognition,MgpstrModelOutput:()=>n.MgpstrModelOutput,MgpstrPreTrainedModel:()=>n.MgpstrPreTrainedModel,MgpstrProcessor:()=>_.MgpstrProcessor,MgpstrTokenizer:()=>r.MgpstrTokenizer,MimiDecoderModel:()=>n.MimiDecoderModel,MimiDecoderOutput:()=>n.MimiDecoderOutput,MimiEncoderModel:()=>n.MimiEncoderModel,MimiEncoderOutput:()=>n.MimiEncoderOutput,MimiModel:()=>n.MimiModel,MimiPreTrainedModel:()=>n.MimiPreTrainedModel,MinLengthLogitsProcessor:()=>x.MinLengthLogitsProcessor,MinNewTokensLengthLogitsProcessor:()=>x.MinNewTokensLengthLogitsProcessor,Ministral3ForCausalLM:()=>n.Ministral3ForCausalLM,Ministral3Model:()=>n.Ministral3Model,Ministral3PreTrainedModel:()=>n.Ministral3PreTrainedModel,MinistralForCausalLM:()=>n.MinistralForCausalLM,MinistralModel:()=>n.MinistralModel,MinistralPreTrainedModel:()=>n.MinistralPreTrainedModel,Mistral3ForConditionalGeneration:()=>n.Mistral3ForConditionalGeneration,MistralForCausalLM:()=>n.MistralForCausalLM,MistralModel:()=>n.MistralModel,MistralPreTrainedModel:()=>n.MistralPreTrainedModel,MobileBertForMaskedLM:()=>n.MobileBertForMaskedLM,MobileBertForQuestionAnswering:()=>n.MobileBertForQuestionAnswering,MobileBertForSequenceClassification:()=>n.MobileBertForSequenceClassification,MobileBertModel:()=>n.MobileBertModel,MobileBertPreTrainedModel:()=>n.MobileBertPreTrainedModel,MobileBertTokenizer:()=>r.MobileBertTokenizer,MobileLLMForCausalLM:()=>n.MobileLLMForCausalLM,MobileLLMModel:()=>n.MobileLLMModel,MobileLLMPreTrainedModel:()=>n.MobileLLMPreTrainedModel,MobileNetV1FeatureExtractor:()=>m.MobileNetV1FeatureExtractor,MobileNetV1ForImageClassification:()=>n.MobileNetV1ForImageClassification,MobileNetV1ForSemanticSegmentation:()=>n.MobileNetV1ForSemanticSegmentation,MobileNetV1ImageProcessor:()=>m.MobileNetV1ImageProcessor,MobileNetV1Model:()=>n.MobileNetV1Model,MobileNetV1PreTrainedModel:()=>n.MobileNetV1PreTrainedModel,MobileNetV2FeatureExtractor:()=>m.MobileNetV2FeatureExtractor,MobileNetV2ForImageClassification:()=>n.MobileNetV2ForImageClassification,MobileNetV2ForSemanticSegmentation:()=>n.MobileNetV2ForSemanticSegmentation,MobileNetV2ImageProcessor:()=>m.MobileNetV2ImageProcessor,MobileNetV2Model:()=>n.MobileNetV2Model,MobileNetV2PreTrainedModel:()=>n.MobileNetV2PreTrainedModel,MobileNetV3FeatureExtractor:()=>m.MobileNetV3FeatureExtractor,MobileNetV3ForImageClassification:()=>n.MobileNetV3ForImageClassification,MobileNetV3ForSemanticSegmentation:()=>n.MobileNetV3ForSemanticSegmentation,MobileNetV3ImageProcessor:()=>m.MobileNetV3ImageProcessor,MobileNetV3Model:()=>n.MobileNetV3Model,MobileNetV3PreTrainedModel:()=>n.MobileNetV3PreTrainedModel,MobileNetV4FeatureExtractor:()=>m.MobileNetV4FeatureExtractor,MobileNetV4ForImageClassification:()=>n.MobileNetV4ForImageClassification,MobileNetV4ForSemanticSegmentation:()=>n.MobileNetV4ForSemanticSegmentation,MobileNetV4ImageProcessor:()=>m.MobileNetV4ImageProcessor,MobileNetV4Model:()=>n.MobileNetV4Model,MobileNetV4PreTrainedModel:()=>n.MobileNetV4PreTrainedModel,MobileViTFeatureExtractor:()=>m.MobileViTFeatureExtractor,MobileViTForImageClassification:()=>n.MobileViTForImageClassification,MobileViTImageProcessor:()=>m.MobileViTImageProcessor,MobileViTModel:()=>n.MobileViTModel,MobileViTPreTrainedModel:()=>n.MobileViTPreTrainedModel,MobileViTV2ForImageClassification:()=>n.MobileViTV2ForImageClassification,MobileViTV2Model:()=>n.MobileViTV2Model,MobileViTV2PreTrainedModel:()=>n.MobileViTV2PreTrainedModel,ModelOutput:()=>n.ModelOutput,ModernBertDecoderForCausalLM:()=>n.ModernBertDecoderForCausalLM,ModernBertDecoderModel:()=>n.ModernBertDecoderModel,ModernBertDecoderPreTrainedModel:()=>n.ModernBertDecoderPreTrainedModel,ModernBertForMaskedLM:()=>n.ModernBertForMaskedLM,ModernBertForSequenceClassification:()=>n.ModernBertForSequenceClassification,ModernBertForTokenClassification:()=>n.ModernBertForTokenClassification,ModernBertModel:()=>n.ModernBertModel,ModernBertPreTrainedModel:()=>n.ModernBertPreTrainedModel,Moondream1ForConditionalGeneration:()=>n.Moondream1ForConditionalGeneration,MoonshineFeatureExtractor:()=>d.MoonshineFeatureExtractor,MoonshineForConditionalGeneration:()=>n.MoonshineForConditionalGeneration,MoonshineModel:()=>n.MoonshineModel,MoonshinePreTrainedModel:()=>n.MoonshinePreTrainedModel,MoonshineProcessor:()=>_.MoonshineProcessor,MptForCausalLM:()=>n.MptForCausalLM,MptModel:()=>n.MptModel,MptPreTrainedModel:()=>n.MptPreTrainedModel,MultiModalityCausalLM:()=>n.MultiModalityCausalLM,MultiModalityPreTrainedModel:()=>n.MultiModalityPreTrainedModel,MusicgenForCausalLM:()=>n.MusicgenForCausalLM,MusicgenForConditionalGeneration:()=>n.MusicgenForConditionalGeneration,MusicgenModel:()=>n.MusicgenModel,MusicgenPreTrainedModel:()=>n.MusicgenPreTrainedModel,NanoChatForCausalLM:()=>n.NanoChatForCausalLM,NanoChatModel:()=>n.NanoChatModel,NanoChatPreTrainedModel:()=>n.NanoChatPreTrainedModel,NeoBertForMaskedLM:()=>n.NeoBertForMaskedLM,NeoBertForQuestionAnswering:()=>n.NeoBertForQuestionAnswering,NeoBertForSequenceClassification:()=>n.NeoBertForSequenceClassification,NeoBertForTokenClassification:()=>n.NeoBertForTokenClassification,NeoBertModel:()=>n.NeoBertModel,NeoBertPreTrainedModel:()=>n.NeoBertPreTrainedModel,NllbTokenizer:()=>r.NllbTokenizer,NoBadWordsLogitsProcessor:()=>x.NoBadWordsLogitsProcessor,NoRepeatNGramLogitsProcessor:()=>x.NoRepeatNGramLogitsProcessor,NomicBertModel:()=>n.NomicBertModel,NomicBertPreTrainedModel:()=>n.NomicBertPreTrainedModel,NougatImageProcessor:()=>m.NougatImageProcessor,NougatTokenizer:()=>r.NougatTokenizer,OPTForCausalLM:()=>n.OPTForCausalLM,OPTModel:()=>n.OPTModel,OPTPreTrainedModel:()=>n.OPTPreTrainedModel,ObjectDetectionPipeline:()=>t.ObjectDetectionPipeline,Olmo2ForCausalLM:()=>n.Olmo2ForCausalLM,Olmo2Model:()=>n.Olmo2Model,Olmo2PreTrainedModel:()=>n.Olmo2PreTrainedModel,OlmoForCausalLM:()=>n.OlmoForCausalLM,OlmoModel:()=>n.OlmoModel,OlmoPreTrainedModel:()=>n.OlmoPreTrainedModel,OpenELMForCausalLM:()=>n.OpenELMForCausalLM,OpenELMModel:()=>n.OpenELMModel,OpenELMPreTrainedModel:()=>n.OpenELMPreTrainedModel,OwlViTFeatureExtractor:()=>m.OwlViTFeatureExtractor,OwlViTForObjectDetection:()=>n.OwlViTForObjectDetection,OwlViTImageProcessor:()=>m.OwlViTImageProcessor,OwlViTModel:()=>n.OwlViTModel,OwlViTPreTrainedModel:()=>n.OwlViTPreTrainedModel,OwlViTProcessor:()=>_.OwlViTProcessor,Owlv2ForObjectDetection:()=>n.Owlv2ForObjectDetection,Owlv2ImageProcessor:()=>m.Owlv2ImageProcessor,Owlv2Model:()=>n.Owlv2Model,Owlv2PreTrainedModel:()=>n.Owlv2PreTrainedModel,PaliGemmaForConditionalGeneration:()=>n.PaliGemmaForConditionalGeneration,PaliGemmaPreTrainedModel:()=>n.PaliGemmaPreTrainedModel,PaliGemmaProcessor:()=>_.PaliGemmaProcessor,ParakeetFeatureExtractor:()=>d.ParakeetFeatureExtractor,ParakeetForCTC:()=>n.ParakeetForCTC,ParakeetPreTrainedModel:()=>n.ParakeetPreTrainedModel,PatchTSMixerForPrediction:()=>n.PatchTSMixerForPrediction,PatchTSMixerModel:()=>n.PatchTSMixerModel,PatchTSMixerPreTrainedModel:()=>n.PatchTSMixerPreTrainedModel,PatchTSTForPrediction:()=>n.PatchTSTForPrediction,PatchTSTModel:()=>n.PatchTSTModel,PatchTSTPreTrainedModel:()=>n.PatchTSTPreTrainedModel,Phi3ForCausalLM:()=>n.Phi3ForCausalLM,Phi3Model:()=>n.Phi3Model,Phi3PreTrainedModel:()=>n.Phi3PreTrainedModel,Phi3VForCausalLM:()=>n.Phi3VForCausalLM,Phi3VImageProcessor:()=>m.Phi3VImageProcessor,Phi3VPreTrainedModel:()=>n.Phi3VPreTrainedModel,Phi3VProcessor:()=>_.Phi3VProcessor,PhiForCausalLM:()=>n.PhiForCausalLM,PhiModel:()=>n.PhiModel,PhiPreTrainedModel:()=>n.PhiPreTrainedModel,Pipeline:()=>t.Pipeline,PixtralImageProcessor:()=>m.PixtralImageProcessor,PixtralProcessor:()=>_.PixtralProcessor,PreTrainedModel:()=>n.PreTrainedModel,PreTrainedTokenizer:()=>r.PreTrainedTokenizer,PretrainedConfig:()=>i.PretrainedConfig,PretrainedMixin:()=>n.PretrainedMixin,Processor:()=>g.Processor,PvtForImageClassification:()=>n.PvtForImageClassification,PvtImageProcessor:()=>m.PvtImageProcessor,PvtModel:()=>n.PvtModel,PvtPreTrainedModel:()=>n.PvtPreTrainedModel,PyAnnoteFeatureExtractor:()=>d.PyAnnoteFeatureExtractor,PyAnnoteForAudioFrameClassification:()=>n.PyAnnoteForAudioFrameClassification,PyAnnoteModel:()=>n.PyAnnoteModel,PyAnnotePreTrainedModel:()=>n.PyAnnotePreTrainedModel,PyAnnoteProcessor:()=>_.PyAnnoteProcessor,QuestionAnsweringModelOutput:()=>n.QuestionAnsweringModelOutput,QuestionAnsweringPipeline:()=>t.QuestionAnsweringPipeline,Qwen2ForCausalLM:()=>n.Qwen2ForCausalLM,Qwen2Model:()=>n.Qwen2Model,Qwen2PreTrainedModel:()=>n.Qwen2PreTrainedModel,Qwen2Tokenizer:()=>r.Qwen2Tokenizer,Qwen2VLForConditionalGeneration:()=>n.Qwen2VLForConditionalGeneration,Qwen2VLImageProcessor:()=>m.Qwen2VLImageProcessor,Qwen2VLPreTrainedModel:()=>n.Qwen2VLPreTrainedModel,Qwen2VLProcessor:()=>_.Qwen2VLProcessor,Qwen3ForCausalLM:()=>n.Qwen3ForCausalLM,Qwen3Model:()=>n.Qwen3Model,Qwen3PreTrainedModel:()=>n.Qwen3PreTrainedModel,RFDetrForObjectDetection:()=>n.RFDetrForObjectDetection,RFDetrModel:()=>n.RFDetrModel,RFDetrObjectDetectionOutput:()=>n.RFDetrObjectDetectionOutput,RFDetrPreTrainedModel:()=>n.RFDetrPreTrainedModel,RTDetrForObjectDetection:()=>n.RTDetrForObjectDetection,RTDetrImageProcessor:()=>m.RTDetrImageProcessor,RTDetrModel:()=>n.RTDetrModel,RTDetrObjectDetectionOutput:()=>n.RTDetrObjectDetectionOutput,RTDetrPreTrainedModel:()=>n.RTDetrPreTrainedModel,RTDetrV2ForObjectDetection:()=>n.RTDetrV2ForObjectDetection,RTDetrV2Model:()=>n.RTDetrV2Model,RTDetrV2ObjectDetectionOutput:()=>n.RTDetrV2ObjectDetectionOutput,RTDetrV2PreTrainedModel:()=>n.RTDetrV2PreTrainedModel,RawAudio:()=>a.RawAudio,RawImage:()=>o.RawImage,RawVideo:()=>s.RawVideo,RawVideoFrame:()=>s.RawVideoFrame,RepetitionPenaltyLogitsProcessor:()=>x.RepetitionPenaltyLogitsProcessor,ResNetForImageClassification:()=>n.ResNetForImageClassification,ResNetModel:()=>n.ResNetModel,ResNetPreTrainedModel:()=>n.ResNetPreTrainedModel,RoFormerForMaskedLM:()=>n.RoFormerForMaskedLM,RoFormerForQuestionAnswering:()=>n.RoFormerForQuestionAnswering,RoFormerForSequenceClassification:()=>n.RoFormerForSequenceClassification,RoFormerForTokenClassification:()=>n.RoFormerForTokenClassification,RoFormerModel:()=>n.RoFormerModel,RoFormerPreTrainedModel:()=>n.RoFormerPreTrainedModel,RoFormerTokenizer:()=>r.RoFormerTokenizer,RobertaForMaskedLM:()=>n.RobertaForMaskedLM,RobertaForQuestionAnswering:()=>n.RobertaForQuestionAnswering,RobertaForSequenceClassification:()=>n.RobertaForSequenceClassification,RobertaForTokenClassification:()=>n.RobertaForTokenClassification,RobertaModel:()=>n.RobertaModel,RobertaPreTrainedModel:()=>n.RobertaPreTrainedModel,RobertaTokenizer:()=>r.RobertaTokenizer,Sam2ImageProcessor:()=>m.Sam2ImageProcessor,Sam2ImageSegmentationOutput:()=>n.Sam2ImageSegmentationOutput,Sam2Model:()=>n.Sam2Model,Sam2PreTrainedModel:()=>n.Sam2PreTrainedModel,Sam2Processor:()=>_.Sam2Processor,Sam2VideoProcessor:()=>_.Sam2VideoProcessor,Sam3ImageProcessor:()=>m.Sam3ImageProcessor,Sam3TrackerModel:()=>n.Sam3TrackerModel,SamImageProcessor:()=>m.SamImageProcessor,SamImageSegmentationOutput:()=>n.SamImageSegmentationOutput,SamModel:()=>n.SamModel,SamPreTrainedModel:()=>n.SamPreTrainedModel,SamProcessor:()=>_.SamProcessor,SapiensForDepthEstimation:()=>n.SapiensForDepthEstimation,SapiensForNormalEstimation:()=>n.SapiensForNormalEstimation,SapiensForSemanticSegmentation:()=>n.SapiensForSemanticSegmentation,SapiensPreTrainedModel:()=>n.SapiensPreTrainedModel,SeamlessM4TFeatureExtractor:()=>d.SeamlessM4TFeatureExtractor,SegformerFeatureExtractor:()=>m.SegformerFeatureExtractor,SegformerForImageClassification:()=>n.SegformerForImageClassification,SegformerForSemanticSegmentation:()=>n.SegformerForSemanticSegmentation,SegformerImageProcessor:()=>m.SegformerImageProcessor,SegformerModel:()=>n.SegformerModel,SegformerPreTrainedModel:()=>n.SegformerPreTrainedModel,Seq2SeqLMOutput:()=>n.Seq2SeqLMOutput,SequenceClassifierOutput:()=>n.SequenceClassifierOutput,SiglipImageProcessor:()=>m.SiglipImageProcessor,SiglipModel:()=>n.SiglipModel,SiglipPreTrainedModel:()=>n.SiglipPreTrainedModel,SiglipTextModel:()=>n.SiglipTextModel,SiglipTokenizer:()=>r.SiglipTokenizer,SiglipVisionModel:()=>n.SiglipVisionModel,SmolLM3ForCausalLM:()=>n.SmolLM3ForCausalLM,SmolLM3Model:()=>n.SmolLM3Model,SmolLM3PreTrainedModel:()=>n.SmolLM3PreTrainedModel,SmolVLMForConditionalGeneration:()=>n.SmolVLMForConditionalGeneration,SmolVLMImageProcessor:()=>m.SmolVLMImageProcessor,SmolVLMProcessor:()=>_.SmolVLMProcessor,SnacDecoderModel:()=>n.SnacDecoderModel,SnacEncoderModel:()=>n.SnacEncoderModel,SnacFeatureExtractor:()=>d.SnacFeatureExtractor,SnacModel:()=>n.SnacModel,SnacPreTrainedModel:()=>n.SnacPreTrainedModel,SpeechT5FeatureExtractor:()=>d.SpeechT5FeatureExtractor,SpeechT5ForSpeechToText:()=>n.SpeechT5ForSpeechToText,SpeechT5ForTextToSpeech:()=>n.SpeechT5ForTextToSpeech,SpeechT5HifiGan:()=>n.SpeechT5HifiGan,SpeechT5Model:()=>n.SpeechT5Model,SpeechT5PreTrainedModel:()=>n.SpeechT5PreTrainedModel,SpeechT5Processor:()=>_.SpeechT5Processor,SpeechT5Tokenizer:()=>r.SpeechT5Tokenizer,SqueezeBertForMaskedLM:()=>n.SqueezeBertForMaskedLM,SqueezeBertForQuestionAnswering:()=>n.SqueezeBertForQuestionAnswering,SqueezeBertForSequenceClassification:()=>n.SqueezeBertForSequenceClassification,SqueezeBertModel:()=>n.SqueezeBertModel,SqueezeBertPreTrainedModel:()=>n.SqueezeBertPreTrainedModel,SqueezeBertTokenizer:()=>r.SqueezeBertTokenizer,StableLmForCausalLM:()=>n.StableLmForCausalLM,StableLmModel:()=>n.StableLmModel,StableLmPreTrainedModel:()=>n.StableLmPreTrainedModel,Starcoder2ForCausalLM:()=>n.Starcoder2ForCausalLM,Starcoder2Model:()=>n.Starcoder2Model,Starcoder2PreTrainedModel:()=>n.Starcoder2PreTrainedModel,StoppingCriteria:()=>b.StoppingCriteria,StoppingCriteriaList:()=>b.StoppingCriteriaList,StyleTextToSpeech2Model:()=>n.StyleTextToSpeech2Model,StyleTextToSpeech2PreTrainedModel:()=>n.StyleTextToSpeech2PreTrainedModel,SummarizationPipeline:()=>t.SummarizationPipeline,SupertonicForConditionalGeneration:()=>n.SupertonicForConditionalGeneration,SupertonicPreTrainedModel:()=>n.SupertonicPreTrainedModel,SuppressTokensAtBeginLogitsProcessor:()=>x.SuppressTokensAtBeginLogitsProcessor,Swin2SRForImageSuperResolution:()=>n.Swin2SRForImageSuperResolution,Swin2SRImageProcessor:()=>m.Swin2SRImageProcessor,Swin2SRModel:()=>n.Swin2SRModel,Swin2SRPreTrainedModel:()=>n.Swin2SRPreTrainedModel,SwinForImageClassification:()=>n.SwinForImageClassification,SwinForSemanticSegmentation:()=>n.SwinForSemanticSegmentation,SwinModel:()=>n.SwinModel,SwinPreTrainedModel:()=>n.SwinPreTrainedModel,T5ForConditionalGeneration:()=>n.T5ForConditionalGeneration,T5Model:()=>n.T5Model,T5PreTrainedModel:()=>n.T5PreTrainedModel,T5Tokenizer:()=>r.T5Tokenizer,TableTransformerForObjectDetection:()=>n.TableTransformerForObjectDetection,TableTransformerModel:()=>n.TableTransformerModel,TableTransformerObjectDetectionOutput:()=>n.TableTransformerObjectDetectionOutput,TableTransformerPreTrainedModel:()=>n.TableTransformerPreTrainedModel,TemperatureLogitsWarper:()=>x.TemperatureLogitsWarper,Tensor:()=>c.Tensor,Text2TextGenerationPipeline:()=>t.Text2TextGenerationPipeline,TextClassificationPipeline:()=>t.TextClassificationPipeline,TextGenerationPipeline:()=>t.TextGenerationPipeline,TextStreamer:()=>y.TextStreamer,TextToAudioPipeline:()=>t.TextToAudioPipeline,TokenClassificationPipeline:()=>t.TokenClassificationPipeline,TokenClassifierOutput:()=>n.TokenClassifierOutput,TokenizerModel:()=>r.TokenizerModel,TopKLogitsWarper:()=>x.TopKLogitsWarper,TopPLogitsWarper:()=>x.TopPLogitsWarper,TrOCRForCausalLM:()=>n.TrOCRForCausalLM,TrOCRPreTrainedModel:()=>n.TrOCRPreTrainedModel,TranslationPipeline:()=>t.TranslationPipeline,UltravoxModel:()=>n.UltravoxModel,UltravoxPreTrainedModel:()=>n.UltravoxPreTrainedModel,UltravoxProcessor:()=>_.UltravoxProcessor,UniSpeechForCTC:()=>n.UniSpeechForCTC,UniSpeechForSequenceClassification:()=>n.UniSpeechForSequenceClassification,UniSpeechModel:()=>n.UniSpeechModel,UniSpeechPreTrainedModel:()=>n.UniSpeechPreTrainedModel,UniSpeechSatForAudioFrameClassification:()=>n.UniSpeechSatForAudioFrameClassification,UniSpeechSatForCTC:()=>n.UniSpeechSatForCTC,UniSpeechSatForSequenceClassification:()=>n.UniSpeechSatForSequenceClassification,UniSpeechSatModel:()=>n.UniSpeechSatModel,UniSpeechSatPreTrainedModel:()=>n.UniSpeechSatPreTrainedModel,VLChatProcessor:()=>_.VLChatProcessor,VLMImageProcessor:()=>m.VLMImageProcessor,VaultGemmaForCausalLM:()=>n.VaultGemmaForCausalLM,VaultGemmaModel:()=>n.VaultGemmaModel,VaultGemmaPreTrainedModel:()=>n.VaultGemmaPreTrainedModel,ViTFeatureExtractor:()=>m.ViTFeatureExtractor,ViTForImageClassification:()=>n.ViTForImageClassification,ViTImageProcessor:()=>m.ViTImageProcessor,ViTMAEModel:()=>n.ViTMAEModel,ViTMAEPreTrainedModel:()=>n.ViTMAEPreTrainedModel,ViTMSNForImageClassification:()=>n.ViTMSNForImageClassification,ViTMSNModel:()=>n.ViTMSNModel,ViTMSNPreTrainedModel:()=>n.ViTMSNPreTrainedModel,ViTModel:()=>n.ViTModel,ViTPreTrainedModel:()=>n.ViTPreTrainedModel,VisionEncoderDecoderModel:()=>n.VisionEncoderDecoderModel,VitMatteForImageMatting:()=>n.VitMatteForImageMatting,VitMatteImageProcessor:()=>m.VitMatteImageProcessor,VitMattePreTrainedModel:()=>n.VitMattePreTrainedModel,VitPoseForPoseEstimation:()=>n.VitPoseForPoseEstimation,VitPoseImageProcessor:()=>m.VitPoseImageProcessor,VitPosePreTrainedModel:()=>n.VitPosePreTrainedModel,VitsModel:()=>n.VitsModel,VitsModelOutput:()=>n.VitsModelOutput,VitsPreTrainedModel:()=>n.VitsPreTrainedModel,VitsTokenizer:()=>r.VitsTokenizer,VoxtralForConditionalGeneration:()=>n.VoxtralForConditionalGeneration,VoxtralProcessor:()=>_.VoxtralProcessor,Wav2Vec2BertForCTC:()=>n.Wav2Vec2BertForCTC,Wav2Vec2BertForSequenceClassification:()=>n.Wav2Vec2BertForSequenceClassification,Wav2Vec2BertModel:()=>n.Wav2Vec2BertModel,Wav2Vec2BertPreTrainedModel:()=>n.Wav2Vec2BertPreTrainedModel,Wav2Vec2CTCTokenizer:()=>r.Wav2Vec2CTCTokenizer,Wav2Vec2FeatureExtractor:()=>d.Wav2Vec2FeatureExtractor,Wav2Vec2ForAudioFrameClassification:()=>n.Wav2Vec2ForAudioFrameClassification,Wav2Vec2ForCTC:()=>n.Wav2Vec2ForCTC,Wav2Vec2ForSequenceClassification:()=>n.Wav2Vec2ForSequenceClassification,Wav2Vec2Model:()=>n.Wav2Vec2Model,Wav2Vec2PreTrainedModel:()=>n.Wav2Vec2PreTrainedModel,Wav2Vec2Processor:()=>_.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>_.Wav2Vec2ProcessorWithLM,WavLMForAudioFrameClassification:()=>n.WavLMForAudioFrameClassification,WavLMForCTC:()=>n.WavLMForCTC,WavLMForSequenceClassification:()=>n.WavLMForSequenceClassification,WavLMForXVector:()=>n.WavLMForXVector,WavLMModel:()=>n.WavLMModel,WavLMPreTrainedModel:()=>n.WavLMPreTrainedModel,WeSpeakerFeatureExtractor:()=>d.WeSpeakerFeatureExtractor,WeSpeakerResNetModel:()=>n.WeSpeakerResNetModel,WeSpeakerResNetPreTrainedModel:()=>n.WeSpeakerResNetPreTrainedModel,WhisperFeatureExtractor:()=>d.WhisperFeatureExtractor,WhisperForConditionalGeneration:()=>n.WhisperForConditionalGeneration,WhisperModel:()=>n.WhisperModel,WhisperPreTrainedModel:()=>n.WhisperPreTrainedModel,WhisperProcessor:()=>_.WhisperProcessor,WhisperTextStreamer:()=>y.WhisperTextStreamer,WhisperTimeStampLogitsProcessor:()=>x.WhisperTimeStampLogitsProcessor,WhisperTokenizer:()=>r.WhisperTokenizer,XLMForQuestionAnswering:()=>n.XLMForQuestionAnswering,XLMForSequenceClassification:()=>n.XLMForSequenceClassification,XLMForTokenClassification:()=>n.XLMForTokenClassification,XLMModel:()=>n.XLMModel,XLMPreTrainedModel:()=>n.XLMPreTrainedModel,XLMRobertaForMaskedLM:()=>n.XLMRobertaForMaskedLM,XLMRobertaForQuestionAnswering:()=>n.XLMRobertaForQuestionAnswering,XLMRobertaForSequenceClassification:()=>n.XLMRobertaForSequenceClassification,XLMRobertaForTokenClassification:()=>n.XLMRobertaForTokenClassification,XLMRobertaModel:()=>n.XLMRobertaModel,XLMRobertaPreTrainedModel:()=>n.XLMRobertaPreTrainedModel,XLMRobertaTokenizer:()=>r.XLMRobertaTokenizer,XLMTokenizer:()=>r.XLMTokenizer,XLMWithLMHeadModel:()=>n.XLMWithLMHeadModel,XVectorOutput:()=>n.XVectorOutput,YolosFeatureExtractor:()=>m.YolosFeatureExtractor,YolosForObjectDetection:()=>n.YolosForObjectDetection,YolosImageProcessor:()=>m.YolosImageProcessor,YolosModel:()=>n.YolosModel,YolosObjectDetectionOutput:()=>n.YolosObjectDetectionOutput,YolosPreTrainedModel:()=>n.YolosPreTrainedModel,ZeroShotAudioClassificationPipeline:()=>t.ZeroShotAudioClassificationPipeline,ZeroShotClassificationPipeline:()=>t.ZeroShotClassificationPipeline,ZeroShotImageClassificationPipeline:()=>t.ZeroShotImageClassificationPipeline,ZeroShotObjectDetectionPipeline:()=>t.ZeroShotObjectDetectionPipeline,bankers_round:()=>l.bankers_round,cat:()=>c.cat,cos_sim:()=>l.cos_sim,dot:()=>l.dot,dynamic_time_warping:()=>l.dynamic_time_warping,env:()=>e.env,full:()=>c.full,full_like:()=>c.full_like,getCacheShapes:()=>i.getCacheShapes,hamming:()=>a.hamming,hanning:()=>a.hanning,interpolate:()=>c.interpolate,interpolate_4d:()=>c.interpolate_4d,interpolate_data:()=>l.interpolate_data,is_chinese_char:()=>r.is_chinese_char,layer_norm:()=>c.layer_norm,load_image:()=>o.load_image,load_video:()=>s.load_video,log_softmax:()=>l.log_softmax,magnitude:()=>l.magnitude,matmul:()=>c.matmul,max:()=>l.max,mean:()=>c.mean,mean_pooling:()=>c.mean_pooling,medianFilter:()=>l.medianFilter,mel_filter_bank:()=>a.mel_filter_bank,min:()=>l.min,ones:()=>c.ones,ones_like:()=>c.ones_like,permute:()=>c.permute,permute_data:()=>l.permute_data,pipeline:()=>t.pipeline,quantize_embeddings:()=>c.quantize_embeddings,rand:()=>c.rand,randn:()=>c.randn,read_audio:()=>a.read_audio,rfft:()=>c.rfft,round:()=>l.round,slice:()=>c.slice,softmax:()=>l.softmax,spectrogram:()=>a.spectrogram,stack:()=>c.stack,std_mean:()=>c.std_mean,topk:()=>c.topk,window_function:()=>a.window_function,zeros:()=>c.zeros,zeros_like:()=>c.zeros_like});var e=TH(`./src/env.js`),t=TH(`./src/pipelines.js`),n=TH(`./src/models.js`),r=TH(`./src/tokenizers.js`),i=TH(`./src/configs.js`),a=TH(`./src/utils/audio.js`),o=TH(`./src/utils/image.js`),s=TH(`./src/utils/video.js`),c=TH(`./src/utils/tensor.js`),l=TH(`./src/utils/maths.js`),u=TH(`./src/base/feature_extraction_utils.js`),d=TH(`./src/models/feature_extractors.js`),f=TH(`./src/models/auto/feature_extraction_auto.js`),p=TH(`./src/base/image_processors_utils.js`),m=TH(`./src/models/image_processors.js`),h=TH(`./src/models/auto/image_processing_auto.js`),g=TH(`./src/base/processing_utils.js`),_=TH(`./src/models/processors.js`),v=TH(`./src/models/auto/processing_auto.js`),y=TH(`./src/generation/streamers.js`),b=TH(`./src/generation/stopping_criteria.js`),x=TH(`./src/generation/logits_process.js`)})(),Z.ASTFeatureExtractor,Z.ASTForAudioClassification,Z.ASTModel,Z.ASTPreTrainedModel,Z.AlbertForMaskedLM,Z.AlbertForQuestionAnswering,Z.AlbertForSequenceClassification,Z.AlbertModel,Z.AlbertPreTrainedModel,Z.AlbertTokenizer,Z.ArceeForCausalLM,Z.ArceeModel,Z.ArceePreTrainedModel,Z.AudioClassificationPipeline,Z.AutoConfig,Z.AutoFeatureExtractor,Z.AutoImageProcessor,Z.AutoModel,Z.AutoModelForAudioClassification,Z.AutoModelForAudioFrameClassification,Z.AutoModelForAudioTextToText,Z.AutoModelForCTC,Z.AutoModelForCausalLM,Z.AutoModelForDepthEstimation,Z.AutoModelForDocumentQuestionAnswering,Z.AutoModelForImageClassification,Z.AutoModelForImageFeatureExtraction,Z.AutoModelForImageMatting,Z.AutoModelForImageSegmentation,Z.AutoModelForImageTextToText,Z.AutoModelForImageToImage,Z.AutoModelForMaskGeneration,Z.AutoModelForMaskedLM,Z.AutoModelForNormalEstimation,Z.AutoModelForObjectDetection,Z.AutoModelForPoseEstimation,Z.AutoModelForQuestionAnswering,Z.AutoModelForSemanticSegmentation,Z.AutoModelForSeq2SeqLM,Z.AutoModelForSequenceClassification,Z.AutoModelForSpeechSeq2Seq,Z.AutoModelForTextToSpectrogram,Z.AutoModelForTextToWaveform,Z.AutoModelForTokenClassification,Z.AutoModelForUniversalSegmentation,Z.AutoModelForVision2Seq,Z.AutoModelForXVector,Z.AutoModelForZeroShotObjectDetection,Z.AutoProcessor;var EH=Z.AutoTokenizer;Z.AutomaticSpeechRecognitionPipeline,Z.BackgroundRemovalPipeline,Z.BartForConditionalGeneration,Z.BartForSequenceClassification,Z.BartModel,Z.BartPretrainedModel,Z.BartTokenizer,Z.BaseModelOutput,Z.BaseStreamer,Z.BeitFeatureExtractor,Z.BeitForImageClassification,Z.BeitModel,Z.BeitPreTrainedModel,Z.BertForMaskedLM,Z.BertForQuestionAnswering,Z.BertForSequenceClassification,Z.BertForTokenClassification,Z.BertModel,Z.BertPreTrainedModel,Z.BertTokenizer,Z.BitImageProcessor,Z.BlenderbotForConditionalGeneration,Z.BlenderbotModel,Z.BlenderbotPreTrainedModel,Z.BlenderbotSmallForConditionalGeneration,Z.BlenderbotSmallModel,Z.BlenderbotSmallPreTrainedModel,Z.BlenderbotSmallTokenizer,Z.BlenderbotTokenizer,Z.BloomForCausalLM,Z.BloomModel,Z.BloomPreTrainedModel,Z.BloomTokenizer,Z.CLIPFeatureExtractor,Z.CLIPImageProcessor,Z.CLIPModel,Z.CLIPPreTrainedModel,Z.CLIPSegForImageSegmentation,Z.CLIPSegModel,Z.CLIPSegPreTrainedModel,Z.CLIPTextModel,Z.CLIPTextModelWithProjection,Z.CLIPTokenizer,Z.CLIPVisionModel,Z.CLIPVisionModelWithProjection,Z.CamembertForMaskedLM,Z.CamembertForQuestionAnswering,Z.CamembertForSequenceClassification,Z.CamembertForTokenClassification,Z.CamembertModel,Z.CamembertPreTrainedModel,Z.CamembertTokenizer,Z.CausalLMOutput,Z.CausalLMOutputWithPast,Z.ChineseCLIPFeatureExtractor,Z.ChineseCLIPModel,Z.ChineseCLIPPreTrainedModel,Z.ClapAudioModelWithProjection,Z.ClapFeatureExtractor,Z.ClapModel,Z.ClapPreTrainedModel,Z.ClapTextModelWithProjection,Z.ClassifierFreeGuidanceLogitsProcessor,Z.CodeGenForCausalLM,Z.CodeGenModel,Z.CodeGenPreTrainedModel,Z.CodeGenTokenizer,Z.CodeLlamaTokenizer,Z.CohereForCausalLM,Z.CohereModel,Z.CoherePreTrainedModel,Z.CohereTokenizer,Z.ConvBertForMaskedLM,Z.ConvBertForQuestionAnswering,Z.ConvBertForSequenceClassification,Z.ConvBertForTokenClassification,Z.ConvBertModel,Z.ConvBertPreTrainedModel,Z.ConvBertTokenizer,Z.ConvNextFeatureExtractor,Z.ConvNextForImageClassification,Z.ConvNextImageProcessor,Z.ConvNextModel,Z.ConvNextPreTrainedModel,Z.ConvNextV2ForImageClassification,Z.ConvNextV2Model,Z.ConvNextV2PreTrainedModel,Z.DFineForObjectDetection,Z.DFineModel,Z.DFinePreTrainedModel,Z.DINOv3ConvNextModel,Z.DINOv3ConvNextPreTrainedModel,Z.DINOv3ViTImageProcessor,Z.DINOv3ViTModel,Z.DINOv3ViTPreTrainedModel,Z.DPTFeatureExtractor,Z.DPTForDepthEstimation,Z.DPTImageProcessor,Z.DPTModel,Z.DPTPreTrainedModel,Z.DacDecoderModel,Z.DacDecoderOutput,Z.DacEncoderModel,Z.DacEncoderOutput,Z.DacFeatureExtractor,Z.DacModel,Z.DacPreTrainedModel,Z.DataTypeMap,Z.DebertaForMaskedLM,Z.DebertaForQuestionAnswering,Z.DebertaForSequenceClassification,Z.DebertaForTokenClassification,Z.DebertaModel,Z.DebertaPreTrainedModel,Z.DebertaTokenizer,Z.DebertaV2ForMaskedLM,Z.DebertaV2ForQuestionAnswering,Z.DebertaV2ForSequenceClassification,Z.DebertaV2ForTokenClassification,Z.DebertaV2Model,Z.DebertaV2PreTrainedModel,Z.DebertaV2Tokenizer,Z.DecisionTransformerModel,Z.DecisionTransformerPreTrainedModel,Z.DeiTFeatureExtractor,Z.DeiTForImageClassification,Z.DeiTImageProcessor,Z.DeiTModel,Z.DeiTPreTrainedModel,Z.DepthAnythingForDepthEstimation,Z.DepthAnythingPreTrainedModel,Z.DepthEstimationPipeline,Z.DepthProForDepthEstimation,Z.DepthProPreTrainedModel,Z.DetrFeatureExtractor,Z.DetrForObjectDetection,Z.DetrForSegmentation,Z.DetrImageProcessor,Z.DetrModel,Z.DetrObjectDetectionOutput,Z.DetrPreTrainedModel,Z.DetrSegmentationOutput,Z.Dinov2ForImageClassification,Z.Dinov2Model,Z.Dinov2PreTrainedModel,Z.Dinov2WithRegistersForImageClassification,Z.Dinov2WithRegistersModel,Z.Dinov2WithRegistersPreTrainedModel,Z.DistilBertForMaskedLM,Z.DistilBertForQuestionAnswering,Z.DistilBertForSequenceClassification,Z.DistilBertForTokenClassification,Z.DistilBertModel,Z.DistilBertPreTrainedModel,Z.DistilBertTokenizer,Z.DocumentQuestionAnsweringPipeline,Z.DonutFeatureExtractor,Z.DonutImageProcessor,Z.DonutSwinModel,Z.DonutSwinPreTrainedModel,Z.EdgeTamModel,Z.EfficientNetForImageClassification,Z.EfficientNetImageProcessor,Z.EfficientNetModel,Z.EfficientNetPreTrainedModel,Z.ElectraForMaskedLM,Z.ElectraForQuestionAnswering,Z.ElectraForSequenceClassification,Z.ElectraForTokenClassification,Z.ElectraModel,Z.ElectraPreTrainedModel,Z.ElectraTokenizer,Z.EncodecFeatureExtractor,Z.EosTokenCriteria,Z.Ernie4_5ForCausalLM,Z.Ernie4_5Model,Z.Ernie4_5PreTrainedModel,Z.EsmForMaskedLM,Z.EsmForSequenceClassification,Z.EsmForTokenClassification,Z.EsmModel,Z.EsmPreTrainedModel,Z.EsmTokenizer,Z.ExaoneForCausalLM,Z.ExaoneModel,Z.ExaonePreTrainedModel,Z.FFT,Z.FalconForCausalLM,Z.FalconModel,Z.FalconPreTrainedModel,Z.FalconTokenizer,Z.FastViTForImageClassification,Z.FastViTModel,Z.FastViTPreTrainedModel,Z.FeatureExtractionPipeline,Z.FeatureExtractor,Z.FillMaskPipeline,Z.Florence2ForConditionalGeneration,Z.Florence2PreTrainedModel,Z.Florence2Processor,Z.ForcedBOSTokenLogitsProcessor,Z.ForcedEOSTokenLogitsProcessor,Z.GLPNFeatureExtractor,Z.GLPNForDepthEstimation,Z.GLPNModel,Z.GLPNPreTrainedModel,Z.GPT2LMHeadModel,Z.GPT2Model,Z.GPT2PreTrainedModel,Z.GPT2Tokenizer,Z.GPTBigCodeForCausalLM,Z.GPTBigCodeModel,Z.GPTBigCodePreTrainedModel,Z.GPTJForCausalLM,Z.GPTJModel,Z.GPTJPreTrainedModel,Z.GPTNeoForCausalLM,Z.GPTNeoModel,Z.GPTNeoPreTrainedModel,Z.GPTNeoXForCausalLM,Z.GPTNeoXModel,Z.GPTNeoXPreTrainedModel,Z.GPTNeoXTokenizer,Z.Gemma2ForCausalLM,Z.Gemma2Model,Z.Gemma2PreTrainedModel,Z.Gemma3ForCausalLM,Z.Gemma3Model,Z.Gemma3PreTrainedModel,Z.Gemma3nAudioFeatureExtractor,Z.Gemma3nForConditionalGeneration,Z.Gemma3nPreTrainedModel,Z.Gemma3nProcessor,Z.GemmaForCausalLM,Z.GemmaModel,Z.GemmaPreTrainedModel,Z.GemmaTokenizer,Z.GlmForCausalLM,Z.GlmModel,Z.GlmPreTrainedModel,Z.GraniteForCausalLM,Z.GraniteModel,Z.GraniteMoeHybridForCausalLM,Z.GraniteMoeHybridModel,Z.GraniteMoeHybridPreTrainedModel,Z.GranitePreTrainedModel,Z.Grok1Tokenizer,Z.GroundingDinoForObjectDetection,Z.GroundingDinoImageProcessor,Z.GroundingDinoPreTrainedModel,Z.GroundingDinoProcessor,Z.GroupViTModel,Z.GroupViTPreTrainedModel,Z.HeliumForCausalLM,Z.HeliumModel,Z.HeliumPreTrainedModel,Z.HerbertTokenizer,Z.HieraForImageClassification,Z.HieraModel,Z.HieraPreTrainedModel,Z.HubertForCTC,Z.HubertForSequenceClassification,Z.HubertModel,Z.HubertPreTrainedModel,Z.IJepaForImageClassification,Z.IJepaModel,Z.IJepaPreTrainedModel,Z.Idefics3ForConditionalGeneration,Z.Idefics3ImageProcessor,Z.Idefics3PreTrainedModel,Z.Idefics3Processor,Z.ImageClassificationPipeline,Z.ImageFeatureExtractionPipeline,Z.ImageFeatureExtractor,Z.ImageMattingOutput,Z.ImageProcessor,Z.ImageSegmentationPipeline,Z.ImageToImagePipeline,Z.ImageToTextPipeline,Z.InterruptableStoppingCriteria,Z.JAISLMHeadModel,Z.JAISModel,Z.JAISPreTrainedModel,Z.JinaCLIPImageProcessor,Z.JinaCLIPModel,Z.JinaCLIPPreTrainedModel,Z.JinaCLIPProcessor,Z.JinaCLIPTextModel,Z.JinaCLIPVisionModel,Z.Lfm2ForCausalLM,Z.Lfm2Model,Z.Lfm2PreTrainedModel,Z.LiteWhisperForConditionalGeneration,Z.Llama4ForCausalLM,Z.Llama4PreTrainedModel,Z.LlamaForCausalLM,Z.LlamaModel,Z.LlamaPreTrainedModel,Z.LlamaTokenizer,Z.LlavaForConditionalGeneration,Z.LlavaOnevisionForConditionalGeneration,Z.LlavaOnevisionImageProcessor,Z.LlavaPreTrainedModel,Z.LlavaProcessor,Z.LlavaQwen2ForCausalLM,Z.LogitsProcessor,Z.LogitsProcessorList,Z.LogitsWarper,Z.LongT5ForConditionalGeneration,Z.LongT5Model,Z.LongT5PreTrainedModel,Z.M2M100ForConditionalGeneration,Z.M2M100Model,Z.M2M100PreTrainedModel,Z.M2M100Tokenizer,Z.MBart50Tokenizer,Z.MBartForCausalLM,Z.MBartForConditionalGeneration,Z.MBartForSequenceClassification,Z.MBartModel,Z.MBartPreTrainedModel,Z.MBartTokenizer,Z.MPNetForMaskedLM,Z.MPNetForQuestionAnswering,Z.MPNetForSequenceClassification,Z.MPNetForTokenClassification,Z.MPNetModel,Z.MPNetPreTrainedModel,Z.MPNetTokenizer,Z.MT5ForConditionalGeneration,Z.MT5Model,Z.MT5PreTrainedModel,Z.MarianMTModel,Z.MarianModel,Z.MarianPreTrainedModel,Z.MarianTokenizer,Z.Mask2FormerImageProcessor,Z.MaskFormerFeatureExtractor,Z.MaskFormerForInstanceSegmentation,Z.MaskFormerImageProcessor,Z.MaskFormerModel,Z.MaskFormerPreTrainedModel,Z.MaskedLMOutput,Z.MaxLengthCriteria,Z.Metric3DForDepthEstimation,Z.Metric3DPreTrainedModel,Z.Metric3Dv2ForDepthEstimation,Z.Metric3Dv2PreTrainedModel,Z.MgpstrForSceneTextRecognition,Z.MgpstrModelOutput,Z.MgpstrPreTrainedModel,Z.MgpstrProcessor,Z.MgpstrTokenizer,Z.MimiDecoderModel,Z.MimiDecoderOutput,Z.MimiEncoderModel,Z.MimiEncoderOutput,Z.MimiModel,Z.MimiPreTrainedModel,Z.MinLengthLogitsProcessor,Z.MinNewTokensLengthLogitsProcessor,Z.Ministral3ForCausalLM,Z.Ministral3Model,Z.Ministral3PreTrainedModel,Z.MinistralForCausalLM,Z.MinistralModel,Z.MinistralPreTrainedModel,Z.Mistral3ForConditionalGeneration,Z.MistralForCausalLM,Z.MistralModel,Z.MistralPreTrainedModel,Z.MobileBertForMaskedLM,Z.MobileBertForQuestionAnswering,Z.MobileBertForSequenceClassification,Z.MobileBertModel,Z.MobileBertPreTrainedModel,Z.MobileBertTokenizer,Z.MobileLLMForCausalLM,Z.MobileLLMModel,Z.MobileLLMPreTrainedModel,Z.MobileNetV1FeatureExtractor,Z.MobileNetV1ForImageClassification,Z.MobileNetV1ForSemanticSegmentation,Z.MobileNetV1ImageProcessor,Z.MobileNetV1Model,Z.MobileNetV1PreTrainedModel,Z.MobileNetV2FeatureExtractor,Z.MobileNetV2ForImageClassification,Z.MobileNetV2ForSemanticSegmentation,Z.MobileNetV2ImageProcessor,Z.MobileNetV2Model,Z.MobileNetV2PreTrainedModel,Z.MobileNetV3FeatureExtractor,Z.MobileNetV3ForImageClassification,Z.MobileNetV3ForSemanticSegmentation,Z.MobileNetV3ImageProcessor,Z.MobileNetV3Model,Z.MobileNetV3PreTrainedModel,Z.MobileNetV4FeatureExtractor,Z.MobileNetV4ForImageClassification,Z.MobileNetV4ForSemanticSegmentation,Z.MobileNetV4ImageProcessor,Z.MobileNetV4Model,Z.MobileNetV4PreTrainedModel,Z.MobileViTFeatureExtractor,Z.MobileViTForImageClassification,Z.MobileViTImageProcessor,Z.MobileViTModel,Z.MobileViTPreTrainedModel,Z.MobileViTV2ForImageClassification,Z.MobileViTV2Model,Z.MobileViTV2PreTrainedModel,Z.ModelOutput,Z.ModernBertDecoderForCausalLM,Z.ModernBertDecoderModel,Z.ModernBertDecoderPreTrainedModel,Z.ModernBertForMaskedLM,Z.ModernBertForSequenceClassification,Z.ModernBertForTokenClassification,Z.ModernBertModel,Z.ModernBertPreTrainedModel,Z.Moondream1ForConditionalGeneration,Z.MoonshineFeatureExtractor,Z.MoonshineForConditionalGeneration,Z.MoonshineModel,Z.MoonshinePreTrainedModel,Z.MoonshineProcessor,Z.MptForCausalLM,Z.MptModel,Z.MptPreTrainedModel,Z.MultiModalityCausalLM,Z.MultiModalityPreTrainedModel,Z.MusicgenForCausalLM,Z.MusicgenForConditionalGeneration,Z.MusicgenModel,Z.MusicgenPreTrainedModel,Z.NanoChatForCausalLM,Z.NanoChatModel,Z.NanoChatPreTrainedModel,Z.NeoBertForMaskedLM,Z.NeoBertForQuestionAnswering,Z.NeoBertForSequenceClassification,Z.NeoBertForTokenClassification,Z.NeoBertModel,Z.NeoBertPreTrainedModel,Z.NllbTokenizer,Z.NoBadWordsLogitsProcessor,Z.NoRepeatNGramLogitsProcessor,Z.NomicBertModel,Z.NomicBertPreTrainedModel,Z.NougatImageProcessor,Z.NougatTokenizer,Z.OPTForCausalLM,Z.OPTModel,Z.OPTPreTrainedModel,Z.ObjectDetectionPipeline,Z.Olmo2ForCausalLM,Z.Olmo2Model,Z.Olmo2PreTrainedModel,Z.OlmoForCausalLM,Z.OlmoModel,Z.OlmoPreTrainedModel,Z.OpenELMForCausalLM,Z.OpenELMModel,Z.OpenELMPreTrainedModel,Z.OwlViTFeatureExtractor,Z.OwlViTForObjectDetection,Z.OwlViTImageProcessor,Z.OwlViTModel,Z.OwlViTPreTrainedModel,Z.OwlViTProcessor,Z.Owlv2ForObjectDetection,Z.Owlv2ImageProcessor,Z.Owlv2Model,Z.Owlv2PreTrainedModel,Z.PaliGemmaForConditionalGeneration,Z.PaliGemmaPreTrainedModel,Z.PaliGemmaProcessor,Z.ParakeetFeatureExtractor,Z.ParakeetForCTC,Z.ParakeetPreTrainedModel,Z.PatchTSMixerForPrediction,Z.PatchTSMixerModel,Z.PatchTSMixerPreTrainedModel,Z.PatchTSTForPrediction,Z.PatchTSTModel,Z.PatchTSTPreTrainedModel,Z.Phi3ForCausalLM,Z.Phi3Model,Z.Phi3PreTrainedModel,Z.Phi3VForCausalLM,Z.Phi3VImageProcessor,Z.Phi3VPreTrainedModel,Z.Phi3VProcessor,Z.PhiForCausalLM,Z.PhiModel,Z.PhiPreTrainedModel,Z.Pipeline,Z.PixtralImageProcessor,Z.PixtralProcessor,Z.PreTrainedModel,Z.PreTrainedTokenizer,Z.PretrainedConfig,Z.PretrainedMixin,Z.Processor,Z.PvtForImageClassification,Z.PvtImageProcessor,Z.PvtModel,Z.PvtPreTrainedModel,Z.PyAnnoteFeatureExtractor,Z.PyAnnoteForAudioFrameClassification,Z.PyAnnoteModel,Z.PyAnnotePreTrainedModel,Z.PyAnnoteProcessor,Z.QuestionAnsweringModelOutput,Z.QuestionAnsweringPipeline,Z.Qwen2ForCausalLM,Z.Qwen2Model,Z.Qwen2PreTrainedModel,Z.Qwen2Tokenizer,Z.Qwen2VLForConditionalGeneration,Z.Qwen2VLImageProcessor,Z.Qwen2VLPreTrainedModel,Z.Qwen2VLProcessor,Z.Qwen3ForCausalLM,Z.Qwen3Model,Z.Qwen3PreTrainedModel,Z.RFDetrForObjectDetection,Z.RFDetrModel,Z.RFDetrObjectDetectionOutput,Z.RFDetrPreTrainedModel,Z.RTDetrForObjectDetection,Z.RTDetrImageProcessor,Z.RTDetrModel,Z.RTDetrObjectDetectionOutput,Z.RTDetrPreTrainedModel,Z.RTDetrV2ForObjectDetection,Z.RTDetrV2Model,Z.RTDetrV2ObjectDetectionOutput,Z.RTDetrV2PreTrainedModel;var DH=Z.RawAudio;Z.RawImage,Z.RawVideo,Z.RawVideoFrame,Z.RepetitionPenaltyLogitsProcessor,Z.ResNetForImageClassification,Z.ResNetModel,Z.ResNetPreTrainedModel,Z.RoFormerForMaskedLM,Z.RoFormerForQuestionAnswering,Z.RoFormerForSequenceClassification,Z.RoFormerForTokenClassification,Z.RoFormerModel,Z.RoFormerPreTrainedModel,Z.RoFormerTokenizer,Z.RobertaForMaskedLM,Z.RobertaForQuestionAnswering,Z.RobertaForSequenceClassification,Z.RobertaForTokenClassification,Z.RobertaModel,Z.RobertaPreTrainedModel,Z.RobertaTokenizer,Z.Sam2ImageProcessor,Z.Sam2ImageSegmentationOutput,Z.Sam2Model,Z.Sam2PreTrainedModel,Z.Sam2Processor,Z.Sam2VideoProcessor,Z.Sam3ImageProcessor,Z.Sam3TrackerModel,Z.SamImageProcessor,Z.SamImageSegmentationOutput,Z.SamModel,Z.SamPreTrainedModel,Z.SamProcessor,Z.SapiensForDepthEstimation,Z.SapiensForNormalEstimation,Z.SapiensForSemanticSegmentation,Z.SapiensPreTrainedModel,Z.SeamlessM4TFeatureExtractor,Z.SegformerFeatureExtractor,Z.SegformerForImageClassification,Z.SegformerForSemanticSegmentation,Z.SegformerImageProcessor,Z.SegformerModel,Z.SegformerPreTrainedModel,Z.Seq2SeqLMOutput,Z.SequenceClassifierOutput,Z.SiglipImageProcessor,Z.SiglipModel,Z.SiglipPreTrainedModel,Z.SiglipTextModel,Z.SiglipTokenizer,Z.SiglipVisionModel,Z.SmolLM3ForCausalLM,Z.SmolLM3Model,Z.SmolLM3PreTrainedModel,Z.SmolVLMForConditionalGeneration,Z.SmolVLMImageProcessor,Z.SmolVLMProcessor,Z.SnacDecoderModel,Z.SnacEncoderModel,Z.SnacFeatureExtractor,Z.SnacModel,Z.SnacPreTrainedModel,Z.SpeechT5FeatureExtractor,Z.SpeechT5ForSpeechToText,Z.SpeechT5ForTextToSpeech,Z.SpeechT5HifiGan,Z.SpeechT5Model,Z.SpeechT5PreTrainedModel,Z.SpeechT5Processor,Z.SpeechT5Tokenizer,Z.SqueezeBertForMaskedLM,Z.SqueezeBertForQuestionAnswering,Z.SqueezeBertForSequenceClassification,Z.SqueezeBertModel,Z.SqueezeBertPreTrainedModel,Z.SqueezeBertTokenizer,Z.StableLmForCausalLM,Z.StableLmModel,Z.StableLmPreTrainedModel,Z.Starcoder2ForCausalLM,Z.Starcoder2Model,Z.Starcoder2PreTrainedModel,Z.StoppingCriteria,Z.StoppingCriteriaList;var OH=Z.StyleTextToSpeech2Model;Z.StyleTextToSpeech2PreTrainedModel,Z.SummarizationPipeline,Z.SupertonicForConditionalGeneration,Z.SupertonicPreTrainedModel,Z.SuppressTokensAtBeginLogitsProcessor,Z.Swin2SRForImageSuperResolution,Z.Swin2SRImageProcessor,Z.Swin2SRModel,Z.Swin2SRPreTrainedModel,Z.SwinForImageClassification,Z.SwinForSemanticSegmentation,Z.SwinModel,Z.SwinPreTrainedModel,Z.T5ForConditionalGeneration,Z.T5Model,Z.T5PreTrainedModel,Z.T5Tokenizer,Z.TableTransformerForObjectDetection,Z.TableTransformerModel,Z.TableTransformerObjectDetectionOutput,Z.TableTransformerPreTrainedModel,Z.TemperatureLogitsWarper;var kH=Z.Tensor;Z.Text2TextGenerationPipeline,Z.TextClassificationPipeline,Z.TextGenerationPipeline,Z.TextStreamer,Z.TextToAudioPipeline,Z.TokenClassificationPipeline,Z.TokenClassifierOutput,Z.TokenizerModel,Z.TopKLogitsWarper,Z.TopPLogitsWarper,Z.TrOCRForCausalLM,Z.TrOCRPreTrainedModel,Z.TranslationPipeline,Z.UltravoxModel,Z.UltravoxPreTrainedModel,Z.UltravoxProcessor,Z.UniSpeechForCTC,Z.UniSpeechForSequenceClassification,Z.UniSpeechModel,Z.UniSpeechPreTrainedModel,Z.UniSpeechSatForAudioFrameClassification,Z.UniSpeechSatForCTC,Z.UniSpeechSatForSequenceClassification,Z.UniSpeechSatModel,Z.UniSpeechSatPreTrainedModel,Z.VLChatProcessor,Z.VLMImageProcessor,Z.VaultGemmaForCausalLM,Z.VaultGemmaModel,Z.VaultGemmaPreTrainedModel,Z.ViTFeatureExtractor,Z.ViTForImageClassification,Z.ViTImageProcessor,Z.ViTMAEModel,Z.ViTMAEPreTrainedModel,Z.ViTMSNForImageClassification,Z.ViTMSNModel,Z.ViTMSNPreTrainedModel,Z.ViTModel,Z.ViTPreTrainedModel,Z.VisionEncoderDecoderModel,Z.VitMatteForImageMatting,Z.VitMatteImageProcessor,Z.VitMattePreTrainedModel,Z.VitPoseForPoseEstimation,Z.VitPoseImageProcessor,Z.VitPosePreTrainedModel,Z.VitsModel,Z.VitsModelOutput,Z.VitsPreTrainedModel,Z.VitsTokenizer,Z.VoxtralForConditionalGeneration,Z.VoxtralProcessor,Z.Wav2Vec2BertForCTC,Z.Wav2Vec2BertForSequenceClassification,Z.Wav2Vec2BertModel,Z.Wav2Vec2BertPreTrainedModel,Z.Wav2Vec2CTCTokenizer,Z.Wav2Vec2FeatureExtractor,Z.Wav2Vec2ForAudioFrameClassification,Z.Wav2Vec2ForCTC,Z.Wav2Vec2ForSequenceClassification,Z.Wav2Vec2Model,Z.Wav2Vec2PreTrainedModel,Z.Wav2Vec2Processor,Z.Wav2Vec2ProcessorWithLM,Z.WavLMForAudioFrameClassification,Z.WavLMForCTC,Z.WavLMForSequenceClassification,Z.WavLMForXVector,Z.WavLMModel,Z.WavLMPreTrainedModel,Z.WeSpeakerFeatureExtractor,Z.WeSpeakerResNetModel,Z.WeSpeakerResNetPreTrainedModel,Z.WhisperFeatureExtractor,Z.WhisperForConditionalGeneration,Z.WhisperModel,Z.WhisperPreTrainedModel,Z.WhisperProcessor,Z.WhisperTextStreamer,Z.WhisperTimeStampLogitsProcessor,Z.WhisperTokenizer,Z.XLMForQuestionAnswering,Z.XLMForSequenceClassification,Z.XLMForTokenClassification,Z.XLMModel,Z.XLMPreTrainedModel,Z.XLMRobertaForMaskedLM,Z.XLMRobertaForQuestionAnswering,Z.XLMRobertaForSequenceClassification,Z.XLMRobertaForTokenClassification,Z.XLMRobertaModel,Z.XLMRobertaPreTrainedModel,Z.XLMRobertaTokenizer,Z.XLMTokenizer,Z.XLMWithLMHeadModel,Z.XVectorOutput,Z.YolosFeatureExtractor,Z.YolosForObjectDetection,Z.YolosImageProcessor,Z.YolosModel,Z.YolosObjectDetectionOutput,Z.YolosPreTrainedModel,Z.ZeroShotAudioClassificationPipeline,Z.ZeroShotClassificationPipeline,Z.ZeroShotImageClassificationPipeline,Z.ZeroShotObjectDetectionPipeline,Z.bankers_round,Z.cat,Z.cos_sim,Z.dot,Z.dynamic_time_warping,Z.env,Z.full,Z.full_like,Z.getCacheShapes,Z.hamming,Z.hanning,Z.interpolate,Z.interpolate_4d,Z.interpolate_data,Z.is_chinese_char,Z.layer_norm,Z.load_image,Z.load_video,Z.log_softmax,Z.magnitude,Z.matmul,Z.max,Z.mean,Z.mean_pooling,Z.medianFilter,Z.mel_filter_bank,Z.min,Z.ones,Z.ones_like,Z.permute,Z.permute_data,Z.pipeline,Z.quantize_embeddings,Z.rand,Z.randn,Z.read_audio,Z.rfft,Z.round,Z.slice,Z.softmax,Z.spectrogram,Z.stack,Z.std_mean,Z.topk,Z.window_function,Z.zeros,Z.zeros_like;var Q=Q===void 0?{}:Q;Q.expectedDataFileDownloads||=0;var AH=typeof importScripts==`function`,jH=typeof process==`object`&&typeof process.versions==`object`&&typeof process.versions.node==`string`,MH=typeof atob==`function`?atob:function(e){var t,n,r,i,a,o,s=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`,c=``,l=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,``);do t=s.indexOf(e.charAt(l++))<<2|(i=s.indexOf(e.charAt(l++)))>>4,n=(15&i)<<4|(a=s.indexOf(e.charAt(l++)))>>2,r=(3&a)<<6|(o=s.indexOf(e.charAt(l++))),c+=String.fromCharCode(t),a!==64&&(c+=String.fromCharCode(n)),o!==64&&(c+=String.fromCharCode(r));while(l1&&(PH=process.argv[1].replace(/\\/g,`/`)),process.argv.slice(2),process.on(`uncaughtException`,(function(e){if(!(e instanceof pU))throw e})),process.on(`unhandledRejection`,(function(e){throw e})),Q.inspect=function(){return`[Emscripten Module object]`}),Q.expectedDataFileDownloads++,function(){if(Q.ENVIRONMENT_IS_PTHREAD)return;let e=`/usr/share/espeak-ng-data`,t=`/usr/share/espeak-ng-data/lang`,n=`/usr/share/espeak-ng-data/voices`;(function(r){var i=null,a=null;function o(){function o(e,t){if(!e)throw t+Error().stack}function s(e,t,n){this.start=e,this.end=t,this.audio=n}Q.FS_createPath(`/`,`usr`,!0,!0),Q.FS_createPath(`/usr`,`share`,!0,!0),Q.FS_createPath(`/usr/share`,`espeak-ng-data`,!0,!0),Q.FS_createPath(e,`lang`,!0,!0),Q.FS_createPath(t,`aav`,!0,!0),Q.FS_createPath(t,`art`,!0,!0),Q.FS_createPath(t,`azc`,!0,!0),Q.FS_createPath(t,`bat`,!0,!0),Q.FS_createPath(t,`bnt`,!0,!0),Q.FS_createPath(t,`ccs`,!0,!0),Q.FS_createPath(t,`cel`,!0,!0),Q.FS_createPath(t,`cus`,!0,!0),Q.FS_createPath(t,`dra`,!0,!0),Q.FS_createPath(t,`esx`,!0,!0),Q.FS_createPath(t,`gmq`,!0,!0),Q.FS_createPath(t,`gmw`,!0,!0),Q.FS_createPath(t,`grk`,!0,!0),Q.FS_createPath(t,`inc`,!0,!0),Q.FS_createPath(t,`ine`,!0,!0),Q.FS_createPath(t,`ira`,!0,!0),Q.FS_createPath(t,`iro`,!0,!0),Q.FS_createPath(t,`itc`,!0,!0),Q.FS_createPath(t,`jpx`,!0,!0),Q.FS_createPath(t,`map`,!0,!0),Q.FS_createPath(t,`miz`,!0,!0),Q.FS_createPath(t,`myn`,!0,!0),Q.FS_createPath(t,`poz`,!0,!0),Q.FS_createPath(t,`roa`,!0,!0),Q.FS_createPath(t,`sai`,!0,!0),Q.FS_createPath(t,`sem`,!0,!0),Q.FS_createPath(t,`sit`,!0,!0),Q.FS_createPath(t,`tai`,!0,!0),Q.FS_createPath(t,`trk`,!0,!0),Q.FS_createPath(t,`urj`,!0,!0),Q.FS_createPath(t,`zle`,!0,!0),Q.FS_createPath(t,`zls`,!0,!0),Q.FS_createPath(t,`zlw`,!0,!0),Q.FS_createPath(e,`voices`,!0,!0),Q.FS_createPath(n,`!v`,!0,!0),Q.FS_createPath(n,`mb`,!0,!0),s.prototype={requests:{},open:function(e,t){this.name=t,this.requests[t]=this,Q.addRunDependency(`fp `+this.name)},send:function(){},onload:function(){var e=this.byteArray.subarray(this.start,this.end);this.finish(e)},finish:function(e){Q.FS_createDataFile(this.name,null,e,!0,!0,!0),Q.removeRunDependency(`fp `+this.name),this.requests[this.name]=null}};for(var c=r.files,l=0;l{let e=function(e){if(typeof jH==`boolean`&&jH){var t=Buffer.from(e,`base64`);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}try{for(var n=MH(e),r=new Uint8Array(n.length),i=0;i=0;--r)n[48+r]=52+r,n[65+r]=r,n[97+r]=26+r;function i(e,t,r){for(var i,a,o=0,s=t,c=r.length,l=t+(3*c>>2)-(r[c-2]==`=`)-(r[c-1]==`=`);o>4,s>2),s>2]!=s[e+4>>2]){if(ci(s[s[32972]+60>>2]),O=s[47192],be=t+12|0,Oe=t+8|0,z=x=z-6832|0,s[x+6816>>2]=0,s[x+6808>>2]=32,s[x+6800>>2]=0,O){s[47351]=0,s[47350]=0,s[47352]=0,a[189076]=0,e=s[33284],s[47353]=(0|e)>0?e:0,s[47355]=s[47354]+1,Pt(ee=x+5184|0,0,1600),me=x+6800|0,z=m=z-2608|0,s[m+2156>>2]=32,s[m+2148>>2]=0,c[134760]&&(a[190280]=0,a[134760]=0),s[O+8216>>2]=0,s[O+8220>>2]=0,s[O+288>>2]=0,s[x+780>>2]=0,a[189360]=0;A:if(e=s[33691])s[m+2152>>2]=e;else{e:{g:{if(!(n=s[33285])){if(e=s[33283],s[e>>2]==s[e+4>>2]){s[m+2152>>2]=0;break A}if(!(n=s[33285]))break g}s[33285]=0;break e}s[33284]+=1,e=s[33283],n=0|Ui[s[e+8>>2]](e)}s[m+2152>>2]=n}Me=ee+2|0,F=32;A:{for(;;){P=F;e:{g:{r:{if(n=s[33691],(i=s[33285])?e=0:(i=s[33285],e=s[33283],e=s[e>>2]==s[e+4>>2]),n|!e|i||!(s[32524]<0)){if(!Lr(s[m+2156>>2])){if((i=(0|(e=s[49828]))>0)&(0|(n=e))<(0|(e=s[33284])))break r;if(!((0|(n=s[49845]))<=0|(0|e)<(0|n))){s[49845]=0,a[134760]=1,s[33285]=s[m+2152>>2],r=16384;break A}}F=s[m+2156>>2],s[m+2156>>2]=s[m+2152>>2];C:{a:{I:{f:{i:{if((0|(n=s[32524]))>=0){if(c[n+134736|0])break i;s[32524]=-1}if(n=s[33285])break I;if(e=s[33283],s[e>>2]!=s[e+4>>2])break f;n=32;break C}s[33691]|n||(s[m+2156>>2]=a[134736],n=1),s[32524]=n+1,n=a[n+134736|0];break C}if(!(n=s[33285]))break a}s[33285]=0;break C}s[33284]+=1,e=s[33283],n=0|Ui[s[e+8>>2]](e)}s[m+2152>>2]=n,s[33691]=0;C:if(!(S|!s[47203])){a:{if((0|(e=s[m+2156>>2]))!=60){if((0|n)!=35&n-97>>>0>25|(0|e)!=38)break C;for(i=s[33285],p=0;;){I:{if(s[m+2156>>2]=n,!i){if(e=s[33283],s[e>>2]==s[e+4>>2])break I;n=s[m+2156>>2]}if(!(!((n=!!(0|Lr(n)))|(0|(e=s[m+2156>>2]))==35)|p>>>0>19)){a[(m+112|0)+p|0]=e,p=p+1|0,(n=s[33285])?(s[33285]=0,i=0):(s[33284]+=1,e=s[33283],n=0|Ui[s[e+8>>2]](e),i=s[33285]);continue}}break}a[(m+112|0)+p|0]=0;I:{f:{if(!(n=s[33285])){if(n=0,e=s[33283],s[e>>2]==s[e+4>>2])break I;if(!(n=s[33285]))break f}s[33285]=0;break I}s[33284]+=1,e=s[33283],n=0|Ui[s[e+8>>2]](e)}s[m+2152>>2]=n,s[m+100>>2]=s[m+2156>>2],s[m+104>>2]=n,s[m+96>>2]=m+112,H(134736,84252,m+96|0);I:{if(s[m+2156>>2]==59){p=m+2156|0,D=m+2152|0,z=i=z-32|0;f:if(c[0|(n=m+112|0)]!=35)e=-1,(0|(n=Ur(130752,n)))!=-1&&(s[p>>2]=n,s[D>>2]||(s[D>>2]=32),e=n);else{if(c[0|(e=n+1|0)]==120){s[i>>2]=p,e=_e(n+2|0,90005,i);break f}s[i+16>>2]=p,e=_e(e,90070,i+16|0)}if(z=i+32|0,(0|e)>0)break I}s[32524]=0,s[m+2156>>2]=38,s[m+2152>>2]=32;break C}if((0|(e=s[m+2156>>2]))>32)break C;if(!(n=s[33692]-20|0)|(0|n)==16)break a;break C}if((0|n)!=47&&!Rr(n)&&(0|(e=s[m+2152>>2]))!=63&&(0|e)!=33)break C;if((0|(e=s[m+2148>>2]))>780){s[33691]=s[m+2156>>2],a[0|(e=e+189424|0)]=32,a[e+1|0]=0,s[33285]=s[m+2152>>2],r=16384;break A}for(D=s[33285],p=0,n=s[m+2152>>2];s[m+2156>>2]=n,i=0,D||(e=s[33283],i=s[e>>2]==s[e+4>>2],n=s[m+2156>>2]),!((0|n)==62|i|p>>>0>499);)s[(m+144|0)+(p<<2)>>2]=n,p=p+1|0,(n=s[33285])?(D=0,s[33285]=0):(s[33284]+=1,e=s[33283],n=0|Ui[s[e+8>>2]](e),D=s[33285]);s[(i=m+144|0)+(p<<2)>>2]=0,s[m+2152>>2]=32,I=m+2148|0,P=s[32525],n=0,z=N=z-560|0;I:if(Ar(i,84333,3)&&Ar(i,84477,4)){for(e=(i+(ii(i)<<2)|0)-4|0,(0|(te=s[e>>2]))==47&&(s[e>>2]=32);;){if(e=s[i+(n<<2)>>2]){if(fr(e))e=n;else if(a[(N+512|0)+n|0]=gr(e<<24>>24),e=39,(0|(n=n+1|0))!=39)continue}else e=n;break}if(a[(N+512|0)+e|0]=0,c[N+512|0]!=47){if((0|(D=Ur(130480,N+512|0)))!=16&&(n=s[I>>2],s[I>>2]=n+1,a[n+189424|0]=32),(0|te)==47&&(n=0,!(502241>>>D&1)))break I}else(0|(n=Ur(130480,N+512|1)))!=16&&(p=s[I>>2],s[I>>2]=p+1,a[p+189424|0]=32),D=n+32|0;p=i+(e<<2)|0,e=s[33708],S=v(e,76)+133076|0,n=262174;f:{i:{b:{s:switch(D-1|0){case 33:t:if(!((0|e)<=1)){for(;;){if(s[v(n=e-1|0,76)+133152>>2]==2)break t;if(s[33708]=n,i=e>>>0>2,e=n,!i)break}e=1}n=ze(p,34,e);break I;case 32:t:if(!((0|e)<=1)){for(;;){if(s[v(n=e-1|0,76)+133152>>2]==1)break t;if(s[33708]=n,i=e>>>0>2,e=n,!i)break}e=1}n=ze(p,33,e)+524328|0;break I;case 9:(0|(n=s[33709]))<=18&&(s[33709]=n+1),s[(e=(S=n<<6)+134912|0)>>2]=10,s[e+4>>2]=-1,s[e+8>>2]=-1,s[e+52>>2]=-1,s[e+56>>2]=-1,s[e+44>>2]=-1,s[e+48>>2]=-1,s[e+36>>2]=-1,s[e+40>>2]=-1,s[e+28>>2]=-1,s[e+32>>2]=-1,s[e+20>>2]=-1,s[e+24>>2]=-1,s[e+12>>2]=-1,s[e+16>>2]=-1,s[e+60>>2]=-1,e=Yt(p,88301),i=Yt(p,88390),or(e,88479)?or(e,88528)||(s[28+(134912+(n<<6)|0)>>2]=kn(i,130224)):s[24+(S+134912|0)>>2]=kn(i,130192),et(I,s[33709]);break b;case 2:for((0|(e=s[33709]))<=18&&(s[33709]=e+1),s[(e=(ke=e<<6)+134912|0)>>2]=3,s[e+4>>2]=-1,s[e+8>>2]=-1,s[e+52>>2]=-1,s[e+56>>2]=-1,s[e+44>>2]=-1,s[e+48>>2]=-1,s[e+36>>2]=-1,s[e+40>>2]=-1,s[e+28>>2]=-1,s[e+32>>2]=-1,s[e+20>>2]=-1,s[e+24>>2]=-1,s[e+12>>2]=-1,s[e+16>>2]=-1,s[e+60>>2]=-1,oe=1;;){if(i=Yt(p,s[(se=oe<<2)+130448>>2])){te=0,e=s[se+131072>>2];t:if(D=s[e>>2])for(;;){for(n=0;S=a[n+D|0],(P=s[(n<<2)+i>>2])&&(n=n+1|0,(0|S)==(0|P)););n:switch(P-34|0){case 0:case 5:if(!S)break t;break;default:break n}if(!(D=s[e+((te=te+1|0)<<3)>>2]))break}Ne=se+(ke+134912|0)|0;t:if((0|(e=s[4+(e+(te<<3)|0)>>2]))>=0)e=(0|v(e,s[4+(se+134912|0)>>2]))/100|0;else{for(;i=(e=i)+4|0,fr(s[e>>2]););for(Ae=s[e>>2]==43,i=((je=s[(e=e+(Ae<<2)|0)>>2]==45)<<2)+e|0,te=N+96|0,z=D=(z=S=z-16|0)-224|0,Pt(D+16|0,0,144),e=D+160|4,s[D+24>>2]=e,s[D+60>>2]=e,s[D+92>>2]=-1,s[D+64>>2]=60,s[D+20>>2]=e,s[D+48>>2]=19,n=i;n=(e=n)+4|0,P=(P=s[e>>2])?Gr(124960,P):0;);s[D+100>>2]=e,tr(n=D+16|0,0,0),pe(D,n,1,1),n=s[D+8>>2],Pe=s[D+12>>2],P=s[D>>2],Fe=s[D+4>>2],te&&(Ie=te,te=s[D+136>>2]+(s[D+20>>2]-s[D+60>>2]|0)|0,s[Ie>>2]=te?e+(te<<2)|0:i),s[(e=S)+8>>2]=n,s[e+12>>2]=Pe,s[e>>2]=P,s[e+4>>2]=Fe,z=D+224|0,M=mt(s[e>>2],s[e+4>>2],s[e+8>>2],s[e+12>>2]),z=e+16|0;n:{n=100;k:if((0|(e=i))!=(0|(i=s[N+96>>2]))){n=je?-1:Ae;o:{if((0|(e=s[i>>2]))!=115){if((0|e)!=37)break o;if(b(M=n?+(0|n)*M+100:M)<2147483648){n=~~M;break k}n=-2147483648;break k}if(s[i+4>>2]==116){f(+(ie=M*+(0|n)/12)),e=0|l(1),l(0);B:{if((n=(e=e>>>20&2047)-969|0)>>>0>=63){if(M=ie+1,(0|n)<0)break B;if(f(+ie),n=0|l(1),i=0|l(0),!(e>>>0<1033)){if(M=0,!i&(0|n)==-1048576||(M=ie+1,e>>>0>=2047))break B;if((0|n)>0|(0|n)>=0){_[(e=z-16|0)+8>>3]=3105036184601418e216,M=3105036184601418e216*_[e+8>>3];break B}if(!(n>>>0<3230714880)){_[(e=z-16|0)+8>>3]=12882297539194267e-247,M=12882297539194267e-247*_[e+8>>3];break B}}S=e,e=!(i<<1)&(0|(e=n<<1|i>>>31))==-2129002496|e>>>0<2165964800?S:0}Se=(ie=(M=ie-((V=(M=_[14416])+ie)-M))*M)*ie*(M*_[14421]+_[14420]),ie*=M*_[14419]+_[14418],M*=_[14417],f(+V),l(1),S=0|l(0),M=Se+(ie+(M+_[(i=S<<4&2032)+115376>>3])),P=s[(i=i+115384|0)>>2],D=s[i+4>>2],i=(n=P)+(P=0)|0,n=(S<<13)+D|0,n=i>>>0

>>0?n+1|0:n,e?(u(0,0|i),u(1,0|n),M=(ie=+d())*M+ie):-2147483648&S?(u(0,0|i),u(1,n+1071644672|0),(M=(V=(ie=+d())*M)+ie)<1&&(s[(e=z-16|0)+8>>2]=0,s[e+12>>2]=1048576,_[e+8>>3]=22250738585072014e-324*_[e+8>>3],M=(M=(Se=M+1)+(V+(ie-M)+(M+(1-Se)))+-1)==0?0:M),M*=22250738585072014e-324):(u(0,0|i),u(1,n+-1048576|0),M=(ie=+d())*M+ie,M+=M)}if(b(M*=100)<2147483648){n=~~M;break k}n=-2147483648;break k}}if((0|oe)!=1)break n;if(n)n=(e=b(M=M*+(0|n)*100)<2147483648?~~M:-2147483648)+100|0;else{if(b(M*=100)<2147483648){n=~~M;break k}n=-2147483648}}e=(0|v(n,s[se+134848>>2]))/100|0;break t}e=b(M)<2147483648?~~M:-2147483648,n&&(e=s[se+134848>>2]+v(e,n)|0)}s[Ne+4>>2]=e}if((0|(oe=oe+1|0))==5)break}et(I,s[33709]);break b;case 11:(0|(n=s[33709]))<=18&&(s[33709]=n+1),s[(e=134912+(n<<6)|0)>>2]=12,s[e+4>>2]=-1,s[e+8>>2]=-1,s[e+52>>2]=-1,s[e+56>>2]=-1,s[e+44>>2]=-1,s[e+48>>2]=-1,s[e+36>>2]=-1,s[e+40>>2]=-1,s[e+28>>2]=-1,s[e+32>>2]=-1,s[e+20>>2]=-1,s[e+24>>2]=-1,s[e+12>>2]=-1,s[e+16>>2]=-1,s[e+60>>2]=-1,e=(e=Yt(p,88658))?kn(e,130400):3,i=134912+(n<<6)|0,s[s[47192]+148>>2]==1?(s[20+(134912+(n<<6)|0)>>2]=c[e+102764|0],e=c[e+102770|0]):(s[52+(134912+(n<<6)|0)>>2]=e,e=c[e+102776|0]),s[i+12>>2]=e,et(I,s[33709]);break b;case 34:case 41:case 43:if(!((0|(e=s[33709]))<=0)){if(p=D-32|0,D=0,i=0,n=0,e>>>0>=4)for(S=-4&e,te=0;oe=2|n,se=1|n,i=(0|p)==s[134912+((P=3|n)<<6)>>2]?P:(0|p)==s[134912+(oe<<6)>>2]?oe:(0|p)==s[134912+(se<<6)>>2]?se:(0|p)==s[134912+(n<<6)>>2]?n:i,n=n+4|0,(0|S)!=(0|(te=te+4|0)););if(S=3&e)for(;i=(0|p)==s[134912+(n<<6)>>2]?n:i,n=n+1|0,(0|S)!=(0|(D=D+1|0)););(0|i)<=0||(s[33709]=i,e=i)}et(I,e);break b;case 7:if(e=Yt(p,88741),n=Yt(p,88860),(0|kn(e,130176))!=1)break b;e=s[I>>2],s[I>>2]=e+1,a[e+189424|0]=91,e=s[I>>2],s[I>>2]=e+1,a[e+189424|0]=91,e=Tn((e=s[I>>2])+189424|0,n,800-e|0)+s[I>>2]|0,s[I>>2]=e+1,a[e+189424|0]=93,e=s[I>>2],s[I>>2]=e+1,a[e+189424|0]=93;break b;case 35:s[33692]==36&&(a[s[I>>2]+189424|0]=0,(i=Ur(131104,n=(e=s[33707])+189424|0))&&(s[I>>2]=qn(i,n)+e)),e=s[I>>2],s[I>>2]=e+1,a[e+189424|0]=1,e=s[I>>2],s[I>>2]=e+1,a[e+189424|0]=89,s[33692]=0;break b;case 8:if(!(e=Yt(p,89299)))break b;a[134824]=1,n=s[I>>2],s[I>>2]=Tn(n+189424|0,e,800-n|0)+s[I>>2];break b;case 13:a[134824]=1;break b;case 40:case 45:a[134824]=0;break b;case 4:if(!(e=Yt(p,89360)))break b;if(Tn(N+352|0,e,160),c[N+352|0]&&!Or(199328,N+352|0)){a[134760]=1,a[199328]=0,n=16384;break I}if((0|(e=wr(N+352|0)))<0)break b;s[N+20>>2]=e,s[N+16>>2]=1,H(e=N+352|0,89460,N+16|0),gn(s[I>>2]+189424|0,e),s[I>>2]=s[I>>2]+U(e);break b;case 10:(0|(n=s[33709]))<=18&&(s[33709]=n+1),s[(e=134912+(n<<6)|0)>>2]=11,s[e+4>>2]=-1,s[e+8>>2]=-1,s[e+52>>2]=-1,s[e+56>>2]=-1,s[e+44>>2]=-1,s[e+48>>2]=-1,s[e+36>>2]=-1,s[e+40>>2]=-1,s[e+28>>2]=-1,s[e+32>>2]=-1,s[e+20>>2]=-1,s[e+24>>2]=-1,s[e+12>>2]=-1,s[e+16>>2]=-1,s[e+60>>2]=-1;t:if(e=Yt(p,89514)){if(Tn(N+352|0,e,160),s[34441]){if((0|(e=wr(N+352|0)))<0||0|Ui[s[34441]](1,e+s[33282]|0,P))break t;s[N+68>>2]=e,s[N+64>>2]=1,H(N+352|0,89658,N- -64|0)}else{if(!P|c[N+352|0]==47?e=Sn(N+352|0):(s[N+48>>2]=P,s[N+52>>2]=N+352,H(e=N+96|0,89564,N+48|0),e=Sn(e)),(0|e)<0)break t;s[N+36>>2]=e,s[N+32>>2]=1,H(N+352|0,89623,N+32|0)}e=N+352|0,gn(s[I>>2]+189424|0,e),s[I>>2]=s[I>>2]+U(e),s[4+(134912+(n<<6)|0)>>2]=1}if(et(I,s[33709]),(0|te)==47){on(11,I),n=16384;break I}a[134772]=1,n=16384;break I;case 42:on(43,I),a[134772]=0,n=16384;break I;case 12:t:{if(e=Yt(p,89714)){if(n=16384,(S=(0|(e=kn(e,130336)))<0?2:e)>>>0<=2&&(e=s[I>>2],s[N+84>>2]=S,s[N+80>>2]=1,H(e+189424|0,89770,N+80|0),s[I>>2]=s[I>>2]+3,n=0),e=s[102784+(S<<2)>>2],!(i=Yt(p,89907)))break t;break i}if(n=16384,i=Yt(p,89907))break i;e=21;break f}if(S>>>0<3)break b;break f;case 0:(e=Yt(p,89965))&&(Tn(n=N+352|0,e,160),wr(n)),n=ze(p,1,s[33708])?147456:0;break I;case 1:n=ze(p,2,e)?147456:0;break I;case 5:n=0,s[S>>2]==6&&(n=ze(p,38,e),e=s[33708]),n=524358+(ze(p,6,e)|n)|0;break I;case 6:n=0,(0|(i=s[S>>2]))==6&&(n=ze(p,38,e),i=s[S>>2]),(0|i)==7&&(n=ze(p,39,s[33708])|n),n=524358+(n|ze(p,7,s[33708]))|0;break I;case 37:if(n=524328,s[S>>2]!=6)break I;n=ze(p,38,e)+524328|0;break I;case 38:if(n=524358,(-2&s[S>>2])!=6)break I;n=ze(p,39,e)+524358|0;break I;case 14:case 46:break I;case 3:break s;default:break b}e=Yt(p,88893),n=Yt(p,88992),i=Yt(p,89153),p=kn(e,130272),n=kn(n,130320),e=dr(i,0),s[N>>2]=1,i=(0|e)<2?193:e- -64|0,n=(0|(e=(0|n)==1?19:p))==64?i:e,s[N+4>>2]=n,H(e=N+352|0,89230,N),gn(s[I>>2]+189424|0,e),e=s[I>>2]+U(e)|0,s[I>>2]=e,s[33707]=e,s[33692]=n}n=0;break I}e=dr(i,1),i=s[33722],Fr(1,s[33713]),(0|(e=(0|(i=(0|v(e,i))/100<<8))/(0|v(s[36429],10))|0))<=199&&(e=(0|i)/(0|v(s[36428],10))|0),n||=16384}i=e>>>5|0,p=e,n=((e=(0|e)>4095)?i>>>0>=4095?4095:i:p)+(e?8388608|n:n)|0}if(z=N+560|0,n){if(e=s[m+2148>>2]+189424|0,a[0|e]=32,a[e+1|0]=0,!(131072&n)){r=n;break A}gn(189360,134784),r=n;break A}s[m+2156>>2]=32;I:{f:{if(!(n=s[33285])){if(S=0,e=s[33283],s[e>>2]==s[e+4>>2])continue;if(!(n=s[33285]))break f}s[33285]=0;break I}s[33284]+=1,e=s[33283],n=0|Ui[s[e+8>>2]](e)}s[m+2152>>2]=n,S=0;continue}s[m+2156>>2]=e+57344}if(c[134824])continue;if(i=s[m+2156>>2],!((0|(e=s[m+2152>>2]))!=10|s[47268]!=-1)){(0|(r=ct(i)))==16384?(e=s[m+2148>>2],o[ee+(e<<1)>>1]=s[33284]-s[47353],s[me>>2]=e,r=524328,e=qn(s[m+2156>>2],e+189424|0)+s[m+2148>>2]|0):e=s[m+2148>>2],a[0|(e=e+189424|0)]=32,a[e+1|0]=0;break A}C:if((0|i)==1){if((0|e)!=66){if((0|e)!=86)break C;for(e=s[m+2148>>2],s[m+2148>>2]=e+1,a[e+189424|0]=0;;){a:{I:{f:{if(!(n=s[33285])){if(e=s[33283],s[e>>2]==s[e+4>>2])break a;if(!(n=s[33285]))break f}s[33285]=0;break I}s[33284]+=1,e=s[33283],n=0|Ui[s[e+8>>2]](e)}if(s[m+2156>>2]=n,!(fr(n)||(0|(e=s[m+2148>>2]))>=799)){s[m+2148>>2]=e+1,a[e+189424|0]=s[m+2156>>2];continue}}break}a[s[m+2148>>2]+189424|0]=0,r=147456;break A}n=s[m+2148>>2],a[0|(e=n+189424|0)]=32,a[e+1|0]=32,a[e+2|0]=32,a[e+3|0]=0,s[m+2148>>2]=n+3;a:{I:{f:{i:{b:{s:{if(!(n=s[33285])){if(e=s[33283],s[e>>2]==s[e+4>>2])break i;if(!(n=s[33285]))break s}s[33285]=0;break b}s[33284]+=1,e=s[33283],n=0|Ui[s[e+8>>2]](e)}if(s[m+2152>>2]=n,i=0,(0|n)!=48)break f;break I}n=s[m+2152>>2]}if(s[47208]=0,s[47201]=1,(0|n)==49)break a;for(i=s[33285],p=0;;){f:{if(!i){if(e=s[33283],s[e>>2]==s[e+4>>2])break f;n=s[m+2152>>2]}if(!(fr(n)|p>>>0>58)){s[188832+(p<<2)>>2]=s[m+2152>>2],(n=s[33285])?(s[33285]=0,i=0):(s[33284]+=1,e=s[33283],n=0|Ui[s[e+8>>2]](e),i=s[33285]),p=p+1|0,s[m+2152>>2]=n,e=s[m+2148>>2],s[m+2148>>2]=e+1,a[e+189424|0]=32;continue}}break}i=2,s[188832+(p<<2)>>2]=0}s[47201]=i}a:{if(!(n=s[33285])){if(e=s[33283],s[e>>2]==s[e+4>>2])continue;if(!(n=s[33285]))break a}s[33285]=0,s[m+2152>>2]=n;continue}s[33284]+=1,e=s[33283],s[m+2152>>2]=Ui[s[e+8>>2]](e);continue}ce=ce+1|0,n=0,e=s[O+340>>2];C:if(p=h[e>>1]){for(;;){if((65535&p)!=(0|i)){if(p=h[e+((n=n+2|0)<<1)>>1])continue;break C}break}a:switch(0|(e=h[e+(n<<1|2)>>1])){case 1:continue;case 0:break C;default:break a}s[m+2156>>2]=e,i=e}Lr(i)?(A=1,n=s[m+2156>>2]):ne?(s[33285]=s[m+2152>>2],n=1328,s[m+2156>>2]=1328,s[m+2152>>2]=32,ne=0):(0|(n=s[m+2156>>2]))==3851?(n=32,s[m+2156>>2]=32,ne=0):(ne=0,(0|n)!=3405|s[m+2152>>2]!=8205||(n=3406,s[m+2156>>2]=3406));C:if(Cr(n)){if(s[O+8216>>2]=s[O+8216>>2]+1,s[33692]|s[47200]!=2||Cr(F)||(s[m+2544>>2]=0,s[m+2548>>2]=0,s[m+2304>>2]=84731,!nt(O,m+2304|0,m+2160|0,m+2544|0,0,0))||(ye(O,e=m+2160|0,m+2544|0,-1,0),Ut(n=e,e=m+2336|0),s[m+80>>2]=e,H(n=m+2240|0,85451,m+80|0),e=s[m+2148>>2],(0|(n=U(n)+e|0))>=800))break C;gn(e+189424|0,m+2240|0),s[m+2148>>2]=n}else Rr(s[m+2156>>2])&&(s[O+8220>>2]=s[O+8220>>2]+1);if(n=s[m+2152>>2],e=s[m+2156>>2],s[47204])if((0|S)>0)S=S-1|0;else{if(!((0|e)!=91|(0|n)!=91)){i=0,S=-1;break e}S=(0|e)==93&&(0|n)==93?2:S}if((0|e)==10){for(i=s[33285],p=0;;){C:{if(!i){if(e=s[33283],s[e>>2]==s[e+4>>2])break C;n=s[m+2152>>2]}if(fr(n)){p=(s[m+2152>>2]==10)+p|0,(n=s[33285])?(s[33285]=0,i=0):(s[33284]+=1,e=s[33283],n=0|Ui[s[e+8>>2]](e),i=s[33285]),s[m+2152>>2]=n;continue}}break}if((0|p)>0){r&&Pt(e=ue+189424|0,32,nn(m+2336|0,e)),e=s[m+2148>>2]+189424|0,a[0|e]=32,a[e+1|0]=0,s[33285]=s[m+2152>>2],r=s[47203]?524358:v((0|p)>=3?3:p,30)+524328|0;break A}if(e=s[47268]<(0|ce),ce=0,!e){e=s[m+2148>>2]+189424|0,a[0|e]=32,a[e+1|0]=0,s[33285]=s[m+2152>>2],r=262174;break A}}if(i=0,s[33692]|S)break e;if(e=0,!r)break g;if(fr(s[m+2156>>2])){e=r;break g}if(En(s[m+2156>>2])&&Nr(s[m+2156>>2]))break g;s[33691]=s[m+2156>>2],a[0|(e=ue+189424|0)]=32,a[e+1|0]=0,s[33285]=s[m+2152>>2];break A}ne&&(s[m+2148>>2]=qn(1328,s[m+2148>>2]+189424|0)+s[m+2148>>2]),r&&Pt(e=ue+189424|0,32,nn(m+2336|0,e)),e=s[m+2148>>2]+189424|0,a[0|e]=32,a[e+1|0]=0}r=589864;break A}if(!((0|(n=s[m+2156>>2]))!=46|s[m+2152>>2]!=46)){g:{r:{C:{if(!(n=s[33285])){if(n=s[33283],s[n>>2]==s[n+4>>2])break g;if(!(n=s[33285]))break C}s[33285]=0;break r}s[33284]+=1,n=s[33283],n=0|Ui[s[n+8>>2]](n)}if(y=n,(0|n)==46)for(s[m+2152>>2]=32,s[m+2156>>2]=8230,y=s[33285];;){r:{C:{if(!y){if(n=s[33283],s[n>>2]==s[n+4>>2]){y=46;break g}if(!(y=s[33285]))break C}s[33285]=0,n=0;break r}s[33284]+=1,n=s[33283],y=0|Ui[s[n+8>>2]](n),n=s[33285]}if((0|y)!=46)break g;s[m+2152>>2]=32,s[m+2156>>2]=8230,y=n}}(0|(n=s[m+2156>>2]))==8230?(s[m+2152>>2]=y,n=8230):s[33285]=y}if(te=0,(0|(D=ct(n)))!=16384){g:if(536621&D)for(n=s[33285];;){if(!n&&(n=s[33283],s[n>>2]==s[n+4>>2])||!(536621&ct(s[m+2152>>2])))break g;(y=s[33285])?(s[33285]=0,n=0):(s[33284]+=1,n=s[33283],y=0|Ui[s[n+8>>2]](n),n=s[33285]),s[m+2152>>2]=y}if(1048576&D){s[x+780>>2]=D>>>12&15,ne=1,S=0,r=e;continue}(fr(s[m+2152>>2])|32768&D||hi(s[m+2152>>2])||(0|(n=s[m+2152>>2]))==63||(p=0,s[33285]||(n=s[33283],p=s[n>>2]==s[n+4>>2],n=s[m+2152>>2]),p||(0|n)==1))&&(te=1)}if((0|(n=s[m+2156>>2]))==57404&&(s[m+2156>>2]=60,n=60),s[47201]){r=0;g:if(!(1<<(p=an(n))&1879048255&&p>>>0<=30)){if(!((p=an(n))>>>0>27)){if(116672&(S=1<>2]))){s[O+288>>2]=0,i=s[m+2156>>2],a[m+2336|0]=0,S=s[m+2152>>2],n=0;g:{r:if(!((0|(r=s[34064]))<=0))for(;;){if((0|i)==s[136272+(n<<4)>>2]){if(s[136276+(n<<4)>>2])break g;if(Je(0,n))break r;break g}if((0|r)==(0|(n=n+1|0)))break}n=-1}g:if((0|n)>=0)s[m>>2]=n,H(m+2336|0,86007,m),s[33285]=S;else if((p=!te)|(0|i)!=46|(0|S)==46||(s[m+2600>>2]=0,s[m+2604>>2]=0,s[m+2540>>2]=86036,!nt(O,m+2540|0,m+2544|0,m+2600|0,0,0))?n=$e(m+2240|0,O,i,0):(ye(O,n=m+2544|0,m+2600|0,-1,0),Ut(r=n,n=m+2160|0),s[m+64>>2]=n,H(n=m+2304|0,85451,m- -64|0)),r=n,p|!s[m+2148>>2]|2&c[O+76|0]){for(n=s[33285],p=1;;){r:{C:{if(!n){if(n=s[33283],s[n>>2]==s[n+4>>2]|(0|i)==60|(0|i)!=(0|S))break r;if(p=p+1|0,S=s[33285])break C;s[33284]+=1,n=s[33283],S=0|Ui[s[n+8>>2]](n),n=s[33285];continue}if((0|i)==60|(0|i)!=(0|S))break r;S=n,p=p+1|0}n=0,s[33285]=0;continue}break}if(s[m+2152>>2]=S,te&&(s[33285]=S),(0|p)==1){s[m+16>>2]=r,H(m+2336|0,86219,m+16|0);break g}if((0|p)<=3){if(a[m+2336|0]=0,(0|(n=s[50786]))<=299&&(s[m+2336>>2]=c[86728]|c[86729]<<8|c[86730]<<16|c[86731]<<24,o[m+2340>>1]=c[86732]|c[86733]<<8),(0|p)>0){for(;s[m+32>>2]=r,H(n=m+2160|0,86219,m+32|0),S=p>>>0>1,Li(m+2336|0,n),p=p-1|0,S;);n=s[50786]}if((0|n)>299)break g;s[m+2160>>2]=c[86857]|c[86858]<<8|c[86859]<<16|c[86860]<<24,n=c[86860]|c[86861]<<8|c[86862]<<16|c[86863]<<24,a[m+2163|0]=n,a[m+2164|0]=n>>>8,a[m+2165|0]=n>>>16,a[m+2166|0]=n>>>24,Li(m+2336|0,m+2160|0);break g}s[m+56>>2]=r,s[m+52>>2]=p,s[m+48>>2]=r,H(m+2336|0,86932,m+48|0)}else s[33691]=i,s[33285]=S,o[m+2336>>1]=32;if(p=U(r=m+2336|0),gn((n=s[m+2148>>2])+189424|0,r),s[m+2148>>2]=n+p,te){if((0|i)==45){r=16384;break A}if(r=ct(i),!(2&c[O+76|0]|(0|n)<=0)){r=(-32769&r)==266270?262148:(28672&r)==4096?266244:262148;break A}if(!(524288&r)){r=(28672&r)==4096?266244:262148;break A}if((0|r)>=0)break A}i=s[m+2156>>2]}}if(i|!(2097152&D)||(n=gn(s[m+2148>>2]+189424|0,$e(m+2336|0,O,s[m+2156>>2],1)),c[0|n]?(s[m+2148>>2]=s[m+2148>>2]+U(n),D&=-28673,i=s[m+2156>>2]):i=0),S=0,te){g:if(fr(y=s[m+2152>>2]))for(p=s[33285],n=0;;){if(!p&&(r=s[33283],s[r>>2]==s[r+4>>2])||!fr(y))break g;n=((0|y)==10)+n|0,(y=s[33285])?(s[33285]=0,p=0):(s[33284]+=1,r=s[33283],y=0|Ui[s[r+8>>2]](r),p=s[33285])}else n=0;r=(0|(S=s[m+2156>>2]))==46&&(0|n)<2?4194304|D:D;g:{if(!n){p=1,(0|S)!=44|(0|F)!=46|s[O+212>>2]!=26741|P-48>>>0>=10||y-48>>>0>=10&&!Nr(y)||(s[m+2156>>2]=1367,p=0),(0|(D=s[m+2156>>2]))!=46|(0|y)!=39||(S=p,D=s[33283],(0|(N=s[D>>2]))==s[D+4>>2]?p=0:(p=0|Ui[s[D+8>>2]](D),s[D>>2]=N),D=s[m+2156>>2],p=(0|p)!=115&S);r:if((0|D)!=46)p&=A;else{C:if(1&a[O+106|0]){if(!(F-48>>>0<10)&&((S=F-73|0)>>>0>15|!(1<>>0<=15||fr(P))))break C;p=F-48>>>0>=10?0:!Nr(y)&(0|y)!=45&p}if(Nr(y)&&(p=c[O+208|0]!=0&p),A){D=s[m+2156>>2];break r}D=32,s[m+2156>>2]=32,p=0}if(!(!p|(0|D)!=46|!s[47203]|(0|y)!=60)){ue=s[m+2148>>2],e=r;break g}if(!p)break g}if(e=s[m+2148>>2]+189424|0,a[0|e]=32,a[e+1|0]=0,s[33285]=y,F-48>>>0<10&&(r=En(y)?r:-4194305&r),(0|n)<2)break A;r=(0|r)==536621?536656:(0|r)==532520?532555:524358;break A}(s[33285]||(S=0,n=s[33283],s[n>>2]!=s[n+4>>2]))&&(S=0,fr(s[m+2152>>2])&&(s[33285]=y))}r=e}if(s[33712]!=1){if((0|i)!=(0|(n=s[m+2156>>2])))p=s[m+2148>>2],(0|n)==57404&&(n=60,s[m+2156>>2]=60);else{e:{if(hi(i))n=57384;else{if(n=45,s[m+2156>>2]==45)break e;n=32}s[m+2156>>2]=n}p=s[m+2148>>2]}s[m+2148>>2]=qn(n,p+189424|0)+s[m+2148>>2],fr(s[m+2156>>2])||hi(s[m+2156>>2])||(e=s[m+2148>>2],o[ee+(e<<1)>>1]=s[33284]-s[47353],(0|e)<=(p+1|0)||Pt(Me+(p<<1)|0,255,e+~p<<1)),n=s[m+2148>>2],s[me>>2]=n;e:{g:{if((0|n)>725){if(!En(s[m+2156>>2]))break g;n=s[m+2148>>2]}if((0|n)<796)continue;break e}if(n=s[m+2148>>2],!(s[m+2156>>2]-48>>>0>=10)&&(0|n)<796)continue}break}}a[0|(e=n+189424|0)]=32,a[e+1|0]=0,s[33285]=s[m+2152>>2],r=16384}z=m+2608|0,ne=r,be&&(e=s[x+780>>2],s[be>>2]=e||ne>>>12&7),e=(x+5184|0)+(s[x+6800>>2]<<1)|0,o[e+6>>1]=0,o[e+2>>1]=0,o[e+4>>1]=32767,D=v(4095&ne,8388608&ne?320:10),r=189424;A:{e:{g:if(e=c[189424]){for(;;){if(!!(255&(e=e<<24>>24))&e>>>0<33){if(e=c[0|(r=r+1|0)])continue;break g}break}if(c[0|r])break e}D=(0|(n=D-(e=s[47566])|0))>0?n:0,s[47566]=D+e,ne=c[190268]?524288|ne:ne,s[O+8240>>2]=ne;break A}s[47566]=D,e=c[190268],s[O+8240>>2]=ne,e&&(re=1,s[47568]+=1,(0|(e=s[47569]))<=0||(e=e-1|0,s[47569]=e,e||(a[190280]=0)))}s[49572]=1,s[47572]=655360,s[47573]=0,s[O+8184>>2]=0,s[O+8188>>2]=0,e=0,s[O+288>>2]=0,s[(n=O- -8192|0)>>2]=0,s[n+4>>2]=0,s[O+8200>>2]=0,s[O+8224>>2]=0,s[O+8228>>2]=0,s[(n=O+8232|0)>>2]=0,s[n+4>>2]=0,a[x+786|0]=32,o[x+784>>1]=8192,s[x+6812>>2]=32,o[x+1588>>1]=3,s[x+1584>>2]=0,r=0;A:if(!((0|(n=s[x+6800>>2]))<=0)){for(;;){if(o[(x+5184|0)+(r<<1)>>1]>0)break A;if((0|n)==(0|(r=r+1|0)))break}r=n}if(n=h[(x+5184|0)+(r<<1)>>1],o[x+1592>>1]=n,n)for(;e=!!(65535&~n)+e|0,n=h[(x+5184|0)+((r=r+1|0)<<1)>>1];);for(a[x+1594|0]=e,p=3,ee=1,r=0;;){P=s[x+6808>>2],en(x+6808|0,(I=(x+784|0)+p|0)-1|0),!c[O+170|0]|s[x+6808>>2]-48>>>0>=10||En(P)&&(s[x+6808>>2]=97),j?s[x+6812>>2]=j:w&&en(x+6812|0,w+189423|0),n=w;A:{e:if(r||=(n=nn(x+6816|0,w+189424|0)+w|0,s[x+6816>>2])){if(A=nn(x+6804|0,e=n+189424|0),(0|r)==1){if(i=n-1|0,j=32,F=0,s[x+6812>>2]!=32){n=i,e=32;break e}w=0,r=n;g:{r:switch(c[0|e]-43|0){case 0:r=n+1|0,w=64;break g;case 2:break r;default:break g}r=n+1|0,w=96}if(a[0|(e=r+189424|0)]-48>>>0>=10)y=r+1|0,A=-1;else{for(A=Pn(e);r=(e=r)+1|0,a[e+189424|0]-48>>>0<10;);y=r,r=e}if((0|(j=s[47350]))>247)e=0;else if(e=0,!((0|(r=a[r+189424|0]))<0)&&(r=un(84868,255&r,14))){n=(e=r-84868|0)+1|0,(0|A)==-1&&(A=s[105536+(n<<2)>>2],w=0);g:{r:switch(e-8|0){case 0:s[49574]=0,s[49573]=A;break g;case 4:break r;default:break g}(0|A)>=3?a[199304]=1:a[199304]=0}e=1,s[47350]=j+1,s[198304+(j<<2)>>2]=(n+w|0)+(A<<8),n=y}j=s[x+6812>>2],Pt(i+189424|0,32,n-i|0),he=e+he|0,r=0;break A}j=0,(0|r)==32|s[49573]!=36?(F=0,e=r):(s[x+6812>>2]!=32|s[x+6804>>2]!=32||(s[49573]=20),F=0,e=si(r,O))}else s[x+6804>>2]=32,F=1,j=0,A=0,e=32;e:if(B){if(B=1,ee=8,r=0,(0|e)!=93|s[x+6804>>2]!=93)break e;n=n+1|0,e=32,B=0}else if((240&(r=s[49573]))!=64)if(B=0,16&r)r=0;else{g:{r:{C:{a:{if(!((0|(y=(0|e)==8242||(0|e)==8217||(0|e)==146||(0|e)==180?39:e))!=8216&(0|y)!=63))if(En(s[x+6808>>2])){if(y=e,En(s[x+6804>>2])){y=39;break a}}else y=e;I:{if((0|y)!=1367){if((0|y)==1328){E|=1024,y=32;break a}if((e=y-44032|0)>>>0>11183)break a;if(i=((r=((S=65535&e)>>>0)/28|0)>>>0)%21|0,e=e-v(r,28)&65535,y-50500>>>0>587)break I;r=e?e+4519|0:0,i=i+4449|0;break r}E|=131072,ue=s[x+6804>>2],e=s[x+6812>>2],y=32;break C}r=50500+(e+v(i,28)|0)|0,i=(S>>>0)/588|4352;break r}if(ue=s[x+6804>>2],e=s[x+6812>>2],!((r=y-12592|0)>>>0>51)){i=4352|c[r+103296|0],r=0;break r}}m=n+189424|0;C:if(!((0|(r=s[O+212>>2]))!=28268&(0|r)!=24934|(0|y)!=39)&&!Rr(e)&&(nn(x+6820|0,m+1|0),ni(s[x+6820>>2]))){i=601,r=0;a:switch(ue-110|0){case 6:break r;case 0:break a;default:break C}if(s[O+212>>2]!=24934)break r;a[0|m]=32;break r}if(s[x+6824>>2]=32,(0|(e=s[49897]))>0)s[49897]=e-1,r=0;else{if(!y){r=0,i=0;break g}C:{a:{I:{f:if((te=s[O+180>>2])&&(S=y,(N=Cr(y))&&(S=si(y,O)),!vi(te)))for(;;){s[x+16>>2]=0,s[x+624>>2]=S,e=nn(x+16|0,te)+te|0;i:if(s[x+624>>2]==s[x+16>>2]){if(c[0|e]){for(i=1,oe=0,r=m;se=nn(x+16|0,e),ce=nn(x+624|0,r),me=si(s[x+624>>2],O),s[x+624>>2]=me,r=r+ce|0,oe=(ce=(0|me)==s[x+16>>2])+oe|0,i&=ce,c[0|(e=e+se|0)];);if(!i)break i;s[49897]=oe}if(!(e=e+1|0))break f;if(8&c[188788]&&(s[x>>2]=te,s[x+4>>2]=e,fi(s[47195],85187,x)),e=nn(x+6828|0,e)+e|0,c[0|e])break I;r=0;break a}for(;r=e,e=e+1|0,c[0|r];);for(;c[0|(r=(e=r)+1|0)];);if(vi(te=e+2|0))break}r=0,i=y;break C}nn(x+6824|0,e),N&&Cr(ue)&&(s[x+6824>>2]=_r(s[x+6824>>2])),r=s[x+6824>>2]}i=s[x+6828>>2],E|=2097152,N&&(i=_r(i))}if((0|i)!=8)break r}i=n;break A}r?s[x+6804>>2]=r:r=0}En(i)||ni(i)||Gr(s[O+336>>2],i)||!En(s[x+6808>>2])|!(!c[O+170|0]|i-48>>>0>=10)&s[x+6804>>2]-48>>>0>=10||(i=32,L=1);g:{r:{C:{a:{I:{if(s[x+6808>>2]-48>>>0<10){if(i-48>>>0<10){e=T;break I}if(1<<(e=i-32|0)&20481&&e>>>0<=14)break a;L=1}else if(e=0,s[x+6812>>2]!=44||(e=T,(0|i)!=44))break I;i=32;break a}if((0|i)==91&&((0|(y=s[x+6804>>2]))==2||(i=91,(0|y)==91&&s[47204])))break C;T=e}if(En(i)){a:{I:{f:{if(En(s[x+6808>>2])){if(!c[O+171|0]||(e=s[x+6808>>2],!((0|i)>12352)&&(0|e)<12353))break f}else e=s[x+6808>>2];if(de=Gr(s[O+336>>2],e)?de:0,(0|(e=s[x+6808>>2]))!=32&&!Gr(s[O+336>>2],e)){e=32,k=hi(s[x+6808>>2])?k:256|k;break I}E=Cr(i)?2|E:E,s[x+6808>>2]!=32|a[I-2|0]-48>>>0>=10|s[x+6812>>2]-48>>>0<10||(a[(x+784|0)+p|0]=32,e=1588+(v(R,12)+x|0)|0,o[e>>1]=h[e>>1]+1,p=p+1|0)}if(e=32,(0|i)==32)break a;if(de=de+1|0,(0|(y=s[O+600>>2]))<=0){e=i;break a}if(!((0|i)<=591&(0|(S=s[x+6808>>2]))>=(0|y))){if((0|i)<(0|y)){e=i;break a}if((0|de)<2){e=i;break a}if(!((0|S)<=591)){e=i;break a}}if(!En(S)){e=i;break a}E|=16384,k|=128}L=1}if(Te=Te+1|0,Cr(e)){if(y=si(e,O),s[O- -64>>2]){e=Ee?y:712,r=Ee?r:y,Ee=1;break e}if(Nr(s[x+6812>>2])){if(s[x+6808>>2]==32){e=y;break e}if(e=32,s[O+212>>2]!=26465)break g;for(i=85240,S=(x+784|0)+p|0,A=0;;){if(m=U(i),c[0|(P=S-m|0)]==32&&!Hn(P+1|0,i,m=m-1|0)){if((0|(i=a[i+m|0]))==(0|y)){e=y;break e}if((0|i)==65&&Yn(O,y)){e=y;break e}}if(i=s[131184+((A=A+1|0)<<2)>>2],(0|A)==11)break}break g}if(e=32,(0|y)==32)break e;if(!Cr(s[x+6812>>2])){e=y;break e}if(!Nr(s[x+6804>>2])){e=y;break e}if(nn(x+16|0,189424+(n+A|0)|0),!(s[O+212>>2]!=28268|(0|de)!=2|(0|y)!=106|s[x+6812>>2]!=73)){e=y;break e}if(s[x+6808>>2]==32){e=y;break e}if(!En(s[x+16>>2])){e=y;break e}k|=256,j=32,L=1;break e}if(!ee){ee=0;break e}if((0|de)<3){ee=0;break e}if((0|e)!=115){ee=0;break e}if(s[O+212>>2]!=25966){ee=0;break e}if(s[x+6804>>2]!=32){ee=0;break e}if(ee|=4,e=32,c[(i=p+x|0)+783|0]!=39)break e;a[i+783|0]=32;break e}e=32;a:{I:{f:{i:{b:switch(i-39|0){default:if((0|i)==95)break e;case 1:case 2:case 3:case 4:case 5:if(i-48>>>0>=10||c[O+170|0]&&En(s[x+6808>>2])&&!((y=s[x+6804>>2])-48>>>0<10|y-2406>>>0<10))break a;if((0|(S=s[x+6808>>2]))==32)break I;if(y=s[x+6808>>2],S-48>>>0<10)break f;if((0|(S=y))==(0|(y=s[O+128>>2])))break i;L=1;break e;case 6:if(!ni(s[x+6812>>2])&&En(s[x+6804>>2])){if(s[x+6808>>2]!=32){L=1;break e}if(E|=128,(0|R)<=0)break e;i=1572+(v(R,12)+x|0)|0,s[i>>2]=16384|s[i>>2];break e}if(i=s[x+6804>>2],!(s[x+6812>>2]!=32|(0|i)!=32)){ae=4;break e}if((0|i)==45){n=n+1|0,ae=4;break e}if(e=45,s[x+6808>>2]!=32||!En(P)||En(s[x+6812>>2]))break e;a[(x+784|0)+p|0]=32,i=1588+(v(R,12)+x|0)|0,o[i>>1]=h[i>>1]+1,p=p+1|0;break e;case 7:if(s[x+6808>>2]==46){L=1;break e}if(e=46,(0|R)<=0||(i=1572+(v(R,12)+x|0)|0,1&a[i+1|0])||!En(s[x+6812>>2]))break e;s[i>>2]=65536|s[i>>2],e=(e=ni(s[x+6804>>2]))||s[x+6804>>2]==45?32:46;break e;case 0:break b}b:{if((0|(y=s[x+6812>>2]))!=46||(i=115,s[x+6804>>2]!=115)){if(!Lr(y))break b;i=s[x+6804>>2]}if(En(i))break r}if(1&(i=s[O+88>>2])){if(En(s[x+6804>>2]))break r;i=s[O+88>>2]}if(2&i&&En(s[x+6812>>2]))break r;if(!(!Gr(s[O+332>>2],s[x+6812>>2])|(0|P)!=32)){n=(s[x+6804>>2]==32)+n|0;break r}if(y=(0|(i=s[x+6808>>2]))!=115|De,De=0,!(1&y))break e;De=!!(0|ni(i)),ae=4;break e}if((0|y)==44&T){L=1;break e}T=1;break a}if((0|y)!=32)break a}En(P)&&(En(s[x+6812>>2])||(a[(x+784|0)+p|0]=32,e=1588+(v(R,12)+x|0)|0,o[e>>1]=h[e>>1]+1,p=p+1|0))}e=i;break e}B=1,i=n+1|0,T=e;break A}e=39,De=0;break e}L=1,j=32}else{if(e-48>>>0<10){r=0,i=(0|(y=s[49574]+1|0))>(15&s[49573]),s[49574]=i?0:y,e=i?32:e,L|=i,B=0;break e}r=0,s[49574]=0,e=(i=s[x+6808>>2]-48>>>0<10)?32:e,L|=i,B=0}if(ni(e)){if(s[x+6808>>2]==32){E|=262144,i=n;break A}if(i=s[x+6816>>2]-9>>>0<2,S=1&L){A=0;e:if(!((0|C)>(0|(e=n-1|0))))for(;;){if(!(y=o[(x+5184|0)+(e<<1)>>1]))break e;if(A=((0|y)>0)+A|0,!((0|C)<=(0|(e=e-1|0))))break}a[1594+(v(R,12)+x|0)|0]=A}if(k=i?262144|k:k,a[(x+784|0)+p|0]=32,e=p+1|0,!((0|R)>298||(i=(x+1584|0)+v(R,12)|0,(0|(y=h[i+4>>1]))>=(0|e)))){if((0|he)<=0?C=s[i>>2]:(C=198300+(s[47350]<<2)|0,s[C>>2]=128|s[C>>2],he=0,C=64|s[i>>2]),m=s[47352],a[i+6|0]=m,s[i>>2]=C|(Te?ee:-2&ee)|(c[199304]?2048:0)|E,(0|m)>0){for(;E=(C=x+784|0)+e|0,C=C+(e=e-1|0)|0,a[0|E]=c[0|C],(0|e)>(0|y););a[0|C]=32,o[i+4>>1]=y+1,e=p+2|0}y=(x+1584|0)+v(R=R+1|0,12)|0,s[y>>2]=0,o[y+4>>1]=e,p=n;e:if(!((0|(i=s[x+6800>>2]))<=(0|n))){for(;;){if(o[(x+5184|0)+(p<<1)>>1]>0)break e;if((0|i)==(0|(p=p+1|0)))break}p=i}if(A=h[(x+5184|0)+(p<<1)>>1],o[y+8>>1]=A,Te=0,i=0,A)for(;i=!!(65535&~A)+i|0,A=h[(x+5184|0)+((p=p+1|0)<<1)>>1];);a[y+10|0]=i,s[47352]=0,ee=1,E=k,k=0,Ee=0}L=0,r=S?0:r,i=S?w:n}else(0|p)>795?(i=n,n=C,e=p):(e=qn(e,(x+784|0)+p|0)+p|0,i=n,n=C);s[47352]<(0|ae)&&(s[47352]=ae),ae=0,C=n,p=e}if(F||(w=i,!((0|p)<799)))break}(0|he)<=0|R||(e=198300+(s[47350]<<2)|0,s[e>>2]=128|s[e>>2],s[x+1584>>2]=64|s[x+1584>>2],R=1),e=(x+784|0)+p|0,s[O+8204>>2]=e-1,n=0,a[0|e]=0,a[x+1590|0]=0,a[1590+(v(R,12)+x|0)|0]=8;A:if((0|R)<=0)s[x+1584>>2]=512|s[x+1584>>2],p=s[49572];else{e=R-1|0;e:if((0|R)!=1)for(r=e;;){if(!hi(a[h[1588+(v(r,12)+x|0)>>1]+(x+784|0)|0])){n=r;break e}if(y=(0|r)>1,r=r-1|0,!y)break}if(n=(x+1584|0)+v(n,12)|0,s[n>>2]=16|s[n>>2],4194304&ne&&(e=(x+1584|0)+v(e,12)|0,256&(n=s[e>>2])||(s[e>>2]=65536|n)),s[x+1584>>2]=512|s[x+1584>>2],!((0|R)<=0|(0|(p=s[49572]))>990))for(y=3|(e=x+624|0),S=2|e,j=x+754|0,F=!(4194304&ne),w=0,C=0;;){s[47354]+=1;e:{if((0|(e=s[49827]))<=0||(e=e-1|0,s[49827]=e,e)){if(c[190280])break e}else a[190280]=0;e=h[1588+(v(w,12)+x|0)>>1]+(x+784|0)|0;g:if(!(a[0|e]-48>>>0>=10)&&(n=x+624|0,r=e,s[O+112>>2]!=1227133512)){for(;;){r:{if(a[0|r]-48>>>0<10)a[0|n]=c[0|r],n=n+1|0,r=r+1|0;else{if(s[O+124>>2]!=a[0|r]|c[r+1|0]!=32||(p=r+2|0,c[r+3|0]==32|a[0|p]-48>>>0>=10|c[r+4|0]==32))break r;w=w+1|0,r=p}if(n>>>0>>0)continue;break g}break}Pt(e+(n=n-(T=x+624|0)|0)|0,32,(r=(p=r-e|0)-n|0)>>>0<=p>>>0?r:0),ut(e,T,n)}for(n=0;r=n,n=n+1|0,a[e+r|0]-48>>>0<10;);g:if(r-5>>>0<=27){for(a[x+626|0]=32,o[x+624>>1]=8224,c[0|e]!=48&s[O+132>>2]>=(0|r)||(n=(x+1584|0)+v(w,12)|0,s[n>>2]=524288|s[n>>2]),k=(x+1584|0)+v(w,12)|0,A=0,p=y;n=e,!((e=a[0|e])-48>>>0>=10&(0|e)!=s[O+128>>2])&&(a[0|p]=e,e=p+1|0,T=r,(0|(r=r-1|0))<=0?p=e:s[O+112>>2]>>>r&1?(m=s[k+4>>2],E=(x+16|0)+v(A,12)|0,s[E>>2]=s[k>>2],s[E+4>>2]=m,s[E+8>>2]=s[k+8>>2],A=A+1|0,(0|(E=s[O+124>>2]))!=32&&(a[p+1|0]=E,e=p+2|0),a[0|e]=32,p=e+1|0,8&c[k+2|0]||((ae=s[O+112>>2])>>>T-2&1&&(a[e+1|0]=48,a[e+2|0]=48,ae=s[O+112>>2],p=e+3|0),ae>>>T-3&1&&(a[0|p]=48,p=p+1|0))):p=e,e=n+1|0,p>>>0>>0););if(r=s[k+4>>2],e=(x+16|0)+v(A,12)|0,s[e>>2]=s[k>>2],s[e+4>>2]=r,r=s[k+20>>2],s[e+16>>2]=s[k+16>>2],s[e+20>>2]=r,r=s[k+12>>2],s[e+8>>2]=s[k+8>>2],s[e+12>>2]=r,r=1,(0|A)>0)for(;e=(x+16|0)+v(r,12)|0,s[e>>2]=-262209&s[e>>2],(0|A)>=(0|(r=r+1|0)););if(e=c[n+4|0]|c[n+5|0]<<8|c[n+6|0]<<16|c[n+7|0]<<24,r=c[0|n]|c[n+1|0]<<8|c[n+2|0]<<16|c[n+3|0]<<24,a[0|p]=r,a[p+1|0]=r>>>8,a[p+2|0]=r>>>16,a[p+3|0]=r>>>24,a[p+4|0]=e,a[p+5|0]=e>>>8,a[p+6|0]=e>>>16,a[p+7|0]=e>>>24,e=c[n+12|0]|c[n+13|0]<<8|c[n+14|0]<<16|c[n+15|0]<<24,n=c[n+8|0]|c[n+9|0]<<8|c[n+10|0]<<16|c[n+11|0]<<24,a[p+8|0]=n,a[p+9|0]=n>>>8,a[p+10|0]=n>>>16,a[p+11|0]=n>>>24,a[p+12|0]=e,a[p+13|0]=e>>>8,a[p+14|0]=e>>>16,a[p+15|0]=e>>>24,a[p+16|0]=0,p>>>0<=y>>>0)break g;for(e=c[k+6|0],A=0,r=y;;){for(C=Ce(O,r,(x+16|0)+v(A,12)|0,255&e);e=c[0|r],r=r+1|0,(0|e)!=32;);if(e=0,a[k+6|0]=0,A=A+1|0,!(r>>>0

>>0))break}}else{if(s[47352]=0,C=Ce(O,e,n=(x+1584|0)+v(w,12)|0,c[n+6|0]),(0|(r=s[47352]))>c[n+18|0]&&(a[n+18|0]=r,s[47352]=0),!(!(4096&C)|c[0|e]==32))for(;Pt(x+624|0,0,150),s[x+624>>2]=538976288,s[x+628>>2]=538976288,a[x+632|0]=32,Ce(O,ut(S,e,r=nn(x+16|0,e)),n,0),c[0|(e=e+r|0)]!=32;);50331648&C&&(D=(e=F|(~s[33264]+R|0)!=(0|w))?D:10,e|!be||(s[be>>2]=4,D=10))}if(128&C&&!((0|(n=s[33264]))<=0)){if(e=0,r=n,p=3&n)for(;T=(x+1584|0)+v(r+w|0,12)|0,s[T>>2]=1048576|s[T>>2],r=r-1|0,(0|p)!=(0|(e=e+1|0)););if(n>>>0>=4)for(;e=(x+1584|0)+v(r+w|0,12)|0,s[e>>2]=1048576|s[e>>2],s[(n=e-12|0)>>2]=1048576|s[n>>2],s[(n=e-24|0)>>2]=1048576|s[n>>2],s[(e=e-36|0)>>2]=1048576|s[e>>2],r=r-4|0;);s[33264]=r}}if(p=s[49572],(0|R)<=(0|(w=w+1|0)))break A;if(!((0|p)<991))break}}if((0|(r=s[47351]))<(0|(y=s[47350]))){for(j=s[47202],F=s[49846],A=s[47352];;){e=(n=s[198304+(r<<2)>>2])>>8;A:{e:switch((31&n)-9|0){case 0:j=e;break A;case 4:F=e;break A;case 3:break e;default:break A}A=n>>>0>=256?e+A|0:0}if(!(!(128&n)&(0|y)>(0|(r=r+1|0))))break}s[47352]=A,s[47351]=r,s[49846]=F,s[47202]=j}s[49572]=p+2,s[(e=190288+(p<<3)|0)>>2]=589824,o[e+4>>1]=i,s[e+8>>2]=589824,o[e+12>>1]=i,n=R&&s[47199]?D:10,s[33285]?e=0:(e=s[33283],e=s[e>>2]==s[e+4>>2]),D=e?n:D,w=re,y=0,R=0,z=S=z-32192|0,s[S+24>>2]=0,s[S+28>>2]=0,s[S+16>>2]=0,s[S+20>>2]=0,s[S+8>>2]=0,s[S+12>>2]=0,s[S>>2]=0,s[S+4>>2]=0,i=s[49572],m=h[190284+(i<<3)>>1];A:{if((0|(r=i-3|0))<0)e=r;else{for(;;){if(y=(0|(n=127&c[(e=190288+(r<<3)|0)+3|0]))<(0|y)?y:n,h[e+4>>1])e=r;else if(e=-1,n=(0|r)>0,r=r-1|0,n)continue;break}if(y>>>0>3)break A}for(;;){if((0|(e=e-1|0))<0)break A;if(64&c[0|(n=190288+(e<<3)|0)]){a[n+3|0]=4;break A}if(!(c[n+3|0]<4))break}}if(e=s[O+292>>2],r=0,(0|i)<=0)y=0;else for(T=-1,y=0;;){n=e,s[O+292>>2]!=(0|e)&&(o[(e=190288+(r<<3)|0)>>1]=32|h[e>>1]),(0|y)>0&&(k=s[(C=190288+(r<<3)|0)+4>>2],s[(p=(e=r-y<<3)+190288|0)>>2]=s[C>>2],s[p+4>>2]=k,(0|T)!=-1&&(o[4+(e+190288|0)>>1]=T),T=-1);A:{if(c[2+((p=r<<3)+190288|0)|0]==21){if(e=c[(C=p+190288|0)+7|0],2&c[0|C])break A;e:if((0|e)!=(0|n)){if(C=c[10+(p+190288|0)|0]-9|0){if((0|C)==12)break e;break A}if(c[18+(p+190288|0)|0]!=21)break A}(0|T)==-1&&(T=(e=h[4+(p+190288|0)>>1])||-1),y=y+1|0}e=n}if((0|i)==(0|(r=r+1|0)))break}if(s[49572]=i-y,ci(e),(n=s[O+36>>2])&&!((0|(e=(y=s[49572])-1|0))<0))for(j=256&n,E=4&n,F=8&n,k=15&n,L=16&n,re=2&n,n=n>>>8&1,r=0;;){if(p=y,i=r,y=e,(0|(e=c[(C=(ee=e<<3)+190288|0)+2|0]))==21){A:{e:{if((0|(r=p-2|0))>=0)for(;;){if(c[2+((e=r<<3)+190288|0)|0]==21)break e;if(e=(0|r)>0,r=r-1|0,!e)break}e=s[O+292>>2];break A}e=c[7+(e+190288|0)|0]}ci(e),e=c[C+2|0]}if(r=i,(e=s[144464+((255&e)<<2)>>2])&&(r=n,!(32&c[0|C]))){r=c[e+11|0],T=0,re&&((0|(p=c[0|e]))!=118&(0|p)!=82||(i=L?0:i,T=1));A:{e:{g:{r:switch((p=253&r)-4|0){case 1:break g;case 0:break r;default:break e}if(k&&(r=1,!i)||(0|(r=i))!=2||(r=2,!(e=c[e+13|0])))break A;a[C+2|0]=e;break A}if(k&&(r=2,!i)||(0|(r=i))!=1||(r=1,!(e=c[e+13|0])))break A;a[C+2|0]=e;break A}r=0,F&&(r=p?i:0)}r=e=T?0:r,h[4+(ee+190288|0)>>1]&&(r=e=E?0:e,j&&(r=e||1))}if(!((0|(e=y-1|0))>=0))break}if(ci(s[O+292>>2]),s[49572]<=0)L=-2,r=0;else{for(r=-1,i=0,C=0,F=0;;){e=C<<3,(0|r)!=-1&&(o[4+(e+190288|0)>>1]=r),c[(T=e+190288|0)+2|0]==21&&ci(c[7+(e+190288|0)|0]),k=s[49572];A:{if(!(32&c[0|(p=e+190288|0)])){i=(0|(n=k-1|0))>(0|C)?s[144464+(c[10+(e+190288|0)|0]<<2)>>2]:i,!(h[p+12>>1]|(0|n)==(0|C))&&(A=0,c[i+11|0]|!i)||(A=1),y=c[T+2|0];e:if(!((0|(L=s[49848]))<=0))for(n=e+190288|0,r=0;;){if(j=v(r,3),c[j+199408|0]==(255&y)&&!((E=c[2+(j+199408|0)|0])&(1^A)|(4&c[n+3|0]?2&E:0)|(h[n+4>>1]?0:4&E))){if(y=c[1+(j+199408|0)|0],a[T+2|0]=y,!(2&c[s[144464+(y<<2)>>2]+4|0])|c[n+3|0]<2)break e;a[n+3|0]=0;break e}if((0|L)==(0|(r=r+1|0)))break}if(!(255&y)){r=h[4+(e+190288|0)>>1];break A}}r=s[p+4>>2],e=(S+32|0)+(F<<5)|0,n=s[p>>2],s[e>>2]=n,s[e+4>>2]=r,n=s[144464+(n>>>14&1020)>>2],s[e+8>>2]=n,a[e+17|0]=c[n+11|0],F=F+1|0,r=-1}if(!((0|F)<1e3&(0|k)>(0|(C=C+1|0))))break}if(y=0,r=0,!((0|(L=F-2|0))<=0))for(;;){A:if(h[4+((S+32|0)+(y<<5)|0)>>1]){for(n=(0|y)>(0|L)?y:L,r=0,e=y;;){if((0|e)!=(0|n)){if(r=(0|r)>(0|(p=c[3+((i=S+32|0)+(e<<5)|0)|0]))?r:p,!h[4+(i+((e=e+1|0)<<5)|0)>>1])continue}else e=n;break}if((0|e)<=(0|y))break A;if(n=~y+e|0,i=0,p=e-y&7)for(;a[6+((S+32|0)+(y<<5)|0)|0]=r,y=y+1|0,(0|p)!=(0|(i=i+1|0)););if(n>>>0<7)break A;for(;a[(n=(S+32|0)+(y<<5)|0)+6|0]=r,a[n+38|0]=r,a[n+70|0]=r,a[n+102|0]=r,a[n+134|0]=r,a[n+166|0]=r,a[n+198|0]=r,a[n+230|0]=r,(0|(y=y+8|0))!=(0|e););}else e=y+1|0;if(y=e,!((0|L)>(0|e)))break}}for(s[S+40>>2]=s[36125],ci(s[O+292>>2]),P=(0|r)<4,C=1,j=1,k=0,n=0,r=0,re=0;;){A:{e:{g:{r:{if(n){if(i=(e=S+32|0)+((T=r-1|0)<<5)|0,k=c[2+(e+(r<<5)|0)|0],(0|T)>0){if(e=C-(r=(0|C)>0)|0,T>>>0>=(y=r?C:2)>>>0)for(;p=(r=(S+32|0)+(y<<5)|0)-32|0,C=s[r+12>>2],s[p+8>>2]=s[r+8>>2],s[p+12>>2]=C,C=s[r+4>>2],s[p>>2]=s[r>>2],s[p+4>>2]=C,C=s[r+28>>2],s[p+24>>2]=s[r+24>>2],s[p+28>>2]=C,C=s[r+20>>2],s[p+16>>2]=s[r+16>>2],s[p+20>>2]=C,(0|T)>=(0|(y=y+1|0)););C=e}A=s[144464+(k<<2)>>2],s[i>>2]=0,s[i+4>>2]=0,s[i+24>>2]=0,s[i+28>>2]=0,s[i+16>>2]=0,s[i+20>>2]=0,s[i+8>>2]=0,s[i+12>>2]=0,a[i+2|0]=n,e=s[144464+(n<<2)>>2],s[i+8>>2]=e,k=i}else{if((0|r)>=(0|L)|(0|re)>=997)break r;p=c[(i=(y=r<<5)+(S+32|0)|0)+2|0],e=s[144464+(p<<2)>>2],s[i+8>>2]=e,T=h[i+4>>1],(0|p)==21&&ci(c[7+(y+(S+32|0)|0)|0]),C=T?r:C,A=s[144464+(c[i+34|0]<<2)>>2],s[i+40>>2]=A,T=r}if(!e){n=0,r=T+1|0;continue}if(xe(O,256,i,S+32040|0,S),(0|(r=s[S+32052>>2]))>0&&(y=(S+32|0)+(T<<5)|0,A=s[144464+(r<<2)>>2],s[y+40>>2]=A,a[y+34|0]=r,a[y+49|0]=c[A+11|0]),r=0,n)n=e;else if((0|(y=s[S+32056>>2]))<=0)n=e;else{n=s[144464+(y<<2)>>2],s[i+8>>2]=n,r=c[i+2|0],a[i+2|0]=y,y=h[i>>1];C:if(c[n+11|0]!=2)o[i>>1]=65531&y;else{if(o[i>>1]=4|y,c[e+11|0]==2)break C;a[i+3|0]=0}xe(O,256,i,S+32040|0,S)}if((0|(p=s[S+32048>>2]))<=0)y=n;else{if(y=s[144464+(p<<2)>>2],a[i+2|0]=p,s[i+8>>2]=y,e=c[y+11|0],F=1,(0|p)==1){ee=(0|e)==2;break e}p=h[i>>1];C:if((0|e)!=2)o[i>>1]=65531&p;else{if(o[i>>1]=4|p,c[n+11|0]==2)break C;a[i+3|0]=0}xe(O,256,i,S+32040|0,S)}if(ee=0,(0|(e=c[y+11|0]))!=2){F=0;break e}if(ee=1,F=0,e=2,c[i+3|0]>1){R=0;break e}p=i+3|0,R=R+1|0,n=i;C:{if(8&(E=s[O+12>>2])){for(;;){a:switch(E=n,n=n+32|0,c[E+49|0]){case 0:break e;case 2:break a;default:continue}break}if(c[0|(n=E+35|0)]>1)break e;if(c[i+6|0]<=3&&(a[0|p]=0),c[E+38|0]<4)break C;break e}if(1&R|(0|R)<2)break e;if(2&E)break g;if(P)n=p;else if(n=p,h[i+36>>1])break g}a[0|n]=0;break e}s[36423]=re+2,o[(e=145840+(re<<5)|0)>>1]=0,a[e+2|0]=9,a[e+20|0]=2,s[e+12>>2]=D,o[e+4>>1]=m,a[e+17|0]=0,a[e+18|0]=0,s[e+8>>2]=s[36125],o[e+32>>1]=0,a[e+34|0]=9,a[e+52|0]=0,s[e+44>>2]=0,o[e+36>>1]=0,a[e+49|0]=0,a[e+50|0]=0,s[e+40>>2]=s[36126],ci(s[O+292>>2]),z=S+32192|0;break A}R=1}if(!(8&(n=h[i+32>>1]))|(0|T)<=0||(p=c[A+11|0])>>>0>15|!(1<>1]=8^n),N=h[i+36>>1]){e:if(n=s[O+4>>2]){g:switch(0|e){default:r=512&n?11:r;break;case 0:break e;case 2:break g}if(c[A+11|0]==2){(p=12&n)&&(r=(0|p)==12?11:23);g:if(ee){r:switch(3&n){case 2:r=10;break g;case 0:break g;default:break r}r=23}c[i+35|0]<4||(r=256&n?10:r)}}if(!((0|i)==(0|k)|(0|re)<=0)){e:{g:{r:switch(0|(n=7&s[O>>2])){case 0:break e;case 1:break r;default:break g}if(r-12>>>0>4294967293)break e}r=c[n+101916|0]}r=s[47205]>0?24:r}}if(s[i+72>>2]=s[144464+(c[i+66|0]<<2)>>2],n=s[S+32060>>2],n=r||n||r,!F){a[(p=(E=re<<5)+145840|0)+17|0]=e,s[p+8>>2]=y,a[p+16|0]=0,o[p>>1]=h[i>>1],a[p+3|0]=15&c[i+3|0],a[p+6|0]=c[i+6|0],r=c[i+7|0],o[p+4>>1]=0,a[p+7|0]=r,F=c[y+10|0],a[p+2|0]=F;e:if(r=h[i+4>>1]){if(o[p+4>>1]=r,w=1&w?5:1,a[(i=E+145840|0)+20|0]=w,r=j,j=0,!r){w=0;break e}a[i+20|0]=8|w,w=0}else a[20+(E+145840|0)|0]=0;s[(r=E+145840|0)+12>>2]=s[S+32084>>2]<<1,!N|(0|F)!=24||(0|(i=s[47205]))<=0||(s[p+8>>2]=s[36126],s[r+12>>2]=v(i,14)),(1<>>0<=8:0)|2&c[y+7|0]&&(s[r+12>>2]=128,a[p+16|0]=0),a[(e=E+145840|0)+21|0]=255,a[e+22|0]=255,o[e+18>>1]=5120,re=re+1|0}r=T+1|0;continue}break}o[88922]=1,s[44462]=0,he&&(o[145776+(s[36423]<<5)>>1]=2,e=198304+(s[47350]<<2)|0,s[e>>2]=128,s[(e=e-4|0)>>2]=128|s[e>>2]),a[190268]=ne>>>19&1,Oe&&(s[Oe>>2]=ne<<14>>31&189360)}z=x+6832|0,L=s[47192],ee=s[t+12>>2],n=0,p=0,C=0,E=0,k=0,ae=0,D=0,z=m=z-6e3|0;A:if(!((0|(i=(re=s[36423])-1|0))<=0)){for(;a[2+(m+v(n,6)|0)|0]=0,4&c[(e=n<<5)+145840|0]?(r=m+v(E,6)|0,a[r+1|0]=0,e=e+145840|0,a[r+3|0]=c[e+49|0],e=c[e+3|0],a[0|r]=e,E=E+1|0,ae=(e>>>0>3)+ae|0):c[s[8+(e+145840|0)>>2]+10|0]!=27|(0|E)<=0||(e=(m+v(E,6)|0)-4|0,a[0|e]=4|c[0|e]),(0|i)!=(0|(n=n+1|0)););if(a[m+v(E,6)|0]=0,E)if(s[L+148>>2]==1){if(!((0|re)<=0)){for(e=-2&re,r=1&re,n=145840;C=c[n+17|0]==2&&c[n+3|0]>3?p:C,C=c[n+49|0]==2&&c[n+35|0]>3?1|p:C,n=n- -64|0,p=p+2|0,(0|e)!=(0|(k=k+2|0)););!r|c[n+17|0]!=2||(C=c[n+3|0]>3?p:C)}if(a[(y=(e=C<<5)+145840|0)+3|0]=7,s[L+212>>2]==30313&&(c[(e=e+145840|0)+7|0]||(a[e+7|0]=jr(55),re=s[36423])),!((0|re)<=0)){for(k=0,n=145840,e=145840,p=T=s[36125],i=0,j=1;;){if(c[n+17|0]?w=s[36125]:(w=s[36125],T=(r=c[s[n+8>>2]+14|0]>50)?w:T,j|=r),r=c[n+20|0]?w:p,4&c[0|n]){w=c[n+7|0],p=s[144464+(w<<2)>>2];e:{if((0|(E=s[L+212>>2]))==6840683){if(s[r>>2]!=49||(E=s[p>>2]-49|0)>>>0>5|!(1<>2]}if(!((0|E)!=6516078&(0|E)!=31336)){E=0,w||(i=jr(1&(E=i|j)?13621:12593),a[n+7|0]=i,p=s[144464+(i<<2)>>2]),(0|C)!=(0|k)|(1024|s[p>>2])!=13621||(a[y+3|0]=6),s[T>>2]==3420466&&(a[e+7|0]=jr(s[p>>2]==3420466?13619:12594));g:{if(s[r>>2]==12597){if((0|(w=s[p>>2]))!=12597)break g;a[e+7|0]=jr(13109)}w=s[p>>2]}i=E,(0|w)==12593&&((0|(w=s[T>>2]))==13621&&(a[n+7|0]=jr(12850),w=s[T>>2]),(0|w)==13619&&(a[n+7|0]=jr(13107),w=s[T>>2]),(0|w)==3420466&&(a[n+7|0]=jr(13364)),a[n+3|0]=0)}}j=0,T=p,e=n}else p=r;if(n=n+32|0,!((0|(k=k+1|0))<(0|(r=s[36423]))))break}if(p=0,n=145840,!((0|r)<=0))for(;4&c[0|n]&&((e=c[n+7|0])||(a[n+7|0]=17,e=17),e=s[144464+(e<<2)>>2],a[n+21|0]=c[e+12|0],a[n+22|0]=c[e+13|0]),n=n+32|0,(0|r)!=(0|(p=p+1|0)););}}else{if(e=s[L+152>>2],e=L+v(P=(0|e)>7?1:e,6)|0,O=c[0|(P?e+637:L+157)],ne=c[0|(P?636+(e+ee|0):156+(L+ee|0))],a[133068]=(0|ee)==4,!((0|E)<=0)){for(F=E-1|0,A=ee-1>>>0>1,r=0,i=0;;){x=m+v(i,6)|0,D=((e=c[0|x])<<24>>24>3)+D|0;e:if((0|e)==6){e=i-3|0,n=i;g:{for(;;){if((0|n)<=(0|r)|(0|e)>=(0|n))break g;r:switch(y=m+v(n=n-1|0,6)|0,c[0|y]-4|0){case 2:break g;case 0:break r;default:continue}break}a[0|y]=3}n=i;g:{for(;;){if((0|E)<=(0|(n=n+1|0)))break g;r:switch(c[m+v(n,6)|0]-4|0){case 0:break g;case 2:break r;default:continue}break}a[x+2|0]=2,a[0|x]=5,e=r;break e}if(c[0|x]==6){a[x+2|0]=2,S=0;g:if((0|E)<=(0|(e=i+1|0)))y=i,B=0;else if(B=1,(0|(p=a[m+v(e,6)|0]))>4)y=i;else{for(C=(ae-D|0)>1,y=i;;){if(n=e,(255&p)==4&&(e=C+1|0,C=1,!((0|e)<=1))){e=n;break g}if(B=(0|E)>(0|(e=n+1|0)),(0|e)==(0|E))break;if(y=n,(0|(p=a[m+v(e,6)|0]))>4)break g}y=F,e=E}p=-1,w=0,C=0,j=-1,k=0,T=-1;g:{if((0|(n=r))<(0|e)){for(;p=(N=(0|(T=a[m+v(n,6)|0]))>3)&&(0|p)<0?n-r|0:p,S=(k=(0|C)>(0|T))?S:(0|C)<(0|T)?n:w,j=N?n:j,w=k?w:n,N=(0|n)!=(0|y),C=k?C:T,n=n+1|0,N;);if(k=w,T=j,(0|p)>=0)break g}p=e,w=k,j=T}s[33269]=y-w,s[33268]=p,s[33270]=w,s[33271]=S;g:if(c[133068])s[33270]=e,s[33271]=e;else if((0|j)>=0){if((0|e)!=(0|E))break g;a[m+v(j,6)|0]=7}else a[m+v(w,6)|0]=7;we(m,P,r,e,ne),!B&!!(0|ee)||(ne=A?c[L+156|0]:c[L+157|0])}else e=r}else e=r;if((0|e)>=(0|i))r=e;else if(4&c[x+2|0]){for(r=i+1|0,p=-1,j=0,w=0,C=0,n=e,S=-1;p=(k=(0|(y=a[m+v(n,6)|0]))>3)&&(0|p)<0?n-e|0:p,j=(T=(0|y)<(0|C))?j:(0|y)>(0|C)?n:w,S=k?n:S,w=T?w:n,k=(0|n)!=(0|i),C=T?C:y,n=n+1|0,k;);s[33269]=i-w,s[33270]=w,s[33271]=j,s[33268]=(0|p)<0?r:p,c[133068]?(s[33270]=r,s[33271]=r):(0|S)>=0?a[m+v(S,6)|0]=7:a[m+v(w,6)|0]=7,we(m,P,e,r,O)}else r=e;if((0|E)==(0|(i=i+1|0)))break}if(!((0|r)>=(0|E))){for(p=-1,j=0,w=0,C=0,n=r,S=-1;p=(y=(0|(e=a[m+v(n,6)|0]))>3)&&(0|p)<0?n-r|0:p,j=(i=(0|e)<(0|C))?j:(0|e)>(0|C)?n:w,S=y?n:S,w=i?w:n,C=i?C:e,(0|E)!=(0|(n=n+1|0)););s[33270]=w,s[33271]=j,s[33269]=~w+E,s[33268]=(0|p)<0?E:p,c[133068]?(s[33270]=E,s[33271]=E):(0|S)>=0?a[m+v(S,6)|0]=7:a[m+v(w,6)|0]=7,we(m,P,r,E,ne)}}if((0|re)<=0)break A;for(n=0,k=0;;){if(T=r=(y=n<<5)+145840|0,e=m+v(k,6)|0,p=c[0|e],a[r+3|0]=p,4&c[0|r]){i=y+145840|0,r=c[e+4|0],a[i+21|0]=r,C=c[e+5|0],a[i+16|0]=0,a[i+22|0]=C;e:{if(1&(w=c[e+2|0]))e=2;else{if(p>>>0<6)break e;e=c[e+1|0]}a[i+16|0]=e}r>>>0<=(255&C)>>>0?(e=C,C=r):(a[i+21|0]=C,a[i+22|0]=r,e=r),(r=c[7+(y+145840|0)|0])&&(e=(255&e)+(255&C)>>>1|0,r=s[144464+(r<<2)>>2],a[i+22|0]=e+c[r+13|0],a[i+21|0]=e+c[r+12|0]),2&w&&(a[T+3|0]=8|p),k=k+1|0}if((0|re)==(0|(n=n+1|0)))break}}}if(z=m+6e3|0,k=s[47192],n=0,A=0,S=0,D=0,z=m=z-160|0,s[36423]>=2)for(ee=s[30450],p=1;;){if(p=(e=p)+1|0,E=c[(i=(C=e<<5)+145840|0)+3|0],2&(w=h[i>>1])){for(;(31&(y=s[198304+(D<<2)>>2]))==2&&(rt(127&y,y>>>8|0),s[36432]=110,s[36433]=100,s[36434]=450,s[36430]=5,w=s[50786],T=s[32972],(0|(r=s[T+84>>2]))>0&&(w=(0|v(r,w))/100|0),j=c[((0|(r=(0|w)>=359?359:w))<=80?80:r)+101856|0],r=(0|(r=(0|w)>=450?450:w))>399?6:(0|r)>379?7:j,s[32526]=(0|v(r,s[T+72>>2]))/256,s[32527]=(0|v(r,s[T+76>>2]))/256,s[32528]=(0|v(r,s[T+80>>2]))/256,r>>>0>7||(T=r-1|0,s[32528]=T,s[32526]=r,s[32527]=T)),D=D+1|0,!(128&y););w=h[i>>1]}T=p<<5,j=e-1|0,r=7&E;A:{e:{g:{r:{C:{a:{I:{f:{i:{b:switch(ne=c[17+(C+145840|0)|0],0|(y=4&w?2:ne)){case 2:break C;case 3:case 8:break a;case 5:break I;case 6:case 7:break f;case 4:break i;case 0:break b;default:break A}n=0;break A}if((0|(e=c[17+(145840+(j<<5)|0)|0]))==6?(r=25,a[18+(C+145840|0)|0]=25):(r=(0|e)==4?60:s[34063]>0||r>>>0<4?48:60,a[18+(C+145840|0)|0]=r),!(16&c[0|k])|!c[20+(C+145840|0)|0]||(a[18+(C+145840|0)|0]=60,r=60),64&c[s[8+(C+145840|0)>>2]+6|0]&&(r=r+30|0,a[18+(C+145840|0)|0]=r),n=0,!(8&w))break A;a[18+(C+145840|0)|0]=c[k+164|0]+r;break A}!(i=c[(e=C+145840|0)+20|0])|1&a[s[e+8>>2]+7|0]&c[17+(145840+(j<<5)|0)|0]==2||(a[18+(C+145840|0)|0]=15),r=c[17+(T+145840|0)|0],8&c[s[8+(C+145840|0)>>2]+4|0]|r|c[17+(145840+(j<<5)|0)|0]!=8||(a[18+(C+145840|0)|0]=25),64&c[s[8+((e=j<<5)+145840|0)>>2]+5|0]&&(a[18+(C+145840|0)|0]=30),!i|!(16&s[k>>2])||(a[18+(C+145840|0)|0]=30);f:if(c[20+(T+145840|0)|0]|!(32&c[s[8+(C+145840|0)>>2]+4|0])|(0|r)!=4)s[12+(C+145840|0)>>2]=256;else{if(i=C+145840|0,c[17+(e+145840|0)|0]==2){s[i+12>>2]=200;break f}s[i+12>>2]=150}if((0|y)!=7||(A|=(0|r)==2,(254&c[17+(e+145840|0)|0])!=2))break A;s[12+(C+145840|0)>>2]=s[12+(e+145840|0)>>2]+255>>>1;break A}(254&(r=c[17+((e=j<<5)+145840|0)|0]))==6|(0|r)==3|32&s[s[8+(e+145840|0)>>2]+4>>2]&&(a[18+(C+145840|0)|0]=30);I:if((254&(i=c[17+(T+145840|0)|0]))==2){A=c[20+(T+145840|0)|0]&&(0|i)!=2?A:1,a[(i=C+145840|0)+18|0]=40,E=0;f:{i:switch(0|r){case 0:if((e=s[12+(e+145840|0)>>2])>>>0>39)break f;E=40-e|0;break f;case 2:break f;default:break i}if(c[20+(C+145840|0)|0])break I;E=20;i:switch(r-3|0){case 1:if(E=0,!(8&c[s[8+(e+145840|0)>>2]+4|0]))break f;break I;case 0:break f;case 5:break i;default:break I}E=12}a[i+18|0]=E}if(!(16&c[0|k])|!c[20+(C+145840|0)|0]||c[(e=C+145840|0)+18|0]>19)break A;a[e+18|0]=20;break A}i=c[k+296|0],y=r=C+145840|0,s[r+12>>2]=256,a[r+19|0]=i;a:if(c[r+20|0]){w=25;I:switch(c[17+(145840+(j<<5)|0)|0]-2|0){case 0:if(w=12,1&a[s[8+(C+145840|0)>>2]+7|0])break a;break;case 1:break I;default:break a}a[18+(C+145840|0)|0]=w}if((0|(T=c[17+(T+145840|0)|0]))==2){S=1;break A}if(a[(i=C+145840|0)+22|0]=n,(254&c[17+((r=j<<5)+145840|0)|0])==2)break r;if(r=n,(0|(y=s[36423]))<=(0|e))break e;for(;;){if(c[17+((r=e<<5)+145840|0)|0]==2){r=c[22+(r+145840|0)|0],a[i+22|0]=r;break e}if((0|y)==(0|(e=e+1|0)))break}break g}if(L=C+145840|0,F=r^r>>>0<2,r=(re=8&E)?25:c[296+(F+k|0)|0]-S|0,a[L+19|0]=r,(s[36423]-3|0)>(0|e)||(0|(y=255&r))<=(0|(r=s[k+52>>2]))||(a[L+19|0]=r),r=0,E=0,!(w=c[i+52|0]))for(;y=s[i+40>>2],E=c[i+49|0]==2?(~s[y+4>>2]>>>20&1)+E|0:E,r=c[y+10|0]==27?2:r,y=i,i=i+32|0,!(w=c[y+84|0]););y=L+96|0,e=(P=e+2<<5)+145840|0,s[34063]=E,x=c[s[i+40>>2]+10|0],T=T+145840|0,c[17+(P+145840|0)|0]|c[s[T+8>>2]+10|0]!=23?(i=y,y=e,e=T):i=C+145968|0,T=c[s[y+8>>2]+15|0];C:if(E)T=c[s[k+96>>2]+(c[s[e+8>>2]+15|0]+v(T,10)|0)|0],c[e+17|0]!=8|(254&c[y+17|0])!=4||(T=8&c[s[i+8>>2]+4|0]?T-15|0:T);else{if(O=s[k+100>>2],P=c[s[e+8>>2]+15|0],i=c[e+20|0],T=c[O+(P+v(i|c[y+20|0]?(0|T)==1:T,10)|0)|0],!i|!(32&c[0|k]))break C;T=c[1+(O+v(P,10)|0)|0]+T>>>1|0}i=w>>>1|0,P=!E,w=(0|(T=(0|v(s[130104+(E?(0|E)==1?4:8:0)>>2],T))/128|0))<=8?8:T;C:if((0|F)!=7)re&&(w=s[k+200>>2]+w|0);else{if(w=(T=s[k+200>>2])+w|0,!re)break C;w=((0|T)/2|0)+w|0}T=i&P|(0|x)==27,(i=h[304+(k+(F<<1)|0)>>1])||(i=h[k+316>>1]),w=v(i<<16>>16,w),(E=c[(i=C+145840|0)+7|0])&&(F=c[s[144464+(E<<2)>>2]+14|0])&&(w=(0|v(w,F))/100|0),(T|(0|r)==2)==1&&(2097152&(r=s[k+12>>2])||(w=(0|v(262144&r?282:256+((280-(c[s[8+(C+145840|0)>>2]+14|0]<<1)|0)/3|0)&65535,w))/256|0)),F=C+145840|0,r=v(s[32526],s[k+196>>2]),re=(0|ne)==2?(0|((0|r)>(0|w)?w:r))/128|0:256,s[F+12>>2]=re,(r=c[F+16|0])>>>0>=19&&(pi(84371,28,ee),a[F+16|0]=0,E=c[i+7|0],r=0),w=r+1|0,(r=255&E)?(lr(r,m+8|0),r=li(s[m+132>>2])):r=s[129280+((255&w)<<2)>>2],T=C+145840|0,1&(S|A)&&(i=(C=j<<5)+145840|0,S=c[0|r],r=c[T+21|0],r=((0|v(S,c[T+22|0]-r|0))/256|0)+r|0,a[i+22|0]=r,n=(r-(n=(0|r)==255?255:n)|0)>16?r-16|0:n,a[i+21|0]=n,i=0,(0|n)<(0|r)&&(a[F+16|0]=w,i=2),s[(n=C+145840|0)+12>>2]=re,a[n+16|0]=i,r=c[L+19|0],a[n+19|0]=c[n+17|0]!=3&&r>>>0>18?18:r),n=(0|ne)!=2,i=-2&(r=h[e>>1]),o[e>>1]=i;C:{a:{I:switch(c[e+17|0]-3|0){case 5:if(c[y+17|0]==2)break C;i=1|r;break a;case 0:break I;default:break C}if(o[e>>1]=1|r,c[y+17|0]!=2&&s[s[e+8>>2]>>2]!=12146)break C}o[e>>1]=i}n?(0|(e=n<<4))<=((r=c[T+22|0])-(i=c[T+21|0])|0)||(i=(0|(e=r-e|0))>0?e:0,a[T+21|0]=i):(r=c[T+22|0],i=c[T+21|0]),e=255&i,n=((0|v(c[s[129280+(c[F+16|0]<<2)>>2]+127|0],r-e|0))/256|0)+e|0,S=0,A=0;break A}i=s[12+(r+145840|0)>>2],s[y+12>>2]=i,(0|ne)==3&&(i=s[32526],s[y+12>>2]=i),r=n;r:switch(T-5|0){case 0:s[y+12>>2]=(v(i,160)>>>0)/100;break g;case 2:break r;default:break e}s[y+12>>2]=(v(i,120)>>>0)/100}r=n}A=0,a[(e=C+145840|0)+16|0]=0,i=e,r=(e=255&r)-16|0,a[i+21|0]=e>>>0>=r>>>0?r:0}if(!(s[36423]>(0|p)))break}if(z=m+160|0,15&(i=s[47197])|s[36456]){e=0,y=0,z=r=z-80|0;A:if((n=s[33222])||(s[33223]=500,n=ve(500),s[33222]=n,n)){if(!((s[36423]-2|0)<2)){for(e=i>>8,k=128&i?0:e,E=e&i<<24>>31,T=2&i,i=r+32|1,C=1;;){if(gt(r,s[(p=(j=C<<5)+145840|0)+8>>2],p,T,r+72|0),e=r+32|0,(13&(n=c[p+20|0]))==1&&(a[r+32|0]=32,e=i),!k|(0|k)!=32&!!(0|n)|C>>>0<2||(nn(r+76|0,r),s[r+76>>2]-880>>>0>4294967103||(e=qn(k,e)+e|0)),4&c[0|p]&&((n=c[3+(j+145840|0)|0])>>>0<2||(n=n>>>0>=5?5:n,n=T?n>>>0>3?712:716:a[n+94144|0],s[r+76>>2]=n,e=qn(n,e)+e|0)),w=0,s[r+72>>2]=0,c[0|(n=r)])for(;n=nn(r+76|0,n)+n|0,s[r+72>>2]>>>w-1&1|!E|(0|w)<=0||(S=s[r+76>>2])-880>>>0>4294967103||Xr(S)&&(e=qn(E,e)+e|0),w=w+1|0,e=qn(s[r+76>>2],e)+e|0,c[0|n];);if(c[s[p+8>>2]+10|0]!=21&&(8&(n=h[p>>1])&&(e=gt(e,s[36128],p,T,0),n=h[p>>1]),!(4&n)|c[17+(j+145840|0)|0]==2||(e=gt(e,s[36136],p,T,0)),(n=c[7+(j+145840|0)|0])&&(e=gt(e,s[144464+(n<<2)>>2],p,T,0))),(e=(p=e-(r+32|0)|0)+y|0)>>>0>2]=n,fi(s[47195],84367,t)),(e=s[36456])&&Ui[0|e](n)}c[190280]?(s[36423]=0,e=1):(fe(0),(e=s[t+8>>2])?(z=n=z+-64|0,Ti(n,e,60),pn(n,1),r=0,(e=ge(n,0))&&(r=e,c[202976]&&(r=ge(202976,2))),z=n- -64|0,s[44468]=r):r=s[44468],e=1,r&&(n=s[32972],(r=ve(1344))&&(n=ut(r,n,1344),r=216192+(s[50758]<<4)|0,s[r>>2]=11,s[r+8>>2]=n,n=s[50758]+1|0,s[50758]=(0|n)<=169?n:0),s[44468]=0))}else e=0,a[190280]=0;else e=0,s[36423]=0,s[50758]=0,s[50757]=0;return z=t+16|0,e}function le(e,t){var n=0,r=0,i=0,a=0;n=1073741825;A:{e:{g:{r:{C:{a:{I:{f:{i:{b:{s:{t:{n:{k:{o:{B:{c:{Q:{G:{w:{E:{D:{u:{l:{x:{d:{m:{M:{v:{h:{p:{Y:{H:{N:{P:{F:{y:{z:{O:{Z:{K:{W:{X:{L:{T:{V:{J:{R:{U:{j:{S:{q:{_:{$:{AA:{eA:{gA:{rA:{CA:{aA:{IA:{fA:{iA:{bA:{sA:{tA:{nA:{kA:{oA:{BA:{cA:{QA:{GA:{wA:{EA:{DA:{uA:{lA:{xA:{dA:{mA:{MA:{vA:{hA:{pA:{YA:{HA:{NA:{PA:{FA:{yA:{zA:{OA:{ZA:{KA:{WA:{XA:{LA:{TA:{VA:{JA:{RA:{UA:switch(0|t){case 0:t=e-9>>>0<5?1073741825:0,t=(e=(0|e)==133)?1073741825:t;break x;case 1:jA:{SA:{qA:{_A:{$A:{Ae:{ee:{ge:{re:{Ce:{ae:{Ie:{fe:{ie:{if((0|(t=-256&e))<=2047){if(!t)break ie;if((0|t)==1536)break fe;if((0|t)!=1792||(n=0,r=1,(0|e)!=1807))break jA;break X}if((0|t)<=69631){if((0|t)==2048)break Ie;if((0|t)!=8192)break jA;switch(n=131076,e-8204|0){case 1:break ae;case 0:break X;default:break Ce}}if((0|t)==69632)break re;if((0|t)!=917504)break jA;switch(n=8388608,e-917505|0){case 62:break qA;case 58:break _A;case 57:break $A;case 45:break Ae;case 43:break ee;case 32:break ge;case 0:break X;default:break SA}}if(n=16,(0|e)!=173)break jA;break X}if(n=0,r=1,e-1536>>>0<6)break X;r=(0|e)==1757,t=(e=(0|e)==1564)?2:0;break l}if(n=0,r=1,(0|e)!=2274)break jA;break X}return B=64,4}if(n=1073741826,(-2&e)==8206)break X;if(e-8234>>>0<5)return B=0,2;if(n=128,e-8289>>>0<4||(n=2,e-8294>>>0<4))break X;if(n=8388608,e-8298>>>0>=6)break jA;break X}t=!(e-69821&-17),e=0;break u}B=536870976;break D}B=268435520;break D}B=-2147483584;break D}B=134217792;break D}B=67108928;break D}B=1073741888;break D}if(n=131072,r=64,e-917536>>>0<96)break X}break Z;case 2:jA:{SA:{qA:{_A:{$A:{Ae:{ee:{if((0|(t=-256&e))<=130303){if((0|t)<=127743){if((0|t)<=64767){if((0|t)<=11007){if((0|t)==8192)break ee;if((0|t)!=9216)break jA;if(e-9255>>>0>=25)break Ae;break O}if((0|t)==11008)break $A;if((0|t)!=11776||(n=-2147483648,e-11845>>>0>=59))break jA;break X}if((0|t)<=126975){if((0|t)==64768)break _A;if((0|t)!=65280||(n=4194304,e-65520>>>0>=9))break jA;break X}if((0|t)==126976|(0|t)==127232|(0|t)==127488)break W;break jA}if((0|t)<=129023){if((0|t)<=128255){if((0|t)==127744|(0|t)==128e3)break W;break jA}if((0|t)==128256|(0|t)==128512|(0|t)==128768)break W;break jA}if((0|t)<=129535){if((0|t)==129024|(0|t)==129280)break W;break jA}if((0|t)==129536|(0|t)==129792|(0|t)==130048)break W;break jA}if((0|t)<=919039){if((0|t)<=917759){if((0|t)<=130815){if((0|t)==130304)break W;if((0|t)!=130560)break jA;break W}if((0|t)==130816)break W;if((0|t)!=917504)break jA;if((-128&e)!=917632)break qA;break z}if((0|t)<=918271){if((0|t)==917760)break SA;if(n=4194304,(0|t)!=918016)break jA;break X}if((0|t)==918272|(0|t)==918528)break z;if(n=4194304,(0|t)!=918784)break jA;break X}if((0|t)<=920319){if((0|t)<=919551){if((0|t)==919040)break z;if(n=4194304,(0|t)!=919296)break jA;break X}if((0|t)==919552|(0|t)==919808)break z;if(n=4194304,(0|t)!=920064)break jA;break X}if((0|t)<=920831){if((0|t)==920320)break z;if(n=4194304,(0|t)!=920576)break jA;break X}if((0|t)==920832|(0|t)==921088)break z;if(n=4194304,(0|t)!=921344)break jA;break X}if(n=4194304,(0|e)!=8293)break jA;break X}if(n=-2147483648,e-9291>>>0>=21)break jA;break X}if((-16&e)==11248|e-11219>>>0<25|(0|e)==11209|e-11194>>>0<3||(0|(t=-2&e))==11124)break O;if(n=-2147483648,(0|t)!=11158)break jA;break X}if(n=65536,e-64976>>>0>=32)break jA;break X}if((0|e)==917504)break z;if(n=4194304,e-917506>>>0>=30)break jA;break X}if(n=4194304,e>>>0>917999)break X}t=(e=!(65534&~e))>>>16|0,e<<=16;break u;case 6:jA:{SA:{qA:{_A:{$A:{Ae:{ee:{ge:{re:{Ce:{ae:{Ie:{if((0|(t=-256&e))<=7679){if((0|t)<=767){if(!t)break Ie;if((0|t)==256)break ae;if((0|t)!=512)break Z;if((0|e)!=585)break Ce;break E}if((0|t)==768)break re;if((0|t)==1024)break ge;if((0|t)!=7424||(n=16777216,(0|e)!=7574))break Z;break X}if((0|t)<=119807){if((0|t)==7680)break ee;if((0|t)==8448)break Ae;if((0|t)!=65280||(n=256,e-65345>>>0>=6))break Z;break X}if((0|t)<=120319){if((0|t)==119808)break $A;if((0|t)!=120064)break Z;if(e>>>0>=120070)break _A;break y}if((0|t)==120320)break qA;if((0|t)!=120576)break Z;if(e>>>0>=120597)break SA;break y}if(n=768,e-97>>>0<6)break X;if(n=16777216,e-105>>>0>=2)break Z;break X}n=(t=(0|e)==329)>>>9|0,t=(e=(0|e)==303)?16777216:t<<23;break w}if((0|e)==616)break E;if(n=16777216,(0|e)!=669)break Z;break X}n=128;re:switch(e-976|0){case 35:break jA;case 0:case 1:case 2:case 5:case 32:case 33:break X;default:break re}if((-2&e)!=1012)break Z;break X}r=(e=!(e-1110&-3))>>>8|0,e<<=24;break G}r=(t=(0|e)==7883)>>>8|0,t=(e=(0|e)==7725)?16777216:t<<24;break l}if(e-8458>>>0<10)break y;if((t=e-8495|0)>>>0<11)break RA;break L}if((0|(t=-2&e))==119842)break F;if(e-119808>>>0<85)break y;if(e-119894>>>0<2|e-119946>>>0<2)break F;if((0|e)==119995|e-119896>>>0<69|e-119982>>>0<12)break y;if((0|t)==119998)break F;if(e-119997>>>0<7)break y;if(n=16777344,(0|t)==120050)break X;if(n=128,e>>>0<=120004)break Z;break X}if((-2&e)==120102)break F;if(e-120094>>>0<28)break y;_A:{if((0|e)<=120257){if(e-120154>>>0<2)break F;if(n=16777344,e-120206>>>0>=2)break _A;break X}if(e-120258>>>0<2)break F;if(n=16777344,e-120310>>>0<2)break X}if(n=128,e>>>0<=120145)break Z;break X}if(e-120362>>>0<2|e-120414>>>0<2)break F;if(n=16777344,e-120466>>>0<2)break X;if(e-120540>>>0<31|e>>>0>120571|e>>>0<120486)break y;if(n=128,e-120514>>>0>=25)break Z;break X}if(e-120772>>>0<8|e-120746>>>0<25|e-120714>>>0<31|e-120688>>>0<25||(0|e)!=120597&e>>>0<120629|e-120656>>>0<31)break y;if(n=128,e-120630>>>0<25)break X;break Z}break E;case 7:jA:{SA:{qA:{_A:{$A:{Ae:{ee:{ge:{re:{Ce:{ae:{Ie:{fe:{ie:{be:{se:{te:{ne:{ke:{oe:{Be:{ce:{if((0|(t=-256&e))<=11263){if((0|t)<=3583){if((0|t)<=1535){if((0|t)==512)break ce;if((0|t)==768)break Be;if((0|t)!=1280||(n=4096,(0|e)!=1369))break Z;break X}if((0|t)==1536)break oe;if((0|t)==1792)break ke;if((0|t)!=2304||(n=4096,(0|e)!=2417))break Z;break X}if((0|t)<=7167){if((0|t)==3584)break ne;if((0|t)==6144)break te;if((0|t)!=6656||(n=8192,(0|e)!=6823))break Z;break X}if((0|t)==7168)break se;if((0|t)==7424)break be;if((0|t)!=8192)break Z;if(n=16793600,!(t=e-8305|0))break X;if((0|t)==14)break ie;break fe}if((0|t)<=43263){if((0|t)<=40959){if((0|t)==11264)break Ie;if((0|t)==11776)break ae;if((0|t)!=12288)break Z;switch(n=8192,e-12293|0){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:break re;case 0:case 44:case 45:case 46:case 47:case 48:break X;default:break Ce}}if((0|t)==40960)break ge;if((0|t)==42496)break ee;if((0|t)!=42752)break Z;if(e-42775>>>0>=9)break Ae;break P}if((0|t)<=65279){if((0|t)==43264)break $A;if((0|t)==43520)break _A;if((0|t)!=43776||(n=20480,(-4&e)!=43868))break Z;break X}if((0|t)==65280)break qA;if((0|t)==92928)break SA;if((0|t)!=93952)break Z;if(n=4096,e-94099>>>0<13)break X;if(n=8192,(-2&e)!=94176)break Z;break X}if(n=16797696,(0|e)==690)break X;if(e-688>>>0<9)return B=0,20480;if(e-697>>>0<7)break P;if((0|(t=-2&e))==704)return B=0,20480;if(n=4096,e-710>>>0<10||(n=12288,(0|t)==720)||(n=20480,e-736>>>0<5))break X;n=(e=(-3&e)==748)>>>20|0,e<<=12;break Q}t=(0|e)==890?20480:0,t=(e=(0|e)==884)?4096:t;break x}if(n=8192,(0|e)==1600)break X;if(n=4096,e-1765>>>0>=2)break Z;break X}if(n=4096,(-2&e)==2036)break X;if(n=8192,(0|e)!=2042)break Z;break X}t=(e=!(e-3654&-129))>>>19|0,e<<=13;break u}if(n=8192,(0|e)!=6211)break Z;break X}if(n=12288,(0|e)==7291)break X;if(n=4096,e-7288>>>0>=6)break Z;break X}if(n=16797696,(0|e)==7522||(n=20480,e-7468>>>0<63))break X;n=16384;be:switch(e-7588|0){default:if((0|e)==7544)break X;case 1:case 2:case 3:if(e-7579>>>0>=37)break Z;break X;case 0:case 4:break be}return B=0,16793600}return B=0,16384}if(n=16384,e-8336>>>0>=13)break Z;break X}t=(n=(0|e)==11389)>>>18|0,n=(e=(0|e)==11388)?16793600:n<<14;break c}if(n=-2147479552,(0|e)!=11823)break Z;break X}if(e-12445>>>0<2)break X;if((0|e)==12540)break jA}if(e-12541>>>0>=2)break Z;break X}if(n=8192,(0|e)!=40981)break Z;break X}if((0|e)==42508)break B;if((0|e)==42623)break P;if(n=20480,(-2&e)!=42652)break Z;break X}if((0|e)==42864)return B=0,16384;if((0|e)==42888)break P;if(n=20480,(-2&e)!=43e3)break Z;break X}n=(t=(0|e)==43494)>>>19|0,t=(e=(0|e)==43471)?8192:t<<13;break w}if((0|e)==43632||(0|e)==43741)break B;if(n=8192,e-43763>>>0>=2)break Z;break X}if(n=12288,(0|e)==65392)break X;if(n=135168,(-2&e)!=65438)break Z;break X}if(n=8192,(-2&e)==92994)break X;break Z}return B=0,12288;case 8:n=128;jA:{SA:{qA:{_A:{$A:{Ae:{ee:{ge:{re:{if((0|(t=-256&e))<=12543){if((0|t)<=5887){if((0|t)<=3583){if(!t)break re;if((0|t)!=1536||(t=8388608,(0|e)!=1651))break q;break U}if((0|t)==3584)break ge;if((0|t)!=4352||(n=4194304,e-4447>>>0>=2))break q;break j}if((0|t)<=8447){if((0|t)==5888)break ee;if((0|t)!=6400||(t=e-6581|0)>>>0>=6)break q;n=s[(t=81432+(t<<3)|0)>>2],r=s[t+4>>2];break j}if((0|t)==8448)break Ae;if((0|t)!=12288||(t=2048,(0|e)!=12294))break q;break U}if((0|t)<=68863){if((0|t)<=63999){if((0|t)==12544)break $A;if((0|t)!=43520)break q;if((t=e-43701|0)>>>0<8)break SA;break S}if((0|t)==64e3)break jA;if((0|t)!=65280||(t=4194304,(0|e)!=65440))break q;break U}if((0|t)<=100095){if((0|t)==68864)break _A;if((0|t)!=70400||(n=8192,(0|e)!=70493))break q;break J}if((0|t)==100096)break qA;if((0|t)!=126464)break q;break j}r=(t=!(e-170&-17))>>>18|0,n=t<<14;break j}if(n=33554432,e-3648>>>0<5)break j;if(t=0,a=33554432,(0|e)==3759)break U;if(e-3776>>>0>=5)break q;break j}if(n=8388608,e-6051>>>0>=2)break q;break j}if(e-8501>>>0>=4)break q;break j}if(t=4194304,(0|e)!=12644)break q;break U}if(n=4096,(-2&e)!=68898)break q;break j}if(n=2048,e-100333>>>0<5)break j;break q}if(n=33554432,!(211>>>t&1))break S;break j}if((t=e-64014|0)>>>0>=28)break q;n=s[(t=81480+(t<<3)|0)>>2],r=s[t+4>>2];break j;case 10:jA:{SA:{qA:{_A:{$A:{Ae:{if((0|(t=-256&e))<=119807){if((0|t)<=8447){if(!t)break Ae;if((0|t)!=768)break Z;switch(n=128,e-976|0){case 0:case 1:case 2:case 36:case 37:break X;default:break Z}}if((0|t)==8448)break $A;if((0|t)!=65280||(n=256,e-65313>>>0>=6))break Z;break X}if((0|t)<=120319){if((0|t)==119808)break _A;if((0|t)!=120064)break Z;if(e>>>0>=120070)break qA;break y}if((0|t)==120320)break SA;if((0|t)!=120576)break Z;if(e-120772>>>0>=8)break jA;break y}if(n=768,e-65>>>0>=6)break Z;break X}n=128;$A:switch(e-8450|0){case 0:case 5:break X;default:break $A}if(e-8458>>>0<10)break y;if((t=e-8469|0)>>>0<20)break JA;if((-4&e)==8508)break X;break _}if(e-119982>>>0<12|e>>>0>120004|e-119977>>>0<4|e-119973>>>0<2||(0|e)==119970|(-2&e)==119966|e-119808>>>0<85)break y;if(n=128,e-119894>>>0>=71)break Z;break X}if(e-120138>>>0<7|e>>>0>120145|(0|e)==120134|e-120128>>>0<5||e-120123>>>0<4|e-120094>>>0<28|(0|e)!=120070&e>>>0<120075|e-120086>>>0<7)break y;if(n=128,e-120077>>>0>=8)break Z;break X}if(e-120540>>>0<31|e>>>0<120486)break y;if(n=128,e-120488>>>0>=25)break Z;break X}if(e-120714>>>0<31|e-120598>>>0<31)break y;if(n=128,e-120656>>>0<31)break X;break Z;case 11:jA:{SA:{qA:{_A:{$A:{Ae:{ee:{ge:{re:{Ce:{ae:{Ie:{fe:{ie:{be:{se:{te:{if((0|(t=-256&e))<=43263){if((0|t)<=3839){if((0|t)<=3071){if((0|t)==2304)break te;if((0|t)!=2816)break N;if((0|e)>3005)break be;if((0|e)!=2878)break se;return B=0,132096}if((0|t)==3072)break ie;if((0|t)!=3328)break N;switch(n=132096,e-3535|0){case 0:case 16:break X;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:break N;default:break fe}}if((0|t)<=6911){if((0|t)==3840)break Ie;if((0|t)!=4096)break N;if(n=1024,e-4139>>>0<2)break X;switch(e-4145|0){case 0:case 7:case 10:case 11:case 37:case 38:case 49:case 54:case 55:case 82:case 83:break X;case 86:case 87:case 88:case 89:case 90:case 91:case 94:case 105:case 106:break jA;default:break ae}}if((0|t)==6912)break Ce;if((0|t)==7168)break re;if((0|t)!=12288||(n=135168,(-2&e)!=12334))break N;break X}if((0|t)<=70399){if((0|t)<=43775){if((0|t)==43264)break ge;if((0|t)!=43520)break N;return B=0,e-43643&-3?1024:4096}if((0|t)==43776)break ee;if((0|t)==69888)break Ae;if((0|t)!=70144||(n=4096,(0|e)!=70197))break N;break X}if((0|t)<=70911){if((0|t)==70400)break $A;if((0|t)!=70656)break N;t=(0|e)==70845?132096:1024,t=(e=(0|e)==70832)?132096:t;break x}if((0|t)==70912)break _A;if((0|t)==71168)break qA;if((0|t)!=119040)break N;switch(n=131072,e-119141|0){case 8:break P;case 1:break Z;case 0:break X;default:break SA}}t=(0|e)==2519?132096:1024,t=(e=(0|e)==2494)?132096:t;break x}if(n=132096,(0|e)!=2903)break N;break X}if((0|e)==3006)return B=0,132096;if(n=132096,(0|e)!=3031)break N;break X}if((e=e-3266|0)>>>0>20||(n=132096,!(1<>>22|0,e<<=10;break Q}n=1024;Ce:switch(e-6965|0){default:if((0|e)==6916)break X;break;case 0:case 6:break X;case 1:case 2:case 3:case 4:case 5:break Ce}if(e-6973>>>0<5)break X;Ce:switch(e-6979|0){case 1:break P;case 0:break X;default:break Ce}if((0|e)==7042|(0|e)==7073|(-2&e)==7078)break X;if((0|e)==7082)break P;if((0|e)==7143|e-7146>>>0<3)break X;n=(e=(0|e)==7150)>>>22|0,e<<=10;break Q}t=(0|e)==7415?4096:1024,t=(e=(0|e)==7393)?4096:t;break x}t=(0|e)==43456?4096:1024,t=(e=(0|e)==43347)?4096:t;break x}if(n=4096,(0|e)!=44012)break N;break X}if(n=4096,(0|e)!=70080)break N;break X}n=132096;$A:switch(e-70462|0){case 0:case 25:break X;case 15:break $A;default:break N}break P}if(n=132096,(0|e)!=71087)break N;break X}if(n=4096,(0|e)!=71350)break N;break X}if(n=135168,e-119150>>>0<5)break X;break N}break P;case 12:t=((0|e)==8419)<<6,e=0;break u;case 13:jA:{SA:{qA:{_A:{$A:{Ae:{ee:{ge:{re:{Ce:{ae:{Ie:{fe:{ie:{be:{se:{te:{ne:{ke:{oe:{Be:{ce:{Qe:{Ge:{we:{Ee:{De:{ue:{le:{xe:{de:{me:{Me:{ve:{he:{pe:{Ye:{He:{Ne:{Pe:{Fe:{ye:{ze:{Oe:{Ze:{Ke:{We:{Xe:{Le:{Te:{Ve:{if((0|(t=-256&e))<=43775){if((0|t)<=5887){if((0|t)<=2559){if((0|t)<=1535){if((0|t)==768)break Ve;if((0|t)==1024)break Te;if((0|t)!=1280)break Z;if(e-1425>>>0>=17)break Le;break P}if((0|t)<=2047){if((0|t)==1536)break Xe;if((0|t)!=1792)break Z;if(n=1024,(0|e)==1809)break X;if((-16&e)!=1840)break We;return B=0,5120}if((0|t)==2048)break Ke;if((0|t)!=2304)break Z;if(e>>>0>=2307)break Ze;break N}if((0|t)<=3583){if((0|t)<=3071){if((0|t)==2560)break Oe;if((0|t)!=2816)break Z;switch(n=1024,e-2876|0){case 0:break P;case 3:break X;case 1:case 2:break ye;default:break ze}}if((0|t)==3072)break Fe;if((0|t)!=3328)break Z;if((0|(t=-2&e))!=3328)break Pe;break N}if((0|t)<=4095){if((0|t)==3584)break Ne;if((0|t)!=3840)break Z;if((0|(t=-2&e))!=3864)break He;break P}if((0|t)==4096)break Ye;if((0|t)!=4864||(n=1024,(0|e)!=4959))break Z;break X}if((0|t)<=8191){if((0|t)<=6655){if((0|t)==5888)break pe;if((0|t)==6144)break he;if((0|t)!=6400)break Z;if((t=e-6432|0)>>>0<=18&&(n=1024,1<>>0>=3)break Z;break X}if((0|t)<=7167){if((0|t)==6656)break ve;if((0|t)!=6912)break Z;if(n=1024,(-4&e)==6912)break X;if((0|e)!=6964)break Me;break P}if((0|t)==7168)break me;if((0|t)!=7424)break Z;if(n=4096,e-7620>>>0<12||(n=1024,e-7655>>>0<14))break X;if((e=e-7669|0)>>>0>=11)break Z;t=s[(e=82104+(e<<3)|0)>>2];break o}if((0|t)<=42495){if((0|t)<=11519){if((0|t)==8192)break de;if((0|t)!=11264||(n=4096,e-11503>>>0>=3))break Z;break X}if((0|t)==11520)break xe;if((0|t)!=12288)break Z;if(e-12330>>>0>=4)break le;break P}if((0|t)<=43263){if((0|t)==42496)break ue;if((0|t)!=43008)break Z;if(e-43045>>>0>=2)break De;break N}if((0|t)==43264)break Ee;if((0|t)!=43520)break Z;switch(n=1024,e-43561|0){case 83:case 150:case 152:break P;case 0:case 1:case 2:case 3:case 4:case 5:case 8:case 9:case 12:case 13:case 26:case 35:case 135:case 137:case 138:case 139:case 142:case 143:case 149:break X;default:break we}}if((0|t)<=71423){if((0|t)<=69375){if((0|t)<=66047){if((0|t)==43776)break Ge;if((0|t)==64256)break Qe;if((0|t)!=65024)break Z;if(n=536870912,e-65024>>>0<15||(r=64,(0|e)==65039))break X;if(n=4096,r=0,(-16&e)!=65056)break Z;break X}if((0|t)<=68095){if((0|t)==66048)break ce;if((0|t)!=66304||(n=1024,e-66422>>>0>=5))break Z;break X}if((0|t)==68096)break Be;if((0|t)!=68864||(n=5120,(-4&e)!=68900))break Z;break X}if((0|t)<=70399){if((0|t)<=69887){if((0|t)==69376)break oe;if((0|t)!=69632)break Z;if(e-69688>>>0>=14)break ke;break N}if((0|t)==69888)break ne;if((0|t)!=70144)break Z;if(n=1024,e-70191>>>0<3)break X;switch(e-70196|0){case 2:break P;case 0:case 3:case 10:break X;case 1:case 4:case 5:case 6:case 7:case 8:case 9:break se;default:break te}}if((0|t)<=70911){if((0|t)==70400)break be;if((0|t)!=70656)break Z;if((-8&e)!=70712)break ie;break N}if((0|t)==70912)break fe;if((0|t)!=71168)break Z;if(n=1024,e-71219>>>0<8)break X;switch(e-71229|0){case 2:break P;case 0:case 3:break X;case 1:break ae;default:break Ie}}if((0|t)<=92927){if((0|t)<=72703){if((0|t)==71424)break KA;if((0|t)==71680)break Ce;if((0|t)!=72192)break Z;if(e-72193>>>0>=10)break re;break N}if((0|t)<=73215){if((0|t)==72704)break ge;if((0|t)!=72960)break Z;if((t=e-73009|0)>>>0<19)break OA;break $}if((0|t)==73216)break ee;if((0|t)!=92672||(n=4096,e-92912>>>0>=5))break Z;break X}if((0|t)<=122879){if((0|t)<=113663){if((0|t)==92928)break Ae;if((0|t)!=93952||(n=4096,e-94095>>>0>=4))break Z;break X}if((0|t)==113664)break $A;if((0|t)!=119040)break Z;switch(n=4096,e-119143|0){case 0:case 1:case 2:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 67:case 68:case 69:case 70:break X;default:break Z}}if((0|t)<=125183){if((0|t)==122880)break _A;if((0|t)!=124928||(n=4096,e-125136>>>0>=7))break Z;break X}if((0|t)==125184)break qA;if((0|t)!=917760||(n=536870912,e-917760>>>0>=240))break Z;break X}if(e-768>>>0<69)break P;if(n=21504,(0|e)==837)break X;if(e-838>>>0<9)break P;if(n=4194304,(0|e)==847)break X;if((-8&e)==848)break P;if(n=4096,e-861>>>0>=6)break Z;break X}if(n=4096,e-1155>>>0>=5)break Z;break X}if(n=4096,e-1443>>>0<13||(n=5120,e-1456>>>0<14))break X;if((e=e-1471|0)>>>0>=9)break Z;t=s[(e=81944+(e<<3)|0)>>2];break o}if(e-1552>>>0<11)break N;if(n=5120,e-1611>>>0<8)break X;if(e-1619>>>0<4)break N;Xe:switch(e-1623|0){case 1:break P;case 0:break X;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 25:case 127:case 128:case 129:case 130:case 131:case 132:case 133:break N;default:break Xe}if(n=4096,e-1759>>>0<2)break X;if((t=e-1761|0)>>>0<8)break VA;break AA}if(e-1856>>>0<11)break P;if(n=5120,e-1958>>>0<11)break X;if(n=4096,e-2027>>>0>=9)break Z;break X}n=1024;Ke:switch((-2&e)-2070|0){case 2:break P;case 0:break X;default:break Ke}if(e-2260>>>0<12|e-2089>>>0<4|e-2075>>>0<9|e-2085>>>0<3)break N;if(e-2275>>>0<7)return B=0,5120;if(n=4096,e-2282>>>0<6||(n=5120,e-2288>>>0<15))break X;if(n=1024,(0|e)!=2303)break Z;break X}n=1024;Ze:switch(e-2362|0){case 2:break P;case 0:break X;default:break Ze}if(e-2369>>>0<8)break N;n=4096;Ze:switch(e-2381|0){case 0:case 4:case 5:case 6:case 7:case 111:break X;case 8:case 9:case 10:case 21:case 22:case 52:break N;default:break Ze}if(e-2497>>>0<4)break N;if((0|e)==2509)break X;if(n=1024,(-2&e)!=2530)break Z;break X}if(e-2561>>>0<2)break N;n=4096;Oe:switch(e-2620|0){case 0:case 17:case 128:case 145:break X;case 5:case 6:case 11:case 12:case 15:case 16:case 21:case 52:case 53:case 57:case 69:case 70:case 133:case 134:case 135:case 136:case 137:case 139:case 140:case 166:case 167:case 190:case 191:case 192:break N;default:break Oe}if(e-2813>>>0>=3)break Z;break X}if((0|e)==2817)break N}if(e-2881>>>0<4)break N;n=4096;ye:switch(e-2893|0){case 0:break X;case 9:break N;default:break ye}if((-2&e)==2914)break N;n=1024;ye:switch(e-3008|0){default:if((0|e)!=2946)break Z;break X;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:break Z;case 0:break X;case 13:break ye}break P}n=1024;Fe:switch(e-3072|0){case 77:case 188:case 205:break P;case 0:case 62:case 63:case 64:case 70:case 71:case 72:case 74:case 75:case 76:case 85:case 86:case 98:case 99:case 129:case 191:case 198:case 204:break X;default:break Fe}if((-2&e)!=3298)break Z;break X}if(n=4096,e-3387>>>0<2)break X;if(e-3393>>>0<4)break N;if((0|e)==3405)break X;if((0|t)==3426)break N;switch(e-3530|0){case 0:break X;case 8:case 9:case 10:case 12:break N;default:break Z}}if((t=e-3633|0)>>>0<10)break TA;break eA}if((n=e-3893|0)>>>0>4|!(1<>>22|0,n=(e=(0|e)==4237)?4096:n<<10;break c}n=1024;pe:{Ye:switch(e-5906|0){case 0:case 1:case 32:case 33:break X;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:break pe;default:break Ye}switch(e-5970|0){case 0:case 1:case 32:case 33:break X;default:break pe}}if(n=4194304,(-2&e)==6068)break X;if((t=e-6071|0)>>>0<16)break LA;break rA}if(n=536870912,e-6155>>>0<3||(n=67109888,e-6277>>>0<2))break X;if(n=1024,(0|e)!=6313)break Z;break X}if(e-6679>>>0<2)break N;n=1024;ve:switch(e-6683|0){case 0:case 59:case 61:case 62:case 63:case 64:case 65:case 66:case 67:case 71:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 88:case 89:break X;default:break ve}if(n=4096,e-6832>>>0<14)break X;if((e=e-6773|0)>>>0>=11)break Z;t=s[(e=82016+(e<<3)|0)>>2];break o}if(e-6966>>>0<5)break X;Me:switch(e-6972|0){case 0:case 6:break X;default:break Me}if(e-7019>>>0<9)break P;switch(e-7040|0){case 43:break P;case 0:case 1:case 34:case 35:case 36:case 37:case 40:case 41:case 44:case 45:case 104:case 105:case 109:case 111:case 112:case 113:break X;default:break Z}}if(n=1024,e-7212>>>0<8)break X;n=12288;me:switch(e-7222|0){case 1:break P;case 0:break X;default:break me}if(e-7380>>>0<13)break P;n=4096;me:switch(e-7376|0){case 0:case 1:case 2:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 29:case 36:break X;default:break me}if((-2&e)!=7416)break Z;break X}if(n=128,e-8400>>>0<13)break X;if((e=e-8417|0)>>>0>=15)break Z;t=s[(e=82192+(e<<3)|0)>>2];break o}if(n=1024,(-32&e)!=11744)break Z;break X}if(n=4096,e-12441>>>0>=2)break Z;break X}if((0|e)==42607)break P;if(e-42612>>>0<8)break N;if((0|(e&=-2))==42620)break P;if((0|e)==42654)break jA;if(n=4096,(0|e)!=42736)break Z;break X}n=4096;De:switch(e-43204|0){case 0:break X;case 1:break N;default:break De}if(e-43232>>>0>=18)break Z;break X}if(e-43302>>>0<5)break N;if(e-43307>>>0<3)break P;if(e-43335>>>0<11|e-43392>>>0<3)break N;if(n=4096,(0|e)==43443||(n=1024,e-43446>>>0<4))break X;r=(t=(0|e)==43493)>>>20|0,t=(e=(0|e)==43452)?1024:t<<12;break l}if((-2&e)==43756)break X;if(n=4096,(0|e)!=43766)break Z;break X}n=1024;Ge:switch(e-44005|0){case 0:case 3:break X;case 8:break Ge;default:break Z}break P}if(n=5120,(0|e)!=64286)break Z;break X}if(n=4096,(0|e)!=66272)break Z;break X}if((-4&e)==68108)break N;if((t=e-68097|0)>>>0<6)break XA;break CA}if(n=4096,e-69446>>>0>=11)break Z;break X}if(e-69811>>>0<4)break N;if(n=1024,(0|e)==69633)break X;if(n=4096,e-69817>>>0>=2)break Z;break X}n=1024;ne:switch(e-69888|0){case 51:case 52:case 115:break P;case 0:case 1:case 2:case 39:case 40:case 41:case 42:case 43:case 45:case 46:case 47:case 48:case 49:case 50:break X;default:break ne}if((-2&e)==70016|e-70070>>>0<9)break X;if(n=4096,e-70090>>>0>=3)break Z;break X}if((0|e)==70367)break X}if(e-70371>>>0<6)break X;if(n=4096,e-70377>>>0>=2)break Z;break X}if((-2&e)==70400)break N;n=4096;be:switch(e-70460|0){case 0:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 52:case 53:case 54:case 55:case 56:break X;case 4:break be;default:break Z}break N}if((0|e)==70722)break P;if(e-70723>>>0<2)break N;if((t=e-70835|0)>>>0<=13)break SA;break aA}if((t=e-71090|0)>>>0<12)break WA;break IA}switch(e-71339|0){case 0:case 2:break X;default:break ae}}if(e-71344>>>0<6)break X;if(n=4096,(0|e)!=71351)break Z;break X}if(n=1024,e-71727>>>0<10)break X;if(n=4096,e-71737>>>0>=2)break Z;break X}if((0|e)==72244)break P;if(e-72245>>>0<10)break N;if(n=4096,(0|e)==72263)break X;if(e-72273>>>0<11)break N;if(n=1024,e-72330>>>0<13)break X;n=(t=(0|e)==72345)>>>20|0,t=(e=(0|e)==72344)?8192:t<<12;break w}if((t=e-72752|0)>>>0<16)break ZA;break fA}if(n=1024,e-73459>>>0>=2)break Z;break X}if(n=1024,e-92976>>>0>=7)break Z;break X}if(n=1024,(0|e)!=113822)break Z;break X}if(n=1024,e-122888>>>0<17)break X;if((e=e-122880|0)>>>0>=43)break Z;t=s[(e=82816+(e<<3)|0)>>2];break o}if(n=12288,e-125252>>>0<3||(n=1024,(0|e)==125255)||(n=4096,e-125256>>>0<3))break X;break Z}if(!(1<>>0>=10))break jA;break X}if(n=256,e-65296>>>0>=10)break jA;break X}if(n=128,e-120782>>>0<50)break X}break Z;case 15:jA:{if((0|(t=-256&e))!=12288){if((0|t)!=8448)break jA;t=(e=(0|(n=-16&e))==8560)>>>18|0,r=e<<14,n=(e=(0|n)==8544)?32768:r;break c}if(e-12321>>>0<9||e-12344>>>0<3)return B=0,2048;if(n=2048,(0|e)==12295)break X}break Z;case 16:jA:{SA:{qA:{if((0|(t=-256&e))<=9215){if((0|t)==4864)break qA;if((0|t)!=6400||(n=134217728,(0|e)!=6618))break jA;break X}if((0|t)==9216)break SA;if((0|t)!=127232)break jA;if(n=0,r=-2147483648,(0|e)==127232)break X;if(r=268435456,e-127233>>>0>=10)break jA;break X}if(n=134217728,e-4969>>>0>=9)break jA;break X}if(n=0,r=-2147483648,e-9352>>>0<20)break X}break Z;case 17:r=(e=(0|e)==8256)>>>25|0,e<<=7;break G;case 18:jA:{SA:{qA:{_A:{if((0|(t=-256&e))<=11775){if((0|t)<=6143){if(n=-2147483624,!t)break X;if((0|t)!=1280||(n=24,(0|e)!=1418))break jA;break X}if((0|t)==6144)break _A;if((0|t)!=8192)break jA;if(n=-2147483624,(-2&e)==8208)break X;e=e-8211>>>0<2,t=-2147483640;break k}if((0|t)<=65023){if((0|t)==11776)break qA;if((0|t)!=12288)break jA;t=(0|e)==12336,n=(e=(0|e)==12316)||t?-2147483640:8,B=e?0:t?130:0;break n}if((0|t)==65024)break SA;if((0|t)!=65280||(n=24,(0|e)!=65293))break jA;break X}if(n=24,(0|e)!=6150)break jA;break X}if(n=-2147483624,(0|e)==11799)break X;e=(-2&e)==11834,t=-2147483640;break k}if(n=8,r=8388608,e-65073>>>0<2||(n=152,r=0,(0|e)==65123))break X}return B=0,8;case 19:jA:{SA:{qA:{_A:{$A:{Ae:{if((0|(t=-256&e))<=11775){if((0|t)<=8959){if(t)break Ae;break O}if((0|t)==8960)break $A;if((0|t)==9984)break _A;if((0|t)!=10496)break Z;break H}if((0|t)<=64767){if(n=-2147483648,(0|t)==11776)break X;if((0|t)!=12288)break Z;switch(n=-2147483616,e-12301|0){case 0:case 2:break X;default:break qA}}if((0|t)==64768)break SA;if((0|t)==65024)break jA;if((0|t)!=65280)break Z;if(n=32,(0|e)==65379)break X;break Z}if((0|t)!=8192)break Z;Ae:switch(e-8318|0){default:if(n=-2147483648,(0|e)!=8262)break Z;break X;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:break Z;case 0:case 16:break Ae}break y}n=-2147483520;$A:switch(e-8969|0){case 1:break Z;case 0:case 2:break X;default:break $A}if((0|e)!=9002)break Z;return B=0,-2139095040}if(n=-2147483520,(0|e)==10182)break X;break Y}return B=0,(-2&e)==12318?-2147483616:-2147483648}if(n=-2147483648,(0|e)!=64830)break Z;break X}r=(e=!(e-65090&-3))>>>27|0,e<<=5;break G;case 20:case 21:if(!(e&=-256))break t;if(n=-2147483616,(0|e)==8192)break X;break K;case 22:jA:{SA:{qA:{_A:{$A:{Ae:{ee:{ge:{re:{Ce:{ae:{Ie:{fe:{ie:{be:{se:{te:{ne:{ke:{oe:{Be:{ce:{Qe:{Ge:{we:{Ee:{De:{ue:{le:{xe:{de:{me:{Me:{ve:{he:{pe:{Ye:{He:{Ne:{Pe:{Fe:{ye:{ze:{Oe:{Ze:{Ke:{We:{Xe:{if((0|(t=-256&e))<=43519){if((0|t)<=5887){if((0|t)<=2303){if((0|t)<=1535){if(!t)break Xe;if((0|t)==768)break We;if((0|t)!=1280)break Z;if(n=0,r=538968064,e-1371>>>0<2)break X;switch(r=268435456,e-1373|0){case 0:break X;case 1:break Ze;default:break Ke}}if((0|t)==1536)break ze;if((0|t)==1792)break ye;if((0|t)!=2048)break Z;if((t=e-2103|0)>>>0<8)break yA;break iA}if((0|t)<=3839){if((0|t)==2304)break Fe;if((0|t)==3328)break Pe;if((0|t)!=3584||(n=64,(-2&e)!=3674))break Z;break X}if((0|t)<=4863){if((0|t)==3840)break Ne;if((0|t)!=4096)break Z;if(n=268435520,(-2&e)==4170)break X;if(n=0,r=16777216,(0|e)!=4347)break Z;break X}if((0|t)==4864)break He;if((0|t)!=5632)break Z;switch(n=64,e-5741|0){case 1:break C;case 0:break X;default:break Ye}}if((0|t)<=11263){if((0|t)<=6655){if((0|t)==5888)break pe;if((0|t)==6144)break PA;if((0|t)!=6400)break Z;t=(0|e)==6469,n=(e=(0|e)==6468)||t?268435520:0,B=e?536870912:t?1073741824:0;break n}if((0|t)<=7167){if((0|t)==6656)break he;if((0|t)!=6912)break Z;if((0|(t=-2&e))!=7002)break ve;break p}if((0|t)==7168)break Me;if((0|t)!=8192)break Z;switch(n=-2147483520,e-8214|0){case 1:break O;case 0:break X;case 16:break me;default:break de}}if((0|t)<=41983){if((0|t)==11264)break xe;if((0|t)==11776)break le;if((0|t)!=12288)break Z;switch(n=-2147483584,r=272629760,e-12289|0){case 2:break O;case 0:break X;case 1:break De;default:break ue}}if((0|t)<=43007){if((0|t)==41984)break Ee;if((0|t)!=42496)break Z;switch(n=64,r=268435456,e-42739|0){case 4:break a;case 0:break C;case 3:break g;case 2:break X;case 1:break Ge;default:break we}}if((0|t)==43008)break Qe;if((0|t)!=43264)break Z;switch(n=4096,e-43310|0){case 0:break X;case 1:break p;default:break ce}}if((0|t)<=70655){if((0|t)<=67839){if((0|t)<=65279){if((0|t)==43520)break Be;if((0|t)==43776)break oe;if((0|t)!=65024)break Z;if(n=0,r=268435456,(0|(a=-2&e))==65040)break X;if((t=e-65042|0)>>>0<8)break HA;break bA}if((0|t)==65280)break ke;if((0|t)==66304)break ne;if((0|t)!=67584||(n=64,(0|e)!=67671))break Z;break X}if((0|t)<=69375){if((0|t)==67840)break te;if((0|t)==68096)break se;if((0|t)!=68352)break Z;switch(n=64,e-68410|0){case 0:case 1:case 2:case 3:case 4:case 5:case 95:case 96:case 97:case 98:break X;default:break Z}}if((0|t)<=69887){if((0|t)==69376)break be;if((0|t)!=69632)break Z;if(e-69703>>>0>=2)break ie;break p}if((0|t)==69888)break fe;if((0|t)!=70144)break Z;if((t=e-70200|0)>>>0<=4)break Ie;if((0|e)!=70313)break Z;break p}if((0|t)<=74751){if((0|t)<=71423){if((0|t)==70656)break ae;if((0|t)==70912)break Ce;if((0|t)!=71168||(n=268435520,e-71233>>>0>=2))break Z;break X}if((0|t)<=72703){if((0|t)==71424)break re;if((0|t)!=72192)break Z;if(e-72258>>>0>=2)break ge;break p}if((0|t)==72704)break ee;if((0|t)!=73216||(n=268435520,e-73463>>>0>=2))break Z;break X}if((0|t)<=93695){if((0|t)==74752)break Ae;if((0|t)==92672)break _A;if((0|t)!=92928)break Z;if(n=268435520,e-92983>>>0<2)break X;t=(0|e)==92996?268435520:0,t=(e=(0|e)==92985)?64:t;break x}if((0|t)<=121343){if((0|t)==93696)break $A;if((0|t)!=113664||(n=268435520,r=-2147483648,(0|e)!=113823))break Z;break X}if((0|t)==121344)break YA;if((0|t)!=125184)break Z;n=((0|e)==125279)<<30,t=0,B=(e=(0|e)==125278)?536870912:n;break b}n=-1879048128,r=536870912;Xe:{Le:{Te:{Ve:{Je:switch(e-33|0){default:switch(e-183|0){case 1:case 2:case 3:case 4:case 5:case 6:case 7:break Xe;case 8:break Te;case 0:break Ve;default:break Le}case 2:case 9:B=66;break f;case 11:return B=268435456,-2147483584;case 13:return B=-2147483648,-1879048128;case 25:return B=134217728,-2147483584;case 26:return B=67108864,-2147483584;case 1:case 6:break t;case 0:break X;case 3:case 4:case 5:case 7:case 8:case 10:case 12:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 27:case 28:case 29:break Xe;case 30:break Je}return B=1073741824,-1879048128}return B=0,134230016}B=1078984704;break f}if((0|e)==161)break sA}break O}t=(0|e)==903,n=(e=(0|e)==894)?64:t?134217792:0,B=e?1073741824:t?67108864:0;break n}if((0|e)==1417)break Oe;if((0|e)!=1475)break Z;break h}B=1075838976;break I}B=-2143289344;break r}n=64,r=268435456;ze:switch(e-1548|0){case 15:break g;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 16:case 17:break Z;case 0:break X;case 19:break ze;case 18:break p;default:break qA}break a}if((t=e-1792|0)>>>0<6)break zA;if(n=64,r=134217728,(-2&e)==1798)break X;r=67108864;ye:{ze:{Oe:switch(e-1800|0){default:switch(e-2040|0){case 1:break ye;case 0:break ze;default:break Z}case 3:break Z;case 0:break X;case 1:break Oe;case 2:case 4:break h}B=1073741824;break e}B=268435456;break e}B=536870912;break r}t=(0|e)==2405,n=(e=(0|e)==2404)||t?268435520:0,B=e?-2143289344:t?16777216:0;break n}if(n=0,r=-2143289344,(0|e)!=3572)break Z;break X}n=64;Ne:switch(e-3848|0){case 5:B=-2143289344;break e;case 6:B=16777216;break e;case 0:break X;default:break Ne}if(e-3854>>>0<5)break X;if(n=0,r=268435456,(0|e)!=3860)break Z;break X}if((t=e-4961|0)>>>0<4)break FA;if(n=64,r=134217728,e-4965>>>0<2)break X;t=(0|e)==4968,n=(e=(0|e)==4967)||t?268435520:0,B=e?1073741824:t?16777216:0;break n}if(e-5867>>>0>=3)break Z;break X}if(n=268435520,e-5941>>>0<2)break X;if((e=e-6100|0)>>>0>=7)break Z;t=s[(e=83240+(e<<3)|0)>>2];break o}if(n=268435520,(-4&e)!=6824)break Z;break X}if(n=64,(0|e)==7005)break X;if(n=268435520,(0|t)!=7006)break Z;break X}if(e-7227>>>0<2)break p;if(n=64,e-7229>>>0<3||(n=268435520,(-2&e)==7294))break X;if(n=4096,(0|e)!=7379)break Z;break X}B=33554432;break f}if((-8&e)==8224)break O;if(e-8242>>>0<3)break X;if(e-8240>>>0<9)break O;if((t=e-8251|0)>>>0<21)break NA;break tA}if((0|e)==11513){B=-2147483648;break I}if(n=0,r=1073741824,(-2&e)==11514)break X;if(r=-2147483648,(0|e)!=11518)break Z;break X}n=-1879048128;le:switch(e-11822|0){case 4:case 6:B=268435456;break f;case 5:B=-2147483648;break f;case 7:B=67108864;break f;case 14:return B=-2147483648,-1879048128;case 19:return B=268435456,-2147483584;case 30:case 32:return B=0,-2147483584;case 0:break X;default:break le}break O}if((0|e)==12349)break v;if((0|e)!=12539)break Z;return B=0,16}return B=-2143289344,-1879048128}t=(0|e)==42239,n=(e=(0|e)==42238)?64:t?268435520:0,B=e?268435456:t?-2147483648:0;break n}we:switch(e-42509|0){case 1:break C;case 0:break X;case 2:break we;default:break Z}break a}B=134217728;break e}if(e-43126>>>0<2)break p;if(n=268435520,e-43214>>>0>=2)break Z;break X}if((0|e)==43463)break h;if(n=268435520,(-2&e)!=43464)break Z;break X}if(e-43613>>>0<3)break p;if(n=64,(0|e)==43743)break X;if(n=268435520,(-2&e)!=43760)break Z;break X}if(n=268435520,(0|e)!=44011)break Z;break X}n=268435520,r=541065216;ke:switch(e-65281|0){case 1:case 6:return B=0,32;case 11:B=272629760;break e;case 13:B=-2143289344;break r;case 100:return B=0,16;case 25:B=138412032;break e;case 26:B=71303168;break e;case 30:B=1077936128;break r;case 96:break C;case 59:break y;case 0:break X;case 99:break ke;default:break Z}B=268435456;break e}n=(t=(0|e)==66512)>>>26|0,t=(e=(0|e)==66463)?64:t<<6;break w}if(n=64,(0|e)!=67871)break Z;break X}if(n=268435520,(-2&e)==68182)break X;if(n=64,e-68336>>>0>=6)break Z;break X}if(n=268435520,e-69461>>>0>=5)break Z;break X}if(n=64,e-69705>>>0<5)break X;if(n=268435520,e-69822>>>0>=4)break Z;break X}if(e-69953>>>0<2)break p;if((t=e-70085|0)>>>0<=26)break SA;break nA}if((0|t)!=2)break p;break h}if(n=268435520,e-70731>>>0<2)break X;r=(t=(0|e)==70747)>>>26|0,t=(e=(0|e)==70733)?64:t<<6,B=e?268435456:r;break b}n=268435520;Ce:switch((-2&e)-71106|0){case 0:break X;case 2:break jA;default:break Ce}if(n=8192,e-71110>>>0<3)break X;if(n=268435520,e-71113>>>0>=15)break Z;break X}if(n=268435520,e-71484>>>0>=3)break Z;break X}if(n=268435520,e-72347>>>0<2)break X;if(n=64,e-72353>>>0>=2)break Z;break X}if(n=268435520,e-72769>>>0<2)break X;n=(t=(0|e)==72817)>>>26|0,t=(e=(0|e)==72771)?64:t<<6;break w}if(n=64,r=134217728,e-74865>>>0<2)break X;if(r=0,e-74864>>>0>=5)break Z;break X}t=(0|e)==93848?268435520:0,t=(e=(0|e)==93847)?64:t;break x}if(n=268435520,(-2&e)==92782)break X;if(r=-2147483648,(0|e)!=92917)break Z;break X}if((0|e)==1748)break C;break Z}if(!(1<>>0<=17&&(n=-2147483616,1<>>27|0,e<<=5;break Q;case 24:n=(e=e>>>0<256)>>>1|0,e<<=31;break Q;case 25:jA:{SA:{qA:{_A:{$A:{Ae:{ee:{ge:{if((0|(t=-256&e))<=12287){if((0|t)<=767){if(!t)break ge;if((0|t)!=512)break jA;if(e-751>>>0>=17)break ee;break P}if((0|t)==768)break Ae;if((0|t)!=7936)break jA;switch(n=4096,e-8125|0){case 0:case 2:case 3:case 4:case 16:case 17:case 18:case 32:case 33:case 34:case 48:case 49:case 50:case 64:case 65:break X;default:break jA}}if((0|t)<=43775){if((0|t)==12288)break $A;if((0|t)!=42752||(n=4096,(-2&e)!=42784))break jA;break X}if((0|t)==43776)break _A;if((0|t)==65280)break qA;if(n=0,r=78,(0|t)!=127744)break jA;break X}ge:switch(e-168|0){default:n=-2147479424;re:switch(e-94|0){case 0:break X;case 2:break re;default:break jA}return B=0,-2147479552;case 0:case 7:break P;case 1:case 2:case 3:case 4:case 5:case 6:case 8:case 9:case 10:case 11:case 13:case 14:case 15:break jA;case 12:case 16:break ge}break P}if((0|e)==749|e-741>>>0<7)break P;if(e-706>>>0>=4)break SA;break P}if((e=e-885|0)>>>0>16||(n=4096,!(1<>>0>=2)break jA;break X}if(n=4096,(0|e)!=43867)break jA;break X}n=4224;qA:switch(e-65342|0){default:if((0|e)!=65507)break jA;break;case 0:break X;case 1:break jA;case 2:break qA}break P}if(n=4096,e-722>>>0<14)break X}break Z;case 26:jA:{SA:{qA:{_A:{$A:{Ae:{if((0|(t=-256&e))<=9471){if((0|t)<=8447){if(t)break jA;break O}if((0|t)==8448)break Ae;if((0|t)==8704)break $A;if(n=-2147483648,(0|t)!=8960)break Z;break X}if((0|t)<=10495){if((0|t)==9472)break _A;if((0|t)==9728)break qA;if((0|t)==9984)break O;break Z}if((0|t)==10496)break SA;if((0|t)==10752)break O;if(n=-2147483648,(0|t)!=11008)break Z;break X}if((0|e)==8472)return B=0,67108864;if((0|e)==8596)break M;if(n=-2147483648,e>>>0<=8591)break Z;break X}if(n=-2147483640,(0|e)==8722)break X;t=-2147483648,B=(e=e-8942>>>0<4)?33554432:0;break b}if(n=-2147483648,r=130,e-9723>>>0<2)break X;t=-2147483648,B=(e=e-9725>>>0<2)?134:0;break b}if(n=-2147483648,r=128,(0|e)==9839)break X;break O}if(n=-2147483648,r=130,(-2&e)==10548)break X;t=-2147483648,B=(e=(0|e)==10626)?134217728:0;break b}if((0|t)==8192)break kA;break Z;case 27:jA:{SA:{qA:{_A:{$A:{Ae:{ee:{ge:{re:{Ce:{ae:{Ie:{fe:{ie:{be:{se:{te:{ne:{ke:{oe:{Be:{ce:{Qe:{Ge:{if((0|(t=-256&e))<=12287){if((0|t)<=9727){if((0|t)<=8959){if(!t)break Ge;if((0|t)!=8448)break Z;switch(n=0,r=130,e-8482|0){case 7:break y;case 0:break X;case 1:case 2:case 3:case 4:case 5:case 6:case 8:case 9:case 10:case 11:break oe;case 12:break ce;default:break Qe}}if((0|t)==8960)break ke;if((0|t)==9216)break ne;if((0|t)!=9472)break Z;switch(n=-2147483520,(-2&e)-9632|0){case 0:break X;case 10:break M;default:break te}}if((0|t)<=11007){if((0|t)==9728)break se;if((0|t)==9984)break be;if(n=-2147483648,(0|t)!=10240)break Z;break X}if((0|t)==11008)break ie;if((0|t)==11776)break fe;if((0|t)!=12032)break Z;if(n=1048576,e>>>0<12246)break X;switch(n=262144,(-2&e)-12272|0){case 0:break X;case 2:break jA;default:break Ie}}if((0|t)<=127999){if((0|t)<=127231){if((0|t)==12288)break ae;if((0|t)==12800)break Ce;if((0|t)!=126976)break Z;t=(0|e)==127183,n=0,B=(e=(0|e)==126980)||t?134:128;break n}if((0|t)==127232)break re;if((0|t)==127488)break ge;if((0|t)!=127744)break Z;if(e>>>0>=127777)break ee;break m}if((0|t)<=128767){if((0|t)==128e3)break Ae;if((0|t)==128256)break $A;if((0|t)!=128512)break Z;if((t=e-128581|0)>>>0<11)break DA;break oA}if((0|t)==128768)break _A;if((0|t)==129280)break qA;if((0|t)!=129536)break Z;B=128;break I}t=(0|e)==174,n=-2147483648,B=(e=(0|e)==169)||t?130:0;break n}switch(e-8616|0){case 0:break O;case 1:case 2:break Be;default:break oe}}return B=0,67108864}return B=130,-2147483520}if(n=-2147483520,e-8597>>>0<5)break X;if(e-8604>>>0<18)break H;if((t=e-8624|0)>>>0<8)break pA;break BA}if(e>>>0<8968)break O;if((0|(t=-2&e))==8986)break i;if(e-8972>>>0<20|e-8994>>>0<6)break O;if((0|e)==9e3)break M;if(e-9003>>>0<81)break O;if(n=-2147483648,r=128,(0|e)==9096)break X;if(e-9085>>>0<30)break O;if(n=-2147483520,r=0,(0|t)==9140)break X;ke:switch(e-9143|0){case 0:case 25:break X;case 24:break M;default:break ke}if(e-9140>>>0<40)break O;if((0|e)==9186)break X;if((t=e-9193|0)>>>0<4)break i;n=-2147483648,r=134;ke:switch(e-9200|0){case 0:case 3:break X;default:break ke}if(t>>>0<11)break M;if(r=130,e-9208>>>0<3)break X;if(r=0,e>>>0<=9186)break Z;break X}if(n=-2147483648,e-9216>>>0<75||(n=33792,r=130,(0|e)==9410)||(r=0,e-9398>>>0<26))break X;if(n=17408,e-9424>>>0>=26)break Z;break X}if(e-9646>>>0<8)break H;if(r=130,(0|e)==9654)break X;if((-4&e)==9660)break H;te:switch(e-9664|0){case 0:break X;case 6:case 7:case 10:case 11:case 15:case 16:case 17:case 18:case 19:case 34:case 36:break H;default:break te}return B=0,e-9703>>>0<6?-2147483520:-2147483648}se:switch((-16&e)-9728>>>4|0){case 0:if(e>>>0<9733)break M;n=-2147483520,r=128;te:switch(e-9733|0){case 0:break X;case 9:break te;case 1:break H;default:break cA}break M;case 2:if((t=e-9760|0)>>>0<11)break vA;if(n=-2147483648,r=130,e>>>0<=9773)break cA;break X;case 3:if(n=-2147483648,r=130,e-9784>>>0>=3)break cA;break X;case 4:n=-2147483520,r=130;te:switch(e-9792|0){case 0:case 2:break X;default:break te}if(n=-2147483648,r=134,e>>>0<=9799)break cA;break X;case 5:if(n=-2147483648,r=134,e>>>0<9812)break X;if(r=130,(0|e)!=9823)break cA;break X;case 6:if((0|e)==9734)break H;if((0|e)==9824)return B=130,-2147483520;if(n=-2147483520,r=128,e-9825>>>0<2)break X;if((t=e-9827|0)>>>0<6)break MA;break QA;case 8:if(n=-2147483648,e>>>0<=9861)break cA;break X;case 10:n=-2147483648,r=130;te:switch(e-9888|0){case 1:break i;case 0:break X;default:break te}if(r=134,(-2&e)!=9898)break cA;break X;case 11:if(n=-2147483648,r=130,(-2&e)==9904)break X;if(r=134,e-9917>>>0>=2)break cA;break X;case 12:if((-2&e)==9924)break i;n=-2147483648,r=130;te:switch(e-9928|0){case 0:case 7:break X;case 6:break te;default:break cA}break i;case 14:t=(0|e)==9962,n=-2147483648,B=(e=(0|e)==9961)?130:t?134:128;break n;case 13:break xA;case 9:break dA;case 15:break se;case 7:break mA;case 1:break hA;default:break cA}if((0|e)==9972|e>>>0<9970)break M;if(n=-2147483648,r=134,e>>>0<9974||(0|e)!=9974&&(r=130,e>>>0<9977))break X;if((e=e-9977|0)>>>0<5)break lA;break cA}be:{se:{te:{ne:{ke:switch((-16&e)-9984>>>4|0){case 0:if(n=0,r=130,(0|e)==9986||(r=128,e>>>0<9989)||(r=134,(0|e)==9989))break be;r=150;oe:switch((-2&e)-9994|0){case 0:break be;case 2:break te;default:break oe}if(r=130,e-9992>>>0<6)break be;t=(0|e)==9999,n=0,r=(e=(0|e)==9998)?128:t?130:0;break be;case 1:if(n=0,r=128,e>>>0<10002)break be;if((e=e-10002|0)>>>0>11||(r=130,!(1<>>0<2)break be;r=(e=e-10069&-3)?0:536871046;break be;case 6:if((t=e-10082|0)>>>0<3)break se;if(n=0,r=128,e>>>0<=10084)break ne;break be;case 9:if(n=0,r=134,e-10133>>>0>=3)break ne;break be;case 10:if(n=0,r=130,(0|e)!=10145)break ne;break be;case 11:t=(0|e)==10175,n=0,r=(e=(0|e)==10160)||t?134:0;break be;case 3:break ke;default:break ne}if(n=0,r=130,e-10035>>>0<2)break be}n=0,r=0;break be}r=146;break be}n=s[(e=83992+(t<<3)|0)>>2],r=s[e+4>>2]}return B=r,-2147483648|n}if(n=-2147483648,r=130,e-11013>>>0<3||(r=134,e-11035>>>0<2))break X;t=(0|e)==11093,n=-2147483648,B=(e=(0|e)==11088)||t?134:0;break n}if(e-11904>>>0>=26)break SA;return B=0,1048576}if(e-12276>>>0>=8)break Z;break X}if((e=e-12306|0)>>>0>14||(n=-2147483648,!(1<>>0<26||e-127312>>>0<26)return B=0,33792;if((t=e-127344|0)>>>0<=15&&(n=33792,r=130,1<>>0<26))break X;if((0|e)==127374)break m;if(n=0,r=134,e-127377>>>0<10)break X;if(r=102,e>>>0<=127461)break Z;break X}n=0,r=134;ge:{re:switch(e-127489|0){case 0:case 25:break X;case 1:break v;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:break ge;default:break re}switch(e-127535|0){case 0:break X;case 8:break v;default:break ge}}if((-2&e)==127568|e-127538>>>0<9)break X;if(r=128,e>>>0<=127583)break Z;break X}if((0|e)==127777)break v;if(e-127789>>>0<9|e-127799>>>0<70)break m;if((0|e)==127877)break d;if(e-127870>>>0<22)break m;if(e-127780>>>0<112)break v;n=0,r=130;ee:switch(e-127894|0){case 44:case 45:case 46:case 49:break d;case 0:case 1:case 3:case 4:case 5:break X;default:break ee}if(e-127904>>>0<42)break m;if(r=150,(0|e)==127946||(r=146,e-127947>>>0<2))break X;if(e-127951>>>0<5)break m;if(r=134,e-127968>>>0<17||(r=130,e-127902>>>0<83))break X;if((t=e-127987|0)>>>0<5)break uA;break GA}n=0,r=130;Ae:switch(e-128063|0){case 0:case 2:break X;default:break Ae}if((0|e)==128124|(-5&e)-128129>>>0<3|(0|e)==128110|e-128112>>>0<9||(-2&e)==128066|e-128102>>>0<4|e-128070>>>0<11)break d;Ae:switch(e-128253|0){case 1:B=128;break I;case 0:break v;default:break Ae}if(r=150,(0|e)==128170)break X;break m}if(e>>>0<128318)break m;if(n=0,e>>>0<128326)break X;if(e-128329>>>0<2)break v;if(e-128331>>>0<4|e-128336>>>0<24)break m;if(e-128367>>>0<2)break v;if((-2&e)==128372){B=146;break I}if(e-128371>>>0<7)break v;if(r=150,!(t=e-128378|0))break X;if((0|t)==13|e-128394>>>0<4)break v;if(r=146,(0|e)==128400||(r=150,e-128405>>>0<2))break X;r=134;$A:switch(e-128420|0){case 0:break X;case 1:case 4:case 13:case 14:case 24:case 30:case 31:case 32:case 45:case 46:case 47:case 56:case 57:case 58:case 61:case 63:case 68:case 75:case 79:case 86:break v;default:break $A}e=e>>>0>128506,t=0;break s}if(n=0,r=128,e-128981>>>0>=4)break Z;break X}if(e>>>0<129292)break Z;if(e-129328>>>0<10)break d;n=0,r=150;qA:switch(e-129304|0){case 35:break Z;case 0:case 1:case 2:case 3:case 4:case 6:case 7:case 14:break X;default:break qA}if(e-129341>>>0<2)break d;if(r=0,(0|e)==129350||(r=198,(-4&e)==129456))break X;if((t=e-129461|0)>>>0<5)break EA;break wA}if(n=1048576,e-11931>>>0<89)break X;break Z}return B=0,524288;case 29:return B=16777216,1073741825;case 28:break X;case 30:break UA;default:break Z}return B=0,(0|e)==32?1073741825:1}if(!(1079>>>t&1))break L;t=s[(e=81344+(t<<3)|0)>>2];break o}if(557553>>>t&1)break y;if((-4&e)!=8508)break _;break X}if(!(207>>>t&1))break AA;break N}if(n=1024,!(1017>>>t&1))break eA;break X}if(n=1024,!(32895>>>t&1))break rA;break X}if(n=1024,!(55>>>t&1))break CA;break X}if(n=1024,!(3087>>>t&1))break IA;break X}if((e=e-71453|0)>>>0>=15)break Z;t=s[(e=82312+(e<<3)|0)>>2];break o}if(!(49023>>>t&1))break fA;t=s[(e=82432+(t<<3)|0)>>2];break o}if(!(514623>>>t&1))break $;t=s[(e=82664+(t<<3)|0)>>2];break o}t=s[(e=83160+(t<<3)|0)>>2];break o}if(n=268435520,!(197>>>t&1))break iA;break X}t=s[(e=83208+(t<<3)|0)>>2];break o}if((e=e-6145|0)>>>0>=10)break Z;t=s[(e=83296+(e<<3)|0)>>2];break o}if(!(1077711>>>t&1))break tA;t=s[(e=83376+(t<<3)|0)>>2];break o}if(!(159>>>t&1))break bA;t=s[(e=83544+(t<<3)|0)>>2];break o}if((e=e-121479|0)>>>0>=4)break Z;t=s[(e=83608+(e<<3)|0)>>2];break o}if(!(195>>>t&1))break BA;break H}if((e=e-9745|0)>>>0>=13)break cA;t=s[(e=83640+(e<<3)|0)>>2];break o}if(1101>>>t&1)break M;if(n=-2147483648,r=130,e>>>0<=9773)break cA;break X}if(!(45>>>t&1))break QA;t=s[(e=83744+(t<<3)|0)>>2];break o}if((e=e-9851|0)>>>0>=5)break cA;t=s[(e=83792+(e<<3)|0)>>2];break o}if((e=e-9874|0)>>>0>=11)break cA;t=s[(e=83832+(e<<3)|0)>>2];break o}if((e=e-9937|0)>>>0>=4)break cA;t=s[(e=83920+(e<<3)|0)>>2];break o}t=s[(e=83952+(e<<3)|0)>>2];break o}if(!(23>>>t&1))break GA;t=s[(e=84016+(t<<3)|0)>>2];break o}if(n=0,r=150,!(1991>>>t&1))break oA;break X}if(r=150,27>>>t&1)break X}t=0,B=(e=e-129489>>>0<13)?150:134;break b}e=e-127992>>>0<3,t=0;break s}if(e-9837>>>0<2)break X}B=128;break f}if(e-8623>>>0<13)break O;if(e-8636>>>0<18)break H;if((t=e-8656|0)>>>0<22&&(r=0,3157995>>>t&1)||(n=-2147483648,r=0,e-8661>>>0<31))break X;break Z}if(e>>>0<128592)break m;if(n=0,r=0,e>>>0<128640)break X;if(!((t=e-128675|0)>>>0>29|!(1<>>0<128710)break m;if(r=150,(0|e)==128716)break X;if(e-128715>>>0<5)break v;if(e-128720>>>0<3)break m;if(!((t=e-128736|0)>>>0>=10|!(575>>>t&1)))break v;if(r=134,e-128747>>>0<2)break X;r=130;oA:switch(e-128752|0){case 0:case 3:break X;default:break oA}e=e-128756>>>0<6,t=0;break s}n=-2147483648;kA:switch(e-8260|0){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:break Z;case 0:case 14:break X;default:break kA}if((0|(e=e-8315|0))!=16&&e)break Z;return B=0,8}if(n=268435520,r=1073741824,(0|e)!=69955)break Z;break X}if(e-8266>>>0<8)break O;if(n=-2147483640,(0|e)==8275)break X;if(n=-2147483648,e-8277>>>0>=10)break Z;break X}B=542113792;break f}if(n=-2147483648,r=0,e-65093>>>0<2||(n=64,r=268435456,(0|a)==65104))break X;n=268435520,r=-2147483648;bA:switch(e-65106|0){case 3:B=134217728;break e;case 5:B=536870912;break r;case 4:break a;case 2:break g;case 0:break X;case 15:case 22:break bA;default:break Z}break y}if((0|e)==2142)break h;if(n=64,e-2096>>>0<15)break X;break Z}if(n=1024,e-72850>>>0<22)break X;if((e=e-72874|0)>>>0>=13)break Z;t=s[(e=82560+(e<<3)|0)>>2];break o}if(n=4096,e-71103>>>0<2)break X;if(n=1024,(-2&e)!=71132)break Z;break X}if((0|e)==70726)break P;if(n=4096,(-2&e)!=70850)break Z;break X}if(n=4096,e-68325>>>0>=2)break Z;break X}if((0|e)==6109)break P;if(n=4096,e-6089>>>0>=11)break Z;break X}gA:switch(e-3959|0){case 0:case 2:return B=0,8389632;default:break gA}if((0|t)==3968|e-3953>>>0<14)break N;if(!((t=e-3970|0)>>>0>=6|!(55>>>t&1)))break P;if(e-3981>>>0<11)break N;if(n=1024,e-3993>>>0<36)break X;if(n=4096,(0|e)!=4038)break Z;break X}if(e-3655>>>0<6)break P;if(!((t=e-3761|0)>>>0>11|!(1<>>0<5)break X;if(n=1024,(0|e)!=3789)break Z;break X}if(e-1770>>>0<3)break X;if(n=1024,(0|e)!=1773)break Z;break X}if((-2&e)==73028)break P;n=1024;$:switch(e-73104|0){default:if((0|e)!=73031)break Z;break X;case 2:case 3:case 4:case 6:break Z;case 0:case 1:case 5:break X;case 7:break $}break P}if((e=e-8492|0)>>>0>=30)break Z;t=s[(e=81704+(e<<3)|0)>>2];break o}n=0;break j}r=(t=(-3&e)==43712)>>>20|0,n=t<<12}if((0|(i=-65536&e))==131072)break R;if((0|i)==65536)break J;if(t=n,a=r,i)break V}if(e-13312>>>0<6582||e-19968>>>0<20976)break A;if(i=2048,e-63744>>>0<366)return B=a,2048|t;if(n=t,r=a,e-64112>>>0>=106)break V;break T}if(i=2099200,e-183984>>>0<7473|e-178208>>>0<5762|e-177984>>>0<222|e-131072>>>0<42711||e-173824>>>0<4149||(i=2048,e-194560>>>0<542))break T;break V}if(i=2048,e-110960>>>0<396|e-94208>>>0<6125|e-100352>>>0<755)break T}i=0}return B=r,n|i}if((-4&e)==8508)break y;if(n=128,!(e-8517>>>0<3)&&(n=16777344,(-2&e)!=8520))break Z}B=r;break n}t=(e=e>>>0>131069)?65536:0,B=e?0:128;break b}if((0|e)==11776)break O}B=0;break I}B=0;break f}return B=0,4194304}return B=0,128}return B=0,16777344}return B=0,4096}return B=0,1024}return B=0,-2147483520}return B=0,e-10214>>>0<10?-2147483520:-2147483648}B=0;break r}B=0;break e}B=130;break I}B=130;break f}B=134;break I}return B=150,0}B=0;break b}B=e?0:r;break b}return B=t,e}return 131072}return B=0,16777216}B=e?0:n;break b}return B=r,e}return B=n,e}B=e?0:t;break n}return B=0,8192}B=s[e+4>>2];break b}B=e?8388608:0;break b}return n}return B=0,-2147483616}B=e?134:128}return t}B=134}return-2147483648}return 0}B=1073741824;break r}B=-2147483648}return 268435520}B=67108864}return 64}return B=a,2099200|t}function ue(e){var t,n=0,r=0,i=0,l=0,u=0;(t=ve(8244))&&(s[t+328>>2]=2,a[132848]=0,s[t+684>>2]=0,s[t+688>>2]=0,s[t+320>>2]=0,s[t+324>>2]=0,a[t+268|0]=0,a[t+228|0]=0,s[t+8216>>2]=0,s[t+8220>>2]=0,s[t+224>>2]=104944,s[t+216>>2]=383,s[t+220>>2]=96,Pt(t+344|0,0,292),s[t+8196>>2]=0,s[(n=t+8188|0)>>2]=0,s[n+4>>2]=0,s[t+8180>>2]=0,s[t+8184>>2]=0,a[t+460|0]=22,a[t+461|0]=129,a[t+466|0]=38,a[t+462|0]=38,a[t+463|0]=36,a[t+464|0]=22,a[t+465|0]=224,a[t+456|0]=22,a[t+457|0]=22,a[t+458|0]=44,a[t+459|0]=22,a[t+454|0]=46,a[t+455|0]=129,a[t+446|0]=22,a[t+447|0]=38,a[t+448|0]=28,a[t+449|0]=193,a[t+450|0]=38,a[t+451|0]=22,a[t+452|0]=46,a[t+453|0]=46,a[t+441|0]=129,a[t+442|0]=38,a[t+443|0]=22,a[t+444|0]=38,a[t+445|0]=193,s[t+332>>2]=104912,s[t+336>>2]=104916,s[t+340>>2]=105232,a[t+296|0]=18,a[t+297|0]=18,o[t+304>>1]=182,o[t+306>>1]=140,a[t+298|0]=20,o[t+308>>1]=220,o[t+310>>1]=220,o[t+312>>1]=220,a[t+299|0]=20,a[t+300|0]=20,o[t+314>>1]=240,a[t+301|0]=22,o[t+316>>1]=260,o[t+318>>1]=280,a[t+302|0]=22,a[t+303|0]=20,n=Pt(t,0,212),s[n+200>>2]=20,s[n+192>>2]=25966,s[n+196>>2]=500,s[n+80>>2]=95,s[n+16>>2]=1,s[n+20>>2]=3,s[n+8>>2]=2,s[n+52>>2]=19,a[n+168|0]=3,s[n+92>>2]=2,s[n+72>>2]=4,s[n+40>>2]=115,s[n+44>>2]=95,s[n+140>>2]=105244,Vr(n,201),s[n+120>>2]=2,s[n+124>>2]=44,s[n+164>>2]=100,s[n+128>>2]=46,s[n+132>>2]=14,s[n+112>>2]=1227133512,s[n+116>>2]=49,s[n+104>>2]=1,r=s[26313],s[n+636>>2]=s[26312],s[n+640>>2]=r,r=s[26315],s[n+644>>2]=s[26314],s[n+648>>2]=r,r=s[26317],s[n+652>>2]=s[26316],s[n+656>>2]=r,r=s[26319],s[n+660>>2]=s[26318],s[n+664>>2]=r,r=s[26321],s[n+668>>2]=s[26320],s[n+672>>2]=r,r=s[26323],s[n+676>>2]=s[26322],s[n+680>>2]=r,r=c[104928]|c[104929]<<8,a[n+160|0]=r,a[n+161|0]=r>>>8,r=c[104924]|c[104925]<<8|c[104926]<<16|c[104927]<<24,a[n+156|0]=r,a[n+157|0]=r>>>8,a[n+158|0]=r>>>16,a[n+159|0]=r>>>24),i=gn(t+228|0,e),n=0;A:{e:if(r=c[0|e]){for(;n=(r<<24>>24)+(n<<8)|0,r=c[0|(e=e+1|0)];);g:{r:{C:{a:{I:{f:{i:{b:{s:{t:{n:{k:{o:{B:{c:{Q:{G:{w:{E:{D:{u:{l:{x:{d:{m:{M:{v:{h:{p:{Y:{H:{N:{P:{F:{y:{z:{O:{Z:{K:{W:{X:{L:{T:{V:{J:{R:{U:{j:{S:{q:{_:{$:{AA:{eA:{gA:{rA:{CA:{aA:{IA:{fA:{iA:{bA:{sA:{tA:{nA:{kA:{oA:{BA:{cA:{QA:{if((0|n)<=28008){if((0|n)<=26464){if((0|n)<=25696){GA:switch(n-24934|0){case 20:break b;case 1:case 2:case 3:case 4:case 5:case 6:case 9:case 10:case 11:case 14:case 15:case 16:case 17:case 18:case 19:break e;case 8:break $;case 12:break iA;case 7:break bA;case 0:break sA;case 13:break QA;default:break GA}GA:switch(n-25189|0){case 1:case 3:case 4:case 5:case 6:case 7:case 8:case 10:case 11:case 12:case 13:break e;case 14:break L;case 2:break IA;case 0:break fA;case 9:break QA;default:break GA}switch(n-25441|0){case 18:break Q;case 0:break $;case 24:break CA;default:break e}}GA:switch(n-25964|0){case 1:case 4:case 5:case 6:break e;case 8:break S;case 9:break _;case 7:break $;case 3:break AA;case 2:break eA;case 0:break BA;default:break GA}GA:switch(n-26209|0){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:break e;case 17:break U;case 8:break j;case 0:break q;default:break GA}switch(n-25697|0){case 4:break gA;case 0:break rA;default:break e}}if((0|n)<=27488){GA:switch(n-26729|0){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 10:case 13:case 14:case 15:break e;case 16:break K;case 12:break W;case 11:break X;case 9:break L;case 0:break T;default:break GA}GA:switch(n-26977|0){case 1:case 2:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 15:case 16:case 17:break e;case 19:break y;case 18:break z;case 3:break O;case 14:break Z;case 0:break $;default:break GA}switch(n-26465|0){case 20:break T;case 13:break V;case 0:case 3:break J;default:break e}}GA:switch(n-27489|0){case 13:break s;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 12:case 15:case 16:case 17:case 18:case 19:case 21:case 22:case 23:break e;case 24:break h;case 20:break p;case 14:break Y;case 11:break H;case 10:break N;case 0:break P;default:break GA}switch(n-27745|0){case 19:break M;case 0:break v;case 21:break kA;default:break e}}if((0|n)<=29792){if((0|n)<=28768){GA:switch(n-28009|0){case 3:break s;case 11:break d;case 2:break m;case 1:case 4:case 5:case 6:case 7:case 8:case 12:case 13:case 14:case 15:break e;case 10:break O;case 9:break T;case 0:case 16:break tA;default:break GA}GA:switch(n-28258|0){case 0:break l;case 10:break x;case 1:case 2:case 4:case 5:case 6:case 7:case 8:case 9:break e;case 3:break T;default:break GA}switch(n-28525|0){case 0:break u;case 5:break T;default:break e}}if((0|n)<=29539){GA:switch(n-28769|0){case 19:break E;case 11:break D;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 20:case 21:case 22:case 23:break e;case 0:break T;case 24:break tA;default:break GA}GA:switch(n-29295|0){case 6:break G;case 0:break w;case 1:case 2:case 3:case 4:case 5:break e;default:break GA}if((0|n)==29045)break tA;break e}switch(n-29540|0){case 19:break t;case 18:break n;case 13:break k;case 8:break B;case 5:break c;case 7:break Q;case 14:break L;case 0:break I;default:break e}}if((0|n)>6514801)break cA;if((0|n)<=30058)switch(n-29793|0){case 19:break i;case 17:break b;case 0:case 4:break s;case 13:break t;case 7:break tA;default:break e}if((0|n)<=30312)switch(n-30059|0){case 0:break f;case 15:break tA;case 7:break I;default:break e}if((0|n)==30313)break a;if((0|n)==31336)break C;if((0|n)!=6451321)break e}if(s[t+296>>2]=303174162,s[t+300>>2]=370545684,s[t+600>>2]=2432,s[t+8>>2]=0,s[t+12>>2]=65540,s[t+100>>2]=s[t+96>>2],e=s[25889],s[t+304>>2]=s[25888],s[t+308>>2]=e,e=s[25891],s[t+312>>2]=s[25890],s[t+316>>2]=e,Ge(t),a[t+345|0]=2|c[t+345|0],a[t+406|0]=16|c[t+406|0],a[t+407|0]=16|c[t+407|0],a[t+408|0]=16|c[t+408|0],a[t+409|0]=16|c[t+409|0],a[t+410|0]=16|c[t+410|0],a[t+411|0]=16|c[t+411|0],a[t+412|0]=16|c[t+412|0],a[t+413|0]=16|c[t+413|0],a[t+414|0]=16|c[t+414|0],a[t+415|0]=16|c[t+415|0],a[t+416|0]=16|c[t+416|0],a[t+417|0]=16|c[t+417|0],a[t+418|0]=16|c[t+418|0],a[t+419|0]=16|c[t+419|0],a[t+420|0]=16|c[t+420|0],a[t+456|0]=4|c[t+456|0],a[t+457|0]=4|c[t+457|0],s[t+112>>2]=613567144,s[t+104>>2]=16,(0|n)!=6451321)break A;s[t+104>>2]=1,s[t+108>>2]=512,n=6451321;break A}if((0|n)>7364975)break nA;if((0|n)>6840682)break oA;if((0|n)==6514802)break aA;if((0|n)==6516078)break C;if((0|n)!=6779491)break e}if(s[t+600>>2]=896,s[t+328>>2]=8,s[t+296>>2]=336858127,s[t+300>>2]=353768980,s[t+332>>2]=103632,e=s[25905],s[t+304>>2]=s[25904],s[t+308>>2]=e,e=s[25907],s[t+312>>2]=s[25906],s[t+316>>2]=e,Pt(t+344|0,0,256),a[t+388|0]=129,a[t+389|0]=129,a[t+390|0]=129,a[t+391|0]=129,a[t+420|0]=129,a[t+421|0]=129,a[t+422|0]=129,a[t+423|0]=129,a[t+360|0]=129,a[t+392|0]=129,a[t+393|0]=129,a[t+417|0]=129,a[t+418|0]=129,a[t+419|0]=129,a[t+420|0]=129,a[t+408|0]=6,a[t+409|0]=4,a[t+410|0]=6,a[t+411|0]=6,a[t+412|0]=6,a[t+413|0]=193,a[t+414|0]=6,a[t+415|0]=6,a[t+406|0]=6,a[t+407|0]=129,a[t+398|0]=4,a[t+399|0]=193,a[t+400|0]=6,a[t+401|0]=193,a[t+402|0]=6,a[t+403|0]=4,a[t+404|0]=4,a[t+405|0]=4,a[t+394|0]=4,a[t+395|0]=4,a[t+396|0]=4,a[t+397|0]=193,s[t+44>>2]=130,s[t+8>>2]=2,s[t+12>>2]=6,s[t+16>>2]=0,s[t+20>>2]=2,s[t+104>>2]=264,s[t+108>>2]=6146,a[t+391|0]=193,a[t+389|0]=193,a[t+390|0]=193,a[t+421|0]=193,s[t+100>>2]=s[t+96>>2],a[t+416|0]=4|c[t+416|0],(0|n)!=6779491)break A;s[t+40>>2]=1,n=6779491;break A}if((0|n)==6840683)break R;if((0|n)==6972015)break F;if((0|n)!=7107687)break e}s[t+296>>2]=134875662,s[t+300>>2]=252968960,s[t+328>>2]=5,a[t+169|0]=1,s[t+132>>2]=33,s[t+104>>2]=99336,s[t+8>>2]=0,s[t+12>>2]=262182,e=s[26069],s[t+304>>2]=s[26068],s[t+308>>2]=e,e=s[26071],s[t+312>>2]=s[26070],s[t+316>>2]=e;break A}if((0|n)<=7564649){if((0|n)==7364976)break $;if((0|n)==7435619)break tA;if((0|n)!=7563374)break e;s[t+148>>2]=1,s[t+112>>2]=24,s[t+104>>2]=1,s[t+100>>2]=s[t+96>>2],n=7563374;break A}if((0|n)==7564650)break o;if((0|n)==7959909)break C;if((0|n)!=1885958500)break e}s[t+104>>2]=0;break A}s[t+4>>2]=48,s[t+8>>2]=0,s[t+144>>2]=1,s[t+104>>2]=16779472,s[t+32>>2]=1,s[t+24>>2]=1,e=s[25881],s[t+304>>2]=s[25880],s[t+308>>2]=e,e=s[25883],s[t+312>>2]=s[25882],s[t+316>>2]=e,a[t+465|0]=64&c[t+465|0]|129,n=24934;break A}s[t+600>>2]=4608,s[t+296>>2]=303173650,s[t+300>>2]=303174162,s[t+8>>2]=0,s[t+12>>2]=36,s[t+104>>2]=1024,s[t+100>>2]=s[t+96>>2],s[t+40>>2]=1,e=s[25865],s[t+304>>2]=s[25864],s[t+308>>2]=e,e=s[25867],s[t+312>>2]=s[25866],s[t+316>>2]=e,n=24941;break A}for(s[t+600>>2]=1536,s[t+224>>2]=0,s[t+216>>2]=1631,s[t+220>>2]=1536,s[t+104>>2]=2884720,s[t+328>>2]=7,s[t+40>>2]=1,z=n=z-16|0,s[n+12>>2]=-1,e=89684;i=nn(n+12|0,e),(0|(r=s[n+12>>2]))>=33&&(a[0|(l=(t+r|0)-1192|0)]=1|c[0|l]),e=e+i|0,r;);for(s[n+12>>2]=-1,e=89743;i=nn(n+12|0,e),(0|(r=s[n+12>>2]))>=33&&(a[0|(l=(t+r|0)-1192|0)]=2|c[0|l]),e=e+i|0,r;);for(s[n+12>>2]=-1,e=89795;i=nn(n+12|0,e),(0|(r=s[n+12>>2]))>=33&&(a[0|(l=(t+r|0)-1192|0)]=4|c[0|l]),e=e+i|0,r;);for(s[n+12>>2]=-1,e=89941;i=nn(n+12|0,e),(0|(r=s[n+12>>2]))>=33&&(a[0|(l=(t+r|0)-1192|0)]=16|c[0|l]),e=e+i|0,r;);for(s[n+12>>2]=-1,e=90045;i=nn(n+12|0,e),(0|(r=s[n+12>>2]))>=33&&(a[0|(l=(t+r|0)-1192|0)]=32|c[0|l]),e=e+i|0,r;);for(s[n+12>>2]=-1,e=90045;i=nn(n+12|0,e),(0|(r=s[n+12>>2]))>=33&&(a[0|(l=(t+r|0)-1192|0)]=8|c[0|l]),e=e+i|0,r;);for(s[n+12>>2]=-1,e=90045;i=nn(n+12|0,e),(0|(r=s[n+12>>2]))>=33&&(a[0|(l=(t+r|0)-1192|0)]=64|c[0|l]),e=e+i|0,r;);z=n+16|0,n=24946;break A}s[t+600>>2]=1056,s[t+12>>2]=34,s[t+216>>2]=1118,s[t+220>>2]=1072,Pt(t+344|0,0,256),a[t+406|0]=4,a[t+366|0]=4,a[t+367|0]=4,a[t+369|0]=4,a[t+370|0]=4,a[t+371|0]=4,a[t+372|0]=4,a[t+361|0]=4,a[t+362|0]=4,a[t+363|0]=4,a[t+364|0]=4,a[t+373|0]=4,a[t+380|0]=4,a[t+381|0]=4,a[t+382|0]=4,a[t+383|0]=4,a[t+375|0]=4,a[t+376|0]=4,a[t+377|0]=4,a[t+378|0]=4,a[t+384|0]=4,a[t+360|0]=129,s[t+328>>2]=6,s[t+296>>2]=134744588,s[t+300>>2]=286261248,s[t+40>>2]=1,s[t+8>>2]=0,s[t+104>>2]=1032,s[t+108>>2]=66,e=s[25885],s[t+304>>2]=s[25884],s[t+308>>2]=e,e=s[25887],s[t+312>>2]=s[25886],s[t+316>>2]=e,n=25189;break A}tt(t),s[t+328>>2]=6,s[t+56>>2]=2,s[t+36>>2]=263,s[t+40>>2]=1074,s[t+124>>2]=32,s[t+104>>2]=184554728,s[t+8>>2]=2,a[t+386|0]=64&c[t+386|0]|129,n=25191;break A}s[t+12>>2]=262182,s[t+40>>2]=1,n=6514802;break A}s[t+328>>2]=14,s[t+296>>2]=303173393,s[t+300>>2]=336986112,s[t+104>>2]=1024,s[t+16>>2]=0,s[t+20>>2]=2,s[t+8>>2]=2,s[t+12>>2]=22,s[t+44>>2]=120,e=s[25893],s[t+304>>2]=s[25892],s[t+308>>2]=e,e=s[25895],s[t+312>>2]=s[25894],s[t+316>>2]=e,a[t+463|0]=64&c[t+463|0]|129,a[t+465|0]=64&c[t+465|0]|129,n=25465;break A}s[t+8>>2]=0,s[t+104>>2]=184618072,s[t+32>>2]=1,e=s[26101],s[t+304>>2]=s[26100],s[t+308>>2]=e,e=s[26103],s[t+312>>2]=s[26102],s[t+316>>2]=e,a[t+465|0]=64&c[t+465|0]|129,n=25697;break A}s[t+296>>2]=336860180,s[t+300>>2]=336991764,s[t+8>>2]=0,s[t+104>>2]=16846872,s[t>>2]=8,s[t+4>>2]=48,s[t+80>>2]=87,s[t+32>>2]=1,s[t+36>>2]=256,s[t+40>>2]=2,e=s[25897],s[t+304>>2]=s[25896],s[t+308>>2]=e,e=s[25899],s[t+312>>2]=s[25898],s[t+316>>2]=e,a[t+465|0]=64&c[t+465|0]|129,n=25701;break A}s[t+132>>2]=33,s[t+104>>2]=16779328,s[t+8>>2]=0,s[t+12>>2]=8,s[t+204>>2]=101,s[t+60>>2]=2,s[t+40>>2]=2,e=s[25901],s[t+304>>2]=s[25900],s[t+308>>2]=e,e=s[25903],s[t+312>>2]=s[25902],s[t+316>>2]=e,a[t+441|0]=64|c[t+441|0],a[t+445|0]=64|c[t+445|0],a[t+449|0]=64|c[t+449|0],a[t+455|0]=64|c[t+455|0],a[t+461|0]=64|c[t+461|0],a[t+465|0]=64|c[t+465|0],n=25966;break A}s[t+328>>2]=4,s[t+296>>2]=336858640,s[t+300>>2]=353768980,s[t+104>>2]=16782344,s[t+20>>2]=2,s[t+12>>2]=22,s[t+4>>2]=2,s[t+8>>2]=2,s[t+332>>2]=103640,e=s[25997],s[t+304>>2]=s[25996],s[t+308>>2]=e,e=s[25999],s[t+312>>2]=s[25998],s[t+316>>2]=e,n=25967;break A}s[t+296>>2]=269422096,s[t+300>>2]=370545684,s[t+104>>2]=86017320,s[t+108>>2]=6144,s[t+16>>2]=0,s[t+20>>2]=2,s[t+8>>2]=2,s[t+12>>2]=534,s[t+100>>2]=s[t+96>>2],s[t+44>>2]=120,e=s[25913],s[t+304>>2]=s[25912],s[t+308>>2]=e,e=s[25915],s[t+312>>2]=s[25914],s[t+316>>2]=e;$:{AA:{if((0|n)<=26976){if((0|n)==24942)break AA;if((0|n)!=25441)break $;s[t+12>>2]=566,s[t+336>>2]=103664,n=25441;break A}if((0|n)!=26977){if((0|n)!=7364976)break $;s[t+8>>2]=3,s[t+12>>2]=310,n=7364976;break A}s[t+104>>2]=85984264,n=26977;break A}s[t+104>>2]=153093416,s[t+108>>2]=2048,s[t+140>>2]=103676,n=24942;break A}s[t+40>>2]=2;break A}s[t+296>>2]=303173648,s[t+300>>2]=303174162,s[t+104>>2]=3147080,s[t+12>>2]=65792,s[t+84>>2]=1,e=s[25921],s[t+304>>2]=s[25920],s[t+308>>2]=e,e=s[25923],s[t+312>>2]=s[25922],s[t+316>>2]=e,n=25973;break A}s[t+600>>2]=1536,s[t+216>>2]=1740,s[t+220>>2]=1568,s[t+104>>2]=96,s[t+224>>2]=103696,s[t+340>>2]=103872,s[t+40>>2]=1,n=26209;break A}s[t+328>>2]=5}s[t+104>>2]=86024,s[t+164>>2]=130,a[t+465|0]=64&c[t+465|0]|129;break A}s[t+296>>2]=303173650,s[t+300>>2]=303174162,s[t+8>>2]=3,s[t+12>>2]=36,s[t+144>>2]=2,s[t+104>>2]=118658312,s[t+28>>2]=1,s[t+100>>2]=s[t+96>>2],e=s[25865],s[t+304>>2]=s[25864],s[t+308>>2]=e,e=s[25867],s[t+312>>2]=s[25866],s[t+316>>2]=e,a[t+465|0]=64&c[t+465|0]|129,n=26226;break A}o[t+170>>1]=257,s[t+148>>2]=1,s[t+12>>2]=2,n=6840683;break A}s[t+144>>2]=2,s[t+104>>2]=2098176,s[t+8>>2]=0,s[t+12>>2]=32,s[t+40>>2]=3,s[t+28>>2]=1;break A}s[t+8>>2]=3,s[t+100>>2]=s[t+96>>2],n=26478;break A}s[t+328>>2]=18,s[t+296>>2]=320081425,s[t+300>>2]=353768980,s[t+600>>2]=2304,s[t+112>>2]=84648,s[t+104>>2]=16,s[t+8>>2]=6,s[t+12>>2]=65540,s[t+100>>2]=s[t+96>>2],e=s[25973],s[t+304>>2]=s[25972],s[t+308>>2]=e,e=s[25975],s[t+312>>2]=s[25974],s[t+316>>2]=e;T:{V:{J:{if((0|n)<=28529){if((0|n)==26485)break J;if((0|n)!=28261)break T;e=s[25861],s[t+304>>2]=s[25860],s[t+308>>2]=e,e=s[25863],s[t+312>>2]=s[25862],s[t+316>>2]=e,s[t+296>>2]=320017171,s[t+300>>2]=320017171,s[t+132>>2]=22,s[t+112>>2]=-1431655768,s[t+108>>2]=32768|s[t+108>>2],Ge(t);break A}if((0|n)==28530)break V;if((0|n)!=28769)break T;s[t+600>>2]=2560,Ge(t);break A}e=s[25861],s[t+304>>2]=s[25860],s[t+308>>2]=e,e=s[25863],s[t+312>>2]=s[25862],s[t+316>>2]=e,s[t+600>>2]=2688,s[t+296>>2]=320017171,s[t+300>>2]=320017171,s[t+8>>2]=2,Ge(t);break A}s[t+600>>2]=2816}Ge(t);break A}a[0|i]=104,a[i+1|0]=98,a[i+2|0]=115,a[i+3|0]=0,(0|n)==29554?(e=s[25977],s[t+304>>2]=s[25976],s[t+308>>2]=e,e=s[25979],s[t+312>>2]=s[25978],s[t+316>>2]=e):(e=s[26093],s[t+304>>2]=s[26092],s[t+308>>2]=e,e=s[26095],s[t+312>>2]=s[26094],s[t+316>>2]=e),s[t+328>>2]=3,s[t+296>>2]=336859409,s[t+300>>2]=353768980,o[t+168>>1]=261,s[t+8>>2]=0,s[t+12>>2]=16,s[t+144>>2]=1,s[t+184>>2]=1056,s[t+104>>2]=33572172,s[t+108>>2]=330,s[t+36>>2]=3,a[t+465|0]=64&c[t+465|0]|129,a[t+458|0]=64&c[t+458|0]|129;break A}s[t+104>>2]=17990912,s[t+8>>2]=3,s[t+12>>2]=36,n=26740;break A}s[t+328>>2]=3,s[t+296>>2]=320016657,s[t+300>>2]=353768980,s[t+124>>2]=32,s[t+128>>2]=44,s[t+104>>2]=186758144,s[t+12>>2]=1081398,s[t+16>>2]=2,s[t+4>>2]=32,s[t+8>>2]=0,s[t+116>>2]=899,s[t+120>>2]=1,a[t+169|0]=1,s[t+76>>2]=2,e=s[25981],s[t+304>>2]=s[25980],s[t+308>>2]=e,e=s[25983],s[t+312>>2]=s[25982],s[t+316>>2]=e,a[t+465|0]=64&c[t+465|0]|129,Vr(t,3),n=26741;break A}for(s[t+600>>2]=1328,s[t+8>>2]=3,e=s[25985],s[t+304>>2]=s[25984],s[t+308>>2]=e,e=s[25987],s[t+312>>2]=s[25986],s[t+316>>2]=e,i=Pt(t+344|0,0,256),a[t+429|0]=129,a[t+416|0]=129,a[t+403|0]=129,a[t+399|0]=129,a[t+400|0]=129,a[t+397|0]=129,a[t+393|0]=129,r=103952,l=50,u=50;a[0|(e=i+u|0)]=2|c[0|e],e=i+c[r+1|0]|0,a[0|e]=2|c[0|e],e=i+c[r+2|0]|0,a[0|e]=2|c[0|e],u=c[0|(r=r+3|0)],e=103952,(0|r)!=103982;);for(r=t+344|0;a[0|(i=r+l|0)]=4|c[0|i],i=r+c[e+1|0]|0,a[0|i]=4|c[0|i],i=r+c[e+2|0]|0,a[0|i]=4|c[0|i],l=c[0|(e=e+3|0)],(0|e)!=103982;);a[t+168|0]=6,s[t+104>>2]=5128,a[t+413|0]=4|c[t+413|0];break A}s[t+328>>2]=4,s[t+296>>2]=336858640,s[t+300>>2]=353768980,s[t+104>>2]=16782440,s[t+20>>2]=2,s[t+12>>2]=22,s[t+4>>2]=2,s[t+8>>2]=2,s[t+332>>2]=104e3,e=s[25997],s[t+304>>2]=s[25996],s[t+308>>2]=e,e=s[25999],s[t+312>>2]=s[25998],s[t+316>>2]=e,n=26991;break A}s[t+296>>2]=303174160,s[t+300>>2]=353768980,s[t+104>>2]=16781320,s[t+144>>2]=2,s[t+8>>2]=2,s[t+12>>2]=22,e=s[26005],s[t+304>>2]=s[26004],s[t+308>>2]=e,e=s[26007],s[t+312>>2]=s[26006],s[t+316>>2]=e;break A}for(s[t+8>>2]=0,s[t+12>>2]=16,s[t+56>>2]=2,s[t+28>>2]=17,e=s[26009],s[t+304>>2]=s[26008],s[t+308>>2]=e,e=s[26011],s[t+312>>2]=s[26010],s[t+316>>2]=e,e=0,r=t+344|0;a[0|(i=e+r|0)]=231&c[0|i],a[0|(i=r+(1|e)|0)]=231&c[0|i],a[0|(i=r+(2|e)|0)]=231&c[0|i],a[0|(i=r+(3|e)|0)]=231&c[0|i],(0|(e=e+4|0))!=256;);s[t+104>>2]=2280,s[t+108>>2]=2,s[t+608>>2]=104048,a[t+451|0]=16|c[t+451|0],a[t+456|0]=16|c[t+456|0],a[t+459|0]=16|c[t+459|0],a[t+460|0]=16|c[t+460|0],a[t+450|0]=8|c[t+450|0],a[t+462|0]=8|c[t+462|0],a[t+458|0]=8|c[t+458|0],a[t+465|0]=64&c[t+465|0]|129;break A}s[t+296>>2]=269618961,s[t+300>>2]=370546196,s[t+12>>2]=131110,s[t+144>>2]=2,s[t+104>>2]=184559112,s[t+108>>2]=8192,s[t+16>>2]=0,s[t+20>>2]=2,s[t+4>>2]=1,s[t+8>>2]=2,s[t+100>>2]=s[t+96>>2],s[t+140>>2]=103676,s[t+68>>2]=2,s[t+56>>2]=1,s[t+44>>2]=130,s[t+28>>2]=2,e=s[26025],s[t+304>>2]=s[26024],s[t+308>>2]=e,e=s[26027],s[t+312>>2]=s[26026],s[t+316>>2]=e,a[t+465|0]=64&c[t+465|0]|129,n=26996;break A}s[t+4>>2]=524,s[t+8>>2]=2,s[t+196>>2]=368,s[t+104>>2]=0,s[t+336>>2]=104128,s[t- -64>>2]=1,e=s[26029],s[t+304>>2]=s[26028],s[t+308>>2]=e,e=s[26031],s[t+312>>2]=s[26030],s[t+316>>2]=e,a[t+465|0]=64&c[t+465|0]|129,n=6972015;break A}for(s[t+296>>2]=303174162,s[t+300>>2]=370545684,e=s[25873],s[t+304>>2]=s[25872],s[t+308>>2]=e,e=s[25875],s[t+312>>2]=s[25874],s[t+316>>2]=e,i=Pt(t+344|0,0,256),a[t+431|0]=1,a[t+429|0]=1,a[t+411|0]=1,a[t+405|0]=1,a[t+400|0]=1,a[t+396|0]=1,a[t+392|0]=1,e=104160,r=49;a[0|(r=r+i|0)]=4|c[0|r],r=i+c[e+1|0]|0,a[0|r]=4|c[0|r],r=i+c[e+2|0]|0,a[0|r]=4|c[0|r],r=c[0|(e=e+3|0)],(0|e)!=104193;);s[t+600>>2]=4256,s[t+8>>2]=0,s[t+12>>2]=16,a[t+168|0]=7,s[t+132>>2]=32,a[t+392|0]=128|c[t+392|0],a[t+396|0]=128|c[t+396|0],a[t+400|0]=128|c[t+400|0],a[t+405|0]=128|c[t+405|0],a[t+411|0]=128|c[t+411|0],a[t+429|0]=128|c[t+429|0],a[t+431|0]=128|c[t+431|0],s[t+188>>2]=1056,s[t+192>>2]=29301,s[t+104>>2]=19964960;break A}for(s[t+600>>2]=1056,i=Pt(t+344|0,0,256),a[t+393|0]=1,a[t+365|0]=1,a[t+360|0]=1,a[t+545|0]=1,a[t+529|0]=1,a[t+391|0]=1,a[t+389|0]=1,a[t+390|0]=1,a[t+387|0]=1,a[t+379|0]=1,a[t+374|0]=1,a[t+368|0]=1,a[t+489|0]=1,a[t+487|0]=1,a[t+398|0]=1,e=104224,r=17;a[0|(r=r+i|0)]=4|c[0|r],r=i+c[e+1|0]|0,a[0|r]=4|c[0|r],r=i+c[e+2|0]|0,a[0|r]=4|c[0|r],r=c[0|(e=e+3|0)],(0|e)!=104251;);a[t+360|0]=128|c[t+360|0],a[t+365|0]=128|c[t+365|0],a[t+393|0]=128|c[t+393|0],a[t+368|0]=128|c[t+368|0],a[t+374|0]=128|c[t+374|0],a[t+379|0]=128|c[t+379|0],a[t+387|0]=128|c[t+387|0],a[t+389|0]=128|c[t+389|0],a[t+390|0]=128|c[t+390|0],a[t+391|0]=128|c[t+391|0],a[t+529|0]=128|c[t+529|0],a[t+545|0]=128|c[t+545|0],a[t+489|0]=128|c[t+489|0],a[t+487|0]=128|c[t+487|0],a[t+398|0]=128|c[t+398|0],e=s[26055],s[t+312>>2]=s[26054],s[t+316>>2]=e,e=s[26053],s[t+304>>2]=s[26052],s[t+308>>2]=e,s[t+296>>2]=353636370,s[t+300>>2]=336925972,s[t+200>>2]=0,s[t+8>>2]=7,s[t+12>>2]=2097184,a[t+168|0]=2,s[t+104>>2]=50176,s[t+84>>2]=1,Vr(t,3);break A}s[t+296>>2]=320017171,s[t+300>>2]=320017171,s[t+104>>2]=184618072,s[t+8>>2]=12,s[t+12>>2]=32,e=s[25861],s[t+304>>2]=s[25860],s[t+308>>2]=e,e=s[25863],s[t+312>>2]=s[25862],s[t+316>>2]=e,n=27500;break A}s[t+184>>2]=42752,s[t+600>>2]=4352,Pt(t+344|0,0,256),a[t+456|0]=1,a[t+457|0]=1,a[t+458|0]=1,a[t+459|0]=1,a[t+449|0]=1,a[t+450|0]=1,a[t+451|0]=1,a[t+452|0]=1,a[t+453|0]=1,a[t+454|0]=1,a[t+455|0]=1,a[t+456|0]=1,a[t+441|0]=1,a[t+442|0]=1,a[t+443|0]=1,a[t+444|0]=1,a[t+445|0]=1,a[t+446|0]=1,a[t+447|0]=1,a[t+448|0]=1,a[t+460|0]=65,a[t+461|0]=65,a[t+532|0]=32,a[t+527|0]=32,a[t+519|0]=32,a[t+515|0]=32,a[t+349|0]=32,a[t+350|0]=32,a[t+346|0]=32,s[t+132>>2]=20,s[t+112>>2]=286331152,s[t+104>>2]=1024,s[t+108>>2]=16384,s[t+40>>2]=1,s[t+8>>2]=8,a[t+458|0]=65,a[t+453|0]=65,a[t+447|0]=65,a[t+448|0]=65,a[t+443|0]=65,a[t+444|0]=65,n=27503;break A}s[t+328>>2]=10,s[t+296>>2]=336859666,s[t+300>>2]=353768980,a[t+168|0]=2,s[t+104>>2]=263264,s[t+8>>2]=7,e=s[26065],s[t+304>>2]=s[26064],s[t+308>>2]=e,e=s[26067],s[t+312>>2]=s[26066],s[t+316>>2]=e,n=27509;break A}s[t+104>>2]=1,n=27513;break A}s[t+116>>2]=5e3,s[t+104>>2]=16777216,s[t+24>>2]=1,s[t+16>>2]=0,s[t+20>>2]=2,s[t+8>>2]=2,s[t+12>>2]=32,s[t+328>>2]=5,n=27745;break A}s[t+116>>2]=5e3,s[t+104>>2]=99336,s[t+108>>2]=256,s[t+24>>2]=1,s[t+16>>2]=0,s[t+20>>2]=2,s[t+8>>2]=2,s[t+12>>2]=32,s[t+328>>2]=5,n=27764;break A}s[t+328>>2]=6,s[t+296>>2]=336859409,s[t+300>>2]=353768980,s[t+600>>2]=1056,s[t+104>>2]=2114600,s[t+108>>2]=138,s[t+8>>2]=4,s[t+632>>2]=104288,s[t+604>>2]=104288,e=s[26093],s[t+304>>2]=s[26092],s[t+308>>2]=e,e=s[26095],s[t+312>>2]=s[26094],s[t+316>>2]=e,n=28011;break A}s[t+328>>2]=4,s[t+104>>2]=1,s[t+8>>2]=2,s[t+36>>2]=256,n=28020;break A}s[t+4>>2]=48,s[t+8>>2]=0,s[t+12>>2]=128,s[t+104>>2]=2169880,s[t+32>>2]=1,s[t+36>>2]=256,s[t+24>>2]=1,s[t+136>>2]=85767,e=s[26097],s[t+304>>2]=s[26096],s[t+308>>2]=e,e=s[26099],s[t+312>>2]=s[26098],s[t+316>>2]=e,a[t+465|0]=64&c[t+465|0]|129,n=28268;break A}s[t+8>>2]=0,s[t+104>>2]=71752,e=s[26101],s[t+304>>2]=s[26100],s[t+308>>2]=e,e=s[26103],s[t+312>>2]=s[26102],s[t+316>>2]=e,a[t+465|0]=64&c[t+465|0]|129,n=28258;break A}s[t+296>>2]=336858898,s[t+300>>2]=370546196,s[t+104>>2]=1088,s[t+108>>2]=512,s[t+8>>2]=2,s[t+12>>2]=524310,e=s[26105],s[t+304>>2]=s[26104],s[t+308>>2]=e,e=s[26107],s[t+312>>2]=s[26106],s[t+316>>2]=e,n=28525;break A}s[t+328>>2]=3,s[t+296>>2]=320015633,s[t+300>>2]=353768980,a[t+168|0]=7,s[t+8>>2]=2,s[t+12>>2]=6,s[t+104>>2]=20488,s[t+108>>2]=192,s[t+36>>2]=9,s[t+60>>2]=260,e=s[26109],s[t+304>>2]=s[26108],s[t+308>>2]=e,e=s[26111],s[t+312>>2]=s[26110],s[t+316>>2]=e,a[t+465|0]=64&c[t+465|0]|129,n=28780;break A}for(s[t+296>>2]=353569552,s[t+300>>2]=353768980,s[t+116>>2]=5e3,s[t+104>>2]=33570920,s[t+108>>2]=14336,s[t+8>>2]=3,s[t+12>>2]=139286,s[t+100>>2]=s[t+96>>2],e=s[26113],s[t+304>>2]=s[26112],s[t+308>>2]=e,e=s[26115],s[t+312>>2]=s[26114],s[t+316>>2]=e,a[t+465|0]=64&c[t+465|0]|129,e=0,r=t+344|0;a[0|(i=e+r|0)]=253&c[0|i],a[0|(i=r+(1|e)|0)]=253&c[0|i],a[0|(i=r+(2|e)|0)]=253&c[0|i],a[0|(i=r+(3|e)|0)]=253&c[0|i],(0|(e=e+4|0))!=256;);a[t+442|0]=2|c[t+442|0],a[t+443|0]=2|c[t+443|0],a[t+444|0]=2|c[t+444|0],a[t+446|0]=2|c[t+446|0],a[t+447|0]=2|c[t+447|0],a[t+450|0]=2|c[t+450|0],a[t+451|0]=2|c[t+451|0],a[t+453|0]=2|c[t+453|0],a[t+454|0]=2|c[t+454|0],a[t+456|0]=2|c[t+456|0],a[t+457|0]=2|c[t+457|0],a[t+459|0]=2|c[t+459|0],a[t+460|0]=2|c[t+460|0],a[t+462|0]=2|c[t+462|0],a[t+464|0]=2|c[t+464|0],a[t+466|0]=2|c[t+466|0],s[t+144>>2]=2,s[t+68>>2]=2;break A}s[t+296>>2]=303172879,s[t+300>>2]=353768980,s[t+328>>2]=3,s[t+8>>2]=3,s[t+12>>2]=262,s[t+104>>2]=16805928,s[t+108>>2]=30,e=s[26117],s[t+304>>2]=s[26116],s[t+308>>2]=e,e=s[26119],s[t+312>>2]=s[26118],s[t+316>>2]=e,n=29295;break A}bn(t),n=29301;break A}for(s[t+328>>2]=3,s[t+296>>2]=336859153,s[t+300>>2]=353768980,o[t+168>>1]=261,s[t+8>>2]=0,s[t+12>>2]=22,s[t+124>>2]=0,s[t+128>>2]=44,s[t+104>>2]=16794624,s[t+108>>2]=128,s[t+36>>2]=3,s[t+60>>2]=4,e=s[25869],s[t+304>>2]=s[25868],s[t+308>>2]=e,e=s[25871],s[t+312>>2]=s[25870],s[t+316>>2]=e,(0|n)==25459&&(s[t+108>>2]=136),a[t+465|0]=64&c[t+465|0]|129,a[t+458|0]=64&c[t+458|0]|129,e=0,r=t+344|0;a[0|(i=e+r|0)]=223&c[0|i],a[0|(i=r+(1|e)|0)]=223&c[0|i],a[0|(i=r+(2|e)|0)]=223&c[0|i],a[0|(i=r+(3|e)|0)]=223&c[0|i],(0|(e=e+4|0))!=256;);a[t+442|0]=32|c[t+442|0],a[t+444|0]=32|c[t+444|0],a[t+447|0]=32|c[t+447|0],a[t+450|0]=32|c[t+450|0],a[t+452|0]=32|c[t+452|0],a[t+453|0]=32|c[t+453|0],a[t+454|0]=32|c[t+454|0],a[t+458|0]=32|c[t+458|0],a[t+462|0]=32|c[t+462|0],a[t+463|0]=32|c[t+463|0],a[t+466|0]=32|c[t+466|0],a[t+441|0]=32|c[t+441|0],a[t+445|0]=32|c[t+445|0],a[t+449|0]=32|c[t+449|0],a[t+455|0]=32|c[t+455|0],a[t+461|0]=32|c[t+461|0],a[t+465|0]=32|c[t+465|0];break A}for(s[t+296>>2]=303174162,s[t+300>>2]=370545684,s[t+600>>2]=3456,a[t+169|0]=1,s[t+8>>2]=0,s[t+12>>2]=22,s[t+100>>2]=s[t+96>>2],e=s[25873],s[t+304>>2]=s[25872],s[t+308>>2]=e,e=s[25875],s[t+312>>2]=s[25874],s[t+316>>2]=e,Pt(t+344|0,0,256),a[t+365|0]=1,a[t+366|0]=1,a[t+357|0]=1,a[t+358|0]=1,a[t+359|0]=1,a[t+360|0]=1,a[t+361|0]=1,a[t+362|0]=1,a[t+363|0]=1,a[t+364|0]=1,a[t+349|0]=1,a[t+350|0]=1,a[t+351|0]=1,a[t+352|0]=1,a[t+353|0]=1,a[t+354|0]=1,a[t+355|0]=1,a[t+356|0]=1,e=74,r=74;a[(i=t+r|0)+344|0]=1|c[i+344|0],a[i+345|0]=1|c[i+345|0],a[i+346|0]=1|c[i+346|0],(0|(r=r+3|0))!=116;);for(;a[(r=e+t|0)+344|0]=2|c[r+344|0],a[r+345|0]=2|c[r+345|0],a[r+346|0]=2|c[r+346|0],(0|(e=e+3|0))!=116;);for(r=26;a[(e=t+r|0)+344|0]=4|c[e+344|0],a[e+345|0]=4|c[e+345|0],a[e+346|0]=4|c[e+346|0],a[e+347|0]=4|c[e+347|0],a[e+348|0]=4|c[e+348|0],(0|(r=r+5|0))!=71;);s[t+112>>2]=84648,s[t+104>>2]=270589952,s[t+108>>2]=65536,s[t+40>>2]=1,s[t+204>>2]=s[t+600>>2]+74;break A}s[t+8>>2]=2,s[t+12>>2]=32,s[t+328>>2]=3,s[t+124>>2]=32,s[t+104>>2]=16864280,s[t+108>>2]=256,s[t+68>>2]=2,s[t+36>>2]=259,s[t+40>>2]=118,s[t+28>>2]=1,a[t+458|0]=128|c[t+458|0],n=29548;break A}s[t+296>>2]=370544658,s[t+300>>2]=370546196,s[t+164>>2]=130,s[t+8>>2]=0,s[t+12>>2]=86,s[t+104>>2]=87064,a[t+169|0]=1,s[t+152>>2]=3,e=s[26121],s[t+304>>2]=s[26120],s[t+308>>2]=e,e=s[26123],s[t+312>>2]=s[26122],s[t+316>>2]=e,a[t+465|0]=64&c[t+465|0]|129,n=7564650;break A}s[t+296>>2]=269487120,s[t+300>>2]=320148500,s[t+8>>2]=3,s[t+12>>2]=278,s[t+144>>2]=2,s[t+104>>2]=32872,e=s[26125],s[t+304>>2]=s[26124],s[t+308>>2]=e,e=s[26127],s[t+312>>2]=s[26126],s[t+316>>2]=e,a[t+465|0]=64&c[t+465|0]|129,n=29553;break A}s[t+296>>2]=336859152,s[t+300>>2]=353768980,s[t+8>>2]=0,s[t+144>>2]=1,s[t+104>>2]=6408,e=s[26129],s[t+304>>2]=s[26128],s[t+308>>2]=e,e=s[26131],s[t+312>>2]=s[26130],s[t+316>>2]=e,a[t+465|0]=64&c[t+465|0]|129,n=29558;break A}s[t+296>>2]=320015376,s[t+300>>2]=353768980,a[t+168|0]=4,s[t+12>>2]=22,s[t+4>>2]=1,s[t+8>>2]=2,s[t+104>>2]=1248,s[t+100>>2]=s[t+96>>2],e=s[26133],s[t+304>>2]=s[26132],s[t+308>>2]=e,e=s[26135],s[t+312>>2]=s[26134],s[t+316>>2]=e;break A}s[t+296>>2]=303174162,s[t+300>>2]=370545684,a[t+169|0]=1,s[t+8>>2]=0,s[t+12>>2]=22,s[t+112>>2]=5288,s[t+100>>2]=s[t+96>>2],e=s[25877],s[t+304>>2]=s[25876],s[t+308>>2]=e,e=s[25879],s[t+312>>2]=s[25878],s[t+316>>2]=e;s:switch(n-29793|0){default:if((0|n)!=27502){if((0|n)!=28012)break g;e=s[26137],s[t+304>>2]=s[26136],s[t+308>>2]=e,e=s[26139],s[t+312>>2]=s[26138],s[t+316>>2]=e,s[t+600>>2]=3328,s[t+296>>2]=320017171,s[t+300>>2]=320017171,s[t+104>>2]=2098176,s[t+108>>2]=131072,s[t+8>>2]=13;break g}s[t+104>>2]=1,s[t+600>>2]=3200;break g;case 4:break s;case 1:case 2:case 3:break g;case 0:break r}s[t+104>>2]=1,s[t+108>>2]=524288,s[t+600>>2]=3072;break g}s[t+328>>2]=10,s[t+296>>2]=353636370,s[t+300>>2]=336925972,a[t+173|0]=1,s[t+8>>2]=7,s[t+12>>2]=32,a[t+168|0]=2,s[t+84>>2]=1,e=s[26141],s[t+304>>2]=s[26140],s[t+308>>2]=e,s[t+104>>2]=(0|n)==24954?2118920:2114824,e=s[26143],s[t+312>>2]=s[26142],s[t+316>>2]=e;break A}tt(t),s[t+296>>2]=303173650,s[t+300>>2]=303174162,s[t+104>>2]=2131208,s[t+8>>2]=3,s[t+12>>2]=32,e=s[25865],s[t+304>>2]=s[25864],s[t+308>>2]=e,e=s[25867],s[t+312>>2]=s[25866],s[t+316>>2]=e,n=29812;break A}bn(t),n=30059;break A}s[t+112>>2]=21160,s[t+104>>2]=16,s[t+600>>2]=1536,s[t+40>>2]=1;break A}s[t+296>>2]=269488144,s[t+300>>2]=370546198,s[t+8>>2]=0,s[t>>2]=33,s[t+148>>2]=1,s[t+104>>2]=12615688,s[t+16>>2]=2,s[t+100>>2]=s[t+96>>2],s[t+632>>2]=104592,s[t+604>>2]=104592,e=s[26145],s[t+304>>2]=s[26144],s[t+308>>2]=e,e=s[26147],s[t+312>>2]=s[26146],s[t+316>>2]=e,n=30313;break A}if(s[t+296>>2]=370544662,s[t+300>>2]=370546198,s[t+8>>2]=3,s[t+12>>2]=2,s[t+148>>2]=1,s[t+184>>2]=12544,o[t+170>>1]=257,s[t+176>>2]=1,a[t+172|0]=1,s[t>>2]=33,s[t+4>>2]=0,s[t+100>>2]=s[t+96>>2],e=s[26225],s[t+304>>2]=s[26224],s[t+308>>2]=e,e=s[26227],s[t+312>>2]=s[26226],s[t+316>>2]=e,(0|n)!=7959909)break A;s[t+112>>2]=24,s[t+104>>2]=1,s[t+108>>2]=1048576,n=7959909;break A}e=s[25873],s[t+304>>2]=s[25872],s[t+308>>2]=e,e=s[25875],s[t+312>>2]=s[25874],s[t+316>>2]=e,s[t+600>>2]=2944,s[t+104>>2]=2097152,s[t+108>>2]=262144,s[t+48>>2]=1}Ge(t),a[t+422|0]=2|c[t+422|0];break A}s[t+40>>2]=1}return s[t+212>>2]=n,8&(e=s[t+104>>2])&&(s[t+124>>2]=46,s[t+128>>2]=44),4&e&&(s[t+124>>2]=0),t}function de(e){var t=0,n=0,r=0,i=0,l=0,u=0,d=0,f=0,p=0,m=0,y=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0,P=0;A:{n=s[32538],s[47354]=0,s[47568]=0,s[49828]=0,s[47569]=0,a[199328]=0,s[49827]=0,s[49845]=0,a[190280]=0,a[190268]=1,s[47202]=0,s[49573]=0,s[49846]=0,a[199304]=0,a[199388]=0,s[33691]=0,s[33285]=0,s[33708]=1,s[33709]=1,s[33288]=0,t=s[33730],s[33712]=s[33729],s[33713]=t,t=s[33732],s[33714]=s[33731],s[33715]=t,t=s[33734],s[33716]=s[33733],s[33717]=t,t=s[33736],s[33718]=s[33735],s[33719]=t,t=s[33738],s[33720]=s[33737],s[33721]=t,t=s[33740],s[33722]=s[33739],s[33723]=t,t=s[33742],s[33724]=s[33741],s[33725]=t,s[33726]=s[33743],a[134784]=0,a[134824]=0,a[134772]=0,a[134760]=0,s[33284]=-1,s[33692]=0,s[32525]=0,s[47201]=s[33717],s[47200]=s[33718],di(),s[34438]=0,s[34437]=0,t=s[33730],s[34048]=s[33729],s[34049]=t,t=s[33732],s[34050]=s[33731],s[34051]=t,t=s[33734],s[34052]=s[33733],s[34053]=t,t=s[33736],s[34054]=s[33735],s[34055]=t,t=s[33738],s[34056]=s[33737],s[34057]=t,t=s[33740],s[34058]=s[33739],s[34059]=t,t=s[33742],s[34060]=s[33741],s[34061]=t,s[34062]=s[33743];e:{g:{if(1&n){if(s[s[32539]>>2]=0,s[47569]|s[49845]|s[49827])break g;break e}if(s[s[32539]>>2]=0,!(s[49845]|s[49827]||s[47569]))break e}a[190280]=1}s[49828]=0,t=268436735;e:if(!(!s[34391]|!s[34388])&&(s[47204]=0,s[47203]=0,s[47199]=0,s[34439]=0,(s[47192]||!(t=sn(86228)))&&((t=s[33283])||((t=ve(16))&&(s[t>>2]=0,s[t+4>>2]=0,s[t+8>>2]=0,s[t+12>>2]=0),s[33283]=t),l=268439807,(n=s[s[47192]+328>>2])>>>0>20|!s[129104+(n<<3)>>2]?t=l:(e?(l=4,i=U(e)+1|0):(l=2,i=0),s[t+8>>2]=l,s[t>>2]=e,s[t+12>>2]=s[129108+(n<<3)>>2],s[t+4>>2]=e?e+i|0:0,t=0),!t))){ce(0);g:{for(;;){s[34436]=0,e=s[34391],s[51290]=e,s[54046]=e+s[34390],s[50767]<=102399&&(s[50767]=102400);r:if(!((u=s[51290])>>>0>=g[54046]))for(;;){if((((0|(e=(i=s[50757])-(d=s[50758])|0))<=0?e+170|0:e)-171|0)>=-1){if((0|(e=s[54731]))<=0)break r;l=0,s[50763]=0,s[50762]=0,s[50765]=2147483647,e=c[218920]?s[54732]:e;C:{for(;;){if(n=e-1|0,s[54732]=n,(0|e)<=0)break C;if(s[51290]=u+1,t=(e=s[51293])+1|0,s[51293]=(0|t)<=5499?t:0,t=(e=v(s[50755],o[205184+(e<<1)>>1]))>>8,a[0|u]=t,i=s[51290],s[51290]=i+1,a[0|i]=e>>>16,(i=s[50756])?(e=n,(n=s[i+4>>2])&&(Ui[0|n](t<<16>>16),e=s[54732])):e=n,i=(n=s[51292])+1|0,s[51292]=i,o[205184+(n<<1)>>1]=t,(0|i)>=5500&&(s[51292]=0),u=s[51290],!(g[54046]>=u+2>>>0))break}l=1}a[218920]=l;break r}e=s[(n=216192+(i<<4)|0)+4>>2];C:{a:{I:{f:{i:{b:{s:{t:{n:{k:{o:{B:{c:{Q:{G:{w:switch((255&(t=s[n>>2]))-1|0){case 9:break I;case 7:break f;case 10:break i;case 11:break b;case 13:break s;case 0:break t;case 1:break n;case 2:break k;case 3:break o;case 6:break B;case 5:break c;case 4:break Q;case 15:break G;case 8:break w;default:break a}if(!s[50759])break a;t=s[n+12>>2],n=s[n+8>>2],s[50768]=0,u=n||99232,s[50766]=u,s[50769]=e?2097152/(0|e)|0:0,e=s[50971],i=(0|v(e,s[50788]))/50|0,n=v(i-e|0,-18),e=((0|(e=s[50785]))>=101?101:e)-s[50790]|0,t=(l=n+((0|v(s[50970],c[((0|e)>0?e:0)+105680|0]))/128|0)|0)+((0|v(i,(0|(e=t>>16))<(0|(n=65535&t))?e:n))/2|0)|0,s[50770]=t,e=(l+((0|v(i,(0|e)>(0|n)?e:n))/2|0)|0)-t|0,s[50771]=e,n=c[0|u],s[33072]=s[50976],s[50767]=t+(v(e,n)>>8);break a}Ui[s[s[50756]>>2]](e,s[n+8>>2]),Re(e);break a}if(c[218920]||(s[54731]-=e),s[50781]=100,s[50773]=0,yt(),s[50763]=0,s[50762]=0,s[50765]=2147483647,!e)break a;for(e=c[218920]?s[54732]:e;;){if(n=e-1|0,s[54732]=n,(0|e)<=0)break a;if(e=s[51290],s[51290]=e+1,i=(t=s[51293])+1|0,s[51293]=(0|i)<=5499?i:0,i=e,t=(e=v(s[50755],o[205184+(t<<1)>>1]))>>8,a[0|i]=t,i=s[51290],s[51290]=i+1,a[0|i]=e>>>16,(i=s[50756])?(e=n,(n=s[i+4>>2])&&(Ui[0|n](t<<16>>16),e=s[54732])):e=n,i=(n=s[51292])+1|0,s[51292]=i,o[205184+(n<<1)>>1]=t,(0|i)>=5500&&(s[51292]=0),i=1,!(g[54046]>=s[51290]+2>>>0))break}break C}for(s[50773]=0,s[54731]=s[54729],yt(),t=s[n+12>>2],i=s[n+8>>2],c[218920]?e=s[54733]:s[54734]=0,d=t>>8,l=255&t,s[50762]=0,s[50763]=0;;){if(n=e-1|0,s[54733]=n,(0|e)<=0)break a;if(t=(e=s[54734])+1|0,l?u=v(l,a[e+i|0]):(u=c[e+i|0]|a[t+i|0]<<8,t=e+2|0),s[54734]=t,f=(e=s[51293])+1|0,s[51293]=f,t=(0|(e=(0|(e=((0|v(d,v(s[33037],v(s[33038],u))>>10))/32|0)+(v(s[50755],o[205184+(e<<1)>>1])>>8)|0))<=-32768?-32768:e))>=32767?32767:e,(0|f)>=5500&&(s[51293]=0),a[s[51290]]=t,a[s[51290]+1|0]=t>>>8,(u=s[50756])?(e=n,(n=s[u+12>>2])&&(Ui[0|n](t<<16>>16),e=s[54733])):e=n,n=s[51290],s[51290]=n+2,f=(u=s[51292])+1|0,s[51292]=f,o[205184+(u<<1)>>1]=(0|v(t,3))/4,(0|f)>=5500&&(s[51292]=0),!(g[54046]>=n+4>>>0))break}i=1;break C}t=s[n+12>>2],i=e>>>16|0,s[50777]=i,e&=65535,s[50773]=e,l=255&t,s[50774]=l,s[50775]=t>>8,l||(s[50777]=i<<1,s[50773]=e<<1),s[50778]=0,s[50776]=0,s[50772]=s[n+8>>2];break a}s[50773]=0}if(s[54731]=s[54729],t=s[50759],c[218920]){if(!t)break a}else{if(!t)break a;for(l=s[n+12>>2],u=s[n+8>>2],n=e>>16,s[55912]=255&n,a[218960]=1,s[55908]=0,67108864&e&&(s[55908]=3,s[55909]=s[110496+(n>>>6&12)>>2]),134217728&e&&(s[55908]=4,s[55909]=s[110512+(n>>>6&12)>>2]),e&=65504;;){if((0|d)!=(0|(i=(0|(n=i+1|0))<=169?n:0)))if((0|(n=s[216192+(i<<4)>>2]))!=3){if(n-5>>>0>1)continue}else a[218960]=0;break}for(s[55913]=s[50762],e=(e=e+32&131008)||64,s[50763]=e+s[50763],s[55684]=v(o[101997],7800)+(h[102024]<<8)<<8,s[55704]=v(o[101998],9e3)+(h[102025]<<8)<<8,S=s[50980],r=+(0|e),y=+(e>>>2|0),e=0;(0|e)!=7&&(i=o[(f=(n=e<<1)+t|0)+218>>1]<<8,d=v(e,80)+222176|0,f=o[f+164>>1],x=i+v(f,o[2+(n+u|0)>>1])<<8,s[d>>2]=x,m=+(0|x),_[d+16>>3]=m,_[d+48>>3]=16*(+(i+v(f,o[2+(n+l|0)>>1])<<8)-m)/y),i=(n=v(e,80))+222176|0,f=o[(x=t+(e<<1)|0)+182>>1],w=v(f,c[(d=e+u|0)+18|0])<<6,s[i+4>>2]=w,m=+(0|w),_[i+24>>3]=m,C=i,i=e+l|0,_[C+56>>3]=64*(+(v(f,c[i+18|0])<<6)-m)/r,(0|e)>(0|S)|e>>>0>5||(f=n+222176|0,w=o[x+200>>1],x=v(w,c[d+26|0])<<10,s[f+8>>2]=x,m=+(0|x),_[f+32>>3]=m,C=f- -64|0,f=w<<10,_[C>>3]=64*(+(0|v(f,c[i+26|0]))-m)/r,e>>>0<=2?(n=n+222176|0,d=v(f,c[d+32|0]),s[n+12>>2]=d,m=+(0|d),_[n+40>>3]=m,_[n+72>>3]=64*(+(0|v(f,c[i+32|0]))-m)/r):s[n+222188>>2]=x),(0|(e=e+1|0))!=8;);}for(;;){if(e=s[50762],!c[218960]&(0|e)==s[50763])break a;k:{o:{if(63&e){if(7&e)break k;B:if(!((0|(n=s[54736]))<=0||(0|(t=s[54735]))<=0))for(i=s[50826],e=1;;){if(s[(u=(l=e<<2)+i|0)>>2]=s[u>>2]+s[l+203312>>2],e>>>0>28|(0|e)>=(0|n))break B;if(l=(0|e)<(0|t),e=e+1|0,!l)break}if((0|(e=s[33073]))>255)break k;s[33073]=e+1;break k}if(e)if(s[50759]){if(n=s[50768]+s[50769]|0,s[50768]=n,n=(t=s[50766])?v(c[t+((0|(n>>=8))>=127?127:n)|0],s[50771])>>8:0,s[55911]+=s[55915],t=(0|(t=s[55914]))<=23551?t:0,s[55914]=t+s[50761],t=(n+s[50770]|0)+v(s[33072],c[110528+(t>>6)|0]-128|0)|0,s[50767]=t,!(i=s[51291])&(0|(n=i?i<<12:t))>102399||(t=(0|n)<=102400?102400:n,s[50767]=t),(0|e)!=s[55913]){if(e=0,!((0|(d=s[50980]))<0)){for(;u=v(e,80),r=_[(n=u+222176|0)+48>>3]+_[n+16>>3],_[n+16>>3]=r,y=_[n+56>>3]+_[n+24>>3],_[n+24>>3]=y,m=_[n- -64>>3]+_[n+32>>3],_[n+32>>3]=m,i=b(r)<2147483648?~~r:-2147483648,s[n>>2]=i,i=b(m)<2147483648?~~m:-2147483648,s[n+8>>2]=i,l=b(y)<2147483648?~~y:-2147483648,s[n+4>>2]=(0|l)>0?l:0,(0|e)>2||(r=_[(n=u+222176|0)+72>>3]+_[n+40>>3],_[n+40>>3]=r,i=b(r)<2147483648?~~r:-2147483648),s[u+222188>>2]=i,(0|d)>=(0|(e=e+1|0)););if((0|e)>=8)break o}for(;(0|e)!=7&&(n=v(e,80)+222176|0,r=_[n+48>>3]+_[n+16>>3],_[n+16>>3]=r,i=b(r)<2147483648?~~r:-2147483648,s[n>>2]=i),n=v(e,80)+222176|0,r=_[n+56>>3]+_[n+24>>3],_[n+24>>3]=r,i=b(r)<2147483648?~~r:-2147483648,s[n+4>>2]=(0|i)>0?i:0,(0|(e=e+1|0))!=8;);}}else t=s[50767];else s[50826]=218976,s[54742]=0,s[54736]=Qe(s[50767]<<4,218976,0),t=s[50767],s[54737]=890/(t>>12),s[54739]=(0|v(s[50781],v(s[50779],t>>8)))/8e4}if(s[55906]=t>>11,s[54735]=s[54736],s[55904]=v(s[50760],t>>7),s[55905]=s[50754]/(t>>12),n=1^(e=s[54742]),s[54742]=n,s[50826]=v(e,1600)+218976,s[54736]=Qe(t<<4,v(n,1600)+218976|0,1),!(!(t=s[50759])|!s[51022]))for(y=_[25430],m=_[25429],e=1;s[(n=t+(e<<2)|0)+272>>2]&&(i=s[n+308>>2],n=v(e,40)+203456|0,p=_n(y*+o[2+(v(e,80)+222176|0)>>1]),p*=r=dt(m*+(0|i)),p+=p,_[n+8>>3]=p,r*=-r,_[n+16>>3]=r,_[n>>3]=1-p-r),(0|(e=e+1|0))!=9;);}if(l=s[50762]+1|0,s[50762]=l,u=(e=s[50765])+s[55904]|0,s[50765]=u,(0|u)<0&(0|e)>0){if(f=s[55905],t=s[50800]+((0|f)/-2|0)|0,s[55907]=t,(0|(x=s[50763]))<(0|l))break a;if(S=s[54738]+1|0,s[54738]=S,d=s[50767],!((0|(e=(n=s[50980])+1|0))>8)&&(i=d<<3,1&n&&(s[203264+(e<<2)>>2]=(1+(s[v(e,80)+222176>>2]/(0|i)|0)|0)/2,e=n+2|0),(0|n)!=7))for(;n=203264+(e<<2)|0,w=v(e,80)+222176|0,s[n>>2]=(1+(s[w>>2]/(0|i)|0)|0)/2,s[n+4>>2]=(1+(s[w+80>>2]/(0|i)|0)|0)/2,(0|(e=e+2|0))!=9;);e=(0|v(s[50781],v(s[50779],d>>8)))/8e4|0,s[54739]=e;k:if(!((0|(n=s[55908]))<=0)){o:switch(n-3|0){case 0:if((x-l|0)>=f<<1)break k;s[55908]=2,e=(0|v(s[55909],e))/256|0,s[54739]=e;break k;case 1:s[55908]=2,e=(0|v(s[55909],e))/256|0,s[54739]=e;break k;default:break o}s[55908]=n-1}(n=s[55910])&&(i=e,e=s[55911]>>8,e=(0|v(i,c[n+((0|e)>=127?127:e)|0]))/128|0,s[54739]=e),(0|(n=s[s[32972]+92>>2]))>7||(n=15&(i=c[s[55912]+(106336+(n<<3)|0)|0]),(i=i>>>4|0)&&((0|i)==15?(s[55912]=0,s[54739]=(0|v(e,n))/16):(0|S)%(0|i)|0||(s[54739]=(0|v(e,n))/16)))}else t=s[55907];if(l=t+1|0,s[55907]=l,n=u>>>16|0,i=0,!((0|l)<0|(0|l)>=s[50799])){if(!((0|(e=(t=s[50980])+1|0))>8)){if(d=1&(u=8-t|0),(0|t)!=7)for(f=-2&u,t=0;i=v(s[(x=(u=e<<2)+4|0)+203216>>2],o[106400+(v(n,s[x+203264>>2])>>>4&4094)>>1])+(v(s[u+203216>>2],o[106400+(v(n,s[u+203264>>2])>>>4&4094)>>1])+i|0)|0,e=e+2|0,(0|f)!=(0|(t=t+2|0)););d&&(i=v(s[(e<<=2)+203216>>2],o[106400+(v(n,s[e+203264>>2])>>>4&4094)>>1])+i|0)}i=v(c[l+132160|0],(0|i)/s[55906]|0)}if(e=1,(0|(l=s[54737]))<=0)t=n;else for(u=s[50826],t=n;i=v(s[u+(e<<2)>>2],o[106400+((65504&t)>>>4|0)>>1])+i|0,t=t+n|0,(0|l)>=(0|(e=e+1|0)););if((0|(l=s[54735]))>=(0|e))for(u=s[50826];i=i-v(s[u+(e<<2)>>2],o[106400+((65504&t)>>>4|0)>>1])|0,t=t+n|0,(0|l)>=(0|(e=e+1|0)););if(l=(0|(e=s[54728]))==64?i:v(e,i>>6),s[51022]){if(s[50759])for(n=hr(s[33209],0,1103515245,0),e=B,e=Si(n=n+12345|0,e=n>>>0<12345?e+1|0:e),s[33209]=e,y=+((16383&e)- -8192|0),t=s[50759],u=0,e=1;(i=s[272+(t+(e<<2)|0)>>2])&&(d=s[v(e,80)+222180>>2],n=v(e,40)+203456|0,r=_[n+32>>3],m=_[n+24>>3],_[n+32>>3]=m,r=r*_[n+16>>3]+(_[n>>3]*y+m*_[n+8>>3]),_[n+24>>3]=r,n=b(r)<2147483648?~~r:-2147483648,u=v(n,v(i,d>>14))+u|0),(0|(e=e+1|0))!=9;);else u=0;l=l+u|0}t=0,(0|(e=s[50776]))>=s[50773]||(n=s[50778],t=s[50772],(u=s[50774])?(i=e+1|0,s[50776]=i,e=v(u,a[t+(e+n|0)|0])):(u=c[0|(t=t+(e+n|0)|0)],t=a[t+1|0],i=e+2|0,s[50776]=i,e=u|t<<8),t=(0|v(v(e,s[50780])>>10,s[50775]))/32|0,(0|(e=s[50777]))>(n+i|0)||(s[50778]=n+((0|v(e,3))/-4|0))),n=(e=s[51293])+1|0,s[51293]=n,e=((v(s[54739],l>>8)>>13)+t|0)+(v(s[50755],o[205184+(e<<1)>>1])>>8)|0,(0|n)>=5500&&(s[51293]=0),n=s[33073];k:{o:{if((0|(t=v(n,e)))>=8388608){if((0|n)>=(0|(u=8388608/(0|e)|0)))break o;break k}if((0|t)>-8388353||(0|n)<(0|(u=-8388608/(0|e)|0)))break k}n=u-1|0,s[33073]=n,t=v(e,n)}if(e=s[51290],s[51290]=e+1,n=e,e=t>>8,a[0|n]=e,n=s[51290],s[51290]=n+1,a[0|n]=t>>>16,(n=s[50756])&&(n=s[n+8>>2])&&Ui[0|n](e<<16>>16),t=(n=s[51292])+1|0,s[51292]=t,o[205184+(n<<1)>>1]=e,(0|t)>=5500&&(s[51292]=0),!(g[54046]>=s[51290]+2>>>0))break}i=1;break C}s[50773]=0}s[54731]=s[54729],i=1,d=65535&e,t=c[218920],u=s[n+8>>2],l=s[n+12>>2],r=0,m=0,z=n=z+-64|0,f=s[50759];t:if((0|(e=s[f+132>>2]))!=6){if(!t){for(e-1>>>0<=4&&(s[55921]=e,s[55964]=s[110896+(e<<2)>>2]),e=s[f+88>>2],s[54741]=1,s[55922]=(0|e)/32,t=s[50758],e=s[50757];;){n:if((0|t)!=(0|(e=(0|(e=e+1|0))<=169?e:0)))if((0|(x=s[216192+(e<<4)>>2]))!=1){if(x-5>>>0>1)continue}else{if(s[54741]=0,e=s[8+(216192+(e<<4)|0)>>2],!(h[l+4>>1]!=h[e+4>>1]|h[e+6>>1]!=h[l+6>>1]|h[e+8>>1]!=h[l+8>>1]|h[e+10>>1]!=h[l+10>>1])&&h[e+12>>1]==h[l+12>>1])break n;s[54741]=2}break}for((h[u+4>>1]!=h[113564]|h[u+6>>1]!=h[113565]|h[u+8>>1]!=h[113566]|h[u+10>>1]!=h[113567]||h[u+12>>1]!=h[113568])&&(zr(),s[55974]=0,s[55975]=0,s[55972]=0,s[55973]=0,s[55988]=0,s[55989]=0,s[55990]=0,s[55991]=0,s[56004]=0,s[56005]=0,s[56006]=0,s[56007]=0,s[56020]=0,s[56021]=0,s[56022]=0,s[56023]=0,s[56036]=0,s[56037]=0,s[56038]=0,s[56039]=0,s[56052]=0,s[56053]=0,s[56054]=0,s[56055]=0,s[56068]=0,s[56069]=0,s[56070]=0,s[56071]=0,s[56086]=0,s[56087]=0,s[56084]=0,s[56085]=0,s[56102]=0,s[56103]=0,s[56100]=0,s[56101]=0,s[56118]=0,s[56119]=0,s[56116]=0,s[56117]=0,s[56134]=0,s[56135]=0,s[56132]=0,s[56133]=0,s[56150]=0,s[56151]=0,s[56148]=0,s[56149]=0,s[56166]=0,s[56167]=0,s[56164]=0,s[56165]=0,s[56182]=0,s[56183]=0,s[56180]=0,s[56181]=0,s[56198]=0,s[56199]=0,s[56196]=0,s[56197]=0,s[56214]=0,s[56215]=0,s[56212]=0,s[56213]=0,s[56230]=0,s[56231]=0,s[56228]=0,s[56229]=0),e=h[l+4>>1]|h[l+6>>1]<<16,t=h[l>>1]|h[l+2>>1]<<16,o[113562]=t,o[113563]=t>>>16,o[113564]=e,o[113565]=e>>>16,e=h[l+60>>1]|h[l+62>>1]<<16,t=h[l+56>>1]|h[l+58>>1]<<16,o[113590]=t,o[113591]=t>>>16,o[113592]=e,o[113593]=e>>>16,e=h[l+52>>1]|h[l+54>>1]<<16,t=h[l+48>>1]|h[l+50>>1]<<16,o[113586]=t,o[113587]=t>>>16,o[113588]=e,o[113589]=e>>>16,e=h[l+44>>1]|h[l+46>>1]<<16,t=h[l+40>>1]|h[l+42>>1]<<16,o[113582]=t,o[113583]=t>>>16,o[113584]=e,o[113585]=e>>>16,e=h[l+36>>1]|h[l+38>>1]<<16,t=h[l+32>>1]|h[l+34>>1]<<16,o[113578]=t,o[113579]=t>>>16,o[113580]=e,o[113581]=e>>>16,e=h[l+28>>1]|h[l+30>>1]<<16,t=h[l+24>>1]|h[l+26>>1]<<16,o[113574]=t,o[113575]=t>>>16,o[113576]=e,o[113577]=e>>>16,e=h[l+20>>1]|h[l+22>>1]<<16,t=h[l+16>>1]|h[l+18>>1]<<16,o[113570]=t,o[113571]=t>>>16,o[113572]=e,o[113573]=e>>>16,e=h[l+12>>1]|h[l+14>>1]<<16,t=h[l+8>>1]|h[l+10>>1]<<16,o[113566]=t,o[113567]=t>>>16,o[113568]=e,o[113569]=e>>>16,y=+(0|d),(C=1&o[u>>1])?(e=c[u+39|0],s[56680]=e,_[28364]=e>>>0,_[28354]=+(c[l+39|0]-e<<6)/y,e=c[u+40|0],_[28366]=e>>>0,_[28356]=+(c[l+40|0]-e<<6)/y,e=c[u+41|0],s[56682]=e,_[28368]=e>>>0,_[28358]=+(c[l+41|0]-e<<6)/y,t=c[u+42|0],s[56684]=t,_[28370]=t>>>0,e=c[u+43|0],r=+(c[l+43|0]-e<<6)/y,m=+(c[l+42|0]-t<<6)/y,p=+(e>>>0)):(s[56728]=0,s[56729]=0,e=0,s[56680]=0,s[56708]=0,s[56709]=0,s[56732]=0,s[56733]=0,s[56712]=0,s[56713]=0,s[56682]=0,s[56736]=0,s[56737]=0,s[56716]=0,s[56717]=0,s[56684]=0,s[56740]=0,s[56741]=0,p=0),s[56688]=e,_[28360]=m,_[28372]=p,_[28362]=r,s[56692]=0,s[56748]=0,s[56749]=0,s[56694]=0,s[56752]=0,s[56753]=0,s[56696]=0,s[56756]=0,s[56757]=0,s[56700]=0,s[56760]=0,s[56761]=0,s[56704]=0,s[56764]=0,s[56765]=0,s[50764]=d,e=1;S=o[(x=(d=e<<1)+f|0)+164>>1],t=(k=v(e,80))+222896|0,m=+o[x+218>>1],r=.00390625*(0|v(S,o[2+(u+d|0)>>1]))+m,_[t+16>>3]=r,w=b(r)<2147483648?~~r:-2147483648,s[t>>2]=w,_[t+48>>3]=64*(.00390625*(0|v(S,o[2+(l+d|0)>>1]))+m-r)/y,e>>>0<=3&&(t=k+222896|0,r=.00390625*o[x+200>>1]*(c[35+(e+u|0)|0]<<1),_[t+24>>3]=r,d=b(r)<2147483648?~~r:-2147483648,s[t+4>>2]=d,_[t+56>>3]=64*(+(c[35+(e+l|0)|0]<<1)-r)/y),(0|(e=e+1|0))!=6;);if(r=+((e=c[u+40|0])<<1),_[27864]=r,t=s[56618],e||(r=+(0|t),_[27864]=r),e=b(r)<2147483648?~~r:-2147483648,s[55724]=e,d=c[l+40|0],s[55730]=0,s[55731]=1079394304,s[55738]=0,s[55739]=0,s[55725]=89,e=1,_[27868]=64*(+(0|(d?d<<1:t))-r)/y,C)for(;t=v(e,80)+222896|0,f=c[(d=e+u|0)+56|0]<<2,s[t+12>>2]=f,r=+(0|f),_[t+40>>3]=r,f=e+l|0,_[t+72>>3]=64*(+(c[f+56|0]<<2)-r)/y,d=c[d+49|0],s[t+8>>2]=d,r=+(d>>>0),_[t+32>>3]=r,_[t- -64>>3]=64*(+c[f+49|0]-r)/y,(0|(e=e+1|0))!=7;);s[56606]=0}for(;;){if((0|(w=s[50764]))>(0|(l=s[56606]))){for(e=s[50767],s[56609]=s[55724],s[56619]=s[55725],s[56610]=s[55744],s[56611]=s[55764],s[56612]=s[55784],s[56613]=s[55804],C=v(e,10),s[56607]=(0|C)/4096,s[56620]=s[55745],s[56621]=s[55765],s[56622]=s[55785],s[56614]=s[55824],s[56630]=s[55746],s[56631]=s[55766],s[56632]=s[55786],s[56633]=s[55806],s[56634]=s[55826],s[56635]=s[55846],k=s[56680],s[56608]=k,u=s[56694],s[56656]=u,d=s[56696],s[56653]=d,f=s[56700],s[56655]=f,x=s[56684],s[56649]=x,s[56651]=s[56704],s[56654]=s[56688],s[56652]=s[56682],s[56650]=s[56692],e=0;t=v(e,80)+222896|0,r=_[t+48>>3]+_[t+16>>3],_[t+16>>3]=r,y=_[t+56>>3]+_[t+24>>3],_[t+24>>3]=y,m=_[t+72>>3]+_[t+40>>3],_[t+40>>3]=m,p=_[t- -64>>3]+_[t+32>>3],_[t+32>>3]=p,S=b(r)<2147483648?~~r:-2147483648,s[t>>2]=S,S=b(y)<2147483648?~~y:-2147483648,s[t+4>>2]=S,S=b(m)<2147483648?~~m:-2147483648,s[t+12>>2]=S,S=b(p)<2147483648?~~p:-2147483648,s[t+8>>2]=S,(0|(e=e+1|0))!=9;);for(r=_[28354]+_[28364],_[28364]=r,_[28366]=_[28356]+_[28366],y=_[28358]+_[28368],_[28368]=y,m=_[28360]+_[28370],_[28370]=m,p=_[28362]+_[28372],_[28372]=p,e=b(r)<2147483648?~~r:-2147483648,s[56680]=e,e=b(y)<2147483648?~~y:-2147483648,s[56682]=e,e=b(m)<2147483648?~~m:-2147483648,s[56684]=e,e=b(p)<2147483648?~~p:-2147483648,s[56688]=e,r=_[28374]+0,_[28374]=r,e=b(r)<2147483648?~~r:-2147483648,s[56692]=e,r=_[28376]+0,_[28376]=r,e=b(r)<2147483648?~~r:-2147483648,s[56694]=e,r=_[28378]+0,_[28378]=r,e=b(r)<2147483648?~~r:-2147483648,s[56696]=e,r=_[28380]+0,_[28380]=r,e=b(r)<2147483648?~~r:-2147483648,s[56700]=e,r=_[28382]+0,_[28382]=r,e=b(r)<2147483648?~~r:-2147483648,s[56704]=e,s[56659]=s[55724],s[56669]=s[55725],s[56660]=s[55744],s[56670]=s[55745],s[56661]=s[55764],s[56671]=s[55765],s[56662]=s[55784],s[56672]=s[55785],s[56663]=s[55804],s[56664]=s[55824],s[56665]=s[55844],e=s[50768]+s[50769]|0,s[50768]=e,e>>=8,s[50767]=s[50770]+(v(s[50771],c[s[50766]+((0|e)>=127?127:e)|0])>>8),e=w-l|0,s[55923]=(0|e)>=64?64:e,s[55961]=(0|C)/40960,e=k-7|0,s[56658]=(0|e)>0?e:0,_[27974]=x>>>0<=87?.001*o[111136+(x<<1)>>1]*.05:0,_[27975]=d>>>0<=87?.001*o[111136+(d<<1)>>1]*.25:0,_[27973]=u>>>0<=87?.001*o[111136+(u<<1)>>1]:0,_[27971]=f>>>0<=87?.001*o[111136+(f<<1)>>1]*.05:0,r=(e=s[56629])>>>0<=87?.001*o[111136+(e<<1)>>1]*.6:0,_[n>>3]=r,r=(e=s[56630])>>>0<=87?.001*o[111136+(e<<1)>>1]*.4:0,_[n+8>>3]=r,r=(e=s[56631])>>>0<=87?.001*o[111136+(e<<1)>>1]*.15:0,_[n+16>>3]=r,r=(e=s[56632])>>>0<=87?.001*o[111136+(e<<1)>>1]*.06:0,_[n+24>>3]=r,r=(e=s[56633])>>>0<=87?.001*o[111136+(e<<1)>>1]*.04:0,_[n+32>>3]=r,r=(e=s[56634])>>>0<=87?.001*o[111136+(e<<1)>>1]*.022:0,_[n+40>>3]=r,r=(e=s[56635])>>>0<=87?.001*o[111136+(e<<1)>>1]*.03:0,_[n+48>>3]=r,r=(e=(0|(e=s[56657]-3|0))<=0?57:e)>>>0<=87?.001*o[111136+(e<<1)>>1]:0,_[27977]=r/+s[55964],y=_[27968],m=_[27967],e=1;t=(l=e<<6)+223664|0,p=(r=dt(m*+s[(d=(u=e<<2)+226428|0)+48>>2]))*-r,_[t+216>>3]=p,r*=_n(y*+s[d+8>>2]),r+=r,_[t+208>>3]=r,D=1-r-p,_[t+200>>3]=D,e>>>0<=5&&(d=s[(u=u+226428|0)+208>>2],t=l+223664|0,E=(T=dt(m*+s[u+248>>2]))*_n(y*+(0|d)),E+=E,_[t+1488>>3]=E,T*=-T,_[t+1496>>3]=T,O=1-E-T,_[t+1480>>3]=O,_[t+256>>3]=.015625*(T-p),_[t+248>>3]=.015625*(E-r),_[t+240>>3]=.015625*(O-D)),(0|(e=e+1|0))!=10;);for(T=(r=dt(m*+s[56619]))*-r,_[27985]=T,E=(r*=_n(y*+(0-s[56609]|0)))+r,_[27984]=E,r=1-E-T,_[27983]=r,r!=0&&(r=1/r,_[27983]=r,T*=p=-r,_[27985]=T,E*=p,_[27984]=E),D=(p=dt(m*+s[56669]))*-p,_[28145]=D,O=(p*=_n(y*+(0-s[56659]|0)))+p,_[28144]=O,p=1-O-D,_[28143]=p,p!=0&&(p=1/p,_[28143]=p,D*=M=-p,_[28145]=D,O*=M,_[28144]=O),_[27990]=.015625*(D-T),_[27989]=.015625*(O-E),_[27988]=.015625*(p-r),e=0;u=s[(l=226428+(e<<2)|0)+8>>2],t=223664+(e<<6)|0,p=(r=dt(m*+s[l+128>>2]))*_n(y*+(0|u)),p+=p,_[t+848>>3]=p,r*=-r,_[t+856>>3]=r,_[t+840>>3]=_[n+(e<<3)>>3]*(1-p-r),(0|(e=e+1|0))!=7;);if(m=(r=dt(m*+(s[55918]/2|0)))*-r,_[28137]=m,r*=_n(0*y),r+=r,_[28136]=r,_[28135]=1-r-m,e=1,(0|De())!=1)continue;break t}break}e=1,s[54741]>0&&(s[54741]=0,s[55963]=64,s[56606]=l+-64,s[55923]=64,(0|De())==1)||(e=0)}else{if(z=x=z-752|0,!t){Pt(e=x+376|0,0,376),st(f,u,e),st(f,l,e=Pt(x,0,376)),t=s[50768]+v(s[50769],d>>>6|0)|0,s[50768]=t,t>>=8,t=s[50770]+(v(s[50771],c[s[50766]+((0|t)>=127?127:t)|0])>>8)|0,s[50767]=t,_[e+368>>3]=(0|t)/4096|0,s[50773]&&(_[e+736>>3]=_[e+736>>3]/5,_[e+360>>3]=_[e+360>>3]/5),t=s[s[56797]+4>>2],Ui[s[s[t>>2]>>2]](t,e+376|0,110,110,-1,0),l=d-110|0,f=s[50758],t=s[50757];n:{for(;;){if((0|f)!=(0|(t=(t+1|0)%170|0))&&!((S=s[216192+(t<<4)>>2])-5>>>0<2)){if(u=1,(0|S)!=1)continue;break n}break}l=d-220|0,u=0}(0|l)>0&&(t=s[s[56797]+4>>2],Ui[s[s[t>>2]>>2]](t,e,l,l||1,-1,0)),u||(s[e+352>>2]=0,s[e+356>>2]=0,_[e>>3]=_[e+368>>3],t=s[s[56797]+4>>2],Ui[s[s[t>>2]>>2]](t,e,55,55,-1,0),s[e+360>>2]=0,s[e+364>>2]=0,t=s[s[56797]+4>>2],Ui[s[s[t>>2]>>2]](t,e,55,55,-1,0))}e=s[s[56797]+8>>2],t=s[51290],d=0|Ui[s[s[e>>2]>>2]](e,s[54046]-t>>>1|0,t),f=s[51290];n:if(d&&!((0|(t=s[50776]))>=(0|(k=s[50773]))))for(A=s[50777],N=(0|v(A,3))/-4|0,r=.0009765625*s[50780],S=s[50772],l=s[50778],P=s[50775],w=s[50774],e=0;;){if(C=c[S+(u=t+l|0)|0],w?C=v(w,C<<24>>24):(t=t+1|0,s[50776]=t,C|=a[S+(u=t+l|0)|0]<<8),C=b(y=r*+(0|C))<2147483648?~~y:-2147483648,o[(j=f+(e<<1)|0)>>1]=h[j>>1]+((0|v(C,P))/40|0),(0|u)>=(0|A)&&(l=l+N|0,s[50778]=l),t=t+1|0,s[50776]=t,(0|t)>=(0|k))break n;if(!(d>>>0>(e=e+1|0)>>>0))break}e=f+(d<<1)|0,s[51290]=e,z=x+752|0,e=g[54046]<=e>>>0}if(z=n- -64|0,e)break C;break a}s[50781]=e||100;break a}rt(e,s[n+8>>2]);break a}e=s[n+8>>2],s[50759]=ut(203816,e,1344),s[50801]=s[e+108>>2]?105792:106064,e=(0|v(s[e+120>>2],26))/100|0,s[33038]=e,(0|(i=s[50754]))<=11e3&&(a[203300]=1,s[33038]=e<<1),s[54728]=s[50982],e=s[50979],t=s[50978],Pt(205184,0,11e3),s[51293]=0,e=(t=(u=(0|(l=s[50789]))>0)?130:(0|t)>=5499?5499:t)?u?l:(0|e)>=100?100:e:0,s[50755]=e,t=(0|v(t,i))/1e3|0,s[51292]=t,s[54729]=(0|e)>20?t<<1:e?t:0,s[33037]=(0|v(500-e|0,(0|v(c[s[50797]+105596|0],(0|v(s[50787],55))/100|0))/16|0))/500,e=256,(0|(t=(0|(t=s[50785]))>=101?101:t))>=51&&(e=256+(((v(t,25)-1250&65535)>>>0)/50|0)|0),o[101990]=(0|v(o[102026],e))/256,o[101991]=(0|v(o[102027],e))/256,o[101992]=(0|v(o[102028],e))/256,o[101993]=(0|v(o[102029],e))/256,o[101994]=(0|v(o[102030],e))/256,o[101995]=(0|v(o[102031],e))/256,e=s[50790],o[101999]=(0|v(o[102035],v(e,-6)+256|0))/256,o[102e3]=(0|v(o[102036],v(e,-3)+256|0))/256,Zt(8,0,s[50986],0,s[51290]),Re(s[n+8>>2]);break a}if(!s[50759])break a;t=s[n+12>>2],n=s[n+8>>2],s[55911]=0,s[55915]=e?2097152/(0|e)|0:0,s[55910]=n,e=(0|v(t,s[33037]))/16|0,s[50779]=e,s[50780]=(0|v(v(e,s[50985]),15))/100;break a}Zt(t>>8,e,s[n+8>>2],s[n+12>>2],u)}i=0,e=s[50757]+1|0,s[50757]=(0|e)<=169?e:0}if(a[218920]=i,!((u=s[51290])>>>0>2]=0,s[e>>2]=0,s[e+24>>2]=s[34438];r:if(2&(e=s[32538])){if(u=s[34388],(-2&e)==2&&(!(n=t?u:0)|s[n>>2]!=8||(0|(n=s[n+28>>2]))!=s[34389]&&(s[34389]=n)),i=1,(0|t)<2)break r;for(;;){n=t?u+v(i,36)|0:0;C:{a:switch(0|e){case 2:case 3:if(!n|s[n>>2]!=8||(0|(n=s[n+28>>2]))==s[34389])break C;s[34389]=n;break C;case 0:break a;default:break C}(e=s[34440])?(Ui[0|e](l,0,n),t=s[34436],e=s[32538]):e=0}if(!((0|(i=i+1|0))<(0|t)))break}}else if((e=s[34440])&&0|Ui[0|e](l,n,s[34388]))break g;if(!fe(1)&&!(170-((0|(e=s[50757]-s[50758]|0))<=0?e+170|0:e)|0||(e=s[34388],s[e>>2]=0,s[e+4>>2]=s[34437],s[e+24>>2]=s[34438],ce(1))))break}if(t=0,2&c[130152]||!(e=s[34440])||!(0|Ui[0|e](0,0,s[34388])))break e}ce(2),t=268439295}if((0|t)<=268437502){if(!t|(0|t)==268436479|(0|t)!=268437247)break A;return}}}function fe(e){var t,n=0,r=0,i=0,l=0,u=0,d=0,f=0,p=0,m=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0;z=t=z-720|0,n=s[47198],e||(s[36443]=0,s[36442]=1,s[36444]=0,s[36440]=0,s[36441]=0,e=s[50758],s[36454]=e,s[36427]=-1,s[36424]=-1,s[36446]=0,s[36447]=0,s[36439]=-1,s[36426]=0,s[36455]=e,s[36448]=0,s[36449]=0,s[36450]=0,s[36451]=0,s[36452]=0,s[36453]=0,Te(),s[36427]=-1,e=216192+(s[50758]<<4)|0,s[e>>2]=5,s[e+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,s[36426]=0,s[36438]&&(s[36438]=0,e=216192+(s[50758]<<4)|0,s[e>>2]=14,s[e+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0));A:{e:if(!((0|(e=s[36442]))>997|s[36423]<=(0|e)))for(y=n>>>1&1,b=t+48|4,x=t+348|0,S=t+652|0,C=s[32322],g=s[32320],w=t+60|0,T=t+648|0,E=t+56|0,D=t+620|0,_=t- -64|0;;){if(r=145840+(e<<5)|0,!(e=s[50756])|!s[e>>2]||(s[t+12>>2]=0,gt(e=t+16|0,s[r+8>>2],r,0,t+12|0),n=ui(e),i=c[r+17|0],e=216192+(s[50758]<<4)|0,s[e>>2]=16,s[e+8>>2]=i,s[e+4>>2]=n,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0),e=1,(0|(i=(0|(n=s[50757]-s[50758]|0))<=0?n+170|0:n))<=(0|((n=c[r+17|0])?(0|n)==2?25:15:10)))break A;if(p=s[36442],2&c[0|r])for(m=2047&h[r+4>>1];;){if(i=s[36443],d=127&(n=s[198304+(i<<2)>>2])){e=n>>>8|0,s[36443]=i+1;g:{r:{C:switch((31&n)-2|0){case 0:rt(96&n|8,e),ot(2);break g;case 5:if((0|e)>=s[34064]||!s[(d=(i=e<<4)+136272|0)+4>>2])break g;Vt(10,0),e=216192+(s[50758]<<4)|0,s[e>>2]=6,d=s[d+4>>2],s[e+8>>2]=s[8+(i+136272|0)>>2]+44,s[e+12>>2]=5376,s[e+4>>2]=d;break r;case 8:if((0|((0|(i=s[50757]-s[50758]|0))<=0?i+170:i))<6)break g;d=s[47353],i=216192+(s[50758]<<4)|0,s[i>>2]=778,s[i+8>>2]=e,s[i+4>>2]=d+m&16777215;break r;case 9:if((0|((0|(i=s[50757]-s[50758]|0))<=0?i+170:i))<6)break g;d=s[33284],i=216192+(s[50758]<<4)|0,s[i>>2]=1034,s[i+8>>2]=e,s[i+4>>2]=d+1&16777215;break r;default:break C}Vt(10,0),i=216192+(s[50758]<<4)|0,s[i>>2]=12,s[i+8>>2]=e,s[i+4>>2]=d}e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0}if(!(128&n))continue}break}(e=c[r+20|0])&&(1&a[s[47192]+48|0]&c[r+17|0]==2|1&a[s[r+8>>2]+7|0]||(s[36426]=0),n=s[47353]+(2047&h[r+4>>1])|0,s[36445]=n,4&e&&((0|((0|(e=s[50757]-s[50758]|0))<=0?e+170:e))<6||(i=s[47568],e=216192+(s[50758]<<4)|0,s[e>>2]=522,s[e+8>>2]=i,s[e+4>>2]=16777215&n,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0)),1&a[r+20|0]&&(n=h[r+4>>1],i=s[36444],s[36444]=i+1,(0|((0|(e=s[50757]-s[50758]|0))<=0?e+170:e))<6||(m=s[36445],d=s[47355],e=216192+(s[50758]<<4)|0,s[e>>2]=266,s[e+8>>2]=i+d,s[e+4>>2]=16777215&m|(63488&n)<<13,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0))),(0|(e=s[36441]))>0&&(n=216192+(s[36425]<<4)|0,s[n+4>>2]||(s[n+4>>2]=e),s[36441]=0),e=p+1<<5,n=p-1<<5,!(i=c[r+18|0])|2&c[s[r+8>>2]+7|0]||Vt(i,1),d=e+145840|0,l=n+145840|0,m=1;g:{r:{if(s[47198]&&(f=s[r+8>>2],c[f+10|0]!=15)){C:if(c[r+17|0]==2)switch(c[l+17|0]-3|0){case 0:case 5:break r;default:break C}m=0,gt(t+704|0,f,r,y,0),(0|((0|(e=s[50757]-s[50758]|0))<=0?e+170:e))<6||(n=s[36445],e=216192+(s[50758]<<4)|0,s[e>>2]=1802,s[e+4>>2]=16777215&n,n=s[t+708>>2],s[e+8>>2]=s[t+704>>2],s[e+12>>2]=n,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0)}C:switch(c[r+17|0]){case 0:Vt(s[r+12>>2],0),a[r+23|0]=c[s[r+8>>2]+14|0];break g;case 4:n=s[r+8>>2],(0|(e=c[d+17|0]))==2|!c[d+20|0]&(0|e)==3||(o[r>>1]=8192|h[r>>1]),2&c[n+7|0]&&(s[t+88>>2]=0,s[t+92>>2]=0,s[t+80>>2]=0,s[t+84>>2]=0,s[t+72>>2]=0,s[t+76>>2]=0,s[_>>2]=0,s[_+4>>2]=0,s[t+56>>2]=0,s[t+60>>2]=0,s[t+48>>2]=0,s[t+52>>2]=0,xe(0,1,r,t+552|0,145784),s[t+56>>2]=s[t+620>>2],s[_>>2]=s[t+640>>2],s[36424]<0&&(i=c[d+19|0],e=s[50758],s[36425]=e,s[36441]=0,s[(e=216192+(e<<4)|0)+12>>2]=i,s[e+8>>2]=0,s[e>>2]=8,s[e+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,m=c[d+22|0],i=c[d+21|0],d=s[129280+(c[r+16|0]<<2)>>2],(0|(e=s[36424]))<0|(0|(f=s[36440]))<=0||s[(e=216192+(e<<4)|0)+4>>2]||(s[e+4>>2]=f),e=s[50758],s[36424]=e,s[36440]=0,s[(e=216192+(e<<4)|0)>>2]=9,s[e+4>>2]=0,m|=i<<16,i=(0|i)==255,s[e+12>>2]=i?3604556:m,s[e+8>>2]=i?g:d,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0),me(n,0,t+48|0,r,0)),xe(0,0,r,t+552|0,145784),s[t+552>>2]=4|s[t+552>>2],(0|(e=s[36440]))<=0||(0|(n=s[36424]))<0||(s[(n=216192+(n<<4)|0)+4>>2]||(s[n+4>>2]=e),s[36440]=0),s[36426]=0,s[36439]=-1,s[36455]=s[50758],Te(),s[36427]=-1,s[36422]=0,(e=s[t+624>>2])&&(i=e,e=s[t+644>>2],lt(i,2,s[t+596>>2]<<1,s[t+552>>2],0,e?(e<<5)/100|0:32)),s[36426]=0;break g;case 6:xe(0,0,r,t+552|0,145784),8&c[0|r]&&(e=s[r+12>>2],(0|(n=s[36440]))<=0||(0|(i=s[36424]))<0||(s[(i=216192+(i<<4)|0)+4>>2]||(s[i+4>>2]=n),s[36440]=0),s[36426]=0,s[36439]=-1,s[36455]=s[50758],Te(),s[36427]=-1,s[36422]=0,(n=s[t+624>>2])&&(i=e,e=s[t+644>>2],lt(n,2,s[t+596>>2]<<1,s[t+552>>2],i,e?(e<<5)/100|0:32))),e=s[r+12>>2],(0|(n=s[36440]))<=0||(0|(i=s[36424]))<0||(s[(i=216192+(i<<4)|0)+4>>2]||(s[i+4>>2]=n),s[36440]=0),s[36426]=0,s[36439]=-1,s[36455]=s[50758],Te(),s[36427]=-1,s[36422]=0,(n=s[t+624>>2])&&(i=e,e=s[t+644>>2],lt(n,2,s[t+596>>2]<<1,s[t+552>>2],i,e?(e<<5)/100|0:32)),s[36426]=0;break g;case 5:i=s[r+8>>2],s[b+40>>2]=0,s[(e=b)+32>>2]=0,s[e+36>>2]=0,s[e+24>>2]=0,s[e+28>>2]=0,s[e+16>>2]=0,s[e+20>>2]=0,s[e+8>>2]=0,s[e+12>>2]=0,s[e>>2]=0,s[e+4>>2]=0,s[t+48>>2]=4;a:{I:{f:{i:switch(c[d+17|0]-2|0){case 0:n=c[r+19|0],e=s[50758],s[36425]=e,s[36441]=0,s[(e=216192+(e<<4)|0)+12>>2]=n,s[e+8>>2]=0,s[e>>2]=8,s[e+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,n=c[r+22|0],f=c[r+21|0],m=s[129280+(c[r+16|0]<<2)>>2],(0|(e=s[36424]))<0|(0|(u=s[36440]))<=0||s[(e=216192+(e<<4)|0)+4>>2]||(s[e+4>>2]=u),e=(u=!(255&~f))?g:m,m=1;break I;case 1:break i;default:break f}if(!c[d+20|0]){n=c[d+19|0],e=s[50758],s[36425]=e,s[36441]=0,s[(e=216192+(e<<4)|0)+12>>2]=n,s[e+8>>2]=0,s[e>>2]=8,s[e+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,n=c[d+22|0],f=c[d+21|0],m=s[129280+(c[d+16|0]<<2)>>2],(0|(e=s[36424]))<0|(0|(u=s[36440]))<=0||s[(e=216192+(e<<4)|0)+4>>2]||(s[e+4>>2]=u),e=(u=!(255&~f))?g:m,m=1;break I}}if(m=0,s[36424]>=0)break a;n=c[d+19|0],e=s[50758],s[36425]=e,s[36441]=0,s[(e=216192+(e<<4)|0)+12>>2]=n,s[e+8>>2]=0,s[e>>2]=8,s[e+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,n=c[r+22|0],f=c[r+21|0],m=s[129280+(c[r+16|0]<<2)>>2],(0|(e=s[36424]))<0|(0|(u=s[36440]))<=0||s[(e=216192+(e<<4)|0)+4>>2]||(s[e+4>>2]=u),e=(u=!(255&~f))?g:m,m=0}v=s[50758],s[36424]=v,s[36440]=0,s[(v=216192+(v<<4)|0)>>2]=9,s[v+4>>2]=0,s[v+12>>2]=u?3604556:255&n|(255&f)<<16,s[v+8>>2]=e,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0}a:if(!(2&c[i+7|0])&c[l+17|0]!=2)8&c[0|r]&&Vt(50,0);else{if(xe(0,1,r,t+552|0,145784),s[t+56>>2]=s[t+620>>2],s[t+64>>2]=s[t+640>>2],me(i,0,t+48|0,r,0),!(8&c[0|r]))break a;Vt(25,1),me(i,0,t+48|0,r,0)}a:if(m){if(s[36455]!=s[36454])break a;s[36455]=s[50758]}else o[r>>1]=8192|h[r>>1];if(xe(0,0,r,t+552|0,145784),s[t+56>>2]=s[t+620>>2],s[t+64>>2]=s[t+640>>2],s[t+76>>2]=s[t+636>>2],s[t+80>>2]=s[t+656>>2],me(i,0,t+48|0,r,0),c[r+20|0]|c[84+(145840+(p<<5)|0)|0]||((0|(e=c[d+17|0]))==7&&(Vt(20,0),e=c[d+17|0]),(255&e)!=6))break g;Vt(12,0);break g;case 7:a:{I:{f:{i:{b:switch((e=c[d+17|0])-2|0){case 1:break i;case 0:break b;default:break f}n=c[r+19|0],e=s[50758],s[36425]=e,s[36441]=0,s[(e=216192+(e<<4)|0)+12>>2]=n,s[e+8>>2]=0,s[e>>2]=8,s[e+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,m=c[r+22|0],e=c[r+21|0],i=s[129280+(c[r+16|0]<<2)>>2],(0|(n=s[36424]))<0|(0|(f=s[36440]))<=0||s[(n=216192+(n<<4)|0)+4>>2]||(s[n+4>>2]=f),n=(f=!(255&~e))?g:i;break I}n=c[d+19|0],e=s[50758],s[36425]=e,s[36441]=0,s[(e=216192+(e<<4)|0)+12>>2]=n,s[e+8>>2]=0,s[e>>2]=8,s[e+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,m=c[d+22|0],e=c[d+21|0],i=s[129280+(c[d+16|0]<<2)>>2],(0|(n=s[36424]))<0|(0|(f=s[36440]))<=0||s[(n=216192+(n<<4)|0)+4>>2]||(s[n+4>>2]=f),n=(f=!(255&~e))?g:i;break I}if(s[36424]>=0)break a;n=c[r+19|0],e=s[50758],s[36425]=e,s[36441]=0,s[(e=216192+(e<<4)|0)+12>>2]=n,s[e+8>>2]=0,s[e>>2]=8,s[e+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,m=c[r+22|0],e=c[r+21|0],i=s[129280+(c[r+16|0]<<2)>>2],(0|(n=s[36424]))<0|(0|(f=s[36440]))<=0||s[(n=216192+(n<<4)|0)+4>>2]||(s[n+4>>2]=f),n=(f=!(255&~e))?g:i}i=s[50758],s[36424]=i,s[36440]=0,s[(i=216192+(i<<4)|0)>>2]=9,s[i+4>>2]=0,s[i+12>>2]=f?3604556:(255&e)<<16|m,s[i+8>>2]=n,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,e=c[d+17|0]}a:{I:{f:switch((255&e)-2|0){case 1:if(c[d+20|0])break I;break;case 0:break f;default:break I}if(s[36455]!=s[36454])break a;s[36455]=s[50758];break a}o[r>>1]=8192|h[r>>1]}xe(0,0,r,t+552|0,145784),s[t+56>>2]=0,s[t+60>>2]=0,s[_>>2]=0,s[_+4>>2]=0,s[t+80>>2]=0,s[t+84>>2]=0,s[t+72>>2]=0,s[t+76>>2]=0,s[t+88>>2]=0,s[t+56>>2]=s[t+620>>2],s[_>>2]=s[t+640>>2],s[t+80>>2]=s[t+656>>2],s[t+48>>2]=0,s[t+52>>2]=0,s[t+76>>2]=s[t+636>>2],s[t+92>>2]=s[t+596>>2]<<1,8&c[0|r]&&me(s[r+8>>2],0,t+48|0,r,0),me(s[r+8>>2],0,t+48|0,r,0);break g;case 8:if(s[t+88>>2]=0,s[t+92>>2]=0,s[t+80>>2]=0,s[t+84>>2]=0,s[t+72>>2]=0,s[t+76>>2]=0,s[_>>2]=0,s[_+4>>2]=0,s[t+56>>2]=0,s[t+60>>2]=0,s[t+48>>2]=0,s[t+52>>2]=0,1&a[0|r]||(n=c[r+19|0],e=s[50758],s[36425]=e,s[36441]=0,s[(e=216192+(e<<4)|0)+12>>2]=n,s[e+8>>2]=0,s[e>>2]=8,s[e+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,i=c[r+22|0],n=c[r+21|0],m=s[129280+(c[r+16|0]<<2)>>2],(0|(e=s[36424]))<0|(0|(f=s[36440]))<=0||s[(e=216192+(e<<4)|0)+4>>2]||(s[e+4>>2]=f),e=s[50758],s[36424]=e,s[36440]=0,s[(e=216192+(e<<4)|0)>>2]=9,s[e+4>>2]=0,i|=n<<16,n=(0|n)==255,s[e+12>>2]=n?3604556:i,s[e+8>>2]=n?g:m,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0),c[l+17|0]==8&&(s[36426]=0),xe(0,0,r,t+552|0,145784),s[t+56>>2]=s[t+620>>2],s[t+64>>2]=s[t+640>>2],s[t+92>>2]=s[t+596>>2]<<1,c[d+17|0]==2){s[36455]==s[36454]&&(s[36455]=s[50758]),me(s[r+8>>2],0,t+48|0,r,0);break g}if(!(!(1&a[0|r])|c[l+17|0]!=2)){me(s[r+8>>2],0,t+48|0,r,0);break g}s[36426]=0,me(s[r+8>>2],0,t+48|0,r,0),s[36426]=0;break g;case 3:s[t+88>>2]=0,s[t+92>>2]=0,s[t+80>>2]=0,s[t+84>>2]=0,s[t+72>>2]=0,s[t+76>>2]=0,s[_>>2]=0,s[_+4>>2]=0,s[t+56>>2]=0,s[t+60>>2]=0,s[t+48>>2]=0,s[t+52>>2]=0,i=s[s[r+8>>2]+4>>2],1&a[0|r]||(n=c[r+19|0],e=s[50758],s[36425]=e,s[36441]=0,s[(e=216192+(e<<4)|0)+12>>2]=n,s[e+8>>2]=0,s[e>>2]=8,s[e+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,m=c[r+22|0],n=c[r+21|0],f=s[129280+(c[r+16|0]<<2)>>2],(0|(e=s[36424]))<0|(0|(u=s[36440]))<=0||s[(e=216192+(e<<4)|0)+4>>2]||(s[e+4>>2]=u),e=s[50758],s[36424]=e,s[36440]=0,s[(e=216192+(e<<4)|0)>>2]=9,s[e+4>>2]=0,m|=n<<16,n=(0|n)==255,s[e+12>>2]=n?3604556:m,s[e+8>>2]=n?g:f,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0),c[l+17|0]==8&&(s[36426]=0),c[d+17|0]!=2|s[36455]!=s[36454]||(s[36455]=s[50758]),xe(0,0,r,t+552|0,145784),(0|(e=s[t+584>>2]-c[r+18|0]|0))>0&&Vt(e,1),s[t+56>>2]=s[t+620>>2],s[t+64>>2]=s[t+640>>2],s[t+76>>2]=s[t+636>>2],s[t+80>>2]=s[t+656>>2],s[t+92>>2]=s[t+596>>2]<<1,me(s[r+8>>2],0,t+48|0,r,i<<24>>31&5);break g;case 2:break C;default:break g}f=s[r+8>>2]}p=c[r+3|0],s[t+88>>2]=0,s[t+92>>2]=0,s[t+80>>2]=0,s[t+84>>2]=0,s[t+72>>2]=0,s[t+76>>2]=0,s[_>>2]=0,s[_+4>>2]=0,s[t+56>>2]=0,s[t+60>>2]=0,s[t+48>>2]=0,s[t+52>>2]=0,xe(0,0,r,t+552|0,145784),e=s[t+628>>2],s[t+56>>2]=e,s[t+92>>2]=s[t+596>>2]<<1;r:{if(!e||(u=0,i=T,n=w,2&c[t+552|0])){if(c[l+17|0]?(u=0,xe(0,0,l,t+400|0,0),e=s[t+476>>2],s[t+56>>2]=e,!e|!(2&c[t+400|0])||(s[t+72>>2]=s[t+496>>2],u=1),n=s[t+512>>2],s[t+84>>2]=s[t+508>>2],s[t+88>>2]=n):u=0,e)break r;s[t+48>>2]=1,s[t+52>>2]=1,i=D,n=E}s[n>>2]=s[i>>2]}s[t+64>>2]=s[t+640>>2],n=c[r+16|0],e=0,(i=c[r+7|0])?(lr(i,t+96|0),n=li(s[t+220>>2]),(0|(i=s[t+224>>2]))<=0||(e=li(i))):n=s[129280+(n<<2)>>2],s[36455]==s[36454]&&(s[36455]=s[50758]),i=(i=15&p)>>>0<2?1:i>>>0>6?3:2;r:{C:switch(c[l+17|0]-3|0){case 2:case 4:u=c[r+19|0],l=s[50758],s[36425]=l,s[36441]=0,s[(l=216192+(l<<4)|0)+12>>2]=u,s[l+8>>2]=e,s[l>>2]=8,s[l+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,u=c[r+22|0],l=c[r+21|0],(0|(e=s[36440]))<=0||(0|(p=s[36424]))<0||s[(p=216192+(p<<4)|0)+4>>2]||(s[p+4>>2]=e),e=s[50758],s[36424]=e,s[36440]=0,s[(e=216192+(e<<4)|0)>>2]=9,s[e+4>>2]=0,u|=l<<16,l=(0|l)==255,s[e+12>>2]=l?3604556:u,s[e+8>>2]=l?g:n,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,me(f,1,t+48|0,r,i);break r;case 0:case 5:u=c[r+19|0],l=s[50758],s[36425]=l,s[36441]=0,s[(l=216192+(l<<4)|0)+12>>2]=u,s[l+8>>2]=e,s[l>>2]=8,s[l+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,me(f,1,t+48|0,r,i),u=c[r+22|0],l=c[r+21|0],(0|(e=s[36440]))<=0||(0|(p=s[36424]))<0||s[(p=216192+(p<<4)|0)+4>>2]||(s[p+4>>2]=e),e=s[50758],s[36424]=e,s[36440]=0,s[(e=216192+(e<<4)|0)>>2]=9,s[e+4>>2]=0,u|=l<<16,l=(0|l)==255,s[e+12>>2]=l?3604556:u,s[e+8>>2]=l?g:n,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0;break r;default:break C}u?(u=c[r+22|0],(0|(l=s[36440]))<=0||(0|(p=s[36424]))<0||s[(p=216192+(p<<4)|0)+4>>2]||(s[p+4>>2]=l),l=s[50758],s[36424]=l,s[36440]=0,s[(l=216192+(l<<4)|0)>>2]=9,s[l+4>>2]=0,s[l+12>>2]=(u|u<<16)-983040,s[l+8>>2]=C,l=s[50758]+1|0,s[50758]=(0|l)<=169?l:0,u=c[r+19|0],l=s[50758],s[36425]=l,s[36441]=0,s[(l=216192+(l<<4)|0)>>2]=8,s[l+4>>2]=0,s[l+12>>2]=u-1,s[l+8>>2]=e,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,me(f,1,t+48|0,r,i),l=c[r+21|0],u=c[r+22|0],(0|(e=s[36440]))<=0||(0|(p=s[36424]))<0||s[(p=216192+(p<<4)|0)+4>>2]||(s[p+4>>2]=e),e=s[50758],s[36424]=e,s[36440]=0,s[(e=216192+(e<<4)|0)>>2]=9,s[e+4>>2]=0,u|=l<<16,l=(0|l)==255,s[e+12>>2]=l?3604556:u,s[e+8>>2]=l?g:n,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0):(1&a[0|r]||(u=c[r+19|0],l=s[50758],s[36425]=l,s[36441]=0,s[(l=216192+(l<<4)|0)+12>>2]=u,s[l+8>>2]=e,s[l>>2]=8,s[l+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,u=c[r+22|0],l=c[r+21|0],(0|(e=s[36440]))<=0||(0|(p=s[36424]))<0||s[(p=216192+(p<<4)|0)+4>>2]||(s[p+4>>2]=e),e=s[50758],s[36424]=e,s[36440]=0,s[(e=216192+(e<<4)|0)>>2]=9,s[e+4>>2]=0,u|=l<<16,l=(0|l)==255,s[e+12>>2]=l?3604556:u,s[e+8>>2]=l?g:n,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0),me(f,1,t+48|0,r,i))}!s[47198]|1^m||(gt(t+704|0,s[r+8>>2],r,y,0),(0|((0|(e=s[50757]-s[50758]|0))<=0?e+170:e))<6||(n=s[36445],e=216192+(s[50758]<<4)|0,s[e>>2]=1802,s[e+4>>2]=16777215&n,n=s[t+708>>2],s[e+8>>2]=s[t+704>>2],s[e+12>>2]=n,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0)),s[t+56>>2]=s[t+620>>2],s[t+84>>2]=0,s[t+88>>2]=0,s[t+64>>2]=s[t+640>>2],n=s[t+632>>2],s[t+68>>2]=n,e=S;r:{if(!n&&(!c[d+17|0]||(s[t+72>>2]=0,xe(0,0,d,t+248|0,0),s[t+52>>2]=1,e=s[t+368>>2],s[t+84>>2]=s[t+364>>2],s[t+88>>2]=e,n=s[t+328>>2],s[t+68>>2]=n,e=x,!n)))break r;s[t+72>>2]=s[e>>2]}me(f,2,t+48|0,r,i)}if(e=s[36442]+1|0,s[36442]=e,(0|e)>997)break e;if(!(s[36423]>(0|e)))break}(0|(e=s[36440]))<=0||(0|(n=s[36424]))<0||(s[(n=216192+(n<<4)|0)+4>>2]||(s[n+4>>2]=e),s[36440]=0),s[36426]=0,s[36439]=-1,s[36455]=s[50758],Te(),s[36427]=-1,e=0,s[36423]<=0||(n=s[47568],i=s[33284],(0|((0|(e=s[50757]-s[50758]|0))<=0?e+170:e))>=6&&(e=216192+(s[50758]<<4)|0,s[e>>2]=1290,s[e+8>>2]=n,s[e+4>>2]=16777215&i,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0),s[36423]=0,e=0)}return z=t+720|0,e}function pe(e,t,n,r){var i,o=0,u=0,d=0,f=0,p=0,h=0,_=0,b=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0,P=0,F=0,I=0,L=0,ee=0;z=i=z-48|0;A:{if(n>>>0<=2){for(P=s[(n<<=2)+124732>>2],F=s[n+124720>>2];(0|(n=s[t+4>>2]))==s[t+104>>2]?n=Ot(t):(s[t+4>>2]=n+1,n=c[0|n]),(0|n)==32|n-9>>>0<5;);S=1;e:{g:switch(n-43|0){case 0:case 2:break g;default:break e}S=(0|n)==45?-1:1,(0|(n=s[t+4>>2]))==s[t+104>>2]?n=Ot(t):(s[t+4>>2]=n+1,n=c[0|n])}e:{g:{for(;;){if(a[d+84056|0]==(32|n)){if(d>>>0>6||((0|(n=s[t+4>>2]))==s[t+104>>2]?n=Ot(t):(s[t+4>>2]=n+1,n=c[0|n])),(0|(d=d+1|0))!=8)continue;break g}break}if((0|d)!=3){if((0|d)==8)break g;if(!r|d>>>0<4)break e;if((0|d)==8)break g}if((0|(n=s[t+116>>2]))>0|(0|n)>=0&&(s[t+4>>2]=s[t+4>>2]-1),!(!r|d>>>0<4))for(n=(0|n)<0;n||(s[t+4>>2]=s[t+4>>2]-1),(d=d-1|0)>>>0>3;);}z=_=z-16|0,m(y(y(0|S)*y(1/0))),(t=2147483647&(f=l(2)))-8388608>>>0<=2130706431?(n=t,n<<=25,r=(t=t>>>7|0)+1065353216|0):(n=f<<25,r=f>>>7|2147418112,t>>>0>=2139095040||(n=0,r=0,t&&(rn(_,n=t,0,0,0,(t=x(t))+81|0),h=s[_>>2],p=s[_+4>>2],n=s[_+8>>2],r=65536^s[_+12>>2]|16265-t<<16))),s[i>>2]=h,s[i+4>>2]=p,s[i+8>>2]=n,s[i+12>>2]=-2147483648&f|r,z=_+16|0,h=s[i+8>>2],p=s[i+12>>2],f=s[i>>2],b=s[i+4>>2];break A}e:{g:{r:if(!d){for(d=0;;){if(a[d+84473|0]!=(32|n))break r;if(d>>>0>1||((0|(n=s[t+4>>2]))==s[t+104>>2]?n=Ot(t):(s[t+4>>2]=n+1,n=c[0|n])),(0|(d=d+1|0))==3)break}break g}r:switch(0|d){case 0:if((0|n)==48){if((0|(d=s[t+4>>2]))==s[t+104>>2]?d=Ot(t):(s[t+4>>2]=d+1,d=c[0|d]),(-33&d)==88){z=u=z-432|0,(0|(n=s[t+4>>2]))==s[t+104>>2]?d=Ot(t):(s[t+4>>2]=n+1,d=c[0|n]);C:{a:{for(;;){if((0|d)!=48){if((0|d)!=46)break C;if((0|(n=s[t+4>>2]))!=s[t+104>>2]){s[t+4>>2]=n+1,d=c[0|n];break a}break}(0|(n=s[t+4>>2]))==s[t+104>>2]?(N=1,d=Ot(t)):(N=1,s[t+4>>2]=n+1,d=c[0|n])}d=Ot(t)}if(T=1,(0|d)==48){for(;E=(n=E)-1|0,D=D-!n|0,(0|(n=s[t+4>>2]))==s[t+104>>2]?d=Ot(t):(s[t+4>>2]=n+1,d=c[0|n]),(0|d)==48;);N=1}}for(b=1073676288;;){C:{n=32|d;a:{if(!((I=d-48|0)>>>0<10)){if((0|d)!=46&n-97>>>0>=6)break C;if((0|d)==46){if(T)break C;T=1,E=h,D=p;break a}}n=(0|d)>57?n-87|0:I,(0|p)<=0&h>>>0<=7|(0|p)<0?o=n+(o<<4)|0:!p&h>>>0<=28?(Un(u+48|0,n),ke(u+32|0,j,M,f,b,0,0,0,1073414144),j=s[u+32>>2],M=s[u+36>>2],f=s[u+40>>2],b=s[u+44>>2],ke(u+16|0,s[u+48>>2],s[u+52>>2],s[u+56>>2],s[u+60>>2],j,M,f,b),Le(u,s[u+16>>2],s[u+20>>2],s[u+24>>2],s[u+28>>2],_,w,k,A),k=s[u+8>>2],A=s[u+12>>2],_=s[u>>2],w=s[u+4>>2]):C|!n||(ke(u+80|0,j,M,f,b,0,0,0,1073610752),Le(u- -64|0,s[u+80>>2],s[u+84>>2],s[u+88>>2],s[u+92>>2],_,w,k,A),k=s[u+72>>2],A=s[u+76>>2],C=1,_=s[u+64>>2],w=s[u+68>>2]),p=(h=h+1|0)?p:p+1|0,N=1}(0|(n=s[t+4>>2]))==s[t+104>>2]?d=Ot(t):(s[t+4>>2]=n+1,d=c[0|n]);continue}break}C:if(N){if((0|p)<=0&h>>>0<=7|(0|p)<0)for(f=h,b=p;o<<=4,(0|(f=f+1|0))!=8|(b=f?b:b+1|0););a:{I:{f:{if((-33&d)==80){if(f=at(t,r),b=n=B,f|(0|n)!=-2147483648)break a;if(r){if((0|(n=s[t+116>>2]))>0|(0|n)>=0)break f;break I}_=0,w=0,tr(t,0,0),n=0,t=0;break C}if(f=0,b=0,s[t+116>>2]<0)break a}s[t+4>>2]=s[t+4>>2]-1}f=0,b=0}if(o)if(n=f+((t=T?E:h)<<2)|0,t=(p=(T?D:p)<<2|t>>>30)+b|0,(h=n-32|0)>>>0>0-P>>>0&(0|(t=p=(n>>>0>>0?t+1|0:t)-(n>>>0<32)|0))>=0|(0|t)>0)s[56798]=68,Un(u+160|0,S),ke(u+144|0,s[u+160>>2],s[u+164>>2],s[u+168>>2],s[u+172>>2],-1,-1,-1,2147418111),ke(u+128|0,s[u+144>>2],s[u+148>>2],s[u+152>>2],s[u+156>>2],-1,-1,-1,2147418111),_=s[u+128>>2],w=s[u+132>>2],n=s[u+140>>2],t=s[u+136>>2];else if((0|p)>=(0|(n=(t=P-226|0)>>31))&t>>>0<=h>>>0|(0|n)<(0|p)){if((0|o)>=0)for(;Le(u+416|0,_,w,k,A,0,0,0,-1073807360),Le(u+400|0,_,w,k,A,(t=n=(0|(t=fn(_,w,k,A,1073610752)))>=0)?s[u+416>>2]:_,t?s[u+420>>2]:w,t?s[u+424>>2]:k,t?s[u+428>>2]:A),h=(t=h)-1|0,p=p-!t|0,k=s[u+408>>2],A=s[u+412>>2],_=s[u+400>>2],w=s[u+404>>2],(0|(o=n|o<<1))>=0;);t=p-((P>>31)+(h>>>0

>>0)|0)|0,(0|(n=(n=32+(h-P|0)|0)>>>0>>0&(0|(t=n>>>0<32?t+1|0:t))<=0|(0|t)<0?(0|n)>0?n:0:F))>=113?(Un(u+384|0,S),E=s[u+392>>2],D=s[u+396>>2],j=s[u+384>>2],M=s[u+388>>2],f=0,t=0):(Gt(u+352|0,An(1,144-n|0)),Un(u+336|0,S),j=s[u+336>>2],M=s[u+340>>2],E=s[u+344>>2],D=s[u+348>>2],Zr(u+368|0,s[u+352>>2],s[u+356>>2],s[u+360>>2],s[u+364>>2],j,M,E,D),O=s[u+376>>2],L=s[u+380>>2],f=s[u+372>>2],t=s[u+368>>2]),Zn(u+320|0,(r=!(1&o)&!!(0|Ht(_,w,k,A,0,0,0,0))&(0|n)<32)+o|0),ke(u+304|0,j,M,E,D,s[u+320>>2],s[u+324>>2],s[u+328>>2],s[u+332>>2]),n=t,Le(u+272|0,s[u+304>>2],s[u+308>>2],s[u+312>>2],s[u+316>>2],t,f,O,L),ke(u+288|0,j,M,E,D,(t=r)?0:_,t?0:w,t?0:k,t?0:A),Le(u+256|0,s[u+288>>2],s[u+292>>2],s[u+296>>2],s[u+300>>2],s[u+272>>2],s[u+276>>2],s[u+280>>2],s[u+284>>2]),Dr(u+240|0,s[u+256>>2],s[u+260>>2],s[u+264>>2],s[u+268>>2],n,f,O,L),Ht(t=s[u+240>>2],r=s[u+244>>2],n=s[u+248>>2],f=s[u+252>>2],0,0,0,0)||(s[56798]=68),jt(u+224|0,t,r,n,f,h),_=s[u+224>>2],w=s[u+228>>2],n=s[u+236>>2],t=s[u+232>>2]}else s[56798]=68,Un(u+208|0,S),ke(u+192|0,s[u+208>>2],s[u+212>>2],s[u+216>>2],s[u+220>>2],0,0,0,65536),ke(u+176|0,s[u+192>>2],s[u+196>>2],s[u+200>>2],s[u+204>>2],0,0,0,65536),_=s[u+176>>2],w=s[u+180>>2],n=s[u+188>>2],t=s[u+184>>2];else Gt(u+112|0,0*(0|S)),_=s[u+112>>2],w=s[u+116>>2],n=s[u+124>>2],t=s[u+120>>2]}else{a:{I:{if((0|(n=s[t+116>>2]))>0|(0|n)>=0){if(n=s[t+4>>2],s[t+4>>2]=n-1,!r)break I;if(s[t+4>>2]=n-2,!T)break a;s[t+4>>2]=n-3;break a}if(r)break a}tr(t,0,0)}Gt(u+96|0,0*(0|S)),_=s[u+96>>2],w=s[u+100>>2],n=s[u+108>>2],t=s[u+104>>2]}s[i+16>>2]=_,s[i+20>>2]=w,s[i+24>>2]=t,s[i+28>>2]=n,z=u+432|0,h=s[i+24>>2],p=s[i+28>>2],f=s[i+16>>2],b=s[i+20>>2];break A}s[t+116>>2]<0||(s[t+4>>2]=s[t+4>>2]-1)}d=t,O=S,u=r,t=0,S=0,z=o=z-8976|0,L=(I=0-P|0)-F|0;C:{a:{for(;;){if((0|n)!=48){if((0|n)!=46)break C;if((0|(n=s[d+4>>2]))!=s[d+104>>2]){s[d+4>>2]=n+1,n=c[0|n];break a}break}(0|(t=s[d+4>>2]))==s[d+104>>2]?n=Ot(d):(s[d+4>>2]=t+1,n=c[0|t]),t=1}n=Ot(d)}if(C=1,(0|n)==48){for(;h=(t=h)-1|0,p=p-!t|0,(0|(t=s[d+4>>2]))==s[d+104>>2]?n=Ot(d):(s[d+4>>2]=t+1,n=c[0|t]),(0|n)==48;);t=1}}s[o+784>>2]=0;C:{a:{I:{f:{i:{if((r=(0|n)==46)|(_=n-48|0)>>>0<=9)for(;;){b:{if(1&r){if(!C){h=f,p=b,C=1;break b}r=!t;break i}b=(f=f+1|0)?b:b+1|0,(0|S)<=2044?(N=(0|n)==48?N:f,t=(o+784|0)+(S<<2)|0,T&&(_=(v(s[t>>2],10)+n|0)-48|0),s[t>>2]=_,t=1,T=(n=(0|(r=T+1|0))==9)?0:r,S=n+S|0):(0|n)!=48&&(s[o+8960>>2]=1|s[o+8960>>2],N=18396)}if((0|(n=s[d+4>>2]))==s[d+104>>2]?n=Ot(d):(s[d+4>>2]=n+1,n=c[0|n]),!((r=(0|n)==46)|(_=n-48|0)>>>0<10))break}if(h=C?h:f,p=C?p:b,!(!t|(-33&n)!=69)){if(_=at(d,u),w=t=B,!(_|(0|t)!=-2147483648)){if(!u)break I;_=0,w=0,s[d+116>>2]<0||(s[d+4>>2]=s[d+4>>2]-1)}p=p+w|0,p=(h=h+_|0)>>>0<_>>>0?p+1|0:p;break a}if(r=!t,(0|n)<0)break f}s[d+116>>2]<0||(s[d+4>>2]=s[d+4>>2]-1)}if(!r)break a;s[56798]=28}f=0,b=0,tr(d,0,0),n=0,t=0;break C}if(t=s[o+784>>2])if(f>>>0>9&(0|b)>=0|(0|b)>0|(0|f)!=(0|h)|(0|p)!=(0|b)|(t>>>F|0?(0|F)<=30:0))if(h>>>0>I>>>1>>>0&(0|p)>=0|(0|p)>0)s[56798]=68,Un(o+96|0,O),ke(o+80|0,s[o+96>>2],s[o+100>>2],s[o+104>>2],s[o+108>>2],-1,-1,-1,2147418111),ke(o- -64|0,s[o+80>>2],s[o+84>>2],s[o+88>>2],s[o+92>>2],-1,-1,-1,2147418111),f=s[o+64>>2],b=s[o+68>>2],n=s[o+76>>2],t=s[o+72>>2];else if((n=h>>>0<(t=P-226|0)>>>0)&(0|p)<=(0|(t>>=31))|(0|t)>(0|p))s[56798]=68,Un(o+144|0,O),ke(o+128|0,s[o+144>>2],s[o+148>>2],s[o+152>>2],s[o+156>>2],0,0,0,65536),ke(o+112|0,s[o+128>>2],s[o+132>>2],s[o+136>>2],s[o+140>>2],0,0,0,65536),f=s[o+112>>2],b=s[o+116>>2],n=s[o+124>>2],t=s[o+120>>2];else{if(T){if((0|T)<=8){for(d=s[(t=(o+784|0)+(S<<2)|0)>>2];d=v(d,10),(0|(T=T+1|0))!=9;);s[t>>2]=d}S=S+1|0}if(C=h,!((0|N)>(0|h)|(0|N)>=9|(0|h)>17)){if((0|C)==9){Un(o+192|0,O),Zn(o+176|0,s[o+784>>2]),ke(o+160|0,s[o+192>>2],s[o+196>>2],s[o+200>>2],s[o+204>>2],s[o+176>>2],s[o+180>>2],s[o+184>>2],s[o+188>>2]),f=s[o+160>>2],b=s[o+164>>2],n=s[o+172>>2],t=s[o+168>>2];break C}if((0|C)<=8){Un(o+272|0,O),Zn(o+256|0,s[o+784>>2]),ke(o+240|0,s[o+272>>2],s[o+276>>2],s[o+280>>2],s[o+284>>2],s[o+256>>2],s[o+260>>2],s[o+264>>2],s[o+268>>2]),Un(o+224|0,s[124720+(0-C<<2)>>2]),be(o+208|0,s[o+240>>2],s[o+244>>2],s[o+248>>2],s[o+252>>2],s[o+224>>2],s[o+228>>2],s[o+232>>2],s[o+236>>2]),f=s[o+208>>2],b=s[o+212>>2],n=s[o+220>>2],t=s[o+216>>2];break C}if(t=27+(v(C,-3)+F|0)|0,!((n=s[o+784>>2])>>>t|0&&(0|t)<=30)){Un(o+352|0,O),Zn(o+336|0,n),ke(o+320|0,s[o+352>>2],s[o+356>>2],s[o+360>>2],s[o+364>>2],s[o+336>>2],s[o+340>>2],s[o+344>>2],s[o+348>>2]),Un(o+304|0,s[124648+(C<<2)>>2]),ke(o+288|0,s[o+320>>2],s[o+324>>2],s[o+328>>2],s[o+332>>2],s[o+304>>2],s[o+308>>2],s[o+312>>2],s[o+316>>2]),f=s[o+288>>2],b=s[o+292>>2],n=s[o+300>>2],t=s[o+296>>2];break C}}for(;!s[(o+784|0)+((S=(n=S)-1|0)<<2)>>2];);if(T=0,t=(0|C)%9|0){if(r=0,t=(0|C)<0?t+9|0:t,n){for(p=1e9/(0|(h=s[124720+(0-t<<2)>>2]))|0,_=0,d=0;f=(f=_)+(S=((b=s[(_=(o+784|0)+(d<<2)|0)>>2])>>>0)/(h>>>0)|0)|0,s[_>>2]=f,r=(f=!f&(0|r)==(0|d))?r+1&2047:r,C=f?C-9|0:C,_=v(p,b-v(h,S)|0),(0|(d=d+1|0))!=(0|n););_&&(s[(o+784|0)+(n<<2)>>2]=_,n=n+1|0)}else n=0;C=9+(C-t|0)|0}else r=0;for(;;){d=(o+784|0)+(r<<2)|0;a:{for(;;){if(((0|C)!=36|g[d>>2]>=10384593)&(0|C)>=36)break a;for(S=n+2047|0,_=0,t=n;n=t,h=_,_=(t=s[(S=(o+784|0)+((f=2047&S)<<2)|0)>>2])<<29,t=b=t>>>3|0,!(p=(h=h+_|0)>>>0<_>>>0?t+1|0:t)&h>>>0<1000000001?_=0:h=(t=h)-hr(_=Fi(t,p,1e9),B,1e9,0)|0,s[S>>2]=h,t=(0|f)!=(n-1&2047)||(0|r)==(0|f)||h?n:f,S=f-1|0,(0|r)!=(0|f););if(T=T-29|0,_)break}(0|(r=r-1&2047))==(0|t)&&(d=n=(h=o+784|0)+((t+2046&2047)<<2)|0,p=s[n>>2],n=t-1&2047,s[d>>2]=p|s[h+(n<<2)>>2]),C=C+9|0,s[(o+784|0)+(r<<2)>>2]=_;continue}break}a:{I:for(;;){for(h=n+1&2047,_=(o+784|0)+((n-1&2047)<<2)|0;;){f=(0|C)>45?9:1;f:{for(;;){t=r,d=0;i:{for(;;){if((0|(r=t+d&2047))!=(0|n)&&!((r=s[(o+784|0)+(r<<2)>>2])>>>0<(p=s[124672+(d<<2)>>2])>>>0)){if(r>>>0>p>>>0)break i;if((0|(d=d+1|0))!=4)continue}break}if((0|C)==36){for(h=0,p=0,d=0,f=0,b=0;(0|(r=t+d&2047))==(0|n)&&(s[780+(o+((n=n+1&2047)<<2)|0)>>2]=0),Zn(o+768|0,s[(o+784|0)+(r<<2)>>2]),ke(o+752|0,h,p,f,b,0,0,1342177280,1075633366),Le(o+736|0,s[o+752>>2],s[o+756>>2],s[o+760>>2],s[o+764>>2],s[o+768>>2],s[o+772>>2],s[o+776>>2],s[o+780>>2]),f=s[o+744>>2],b=s[o+748>>2],h=s[o+736>>2],p=s[o+740>>2],(0|(d=d+1|0))!=4;);if(Un(o+720|0,O),ke(o+704|0,h,p,f,b,s[o+720>>2],s[o+724>>2],s[o+728>>2],s[o+732>>2]),f=s[o+712>>2],b=s[o+716>>2],h=0,p=0,_=s[o+704>>2],w=s[o+708>>2],(0|(r=(S=(0|(d=(u=T+113|0)-P|0))<(0|F))?(0|d)>0?d:0:F))<=112)break f;break a}}if(T=f+T|0,r=n,(0|t)!=(0|n))break}for(b=1e9>>>f|0,S=~(-1<>2])>>>f|0)|0,s[d>>2]=p,r=(p=!p&(0|t)==(0|r))?r+1&2047:r,C=p?C-9|0:C,d=v(b,u&S),(0|n)!=(0|(t=t+1&2047)););if(!d)continue;if((0|r)!=(0|h)){s[(o+784|0)+(n<<2)>>2]=d,n=h;continue I}s[_>>2]=1|s[_>>2];continue}break}break}Gt(o+656|0,An(1,225-r|0)),Zr(o+688|0,s[o+656>>2],s[o+660>>2],s[o+664>>2],s[o+668>>2],_,w,f,b),j=s[o+696>>2],M=s[o+700>>2],k=s[o+688>>2],A=s[o+692>>2],Gt(o+640|0,An(1,113-r|0)),Ke(o+672|0,_,w,f,b,s[o+640>>2],s[o+644>>2],s[o+648>>2],s[o+652>>2]),Dr(o+624|0,_,w,f,b,h=s[o+672>>2],p=s[o+676>>2],E=s[o+680>>2],D=s[o+684>>2]),Le(o+608|0,k,A,j,M,s[o+624>>2],s[o+628>>2],s[o+632>>2],s[o+636>>2]),f=s[o+616>>2],b=s[o+620>>2],_=s[o+608>>2],w=s[o+612>>2]}if((0|(C=t+4&2047))!=(0|n)){a:if((C=s[(o+784|0)+(C<<2)>>2])>>>0<=499999999){if(!C&(t+5&2047)==(0|n))break a;Gt(o+496|0,.25*(0|O)),Le(o+480|0,h,p,E,D,s[o+496>>2],s[o+500>>2],s[o+504>>2],s[o+508>>2]),E=s[o+488>>2],D=s[o+492>>2],h=s[o+480>>2],p=s[o+484>>2]}else(0|C)==5e8?(ee=+(0|O),(t+5&2047)==(0|n)?(Gt(o+528|0,.5*ee),Le(o+512|0,h,p,E,D,s[o+528>>2],s[o+532>>2],s[o+536>>2],s[o+540>>2]),E=s[o+520>>2],D=s[o+524>>2],h=s[o+512>>2],p=s[o+516>>2]):(Gt(o+560|0,.75*ee),Le(o+544|0,h,p,E,D,s[o+560>>2],s[o+564>>2],s[o+568>>2],s[o+572>>2]),E=s[o+552>>2],D=s[o+556>>2],h=s[o+544>>2],p=s[o+548>>2])):(Gt(o+592|0,.75*(0|O)),Le(o+576|0,h,p,E,D,s[o+592>>2],s[o+596>>2],s[o+600>>2],s[o+604>>2]),E=s[o+584>>2],D=s[o+588>>2],h=s[o+576>>2],p=s[o+580>>2]);(0|r)>111||(Ke(o+464|0,h,p,E,D,0,0,0,1073676288),Ht(s[o+464>>2],s[o+468>>2],s[o+472>>2],s[o+476>>2],0,0,0,0)||(Le(o+448|0,h,p,E,D,0,0,0,1073676288),E=s[o+456>>2],D=s[o+460>>2],h=s[o+448>>2],p=s[o+452>>2]))}Le(o+432|0,_,w,f,b,h,p,E,D),Dr(o+416|0,s[o+432>>2],s[o+436>>2],s[o+440>>2],s[o+444>>2],k,A,j,M),f=s[o+424>>2],b=s[o+428>>2],_=s[o+416>>2],w=s[o+420>>2],(L-2|0)>=(2147483647&u)||(s[o+408>>2]=f,s[o+412>>2]=2147483647&b,s[o+400>>2]=_,s[o+404>>2]=w,ke(o+384|0,_,w,f,b,0,0,0,1073610752),f=(t=(0|(t=fn(s[o+400>>2],s[o+404>>2],s[o+408>>2],s[o+412>>2],1081081856)))>=0)?s[o+392>>2]:f,b=t?s[o+396>>2]:b,_=t?s[o+384>>2]:_,w=t?s[o+388>>2]:w,T=t+T|0,!(!!(0|Ht(h,p,E,D,0,0,0,0))&(t?S&(0|r)!=(0|d):S))&(T+110|0)<=(0|L)||(s[56798]=68)),jt(o+368|0,_,w,f,b,T),f=s[o+368>>2],b=s[o+372>>2],n=s[o+380>>2],t=s[o+376>>2]}else Un(o+48|0,O),Zn(o+32|0,t),ke(o+16|0,s[o+48>>2],s[o+52>>2],s[o+56>>2],s[o+60>>2],s[o+32>>2],s[o+36>>2],s[o+40>>2],s[o+44>>2]),f=s[o+16>>2],b=s[o+20>>2],n=s[o+28>>2],t=s[o+24>>2];else Gt(o,0*(0|O)),f=s[o>>2],b=s[o+4>>2],n=s[o+12>>2],t=s[o+8>>2]}s[i+40>>2]=t,s[i+44>>2]=n,s[i+32>>2]=f,s[i+36>>2]=b,z=o+8976|0,h=s[i+40>>2],p=s[i+44>>2],f=s[i+32>>2],b=s[i+36>>2];break A;case 3:break g;default:break r}(0|(n=s[t+116>>2]))>0|(0|n)>=0&&(s[t+4>>2]=s[t+4>>2]-1);break e}if((0|(n=s[t+4>>2]))==s[t+104>>2]?n=Ot(t):(s[t+4>>2]=n+1,n=c[0|n]),(0|n)!=40){if(p=2147450880,s[t+116>>2]<0)break A;s[t+4>>2]=s[t+4>>2]-1;break A}for(d=1;(0|(n=s[t+4>>2]))==s[t+104>>2]?n=Ot(t):(s[t+4>>2]=n+1,n=c[0|n]),n-48>>>0<10|n-65>>>0<26|(0|n)==95||!(n-97>>>0>=26);)d=d+1|0;if(p=2147450880,(0|n)==41)break A;(0|(n=s[t+116>>2]))>0|(0|n)>=0&&(s[t+4>>2]=s[t+4>>2]-1);g:{if(r){if(d)break g;break A}break e}for(;d=d-1|0,(0|n)>0|(0|n)>=0&&(s[t+4>>2]=s[t+4>>2]-1),d;);break A}s[56798]=28,tr(t,0,0)}p=0}s[e>>2]=f,s[e+4>>2]=b,s[e+8>>2]=h,s[e+12>>2]=p,z=i+48|0}function me(e,t,n,r,i){var l,u=0,d=0,f=0,p=0,m=0,g=0,_=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0;if(z=l=z-112|0,s[n+8>>2]){j=s[50754]/70|0,x=(g=s[r+12>>2])||256;A:if((0|t)!=2){if((0|t)==1){e:if(c[e+11|0]!=3)switch(c[r-15|0]-3|0){case 0:case 5:break e;default:break A}x=(0|(g=s[s[47192]+44>>2]))<(0|x)?x:g}}else{if((0|(g=s[s[47192]+80>>2]))<=0|!(8&c[0|r]|g>>>0<=c[e+14|0]|32&c[e+6|0]))break A;j<<=1}if(s[36436]=0,w=e,M=t,m=r,z=b=z-16|0,e=s[34460]+s[n+8>>2]|0,t=(t=c[e+2|0])>>>0>=24?24:t,s[b+12>>2]=t,d=s[n+12>>2]+s[n+24>>2]|0,s[36422]=d,t){for(g=e+4|0,u=1&o[e+4>>1];e=145488+(p<<3)|0,r=g+(u?p<<6:v(p,44))|0,s[e+4>>2]=r,y=h[r>>1],o[e+2>>1]=y,o[e>>1]=c[r+16|0],f=2&y?p:f,(0|(p=p+1|0))!=(0|t););g=145488,(0|f)<=0||((0|M)==1?(t=f+1|0,s[b+12>>2]=t,g=145488):(t=t-f|0,s[b+12>>2]=t,g=145488+(f<<3)|0))}else t=0,g=145488;if(!(!s[n+4>>2]|s[n+20>>2]|c[w+11|0]!=2)){if(u=s[n+36>>2],r=s[n+40>>2],e=0,(0|(t=s[b+12>>2]))>=2){f=u>>>12|0,y=r>>>26&7,T=r>>>18&248,S=v(C=63&r,50),D=63&(O=u>>>6|0),p=u<<1&126,k=v(r>>>16&31,50)-750|0,A=v(r>>>11&31,50)-750|0,E=v(r>>>6&31,50)-750|0;A:{e:if((0|M)!=1){if(!(f|C))break A;if(8&f?(t=s[4+(g+((d=t-1|0)<<3)|0)>>2],o[t>>1]<0?e=t:(e=(0|(e=s[44469]+1|0))<=169?e:0,s[44469]=e,d=h[t+20>>1]|h[t+22>>1]<<16,e=177888+(e<<6)|0,u=h[t+16>>1]|h[t+18>>1]<<16,o[e+16>>1]=u,o[e+18>>1]=u>>>16,o[e+20>>1]=d,o[e+22>>1]=d>>>16,d=h[t+4>>1]|h[t+6>>1]<<16,u=h[t>>1]|h[t+2>>1]<<16,o[e>>1]=u,o[e+2>>1]=u>>>16,o[e+4>>1]=d,o[e+6>>1]=d>>>16,d=h[t+12>>1]|h[t+14>>1]<<16,u=h[t+8>>1]|h[t+10>>1]<<16,o[e+8>>1]=u,o[e+10>>1]=u>>>16,o[e+12>>1]=d,o[e+14>>1]=d>>>16,d=h[t+28>>1]|h[t+30>>1]<<16,u=h[t+24>>1]|h[t+26>>1]<<16,o[e+24>>1]=u,o[e+26>>1]=u>>>16,o[e+28>>1]=d,o[e+30>>1]=d>>>16,d=h[t+36>>1]|h[t+38>>1]<<16,u=h[t+32>>1]|h[t+34>>1]<<16,o[e+32>>1]=u,o[e+34>>1]=u>>>16,o[e+36>>1]=d,o[e+38>>1]=d>>>16,d=h[t+44>>1]|h[t+46>>1]<<16,u=h[t+40>>1]|h[t+42>>1]<<16,o[e+40>>1]=u,o[e+42>>1]=u>>>16,o[e+44>>1]=d,o[e+46>>1]=d>>>16,d=h[t+52>>1]|h[t+54>>1]<<16,u=h[t+48>>1]|h[t+50>>1]<<16,o[e+48>>1]=u,o[e+50>>1]=u>>>16,o[e+52>>1]=d,o[e+54>>1]=d>>>16,d=h[t+60>>1]|h[t+62>>1]<<16,t=h[t+56>>1]|h[t+58>>1]<<16,o[e+56>>1]=t,o[e+58>>1]=t>>>16,o[e+60>>1]=d,o[e+62>>1]=d>>>16,a[e+16|0]=0,o[e>>1]=32768|h[e>>1],d=s[b+12>>2]-1|0),s[4+(g+(d<<3)|0)>>2]=e,t=1792,(0|(d=o[e+4>>1]))<300||(t=1536,d>>>0<400||(t=d>>>0<500?1280:1024)),s[36436]=t,u=35):(s[b+12>>2]=t+1,o[(e=(d=g+(t<<3)|0)-8|0)>>1]=p,t=s[e+4>>2],e=(0|(e=s[44469]+1|0))<=169?e:0,s[44469]=e,(e=(O=e<<6)+177888|0)&&(u=h[t+4>>1]|h[t+6>>1]<<16,_=h[t>>1]|h[t+2>>1]<<16,o[e>>1]=_,o[e+2>>1]=_>>>16,o[e+4>>1]=u,o[e+6>>1]=u>>>16,u=h[t+60>>1]|h[t+62>>1]<<16,_=h[t+56>>1]|h[t+58>>1]<<16,o[e+56>>1]=_,o[e+58>>1]=_>>>16,o[e+60>>1]=u,o[e+62>>1]=u>>>16,u=h[t+52>>1]|h[t+54>>1]<<16,_=h[t+48>>1]|h[t+50>>1]<<16,o[e+48>>1]=_,o[e+50>>1]=_>>>16,o[e+52>>1]=u,o[e+54>>1]=u>>>16,u=h[t+44>>1]|h[t+46>>1]<<16,_=h[t+40>>1]|h[t+42>>1]<<16,o[e+40>>1]=_,o[e+42>>1]=_>>>16,o[e+44>>1]=u,o[e+46>>1]=u>>>16,u=h[t+36>>1]|h[t+38>>1]<<16,_=h[t+32>>1]|h[t+34>>1]<<16,o[e+32>>1]=_,o[e+34>>1]=_>>>16,o[e+36>>1]=u,o[e+38>>1]=u>>>16,u=h[t+28>>1]|h[t+30>>1]<<16,_=h[t+24>>1]|h[t+26>>1]<<16,o[e+24>>1]=_,o[e+26>>1]=_>>>16,o[e+28>>1]=u,o[e+30>>1]=u>>>16,u=h[t+20>>1]|h[t+22>>1]<<16,_=h[t+16>>1]|h[t+18>>1]<<16,o[e+16>>1]=_,o[e+18>>1]=_>>>16,o[e+20>>1]=u,o[e+22>>1]=u>>>16,u=h[t+12>>1]|h[t+14>>1]<<16,t=h[t+8>>1]|h[t+10>>1]<<16,o[e+8>>1]=t,o[e+10>>1]=t>>>16,o[e+12>>1]=u,o[e+14>>1]=u>>>16,a[O+177904|0]=0,o[e>>1]=32768|h[e>>1]),o[d>>1]=0,s[d+4>>2]=e,p>>>0>=37&&(s[36422]=(p+s[36422]|0)-36),u=D<<1,C&&Et(e,S,E,A,y,k,T,f)),s[s[32972]+132>>2]||(t=c[e+17|0])&&(t=o[102896+(((0|(t=(u<<6>>>0)/(t>>>0)|0))>=199?199:t)<<1)>>1],a[e+18|0]=(0|v(t,c[e+18|0]))/512,a[e+19|0]=(0|v(t,c[e+19|0]))/512,a[e+20|0]=(0|v(t,c[e+20|0]))/512,a[e+21|0]=(0|v(t,c[e+21|0]))/512,a[e+22|0]=(0|v(t,c[e+22|0]))/512,a[e+23|0]=(0|v(t,c[e+23|0]))/512,a[e+24|0]=(0|v(t,c[e+24|0]))/512,a[e+25|0]=(0|v(t,c[e+25|0]))/512),r-536870912>>>0<=1073741823){if(y=s[44469],(0|(d=s[b+12>>2]))>0)for(e=v(r>>>29|0,10)+102854|0,T=o[e+4>>1],C=o[e+2>>1],S=o[e>>1],k=o[e+6>>1],A=o[e+8>>1],u=0;t=s[(E=g+(u<<3)|0)+4>>2],o[t>>1]<0?e=t:(e=(D=(y=(0|(e=y+1|0))<=169?e:0)<<6)+177888|0)?(r=h[t+4>>1]|h[t+6>>1]<<16,d=h[t>>1]|h[t+2>>1]<<16,o[e>>1]=d,o[e+2>>1]=d>>>16,o[e+4>>1]=r,o[e+6>>1]=r>>>16,r=h[t+60>>1]|h[t+62>>1]<<16,d=h[t+56>>1]|h[t+58>>1]<<16,o[e+56>>1]=d,o[e+58>>1]=d>>>16,o[e+60>>1]=r,o[e+62>>1]=r>>>16,r=h[t+52>>1]|h[t+54>>1]<<16,d=h[t+48>>1]|h[t+50>>1]<<16,o[e+48>>1]=d,o[e+50>>1]=d>>>16,o[e+52>>1]=r,o[e+54>>1]=r>>>16,r=h[t+44>>1]|h[t+46>>1]<<16,d=h[t+40>>1]|h[t+42>>1]<<16,o[e+40>>1]=d,o[e+42>>1]=d>>>16,o[e+44>>1]=r,o[e+46>>1]=r>>>16,r=h[t+36>>1]|h[t+38>>1]<<16,d=h[t+32>>1]|h[t+34>>1]<<16,o[e+32>>1]=d,o[e+34>>1]=d>>>16,o[e+36>>1]=r,o[e+38>>1]=r>>>16,r=h[t+28>>1]|h[t+30>>1]<<16,d=h[t+24>>1]|h[t+26>>1]<<16,o[e+24>>1]=d,o[e+26>>1]=d>>>16,o[e+28>>1]=r,o[e+30>>1]=r>>>16,r=h[t+20>>1]|h[t+22>>1]<<16,d=h[t+16>>1]|h[t+18>>1]<<16,o[e+16>>1]=d,o[e+18>>1]=d>>>16,o[e+20>>1]=r,o[e+22>>1]=r>>>16,r=h[t+12>>1]|h[t+14>>1]<<16,t=h[t+8>>1]|h[t+10>>1]<<16,o[e+8>>1]=t,o[e+10>>1]=t>>>16,o[e+12>>1]=r,o[e+14>>1]=r>>>16,a[D+177904|0]=0,o[e>>1]=32768|h[e>>1],d=s[b+12>>2]):e=0,s[E+4>>2]=e,o[e+8>>1]=(0|v(T,o[e+8>>1]))/256,o[e+6>>1]=(0|v(C,o[e+6>>1]))/256,o[e+4>>1]=(0|v(S,o[e+4>>1]))/256,o[e+12>>1]=(0|v(A,o[e+12>>1]))/256,o[e+10>>1]=(0|v(k,o[e+10>>1]))/256,(0|d)>(0|(u=u+1|0)););s[44469]=y}if(!e)break A}else{t=s[g+4>>2],(0|(d=o[t>>1]))<0?e=t:(r=(0|(r=s[44469]+1|0))<=169?r:0,s[44469]=r,(r=(d=r<<6)+177888|0)&&(e=h[t+4>>1]|h[t+6>>1]<<16,_=h[t>>1]|h[t+2>>1]<<16,o[r>>1]=_,o[r+2>>1]=_>>>16,o[r+4>>1]=e,o[r+6>>1]=e>>>16,e=h[t+60>>1]|h[t+62>>1]<<16,_=h[t+56>>1]|h[t+58>>1]<<16,o[r+56>>1]=_,o[r+58>>1]=_>>>16,o[r+60>>1]=e,o[r+62>>1]=e>>>16,e=h[t+52>>1]|h[t+54>>1]<<16,_=h[t+48>>1]|h[t+50>>1]<<16,o[r+48>>1]=_,o[r+50>>1]=_>>>16,o[r+52>>1]=e,o[r+54>>1]=e>>>16,e=h[t+44>>1]|h[t+46>>1]<<16,_=h[t+40>>1]|h[t+42>>1]<<16,o[r+40>>1]=_,o[r+42>>1]=_>>>16,o[r+44>>1]=e,o[r+46>>1]=e>>>16,e=h[t+36>>1]|h[t+38>>1]<<16,_=h[t+32>>1]|h[t+34>>1]<<16,o[r+32>>1]=_,o[r+34>>1]=_>>>16,o[r+36>>1]=e,o[r+38>>1]=e>>>16,e=h[t+28>>1]|h[t+30>>1]<<16,_=h[t+24>>1]|h[t+26>>1]<<16,o[r+24>>1]=_,o[r+26>>1]=_>>>16,o[r+28>>1]=e,o[r+30>>1]=e>>>16,e=h[t+20>>1]|h[t+22>>1]<<16,_=h[t+16>>1]|h[t+18>>1]<<16,o[r+16>>1]=_,o[r+18>>1]=_>>>16,o[r+20>>1]=e,o[r+22>>1]=e>>>16,e=h[t+12>>1]|h[t+14>>1]<<16,t=h[t+8>>1]|h[t+10>>1]<<16,o[r+8>>1]=t,o[r+10>>1]=t>>>16,o[r+12>>1]=e,o[r+14>>1]=e>>>16,a[d+177904|0]=0,d=-32768|h[r>>1],o[r>>1]=d,e=r)),s[g+4>>2]=e,o[g>>1]=p||50,o[g+2>>1]=16384|h[g+2>>1],o[e>>1]=16384|d,d=s[g+12>>2],t=c[d+17|0],r=s[32972],s[r+132>>2]&&(a[e+39|0]=c[d+39|0]-4);g:if(C){if(2048&u){t=(v(t,31&O)>>>0)/30|0,s[r+132>>2]||(r=c[e+17|0])&&(t=o[102896+(((0|(t=(t<<6>>>0)/(r>>>0)|0))>=199?199:t)<<1)>>1],a[e+18|0]=(0|v(t,c[e+18|0]))/512,a[e+19|0]=(0|v(t,c[e+19|0]))/512,a[e+20|0]=(0|v(t,c[e+20|0]))/512,a[e+21|0]=(0|v(t,c[e+21|0]))/512,a[e+22|0]=(0|v(t,c[e+22|0]))/512,a[e+23|0]=(0|v(t,c[e+23|0]))/512,a[e+24|0]=(0|v(t,c[e+24|0]))/512,a[e+25|0]=(0|v(t,c[e+25|0]))/512),Et(e,S,E,A,y,k,T,f);break g}if(Et(e,S,E,A,y,k,T,f),s[s[32972]+132>>2]||!(t=c[e+17|0]))break g;t=o[102896+(((0|(t=(D<<7>>>0)/(t>>>0)|0))>=199?199:t)<<1)>>1],a[e+18|0]=(0|v(t,c[e+18|0]))/512,a[e+19|0]=(0|v(t,c[e+19|0]))/512,a[e+20|0]=(0|v(t,c[e+20|0]))/512,a[e+21|0]=(0|v(t,c[e+21|0]))/512,a[e+22|0]=(0|v(t,c[e+22|0]))/512,a[e+23|0]=(0|v(t,c[e+23|0]))/512,a[e+24|0]=(0|v(t,c[e+24|0]))/512,a[e+25|0]=(0|v(t,c[e+25|0]))/512}else if(r=s[r+132>>2],8&f){if(r||!(r=c[e+17|0]))break g;t=((16320&v(t,48))>>>0)/(r>>>0)|0,t=o[102896+((t>>>0>=199?199:t)<<1)>>1],a[e+18|0]=(0|v(t,c[e+18|0]))/512,a[e+19|0]=(0|v(t,c[e+19|0]))/512,a[e+20|0]=(0|v(t,c[e+20|0]))/512,a[e+21|0]=(0|v(t,c[e+21|0]))/512,a[e+22|0]=(0|v(t,c[e+22|0]))/512,a[e+23|0]=(0|v(t,c[e+23|0]))/512,a[e+24|0]=(0|v(t,c[e+24|0]))/512,a[e+25|0]=(0|v(t,c[e+25|0]))/512}else r||(t=c[e+17|0])&&(t=o[102896+(((t=1792/(t>>>0)|0)>>>0>=199?199:t)<<1)>>1],a[e+18|0]=(0|v(t,c[e+18|0]))/512,a[e+19|0]=(0|v(t,c[e+19|0]))/512,a[e+20|0]=(0|v(t,c[e+20|0]))/512,a[e+21|0]=(0|v(t,c[e+21|0]))/512,a[e+22|0]=(0|v(t,c[e+22|0]))/512,a[e+23|0]=(0|v(t,c[e+23|0]))/512,a[e+24|0]=(0|v(t,c[e+24|0]))/512,a[e+25|0]=(0|v(t,c[e+25|0]))/512);if(!(8&f))break e;t=2816,(0|(r=o[e+4>>1]))<300||(t=2560,r>>>0<400||(t=r>>>0<500?2304:2048)),s[36436]=t}4&f&&(o[e>>1]=32|h[e>>1]),2&f&&(o[e>>1]=16|h[e>>1])}64&f&&Vt(20,0),e=p&f<<27>>31}else e=0;d=e+s[36422]|0,s[36422]=d,t=s[b+12>>2]}if((0|(r=t-1|0))<=0)u=0;else{if(e=0,p=0,u=0,t-2>>>0>=3)for(T=-4&r,y=0;u=(((o[(f=p<<3)+g>>1]+u|0)+o[g+(8|f)>>1]|0)+o[g+(16|f)>>1]|0)+o[g+(24|f)>>1]|0,p=p+4|0,(0|T)!=(0|(y=y+4|0)););if(f=3&r)for(;u=o[g+(p<<3)>>1]+u|0,p=p+1|0,(0|f)!=(0|(e=e+1|0)););}if(e=t,(f=s[n+20>>2])&&(e=r,p=f+s[34460]|0,(y=c[p+2|0])&&(C=h[p+4>>1],o[g+(r<<3)>>1]=c[p+20|0],f=1,e=t,(0|y)!=1))){if(T=p+4|0,C&=1,k=1&(p=y-1|0),(0|y)!=2)for(A=-2&p,y=0;E=T+(f<<6)|0,D=T+v(f,44)|0,O=c[(S=C?E:D)+16|0],s[(p=g+(e<<3)|0)+4>>2]=S,o[p>>1]=O,o[p+2>>1]=h[S>>1],E=c[(S=C?E- -64|0:D+44|0)+16|0],s[p+12>>2]=S,o[p+8>>1]=E,o[p+10>>1]=h[S>>1],f=f+2|0,e=e+2|0,(0|A)!=(0|(y=y+2|0)););k&&(f=T+(C?f<<6:v(f,44))|0,y=c[f+16|0],s[(p=g+(e<<3)|0)+4>>2]=f,o[p>>1]=y,o[p+2>>1]=h[f>>1],e=e+1|0)}A:if(!((0|u)<=0)){e:{g:switch(M-1|0){case 1:if(f=(0|(f=(s[n+44>>2]+d|0)-45|0))<=10?10:f,8&c[0|m]&&(f=f+(c[s[36128]+14|0]<<1)|0),(0|r)<=0)break A;if(m=(f<<8)/(0|u)|0,p=0,(0|t)!=2)for(t=-2&r,f=0;o[(u=(d=p<<3)+g|0)>>1]=(0|v(m,o[u>>1]))/256,o[(d=g+(8|d)|0)>>1]=(0|v(m,o[d>>1]))/256,p=p+2|0,(0|t)!=(0|(f=f+2|0)););if(!(1&r))break A;o[(t=g+(p<<3)|0)>>1]=(0|v(m,o[t>>1]))/256;break A;case 0:if(s[n>>2]!=1||(0|(f=s[n+44>>2]))>129)break e;o[g>>1]=(0|v(f,o[g>>1]))/130;break e;default:break g}(0|(f=s[n+44>>2]))<=0||(d=(f-u|0)+d|0,s[36422]=d)}if(!(!d|(0|r)<=0)){if(m=(u+d<<8)/(0|u)|0,p=0,(0|t)!=2)for(t=-2&r,f=0;o[(u=(d=p<<3)+g|0)>>1]=(0|v(m,o[u>>1]))/256,o[(d=g+(8|d)|0)>>1]=(0|v(m,o[d>>1]))/256,p=p+2|0,(0|t)!=(0|(f=f+2|0)););1&r&&(o[(t=g+(p<<3)|0)>>1]=(0|v(m,o[t>>1]))/256)}}if(s[l+108>>2]=e,z=b+16|0,g){if((0|(e=s[n+16>>2]))!=s[36438]&&(s[36438]=e,t=216192+(s[50758]<<4)|0,s[t>>2]=14,s[t+4>>2]=e,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0),p=(e=s[s[32972]+132>>2])?1:3,t=s[g+4>>2],s[n+28>>2]|!c[145748]||(a[145748]=0,p=e?2:4),(r=s[36426])&&(!((2&(e=h[r>>1]))>>>1|c[r+16|0]<2)|16&e||(d=216192+(s[36439]<<4)|0,s[d+12>>2]=t,8&e&&(e=(0|(e=s[44469]+1|0))<=169?e:0,s[44469]=e,(e=(f=e<<6)+177888|0)&&(m=h[t+4>>1]|h[t+6>>1]<<16,u=h[t>>1]|h[t+2>>1]<<16,o[e>>1]=u,o[e+2>>1]=u>>>16,o[e+4>>1]=m,o[e+6>>1]=m>>>16,m=h[t+60>>1]|h[t+62>>1]<<16,u=h[t+56>>1]|h[t+58>>1]<<16,o[e+56>>1]=u,o[e+58>>1]=u>>>16,o[e+60>>1]=m,o[e+62>>1]=m>>>16,m=h[t+52>>1]|h[t+54>>1]<<16,u=h[t+48>>1]|h[t+50>>1]<<16,o[e+48>>1]=u,o[e+50>>1]=u>>>16,o[e+52>>1]=m,o[e+54>>1]=m>>>16,m=h[t+44>>1]|h[t+46>>1]<<16,u=h[t+40>>1]|h[t+42>>1]<<16,o[e+40>>1]=u,o[e+42>>1]=u>>>16,o[e+44>>1]=m,o[e+46>>1]=m>>>16,m=h[t+36>>1]|h[t+38>>1]<<16,u=h[t+32>>1]|h[t+34>>1]<<16,o[e+32>>1]=u,o[e+34>>1]=u>>>16,o[e+36>>1]=m,o[e+38>>1]=m>>>16,m=h[t+28>>1]|h[t+30>>1]<<16,u=h[t+24>>1]|h[t+26>>1]<<16,o[e+24>>1]=u,o[e+26>>1]=u>>>16,o[e+28>>1]=m,o[e+30>>1]=m>>>16,m=h[t+20>>1]|h[t+22>>1]<<16,u=h[t+16>>1]|h[t+18>>1]<<16,o[e+16>>1]=u,o[e+18>>1]=u>>>16,o[e+20>>1]=m,o[e+22>>1]=m>>>16,m=h[t+12>>1]|h[t+14>>1]<<16,u=h[t+8>>1]|h[t+10>>1]<<16,o[e+8>>1]=u,o[e+10>>1]=u>>>16,o[e+12>>1]=m,o[e+14>>1]=m>>>16,a[f+177904|0]=0,o[e>>1]=32768|h[e>>1]),o[(f=f+177888|0)+8>>1]=h[r+8>>1],a[f+21|0]=c[r+21|0],o[f+10>>1]=h[r+10>>1],a[f+22|0]=c[r+22|0],o[f+12>>1]=h[r+12>>1],a[f+23|0]=c[r+23|0],o[f+14>>1]=h[r+14>>1],a[f+24|0]=c[r+24|0],a[f+25|0]=c[r+25|0],s[d+12>>2]=e))),(0|M)!=2|c[w+11|0]!=2||(Te(),s[36427]=s[50758]),!((0|(w=s[l+108>>2]))<2)){for(e=s[36433],m=(v(256-e|0,x)+(e<<8)|0)/256|0,e=s[36432],d=(v(256-e|0,x)+(e<<8)|0)/256|0,u=s[50754],e=0,r=1;f=h[(b=(g+(r<<3)|0)-8|0)+2>>1],f=(0|v((0|v(u,o[b>>1]))/1e3|0,4&f?d:16384&f?m:x))/256|0,s[(r<<2)+l>>2]=f,e=e+f|0,(0|w)!=(0|(r=r+1|0)););if(!((0|e)<=0|(0|e)>=(0|j)|(0|w)<2)){if(r=1,m=1&(f=w-1|0),(0|w)!=2)for(d=-2&f,x=0;s[(f=(r<<2)+l|0)>>2]=(0|v(s[f>>2],j))/(0|e),s[f+4>>2]=(0|v(s[f+4>>2],j))/(0|e),r=r+2|0,(0|d)!=(0|(x=x+2|0)););m&&(s[(r=(r<<2)+l|0)>>2]=(0|v(s[r>>2],j))/(0|e))}if(x=0,!((0|w)<2))for(w=M+256|0,r=1;e=s[4+(g+(r<<3)|0)>>2],!(f=s[n+28>>2])|128&c[0|t]||(s[36422]=0,lt(f,w,0,u=s[n>>2],0,m=(m=s[n+32>>2])?(m<<5)/100|0:32),a[145748]=1,s[n+28>>2]=0),(0|i)<0||(i=64&c[0|t]?6:i,(s[l+108>>2]-1|0)==(0|r)&&(i=(f=i)|(3840&(i=s[36436])?i:0))),f=s[(r<<2)+l>>2],s[36440]=f+s[36440],s[36441]=f+s[36441],f?(m=s[50758],s[36439]=m,(0|i)>=0&&(s[(m=216192+(m<<4)|0)>>2]=p,s[m+12>>2]=e,s[m+8>>2]=t,s[m+4>>2]=f+(i<<16),t=s[50758]+1|0,s[50758]=(0|t)<=169?t:0),s[36426]=e,x=f+x|0):s[36426]=0,t=e,(0|(r=r+1|0))>2];);}!s[36438]|(0|M)==1||(s[36438]=0,e=216192+(s[50758]<<4)|0,s[e>>2]=14,s[e+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0)}}z=l+112|0}function V(e,t,n,r){var i,o=0,l=0,u=0,d=0,f=0,p=0,m=0,g=0,_=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0;z=i=z-1856|0,s[i+164>>2]=0,n?g=s[n>>2]:Pt(n=i- -64|0,0,96),s[33264]=0,s[i+1824>>2]=0,s[i+1828>>2]=0,s[i+1832>>2]=0,s[i+1836>>2]=0,a[i+1616|0]=0,a[i+992|0]=0,a[i+1200|0]=0,a[i+784|0]=0;A:if(s[e+688>>2]){for(s[i+1840>>2]=t,c[0|(o=t)]==32&&(o=t+1|0,s[i+1840>>2]=o),_=i+416|1,D=i+1844|1,k=i+1848|1,A=i+1852|1,s[i+1820>>2]=o,nn(i+168|0,o),o=s[i+1820>>2];(32|c[0|o])!=32;)o=nn(i+164|0,o)+s[i+1820>>2]|0,s[i+1820>>2]=o,x=x+1|0;ut(i+256|0,t,O=(0|(u=o-t|0))>=159?159:u),!(T=4194304&g)|(0|x)!=1?(C=((0|(o=s[47202]))==36)<<2,(0|x)==1|(0|o)!=36||(o=s[i+1840>>2]-1|0,s[i+1840>>2]=o,a[0|o]=95,C=0,l=!!(0|nt(e,i+1840|0,i+1616|0,i+1832|0,0,n)),o=s[47202])):(l=1,nn(i+172|0,o+1|0),En(s[i+172>>2])&&(0|_t(s[i+164>>2]))==(0|_t(s[i+172>>2]))&&(l=0),C=(0|(o=s[47202]))==36?4:l,l=0);e:{g:{r:{C:{a:if(16&o)y=15&o,C=0;else{if(S=1,l||(S=!!(0|nt(e,i+1840|0,i+1616|0,i+1832|0,2,n))),50331648&(o=s[i+1832>>2])&&(u=s[i+1820>>2],c[u+1|0]==46&&(a[u+1|0]=32,o=s[i+1832>>2])),536870912&o){if(!r)break A;gn(r,s[i+1840>>2]);break A}if(8192&o|!(128&o)|S)r=s[33264];else if(o=s[i+1840>>2],s[i+1820>>2]=o,!((0|(r=s[33264]))<=0))for(l=0;c[0|o]==32&&(a[0|o]=45,l=l+1|0,o=s[i+1820>>2],r=s[33264]),o=o+1|0,s[i+1820>>2]=o,(0|r)>(0|l););I:if(!(r|(0|x)!=1)&&(u=nn(i+576|0,m=s[i+1840>>2]),c[u+m|0]==32)){l=i+1408|0,r=m;f:{i:{b:{for(;;){s:if(En(s[i+576>>2])){t:{if(c[(d=r+u|0)+1|0]==46){y=0;n:switch(c[(o=u+2|0)+r|0]-32|0){case 0:break t;case 7:break n;default:break s}if(y=1,u=o,c[d+3|0]==115)break t;break s}if(y=1,(0|p)<=0)break b}if(!((0|u)<=0)){if(b=3&u,f=0,u>>>0<4)o=0;else for(w=-4&u,o=0,d=0;a[0|l]=c[r+o|0],a[l+1|0]=c[(1|o)+r|0],a[l+2|0]=c[(2|o)+r|0],a[l+3|0]=c[(3|o)+r|0],o=o+4|0,l=l+4|0,(0|w)!=(0|(d=d+4|0)););if(b)for(;a[0|l]=c[r+o|0],o=o+1|0,l=l+1|0,(0|b)!=(0|(f=f+1|0)););}if(p=p+1|0,y)r=r+u|0;else if(u=nn(i+576|0,r=3+(r+u|0)|0),c[r+u|0]==32)continue}break}if(!((0|p)<2)){(u=(u=l-(o=i+1408|0)|0)+(o=ut(m,o,u))|0)>>>0>>0&&Pt(u,32,(i+1408|0)+r-(o+l)|0),s[33264]=(p<<1)-2,s[i+1836>>2]=0;break i}}if(!p)break I;if(s[i+1832>>2]=0,s[i+1836>>2]=0,!s[33264])break f}s[i+1832>>2]=128}C=1}if(c[i+1616|0]==21){gn(189088,i+1616|0),o=0;break A}if(j=c[i+1833|0],l=1,!S){if(s[i+168>>2]-48>>>0<10){if(zn(e,84174,189088),o=0,c[189088]==21)break A;if(!(!(128&c[e+109|0])|32&c[n+2|0])){a[189088]=21,a[189089]=0;break A}l=!!(0|Se(e,s[i+1840>>2],i+1616|0,i+1832|0,n,0))}else l=0;if(!(l|(3&g)==2)&&(16777216&(r=s[e+104>>2])||(l=0,!(!(33554432&r)|!(1&g))))&&(16&g||(l=0,!(1&a[n+13|0])))){w=s[i+1840>>2],o=0,p=0,d=0,z=b=z-224|0,a[0|(f=i+1616|0)]=0,s[b+216>>2]=0,s[b+220>>2]=0;I:if(!(a[w-2|0]-48>>>0<10|(1&a[0|n]?0:2&c[e+107|0])||(r=c[0|(u=w+1|0)],(!(2561&h[e+106>>1])|!(1&a[n+2|0]))&(0|r)==32))){if((0|(p=c[0|w]))!=32){for(y=32767,r=0;;){if(!(o=un(101868,p<<24>>24,8))){p=0;break I}if(m=0,(0|(o=s[(o<<2)-305584>>2]))==(0|r)&&!((0|(m=d+1|0))<=2)){p=0;break I}f:{i:{b:{s:{if(!((0|r)<2)){if((0|r)==10|(0|r)==100)break s;if(!((0|r)>(0|o))){p=0;break I}}if(!r)break i;if((0|r)<(0|o))break b;break i}if((0|r)>=(0|o))break i}if(p=0,(0|E)%10|(0|v(r,10))<(0|o))break I;o=o-r|0,y=r;break f}if((0|o)>=(0|y)){p=0;break I}E=r+E|0}if(p=c[0|u],u=l=u+1|0,r=o,d=m,(0|p)==32)break}r=c[0|l]}else l=u;if((r<<24>>24)-48>>>0<10)p=0;else if((0|(r=o+E|0))>2])p=0;else if((0|r)>s[e+116>>2])p=0;else if(zn(e,85600,b+176|0),o=f,4&c[e+107|0]||(o=gn(f,o=b+176|0)+U(o)|0),s[b+4>>2]=s[e+140>>2],s[b>>2]=r,H(b+16|0,85839,b),p=0,c[0|l]!=46){Rt(e,w,l,n,1)&&(s[n>>2]=32768|s[n>>2]),u=0;f:if(8&c[e+107|0]){if(d=s[n>>2],s[e+212>>2]==26741){if(32768&d)break f;if(!(16384&d))break I;u=1,d=0;i:{b:switch(c[0|l]-97|0){case 0:case 4:break b;default:break i}b:{s:{t:{n:switch((y=c[l+1|0])-116|0){case 6:break i;case 1:case 2:case 3:case 4:case 5:break s;case 0:break n;default:break t}if(c[l+2|0]!=116)break b;break i}if((0|y)==32)break i}if(!((0|r)%1e3|0)&&(0|y)==108)break i}d=1}if(d)break f;break I}s[n>>2]=32768|d}s[(r=e+8232|0)>>2]=0,s[r+4>>2]=0,Se(e,b+16|2,o,b+216|0,n,u),p=1,4&c[e+107|0]&&Li(f,b+176|0)}}z=b+224|0,p?(s[i+1832>>2]=8192|s[i+1832>>2],l=1):l=0}}if(y=S?C:32&j?1:C,C=0,!(!(1&g)|(0|x)<2)&&Rr(s[i+168>>2])){I:{if(1&a[188785]){if(!(!(r=8192&(o=s[i+1832>>2]))|l))break I;C=r>>>2^2048;break a}if(l)break C;o=s[i+1832>>2]}if(!(128&o|x>>>0>3)&&!((0|(o=s[e+8220>>2]))<4)&&(r=1,(0|o)>=s[e+8216>>2]))break e}}if(f=0,(0|y)<=0)break r;r=y;break e}if((0|(r=y))>0)break e;f=0,m=0,d=0,p=0;break g}if(l)m=0,d=0,p=0;else{r=s[i+1840>>2],s[i+1820>>2]=r,o=999,p=0,m=0,_=0;r:{C:{a:{for(;;){I:{f:{i:{if(o-1>>>0>=2){if((0|x)<2||(nn(i+1408|0,r),(0|(o=s[i+1408>>2]))<577&s[e+600>>2]>0)||(o=_t(o),(s[o+4>>2]==s[e+600>>2]?0:o)|s[e+40>>2]==1))break i;o=c[0|r],s[i+1408>>2]=o<<24>>24;b:switch(o-32|0){default:if(!o)break i;break;case 0:case 7:break i;case 1:case 2:case 3:case 4:case 5:case 6:break b}f=nn(i+1408|0,r),S=9;b:{s:{t:{n:if(-33&(o=s[i+1408>>2])){for(l=0,d=0;;){k:{o:{if((0|o)==39){if((0|m)>0|(0|l)>1)break n;if(d=l?d:39,s[e+40>>2]!=3)break o;break k}d=l?d:o}l=l+1|0}if(!Yn(e,o)){if((0|(o=s[i+1408>>2]))!=39&&!Rr(o))break i;if(f=nn(i+1408|0,r+f|0)+f|0,-33&(o=s[i+1408>>2]))continue;break n}break}if((0|l)<=2)break t;S=l}else d=0;if((0|(o=s[e+40>>2]))!=2)break s;z=o=z-208|0,a[0|o]=0,l=c[0|(u=r-1|0)],a[0|u]=32,r=Ae(e,r,o,200,0,-2147483648,0),a[0|u]=l,z=o+208|0,r=!r|(32768&r)>>>15;break b}o=s[e+40>>2],S=l}r=(a[e+168|0]+1|0)<(S-((0|o)==(0|d))|0)}if(!r)break i;r=s[i+1820>>2]}if(c[0|r]!=39)break f;p=67108864,C=0}if(f=0,Bt(e,i+992|0,0,m),r=s[i+1820>>2],(0|(o=c[0|r]))!=32)break I;m=0,d=0;break g}if(C=0,r=Ne(e,r,i+992|0,1&(_|=(0|m)>0))+s[i+1820>>2]|0,s[i+1820>>2]=r,c[i+992|0]==21)break a;for(m=m+1|0,l=0;l=(o=l)+1|0,c[r+o|0]!=32;);p=67108864;continue}break}if(!c[i+992|0]|(0|o)==39||(a[r-1|0]=32,r=s[i+1820>>2]),u=Ae(e,r,i+1616|0,200,i+784|0,g,i+1832|0),(0|(r=c[i+1616|0]))==21){gn(189088,i+1616|0),o=0;break A}if(!(r|c[i+784|0])&&(nn(i+1408|0,s[i+1820>>2]),(0|x)==1&&(En(s[i+1408>>2])||mr(s[i+1408>>2])))){Kn(e,s[i+1820>>2],i+1616|0,y)&&gn(189088,i+1616|0),o=0;break A}s[i+172>>2]=a[s[i+1820>>2]-1|0];I:if(1024&u)for(w=i+176|1,y=0,o=1,_=0,m=0;;){if((S=131072&u)|!(1&o)||(a[i+1408|0]=0,!(r=Ae(e,s[i+1820>>2],i+1408|0,200,i+576|0,805306368|g,i+1832|0)))){2048&u&&(s[e+8184>>2]=1),a[s[i+1820>>2]-1|0]=s[i+172>>2];f:{i:{b:{s:if(S){if(a[i+176|0]=0,o=s[i+1820>>2],r=1,d=63&u){if(b=1&u,m=d-1|0,l=0,(0|d)!=1)for(E=d-b|0,d=0;f=o,s[i+1820>>2]=o+1,a[0|(T=(i+176|0)+r|0)]=(0|l)==(0|m)?0:c[0|o],o=o+2|0,s[i+1820>>2]=o,a[T+1|0]=(0|m)==(1|l)?0:c[f+1|0],l=l+2|0,r=r+2|0,(0|E)!=(0|(d=d+2|0)););b&&(d=o+1|0,s[i+1820>>2]=d,a[(i+176|0)+r|0]=(0|l)==(0|m)?0:c[0|o],r=r+1|0,o=d)}a[(i+176|0)+r|0]=0}else{if(o=s[i+1820>>2],!(d=15&u))break b;if(r=0,l=d,f=3&u)for(;o=o+1|0,s[i+1820>>2]=o,(192&c[0|o])==128||(l=l-1|0,(0|f)!=(0|(r=r+1|0))););if(d>>>0<4)break s;for(;;)if(o=o+1|0,s[i+1820>>2]=o,(192&c[0|o])!=128){for(;o=o+1|0,s[i+1820>>2]=o,(192&c[0|o])==128;);for(;o=o+1|0,s[i+1820>>2]=o,(192&c[0|o])==128;);for(;o=o+1|0,s[i+1820>>2]=o,(192&c[0|o])==128;);if(r=(0|l)>4,l=l-4|0,!r)break}}if(r=o-1|0,s[i+172>>2]=a[0|r],a[0|r]=32,r=g|=8388608,!S)break i;if(Ti(i+576|0,i+784|0,12),s[i+1852>>2]=w,r=gn(i+1200|0,o=i+1616|0),nt(e,i+1852|0,o,i+1832|0,0,n)&&gn(r,i+1616|0),!(32&c[i+1833|0]))break f;a[0|r]=0,Kn(e,s[i+1852>>2],r,1);break f}r=o-1|0,s[i+172>>2]=a[0|r],a[0|r]=32,r=8388608|g}g=r,Li(i+1200|0,i+784|0)}if(a[i+784|0]=0,d=1,r=nt(e,i+1820|0,i+1616|0,i+1824|0,1024,n),s[i+1832>>2]||(o=s[i+1828>>2],s[i+1832>>2]=s[i+1824>>2],s[i+1836>>2]=o,d=_),r){f=0,m=u;break r}if(f=Ae(e,s[i+1820>>2],i+1616|0,200,i+784|0,8404992&g,i+1832|0),o=1,m=u,_=d,c[i+1616|0]==21){a[s[i+1820>>2]-1|0]=s[i+172>>2],gn(189088,i+1616|0),o=0;break A}}else o=i+416|0,Ie(e,s[i+1820>>2],r,o),f=Ae(e,s[i+1820>>2],i+1616|0,200,i+784|0,268435456|g,i+1832|0),ut(s[i+1820>>2],o,U(o)),1024&f||(gn(i+1616|0,i+1408|0),o=gn(i+784|0,i+576|0),8&c[188788]&&(Ut(d=o,o=i+576|0),u=s[47195],s[i+48>>2]=o,fi(u,85205,i+48|0)),f=r),o=0;if(r=(l=1024&f)>>>10|0,y>>>0>48)break I;if(y=y+1|0,u=f,!l)break}else f=u,m=0,_=0,r=0;if(r|!f)break C;for(u=gn(i+1408|0,i+1616|0),l=Ie(e,s[i+1820>>2],f,i+416|0),d=_,o=f;;){I:{if(a[i+1616|0]=0,c[i+1200|0]){if(a[s[i+1820>>2]-1|0]=s[i+172>>2],r=nt(e,i+1840|0,i+1616|0,i+1824|0,l,n),a[s[i+1820>>2]-1|0]=32,c[i+1616|0]==21){e=i+416|0,ut(s[i+1820>>2],e,U(e)),gn(189088,i+1616|0),o=0;break A}if(s[i+1832>>2]||(_=s[i+1828>>2],s[i+1832>>2]=s[i+1824>>2],s[i+1836>>2]=_),r){a[i+1200|0]=0;break I}d=s[i+1824>>2]?1:d}if(r=nt(e,i+1820|0,i+1616|0,i+1824|0,l,n),c[i+1616|0]==21){e=i+416|0,ut(s[i+1820>>2],e,U(e)),gn(189088,i+1616|0),o=0;break A}if(s[i+1832>>2]||(_=s[i+1828>>2],s[i+1832>>2]=s[i+1824>>2],s[i+1836>>2]=_),!r)if(16384&o)gn(i+1616|0,u);else{g|=l<<11&8192|o<<9&134217728;f:if(524288&o){if(_=gn(i+576|0,r=i+784|0),o=Ae(e,s[i+1820>>2],i+1616|0,200,r,g,i+1832|0),Li(r,_),r=0,!o){o=0;break f}if(1024&o)break f;r=1,l=Ie(e,s[i+1820>>2],o,0)}else o=0,Ae(e,s[i+1820>>2],i+1616|0,200,0,g,i+1832|0),r=0;if(c[i+1616|0]==21){gn(189088,i+1616|0),e=i+416|0,ut(s[i+1820>>2],e,U(e)),a[s[i+1820>>2]-1|0]=s[i+172>>2],o=0;break A}if(r)continue}}break}65536&f||(vn(e,i+1616|0,200,i+784|0),a[i+784|0]=0),r=i+416|0,ut(s[i+1820>>2],r,U(r));break r}gn(189088,e=i+992|0),o=!Hn(1|e,84744,3)<<12;break A}f=0,d=_}a[s[i+1820>>2]-1|0]=s[i+172>>2]}}if(r=s[i+164>>2],s[i+1852>>2]=8026656,s[i+1848>>2]=8022304,s[i+1844>>2]=7566112,4&g){g:{if((o=255&r)&&((0|o)==102||(D=k,_i(r<<24>>24))))break g;D=A}Ae(e,D,189088,200,0,0,0)}for(r=0,o=i+1200|0,_=c[i+784|0];;){g:{r:{C:switch(0|(u=c[0|o])){case 0:break g;case 6:case 7:break C;default:break r}r=u}o=o+1|0;continue}break}g:if(r|d){if(s[e+32>>2]|65536&m){for(l=0,ye(e,i+1616|0,i+1832|0,3,0),o=i+1200|0;;){r:switch(c[0|o]){case 6:l&&(a[0|o]=5),l=1;default:o=o+1|0;continue;case 0:break r}break}s[i+24>>2]=i+1616,s[i+20>>2]=i+1200,s[i+16>>2]=i+992,jn(189088,200,85233,i+16|0),a[189287]=0,ye(e,189088,i+1832|0,-1,0);break g}s[i+8>>2]=i+1616,s[i+4>>2]=i+1200,s[i>>2]=i+992,jn(189088,200,85233,i),a[189287]=0,ye(e,189088,i+1832|0,-1,0)}else ye(e,r=i+1616|0,i+1832|0,-1,!!(0|_)<<1),s[i+40>>2]=r,s[i+36>>2]=i+1200,s[i+32>>2]=i+992,jn(189088,200,85233,i+32|0),a[189287]=0;c[i+784|0]&&(r=U(189088),a[983+(i-r|0)|0]=0,gn(r+189088|0,i+784|0)),16&(r=g|C)&&(s[i+1832>>2]=-268435457&s[i+1832>>2]);g:if(!(128&r)|!(16&c[e+14|0]))if(3072&r){if(Ct(e,6),!(2048&r))break g;s[i+1832>>2]=268435456|s[i+1832>>2]}else 16&c[v(s[33264],12)+n|0]&&(1536&(n=s[i+1832>>2])?Ct(e,4):2048&n&&Ct(e,3));else Ct(e,3);8192&f&&(s[e+8192>>2]=2,s[e+8184>>2]=2);g:{if(8&(n=s[i+1836>>2]))s[e+8184>>2]=0,s[e+8188>>2]=3,r=e+8196|0;else if(1&n)s[e+8192>>2]=0,s[e+8184>>2]=2,r=e+8196|0;else if(2&n)s[e+8192>>2]=2,s[e+8184>>2]=0,s[e+8188>>2]=0,r=e+8196|0;else{if(!(4&n))break g;s[e+8184>>2]=0,s[e+8192>>2]=0,s[e+8196>>2]=2,r=e+8188|0}s[r>>2]=0}!c[s[i+1820>>2]]|256&n||((0|(n=s[e+8184>>2]))>0&&(s[e+8184>>2]=n-1),(0|(n=s[e+8192>>2]))>0&&(s[e+8192>>2]=n-1),(0|(n=s[e+8196>>2]))>0&&(s[e+8196>>2]=n-1),(0|(n=s[e+8188>>2]))<=0||(s[e+8188>>2]=n-1)),(0|x)!=1|s[e+212>>2]!=25966||!Rr(s[i+168>>2])|s[i+168>>2]==105||(s[i+1832>>2]=16777216|s[i+1832>>2]);g:if(2&c[e+68|0]&&98304&(r=s[i+1832>>2])&&!((0|(n=U(189088)-1|0))<=0))for(o=0;;){if(e=o+1|0,c[o+189088|0]==6){n=a[0|(e=e+189088|0)];r:{if(65536&r){if((0|jr(69))==(0|n)?(x=jr(101),a[0|e]=x):x=c[0|e],l=111,(0|jr(79))==x<<24>>24)break r;break g}if((0|jr(101))==(0|n)?(x=jr(69),a[0|e]=x):x=c[0|e],l=79,(0|jr(111))!=x<<24>>24)break g}a[0|e]=jr(l);break g}if((0|n)==(0|(o=e)))break}e=s[i+1832>>2],ut(t,i+256|0,O),o=e|p;break A}if(o=0,a[i+1616|0]=0,Kn(e,s[i+1840>>2],i+1616|0,r)){if(u=gn(189088,i+1616|0),!T){if(r=s[i+164>>2],s[i+1408>>2]=8026656,s[i+576>>2]=8022304,s[i+416>>2]=7566112,4&g){t=i+576|1,n=i+1408|1;e:{if((o=255&r)&&((0|o)==102||(_=t,_i(r<<24>>24))))break e;_=n}Ae(e,_,u,200,0,0,0)}o=128&s[i+1832>>2]}}else o=((0|x)>1)<<12}else a[189088]=0;return z=i+1856|0,o}function he(e,t,n,r,i,o,l,u){var d,f,p=0,m=0,h=0,g=0,_=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0,P=0,F=0,I=0,L=0,ee=0,te=0,R=0,ne=0,re=0,ie=0,ae=0,oe=0,se=0,B=0,ce=0,le=0,ue=0,de=0,fe=0,pe=0,me=0;z=d=z-384|0,f=s[t>>2];A:{e:{g:{r:{if(i){if(c[0|i]!=7)break r;s[t>>2]=(r||1)+f;break g}s[o>>2]=0,s[t>>2]=f+1;break A}P=86135,re=268435456&l,ie=134217728&l,ae=8388608&l,oe=16384&l,se=8192&l,L=n-1|0,ee=r-n|0,B=2&l,ce=128&l,le=l>>>31|0,ue=-2147483648&l,te=d+96|1;r:for(;;)for(s[d+268>>2]=0,b=(h=s[t>>2])+r|0,O=-2,E=-6,n=i,k=ue,j=0,F=0,D=1,p=0,A=0,N=0;;){g=h,x=p;C:{a:{I:{f:{i:{b:{s:{t:{n:{k:{o:{B:{c:{Q:{G:{w:{for(;C=n,n=n+1|0,!((m=c[0|C])>>>0>9);){_=n;E:switch(0|m){case 0:if(!(n=R)){R=0,n=86135;break G}for(;;){m=1;D:{u:switch(0|(p=c[0|n])){case 0:case 3:break w;case 5:break u;default:break D}m=2}n=(n+m|0)+(((0|p)==9)<<1)|0}case 1:if(N=1,!le)continue;break i;case 2:N=2;continue;case 4:R=n;continue;case 5:n=C+2|0,p=s[e+320>>2];D:{if((h=c[C+1|0])>>>0>=32){if(!(p>>>h-32&1))break D;break i}if(!(p>>>h&1))break i}D=D+1|0;continue;case 9:n=C+3|0;continue;case 8:N=1,F=1,k=0;break;case 3:break Q;default:break E}}_=0,p=x,h=g;E:switch(0|N){case 0:D:{u:{if((0|(p=c[0|b]))!=(0|m)){if((0|p)!=69)break i;if((0|m)==101)break u;break i}if(_=0,(192&m)==128)break D}_=21}b=b+1|0,j=j+1|0;break C;case 1:break c;case 2:break E;default:break k}if(s[d+264>>2]=s[d+268>>2],!c[b-1|0])break i;E=(0|(p=E+6|0))>=19?19:p,T=b+1|0,w=nn(d+268|0,b),S=c[0|b],_=20,p=x;E:{D:switch(m-11|0){case 6:n=C+2|0,p=s[d+268>>2],h=a[C+1|0];u:if(m=s[604+(((h=((0|h)<65?191:-65)+h|0)<<2)+e|0)>>2])p=!!(0|Gr(m,p));else{if((0|h)>7)break i;l:{if((0|(m=s[e+600>>2]))>0){if((p=p-m|0)-1>>>0<255)break l;break i}if((m=p-192|0)>>>0<=413){p=c[344+(c[m+94240|0]+e|0)|0]&1<>>0>255)break i}p=c[344+(e+p|0)|0]&1<>2]))break i;u:for(;;){if((0|(_=c[0|p]))==7)break i;if((0|_)==126){_=20-E|0;break C}l:if(S){if(y=b,m=p,(0|_)==(0|S))for(;;){if((0|(_=c[0|(m=m+1|0)]))!=(0|(p=c[0|(y=y+1|0)])))break l;if(!p)break}}else m=p,y=b;if(_){for(;;)if(h=c[0|m],m=p=m+1|0,!h)continue u}break}if((0|(p=y-b|0))<0)break i;b=p+b|0,_=20-E|0;break C;case 14:m=s[d+268>>2];u:{l:if(p=s[e+604>>2])p=!!(0|Gr(p,m));else{x:{if((0|(p=s[e+600>>2]))>0){if((y=m-p|0)-1>>>0<255)break x;break u}if((p=m-192|0)>>>0<=413){p=1&a[344+(c[p+94240|0]+e|0)|0];break l}if(y=m,m>>>0>255)break a}p=1&a[344+(e+y|0)|0]}if(p)break i;m=s[d+268>>2]}if(!ie)break a;if((0|m)==32)break i;break a;case 4:if((p=s[d+268>>2])-48>>>0<10|p-2406>>>0<10)break a;if(!c[e+170|0])break i;_=20-E|0;break C;case 5:if(Xr(s[d+268>>2]))break i;break I;case 0:if(s[d+268>>2]==s[d+264>>2])break I;break i;case 17:n=C+2|0,p=32768,_=0;u:{l:switch((m=c[C+1|0])-1|0){case 0:break k;case 1:break l;default:break u}if(_=1,p=x,!ae)break k;break i}if((0|(p=240&m))==16){if(_=23,p=x,u>>>(15&m)&16384)break k;break i}if((0|m)!=3&(0|p)!=32||(ut(p=d+96|0,L,h=1+(s[t>>2]+(j+ee|0)|0)|0),a[0|(p=p+h|0)]=32,a[p+1|0]=0,s[33265]=0,s[33266]=0,s[d+16>>2]=te,nt(e,d+16|0,d+272|0,133060,0,0),_=23,!((0|m)!=3|(0|(y=s[33265]))>=0|16384&s[33266])))break C;if(p=x,h=g,y>>>(15&m)&16384)break k;break i;case 34:u:{if(p=S-32|0){if((0|p)==13)break u;break i}if(!oe)break i}y=22-E|0;break f;case 10:if(p=1,c[0|n]==21)break E;break b;case 18:if((0|(y=s[d+268>>2]))!=32)for(m=b+w|0;;){u:{l:if(p=s[e+632>>2])p=!!(0|Gr(p,y));else{x:{if((0|(p=s[e+600>>2]))>0){if((y=y-p|0)-1>>>0<255)break x;break u}if((p=y-192|0)>>>0<=413){p=128&c[344+(c[p+94240|0]+e|0)|0];break l}if(y>>>0>255)break u}p=128&c[344+(e+y|0)|0]}if(p)break i}if(m=nn(d+268|0,m)+m|0,(0|(y=s[d+268>>2]))==32)break}y=19-E|0;break f;case 49:break s;case 2:break t;case 3:break n;case 1:break k;case 13:break o;case 12:break D;default:break B}nn(d+272|0,n),w=-1;D:if((0|(p=s[d+272>>2]))!=(0|(m=s[d+268>>2])))if(-33&m)for(;;){S=b,w=-1;u:if((0|p)==18&&(p=a[C+2|0],_=s[4788+((((0|p)<65?191:-65)+p<<2)+e|0)>>2])){for(;;){if((0|(h=c[0|_]))==7)break u;if((0|h)==126){w=0;break u}l:if((0|(b=c[0|S]))==(0|h)){if(p=S,m=_,b)for(;;){if((0|(h=c[0|(m=m+1|0)]))!=(0|(_=c[0|(p=p+1|0)])))break l;if(!_)break}}else m=_,p=S;if(!h){p=p-S|0;break}for(;p=c[0|m],m=_=m+1|0,p;);}w=p}if(h=nn(d+268|0,S),(0|(p=s[d+272>>2]))==(0|(m=s[d+268>>2]))|!(-33&m))break D;if(b=h+S|0,(0|w)!=-1)break}else S=b;else S=b;b=(0|p)==(0|m)||(0|w)>=0?S:T,_=0;break C}for(;p=p+1|0,c[0|(n=n+1|0)]==21;);break b}n=n+1|0}_=C}if(!(c[g-1|0]!=32&F|k||((0|(m=F?D+4|0:D))>=(0|I)&&(de=A,fe=x,I=m,pe=j,P=n),!(8&s[47197])|re|(0|m)<=0))){for(Ut(n,C=d+272|0),T=s[47195],h=d+16|0,n=0,S=0,k=0,A=0,z=b=z-496|0,a[b+80|0]=0,(0|r)>0?(ut(b+288|0,f,r),x=r):x=0,a[x+(p=b+288|0)|0]=0,g=U(p)+p|0,w=(0|l)<0;;){if(y=c[0|i],x=i,i=i+1|0,y>>>0>9)for(;;){Q:{G:{w:{E:{D:{u:switch((p=255&y)-14|0){case 4:break w;case 3:break E;case 0:break D;case 14:break u;default:break G}if(x=x+2|0,y=32,!w&(0|(i=c[0|i]))==1)break Q;a[0|g]=36,gn(p=g+1|0,i=kr(128960,i)),g=U(i)+p|0;break Q}p=c[x+2|0],y=c[0|i],s[b+36>>2]=127&c[x+3|0],s[b+32>>2]=4&p?80:83,H(b+48|0,85131,b+32|0),1&p&&(i=U(i=b+48|0)+i|0,a[0|i]=101,a[i+1|0]=0),2&(i=127&p)&&(p=U(p=b+48|0)+p|0,a[0|p]=105,a[p+1|0]=0),4&i&&(p=U(p=b+48|0)+p|0,a[0|p]=112,a[p+1|0]=0),8&i&&(p=U(p=b+48|0)+p|0,a[0|p]=118,a[p+1|0]=0),16&i&&(p=U(p=b+48|0)+p|0,a[0|p]=100,a[p+1|0]=0),32&i&&(p=U(p=b+48|0)+p|0,a[0|p]=102,a[p+1|0]=0),i>>>0>=64&&(i=U(i=b+48|0)+i|0,a[0|i]=113,a[i+1|0]=0),1&y&&(i=U(i=b+48|0)+i|0,a[0|i]=116,a[i+1|0]=0),x=x+4|0,g=gn(g,i=b+48|0)+U(i)|0,y=32;break Q}x=x+2|0,y=c[a[0|i]+93871|0];break Q}i=a[0|i],a[0|g]=76,p=((i=i+((0|i)<65?191:-65)|0)>>>0)/10|0,a[g+1|0]=p+48,y=i-v(p,10)|48,(0|A)==1&&(a[0|g]=y,y=76),x=x+2|0,g=g+2|0;break Q}y=p>>>0<=31?c[p+93904|0]:(0|p)==32?95:y,x=i}if(a[0|g]=y,i=x+1|0,g=g+1|0,!((y=c[0|x])>>>0>=10))break}p=1;Q:switch(0|y){case 1:p=n;case 8:a[0|g]=0,g=b+80|0,n=p,A=1;continue;case 2:a[0|g]=0,x=U(p=b+288|0)+p|0,g=c[84899]|c[84900]<<8,a[0|x]=g,a[x+1|0]=g>>>8,A=2,a[x+2|0]=c[84901],g=U(p)+p|0;continue;case 5:S=a[0|i],i=x+2|0;continue;case 9:k=(c[0|i]+v(c[x+2|0],255)|0)-256|0,i=x+3|0;continue;case 0:case 3:break Q;default:continue}break}if(a[0|g]=0,g=h,(0|k)>0&&(s[b+16>>2]=k,H(h,85581,b+16|0),g=h+7|0),(0|S)>0&&(s[b>>2]=S,H(g,85694,b),g=U(g)+g|0),1&((0|(i=U(b+80|0)))>0|n)){1&n&&(a[0|g]=95,g=g+1|0);Q:if(!((0|(x=i-1|0))<0|g>>>0>=h>>>0))for(;;){if(a[0|g]=c[(b+80|0)+x|0],g=g+1|0,(0|x)<=0)break Q;if(x=x-1|0,!(g>>>0>>0))break}a[0|g]=41,a[g+1|0]=32,g=g+2|0}a[0|g]=0,a[(n=b+288|0)+((h+3|0)-g|0)|0]=0,Li(g,n),(0|(n=U(h)))<=7&&(Pt(n+h|0,32,8-n|0),n=8),a[n+h|0]=0,z=b+496|0,s[d+4>>2]=h,s[d>>2]=(0|r)>1?m+35|0:m,s[d+8>>2]=C,fi(T,89088,d)}n=_;break i}if(!c[0|g])break i;O=(0|(p=O+2|0))>=19?19:p,nn(d+264|0,g),p=en(d+268|0,h=g-1|0),S=c[0|h],T=h;c:{Q:{G:{w:{E:{D:switch(m-10|0){case 13:if(p=(0|(M=c[0|n]))==(0|(m=c[0|g])),w=-1,(0|m)==32|(0|m)==(0|M))break w;if(m)break E;break G;case 7:n=C+2|0,_=s[d+268>>2],g=a[C+1|0];u:if(m=s[604+(((g=((0|g)<65?191:-65)+g|0)<<2)+e|0)>>2])m=!!(0|Gr(m,_));else{if((0|g)>7)break i;l:{if((0|(m=s[e+600>>2]))>0){if((_=_-m|0)-1>>>0<255)break l;break i}if((m=_-192|0)>>>0<=413){m=c[344+(c[m+94240|0]+e|0)|0]&1<>>0>255)break i}m=c[344+(e+_|0)|0]&1<>2]))break i;u:{for(;;){if((0|(S=c[0|p]))==7)break i;if((0|S)==126){w=0;break u}m=h;l:{x:{if((0|(C=(w=U(p))-1|0))>0)for(m=g-w|0,_=0,y=h;;){if(!c[0|(y=y-1|0)])break x;if((0|C)==(0|(_=_+1|0)))break}d:if(!((0|(_=c[0|m]))!=(0|S)|!_))for(;;){if((0|(S=c[0|(p=p+1|0)]))!=(0|(_=c[0|(m=m+1|0)])))break d;if(!_)break}if(!S)break l}for(m=p;_=c[0|m],m=p=m+1|0,_;);continue}break}if((0|w)<0)break i}_=20-E|0,h=1+(h-w|0)|0;break c;case 15:m=s[d+268>>2];u:{l:if(g=s[e+604>>2])g=!!(0|Gr(g,m));else{x:{if((0|(g=s[e+600>>2]))>0){if((m=m-g|0)-1>>>0<255)break x;break u}if((g=m-192|0)>>>0<=413){g=1&a[344+(c[g+94240|0]+e|0)|0];break l}if(m>>>0>255)break u}g=1&a[344+(e+m|0)|0]}if(g)break i}_=20-O|0,h=1+(h-p|0)|0;break c;case 1:if(s[d+268>>2]!=s[d+264>>2])break i;_=21-O|0,h=1+(h-p|0)|0;break c;case 5:if(!((g=s[d+268>>2])-48>>>0<10|g-2406>>>0<10))break i;_=21-O|0,h=1+(h-p|0)|0;break c;case 6:if(Xr(s[d+268>>2]))break i;_=21-E|0,h=1+(h-p|0)|0;break c;case 18:if(n=C+2|0,!((0|(m=c[C+1|0]))==3|(240&m)==32)||(ut(p=d+96|0,L,h=1+(s[t>>2]+(j+ee|0)|0)|0),a[0|(p=p+h|0)]=32,a[p+1|0]=0,s[33265]=0,s[33266]=0,s[d+16>>2]=te,nt(e,d+16|0,d+272|0,133060,0,0),_=23,!((0|m)!=3|(0|(y=s[33265]))>=0|16384&s[33266])))break C;if(p=x,h=g,y>>>(15&m)&16384)break k;break i;case 11:if(m=1,c[0|n]==21)for(;m=m+1|0,c[0|(n=n+1|0)]==21;);if(s[e+8208>>2]<(0|m))break i;_=18+(m-O|0)|0;break c;case 0:if(_=19,p=x,h=g,s[e+8212>>2]>0)break k;break i;case 19:if(_=3,(0|(y=s[d+268>>2]))==32)break c;for(m=1+(h-p|0)|0;;){u:{l:if(p=s[e+632>>2])p=!!(0|Gr(p,y));else{x:{if((0|(p=s[e+600>>2]))>0){if((y=y-p|0)-1>>>0<255)break x;break u}if((p=y-192|0)>>>0<=413){p=128&c[344+(c[p+94240|0]+e|0)|0];break l}if(y>>>0>255)break u}p=128&c[344+(e+y|0)|0]}if(p)break i}if(m=m-en(d+268|0,m-1|0)|0,(0|(y=s[d+268>>2]))==32)break}break c;case 16:if(_=1,p=x,h=g,s[e+8184>>2])break k;break i;case 9:if(_=1,p=x,h=g,B)break k;break i;case 36:for(;;){if(_=50,p=x,!(g=(255&S)-32|0))break i;if((0|g)==14)break k;S=c[0|(T=T-1|0)]}case 35:break D;default:break Q}D:{if(p=S-32|0){if((0|p)==13)break D;break i}if(!ce)break i}_=22-E|0;break c}E:{for(;;){w=-1,y=g,g=g-1|0;D:if((0|M)==18&&(p=a[C+2|0],_=s[4788+((((0|p)<65?191:-65)+p<<2)+e|0)>>2]))for(me=y+1|0;;){if((0|(T=c[0|_]))==7){w=-1;break D}if((0|T)==126){w=0;break D}m=y;u:{if((0|(ne=(w=U(_))-1|0))>0)for(m=me-w|0,S=0,p=y;;){if(!c[0|(p=p-1|0)])break u;if((0|ne)==(0|(S=S+1|0)))break}l:if(!((0|(p=c[0|m]))!=(0|T)|!p))for(;;){if((0|(T=c[0|(_=_+1|0)]))!=(0|(p=c[0|(m=m+1|0)])))break l;if(!p)break}if(!T)break D}for(m=_;p=c[0|m],m=_=m+1|0,p;);}if(p=(0|(m=c[0|g]))==(0|M),(0|m)==32|(0|m)==(0|M))break E;if(!m){g=y;break G}if((0|w)!=-1)break}g=y;break G}g=y}h=p?g:h}_=0,h=(0|w)<0?h:g+1|0;break c}if((0|m)!=(0|S))break i;_=4,(0|m)!=32&&(_=(192&m)==128?0:21-O|0)}p=x;break k}if((0|m)!=(0|S))break i;y=(192&m)==128?0:21-E|0;break f}if(_=1,se)break i}D=_+D|0;continue}if(p=a[C+1|0],x=c[C+3|0],h=c[C+2|0],1&!(s[e+8208>>2]|4&h)&a[e+84|0])break i;n=C+4|0,y=0,x=127&x|(127&h)<<8|p<<16;break f}t:if(!(T>>>0<=(m=s[t>>2]+r|0)>>>0)){for(;;){if(c[0|m]!=101){if(p=m>>>0>>0,m=m+1|0,p)continue;break t}break}y=0,A=m;break f}y=0;break f}_=-20;break C}if(S=0,(0|(m=s[d+268>>2]))!=32)for(y=b+w|0,_=0;;){if(!_){b:{s:if(h=s[e+632>>2])m=!!(0|Gr(h,m));else{t:{if((0|(h=s[e+600>>2]))>0){if((m=m-h|0)-1>>>0<255)break t;break b}if((h=m-192|0)>>>0<=413){m=128&c[344+(c[h+94240|0]+e|0)|0];break s}if(m>>>0>255)break b}m=128&c[344+(e+m|0)|0]}m&&(S=S+1|0)}m=s[d+268>>2]}b:if(h=s[e+632>>2])_=!!(0|Gr(h,m));else{s:{if((0|(h=s[e+600>>2]))>0){if(_=0,(m=m-h|0)-1>>>0<255)break s;break b}if((h=m-192|0)>>>0<=413){_=128&c[344+(c[h+94240|0]+e|0)|0];break b}if(_=0,m>>>0>255)break b}_=128&c[344+(e+m|0)|0]}if(y=nn(d+268|0,y)+y|0,(0|(m=s[d+268>>2]))==32)break}if(!((0|p)>(0|S))){y=18+(p-E|0)|0;break f}}for(;p=c[0|n],n=i=n+1|0,p;);if(c[0|i]!=7)continue r;if(e=r+pe|0,s[t>>2]=s[t>>2]+(e||1),I)break e;break g}p=x,b=T,h=g,D=y+D|0;continue}b=b+w|0,_=21-E|0;break C}b=b+w|0,_=20-E|0}p=x,h=g,D=_+D|0}}P=86135}s[o+12>>2]=de,s[o+8>>2]=fe,s[o+4>>2]=P,s[o>>2]=I}z=d+384|0}function ge(e,t){var n,r=0,i=0,l=0,u=0,d=0,f=0,p=0,m=0,g=0,_=0,y=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0,P=0,F=0,I=0,L=0,ee=0,te=0;z=n=z-1168|0,s[n+928>>2]=0,s[n+932>>2]=0,s[n+920>>2]=0,s[n+924>>2]=0,s[n+912>>2]=0,s[n+916>>2]=0,s[n+904>>2]=0,s[n+908>>2]=0,s[n+896>>2]=0,s[n+900>>2]=0;A:{e:{if(e){if(c[0|e]|8&t)break e;break A}if(!(8&t))break A}if(Ti(n+1088|0,e,40),16&t){if((0|vr(gn(n+704|0,e)))<=0)break A;S=8&t}else(S=8&t)|c[n+1088|0]||(o[n+1088>>1]=c[85055]|c[85056]<<8,a[n+1090|0]=c[85057]),s[n+496>>2]=137584,s[n+500>>2]=47,s[n+504>>2]=47,H(r=n+512|0,85286,n+496|0),s[n+484>>2]=n+1088,s[n+480>>2]=r,H(r=n+704|0,85425,n+480|0),(0|vr(r))>0||(s[n+468>>2]=47,s[n+472>>2]=47,s[n+464>>2]=137584,H(r=n+512|0,85648,n+464|0),s[n+452>>2]=n+1088,s[n+448>>2]=r,H(n+704|0,85425,n+448|0));if(i=S?86012:85055,!(C=ft(n+704|0,85712))){if(r=0,3&t)break A;i=(0|Gn(r=n+1088|0))<0?i:r}if((x=2&t)||(r=s[47192])&&(gi(r),s[47192]=0),E=gn(n+992|0,i),T=gn(n+944|0,i),x?((r=xi(200992,43))&&(a[0|r]=0),s[n+432>>2]=e+3,H(e=n+704|0,86030,n+432|0),Li(200992,e)):(s[32972]=199592,Ti(200992,e,40),a[201088]=0,a[201040]=0,s[50299]=200992,s[50298]=201088,s[50297]=201040),Ue(x),C){for(O=s[30450],k=n+548|0,A=n+544|0,j=n+540|0,M=n+536|0,N=n+532|0,P=n+528|0,F=12|(e=n+512|0),I=8|e,L=4|e;It(n+704|0,190,C);){e=n+704|0;e:{if(c[n+704|0]!=35){g:if(!((0|(e=U(n+704|0)-1|0))<=0))for(;;){if(!((0|(i=a[0|(r=(n+704|0)+e|0)]))==32|i-9>>>0<5))break g;if(a[0|r]=0,!((0|(e=e-1|0))>0))break}if(!(e=Ve(n+704|0)))break e}a[0|e]=0}e=n+704|0;e:if(r=c[n+704|0])for(;;){if((0|(r=r<<24>>24))==32|r-9>>>0<5)break e;if(!(r=c[0|(e=e+1|0)]))break}if(a[0|e]=0,c[n+704|0])if(e=e+1|0,r=Ur(129744,n+704|0)){l=0,z=i=z-416|0;e:if(u=s[47192]){g:switch(r-19|0){case 16:if(s[i+32>>2]=i+412,(0|_e(e,84249,i+32|0))!=1)break e;s[u+324>>2]=s[i+412>>2];break e;case 8:wn(e,u+320|0,27);break e;case 2:if(s[i+48>>2]=188784,_e(e,84249,i+48|0),!(e=c[188784]))break e;s[u+152>>2]=e;break e;case 11:if(c[0|e]){for(d=s[30450];;)if(r=e,e=e+1|0,!((0|(l=a[0|r]))==32|l-9>>>0<5)){for(l=Pn(r),s[i+412>>2]=l,(0|l)>0&&(l>>>0<=31?s[u+104>>2]=s[u+104>>2]|1<>>0<=63?s[u+108>>2]=s[u+108>>2]|1<>2]=l,fi(d,84700,i- -64|0)),r=e);r=(e=r)+1|0,(l=a[0|e])-48>>>0<10|(32|l)-97>>>0<26;);if(!l)break}}8&(e=s[u+104>>2])&&(s[u+124>>2]=46,s[u+128>>2]=44),4&e&&(s[u+124>>2]=0);break e;default:if((65280&r)!=256)break e;s[i+16>>2]=24+(u+((255&r)<<2)|0),_e(e,84249,i+16|0);break e;case 1:s[i+144>>2]=u,s[i+148>>2]=u+4,_e(e,85642,i+144|0);break e;case 3:if(r=0,Pt(l=i+160|0,0,240),s[i+132>>2]=i+360,s[i+128>>2]=i+320,s[i+124>>2]=i+280,s[i+120>>2]=i+240,s[i+116>>2]=i+200,s[i+112>>2]=l,l=_e(e,85037,i+112|0),s[i+412>>2]=l,s[u+152>>2]=0,(0|l)<=0)break e;for(m=s[30450];;){r:if(Or(d=(i+160|0)+v(r,40)|0,85301)){C:{if((0|(p=s[34454]))>0)for(y=s[34455],e=0;;){if(!Or(d,y+v(e,68)|0))break C;if((0|p)==(0|(e=e+1|0)))break}s[i+96>>2]=d,fi(m,85562,i+96|0),l=s[i+412>>2];break r}a[156+(r+u|0)|0]=e}if(!((0|l)>(0|(r=r+1|0))))break}break e;case 9:s[i+88>>2]=u+20,s[i+84>>2]=u+16,s[i+80>>2]=u+8,_e(e,84778,i+80|0);break e;case 10:wn(e,u+12|0,29);break e;case 5:if((0|(m=Fn(e,i+160|0)))<=0)break e;if(r=0,e=0,m>>>0>=4)for(y=-4&m,d=u+304|0;p=i+160|0,o[d+(e<<1)>>1]=s[p+(e<<2)>>2],o[d+((f=1|e)<<1)>>1]=s[p+(f<<2)>>2],o[d+((f=2|e)<<1)>>1]=s[p+(f<<2)>>2],o[d+((f=3|e)<<1)>>1]=s[p+(f<<2)>>2],e=e+4|0,(0|y)!=(0|(l=l+4|0)););if(!(l=3&m))break e;for(;o[304+(u+(e<<1)|0)>>1]=s[(i+160|0)+(e<<2)>>2],e=e+1|0,(0|l)!=(0|(r=r+1|0)););break e;case 6:if((0|(m=Fn(e,i+160|0)))<=0)break e;if(r=0,e=0,m>>>0>=4)for(y=-4&m,d=u+296|0;p=i+160|0,a[e+d|0]=s[p+(e<<2)>>2],a[(f=1|e)+d|0]=s[p+(f<<2)>>2],a[(f=2|e)+d|0]=s[p+(f<<2)>>2],a[(f=3|e)+d|0]=s[p+(f<<2)>>2],e=e+4|0,(0|y)!=(0|(l=l+4|0)););if(!(l=3&m))break e;for(;a[296+(e+u|0)|0]=s[(i+160|0)+(e<<2)>>2],e=e+1|0,(0|l)!=(0|(r=r+1|0)););break e;case 7:if((0|(m=Fn(e,i+160|0)))<=0)break e;if(r=0,e=0,m>>>0>=4)for(y=-4&m,d=u+304|0;f=p=d+(e<<1)|0,g=h[p>>1],p=i+160|0,o[f>>1]=g+h[p+(e<<2)>>1],o[(g=d+((f=1|e)<<1)|0)>>1]=h[g>>1]+h[p+(f<<2)>>1],o[(g=d+((f=2|e)<<1)|0)>>1]=h[g>>1]+h[p+(f<<2)>>1],o[(g=d+((f=3|e)<<1)|0)>>1]=h[g>>1]+h[p+(f<<2)>>1],e=e+4|0,(0|y)!=(0|(l=l+4|0)););if(!(l=3&m))break e;for(;o[(d=u+(e<<1)|0)+304>>1]=h[d+304>>1]+h[(i+160|0)+(e<<2)>>1],e=e+1|0,(0|l)!=(0|(r=r+1|0)););break e;case 4:a[u+169|0]=1;break e;case 0:break g}a[u+208|0]=1}else s[i>>2]=kr(129568,r),fi(s[30450],89101,i);z=i+416|0}else{e:switch(Ur(131904,n+704|0)-1|0){case 1:if(x||(a[n+1040|0]=0,s[n+512>>2]=5,s[n+32>>2]=n+1040,s[n+36>>2]=n+512,_e(e,86237,n+32|0),s[n+1040>>2]==1769103734&s[n+1044>>2]==7630433))continue;if((e=U(n+1040|0)+2|0)>>>0<99-w>>>0&&(a[0|(r=w+201088|0)]=s[n+512>>2],gn(r+1|0,n+1040|0),w=e+w|0),!ee){if(e=0,(r=d=n+1040|0)||(r=s[57150])){if(e=86875,s[(i=z-32|0)+24>>2]=0,s[i+28>>2]=0,s[i+16>>2]=0,s[i+20>>2]=0,s[i+8>>2]=0,s[i+12>>2]=0,s[i>>2]=0,s[i+4>>2]=0,u=0,l=c[86875])if(c[86876]){for(;s[(u=i+(l>>>3&28)|0)>>2]=s[u>>2]|1<>>3&28)>>2]>>>l&1))break g;if(l=c[e+1|0],e=e+1|0,!l)break}u=e-r|0}else{for(e=r;i=e,e=e+1|0,c[0|i]==(0|l););u=i-r|0}if(c[0|(e=u+r|0)]){r=86875,z=l=z-32|0,i=a[86875];g:if(c[86876]&&i){if(Pt(l,0,32),i=c[86875])for(;s[(u=l+(i>>>3&28)|0)>>2]=s[u>>2]|1<>>3&28)>>2]>>>i&1)break g;if(i=c[r+1|0],r=r+1|0,!i)break}}else r=dn(e,i);z=l+32|0,c[0|(r=(r-e|0)+e|0)]?(s[57150]=r+1,a[0|r]=0):s[57150]=0}else s[57150]=0,e=0}r=gn(E,e),gn(T,e),Gn(gn(n+896|0,e)),s[47192]=ue(r),Ti(s[32972]+40|0,d,20)}ee=1;continue;case 0:if(x)continue;for(;r=e,e=e+1|0,(0|(i=a[0|r]))==32|i-9>>>0<5;);Ti(201040,r,40);continue;case 2:s[n+1152>>2]=0,r=n+512|0,s[n+48>>2]=r,s[n+52>>2]=n+1152,_e(e,86237,n+48|0),a[201200]=Ur(132112,r),a[201201]=s[n+1152>>2];continue;case 4:s[n+64>>2]=T,_e(e,86939,n- -64|0);continue;case 3:s[n+80>>2]=n+896,_e(e,86939,n+80|0);continue;case 8:if(s[n+1152>>2]=100,s[n+1164>>2]=100,s[n+1148>>2]=100,s[n+112>>2]=n+1144,s[n+1144>>2]=0,s[n+96>>2]=n+512,s[n+100>>2]=n+1152,s[n+104>>2]=n+1164,s[n+108>>2]=n+1148,(0|_e(e,91156,n+96|0))<2||(e=s[n+512>>2])>>>0>8||((0|(r=s[n+1152>>2]))>=0&&(i=s[32972]+(e<<1)|0,r=b(_=2.56001*(0|r))<2147483648?~~_:-2147483648,o[i+236>>1]=r,o[i+164>>1]=r),(0|(r=s[n+1164>>2]))>=0&&(i=s[32972]+(e<<1)|0,r=b(_=2.56001*(0|r))<2147483648?~~_:-2147483648,o[i+254>>1]=r,o[i+182>>1]=r),(0|(i=s[n+1148>>2]))<0?r=s[32972]:(d=(r=s[32972])+(e<<1)|0,i=b(_=2.56001*(0|i))<2147483648?~~_:-2147483648,o[d+200>>1]=i),o[218+((e<<1)+r|0)>>1]=s[n+1144>>2],e))continue;o[r+200>>1]=(0|v(o[r+200>>1],105))/100;continue;case 9:if(s[n+132>>2]=n+696,s[n+128>>2]=n+700,(0|_e(e,87106,n+128|0))!=2)continue;if(e=s[32972],r=s[n+700>>2],s[e+64>>2]=(r<<12)-36864,s[e+68>>2]=v(s[n+696>>2]-r|0,108),b(_=256*((r-82|0)/82*.25+1))<2147483648){s[e+116>>2]=~~_;continue}s[e+116>>2]=-2147483648;continue;case 35:te||Gn(n+896|0),s[n+1164>>2]=0,a[n+1156|0]=c[91267],s[n+1152>>2]=c[91263]|c[91264]<<8|c[91265]<<16|c[91266]<<24,s[n+144>>2]=n+1164,s[n+148>>2]=n+512,s[n+152>>2]=n+1152,(0|_e(e,91302,n+144|0))<2|s[49848]>59||(e=In(n+512|0))&&(a[v(s[49848],3)+199408|0]=e,e=In(n+1152|0),r=s[49848],i=v(r,3)+199408|0,a[i+1|0]=e,s[49848]=r+1,a[i+2|0]=s[n+1164>>2]),te=1;continue;case 10:s[n+1140>>2]=0,r=s[32972],s[r+100>>2]=0,s[n+164>>2]=r+100,s[n+160>>2]=r+96,_e(e,87106,n+160|0);continue;case 11:if(s[n+176>>2]=n+1140,(0|_e(e,87268,n+176|0))!=1)continue;s[s[32972]+88>>2]=s[n+1140>>2]<<5;continue;case 12:if(s[n+192>>2]=n+1140,(0|_e(e,87268,n+192|0))!=1)continue;s[s[32972]+92>>2]=s[n+1140>>2];continue;case 13:if(s[n+208>>2]=n+1140,(0|_e(e,87268,n+208|0))!=1)continue;r=s[32972],(0|(e=s[n+1140>>2]))>=5&&(s[r+108>>2]=1,s[n+1140>>2]=4,e=4),s[r+104>>2]=e+1;continue;case 14:for(s[n+552>>2]=-1,s[n+556>>2]=-1,s[n+544>>2]=-1,s[n+548>>2]=-1,s[n+536>>2]=-1,s[n+540>>2]=-1,s[n+528>>2]=-1,s[n+532>>2]=-1,s[n+240>>2]=P,s[n+244>>2]=N,s[n+248>>2]=M,s[n+252>>2]=j,s[n+256>>2]=A,s[n+260>>2]=k,s[n+520>>2]=-1,s[n+524>>2]=-1,s[n+512>>2]=-1,s[n+516>>2]=-1,s[n+228>>2]=L,s[n+232>>2]=I,s[n+236>>2]=F,s[n+224>>2]=n+512,_e(e,84222,n+224|0),y=s[32972],e=0,l=s[n+516>>2],i=0;;){if(r=i,u=l,d=e,(0|(i=s[(l=(e<<=2)+(n+512|0)|0)>>2]))==-1&&(i=8e3,s[l>>2]=8e3,d&&(s[(n+512|0)+(4|e)>>2]=s[508+(e+n|0)>>2])),l=s[(n+512|0)+(4|e)>>2],!((0|r)>=(0|(i=(0|i)/8|0))||(0|(p=i-r|0))<=0||(m=r+1|0,e=r,1&p&&(a[344+(r+y|0)|0]=(0|u)>=255?255:u,e=m),(0|i)==(0|m))))for(m=l-u|0;g=y+344|0,f=u+((0|v(m,e-r|0))/(0|p)|0)|0,a[g+e|0]=(0|f)>=255?255:f,f=u+((0|v(m,(D=e+1|0)-r|0))/(0|p)|0)|0,a[g+D|0]=(0|f)>=255?255:f,(0|i)!=(0|(e=e+2|0)););if(e=d+2|0,!(d>>>0<10))break}continue;case 15:if(s[n+272>>2]=n+1140,(0|_e(e,87268,n+272|0))!=1)continue;s[s[32972]+112>>2]=(s[n+1140>>2]<<6)/100;continue;case 16:r=s[32972],s[(i=r+300|0)>>2]=0,s[i+4>>2]=0,s[(l=r+292|0)>>2]=0,s[l+4>>2]=0,s[(u=r+284|0)>>2]=0,s[u+4>>2]=0,s[(d=r+276|0)>>2]=0,s[d+4>>2]=0,s[n+316>>2]=r+304,s[n+312>>2]=i,s[n+308>>2]=r+296,s[n+304>>2]=l,s[n+300>>2]=r+288,s[n+296>>2]=u,s[n+292>>2]=r+280,s[n+288>>2]=d,r=_e(e,84553,n+288|0),e=s[32972],s[e+272>>2]=r,s[e+276>>2]=0-s[e+276>>2],s[e+284>>2]=0-s[e+284>>2],s[e+292>>2]=0-s[e+292>>2],s[e+300>>2]=0-s[e+300>>2];continue;case 17:r=s[32972],s[(i=r+336|0)>>2]=0,s[i+4>>2]=0,s[(l=r+328|0)>>2]=0,s[l+4>>2]=0,s[(u=r+320|0)>>2]=0,s[u+4>>2]=0,s[(d=r+312|0)>>2]=0,s[d+4>>2]=0,s[n+348>>2]=r+340,s[n+344>>2]=i,s[n+340>>2]=r+332,s[n+336>>2]=l,s[n+332>>2]=r+324,s[n+328>>2]=u,s[n+324>>2]=r+316,s[n+320>>2]=d,e=_e(e,84553,n+320|0),s[s[32972]+308>>2]=e;continue;case 36:r=s[32972],s[n+352>>2]=r+120,s[n+356>>2]=r+124,s[n+1140>>2]=_e(e,87106,n+352|0);continue;case 33:s[n+368>>2]=s[32972]+84,_e(e,87268,n+368|0),ot(3);continue;case 31:r=s[32972],s[(i=r+156|0)>>2]=0,s[i+4>>2]=0,s[(l=r+148|0)>>2]=0,s[l+4>>2]=0,s[(u=r+140|0)>>2]=0,s[u+4>>2]=0,s[(d=r+132|0)>>2]=0,s[d+4>>2]=0,s[n+412>>2]=r+160,s[n+408>>2]=i,s[n+404>>2]=r+152,s[n+400>>2]=l,s[n+396>>2]=r+144,s[n+392>>2]=u,s[n+388>>2]=r+136,s[n+384>>2]=d,_e(e,84553,n+384|0),e=s[32972],s[e+152>>2]=s[e+152>>2]-40;continue;case 32:s[n+416>>2]=145740,_e(e,87268,n+416|0),ot(3);continue;case 6:case 7:continue;default:break e}s[n+16>>2]=n+704,fi(O,87359,n+16|0)}}Sr(C)}e:{if((e=s[47192])|x){if(x)break e}else e=ue(E),s[47192]=e;g:{if(!S){if((0|(e=Gn(n+896|0)))<0&&(s[n>>2]=n+896,fi(s[30450],87567,n),e=0),s[s[32972]+60>>2]=e,r=s[47192],s[r+292>>2]=e,We(r,T,4&t),c[132848])break g;gi(s[47192]),r=0;break A}s[s[32972]+60>>2]=0,s[e+292>>2]=0}a[w+201088|0]=0}r=s[32972]}return z=n+1168|0,r}function _e(e,t,n){var r,i,l,u=0,d=0,f=0,p=0,m=0,h=0,g=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0;z=l=z-16|0,s[l+12>>2]=n,z=u=z-144|0,r=Pt(u,0,144),s[r+76>>2]=-1,s[r+44>>2]=e,s[r+32>>2]=18,s[r+84>>2]=e,u=t,O=n,e=0,z=i=z-304|0;A:{e:{g:if(s[r+4>>2]||($n(r),s[r+4>>2])){if(!(t=c[0|u]))break A;r:{C:{a:{I:{for(;;){f:{i:if((0|(t&=255))==32|t-9>>>0<5){for(;t=u,u=u+1|0,(0|(n=c[t+1|0]))==32|n-9>>>0<5;);for(tr(r,0,0);(0|(n=s[r+4>>2]))==s[r+104>>2]?n=Ot(r):(s[r+4>>2]=n+1,n=c[0|n]),(0|n)==32|n-9>>>0<5;);u=s[r+4>>2],(0|(n=s[r+116>>2]))>0|(0|n)>=0&&(u=u-1|0,s[r+4>>2]=u),u=n=u-s[r+44>>2]|0,m=C+s[r+124>>2]|0,m=(d=n>>31)+((n=b+s[r+120>>2]|0)>>>0>>0?m+1|0:m)|0,C=(b=n+u|0)>>>0>>0?m+1|0:m}else{b:{s:{t:{if(c[0|u]==37){if((0|(t=c[u+1|0]))==42)break t;if((0|t)!=37)break s}if(tr(r,0,0),c[0|u]!=37)(0|(t=s[r+4>>2]))==s[r+104>>2]?t=Ot(r):(s[r+4>>2]=t+1,t=c[0|t]);else{for(;(0|(t=s[r+4>>2]))==s[r+104>>2]?t=Ot(r):(s[r+4>>2]=t+1,t=c[0|t]),(0|t)==32|t-9>>>0<5;);u=u+1|0}if(c[0|u]!=(0|t)){if((0|(n=s[r+116>>2]))>0|(0|n)>=0&&(s[r+4>>2]=s[r+4>>2]-1),(0|t)>=0||(f=0,k))break A;break g}p=(d=t=s[r+4>>2]-s[r+44>>2]|0)>>31,t=C+s[r+124>>2]|0,f=((n=b+s[r+120>>2]|0)>>>0>>0?t+1|0:t)+p|0,C=(b=n+d|0)>>>0>>0?f+1|0:f,t=u;break i}h=0,t=u+2|0;break b}c[u+2|0]!=36|t-48>>>0>=10?(h=s[O>>2],O=O+4|0,t=u+1|0):(t=c[u+1|0]-48|0,s[(n=z-16|0)+12>>2]=O,t=(t>>>0>1?(t<<2)-4|0:0)+O|0,s[n+8>>2]=t+4,h=s[t>>2],t=u+3|0)}if(g=0,u=0,c[0|t]-48>>>0<10)for(;u=(c[0|t]+v(u,10)|0)-48|0,n=c[t+1|0],t=t+1|0,n-48>>>0<10;);(0|(x=c[0|t]))==109&&(y=0,g=!!(0|h),x=c[t+1|0],e=0,t=t+1|0),t=(n=t)+1|0,d=3,f=g;b:{s:switch(x-65|0){case 39:d=n+2|0,t=(n=c[n+1|0]==104)?d:t,d=n?-2:-1;break b;case 43:d=n+2|0,t=(n=c[n+1|0]==108)?d:t,d=n?3:1;break b;case 51:case 57:d=1;break b;case 11:d=2;break b;case 41:break b;case 0:case 2:case 4:case 5:case 6:case 18:case 23:case 26:case 32:case 34:case 35:case 36:case 37:case 38:case 40:case 45:case 46:case 47:case 50:case 52:case 55:break s;default:break r}d=0,t=n}f=d,E=(d=(47&(n=c[0|t]))==3)?1:f;b:if((0|(T=d?32|n:n))!=91){s:{if((0|T)!=110){if((0|T)!=99)break s;u=(0|u)<=1?1:u;break b}Er(h,E,b,C);break i}for(tr(r,0,0);(0|(n=s[r+4>>2]))==s[r+104>>2]?n=Ot(r):(s[r+4>>2]=n+1,n=c[0|n]),(0|n)==32|n-9>>>0<5;);n=s[r+4>>2],(0|(d=s[r+116>>2]))>0|(0|d)>=0&&(n=n-1|0,s[r+4>>2]=n),d=n=n-s[r+44>>2]|0,m=C+s[r+124>>2]|0,C=(f=n>>31)+((n=b+s[r+120>>2]|0)>>>0>>0?m+1|0:m)|0,C=(b=n+d|0)>>>0>>0?C+1|0:C}if(S=u,tr(r,u,w=u>>31),(0|(n=s[r+4>>2]))==s[r+104>>2]){if((0|Ot(r))<0)break C}else s[r+4>>2]=n+1;(0|(n=s[r+116>>2]))>0|(0|n)>=0&&(s[r+4>>2]=s[r+4>>2]-1),n=16;b:{s:{t:{n:{k:switch(T-88|0){default:if((n=T-65|0)>>>0>6|!(1<>2]-s[r+44>>2]|0,s[r+120>>2]!=(0-n|0)|s[r+124>>2]!=(0-((n>>31)+!!(0|n)|0)|0))break t;break a;case 3:case 11:case 27:if((16|T)==115){if(Pt(i+32|0,-1,257),a[i+32|0]=0,(0|T)!=115)break s;a[i+65|0]=0,a[i+46|0]=0,o[i+42>>1]=0,o[i+44>>1]=0;break s}Pt(i+32|0,p=(0|(d=c[t+1|0]))==94,257),a[i+32|0]=0,n=p?t+2|0:t+1|0;o:{B:{c:{if((0|(t=c[(p?2:1)+t|0]))!=45){if((0|t)==93)break c;d=(0|d)!=94,t=n;break o}d=(0|d)!=94,a[i+78|0]=d;break B}d=(0|d)!=94,a[i+126|0]=d}t=n+1|0}for(;;){if((0|(n=c[0|t]))==45){if(n=45,!(!(p=c[t+1|0])|(0|p)==93)){if(f=t+1|0,p>>>0<=(t=c[t-1|0])>>>0)n=p;else for(;a[(t=t+1|0)+(i+32|0)|0]=d,(n=c[0|f])>>>0>t>>>0;);t=f}}else{if(!n)break C;if((0|n)==93)break s}a[33+(n+i|0)|0]=d,t=t+1|0}case 23:n=8;break n;case 12:case 29:n=10;break n;case 1:case 2:case 4:case 5:case 6:case 7:case 8:case 10:case 16:case 18:case 19:case 20:case 21:case 22:case 25:case 26:case 28:case 30:case 31:break b;case 0:case 24:case 32:break n;case 17:break k}n=0}p=0,m=0,d=0,f=0,x=0,z=D=z-16|0;n:if((0|n)!=1&n>>>0<=36){for(;(0|(u=s[r+4>>2]))==s[r+104>>2]?u=Ot(r):(s[r+4>>2]=u+1,u=c[0|u]),(0|u)==32|u-9>>>0<5;);k:{o:switch(u-43|0){case 0:case 2:break o;default:break k}x=(0|u)==45?-1:0,(0|(u=s[r+4>>2]))==s[r+104>>2]?u=Ot(r):(s[r+4>>2]=u+1,u=c[0|u])}k:{o:{B:{c:{if(!(!!(0|n)&(0|n)!=16|(0|u)!=48)){if((0|(u=s[r+4>>2]))==s[r+104>>2]?u=Ot(r):(s[r+4>>2]=u+1,u=c[0|u]),(-33&u)==88){if(n=16,(0|(u=s[r+4>>2]))==s[r+104>>2]?u=Ot(r):(s[r+4>>2]=u+1,u=c[0|u]),c[u+121329|0]<16)break B;(0|(n=s[r+116>>2]))>0|(0|n)>=0&&(s[r+4>>2]=s[r+4>>2]-1),tr(r,0,0);break n}if(n)break c;n=8;break B}if(!((n||=10)>>>0>c[u+121329|0])){(0|(n=s[r+116>>2]))>0|(0|n)>=0&&(s[r+4>>2]=s[r+4>>2]-1),tr(r,0,0),s[56798]=28;break n}}if((0|n)==10){if((d=u-48|0)>>>0<=9){for(n=0;f=(n=v(n,10)+d|0)>>>0<429496729,(0|(u=s[r+4>>2]))==s[r+104>>2]?u=Ot(r):(s[r+4>>2]=u+1,u=c[0|u]),f&(d=u-48|0)>>>0<=9;);p=n}c:if(!(d>>>0>9)){for(n=hr(p,0,10,0),f=B;;){if(m=f,f=(0|(m=(p=n+d|0)>>>0>>0?m+1|0:m))==429496729&p>>>0>=2576980378|m>>>0>429496729,(0|(n=s[r+4>>2]))==s[r+104>>2]?u=Ot(r):(s[r+4>>2]=n+1,u=c[0|n]),f|(d=u-48|0)>>>0>9)break c;if(n=hr(p,m,10,0),!((0|(f=B))==-1&~d>>>0>=n>>>0|(0|f)!=-1))break}n=10;break o}if(n=10,d>>>0<=9)break o;break k}}if(n-1&n){if((f=c[u+121329|0])>>>0>>0){for(;p=(d=v(n,d)+f|0)>>>0<119304647,(0|(u=s[r+4>>2]))==s[r+104>>2]?u=Ot(r):(s[r+4>>2]=u+1,u=c[0|u]),p&(f=c[u+121329|0])>>>0>>0;);p=d}if(n>>>0<=f>>>0)break o;for(;;){if(d=hr(p,m,n,0),(0|(S=B))==-1&~(f&=255)>>>0>>0||(m=S,m=(p=d+f|0)>>>0>>0?m+1|0:m,(0|(u=s[r+4>>2]))==s[r+104>>2]?u=Ot(r):(s[r+4>>2]=u+1,u=c[0|u]),n>>>0<=(f=c[u+121329|0])>>>0))break o;if(hn(D,n,0,0,0,p,m,0,0),s[D+8>>2]|s[D+12>>2])break}}else{if(S=a[84400+(v(n,23)>>>5&7)|0],(d=c[u+121329|0])>>>0>>0){for(;p=(f=f<>>0<134217728,(0|(u=s[r+4>>2]))==s[r+104>>2]?u=Ot(r):(s[r+4>>2]=u+1,u=c[0|u]),p&(d=c[u+121329|0])>>>0>>0;);p=f}if(!(n>>>0<=d>>>0||(w=31&S,(63&S)>>>0>=32?(f=0,w=-1>>>w|0):w=(f=-1>>>w|0)|(1<>>0>w>>>0)))for(;;){if(A=255&d,d=p,u=31&S,(63&S)>>>0>=32?(m=d<>>32-u|m<>2]))==s[r+104>>2]?u=Ot(r):(s[r+4>>2]=u+1,u=c[0|u]),n>>>0<=(d=c[u+121329|0])>>>0)break o;if(!((0|f)==(0|m)&p>>>0<=w>>>0|f>>>0>m>>>0))break}}}if(!(c[u+121329|0]>=n>>>0)){for(;(0|(u=s[r+4>>2]))==s[r+104>>2]?u=Ot(r):(s[r+4>>2]=u+1,u=c[0|u]),c[u+121329|0]>>0;);s[56798]=68,x=0,p=-1,m=-1}}(0|(n=s[r+116>>2]))>0|(0|n)>=0&&(s[r+4>>2]=s[r+4>>2]-1),p=(n=p^x)-x|0,m=((u=x>>31)^m)-((n>>>0>>0)+u|0)|0}else s[56798]=28;if(z=D+16|0,n=s[r+4>>2]-s[r+44>>2]|0,s[r+120>>2]==(0-n|0)&s[r+124>>2]==(0-((n>>31)+!!(0|n)|0)|0))break a;if(!(!h|(0|T)!=112)){s[h>>2]=p;break b}Er(h,E,p,m);break b}if(!h)break b;u=s[i+16>>2],n=s[i+20>>2],d=s[i+8>>2],g=s[i+12>>2];t:switch(0|E){case 0:z=m=z-32|0;n:if(0|(f=(p=2147483647&n)-1065418752|0)>>>0<(S=p-1082064896|0)>>>0){if(p=(33554431&n)<<7|u>>>25,S=f=0,!(!f&(0|(u&=33554431))==16777216?!(d|g):!f&u>>>0<16777216)){f=p+1073741825|0;break n}if(f=p+1073741824|0,16777216^u|d|g|S)break n;f=(1&p)+f|0}else(!u&(0|p)==2147418112?!(d|g):p>>>0<2147418112)?(f=2139095040,p>>>0>1082064895||(f=0,(p=p>>>16|0)>>>0<16145||(rn(m+16|0,d,g,u,f=65535&n|65536,p-16129|0),Qt(m,d,g,u,f,16257-p|0),u=s[m+8>>2],f=(33554431&s[m+12>>2])<<7|u>>>25,p=s[m>>2]|!!(s[m+16>>2]|s[m+24>>2]|s[m+20>>2]|s[m+28>>2]),g=s[m+4>>2],(!(d=0)&(0|(u&=33554431))==16777216?!(p|g):!d&u>>>0<16777216)?16777216^u|p|d|g||(f=(1&f)+f|0):f=f+1|0))):f=4194303&((33554431&n)<<7|u>>>25)|2143289344;z=m+32|0,s[h>>2]=-2147483648&n|f;break b;case 1:_[h>>3]=mt(d,g,u,n);break b;case 2:break t;default:break b}s[h>>2]=d,s[h+4>>2]=g,s[h+8>>2]=u,s[h+12>>2]=n;break b}d=(D=(0|T)!=99)?31:u+1|0;s:if((0|E)!=1){if(g){if(u=0,!(n=ve(d)))break I;for(;;){for(e=n;;){if((0|(n=s[r+4>>2]))==s[r+104>>2]?n=Ot(r):(s[r+4>>2]=n+1,n=c[0|n]),!c[33+(n+i|0)|0]){d=0,y=e;break s}if(a[e+u|0]=n,(0|d)==(0|(u=u+1|0)))break}if(f=1,!(n=Xe(e,d=d<<1|1)))break}y=e,e=0;break r}if(u=0,h)for(;;){if((0|(e=s[r+4>>2]))==s[r+104>>2]?e=Ot(r):(s[r+4>>2]=e+1,e=c[0|e]),!c[33+(e+i|0)|0]){d=0,y=e=h;break s}a[u+h|0]=e,u=u+1|0}for(;(0|(e=s[r+4>>2]))==s[r+104>>2]?e=Ot(r):(s[r+4>>2]=e+1,e=c[0|e]),c[33+(e+i|0)|0];);e=0,y=0,d=0}else{if(n=h,g&&!(n=ve(d<<2)))break I;for(s[i+296>>2]=0,s[i+300>>2]=0,u=0;;){e=n;t:{for(;;){if((0|(n=s[r+4>>2]))==s[r+104>>2]?n=Ot(r):(s[r+4>>2]=n+1,n=c[0|n]),!c[33+(n+i|0)|0])break t;a[i+27|0]=n,p=i+28|0,n=s[(f=(n=i+296|0)||228604)>>2];n:{k:{o:{B:{if(!(y=i+27|0)){if(n)break B;n=0;break n}if(!n){if((0|(m=(n=c[0|y])<<24>>24))>=0){p&&(s[p>>2]=n),n=!!(0|m);break n}if(!s[s[56841]>>2]){if(n=1,!p)break o;s[p>>2]=57343&m,n=1;break n}if((n=n-194|0)>>>0>50)break B;n=s[124752+(n<<2)>>2];break k}if(x=1,!(((E=(m=c[0|y])>>>3|0)-16|(n>>26)+E)>>>0>7))for(;;){if(x=x-1|0,(0|(n=m-128|n<<6))>=0){s[f>>2]=0,p&&(s[p>>2]=n),n=1-x|0;break n}if(!x)break k;if((192&(m=c[0|(y=y+1|0)]))!=128)break}}s[f>>2]=0,s[56798]=25,n=-1}break n}s[f>>2]=n,n=-2}if((0|n)!=-2){if(y=0,(0|n)==-1)break C;if(e&&(s[(u<<2)+e>>2]=s[i+28>>2],u=u+1|0),!(!g|(0|u)!=(0|d)))break}}if(f=1,n=Xe(e,(d=d<<1|1)<<2))continue;break r}break}if(y=0,d=e,i+296|0&&s[i+296>>2])break C}if(n=s[r+4>>2],(0|(p=s[r+116>>2]))>0|(0|p)>=0&&(n=n-1|0,s[r+4>>2]=n),n=(p=n-s[r+44>>2]|0)+s[r+120>>2]|0,m=s[r+124>>2]+(p>>31)|0,!((m=n>>>0

>>0?m+1|0:m)|n)|!(D|(0|n)==(0|S)&(0|m)==(0|w)))break f;g&&(s[h>>2]=e),(0|T)!=99&&(d&&(s[(u<<2)+d>>2]=0),y?a[u+y|0]=0:y=0),e=d}u=n=s[r+4>>2]-s[r+44>>2]|0,f=C+s[r+124>>2]|0,C=(d=n>>31)+((n=b+s[r+120>>2]|0)>>>0>>0?f+1|0:f)|0,C=(b=n+u|0)>>>0>>0?C+1|0:C,k=!!(0|h)+k|0}if(u=t+1|0,t=c[t+1|0])continue;break A}break}e=d;break a}f=1,y=0,e=0;break r}f=g;break e}f=g}if(k)break e}k=-1}f&&(Re(y),Re(e))}return z=i+304|0,z=r+144|0,z=l+16|0,k}function ve(e){var t,n=0,r=0,i=0,a=0,o=0,l=0,u=0,d=0,f=0,p=0;z=t=z-16|0;A:{e:{g:{r:{C:{a:{I:{f:{i:{if((e|=0)>>>0<=244){if(3&(n=(l=s[57152])>>>(r=(u=e>>>0<11?16:e+11&-8)>>>3|0)|0)){n=(e=(r=r+(1&~n)|0)<<3)+228648|0,i=s[e+228656>>2],(0|n)==(0|(e=s[i+8>>2]))?s[57152]=oi(-2,r)&l:(s[e+12>>2]=n,s[n+8>>2]=e),e=i+8|0,n=r<<3,s[i+4>>2]=3|n,s[(n=n+i|0)+4>>2]=1|s[n+4>>2];break A}if((p=s[57154])>>>0>=u>>>0)break i;if(n){n=(e=(i=Ci(0-(e=(0-(e=2<>2],(0|n)==(0|(e=s[a+8>>2]))?(l=oi(-2,i)&l,s[57152]=l):(s[e+12>>2]=n,s[n+8>>2]=e),s[a+4>>2]=3|u,i=(e=i<<3)-u|0,s[(r=a+u|0)+4>>2]=1|i,s[e+a>>2]=i,p&&(n=228648+(-8&p)|0,o=s[57157],(e=1<<(p>>>3))&l?e=s[n+8>>2]:(s[57152]=e|l,e=n),s[n+8>>2]=o,s[e+12>>2]=o,s[o+12>>2]=n,s[o+8>>2]=e),e=a+8|0,s[57157]=r,s[57154]=i;break A}if(!(f=s[57153]))break i;for(r=s[228912+(Ci(0-f&f)<<2)>>2],o=(-8&s[r+4>>2])-u|0,n=r;(e=s[n+16>>2])||(e=s[n+20>>2]);)o=(i=(n=(-8&s[e+4>>2])-u|0)>>>0>>0)?n:o,r=i?e:r,n=e;if(d=s[r+24>>2],(0|(i=s[r+12>>2]))!=(0|r)){e=s[r+8>>2],s[e+12>>2]=i,s[i+8>>2]=e;break e}if(!(e=s[(n=r+20|0)>>2])){if(!(e=s[r+16>>2]))break f;n=r+16|0}for(;a=n,i=e,(e=s[(n=e+20|0)>>2])||(n=i+16|0,e=s[i+16>>2]););s[a>>2]=0;break e}if(u=-1,!(e>>>0>4294967231)&&(u=-8&(e=e+11|0),f=s[57153])){o=0-u|0,l=0,u>>>0<256||(l=31,u>>>0>16777215||(l=62+((u>>>38-(e=x(e>>>8|0))&1)-(e<<1)|0)|0));b:{s:{if(n=s[228912+(l<<2)>>2])for(e=0,r=u<<((0|l)==31?0:25-(l>>>1|0));;){if(!((a=(-8&s[n+4>>2])-u|0)>>>0>=o>>>0||(i=n,o=a,a))){o=0,e=n;break s}if(a=s[n+20>>2],n=s[16+((r>>>29&4)+n|0)>>2],e=a?(0|a)==(0|n)?e:a:e,r<<=1,!n)break}else e=0;if(!(e|i)){if(i=0,!(e=(0-(e=2<>2]}if(!e)break b}for(;o=(r=(n=(-8&s[e+4>>2])-u|0)>>>0>>0)?n:o,i=r?e:i,e=(n=s[e+16>>2])||s[e+20>>2];);}if(!(!i|s[57154]-u>>>0<=o>>>0)){if(l=s[i+24>>2],(0|i)!=(0|(r=s[i+12>>2]))){e=s[i+8>>2],s[e+12>>2]=r,s[r+8>>2]=e;break g}if(!(e=s[(n=i+20|0)>>2])){if(!(e=s[i+16>>2]))break I;n=i+16|0}for(;a=n,r=e,(e=s[(n=e+20|0)>>2])||(n=r+16|0,e=s[r+16>>2]););s[a>>2]=0;break g}}}if((e=s[57154])>>>0>=u>>>0){i=s[57157],(n=e-u|0)>>>0>=16?(s[(r=i+u|0)+4>>2]=1|n,s[e+i>>2]=n,s[i+4>>2]=3|u):(s[i+4>>2]=3|e,s[(e=e+i|0)+4>>2]=1|s[e+4>>2],r=0,n=0),s[57154]=n,s[57157]=r,e=i+8|0;break A}if((d=s[57155])>>>0>u>>>0){n=d-u|0,s[57155]=n,e=(r=s[57158])+u|0,s[57158]=e,s[e+4>>2]=1|n,s[r+4>>2]=3|u,e=r+8|0;break A}if(e=0,f=u+47|0,s[57270]?r=s[57272]:(s[57273]=-1,s[57274]=-1,s[57271]=4096,s[57272]=4096,s[57270]=t+12&-16^1431655768,s[57275]=0,s[57263]=0,r=4096),(n=(a=f+r|0)&(o=0-r|0))>>>0<=u>>>0||(i=s[57262])&&i>>>0<(l=(r=s[57260])+n|0)>>>0|r>>>0>=l>>>0)break A;i:{if(!(4&c[229052])){b:{s:{t:{n:{if(i=s[57158])for(e=229056;;){if((r=s[e>>2])>>>0<=i>>>0&i>>>0>2]>>>0)break n;if(!(e=s[e+8>>2]))break}if((0|(r=Mr(0)))==-1||(l=n,(e=(i=s[57271])-1|0)&r&&(l=(n-r|0)+(e+r&0-i)|0),l>>>0<=u>>>0)||(i=s[57262])&&i>>>0<(o=(e=s[57260])+l|0)>>>0|e>>>0>=o>>>0)break b;if((0|r)!=(0|(e=Mr(l))))break t;break i}if((0|(r=Mr(l=o&a-d)))==(s[e>>2]+s[e+4>>2]|0))break s;e=r}if((0|e)==-1)break b;if(u+48>>>0<=l>>>0){r=e;break i}if((0|Mr(r=(r=s[57272])+(f-l|0)&0-r))==-1)break b;l=r+l|0,r=e;break i}if((0|r)!=-1)break i}s[57263]=4|s[57263]}if((0|(r=Mr(n)))==-1|(0|(e=Mr(0)))==-1|e>>>0<=r>>>0||(l=e-r|0)>>>0<=u+40>>>0)break r}e=s[57260]+l|0,s[57260]=e,e>>>0>g[57261]&&(s[57261]=e);i:{if(a=s[57158]){for(e=229056;;){if(((i=s[e>>2])+(n=s[e+4>>2])|0)==(0|r))break i;if(!(e=s[e+8>>2]))break}break a}for((e=s[57156])>>>0<=r>>>0&&e||(s[57156]=r),e=0,s[57265]=l,s[57264]=r,s[57160]=-1,s[57161]=s[57270],s[57267]=0;n=(i=e<<3)+228648|0,s[i+228656>>2]=n,s[i+228660>>2]=n,(0|(e=e+1|0))!=32;);n=(i=l-40|0)-(e=r+8&7?-8-r&7:0)|0,s[57155]=n,e=e+r|0,s[57158]=e,s[e+4>>2]=1|n,s[4+(r+i|0)>>2]=40,s[57159]=s[57274];break C}if(8&c[e+12|0]|i>>>0>a>>>0|r>>>0<=a>>>0)break a;s[e+4>>2]=n+l,r=(e=a+8&7?-8-a&7:0)+a|0,s[57158]=r,e=(n=s[57155]+l|0)-e|0,s[57155]=e,s[r+4>>2]=1|e,s[4+(n+a|0)>>2]=40,s[57159]=s[57274];break C}i=0;break e}r=0;break g}g[57156]>r>>>0&&(s[57156]=r),n=r+l|0,e=229056;a:{I:{f:{i:{b:{s:{for(;;){if((0|n)!=s[e>>2]){if(e=s[e+8>>2])continue;break s}break}if(!(8&c[e+12|0]))break b}for(e=229056;;){if((n=s[e>>2])>>>0<=a>>>0&&(o=n+s[e+4>>2]|0)>>>0>a>>>0)break i;e=s[e+8>>2]}}if(s[e>>2]=r,s[e+4>>2]=s[e+4>>2]+l,s[(f=(r+8&7?-8-r&7:0)+r|0)+4>>2]=3|u,e=(l=n+(n+8&7?-8-n&7:0)|0)-(d=u+f|0)|0,(0|a)==(0|l)){s[57158]=d,e=s[57155]+e|0,s[57155]=e,s[d+4>>2]=1|e;break I}if(s[57157]==(0|l)){s[57157]=d,e=s[57154]+e|0,s[57154]=e,s[d+4>>2]=1|e,s[e+d>>2]=e;break I}if((3&(o=s[l+4>>2]))==1){a=-8&o;b:if(o>>>0<=255){if(i=s[l+8>>2],n=o>>>3|0,(0|(r=s[l+12>>2]))==(0|i)){s[57152]&=oi(-2,n);break b}s[i+12>>2]=r,s[r+8>>2]=i}else{if(u=s[l+24>>2],(0|l)==(0|(r=s[l+12>>2])))if((n=s[(o=l+20|0)>>2])||(n=s[(o=l+16|0)>>2])){for(;i=o,(n=s[(o=(r=n)+20|0)>>2])||(o=r+16|0,n=s[r+16>>2]););s[i>>2]=0}else r=0;else n=s[l+8>>2],s[n+12>>2]=r,s[r+8>>2]=n;if(u){i=s[l+28>>2];s:{if(s[(n=228912+(i<<2)|0)>>2]==(0|l)){if(s[n>>2]=r,r)break s;s[57153]&=oi(-2,i);break b}if(s[u+(s[u+16>>2]==(0|l)?16:20)>>2]=r,!r)break b}s[r+24>>2]=u,(n=s[l+16>>2])&&(s[r+16>>2]=n,s[n+24>>2]=r),(n=s[l+20>>2])&&(s[r+20>>2]=n,s[n+24>>2]=r)}}o=s[(l=a+l|0)+4>>2],e=e+a|0}if(s[l+4>>2]=-2&o,s[d+4>>2]=1|e,s[e+d>>2]=e,e>>>0<=255){n=228648+(-8&e)|0,(r=s[57152])&(e=1<<(e>>>3))?e=s[n+8>>2]:(s[57152]=e|r,e=n),s[n+8>>2]=d,s[e+12>>2]=d,s[d+12>>2]=n,s[d+8>>2]=e;break I}if(o=31,e>>>0<=16777215&&(o=62+((e>>>38-(n=x(e>>>8|0))&1)-(n<<1)|0)|0),s[d+28>>2]=o,s[d+16>>2]=0,s[d+20>>2]=0,n=228912+(o<<2)|0,(i=s[57153])&(r=1<>>1|0)),r=s[n>>2];;){if(n=r,(-8&s[r+4>>2])==(0|e))break f;if(r=o>>>29|0,o<<=1,!(r=s[(i=(4&r)+n|0)+16>>2]))break}s[i+16>>2]=d}else s[57153]=r|i,s[n>>2]=d;s[d+24>>2]=n,s[d+12>>2]=d,s[d+8>>2]=d;break I}for(n=(i=l-40|0)-(e=r+8&7?-8-r&7:0)|0,s[57155]=n,e=e+r|0,s[57158]=e,s[e+4>>2]=1|n,s[4+(r+i|0)>>2]=40,s[57159]=s[57274],s[(i=(e=(o+(o-39&7?39-o&7:0)|0)-47|0)>>>0>>0?a:e)+4>>2]=27,e=s[57267],s[i+16>>2]=s[57266],s[i+20>>2]=e,e=s[57265],s[i+8>>2]=s[57264],s[i+12>>2]=e,s[57266]=i+8,s[57265]=l,s[57264]=r,s[57267]=0,e=i+24|0;s[e+4>>2]=7,n=e+8|0,e=e+4|0,n>>>0>>0;);if((0|i)==(0|a))break C;if(s[i+4>>2]=-2&s[i+4>>2],o=i-a|0,s[a+4>>2]=1|o,s[i>>2]=o,o>>>0<=255){n=228648+(-8&o)|0,(r=s[57152])&(e=1<<(o>>>3))?e=s[n+8>>2]:(s[57152]=e|r,e=n),s[n+8>>2]=a,s[e+12>>2]=a,s[a+12>>2]=n,s[a+8>>2]=e;break C}if(e=31,o>>>0<=16777215&&(e=62+((o>>>38-(e=x(o>>>8|0))&1)-(e<<1)|0)|0),s[a+28>>2]=e,s[a+16>>2]=0,s[a+20>>2]=0,n=228912+(e<<2)|0,(i=s[57153])&(r=1<>>1|0)),i=s[n>>2];;){if((0|o)==(-8&s[(n=i)+4>>2]))break a;if(r=e>>>29|0,e<<=1,!(i=s[(r=(4&r)+n|0)+16>>2]))break}s[r+16>>2]=a}else s[57153]=r|i,s[n>>2]=a;s[a+24>>2]=n,s[a+12>>2]=a,s[a+8>>2]=a;break C}e=s[n+8>>2],s[e+12>>2]=d,s[n+8>>2]=d,s[d+24>>2]=0,s[d+12>>2]=n,s[d+8>>2]=e}e=f+8|0;break A}e=s[n+8>>2],s[e+12>>2]=a,s[n+8>>2]=a,s[a+24>>2]=0,s[a+12>>2]=n,s[a+8>>2]=e}if(!((e=s[57155])>>>0<=u>>>0)){n=e-u|0,s[57155]=n,e=(r=s[57158])+u|0,s[57158]=e,s[e+4>>2]=1|n,s[r+4>>2]=3|u,e=r+8|0;break A}}s[56798]=48,e=0;break A}g:if(l){n=s[i+28>>2];r:{if(s[(e=228912+(n<<2)|0)>>2]==(0|i)){if(s[e>>2]=r,r)break r;f=oi(-2,n)&f,s[57153]=f;break g}if(s[l+(s[l+16>>2]==(0|i)?16:20)>>2]=r,!r)break g}s[r+24>>2]=l,(e=s[i+16>>2])&&(s[r+16>>2]=e,s[e+24>>2]=r),(e=s[i+20>>2])&&(s[r+20>>2]=e,s[e+24>>2]=r)}g:if(o>>>0<=15)e=o+u|0,s[i+4>>2]=3|e,s[(e=e+i|0)+4>>2]=1|s[e+4>>2];else if(s[i+4>>2]=3|u,s[(a=i+u|0)+4>>2]=1|o,s[a+o>>2]=o,o>>>0<=255)n=228648+(-8&o)|0,(r=s[57152])&(e=1<<(o>>>3))?e=s[n+8>>2]:(s[57152]=e|r,e=n),s[n+8>>2]=a,s[e+12>>2]=a,s[a+12>>2]=n,s[a+8>>2]=e;else{e=31,o>>>0<=16777215&&(e=62+((o>>>38-(e=x(o>>>8|0))&1)-(e<<1)|0)|0),s[a+28>>2]=e,s[a+16>>2]=0,s[a+20>>2]=0,n=228912+(e<<2)|0;r:{if((r=1<>>1|0)),u=s[n>>2];;){if((-8&s[(n=u)+4>>2])==(0|o))break r;if(r=e>>>29|0,e<<=1,!(u=s[(r=(4&r)+n|0)+16>>2]))break}s[r+16>>2]=a}else s[57153]=r|f,s[n>>2]=a;s[a+24>>2]=n,s[a+12>>2]=a,s[a+8>>2]=a;break g}e=s[n+8>>2],s[e+12>>2]=a,s[n+8>>2]=a,s[a+24>>2]=0,s[a+12>>2]=n,s[a+8>>2]=e}e=i+8|0;break A}e:if(d){n=s[r+28>>2];g:{if(s[(e=228912+(n<<2)|0)>>2]==(0|r)){if(s[e>>2]=i,i)break g;s[57153]=oi(-2,n)&f;break e}if(s[d+(s[d+16>>2]==(0|r)?16:20)>>2]=i,!i)break e}s[i+24>>2]=d,(e=s[r+16>>2])&&(s[i+16>>2]=e,s[e+24>>2]=i),(e=s[r+20>>2])&&(s[i+20>>2]=e,s[e+24>>2]=i)}o>>>0<=15?(e=o+u|0,s[r+4>>2]=3|e,s[(e=e+r|0)+4>>2]=1|s[e+4>>2]):(s[r+4>>2]=3|u,s[(i=r+u|0)+4>>2]=1|o,s[i+o>>2]=o,p&&(n=228648+(-8&p)|0,a=s[57157],(e=1<<(p>>>3))&l?e=s[n+8>>2]:(s[57152]=e|l,e=n),s[n+8>>2]=a,s[e+12>>2]=a,s[a+12>>2]=n,s[a+8>>2]=e),s[57157]=i,s[57154]=o),e=r+8|0}return z=t+16|0,0|e}function ye(e,t,n,r,i){var o,l=0,u=0,d=0,f=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0;z=o=z-544|0,Pt(o+320|0,0,100),Pt(o+208|0,0,100),f=n?s[n>>2]:f,v=s[e+12>>2],m=s[36115];A:{e:{g:{r:{for(;;){if(l=(0|(l=c[t+u|0]))>=(0|m)?13:l,a[o+u|0]=l,!l){l=u;break r}if(d=(0|m)<=(0|(d=c[(l=1|u)+t|0]))?13:d,a[l+o|0]=d,!d)break r;if((0|(u=u+2|0))==200)break}u=198,b=c[o+199|0];break g}if(!l)break e;b=c[o+(u=l-1|0)|0],(0|l)!=1&&(u=l-2|0)}if(w=8&f,s[o+536>>2]=(w>>>3|0?3:7)&f,f=c[o+u|0],m=1,g=(0|(h=Ye(e,o,o+432|0,o+540|0,o+536|0,1)))>=0?h:0,S=c[0|o])for(u=o,l=S;l=s[144464+((255&l)<<2)>>2],c[l+11|0]==2&&(1048576&(l=s[l+4>>2])||(d=(2097152&l)>>>21|0,d|=l=c[s[144464+(c[0|(_=u+1|0)]<<2)>>2]+10|0]==12,a[(o+208|0)+m|0]=d,y=s[144464+(c[(l?2:1)+u|0]<<2)>>2],d=c[y+11|0]-10>>>0<4294967289|!(32&c[y+6|0])&c[s[144464+(c[(l?3:2)+u|0]<<2)>>2]+11|0]==2?d:d?2:1,u=l?_:u,a[(o+320|0)+m|0]=d,m=m+1|0)),l=c[0|(u=u+1|0)];);u=n=n?g:h;g:{r:{C:{a:{I:{f:{i:{b:{s:{t:{n:{k:switch(s[e+8>>2]-1|0){case 11:if((0|(n=s[o+540>>2]))<2)break s;if(u=1,g=1&(l=n-1|0),(0|n)!=2)break n;m=0;break t;case 8:if((0|(l=s[o+540>>2]))<2)break r;if(m=3&(d=l-1|0),u=1,l-2>>>0>=3)for(g=-4&d,d=0;f=a[0|(l=(o+432|0)+u|0)],a[0|l]=(0|f)<0?4:f,f=a[l+1|0],a[l+1|0]=(0|f)<0?4:f,f=a[l+2|0],a[l+2|0]=(0|f)<0?4:f,f=l,l=a[l+3|0],a[f+3|0]=(0|l)<0?4:l,u=u+4|0,(0|g)!=(0|(d=d+4|0)););if(!m)break r;for(l=0;d=a[0|(f=(o+432|0)+u|0)],a[0|f]=(0|d)<0?4:d,u=u+1|0,(0|m)!=(0|(l=l+1|0)););break r;case 7:if(!c[o+322|0]|a[o+321|0]>0)break r;case 0:if(s[o+536>>2]|s[o+540>>2]<3)break r;if(s[o+536>>2]=2,u=4,n)break g;a[o+434|0]=4;break g;case 1:if(s[o+536>>2])break g;o:{B:{if((0|(m=s[o+540>>2]))>=3){n=m-2|0,s[o+536>>2]=n,u=n;c:if(512&v&&(l=s[144464+(b<<2)>>2],(0|(d=c[l+11|0]))!=2)){u=s[l>>2],l=o;Q:{G:{if((0|(g=s[e+212>>2]))!=26977){if((0|g)!=24942)break G;w:switch(u-110|0){case 0:case 5:if(u=n,c[s[144464+(f<<2)>>2]+11|0]==2)break c;break;default:break w}u=m-1|0;break Q}if((0|u)==115&&(u=n,c[s[144464+(f<<2)>>2]+11|0]==2))break c;u=m-1|0;break Q}G:{w:{if((0|u)==115){if(u=n,(0|(d=c[s[144464+(f<<2)>>2]+11|0]))!=8)break w;break c}if((0|d)!=8)break G;d=c[s[144464+(f<<2)>>2]+11|0]}if(u=n,(255&d)==2)break c}u=m-1|0}s[l+536>>2]=u}if(524288&v&&(a[(l=m-1|0)+(m=o+208|0)|0]<=a[n+m|0]||(s[o+536>>2]=l,u=l)),c[(o+432|0)+u|0]>1){l=u;break o}if(l=2,n=u-1|0,u>>>0>=2)break B;s[o+536>>2]=u+1;break o}n=1}l=n,s[o+536>>2]=l}if(u=4,a[0|(n=(o+432|0)+l|0)]>=0||a[(l=(o+432|0)+l|0)-1|0]>=4&a[l+1|0]>3)break g;a[0|n]=4;break g;case 2:if(s[o+536>>2])break g;for(n=(u=s[o+540>>2])-1|0,n&=n>>31;;){if((0|(u=u-1|0))<=0)break C;if(!(a[0|(l=(o+432|0)+u|0)]>=0))break}s[o+536>>2]=u,u=4,a[0|l]=4;break g;case 3:if(s[o+536>>2])break r;if(l=(0|(u=s[o+540>>2]-3|0))<=1?1:u,s[o+536>>2]=l,u=4,n)break g;a[l+(o+432|0)|0]=4;break g;case 4:if(s[o+536>>2])break g;if(l=(n=s[o+540>>2])-3|0,s[o+536>>2]=l,(0|n)<=15){o:{B:switch(c[s[144464+(b<<2)>>2]+11|0]-2|0){case 0:l=a[n+94176|0];break o;case 2:l=a[n+94192|0];break o;default:break B}l=a[n+94160|0]}s[o+536>>2]=l}u=4,a[(o+432|0)+l|0]=4;break g;case 5:if(s[o+536>>2])break g;if(m=-1,d=0,!((0|(n=(l=s[o+540>>2])-1|0))<2)){if(u=1,_=1&l,(0|l)!=3)for(y=(-2&l)-4|0,l=0;a[(o+432|0)+u|0]<0&&(d=(f=(0|(g=a[(o+320|0)+u|0]))<(0|m))?d:u,m=f?m:g),a[(f=u+1|0)+(o+432|0)|0]<0&&(d=(g=(0|(C=a[f+(o+320|0)|0]))<(0|m))?d:f,m=g?m:C),u=u+2|0,f=(0|l)!=(0|y),l=l+2|0,f;);!_|a[(o+432|0)+u|0]>=0||(m=(l=(0|(f=a[(o+320|0)+u|0]))<(0|m))?m:f,d=l?d:u)}s[o+536>>2]=d,c[n+(o+320|0)|0]!=2|(0|m)>1?(0|m)>0||(d=1,s[o+536>>2]=1):(s[o+536>>2]=n,d=n),u=4,a[(o+432|0)+d|0]=4;break g;case 14:break a;case 12:break I;case 6:break k;default:break g}if(s[o+536>>2])break g;m=(n=s[o+540>>2])-1|0,s[o+536>>2]=m;k:if(!((0|n)<2))for(u=1;;){if(c[(o+432|0)+u|0]==1){m=u-1|0,s[o+536>>2]=m;break k}if((0|n)==(0|(u=u+1|0)))break}u=4,a[(o+432|0)+m|0]=4;break g}for(_=-2&l,m=0,d=0;l=c[0|(y=(f=o+432|0)+u|0)],x=y,C=a[(y=o+208|0)+u|0]>0,a[0|x]=C||(0|l)==4?3:l,T=(0|(f=c[0|(x=(l=u+1|0)+f|0)]))==4?3:f,f=a[l+y|0]>0,a[0|x]=f?3:T,m=f?l:C?u:m,u=u+2|0,(0|_)!=(0|(d=d+2|0)););}if(g&&(f=(0|(l=c[0|(d=(o+432|0)+u|0)]))==4?3:l,l=a[(o+208|0)+u|0]>0,a[0|d]=l?3:f,m=l?u:m),l=s[o+536>>2])break f;if((0|m)>0){s[o+536>>2]=m,l=m;break f}if((0|n)<6)break b;l=n-3|0;break i}if(l=s[o+536>>2])break f}l=n-1|0}s[o+536>>2]=l}u=4,a[(o+432|0)+l|0]=4;break g}if(s[o+536>>2])break g;l=1,s[o+536>>2]=1,c[o+209|0]|s[o+540>>2]<3|a[o+210|0]<=0||(l=2,s[o+536>>2]=2),u=4,a[o+432|l]=4;break g}if(s[o+536>>2]||(0|(l=s[o+540>>2]))<3)break r;if(Pt(o+432|1,0,l-1|0),s[o+536>>2]=2,n||(a[o+434|0]=4),u=4,l>>>0<4)break g;a[431+(l+o|0)|0]=3;break g}s[o+536>>2]=n,u=4;break g}u=n}!(256&v)|2&i||(0|(n=s[o+540>>2]))<3|(0|h)>2||c[0|(l=(n=n+(o+432|0)|0)-1|0)]!=4|c[s[144464+(b<<2)>>2]+11|0]!=2||(a[0|l]=1,a[n-2|0]=4);g:{r:{if(w)h=s[o+540>>2];else{if(n=a[o+433|0],!(!(4096&v)|(0|(h=s[o+540>>2]))!=3)){if((0|n)==4){a[o+434|0]=3;break r}if(c[o+434|0]==4){a[o+433|0]=3;break r}}if(!(!(8192&v)|(0|n)>=0|(0|h)<4|a[o+434|0]<4)){a[o+433|0]=3;break r}}if(d=0,(0|h)<2)break g}for(m=(0|u)<4?4:3,y=128&v,C=64&v,x=32&v,g=h-1|0,T=16&v,E=!(32768&v),b=0,f=0,u=1;;){r:{C:if((0|(l=a[0|(_=(o+432|0)+u|0)]))>=0)d=m;else{d=3;a:{I:if(!(!(!T|(0|m)>3)&(0|u)==(0|g))){if(!(1&(b|E)))break a;if(!(a[431+(o+u|0)|0]>1)){if((0|(l=a[(n=u+1|0)+(o+432|0)|0]))>=2){if((0|m)!=4||(d=4,l>>>0>=3))break I}else if(!(!x|(0|m)!=3)){m=3;break r}if(!C|u>>>0<2||(d=c[(o+320|0)+u|0]))break a;if((0|g)>(0|(l=u))){for(;;){if(a[(o+320|0)+l|0]>0)break r;if((0|g)==(0|(l=l+1|0)))break}if(d)break a}if(a[n+(o+320|0)|0]<=0)break a;break r}d=m}l=c[0|_];break C}a[0|_]=m,b=1,d=3,l=m}C:{if(l<<24>>24>=4){if(n=f||u,!f|!y)break C;a[0|_]=3}m=d;break r}m=d,f=n}if(d=1,(0|h)==(0|(u=u+1|0)))break}}if(r=!w|(0|r)>=0?r:s[((0|h)<3?16:20)+e>>2],m=0,l=0,d){if(b=3&(n=h-1|0),d=0,h-2>>>0<3)u=1;else for(w=-4&n,u=1,f=0;l=(n=(0|(l=(_=(0|(l=(g=(0|(l=(h=(0|(g=a[(n=o+432|0)+u|0]))<(0|l))?l:g))>(0|(_=a[(y=u+1|0)+n|0])))?l:_))>(0|(x=a[(C=u+2|0)+n|0])))?l:x))>(0|(T=a[(x=u+3|0)+n|0])))?l:T,m=n?_?g?h?m:u:y:C:x,u=u+4|0,(0|w)!=(0|(f=f+4|0)););if(b)for(;l=(n=(0|(f=a[(o+432|0)+u|0]))<(0|l))?l:f,m=n?m:u,u=u+1|0,(0|b)!=(0|(d=d+1|0)););}if((0|r)<0?r=l:(0|r)<=(0|l)&(0|l)>4||(a[(o+432|0)+m|0]=r),b=t+197|0,h=1,!(1&i)&&(n=s[144464+(S<<2)>>2])){if(l=o,!((0|(d=c[n+11|0]))!=1&(0|S)!=15))for(;n=c[0|(l=l+1|0)],(0|(d=c[s[144464+(n<<2)>>2]+11|0]))==1|(0|n)==15;);!(48&(n=s[e+4>>2]))|(0|d)!=2||(a[0|t]=(32&n)>>>5|0&&a[o+433|0]>3?11:23,t=t+1|0)}g:if(!(t>>>0>=b>>>0))for(g=65536&v,_=2&v,w=4&v,u=o;;){if(!(l=c[0|u]))break g;if(i=u,u=u+1|0,n=s[144464+(l<<2)>>2]){r:{C:{a:switch(c[n+11|0]){case 0:s[e+8200>>2]=0;break r;case 2:if(!(16&c[n+6|0]))break C;break;default:break a}if(c[0|u]!=20)break r}if((0|(S=s[o+540>>2]))<(0|h))break A;f=a[0|(v=(o+432|0)+h|0)],s[e+8200>>2]=f;C:{a:{if(!((0|(n=f))>1)){if(d=S-1|0,!(!w|(0|h)<2|(0|r)<2)&&(n=0,(0|d)==(0|h)))break a;if(n=1,!((0|h)==1|_|(S-2|0)==(0|h)&a[d+(o+432|0)|0]<2|(0|d)==(0|h)||a[431+(o+h|0)|0]>=0&&(n=f,g))){n=0,a[0|v]=0;break a}}if(n&&(0|n)<2)break C}a[0|t]=c[n+94151|0],t=t+1|0,f=a[0|v]}d=(0|r)>(0|f),c[0|u]==12&&1&(S=s[e+28>>2])&&(u=(16&S?(0|m)!=(0|h):(0|n)<4)?i+2|0:u),r=d?r:f,h=h+1|0}if((0|l)!=1&&(a[0|t]=l,t=t+1|0),!(t>>>0>>0))break}}a[0|t]=0}z=o+544|0;return}A(86136,86634,1353,94208),p()}function be(e,t,n,r,i,a,o,c,l){var u,d=0,f=0,p=0,m=0,h=0,_=0,v=0,y=0,b=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0,P=0,F=0,I=0,L=0,ee=0,te=0,R=0,ne=0,re=0;z=u=z-336|0,m=c,_=65535&l,h=r,p=65535&i,C=-2147483648&(i^l);A:{if(!((b=l>>>16&32767)-32767>>>0>4294934529&(v=i>>>16&32767)-32767>>>0>=4294934530)){if(!(!r&(0|(d=2147483647&i))==2147418112?!(t|n):d>>>0<2147418112)){y=r,C=32768|i;break A}if(!(!c&(0|(i=2147483647&l))==2147418112?!(a|o):i>>>0<2147418112)){y=c,C=32768|l,t=a,n=o;break A}if(!(t|r|2147418112^d|n)){if(!(a|c|2147418112^i|o)){t=0,n=0,C=2147450880;break A}C|=2147418112,t=0,n=0;break A}if(!(a|c|2147418112^i|o)){t=0,n=0;break A}if(!(t|r|n|d)){y=(t=!(a|c|i|o))?0:y,C=t?2147450880:C,t=0,n=0;break A}if(!(a|c|i|o)){C|=2147418112,t=0,n=0;break A}(0|d)==65535|d>>>0<65535&&(l=r=!(p|h),d=r?t:h,c=r<<=6,rn(u+320|0,t,n,h,p,(r=r+((0|(l=x(l?n:p)))==32?x(d)+32|0:l)|0)-15|0),w=16-r|0,h=s[u+328>>2],p=s[u+332>>2],n=s[u+324>>2],t=s[u+320>>2]),i>>>0>65535||(c=r=!(m|_),l=r?a:m,i=r<<=6,rn(u+304|0,a,o,m,_,(r=r+((0|(c=x(c?o:_)))==32?x(l)+32|0:c)|0)-15|0),w=(r+w|0)-16|0,m=s[u+312>>2],_=s[u+316>>2],a=s[u+304>>2],o=s[u+308>>2])}if(k=i=65536|_,A=m,d=i<<15|(r=m)>>>17,hn(u+288|0,r=i=r<<15|o>>>17,c=d,0,0,l=0-r|0,d=1963258675-(d+!!(0|r)|0)|0,0,0),hn(u+272|0,0-(r=s[u+296>>2])|0,0-(s[u+300>>2]+!!(0|r)|0)|0,0,0,l,d,0,0),hn(u+256|0,l=(r=s[u+280>>2])<<1|s[u+276>>2]>>>31,r=s[u+284>>2]<<1|r>>>31,0,0,i,c,0,0),hn(u+240|0,l,r,0,0,0-(d=s[u+264>>2])|0,0-(s[u+268>>2]+!!(0|d)|0)|0,0,0),hn(u+224|0,d=(l=s[u+248>>2])<<1|s[u+244>>2]>>>31,r=s[u+252>>2]<<1|l>>>31,0,0,i,c,0,0),hn(u+208|0,d,r,0,0,0-(l=s[u+232>>2])|0,0-(s[u+236>>2]+!!(0|l)|0)|0,0,0),hn(u+192|0,l=(r=s[u+216>>2])<<1|s[u+212>>2]>>>31,r=s[u+220>>2]<<1|r>>>31,0,0,i,c,0,0),hn(u+176|0,l,r,0,0,0-(d=s[u+200>>2])|0,0-(s[u+204>>2]+!!(0|d)|0)|0,0,0),hn(u+160|0,l=i,r=c,0,0,c=(m=(i=s[u+184>>2])<<1|s[u+180>>2]>>>31)-1|0,i=(s[u+188>>2]<<1|i>>>31)-!m|0,0,0),hn(u+144|0,a<<15,o<<15|a>>>17,0,0,r=c,i,0,0),S=u+112|0,D=s[u+168>>2],c=s[u+172>>2],f=(m=s[u+160>>2])+(l=s[u+152>>2])|0,d=(_=s[u+164>>2])+s[u+156>>2]|0,l=d=l>>>0>f>>>0?d+1|0:d,d=(d=(0|_)==(0|d)&f>>>0>>0|d>>>0<_>>>0)>>>0>(_=d+D|0)>>>0?c+1|0:c,hn(S,r,i,0,0,0-(c=(m=!l&f>>>0>1|!!(0|l))+_|0)|0,0-(!!(0|c)+(d=m>>>0>c>>>0?d+1|0:d)|0)|0,0,0),hn(u+128|0,1-f|0,0-((f>>>0>1)+l|0)|0,0,0,r,i,0,0),I=(v-b|0)+w|0,S=i=s[u+116>>2],m=(r=s[u+112>>2])<<1,v=d=i<<1|r>>>31,r=d,O=c=s[u+140>>2],r=r+(d=c<<1|(i=s[u+136>>2])>>>31)|0,i=r=(c=(l=i<<1|s[u+132>>2]>>>31)+m|0)>>>0>>0?r+1|0:r,E=r=r-(c>>>0<13927)|0,D=r,L=d=65536|p,ee=h,R=(r=h)<<1,ne=d=d<<1|r>>>31,M=d,N=r=hr(E,f=0,d,0),T=d=B,w=t<<1,b=r=n<<1|t>>>31,_=d=0,E=(0|i)==(0|E)&(l=c-13927|0)>>>0>>0|i>>>0>E>>>0,i=(0|i)==(0|v)&c>>>0>>0|i>>>0>>0,r=s[u+120>>2],d=c=s[u+124>>2]<<1|r>>>31,d=(r=(f=O>>>31|0)+(r=r<<1|S>>>31)|0)>>>0>>0?d+1|0:d,f=(c=r)>>>0>(r=r+i|0)>>>0?d+1|0:d,f=(i=r)>>>0>(r=r+E|0)>>>0?f+1|0:f,i=r-1|0,d=hr(b,_,E=f-!r|0,v=0),c=B+T|0,S=(0|T)==(0|(c=(r=d+N|0)>>>0>>0?c+1|0:c))&r>>>0>>0|c>>>0>>0,O=i,i=hr(i,d=0,j=(te=n>>>31|0)|h<<1,T=0),d=B+c|0,f=0,m=d=i>>>0>(h=i+r|0)>>>0?d+1|0:d,f=(i=r=(0|d)==(0|c)&r>>>0>h>>>0|c>>>0>d>>>0)>>>0>(r=r+S|0)>>>0?1:f,i=hr(M,_,E,v),d=B+f|0,S=r=i+r|0,r=r>>>0>>0?d+1|0:d,i=hr(M,_,O,T),p=B,c=i,i=hr(j,T,E,v),d=B+p|0,i=d=i>>>0>(f=c+i|0)>>>0?d+1|0:d,r=r+(d=(0|p)==(0|d)&c>>>0>f>>>0|d>>>0

>>0)|0,S=p=S+i|0,p=r=p>>>0>>0?r+1|0:r,d=f+m|0,i=d=(r=(i=0)+h|0)>>>0>>0?d+1|0:d,c=(0|d)==(0|m)&r>>>0>>0|d>>>0>>0,d=p,f=c,P=c=c+S|0,f=d=f>>>0>c>>>0?d+1|0:d,S=r,p=r,h=i,N=l,r=hr(l,0,j,T),c=B,i=r,l=hr(D,y,b,y),d=B+c|0,l=(0|c)==(0|(d=(r=r+l|0)>>>0>>0?d+1|0:d))&r>>>0>>0|c>>>0>d>>>0,c=d,i=hr(O,T,F=-2&w,0),d=B+d|0,i=d=i>>>0>(m=i+r|0)>>>0?d+1|0:d,r=(0|d)==(0|c)&r>>>0>m>>>0|c>>>0>d>>>0,c=0,r=((l=r+l|0)>>>0>>0?1:c)+h|0,d=f,l=r=(p=l+p|0)>>>0>>0?r+1|0:r,c=r=(0|r)==(0|h)&p>>>0>>0|r>>>0>>0,re=r=r+P|0,S=d=c>>>0>r>>>0?d+1|0:d,r=hr(M,_,N,y),P=B,M=r,c=hr(E,v,F,y),d=B+P|0,h=r=r+c|0,f=r+(_=hr(D,y,j,T))|0,r=(c=r>>>0>>0?d+1|0:d)+B|0,r=f>>>0<_>>>0?r+1|0:r,v=f,_=f+(d=hr(b,y,O,T))|0,f=B+r|0,j=(0|r)==(0|(f=d>>>0>_>>>0?f+1|0:f))&_>>>0>>0|r>>>0>f>>>0,d=((r=(r=(r=(0|r)==(0|c)&h>>>0>v>>>0|r>>>0>>0)+(d=(0|c)==(0|P)&h>>>0>>0|c>>>0

>>0)|0)+j|0)|(O=0))+l|0,h=d=(c=f)>>>0>(v=c+p|0)>>>0?d+1|0:d,r=(0|l)==(0|d)&p>>>0>v>>>0|l>>>0>d>>>0,d=S,c=r,O=r=r+re|0,l=d=c>>>0>r>>>0?d+1|0:d,r=hr(D,y,F,y),D=B,p=r,c=hr(b,y,N,y),d=B+D|0,c=(0|(d=(r=r+c|0)>>>0>>0?d+1|0:d))==(0|D)&r>>>0

>>0|d>>>0>>0,p=d,r=d+m|0,d=(c|(S=0))+i|0,p=(0|i)==(0|(d=r>>>0

>>0?d+1|0:d))&r>>>0>>0|i>>>0>d>>>0,f=(c=d)+(d=_)|0,d=0,d=((i=r=(0|c)==(0|(f=(m=(_=0)+r|0)>>>0<_>>>0?f+1|0:f))&r>>>0>m>>>0|c>>>0>f>>>0)>>>0>(r=r+p|0)>>>0?1:d)+h|0,f=l,i=d=(i=r)>>>0>(r=r+v|0)>>>0?d+1|0:d,l=f=(l=c=(0|h)==(0|d)&r>>>0>>0|d>>>0>>0)>>>0>(c=c+O|0)>>>0?f+1|0:f,(0|f)==131071|f>>>0<131071?(ee=R|te,L=T|ne,hn(u+80|0,r,i,c,l,a,o,A,k),_=f=s[u+84>>2],d=t<<17,h=(n=(m=0)-(p=s[u+88>>2])|0)-(f=!!(f|(t=s[u+80>>2])))|0,p=(d-(s[u+92>>2]+(p>>>0>m>>>0)|0)|0)-(n>>>0>>0)|0,m=0-t|0,_=0-(!!(0|t)+_|0)|0,t=I+16382|0):(hn(u+96|0,r=(1&i)<<31|r>>>1,i=c<<31|i>>>1,c=(1&l)<<31|c>>>1,l=l>>>1|0,a,o,A,k),b=h=s[u+100>>2],h=(m=0-(w=s[u+104>>2])|0)-(p=!!(h|(f=s[u+96>>2])))|0,p=((t<<16)-(s[u+108>>2]+(_>>>0>>0)|0)|0)-(p>>>0>m>>>0)|0,m=0-f|0,_=0-(!!(0|f)+b|0)|0,w=t,b=n,t=I+16383|0),(0|t)>=32767)C|=2147418112,t=0,n=0;else{if((0|t)>0)f=p<<1|h>>>31,h=h<<1|_>>>31,p=f,w=c,b=65535&l|t<<16,f=_<<1|m>>>31,l=m<<1;else{if((0|t)<=-113){t=0,n=0;break A}Qt(u- -64|0,r,i,c,l,1-t|0),rn(u+48|0,w,b,ee,L,t+112|0),hn(u+32|0,a,o,A,k,r=s[u+64>>2],i=s[u+68>>2],w=s[u+72>>2],b=s[u+76>>2]),t=s[u+40>>2],m=(n=s[u+56>>2])-(h=t<<1|(f=s[u+36>>2])>>>31)|0,p=s[u+60>>2]-((s[u+44>>2]<<1|t>>>31)+(n>>>0>>0)|0)|0,d=(t=s[u+32>>2])<<1,h=m-(t=(0|(c=f<<1|t>>>31))==(0|(l=s[u+52>>2]))&d>>>0>(n=s[u+48>>2])>>>0|c>>>0>l>>>0)|0,p=p-(t>>>0>m>>>0)|0,f=l-((n>>>0>>0)+c|0)|0,l=n-d|0}t=l,hn(u+16|0,a,o,A,k,3,0,0,0),hn(u,a,o,A,k,5,0,0,0),c=f+(n=0)|0,c=l>>>0>(t=t+(d=1&r)|0)>>>0?c+1|0:c,l=t,o=(0|o)==(0|c)&t>>>0>a>>>0|o>>>0>>0,f=p,t=(0|n)==(0|c)&t>>>0>>0|n>>>0>c>>>0,d=i,n=d=(n=t=(t=(0|(f=t>>>0>(a=t+h|0)>>>0?f+1|0:f))==(0|k))&(0|a)==(0|A)?o:t&a>>>0>A>>>0|f>>>0>k>>>0)>>>0>(t=t+r|0)>>>0?d+1|0:d,r=(0|i)==(0|d)&t>>>0>>0|i>>>0>d>>>0,d=b,d=(i=r)>>>0>(r=r+w|0)>>>0?d+1|0:d,o=r,p=(0|(i=s[u+20>>2]))==(0|c)&g[u+16>>2]>>0|i>>>0>>0,i=s[u+28>>2],i=d>>>0<2147418112&((0|(r=s[u+24>>2]))==(0|a)&(0|i)==(0|f)?p:(0|i)==(0|f)&r>>>0>>0|i>>>0>>0),r=n,d=(n=t=(0|n)==(0|(r=(p=i)>>>0>(i=t+i|0)>>>0?r+1|0:r))&t>>>0>i>>>0|n>>>0>r>>>0)>>>0>(t=t+o|0)>>>0?d+1|0:d,o=t,c=(0|(n=s[u+4>>2]))==(0|c)&g[u>>2]>>0|n>>>0>>0,n=s[u+12>>2],n=f=(n=t=d>>>0<2147418112&((0|(t=s[u+8>>2]))==(0|a)&(0|n)==(0|f)?c:(0|n)==(0|f)&t>>>0>>0|n>>>0>>0))>>>0>(t=t+i|0)>>>0?r+1|0:r,i=(0|r)==(0|f)&t>>>0>>0|r>>>0>f>>>0,r=d,a=i,y|=i=i+o|0,C|=r=a>>>0>i>>>0?r+1|0:r}}s[e>>2]=t,s[e+4>>2]=n,s[e+8>>2]=y,s[e+12>>2]=C,z=u+336|0}function xe(e,t,n,r,i){var o,l,u,d=0,f=0,p=0,m=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0;if(z=l=z-80|0,u=s[n+8>>2],!i|!h[n+4>>1]||(s[i+8>>2]=0),o=Pt(r,0,152),s[o+44>>2]=c[u+14|0],s[o+40>>2]=c[u+15|0],r=h[u+8>>1]){for(r=s[34459]+(r<<1)|0,x=256&t,S=n+32|0,T=n-32|0,E=n- -64|0,D=n+96|0,O=n+-64|0,k=n-28|0,A=1&t,j=n-24|0,C=s[30450];;){d=15&(g=(t=h[r>>1])>>>8|0);A:{e:{g:{r:{C:{a:{I:{f:{i:{b:{s:{t:switch(0|(p=t>>>12|0)){case 10:break I;case 9:break f;case 6:break i;case 2:case 3:break b;case 1:break s;case 0:break t;case 11:case 12:case 13:case 14:case 15:break a;default:break C}f=255&t;t:{n:{k:switch(0|d){case 13:if(f)break n;d=r,t=0;break t;case 0:d=r;o:switch(f-1|0){case 1:break A;case 0:break e;default:break o}s[l+20>>2]=ai(l+75|0,s[u>>2]),s[l+16>>2]=t,fi(C,85851,l+16|0);break A;case 5:if(c[s[144464+(c[n+34|0]<<2)>>2]+11|0]!=2)break A;s[o+20>>2]=f;break A;case 12:break k;default:break r}s[o+44>>2]=s[o+44>>2]+(t<<24>>31&-256|f);break A}a[o+132|0]=c[r+3|0],d=r+2|0,a[o+133|0]=c[0|d],t=2,f>>>0<3||(a[o+134|0]=c[r+5|0],d=r+4|0,a[o+135|0]=c[0|d],t=4,f>>>0<5||(a[o+136|0]=c[r+7|0],d=r+6|0,a[o+137|0]=c[0|d],t=6,f>>>0<7||(a[o+138|0]=c[r+9|0],d=r+8|0,a[o+139|0]=c[0|d],t=8,f>>>0<9||(a[o+140|0]=c[r+11|0],d=r+10|0,a[o+141|0]=c[0|d],t=10,f>>>0<11||(a[o+142|0]=c[r+13|0],d=r+12|0,a[o+143|0]=c[0|d],t=12,f>>>0<13||(a[o+144|0]=c[r+15|0],d=r+14|0,a[o+145|0]=c[0|d],t=14,f>>>0<15||(a[o+146|0]=c[r+17|0],d=r+16|0,a[o+147|0]=c[0|d],t=16)))))))}a[132+(t+o|0)|0]=0,f=v;break e}if(!e|d>>>0>7||(p=n,c[s[144464+(c[n+2|0]<<2)>>2]+11|0]!=2&&(p=S,c[s[144464+(c[n+34|0]<<2)>>2]+11|0]!=2))||!(1&(d=s[e+56>>2]))&&16&c[0|n])break A;f=15&c[p+3|0],f=2&d&&c[p+6|0]<=f>>>0?4:f;s:{t:{n:{k:switch((d=7&g)-3|0){case 1:break t;case 0:break k;default:break n}if(f>>>0>3)break s;break A}if(s[102832+(d<<2)>>2]>(0|f))break s;break A}if(c[p+6|0]>f>>>0)break A}s[o+8>>2]=255&t,f=1;break g}if((57344&t)==8192){for(M=s[32972],g=1,w=0;;){m=255&t,d=(_=4095&t)>>>8|0;b:if(_>>>0<=3583){(0|(f=(d>>>0)%7|0))==6&&(f=h[r+2>>1]),b=0,d=n;s:{t:{n:switch(0|f){case 6:if(p=0,h[n+36>>1]|h[n+68>>1])break b;case 3:d=E;break t;case 9:if(p=0,h[n+36>>1]|h[n+68>>1])break b;if(d=D,!h[n+100>>1])break s;break b;case 7:if(p=0,h[n+36>>1])break b;for(f=1;;){if(c[s[144464+(c[(d=(f<<5)+n|0)+2|0]<<2)>>2]+11|0]==2)break t;if(h[4+(((f=f+1|0)<<5)+n|0)>>1])break}break b;case 5:if(p=0,h[n+4>>1])break b;case 0:b=1,d=T;break t;case 4:if(p=0,h[n+36>>1])break b;case 2:d=S;break t;case 8:if(p=0,!i)break b;if(b=1,s[(d=i)+8>>2])break s;break b;case 10:break n;default:break t}if(p=0,h[n+4>>1]|h[k>>1])break b;b=1,d=O;break s}t:switch(0|f){case 0:case 5:break t;default:break s}d=(c[d+2|0]==1?-32:0)+d|0}if(x?(f=s[144464+(c[d+2|0]<<2)>>2],s[d+8>>2]=f):f=s[d+8>>2],_>>>0<=1791){if(p=1,s[s[144464+(m<<2)>>2]>>2]==s[f>>2])break b;if(!(!b|c[f+11|0]!=2)){p=(0|m)==c[f+13|0];break b}p=(0|m)==c[f+12|0];break b}m=31&_,p=0;s:switch(_>>>5&7){case 0:p=(0|m)==c[f+11|0];break b;case 1:p=(0|m)==(15&h[f+6>>1]);break b;case 2:p=s[f+4>>2]>>>m&1;break b;case 4:break s;default:break b}s:switch(0|m){case 0:case 1:case 2:case 3:case 4:if(c[s[144464+(c[d+2|0]<<2)>>2]+11|0]!=2){if(c[s[144464+(c[d+34|0]<<2)>>2]+11|0]!=2)break b;d=d+32|0}f=15&c[d+3|0],f=!e|!(2&c[e+56|0])?f:c[d+6|0]<=f>>>0?4:f;t:{n:switch(m-3|0){case 1:p=c[d+6|0]<=f>>>0;break b;case 0:if(p=1,f>>>0<=3)break t;break b;default:break n}if(p=1,s[102832+(m<<2)>>2]>(0|f))break b}p=0;break b;case 17:if(!c[f+11|0]){p=1;break b}p=(32&c[n+1|0])>>>5|0;break b;case 18:p=h[d+4>>1]!=0;break b;case 19:if(p=1,h[d+36>>1])break b;p=!c[s[d+40>>2]+11|0];break b;case 9:if(h[d+4>>1])break b;for(;;){if(p=!!(0|(f=12&c[d-29|0])),f)break b;if(h[(d=d-32|0)+4>>1])break}break b;case 10:p=c[f+11|0]!=2;break b;case 11:for(;;){if(p=!!(0|(f=h[d+36>>1])),f)break b;if(f=d,d=d+32|0,c[s[f+40>>2]+11|0]==2)break}break b;case 12:if(p=1,(254&c[f+11|0])==2)break b;p=(16&c[f+4|0])>>>4|0;break b;case 13:for(;p=(c[s[d+8>>2]+11|0]==2)+p|0,f=h[d+4>>1],d=d-32|0,!f;);p=(0|p)==1;break b;case 14:for(;p=(c[s[d+8>>2]+11|0]==2)+p|0,f=h[d+4>>1],d=d-32|0,!f;);p=(0|p)==2;break b;case 16:break s;default:break b}p=(16&c[0|d])>>>4|0}else if(p=0,(0|d)==15){s:switch(m-1|0){case 0:p=A;break b;case 1:break s;default:break b}p=s[M+132>>2]!=0}b:if(1970>>>(d=(f=65535&t)>>>12|0)&1)d=a[d+102848|0];else{s:switch(0|d){case 0:if(d=1,(3840&f)!=3328)break b;d=1+(1+(255&f)>>>1|0)|0;break b;case 6:d=(f>>>9&7)-5>>>0<2?12:1;break b;case 2:case 3:d=(0|(d=3840&f))==3328||(0|d)==1536?2:1;break b;default:break s}d=4,(f=h[r+4>>1])>>>0>61439||(d=(0|f)==2?3:2)}if(r=((d=h[(r=(d<<1)+r|0)>>1]==3)<<1)+r|0,d^=p,g=w?d|g:d&g,w=4096&t,(57344&(t=h[r>>1]))!=8192)break}if(!(1&g))if((63488&t)!=26624){b:if(1970>>>(d=t>>>12|0)&1)d=a[d+102848|0];else{s:switch(0|d){case 0:if(d=1,(3840&t)!=3328)break b;d=1+(1+(255&t)>>>1|0)|0;break b;case 6:d=(t>>>9&7)-5>>>0<2?12:1;break b;case 2:case 3:d=(0|(t&=3840))==3328||(0|t)==1536?2:1;break b;default:break s}d=4,(t=h[r+4>>1])>>>0>61439||(d=(0|t)==2?3:2)}r=(((65024&h[(t=(d<<1)+r|0)>>1])==24576)<<1)+t|0}else r=((255&t)<<1)+r|0}d=r-2|0,f=v;break e}i:switch(d>>>1|0){case 0:r=(((255&t)<<1)+r|0)-2|0;break A;case 5:s[o>>2]=2|s[o>>2],((t=c[s[n+40>>2]+12|0])-28&255)>>>0<=5&&(d=h[(t=((t<<2)+r|0)-112|0)+4>>1],t=h[t+2>>1],s[o+96>>2]=t>>>4<<24>>24,s[o+76>>2]=(15&t)<<18|d<<2),r=r+24|0;break A;case 6:break i;default:break A}((t=c[s[j>>2]+13|0])-28&255)>>>0<=5&&(d=h[(t=((t<<2)+r|0)-112|0)+4>>1],t=h[t+2>>1],s[o+100>>2]=t>>>4<<24>>24,s[o+80>>2]=(15&t)<<18|d<<2),r=r+24|0;break A}t=h[(r=r+2|0)>>1]|t<<16&983040;f:switch(d-1|0){case 0:if((0|y)>9)break A;s[(l+32|0)+(y<<2)>>2]=r,r=(s[34459]+(t<<1)|0)-2|0,y=y+1|0;break A;case 1:s[o+124>>2]=t;break A;case 2:break f;default:break A}s[o+128>>2]=t;break A}s[(d=(((0|d)!=1)<<3)+o|0)+108>>2]=h[r+2>>1]|(255&t)<<16,t=h[r+4>>1]<<16,r=r+6|0,s[d+112>>2]=t|h[r>>1];break A}if(f=h[(d=r+2|0)>>1],_=t>>>4|0,s[(g=((m=p-11|0)<<2)+o|0)+88>>2]=255&_,s[g+68>>2]=t<<18&3932160|f<<2,(0|(r=h[r+4>>1]))==2){r=d;break A}if(f=t>>>0<=53247?r>>>0>61439?2:1:v-((0|m)==4)|0,p-13>>>0>1)break e;s[g+88>>2]=_<<24>>24;break e}s[l+4>>2]=ai(l+75|0,s[u>>2]),s[l>>2]=t,fi(C,85851,l);break A}s[4+((d<<2)+o|0)>>2]=f,f=x&&(0|d)==1?1:v}d=r}(0|f)!=1|(0|y)<=0?(r=d,v=f):(r=s[(l+32|0)+((y=y-1|0)<<2)>>2],v=0)}if(r=r+2|0,(0|v)==1)break}!i|c[n+17|0]!=2||(e=s[n+4>>2],s[i>>2]=s[n>>2],s[i+4>>2]=e,e=s[n+28>>2],s[i+24>>2]=s[n+24>>2],s[i+28>>2]=e,e=s[n+20>>2],s[i+16>>2]=s[n+16>>2],s[i+20>>2]=e,e=s[n+12>>2],s[i+8>>2]=s[n+8>>2],s[i+12>>2]=e),a[n+23|0]=s[o+44>>2],(e=s[o+68>>2])?(s[n+24>>2]=e,e=o+88|0):(s[n+24>>2]=s[o+72>>2],e=o+92|0),s[n+28>>2]=s[e>>2]}z=l+80|0}function Se(e,t,n,r,i,o){var l,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0;z=l=z-848|0;A:if(!(!s[e+104>>2]|8&c[i+2|0]|s[47202]==193)){for(s[r>>2]=0,s[33272]=0,s[33274]=o,a[l+192|0]=0,s[33273]=l+192;p=(o=p)+1|0,a[0|(S=t+o|0)]-48>>>0<10;);s[56798]=0,E=l+188|0,h=-2147483648,z=x=z-16|0;e:if(u=c[0|t]){m=t;g:{for(;;){if(!((0|(u=u<<24>>24))==32|u-9>>>0<5))break g;if(u=c[m+1|0],m=m+1|0,!u)break}break e}g:switch((u=c[0|m])-43|0){case 0:case 2:break g;default:break e}y=(0|u)==45?-1:0,m=m+1|0}else m=t;for(;u=-48,(((g=a[0|m])-48&255)>>>0<10||(u=-87,(g-97&255)>>>0<26||(u=-55,!((g-65&255)>>>0>25))))&&!((0|(g=u+g|0))>=10);)hn(x,10,0,0,0,_,b,0,0),u=1,s[x+8>>2]|s[x+12>>2]||(w=hr(_,b,10,0),(0|(T=B))==-1&~g>>>0>>0||(u=T,b=(_=g+w|0)>>>0>>0?u+1|0:u,C=1,u=f)),m=m+1|0,f=u;E&&(s[E>>2]=C?m:t);e:{g:{if(f)s[56798]=68,_=-2147483648,b=0;else if(!b&_>>>0<2147483648)break g;if(!y){s[56798]=68,h=2147483647;break e}if(!(!b&_>>>0<=2147483648)){s[56798]=68;break e}}h=(y^_)-y|0}if(z=x+16|0,y=h,!(s[56798]|s[l+188>>2]==(0|t))){e:{g:{r:{if(!(!((0|(g=64&c[e+109|0]?4:3))!=(0|o)|s[e+124>>2]!=a[t-2|0])&a[t-3|0]-48>>>0<10)){C:{if(s[e+124>>2]!=32){if(!(16&c[e+105|0]))break r;if((0|o)==3)break C;break r}if((0|o)!=3)break r}if(4&c[i+2|0]|a[t-2|0]-48>>>0>=10)break r}a[133104]=0,a[l+288|0]=0,D=1;break g}if(a[133104]=0,s[33275]=0,a[l+288|0]=0,O=1,C=0,c[0|t]==48)break e}C=Rt(e,t,S,i,0)}c[0|S]!=46|a[t+p|0]-48>>>0<10|1&a[i+13|0]|a[S+2|0]-48>>>0<10||(a[0|S]=0);e:if(!C||(w=1,s[e+212>>2]==26741)){if(h=l+256|0,s[l+844>>2]=h,d=p,64&c[i+1|0]&&(a[l+256|0]=45,h=l+256|1,s[l+844>>2]=h,d=o+2|0),m=c[t+d|0]){for(;!((255&m)==32|(0|d)>28)&&(u=s[l+844>>2],s[l+844>>2]=u+1,a[0|u]=m,m=c[(d=d+1|0)+t|0]););h=s[l+844>>2]}if(a[0|h]=0,w=1,u=a[l+256|0]){if(!(f=s[e+136>>2])||Or(l+256|0,f)){if(u-48>>>0<10||(s[l+176>>2]=l+256,H(u=l+800|0,88653,l+176|0),!zn(e,u,133104)))break e;s[r>>2]=128|s[r>>2],s[l+160>>2]=l+256,H(u=l+800|0,88773,l+160|0),zn(e,u,133116),w=0}C=2}}E=s[i>>2],a[l+352|0]=0,a[l+624|0]=0;e:{g:{r:if(!(!O|c[0|t]!=48||(0|(u=a[t+1|0]))==32|(0|u)==s[e+128>>2])){C:{if((0|o)==2){if(c[t+3|0]!=58|a[t+5|0]-48>>>0>=10||!((0|(u=a[t+7|0]))==32|u-9>>>0<5))break C;break r}if((0|o)>3)break g}if(c[0|t]==48&&!((0|(u=o-1|0))<=0))for(d=0;;){if(zn(e,88875,U(f=l+288|0)+f|0),c[(d=d+1|0)+t|0]!=48)break r;if(!((0|u)>(0|d)))break}}r:{C:{if(!((0|(u=a[0|S]))==32&&16&c[e+105|0])){if(T=2,_=o+2|0,(0|u)==s[e+124>>2])break C;b=1,h=0,u=0;break r}T=1,_=o+2|0}if(4&c[i+14|0])h=1,u=0,b=1;else for(u=0,m=1,d=o,b=1;;){f=u,u=m,m=(x=d+T|0)+t|0,d=0;C:{for(;;){if(h=1,!(a[d+m|0]-48>>>0>=10)){if((0|g)!=(0|(d=d+1|0)))continue;break C}break}u=f;break r}if(a[m+g|0]-48>>>0<10){u=f;break r}if(d=0,a[m-1|0]-48>>>0<10){u=f;break r}C:{for(;;){if(c[(d+x|0)+t|0]==48){if((0|g)!=(0|(d=d+1|0)))continue;break C}break}b=0}if((0|(f=a[(d=g+x|0)+t|0]))!=s[e+124>>2]&(!(16&c[e+105|0])|(0|f)!=32))break r;if(_=d+2|0,4&c[2+(v(m=u+1|0,12)+i|0)|0])break}}d=!y;r:if(!(!b|!(64&c[1+(v(u,12)+i|0)|0])|s[e+212>>2]!=26741)){C:switch(c[0|(f=t+_|0)]-97|0){case 0:case 4:break C;default:break r}C:{a:{I:{f:switch((m=c[f+1|0])-116|0){case 6:break r;case 1:case 2:case 3:case 4:case 5:break a;case 0:break f;default:break I}if(c[f+2|0]!=116)break C;break r}if((0|m)==32)break r}if(!(!!((0|y)%1e3|0)&(0|u)!=1)&&(0|m)==108)break r}s[33274]=1|s[33274]}_=32768&E,d&=D;r:if(s[e+128>>2]!=a[0|S]|a[t+p|0]-48>>>0>=10){C:{if(!d){if(d=0,f=1,!((0|u)>0&h))break C;y=(p=Fe(e,y,u,b,l+624|0))?0:y,d=!!(0|p),m=0;break r}d=1,y=0,s[33275]==1&&(s[l+144>>2]=u+1,H(p=l+800|0,89026,l+144|0),zn(e,p,l+688|0)||(s[l+128>>2]=u,H(p=l+800|0,89026,l+128|0),zn(e,p,l+624|0)))}f=1,m=0}else zn(e,88882,l+624|0),f=0,m=256;h=_?2:C;r:{if(u|c[l+624|0]|c[0|S]!=46){if(u)break r}else zn(e,89192,l+624|0);if(s[l+844>>2]=t,a[t+1|0]-48>>>0<10)for(;p=s[l+844>>2],s[l+844>>2]=p+1,a[p+2|0]-48>>>0<10;);if(a[s[l+844>>2]-1|0]-48>>>0>=10||(s[l+416>>2]=s[l+844>>2]-1,nt(e,l+416|0,l+192|0,r,4,i)&&(s[33272]=2)),c[l+192|0]|c[s[l+844>>2]]==48||nt(e,l+844|0,l+192|0,r,4,i)&&(s[33272]=1),O){if(!h&f&&(s[l+112>>2]=y,H(i=l+800|0,89214,l+112|0),zn(e,i,n)))break e;if(1&a[e+110|0]){for(p=t;(32|c[0|p])!=32;)p=p+1|0;s[l+416>>2]=p,c[p+1|0]==37&&(zn(e,89328,n),i=U(n),a[s[l+416>>2]+1|0]=32,n=n+i|0)}}}He(e,y,l+416|0,d,u,h|m|D),!(2&c[e+109|0])|(0|u)<=0?(s[l+60>>2]=15,s[l- -64>>2]=l+624,s[l+56>>2]=l+416,s[l+52>>2]=l+352,s[l+48>>2]=l+288,H(n,89415,l+48|0)):(s[l+88>>2]=15,s[l+96>>2]=l+416,s[l+92>>2]=l+352,s[l+84>>2]=l+624,s[l+80>>2]=l+288,H(n,89346,l+80|0));r:if(!f)for(;;){for(o=o+1|0,f=0;f=(p=f)+1|0,a[(u=o+p|0)+t|0]-48>>>0<10;);i=2;C:{a:{I:{f:{i:{b:switch((f=57344&s[e+104>>2])+-8192>>>13|0){case 6:break a;case 2:break I;case 0:case 4:case 5:break f;case 1:break i;case 3:break b;default:break C}i=5}if((0|(f=c[0|(d=t+o|0)]))==48)for(;zn(e,88875,u=l+688|0),Li(n,u),p=p-1|0,(0|(f=c[0|(d=(o=o+1|0)+t|0)]))==48;);if((0|i)<(0|p)|(f<<24>>24)-48>>>0>=10)break C;i=l+688|0,He(e,Pn(d),i,0,0,0),Li(n,i),o=o+p|0;break C}if(He(e,Pn(i=t+o|0),l+416|0,0,0,0),!((0|f)==8192&c[0|i]!=48)){if(s[l+16>>2]=p,H(i=l+800|0,89508,l+16|0),!zn(e,i,l+688|0))break C;Li((0|f)==49152?n:l+416|0,l+688|0)}Li(n,l+416|0),o=u;break C}if((0|p)>4||c[0|(i=t+o|0)]==48)break C;He(e,o=Pn(i),i=l+688|0,0,0,0),Li(n,i),o=u;break C}if(!((0|p)<=1))for(;;){if(s[l+32>>2]=a[t+o|0],H(i=l+800|0,89575,l+32|0),!zn(e,i,l+688|0))break C;if(Li(n,l+688|0),o=o+1|0,!((0|(p=p-1|0))>1))break}}C:if(!((f=c[0|(p=t+o|0)])-48>>>0>=10||U(n)>>>0>=190))for(;;){if(i=l+688|0,Me(e,a[0|p]-48|0,0,2,i),u=U(n),s[l>>2]=15,s[l+4>>2]=i,H(n+u|0,89594,l),(f=c[0|(p=(o=o+1|0)+t|0)])-48>>>0>=10)break C;if(!(U(n)>>>0<=189))break}if(zn(e,89678,l+688|0)&&Li(n,l+688|0),s[e+128>>2]!=(0|f)|a[1+(t+o|0)|0]-48>>>0>=10)break r;zn(e,88882,i=l+688|0),Li(n,i)}if(!(i=c[0|n])|(0|i)==21||(i=nn(l+184|0,t=1+(t+o|0)|0),o=s[l+184>>2],!(2&c[e+106|0])|(0|o)!=32||(nn(l+184|0,t+i|0),o=s[l+184>>2]),Rr(o)|b||(e=U(n)+n|0,a[0|e]=11,a[e+1|0]=0)),s[r>>2]=-2147483648|s[r>>2],--s[33275],d=1,w)break A;s[33264]=1;break A}s[r>>2]=-129&s[r>>2],d=0;break A}d=1}}return z=l+848|0,d}function Ce(e,t,n,r){var i,l,u=0,d=0,f=0,p=0,m=0,g=0,_=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0;if(z=i=z-416|0,T=h[n+8>>1],b=c[n+10|0],64&(l=s[n>>2])){for(s[n>>2]=-65&l,a[199388]=1,f=s[47202],_=s[49846],m=s[47352],g=s[47351],p=s[47350];;){u=(d=s[198304+(g<<2)>>2])>>8;A:{e:switch((31&d)-9|0){case 0:f=u;break A;case 4:_=u;break A;case 3:break e;default:break A}m=d>>>0>=256?u+m|0:0}if(!(!(128&d)&(0|p)>(0|(g=g+1|0))))break}s[47352]=m,s[47351]=g,s[49846]=_,s[47202]=f}_=0;A:if(!((0|(u=s[49572]))>997)){if(1048576&l||!c[0|t])c[199388]&&(s[49572]=u+1,a[199388]=0,s[(e=190288+(u<<3)|0)>>2]=983042,s[e+4>>2]=0),a[189088]=0;else if(!((0|u)>990)){(0|(u=s[e+8224>>2]))>0&&(s[e+8224>>2]=u-1),f=512&l?r:r+4|0,m=(240&s[47202])==16,(C=2&l)&&((0|(d=s[47200]))<3||(0|(u=s[47350]))>243||(c[199388]&&(s[(g=198300+(u<<2)|0)>>2]=-129&s[g>>2]),s[47350]=u+1,a[199388]=1,E=(0|d)==3?20:d,s[198304+(u<<2)>>2]=E<<8|193)),p=m?f:r;e:{g:{if(!(8&l)){for(;r=c[(u=y)+t|0],a[u+(i+240|0)|0]=r,223&r&&(y=u+1|0,u>>>0<160););if(a[i+66|0]=0,y=i- -64|2,_=Tt(s[47192],t,n,y),s[i+412>>2]=_,!(4096&_))break g;ut(t,i+240|0,u);break A}r:if(Hn(t,87276,3))it(t,189088,i+240|0);else{if(g=0,223&(u=c[0|(y=t+3|0)]))for(;a[(i+240|0)+g|0]=gr(u<<24>>24),g=g+1|0,223&(u=c[0|(y=y+1|0)]););a[(r=i+240|0)+g|0]=0,u=0;C:if(!((0|(n=s[34461]))<=0)){for(;;){if(!Or(r,v(u,44)+137856|0)){s[34457]=u;break C}if((0|n)==(0|(u=u+1|0)))break}u=n}if((0|(n=(0|n)==(0|u)?-1:u))<=0)break r;ci(n),a[189090]=0,a[189089]=n,a[189088]=21}_=-2147483648,s[i+412>>2]=-2147483648,r=-1;break e}if(!(!(8388608&_)|8&c[n+12|0])){for(z=m=z-208|0,g=s[e+60>>2],d=t;r=d,d=d+1|0,c[0|r]!=32;);nn(m+204|0,d);g:if(Rr(s[m+204>>2])){f=gn(m,189088),d=(!(256&g)|(S=V(e,d,n+12|0,0))>>>15)&!(67108864&S)&c[189088]!=21;r:{C:{if(512&g){if(!(d&!(16&c[n+12|0])))break C;break r}if(d)break r}gn(189088,f);break g}if(a[0|r]=45,s[n>>2]=-2&s[n>>2],_=0,d=189088,x=V(s[47192],t,n,0),s[i+412>>2]=x,!((0|g)<=0)&&(f=c[189088])){for(;_=(c[s[144464+(f<<2)>>2]+11|0]==2)+_|0,f=c[0|(d=d+1|0)];);if(!((31&g)>=(0|_))){a[0|r]=32,s[i+412>>2]=V(s[47192],t,n,0);break g}}s[i+412>>2]=128|(x||S),s[33264]=1}z=m+208|0}if(r=-1,c[189088]==21){if(g=gn(i+16|0,132848),m=s[i+412>>2],d=ut(t,i+240|0,u),f=i- -64|1,(0|(r=Bn(c[189089]?189089:87315,188772,189296)))<0||(s[n>>2]=4194304|s[n>>2],c[i+66|0]?(o[i+64>>1]=8192,m=V(s[47193],f,n,0)):m=Tt(s[47193],d,n,y)),c[189088]==21&&(u=ut(d,i+240|0,u),(0|(r=Bn(c[189089]?189089:87315,188772,189296)))<0||(s[n>>2]=4194304|s[n>>2],c[i+66|0]?(o[i+64>>1]=8192,m=V(s[47193],f,n,0)):m=Tt(s[47193],u,n,y)),_=4096,c[189088]==21))break A;s[i+412>>2]=m,(0|r)>=0||(a[189090]=0,o[94544]=3341,(0|r)==-1&&(gn(132848,g),ci(s[s[32972]+60>>2]),r=s[s[32972]+60>>2]))}_=s[i+412>>2],128&l||(p=268435456&_&&(0|p)<=1?1:p,!(256&_)|528&l|s[e+8224>>2]|2&c[n-11|0]||(s[e+8224>>2]=3,p=(0|p)<=4?4:p)),p=(0|p)<=0&&s[49846]>2?1:p}if(n=c[199388],!((0|p)<=0|(0|(y=s[49572]))>990)){s[49572]=y+1,d=1&n,n=0,o[(u=190288+(y<<3)|0)>>1]=d?2:0,a[u+7|0]=0,a[u+3|0]=0,d=p>>>0>1,a[u+2|0]=d?9:11,o[u+4>>1]=0,s[e+8236>>2]=0;e:if(!(!(u=d?p-2|0:0)|(0|(y=s[49572]))>990))for(f=e+8236|0;;){if(s[49572]=y+1,o[(d=190288+(y<<3)|0)>>1]=0,a[d+7|0]=0,a[d+3|0]=0,m=u>>>0>1,a[d+2|0]=m?9:11,o[d+4>>1]=0,s[f>>2]=0,y=s[49572],(0|(u=m?u-2|0:0))<=0)break e;if(!((0|y)<991))break}s[e+8228>>2]=0,s[e+8232>>2]=0}a[199388]=1&n,!C|s[47200]!=1||(s[49572]=y+2,a[199388]=0,o[(u=190288+(y<<3)|0)>>1]=1&n?2:0,a[u+7|0]=0,o[u+2>>1]=10,o[u+4>>1]=0,o[u+12>>1]=0,s[u+8>>2]=1179648,a[u+15|0]=0,1&l&&En(a[t+1|0])&&(n=c[199388],a[199388]=0,t=s[49572],s[49572]=t+2,o[(t=190288+(t<<3)|0)>>1]=n?2:0,a[t+7|0]=0,o[t+2>>1]=10,o[t+4>>1]=0,o[t+12>>1]=0,s[t+8>>2]=1179648,a[t+15|0]=0)),u=b>>>0<31;e:if(!((0|r)<0))if(t=s[49572],n=c[190290+((p=t-1|0)<<3)|0],c[189088]!=9|c[189089]!=21)(0|n)!=21&&(d=c[199388],a[199388]=0,a[(n=190288+(t<<3)|0)+7|0]=0,o[n+2>>1]=21,o[n+4>>1]=0,o[n>>1]=d?2:0,p=t),s[49572]=p+1,a[190295+(p<<3)|0]=r;else{if((0|n)!=21)break e;s[49572]=p}t=2047&T,n=(u?b:31)<<11,m=(D=128&l)?c[s[144464+(c[189088]<<2)>>2]+11|0]?189088:189089:189088,(p=c[0|m])|!(1&a[199388])||(p=23,a[0|m]=23,a[m+1|0]=0),O=t|n,f=s[49572];e:if(p)if((0|f)>994)t=0;else for(j=((-1610612736&_)==-2147483648)<<4,T=O+1|0,M=e+8233|0,t=0,d=1,S=0,k=1,b=-1,C=-1,u=0;;){g=m+1|0;g:{if((0|(x=255&p))!=255){if(n=s[144464+(x<<2)>>2])break g;s[i>>2]=x,z=n=z-16|0,s[n+12>>2]=i,Oi(132552,87474,i),z=n+16|0,f=s[49572]}if(!(p=c[0|g]))break e;if(m=g,(0|f)<995)continue;break e}g:if((0|(w=255&p))!=21)if((0|(m=c[n+11|0]))!=1){n=T;r:switch(w-12|0){case 8:a[(n=190288+((b=f-1|0)<<3)|0)+3|0]=d,o[n>>1]=4|h[n>>1],n=u;break g;case 0:o[(n=190280+(f<<3)|0)>>1]=8|h[n>>1],n=u;break g;case 10:_|=16384,s[i+412>>2]=_,n=u;break g;case 3:break g;default:break r}x=c[199388],a[199388]=0,a[(n=(w=f<<3)+190288|0)+7|0]=0,a[n+2|0]=p,o[n+4>>1]=u,u=(x?2:0)|j,o[n>>1]=u,(0|m)==2?((0|d)>=4&&(a[189076]=1),(0|b)<0||(0|(t=f-1|0))!=(0|b)&&(a[190291+(t<<3)|0]=d),o[n>>1]=4|u,A=(t=(0|d)>(0|C))?f:A,C=t?d:C,u=1,S&&(a[n+7|0]=S),b=f,S=0,t=d):(!k|!(64&c[0|M])||(o[n>>1]=8|u),u=d),f=f+1|0,s[49572]=f,a[w+190291|0]=t,n=0,k=0,d=u}else{if(!h[n+8>>1]){d=c[n+14|0],n=u;break g}if((0|b)<0){n=u,S=x;break g}a[190295+(b<<3)|0]=p,n=u}else s[(n=190288+(f<<3)|0)>>2]=1376256,o[n+4>>1]=0,a[n+7|0]=c[m+1|0],s[49572]=f+1,ci(c[m+1|0]),g=m+2|0,f=s[49572],n=u;if(!(p=c[0|g]))break e;if(m=g,u=n,!((0|f)<995))break}else t=0;131072&l&&(n=f+1|0,s[49572]=n,d=c[199388],a[199388]=0,a[(u=190288+(f<<3)|0)+7|0]=0,o[u+2>>1]=27,o[u+4>>1]=0,o[u>>1]=d?2:0,f=n),D||(o[190292+(y<<3)>>1]=O),s[e+8228>>2]=0,c[s[144464+(c[190282+(f<<3)|0]<<2)>>2]+11|0]!=2|(0|t)<4||(s[e+8228>>2]=1),(0|r)>=0&&(gn(132848,i+16|0),ci(s[s[32972]+60>>2]),n=c[199388],a[199388]=0,r=s[49572],o[(t=190288+(r<<3)|0)>>1]=n?2:0,o[t+2>>1]=21,o[t+4>>1]=0,a[t+7|0]=s[s[32972]+60>>2],f=r+1|0,s[49572]=f),(0|E)>0&&(a[199388]=0,s[49572]=f+1,s[(t=190288+(f<<3)|0)>>2]=655362,n=s[47350],s[47350]=n+1,a[t+7|0]=0,o[t+4>>1]=0,s[198304+(n<<2)>>2]=E<<8|225),1024&_&&(o[(t=190288+(A<<3)|0)>>1]=64|h[t>>1]),s[e+8232>>2]=_}}return z=i+416|0,_}function we(e,t,n,r,i){var o=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0;A:if(t){if(x=i<<4,l=(t=s[33268])+n|0,!((0|t)<=0||(o=c[0|(d=x+129360|0)],m=c[d+1|0]-o<<8,m=(0|t)==1?m:(0|m)/(0|t)|0,(0|n)>=(0|l))))for(h=m>>>0>255,y=m>>>8|0,o<<=8,d=0-m>>>8|0,w=(0|m)<=0,t=n;w?(f=(p=(p=(0|(u=(0|(u=s[101024+(a[v(t,6)+e|0]<<2)>>2]))<(0|d)?d:u))>=18?18:u)+(u=(0|(u=(0|(o=o+m|0))/256|0))>0?u:0)|0)>>>0>=254?254:p,u=u>>>0>=254?254:u):(u=v(t,6)+e|0,a[u+2|0]=h|c[u+2|0],u=(p=(0|(u=(0|o)/256|0))>0?u:0)>>>0>=254?254:p,f=(p=p+y|0)>>>0>=254?254:p,o=o+m|0),p=v(t,6)+e|0,a[p+5|0]=u,a[p+4|0]=f,(0|l)!=(0|(t=t+1|0)););if(2&c[188785]?(d=s[33271],s[33270]=d):d=s[33270],y=(h=c[(o=(t=i<<4)+129360|0)+3|0])-(u=c[o+2|0])<<8,w=s[o+4>>2],(0|n)>0?(E=101056,S=5,p=(0|y)/(c[t+129368|0]-1|0)|0):(E=s[(t=t+129360|0)+12>>2],S=c[t+10|0],p=0),(0|l)<(0|d)){for(m=(0|n)<=0,b=((t=y>>31)^y)-t|0,g=129360+(i<<4)|0,u<<=8,T=h<<8,h=0;;){e:{if(f=v(l,6)+e|0,!(!(1&m)&(0|(o=a[0|f]))<4)){n=0,t=l;g:if(1&((0|o)==5|m)){for(;(0|(p=a[v(t,6)+e|0]))<=6&&(n=((0|p)>3)+n|0,(0|d)!=(0|(t=t+1|0))););if(_=0,(0|(C=(0|(t=c[g+8|0]))>(0|n)?n:t))<2){p=0,h=u;break g}p=(0|y)/(C-1|0)|0,h=u}else(0|C)>0?h=p+h|0:(h=T+(v(b,a[_+E|0])>>6)|0,(0|S)>(0|(_=_+1|0))||(E=s[g+12>>2],_=0));if(C=C-1|0,!((0|o)<4)){a[0|f]=6,n=(t=(0|(t=(0|h)/256|0))>0?t:0)+(((n=(o=s[w+(o<<2)>>2])>>31)^o)-n|0)|0;break e}}(0|o)==3?n=(t=(0|(t=(0|h)/256|0))>0?t:0)+(((n=(o=s[w+12>>2])>>31)^o)-n|0)|0:(t=(0|h)/256|0,(63&c[f-6|0])>>>0>=3?(n=(o=s[w+(o<<2)>>2])>>31,n=(t=(0|(t=t-a[g+9|0]|0))>0?t:0)+((n^o)-n|0)|0):n=(t=(0|t)>0?t:0)+(((n=(o=s[w+(o<<2)>>2])>>31)^o)-n|0)|0)}if(a[f+5|0]=t>>>0>=254?254:t,m=0,t=(0|n)>0?n:0,a[f+4|0]=t>>>0>=254?254:t,a[f+2|0]=c[f+2|0]|o>>>31,(0|d)==(0|(l=l+1|0)))break}l=d}if(!(c[133068]||((268435455&i)==3&&(t=v(l,6)+e|0,a[t+2|0]=2|c[t+2|0]),s[33269]?(t=c[(o=100768+(i<<4)|0)+5|0],u=o+3|0,n=c[o+4|0]-t|0):(t=c[(n=100768+(i<<4)|0)+2|0],u=x+100768|0,n=c[n+1|0]-t|0),o=v(l,6)+e|0,a[o+5|0]=t>>>0>=254?254:t,a[o+2|0]=c[o+2|0]|n>>>31,t=(p=t)+(((t=n>>31)^n)-t|0)|0,a[o+4|0]=t>>>0>=254?254:t,n=v(d,6)+e|0,a[n+1|0]=c[0|u],t=l+1|0,c[0|n]==4&&(a[0|n]=6),(0|(n=r-t|0))<=0||(i=c[(l=100768+(i<<4)|0)+12|0],l=c[l+13|0]-i<<8,l=(0|n)==1?l:(0|l)/(0|n)|0,(0|t)>=(0|r)))))for(p=l>>>0>255,m=l>>>8|0,n=i<<8,i=0-l>>>8|0,h=(0|l)<=0;h?(u=(d=(u=(0|(o=(0|i)>(0|(o=s[101024+(a[v(t,6)+e|0]<<2)>>2]))?i:o))>=18?18:o)+(o=(0|(o=(0|(n=n+l|0))/256|0))>0?o:0)|0)>>>0>=254?254:d,d=o>>>0>=254?254:o):(o=v(t,6)+e|0,a[o+2|0]=p|c[o+2|0],d=(o=(0|(o=(0|n)/256|0))>0?o:0)>>>0>=254?254:o,u=(o=o+m|0)>>>0>=254?254:o,n=n+l|0),o=v(t,6)+e|0,a[o+5|0]=d,a[o+4|0]=u,(0|r)!=(0|(t=t+1|0)););}else{if(t=(S=s[34455])+v(i,68)|0,l=c[t+24|0],d=c[t+25|0],o=(t=s[33268])+n|0,!((0|t)<=0||(f=d-l<<8,f=(0|t)==1?f:(0|f)/(0|t)|0,(0|n)>=(0|o))))for(p=f>>>0>255,m=f>>>8|0,t=l<<8,d=0-f>>>8|0,h=(0|f)<=0;h?(l=(l=(y=(0|(l=(0|(l=s[101024+(a[v(n,6)+e|0]<<2)>>2]))<(0|d)?d:l))>=18?18:l)+(u=(0|(l=(0|(t=t+f|0))/256|0))>0?l:0)|0)>>>0>=254?254:l,u=u>>>0>=254?254:u):(l=v(n,6)+e|0,a[l+2|0]=p|c[l+2|0],u=(l=(0|(l=(0|t)/256|0))>0?l:0)>>>0>=254?254:l,l=(l=l+m|0)>>>0>=254?254:l,t=t+f|0),y=v(n,6)+e|0,a[y+5|0]=u,a[y+4|0]=l,(0|o)!=(0|(n=n+1|0)););2&c[188785]?(n=s[33271],s[33270]=n):n=s[33270],d=n,t=S+v(i,68)|0;e:if((0|(m=c[t+33|0]))!=255)for(;;){if((0|(d=d-1|0))<(0|o)){d=n;break e}if(!(a[v(d,6)+e|0]<4))break}if((0|n)>(0|o)){for(A=((l=(O=(h=c[t+32|0])-(f=c[0|(u=t+31|0)])<<8)>>31)^O)-l|0,T=(0|(t=c[0|(p=t+30|0)]))==255,y=m<<8,w=f<<8,j=h<<8,x=S+v(i,68)|0,M=(0|t)!=255,h=0,m=0,t=1,f=0;;){e:{if(g=v(o,6)+e|0,!(!(1&t)&(0|(b=a[0|g]))<4)){g:if(1&((0|b)==5|t)){r:if(M){if(D=1,t=0,l=p,!((0|d)<=(0|(f=o+1|0)))){for(;;){if(l=p,(0|(m=a[v(f,6)+e|0]))>6)break r;if(t=((0|m)>3)+t|0,(0|d)==(0|(f=f+1|0)))break}l=p}}else{if(t=0,f=o,l=u,(0|d)<=(0|o))break r;for(;;){if(l=u,(0|(m=a[v(f,6)+e|0]))>6)break r;if(t=((0|m)>3)+t|0,(0|d)==(0|(f=f+1|0)))break}l=u}if(m=c[0|l]<<8,k=0,(0|(f=(0|t)<(0|(l=c[x+34|0]))?t:l))<2){E=0;break g}E=(0|O)/(f-1|0)|0}else(0|o)==(0|d)?(T=2,m=y):D?(T=1,f=f+1|0,D=0,m=w):(0|f)>0?(m=m+E|0,D=0):(D=0,m=(v(a[16+(x+k|0)|0],A)>>6)+j|0,k=(0|(t=k+1|0))1)break g;if(!((0|n)>=(0|(t=t+1|0))))break}a[0|g]=6,a[g+1|0]=c[x+26|0],h=0,_=c[x+27|0],o=(0|(o=(0|m)/256|0))>0?o:0,a[g+5|0]=o>>>0>=254?254:o,o=o+_|0,a[g+4|0]=o>>>0>=254?254:o,C=t-l|0;break e}}if((0|b)>=2){t=l=o+1|0;g:if(!((0|n)<=(0|o)))for(;;){if(a[v(t,6)+e|0]>1)break g;if(!((0|n)>=(0|(t=t+1|0))))break}h=0,o=(0|(o=(0|m)/256|0))>0?o:0,a[g+5|0]=o>>>0>=254?254:o,_=s[100976+(b<<2)>>2],a[g+2|0]=c[g+2|0]|_>>>31,o=(0|(o=(b=o)+(((o=_>>31)^_)-o|0)|0))>0?o:0,a[g+4|0]=o>>>0>=254?254:o,C=t-l|0}else(0|C)<=1?(_=a[36+(x+T|0)|0],t=0):(_=a[(t=x+T|0)+36|0],t=(a[t+39|0]-_|0)/(C-1|0)|0),l=s[100976+(b<<2)>>2],a[g+2|0]=c[g+2|0]|l>>>31,t=(0|(t=(((0|m)/256|0)+_|0)+v(t,h)|0))>0?t:0,a[g+5|0]=t>>>0>=254?254:t,t=(0|(t=t+(((b=l)^(l>>=31))-l|0)|0))>0?t:0,a[g+4|0]=t>>>0>=254?254:t,h=h+1|0,l=o+1|0}if(t=0,(0|n)==(0|(o=l)))break}o=n}if(c[133068]||(l=v(o,6)+e|0,s[33269]?(u=S+v(i,68)|0,t=c[u+47|0],d=c[u+46|0]-t|0,u=u+45|0):(u=S+v(i,68)|0,t=c[u+44|0],d=c[u+43|0]-t|0,u=u+42|0),u=c[0|u],p=(((p=d>>31)^d)-p|0)+t|0,a[l+4|0]=p>>>0>=254?254:p,a[l+5|0]=t>>>0>=254?254:t,t=v(o,6)+e|0,a[t+2|0]=c[t+2|0]|d>>>31,n=v(n,6)+e|0,a[n+1|0]=u,t=o+1|0,c[0|n]==4&&(a[0|n]=6),(0|(n=r-t|0))<=0)||(l=S+v(i,68)|0,i=c[l+48|0],l=c[l+49|0]-i<<8,l=(0|n)==1?l:(0|l)/(0|n)|0,(0|t)>=(0|r)))break A;for(p=l>>>0>255,m=l>>>8|0,n=i<<8,i=0-l>>>8|0,h=(0|l)<=0;h?(u=(d=(u=(0|(o=(0|i)>(0|(o=s[101024+(a[v(t,6)+e|0]<<2)>>2]))?i:o))>=18?18:o)+(o=(0|(o=(0|(n=n+l|0))/256|0))>0?o:0)|0)>>>0>=254?254:d,d=o>>>0>=254?254:o):(o=v(t,6)+e|0,a[o+2|0]=p|c[o+2|0],d=(o=(0|(o=(0|n)/256|0))>0?o:0)>>>0>=254?254:o,u=(o=o+m|0)>>>0>=254?254:o,n=n+l|0),o=v(t,6)+e|0,a[o+5|0]=d,a[o+4|0]=u,(0|r)!=(0|(t=t+1|0)););}}function Te(){var e,t=0,n=0,r=0,i=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,g=0,_=0,y=0,b=0;if((0|(e=s[36455]))!=(0|(d=s[36454]))){A:if(!((0|(_=s[36427]))<0|(0|d)==(0|_))){n=m=s[8+(216192+((f=_)<<4)|0)>>2];e:{for(;;){if((r=s[(l=216192+((f=(0|(r=f-1|0))<0?169:r)<<4)|0)>>2])-5>>>0<2)break e;g:{if((0|r)<=4){if(s[l+12>>2]!=(0|n))break e;if(r=h[l+4>>1],s[l+12>>2]=m,n=s[l+8>>2],16&(t=h[n>>1]))break g;for(b=32&t?(v(r,12)>>>0)/10|0:r,i=0,r=n,u=0;;){t=h[n>>1];r:if(!(u>>>0<3&&8&t)){if(t=t<<16>>16,(0|(y=(p=o[2+((g=u<<1)+n|0)>>1])-(c=o[(g=m+g|0)+2>>1])|0))>(0|(p=(0|v(b,(0|v(s[200944+(u<<2)>>2],(0|y)>0?p+(c<<1)|0:(p<<1)+c|0))/3e3|0))/256|0)))i||((0|t)<0?r=n:(r=0,t=(0|(t=s[44469]+1|0))<=169?t:0,s[44469]=t,(t=(i=t<<6)+177888|0)&&(r=h[n+4>>1]|h[n+6>>1]<<16,c=h[n>>1]|h[n+2>>1]<<16,o[t>>1]=c,o[t+2>>1]=c>>>16,o[t+4>>1]=r,o[t+6>>1]=r>>>16,r=h[n+60>>1]|h[n+62>>1]<<16,c=h[n+56>>1]|h[n+58>>1]<<16,o[t+56>>1]=c,o[t+58>>1]=c>>>16,o[t+60>>1]=r,o[t+62>>1]=r>>>16,r=h[n+52>>1]|h[n+54>>1]<<16,c=h[n+48>>1]|h[n+50>>1]<<16,o[t+48>>1]=c,o[t+50>>1]=c>>>16,o[t+52>>1]=r,o[t+54>>1]=r>>>16,r=h[n+44>>1]|h[n+46>>1]<<16,c=h[n+40>>1]|h[n+42>>1]<<16,o[t+40>>1]=c,o[t+42>>1]=c>>>16,o[t+44>>1]=r,o[t+46>>1]=r>>>16,r=h[n+36>>1]|h[n+38>>1]<<16,c=h[n+32>>1]|h[n+34>>1]<<16,o[t+32>>1]=c,o[t+34>>1]=c>>>16,o[t+36>>1]=r,o[t+38>>1]=r>>>16,r=h[n+28>>1]|h[n+30>>1]<<16,c=h[n+24>>1]|h[n+26>>1]<<16,o[t+24>>1]=c,o[t+26>>1]=c>>>16,o[t+28>>1]=r,o[t+30>>1]=r>>>16,r=h[n+20>>1]|h[n+22>>1]<<16,c=h[n+16>>1]|h[n+18>>1]<<16,o[t+16>>1]=c,o[t+18>>1]=c>>>16,o[t+20>>1]=r,o[t+22>>1]=r>>>16,r=h[n+12>>1]|h[n+14>>1]<<16,c=h[n+8>>1]|h[n+10>>1]<<16,o[t+8>>1]=c,o[t+10>>1]=c>>>16,o[t+12>>1]=r,o[t+14>>1]=r>>>16,a[i+177904|0]=0,o[t>>1]=32768|h[t>>1],r=t))),t=p+h[g+2>>1]|0;else{if((0-p|0)<=(0|y))break r;i||((0|t)<0?r=n:(r=0,t=(0|(t=s[44469]+1|0))<=169?t:0,s[44469]=t,(t=(i=t<<6)+177888|0)&&(r=h[n+4>>1]|h[n+6>>1]<<16,c=h[n>>1]|h[n+2>>1]<<16,o[t>>1]=c,o[t+2>>1]=c>>>16,o[t+4>>1]=r,o[t+6>>1]=r>>>16,r=h[n+60>>1]|h[n+62>>1]<<16,c=h[n+56>>1]|h[n+58>>1]<<16,o[t+56>>1]=c,o[t+58>>1]=c>>>16,o[t+60>>1]=r,o[t+62>>1]=r>>>16,r=h[n+52>>1]|h[n+54>>1]<<16,c=h[n+48>>1]|h[n+50>>1]<<16,o[t+48>>1]=c,o[t+50>>1]=c>>>16,o[t+52>>1]=r,o[t+54>>1]=r>>>16,r=h[n+44>>1]|h[n+46>>1]<<16,c=h[n+40>>1]|h[n+42>>1]<<16,o[t+40>>1]=c,o[t+42>>1]=c>>>16,o[t+44>>1]=r,o[t+46>>1]=r>>>16,r=h[n+36>>1]|h[n+38>>1]<<16,c=h[n+32>>1]|h[n+34>>1]<<16,o[t+32>>1]=c,o[t+34>>1]=c>>>16,o[t+36>>1]=r,o[t+38>>1]=r>>>16,r=h[n+28>>1]|h[n+30>>1]<<16,c=h[n+24>>1]|h[n+26>>1]<<16,o[t+24>>1]=c,o[t+26>>1]=c>>>16,o[t+28>>1]=r,o[t+30>>1]=r>>>16,r=h[n+20>>1]|h[n+22>>1]<<16,c=h[n+16>>1]|h[n+18>>1]<<16,o[t+16>>1]=c,o[t+18>>1]=c>>>16,o[t+20>>1]=r,o[t+22>>1]=r>>>16,r=h[n+12>>1]|h[n+14>>1]<<16,c=h[n+8>>1]|h[n+10>>1]<<16,o[t+8>>1]=c,o[t+10>>1]=c>>>16,o[t+12>>1]=r,o[t+14>>1]=r>>>16,a[i+177904|0]=0,o[t>>1]=32768|h[t>>1],r=t))),t=h[g+2>>1]-p|0}i=1,o[2+((u<<1)+r|0)>>1]=t,s[l+8>>2]=r}if((0|(u=u+1|0))==6)break}m=r}if((0|d)!=(0|f))continue;break e}break}m=n}for(r=0;;){if((n=s[(f=216192+(_<<4)|0)>>2])-5>>>0<2)break A;if((0|n)<=4){if(n=s[f+8>>2],t=h[f+4>>1],r){if((0|n)!=(0|r))break A;s[f+8>>2]=m}else m=n;if(16&(r=h[m>>1]))break A;for(g=32&r?(v(t,6)>>>0)/5|0:t,i=0,n=r=s[f+12>>2],u=0;;){e:{g:if((0|(d=(l=o[2+((t=u<<1)+r|0)>>1])-(t=o[(p=t+m|0)+2>>1])|0))>(0|(l=(0|v(g,(0|v(s[200944+(u<<2)>>2],(0|d)>0?l+(t<<1)|0:(l<<1)+t|0))/3e3|0))/256|0))){if(!i){if(o[r>>1]<0){n=r,t=t+l|0;break g}n=(0|(n=s[44469]+1|0))<=169?n:0,s[44469]=n,i=h[r+20>>1]|h[r+22>>1]<<16,t=(n=177888+(n<<6)|0)+16|0,d=h[r+16>>1]|h[r+18>>1]<<16,o[t>>1]=d,o[t+2>>1]=d>>>16,o[t+4>>1]=i,o[t+6>>1]=i>>>16,t=h[r+4>>1]|h[r+6>>1]<<16,i=h[r>>1]|h[r+2>>1]<<16,o[n>>1]=i,o[n+2>>1]=i>>>16,o[n+4>>1]=t,o[n+6>>1]=t>>>16,t=h[r+12>>1]|h[r+14>>1]<<16,i=h[r+8>>1]|h[r+10>>1]<<16,o[n+8>>1]=i,o[n+10>>1]=i>>>16,o[n+12>>1]=t,o[n+14>>1]=t>>>16,t=h[r+28>>1]|h[r+30>>1]<<16,i=h[r+24>>1]|h[r+26>>1]<<16,o[n+24>>1]=i,o[n+26>>1]=i>>>16,o[n+28>>1]=t,o[n+30>>1]=t>>>16,t=h[r+36>>1]|h[r+38>>1]<<16,i=h[r+32>>1]|h[r+34>>1]<<16,o[n+32>>1]=i,o[n+34>>1]=i>>>16,o[n+36>>1]=t,o[n+38>>1]=t>>>16,t=h[r+44>>1]|h[r+46>>1]<<16,i=h[r+40>>1]|h[r+42>>1]<<16,o[n+40>>1]=i,o[n+42>>1]=i>>>16,o[n+44>>1]=t,o[n+46>>1]=t>>>16,t=h[r+52>>1]|h[r+54>>1]<<16,i=h[r+48>>1]|h[r+50>>1]<<16,o[n+48>>1]=i,o[n+50>>1]=i>>>16,o[n+52>>1]=t,o[n+54>>1]=t>>>16,t=h[r+60>>1]|h[r+62>>1]<<16,i=h[r+56>>1]|h[r+58>>1]<<16,o[n+56>>1]=i,o[n+58>>1]=i>>>16,o[n+60>>1]=t,o[n+62>>1]=t>>>16,a[n+16|0]=0,o[n>>1]=32768|h[n>>1],t=h[p+2>>1]}t=t+l|0}else{if((0|d)>=(0-l|0))break e;i||(o[r>>1]<0?n=r:(n=(0|(n=s[44469]+1|0))<=169?n:0,s[44469]=n,i=h[r+20>>1]|h[r+22>>1]<<16,t=(n=177888+(n<<6)|0)+16|0,d=h[r+16>>1]|h[r+18>>1]<<16,o[t>>1]=d,o[t+2>>1]=d>>>16,o[t+4>>1]=i,o[t+6>>1]=i>>>16,t=h[r+4>>1]|h[r+6>>1]<<16,i=h[r>>1]|h[r+2>>1]<<16,o[n>>1]=i,o[n+2>>1]=i>>>16,o[n+4>>1]=t,o[n+6>>1]=t>>>16,t=h[r+12>>1]|h[r+14>>1]<<16,i=h[r+8>>1]|h[r+10>>1]<<16,o[n+8>>1]=i,o[n+10>>1]=i>>>16,o[n+12>>1]=t,o[n+14>>1]=t>>>16,t=h[r+28>>1]|h[r+30>>1]<<16,i=h[r+24>>1]|h[r+26>>1]<<16,o[n+24>>1]=i,o[n+26>>1]=i>>>16,o[n+28>>1]=t,o[n+30>>1]=t>>>16,t=h[r+36>>1]|h[r+38>>1]<<16,i=h[r+32>>1]|h[r+34>>1]<<16,o[n+32>>1]=i,o[n+34>>1]=i>>>16,o[n+36>>1]=t,o[n+38>>1]=t>>>16,t=h[r+44>>1]|h[r+46>>1]<<16,i=h[r+40>>1]|h[r+42>>1]<<16,o[n+40>>1]=i,o[n+42>>1]=i>>>16,o[n+44>>1]=t,o[n+46>>1]=t>>>16,t=h[r+52>>1]|h[r+54>>1]<<16,i=h[r+48>>1]|h[r+50>>1]<<16,o[n+48>>1]=i,o[n+50>>1]=i>>>16,o[n+52>>1]=t,o[n+54>>1]=t>>>16,t=h[r+60>>1]|h[r+62>>1]<<16,i=h[r+56>>1]|h[r+58>>1]<<16,o[n+56>>1]=i,o[n+58>>1]=i>>>16,o[n+60>>1]=t,o[n+62>>1]=t>>>16,a[n+16|0]=0,o[n>>1]=32768|h[n>>1],t=h[p+2>>1])),t=t-l|0}i=1,o[2+((u<<1)+n|0)>>1]=t,s[f+12>>2]=n}if((0|(u=u+1|0))==6)break}m=n}if((0|e)==(0|(_=(0|(n=_+1|0))<=169?n:0)))break}}s[36454]=e}}function Ee(e,t){var n,r,i=0,a=0,o=0,c=0,p=0,m=0,h=0,g=0,y=0,x=0,S=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0,P=0,F=0;z=n=z-48|0,f(+e),a=0|l(1),i=0|l(0),r=a;A:{e:{g:{if((p=2147483647&a)>>>0<=1074752122){if((1048575&a)==598523)break g;if(p>>>0<=1073928572){if((0|r)>0|(0|r)>=0){c=(e+=-1.5707963267341256)+-6077100506506192e-26,_[t>>3]=c,_[t+8>>3]=e-c-6077100506506192e-26,a=1;break A}c=(e+=1.5707963267341256)+6077100506506192e-26,_[t>>3]=c,_[t+8>>3]=e-c+6077100506506192e-26,a=-1;break A}if((0|r)>0|(0|r)>=0){c=(e+=-3.1415926534682512)+-12154201013012384e-26,_[t>>3]=c,_[t+8>>3]=e-c-12154201013012384e-26,a=2;break A}c=(e+=3.1415926534682512)+12154201013012384e-26,_[t>>3]=c,_[t+8>>3]=e-c+12154201013012384e-26,a=-2;break A}if(p>>>0<=1075594811){if(p>>>0<=1075183036){if((0|p)==1074977148)break g;if((0|r)>0|(0|r)>=0){c=(e+=-4.712388980202377)+-18231301519518578e-26,_[t>>3]=c,_[t+8>>3]=e-c-18231301519518578e-26,a=3;break A}c=(e+=4.712388980202377)+18231301519518578e-26,_[t>>3]=c,_[t+8>>3]=e-c+18231301519518578e-26,a=-3;break A}if((0|p)==1075388923)break g;if((0|r)>0|(0|r)>=0){c=(e+=-6.2831853069365025)+-2430840202602477e-25,_[t>>3]=c,_[t+8>>3]=e-c-2430840202602477e-25,a=4;break A}c=(e+=6.2831853069365025)+2430840202602477e-25,_[t>>3]=c,_[t+8>>3]=e-c+2430840202602477e-25,a=-4;break A}if(p>>>0>1094263290)break e}i=(k=(c=e+-1.5707963267341256*(g=.6366197723675814*e+6755399441055744-6755399441055744))-(x=6077100506506192e-26*g))<-.7853981633974483,a=b(g)<2147483648?~~g:-2147483648,i?(a=a-1|0,x=6077100506506192e-26*(g+=-1),c=e+-1.5707963267341256*g):k>.7853981633974483&&(a=a+1|0,x=6077100506506192e-26*(g+=1),c=e+-1.5707963267341256*g),e=c-x,_[t>>3]=e,f(+e),i=0|l(1),l(0),((o=p>>>20|0)-(i>>>20&2047)|0)<17||(x=c,e=(c-=e=6077100506303966e-26*g)-(x=20222662487959506e-37*g-(x-c-e)),_[t>>3]=e,f(+e),i=0|l(1),l(0),(o-(i>>>20&2047)|0)<50||(x=c,e=(c-=e=20222662487111665e-37*g)-(x=84784276603689e-45*g-(x-c-e)),_[t>>3]=e)),_[t+8>>3]=c-e-x;break A}if(p>>>0>=2146435072)e-=e,_[t>>3]=e,_[t+8>>3]=e,a=0;else{for(u(0,0|i),u(1,1048575&r|1096810496),e=+d(),a=0,i=1;o=(n+16|0)+(a<<3)|0,c=+(0|(a=b(e)<2147483648?~~e:-2147483648)),_[o>>3]=c,e=16777216*(e-c),a=1,o=i,i=0,o;);for(_[n+32>>3]=e,a=2;a=(i=a)-1|0,_[(n+16|0)+(i<<3)>>3]==0;);if(A=n+16|0,o=0,z=m=z-560|0,p=v(O=(0|(p=((a=(p>>>20|0)-1046|0)-3|0)/24|0))>0?p:0,-24)+a|0,((S=s[28105])+(h=(E=i+1|0)-1|0)|0)>=0)for(a=S+E|0,i=O-h|0;_[(m+320|0)+(o<<3)>>3]=(0|i)<0?0:+s[112432+(i<<2)>>2],i=i+1|0,(0|a)!=(0|(o=o+1|0)););for(T=p-24|0,a=0,o=(0|S)>0?S:0,w=(0|E)<=0;;){if(w)e=0;else for(y=a+h|0,i=0,e=0;e=_[(i<<3)+A>>3]*_[(m+320|0)+(y-i<<3)>>3]+e,(0|E)!=(0|(i=i+1|0)););if(_[(a<<3)+m>>3]=e,i=(0|a)==(0|o),a=a+1|0,i)break}P=47-p|0,j=48-p|0,F=p-25|0,a=S;e:{for(;;){if(e=_[(a<<3)+m>>3],i=0,o=a,!(y=(0|a)<=0))for(;w=(m+480|0)+(i<<2)|0,h=b(c=5.960464477539063e-8*e)<2147483648?~~c:-2147483648,h=b(e=-16777216*(c=+(0|h))+e)<2147483648?~~e:-2147483648,s[w>>2]=h,e=_[((o=o-1|0)<<3)+m>>3]+c,(0|a)!=(0|(i=i+1|0)););e=An(e,T),e+=-8*C(.125*e),e-=+(0|(w=b(e)<2147483648?~~e:-2147483648));g:{r:{C:{if(M=(0|T)<=0){if(T)break C;h=s[476+((a<<2)+m|0)>>2]>>23}else D=o=(a<<2)+m|0,o=(h=s[o+476>>2])-((i=h>>j)<>2]=o,w=i+w|0,h=o>>P;if((0|h)<=0)break g;break r}if(h=2,!(e>=.5)){h=0;break g}}if(i=0,o=0,!y)for(;N=s[(D=(m+480|0)+(i<<2)|0)>>2],y=16777215,o||(y=16777216,N)?(s[D>>2]=y-N,o=1):o=0,(0|a)!=(0|(i=i+1|0)););r:if(!M){i=8388607;C:switch(0|F){case 1:i=4194303;break;case 0:break C;default:break r}s[(y=(a<<2)+m|0)+476>>2]=s[y+476>>2]&i}w=w+1|0,(0|h)==2&&(e=1-e,h=2,o&&(e-=An(1,T)))}if(e!=0)break;if(o=0,!((0|S)>=(0|(i=a)))){for(;o=s[(m+480|0)+((i=i-1|0)<<2)>>2]|o,(0|i)>(0|S););if(o){for(p=T;p=p-24|0,!s[(m+480|0)+((a=a-1|0)<<2)>>2];);break e}}for(i=1;o=i,i=i+1|0,!s[(m+480|0)+(S-o<<2)>>2];);for(o=a+o|0;;){if(h=a+E|0,a=a+1|0,_[(m+320|0)+(h<<3)>>3]=s[112432+(O+a<<2)>>2],i=0,e=0,(0|E)>0)for(;e=_[(i<<3)+A>>3]*_[(m+320|0)+(h-i<<3)>>3]+e,(0|E)!=(0|(i=i+1|0)););if(_[(a<<3)+m>>3]=e,!((0|a)<(0|o)))break}a=o}(e=An(e,24-p|0))>=16777216?(T=(m+480|0)+(a<<2)|0,i=b(c=5.960464477539063e-8*e)<2147483648?~~c:-2147483648,o=b(e=-16777216*(0|i)+e)<2147483648?~~e:-2147483648,s[T>>2]=o,a=a+1|0):(i=b(e)<2147483648?~~e:-2147483648,p=T),s[(m+480|0)+(a<<2)>>2]=i}if(e=An(1,p),!((0|a)<0)){for(i=a;o=i,_[(i<<3)+m>>3]=e*+s[(m+480|0)+(i<<2)>>2],i=i-1|0,e*=5.960464477539063e-8,o;);if(y=0,!((0|a)<0))for(p=(0|S)>0?S:0,o=a;;){for(T=p>>>0>>0?p:y,S=a-o|0,i=0,e=0;e=_[115200+(i<<3)>>3]*_[(i+o<<3)+m>>3]+e,E=(0|i)!=(0|T),i=i+1|0,E;);if(_[(m+160|0)+(S<<3)>>3]=e,o=o-1|0,i=(0|a)!=(0|y),y=y+1|0,!i)break}}if(e=0,(0|a)>=0)for(i=a;o=i,i=i-1|0,e+=_[(m+160|0)+(o<<3)>>3],o;);if(_[n>>3]=h?-e:e,e=_[m+160>>3]-e,i=1,(0|a)>0)for(;e+=_[(m+160|0)+(i<<3)>>3],o=(0|i)!=(0|a),i=i+1|0,o;);_[n+8>>3]=h?-e:e,z=m+560|0,a=7&w,e=_[n>>3],(0|r)<0?(_[t>>3]=-e,_[t+8>>3]=-_[n+8>>3],a=0-a|0):(_[t>>3]=e,_[t+8>>3]=_[n+8>>3])}}return z=n+48|0,a}function De(){var e=0,t=0,n=0,r=0,i=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,y=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0,P=0,F=0,I=0,L=0,ee=0,te=0,R=0,ne=0,re=0,ie=0,ae=0,z=0,oe=0,se=0,ce=0,le=0,ue=0,de=0,fe=0,pe=0;s[55925]=0,e=s[56772],s[56772]=e+1,n=s[55961],y=s[55922],S=yn(39.89822670059037*(t=+(0|e))),p=yn(22.30530784048753*t),t=(0|y)/50*((0|n)/100)*(yn(14.765485471872028*t)+(S+p))*10,e=b(t)<2147483648?~~t:-2147483648,s[56607]=e+s[56607];A:if(!(s[55923]<=0)){for(;;){for(n=hr(s[33209],0,1103515245,0),e=B,e=Si(n=n+12345|0,e=n>>>0<12345?e+1|0:e),s[33209]=e,e=8191+((e>>>0)%16383|0)|0,s[55929]=e,L=+(0|e),t=.75*_[28387]+L,_[28387]=t,ee=(0|(e=s[55924]))>(0|(A=s[55928]))?.5*t:t,re=(i=.033*s[56652])>0?1-i:1,n=s[56650]<<2,N=(0|(M=s[55921]))==1&&(0|n)>263?263:n,ie=111136+((te=s[56651])<<1)|0,ae=111136+((P=s[56658])<<1)|0,z=(0|P)>0,R=s[55918],oe=v(R,40),se=s[55925],ce=_[27967],ne=s[56607],t=_[27979],w=_[27969],d=_[27970],F=s[56780],D=s[56654],h=_[27976],x=_[27972],T=_[28388],E=_[28389],y=s[55927],r=_[28383],m=s[55926],O=s[55956],le=_[27975],p=_[28131],l=_[28130],u=_[28123],C=_[28121],f=_[28122],j=_[28120],k=_[28119],ue=_[28129],de=_[28128],fe=_[28127],pe=_n(0*_[27968]),I=0;;){S=l;e:{g:switch(M-1|0){case 0:T=0,l=C*u,u=f,f=r=l+(k*(T=(0|e)<=2?_[111312+(e<<3)>>3]:T)+j*u);break e;case 1:if(r=0,(0|e)>=(0|y)){E=0;break e}l=_[27965]-_[27966],_[27965]=l,r=.028*(E=l+E);break e;case 2:if(!m){O=100,r=0;break e}O=100,n=b(l=(0|e)/(0|m)*100)<2147483648?~~l:-2147483648,r=+o[110928+((0|n)%100<<1)>>1],r=t*((+o[110928+((n+1|0)%100<<1)>>1]-r)*(l-+(0|n))+r);break e;case 3:break g;default:break e}m?(O=256,n=b(l=(0|e)/(0|m)*256)<2147483648?~~l:-2147483648,r=+o[111344+((0|n)%256<<1)>>1],r=t*((+o[111344+((n+1|0)%256<<1)>>1]-r)*(l-+(0|n))+r)):(O=256,r=0)}if((0|e)>=(0|m)&&((0|ne)>0?(e=(0|oe)/(0|ne)|0,h=0,x=0,x=P>>>0<=87?.001*o[ae>>1]:x,h=te>>>0<=87?.001*o[ie>>1]*.1:h,A=e>>z,y=(0|(n=(m=(e-1|0)<=(0|N))?e-2|0:N))<=40?40:n,l=+o[111776+((y=m||(0|n)<40?y:N)<<1)>>1],_[27966]=l,C=l,l=+(0|y),_[27965]=C*l*.333,D=(0|(n=e-y|0))>(0|D)?D:n,F=0-(n=(0|F)<0?0-D|0:D)|0,k=(l*=.00833)*l,k*=1-(j=(C=(l=dt(ce*+((0|R)/(0|y)|0)))*pe)+C)-(C=l*-l),e=(0|(m=e+n|0))!=4):(s[55930]=0,s[55931]=0,s[55932]=0,s[55933]=0,A=4,h=0,x=0,m=4,e=0),d=(e|=!se)?i:d,w=e?re:w,e=0),e=e+1|0,l=r=ue*p+(fe*r+de*S),p=S,(0|(I=I+1|0))==4)break}if(s[55926]=m,s[55956]=O,s[55924]=e,_[28383]=r,s[55927]=y,_[28389]=E,_[28388]=T,_[27972]=x,_[27976]=h,s[55928]=A,s[56654]=D,s[56780]=F,_[27970]=d,_[27969]=w,_[28122]=f,_[28120]=j,_[28119]=k,_[28123]=u,_[28121]=C,_[28131]=p,_[28130]=r,(0|M)==5&&(r=6e3*((t=(0|e)/(0|m))+t+-1),_[28383]=r),t=r*w+_[28384]*d,_[28383]=t,_[28384]=t,(0|e)<(0|y)&&(t=h*L+t,_[28383]=t),d=ee*_[27974],S=t*_[27973]+d,p=0,s[55916]!=2&&(p=_[27987],f=_[27986],_[27987]=f,t=d+t*x,_[27986]=t,d=_[28059],u=_[28058],_[28059]=u,t=d*_[28057]+(_[28055]*(p*_[27985]+(_[27983]*t+f*_[27984]))+u*_[28056]),_[28058]=t,p=_[28049],d=_[28051],f=_[28048],u=_[28047],i=_[28050],_[28051]=i,t=p*d+(u*t+f*i),_[28050]=t,p=_[28043],d=_[28041],f=_[28040],u=_[28039],i=_[28042],_[28043]=i,t=d*p+(u*t+f*i),_[28042]=t,p=_[28035],d=_[28033],f=_[28032],u=_[28031],i=_[28034],_[28035]=i,t=d*p+(u*t+f*i),_[28034]=t,p=_[28027],d=_[28025],f=_[28024],u=_[28023],i=_[28026],_[28027]=i,t=d*p+(u*t+f*i),_[28026]=t,p=_[28019],d=_[28017],f=_[28016],u=_[28015],i=_[28018],_[28019]=i,t=d*p+(u*t+f*i),_[28018]=t,p=_[28011],d=_[28009],f=_[28008],u=_[28007],i=_[28010],_[28011]=i,t=d*p+(u*t+f*i),_[28010]=t,p=_[28003],d=_[28001],f=_[28e3],u=_[27999],i=_[28002],_[28003]=i,t=d*p+(u*t+f*i),_[28002]=t,p=_[27995],d=_[27993],f=_[27992],u=_[27991],i=_[27994],_[27995]=i,p=d*p+(u*t+f*i),_[27994]=p),t=_[28385],_[28385]=S,d=_[28075],f=_[28074],_[28075]=f,u=_[28067],i=_[28066],_[28067]=i,d=d*_[28073]+(_[28071]*S+f*_[28072]),_[28074]=d,f=u*_[28065]+(_[28063]*S+i*_[28064]),_[28066]=f,u=_[28081],i=_[28083],l=_[28079],r=_[28080],h=_[28082],_[28083]=h,S=u*i+(l*(t=le*ee+S-t)+r*h),_[28082]=S,u=_[28091],i=_[28089],l=_[28087],r=_[28088],h=_[28090],_[28091]=h,u=i*u+(l*t+r*h),_[28090]=u,i=_[28099],l=_[28097],r=_[28095],h=_[28096],x=_[28098],_[28099]=x,i=l*i+(r*t+h*x),_[28098]=i,l=_[28107],r=_[28105],h=_[28103],x=_[28104],w=_[28106],_[28107]=w,l=r*l+(h*t+x*w),_[28106]=l,r=_[28115],h=_[28113],x=_[28111],w=_[28112],T=_[28114],_[28115]=T,r=h*r+(x*t+w*T),_[28114]=r,h=_[28139],x=_[28137],w=_[28136],T=_[28135],E=_[27971],C=_[28138],_[28139]=C,t=x*h+(T*(t*E-(r-(l-(i-(u-(S-(p+d+f)))))))+w*C),_[28138]=t,t=_[27977]*(t*+s[50779]),r=+(0|(e=b(t)<2147483648?~~t:-2147483648)),(0|(e=s[50776]))>1],s[50755])>>8,e=b(r)<2147483648?~~r:-2147483648,(0|n)>=5500&&(s[51293]=0),n=s[51290],s[51290]=n+1,e=(0|(e=(0|(e=e+m|0))<=-32768?-32768:e))>=32767?32767:e,a[0|n]=e,n=s[51290],s[51290]=n+1,a[0|n]=e>>>8,m=(n=s[51292])+1|0,s[51292]=m,o[205184+(n<<1)>>1]=e,(0|m)>=5500&&(s[51292]=0),m=1,s[56606]+=1,g[54046]>>0)break A;if(e=s[55925]+1|0,s[55925]=e,!((0|e)>2]=t,p=d+55|0,f=d+56|0;A:{e:{g:{r:{C:for(;;){if(g=t,(2147483647^C)<(0|m))break r;C=m+C|0;a:{I:{f:{if(h=c[0|(m=g)])for(;;){i:{b:if(t=255&h){if((0|t)!=37)break i;for(h=m;;){if(c[h+1|0]!=37){t=h;break b}if(m=m+1|0,b=c[h+2|0],h=t=h+2|0,(0|b)!=37)break}}else t=m;if((0|(m=m-g|0))>(0|(A=2147483647^C)))break r;if(e&&wi(e,g,m),m)continue C;s[d+76>>2]=t,m=t+1|0,w=-1,c[t+2|0]!=36|a[t+1|0]-48>>>0>=10||(w=a[t+1|0]-48|0,D=1,m=t+3|0),s[d+76>>2]=m,x=0;b:if((t=(h=a[0|m])-32|0)>>>0>31)S=m;else if(S=m,75913&(t=1<>2]=S,x|=t,(t=(h=a[m+1|0])-32|0)>>>0>=32)break b;if(m=S,!(75913&(t=1<>2]}else{if(c[S+2|0]!=36|a[S+1|0]-48>>>0>=10){if(D)break f;if(h=S+1|0,!e){s[d+76>>2]=h,D=0,T=0;break b}t=s[n>>2],s[n>>2]=t+4,D=0,t=s[t>>2]}else s[((a[S+1|0]<<2)+i|0)-192>>2]=10,h=S+3|0,D=1,t=s[((a[S+1|0]<<3)+r|0)-384>>2];if(s[d+76>>2]=h,T=t,(0|t)>=0)break b;T=0-T|0,x|=8192}if(m=0,y=-1,c[0|h]==46)if(c[h+1|0]!=42)s[d+76>>2]=h+1,y=ur(d+76|0),t=s[d+76>>2],k=1;else{if(c[h+3|0]!=36|a[h+2|0]-48>>>0>=10){if(D)break f;t=h+2|0,y=0,e&&(h=s[n>>2],s[n>>2]=h+4,y=s[h>>2])}else s[((a[h+2|0]<<2)+i|0)-192>>2]=10,t=h+4|0,y=s[((a[h+2|0]<<3)+r|0)-384>>2];s[d+76>>2]=t,k=~y>>>31|0}else t=h,k=0;for(;;){if(E=m,S=28,b=t,(m=a[0|t])-123>>>0<4294967238)break g;if(t=b+1|0,!((m=c[123983+(m+v(E,58)|0)|0])-1>>>0<8))break}s[d+76>>2]=t;b:{s:{if((0|m)!=27){if(!m)break g;if((0|w)>=0){s[(w<<2)+i>>2]=m,m=s[(h=(w<<3)+r|0)+4>>2],s[d+64>>2]=s[h>>2],s[d+68>>2]=m;break s}if(!e)break a;At(d- -64|0,m,n,u);break b}if((0|w)>=0)break g}if(m=0,!e)continue C}h=-65537&x,x=8192&x?h:x,w=0,O=84065,S=f;b:{s:{t:{n:{k:{o:{B:{c:{Q:{G:{w:{E:{D:{u:{l:{x:switch(m=a[0|b],(m=E&&(15&m)==3?-33&m:m)-88|0){case 11:break b;case 9:case 13:case 14:case 15:break s;case 27:break B;case 12:case 17:break G;case 23:break w;case 0:case 32:break E;case 24:break D;case 22:break u;case 29:break l;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 10:case 16:case 18:case 19:case 20:case 21:case 25:case 26:case 28:case 30:case 31:break I;default:break x}x:switch(m-65|0){case 0:case 4:case 5:case 6:break s;case 2:break k;case 1:case 3:break I;default:break x}if((0|m)==83)break o;break I}h=s[d+64>>2],b=s[d+68>>2],O=84065;break Q}m=0;u:switch(255&E){case 0:case 1:case 6:s[s[d+64>>2]>>2]=C;continue C;case 2:g=s[d+64>>2],s[g>>2]=C,s[g+4>>2]=C>>31;continue C;case 3:o[s[d+64>>2]>>1]=C;continue C;case 4:a[s[d+64>>2]]=C;continue C;case 7:break u;default:continue C}g=s[d+64>>2],s[g>>2]=C,s[g+4>>2]=C>>31;continue C}y=y>>>0<=8?8:y,x|=8,m=120}if(g=f,j=32&m,(h=s[d+64>>2])|(b=s[d+68>>2]))for(;a[0|(g=g-1|0)]=j|c[124512+(15&h)|0],M=!b&h>>>0>15|!!(0|b),E=b,b=b>>>4|0,h=(15&E)<<28|h>>>4,M;);if(!(s[d+64>>2]|s[d+68>>2])|!(8&x))break c;O=84065+(m>>>4|0)|0,w=2;break c}if(m=f,b=g=s[d+68>>2],g|(h=s[d+64>>2]))for(;a[0|(m=m-1|0)]=7&h|48,E=!b&h>>>0>7|!!(0|b),b=(g=b)>>>3|0,h=(7&g)<<29|h>>>3,E;);if(g=m,!(8&x))break c;y=(0|(m=f-g|0))<(0|y)?y:m+1|0;break c}h=s[d+64>>2],b=m=s[d+68>>2],(0|m)<0?(b=g=0-(b+!!(0|h)|0)|0,h=0-h|0,s[d+64>>2]=h,s[d+68>>2]=g,w=1,O=84065):2048&x?(w=1,O=84066):O=(w=1&x)?84067:84065}g=ar(h,b,f)}if((0|y)<0&&k)break r;if(x=k?-65537&x:x,!(y|!!((m=s[d+64>>2])|(h=s[d+68>>2])))){g=f,y=0;break I}y=(0|(m=!(m|h)+(f-g|0)|0))<(0|y)?y:m;break I}if(S=(m=(m=un(g=(m=s[d+64>>2])||84639,0,b=y>>>0>=2147483647?2147483647:y))?m-g|0:b)+g|0,(0|y)>=0){x=h,y=m;break I}if(x=h,y=m,c[0|S])break r;break I}if(y){h=s[d+64>>2];break n}m=0,br(e,32,T,0,x);break t}s[d+12>>2]=0,s[d+8>>2]=s[d+64>>2],h=d+8|0,s[d+64>>2]=h,y=-1}m=0;n:{for(;;){if(!(g=s[h>>2]))break n;if(!((g=(0|(b=cn(d+4|0,g)))<0)|b>>>0>y-m>>>0)){if(h=h+4|0,y>>>0>(m=m+b|0)>>>0)continue;break n}break}if(g)break e}if(S=61,(0|m)<0)break g;if(br(e,32,T,m,x),m)for(S=0,h=s[d+64>>2];;){if(!(g=s[h>>2])||(S=(g=cn(d+4|0,g))+S|0)>>>0>m>>>0)break t;if(wi(e,d+4|0,g),h=h+4|0,!(m>>>0>S>>>0))break}else m=0}br(e,32,T,m,8192^x),m=(0|m)<(0|T)?T:m;continue C}if((0|y)<0&&k)break r;if(S=61,(0|(m=0|Ui[0|l](e,_[d+64>>3],T,y,x,m)))>=0)continue C;break g}a[d+55|0]=s[d+64>>2],y=1,g=p,x=h;break I}h=c[m+1|0],m=m+1|0}if(e)break A;if(!D)break a;for(m=1;;){if(e=s[(m<<2)+i>>2]){if(At((m<<3)+r|0,e,n,u),C=1,(0|(m=m+1|0))!=10)continue;break A}break}if(C=1,m>>>0>=10)break A;for(;;){if(s[(m<<2)+i>>2])break f;if((0|(m=m+1|0))==10)break}break A}S=28;break g}if((0|(h=(0|y)>(0|(b=S-g|0))?y:b))>(2147483647^w))break r;if(S=61,(0|A)<(0|(m=(0|(y=h+w|0))<(0|T)?T:y)))break g;br(e,32,m,y,x),wi(e,O,w),br(e,48,m,y,65536^x),br(e,48,h,b,0),wi(e,g,b),br(e,32,m,y,8192^x);continue}break}C=0;break A}S=61}s[56798]=S}C=-1}return z=d+80|0,C}function ke(e,t,n,r,i,a,o,c,l){var u,d,f,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0,P=0,F=0,I=0,L=0,ee=0,te=0,R=0,ne=0,re=0,ie=0,ae=0;z=u=z-96|0,w=65535&l,_=-2147483648&(i^l),k=y=65535&i;A:{if(!((d=l>>>16&32767)-32767>>>0>4294934529&(f=i>>>16&32767)-32767>>>0>=4294934530)){if(p=r,!(!r&(0|(b=S=2147483647&i))==2147418112?!(t|n):b>>>0<2147418112)){h=r,_=32768|i;break A}if(!(!(i=c)&(0|(v=S=2147483647&l))==2147418112?!(a|o):v>>>0<2147418112)){h=c,_=32768|l,t=a,n=o;break A}if(!(t|p|2147418112^b|n)){if(!(i|a|o|v)){_=2147450880,t=0,n=0;break A}_|=2147418112,t=0,n=0;break A}if(!(i|a|2147418112^v|o)){if(i=t|p,r=n|b,t=0,n=0,!(r|i)){_=2147450880;break A}_|=2147418112;break A}if(!(t|p|n|b)){t=0,n=0;break A}if(!(i|a|o|v)){t=0,n=0;break A}(0|b)==65535|b>>>0<65535&&(S=(p=!(r|y))<<6,i=x(l=p?t:r)+32|0,rn(u+80|0,t,n,r,y,(l=S+((0|(l=x(p?n:y)))==32?i:l)|0)-15|0),C=16-l|0,r=s[u+88>>2],k=s[u+92>>2],n=s[u+84>>2],t=s[u+80>>2]),v>>>0>65535||(y=(l=!(c|w))<<6,p=x(i=l?a:c)+32|0,rn(u- -64|0,a,o,c,w,(i=y+((0|(i=x(l?o:w)))==32?p:i)|0)-15|0),C=16+(C-i|0)|0,c=s[u+72>>2],w=s[u+76>>2],a=s[u+64>>2],o=s[u+68>>2])}if(i=a,a=o<<15|a>>>17,te=n,S=hr(T=-32768&(l=i<<15),i=0,n,0),O=i=B,R=a,b=t,t=hr(a,0,t,0),a=B+i|0,n=t>>>0>(l=t+S|0)>>>0?a+1|0:a,p=0,t=hr(b,m,T,m),i=(a=l)+B|0,y=i=t>>>0>(v=p+t|0)>>>0?i+1|0:i,ne=(0|a)==(0|i)&p>>>0>v>>>0|i>>>0>>0,re=r,E=hr(T,m,r,0),ie=B,t=hr(te,m,R,m),p=B+ie|0,p=t>>>0>(D=t+E|0)>>>0?p+1|0:p,t=w<<15|c>>>17,r=hr(A=c<<15|o>>>17,0,b,m),a=B+p|0,M=a=r>>>0>(j=r+D|0)>>>0?a+1|0:a,a=(r=(0|n)==(0|O)&l>>>0>>0|n>>>0>>0)+a|0,w=a=n>>>0>(N=n+j|0)>>>0?a+1|0:a,o=N,n=a,k=hr(T,m,P=65536|k,g),ae=B,r=hr(re,h,R,m),i=B+ae|0,l=i=r>>>0>(F=r+k|0)>>>0?i+1|0:i,t=hr(I=-2147483648|t,0,b,m),a=B+i|0,a=t>>>0>(L=t+F|0)>>>0?a+1|0:a,t=hr(A,h,te,m),ee=a,a=a+B|0,S=t>>>0>(O=t+L|0)>>>0?a+1|0:a,i=n+O|0,a=T=(t=0)>>>0>(b=t+o|0)>>>0?i+1|0:i,n=(t=b+ne|0)>>>0>>0?a+1|0:a,C=((f+d|0)+C|0)-16383|0,r=hr(I,h,te,m),c=B,i=hr(P,h,R,m),a=B+c|0,g=(0|c)==(0|(a=i>>>0>(o=i+r|0)>>>0?a+1|0:a))&r>>>0>o>>>0|a>>>0>>0,c=a,i=hr(A,h,re,h),a=B+a|0,i=a=(r=i+o|0)>>>0>>0?a+1|0:a,o=(0|a)==(0|c)&r>>>0>>0|a>>>0>>0,a=0,a=(c=o)>>>0>(o=o+g|0)>>>0?1:a,c=o,o=hr(I,h,P,h),a=B+a|0,ne=c=c+o|0,o=o>>>0>c>>>0?a+1|0:a,c=r,m=i,i=(0|p)==(0|ie)&E>>>0>D>>>0|p>>>0>>0,a=0,i=((g=p=(0|p)==(0|M)&D>>>0>j>>>0|p>>>0>M>>>0)>>>0>(p=i+p|0)>>>0?1:a)+m|0,a=o,g=i=(r=r+p|0)>>>0

>>0?i+1|0:i,E=r,i=r=(0|i)==(0|m)&r>>>0>>0|i>>>0>>0,p=r=r+ne|0,o=a=i>>>0>r>>>0?a+1|0:a,i=hr(A,h,P,h),m=B,r=hr(I,h,re,h),a=B+m|0,r=a=r>>>0>(c=r+i|0)>>>0?a+1|0:a,i=(a=(0|m)==(0|a)&i>>>0>c>>>0|a>>>0>>0)+o|0,o=i=r>>>0>(D=r+p|0)>>>0?i+1|0:i,a=c+g|0,i=a=(r=(i=0)+E|0)>>>0>>0?a+1|0:a,c=(0|g)==(0|a)&r>>>0>>0|a>>>0>>0,a=o,a=(o=c+(m=D)|0)>>>0>>0?a+1|0:a,E=o,c=r,p=i,i=(r=(r=(r=(0|l)==(0|ae)&k>>>0>F>>>0|l>>>0>>0)+(l=(0|l)==(0|ee)&F>>>0>L>>>0|l>>>0>ee>>>0)|0)+(i=(0|S)==(0|ee)&O>>>0>>0|S>>>0>>0)|0)+p|0,a=o=a,p=o=(c=(0|(i=(r=l=(g=S)+c|0)>>>0>>0?i+1|0:i))==(0|p)&c>>>0>r>>>0|i>>>0

>>0)+E|0,o=a=c>>>0>o>>>0?a+1|0:a,c=r,a=0,l=i,i=i+((m=g=(0|w)==(0|T)&b>>>0>>0|w>>>0>T>>>0)>>>0>(g=g+((0|w)==(0|M)&j>>>0>N>>>0|w>>>0>>0)|0)>>>0?1:a)|0,a=o,l=a=(o=c=(0|(i=(r=r+g|0)>>>0>>0?i+1|0:i))==(0|l)&r>>>0>>0|i>>>0>>0)>>>0>(c=c+p|0)>>>0?a+1|0:a,65536&a?C=C+1|0:(p=y>>>31|0,a=l<<1|c>>>31,c=c<<1|i>>>31,l=a,a=i<<1|r>>>31,r=r<<1|n>>>31,i=a,a=y<<1|v>>>31,v<<=1,y=a,a=n<<1|t>>>31,t=t<<1|p,n=a|(o=0)),(0|C)>=32767)_|=2147418112,t=0,n=0;else{e:{if((0|C)<=0){if((o=1-C|0)>>>0<=127){rn(u+48|0,v,y,t,n,a=C+127|0),rn(u+32|0,r,i,c,l,a),Qt(u+16|0,v,y,t,n,o),Qt(u,r,i,c,l,o),v=s[u+32>>2]|s[u+16>>2]|!!(s[u+48>>2]|s[u+56>>2]|s[u+52>>2]|s[u+60>>2]),y=s[u+36>>2]|s[u+20>>2],t=s[u+40>>2]|s[u+24>>2],n=s[u+44>>2]|s[u+28>>2],r=s[u>>2],i=s[u+4>>2],o=s[u+8>>2],a=s[u+12>>2];break e}t=0,n=0;break A}o=c,a=65535&l|C<<16}h|=o,_|=a,(!t&(0|n)==-2147483648?!(v|y):(0|n)>0|(0|n)>=0)?t|v|-2147483648^n|y?(t=r,n=i):(p=_,_=(r=(0|(a=i))==(0|(n=(n=t=1&r)>>>0>(t=t+r|0)>>>0?a+1|0:a))&t>>>0>>0|n>>>0>>0)>>>0>(h=r+h|0)>>>0?p+1|0:p):(r=(0|i)==(0|(n=(t=r+1|0)?i:i+1|0))&t>>>0>>0|n>>>0>>0,i=_,_=(h=r+h|0)>>>0>>0?i+1|0:i)}}s[e>>2]=t,s[e+4>>2]=n,s[e+8>>2]=h,s[e+12>>2]=_,z=u+96|0}function Ae(e,t,n,r,i,o,l){var u,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0;z=u=z-480|0,s[u+476>>2]=0,s[u+456>>2]=0,s[u+460>>2]=0,s[u+448>>2]=0,s[u+452>>2]=0,s[u+440>>2]=0,s[u+444>>2]=0,s[u+432>>2]=0,s[u+436>>2]=0,d=0;A:if(s[e+684>>2]){for(_=l?s[l>>2]:_;p=c[t+d|0],a[(u+112|0)+d|0]=p,f=d+1|0,p&&(p=d>>>0<158,d=f,p););if(a[f+(u+112|0)|0]=0,!((b=268435456&o)|!(8&s[47197]))){f=0;e:if(223&(p=c[0|t]))for(d=0;;){if(a[(u+272|0)+d|0]=p,!(223&(p=c[(f=d+1|0)+t|0])))break e;if(m=d>>>0<118,d=f,!m)break}a[(d=u+272|0)+f|0]=0,s[u+48>>2]=d,fi(s[47195],(0|o)>=0?87019:86877,u+48|0)}s[u+464>>2]=t,s[e+8208>>2]=0,s[e+8212>>2]=0,i&&(a[0|i]=0);e:{g:if(223&(d=c[0|t]))for(x=536870912&o,S=4096&o,C=u+105|0,f=t,p=0;;){m=nn(u+476|0,f),y=!!(0|En(s[u+476>>2]))+y|0,g=c[(d=(h=255&d)+e|0)+7668|0];r:if(!((v=s[u+476>>2])-48>>>0<10|v-2406>>>0<10)|(y?c[e+170|0]:0)){C:if((p=s[u+476>>2]-s[e+600>>2]|0)>>>0>127||!(p=s[6192+((p<<2)+e|0)>>2])){if(g){for(v=5168+((h<<2)+e|0)|0,g=g+(d=c[d+7924|0])|0,w=h|c[f+1|0]<<8,p=0;s[(f=(d<<2)+e|0)+7184>>2]==(0|w)&&(s[u+472>>2]=s[u+464>>2],he(e,u+472|0,t,2,s[f+6704>>2],u+432|0,o,_),(0|(f=s[u+432>>2]))>0&&(f=f+35|0,s[u+432>>2]=f),p=1,he(e,u+464|0,t,1,s[v>>2],u+448|0,o,_),s[u+448>>2]>(0|f)||(f=s[u+444>>2],s[u+456>>2]=s[u+440>>2],s[u+460>>2]=f,f=s[u+436>>2],s[u+448>>2]=s[u+432>>2],s[u+452>>2]=f,s[u+464>>2]=s[u+472>>2])),g>>>0>(d=d+1|0)>>>0;);if(p)break C}a:{I:{if(!(d=s[5168+((h<<2)+e|0)>>2])){if(he(e,u+464|0,t,0,s[e+5168>>2],u+448|0,o,_),s[u+448>>2])break a;if(16&c[188808])break I;if(p=nn(u+468|0,h=(f=s[u+464>>2])-1|0),d=s[u+468>>2],!(s[e+600>>2]<=0|(0|d)>577)){if(Xr(d)){s[u+32>>2]=21,H(n,87049,u+32|0);break e}d=s[u+468>>2]}if((0|d)==57384&&((0|(g=s[e+92>>2]))<=s[47352]||(s[47352]=g)),hi(d)&&((0|(d=s[e+72>>2]))<=s[47352]||(s[47352]=d)),!((g=(d=s[u+468>>2])-192|0)>>>0>413)&&(g=c[g+94240|0])&&(p=p-1|0,!(c[f-2|0]==32&c[p+f|0]==32))){for(s[u+472>>2]=h,a[0|h]=g;m=c[(d=f)+p|0],a[0|d]=m,f=d+1|0,(0|m)!=32;);if((0|p)>0&&Pt(d,32,p),s[e+24>>2]&&!((0|Kr(94222,s[u+468>>2]))<=0)){s[u+464>>2]=h,p=0;break r}p=0,a[0|n]=0,s[u+464>>2]=t,s[e+8208>>2]=0,s[e+8212>>2]=0;break r}if(!(d=_t(d))||(0|(f=s[d+4>>2]))==s[e+600>>2])break I;if((0|f)==s[e+188>>2]){s[u+4>>2]=Pr(u- -64|0,s[e+192>>2]),s[u>>2]=21,H(n,87218,u);break e}if(!(4&c[d+16|0]))break I;s[u+20>>2]=Pr(u- -64|0,s[d+12>>2]),s[u+16>>2]=21,H(n,87218,u+16|0);break e}if(he(e,u+464|0,t,1,d,u+448|0,o,_),s[u+448>>2])break a}I:if(!((d=s[u+476>>2])-768>>>0<112)){if(En(d)){if(a[(m+s[u+464>>2]|0)-1|0]<33&(0|y)<=1)break I;if(a[0|n]=0,!l)break g;s[l>>2]=4096|s[l>>2];break g}Nt(e,s[u+476>>2],-1,u+272|0,0),c[u+272|0]&&(s[u+448>>2]=1,s[u+452>>2]=u+272)}s[u+464>>2]=(m+s[u+464>>2]|0)-1;break C}s[e+288>>2]=0}else he(e,u+464|0,t,m,p,u+448|0,o,_);if(f=(d=s[u+452>>2])||86135,s[u+452>>2]=f,p=0,!(s[u+448>>2]<=0)){if(d=1|s[u+456>>2],(0|o)<0)break A;if(!(c[0|f]!=21|S)){gn(n,f);break e}if(!(!(8&s[47197])|b))C:if(d=s[47195],(0|(m=s[d+76>>2]))>=0&(!m|s[56823]!=(-1073741825&m)))h=s[(m=d+76|0)>>2],s[m>>2]=h||1073741823,s[d+80>>2]==10||(0|(h=s[d+20>>2]))==s[d+16>>2]?Qn(d):(s[d+20>>2]=h+1,a[0|h]=10),s[m>>2]=0;else{if(s[d+80>>2]!=10&&(0|(m=s[d+20>>2]))!=s[d+16>>2]){s[d+20>>2]=m+1,a[0|m]=10;break C}Qn(d)}if(m=-32769&(d=s[u+456>>2]),s[u+456>>2]=m,!(!i|!m|(1024&d?x:0))){e=s[u+464>>2],gn(i,f),d=m|(T=(n=e)-ut(t,e=u+112|0,U(e))|0,(1151&d)==1024?T:0);break A}(d=s[u+460>>2])&&(a[0|d]=69),vn(e,n,r,f)}}else a[u+104|0]=95,ut(C,f,m),d=1,a[105+(u+m|0)|0]=0,zn(e,u+104|0,u- -64|0),p-1>>>0<=4294967293&&(d=U(d=u- -64|0)+d|0,a[0|d]=11,a[d+1|0]=0,d=0),vn(e,n,r,u- -64|0),s[u+464>>2]=f+m,p=d;if(f=s[u+464>>2],!(223&(d=c[0|f])))break}ut(t,e=u+112|0,U(e))}d=0}return z=u+480|0,d}function je(e,t){var n,r=0,i=0,o=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0;z=n=z-2976|0,s[t>>2]=1,r=s[e+20>>2],s[(u=n+2960|0)>>2]=s[e+16>>2],s[u+4>>2]=r,r=s[e+12>>2],s[(u=n+2952|0)>>2]=s[e+8>>2],s[u+4>>2]=r,r=s[e+4>>2],s[n+2944>>2]=s[e>>2],s[n+2948>>2]=r,s[50303]||Ft();A:if(e=s[n+2948>>2],c[0|e]&&e||((e=s[n+2944>>2])||(e=(e=s[n+2952>>2])||85055,s[n+2944>>2]=e),Ti(r=n+80|0,e,60),pn(r,0),!(o=Wt(201216,r))||(s[n+2948>>2]=s[o+4>>2]+1,c[n+2958|0]|c[n+2956|0]|c[n+2957|0]))){b=n+1536|0,z=_=z-336|0;e:if(!(!(e=s[(y=n+2944|0)+4>>2])|!c[0|e])){if((0|(x=U(e)))>=0){for(r=x>>>0>=79?79:x,p=1;e=gr(a[s[y+4>>2]+i|0]),a[(_+256|0)+i|0]=e,p=((255&e)==45)+p|0,e=(0|r)!=(0|i),i=i+1|0,e;);if((0|p)!=1)break e}p=1}if((0|(m=s[50303]))<=0)s[b>>2]=0,e=0;else{for(u=(0|p)>=0;;){f=s[201216+(w<<2)>>2];e:if(Hn(s[f+8>>2],88032,3)){if((e=s[y+4>>2])&&Hn(e,91687,3)){if(u){e=100;g:if(p){if(r=0,i=s[f+4>>2],!(S=c[0|i])){if(!Hn(_+256|0,90013,9))break g;break e}for(;;){for(T=1,d=i+1|0,C=1,E=0,i=0;(0|i)<(0|x)&&(0|(e=a[(_+256|0)+i|0]))!=45||(e=0),E=((h=(0|(g=c[i+d|0]))==45)&!!(0|(C=(h?0:g)<<24>>24==(0|e)?C:0)))+E|0,i=i+1|0,T=h+T|0,g;);if(i=i+d|0,(h=C+E|0)&&(r=(0|(e=v((d=(0|(e=p-h|0))<=0?5:5-e|0)-((0|(e=T-h|0))>0?e:0)|0,100)-(S<<24>>24<<1)|0))>(0|r)?e:r),!(S=c[0|i]))break}if(!(e=r))break e}(r=s[y>>2])&&(e=Or(r,s[f>>2])?Or(r,s[f+8>>2])?e:e+400|0:e+500|0),((i=c[y+12|0])-1&255)>>>0>1||((r=c[f+12|0])-1&255)>>>0>1||(e=(0|r)==(0|i)?e+50|0:e-50|0),i=c[y+13|0],e=c[f+12|0]!=2|i>>>0>12?e:c[f+13|0]>12?e+5|0:e,(r=c[f+13|0])&&((r=((i?v(i,100):3e3)>>>0)/(r>>>0)|0)>>>0<=99&&(r=1e4/(r>>>0)|0),e=(d=e)+((e=5-(((r-100&65535)>>>0)/10|0)|0)>>31&e)|0,e=i?e+10|0:e),e=(0|e)<=1?1:e}else{if(Hn(s[f+8>>2],_+256|0,x))break e;e=100}s[b+(l<<2)>>2]=f,s[f+16>>2]=e}else s[b+(l<<2)>>2]=f;l=l+1|0}if((0|m)==(0|(w=w+1|0)))break}s[b+(l<<2)>>2]=0,e=0,l&&(pt(b,l,8),e=l)}if(z=_+336|0,p=e,e||(s[t>>2]=0,e=Wt(201216,85055),s[n+1536>>2]=e,p=!!(0|e)),t=c[n+2957|0],u=2,(0|(e=c[n+2956|0]))!=2&&(u=2,(t-1&255)>>>0<12||(O=(0|e)!=1,u=(0|e)==1)),m=(l=s[132136+(u<<2)>>2])+(g=t>>>0<60)|0,e=0,(0|p)>0)for(r=0;;){o=s[(n+1536|0)+(D<<2)>>2];e:{g:{r:{if(O){if(g||(t=0,r))break g}else{if(t=c[o+12|0],r|g)break r;t=(0|t)!=(0|u)}if(i=0,t|c[o+13|0]<60)break e;break g}if((0|t)!=(0|u)){i=r;break e}}s[(n+80|0)+(r<<2)>>2]=o,i=r+1|0}e:if(c[o+15|0]){if(h=0,t=e,r=i,!((0|e)>11))for(;;){if((i=c[0|m])||(m=l,i=c[0|l]),e=s[o+12>>2],d=v(t,24)+202624|0,s[d+8>>2]=s[o+8>>2],s[d+12>>2]=e,e=s[o+4>>2],s[d>>2]=s[o>>2],s[d+4>>2]=e,e=s[o+20>>2],s[d+16>>2]=s[o+16>>2],s[d+20>>2]=e,a[d+14|0]=i,s[(n+80|0)+(r<<2)>>2]=d,m=m+1|0,r=r+1|0,e=t+1|0,(h=h+1|0)>>>0>=c[o+15|0])break e;if(i=(0|t)<11,t=e,!i)break}}else r=i;if((0|(D=D+1|0))==(0|p))break}else{if(!o)break A;r=0}e:if(!(!(i=c[0|m])|(0|e)>=12))for(;;){if(t=s[o+12>>2],l=v(e,24)+202624|0,s[l+8>>2]=s[o+8>>2],s[l+12>>2]=t,t=s[o+4>>2],s[l>>2]=s[o>>2],s[l+4>>2]=t,t=s[o+20>>2],s[l+16>>2]=s[o+16>>2],s[l+20>>2]=t,a[l+14|0]=i,s[(n+80|0)+(r<<2)>>2]=l,r=r+1|0,!(i=c[0|(m=m+1|0)]))break e;if(t=(0|e)<11,e=e+1|0,!t)break}r?(e=s[(n+80|0)+(c[n+2958|0]%(0|r)<<2)>>2],(t=c[e+14|0])?(a[202976]=0,s[n+48>>2]=47,H(n+2971|0,91351,n+48|0),a[n+2971|0]=0,t>>>0<=9?(s[n+20>>2]=t,s[n+16>>2]=n+2971,H(202976,91378,n+16|0)):(s[n+36>>2]=t-10,s[n+32>>2]=n+2971,H(202976,91503,n+32|0)),e=s[e+8>>2],s[n+4>>2]=202976,s[n>>2]=e,e=202912,H(202912,87760,n)):e=s[e+8>>2]):e=0}else{if(e=s[o+8>>2],!c[202976])break A;s[n+64>>2]=e,s[n+68>>2]=202976,e=202912,H(202912,87760,n- -64|0)}return z=n+2976|0,e}function Me(e,t,n,r,i){var o,l,u=0,d=0,f=0,p=0,m=0,h=0,g=0;z=o=z-464|0,a[o+432|0]=0,a[o+368|0]=0,a[o+304|0]=0,a[o+292|0]=0,m=(0|t)/10|0,u=s[33273];A:{if(!(l=2&r)|s[33272]!=2){g=32&r?113:111,p=1&r,h=t-v(m,10)|0;e:{g:{r:{C:{a:{I:{f:{i:if(c[0|u])u=0;else{b:{if(8&r){if(s[o+288>>2]=t,H(d=o+452|0,91198,o+288|0),u=zn(e,d,o+304|0)){d=0;break i}s[o+272>>2]=t,H(d=o+452|0,91314,o+272|0),u=zn(e,d,o+304|0),d=0}else{if(!p)break b;if(f=gn(o+432|0,133104),4&r){if(s[o+260>>2]=g,s[o+256>>2]=t,H(d=o+452|0,91324,o+256|0),u=zn(e,d,o+304|0),c[133116]&&u)break f;if(d=u,u)break i}s[o+244>>2]=g,s[o+240>>2]=t,H(d=o+452|0,91384,o+240|0),d=u=zn(e,d,o+304|0)}if(u)break i}b:{if(l){if(!(1&a[133096]))break b;s[o+208>>2]=t,H(u=o+452|0,91498,o+208|0),u=zn(e,u,o+304|0)}else f=s[e+108>>2],s[o+224>>2]=t,H(u=o+452|0,(0|n)>=2?91700:(262144&f)>>>18|0?91534:91700,o+224|0),u=zn(e,u,o+304|0);if(u)break i}!p|!(32&c[e+109|0])?(s[o+192>>2]=t,H(u=o+452|0,91766,o+192|0),u=zn(e,u,o+304|0)):u=0}if(!(16&r)|(0|t)>9)break a;u=d;break I}if(gn(f,133116),!(16&r)|(0|t)>9)break C}zn(e,88875,o+368|0);break g}if(!u)break r;u=d}a[o+368|0]=0;break g}r:if(p&&(s[o+180>>2]=g,s[o+176>>2]=m,H(u=o+452|0,91846,o+176|0),zn(e,u,o+368|0))){if(d=1,!h|!(16&c[e+109|0]))break r;Li(o+368|0,133104)}else d||=(s[o+160>>2]=m,H(d=o+452|0,512&r?91936:92016,o+160|0),zn(e,d,o+368|0),0);if(u=h,c[o+368|0]||(u=h,16&c[e+106|0]&&(s[o+144>>2]=254&m,H(u=o+452|0,92016,o+144|0),zn(e,u,o+368|0),u=(0|t)%20|0)),a[o+304|0]=0,m=u,(0|u)<=0)u=d;else{if(l&&(u=s[33273],c[0|u])){gn(o+304|0,u),a[o+432|0]=0,f=p;break e}if(f=0,8&r&&(s[o+128>>2]=m,H(r=o+452|0,91314,o+128|0),f=zn(e,r,o+304|0)),!p|16&c[e+104|0]||(s[o+116>>2]=g,s[o+112>>2]=m,H(r=o+452|0,91384,o+112|0),d=(f=zn(e,r,o+304|0))?1:d),u=d,!f){r:{if(!l|!(1&s[33274])){if(!(16&c[e+104|0])&&l)break r;d=s[e+108>>2],s[o+96>>2]=m,H(r=o+452|0,(0|n)>=2?91700:(262144&d)>>>18|0?91534:91700,o+96|0),n=zn(e,r,o+304|0)}else s[o+80>>2]=m,H(n=o+452|0,91498,o+80|0),n=zn(e,n,o+304|0);if(n)break g}s[o+64>>2]=m,H(n=o+452|0,91766,o- -64|0),zn(e,n,o+304|0)}}}f=p,c[o+432|0]|u|!p||((0|t)<20|(16&c[e+104|0]?0:h)||(zn(e,92162,o+432|0),f=1,!c[o+432|0]))&&(zn(e,92205,o+432|0),f=1)}if(!(!(n=a[o+304|0])|!(48&(t=s[e+104>>2]))|!c[o+368|0])){if(zn(e,90824,o+292|0),!f|!(8&c[e+109|0])||(a[o+292|0]=0),16&c[e+104|0]){s[o+28>>2]=o+432,s[o+24>>2]=o+368,s[o+20>>2]=o+292,s[o+16>>2]=o+304,H(i,91059,o+16|0),r=1;break A}s[o+12>>2]=o+432,s[o+8>>2]=o+304,s[o+4>>2]=o+292,s[o>>2]=o+368,H(i,91059,o),r=1;break A}512&t&&(!n|(0|(t=U(o+368|0)-1|0))<0||(u=c[s[144464+(a[0|(t=t+(o+368|0)|0)]<<2)>>2]+11|0]!=2,(0|(r=c[s[144464+(n<<2)>>2]+11|0]))==1&&(r=c[s[144464+(a[o+305|0]<<2)>>2]+11|0]),u|(255&r)!=2||(a[0|t]=0))),!(8&c[e+110|0])|!c[o+432|0]?(s[o+56>>2]=o+432,s[o+52>>2]=o+304,s[o+48>>2]=o+368,H(i,92282,o+48|0)):(s[o+36>>2]=o+304,s[o+32>>2]=o+368,(0|(t=H(i,90368,o+32|0)))>0&&(t=c[s[144464+(c[(n=t-1|0)+i|0]<<2)>>2]+11|0]==2?n:t),gn(t+i|0,o+432|0))}else gn(i,u);r=0}A:if(268435456&(e=s[e+104>>2])){if((0|U(i))<=0)break A;for(t=0,e=0;c[0|(n=e+i|0)]==6&&(t&&(a[0|n]=5),t=1),e=e+1|0,(0|U(i))>(0|e););}else if(256&e&&(t=0,!((0|(e=(p=U(i))-1|0))<0))){if(e)for(h=-2&p,u=0;c[0|(d=e+i|0)]==6?(n=1,t&&(a[0|d]=5)):n=t,c[0|(d=d-1|0)]==6?(t=1,n&&(a[0|d]=5)):t=n,e=e-2|0,(0|h)!=(0|(u=u+2|0)););1&p&&(!t|c[0|(e=e+i|0)]!=6||(a[0|e]=5))}return z=o+464|0,r}function Ne(e,t,n,r){var i,l,u=0,d=0,f=0,p=0,m=0,h=0,g=0;if(z=i=z-352|0,a[i+304|0]=0,a[i+224|0]=0,a[i+64|0]=0,f=s[s[47192]+292>>2],g=nn(i+348|0,t),(1048320&(u=s[i+348>>2]))==57344&&(u&=255,s[i+348>>2]=u),2&r&&Cr(u)&&zn(e,85437,i+304|0),u=si(s[i+348>>2],e),s[i+348>>2]=u,h=1&r,Nt(e,u,a[0|(l=t+g|0)],i+224|0,h),!(t=c[i+224|0])){A:if((t=mr(s[i+348>>2]))&&(s[i+348>>2]=16383&t,4&r)){e:switch(1073741823&(t>>=14)){case 0:case 3:break A;default:break e}zn(e,t=s[131232+(t<<2)>>2],i+304|0),c[i+304|0]||(a[i+306|0]=Ei(84744),m=t,t=i+304|3,zn(s[47194],m,t),c[i+307|0]&&(o[i+304>>1]=5385,t=U(t)+(i+304|0)|0,a[t+5|0]=0,a[t+4|0]=f,a[t+3|0]=21))}Nt(e,s[i+348>>2],a[0|l],i+224|0,h),t=c[i+224|0]}A:{e:{if(t&=255){if((0|t)!=21)break e;gn(n,i+224|0),g=0;break A}if(t=1632,!((0|(u=s[i+348>>2]))<1632)){for(p=103360;;){if((0|u)>=(t+10|0)){if(!(t=s[(p=p+4|0)>>2]))break e;if((0|t)<=(0|u))continue;break e}break}(0|(t=48+(u-t|0)|0))<=0||Nt(e,t,0,i+224|0,h)}}e:{g:{r:{C:{if(t=_t(s[i+348>>2])){if(u=s[t+4>>2],!t|1&(p=s[t+16>>2])||(d=s[47192],s[d+600>>2]==(0|u)|s[d+188>>2]==(0|u)|s[d+184>>2]==(0|u)||(a[i+144|0]=0,zn(d,s[t>>2],i- -64|0)?(0|(d=s[47192]))!=(0|e)&&(f=s[e+292>>2],gn(i+144|0,i- -64|0),a[i+66|0]=s[d+292>>2]):(a[i+66|0]=Ei(84744),zn(s[47194],s[t>>2],i+144|0)),c[i+144|0]&&(o[i+64>>1]=5385,gn(3|(d=i- -64|0),m=i+144|0),d=U(m)+d|0,a[d+5|0]=0,a[d+4|0]=f,a[d+3|0]=21))),c[i+224|0])break e;if(!u||(f=s[47192],s[f+188>>2]!=(0|u)))break C;t=s[f+192>>2];break g}if(c[i+224|0])break e;p=0,u=0;break r}if((t=s[t+12>>2])&&!(2&p))break g}t=25966}if((s[e+212>>2]==(0|t)&(0|t)!=27503||(a[i+226|0]=Ei(Pr(i+47|0,t)),(t=s[47194])&&((0|(f=s[i+348>>2]))>55215||(0|(d=f-44032|0))<0?Nt(t,f,a[0|l],i+224|3,h):(a[i+52|0]=32,t=m=i+53|0,f-50500>>>0>=588&&(t=qn(4352+((d>>>0)/588|0)|0,m)+m|0),qn(4449+(((f=(d>>>0)/28|0)>>>0)%21|0)|0,t),qn(4519+(d-v(f,28)|0)|0,t+3|0),a[t+6|0]=32,a[t+7|0]=0,a[i+227|0]=0,t=i+224|3,Ae(s[47194],m,t,77,0,0,0),ye(s[47194],t,0,-1,0)),t=i+224|3,c[i+227|0]==21&&(a[i+226|0]=Ei(i+224|4),Nt(s[47194],s[i+348>>2],a[0|l],t,h)),ci(s[s[32972]+60>>2]),c[i+227|0]&&(o[i+224>>1]=5385,t=U(t)+(i+224|0)|0,a[t+3|0]=21,h=s[e+292>>2],a[t+5|0]=0,a[t+4|0]=h)),!c[i+224|0]))&&(16&p||(Rr(s[i+348>>2])&&zn(s[47192],85683,i+224|0),c[i+224|0]||(fr(s[i+348>>2])||zn(s[47192],85778,i+224|0),c[i+224|0]||it(85992,i+224|0,0))),!(8&p)||4&r)){if(t=s[i+348>>2],(0|u)==10240?(u=i+52|0,1&t&&(a[i+52|0]=49,u=i+53|0),2&t&&(a[0|u]=50,u=u+1|0),4&t&&(a[0|u]=51,u=u+1|0,t=s[i+348>>2]),8&t&&(a[0|u]=52,u=u+1|0,t=s[i+348>>2]),16&t&&(a[0|u]=53,u=u+1|0,t=s[i+348>>2]),32&t&&(a[0|u]=54,u=u+1|0,t=s[i+348>>2]),64&t&&(a[0|u]=55,u=u+1|0,t=s[i+348>>2]),128&t&&(a[0|u]=56,u=u+1|0),a[0|u]=0):(s[i+32>>2]=t,H(i+52|0,86013,i+32|0)),t=i+224|0,p=c[i+52|0])for(u=i+52|0;t=U(t)+t|0,a[0|t]=23,t=t+1|0,Nt(s[47192],p<<24>>24,0,t,1),(r=c[0|t])&&(0|r)!=21||(0|(r=a[0|u]))<97||it(s[130860+((255&r)<<2)>>2],t,0),p=c[0|(u=u+1|0)];);t=U(t)+t|0,a[0|t]=9,a[t+1|0]=0}}t=U(n),2&c[e+144|0]?(s[i+16>>2]=255,s[i+28>>2]=i+304,s[i+24>>2]=i+224,s[i+20>>2]=i- -64,H(i+144|0,86210,i+16|0)):(s[i>>2]=255,s[i+12>>2]=i+224,s[i+8>>2]=i+304,s[i+4>>2]=i- -64,H(i+144|0,86210,i)),U(i+144|0)+t>>>0>199||gn(t+n|0,i+144|0)}return z=i+352|0,g}function Pe(e,t,n,r,i,l,u){var d,f=0,m=0,h=0,_=0,y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,j=0,M=0,N=0,P=0,F=0,I=0,L=0;z=d=z-528|0,w=u?s[u>>2]:0,j=s[i+4>>2];A:{e:{if(s[e+220>>2]>0){Ti(m=d+352|0,t,160),z=b=z-176|0,S=1-(x=s[e+220>>2])|0,C=s[e+224>>2],T=s[e+216>>2],_=m;g:{r:{for(;;){if(E=nn(b+172|0,_),f=s[b+172>>2]){if((0|f)<(0|x)|(0|f)>(0|T))break r;if(C){if((0|(f=a[C+(f-x|0)|0]))<=0)break r}else f=f+S|0;if(_=_+E|0,a[y+b|0]=f,f=160,(0|(y=y+1|0))!=160)continue}else f=y;break}if(C=0,a[f+b|0]=0,S=a[0|b],s[b+172>>2]=S,S){for(M=2+(T-x|0)|0,x=f=b;;){T=f+1|0;C:{if((E=s[e+8180>>2])&&(y=0,!((0|(_=o[E>>1]))>(0|(O=(a[0|T]<<8)+S|0)))))for(;;){if((0|_)==(0|O)){S=y+M|0,s[b+172>>2]=S,f=f+2|0;break C}if(!((0|O)>=(0|(_=o[E+((y=y+1|0)<<1)>>1]))))break}f=T}if(D=63&S|D<<6,(0|(y=C+6|0))<8?C=y:(C=C-2|0,a[0|x]=D>>C,x=x+1|0),S=a[0|f],s[b+172>>2]=S,!S)break}(0|C)<=0||(a[0|x]=D<<8-C,x=x+1|0)}else x=b;a[0|x]=0,ut(m,b,f=x-b|0),x=64|f;break g}x=U(m)}z=b+176|0,b=m}else x=U(t),b=t;if(m=c[0|b]){for(f=0,y=b;h=1023&(h=(h<<3)+m|0)^h>>>8,f=f+1|0,m=c[0|(y=y+1|0)];);f=f+h&1023}else f=0;if(h=s[692+((f<<2)+e|0)>>2]){if(f=c[0|h])break e;f=0;break A}if(f=0,!i)break A;s[i>>2]=0;break A}for(E=1073741824&j,O=2048&l,j=512&w,M=65536&w,N=1&w,P=2&w,w=8&l,F=1024&l,T=4&l,I=63&x,L=e+8233|0;;){l=(255&f)+h|0;e:{g:if((127&(f=c[h+1|0]))==(0|x)&&!Hn(b,h+2|0,I)){h=2+((63&f)+h|0)|0;r:{if(f<<24>>24<0)C=0,a[0|r]=0;else{if((0|(C=U(h)))>=160)break r;gn(r,h),h=1+(h+C|0)|0}if(m=0,l>>>0<=h>>>0)f=n,_=0;else{y=0,_=0;C:{for(;;){h=(f=h)+1|0;a:if((f=c[0|f])>>>0>=100){if(S=s[e+320>>2],f>>>0>=132){y|=S>>>f-132&1;break a}y|=!(S>>>f-100&1)}else{if(f>>>0>=81){S=f-80|0,D=l-h|0;I:if(u)for(f=0;;){if(k=v(f,12)+u|0,!c[k+10|0])break I;if(y=!!(12&c[k+1|0])|y,k=(0|f)!=(0|S),f=f+1|0,!k)break}if(cr(n,h,D)|1&y)break g;s[33264]=S,f=n+D|0,_|=128,h=l;break C}f>>>0>=65?(_=15&f|-16&_,_=12&~f?_:512|_):f>>>0>=32?m|=1<>>0>h>>>0))break}if(f=n,1&y)break e}if(65536&m&&!T||F&&49152&m)break e}if(T&&(16384&m||!w&&32768&m)||(P?0:512&m)|(N?0:1024&m)|(M?0:33554432&_)||!(!(131072&m)|g[s[47192]+8204>>2]<=f>>>0|E)|(j?0:262144&m)|(8&c[s[47192]+8242|0]?0:8192&m)||16&m&&(!s[e+8184>>2]&(!w|!s[e+8192>>2])||!(!w|s[e+212>>2]!=25966)&&2097152&s[e+8232>>2])||(s[e+8188>>2]?0:64&m)|(!s[e+8196>>2]|O?32&m:0)||!(!(65536&_)|s[e+212>>2]!=26741|128&c[0|L])|(s[47192]==(0|e)?0:524288&m))break e;C:{a:{I:{if(!i){if(!C)break I;break C}if(s[i+4>>2]=m,s[i>>2]=1073741824|_,C)break a}if(f=0,!(8&c[188788]))break A;Cn(i,e=d+272|0),s[d>>2]=t,s[d+4>>2]=e,fi(s[47195],89330,d);break A}s[i>>2]=-1073741824|_}if(8&c[188788]&&(Ut(r,d- -64|0),c[s[47192]+172|0]==(_>>>29&1)&&(!u|!(128&_)?(s[d+48>>2]=t,fi(s[47195],89426,d+48|0)):(ut(e=d+352|0,r=n,n=f-n|0),a[351+(n+d|0)|0]=0,s[d+32>>2]=t,s[d+36>>2]=e,fi(s[47195],89397,d+32|0)),Cn(i,e=d+272|0),t=s[47195],s[d+16>>2]=d- -64,s[d+20>>2]=e,fi(t,89534,d+16|0))),c[nn(d- -64|0,b)+b|0]|!i||En(s[d+64>>2]))break A;s[i>>2]=134217728|s[i>>2];break A}A(89236,86634,2467,94846),p()}h=l}if(!(f=c[0|h]))break}f=0}return z=d+528|0,f}function Fe(e,t,n,r,i){var o,l=0,u=0;z=o=z-304|0,a[o+278|0]=0;A:{if((0|t)>0&&(1&r&&(2&r&&(s[o+164>>2]=n,s[o+160>>2]=t,H(l=o+290|0,89701,o+160|0),l=zn(e,l,o+224|0))||1&a[133096]&&(s[o+148>>2]=n,s[o+144>>2]=t,H(l=o+290|0,89757,o+144|0),l=zn(e,l,o+224|0))||(s[o+132>>2]=n,s[o+128>>2]=t,H(l=o+290|0,89894,o+128|0),l=zn(e,l,o+224|0)))||(s[o+116>>2]=n,s[o+112>>2]=t,H(l=o+290|0,89974,o+112|0),l=zn(e,l,o+224|0))))break A;if((0|(u=(0|t)%100|0))>=20&&zn(e,90022,o+278|0),1&r){if(2&r){l=u-11|0;e:{g:{r:switch((448&s[s[47192]+108>>2])-64>>>6|0){case 0:if(l>>>0<9)break g;if(r=90418,(0|(l=(0|t)%10|0))==1)break e;if(l-2>>>0>=3)break g;r=90453;break e;case 1:if(t-2>>>0>=3)break g;r=90453;break e;case 2:if(l>>>0<9|((0|t)%10|0)-2>>>0>=3)break g;r=90453;break e;case 3:if(r=90508,l>>>0<9)break e;r=(r=(0|t)%10|0)?(0|r)==1?90453:90586:90508;break e;case 4:break r;default:break g}if(!(l>>>0<9)){if(r=90537,(0|(l=(0|t)%10|0))==1)break e;if(!(l-2>>>0>=3)){r=90453;break e}}}r=90586}if(s[o+100>>2]=n,s[o+96>>2]=r,H(r=o+290|0,90058,o+96|0),l=0,zn(e,r,o+224|0))break A}if(r=u-11|0,1&a[133096]){e:{g:{r:switch((448&s[s[47192]+108>>2])-64>>>6|0){case 0:if(r>>>0<9)break g;if(l=90418,(0|(u=(0|t)%10|0))==1)break e;if(u-2>>>0>=3)break g;l=90453;break e;case 1:if(t-2>>>0>=3)break g;l=90453;break e;case 2:if(r>>>0<9|((0|t)%10|0)-2>>>0>=3)break g;l=90453;break e;case 3:if(l=90508,r>>>0<9)break e;l=(l=(0|t)%10|0)?(0|l)==1?90453:90586:90508;break e;case 4:break r;default:break g}if(!(r>>>0<9)){if(l=90537,(0|(u=(0|t)%10|0))==1)break e;if(!(u-2>>>0>=3)){l=90453;break e}}}l=90586}if(s[o+84>>2]=n,s[o+80>>2]=l,H(u=o+290|0,90110,o+80|0),l=0,zn(e,u,o+224|0))break A}e:{g:{r:switch((448&s[s[47192]+108>>2])-64>>>6|0){case 0:if(r>>>0<9)break g;if(l=90418,(0|(u=(0|t)%10|0))==1)break e;if(u-2>>>0>=3)break g;l=90453;break e;case 1:if(t-2>>>0>=3)break g;l=90453;break e;case 2:if(r>>>0<9|((0|t)%10|0)-2>>>0>=3)break g;l=90453;break e;case 3:if(l=90508,r>>>0<9)break e;l=(l=(0|t)%10|0)?(0|l)==1?90453:90586:90508;break e;case 4:break r;default:break g}if(!(r>>>0<9)){if(l=90537,(0|(u=(0|t)%10|0))==1)break e;if(!(u-2>>>0>=3)){l=90453;break e}}}l=90586}if(s[o+68>>2]=n,s[o+64>>2]=l,H(u=o+290|0,90139,o- -64|0),l=0,zn(e,u,o+224|0))break A}else r=u-11|0;e:{g:{r:switch((448&s[s[47192]+108>>2])-64>>>6|0){case 0:if(r>>>0<9)break g;if(l=90418,(0|(r=(0|t)%10|0))==1)break e;if(r-2>>>0>=3)break g;l=90453;break e;case 1:if(t-2>>>0>=3)break g;l=90453;break e;case 2:if(r>>>0<9|((0|t)%10|0)-2>>>0>=3)break g;l=90453;break e;case 3:if(l=90508,r>>>0<9)break e;l=(r=(0|t)%10|0)?(0|r)==1?90453:90586:90508;break e;case 4:break r;default:break g}if(!(r>>>0<9)){if(l=90537,(0|(r=(0|t)%10|0))==1)break e;if(!(r-2>>>0>=3)){l=90453;break e}}}l=90586}s[o+52>>2]=n,s[o+48>>2]=l,H(r=o+290|0,90218,o+48|0),l=0,zn(e,r,o+224|0)||((0|n)<4||(s[o+32>>2]=n-1,H(r=o+290|0,89026,o+32|0),zn(e,r,o+176|0)||(zn(e,90273,o+224|0),s[33275]=3)),c[o+224|0]||(s[o+16>>2]=t,H(r=o+290|0,90303,o+16|0),(l=zn(e,r,o+224|0))||zn(e,90347,o+224|0),s[33275]=2))}return s[o+4>>2]=o+224,s[o>>2]=o+278,H(i,90368,o),z=o+304|0,!((0|t)!=1|(0|n)!=1)&&(t=1,32&c[e+106|0])||(t=l),t}function Ie(e,t,n,r){var i,l=0,u=0,d=0,f=0,p=0,m=0,g=0;z=i=z+-64|0,o[i+48>>1]=0,s[i+40>>2]=0,s[i+44>>2]=0,s[i+32>>2]=0,s[i+36>>2]=0,s[i+24>>2]=0,s[i+28>>2]=0,s[i+16>>2]=0,s[i+20>>2]=0,s[i+8>>2]=0,s[i+12>>2]=0,s[i>>2]=0,s[i+4>>2]=0,l=t;A:{for(;;){e:{g:{if((0|(u=c[0|l]))!=69){if((0|u)!=32)break g;if(r&&(a[ut(u=r,t,r=(0|(r=l-t|0))>=159?159:r)+r|0]=0),r=63&n)break e;break A}a[0|l]=101}l=l+1|0;continue}break}if(1&n){e:if((l=l-1|0)>>>0>>0)u=r;else for(u=r;;){if((192&c[0|l])!=128)break e;if(u=u+1|0,!((l=l-1|0)>>>0>=t>>>0))break}d=r-1|0}else d=r,u=r;if((0|r)!=1)for(;;){r=d;e:if(!((l=l-1|0)>>>0>>0))for(;;){if((192&c[0|l])!=128)break e;if(u=u+1|0,!((l=l-1|0)>>>0>=t>>>0))break}e:if(!((l=l-1|0)>>>0>>0))for(;;){if((192&c[0|l])!=128)break e;if(u=u+1|0,!((l=l-1|0)>>>0>=t>>>0))break}if(d=r-2|0,!((0|r)>2))break}if((0|u)<=0)d=0;else{if(f=3&(d=(r=(t=u-1|0)>>>0>=48?48:t)+1|0),t=0,u=0,r>>>0>=3)for(g=-4&d,r=0;p=l+u|0,a[u+i|0]=c[0|p],a[0|p]=32,p=(m=1|u)+l|0,a[i+m|0]=c[0|p],a[0|p]=32,p=(m=2|u)+l|0,a[i+m|0]=c[0|p],a[0|p]=32,p=(m=3|u)+l|0,a[i+m|0]=c[0|p],a[0|p]=32,u=u+4|0,(0|g)!=(0|(r=r+4|0)););if(f)for(;r=l+u|0,a[u+i|0]=c[0|r],a[0|r]=32,u=u+1|0,(0|f)!=(0|(t=t+1|0)););}}if(a[i+d|0]=0,f=65520&n,!(512&n)|c[0|(r=l-1|0)]!=105||(a[0|r]=121),u=4|f,256&n){A:{e:{g:{if((0|(t=s[e+212>>2]))!=25966){if((0|t)!=28268)break g;if(a[0|r]<0||128&(t=a[0|(d=l-2|0)]))break A;if(f=s[e+632>>2])t=!!(0|Gr(f,t));else{if((0|(f=s[e+600>>2]))>0&&(t=t-f|0)-1>>>0>254)break A;t=128&c[344+(e+t|0)|0]}if(!t)break A;if(t=a[0|r],f=s[e+612>>2])t=!!(0|Gr(f,t));else{r:{if((0|(f=s[e+600>>2]))>0){if((t=t-f|0)-1>>>0<255)break r;break A}if((0|t)<0)break A}t=4&c[344+(e+t|0)|0]}if(!t)break A;t=a[l-3|0];r:{if(f=s[e+632>>2])t=!!(0|Gr(f,t));else{C:{if((0|(f=s[e+600>>2]))>0){if((t=t-f|0)-1>>>0<255)break C;break r}if((0|t)<0)break r}t=128&c[344+(e+t|0)|0]}if(t)break A}a[0|l]=c[0|r],a[0|r]=c[0|d],a[l+1|0]=32;break A}if(d=a[l-2|0],t=s[e+632>>2])t=!!(0|Gr(t,d));else{r:{if((0|(t=s[e+600>>2]))>0){if((d=d-t|0)-1>>>0<255)break r;break e}if((0|d)<0)break e}t=128&c[344+(e+d|0)|0]}if(!t)break e;if(d=a[0|r],t=s[e+608>>2])t=!!(0|Gr(t,d));else{if((0|(t=s[e+600>>2]))>0){if((d=d-t|0)-1>>>0>=255)break e}else if((0|d)<0)break e;t=2&c[344+(e+d|0)|0]}if(!t)break e;u=Hn(87771,l-3|0,3)?20|f:u;break A}u=s[e+204>>2]?20|f:u;break A}(c[0|r]==99||(d=c[(t=l-2|0)+1|0]<<8,(c[0|t]|d)==29554|(d|c[0|t])==29289||(c[0|(t=l-2|0)]|c[t+1|0]<<8)==29301||!Hn(88115,l-3|0,3)||(c[0|(t=l-2|0)]|c[t+1|0]<<8)==29550|c[0|r]==117||!Hn(88384,l-5|0,5)||(c[0|(t=l-4|0)]|c[t+1|0]<<8|c[t+2|0]<<16|c[t+3|0]<<24)==1735287154||(c[0|t]|c[t+1|0]<<8|c[t+2|0]<<16|c[t+3|0]<<24)==1735549292))&&(u=20|f)}16&u&&(qn(s[e+204>>2],l),8&c[188788]&&pi(88683,6,s[47195]))}return s[e+8184>>2]|!(2048&n)||(s[e+8184>>2]=1),h[i>>1]!=115&&Hn(i,88850,3)||(u|=8),z=i- -64|0,c[0|i]==39?65531&u:u}function Le(e,t,n,r,i,a,o,c,l){var u,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0;z=u=z-112|0,d=2147483647&l;A:{if(p=!(t|n),(r|(f=2147483647&i)?f-2147418112>>>0<2147549184:p)||!(!c&(0|(h=d-2147418112|0))==-2147418112?a|o:(0|h)==-2147418112&!!(0|c)|h>>>0>2147549184)){if(!(!r&(0|f)==2147418112?p:f>>>0<2147418112)){c=r,l=32768|i,a=t,o=n;break A}if(!(!c&(0|d)==2147418112?!(a|o):d>>>0<2147418112)){l|=32768;break A}if(!(t|r|2147418112^f|n)){m=r,c=(r=!(t^a|r^c|n^o|i^l^-2147483648))?0:m,l=r?2147450880:i,a=r?0:t,o=r?0:n;break A}if(!(a|c|2147418112^d|o))break A;if(!(t|r|n|f)){if(a|c|o|d)break A;a&=t,o&=n,c&=r,l&=i;break A}if(!(a|c|o|d)){a=t,o=n,c=r,l=i;break A}}f=(p=v=(m=(0|d)==(0|f))&(0|r)==(0|c)?(0|n)==(0|o)&t>>>0>>0|n>>>0>>0:m&r>>>0>>0|d>>>0>f>>>0)?a:t,h=p?o:n,y=m=p?l:i,p=p?c:r,_=65535&m,r=v?r:c,b=i=v?i:l,m=i>>>16&32767,(g=y>>>16&32767)||(l=i=!(p|_),d=i?f:p,c=i<<=6,rn(u+96|0,f,h,p,_,(i=i+((0|(l=x(l?h:_)))==32?x(d)+32|0:l)|0)-15|0),p=s[u+104>>2],_=s[u+108>>2],h=s[u+100>>2],g=16-i|0,f=s[u+96>>2]),a=v?t:a,o=v?n:o,c=r,l=65535&b,m||(i=t=!(c|l),d=t?a:c,n=t<<=6,rn(u+80|0,a,o,c,l,(t=t+((0|(i=x(i?o:l)))==32?x(d)+32|0:i)|0)-15|0),m=16-t|0,c=s[u+88>>2],l=s[u+92>>2],o=s[u+84>>2],a=s[u+80>>2]),n=l<<3|c>>>29,t=c<<3|o>>>29,n|=524288,c=p<<3|h>>>29,l=_<<3|p>>>29,v=y^b,i=o<<3|a>>>29,r=a<<3,(0|m)!=(0|g)&&((a=g-m|0)>>>0>127?(t=0,n=0,i=0,r=1):(rn(u- -64|0,r,i,t,n,128-a|0),Qt(u+48|0,r,i,t,n,a),t=s[u+56>>2],n=s[u+60>>2],i=s[u+52>>2],r=s[u+48>>2]|!!(s[u+64>>2]|s[u+72>>2]|s[u+68>>2]|s[u+76>>2]))),p=r,d=i,m=c,_=524288|l,i=h<<3|f>>>29,h=f<<3,f=i;e:if((0|v)<0){if(a=0,o=0,c=0,l=0,!(p^h|t^m|d^f|n^_))break A;if(r=h-p|0,i=f-((p>>>0>h>>>0)+d|0)|0,c=(a=m-t|0)-(o=(0|d)==(0|f)&p>>>0>h>>>0|d>>>0>f>>>0)|0,l=t=(_-((t>>>0>m>>>0)+n|0)|0)-(a>>>0>>0)|0,t>>>0>524287)break e;a=t=!(c|l),o=t?r:c,n=t<<=6,rn(u+32|0,r,i,c,l,t=(t=t+((0|(a=x(a?i:l)))==32?x(o)+32|0:a)|0)-12|0),g=g-t|0,c=s[u+40>>2],l=s[u+44>>2],r=s[u+32>>2],i=s[u+36>>2]}else i=d+f|0,a=(0|d)==(0|(i=(r=p+h|0)>>>0>>0?i+1|0:i))&r>>>0

>>0|i>>>0>>0,d=n+_|0,d=(t=t+m|0)>>>0>>0?d+1|0:d,1048576&(l=(c=t+a|0)>>>0>>0?d+1|0:d)&&(r=1&p|(1&i)<<31|r>>>1,i=c<<31|i>>>1,g=g+1|0,c=(1&l)<<31|c>>>1,l=l>>>1|0);if(n=0,f=-2147483648&y,(0|g)>=32767)c=n,l=2147418112|f,a=0,o=0;else if(m=0,(0|g)>0?m=g:(rn(u+16|0,r,i,c,l,g+127|0),Qt(u,r,i,c,l,1-g|0),r=s[u>>2]|!!(s[u+16>>2]|s[u+24>>2]|s[u+20>>2]|s[u+28>>2]),i=s[u+4>>2],c=s[u+8>>2],l=s[u+12>>2]),h=7&r,r=(0|(t=c<<29|i>>>3))==(0|(o=(r=(7&i)<<29|r>>>3)>>>0>(a=(h>>>0>4)+r|0)>>>0?t+1|0:t))&r>>>0>a>>>0|t>>>0>o>>>0,t=n|(7&l)<<29|c>>>3,l=f|l>>>3&65535|m<<16,l=t>>>0>(c=r+t|0)>>>0?l+1|0:l,(0|h)!=4){if(!h)break A}else d=o+(t=0)|0,l=(t=(0|t)==(0|(o=(r=a)>>>0>(a=a+(n=1&a)|0)>>>0?d+1|0:d))&n>>>0>a>>>0|t>>>0>o>>>0)>>>0>(c=t+c|0)>>>0?l+1|0:l}s[e>>2]=a,s[e+4>>2]=o,s[e+8>>2]=c,s[e+12>>2]=l,z=u+112|0}function Re(e){var t=0,n=0,r=0,i=0,a=0,o=0,c=0;A:if(e|=0){a=(r=e-8|0)+(e=-8&(t=s[e-4>>2]))|0;e:if(!(1&t)){if(!(3&t)||(r=r-(t=s[r>>2])|0)>>>0>2])))return s[57154]=e,s[a+4>>2]=-2&t,s[r+4>>2]=1|e,void(s[e+r>>2]=e)}else{if(t>>>0<=255){if(i=s[r+8>>2],t=t>>>3|0,(0|(n=s[r+12>>2]))==(0|i)){s[57152]&=oi(-2,t);break e}s[i+12>>2]=n,s[n+8>>2]=i;break e}if(c=s[r+24>>2],(0|r)==(0|(t=s[r+12>>2])))if((n=s[(i=r+20|0)>>2])||(n=s[(i=r+16|0)>>2])){for(;o=i,(n=s[(i=(t=n)+20|0)>>2])||(i=t+16|0,n=s[t+16>>2]););s[o>>2]=0}else t=0;else n=s[r+8>>2],s[n+12>>2]=t,s[t+8>>2]=n;if(!c)break e;i=s[r+28>>2];g:{if(s[(n=228912+(i<<2)|0)>>2]==(0|r)){if(s[n>>2]=t,t)break g;s[57153]&=oi(-2,i);break e}if(s[c+(s[c+16>>2]==(0|r)?16:20)>>2]=t,!t)break e}if(s[t+24>>2]=c,(n=s[r+16>>2])&&(s[t+16>>2]=n,s[n+24>>2]=t),!(n=s[r+20>>2]))break e;s[t+20>>2]=n,s[n+24>>2]=t}}if(!(r>>>0>=a>>>0)&&1&(t=s[a+4>>2])){e:{if(!(2&t)){if(s[57158]==(0|a)){if(s[57158]=r,e=s[57155]+e|0,s[57155]=e,s[r+4>>2]=1|e,s[57157]!=(0|r))break A;s[57154]=0,s[57157]=0;return}if(s[57157]==(0|a))return s[57157]=r,e=s[57154]+e|0,s[57154]=e,s[r+4>>2]=1|e,void(s[e+r>>2]=e);e=(-8&t)+e|0;g:if(t>>>0<=255){if(i=s[a+8>>2],t=t>>>3|0,(0|(n=s[a+12>>2]))==(0|i)){s[57152]&=oi(-2,t);break g}s[i+12>>2]=n,s[n+8>>2]=i}else{if(c=s[a+24>>2],(0|a)==(0|(t=s[a+12>>2])))if((n=s[(i=a+20|0)>>2])||(n=s[(i=a+16|0)>>2])){for(;o=i,(n=s[(i=(t=n)+20|0)>>2])||(i=t+16|0,n=s[t+16>>2]););s[o>>2]=0}else t=0;else n=s[a+8>>2],s[n+12>>2]=t,s[t+8>>2]=n;if(c){i=s[a+28>>2];r:{if(s[(n=228912+(i<<2)|0)>>2]==(0|a)){if(s[n>>2]=t,t)break r;s[57153]&=oi(-2,i);break g}if(s[c+(s[c+16>>2]==(0|a)?16:20)>>2]=t,!t)break g}s[t+24>>2]=c,(n=s[a+16>>2])&&(s[t+16>>2]=n,s[n+24>>2]=t),(n=s[a+20>>2])&&(s[t+20>>2]=n,s[n+24>>2]=t)}}if(s[r+4>>2]=1|e,s[e+r>>2]=e,s[57157]!=(0|r))break e;s[57154]=e;return}s[a+4>>2]=-2&t,s[r+4>>2]=1|e,s[e+r>>2]=e}if(e>>>0<=255)return t=228648+(-8&e)|0,(n=s[57152])&(e=1<<(e>>>3))?e=s[t+8>>2]:(s[57152]=e|n,e=t),s[t+8>>2]=r,s[e+12>>2]=r,s[r+12>>2]=t,void(s[r+8>>2]=e);i=31,e>>>0<=16777215&&(i=62+((e>>>38-(t=x(e>>>8|0))&1)-(t<<1)|0)|0),s[r+28>>2]=i,s[r+16>>2]=0,s[r+20>>2]=0,o=228912+(i<<2)|0;e:{g:{if((n=s[57153])&(t=1<>>1|0)),t=s[o>>2];;){if(n=t,(-8&s[t+4>>2])==(0|e))break g;if(t=i>>>29|0,i<<=1,!(t=s[(o=n+(4&t)|0)+16>>2]))break}s[o+16>>2]=r,s[r+24>>2]=n}else s[57153]=t|n,s[o>>2]=r,s[r+24>>2]=o;s[r+12>>2]=r,s[r+8>>2]=r;break e}e=s[n+8>>2],s[e+12>>2]=r,s[n+8>>2]=r,s[r+24>>2]=0,s[r+12>>2]=n,s[r+8>>2]=e}e=s[57160]-1|0,s[57160]=e||-1}}}function ze(e,t,n){var r,i=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,y=0,b=0;z=r=z-176|0;A:{if(32&t)_=n-((0|n)>1)|0;else{l=Yt(e,93302);e:{g:{r:{if((0|t)!=2){if(l)break r;t=0;break A}if(_=n+1|0,h=(y=v(n,76)+133152|0)+56|0,g=Yt(e,89360),u=Yt(e,93318),d=Yt(e,93426),f=Yt(e,93499),l)break g;break e}_=n+1|0,h=(y=v(n,76)+133152|0)+56|0,f=0}for(e=0,p=(0|(i=s[l-4>>2]))==34||(0|i)==39?i:0,b=v(n,76)+133208|0;;){if(i=e,!(e=s[l>>2]))break e;g:{if(!p){if((0|e)==32|e-9>>>0<5)break e;if((0|e)!=47)break g;break e}if((0|i)!=92&&(0|e)==(0|p))break e}if(l=l+4|0,!((0|(m=qn(e,m+b|0)+m|0))<16))break}}p=0,a[m+h|0]=0,m=v(n,76)+133168|0,l=0;e:if(g)for(e=0,h=(0|(i=s[g-4>>2]))==34||(0|i)==39?i:0;;){if(i=e,!(e=s[g>>2]))break e;g:{if(!h){if((0|e)==32|e-9>>>0<5)break e;if((0|e)!=47)break g;break e}if((0|i)!=92&&(0|e)==(0|h))break e}if(g=g+4|0,!((0|(l=qn(e,l+m|0)+l|0))<36))break}if(a[l+m|0]=0,!(!u|s[u>>2]-48>>>0>=10)){for(;p=(s[u>>2]+v(p,10)|0)-48|0,s[(u=u+4|0)>>2]-48>>>0<10;);(0|p)<=0||(p=p-1|0)}if(i=v(n,76)+133152|0,s[i+4>>2]=p,e=0,l=0,!(!d|s[d>>2]-48>>>0>=10))for(;l=(s[d>>2]+v(l,10)|0)-48|0,s[(d=d+4|0)>>2]-48>>>0<10;);s[i+12>>2]=l,l=v(n,76)+133152|0;e:{g:if(f){for(;n=a[e+93099|0],(i=s[(e<<2)+f>>2])&&(e=e+1|0,(0|n)==(0|i)););r:{C:switch(i-34|0){case 0:case 5:break C;default:break r}if(!n){e=0;break e}}for(e=0;n=a[e+93116|0],(i=s[(e<<2)+f>>2])&&(e=e+1|0,(0|n)==(0|i)););r:{C:switch(i-34|0){case 0:case 5:break C;default:break r}if(!n){e=1;break e}}for(e=0;n=a[e+93197|0],(i=s[(e<<2)+f>>2])&&(e=e+1|0,(0|n)==(0|i)););r:switch(i-34|0){case 0:case 5:break r;default:break g}if(!n){e=2;break e}}e=3}s[l+8>>2]=s[131156+(e<<3)>>2],s[y>>2]=t}if(gn(137776,133168),n=gn(r+96|0,133208),a[r+157|0]=s[33291],a[r+156|0]=s[33290],e=s[33289],s[r+152>>2]=0,a[r+158|0]=e,(0|_)>0)for(u=0;;){if(d=1,t=v(u,76)+133152|0,c[0|(e=t+16|0)]&&Wt(0,e)&&(gn(137776,e),d=0,a[0|n]=0,a[r+158|0]=0,o[r+156>>1]=0),c[0|(e=t+56|0)]){f=gn(n,e),i=s[33679];e:if(c[0|(e=i)])for(;;){if(!Or(e=e+1|0,f)){gn(f,i+1|0);break e}if(e=1+(U(e)+e|0)|0,!c[0|e])break}d&&(a[137776]=0)}if((e=s[t+8>>2])&&(a[r+156|0]=e),(e=s[t+12>>2])&&(a[r+157|0]=e),(e=s[t+4>>2])&&(a[r+158|0]=e),(0|_)==(0|(u=u+1|0)))break}s[r+148>>2]=n,s[r+144>>2]=137776,(e=je(r+144|0,r+172|0))?xi(e,43)||(t=c[r+156|0],!c[134672]|((0|t)==c[134724]?0:t)||(s[r>>2]=e,s[r+4>>2]=134672,H(t=r+16|0,93533,r),e=137776,Ti(137776,t,40))):e=92003,t=0,Or(e,134784)&&(gn(134784,e),t=131072)}return z=r+176|0,t}function Be(e,t){var n,r=0,i=0,a=0,o=0,c=0;n=e+t|0;A:{e:if(!(1&(r=s[e+4>>2]))){if(!(3&r))break A;t=(r=s[e>>2])+t|0;g:{if((0|(e=e-r|0))!=s[57157]){if(r>>>0<=255){if(a=s[e+8>>2],r=r>>>3|0,(0|(i=s[e+12>>2]))!=(0|a))break g;s[57152]&=oi(-2,r);break e}if(c=s[e+24>>2],(0|(r=s[e+12>>2]))==(0|e))if((i=s[(a=e+20|0)>>2])||(i=s[(a=e+16|0)>>2])){for(;o=a,(i=s[(a=(r=i)+20|0)>>2])||(a=r+16|0,i=s[r+16>>2]););s[o>>2]=0}else r=0;else i=s[e+8>>2],s[i+12>>2]=r,s[r+8>>2]=i;if(!c)break e;a=s[e+28>>2];r:{if(s[(i=228912+(a<<2)|0)>>2]==(0|e)){if(s[i>>2]=r,r)break r;s[57153]&=oi(-2,a);break e}if(s[c+(s[c+16>>2]==(0|e)?16:20)>>2]=r,!r)break e}if(s[r+24>>2]=c,(i=s[e+16>>2])&&(s[r+16>>2]=i,s[i+24>>2]=r),!(i=s[e+20>>2]))break e;s[r+20>>2]=i,s[i+24>>2]=r;break e}if(3&~(r=s[n+4>>2]))break e;s[57154]=t,s[n+4>>2]=-2&r,s[e+4>>2]=1|t,s[n>>2]=t;return}s[a+12>>2]=i,s[i+8>>2]=a}e:{if(!(2&(r=s[n+4>>2]))){if(s[57158]==(0|n)){if(s[57158]=e,t=s[57155]+t|0,s[57155]=t,s[e+4>>2]=1|t,s[57157]!=(0|e))break A;s[57154]=0,s[57157]=0;return}if(s[57157]==(0|n))return s[57157]=e,t=s[57154]+t|0,s[57154]=t,s[e+4>>2]=1|t,void(s[e+t>>2]=t);t=(-8&r)+t|0;g:if(r>>>0<=255){if(a=s[n+8>>2],r=r>>>3|0,(0|(i=s[n+12>>2]))==(0|a)){s[57152]&=oi(-2,r);break g}s[a+12>>2]=i,s[i+8>>2]=a}else{if(c=s[n+24>>2],(0|n)==(0|(r=s[n+12>>2])))if((a=s[(i=n+20|0)>>2])||(a=s[(i=n+16|0)>>2])){for(;o=i,(a=s[(i=(r=a)+20|0)>>2])||(i=r+16|0,a=s[r+16>>2]););s[o>>2]=0}else r=0;else i=s[n+8>>2],s[i+12>>2]=r,s[r+8>>2]=i;if(c){a=s[n+28>>2];r:{if(s[(i=228912+(a<<2)|0)>>2]==(0|n)){if(s[i>>2]=r,r)break r;s[57153]&=oi(-2,a);break g}if(s[c+(s[c+16>>2]==(0|n)?16:20)>>2]=r,!r)break g}s[r+24>>2]=c,(i=s[n+16>>2])&&(s[r+16>>2]=i,s[i+24>>2]=r),(i=s[n+20>>2])&&(s[r+20>>2]=i,s[i+24>>2]=r)}}if(s[e+4>>2]=1|t,s[e+t>>2]=t,s[57157]!=(0|e))break e;s[57154]=t;return}s[n+4>>2]=-2&r,s[e+4>>2]=1|t,s[e+t>>2]=t}if(t>>>0<=255)return r=228648+(-8&t)|0,(i=s[57152])&(t=1<<(t>>>3))?t=s[r+8>>2]:(s[57152]=t|i,t=r),s[r+8>>2]=e,s[t+12>>2]=e,s[e+12>>2]=r,void(s[e+8>>2]=t);a=31,t>>>0<=16777215&&(a=62+((t>>>38-(r=x(t>>>8|0))&1)-(r<<1)|0)|0),s[e+28>>2]=a,s[e+16>>2]=0,s[e+20>>2]=0,o=228912+(a<<2)|0;e:{if((i=s[57153])&(r=1<>>1|0)),r=s[o>>2];;){if(i=r,(-8&s[r+4>>2])==(0|t))break e;if(r=a>>>29|0,a<<=1,!(r=s[(o=i+(4&r)|0)+16>>2]))break}s[o+16>>2]=e,s[e+24>>2]=i}else s[57153]=r|i,s[o>>2]=e,s[e+24>>2]=o;s[e+12>>2]=e,s[e+8>>2]=e;return}t=s[i+8>>2],s[t+12>>2]=e,s[i+8>>2]=e,s[e+24>>2]=0,s[e+12>>2]=i,s[e+8>>2]=t}}function Ve(e){var t=0,n=0,r=0,i=0,o=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0;if(!(t=a[88105]))return e;if(e=xi(e,t)){if(!c[88106])return e;if(c[e+1|0]){if(!c[88107]){i=!!(0|(n=c[e+1|0]));A:if(n&&(0|(t=n|c[0|e]<<8))!=(0|(u=c[88106]|c[88105]<<8)))for(n=e+1|0;;){if(i=!!(0|(r=c[(e=n)+1|0])),!r)break A;if(n=e+1|0,(0|u)==(0|(t=r|t<<8&65280)))break}return i?e:0}if(c[e+2|0]){if(!c[88108]){n=e+2|0,i=!!(0|(t=c[e+2|0]));A:if(t&&(0|(t=c[e+1|0]<<16|c[0|e]<<24|t<<8))!=(0|(u=c[88106]<<16|c[88105]<<24|c[88107]<<8)))for(;;){if(e=n+1|0,i=!!(0|(r=c[n+1|0])),!r)break A;if(n=e,(0|u)==(0|(t=(t|r)<<8)))break}else e=n;return i?e-2|0:0}if(c[e+3|0]){if(!c[88109]){n=e+3|0,i=!!(0|(t=c[e+3|0]));A:if(t&&(0|(t=t|c[e+1|0]<<16|c[0|e]<<24|c[e+2|0]<<8))!=(0|(u=(e=c[88105]|c[88106]<<8|c[88107]<<16|c[88108]<<24)<<24|(65280&e)<<8|e>>>8&65280|e>>>24)))for(;;){if(e=n+1|0,i=!!(0|(r=c[n+1|0])),!r)break A;if(n=e,(0|u)==(0|(t=r|t<<8)))break}else e=n;return i?e-3|0:0}u=e,z=d=z-1056|0,s[(e=d+1048|0)>>2]=0,s[e+4>>2]=0,s[(e=d+1040|0)>>2]=0,s[e+4>>2]=0,s[d+1032>>2]=0,s[d+1036>>2]=0,s[d+1024>>2]=0,s[d+1028>>2]=0;A:{e:{g:{r:{if(t=c[88105]){for(;;){if(!c[o+u|0])break e;if(o=o+1|0,s[((255&t)<<2)+d>>2]=o,s[(e=(d+1024|0)+(t>>>3&28)|0)>>2]=s[e>>2]|1<>>0>1)break r}else f=-1,e=1;l=-1,n=1;break g}for(r=1,t=1;;){r:if((0|(l=c[88105+(t+f|0)|0]))!=(0|(i=c[e+88105|0])))i>>>0>>0?(r=e-f|0,n=e,t=1):(f=n,n=n+1|0,r=1,t=1);else{if((0|t)==(0|r)){n=n+r|0,t=1;break r}t=t+1|0}if(!(o>>>0>(e=n+t|0)>>>0))break}if(n=1,l=-1,o>>>0<=1)e=r;else{for(e=0,i=1,t=1;;){r:if((0|(m=c[88105+(t+l|0)|0]))!=(0|(p=c[n+88105|0])))p>>>0>m>>>0?(i=n-l|0,e=n,t=1):(l=e,e=e+1|0,i=1,t=1);else{if((0|t)==(0|i)){e=e+i|0,t=1;break r}t=t+1|0}if(!(o>>>0>(n=e+t|0)>>>0))break}e=r,n=i}}for(t=e,Hn(88105,(r=(e=l+1>>>0>f+1>>>0)?n:t)+88105|0,m=(p=e?l:f)+1|0)?(r=((e=~p+o|0)>>>0

>>0?p:e)+1|0,i=0):i=o-r|0,g=o-1|0,h=63|o,l=0,e=u;;){if(!(u-e>>>0>=o>>>0))if(n=un(u,0,h)){if(u=n,n-e>>>0>>0)break e}else u=u+h|0;n=c[e+g|0],t=o;g:{if(s[(d+1024|0)+(n>>>3&28)>>2]>>>n&1)if((0|(n=s[(n<<2)+d>>2]))==(0|o)){r:{if(f=c[(n=(t=m)>>>0>l>>>0?t:l)+88105|0])for(;;){if(c[e+n|0]!=(255&f))break r;if(!(f=c[(n=n+1|0)+88105|0]))break}for(;;){if(t>>>0<=l>>>0)break A;if(c[(t=t-1|0)+88105|0]!=c[e+t|0])break}t=r,l=i;break g}t=n-p|0}else t=(n=o-n|0)>>>0>l>>>0?n:l;l=0}e=e+t|0}}e=0}z=d+1056|0,n=e}}}}return n}function He(e,t,n,r,i,o){var l,u,d,f,p=0,m=0,h=0;if(z=l=z-560|0,a[l+448|0]=0,a[l+144|0]=0,a[l+120|0]=0,d=34&o,u=t-v(m=(0|t)/100|0,100)|0,1&(f=64&c[e+106|0]?(0|t)>999|o:0)|(0|t)>99){A:{e:{g:{if(!(!d|u)){if(!zn(e,90606,l+304|0))break g;break A}if(u)break e}if(zn(e,90691,l+304|0))break A}zn(e,90725,l+304|0)}p=o,(0|t)<1e3||(p=o,!(8&c[e+105|0])|t-2e3>>>0<4294967196&&(a[l+208|0]=0,Fe(e,p=(m>>>0)/10|0,r=16384&s[e+108>>2]?0:i+1|0,!((t>>>0)%1e3|0)|d,l+272|0)||Me(e,p,i,s[e+212>>2]==28012?520:(0|r)<4?(s[e+108>>2]>>>r&1)<<3:0,l+208|0),2&c[e+109|0]?(s[l+108>>2]=15,s[l+100>>2]=15,s[l+104>>2]=l+208,s[l+96>>2]=l+272,H(l+144|0,90761,l+96|0)):(s[l+92>>2]=15,s[l+84>>2]=15,s[l+88>>2]=l+272,s[l+80>>2]=l+208,H(l+144|0,90761,l+80|0)),r=1,1&(!!(0|(m=m-v(p,10)|0))|f)||(a[l+304|0]=0),p=1|o)),a[l+208|0]=0;A:if(!(~f&(0|m)<=0))if(!(4&c[e+106|0])|!(1&p|c[l+144|0])||zn(e,90824,l+120|0),!d|(16&c[e+109|0]?0:u)||(s[l+64>>2]=m,H(r=l+548|0,90875,l- -64|0),h=zn(e,r,l+208|0),!(4096&s[e+108>>2])|(0|u)<=0||Li(l+208|0,133104)),r=1,1&(~f|!!(0|m))){e:{g:{r:{C:{if(!(131072&s[e+108>>2])||1&p|(0|m)!=1){if(u|h||(s[l+48>>2]=m,H(r=l+548|0,90985,l+48|0),h=zn(e,r,l+208|0)),h||(s[l+32>>2]=m,H(r=l+548|0,91027,l+32|0),zn(e,r,l+208|0)))break C;if((0|m)!=1)break g;break r}if(!h)break r}a[l+304|0]=0;break e}if(r=1,4&c[e+105|0])break A}Me(e,m,i,0,l+208|0)}r=1}else zn(e,88875,l+208|0);s[l+28>>2]=l+304,s[l+24>>2]=l+208,s[l+20>>2]=l+120,s[l+16>>2]=l+144,H(l+448|0,91059,l+16|0)}else p=o;a[l+132|0]=0;A:{e:{if((0|u)>0)16&c[e+109|0]&&2&p||(!(1&p)|i&&(0|t)<=100||!(64&(r=s[e+104>>2]))&(!(8388608&r)|u>>>0>9)||zn(e,90824,l+132|0),!(1&p|c[l+144|0])|!(524288&s[e+104>>2])|m||zn(e,90824,l+132|0)),a[l+336|0]=0;else if(a[l+336|0]=0,!u&r)break e;if(i?(o=s[e+108>>2],t=(0|i)<4?(o>>>i&1)<<3:0):(r=d?3:2,t=32&o|((0|t)<100?1&p?r:4|r:r),o=s[e+108>>2]),t=(0|i)==1&&s[e+212>>2]==28012?520|t:t,1048576&o&&(r=16|t,t=(0|m)>0||1&p?r:t),!Me(e,u,i,256&p|t,l+336|0)|!(128&c[e+104|0]))break A;a[l+132|0]=0;break A}c[133104]&&((0|(e=U(l+448|0)))<=0||c[(e=e+l|0)+447|0]==10&&(a[e+447|0]=0),gn(l+336|0,133104))}s[l+8>>2]=15,s[l+12>>2]=l+336,s[l+4>>2]=l+132,s[l>>2]=l+448,H(n,91101,l),z=l+560|0}function Ue(e){var t,n,r,i=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,y=0,b=0,x=0;for(i=s[32972],s[i+64>>2]=290816,s[i+68>>2]=4104,s[i+96>>2]=0,s[i+100>>2]=0,s[i+120>>2]=90,s[i+124>>2]=100,s[i+112>>2]=64,s[i+116>>2]=256,s[i+104>>2]=5,s[i+108>>2]=0,s[i+84>>2]=100,s[i+88>>2]=64,l=s[50754],s[i+132>>2]=0,s[i+136>>2]=0,s[i+128>>2]=l,s[i+140>>2]=0,s[i+144>>2]=0,s[i+148>>2]=0,s[i+152>>2]=0,s[i+156>>2]=0,s[i+160>>2]=0,s[36435]=450,s[i+92>>2]=2,s[50870]=0,s[50871]=0,s[50872]=0,s[50873]=0,s[50880]=0,s[50881]=0,s[50882]=0,s[50883]=0,s[50890]=0,s[50891]=0,s[50892]=0,s[50893]=0,u=-3.141592653589793/s[50754],_[25429]=u,f=-2*u,_[25430]=f,t=(u=dt(200*u))*-u,_[25434]=t,_[25439]=t,_[25444]=t,u=(f=u*_n(2e3*f))+f,_[25433]=u,_[25438]=u,_[25443]=u,f=1-u-t,_[25432]=f,_[25437]=f,_[25442]=f,s[50902]=0,s[50903]=0,s[50900]=0,s[50901]=0,_[25449]=t,_[25448]=u,s[50912]=0,s[50913]=0,_[25447]=f,s[50910]=0,s[50911]=0,_[25454]=t,_[25453]=u,s[50922]=0,s[50923]=0,_[25452]=f,s[50920]=0,s[50921]=0,_[25459]=t,_[25458]=u,s[50932]=0,s[50933]=0,_[25457]=f,s[50930]=0,s[50931]=0,_[25464]=t,_[25463]=u,_[25462]=f,s[50942]=0,s[50943]=0,s[50940]=0,s[50941]=0,_[25469]=t,_[25468]=u,_[25467]=f,s[50952]=0,s[50953]=0,s[50950]=0,s[50951]=0,_[25474]=t,_[25473]=u,_[25472]=f,n=s[32972],l=0;o[(p=(l<<1)+n|0)+236>>1]=256,o[p+164>>1]=256,i=c[l+105376|0]<<1,o[p+254>>1]=i,o[p+182>>1]=i,o[p+200>>1]=c[l+105385|0]<<1,s[(i=(d=l<<2)+n|0)+308>>2]=s[d+105408>>2],s[i+272>>2]=0,o[p+218>>1]=0,s[d+200944>>2]=(0|v(s[d+105456>>2],22050))/s[50754],(0|(l=l+1|0))!=9;);for(y=s[32961],l=0,r=n+344|0;;){if(i=m,h=y,p=l,(0|(m=s[(l=(d=l<<2)+131840|0)>>2]))==-1&&(m=8e3,s[l>>2]=8e3,p&&(s[131840+(4|d)>>2]=s[d+131836>>2])),y=s[131840+(4|d)>>2],!((0|i)>=(0|(m=(0|m)/8|0))||(0|(g=m-i|0))<=0||(d=i+1|0,l=i,1&g&&(a[344+(i+n|0)|0]=(0|h)>=255?255:h,l=d),(0|d)==(0|m))))for(b=y-h|0;d=((0|v(l-i|0,b))/(0|g)|0)+h|0,a[l+r|0]=(0|d)>=255?255:d,x=((0|v((d=l+1|0)-i|0,b))/(0|g)|0)+h|0,a[d+r|0]=(0|x)>=255?255:x,(0|m)!=(0|(l=l+2|0)););if(l=p+2|0,!(p>>>0<10))break}l=s[32972],s[l+80>>2]=232,s[l+72>>2]=256,s[l+76>>2]=238,e||(s[49848]=0),o[l+200>>1]=(0|v(o[l+200>>1],105))/100}function We(e,t,n){var r,i=0,o=0,l=0,u=0,d=0,f=0,p=0,m=0;z=r=z-288|0,(0|t)!=132848&&Kt(132848,t,40),(0|(i=e+228|0))!=(0|t)&&Kt(i,t,40),s[r+88>>2]=t,s[r+84>>2]=47,s[r+80>>2]=137584,H(i=r+96|0,84089,r+80|0),o=vr(i),(i=s[e+688>>2])&&(Re(i),s[e+688>>2]=0),i=ft(r+96|0,84577);A:if((0|o)>0&&i)if(n=ve(o),s[e+688>>2]=n,n)if(f=Nn(n,o,i),Sr(i),f>>>0<=1032)s[r+16>>2]=r+96,fi(s[30450],85164,r+16|0),n=2;else if(i=s[e+688>>2],n=s[i+4>>2],!((0|(o=s[i>>2]))!=1024|(0|n)<=0)&(0|n)<134217729){i=n+i|0,s[e+684>>2]=i,m=Pt(e+5168|0,0,1024),Pt(e+7664|0,0,260),Pt(e+7924|0,255,256),Pt(e+4788|0,0,380),Pt(e+6192|0,0,512);e:if((0|(n=c[0|i]))!=7)for(;;){if((0|(o=255&n))!=6){if(!o)break e;o=s[e+684>>2],s[r+72>>2]=n<<24>>24,s[r+64>>2]=132848,s[r+68>>2]=i-o,fi(s[30450],88950,r- -64|0);break}g:{r:{C:{a:{I:switch((o=c[0|(n=i+1|0)])-18|0){case 0:break a;case 2:break I;default:break C}for(n=4+(-4&n)|0,s[e+180>>2]=n;n=(i=n)+1|0,!vi(i););for(;o=c[0|i],n=i,i=i+1|0,(0|o)!=7;);break g}if(n=i+3|0,(0|(i=((0|(i=a[i+2|0]))<65?191:-65)+i|0))>94)break r;s[4788+((i<<2)+e|0)>>2]=n;break r}n=1+((u=U(n))+n|0)|0;C:switch(0|u){case 1:s[5168+((o<<2)+e|0)>>2]=n;break r;case 0:s[m>>2]=n;break r;default:break C}u=c[i+2|0],(0|o)==1?s[6188+((u<<2)+e|0)>>2]=n:(i=s[e+7664>>2],c[0|(p=(l=e+o|0)+7924|0)]==255&&(a[0|p]=i),a[0|(l=l+7668|0)]=c[0|l]+1,s[(l=(i<<2)+e|0)+6704>>2]=n,s[e+7664>>2]=i+1,s[l+7184>>2]=o|u<<8)}if(c[0|n]!=7)for(;n=1+(U(n)+n|0)|0,c[0|n]!=7;);}n=c[0|(i=n+1|0)]}for(i=s[e+688>>2]+8|0;;){for(s[692+((n=d<<2)+e|0)>>2]=i;o=c[0|i];)i=i+o|0;for(i=i+1|0,s[692+((4|n)+e|0)>>2]=i;n=c[0|i];)i=n+i|0;if(i=i+1|0,(0|(d=d+2|0))==1024)break}n=0,(0|(e=s[e+324>>2]))<=0|e>>>0<=f>>>0||(s[r+48>>2]=t,fi(s[30450],85519,r+48|0))}else s[r+40>>2]=n,s[r+36>>2]=o,s[r+32>>2]=r+96,fi(s[30450],85349,r+32|0),n=2;else Sr(i),n=3;else{if(n||(s[r>>2]=r+96,fi(s[30450],84963,r)),n=1,!i)break A;Sr(i)}return z=r+288|0,n}function Ge(e){var t,n=0,r=0;for(t=Pt(e+344|0,0,256),a[e+364|0]=1,a[e+356|0]=1,a[e+357|0]=1,a[e+358|0]=1,a[e+359|0]=1,a[e+360|0]=1,a[e+361|0]=1,a[e+362|0]=1,a[e+363|0]=1,a[e+348|0]=1,a[e+349|0]=1,a[e+350|0]=1,a[e+351|0]=1,a[e+352|0]=1,a[e+353|0]=1,a[e+354|0]=1,a[e+355|0]=1,a[e+431|0]=3,a[e+429|0]=3,a[e+430|0]=3,a[e+406|0]=3,a[e+407|0]=3,a[e+408|0]=3,a[e+409|0]=3,a[e+410|0]=3,a[e+411|0]=3,a[e+412|0]=3,a[e+413|0]=3,a[e+414|0]=3,a[e+415|0]=3,a[e+416|0]=3,a[e+417|0]=3,a[e+418|0]=3,a[e+419|0]=3,a[e+420|0]=3,a[e+421|0]=3,a[e+440|0]=3,a[e+441|0]=3,a[e+442|0]=3,a[e+443|0]=3,r=21;a[(n=e+r|0)+344|0]=4|c[n+344|0],(0|(n=r+1|0))!=58;)a[0|(n=n+t|0)]=4|c[0|n],a[(n=r+t|0)+2|0]=4|c[n+2|0],a[n+3|0]=4|c[n+3|0],r=r+4|0;a[e+346|0]=4|c[e+346|0],a[e+347|0]=4|c[e+347|0],a[e+432|0]=4|c[e+432|0],a[e+433|0]=4|c[e+433|0],a[e+434|0]=4|c[e+434|0],a[e+435|0]=4|c[e+435|0],a[e+436|0]=4|c[e+436|0],a[e+437|0]=4|c[e+437|0],a[e+438|0]=4|c[e+438|0],a[e+439|0]=4|c[e+439|0],a[e+467|0]=4|c[e+467|0],a[e+468|0]=4|c[e+468|0],a[e+470|0]=4|c[e+470|0],a[e+471|0]=4|c[e+471|0],a[e+348|0]=64|c[e+348|0],a[e+349|0]=64|c[e+349|0],a[e+350|0]=64|c[e+350|0],a[e+351|0]=64|c[e+351|0],a[e+352|0]=64|c[e+352|0],a[e+353|0]=64|c[e+353|0],a[e+354|0]=64|c[e+354|0],a[e+355|0]=64|c[e+355|0],a[e+356|0]=64|c[e+356|0],a[e+357|0]=64|c[e+357|0],a[e+358|0]=64|c[e+358|0],a[e+359|0]=64|c[e+359|0],a[e+360|0]=64|c[e+360|0],a[e+361|0]=64|c[e+361|0],a[e+362|0]=64|c[e+362|0],a[e+363|0]=64|c[e+363|0],a[e+364|0]=64|c[e+364|0],a[e+406|0]=64|c[e+406|0],a[e+407|0]=64|c[e+407|0],a[e+408|0]=64|c[e+408|0],a[e+409|0]=64|c[e+409|0],a[e+410|0]=64|c[e+410|0],a[e+411|0]=64|c[e+411|0],a[e+412|0]=64|c[e+412|0],a[e+413|0]=64|c[e+413|0],a[e+414|0]=64|c[e+414|0],a[e+415|0]=64|c[e+415|0],a[e+416|0]=64|c[e+416|0],a[e+417|0]=64|c[e+417|0],a[e+418|0]=64|c[e+418|0],a[e+419|0]=64|c[e+419|0],a[e+420|0]=64|c[e+420|0],a[e+440|0]=64|c[e+440|0],a[e+441|0]=64|c[e+441|0],a[e+429|0]=64|c[e+429|0],a[e+430|0]=64|c[e+430|0],a[e+431|0]=64|c[e+431|0],a[e+442|0]=64|c[e+442|0],a[e+443|0]=64|c[e+443|0],s[e+40>>2]=1,s[e+204>>2]=s[e+600>>2]+77}function Ke(e,t,n,r,i,a,o,c,l){var u,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0;z=u=z-128|0;A:{e:{if(Ht(a,o,c,l,0,0,0,0)){f=65535&l;g:r:{if((0|(m=l>>>16&32767))!=32767){if(d=4,m)break r;d=a|c|o|f?3:2;break g}d=!(a|c|o|f)}if((0|(h=32767&(y=i>>>16|0)))!=32767&&d)break e}ke(u+16|0,t,n,r,i,a,o,c,l),be(u,t=s[u+16>>2],r=s[u+20>>2],i=s[u+24>>2],n=s[u+28>>2],t,r,i,n),r=s[u+8>>2],i=s[u+12>>2],c=s[u>>2],l=s[u+4>>2];break A}if(m=c,(0|Ht(t,n,d=r,g=2147483647&i,a,o,c,p=2147483647&l))<=0){if(Ht(t,n,d,g,a,o,m,p)){c=t,l=n;break A}ke(u+112|0,t,n,r,i,0,0,0,0),r=s[u+120>>2],i=s[u+124>>2],c=s[u+112>>2],l=s[u+116>>2]}else{if(_=l>>>16&32767,h?(l=n,c=t):(ke(u+96|0,t,n,d,g,0,0,0,1081540608),d=s[u+104>>2],g=c=s[u+108>>2],h=(c>>>16|0)-120|0,l=s[u+100>>2],c=s[u+96>>2]),_||(ke(u+80|0,a,o,m,p,0,0,0,1081540608),m=s[u+88>>2],p=a=s[u+92>>2],_=(a>>>16|0)-120|0,o=s[u+84>>2],a=s[u+80>>2]),v=m,b=65535&p|65536,g=65535&g|65536,(0|h)>(0|_)){for(;;){if(m=(p=d-v|0)-(f=(0|o)==(0|l)&a>>>0>c>>>0|o>>>0>l>>>0)|0,(0|(f=(g-((d>>>0>>0)+b|0)|0)-(f>>>0>p>>>0)|0))>0|(0|f)>=0){if(d=c,!((c=c-a|0)|m|(l=l-((a>>>0>d>>>0)+o|0)|0)|f)){ke(u+32|0,t,n,r,i,0,0,0,0),r=s[u+40>>2],i=s[u+44>>2],c=s[u+32>>2],l=s[u+36>>2];break A}f=f<<1|m>>>31,d=m<<1|l>>>31}else f=g<<1|d>>>31,d=d<<1|l>>>31;if(g=f,f=l<<1|c>>>31,c<<=1,l=f,!((0|(h=h-1|0))>(0|_)))break}h=_}if(m=(p=d-v|0)-(f=(0|o)==(0|l)&a>>>0>c>>>0|o>>>0>l>>>0)|0,p=f=(g-((d>>>0>>0)+b|0)|0)-(f>>>0>p>>>0)|0,(0|f)<0)m=d,p=g;else if(d=c,!((c=c-a|0)|m|(l=l-((a>>>0>d>>>0)+o|0)|0)|p)){ke(u+48|0,t,n,r,i,0,0,0,0),r=s[u+56>>2],i=s[u+60>>2],c=s[u+48>>2],l=s[u+52>>2];break A}if((0|p)==65535|p>>>0<65535)for(;t=l>>>31|0,h=h-1|0,g=l<<1|c>>>31,c<<=1,l=g,n=t,t=p<<1|m>>>31,m=n|m<<1,p=t,t>>>0<65536;);t=32768&y,(0|h)<=0?(ke(u- -64|0,c,l,m,65535&p|(t|h+120)<<16,0,0,0,1065811968),r=s[u+72>>2],i=s[u+76>>2],c=s[u+64>>2],l=s[u+68>>2]):(r=m,i=65535&p|(t|h)<<16)}}s[e>>2]=c,s[e+4>>2]=l,s[e+8>>2]=r,s[e+12>>2]=i,z=u+128|0}function qe(e,t,n){var r,i,o=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0;if(z=r=z-1040|0,(0|(l=sr(e,589824,0)))>=0&&((o=Br(1,2072))?s[o+8>>2]=l:(T(0|l),o=0)),i=o,o){A:if(o=Jn(i))for(g=s[30450],h=(r+96|0)+t|0;;){if((0|(l=s[50303]))>=348){s[r+4>>2]=350,s[r>>2]=l+1,fi(g,91860,r);break A}if(c[o+19|0]!=46)if(s[r+88>>2]=o+19,s[r+84>>2]=47,s[r+80>>2]=e,H(o=r+96|0,91924,r+80|0),(0|(o=vr(o)))!=-31){if(!((0|o)<=0)&&(m=ft(r+96|0,85712))){u=0,a[r+832|0]=0,a[r+752|0]=0,s[r+360>>2]=0,s[r+356>>2]=4,f=0;e:for(;;){for(p=299-f|0;It(r+912|0,120,m);){o=r+912|0;g:{if(c[r+912|0]!=35){r:if(!((0|(o=U(r+912|0)-1|0))<=0))for(;;){if(!((0|(l=a[0|(d=(r+912|0)+o|0)]))==32|l-9>>>0<5))break r;if(a[0|d]=0,!((0|(o=o-1|0))>0))break}if(!(o=Ve(r+912|0)))break g}a[0|o]=0}o=r+912|0;g:if(l=c[r+912|0])for(;;){if(fr(l<<24>>24))break g;if(!(l=c[0|(o=o+1|0)]))break}if(a[0|o]=0,c[r+912|0]){o=o+1|0;g:switch(Ur(131904,r+912|0)-1|0){case 0:for(;l=o,o=o+1|0,(0|(d=a[0|l]))==32|d-9>>>0<5;);Ti(r+832|0,l,80);continue;case 1:if(a[r+672|0]=0,s[r+364>>2]=5,l=r+672|0,s[r+16>>2]=l,s[r+20>>2]=r+364,_e(o,86237,r+16|0),(l=U(l)+2|0)>>>0>=p>>>0)continue;a[0|(o=(r+368|0)+f|0)]=s[r+364>>2],gn(o+1|0,r+672|0),u=u+1|0,f=l+f|0;continue e;case 2:if(s[r+52>>2]=r+360,s[r+48>>2]=r+752,_e(o,86237,r+48|0),!n)continue;s[r+32>>2]=h,fi(g,92042,r+32|0);continue;case 5:break g;default:continue}s[r+64>>2]=r+356,_e(o,87268,r- -64|0)}}break}a[(r+368|0)+f|0]=0,l=Ur(132112,r+752|0),u?(d=U(h)+f|0,p=ut((u=Br(28+(U(r+832|0)+d|0)|0,1))+24|0,r+368|0,o=f+1|0),s[u+4>>2]=p,o=gn(o+p|0,h),s[u>>2]=o,s[u+8>>2]=o,c[r+832|0]&&(s[u>>2]=gn(2+(d+p|0)|0,r+832|0)),o=s[r+360>>2],a[u+14|0]=0,a[u+12|0]=l,a[u+13|0]=o,a[u+15|0]=s[r+356>>2],Sr(m),o=s[50303],s[50303]=o+1,s[201216+(o<<2)>>2]=u):Sr(m)}}else qe(r+96|0,t,n);if(!(o=Jn(i)))break}yi(s[i+8>>2]),Re(i)}z=r+1040|0}function Je(e,t){var n,r=0,i=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0;z=n=z-352|0;A:if(e||=s[136284+(t<<4)>>2]){c[0|e]!=47&&(s[n+12>>2]=e,s[n+4>>2]=47,s[n+8>>2]=47,s[n>>2]=137584,H(e=n+16|0,84114,n)),a[n+240|0]=0;e:{g:{if(r=ft(e,84577)){if((0|ri(r,20))==-1)break e;if(l=ti(r),i=ti(r),d=ti(r),!((0|l)!=65537|(0|i)!=s[50754])&(0|d)==i<<1)break g;Sr(r),o[n+256>>1]=c[84864]|c[84865]<<8,e=c[84852]|c[84853]<<8|c[84854]<<16|c[84855]<<24,s[n+240>>2]=c[84848]|c[84849]<<8|c[84850]<<16|c[84851]<<24,s[n+244>>2]=e,e=c[84860]|c[84861]<<8|c[84862]<<16|c[84863]<<24,s[n+248>>2]=c[84856]|c[84857]<<8|c[84858]<<16|c[84859]<<24,s[n+252>>2]=e,z=l=z-16|0;r:{if((r=U(e=n+240|0))>>>0>=6&&!Hn(d=(e+r|0)-6|0,84274,6)){for(p=100;;){for(f=0,z=r=z-16|0,c[227196]||(a[227197]=M(),a[227196]=1),h=+k(),b(u=h/1e3)<0x8000000000000000?(m=b(u)>=1?~~(u>0?S(C(23283064365386963e-26*u),4294967295):w(23283064365386963e-26*(u-+(~~u>>>0>>>0))))>>>0:0,i=~~u>>>0):(m=-2147483648,i=0),s[r>>2]=i,s[r+4>>2]=m,u=1e3*(h-(+(hr(i,m,1e3,0)>>>0)+4294967296*(0|B)))*1e3,i=b(u)<2147483648?~~u:-2147483648,s[r+8>>2]=i,i=d+(r>>>4|0)^v(s[r+8>>2],65537);a[d+f|0]=65+(15&i|i<<1&32),i=i>>>5|0,(0|(f=f+1|0))!=6;);if(z=r+16|0,s[l>>2]=384,(0|(r=sr(e,194,l)))>=0)break r;if(p=p-1|0,s[56798]!=20||!p)break}ut(d,84274,6)}else s[56798]=28;r=-1}z=l+16|0,(0|r)<0||yi(r)}if(!(r=ft(e,84577))){e=xr(0,s[56798],e);break A}}if((0|(l=vr(e)))<0){Sr(r),e=xr(0,0-l|0,e);break A}if((0|ri(r,0))==-1){t=s[56798],Sr(r),e=xr(0,t,e);break A}if(!(i=Xe(s[(d=136280+(t<<4)|0)>>2],l))){Sr(r),e=48;break A}if((0|Nn(i,l,r))!=(0|l)){t=s[56798],Sr(r),c[n+240|0]&&$r(n+240|0),Re(i),e=xr(0,t,e);break A}Sr(r),c[n+240|0]&&$r(n+240|0),s[136276+(t<<4)>>2]=(c[i+40|0]|c[i+41|0]<<8|c[i+42|0]<<16|c[i+43|0]<<24)/2,s[d>>2]=i,e=0;break A}t=s[56798],Sr(r),e=xr(0,t,e)}else e=28;return z=n+352|0,e}function Ye(e,t,n,r,i,o){var l,u=0,d=0,f=0,p=0,m=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0,w=0;for(a[0|n]=1,l=1&o,C=1,y=-1,b=-1,p=1,o=t;;){w=S-2|0,x=m,_=b;A:{e:{for(;;){if(!(g=c[0|o])){b=_,m=x;break A}if(o=o+1|0,v=s[144464+(g<<2)>>2]){g:{if((0|(u=c[v+11|0]))!=1){if(16&c[v+6|0]|(0|u)!=2)break g;a[0|(m=n+p|0)]=y,u=(0|y)<4|(0|_)>(0|y),!(2&c[v+4|0])|!l|(0|y)>=0||(a[0|m]=1),m=u?x:p,b=u?_:y,y=-1,p=p+1|0;break e}if(!h[v+8>>1]){u=0,f=p;r:if((0|g)!=8)u=c[v+14|0],s[i>>2]&&u>>>0>=4||(_=(0|u)<(0|_)?_:u,y=u);else{for(;;){if(g=u,f=f-1|0,s[i>>2]|(0|f)<=0||(0|(v=a[0|(d=n+f|0)]))>3)break r;if(u=g+1|0,!(v>>>0<2))break}if(a[0|d]=4,x=(0|_)<4?f:x,_=(0|_)<=4?4:_,f>>>0<2)break r;if(v=3&(f=~g+S|0),u=1,w-g>>>0>=3)for(g=-4&f,f=0;c[0|(d=n+u|0)]==4&&(a[0|d]=3),c[d+1|0]==4&&(a[d+1|0]=3),c[d+2|0]==4&&(a[d+2|0]=3),c[d+3|0]==4&&(a[d+3|0]=3),u=u+4|0,(0|g)!=(0|(f=f+4|0)););if(d=0,!v)break r;for(;c[0|(g=n+u|0)]==4&&(a[0|g]=3),u=u+1|0,(0|v)!=(0|(d=d+1|0)););}if(C)continue;break A}}break}}b=_,m=x,(0|g)==20&&(a[n+p|0]=l&&(0|y)<0?1:y,p=p+1|0)}if(a[0|t]=g,S=p-1|0,t=t+1|0,C=(0|p)<99)continue}break}a[n+p|0]=1,a[0|t]=0;A:if((0|(t=s[i>>2]))>0)b=4,(0|t)>=(0|p)&&(s[i>>2]=S,t=S),a[t+n|0]=4,m=s[i>>2];else if((0|b)==5&&(b=4,!((0|p)<2))){if(o=1,_=1&(t=p-1|0),(0|p)!=2)for(x=-2&t,f=0;;){d=4;e:{g:{r:switch(c[0|(t=(u=o)+n|0)]-4|0){case 1:break g;case 0:break r;default:break e}d=2&c[e+14|0]?1:3,u=m}a[0|t]=d,m=u}d=4;e:{g:{r:switch(c[0|(t=(u=o+1|0)+n|0)]-4|0){case 1:break g;case 0:break r;default:break e}d=2&c[e+14|0]?1:3,u=m}a[0|t]=d,m=u}if(o=o+2|0,(0|x)==(0|(f=f+2|0)))break}if(_){d=4;e:{g:switch(c[0|(t=n+o|0)]-4|0){case 1:break e;case 0:break g;default:break A}d=2&c[e+14|0]?1:3,o=m}a[0|t]=d,m=o}}return s[i>>2]=m,s[r>>2]=p,b}function Xe(e,t){var n,r,i=0,a=0,o=0,c=0,l=0,u=0,d=0,f=0,p=0;if(!e)return ve(t);if(t>>>0>=4294967232)return s[56798]=48,0;n=t>>>0<11?16:t+11&-8,o=-8&(r=s[(c=e-8|0)+4>>2]);A:if(3&r){l=o+c|0;e:if(o>>>0>=n>>>0){if((a=o-n|0)>>>0<16)break e;s[c+4>>2]=1&r|n|2,s[(i=c+n|0)+4>>2]=3|a,s[l+4>>2]=1|s[l+4>>2],Be(i,a)}else if(s[57158]!=(0|l))if(s[57157]!=(0|l)){if(2&(a=s[l+4>>2])||(d=o+(-8&a)|0)>>>0>>0)break A;p=d-n|0;g:if(a>>>0<=255){if(o=s[l+8>>2],i=a>>>3|0,(0|(a=s[l+12>>2]))==(0|o)){s[57152]&=oi(-2,i);break g}s[o+12>>2]=a,s[a+8>>2]=o}else{if(f=s[l+24>>2],(0|(u=s[l+12>>2]))==(0|l))if((i=s[(o=l+20|0)>>2])||(i=s[(o=l+16|0)>>2])){for(;a=o,u=i,(i=s[(o=i+20|0)>>2])||(o=u+16|0,i=s[u+16>>2]););s[a>>2]=0}else u=0;else i=s[l+8>>2],s[i+12>>2]=u,s[u+8>>2]=i;if(f){a=s[l+28>>2];r:{if(s[(i=228912+(a<<2)|0)>>2]==(0|l)){if(s[i>>2]=u,u)break r;s[57153]&=oi(-2,a);break g}if(s[(s[f+16>>2]==(0|l)?16:20)+f>>2]=u,!u)break g}s[u+24>>2]=f,(i=s[l+16>>2])&&(s[u+16>>2]=i,s[i+24>>2]=u),(i=s[l+20>>2])&&(s[u+20>>2]=i,s[i+24>>2]=u)}}p>>>0<=15?(s[c+4>>2]=1&r|d|2,s[(i=c+d|0)+4>>2]=1|s[i+4>>2]):(s[c+4>>2]=1&r|n|2,s[(a=c+n|0)+4>>2]=3|p,s[(i=c+d|0)+4>>2]=1|s[i+4>>2],Be(a,p))}else{if((a=o+s[57154]|0)>>>0>>0)break A;(i=a-n|0)>>>0>=16?(s[c+4>>2]=1&r|n|2,s[(o=c+n|0)+4>>2]=1|i,s[(a=a+c|0)>>2]=i,s[a+4>>2]=-2&s[a+4>>2]):(s[c+4>>2]=a|1&r|2,s[(i=a+c|0)+4>>2]=1|s[i+4>>2],i=0,o=0),s[57157]=o,s[57154]=i}else{if((o=o+s[57155]|0)>>>0<=n>>>0)break A;s[c+4>>2]=1&r|n|2,i=o-n|0,s[(a=c+n|0)+4>>2]=1|i,s[57155]=i,s[57158]=a}i=c}else{if(n>>>0<256||o>>>0>=n+4>>>0&&(i=c,o-n>>>0<=s[57272]<<1>>>0))break A;i=0}return i?i+8|0:(c=ve(t))?(ut(c,e,t>>>0>(i=(3&(i=s[e-4>>2])?-4:-8)+(-8&i)|0)>>>0?i:t),Re(e),c):0}function Ze(){var e,t,n=0,r=0;return e=Yr(12),s[e>>2]=22050,t=Yr(432),s[(r=t)+4>>2]=0,s[r+8>>2]=0,s[r>>2]=132304,s[r+32>>2]=0,s[r+12>>2]=0,s[r+16>>2]=0,s[r+20>>2]=0,s[r+24>>2]=0,Pt(r+40|0,0,376),s[r+420>>2]=0,s[r+424>>2]=-1,a[r+416|0]=1,n=Pt(Yr(408),0,408),s[r+28>>2]=n,a[n+8|0]=1,s[e+4>>2]=r,n=Yr(1096),s[n+8>>2]=22050,s[n+4>>2]=22050,s[n>>2]=132352,s[n+64>>2]=22050,s[n+56>>2]=0,s[n+60>>2]=0,s[n+32>>2]=0,s[n+36>>2]=0,s[n+24>>2]=22050,s[n+16>>2]=0,s[n+20>>2]=0,s[n+40>>2]=0,s[n+44>>2]=0,a[n+48|0]=0,s[n+128>>2]=0,s[n+132>>2]=0,o[n+96>>1]=0,s[n+72>>2]=22050,s[n+136>>2]=0,s[n+140>>2]=0,o[n+168>>1]=0,s[n+144>>2]=22050,s[n+200>>2]=0,s[n+204>>2]=0,s[n+208>>2]=0,s[n+212>>2]=0,s[n+216>>2]=22050,o[n+240>>1]=0,s[n+280>>2]=0,s[n+284>>2]=0,s[n+272>>2]=0,s[n+276>>2]=0,s[n+288>>2]=22050,o[n+312>>1]=0,s[n+344>>2]=0,s[n+348>>2]=0,s[n+352>>2]=0,s[n+356>>2]=0,s[n+360>>2]=22050,o[n+384>>1]=0,s[n+416>>2]=0,s[n+420>>2]=0,s[n+424>>2]=0,s[n+428>>2]=0,s[n+432>>2]=22050,o[n+456>>1]=0,s[n+488>>2]=0,s[n+492>>2]=0,s[n+496>>2]=0,s[n+500>>2]=0,s[n+504>>2]=22050,o[n+528>>1]=1,s[n+560>>2]=0,s[n+564>>2]=0,s[n+568>>2]=0,s[n+572>>2]=0,o[n+600>>1]=0,s[n+576>>2]=22050,s[n+640>>2]=0,s[n+644>>2]=0,s[n+632>>2]=0,s[n+636>>2]=0,o[n+680>>1]=0,s[n+656>>2]=22050,s[n+648>>2]=22050,s[n+720>>2]=0,s[n+724>>2]=0,s[n+712>>2]=0,s[n+716>>2]=0,o[n+752>>1]=0,s[n+728>>2]=22050,s[n+792>>2]=0,s[n+796>>2]=0,s[n+784>>2]=0,s[n+788>>2]=0,o[n+824>>1]=0,s[n+800>>2]=22050,s[n+864>>2]=0,s[n+868>>2]=0,s[n+856>>2]=0,s[n+860>>2]=0,s[n+872>>2]=22050,o[n+896>>1]=0,s[n+936>>2]=0,s[n+940>>2]=0,s[n+928>>2]=0,s[n+932>>2]=0,o[n+968>>1]=0,s[n+944>>2]=22050,s[n+1008>>2]=0,s[n+1012>>2]=0,s[n+1e3>>2]=0,s[n+1004>>2]=0,o[n+1040>>1]=0,s[n+1016>>2]=22050,s[n+1088>>2]=0,s[(r=n+1080|0)>>2]=0,s[r+4>>2]=0,s[(r=n+1072|0)>>2]=0,s[r+4>>2]=0,s[e+8>>2]=n,Ui[s[s[n>>2]+4>>2]](n,t),e}function Qe(e,t,n){var r=0,i=0,a=0,o=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0;A:if(p=s[50759]){if(r=s[50980],i=v(r,80)+222176|0,(0|(u=(0|(i=(0|(i=(s[i+12>>2]+s[i>>2]|0)/(0|e)|0))<(0|(f=((0|v(s[50754],19))/40<<16)/(0|e)|0))?i:f))>=399?399:i))>=0&&(Pt(t,0,4+(u<<2)|0),r=s[50980]),(0|r)>=0)for(m=s[50801];;){if(a=v(o,80)+222176|0,s[a+4>>2]&&(l=s[a>>2])){if(h=l+s[a+12>>2]|0,r=1+((l-s[a+8>>2]|0)/(0|e)|0)|0,(0|l)>(0|(r=v(i=(0|r)<=1?1:r,e))))for(;s[(d=(i<<2)+t|0)>>2]=s[d>>2]+v(s[a+4>>2],c[((l-r|0)/(s[a+8>>2]>>8)|0)+m|0]),i=i+1|0,(0|l)>(0|(r=e+r|0)););if(!((0|r)>=(0|h)))for(;s[(d=(i<<2)+t|0)>>2]=s[d>>2]+v(s[a+4>>2],c[((r-l|0)/(s[a+12>>2]>>8)|0)+m|0]),i=i+1|0,(0|h)>(0|(r=e+r|0)););}if(!((0|(o=o+1|0))<=s[50980]))break}if(i=1,!((0|(a=65536e3/(0|e)|0))<=0||(0|(r=v(s[55565],10)))<=0))for(a=(0|r)/(0|a)|0;s[(l=(i<<2)+t|0)>>2]=s[l>>2]+r,i=i+1|0,(0|(r=r-a|0))>0;);if((0|o)<=8)for(;i=(r=o<<2)+203216|0,a=v(o,80)+222176|0,l=s[a+4>>2]>>14,s[i>>2]=(0|v(v(l,l),5))/2,n?r=s[r+203264>>2]:(l=r+203264|0,r=s[a>>2]/(0|e)|0,s[l>>2]=r),(0|r)>=(0|f)&&(s[i>>2]=0),(0|(o=o+1|0))!=9;);if(i=0,(0|u)>=0)for(r=0;a=s[(o=(r<<2)+t|0)>>2]>>15,a=v(a,a)>>8,s[o>>2]=a,(0|i)<=524287999&&(s[o>>2]=v(a,c[344+((i>>19)+p|0)|0])>>13),i=e+i|0,o=(0|r)!=(0|u),r=r+1|0,o;);if(s[t+4>>2]=(0|v(s[t+4>>2],c[203300]?6:10))/8,1&n)for(e=s[50826],r=1;;){if(s[(n=r<<2)+203312>>2]=s[t+n>>2]-s[e+n>>2]>>3,(0|(n=r+1|0))==30)break A;s[(n<<=2)+203312>>2]=s[t+n>>2]-s[e+n>>2]>>3,r=r+2|0}}else u=1;return u}function $e(e,t,n,r){var i,l=0,u=0;z=i=z-176|0,a[0|e]=0,o[i+80>>1]=24320,s[i+104>>2]=0,s[i+108>>2]=0,a[82+(qn(n,l=i+80|2)+i|0)|0]=0;A:{e:{if(!r){if(r=i+80|1,s[i+12>>2]=r,nt(t,i+12|0,i+16|0,i+104|0,0,0)||(s[i+12>>2]=l,nt(t,i+12|0,i+16|0,i+104|0,0,0)||(a[i+81|0]=32,Ae(t,l,i+16|0,60,0,0,0))),(n=c[i+16|0])&&(0|n)!=21)break e;g:{if(s[t+212>>2]!=25966){if(Bn(85719,188772,189296),a[i+81|0]=95,s[i+12>>2]=r,nt(s[47193],i+12|0,i+16|0,i+104|0,0,0)||(s[i+12>>2]=l,nt(s[47193],i+12|0,i+16|0,i+104|0,0,0)),c[i+16|0])break g;ci(s[s[32972]+60>>2]),n=c[i+16|0]}if(255&n)break e;t=c[87124]|c[87125]<<8|c[87126]<<16|c[87127]<<24,n=c[87120]|c[87121]<<8|c[87122]<<16|c[87123]<<24,a[0|e]=n,a[e+1|0]=n>>>8,a[e+2|0]=n>>>16,a[e+3|0]=n>>>24,a[e+4|0]=t,a[e+5|0]=t>>>8,a[e+6|0]=t>>>16,a[e+7|0]=t>>>24,a[e+16|0]=c[87136],t=c[87132]|c[87133]<<8|c[87134]<<16|c[87135]<<24,n=c[87128]|c[87129]<<8|c[87130]<<16|c[87131]<<24,a[e+8|0]=n,a[e+9|0]=n>>>8,a[e+10|0]=n>>>16,a[e+11|0]=n>>>24,a[e+12|0]=t,a[e+13|0]=t>>>8,a[e+14|0]=t>>>16,a[e+15|0]=t>>>24;break A}r=i+16|0,l=i+104|0,z=n=z-112|0,(u=s[47193])?(ye(u,r,l,-1,0),Ut(l=r,r=n+48|0),t=s[t+212>>2],a[n+43|0]=t>>>24,a[0|(u=(l=n+43|0)+(t>>>0>16777215)|0)]=t>>>16,a[0|(u=u+!!(16711680&t)|0)]=t>>>8,a[0|(u=u+!!(65280&t)|0)]=t,a[u+!!(255&t)|0]=0,s[n+16>>2]=85719,s[n+24>>2]=l,s[n+20>>2]=r,H(e,85662,n+16|0)):(ye(t,r,l,-1,0),Ut(r,t=n+48|0),s[n>>2]=t,H(e,85451,n)),z=n+112|0,ci(s[s[32972]+60>>2]);break A}if(s[i+12>>2]=l,nt(t,i+12|0,i+16|0,i+104|0,0,0),!c[i+16|0])break A}ye(n=t,t=i+16|0,i+104|0,-1,0),Ut(n=t,t=i+112|0),s[i>>2]=t,H(e,85451,i)}return z=i+176|0,e}function et(e,t){var n,r=0,i=0,o=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0;if(z=n=z-112|0,s[n+72>>2]=-1,s[(r=n- -64|0)>>2]=-1,s[r+4>>2]=-1,s[n+56>>2]=-1,s[n+60>>2]=-1,s[n+48>>2]=-1,s[n+52>>2]=-1,s[n+40>>2]=-1,s[n+44>>2]=-1,s[n+32>>2]=-1,s[n+36>>2]=-1,s[n+24>>2]=-1,s[n+28>>2]=-1,s[n+16>>2]=-1,s[n+20>>2]=-1,(0|t)>0){for(o=s[n+72>>2],c=s[n+68>>2],l=s[n+64>>2],u=s[n+60>>2],d=s[n+56>>2],f=s[n+52>>2],p=s[n+48>>2],m=s[n+44>>2],h=s[n+40>>2],g=s[n+36>>2],_=s[n+32>>2],v=s[n+28>>2],y=s[n+24>>2],b=s[n+20>>2],x=s[n+16>>2];i=o,o=(0|(o=s[(r=134912+(S<<6)|0)+60>>2]))<0?i:o,i=c,c=(0|(c=s[r+56>>2]))<0?i:c,i=l,l=(0|(l=s[r+52>>2]))<0?i:l,i=u,u=(0|(u=s[r+48>>2]))<0?i:u,i=d,d=(0|(d=s[r+44>>2]))<0?i:d,i=f,f=(0|(f=s[r+40>>2]))<0?i:f,i=p,p=(0|(p=s[r+36>>2]))<0?i:p,i=m,m=(0|(m=s[r+32>>2]))<0?i:m,i=h,h=(0|(h=s[r+28>>2]))<0?i:h,i=g,g=(0|(g=s[r+24>>2]))<0?i:g,i=_,_=(0|(_=s[r+20>>2]))<0?i:_,i=v,v=(0|(v=s[r+16>>2]))<0?i:v,i=y,y=(0|(y=s[r+12>>2]))<0?i:y,i=b,b=(0|(b=s[r+8>>2]))<0?i:b,x=(0|(r=s[r+4>>2]))<0?x:r,(0|(S=S+1|0))!=(0|t););s[n+72>>2]=o,s[n+68>>2]=c,s[n+64>>2]=l,s[n+60>>2]=u,s[n+56>>2]=d,s[n+52>>2]=f,s[n+48>>2]=p,s[n+44>>2]=m,s[n+40>>2]=h,s[n+36>>2]=g,s[n+32>>2]=_,s[n+28>>2]=v,s[n+24>>2]=y,s[n+20>>2]=b,s[n+16>>2]=x}for(t=0;;){if((0|(r=s[(o=t<<2)+(n+16|0)>>2]))!=s[(o=o+134848|0)>>2]){a[n+80|0]=0;A:{e:switch(t-1|0){case 4:s[47201]=r-1;break A;case 5:s[47200]=r;break A;case 0:case 1:case 2:case 3:case 11:break e;default:break A}s[n+4>>2]=r,s[n>>2]=1,s[n+8>>2]=a[t+102812|0],H(n+80|0,91942,n)}s[o>>2]=r,r=n+80|0,gn(s[e>>2]+189424|0,r),s[e>>2]=s[e>>2]+U(r)}if((0|(t=t+1|0))==15)break}z=n+112|0}function tt(e){var t,n,r,i=0,o=0,l=0,u=0;for(i=17,s[e+328>>2]=17,s[e+224>>2]=0,s[e+216>>2]=1105,s[e+220>>2]=1072,s[e+600>>2]=1056,s[e+8180>>2]=105296,l=Pt(e+344|0,0,256),a[e+393|0]=1,a[e+365|0]=1,a[e+360|0]=1,a[e+545|0]=1,a[e+529|0]=1,a[e+391|0]=1,a[e+379|0]=1,a[e+374|0]=1,a[e+489|0]=1,a[e+487|0]=1,a[e+398|0]=1,a[e+387|0]=1,a[e+388|0]=2,a[e+389|0]=1,a[e+390|0]=1,a[e+385|0]=2,a[e+383|0]=2,a[e+368|0]=1,a[e+369|0]=2,o=104224;a[0|(i=i+l|0)]=4|c[0|i],i=l+c[o+1|0]|0,a[0|i]=4|c[0|i],i=l+c[o+2|0]|0,a[0|i]=4|c[0|i],i=c[0|(o=o+3|0)],(0|o)!=104251;);a[e+386|0]=8|c[e+386|0],a[e+382|0]=8|c[e+382|0],a[e+384|0]=8|c[e+384|0],a[e+369|0]=16|c[e+369|0],a[e+370|0]=16|c[e+370|0],a[e+371|0]=16|c[e+371|0],o=c[e+361|0],l=c[e+362|0],i=c[e+363|0],u=c[e+364|0],t=c[e+366|0],n=c[e+367|0],a[e+372|0]=16|c[e+372|0],a[e+373|0]=16|c[e+373|0],a[e+375|0]=16|c[e+375|0],a[e+376|0]=16|c[e+376|0],a[e+377|0]=16|c[e+377|0],a[e+378|0]=16|c[e+378|0],a[e+380|0]=16|c[e+380|0],a[e+381|0]=16|c[e+381|0],a[e+383|0]=16|c[e+383|0],a[e+385|0]=16|c[e+385|0],r=c[e+388|0],a[e+367|0]=48|n,a[e+366|0]=40|t,a[e+364|0]=48|u,a[e+363|0]=48|i,a[e+362|0]=48|l,a[e+361|0]=48|o,a[e+388|0]=80|r,o=c[e+390|0],l=c[e+391|0],i=c[e+393|0],a[e+360|0]=128|c[e+360|0],u=c[e+365|0],a[e+393|0]=192|i,a[e+365|0]=128|u,a[e+368|0]=128|c[e+368|0],a[e+374|0]=128|c[e+374|0],a[e+379|0]=128|c[e+379|0],a[e+387|0]=128|c[e+387|0],i=c[e+389|0],a[e+391|0]=192|l,a[e+390|0]=192|o,a[e+389|0]=128|i,a[e+529|0]=128|c[e+529|0],a[e+545|0]=128|c[e+545|0],a[e+489|0]=128|c[e+489|0],a[e+487|0]=128|c[e+487|0],a[e+398|0]=128|c[e+398|0]}function nt(e,t,n,r,i,l){var u,d=0,f=0,p=0,m=0,h=0,g=0;z=u=z-192|0,d=h=s[t>>2];A:{e:{for(;f=1,(0|(p=a[0|d]))>=0||(f=2,p>>>0<4294967264||(f=p>>>0<4294967280?3:4)),!(c[0|(p=f+d|0)]!=32|c[p+1|0]!=46);){if(m-160>>>0<4294967135)break e;ut((g=u+32|0)+m|0,d,f),a[(f=f+m|0)+g|0]=46,d=p+3|0,m=f+1|0}if(m){for(f=0;p=f,f=f+1|0,223&c[d+p|0];);if(!((g=p+m|0)+1>>>0>160)&&(ut((f=u+32|0)+m|0,d,p),a[f+g|0]=0,Pe(e,f,d,n,r,i,l))){s[r>>2]=128|s[r>>2],s[33264]=m,e=1;break A}}}for(d=0;;){if(h=(f=h)+1|0,223&(f=c[0|f]))if(!d|(0|f)!=46|a[31+(d+u|0)|0]-48>>>0>=10){if(a[(u+32|0)+d|0]=f,f=159,(0|(d=d+1|0))!=159)continue}else f=d;else f=d;break}a[(d=u+32|0)+f|0]=0,d=Pe(e,d,h,n,r,i,l);e:if(8&c[r+3|0]){if(!Or(n,p=e+268|0)){if(p=s[e+288>>2]+1|0,s[e+288>>2]=p,(0|p)<4)break e;a[0|n]=0;break e}Ti(p,n,20),s[e+288>>2]=1}else s[e+288>>2]=0;e:{if(!d){if(d=0,8&c[r+5|0]&&(p=nn(u+28|0,d=u+32|c[u+32|0]==95),vt(e,s[u+28>>2],n),d=d+p|0),!(f>>>0<2|d)){if(a[0|n]=0,!(16&i&&c[0|(d=31+(f+u|0)|0)]==101)&&(!(4096&i)||c[0|(d=(f=(u+32|0)+f|0)-1|0)]!=c[f-2|0]))break e;a[0|d]=0,d=Pe(e,u+32|0,h,n,r,i,l)}if(!d)break e}if(m=s[r>>2],c[e+172|0]&&(m^=536870912,s[r>>2]=m),e=1,!(536870912&m))break A;2&i&&(o[66448]=8192,s[u+16>>2]=n,H(132898,87470,u+16|0),e=s[t>>2],s[t>>2]=132898,8&c[188788]&&(ut(t=u+32|0,r=e,e=d-e|0),a[e+t|0]=0,s[u+4>>2]=132898,e=s[47195],s[u>>2]=t,fi(e,87652,u)))}a[0|n]=0,e=0}return z=u+192|0,e}function rt(e,t){var n=0,r=0,i=0;n=31&e;A:{e:{g:{if((0|(e&=96))==96)e=-1;else{if((0|e)!=64)break g;e=1}if(n>>>0>=15)break A;t=s[203136+(n<<2)>>2]+v(e,t)|0;break e}if(n>>>0>=15)break A}e=s[(r=n<<2)+105616>>2],s[r+203136>>2]=(0|t)>=0?(0|e)>(0|t)?t:e:0}A:{e:{g:{r:{C:switch(n-1|0){case 5:if(!(e=s[50759]))break e;s[54728]=s[50982],t=s[50979],n=s[50978],Pt(205184,0,11e3),s[51293]=0,t=(n=(i=(0|(r=s[50789]))>0)?130:(0|n)>=5499?5499:n)?i?r:(0|t)>=100?100:t:0,s[50755]=t,n=(0|v(n,s[50754]))/1e3|0,s[51292]=n,s[54729]=(0|t)>20?n<<1:t?n:0,s[33037]=(0|v(500-t|0,(0|v(c[s[50797]+105596|0],(0|v(s[50787],55))/100|0))/16|0))/500;break r;case 0:break C;case 2:case 12:break A;case 4:break g;default:break e}if(!(e=s[50759]))break e}t=256,(0|(n=(0|(n=s[50785]))>=101?101:n))>=51&&(t=256+(((v(n,25)-1250&65535)>>>0)/50|0)|0),o[e+164>>1]=(0|v(o[e+236>>1],t))/256,o[e+166>>1]=(0|v(o[e+238>>1],t))/256,o[e+168>>1]=(0|v(o[e+240>>1],t))/256,o[e+170>>1]=(0|v(o[e+242>>1],t))/256,o[e+172>>1]=(0|v(o[e+244>>1],t))/256,o[e+174>>1]=(0|v(o[e+246>>1],t))/256,e=s[50790],o[102e3]=(0|v(o[102036],v(e,-3)+256|0))/256,o[101999]=(0|v(o[102035],v(e,-6)+256|0))/256;return}s[50759]&&(s[54728]=s[50982],e=s[50979],t=s[50978],Pt(205184,0,11e3),s[51293]=0,e=(t=(r=(0|(n=s[50789]))>0)?130:(0|t)>=5499?5499:t)?r?n:(0|e)>=100?100:e:0,s[50755]=e,t=(0|v(t,s[50754]))/1e3|0,s[51292]=t,s[54729]=(0|e)>20?t<<1:e?t:0,s[33037]=(0|v(500-e|0,(0|v(c[s[50797]+105596|0],(0|v(s[50787],55))/100|0))/16|0))/500)}return}s[33037]=(0|v(c[s[50797]+105596|0],(0|v(s[50787],55))/100|0))/16}function it(e,t,n){var r=0,i=0,o=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0;n&&(s[n>>2]=0);A:{e:if(!((0|(r=a[0|e]))<0)){for(;;){if((0|(o=255&r))==32|o-9>>>0<5){if((0|(r=a[0|(e=e+1|0)]))>=0)continue;break e}break}if(!(255&r))break A}for(;;){if((0|(r=d=255&r))==32|r-9>>>0<5)break A;if((0|d)!=124||(0|(r=c[0|(o=e+1|0)]))==124){e:{if((0|(m=s[36115]))>=2){for(r=1,o=-1,f=0;;){g:if(!(!(p=s[144464+(r<<2)>>2])|c[p+11|0]==15)){u=s[p>>2];r:{C:{if(d>>>0>=33){if(h=0,l=0,(255&u)==(0|d)&&(l=1,(i=c[e+1|0])>>>0<33|(0|i)!=(u>>>8&255)||(l=2,(i=c[e+2|0])>>>0<33|(0|i)!=(u>>>16&255)||(l=(i=(i=c[e+3|0])>>>0>32&(0|i)==(u>>>24|0))?4:3,h=0-i|0))),(0|o)>=(0|l))break g;if(i=4,!(1&h))break C;break r}if(l=0,(0|o)>=0)break g}if(u>>>((i=l)<<3)&255)break g}f=c[p+10|0],o=i}if((0|m)==(0|(r=r+1|0)))break}if(f)break e}n&&nn(n,e),a[0|t]=0;return}a[0|t]=f,e=((0|o)<=1?1:o)+e|0,t=o=t+1|0;e:if((0|f)==21){g:if((0|(i=c[0|e]))==32|i-9>>>0<5)r=o;else if(r=o,i)for(;;){if(a[0|r]=gr(i),r=r+1|0,(0|(i=c[0|(e=e+1|0)]))==32|i-9>>>0<5)break g;if(!i)break}if(a[0|r]=0,!i){if(t=r,Or(o,85593))break e;a[0|o]=0;return}a[0|r]=124,t=r+1|0}r=c[0|e]}else e=o;if(!(255&r))break}}a[0|t]=0}function at(e,t){var n=0,r=0,i=0,a=0,o=0;A:{e:{g:{r:{C:switch((0|(n=s[e+4>>2]))==s[e+104>>2]?n=Ot(e):(s[e+4>>2]=n+1,n=c[0|n]),n-43|0){case 0:case 2:break C;default:break r}if(a=(0|n)==45,o=!t,(0|(n=s[e+4>>2]))==s[e+104>>2]?n=Ot(e):(s[e+4>>2]=n+1,n=c[0|n]),o|(t=n-58|0)>>>0>4294967285)break g;if(s[e+116>>2]<0)break e;s[e+4>>2]=s[e+4>>2]-1;break e}t=n-58|0}if(!(t>>>0<4294967286)){if((t=n-48|0)>>>0<10){for(;i=(0|(r=(r=v(r,10)+n|0)-48|0))<214748364,(0|(t=s[e+4>>2]))==s[e+104>>2]?n=Ot(e):(s[e+4>>2]=t+1,n=c[0|t]),i&(t=n-48|0)>>>0<=9;);i=r>>31}g:if(!(t>>>0>=10))for(;;){if(t=(r=hr(r,i,10,0))+n|0,n=B,n=t>>>0>>0?n+1|0:n,r=t-48|0,i=n-(t>>>0<48)|0,(0|(t=s[e+4>>2]))==s[e+104>>2]?n=Ot(e):(s[e+4>>2]=t+1,n=c[0|t]),(t=n-48|0)>>>0>9)break g;if(!(r>>>0<2061584302&(0|i)<=21474836|(0|i)<21474836))break}if(t>>>0<10)for(;(0|(t=s[e+4>>2]))==s[e+104>>2]?t=Ot(e):(s[e+4>>2]=t+1,t=c[0|t]),t-48>>>0<10;);(0|(t=s[e+116>>2]))>0|(0|t)>=0&&(s[e+4>>2]=s[e+4>>2]-1),e=r,r=a?0-e|0:e,i=a?0-(!!(0|e)+i|0)|0:i;break A}}if(i=-2147483648,!(s[e+116>>2]<0))return s[e+4>>2]=s[e+4>>2]-1,B=-2147483648,0}return B=i,r}function ot(e){var t=0,n=0,r=0,i=0;if(s[36432]=110,s[36433]=100,s[36434]=450,s[36430]=5,t=s[203136+((0|e)==2?32:8)>>2],r=s[32972],(0|(n=s[r+84>>2]))>0&&(t=(0|v(t,n))/100|0),n=(0|t)>=359?359:t,n=(0|(t=(0|t)>=450?450:t))>399?6:(0|t)>379?7:c[((0|n)<=80?80:n)+101856|0],1&e&&(s[32526]=(0|v(n,s[r+72>>2]))/256,s[32527]=(0|v(n,s[r+76>>2]))/256,s[32528]=(0|v(n,s[r+80>>2]))/256,n>>>0>7||(i=n-1|0,s[32528]=i,s[32526]=n,s[32527]=i)),2&e){e=s[r+72>>2];A:{e:{g:{r:{C:{a:{I:{f:{if((0|t)>=351)r=t-350|0,s[36432]=85-(((255&r)>>>0)/3|0)&255,r=60-(r>>>3|0)|0;else{if((0|t)<251)break f;r=t-250|0,s[36432]=110-(r>>>2|0),r=110-(r>>>1|0)|0}if(s[36433]=r,e=(0|v(e,n))/256|0,s[36431]=110+((0|v(e,150))/128|0),t>>>0<=349)break I;if(n=t-350|0,s[36431]=c[n+102224|0],t>>>0<390)break C;if(s[36434]=450+((t+112<<24>>24)/-2<<24>>24),t>>>0<441)break a;s[36434]=860-t,e=12;break e}e=(0|v(e,n))/256|0,s[36431]=(0|t)>=170?110+((0|v(e,150))/128|0)|0:128+((e<<7)/130|0)|0}e=(e<<8)/115|0;break e}if(e=12,t>>>0>430)break e;if(e=13,t>>>0<=400)break r;break e}if(e=(e<<8)/115|0,s[36428]=e,t>>>0<375)break g}e=14;break e}if((0|t)<351)break A;e=c[n+102336|0]}s[36428]=e}s[36429]=(0|e)<=16?16:e}}function st(e,t,n){var r=.000244140625*s[50767],i,a,l;_[n>>3]=r,_[n+40>>3]=.015625*s[e+112>>2],_[n+48>>3]=.015625*s[e+276>>2],_[n+56>>3]=.00390625*(0|v(o[e+166>>1],o[t+4>>1]))+ +o[e+220>>1],_[n+64>>3]=.00390625*(0|v(o[e+168>>1],o[t+6>>1]))+ +o[e+222>>1],_[n+72>>3]=.00390625*(0|v(o[e+170>>1],o[t+8>>1]))+ +o[e+224>>1],_[n+80>>3]=.00390625*(0|v(o[e+172>>1],o[t+10>>1]))+ +o[e+226>>1],_[n+88>>3]=.00390625*(0|v(o[e+174>>1],o[t+12>>1]))+ +o[e+228>>1],i=o[e+230>>1],a=o[e+176>>1],l=o[t+14>>1],s[n+112>>2]=0,s[n+116>>2]=1080623104,s[n+104>>2]=0,s[n+108>>2]=1081032704,_[n+96>>3]=.00390625*(0|v(a,l))+ +(0|i),c[t+40|0]?(s[n+184>>2]=0,s[n+188>>2]=1072693248,_[n+104>>3]=c[t+40|0]<<1):(s[n+184>>2]=0,s[n+188>>2]=0),_[n+120>>3]=.00390625*o[e+202>>1]*(c[t+35|0]<<1),_[n+128>>3]=.00390625*o[e+204>>1]*(c[t+36|0]<<1),_[n+136>>3]=.00390625*o[e+206>>1]*(c[t+37|0]<<1),t=c[t+38|0],e=o[e+208>>1],s[n+176>>2]=0,s[n+180>>2]=1079574528,s[n+160>>2]=0,s[n+164>>2]=1083129856,s[n+152>>2]=0,s[n+156>>2]=1083129856,s[n+352>>2]=0,s[n+356>>2]=1072693248,s[n+168>>2]=0,s[n+172>>2]=1079574528,_[n+144>>3]=.00390625*(0|e)*(t<<1),e=s[50779],_[n+368>>3]=r,_[n+360>>3]=(0|e)/100*3}function ct(e){var t=0;le(e,an(e));A:{e:{g:{r:{C:{a:{I:{f:{i:{b:{if((0|(e=-1048576&B))<268435455|(0|e)<=268435455){s:{t:{if((0|e)<33554431|(0|e)<=33554431){if((0|e)<8388607|(0|e)<=8388607){if(t=524328,!0&(0|e)==-2147483648)break A;if(0|(0|e)!=-2143289344)break e;return 557096}if(!0&(0|e)==8388608)break t;if(0|(0|e)!=16777216)break e;return 524358}if((0|e)>71303167)break s;if(!0&(0|e)==33554432)break g;if(0|(0|e)!=67108864)break e}return 266270}if(!0&(0|e)==71303168)break b;if(!0&(0|e)==134217728)break r;if(0|(0|e)!=138412032)break e;return 294942}if((0|e)<542113791|(0|e)<=542113791){if((0|e)<536870911|(0|e)<=536870911){if(!0&(0|e)==268435456)break C;if(0|(0|e)!=272629760)break e;return 299028}if(!0&(0|e)==536870912)break I;if(!0&(0|e)==538968064)break a;if(0|(0|e)!=541065216)break e;return 569389}if((0|e)<1075838975|(0|e)<=1075838975){if(!0&(0|e)==542113792)break b;if(0|(0|e)!=1073741824)break e;return 532520}if(!0&(0|e)==1075838976)break f;if(!0&(0|e)==1077936128)break i;if(0|(0|e)!=1078984704)break e}return 299038}return 565288}return 1581096}return 536621}return 1585197}return 266260}return 262174}return 2396190}t=16384}return t}function lt(e,t,n,r,i,a){var o,l,u=0,d=0,f=0,p=0;if(l=8388607&e,d=s[34456],u=c[0|(e=l+d|0)]|c[e+1|0]<<8){o=!(f=c[e+2|0]),e=s[36434]<0?(0|v(n,i))/256|0:n,n=(0|v(i,s[36431]))/256|0,n=(0|e)<(0|(n=(4&r)>>>2|0&&(0|n)>(0|i)?i:n))?n:e,f||(u=u>>>1|0,n=(0|n)/2|0);A:if(!((0|a)<0)){if(r=l+4|0,256&t)e=s[50758],s[36439]=e,s[(t=216192+(e<<4)|0)>>2]=7,s[t+8>>2]=r+d,s[t+4>>2]=u<<16|n,a=f|a<<8;else{if(e=s[50758],s[36439]=e,s[(e=216192+(e<<4)|0)>>2]=6,a=f|a<<8,s[e+12>>2]=a,s[e+8>>2]=r+d,d=e,e=v(t=u>>>2|0,3),i=(0|n)>(0|u),s[d+4>>2]=i?e:n,d=s[50758]+1|0,s[50758]=(0|d)<=169?d:0,(0|e)<(0|(n=i?n-e|0:0)))for(i=t<<1,f=r+(f?t:i)|0;t=s[50758],s[36439]=t,s[(t=216192+(t<<4)|0)>>2]=6,s[t+4>>2]=i,s[t+12>>2]=a,s[t+8>>2]=f+s[34456],t=s[50758]+1|0,s[50758]=(0|t)<=169?t:0,(0|e)<(0|(n=n-i|0)););if((0|n)<=0)break A;e=s[50758],s[36439]=e,s[(t=216192+(e<<4)|0)>>2]=6,s[t+4>>2]=n,s[t+8>>2]=s[34456]+(r+(u-n<>2]=a,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0}}}function ut(e,t,n){var r,i=0,o=0;if(n>>>0>=512)return N(0|e,0|t,0|n),e;r=e+n|0;A:if(3&(e^t))if(r>>>0<4)n=e;else if((i=r-4|0)>>>0>>0)n=e;else for(n=e;a[0|n]=c[0|t],a[n+1|0]=c[t+1|0],a[n+2|0]=c[t+2|0],a[n+3|0]=c[t+3|0],t=t+4|0,i>>>0>=(n=n+4|0)>>>0;);else{e:if(3&e)if(n)for(n=e;;){if(a[0|n]=c[0|t],t=t+1|0,!(3&(n=n+1|0)))break e;if(!(n>>>0>>0))break}else n=e;else n=e;if(!((i=-4&r)>>>0<64||(o=i+-64|0)>>>0>>0))for(;s[n>>2]=s[t>>2],s[n+4>>2]=s[t+4>>2],s[n+8>>2]=s[t+8>>2],s[n+12>>2]=s[t+12>>2],s[n+16>>2]=s[t+16>>2],s[n+20>>2]=s[t+20>>2],s[n+24>>2]=s[t+24>>2],s[n+28>>2]=s[t+28>>2],s[n+32>>2]=s[t+32>>2],s[n+36>>2]=s[t+36>>2],s[n+40>>2]=s[t+40>>2],s[n+44>>2]=s[t+44>>2],s[n+48>>2]=s[t+48>>2],s[n+52>>2]=s[t+52>>2],s[n+56>>2]=s[t+56>>2],s[n+60>>2]=s[t+60>>2],t=t- -64|0,o>>>0>=(n=n- -64|0)>>>0;);if(n>>>0>=i>>>0)break A;for(;s[n>>2]=s[t>>2],t=t+4|0,i>>>0>(n=n+4|0)>>>0;);}if(n>>>0>>0)for(;a[0|n]=c[0|t],t=t+1|0,(0|r)!=(0|(n=n+1|0)););return e}function dt(e){var t=0,n=0,r=0,i=0,a=0,o=0,c=0,p=0;f(+e),t=0|l(1),l(0);A:{if((r=(t=t>>>20&2047)-969|0)>>>0<63)p=t;else{if((0|r)<0)return e+1;if(!(t>>>0<1033)){if(f(+e),r=0|l(1),n=0,!(0|l(0))&(0|r)==-1048576)break A;return t>>>0>=2047?e+1:(0|r)<0?(_[(t=z-16|0)+8>>3]=12882297539194267e-247,12882297539194267e-247*_[t+8>>3]):(_[(t=z-16|0)+8>>3]=3105036184601418e216,3105036184601418e216*_[t+8>>3])}}if(n=_[14409],a=(n=(e=(n=(i=_[14408]*e+n)-n)*_[14411]+(n*_[14410]+e))*e)*n*(e*_[14415]+_[14414]),n*=e*_[14413]+_[14412],f(+i),l(1),c=0|l(0),e=a+(n+(_[(r=c<<4&2032)+115376>>3]+e)),o=s[(r=r+115384|0)>>2],t=(c<<13)+(t=s[r+4>>2])|0,t=(r=(r=o)+(o=0)|0)>>>0>>0?t+1|0:t,!p)return-2147483648&c?(u(0,0|r),u(1,t+1071644672|0),(e=(i=(n=+d())*e)+n)<1&&(s[(t=z-16|0)+8>>2]=0,s[t+12>>2]=1048576,_[t+8>>3]=22250738585072014e-324*_[t+8>>3],e=(e=(a=e+1)+(i+(n-e)+(e+(1-a)))+-1)==0?0:e),e*=22250738585072014e-324):(u(0,0|r),u(1,t-1058013184|0),e=5486124068793689e288*((n=+d())*e+n)),e;u(0,0|r),u(1,0|t),n=(n=+d())*e+n}return n}function ft(e,t){var n,r=0,i=0,o=0,l=0;z=n=z-16|0;A:{if(xi(84270,a[0|t])){if(i=2,xi(t,43)||(i=c[0|t]!=114),i=xi(t,120)?128|i:i,o=i=xi(t,101)?524288|i:i,l=64|i,o=(0|(i=c[0|t]))==114?o:l,o=(0|i)==119?512|o:o,s[n>>2]=438,s[n+4>>2]=0,(e=0|O(-100,0|e,32768|((0|i)==97?1024|o:o),0|n))>>>0>=4294963201&&(s[56798]=0-e,e=-1),(0|e)<0)break A;z=i=z-32|0;e:{g:{if(xi(84270,a[0|t])){if(r=ve(1176))break g}else s[56798]=28;t=0;break e}Pt(r,0,144),xi(t,43)||(s[r>>2]=c[0|t]==114?8:4),c[0|t]==97?(1024&(t=0|D(0|e,3,0))||(t|=1024,s[i+16>>2]=t,s[i+20>>2]=t>>31,D(0|e,4,i+16|0)),t=128|s[r>>2],s[r>>2]=t):t=s[r>>2],s[r+80>>2]=-1,s[r+48>>2]=1024,s[r+60>>2]=e,s[r+44>>2]=r+152,8&t||(s[i>>2]=i+24,s[i+4>>2]=0,0|j(0|e,21523,0|i)||(s[r+80>>2]=10)),s[r+40>>2]=10,s[r+36>>2]=11,s[r+32>>2]=12,s[r+12>>2]=13,c[227205]||(s[r+76>>2]=-1),s[r+56>>2]=s[56816],(t=s[56816])&&(s[t+52>>2]=r),s[56816]=r,t=r}if(z=i+32|0,r=t)break A;T(0|e)}else s[56798]=28;r=0}return z=n+16|0,r}function pt(e,t,n){var r,i=0,a=0,o=0,c=0,l=0;if(o=e,z=r=z-208|0,s[r+8>>2]=1,s[r+12>>2]=0,c=t<<2){for(s[r+16>>2]=4,s[r+20>>2]=4,t=4,i=4,a=2;e=t,t=(i+4|0)+t|0,s[(r+16|0)+(a<<2)>>2]=t,a=a+1|0,i=e,t>>>0>>0;);if((e=(o+c|0)-4|0)>>>0<=o>>>0)a=0,t=1,e=0;else{for(a=1,t=1;3&~a?(g[(r+16|0)+((i=t-1|0)<<2)>>2]>=e-o>>>0?qt(o,n,r+8|0,t,0,r+16|0):Ln(o,n,t,r+16|0),(0|t)==1?(qr(r+8|0,1),t=0):(qr(r+8|0,i),t=1)):(Ln(o,n,t,r+16|0),Jr(r+8|0,2),t=t+2|0),a=1|(i=s[r+8>>2]),s[r+8>>2]=a,e>>>0>(o=o+4|0)>>>0;);a=i>>>0>1,e=s[r+12>>2]!=0}if(qt(o,n,r+8|0,t,0,r+16|0),a|(0|t)!=1|e)for(;(0|t)<=1?(Jr(i=r+8|0,e=Ir(i)),a=s[r+8>>2],e=e+t|0):(qr(i=r+8|0,2),s[r+8>>2]=7^s[r+8>>2],Jr(i,1),qt((l=o-4|0)-s[(c=r+16|0)+((e=t-2|0)<<2)>>2]|0,n,i,t-1|0,1,c),qr(i,1),a=1|s[r+8>>2],s[r+8>>2]=a,qt(l,n,i,e,1,c)),t=e,o=o-4|0,s[r+12>>2]|(0|t)!=1|(0|a)!=1;);}z=r+208|0}function mt(e,t,n,r){var i,a=0,o=0,c=0;z=i=z-32|0,c=a=2147483647&r,o=a-1006698496|0;A:if(0|(a=a-1140785152|0)>>>0>o>>>0){if(a=n<<4|t>>>28,n=r<<4|n>>>28,(0|(t&=268435455))==134217728&!!(0|e)|t>>>0>134217728){o=n+1073741824|0,o=(a=a+1|0)?o:o+1|0;break A}if(o=n+1073741824|0,e|(0|t)!=134217728)break A;o=(e=1&a)>>>0>(a=e+a|0)>>>0?o+1|0:o}else(!n&(0|c)==2147418112?!(e|t):c>>>0<2147418112)?(a=0,o=2146435072,c>>>0>1140785151||(o=0,(c=c>>>16|0)>>>0<15249||(rn(i+16|0,e,t,n,a=65535&r|65536,c-15233|0),Qt(i,e,t,n,a,15361-c|0),a=(t=s[i+8>>2])<<4,t=s[i+12>>2]<<4|t>>>28,n=s[i>>2],c=o=s[i+4>>2],a|=o>>>28,o=t,(0|(e=268435455&c))==134217728&!!(0|(t=n|!!(s[i+16>>2]|s[i+24>>2]|s[i+20>>2]|s[i+28>>2])))|e>>>0>134217728?o=(a=a+1|0)?o:o+1|0:t|(0|e)!=134217728||(o=(e=a)>>>0>(a=a+(1&a)|0)>>>0?o+1|0:o)))):(a=n<<4|t>>>28,o=524287&(e=r<<4|n>>>28)|2146959360);return z=i+32|0,u(0,0|a),u(1,-2147483648&r|o),+d()}function ht(e){var t,n=0,r=0,i=0,a=0,o=0;if(f(+e),o=0|l(1),i=0|l(0),(0|(a=o>>>20&2047))==2047)return(e*=1)/e;if(!(r=i<<1)&(0|(n=o<<1|i>>>31))==2145386496|n>>>0<2145386496)return!r&(0|n)==2145386496?0*e:e;if(a)n=1048575&o|1048576;else{if(a=0,r=i<<12,(0|(n=o<<12|i>>>20))>0|(0|n)>=0)for(;a=a-1|0,n=n<<1|r>>>31,r<<=1,(0|n)>0|(0|n)>=0;);r=31&(n=1-a|0),(63&n)>>>0>=32?(n=i<>>32-r|o<1023){for(;;){if(!((0|(i=n+-1048576|0))<0||(n=i)|r))return 0*e;if(n=n<<1|r>>>31,r<<=1,!((0|(a=a-1|0))>1023))break}a=1023}if(!((0|(i=n+-1048576|0))<0||(n=i)|r))return 0*e;if((0|n)==1048575|n>>>0<1048575)for(;a=a-1|0,i=n>>>0<524288,n=n<<1|r>>>31,r<<=1,i;);return t=-2147483648&o,(0|a)>0?n=n+-1048576|a<<20:(i=1-a|0,o=n,a=r,r=31&i,(63&i)>>>0>=32?(n=0,r=o>>>r|0):(n=o>>>r|0,r=((1<>>r)),u(0,0|r),u(1,n|t),+d()}function gt(e,t,n,r,i){var o,l=0,u=0;z=o=z-160|0;A:{e:{g:{r:switch((l=c[t+10|0])-15|0){case 6:break g;case 0:break r;default:break e}a[0|e]=0;break A}s[o>>2]=v(c[n+7|0],44)+137856,H(e,86002,o),e=U(e)+e|0;break A}if(r){if(a[o+140|0]=0,n?xe(0,0,n,o+8|0,0):lr(l,o+8|0),n=o+140|0,l=c[o+140|0]){if((0|l)==32){a[0|e]=0;break A}224&(l=l<<24>>24)||(i&&(s[i>>2]=l),n=o+141|0)}if(!((0|(i=U(n)))<=0)){e=gn(e,n)+i|0,a[0|e]=0;break A}}i=0;e:if(!(!(n=255&(l=s[t>>2]))|(0|n)==47)){if(r){if((0|(u=255&l))==95)break e;g:{r:{if((0|u)==35){if(u=3,c[t+11|0]!=2)break r;break e}if((u=n-32|0)>>>0>95)break g}n=h[93952+(u<<1)>>1]}i=qn(n,e)}else a[0|e]=l,i=1;for(;;){if(!(n=255&(l>>=8))|(0|n)==47)break e;if(r){if((0|n)==35&c[t+11|0]==2)break e;if(n-48>>>0<10)continue;(u=n-32|0)>>>0<=95&&(n=h[93952+(u<<1)>>1]),i=qn(n,e+i|0)+i|0}else a[e+i|0]=l,i=i+1|0}}a[0|(e=e+i|0)]=0}return z=o+160|0,e}function _t(e){var t,n=0;t=e,n=131280;A:{e:{if(!((0|e)<=1023||(n=131300,e>>>0<1328||(n=131320,e>>>0<1424||(n=131340,e>>>0<1536||(n=131360,e>>>0<1792||(n=131380,e>>>0<1872||(n=131400,e>>>0<2432||(n=131420,e>>>0<2560||(n=131440,e>>>0<2688||(n=131460,e>>>0<2816||(n=131480,e>>>0<2944||(n=131500,e>>>0<3072||(n=131520,e>>>0<3200||(n=131540,e>>>0<3328||(n=131560,e>>>0<3456||(n=131580,e>>>0<3584||(n=131600,e>>>0<3712||(n=131620,e>>>0<3840||(n=131640,e>>>0<4096||(n=131660,e>>>0<4256||(n=131680,e>>>0<4352||(n=131700,e>>>0<4608||(n=131720,e>>>0<5024||(n=131740,e>>>0<10496||(n=131760,e>>>0<12544||(n=131780,e>>>0<40960))))))))))))))))))))))))))){if(e>>>0>=55296)break e;n=131800}if((0|t)>=h[(e=n)+8>>1])break A}e=0}return e}function vt(e,t,n){var r,i=0,c=0,l=0,u=0;z=r=z-208|0,a[r+80|0]=0;A:{if((i=t-224|0)>>>0<=158)t=101072+(i<<1)|0;else{if((t=t-592|0)>>>0>88)break A;t=101392+(t<<1)|0}if(t=h[t>>1]){if(l=t<<16>>16,u=(i=63&t)>>>0>37?i+59|0:o[101584+(i<<1)>>1],i=t>>>6|0,(0|l)<0)i=59+(63&i)|0,t=t>>>12&7;else{if(!(c=31&i))break A;i=0,t=t>>>11&15}(c=zn(e,s[129920+(c<<3)>>2],r+112|0))&&pr(e,u,r+176|0)&&(t&&4096&zn(e,s[129920+(t<<3)>>2],r+80|0)&&(n=U(t=gn(n,r+80|0)),a[r+80|0]=0,n=t+n|0),i?(pr(t=e,i,e=r+144|0),s[r+68>>2]=r+80,s[r- -64>>2]=e,s[r+60>>2]=6,s[r+52>>2]=23,s[r+56>>2]=r+176,s[r+48>>2]=r+112,H(n,84101,r+48|0)):(0|l)<0?gn(n,r+176|0):1&s[e+144>>2]|4096&c?(s[r+36>>2]=23,s[r+40>>2]=6,s[r+44>>2]=r+176,s[r+32>>2]=r+112,H(n,84430,r+32|0)):(s[r+16>>2]=23,s[r+8>>2]=23,s[r>>2]=4,s[r+12>>2]=r+112,s[r+4>>2]=r+176,H(n,84802,r)))}}z=r+208|0}function yt(){zr(),s[55928]=0,s[55926]=0,s[55927]=0,s[55924]=0,s[56244]=0,s[56245]=0,s[56246]=0,s[56247]=0,s[56260]=0,s[56261]=0,s[56262]=0,s[56263]=0,s[56276]=0,s[56277]=0,s[56278]=0,s[56279]=0,s[55974]=0,s[55975]=0,s[55972]=0,s[55973]=0,s[55988]=0,s[55989]=0,s[55990]=0,s[55991]=0,s[56004]=0,s[56005]=0,s[56006]=0,s[56007]=0,s[56020]=0,s[56021]=0,s[56022]=0,s[56023]=0,s[56036]=0,s[56037]=0,s[56038]=0,s[56039]=0,s[56052]=0,s[56053]=0,s[56054]=0,s[56055]=0,s[56068]=0,s[56069]=0,s[56070]=0,s[56071]=0,s[56086]=0,s[56087]=0,s[56084]=0,s[56085]=0,s[56102]=0,s[56103]=0,s[56100]=0,s[56101]=0,s[56118]=0,s[56119]=0,s[56116]=0,s[56117]=0,s[56134]=0,s[56135]=0,s[56132]=0,s[56133]=0,s[56150]=0,s[56151]=0,s[56148]=0,s[56149]=0,s[56166]=0,s[56167]=0,s[56164]=0,s[56165]=0,s[56182]=0,s[56183]=0,s[56180]=0,s[56181]=0,s[56198]=0,s[56199]=0,s[56196]=0,s[56197]=0,s[56214]=0,s[56215]=0,s[56212]=0,s[56213]=0,s[56230]=0,s[56231]=0,s[56228]=0,s[56229]=0}function bt(e,t){var n=0,r=0,i=0,a=0,o=0,c=0,l=0,u=0,d=0,f=0;A:{if((0|(a=s[e+4>>2]))==s[e>>2])if((o=s[e+8>>2])>>>0<(n=s[e+12>>2])>>>0)n=(i=(1+(n-o>>2)|0)/2<<2)+o|0,(0|a)!=(0|o)&&(kt(n=n-(r=o-a|0)|0,a,r),a=s[e+8>>2]),s[e+4>>2]=n,s[e+8>>2]=i+a;else{if((r=(0|n)==(0|a)?1:n-a>>1)>>>0>=1073741824)break A;if(d=(l=Yr(n=r<<2))+n|0,c=n=(r+3&-4)+l|0,(0|a)!=(0|o)){if(f=-4&(o=o-a|0),i=n,r=a,o=1+((u=o-4|0)>>>2|0)&7)for(c=0;s[i>>2]=s[r>>2],r=r+4|0,i=i+4|0,(0|o)!=(0|(c=c+1|0)););if(c=n+f|0,!(u>>>0<28))for(;s[i>>2]=s[r>>2],s[i+4>>2]=s[r+4>>2],s[i+8>>2]=s[r+8>>2],s[i+12>>2]=s[r+12>>2],s[i+16>>2]=s[r+16>>2],s[i+20>>2]=s[r+20>>2],s[i+24>>2]=s[r+24>>2],s[i+28>>2]=s[r+28>>2],r=r+32|0,(0|c)!=(0|(i=i+32|0)););}s[e+12>>2]=d,s[e+8>>2]=c,s[e+4>>2]=n,s[e>>2]=l,a&&(Re(a),n=s[e+4>>2])}else n=a;s[n-4>>2]=s[t>>2],s[e+4>>2]=s[e+4>>2]-4;return}ei(),p()}function xt(e,t,n){var r=0,i=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0;A:{e:{g:{r:{C:{a:{I:{f:{i:{if(t){if(!n)break i;break f}return oe=(t=e)-v(e=(e>>>0)/(n>>>0)|0,n)|0,se=0,B=0,e}if(!e)break I;break a}if(!((r=n-1|0)&n))break C;a=0-(o=(x(n)+33|0)-x(t)|0)|0;break g}return oe=0,se=t-v(e=(t>>>0)/0|0,0)|0,B=0,e}if((r=32-x(t)|0)>>>0<31)break r;break e}if(oe=e&r,se=0,(0|n)==1)break A;return n=31&(r=Ci(n)),(63&r)>>>0>=32?e=t>>>n|0:(i=t>>>n|0,e=((1<>>n),B=i,e}o=r+1|0,a=63-r|0}if(r=31&(i=63&o),i>>>0>=32?(i=0,s=t>>>r|0):(i=t>>>r|0,s=((1<>>r),r=31&(a&=63),a>>>0>=32?(t=e<>>32-r|t<>>31,s=(i=s<<1|t>>>31)-(l=n&(a=u-(c+(i>>>0>r>>>0)|0)>>31))|0,i=c-(i>>>0>>0)|0,t=t<<1|e>>>31,e=d|e<<1,d=c=1&a,o=o-1|0;);return oe=s,se=i,B=t<<1|e>>>31,c|e<<1}oe=e,se=t,e=0,t=0}return B=t,e}function St(e,t){var n=0,r=0,i=0,a=0,o=0,c=0,l=0,u=0,d=0,f=0;A:{if((0|(n=s[e+8>>2]))==s[e+12>>2])if((r=s[e+4>>2])>>>0>(o=s[e>>2])>>>0)i=kt((a=(1+(r-o>>2)|0)/-2<<2)+r|0,r,n=n-r|0)+n|0,s[e+8>>2]=i,s[e+4>>2]=a+s[e+4>>2];else{if((a=(0|n)==(0|o)?1:n-o>>1)>>>0>=1073741824)break A;if(d=(c=Yr(i=a<<2))+i|0,i=a=(-4&a)+c|0,(0|n)!=(0|r)){if(f=-4&(n=n-r|0),u=1+((l=n-4|0)>>>2|0)&7)for(i=0,n=a;s[n>>2]=s[r>>2],r=r+4|0,n=n+4|0,(0|u)!=(0|(i=i+1|0)););else n=a;if(i=a+f|0,!(l>>>0<28))for(;s[n>>2]=s[r>>2],s[n+4>>2]=s[r+4>>2],s[n+8>>2]=s[r+8>>2],s[n+12>>2]=s[r+12>>2],s[n+16>>2]=s[r+16>>2],s[n+20>>2]=s[r+20>>2],s[n+24>>2]=s[r+24>>2],s[n+28>>2]=s[r+28>>2],r=r+32|0,(0|i)!=(0|(n=n+32|0)););}s[e+12>>2]=d,s[e+8>>2]=i,s[e+4>>2]=a,s[e>>2]=c,o&&(Re(o),i=s[e+8>>2])}else i=n;s[i>>2]=s[t>>2],s[e+8>>2]=s[e+8>>2]+4;return}ei(),p()}function Ct(e,t){var n,r=0,i=0,o=0,l=0,u=0;i=189088,z=n=z-320|0,s[n+312>>2]=0,o=Ye(e,l=gn(n+112|0,189088),n,n+316|0,n+312|0,0),r=s[n+316>>2];A:if((0|t)<=3){if((0|r)<2)break A;if(o=3&(t=r-1|0),e=1,r-2>>>0>=3)for(u=-4&t,t=0;a[0|(r=e+n|0)]>=4&&(a[0|r]=3),a[(r=e+n|0)+1|0]>=4&&(a[r+1|0]=3),a[r+2|0]>=4&&(a[r+2|0]=3),a[r+3|0]>=4&&(a[r+3|0]=3),e=e+4|0,(0|u)!=(0|(t=t+4|0)););if(!o)break A;for(t=0;a[0|(r=e+n|0)]>=4&&(a[0|r]=3),e=e+1|0,(0|o)!=(0|(t=t+1|0)););}else if(e=1,!((0|r)<=1)){for(;;){if((0|o)>a[0|(u=e+n|0)]){if((0|r)!=(0|(e=e+1|0)))continue;break A}break}a[0|u]=t}if(e=c[0|l])for(t=1;r=s[144464+((255&e)<<2)>>2],c[r+11|0]!=2|16&c[r+6|0]||(o=255&(r=a[t+n|0]),(0|r)<2&&o||(a[0|i]=c[o+94151|0],i=i+1|0,e=c[0|l]),t=t+1|0),a[0|i]=e,i=i+1|0,e=c[0|(l=l+1|0)];);a[0|i]=0,z=n+320|0}function wt(e){var t=0,n=0,r=0,i=0,a=0,o=0;n=t=s[(e|=0)>>2],s[e>>2]=t+1;A:{e:{g:{r:{C:{a:{I:switch(((a=c[0|t])>>>4|0)-8|0){case 0:case 1:case 2:case 3:break e;case 7:break C;case 6:break a;case 4:case 5:break I;default:break A}if((r=t+2|0)>>>0>=(i=s[e+4>>2])>>>0)break r;if(s[e>>2]=r,(192&(n=c[n+1|0]))!=128)break g;return 63&n|a<<6&1984}if((r=t+3|0)>>>0>=(i=s[e+4>>2])>>>0)break r;if(n=t+2|0,s[e>>2]=n,(192&(t=c[t+1|0]))!=128){r=n;break g}if(s[e>>2]=r,(192&(n=c[0|n]))!=128)break g;return 63&n|(63&t|a<<6&960)<<6}if(!((i=s[e+4>>2])>>>0<=(n=t+4|0)>>>0)){if(r=t+2|0,s[e>>2]=r,(192&(i=c[t+1|0]))!=128||(r=t+3|0,s[e>>2]=r,(192&(o=c[t+2|0]))!=128)||(s[e>>2]=n,t=c[0|r],r=n,(192&t)!=128))break g;return 0|((e=63&t|o<<6&4032|(63&i|a<<6&960)<<12)>>>0>=1114112?65533:e)}}s[e>>2]=i;break e}s[e>>2]=r-1}a=65533}return 0|a}function Tt(e,t,n,r){var i,l,u=0,d=0,f=0,p=0,m=0,h=0;if(z=i=z-432|0,!(!r|!(536870912&(l=V(e,t,n,r))))&&(o[i+48>>1]=8192,r=gn(i+48|2,r),c[0|r])){for(f=i+224|0,u=1,p=200;;){if(nn(i+44|0,r),t=Cr(s[i+44>>2]),d=s[n>>2],t?(s[n>>2]=2|d,qn(gr(s[i+44>>2]),r)):s[n>>2]=-3&d,h=s[33264],V(e,r,n,0),1&u?(s[i+16>>2]=189088,d=jn(f,p,84130,i+16|0)):(s[i+32>>2]=15,s[i+36>>2]=189088,d=jn(f,p,84434,i+32|0)),u=(t=s[33264])+1|0,s[33264]=u,t>>>0<=2147483646){for(;;)if(t=r,r=r+1|0,(0|(m=a[0|t]))==32|m-9>>>0<5){for(;t=(r=t)+1|0,(0|(m=a[0|r]))==32|m-9>>>0<5;);if(u=u-1|0,s[33264]=u,!((0|u)>0))break}}if(f=f+d|0,s[33264]=h,!(c[0|r]&&(u=0,(0|(p=p-d|0))>1)))break}(i+224|0)!=(0|f)&&(s[i>>2]=i+224,jn(189088,200,84130,i))}return z=i+432|0,l}function Et(e,t,n,r,i,l,u,d){var f=s[32972],p=s[f+116>>2];o[e+8>>1]=h[e+8>>1]+l,l=32&d?0-l|0:l,o[e+10>>1]=l+h[e+10>>1],o[e+12>>1]=l+h[e+12>>1],r=(0|r)>(0|(l=((l=(0|v(t,p))/256|0)-(t=o[e+6>>1])|0)/2|0))?l:r,o[e+6>>1]=((0|n)<(0|r)?r:n)+t;A:{e:switch(i-1|0){case 0:t=(0|(t=235-(n=o[e+4>>1])|0))<=-100?-100:t,o[e+4>>1]=((0|t)>=-60?-60:t)+n;break A;case 1:t=(0|(t=(0|(t=235-(n=o[e+4>>1])|0))<=-300?-300:t))>=-150?-150:t,o[e+4>>1]=t+n,o[e+2>>1]=t+h[e+2>>1];break A;case 2:break e;default:break A}t=(0|(t=(0|(t=100-(n=o[e+4>>1])|0))<=-400?-400:t))>-300?-400:t,o[e+4>>1]=t+n,o[e+2>>1]=t+h[e+2>>1]}s[f+132>>2]||(a[e+20|0]=(v(c[e+20|0],u)>>>0)/100,a[e+21|0]=(v(c[e+21|0],u)>>>0)/100,a[e+22|0]=(v(c[e+22|0],u)>>>0)/100,a[e+23|0]=(v(c[e+23|0],u)>>>0)/100,a[e+24|0]=(v(c[e+24|0],u)>>>0)/100,a[e+25|0]=(v(c[e+25|0],u)>>>0)/100)}function Dt(e){var t,n=0,r=0,i=0,o=0;z=t=z-48|0;A:{if(e){c[0|e]||(e=Wn(84285),c[0|e]&&e||(e=Wn(121696),c[0|e]&&e||(e=Wn(84614),c[0|e]&&e||(e=84891))));e:{for(;;){if(!(!(r=c[e+n|0])|(0|r)==47)){if(i=23,(0|(n=n+1|0))!=23)continue;break e}break}i=n}r=84891;e:{g:{if(n=c[0|e],(c[e+i|0]|(0|n)==46||(r=e,(0|n)==67))&&!c[r+1|0]||!Or(r,84891)||!Or(r,85136)){if(n=121652,c[r+1|0]==46)break g;e=0;break e}if(n=s[56851])for(;;){if(!Or(r,n+8|0))break g;if(!(n=s[n+32>>2]))break}(e=ve(36))&&(n=s[30414],s[e>>2]=s[30413],s[e+4>>2]=n,ut(n=e+8|0,r,i),a[n+i|0]=0,s[e+32>>2]=s[56851],s[56851]=e),n=e||121652}e=n}if((0|e)==-1)break A;s[56809]=e}else e=s[56809];o=e?e+8|0:84309}return z=t+48|0,o}function Ot(e){var t=0,n=0,r=0,i=0,o=0,c=0,l=0,u=0,d=0;u=!!((t=s[e+112>>2])|(r=s[e+116>>2])),i=t,c=t=(o=s[e+4>>2])-(l=s[e+44>>2])|0,n=t+s[e+120>>2]|0,t=s[e+124>>2]+(t>>31)|0;A:{if(!(((0|(t=n>>>0>>0?t+1|0:t))>=(0|r)&n>>>0>=i>>>0|(0|t)>(0|r))&u)){if((0|(u=Wr(e)))>=0)break A;o=s[e+4>>2],l=s[e+44>>2]}return s[e+112>>2]=-1,s[e+116>>2]=-1,s[e+104>>2]=o,r=(c=n)+(n=l-o|0)|0,t=(n>>31)+t|0,s[e+120>>2]=r,s[e+124>>2]=n>>>0>r>>>0?t+1|0:t,-1}return t=(r=n+1|0)?t:t+1|0,o=s[e+4>>2],l=s[e+8>>2],c=i=s[e+116>>2],i|(n=s[e+112>>2])&&(i=n-r|0,(0|(n=c-(t+(n>>>0>>0)|0)|0))>=(0|(c=(d=l-o|0)>>31))&i>>>0>=d>>>0|(0|n)>(0|c)||(l=i+o|0)),s[e+104>>2]=l,r=(i=(n=s[e+44>>2])-o|0)+r|0,t=(i>>31)+t|0,s[e+120>>2]=r,s[e+124>>2]=r>>>0>>0?t+1|0:t,n>>>0>=o>>>0&&(a[o-1|0]=u),u}function kt(e,t,n){var r=0,i=0;A:if((0|e)!=(0|t)){if(t-(i=e+n|0)>>>0<=0-(n<<1)>>>0)return ut(e,t,n);if(r=3&(e^t),e>>>0>>0){if(r)r=e;else{if(3&e)for(r=e;;){if(!n)break A;if(a[0|r]=c[0|t],t=t+1|0,n=n-1|0,!(3&(r=r+1|0)))break}else r=e;if(!(n>>>0<=3))for(;s[r>>2]=s[t>>2],t=t+4|0,r=r+4|0,(n=n-4|0)>>>0>3;);}if(n)for(;a[0|r]=c[0|t],r=r+1|0,t=t+1|0,n=n-1|0;);}else{if(!r){if(3&i)for(;;){if(!n)break A;if(a[0|(r=(n=n-1|0)+e|0)]=c[t+n|0],!(3&r))break}if(!(n>>>0<=3))for(;s[(n=n-4|0)+e>>2]=s[t+n>>2],n>>>0>3;);}if(!n)break A;for(;a[(n=n-1|0)+e|0]=c[t+n|0],n;);}}return e}function At(e,t,n,r){A:switch(t-9|0){case 0:t=s[n>>2],s[n>>2]=t+4,s[e>>2]=s[t>>2];return;case 6:t=s[n>>2],s[n>>2]=t+4,t=o[t>>1],s[e>>2]=t,s[e+4>>2]=t>>31;return;case 7:t=s[n>>2],s[n>>2]=t+4,s[e>>2]=h[t>>1],s[e+4>>2]=0;return;case 8:t=s[n>>2],s[n>>2]=t+4,t=a[0|t],s[e>>2]=t,s[e+4>>2]=t>>31;return;case 9:t=s[n>>2],s[n>>2]=t+4,s[e>>2]=c[0|t],s[e+4>>2]=0;return;case 16:t=s[n>>2]+7&-8,s[n>>2]=t+8,_[e>>3]=_[t>>3];return;case 17:Ui[0|r](e,n);default:return;case 1:case 4:case 14:t=s[n>>2],s[n>>2]=t+4,t=s[t>>2],s[e>>2]=t,s[e+4>>2]=t>>31;return;case 2:case 5:case 11:case 15:t=s[n>>2],s[n>>2]=t+4,s[e>>2]=s[t>>2],s[e+4>>2]=0;return;case 3:case 10:case 12:case 13:break A}t=s[n>>2]+7&-8,s[n>>2]=t+8,n=s[t+4>>2],s[e>>2]=s[t>>2],s[e+4>>2]=n}function jt(e,t,n,r,i,a){var o;z=o=z-80|0;A:if((0|a)>=16384){if(ke(o+32|0,t,n,r,i,0,0,0,2147352576),r=s[o+40>>2],i=s[o+44>>2],t=s[o+32>>2],n=s[o+36>>2],a>>>0<32767){a=a-16383|0;break A}ke(o+16|0,t,n,r,i,0,0,0,2147352576),a=((0|a)>=49149?49149:a)-32766|0,r=s[o+24>>2],i=s[o+28>>2],t=s[o+16>>2],n=s[o+20>>2]}else(0|a)>-16383||(ke(o- -64|0,t,n,r,i,0,0,0,7471104),r=s[o+72>>2],i=s[o+76>>2],t=s[o+64>>2],n=s[o+68>>2],a>>>0>4294934644?a=a+16269|0:(ke(o+48|0,t,n,r,i,0,0,0,7471104),a=((0|a)<=-48920?-48920:a)+32538|0,r=s[o+56>>2],i=s[o+60>>2],t=s[o+48>>2],n=s[o+52>>2]));ke(o,t,n,r,i,0,0,0,a+16383<<16),t=s[o+12>>2],s[e+8>>2]=s[o+8>>2],s[e+12>>2]=t,t=s[o+4>>2],s[e>>2]=s[o>>2],s[e+4>>2]=t,z=o+80|0}function Mt(e,t){var n,r,i=0;z=n=z+-64|0,i=s[e>>2],r=s[i-4>>2],i=s[i-8>>2],s[n+32>>2]=0,s[n+36>>2]=0,s[n+40>>2]=0,s[n+44>>2]=0,s[n+48>>2]=0,s[n+52>>2]=0,a[n+55|0]=0,a[n+56|0]=0,a[n+57|0]=0,a[n+58|0]=0,a[n+59|0]=0,a[n+60|0]=0,a[n+61|0]=0,a[n+62|0]=0,s[n+24>>2]=0,s[n+28>>2]=0,s[n+20>>2]=0,s[n+16>>2]=125084,s[n+12>>2]=e,s[n+8>>2]=t,e=e+i|0,i=0;A:if(Qr(r,t,0))s[n+56>>2]=1,Ui[s[s[r>>2]+20>>2]](r,n+8|0,e,e,1,0),i=s[n+32>>2]==1?e:0;else{Ui[s[s[r>>2]+24>>2]](r,n+8|0,e,1,0);e:switch(s[n+44>>2]){case 0:i=s[n+48>>2]==1&&s[n+36>>2]==1&&s[n+40>>2]==1?s[n+28>>2]:0;break A;case 1:break e;default:break A}s[n+32>>2]!=1&&s[n+48>>2]|s[n+36>>2]!=1|s[n+40>>2]!=1||(i=s[n+24>>2])}return z=n- -64|0,i}function Nt(e,t,n,r,i){var l,u,d=0;z=l=z-80|0,o[l+72>>1]=0,s[l+64>>2]=0,s[l+68>>2]=0,a[0|r]=0,d=qn(t,u=2|(d=l- -64|0))+d|0,a[d+2|0]=32;A:if((0|n)!=-1)t>>>0>=33&&!fr(t)?(a[d+3|0]=(0|n)==32?32:31,a[l+65|0]=95,zn(e,l- -64|1,l+16|0)||(a[l+65|0]=32,zn(e,u,l+16|0)||Ae(e,u,l+16|0,40,0,268435456,0)),c[l+16|0]||vt(e,t,l+16|0),t=gn(r,l+16|0),!(n=c[0|t])|(0|n)==21||(s[l+56>>2]=0,s[l+60>>2]=0,ye(e,t,l+56|0,-1,1&i))):(s[l>>2]=t,H(t=l- -64|1,85485,l),zn(e,t,r));else{if(zn(e,u,r)||(a[l+65|0]=95,zn(e,l- -64|1,l+16|0)|s[e+212>>2]==25966))break A;Ei(85055),zn(s[47194],u,l+16|0)&&(a[0|r]=21,a[r+1|0]=0),ci(s[s[32972]+60>>2])}z=l+80|0}function Pt(e,t,n){var r=0,i=0,o=0,c=0;if(n&&(a[0|e]=t,a[(r=e+n|0)-1|0]=t,!(n>>>0<3||(a[e+2|0]=t,a[e+1|0]=t,a[r-3|0]=t,a[r-2|0]=t,n>>>0<7||(a[e+3|0]=t,a[r-4|0]=t,n>>>0<9||(i=(r=0-e&3)+e|0,t=v(255&t,16843009),s[i>>2]=t,s[(n=(r=n-r&-4)+i|0)-4>>2]=t,r>>>0<9||(s[i+8>>2]=t,s[i+4>>2]=t,s[n-8>>2]=t,s[n-12>>2]=t,r>>>0<25||(s[i+24>>2]=t,s[i+20>>2]=t,s[i+16>>2]=t,s[i+12>>2]=t,s[n-16>>2]=t,s[n-20>>2]=t,s[n-24>>2]=t,s[n-28>>2]=t,(n=r-(c=4&i|24)|0)>>>0<32))))))))for(r=hr(t,0,1,1),o=B,t=i+c|0;s[t+24>>2]=r,s[t+28>>2]=o,s[t+16>>2]=r,s[t+20>>2]=o,s[t+8>>2]=r,s[t+12>>2]=o,s[t>>2]=r,s[t+4>>2]=o,t=t+32|0,(n=n-32|0)>>>0>31;);return e}function Ft(){var e,t=0,n=0,r=0,i=0,a=0;if(z=e=z-208|0,(0|(r=s[50303]))>0)for(;(i=s[(n=201216+(t<<2)|0)>>2])&&(Re(i),s[n>>2]=0),(0|r)!=(0|(t=t+1|0)););if(s[50303]=0,s[e+16>>2]=137584,s[e+20>>2]=47,H(t=e+32|0,87827,e+16|0),qe(t,U(t)+1|0,0),s[e+4>>2]=47,s[e>>2]=137584,H(t,87933,e),qe(t,U(t)+1|0,1),t=s[50303],s[(n=t<<2)+201216>>2]=0,n=Xe(r=s[50741],n+4|0)){if(s[50741]=n,pt(201216,t,7),r=s[50741],n=0,t=s[50304])for(i=0;a=s[t+4>>2],c[0|a]&&Or(a+1|0,86589)&&Hn(s[t+8>>2],88032,3)&&(s[(n<<2)+r>>2]=t,n=n+1|0),t=s[201216+((i=i+1|0)<<2)>>2];);s[(n<<2)+r>>2]=0}return z=e+208|0,r}function It(e,t,n){var r=0,i=0,o=0,l=0;if(o=t-1|0,(0|t)>=2){t=e;A:{for(;;){e:{g:{if((0|(r=s[n+4>>2]))!=(0|(i=s[n+8>>2]))){if((l=un(r,10,i-r|0))?i=1+(l-(r=s[n+4>>2])|0)|0:(r=s[n+4>>2],i=s[n+8>>2]-r|0),ut(t,r,r=i>>>0>>0?i:o),i=r+s[n+4>>2]|0,s[n+4>>2]=i,t=t+r|0,l||!(o=o-r|0))break e;if((0|i)!=s[n+8>>2]){s[n+4>>2]=i+1,r=c[0|i];break g}}if(!((0|(r=Wr(n)))>=0)){if(r=0,(0|e)==(0|t))break A;if(16&c[0|n])break e;break A}}if(a[0|t]=r,t=t+1|0,(255&r)!=10&&(o=o-1|0))continue}break}e?(a[0|t]=0,r=e):r=0}}else if(t=s[n+72>>2],s[n+72>>2]=t-1|t,!o)return a[0|e]=0,e;return r}function Lt(e){var t=0,n=0,r=0,i=0,a=0,o=0,l=0,u=0;if(t=v(e,44),(0|(e=s[t+137896>>2]))>0&&Lt(e-1|0),e=s[36115],!((0|(t=s[(n=t+137856|0)+36>>2]))<=0)){if(i=s[n+32>>2],l=1&t,(0|t)!=1)for(u=-2&t,n=0;t=c[(a=(r=n<<4)+i|0)+10|0],s[144464+(t<<2)>>2]=a,(0|e)>=(0|t)?t=e:Pt(144464+((e=e+1|0)<<2)|0,0,t-e<<2),e=c[(r=(16|r)+i|0)+10|0],s[144464+(e<<2)>>2]=r,(0|e)<=(0|t)?e=t:Pt(144464+((t=t+1|0)<<2)|0,0,e-t<<2),n=n+2|0,(0|u)!=(0|(o=o+2|0)););else n=0;l&&(t=c[(n=(n<<4)+i|0)+10|0],s[144464+(t<<2)>>2]=n,(0|e)>=(0|t)||(Pt(144464+((e=e+1|0)<<2)|0,0,t-e<<2),e=t))}s[36115]=e}function Rt(e,t,n,r,i){var o,l=0,u=0,d=0;z=o=z-16|0;A:if(1&a[e+106|0]&&(l=c[0|n],!(!(1&a[r+2|0])&(0|l)!=46||256&(d=s[r+12>>2])|!(!(2&d)||i)||(nn(o+12|0,(0|l)==46?n+2|0:n),!(l=c[0|n])|!c[n+1|0])))){if(!(!(d=s[o+12>>2])|2&c[r+2|0])){if(!En(d))break A;l=c[0|n]}(0|l)==46&&(a[0|n]=32),u=2,s[e+212>>2]!=26741|i||(n=En(s[o+12>>2])?Tt(e,n+2|0,0,0):0,128&c[e+8233|0]&&(!(!(i=s[o+12>>2])|2&c[r+2|0])&i-48>>>0>=10||(u=0)),u=32768&n?0:u,131072&n&&(u=163840&s[e+8232>>2]?34:c[t-2|0]==45?0:u))}return z=o+16|0,u}function zt(e,t,n,r,i){var a,o=0,c=0;if(z=a=z-208|0,s[a+204>>2]=n,Pt(n=a+160|0,0,40),s[a+200>>2]=s[a+204>>2],(0|Oe(0,t,a+200|0,a+80|0,n,r,i))<0)i=-1;else{s[e+76>>2],o=s[e>>2],s[e+72>>2]<=0&&(s[e>>2]=-33&o);A:{e:{if(s[e+48>>2]){if(s[e+16>>2])break e}else s[e+48>>2]=80,s[e+28>>2]=0,s[e+16>>2]=0,s[e+20>>2]=0,c=s[e+44>>2],s[e+44>>2]=a;if(n=-1,Tr(e))break A}n=Oe(e,t,a+200|0,a+80|0,a+160|0,r,i)}c&&(Ui[s[e+36>>2]](e,0,0),s[e+48>>2]=0,s[e+44>>2]=c,s[e+28>>2]=0,t=s[e+20>>2],s[e+16>>2]=0,s[e+20>>2]=0,n=t?n:-1),t=e,e=s[e>>2],s[t>>2]=e|32&o,i=32&e?-1:n}return z=a+208|0,i}function Bt(e,t,n,r){var i,o=0,s=0,l=0,u=0,d=0,f=0,p=0;if(z=i=z-208|0,s=c[0|t])for(;a[o+i|0]=s,u=((255&s)==6&(0|l)!=21)+u|0,l=s<<24>>24,s=c[(o=o+1|0)+t|0];);if(a[o+i|0]=0,o=c[0|i])for(f=u-2|0,l=0,p=(0|r)<2,s=0;;){A:{e:if((255&o)!=6|p|(0|s)==21){if((0|(r=255&o))==255){if(!d|(0|n)<2)break A;r=n>>>0>2?11:(0|l)%3|0?23:11}s=r,r=l}else{if(o=l+1|0,c[e+169|0]){s=(0|o)>1?5:6,r=o;break e}if(s=6,r=u,(0|o)==(0|u))break e;s=(0|o)%3|0||(0|l)==(0|f)?5:6,r=o}l=r,a[0|t]=s,t=t+1|0}if(!(o=c[(d=d+1|0)+i|0]))break}(0|n)>=2&&(a[0|t]=11,t=t+1|0),a[0|t]=0,z=i+208|0}function Vt(e,t){var n=0;n=0,e&&(n=s[50754],n=(e=(e=(0|v(s[145712+(t?12:((0|e)>199)<<2)>>2],e))/256|0)>>>0>(t=s[36430])>>>0?e:t)>>>0<=89999?(v(e,n)>>>0)/1e3|0:(v(e,(0|n)/25|0)>>>0)/40|0),(0|(e=s[36440]))<=0||(0|(t=s[36424]))<0||(s[(t=216192+(t<<4)|0)+4>>2]||(s[t+4>>2]=e),s[36440]=0),s[36426]=0,s[36439]=-1,s[36455]=s[50758],Te(),s[36427]=-1,e=216192+(s[50758]<<4)|0,s[e>>2]=5,s[e+4>>2]=n,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0,s[36426]=0,s[36438]&&(s[36438]=0,e=216192+(s[50758]<<4)|0,s[e>>2]=14,s[e+4>>2]=0,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0)}function Ht(e,t,n,r,i,a,o,s){var c,l=0,u=0,d=0;l=1,c=u=2147483647&r;A:if(!((d=(0|u)==2147418112)&!n?e|t:d&!!(0|n)|u>>>0>2147418112)&&!((d=(0|(u=2147483647&s))==2147418112)&!o?i|a:d&!!(0|o)|u>>>0>2147418112)){if(!(e|i|n|o|t|a|u|c))return 0;if((0|(l=r&s))>0|(0|l)>=0){if(l=-1,(0|n)==(0|o)&(0|r)==(0|s)?(0|t)==(0|a)&e>>>0>>0|t>>>0>>0:n>>>0>>0&(0|r)<=(0|s)|(0|r)<(0|s))break A;return!!(e^i|n^o|t^a|r^s)}l=-1,((0|n)==(0|o)&(0|r)==(0|s)?(0|t)==(0|a)&e>>>0>i>>>0|t>>>0>a>>>0:n>>>0>o>>>0&(0|r)>=(0|s)|(0|r)>(0|s))||(l=!!(e^i|n^o|t^a|r^s))}return l}function Ut(e,t){var n=0,r=0,i=0,o=0;for(n=c[85836]|c[85837]<<8,a[0|t]=n,a[t+1|0]=n>>>8,a[t+2|0]=c[85838];;)if(i=c[0|e],e=n=e+1|0,(0|i)!=255){if(!i)break;if(!(r=s[144464+(i<<2)>>2]))continue;if(c[r+11|0]==1&&(o=c[r+14|0],!(h[r+8>>1]|o>>>0>4))){if(o>>>0<2)continue;a[0|t]=c[o+93943|0],t=t+1|0;continue}if(255&(e=s[r>>2]))for(;a[0|t]=e,t=t+1|0,r=65280&e,e=e>>>8|0,r;);if(e=n,(0|i)!=21||(32|(n=a[0|e]))-97>>>0>=26)continue;for(;a[0|t]=n,t=t+1|0,(32|(n=a[0|(e=e+1|0)]))-97>>>0<26;);}a[0|t]=0}function Wt(e,t){var n,r,i=0,a=0,o=0;z=n=z-112|0,e||=(s[50303]||Ft(),201216),Ti(i=n+16|0,t,40),s[n>>2]=47,s[n+4>>2]=i,H(t=n- -64|0,87599,n),r=U(t),o=-1;A:{e:{g:{if(a=s[e>>2]){t=0,i=-1;r:{for(;;){if(Mn(n+16|0,s[a>>2])){if(Mn(n+16|0,a=s[a+8>>2])?o=Mn(n- -64|0,a+(U(a)-r|0)|0)?o:t:i=t,a=s[((t=t+1|0)<<2)+e>>2])continue;break r}break}if((0|t)>=0)break e;t=(0|i)<0?o:i;break g}if((0|(t=i))>=0)break g}t=o}if(i=0,(0|t)<0)break A}i=s[(t<<2)+e>>2]}return z=n+112|0,i}function Gt(e,t){var n,r,i=0,a=0,o=0,c=0,u=0;z=n=z-16|0,f(+t),r=0|l(1),a=0|l(0),(0|(o=(i=2147483647&r)+-1048576|0))==2145386495|o>>>0<2145386495?(c=a<<28,o=i>>>4|0,i=(15&i)<<28|a>>>4,a=o+1006632960|0):(0|i)==2146435072|i>>>0>2146435072?(c=a<<28,i=(15&r)<<28|a>>>4,a=r>>>4|2147418112):i|a?(rn(n,a,o=i,0,0,(i=i?x(i):x(a)+32|0)+49|0),u=s[n>>2],c=s[n+4>>2],o=15372-i<<16,i=s[n+8>>2],a=o|65536^s[n+12>>2]):(i=0,a=0),s[e>>2]=u,s[e+4>>2]=c,s[e+8>>2]=i,s[e+12>>2]=-2147483648&r|a,z=n+16|0}function Kt(e,t,n){var r=0,i=0;A:{e:{g:{if(!(3&((i=e)^t))){r=!!(0|n);r:if(!(!(3&t)|!n))for(;;){if(r=c[0|t],a[0|i]=r,!r)break A;if(i=i+1|0,r=!!(0|(n=n-1|0)),!(3&(t=t+1|0)))break r;if(!n)break}if(!r)break e;if(!c[0|t])break A;if(!(n>>>0<4))for(;;){if(~(r=s[t>>2])&r-16843009&-2139062144)break g;if(s[i>>2]=r,i=i+4|0,t=t+4|0,!((n=n-4|0)>>>0>3))break}}if(!n)break e}for(;;){if(r=c[0|t],a[0|i]=r,!r)break A;if(i=i+1|0,t=t+1|0,!(n=n-1|0))break}}n=0}return Pt(i,0,n),e}function qt(e,t,n,r,i,a){var o,c=0,l=0,u=0;z=o=z-240|0,c=s[n>>2],s[o+232>>2]=c,n=s[n+4>>2],s[o>>2]=e,s[o+236>>2]=n,u=1;A:{e:{g:{if(n|(0|c)!=1){for(c=e;;){if((0|bi(n=c-s[(l=(r<<2)+a|0)>>2]|0,e,t))<=0){n=c;break g}r:{if(!((0|r)<2|i)&&(i=s[l-8>>2],(0|bi(l=c-4|0,n,t))>=0||(0|bi(l-i|0,n,t))>=0))break r;if(s[(u<<2)+o>>2]=n,Jr(c=o+232|0,i=Ir(c)),u=u+1|0,r=r+i|0,i=0,c=n,s[o+236>>2]|s[o+232>>2]!=1)continue;break e}break}n=c;break e}n=e}if(i)break A}Rn(o,u),Ln(n,t,r,a)}z=o+240|0}function Jt(e,t){var n=0;s[4+((n=e<<2)+134912|0)>>2]=t,s[n+136192>>2]=t,n=28;A:{e:{g:switch(e-1|0){case 0:s[50792]=t,s[50786]=t,ot(3);break e;case 1:s[50787]=t,s[33037]=(0|v(c[s[50797]+105596|0],(0|v(s[50787],55))/100|0))/16;break e;case 2:e=(0|t)>=99?99:t,s[50785]=(0|e)>0?e:0;break e;case 3:s[50788]=(0|t)>=99?99:t;break e;case 12:s[47268]=t;break e;case 6:s[47205]=t;break e;case 9:break e;case 8:break g;default:break A}(e=255&t)&&(s[s[47192]+152>>2]=e),s[47196]=t}n=0}return n}function Yt(e,t){var n=0,r=0,i=0;A:if(s[e>>2])for(;;){if(fr(s[e-4>>2])){if(r=0,(0|(n=a[0|t]))==s[e>>2])for(;(0|(n=a[(r=r+1|0)+t|0]))==s[(e=e+4|0)>>2];);if(!n){for(;t=e,e=e+4|0,fr(s[t>>2]););for(i=t+((s[t>>2]==61)<<2)|0;i=(e=i)+4|0,fr(s[e>>2]););e:switch((t=s[e>>2])-34|0){case 0:case 5:break A;default:break e}return fr(t)||s[e>>2]==47?102808:e}}if(!s[(e=e+4|0)>>2])break}return i}function Xt(e,t,n,r){var i,o,l=0,u=0,d=0;return!c[e+25|0]|_[e+8>>3]!=n|_[e+16>>3]!=r?(_[e+16>>3]=r,_[e+8>>3]=n,r=(l=dt(-3.141592653589793/(u=+s[e>>2])*r))*-l,_[e+48>>3]=r,l*=_n(-6.283185307179586/u*n),l+=l,_[e+40>>3]=l,u=1-l-r,_[e+32>>3]=u,!(d=c[e+24|0])|n==0||(u=1/u,_[e+32>>3]=u,r*=n=-u,_[e+48>>3]=r,l*=n,_[e+40>>3]=l,d=1)):(d=c[e+24|0],r=_[e+48>>3],l=_[e+40>>3],u=_[e+32>>3]),a[e+25|0]=1,n=_[e+64>>3],i=_[e+56>>3],_[e+64>>3]=i,o=t,t=r*n+(u*t+l*i),_[e+56>>3]=d?o:t,t}function Zt(e,t,n,r,i){var a=0,o=0,c=0,l=0,u=0;if((c=s[34388])&&!((0|(o=s[34436]))>=(s[34393]-2|0))){if(s[34436]=o+1,a=v(o,36)+c|0,s[a>>2]=e,s[a+4>>2]=s[34437],u=s[34438],s[a+12>>2]=t>>>24,s[a+8>>2]=16777215&t,s[a+24>>2]=u,t=s[50754],i=s[34439]+((i-s[34392]|0)/2|0)|0,s[a+20>>2]=i,t=b(l=1e3*(0|i)/(0|t))<2147483648?~~l:-2147483648,s[a+16>>2]=t,e-3>>>0<=1)return void(s[28+(v(o,36)+c|0)>>2]=s[33282]+n);t=28+(v(o,36)+c|0)|0,s[t>>2]=n,(0|e)==7&&(s[t+4>>2]=r)}}function Qt(e,t,n,r,i,a){var o=0,c=0,l=0,u=0;64&a?(t=31&(n=a+-64|0),(63&n)>>>0>=32?(n=0,t=i>>>t|0):(n=i>>>t|0,t=((1<>>t),r=0,i=0):a&&(l=r,o=31&(c=64-a|0),(63&c)>>>0>=32?(c=l<>>32-o|i<>>0>=32?(o=0,t=n>>>t|0):(o=n>>>t|0,t=((1<>>t),t|=u,n=o|c,o=r,r=31&a,(63&a)>>>0>=32?(c=0,r=i>>>r|0):(c=i>>>r|0,r=((1<>>r),i=c),s[e>>2]=t,s[e+4>>2]=n,s[e+8>>2]=r,s[e+12>>2]=i}function $t(e){var t=0,n=0;if(!e){if(s[33174]&&(t=$t(s[33174])),s[33136]&&(t=$t(s[33136])|t),e=s[56816])for(;s[e+20>>2]!=s[e+28>>2]&&(t=$t(e)|t),e=s[e+56>>2];);return t}return s[e+76>>2],s[e+20>>2]==s[e+28>>2]||(Ui[s[e+36>>2]](e,0,0),s[e+20>>2])?((0|(t=s[e+8>>2]))!=(0|(n=s[e+4>>2]))&&(t=n-t|0,Ui[s[e+40>>2]](e,t,t>>31,1)),t=0,s[e+28>>2]=0,s[e+16>>2]=0,s[e+20>>2]=0,s[e+4>>2]=0,s[e+8>>2]=0):t=-1,t}function en(e,t){var n=0,r=0,i=0,a=0,o=0;if((192&(n=c[0|t]))==128)for(;(192&(n=c[0|(t=t-1|0)]))==128;);A:if(128&(n=n<<24>>24)){if(r=1,(0|(i=224&n))!=192)if((240&n)!=224){if(r=3,(248&n)!=240){n&=255,r=0;break A}}else r=2,o=1;n=c[r+93846|0]&n,(a=c[t+1|0])?(n=63&a|n<<6,(0|i)!=192&&((i=c[t+2|0])?(n=63&i|n<<6,o||((t=c[t+3|0])?n=63&t|n<<6:r=2)):r=1)):r=0}return s[e>>2]=n,r+1|0}function tn(e,t,n,r){var i,a=0,o=0;return z=i=z-224|0,e?(s[i>>2]=137584,s[i+4>>2]=47,s[i+8>>2]=t,H(t=i+16|0,85430,i),(0|(a=vr(t)))<0?t=xr(r,0-a|0,i+16|0):(t=ft(i+16|0,85659))?((o=s[e>>2])&&Re(o),a?(o=ve(a),s[e>>2]=o,o?(0|Nn(o,a,t))==(0|a)?(Sr(t),t=0,n&&(s[n>>2]=a)):(n=s[56798],Sr(t),Re(s[e>>2]),s[e>>2]=0,t=xr(r,n,i+16|0)):(Sr(t),t=48)):(t=0,s[e>>2]=0)):t=xr(r,s[56798],i+16|0)):t=28,z=i+224|0,t}function nn(e,t){var n=0,r=0,i=0,a=0,o=0;if((192&(n=c[0|t]))==128)for(;(192&(n=c[0|(t=t+1|0)]))==128;);A:if(128&(n=n<<24>>24)){if(r=1,(0|(i=224&n))!=192)if((240&n)!=224){if(r=3,(248&n)!=240){n&=255,r=0;break A}}else r=2,o=1;n=c[r+93846|0]&n,(a=c[t+1|0])?(n=63&a|n<<6,(0|i)!=192&&((i=c[t+2|0])?(n=63&i|n<<6,o||((t=c[t+3|0])?n=63&t|n<<6:r=2)):r=1)):r=0}return s[e>>2]=n,r+1|0}function rn(e,t,n,r,i,a){var o=0,c=0,l=0;64&a?(r=t,t=31&(i=a+-64|0),(63&i)>>>0>=32?(i=r<>>32-t|n<>>0>=32?(c=o<>>32-r|i<>>0>=32?(i=0,t=n>>>r|0):(i=n>>>r|0,t=((1<>>r),r=l|t,i|=c,t=31&a,(63&a)>>>0>=32?(c=o<>>32-t|n<>2]=t,s[e+4>>2]=n,s[e+8>>2]=r,s[e+12>>2]=i}function an(e){var t=0;return e>>>0<=55295?t=c[s[125552+(e>>>6&67108860)>>2]+(255&e)|0]:(t=4,e>>>0<57344||(e>>>0<63488?t=3:e>>>0<=195327?t=c[s[126416+(e-63488>>>6&67108860)>>2]+(255&e)|0]:(t=2,e>>>0<917504||(e>>>0<=918015?t=c[s[128476+(e-917504>>>6&67108860)>>2]+(255&e)|0]:e>>>0<983040||(e>>>0<1048574?t=3:e>>>0<1048576||(t=3,e>>>0<1114110||(t=e>>>0<1114112?2:5))))))),255&t}function on(e,t){var n=0,r=0,i=0,a=0,o=0,c=0,l=0,u=0,d=0;if(!((0|(n=s[33709]))<=0)){if(i=(0|e)>31?e-32|0:e,e=0,n>>>0>=4)for(d=-4&n;c=2|e,l=1|e,r=s[134912+((o=3|e)<<6)>>2]==(0|i)?o:s[134912+(c<<6)>>2]==(0|i)?c:s[134912+(l<<6)>>2]==(0|i)?l:s[134912+(e<<6)>>2]==(0|i)?e:r,e=e+4|0,(0|d)!=(0|(a=a+4|0)););if(a=3&n)for(;r=s[134912+(e<<6)>>2]==(0|i)?e:r,e=e+1|0,(0|a)!=(0|(u=u+1|0)););(0|r)<=0||(s[33709]=r,n=r)}et(t,n)}function sn(e){var t,n=0,r=0,i=0;for(z=t=z-96|0,Ti(t,e,60),pn(t,1);i=gr(a[0|(r=t+n|0)]),a[0|r]=i,n=n+1|0,255&i;);s[t+92>>2]=0,s[t+84>>2]=0,s[t+88>>2]=0,s[t+76>>2]=0,s[t+80>>2]=0,s[t+72>>2]=e;A:{e:{g:{if(ge(t,1)){if(c[202976])break g;break e}if(s[50303]||Ft(),n=268437247,!(e=Wt(201216,t))||!ge(s[e+8>>2],0))break A;if(!c[202976])break e}ge(202976,2)}Hr(s[32972]),s[t+76>>2]=s[32972]+40,Dn(t+72|0,202976),n=0}return z=t+96|0,n}function cn(e,t){if(!e)return 0;A:{e:{if(e){if(t>>>0<=127)break e;if(s[s[56841]>>2]){if(t>>>0<=2047){a[e+1|0]=63&t|128,a[0|e]=t>>>6|192,e=2;break A}if(!((-8192&t)!=57344&t>>>0>=55296)){a[e+2|0]=63&t|128,a[0|e]=t>>>12|224,a[e+1|0]=t>>>6&63|128,e=3;break A}if(t-65536>>>0<=1048575){a[e+3|0]=63&t|128,a[0|e]=t>>>18|240,a[e+2|0]=t>>>6&63|128,a[e+1|0]=t>>>12&63|128,e=4;break A}}else if((-128&t)==57216)break e;s[56798]=25,e=-1}else e=1;break A}a[0|e]=t,e=1}return e}function ln(e){var t=0,n=0,r=0,i=0;if(s[e+20>>2]=0,(r=(n=s[e+8>>2])-(t=s[e+4>>2])|0)>>>0>=9)for(;Re(s[t>>2]),t=s[e+4>>2]+4|0,s[e+4>>2]=t,(r=(n=s[e+8>>2])-t|0)>>>0>8;);i=512;A:switch((r>>>2|0)-1|0){case 1:i=1024;case 0:s[e+16>>2]=i;break;default:break A}if((0|t)!=(0|n)){for(;Re(s[t>>2]),(0|n)!=(0|(t=t+4|0)););(0|(t=s[e+8>>2]))!=(0|(n=s[e+4>>2]))&&(s[e+8>>2]=t+(3+(n-t|0)&-4))}(e=s[e>>2])&&Re(e)}function un(e,t,n){var r=0,i=0;r=!!(0|n);A:{e:{g:if(!(!(3&e)|!n))for(i=255&t;;){if((0|i)==c[0|e])break e;if(r=!!(0|(n=n-1|0)),!(3&(e=e+1|0)))break g;if(!n)break}if(!r)break A;if(!(c[0|e]==(255&t)|n>>>0<4))for(r=v(255&t,16843009);;){if(~(i=r^s[e>>2])&i-16843009&-2139062144)break e;if(e=e+4|0,!((n=n-4|0)>>>0>3))break}if(!n)break A}for(t&=255;;){if((0|t)==c[0|e])return e;if(e=e+1|0,!(n=n-1|0))break}}return 0}function dn(e,t){var n=0,r=0;A:{if(r=255&t){if(3&e)for(;;){if(!(n=c[0|e])|(0|n)==(255&t))break A;if(!(3&(e=e+1|0)))break}e:if(!(~(n=s[e>>2])&n-16843009&-2139062144))for(r=v(r,16843009);;){if(~(n^=r)&n-16843009&-2139062144)break e;if(n=s[e+4>>2],e=e+4|0,n-16843009&~n&-2139062144)break}for(;(r=c[0|(n=e)])&&(e=n+1|0,(0|r)!=(255&t)););return n}return U(e)+e|0}return e}function fn(e,t,n,r,i){var a,o=0,s=0;s=-1;A:if(!(((o=(0|(a=2147483647&r))==2147418112)&!n?e|t:o&!!(0|n)|a>>>0>2147418112)||(o=2147483647&i)>>>0>2147418112&(0|o)!=2147418112)){if(!(e|n|o|a|t))return 0;if((0|(o=r&i))>0|(0|o)>=0){if((!!(0|n)|(0|r)!=(0|i))&(0|r)<(0|i))break A;return!!(e|n|r^i|t)}(!n&(0|r)==(0|i)?e|t:!!(0|n)&(0|r)>=(0|i)|(0|r)>(0|i))||(s=!!(e|n|r^i|t))}return s}function pn(e,t){var n,r=0;z=n=z+-64|0,a[202976]=0,s[n+48>>2]=47,H(n+59|0,91351,n+48|0),t||(a[n+59|0]=0);A:{e:{if(e&&=xi(e,43)){if(a[0|e]=0,a[0|(e=e+1|0)]-48>>>0>=10)break e;r=Pn(e)}if((0|r)<=0)break A;if(r>>>0<=9){s[n+4>>2]=r,s[n>>2]=n+59,H(202976,91378,n);break A}s[n+20>>2]=r-10,s[n+16>>2]=n+59,H(202976,91503,n+16|0);break A}s[n+36>>2]=e,s[n+32>>2]=n+59,H(202976,85425,n+32|0)}z=n- -64|0}function mn(e){var t,n=0,r=0,i=0;z=t=z-80|0,n=je(e,t+12|0),s[t+12>>2]?(Ti(r=t+16|0,n,60),n=0,pn(r,1),!ge(r,0)|!c[202976]||ge(202976,2),Hr(s[32972]),Dn(e,86012)):n=268437247,z=t+80|0;A:{e:{g:{r:{if((0|n)<=268437502){if(!n)break A;if((0|n)==268436479)break e;if((0|n)!=268437247)break r;return 2}if((0|n)==268437503|(0|n)==268437759)break g;if((0|n)==268439295)break A}return-1}return 2}i=1}return i}function hn(e,t,n,r,i,a,o,c,l){var u,d,f;l=hr(t,n,c,l),c=B,i=hr(r,i,a,o),r=B+c|0,c=i>>>0>(l=i+l|0)>>>0?r+1|0:r,u=o,d=n,o=(n=hr(o,i=0,n,r=0))+l|0,l=B+c|0,f=o,n=n>>>0>o>>>0?l+1|0:l,o=hr(a,0,t,0),c=B,r=hr(a,l=0,d,r),a=B+l|0,a=r>>>0>(c=c+r|0)>>>0?a+1|0:a,r=n,a=a>>>0>(l=a+f|0)>>>0?r+1|0:r,n=hr(t,0,u,i)+c|0,i=B,c=(i=n>>>0>>0?i+1|0:i)+l|0,l=a,s[e+8>>2]=c,s[e+12>>2]=i>>>0>c>>>0?l+1|0:l,s[e>>2]=o,s[e+4>>2]=n}function gn(e,t){var n=0,r=0;A:{if(3&((r=e)^t))n=c[0|t];else{if(3&t)for(;;){if(n=c[0|t],a[0|r]=n,!n)break A;if(r=r+1|0,!(3&(t=t+1|0)))break}if(!(~(n=s[t>>2])&n-16843009&-2139062144))for(;s[r>>2]=n,n=s[t+4>>2],r=r+4|0,t=t+4|0,!(n-16843009&~n&-2139062144););}if(a[0|r]=n,255&n)for(;n=c[t+1|0],a[r+1|0]=n,r=r+1|0,t=t+1|0,n;);}return e}function _n(e){var t,n=0,r=0;z=t=z-16|0,f(+e),r=0|l(1),l(0);A:if((r&=2147483647)>>>0<=1072243195){if(n=1,r>>>0<1044816030)break A;n=ir(e,0)}else if(n=e-e,!(r>>>0>=2146435072)){e:switch(3&Ee(e,t)){case 0:n=ir(_[t>>3],_[t+8>>3]);break A;case 1:n=-Xn(_[t>>3],_[t+8>>3],1);break A;case 2:n=-ir(_[t>>3],_[t+8>>3]);break A;default:break e}n=Xn(_[t>>3],_[t+8>>3],1)}return z=t+16|0,e=n}function vn(e,t,n,r){var i=0,a=0,o=0;if(!((U(r)+U(t)|0)>=(0|n))){for(o=s[36115],n=r;i=c[0|n];)if(n=n+1|0,!((0|i)>=(0|o))){A:{e:switch(i=s[144464+(i<<2)>>2],c[i+11|0]-1|0){case 1:break A;case 0:break e;default:continue}a=c[i+14|0]<4|a;continue}1&(c[i+4|0]>>>1|a)||(s[e+8212>>2]=s[e+8212>>2]+1),s[e+8208>>2]=s[e+8208>>2]+1,a=0}t&&Li(t,r)}}function yn(e){var t,n=0;z=t=z-16|0,f(+e),n=0|l(1),l(0);A:if((n&=2147483647)>>>0<=1072243195){if(n>>>0<1045430272)break A;e=Xn(e,0,0)}else if(n>>>0>=2146435072)e-=e;else{e:switch(3&Ee(e,t)){case 0:e=Xn(_[t>>3],_[t+8>>3],1);break A;case 1:e=ir(_[t>>3],_[t+8>>3]);break A;case 2:e=-Xn(_[t>>3],_[t+8>>3],1);break A;default:break e}e=-ir(_[t>>3],_[t+8>>3])}return z=t+16|0,e}function bn(e){var t=0;s[e+296>>2]=303173648,s[e+300>>2]=370677780,t=s[26341],s[e+304>>2]=s[26340],s[e+308>>2]=t,t=s[26343],s[e+312>>2]=s[26342],s[e+316>>2]=t,tt(e),s[e+56>>2]=2,s[e+36>>2]=3,s[e+40>>2]=1074,a[e+168|0]=5,s[e+132>>2]=32,s[e+104>>2]=1032,s[e+108>>2]=66,s[e+8>>2]=5,s[e+12>>2]=32,a[e+365|0]=64|c[e+365|0],a[e+368|0]=64|c[e+368|0],a[e+396|0]=64|c[e+396|0],a[e+399|0]=64|c[e+399|0]}function xn(e,t,n){var r=0,i=0,a=0;A:{if(!(r=s[n+16>>2])){if(Tr(n))break A;r=s[n+16>>2]}if(r-(a=s[n+20>>2])>>>0>>0)return 0|Ui[s[n+36>>2]](n,e,t);e:if(s[n+80>>2]<0)r=0;else{for(i=t;;){if(!(r=i)){r=0;break e}if(c[(i=r-1|0)+e|0]==10)break}if((i=0|Ui[s[n+36>>2]](n,e,r))>>>0>>0)break A;e=e+r|0,t=t-r|0,a=s[n+20>>2]}ut(a,e,t),s[n+20>>2]=s[n+20>>2]+t,i=t+r|0}return i}function Sn(e){var t,n=0,r=0;A:{if((0|(t=s[34064]))>0)for(;;){if((r=s[136284+(n<<4)>>2])&&!Or(e,r)){if(s[136276+(n<<4)>>2])return n;if(r=-1,Je(0,n))break A;return n}if((0|t)==(0|(n=n+1|0)))break}r=-1,Je(e,t)||(n=Xe(s[12+(136272+(s[34064]<<4)|0)>>2],U(e)+1|0),r=s[34064],s[12+(136272+(r<<4)|0)>>2]=n,gn(n,e),s[34064]=r+1)}return r}function Cn(e,t){var n,r=0,i=0,o=0,c=0;for(z=n=z-16|0,a[0|t]=0,(r=15&s[e>>2])&&(t=(i=U(t=gn(t,kr(128496,64|r))))+t|0),r=8;;){A:{e:{if(r>>>0<=29){if(s[e>>2]>>>r&1)break e;break A}if(!(s[e+4>>2]>>>r-32&1)|r>>>0<32)break A}(0|(i=(c=U(o=kr(128496,r))+1|0)+i|0))>=80||(s[n>>2]=o,H(t,84439,n),t=t+c|0)}if((0|(r=r+1|0))==64)break}z=n+16|0}function wn(e,t,n){var r,i=0,o=0,l=0;if(z=r=z-16|0,c[0|e]){for(l=s[30450];;)if(o=e,e=e+1|0,!((0|(i=a[0|o]))==32|i-9>>>0<5)){for((0|(i=Pn(o)))>0&&((0|i)<32?s[t>>2]=s[t>>2]|1<>2]=i,s[r>>2]=o,fi(l,84902,r)),o=e);o=(e=o)+1|0,(i=a[0|e])-48>>>0<10|(32|i)-97>>>0<26;);if(!i)break}}z=r+16|0}function Tn(e,t,n){var r=0,i=0,o=0,c=0;A:if(t&&!((0|(i=n-4|0))<=0))for(o=(0|(n=s[t-4>>2]))==34||(0|n)==39?n:0,n=0;;){if(c=n,!(n=s[t>>2]))break A;e:{if(!o){if((0|n)==32|n-9>>>0<5)break A;if((0|n)!=47)break e;break A}if((0|c)!=92&&(0|n)==(0|o))break A}if(t=t+4|0,!((0|i)>(0|(r=qn(n,e+r|0)+r|0))))break}return a[e+r|0]=0,r}function En(e){var t=0;A:if(!Rr(e)){t=0;e:if(!(e>>>0<768)){if(e-2305>>>0<=1270){if((124&e)>>>0<100)break A;if(t=1,Kr(93850,e))break e;return e-3450>>>0<6}if((0|e)==1541|e-1456>>>0<19|(0|e)==1648||(0|(t=-256&e))==10240|(0|t)==4352|e-3904>>>0<125|e>>>0<880)break A;t=1,e-1611>>>0<20||(t=e-12353>>>0<30400)}return t}return 1}function Dn(e,t){var n=0;e?((n=s[e+4>>2])&&gn(133208,n),(n=s[e>>2])&&Ti(133168,n,40),s[33289]=c[e+14|0],s[33291]=c[e+13|0],s[33290]=c[e+12|0],Ti(134672,c[0|t]!=33|c[t+1|0]!=118?t:(c[t+2|0]==47?3:0)+t|0,40),e=s[50298],s[33678]=s[50297],s[33679]=e,e=s[50302],s[33682]=s[50301],s[33683]=e,e=s[50300],s[33680]=s[50299],s[33681]=e):Pt(133152,0,76)}function On(e,t,n,r){a[e+53|0]=1;A:if(s[e+4>>2]==(0|n)){a[e+52|0]=1;e:{if(!(n=s[e+16>>2])){if(s[e+36>>2]=1,s[e+24>>2]=r,s[e+16>>2]=t,(0|r)!=1)break A;if(s[e+48>>2]==1)break e;break A}if((0|t)==(0|n)){if((0|(n=s[e+24>>2]))==2&&(s[e+24>>2]=r,n=r),s[e+48>>2]!=1)break A;if((0|n)==1)break e;break A}s[e+36>>2]=s[e+36>>2]+1}a[e+54|0]=1}}function kn(e,t){var n=0,r=0,i=0,o=0,c=0;A:if(n=s[t>>2])for(;;){r=0;e:if(e){for(;c=a[r+n|0],(i=s[(r<<2)+e>>2])&&(r=r+1|0,(0|c)==(0|i)););g:switch(i-34|0){case 0:case 5:break g;default:break e}if(!c)break A}if(!(n=s[((o=o+1|0)<<3)+t>>2]))break}return s[4+((o<<3)+t|0)>>2]}function An(e,t){A:if((0|t)>=1024){if(e*=898846567431158e293,t>>>0<2047){t=t-1023|0;break A}e*=898846567431158e293,t=((0|t)>=3069?3069:t)-2046|0}else(0|t)>-1023||(e*=2004168360008973e-307,t>>>0>4294965304?t=t+969|0:(e*=2004168360008973e-307,t=((0|t)<=-2960?-2960:t)+1938|0));return u(0,0),u(1,t+1023<<20),e*+d()}function jn(e,t,n,r){var i,o,c,l=0;return z=o=z-16|0,s[o+12>>2]=r,z=i=z-160|0,c=t?e:i+158|0,s[i+144>>2]=c,l=-1,e=t-1|0,s[i+148>>2]=e>>>0<=t>>>0?e:0,e=Pt(i,0,144),s[e+76>>2]=-1,s[e+36>>2]=17,s[e+80>>2]=-1,s[e+44>>2]=e+159,s[e+84>>2]=e+144,(0|t)<0?s[56798]=61:(a[0|c]=0,l=zt(e,n,r,15,16)),z=e+160|0,z=o+16|0,l}function Mn(e,t){var n=0,r=0,i=0;A:if(n=c[0|e])for(;;){if(!(r=c[0|t])){i=n;break A}if((0|n)!=(0|r)&&(0|(r=n-65>>>0<26?32|n:n))!=(0|((n=c[0|t])-65>>>0<26?32|n:n))){i=c[0|e];break A}if(t=t+1|0,n=c[e+1|0],e=e+1|0,!n)break}return(i=(e=255&i)-65>>>0<26?32|e:e)-((e=c[0|t])-65>>>0<26?32|e:e)|0}function Nn(e,t,n){var r=0,i=0;if(r=s[n+72>>2],s[n+72>>2]=r-1|r,(0|(r=s[n+4>>2]))==(0|(i=s[n+8>>2]))?r=t:(ut(e,r,r=t>>>0>(r=i-r|0)>>>0?r:t),s[n+4>>2]=r+s[n+4>>2],e=e+r|0,r=t-r|0),r)for(;;){if($n(n)||!(i=0|Ui[s[n+32>>2]](n,e,r)))return t-r|0;if(e=e+i|0,!(r=r-i|0))break}return t}function Pn(e){for(var t=0,n=0,r=0,i=0;e=(t=e)+1|0,(0|(n=a[0|t]))==32|n-9>>>0<5;);A:{e:{g:switch((n=a[0|t])-43|0){case 0:break e;case 2:break g;default:break A}i=1}n=a[0|e],t=e}if(n-48>>>0<10)for(;r=48+(v(r,10)-a[0|t]|0)|0,e=a[t+1|0],t=t+1|0,e-48>>>0<10;);return i?r:0-r|0}function Fn(e,t){var n,r,i,a=0;return z=n=z-32|0,s[t>>2]=0,s[t+4>>2]=0,s[(a=r=t+24|0)>>2]=0,s[a+4>>2]=0,s[(a=i=t+16|0)>>2]=0,s[a+4>>2]=0,s[(a=t+8|0)>>2]=0,s[a+4>>2]=0,s[n+28>>2]=t+28,s[n+24>>2]=r,s[n+20>>2]=t+20,s[n+16>>2]=i,s[n+12>>2]=t+12,s[n+8>>2]=a,s[n+4>>2]=t+4,s[n>>2]=t,e=_e(e,84553,n),z=n+32|0,e}function In(e){var t=0,n=0,r=0;if((t=c[0|e])&&((n=c[e+1|0])?(n=t|n<<8,(t=c[e+2|0])&&(n|=t<<16,(e=c[e+3|0])&&(n|=e<<24))):n=t),(0|(t=s[36115]))>0)for(e=0;;){if(!(!(r=s[144464+(e<<2)>>2])|s[r>>2]!=(0|n)))return c[r+10|0];if((0|t)==(0|(e=e+1|0)))break}return 0}function Ln(e,t,n,r){var i,a=0,o=0,c=0,l=0,u=0;z=i=z-240|0,s[i>>2]=e,c=1;A:if(!((0|n)<2))for(a=e;;){if((0|bi(e,o=(a=a-4|0)-s[((l=n-2|0)<<2)+r>>2]|0,t))>=0&&(0|bi(e,a,t))>=0)break A;if(u=o,a=(o=(0|bi(o,a,t))>=0)?u:a,s[(c<<2)+i>>2]=a,c=c+1|0,!((0|(n=o?n-1|0:l))>1))break}Rn(i,c),z=i+240|0}function H(e,t,n){var r,i,o,c=0;return z=i=z-16|0,s[i+12>>2]=n,z=r=z-160|0,ut(o=r+8|0,124528,144),s[r+52>>2]=e,s[r+28>>2]=e,c=(c=-2-e|0)>>>0>2147483647?2147483647:c,s[r+56>>2]=c,e=e+c|0,s[r+36>>2]=e,s[r+24>>2]=e,e=Oi(o,t,n),c&&(t=s[r+28>>2],a[t-((0|t)==s[r+24>>2])|0]=0),z=r+160|0,z=i+16|0,e}function Rn(e,t){var n,r=0,i=0,a=0,o=0,c=0;if(r=4,z=n=z-256|0,(0|t)>=2)for(s[(c=(t<<2)+e|0)>>2]=n;;){for(a=r>>>0>=256?256:r,ut(s[c>>2],s[e>>2],a),i=0;o=(i<<2)+e|0,i=i+1|0,ut(s[o>>2],s[(i<<2)+e>>2],a),s[o>>2]=s[o>>2]+a,(0|t)!=(0|i););if(!(r=r-a|0))break}z=n+256|0}function zn(e,t,n){var r,i=0;return z=r=z-96|0,s[r+88>>2]=0,s[r+92>>2]=1073741824,s[r+84>>2]=t,t=nt(e,r+84|0,n,r+88|0,2,0),536870912&(i=s[r+88>>2])?(t=s[47202],s[47202]=0,a[r+2|0]=32,o[r>>1]=8192,Ti(i=3|r,s[r+84>>2],77),e=Tt(e,i,0,0),gn(n,189088),s[47202]=t):e=t?i:0,z=r+96|0,e}function Bn(e,t,n){var r=0,i=0,o=0;i=Gn(e),r=s[t>>2];A:{e:if((0|i)>=0){if(r){if(!Or(e,n))break e;(o=s[r+688>>2])&&Re(o),Re(r),s[t>>2]=0}s[t>>2]=ue(e),e=gn(n,e),We(n=s[t>>2],n+228|0,0)&&(ci(s[s[32972]+60>>2]),a[0|e]=0,i=-1),r=s[t>>2],s[r+292>>2]=i}else if(!r)break A;a[r+268|0]=0}return i}function Vn(e){var t=0,n=0;return(0|(t=s[e+76>>2]))>=0&(!t|s[56823]!=(-1073741825&t))?(n=s[(t=e+76|0)>>2],s[t>>2]=n||1073741823,(0|(n=s[e+4>>2]))==s[e+8>>2]?e=Wr(e):(s[e+4>>2]=n+1,e=c[0|n]),s[t>>2]=0,e):(0|(t=s[e+4>>2]))==s[e+8>>2]?Wr(e):(s[e+4>>2]=t+1,c[0|t])}function Hn(e,t,n){var r=0,i=0;A:{e:{if(n>>>0>=4){if(3&(e|t))break e;for(;;){if(s[e>>2]!=s[t>>2])break e;if(t=t+4|0,e=e+4|0,!((n=n-4|0)>>>0>3))break}}if(!n)break A}for(;;){if((0|(r=c[0|e]))==(0|(i=c[0|t]))){if(t=t+1|0,e=e+1|0,n=n-1|0)continue;break A}break}return r-i|0}return 0}function Un(e,t){var n,r=0,i=0,a=0;z=n=z-16|0,t?(rn(n,i=((r=t>>31)^t)-r|0,0,0,0,(r=x(i))+81|0),i=0+s[n+8>>2]|0,r=(65536^s[n+12>>2])+(16414-r<<16)|0,a=-2147483648&t|(r=i>>>0>>0?r+1|0:r),r=s[n+4>>2],t=s[n>>2]):t=0,s[e>>2]=t,s[e+4>>2]=r,s[e+8>>2]=i,s[e+12>>2]=a,z=n+16|0}function Wn(e){var t,n=0,r=0,i=0;if((0|(n=dn(e,61)))==(0|e))return 0;A:if(!c[(t=n-e|0)+e|0]&&(n=s[56800])&&(r=s[n>>2])){for(;;){if(cr(e,r,t)||(r=s[n>>2]+t|0,c[0|r]!=61)){if(r=s[n+4>>2],n=n+4|0,r)continue;break A}break}i=r+1|0}return i}function Gn(e){var t=0,n=0;A:if(!((0|(n=s[34461]))<=0)){for(;;){if(!Or(e,v(t,44)+137856|0)){s[34457]=t;break A}if((0|n)==(0|(t=t+1|0)))break}return-1}return(e=(0|t)==(0|n))?-1:((0|(e=e?-1:t))!=s[36114]&&(s[36115]=0,Lt(e),s[36114]=e,s[36115]+=1),t)}function Kn(e,t,n,r){var i=0,a=0;A:if((32|c[0|t])!=32){if(i=((0|r)>2)<<1,a=Ne(e,t,n,i=(0|r)>1?4|i:i),c[0|n]!=21)for(i|=1,t=t+a|0,a=1;;){if((32|c[0|t])==32)break A;if(t=Ne(e,t,n,i)+t|0,a=a+1|0,c[0|n]==21)break}return gn(189088,n),0}return Bt(e,n,r,a),t}function qn(e,t){var n,r=0,i=0,o=0;if(e>>>0<=127)return a[0|t]=e,1;if(e>>>0>=1114112)return a[0|t]=32,1;for(r=v(n=e>>>0<2048?1:e>>>0<65536?2:3,6),a[0|t]=c[n+93842|0]|e>>>r;r=r-6|0,a[(i=i+1|0)+t|0]=e>>>r&63|128,(0|(o=o+1|0))!=(0|n););return n+1|0}function Jn(e){var t=0,n=0;A:{if((0|(t=s[e+12>>2]))>=s[e+16>>2]){if(t=0,(0|(n=0|R(s[e+8>>2],e+24|0,2048)))<=0){if(!n|(0|n)==-44)break A;return s[56798]=0-n,0}s[e+16>>2]=n}n=t,t=e+t|0,s[e+12>>2]=n+h[t+40>>1],n=s[t+36>>2],s[e>>2]=s[t+32>>2],s[e+4>>2]=n,t=t+24|0}return t}function Yn(e,t){var n,r=0;if(r=s[e+632>>2])return!!(0|Gr(r,t));A:{e:{if((0|(n=s[e+600>>2]))>0){if(r=0,(t=t-n|0)-1>>>0<255)break e;break A}if((r=t-192|0)>>>0<=413)return 128&c[344+(c[r+94240|0]+e|0)|0];if(r=0,t>>>0>255)break A}r=128&c[344+(e+t|0)|0]}return r}function Xn(e,t,n){var r,i,a;return a=(r=e*e)*(r*r)*(158969099521155e-24*r-2.5050760253406863e-8)+(r*(27557313707070068e-22*r-.0001984126982985795)+.00833333333332249),i=r*e,n?e-(r*(.5*t-a*i)-t+.16666666666666632*i):i*(r*a-.16666666666666632)+e}function Zn(e,t){var n,r=0,i=0,a=0;z=n=z-16|0,t?(rn(n,r=t,0,0,0,(t=x(t))+81|0),r=0+s[n+8>>2]|0,t=(65536^s[n+12>>2])+(16414-t<<16)|0,a=i>>>0>r>>>0?t+1|0:t,i=s[n+4>>2],t=s[n>>2]):t=0,s[e>>2]=t,s[e+4>>2]=i,s[e+8>>2]=r,s[e+12>>2]=a,z=n+16|0}function Qn(e){var t,n=0;z=t=z-16|0,a[t+15|0]=10;A:{if(!(n=s[e+16>>2])){if(Tr(e))break A;n=s[e+16>>2]}(0|n)==(0|(n=s[e+20>>2]))|s[e+80>>2]==10?Ui[s[e+36>>2]](e,t+15|0,1):(s[e+20>>2]=n+1,a[0|n]=10)}z=t+16|0}function $n(e){var t,n=0;return n=s[e+72>>2],s[e+72>>2]=n-1|n,s[e+20>>2]!=s[e+28>>2]&&Ui[s[e+36>>2]](e,0,0),s[e+28>>2]=0,s[e+16>>2]=0,s[e+20>>2]=0,4&(n=s[e>>2])?(s[e>>2]=32|n,-1):(t=s[e+44>>2]+s[e+48>>2]|0,s[e+8>>2]=t,s[e+4>>2]=t,n<<27>>31)}function er(e){var t=0;A:{e:{g:{r:{if((0|(e=sn(e)))<=268437502){if(!e)break A;if((0|e)==268436479)break e;if((0|e)!=268437247)break r;return 2}if((0|e)==268437503|(0|e)==268437759)break g;if((0|e)==268439295)break A}return-1}return 2}t=1}return t}function U(e){var t=0,n=0,r=0;A:{if(3&(t=e))for(;;){if(!c[0|t])break A;if(!(3&(t=t+1|0)))break}for(;n=t,t=t+4|0,!(~(r=s[n>>2])&r-16843009&-2139062144););for(;n=(t=n)+1|0,c[0|t];);}return t-e|0}function tr(e,t,n){var r,i=0,a=0,o=0;s[e+112>>2]=t,s[e+116>>2]=n,r=s[e+4>>2],i=s[e+44>>2]-r|0,s[e+120>>2]=i,s[e+124>>2]=i>>31,i=s[e+8>>2],t|n&&((0|n)>=(0|(o=(a=i-r|0)>>31))&t>>>0>=a>>>0|(0|n)>(0|o)||(i=t+r|0)),s[e+104>>2]=i}function nr(e,t){var n,r,i=0;if(f(+e),n=0|l(1),r=0|l(0),(0|(i=n>>>20&2047))!=2047){if(!i)return e==0?i=0:(e=nr(0x10000000000000000*e,t),i=s[t>>2]+-64|0),s[t>>2]=i,e;s[t>>2]=i-1022,u(0,0|r),u(1,-2146435073&n|1071644672),e=+d()}return e}function rr(e,t,n){return s[e+20>>2]!=s[e+28>>2]&&(Ui[s[e+36>>2]](e,0,0),!s[e+20>>2])||(s[e+28>>2]=0,s[e+16>>2]=0,s[e+20>>2]=0,Ui[s[e+40>>2]](e,t,n,0),(0|B)<0)?-1:(s[e+4>>2]=0,s[e+8>>2]=0,s[e>>2]=-17&s[e>>2],0)}function ir(e,t){var n,r,i=0;return(r=1-(i=.5*(n=e*e)))+(1-r-i+(n*(n*(n*(2480158728947673e-20*n-.001388888888887411)+.0416666666666666)+(i=n*n)*i*(n*(-11359647557788195e-27*n+2.087572321298175e-9)-2.7557314351390663e-7))-e*t))}function ar(e,t,n){var r=0,i=0;if(t)for(;n=n-1|0,i=e,e=Fi(e,t,10),r=B,a[0|n]=i-hr(e,r,10,0)|48,i=t>>>0>9,t=r,i;);if(e)for(;t=(e>>>0)/10|0,a[0|(n=n-1|0)]=e-v(t,10)|48,r=e>>>0>9,e=t,r;);return n}function or(e,t){var n=0,r=0,i=0;A:if(e){for(;i=a[t+n|0],(r=s[(n<<2)+e>>2])&&(n=n+1|0,(0|i)==(0|r)););e:switch(r-34|0){case 0:case 5:break e;default:break A}if(!i)return 0}return 1}function sr(e,t,n){var r,i=0;return z=r=z-16|0,!(64&t)&&(i=0,4259840&~t)||(s[r+12>>2]=n+4,i=s[n>>2]),s[r>>2]=i,s[r+4>>2]=0,(e=0|O(-100,0|e,32768|t,0|r))>>>0>=4294963201&&(s[56798]=0-e,e=-1),z=r+16|0,e}function cr(e,t,n){var r=0,i=0,a=0;if(!n)return 0;A:if(r=c[0|e]){for(;;){if((i=c[0|t])&&!(!(n=n-1|0)|(0|r)!=(0|i))){if(t=t+1|0,r=c[e+1|0],e=e+1|0,r)continue;break A}break}a=r}return(255&a)-c[0|t]|0}function lr(e,t){var n,r=0;z=r=z-128|0,r=Pt(r,0,128),a[r+98|0]=9,a[r+66|0]=9,a[r+34|0]=e,o[r+68>>1]=1,n=s[36125],s[r+104>>2]=n,s[r+72>>2]=n,s[r+40>>2]=s[144464+(e<<2)>>2],a[r+2|0]=9,s[r+8>>2]=n,xe(0,0,r+32|0,t,0),z=r+128|0}function ur(e){var t=0,n=0,r=0;if(a[s[e>>2]]-48>>>0>=10)return 0;for(;r=s[e>>2],n=-1,t>>>0<=214748364&&(n=(0|(n=a[0|r]-48|0))>(2147483647^(t=v(t,10)))?-1:n+t|0),s[e>>2]=r+1,t=n,a[r+1|0]-48>>>0<10;);return t}function dr(e,t){var n=0;if(!(!e|s[e>>2]-48>>>0>=10)){if(s[e>>2]-48>>>0<10)for(;n=(s[e>>2]+v(n,10)|0)-48|0,s[(e=e+4|0)>>2]-48>>>0<10;);(0|t)==1&&(n=(0|gr(s[e>>2]))==115?v(n,1e3):n)}return n}function fr(e){var t=0;t=1;A:{e:switch(0|an(e)){case 30:if(t=0,(0|e)==160|(0|e)==8199|(0|e)==8239)break A;return 1;case 0:if(e-9>>>0<5)return 1;if((0|e)==133)break A;break;case 28:case 29:break A;default:break e}t=0}return t}function pr(e,t,n){var r,i=0;return z=r=z-16|0,a[r+6|0]=0,a[r+7|0]=95,i=qn(i=t,t=r+8|0)+r|0,a[i+8|0]=32,a[i+9|0]=0,zn(e,r+7|0,n)||(a[r+7|0]=32,zn(e,t,n)||Ae(e,t,n,20,0,0,0)),z=r+16|0,a[0|n]}function mr(e){var t=0,n=0;n=170;A:if(!((0|e)<170))for(;;){if((0|e)==(0|n))return h[101616+(t<<1|2)>>1];if((2147483646&(t=t+2|0))==124)break A;if(!((0|(n=h[101616+(t<<1)>>1]))<=(0|e)))break}return 0}function hr(e,t,n,r){var i,a,o,s,c=0,l=0;return s=v(c=n>>>16|0,l=e>>>16|0),c=(65535&(l=((o=v(i=65535&n,a=65535&e))>>>16|0)+v(l,i)|0))+v(c,a)|0,B=(v(t,n)+s|0)+v(e,r)+(l>>>16)+(c>>>16)|0,65535&o|c<<16}function gr(e){var t=0,n=0,r=0,i=0;for(t=2778;;){if((0|(n=s[1040+((r=(t+i|0)/2|0)<<4)>>2]))==(0|e))return(t=s[1048+(r<<4)>>2])||e;if(!((0|(i=(n=e>>>0>n>>>0)?r+1|0:i))<=(0|(t=n?t:r-1|0))))break}return e}function _r(e){var t=0,n=0,r=0,i=0;for(t=2778;;){if((0|(n=s[1040+((r=(t+i|0)/2|0)<<4)>>2]))==(0|e))return(t=s[1044+(r<<4)>>2])||e;if(!((0|(i=(n=e>>>0>n>>>0)?r+1|0:i))<=(0|(t=n?t:r-1|0))))break}return e}function vr(e){var t,n=0;return z=t=z-112|0,(e=0|L(0|e,0|t))>>>0>=4294963201&&(s[56798]=0-e,e=-1),n=0-s[56798]|0,e||(n=-31,(61440&s[t+12>>2])!=16384&&(n=s[t+40>>2])),z=t+112|0,e=n}function yr(e,t,n){var r;if(!(r=s[e+16>>2]))return s[e+36>>2]=1,s[e+24>>2]=n,void(s[e+16>>2]=t);A:{if((0|t)==(0|r)){if(s[e+24>>2]!=2)break A;s[e+24>>2]=n;return}a[e+54|0]=1,s[e+24>>2]=2,s[e+36>>2]=s[e+36>>2]+1}}function br(e,t,n,r,i){var a;if(z=a=z-256|0,!(73728&i|(0|n)<=(0|r))){if(Pt(a,255&t,(n=(r=n-r|0)>>>0<256)?r:256),!n)for(;wi(e,a,256),(r=r-256|0)>>>0>255;);wi(e,a,r)}z=a+256|0}function xr(e,t,n){var r=0;A:{if(e){if(r=s[e>>2]){Re(s[r+4>>2]),r=s[e>>2];break A}if(r=ve(16),s[e>>2]=r,r)break A;t=48}return t}return s[r>>2]=0,s[r+4>>2]=ui(n),e=s[e>>2],s[e+8>>2]=0,s[e+12>>2]=0,t}function Sr(e){var t=0,n=0;$t(e),Ui[s[e+12>>2]](e),1&a[0|e]||((t=s[e+52>>2])&&(s[t+56>>2]=s[e+56>>2]),(n=s[e+56>>2])&&(s[n+52>>2]=t),s[56816]==(0|e)&&(s[56816]=n),Re(s[e+96>>2]),Re(e))}function Cr(e){var t=0,n=0;t=1;A:{e:{g:{r:switch((n=an(e))-9|0){case 1:break A;case 6:case 18:break g;case 0:break r;default:break e}return(0|gr(e))!=(0|e)}return le(e,n)>>>15&1}t=0}return t}function wr(e){var t,n,r,i=0,a=0;if(r=U(e)+1|0,i=s[33282],(0|(n=(t=s[33287])+r|0))>=s[33286]){if(!(i=Xe(i,a=n+1e3|0)))return-1;s[33286]=a,s[33282]=i}return ut(i+t|0,e,r),s[33287]=n,t}function Tr(e){var t=0;return t=s[e+72>>2],s[e+72>>2]=t-1|t,8&(t=s[e>>2])?(s[e>>2]=32|t,-1):(s[e+4>>2]=0,s[e+8>>2]=0,t=s[e+44>>2],s[e+28>>2]=t,s[e+20>>2]=t,s[e+16>>2]=t+s[e+48>>2],0)}function Er(e,t,n,r){A:if(e){e:switch(t+2|0){case 0:a[0|e]=n;return;case 1:o[e>>1]=n;return;case 2:case 3:s[e>>2]=n;return;case 5:break e;default:break A}s[e>>2]=n,s[e+4>>2]=r}}function Dr(e,t,n,r,i,a,o,c,l){var u;z=u=z-16|0,Le(u,t,n,r,i,a,o,c,-2147483648^l),r=s[u>>2],n=s[u+4>>2],t=s[u+12>>2],s[e+8>>2]=s[u+8>>2],s[e+12>>2]=t,s[e>>2]=r,s[e+4>>2]=n,z=u+16|0}function Or(e,t){var n=0,r=0;A:if(!(!(n=c[0|e])|(0|n)!=(0|(r=c[0|t]))))for(;;){if(r=c[t+1|0],!(n=c[e+1|0]))break A;if(t=t+1|0,e=e+1|0,(0|n)!=(0|r))break}return n-r|0}function kr(e,t){var n=0,r=0,i=0;if(!(n=s[e>>2]))return 84399;if(s[e+4>>2]!=(0|t))for(;;){if(!(n=s[(r=e+8|0)>>2]))return 84399;if(i=e,e=r,s[i+12>>2]==(0|t))break}return n}function Ar(e,t,n){var r=0,i=0,a=0;A:if(n){for(;;){if(!(!(r=s[t>>2])|!(i=s[e>>2])|(0|r)!=(0|i))){if(t=t+4|0,e=e+4|0,n=n-1|0)continue;break A}break}a=i-r|0}return a}function jr(e){var t,n=0,r=0;if((0|(t=s[36115]))>0)for(;;){if(!(!(r=s[144464+(n<<2)>>2])|s[r>>2]!=(0|e)))return c[r+10|0];if((0|t)==(0|(n=n+1|0)))break}return 0}function Mr(e){var t,n;return(e=(t=s[33175])+(n=e+7&-8)|0)>>>0<=t>>>0&&n||e>>>0>r.byteLength/65536<<16>>>0&&!(0|I(0|e))?(s[56798]=48,-1):(s[33175]=e,t)}function Nr(e){var t=0;A:if(!((t=an(e))>>>0>27)){if(!(1<>>14&1}return 0}function Pr(e,t){var n=0;return a[0|e]=t>>>24,a[0|(n=(t>>>0>16777215)+e|0)]=t>>>16,a[0|(n=n+!!(16711680&t)|0)]=t>>>8,a[0|(n=n+!!(65280&t)|0)]=t,a[n+!!(255&t)|0]=0,e}function Fr(e,t){A:if((0|(e=Jt(e,t)))<=268437502){if(!e|(0|e)==268436479|(0|e)!=268437247)break A;return}}function Ir(e){var t=0;return t=s[e>>2]-1|0,(t=a[121600+(v(0-t&t,124511785)>>>27|0)|0])||(e=s[e+4>>2],t=(e=a[121600+(v(0-e&e,124511785)>>>27|0)|0])?e+32|0:0),t}function Lr(e){var t=0,n=0,r=0;A:{if(!((t=an(e))>>>0>27)){if(n=1,116672&(r=1<>>10&1}n=0}return n}function Rr(e){var t=0,n=0,r=0;A:{if(!((t=an(e))>>>0>27)){if(n=1,34752&(r=1<>>10&1}n=0}return n}function zr(){var e,t=0;(e=s[56797])&&((t=s[e+8>>2])&&Ui[s[s[t>>2]+12>>2]](t),(t=s[e+4>>2])&&Ui[s[s[t>>2]+16>>2]](t),Re(e)),s[56797]=0,s[56797]=Ze()}function Br(e,t){var n=0;return e&&(n=hr(e,0,t,0),(e|t)>>>0<65536||(n=B?-1:n)),!(e=ve(n))|!(3&c[e-4|0])||Pt(e,0,n),e}function Vr(e,t){var n,r=s[130128+(t-v(n=(0|t)/100|0,100)<<2)>>2];s[e+100>>2]=r,s[e+96>>2]=r,t+99>>>0>=199&&(s[e+100>>2]=s[130128+(n<<2)>>2])}function Hr(e){var t=0;(t=ve(1344))&&(e=ut(t,e,1344),t=216192+(s[50758]<<4)|0,s[t>>2]=11,s[t+8>>2]=e,e=s[50758]+1|0,s[50758]=(0|e)<=169?e:0)}function Ur(e,t){var n=0;A:if(n=s[e>>2])for(;;){if(t&&!Or(t,n))break A;if(!(n=s[(e=e+8|0)>>2]))break}return s[e+4>>2]}function Wr(e){var t,n=0;return z=t=z-16|0,n=-1,$n(e)||(0|Ui[s[e+32>>2]](e,t+15|0,1))==1&&(n=c[t+15|0]),z=t+16|0,n}function Gr(e,t){var n=0,r=0;if(t){for(;r=e,(n=s[e>>2])&&(e=r+4|0,(0|t)!=(0|n)););return n?r:0}return(ii(e)<<2)+e|0}function Kr(e,t){var n=0,r=0;if(n=h[e>>1])for(;;){if(r=r+1|0,(0|t)==(0|n))return r;if(!(n=h[(r<<1)+e>>1]))break}return 0}function qr(e,t){var n=0,r=0;t>>>0<=31?(r=s[e>>2],n=e+4|0):(t=t-32|0,n=e),n=s[n>>2],s[e>>2]=r<>2]=n<>>32-t}function Jr(e,t){var n=0,r=0;n=s[e+4>>2],t>>>0<=31?r=s[e>>2]:(t=t-32|0,r=n,n=0),s[e+4>>2]=n>>>t,s[e>>2]=n<<32-t|r>>>t}function Yr(e){var t=0;e||=1;A:{for(;;){if(t=ve(e))break A;if(!(t=s[57276]))break;Ui[0|t]()}F(),p()}return t}function Xr(e){return e>>>0<=131071?c[117424+(e>>>3&31|c[117424+(e>>>8|0)|0]<<5)|0]>>>(7&e)&1:e>>>0<196606}function Zr(e,t,n,r,i,a,o,c,l){s[e>>2]=t,s[e+4>>2]=n,s[e+8>>2]=r,s[e+12>>2]=65535&i|(l>>>16&32768|i>>>16&32767)<<16}function Qr(e,t,n){return n?(0|e)==(0|t)?1:!Or(s[e+4>>2],s[t+4>>2]):s[e+4>>2]==s[t+4>>2]}function $r(e){var t=0;(0|(t=0|te(-100,0|e,0)))==-31&&(t=0|ee(0|e)),t>>>0>=4294963201&&(s[56798]=0-t)}function ei(){var e=ve(84)+80|0;s[e>>2]=125420,s[e>>2]=125380,s[e>>2]=125400,ae(0|e,125512,9),p()}function ti(e){var t,n;return t=Vn(e),n=Vn(e),Vn(e)<<16&16711680|n<<8&65280|255&t|Vn(e)<<24}function ni(e){var t=0;return e?(t=1,e-9472>>>0<160|e-65529>>>0<7||(t=fr(e)),t):0}function ri(e,t){var n;return n=t>>31,e=(s[e+76>>2],rr(e,t,n))}function ii(e){var t=0,n=0;for(n=e;n=(t=n)+4|0,s[t>>2];);return t-e>>2}function ai(e,t){return a[0|e]=t,a[e+4|0]=0,a[e+3|0]=t>>>24,a[e+2|0]=t>>>16,a[e+1|0]=t>>>8,e}function oi(e,t){var n=0;return(-1>>>(n=31&t)&e)<>>e}function si(e,t){var n=0;return(0|e)==73&&(n=305,c[t+173|0])||(n=gr(e)),n}function ci(e){s[36114]!=(0|e)&&(s[36115]=0,Lt(e),s[36114]=e,s[36115]+=1)}function li(e){return e?s[34460]+e|0:(pi(85328,20,s[30450]),s[32320])}function ui(e){var t,n;return(n=ve(t=U(e)+1|0))?ut(n,e,t):0}function di(){var e;s[33287]=0,(e=s[33282])&&(Re(e),s[33286]=0,s[33282]=0)}function fi(e,t,n){var r;z=r=z-16|0,s[r+12>>2]=n,Oi(e,t,n),z=r+16|0}function pi(e,t,n){e=(s[n+76>>2],xn(e,t,n))}function mi(e,t){return t?e<<24|(65280&e)<<8|e>>>8&65280|e>>>24:e}function hi(e){return e=e-8212>>>0>=12?Kr(93856,e):1}function gi(e){var t=0;e&&((t=s[e+688>>2])&&Re(t),Re(e))}function _i(e){return e=(0|e)<=127?xi(87712,e):0}function vi(e){return!(e=c[0|e]?1:Hn(e,e+1|0,3))}function yi(e){(e=(0|(e=0|T(0|e)))==27?0:e)&&(s[56798]=e)}function bi(e,t,n){return e|=0,t|=0,0|Ui[0|(n|=0)](e,t)}function xi(e,t){return e=dn(e,t),c[0|e]==(255&t)?e:0}function Si(e,t){return xt(e,t,2147483647),B=se,oe}function Ci(e){return e?31-x(e-1^e)|0:32}function wi(e,t,n){32&c[0|e]||xn(t,n,e)}function Ti(e,t,n){a[(Kt(e,t,n)+n|0)-1|0]=0}function Ei(e){return Bn(e,188776,189328)}function Di(e,t){t|=0,s[(e|=0)+8>>2]=t}function Oi(e,t,n){return zt(e,t,n,0,0)}function ki(e){return s[(e|=0)+12>>2]}function Ai(e){return s[(e|=0)+16>>2]}function ji(e){return s[(e|=0)+20>>2]}function Mi(e){return s[(e|=0)+8>>2]}function Ni(e){return s[(e|=0)+4>>2]}function Pi(e){return s[(e|=0)>>2]}function Fi(e,t,n){return xt(e,t,n)}function Ii(e){(e|=0)&&Re(e)}function Li(e,t){gn(U(e)+e|0,t)}function Ri(e){return 0|(e|=0)}function zi(e){return 0}function Bi(e){Re(e|=0)}function Vi(e){}i(t=c,1024,`ZGVmYXVsdAB3YgAAAAAAAEEAAAAAAAAAYQAAAAAAAABCAAAAAAAAAGIAAAAAAAAAQwAAAAAAAABjAAAAAAAAAEQAAAAAAAAAZAAAAAAAAABFAAAAAAAAAGUAAAAAAAAARgAAAAAAAABmAAAAAAAAAEcAAAAAAAAAZwAAAAAAAABIAAAAAAAAAGgAAAAAAAAASQAAAAAAAABpAAAAAAAAAEoAAAAAAAAAagAAAAAAAABLAAAAAAAAAGsAAAAAAAAATAAAAAAAAABsAAAAAAAAAE0AAAAAAAAAbQAAAAAAAABOAAAAAAAAAG4AAAAAAAAATwAAAAAAAABvAAAAAAAAAFAAAAAAAAAAcAAAAAAAAABRAAAAAAAAAHEAAAAAAAAAUgAAAAAAAAByAAAAAAAAAFMAAAAAAAAAcwAAAAAAAABUAAAAAAAAAHQAAAAAAAAAVQAAAAAAAAB1AAAAAAAAAFYAAAAAAAAAdgAAAAAAAABXAAAAAAAAAHcAAAAAAAAAWAAAAAAAAAB4AAAAAAAAAFkAAAAAAAAAeQAAAAAAAABaAAAAAAAAAHoAAAAAAAAAYQAAAEEAAAAAAAAAQQAAAGIAAABCAAAAAAAAAEIAAABjAAAAQwAAAAAAAABDAAAAZAAAAEQAAAAAAAAARAAAAGUAAABFAAAAAAAAAEUAAABmAAAARgAAAAAAAABGAAAAZwAAAEcAAAAAAAAARwAAAGgAAABIAAAAAAAAAEgAAABpAAAASQAAAAAAAABJAAAAagAAAEoAAAAAAAAASgAAAGsAAABLAAAAAAAAAEsAAABsAAAATAAAAAAAAABMAAAAbQAAAE0AAAAAAAAATQAAAG4AAABOAAAAAAAAAE4AAABvAAAATwAAAAAAAABPAAAAcAAAAFAAAAAAAAAAUAAAAHEAAABRAAAAAAAAAFEAAAByAAAAUgAAAAAAAABSAAAAcwAAAFMAAAAAAAAAUwAAAHQAAABUAAAAAAAAAFQAAAB1AAAAVQAAAAAAAABVAAAAdgAAAFYAAAAAAAAAVgAAAHcAAABXAAAAAAAAAFcAAAB4AAAAWAAAAAAAAABYAAAAeQAAAFkAAAAAAAAAWQAAAHoAAABaAAAAAAAAAFoAAAC1AAAAnAMAAAAAAACcAwAAwAAAAAAAAADgAAAAAAAAAMEAAAAAAAAA4QAAAAAAAADCAAAAAAAAAOIAAAAAAAAAwwAAAAAAAADjAAAAAAAAAMQAAAAAAAAA5AAAAAAAAADFAAAAAAAAAOUAAAAAAAAAxgAAAAAAAADmAAAAAAAAAMcAAAAAAAAA5wAAAAAAAADIAAAAAAAAAOgAAAAAAAAAyQAAAAAAAADpAAAAAAAAAMoAAAAAAAAA6gAAAAAAAADLAAAAAAAAAOsAAAAAAAAAzAAAAAAAAADsAAAAAAAAAM0AAAAAAAAA7QAAAAAAAADOAAAAAAAAAO4AAAAAAAAAzwAAAAAAAADvAAAAAAAAANAAAAAAAAAA8AAAAAAAAADRAAAAAAAAAPEAAAAAAAAA0gAAAAAAAADyAAAAAAAAANMAAAAAAAAA8wAAAAAAAADUAAAAAAAAAPQAAAAAAAAA1QAAAAAAAAD1AAAAAAAAANYAAAAAAAAA9gAAAAAAAADYAAAAAAAAAPgAAAAAAAAA2QAAAAAAAAD5AAAAAAAAANoAAAAAAAAA+gAAAAAAAADbAAAAAAAAAPsAAAAAAAAA3AAAAAAAAAD8AAAAAAAAAN0AAAAAAAAA/QAAAAAAAADeAAAAAAAAAP4AAAAAAAAA4AAAAMAAAAAAAAAAwAAAAOEAAADBAAAAAAAAAMEAAADiAAAAwgAAAAAAAADCAAAA4wAAAMMAAAAAAAAAwwAAAOQAAADEAAAAAAAAAMQAAADlAAAAxQAAAAAAAADFAAAA5gAAAMYAAAAAAAAAxgAAAOcAAADHAAAAAAAAAMcAAADoAAAAyAAAAAAAAADIAAAA6QAAAMkAAAAAAAAAyQAAAOoAAADKAAAAAAAAAMoAAADrAAAAywAAAAAAAADLAAAA7AAAAMwAAAAAAAAAzAAAAO0AAADNAAAAAAAAAM0AAADuAAAAzgAAAAAAAADOAAAA7wAAAM8AAAAAAAAAzwAAAPAAAADQAAAAAAAAANAAAADxAAAA0QAAAAAAAADRAAAA8gAAANIAAAAAAAAA0gAAAPMAAADTAAAAAAAAANMAAAD0AAAA1AAAAAAAAADUAAAA9QAAANUAAAAAAAAA1QAAAPYAAADWAAAAAAAAANYAAAD4AAAA2AAAAAAAAADYAAAA+QAAANkAAAAAAAAA2QAAAPoAAADaAAAAAAAAANoAAAD7AAAA2wAAAAAAAADbAAAA/AAAANwAAAAAAAAA3AAAAP0AAADdAAAAAAAAAN0AAAD+AAAA3gAAAAAAAADeAAAA/wAAAHgBAAAAAAAAeAEAAAABAAAAAAAAAQEAAAAAAAABAQAAAAEAAAAAAAAAAQAAAgEAAAAAAAADAQAAAAAAAAMBAAACAQAAAAAAAAIBAAAEAQAAAAAAAAUBAAAAAAAABQEAAAQBAAAAAAAABAEAAAYBAAAAAAAABwEAAAAAAAAHAQAABgEAAAAAAAAGAQAACAEAAAAAAAAJAQAAAAAAAAkBAAAIAQAAAAAAAAgBAAAKAQAAAAAAAAsBAAAAAAAACwEAAAoBAAAAAAAACgEAAAwBAAAAAAAADQEAAAAAAAANAQAADAEAAAAAAAAMAQAADgEAAAAAAAAPAQAAAAAAAA8BAAAOAQAAAAAAAA4BAAAQAQAAAAAAABEBAAAAAAAAEQEAABABAAAAAAAAEAEAABIBAAAAAAAAEwEAAAAAAAATAQAAEgEAAAAAAAASAQAAFAEAAAAAAAAVAQAAAAAAABUBAAAUAQAAAAAAABQBAAAWAQAAAAAAABcBAAAAAAAAFwEAABYBAAAAAAAAFgEAABgBAAAAAAAAGQEAAAAAAAAZAQAAGAEAAAAAAAAYAQAAGgEAAAAAAAAbAQAAAAAAABsBAAAaAQAAAAAAABoBAAAcAQAAAAAAAB0BAAAAAAAAHQEAABwBAAAAAAAAHAEAAB4BAAAAAAAAHwEAAAAAAAAfAQAAHgEAAAAAAAAeAQAAIAEAAAAAAAAhAQAAAAAAACEBAAAgAQAAAAAAACABAAAiAQAAAAAAACMBAAAAAAAAIwEAACIBAAAAAAAAIgEAACQBAAAAAAAAJQEAAAAAAAAlAQAAJAEAAAAAAAAkAQAAJgEAAAAAAAAnAQAAAAAAACcBAAAmAQAAAAAAACYBAAAoAQAAAAAAACkBAAAAAAAAKQEAACgBAAAAAAAAKAEAACoBAAAAAAAAKwEAAAAAAAArAQAAKgEAAAAAAAAqAQAALAEAAAAAAAAtAQAAAAAAAC0BAAAsAQAAAAAAACwBAAAuAQAAAAAAAC8BAAAAAAAALwEAAC4BAAAAAAAALgEAADABAAAAAAAAaQAAAAAAAAAxAQAASQAAAAAAAABJAAAAMgEAAAAAAAAzAQAAAAAAADMBAAAyAQAAAAAAADIBAAA0AQAAAAAAADUBAAAAAAAANQEAADQBAAAAAAAANAEAADYBAAAAAAAANwEAAAAAAAA3AQAANgEAAAAAAAA2AQAAOQEAAAAAAAA6AQAAAAAAADoBAAA5AQAAAAAAADkBAAA7AQAAAAAAADwBAAAAAAAAPAEAADsBAAAAAAAAOwEAAD0BAAAAAAAAPgEAAAAAAAA+AQAAPQEAAAAAAAA9AQAAPwEAAAAAAABAAQAAAAAAAEABAAA/AQAAAAAAAD8BAABBAQAAAAAAAEIBAAAAAAAAQgEAAEEBAAAAAAAAQQEAAEMBAAAAAAAARAEAAAAAAABEAQAAQwEAAAAAAABDAQAARQEAAAAAAABGAQAAAAAAAEYBAABFAQAAAAAAAEUBAABHAQAAAAAAAEgBAAAAAAAASAEAAEcBAAAAAAAARwEAAEoBAAAAAAAASwEAAAAAAABLAQAASgEAAAAAAABKAQAATAEAAAAAAABNAQAAAAAAAE0BAABMAQAAAAAAAEwBAABOAQAAAAAAAE8BAAAAAAAATwEAAE4BAAAAAAAATgEAAFABAAAAAAAAUQEAAAAAAABRAQAAUAEAAAAAAABQAQAAUgEAAAAAAABTAQAAAAAAAFMBAABSAQAAAAAAAFIBAABUAQAAAAAAAFUBAAAAAAAAVQEAAFQBAAAAAAAAVAEAAFYBAAAAAAAAVwEAAAAAAABXAQAAVgEAAAAAAABWAQAAWAEAAAAAAABZAQAAAAAAAFkBAABYAQAAAAAAAFgBAABaAQAAAAAAAFsBAAAAAAAAWwEAAFoBAAAAAAAAWgEAAFwBAAAAAAAAXQEAAAAAAABdAQAAXAEAAAAAAABcAQAAXgEAAAAAAABfAQAAAAAAAF8BAABeAQAAAAAAAF4BAABgAQAAAAAAAGEBAAAAAAAAYQEAAGABAAAAAAAAYAEAAGIBAAAAAAAAYwEAAAAAAABjAQAAYgEAAAAAAABiAQAAZAEAAAAAAABlAQAAAAAAAGUBAABkAQAAAAAAAGQBAABmAQAAAAAAAGcBAAAAAAAAZwEAAGYBAAAAAAAAZgEAAGgBAAAAAAAAaQEAAAAAAABpAQAAaAEAAAAAAABoAQAAagEAAAAAAABrAQAAAAAAAGsBAABqAQAAAAAAAGoBAABsAQAAAAAAAG0BAAAAAAAAbQEAAGwBAAAAAAAAbAEAAG4BAAAAAAAAbwEAAAAAAABvAQAAbgEAAAAAAABuAQAAcAEAAAAAAABxAQAAAAAAAHEBAABwAQAAAAAAAHABAAByAQAAAAAAAHMBAAAAAAAAcwEAAHIBAAAAAAAAcgEAAHQBAAAAAAAAdQEAAAAAAAB1AQAAdAEAAAAAAAB0AQAAdgEAAAAAAAB3AQAAAAAAAHcBAAB2AQAAAAAAAHYBAAB4AQAAAAAAAP8AAAAAAAAAeQEAAAAAAAB6AQAAAAAAAHoBAAB5AQAAAAAAAHkBAAB7AQAAAAAAAHwBAAAAAAAAfAEAAHsBAAAAAAAAewEAAH0BAAAAAAAAfgEAAAAAAAB+AQAAfQEAAAAAAAB9AQAAfwEAAFMAAAAAAAAAUwAAAIABAABDAgAAAAAAAEMCAACBAQAAAAAAAFMCAAAAAAAAggEAAAAAAACDAQAAAAAAAIMBAACCAQAAAAAAAIIBAACEAQAAAAAAAIUBAAAAAAAAhQEAAIQBAAAAAAAAhAEAAIYBAAAAAAAAVAIAAAAAAACHAQAAAAAAAIgBAAAAAAAAiAEAAIcBAAAAAAAAhwEAAIkBAAAAAAAAVgIAAAAAAACKAQAAAAAAAFcCAAAAAAAAiwEAAAAAAACMAQAAAAAAAIwBAACLAQAAAAAAAIsBAACOAQAAAAAAAN0BAAAAAAAAjwEAAAAAAABZAgAAAAAAAJABAAAAAAAAWwIAAAAAAACRAQAAAAAAAJIBAAAAAAAAkgEAAJEBAAAAAAAAkQEAAJMBAAAAAAAAYAIAAAAAAACUAQAAAAAAAGMCAAAAAAAAlQEAAPYBAAAAAAAA9gEAAJYBAAAAAAAAaQIAAAAAAACXAQAAAAAAAGgCAAAAAAAAmAEAAAAAAACZAQAAAAAAAJkBAACYAQAAAAAAAJgBAACaAQAAPQIAAAAAAAA9AgAAnAEAAAAAAABvAgAAAAAAAJ0BAAAAAAAAcgIAAAAAAACeAQAAIAIAAAAAAAAgAgAAnwEAAAAAAAB1AgAAAAAAAKABAAAAAAAAoQEAAAAAAAChAQAAoAEAAAAAAACgAQAAogEAAAAAAACjAQAAAAAAAKMBAACiAQAAAAAAAKIBAACkAQAAAAAAAKUBAAAAAAAApQEAAKQBAAAAAAAApAEAAKYBAAAAAAAAgAIAAAAAAACnAQAAAAAAAKgBAAAAAAAAqAEAAKcBAAAAAAAApwEAAKkBAAAAAAAAgwIAAAAAAACsAQAAAAAAAK0BAAAAAAAArQEAAKwBAAAAAAAArAEAAK4BAAAAAAAAiAIAAAAAAACvAQAAAAAAALABAAAAAAAAsAEAAK8BAAAAAAAArwEAALEBAAAAAAAAigIAAAAAAACyAQAAAAAAAIsCAAAAAAAAswEAAAAAAAC0AQAAAAAAALQBAACzAQAAAAAAALMBAAC1AQAAAAAAALYBAAAAAAAAtgEAALUBAAAAAAAAtQEAALcBAAAAAAAAkgIAAAAAAAC4AQAAAAAAALkBAAAAAAAAuQEAALgBAAAAAAAAuAEAALwBAAAAAAAAvQEAAAAAAAC9AQAAvAEAAAAAAAC8AQAAvwEAAPcBAAAAAAAA9wEAAMQBAAAAAAAAxgEAAMUBAADFAQAAxAEAAMYBAADFAQAAxgEAAMQBAAAAAAAAxQEAAMcBAAAAAAAAyQEAAMgBAADIAQAAxwEAAMkBAADIAQAAyQEAAMcBAAAAAAAAyAEAAMoBAAAAAAAAzAEAAMsBAADLAQAAygEAAMwBAADLAQAAzAEAAMoBAAAAAAAAywEAAM0BAAAAAAAAzgEAAAAAAADOAQAAzQEAAAAAAADNAQAAzwEAAAAAAADQAQAAAAAAANABAADPAQAAAAAAAM8BAADRAQAAAAAAANIBAAAAAAAA0gEAANEBAAAAAAAA0QEAANMBAAAAAAAA1AEAAAAAAADUAQAA0wEAAAAAAADTAQAA1QEAAAAAAADWAQAAAAAAANYBAADVAQAAAAAAANUBAADXAQAAAAAAANgBAAAAAAAA2AEAANcBAAAAAAAA1wEAANkBAAAAAAAA2gEAAAAAAADaAQAA2QEAAAAAAADZAQAA2wEAAAAAAADcAQAAAAAAANwBAADbAQAAAAAAANsBAADdAQAAjgEAAAAAAACOAQAA3gEAAAAAAADfAQAAAAAAAN8BAADeAQAAAAAAAN4BAADgAQAAAAAAAOEBAAAAAAAA4QEAAOABAAAAAAAA4AEAAOIBAAAAAAAA4wEAAAAAAADjAQAA4gEAAAAAAADiAQAA5AEAAAAAAADlAQAAAAAAAOUBAADkAQAAAAAAAOQBAADmAQAAAAAAAOcBAAAAAAAA5wEAAOYBAAAAAAAA5gEAAOgBAAAAAAAA6QEAAAAAAADpAQAA6AEAAAAAAADoAQAA6gEAAAAAAADrAQAAAAAAAOsBAADqAQAAAAAAAOoBAADsAQAAAAAAAO0BAAAAAAAA7QEAAOwBAAAAAAAA7AEAAO4BAAAAAAAA7wEAAAAAAADvAQAA7gEAAAAAAADuAQAA8QEAAAAAAADzAQAA8gEAAPIBAADxAQAA8wEAAPIBAADzAQAA8QEAAAAAAADyAQAA9AEAAAAAAAD1AQAAAAAAAPUBAAD0AQAAAAAAAPQBAAD2AQAAAAAAAJUBAAAAAAAA9wEAAAAAAAC/AQAAAAAAAPgBAAAAAAAA+QEAAAAAAAD5AQAA+AEAAAAAAAD4AQAA+gEAAAAAAAD7AQAAAAAAAPsBAAD6AQAAAAAAAPoBAAD8AQAAAAAAAP0BAAAAAAAA/QEAAPwBAAAAAAAA/AEAAP4BAAAAAAAA/wEAAAAAAAD/AQAA/gEAAAAAAAD+AQAAAAIAAAAAAAABAgAAAAAAAAECAAAAAgAAAAAAAAACAAACAgAAAAAAAAMCAAAAAAAAAwIAAAICAAAAAAAAAgIAAAQCAAAAAAAABQIAAAAAAAAFAgAABAIAAAAAAAAEAgAABgIAAAAAAAAHAgAAAAAAAAcCAAAGAgAAAAAAAAYCAAAIAgAAAAAAAAkCAAAAAAAACQIAAAgCAAAAAAAACAIAAAoCAAAAAAAACwIAAAAAAAALAgAACgIAAAAAAAAKAgAADAIAAAAAAAANAgAAAAAAAA0CAAAMAgAAAAAAAAwCAAAOAgAAAAAAAA8CAAAAAAAADwIAAA4CAAAAAAAADgIAABACAAAAAAAAEQIAAAAAAAARAgAAEAIAAAAAAAAQAgAAEgIAAAAAAAATAgAAAAAAABMCAAASAgAAAAAAABICAAAUAgAAAAAAABUCAAAAAAAAFQIAABQCAAAAAAAAFAIAABYCAAAAAAAAFwIAAAAAAAAXAgAAFgIAAAAAAAAWAgAAGAIAAAAAAAAZAgAAAAAAABkCAAAYAgAAAAAAABgCAAAaAgAAAAAAABsCAAAAAAAAGwIAABoCAAAAAAAAGgIAABwCAAAAAAAAHQIAAAAAAAAdAgAAHAIAAAAAAAAcAgAAHgIAAAAAAAAfAgAAAAAAAB8CAAAeAgAAAAAAAB4CAAAgAgAAAAAAAJ4BAAAAAAAAIgIAAAAAAAAjAgAAAAAAACMCAAAiAgAAAAAAACICAAAkAgAAAAAAACUCAAAAAAAAJQIAACQCAAAAAAAAJAIAACYCAAAAAAAAJwIAAAAAAAAnAgAAJgIAAAAAAAAmAgAAKAIAAAAAAAApAgAAAAAAACkCAAAoAgAAAAAAACgCAAAqAgAAAAAAACsCAAAAAAAAKwIAACoCAAAAAAAAKgIAACwCAAAAAAAALQIAAAAAAAAtAgAALAIAAAAAAAAsAgAALgIAAAAAAAAvAgAAAAAAAC8CAAAuAgAAAAAAAC4CAAAwAgAAAAAAADECAAAAAAAAMQIAADACAAAAAAAAMAIAADICAAAAAAAAMwIAAAAAAAAzAgAAMgIAAAAAAAAyAgAAOgIAAAAAAABlLAAAAAAAADsCAAAAAAAAPAIAAAAAAAA8AgAAOwIAAAAAAAA7AgAAPQIAAAAAAACaAQAAAAAAAD4CAAAAAAAAZiwAAAAAAAA/AgAAfiwAAAAAAAB+LAAAQAIAAH8sAAAAAAAAfywAAEECAAAAAAAAQgIAAAAAAABCAgAAQQIAAAAAAABBAgAAQwIAAAAAAACAAQAAAAAAAEQCAAAAAAAAiQIAAAAAAABFAgAAAAAAAIwCAAAAAAAARgIAAAAAAABHAgAAAAAAAEcCAABGAgAAAAAAAEYCAABIAgAAAAAAAEkCAAAAAAAASQIAAEgCAAAAAAAASAIAAEoCAAAAAAAASwIAAAAAAABLAgAASgIAAAAAAABKAgAATAIAAAAAAABNAgAAAAAAAE0CAABMAgAAAAAAAEwCAABOAgAAAAAAAE8CAAAAAAAATwIAAE4CAAAAAAAATgIAAFACAABvLAAAAAAAAG8sAABRAgAAbSwAAAAAAABtLAAAUgIAAHAsAAAAAAAAcCwAAFMCAACBAQAAAAAAAIEBAABUAgAAhgEAAAAAAACGAQAAVgIAAIkBAAAAAAAAiQEAAFcCAACKAQAAAAAAAIoBAABZAgAAjwEAAAAAAACPAQAAWwIAAJABAAAAAAAAkAEAAFwCAACrpwAAAAAAAKunAABgAgAAkwEAAAAAAACTAQAAYQIAAKynAAAAAAAArKcAAGMCAACUAQAAAAAAAJQBAABlAgAAjacAAAAAAACNpwAAZgIAAKqnAAAAAAAAqqcAAGgCAACXAQAAAAAAAJcBAABpAgAAlgEAAAAAAACWAQAAagIAAK6nAAAAAAAArqcAAGsCAABiLAAAAAAAAGIsAABsAgAAracAAAAAAACtpwAAbwIAAJwBAAAAAAAAnAEAAHECAABuLAAAAAAAAG4sAAByAgAAnQEAAAAAAACdAQAAdQIAAJ8BAAAAAAAAnwEAAH0CAABkLAAAAAAAAGQsAACAAgAApgEAAAAAAACmAQAAgwIAAKkBAAAAAAAAqQEAAIcCAACxpwAAAAAAALGnAACIAgAArgEAAAAAAACuAQAAiQIAAEQCAAAAAAAARAIAAIoCAACxAQAAAAAAALEBAACLAgAAsgEAAAAAAACyAQAAjAIAAEUCAAAAAAAARQIAAJICAAC3AQAAAAAAALcBAACdAgAAsqcAAAAAAACypwAAngIAALCnAAAAAAAAsKcAAEUDAACZAwAAAAAAAJkDAABwAwAAAAAAAHEDAAAAAAAAcQMAAHADAAAAAAAAcAMAAHIDAAAAAAAAcwMAAAAAAABzAwAAcgMAAAAAAAByAwAAdgMAAAAAAAB3AwAAAAAAAHcDAAB2AwAAAAAAAHYDAAB7AwAA/QMAAAAAAAD9AwAAfAMAAP4DAAAAAAAA/gMAAH0DAAD/AwAAAAAAAP8DAAB/AwAAAAAAAPMDAAAAAAAAhgMAAAAAAACsAwAAAAAAAIgDAAAAAAAArQMAAAAAAACJAwAAAAAAAK4DAAAAAAAAigMAAAAAAACvAwAAAAAAAIwDAAAAAAAAzAMAAAAAAACOAwAAAAAAAM0DAAAAAAAAjwMAAAAAAADOAwAAAAAAAJEDAAAAAAAAsQMAAAAAAACSAwAAAAAAALIDAAAAAAAAkwMAAAAAAACzAwAAAAAAAJQDAAAAAAAAtAMAAAAAAACVAwAAAAAAALUDAAAAAAAAlgMAAAAAAAC2AwAAAAAAAJcDAAAAAAAAtwMAAAAAAACYAwAAAAAAALgDAAAAAAAAmQMAAAAAAAC5AwAAAAAAAJoDAAAAAAAAugMAAAAAAACbAwAAAAAAALsDAAAAAAAAnAMAAAAAAAC8AwAAAAAAAJ0DAAAAAAAAvQMAAAAAAACeAwAAAAAAAL4DAAAAAAAAnwMAAAAAAAC/AwAAAAAAAKADAAAAAAAAwAMAAAAAAAChAwAAAAAAAMEDAAAAAAAAowMAAAAAAADDAwAAAAAAAKQDAAAAAAAAxAMAAAAAAAClAwAAAAAAAMUDAAAAAAAApgMAAAAAAADGAwAAAAAAAKcDAAAAAAAAxwMAAAAAAACoAwAAAAAAAMgDAAAAAAAAqQMAAAAAAADJAwAAAAAAAKoDAAAAAAAAygMAAAAAAACrAwAAAAAAAMsDAAAAAAAArAMAAIYDAAAAAAAAhgMAAK0DAACIAwAAAAAAAIgDAACuAwAAiQMAAAAAAACJAwAArwMAAIoDAAAAAAAAigMAALEDAACRAwAAAAAAAJEDAACyAwAAkgMAAAAAAACSAwAAswMAAJMDAAAAAAAAkwMAALQDAACUAwAAAAAAAJQDAAC1AwAAlQMAAAAAAACVAwAAtgMAAJYDAAAAAAAAlgMAALcDAACXAwAAAAAAAJcDAAC4AwAAmAMAAAAAAACYAwAAuQMAAJkDAAAAAAAAmQMAALoDAACaAwAAAAAAAJoDAAC7AwAAmwMAAAAAAACbAwAAvAMAAJwDAAAAAAAAnAMAAL0DAACdAwAAAAAAAJ0DAAC+AwAAngMAAAAAAACeAwAAvwMAAJ8DAAAAAAAAnwMAAMADAACgAwAAAAAAAKADAADBAwAAoQMAAAAAAAChAwAAwgMAAKMDAAAAAAAAowMAAMMDAACjAwAAAAAAAKMDAADEAwAApAMAAAAAAACkAwAAxQMAAKUDAAAAAAAApQMAAMYDAACmAwAAAAAAAKYDAADHAwAApwMAAAAAAACnAwAAyAMAAKgDAAAAAAAAqAMAAMkDAACpAwAAAAAAAKkDAADKAwAAqgMAAAAAAACqAwAAywMAAKsDAAAAAAAAqwMAAMwDAACMAwAAAAAAAIwDAADNAwAAjgMAAAAAAACOAwAAzgMAAI8DAAAAAAAAjwMAAM8DAAAAAAAA1wMAAAAAAADQAwAAkgMAAAAAAACSAwAA0QMAAJgDAAAAAAAAmAMAANUDAACmAwAAAAAAAKYDAADWAwAAoAMAAAAAAACgAwAA1wMAAM8DAAAAAAAAzwMAANgDAAAAAAAA2QMAAAAAAADZAwAA2AMAAAAAAADYAwAA2gMAAAAAAADbAwAAAAAAANsDAADaAwAAAAAAANoDAADcAwAAAAAAAN0DAAAAAAAA3QMAANwDAAAAAAAA3AMAAN4DAAAAAAAA3wMAAAAAAADfAwAA3gMAAAAAAADeAwAA4AMAAAAAAADhAwAAAAAAAOEDAADgAwAAAAAAAOADAADiAwAAAAAAAOMDAAAAAAAA4wMAAOIDAAAAAAAA4gMAAOQDAAAAAAAA5QMAAAAAAADlAwAA5AMAAAAAAADkAwAA5gMAAAAAAADnAwAAAAAAAOcDAADmAwAAAAAAAOYDAADoAwAAAAAAAOkDAAAAAAAA6QMAAOgDAAAAAAAA6AMAAOoDAAAAAAAA6wMAAAAAAADrAwAA6gMAAAAAAADqAwAA7AMAAAAAAADtAwAAAAAAAO0DAADsAwAAAAAAAOwDAADuAwAAAAAAAO8DAAAAAAAA7wMAAO4DAAAAAAAA7gMAAPADAACaAwAAAAAAAJoDAADxAwAAoQMAAAAAAAChAwAA8gMAAPkDAAAAAAAA+QMAAPMDAAB/AwAAAAAAAH8DAAD0AwAAAAAAALgDAAAAAAAA9QMAAJUDAAAAAAAAlQMAAPcDAAAAAAAA+AMAAAAAAAD4AwAA9wMAAAAAAAD3AwAA+QMAAAAAAADyAwAAAAAAAPoDAAAAAAAA+wMAAAAAAAD7AwAA+gMAAAAAAAD6AwAA/QMAAAAAAAB7AwAAAAAAAP4DAAAAAAAAfAMAAAAAAAD/AwAAAAAAAH0DAAAAAAAAAAQAAAAAAABQBAAAAAAAAAEEAAAAAAAAUQQAAAAAAAACBAAAAAAAAFIEAAAAAAAAAwQAAAAAAABTBAAAAAAAAAQEAAAAAAAAVAQAAAAAAAAFBAAAAAAAAFUEAAAAAAAABgQAAAAAAABWBAAAAAAAAAcEAAAAAAAAVwQAAAAAAAAIBAAAAAAAAFgEAAAAAAAACQQAAAAAAABZBAAAAAAAAAoEAAAAAAAAWgQAAAAAAAALBAAAAAAAAFsEAAAAAAAADAQAAAAAAABcBAAAAAAAAA0EAAAAAAAAXQQAAAAAAAAOBAAAAAAAAF4EAAAAAAAADwQAAAAAAABfBAAAAAAAABAEAAAAAAAAMAQAAAAAAAARBAAAAAAAADEEAAAAAAAAEgQAAAAAAAAyBAAAAAAAABMEAAAAAAAAMwQAAAAAAAAUBAAAAAAAADQEAAAAAAAAFQQAAAAAAAA1BAAAAAAAABYEAAAAAAAANgQAAAAAAAAXBAAAAAAAADcEAAAAAAAAGAQAAAAAAAA4BAAAAAAAABkEAAAAAAAAOQQAAAAAAAAaBAAAAAAAADoEAAAAAAAAGwQAAAAAAAA7BAAAAAAAABwEAAAAAAAAPAQAAAAAAAAdBAAAAAAAAD0EAAAAAAAAHgQAAAAAAAA+BAAAAAAAAB8EAAAAAAAAPwQAAAAAAAAgBAAAAAAAAEAEAAAAAAAAIQQAAAAAAABBBAAAAAAAACIEAAAAAAAAQgQAAAAAAAAjBAAAAAAAAEMEAAAAAAAAJAQAAAAAAABEBAAAAAAAACUEAAAAAAAARQQAAAAAAAAmBAAAAAAAAEYEAAAAAAAAJwQAAAAAAABHBAAAAAAAACgEAAAAAAAASAQAAAAAAAApBAAAAAAAAEkEAAAAAAAAKgQAAAAAAABKBAAAAAAAACsEAAAAAAAASwQAAAAAAAAsBAAAAAAAAEwEAAAAAAAALQQAAAAAAABNBAAAAAAAAC4EAAAAAAAATgQAAAAAAAAvBAAAAAAAAE8EAAAAAAAAMAQAABAEAAAAAAAAEAQAADEEAAARBAAAAAAAABEEAAAyBAAAEgQAAAAAAAASBAAAMwQAABMEAAAAAAAAEwQAADQEAAAUBAAAAAAAABQEAAA1BAAAFQQAAAAAAAAVBAAANgQAABYEAAAAAAAAFgQAADcEAAAXBAAAAAAAABcEAAA4BAAAGAQAAAAAAAAYBAAAOQQAABkEAAAAAAAAGQQAADoEAAAaBAAAAAAAABoEAAA7BAAAGwQAAAAAAAAbBAAAPAQAABwEAAAAAAAAHAQAAD0EAAAdBAAAAAAAAB0EAAA+BAAAHgQAAAAAAAAeBAAAPwQAAB8EAAAAAAAAHwQAAEAEAAAgBAAAAAAAACAEAABBBAAAIQQAAAAAAAAhBAAAQgQAACIEAAAAAAAAIgQAAEMEAAAjBAAAAAAAACMEAABEBAAAJAQAAAAAAAAkBAAARQQAACUEAAAAAAAAJQQAAEYEAAAmBAAAAAAAACYEAABHBAAAJwQAAAAAAAAnBAAASAQAACgEAAAAAAAAKAQAAEkEAAApBAAAAAAAACkEAABKBAAAKgQAAAAAAAAqBAAASwQAACsEAAAAAAAAKwQAAEwEAAAsBAAAAAAAACwEAABNBAAALQQAAAAAAAAtBAAATgQAAC4EAAAAAAAALgQAAE8EAAAvBAAAAAAAAC8EAABQBAAAAAQAAAAAAAAABAAAUQQAAAEEAAAAAAAAAQQAAFIEAAACBAAAAAAAAAIEAABTBAAAAwQAAAAAAAADBAAAVAQAAAQEAAAAAAAABAQAAFUEAAAFBAAAAAAAAAUEAABWBAAABgQAAAAAAAAGBAAAVwQAAAcEAAAAAAAABwQAAFgEAAAIBAAAAAAAAAgEAABZBAAACQQAAAAAAAAJBAAAWgQAAAoEAAAAAAAACgQAAFsEAAALBAAAAAAAAAsEAABcBAAADAQAAAAAAAAMBAAAXQQAAA0EAAAAAAAADQQAAF4EAAAOBAAAAAAAAA4EAABfBAAADwQAAAAAAAAPBAAAYAQAAAAAAABhBAAAAAAAAGEEAABgBAAAAAAAAGAEAABiBAAAAAAAAGMEAAAAAAAAYwQAAGIEAAAAAAAAYgQAAGQEAAAAAAAAZQQAAAAAAABlBAAAZAQAAAAAAABkBAAAZgQAAAAAAABnBAAAAAAAAGcEAABmBAAAAAAAAGYEAABoBAAAAAAAAGkEAAAAAAAAaQQAAGgEAAAAAAAAaAQAAGoEAAAAAAAAawQAAAAAAABrBAAAagQAAAAAAABqBAAAbAQAAAAAAABtBAAAAAAAAG0EAABsBAAAAAAAAGwEAABuBAAAAAAAAG8EAAAAAAAAbwQAAG4EAAAAAAAAbgQAAHAEAAAAAAAAcQQAAAAAAABxBAAAcAQAAAAAAABwBAAAcgQAAAAAAABzBAAAAAAAAHMEAAByBAAAAAAAAHIEAAB0BAAAAAAAAHUEAAAAAAAAdQQAAHQEAAAAAAAAdAQAAHYEAAAAAAAAdwQAAAAAAAB3BAAAdgQAAAAAAAB2BAAAeAQAAAAAAAB5BAAAAAAAAHkEAAB4BAAAAAAAAHgEAAB6BAAAAAAAAHsEAAAAAAAAewQAAHoEAAAAAAAAegQAAHwEAAAAAAAAfQQAAAAAAAB9BAAAfAQAAAAAAAB8BAAAfgQAAAAAAAB/BAAAAAAAAH8EAAB+BAAAAAAAAH4EAACABAAAAAAAAIEEAAAAAAAAgQQAAIAEAAAAAAAAgAQAAIoEAAAAAAAAiwQAAAAAAACLBAAAigQAAAAAAACKBAAAjAQAAAAAAACNBAAAAAAAAI0EAACMBAAAAAAAAIwEAACOBAAAAAAAAI8EAAAAAAAAjwQAAI4EAAAAAAAAjgQAAJAEAAAAAAAAkQQAAAAAAACRBAAAkAQAAAAAAACQBAAAkgQAAAAAAACTBAAAAAAAAJMEAACSBAAAAAAAAJIEAACUBAAAAAAAAJUEAAAAAAAAlQQAAJQEAAAAAAAAlAQAAJYEAAAAAAAAlwQAAAAAAACXBAAAlgQAAAAAAACWBAAAmAQAAAAAAACZBAAAAAAAAJkEAACYBAAAAAAAAJgEAACaBAAAAAAAAJsEAAAAAAAAmwQAAJoEAAAAAAAAmgQAAJwEAAAAAAAAnQQAAAAAAACdBAAAnAQAAAAAAACcBAAAngQAAAAAAACfBAAAAAAAAJ8EAACeBAAAAAAAAJ4EAACgBAAAAAAAAKEEAAAAAAAAoQQAAKAEAAAAAAAAoAQAAKIEAAAAAAAAowQAAAAAAACjBAAAogQAAAAAAACiBAAApAQAAAAAAAClBAAAAAAAAKUEAACkBAAAAAAAAKQEAACmBAAAAAAAAKcEAAAAAAAApwQAAKYEAAAAAAAApgQAAKgEAAAAAAAAqQQAAAAAAACpBAAAqAQAAAAAAACoBAAAqgQAAAAAAACrBAAAAAAAAKsEAACqBAAAAAAAAKoEAACsBAAAAAAAAK0EAAAAAAAArQQAAKwEAAAAAAAArAQAAK4EAAAAAAAArwQAAAAAAACvBAAArgQAAAAAAACuBAAAsAQAAAAAAACxBAAAAAAAALEEAACwBAAAAAAAALAEAACyBAAAAAAAALMEAAAAAAAAswQAALIEAAAAAAAAsgQAALQEAAAAAAAAtQQAAAAAAAC1BAAAtAQAAAAAAAC0BAAAtgQAAAAAAAC3BAAAAAAAALcEAAC2BAAAAAAAALYEAAC4BAAAAAAAALkEAAAAAAAAuQQAALgEAAAAAAAAuAQAALoEAAAAAAAAuwQAAAAAAAC7BAAAugQAAAAAAAC6BAAAvAQAAAAAAAC9BAAAAAAAAL0EAAC8BAAAAAAAALwEAAC+BAAAAAAAAL8EAAAAAAAAvwQAAL4EAAAAAAAAvgQAAMAEAAAAAAAAzwQAAAAAAADBBAAAAAAAAMIEAAAAAAAAwgQAAMEEAAAAAAAAwQQAAMMEAAAAAAAAxAQAAAAAAADEBAAAwwQAAAAAAADDBAAAxQQAAAAAAADGBAAAAAAAAMYEAADFBAAAAAAAAMUEAADHBAAAAAAAAMgEAAAAAAAAyAQAAMcEAAAAAAAAxwQAAMkEAAAAAAAAygQAAAAAAADKBAAAyQQAAAAAAADJBAAAywQAAAAAAADMBAAAAAAAAMwEAADLBAAAAAAAAMsEAADNBAAAAAAAAM4EAAAAAAAAzgQAAM0EAAAAAAAAzQQAAM8EAADABAAAAAAAAMAEAADQBAAAAAAAANEEAAAAAAAA0QQAANAEAAAAAAAA0AQAANIEAAAAAAAA0wQAAAAAAADTBAAA0gQAAAAAAADSBAAA1AQAAAAAAADVBAAAAAAAANUEAADUBAAAAAAAANQEAADWBAAAAAAAANcEAAAAAAAA1wQAANYEAAAAAAAA1gQAANgEAAAAAAAA2QQAAAAAAADZBAAA2AQAAAAAAADYBAAA2gQAAAAAAADbBAAAAAAAANsEAADaBAAAAAAAANoEAADcBAAAAAAAAN0EAAAAAAAA3QQAANwEAAAAAAAA3AQAAN4EAAAAAAAA3wQAAAAAAADfBAAA3gQAAAAAAADeBAAA4AQAAAAAAADhBAAAAAAAAOEEAADgBAAAAAAAAOAEAADiBAAAAAAAAOMEAAAAAAAA4wQAAOIEAAAAAAAA4gQAAOQEAAAAAAAA5QQAAAAAAADlBAAA5AQAAAAAAADkBAAA5gQAAAAAAADnBAAAAAAAAOcEAADmBAAAAAAAAOYEAADoBAAAAAAAAOkEAAAAAAAA6QQAAOgEAAAAAAAA6AQAAOoEAAAAAAAA6wQAAAAAAADrBAAA6gQAAAAAAADqBAAA7AQAAAAAAADtBAAAAAAAAO0EAADsBAAAAAAAAOwEAADuBAAAAAAAAO8EAAAAAAAA7wQAAO4EAAAAAAAA7gQAAPAEAAAAAAAA8QQAAAAAAADxBAAA8AQAAAAAAADwBAAA8gQAAAAAAADzBAAAAAAAAPMEAADyBAAAAAAAAPIEAAD0BAAAAAAAAPUEAAAAAAAA9QQAAPQEAAAAAAAA9AQAAPYEAAAAAAAA9wQAAAAAAAD3BAAA9gQAAAAAAAD2BAAA+AQAAAAAAAD5BAAAAAAAAPkEAAD4BAAAAAAAAPgEAAD6BAAAAAAAAPsEAAAAAAAA+wQAAPoEAAAAAAAA+gQAAPwEAAAAAAAA/QQAAAAAAAD9BAAA/AQAAAAAAAD8BAAA/gQAAAAAAAD/BAAAAAAAAP8EAAD+BAAAAAAAAP4EAAAABQAAAAAAAAEFAAAAAAAAAQUAAAAFAAAAAAAAAAUAAAIFAAAAAAAAAwUAAAAAAAADBQAAAgUAAAAAAAACBQAABAUAAAAAAAAFBQAAAAAAAAUFAAAEBQAAAAAAAAQFAAAGBQAAAAAAAAcFAAAAAAAABwUAAAYFAAAAAAAABgUAAAgFAAAAAAAACQUAAAAAAAAJBQAACAUAAAAAAAAIBQAACgUAAAAAAAALBQAAAAAAAAsFAAAKBQAAAAAAAAoFAAAMBQAAAAAAAA0FAAAAAAAADQUAAAwFAAAAAAAADAUAAA4FAAAAAAAADwUAAAAAAAAPBQAADgUAAAAAAAAOBQAAEAUAAAAAAAARBQAAAAAAABEFAAAQBQAAAAAAABAFAAASBQAAAAAAABMFAAAAAAAAEwUAABIFAAAAAAAAEgUAABQFAAAAAAAAFQUAAAAAAAAVBQAAFAUAAAAAAAAUBQAAFgUAAAAAAAAXBQAAAAAAABcFAAAWBQAAAAAAABYFAAAYBQAAAAAAABkFAAAAAAAAGQUAABgFAAAAAAAAGAUAABoFAAAAAAAAGwUAAAAAAAAbBQAAGgUAAAAAAAAaBQAAHAUAAAAAAAAdBQAAAAAAAB0FAAAcBQAAAAAAABwFAAAeBQAAAAAAAB8FAAAAAAAAHwUAAB4FAAAAAAAAHgUAACAFAAAAAAAAIQUAAAAAAAAhBQAAIAUAAAAAAAAgBQAAIgUAAAAAAAAjBQAAAAAAACMFAAAiBQAAAAAAACIFAAAkBQAAAAAAACUFAAAAAAAAJQUAACQFAAAAAAAAJAUAACYFAAAAAAAAJwUAAAAAAAAnBQAAJgUAAAAAAAAmBQAAKAUAAAAAAAApBQAAAAAAACkFAAAoBQAAAAAAACgFAAAqBQAAAAAAACsFAAAAAAAAKwUAACoFAAAAAAAAKgUAACwFAAAAAAAALQUAAAAAAAAtBQAALAUAAAAAAAAsBQAALgUAAAAAAAAvBQAAAAAAAC8FAAAuBQAAAAAAAC4FAAAxBQAAAAAAAGEFAAAAAAAAMgUAAAAAAABiBQAAAAAAADMFAAAAAAAAYwUAAAAAAAA0BQAAAAAAAGQFAAAAAAAANQUAAAAAAABlBQAAAAAAADYFAAAAAAAAZgUAAAAAAAA3BQAAAAAAAGcFAAAAAAAAOAUAAAAAAABoBQAAAAAAADkFAAAAAAAAaQUAAAAAAAA6BQAAAAAAAGoFAAAAAAAAOwUAAAAAAABrBQAAAAAAADwFAAAAAAAAbAUAAAAAAAA9BQAAAAAAAG0FAAAAAAAAPgUAAAAAAABuBQAAAAAAAD8FAAAAAAAAbwUAAAAAAABABQAAAAAAAHAFAAAAAAAAQQUAAAAAAABxBQAAAAAAAEIFAAAAAAAAcgUAAAAAAABDBQAAAAAAAHMFAAAAAAAARAUAAAAAAAB0BQAAAAAAAEUFAAAAAAAAdQUAAAAAAABGBQAAAAAAAHYFAAAAAAAARwUAAAAAAAB3BQAAAAAAAEgFAAAAAAAAeAUAAAAAAABJBQAAAAAAAHkFAAAAAAAASgUAAAAAAAB6BQAAAAAAAEsFAAAAAAAAewUAAAAAAABMBQAAAAAAAHwFAAAAAAAATQUAAAAAAAB9BQAAAAAAAE4FAAAAAAAAfgUAAAAAAABPBQAAAAAAAH8FAAAAAAAAUAUAAAAAAACABQAAAAAAAFEFAAAAAAAAgQUAAAAAAABSBQAAAAAAAIIFAAAAAAAAUwUAAAAAAACDBQAAAAAAAFQFAAAAAAAAhAUAAAAAAABVBQAAAAAAAIUFAAAAAAAAVgUAAAAAAACGBQAAAAAAAGEFAAAxBQAAAAAAADEFAABiBQAAMgUAAAAAAAAyBQAAYwUAADMFAAAAAAAAMwUAAGQFAAA0BQAAAAAAADQFAABlBQAANQUAAAAAAAA1BQAAZgUAADYFAAAAAAAANgUAAGcFAAA3BQAAAAAAADcFAABoBQAAOAUAAAAAAAA4BQAAaQUAADkFAAAAAAAAOQUAAGoFAAA6BQAAAAAAADoFAABrBQAAOwUAAAAAAAA7BQAAbAUAADwFAAAAAAAAPAUAAG0FAAA9BQAAAAAAAD0FAABuBQAAPgUAAAAAAAA+BQAAbwUAAD8FAAAAAAAAPwUAAHAFAABABQAAAAAAAEAFAABxBQAAQQUAAAAAAABBBQAAcgUAAEIFAAAAAAAAQgUAAHMFAABDBQAAAAAAAEMFAAB0BQAARAUAAAAAAABEBQAAdQUAAEUFAAAAAAAARQUAAHYFAABGBQAAAAAAAEYFAAB3BQAARwUAAAAAAABHBQAAeAUAAEgFAAAAAAAASAUAAHkFAABJBQAAAAAAAEkFAAB6BQAASgUAAAAAAABKBQAAewUAAEsFAAAAAAAASwUAAHwFAABMBQAAAAAAAEwFAAB9BQAATQUAAAAAAABNBQAAfgUAAE4FAAAAAAAATgUAAH8FAABPBQAAAAAAAE8FAACABQAAUAUAAAAAAABQBQAAgQUAAFEFAAAAAAAAUQUAAIIFAABSBQAAAAAAAFIFAACDBQAAUwUAAAAAAABTBQAAhAUAAFQFAAAAAAAAVAUAAIUFAABVBQAAAAAAAFUFAACGBQAAVgUAAAAAAABWBQAAoBAAAAAAAAAALQAAAAAAAKEQAAAAAAAAAS0AAAAAAACiEAAAAAAAAAItAAAAAAAAoxAAAAAAAAADLQAAAAAAAKQQAAAAAAAABC0AAAAAAAClEAAAAAAAAAUtAAAAAAAAphAAAAAAAAAGLQAAAAAAAKcQAAAAAAAABy0AAAAAAACoEAAAAAAAAAgtAAAAAAAAqRAAAAAAAAAJLQAAAAAAAKoQAAAAAAAACi0AAAAAAACrEAAAAAAAAAstAAAAAAAArBAAAAAAAAAMLQAAAAAAAK0QAAAAAAAADS0AAAAAAACuEAAAAAAAAA4tAAAAAAAArxAAAAAAAAAPLQAAAAAAALAQAAAAAAAAEC0AAAAAAACxEAAAAAAAABEtAAAAAAAAshAAAAAAAAASLQAAAAAAALMQAAAAAAAAEy0AAAAAAAC0EAAAAAAAABQtAAAAAAAAtRAAAAAAAAAVLQAAAAAAALYQAAAAAAAAFi0AAAAAAAC3EAAAAAAAABctAAAAAAAAuBAAAAAAAAAYLQAAAAAAALkQAAAAAAAAGS0AAAAAAAC6EAAAAAAAABotAAAAAAAAuxAAAAAAAAAbLQAAAAAAALwQAAAAAAAAHC0AAAAAAAC9EAAAAAAAAB0tAAAAAAAAvhAAAAAAAAAeLQAAAAAAAL8QAAAAAAAAHy0AAAAAAADAEAAAAAAAACAtAAAAAAAAwRAAAAAAAAAhLQAAAAAAAMIQAAAAAAAAIi0AAAAAAADDEAAAAAAAACMtAAAAAAAAxBAAAAAAAAAkLQAAAAAAAMUQAAAAAAAAJS0AAAAAAADHEAAAAAAAACctAAAAAAAAzRAAAAAAAAAtLQAAAAAAANAQAACQHAAAAAAAANAQAADREAAAkRwAAAAAAADREAAA0hAAAJIcAAAAAAAA0hAAANMQAACTHAAAAAAAANMQAADUEAAAlBwAAAAAAADUEAAA1RAAAJUcAAAAAAAA1RAAANYQAACWHAAAAAAAANYQAADXEAAAlxwAAAAAAADXEAAA2BAAAJgcAAAAAAAA2BAAANkQAACZHAAAAAAAANkQAADaEAAAmhwAAAAAAADaEAAA2xAAAJscAAAAAAAA2xAAANwQAACcHAAAAAAAANwQAADdEAAAnRwAAAAAAADdEAAA3hAAAJ4cAAAAAAAA3hAAAN8QAACfHAAAAAAAAN8QAADgEAAAoBwAAAAAAADgEAAA4RAAAKEcAAAAAAAA4RAAAOIQAACiHAAAAAAAAOIQAADjEAAAoxwAAAAAAADjEAAA5BAAAKQcAAAAAAAA5BAAAOUQAAClHAAAAAAAAOUQAADmEAAAphwAAAAAAADmEAAA5xAAAKccAAAAAAAA5xAAAOgQAACoHAAAAAAAAOgQAADpEAAAqRwAAAAAAADpEAAA6hAAAKocAAAAAAAA6hAAAOsQAACrHAAAAAAAAOsQAADsEAAArBwAAAAAAADsEAAA7RAAAK0cAAAAAAAA7RAAAO4QAACuHAAAAAAAAO4QAADvEAAArxwAAAAAAADvEAAA8BAAALAcAAAAAAAA8BAAAPEQAACxHAAAAAAAAPEQAADyEAAAshwAAAAAAADyEAAA8xAAALMcAAAAAAAA8xAAAPQQAAC0HAAAAAAAAPQQAAD1EAAAtRwAAAAAAAD1EAAA9hAAALYcAAAAAAAA9hAAAPcQAAC3HAAAAAAAAPcQAAD4EAAAuBwAAAAAAAD4EAAA+RAAALkcAAAAAAAA+RAAAPoQAAC6HAAAAAAAAPoQAAD9EAAAvRwAAAAAAAD9EAAA/hAAAL4cAAAAAAAA/hAAAP8QAAC/HAAAAAAAAP8QAACgEwAAAAAAAHCrAAAAAAAAoRMAAAAAAABxqwAAAAAAAKITAAAAAAAAcqsAAAAAAACjEwAAAAAAAHOrAAAAAAAApBMAAAAAAAB0qwAAAAAAAKUTAAAAAAAAdasAAAAAAACmEwAAAAAAAHarAAAAAAAApxMAAAAAAAB3qwAAAAAAAKgTAAAAAAAAeKsAAAAAAACpEwAAAAAAAHmrAAAAAAAAqhMAAAAAAAB6qwAAAAAAAKsTAAAAAAAAe6sAAAAAAACsEwAAAAAAAHyrAAAAAAAArRMAAAAAAAB9qwAAAAAAAK4TAAAAAAAAfqsAAAAAAACvEwAAAAAAAH+rAAAAAAAAsBMAAAAAAACAqwAAAAAAALETAAAAAAAAgasAAAAAAACyEwAAAAAAAIKrAAAAAAAAsxMAAAAAAACDqwAAAAAAALQTAAAAAAAAhKsAAAAAAAC1EwAAAAAAAIWrAAAAAAAAthMAAAAAAACGqwAAAAAAALcTAAAAAAAAh6sAAAAAAAC4EwAAAAAAAIirAAAAAAAAuRMAAAAAAACJqwAAAAAAALoTAAAAAAAAiqsAAAAAAAC7EwAAAAAAAIurAAAAAAAAvBMAAAAAAACMqwAAAAAAAL0TAAAAAAAAjasAAAAAAAC+EwAAAAAAAI6rAAAAAAAAvxMAAAAAAACPqwAAAAAAAMATAAAAAAAAkKsAAAAAAADBEwAAAAAAAJGrAAAAAAAAwhMAAAAAAACSqwAAAAAAAMMTAAAAAAAAk6sAAAAAAADEEwAAAAAAAJSrAAAAAAAAxRMAAAAAAACVqwAAAAAAAMYTAAAAAAAAlqsAAAAAAADHEwAAAAAAAJerAAAAAAAAyBMAAAAAAACYqwAAAAAAAMkTAAAAAAAAmasAAAAAAADKEwAAAAAAAJqrAAAAAAAAyxMAAAAAAACbqwAAAAAAAMwTAAAAAAAAnKsAAAAAAADNEwAAAAAAAJ2rAAAAAAAAzhMAAAAAAACeqwAAAAAAAM8TAAAAAAAAn6sAAAAAAADQEwAAAAAAAKCrAAAAAAAA0RMAAAAAAAChqwAAAAAAANITAAAAAAAAoqsAAAAAAADTEwAAAAAAAKOrAAAAAAAA1BMAAAAAAACkqwAAAAAAANUTAAAAAAAApasAAAAAAADWEwAAAAAAAKarAAAAAAAA1xMAAAAAAACnqwAAAAAAANgTAAAAAAAAqKsAAAAAAADZEwAAAAAAAKmrAAAAAAAA2hMAAAAAAACqqwAAAAAAANsTAAAAAAAAq6sAAAAAAADcEwAAAAAAAKyrAAAAAAAA3RMAAAAAAACtqwAAAAAAAN4TAAAAAAAArqsAAAAAAADfEwAAAAAAAK+rAAAAAAAA4BMAAAAAAACwqwAAAAAAAOETAAAAAAAAsasAAAAAAADiEwAAAAAAALKrAAAAAAAA4xMAAAAAAACzqwAAAAAAAOQTAAAAAAAAtKsAAAAAAADlEwAAAAAAALWrAAAAAAAA5hMAAAAAAAC2qwAAAAAAAOcTAAAAAAAAt6sAAAAAAADoEwAAAAAAALirAAAAAAAA6RMAAAAAAAC5qwAAAAAAAOoTAAAAAAAAuqsAAAAAAADrEwAAAAAAALurAAAAAAAA7BMAAAAAAAC8qwAAAAAAAO0TAAAAAAAAvasAAAAAAADuEwAAAAAAAL6rAAAAAAAA7xMAAAAAAAC/qwAAAAAAAPATAAAAAAAA+BMAAAAAAADxEwAAAAAAAPkTAAAAAAAA8hMAAAAAAAD6EwAAAAAAAPMTAAAAAAAA+xMAAAAAAAD0EwAAAAAAAPwTAAAAAAAA9RMAAAAAAAD9EwAAAAAAAPgTAADwEwAAAAAAAPATAAD5EwAA8RMAAAAAAADxEwAA+hMAAPITAAAAAAAA8hMAAPsTAADzEwAAAAAAAPMTAAD8EwAA9BMAAAAAAAD0EwAA/RMAAPUTAAAAAAAA9RMAAIAcAAASBAAAAAAAABIEAACBHAAAFAQAAAAAAAAUBAAAghwAAB4EAAAAAAAAHgQAAIMcAAAhBAAAAAAAACEEAACEHAAAIgQAAAAAAAAiBAAAhRwAACIEAAAAAAAAIgQAAIYcAAAqBAAAAAAAACoEAACHHAAAYgQAAAAAAABiBAAAiBwAAEqmAAAAAAAASqYAAJAcAAAAAAAA0BAAAAAAAACRHAAAAAAAANEQAAAAAAAAkhwAAAAAAADSEAAAAAAAAJMcAAAAAAAA0xAAAAAAAACUHAAAAAAAANQQAAAAAAAAlRwAAAAAAADVEAAAAAAAAJYcAAAAAAAA1hAAAAAAAACXHAAAAAAAANcQAAAAAAAAmBwAAAAAAADYEAAAAAAAAJkcAAAAAAAA2RAAAAAAAACaHAAAAAAAANoQAAAAAAAAmxwAAAAAAADbEAAAAAAAAJwcAAAAAAAA3BAAAAAAAACdHAAAAAAAAN0QAAAAAAAAnhwAAAAAAADeEAAAAAAAAJ8cAAAAAAAA3xAAAAAAAACgHAAAAAAAAOAQAAAAAAAAoRwAAAAAAADhEAAAAAAAAKIcAAAAAAAA4hAAAAAAAACjHAAAAAAAAOMQAAAAAAAApBwAAAAAAADkEAAAAAAAAKUcAAAAAAAA5RAAAAAAAACmHAAAAAAAAOYQAAAAAAAApxwAAAAAAADnEAAAAAAAAKgcAAAAAAAA6BAAAAAAAACpHAAAAAAAAOkQAAAAAAAAqhwAAAAAAADqEAAAAAAAAKscAAAAAAAA6xAAAAAAAACsHAAAAAAAAOwQAAAAAAAArRwAAAAAAADtEAAAAAAAAK4cAAAAAAAA7hAAAAAAAACvHAAAAAAAAO8QAAAAAAAAsBwAAAAAAADwEAAAAAAAALEcAAAAAAAA8RAAAAAAAACyHAAAAAAAAPIQAAAAAAAAsxwAAAAAAADzEAAAAAAAALQcAAAAAAAA9BAAAAAAAAC1HAAAAAAAAPUQAAAAAAAAthwAAAAAAAD2EAAAAAAAALccAAAAAAAA9xAAAAAAAAC4HAAAAAAAAPgQAAAAAAAAuRwAAAAAAAD5EAAAAAAAALocAAAAAAAA+hAAAAAAAAC9HAAAAAAAAP0QAAAAAAAAvhwAAAAAAAD+EAAAAAAAAL8cAAAAAAAA/xAAAAAAAAB5HQAAfacAAAAAAAB9pwAAfR0AAGMsAAAAAAAAYywAAAAeAAAAAAAAAR4AAAAAAAABHgAAAB4AAAAAAAAAHgAAAh4AAAAAAAADHgAAAAAAAAMeAAACHgAAAAAAAAIeAAAEHgAAAAAAAAUeAAAAAAAABR4AAAQeAAAAAAAABB4AAAYeAAAAAAAABx4AAAAAAAAHHgAABh4AAAAAAAAGHgAACB4AAAAAAAAJHgAAAAAAAAkeAAAIHgAAAAAAAAgeAAAKHgAAAAAAAAseAAAAAAAACx4AAAoeAAAAAAAACh4AAAweAAAAAAAADR4AAAAAAAANHgAADB4AAAAAAAAMHgAADh4AAAAAAAAPHgAAAAAAAA8eAAAOHgAAAAAAAA4eAAAQHgAAAAAAABEeAAAAAAAAER4AABAeAAAAAAAAEB4AABIeAAAAAAAAEx4AAAAAAAATHgAAEh4AAAAAAAASHgAAFB4AAAAAAAAVHgAAAAAAABUeAAAUHgAAAAAAABQeAAAWHgAAAAAAABceAAAAAAAAFx4AABYeAAAAAAAAFh4AABgeAAAAAAAAGR4AAAAAAAAZHgAAGB4AAAAAAAAYHgAAGh4AAAAAAAAbHgAAAAAAABseAAAaHgAAAAAAABoeAAAcHgAAAAAAAB0eAAAAAAAAHR4AABweAAAAAAAAHB4AAB4eAAAAAAAAHx4AAAAAAAAfHgAAHh4AAAAAAAAeHgAAIB4AAAAAAAAhHgAAAAAAACEeAAAgHgAAAAAAACAeAAAiHgAAAAAAACMeAAAAAAAAIx4AACIeAAAAAAAAIh4AACQeAAAAAAAAJR4AAAAAAAAlHgAAJB4AAAAAAAAkHgAAJh4AAAAAAAAnHgAAAAAAACceAAAmHgAAAAAAACYeAAAoHgAAAAAAACkeAAAAAAAAKR4AACgeAAAAAAAAKB4AACoeAAAAAAAAKx4AAAAAAAArHgAAKh4AAAAAAAAqHgAALB4AAAAAAAAtHgAAAAAAAC0eAAAsHgAAAAAAACweAAAuHgAAAAAAAC8eAAAAAAAALx4AAC4eAAAAAAAALh4AADAeAAAAAAAAMR4AAAAAAAAxHgAAMB4AAAAAAAAwHgAAMh4AAAAAAAAzHgAAAAAAADMeAAAyHgAAAAAAADIeAAA0HgAAAAAAADUeAAAAAAAANR4AADQeAAAAAAAANB4AADYeAAAAAAAANx4AAAAAAAA3HgAANh4AAAAAAAA2HgAAOB4AAAAAAAA5HgAAAAAAADkeAAA4HgAAAAAAADgeAAA6HgAAAAAAADseAAAAAAAAOx4AADoeAAAAAAAAOh4AADweAAAAAAAAPR4AAAAAAAA9HgAAPB4AAAAAAAA8HgAAPh4AAAAAAAA/HgAAAAAAAD8eAAA+HgAAAAAAAD4eAABAHgAAAAAAAEEeAAAAAAAAQR4AAEAeAAAAAAAAQB4AAEIeAAAAAAAAQx4AAAAAAABDHgAAQh4AAAAAAABCHgAARB4AAAAAAABFHgAAAAAAAEUeAABEHgAAAAAAAEQeAABGHgAAAAAAAEceAAAAAAAARx4AAEYeAAAAAAAARh4AAEgeAAAAAAAASR4AAAAAAABJHgAASB4AAAAAAABIHgAASh4AAAAAAABLHgAAAAAAAEseAABKHgAAAAAAAEoeAABMHgAAAAAAAE0eAAAAAAAATR4AAEweAAAAAAAATB4AAE4eAAAAAAAATx4AAAAAAABPHgAATh4AAAAAAABOHgAAUB4AAAAAAABRHgAAAAAAAFEeAABQHgAAAAAAAFAeAABSHgAAAAAAAFMeAAAAAAAAUx4AAFIeAAAAAAAAUh4AAFQeAAAAAAAAVR4AAAAAAABVHgAAVB4AAAAAAABUHgAAVh4AAAAAAABXHgAAAAAAAFceAABWHgAAAAAAAFYeAABYHgAAAAAAAFkeAAAAAAAAWR4AAFgeAAAAAAAAWB4AAFoeAAAAAAAAWx4AAAAAAABbHgAAWh4AAAAAAABaHgAAXB4AAAAAAABdHgAAAAAAAF0eAABcHgAAAAAAAFweAABeHgAAAAAAAF8eAAAAAAAAXx4AAF4eAAAAAAAAXh4AAGAeAAAAAAAAYR4AAAAAAABhHgAAYB4AAAAAAABgHgAAYh4AAAAAAABjHgAAAAAAAGMeAABiHgAAAAAAAGIeAABkHgAAAAAAAGUeAAAAAAAAZR4AAGQeAAAAAAAAZB4AAGYeAAAAAAAAZx4AAAAAAABnHgAAZh4AAAAAAABmHgAAaB4AAAAAAABpHgAAAAAAAGkeAABoHgAAAAAAAGgeAABqHgAAAAAAAGseAAAAAAAAax4AAGoeAAAAAAAAah4AAGweAAAAAAAAbR4AAAAAAABtHgAAbB4AAAAAAABsHgAAbh4AAAAAAABvHgAAAAAAAG8eAABuHgAAAAAAAG4eAABwHgAAAAAAAHEeAAAAAAAAcR4AAHAeAAAAAAAAcB4AAHIeAAAAAAAAcx4AAAAAAABzHgAAch4AAAAAAAByHgAAdB4AAAAAAAB1HgAAAAAAAHUeAAB0HgAAAAAAAHQeAAB2HgAAAAAAAHceAAAAAAAAdx4AAHYeAAAAAAAAdh4AAHgeAAAAAAAAeR4AAAAAAAB5HgAAeB4AAAAAAAB4HgAAeh4AAAAAAAB7HgAAAAAAAHseAAB6HgAAAAAAAHoeAAB8HgAAAAAAAH0eAAAAAAAAfR4AAHweAAAAAAAAfB4AAH4eAAAAAAAAfx4AAAAAAAB/HgAAfh4AAAAAAAB+HgAAgB4AAAAAAACBHgAAAAAAAIEeAACAHgAAAAAAAIAeAACCHgAAAAAAAIMeAAAAAAAAgx4AAIIeAAAAAAAAgh4AAIQeAAAAAAAAhR4AAAAAAACFHgAAhB4AAAAAAACEHgAAhh4AAAAAAACHHgAAAAAAAIceAACGHgAAAAAAAIYeAACIHgAAAAAAAIkeAAAAAAAAiR4AAIgeAAAAAAAAiB4AAIoeAAAAAAAAix4AAAAAAACLHgAAih4AAAAAAACKHgAAjB4AAAAAAACNHgAAAAAAAI0eAACMHgAAAAAAAIweAACOHgAAAAAAAI8eAAAAAAAAjx4AAI4eAAAAAAAAjh4AAJAeAAAAAAAAkR4AAAAAAACRHgAAkB4AAAAAAACQHgAAkh4AAAAAAACTHgAAAAAAAJMeAACSHgAAAAAAAJIeAACUHgAAAAAAAJUeAAAAAAAAlR4AAJQeAAAAAAAAlB4AAJseAABgHgAAAAAAAGAeAACeHgAAAAAAAN8AAAAAAAAAoB4AAAAAAAChHgAAAAAAAKEeAACgHgAAAAAAAKAeAACiHgAAAAAAAKMeAAAAAAAAox4AAKIeAAAAAAAAoh4AAKQeAAAAAAAApR4AAAAAAAClHgAApB4AAAAAAACkHgAAph4AAAAAAACnHgAAAAAAAKceAACmHgAAAAAAAKYeAACoHgAAAAAAAKkeAAAAAAAAqR4AAKgeAAAAAAAAqB4AAKoeAAAAAAAAqx4AAAAAAACrHgAAqh4AAAAAAACqHgAArB4AAAAAAACtHgAAAAAAAK0eAACsHgAAAAAAAKweAACuHgAAAAAAAK8eAAAAAAAArx4AAK4eAAAAAAAArh4AALAeAAAAAAAAsR4AAAAAAACxHgAAsB4AAAAAAACwHgAAsh4AAAAAAACzHgAAAAAAALMeAACyHgAAAAAAALIeAAC0HgAAAAAAALUeAAAAAAAAtR4AALQeAAAAAAAAtB4AALYeAAAAAAAAtx4AAAAAAAC3HgAAth4AAAAAAAC2HgAAuB4AAAAAAAC5HgAAAAAAALkeAAC4HgAAAAAAALgeAAC6HgAAAAAAALseAAAAAAAAux4AALoeAAAAAAAAuh4AALweAAAAAAAAvR4AAAAAAAC9HgAAvB4AAAAAAAC8HgAAvh4AAAAAAAC/HgAAAAAAAL8eAAC+HgAAAAAAAL4eAADAHgAAAAAAAMEeAAAAAAAAwR4AAMAeAAAAAAAAwB4AAMIeAAAAAAAAwx4AAAAAAADDHgAAwh4AAAAAAADCHgAAxB4AAAAAAADFHgAAAAAAAMUeAADEHgAAAAAAAMQeAADGHgAAAAAAAMceAAAAAAAAxx4AAMYeAAAAAAAAxh4AAMgeAAAAAAAAyR4AAAAAAADJHgAAyB4AAAAAAADIHgAAyh4AAAAAAADLHgAAAAAAAMseAADKHgAAAAAAAMoeAADMHgAAAAAAAM0eAAAAAAAAzR4AAMweAAAAAAAAzB4AAM4eAAAAAAAAzx4AAAAAAADPHgAAzh4AAAAAAADOHgAA0B4AAAAAAADRHgAAAAAAANEeAADQHgAAAAAAANAeAADSHgAAAAAAANMeAAAAAAAA0x4AANIeAAAAAAAA0h4AANQeAAAAAAAA1R4AAAAAAADVHgAA1B4AAAAAAADUHgAA1h4AAAAAAADXHgAAAAAAANceAADWHgAAAAAAANYeAADYHgAAAAAAANkeAAAAAAAA2R4AANgeAAAAAAAA2B4AANoeAAAAAAAA2x4AAAAAAADbHgAA2h4AAAAAAADaHgAA3B4AAAAAAADdHgAAAAAAAN0eAADcHgAAAAAAANweAADeHgAAAAAAAN8eAAAAAAAA3x4AAN4eAAAAAAAA3h4AAOAeAAAAAAAA4R4AAAAAAADhHgAA4B4AAAAAAADgHgAA4h4AAAAAAADjHgAAAAAAAOMeAADiHgAAAAAAAOIeAADkHgAAAAAAAOUeAAAAAAAA5R4AAOQeAAAAAAAA5B4AAOYeAAAAAAAA5x4AAAAAAADnHgAA5h4AAAAAAADmHgAA6B4AAAAAAADpHgAAAAAAAOkeAADoHgAAAAAAAOgeAADqHgAAAAAAAOseAAAAAAAA6x4AAOoeAAAAAAAA6h4AAOweAAAAAAAA7R4AAAAAAADtHgAA7B4AAAAAAADsHgAA7h4AAAAAAADvHgAAAAAAAO8eAADuHgAAAAAAAO4eAADwHgAAAAAAAPEeAAAAAAAA8R4AAPAeAAAAAAAA8B4AAPIeAAAAAAAA8x4AAAAAAADzHgAA8h4AAAAAAADyHgAA9B4AAAAAAAD1HgAAAAAAAPUeAAD0HgAAAAAAAPQeAAD2HgAAAAAAAPceAAAAAAAA9x4AAPYeAAAAAAAA9h4AAPgeAAAAAAAA+R4AAAAAAAD5HgAA+B4AAAAAAAD4HgAA+h4AAAAAAAD7HgAAAAAAAPseAAD6HgAAAAAAAPoeAAD8HgAAAAAAAP0eAAAAAAAA/R4AAPweAAAAAAAA/B4AAP4eAAAAAAAA/x4AAAAAAAD/HgAA/h4AAAAAAAD+HgAAAB8AAAgfAAAAAAAACB8AAAEfAAAJHwAAAAAAAAkfAAACHwAACh8AAAAAAAAKHwAAAx8AAAsfAAAAAAAACx8AAAQfAAAMHwAAAAAAAAwfAAAFHwAADR8AAAAAAAANHwAABh8AAA4fAAAAAAAADh8AAAcfAAAPHwAAAAAAAA8fAAAIHwAAAAAAAAAfAAAAAAAACR8AAAAAAAABHwAAAAAAAAofAAAAAAAAAh8AAAAAAAALHwAAAAAAAAMfAAAAAAAADB8AAAAAAAAEHwAAAAAAAA0fAAAAAAAABR8AAAAAAAAOHwAAAAAAAAYfAAAAAAAADx8AAAAAAAAHHwAAAAAAABAfAAAYHwAAAAAAABgfAAARHwAAGR8AAAAAAAAZHwAAEh8AABofAAAAAAAAGh8AABMfAAAbHwAAAAAAABsfAAAUHwAAHB8AAAAAAAAcHwAAFR8AAB0fAAAAAAAAHR8AABgfAAAAAAAAEB8AAAAAAAAZHwAAAAAAABEfAAAAAAAAGh8AAAAAAAASHwAAAAAAABsfAAAAAAAAEx8AAAAAAAAcHwAAAAAAABQfAAAAAAAAHR8AAAAAAAAVHwAAAAAAACAfAAAoHwAAAAAAACgfAAAhHwAAKR8AAAAAAAApHwAAIh8AACofAAAAAAAAKh8AACMfAAArHwAAAAAAACsfAAAkHwAALB8AAAAAAAAsHwAAJR8AAC0fAAAAAAAALR8AACYfAAAuHwAAAAAAAC4fAAAnHwAALx8AAAAAAAAvHwAAKB8AAAAAAAAgHwAAAAAAACkfAAAAAAAAIR8AAAAAAAAqHwAAAAAAACIfAAAAAAAAKx8AAAAAAAAjHwAAAAAAACwfAAAAAAAAJB8AAAAAAAAtHwAAAAAAACUfAAAAAAAALh8AAAAAAAAmHwAAAAAAAC8fAAAAAAAAJx8AAAAAAAAwHwAAOB8AAAAAAAA4HwAAMR8AADkfAAAAAAAAOR8AADIfAAA6HwAAAAAAADofAAAzHwAAOx8AAAAAAAA7HwAANB8AADwfAAAAAAAAPB8AADUfAAA9HwAAAAAAAD0fAAA2HwAAPh8AAAAAAAA+HwAANx8AAD8fAAAAAAAAPx8AADgfAAAAAAAAMB8AAAAAAAA5HwAAAAAAADEfAAAAAAAAOh8AAAAAAAAyHwAAAAAAADsfAAAAAAAAMx8AAAAAAAA8HwAAAAAAADQfAAAAAAAAPR8AAAAAAAA1HwAAAAAAAD4fAAAAAAAANh8AAAAAAAA/HwAAAAAAADcfAAAAAAAAQB8AAEgfAAAAAAAASB8AAEEfAABJHwAAAAAAAEkfAABCHwAASh8AAAAAAABKHwAAQx8AAEsfAAAAAAAASx8AAEQfAABMHwAAAAAAAEwfAABFHwAATR8AAAAAAABNHwAASB8AAAAAAABAHwAAAAAAAEkfAAAAAAAAQR8AAAAAAABKHwAAAAAAAEIfAAAAAAAASx8AAAAAAABDHwAAAAAAAEwfAAAAAAAARB8AAAAAAABNHwAAAAAAAEUfAAAAAAAAUR8AAFkfAAAAAAAAWR8AAFMfAABbHwAAAAAAAFsfAABVHwAAXR8AAAAAAABdHwAAVx8AAF8fAAAAAAAAXx8AAFkfAAAAAAAAUR8AAAAAAABbHwAAAAAAAFMfAAAAAAAAXR8AAAAAAABVHwAAAAAAAF8fAAAAAAAAVx8AAAAAAABgHwAAaB8AAAAAAABoHwAAYR8AAGkfAAAAAAAAaR8AAGIfAABqHwAAAAAAAGofAABjHwAAax8AAAAAAABrHwAAZB8AAGwfAAAAAAAAbB8AAGUfAABtHwAAAAAAAG0fAABmHwAAbh8AAAAAAABuHwAAZx8AAG8fAAAAAAAAbx8AAGgfAAAAAAAAYB8AAAAAAABpHwAAAAAAAGEfAAAAAAAAah8AAAAAAABiHwAAAAAAAGsfAAAAAAAAYx8AAAAAAABsHwAAAAAAAGQfAAAAAAAAbR8AAAAAAABlHwAAAAAAAG4fAAAAAAAAZh8AAAAAAABvHwAAAAAAAGcfAAAAAAAAcB8AALofAAAAAAAAuh8AAHEfAAC7HwAAAAAAALsfAAByHwAAyB8AAAAAAADIHwAAcx8AAMkfAAAAAAAAyR8AAHQfAADKHwAAAAAAAMofAAB1HwAAyx8AAAAAAADLHwAAdh8AANofAAAAAAAA2h8AAHcfAADbHwAAAAAAANsfAAB4HwAA+B8AAAAAAAD4HwAAeR8AAPkfAAAAAAAA+R8AAHofAADqHwAAAAAAAOofAAB7HwAA6x8AAAAAAADrHwAAfB8AAPofAAAAAAAA+h8AAH0fAAD7HwAAAAAAAPsfAACAHwAAiB8AAAAAAACIHwAAgR8AAIkfAAAAAAAAiR8AAIIfAACKHwAAAAAAAIofAACDHwAAix8AAAAAAACLHwAAhB8AAIwfAAAAAAAAjB8AAIUfAACNHwAAAAAAAI0fAACGHwAAjh8AAAAAAACOHwAAhx8AAI8fAAAAAAAAjx8AAIgfAAAAAAAAgB8AAAAAAACJHwAAAAAAAIEfAAAAAAAAih8AAAAAAACCHwAAAAAAAIsfAAAAAAAAgx8AAAAAAACMHwAAAAAAAIQfAAAAAAAAjR8AAAAAAACFHwAAAAAAAI4fAAAAAAAAhh8AAAAAAACPHwAAAAAAAIcfAAAAAAAAkB8AAJgfAAAAAAAAmB8AAJEfAACZHwAAAAAAAJkfAACSHwAAmh8AAAAAAACaHwAAkx8AAJsfAAAAAAAAmx8AAJQfAACcHwAAAAAAAJwfAACVHwAAnR8AAAAAAACdHwAAlh8AAJ4fAAAAAAAAnh8AAJcfAACfHwAAAAAAAJ8fAACYHwAAAAAAAJAfAAAAAAAAmR8AAAAAAACRHwAAAAAAAJofAAAAAAAAkh8AAAAAAACbHwAAAAAAAJMfAAAAAAAAnB8AAAAAAACUHwAAAAAAAJ0fAAAAAAAAlR8AAAAAAACeHwAAAAAAAJYfAAAAAAAAnx8AAAAAAACXHwAAAAAAAKAfAACoHwAAAAAAAKgfAAChHwAAqR8AAAAAAACpHwAAoh8AAKofAAAAAAAAqh8AAKMfAACrHwAAAAAAAKsfAACkHwAArB8AAAAAAACsHwAApR8AAK0fAAAAAAAArR8AAKYfAACuHwAAAAAAAK4fAACnHwAArx8AAAAAAACvHwAAqB8AAAAAAACgHwAAAAAAAKkfAAAAAAAAoR8AAAAAAACqHwAAAAAAAKIfAAAAAAAAqx8AAAAAAACjHwAAAAAAAKwfAAAAAAAApB8AAAAAAACtHwAAAAAAAKUfAAAAAAAArh8AAAAAAACmHwAAAAAAAK8fAAAAAAAApx8AAAAAAACwHwAAuB8AAAAAAAC4HwAAsR8AALkfAAAAAAAAuR8AALMfAAC8HwAAAAAAALwfAAC4HwAAAAAAALAfAAAAAAAAuR8AAAAAAACxHwAAAAAAALofAAAAAAAAcB8AAAAAAAC7HwAAAAAAAHEfAAAAAAAAvB8AAAAAAACzHwAAAAAAAL4fAACZAwAAAAAAAJkDAADDHwAAzB8AAAAAAADMHwAAyB8AAAAAAAByHwAAAAAAAMkfAAAAAAAAcx8AAAAAAADKHwAAAAAAAHQfAAAAAAAAyx8AAAAAAAB1HwAAAAAAAMwfAAAAAAAAwx8AAAAAAADQHwAA2B8AAAAAAADYHwAA0R8AANkfAAAAAAAA2R8AANgfAAAAAAAA0B8AAAAAAADZHwAAAAAAANEfAAAAAAAA2h8AAAAAAAB2HwAAAAAAANsfAAAAAAAAdx8AAAAAAADgHwAA6B8AAAAAAADoHwAA4R8AAOkfAAAAAAAA6R8AAOUfAADsHwAAAAAAAOwfAADoHwAAAAAAAOAfAAAAAAAA6R8AAAAAAADhHwAAAAAAAOofAAAAAAAAeh8AAAAAAADrHwAAAAAAAHsfAAAAAAAA7B8AAAAAAADlHwAAAAAAAPMfAAD8HwAAAAAAAPwfAAD4HwAAAAAAAHgfAAAAAAAA+R8AAAAAAAB5HwAAAAAAAPofAAAAAAAAfB8AAAAAAAD7HwAAAAAAAH0fAAAAAAAA/B8AAAAAAADzHwAAAAAAACYhAAAAAAAAyQMAAAAAAAAqIQAAAAAAAGsAAAAAAAAAKyEAAAAAAADlAAAAAAAAADIhAAAAAAAATiEAAAAAAABOIQAAMiEAAAAAAAAyIQAAYCEAAAAAAABwIQAAAAAAAGEhAAAAAAAAcSEAAAAAAABiIQAAAAAAAHIhAAAAAAAAYyEAAAAAAABzIQAAAAAAAGQhAAAAAAAAdCEAAAAAAABlIQAAAAAAAHUhAAAAAAAAZiEAAAAAAAB2IQAAAAAAAGchAAAAAAAAdyEAAAAAAABoIQAAAAAAAHghAAAAAAAAaSEAAAAAAAB5IQAAAAAAAGohAAAAAAAAeiEAAAAAAABrIQAAAAAAAHshAAAAAAAAbCEAAAAAAAB8IQAAAAAAAG0hAAAAAAAAfSEAAAAAAABuIQAAAAAAAH4hAAAAAAAAbyEAAAAAAAB/IQAAAAAAAHAhAABgIQAAAAAAAGAhAABxIQAAYSEAAAAAAABhIQAAciEAAGIhAAAAAAAAYiEAAHMhAABjIQAAAAAAAGMhAAB0IQAAZCEAAAAAAABkIQAAdSEAAGUhAAAAAAAAZSEAAHYhAABmIQAAAAAAAGYhAAB3IQAAZyEAAAAAAABnIQAAeCEAAGghAAAAAAAAaCEAAHkhAABpIQAAAAAAAGkhAAB6IQAAaiEAAAAAAABqIQAAeyEAAGshAAAAAAAAayEAAHwhAABsIQAAAAAAAGwhAAB9IQAAbSEAAAAAAABtIQAAfiEAAG4hAAAAAAAAbiEAAH8hAABvIQAAAAAAAG8hAACDIQAAAAAAAIQhAAAAAAAAhCEAAIMhAAAAAAAAgyEAALYkAAAAAAAA0CQAAAAAAAC3JAAAAAAAANEkAAAAAAAAuCQAAAAAAADSJAAAAAAAALkkAAAAAAAA0yQAAAAAAAC6JAAAAAAAANQkAAAAAAAAuyQAAAAAAADVJAAAAAAAALwkAAAAAAAA1iQAAAAAAAC9JAAAAAAAANckAAAAAAAAviQAAAAAAADYJAAAAAAAAL8kAAAAAAAA2SQAAAAAAADAJAAAAAAAANokAAAAAAAAwSQAAAAAAADbJAAAAAAAAMIkAAAAAAAA3CQAAAAAAADDJAAAAAAAAN0kAAAAAAAAxCQAAAAAAADeJAAAAAAAAMUkAAAAAAAA3yQAAAAAAADGJAAAAAAAAOAkAAAAAAAAxyQAAAAAAADhJAAAAAAAAMgkAAAAAAAA4iQAAAAAAADJJAAAAAAAAOMkAAAAAAAAyiQAAAAAAADkJAAAAAAAAMskAAAAAAAA5SQAAAAAAADMJAAAAAAAAOYkAAAAAAAAzSQAAAAAAADnJAAAAAAAAM4kAAAAAAAA6CQAAAAAAADPJAAAAAAAAOkkAAAAAAAA0CQAALYkAAAAAAAAtiQAANEkAAC3JAAAAAAAALckAADSJAAAuCQAAAAAAAC4JAAA0yQAALkkAAAAAAAAuSQAANQkAAC6JAAAAAAAALokAADVJAAAuyQAAAAAAAC7JAAA1iQAALwkAAAAAAAAvCQAANckAAC9JAAAAAAAAL0kAADYJAAAviQAAAAAAAC+JAAA2SQAAL8kAAAAAAAAvyQAANokAADAJAAAAAAAAMAkAADbJAAAwSQAAAAAAADBJAAA3CQAAMIkAAAAAAAAwiQAAN0kAADDJAAAAAAAAMMkAADeJAAAxCQAAAAAAADEJAAA3yQAAMUkAAAAAAAAxSQAAOAkAADGJAAAAAAAAMYkAADhJAAAxyQAAAAAAADHJAAA4iQAAMgkAAAAAAAAyCQAAOMkAADJJAAAAAAAAMkkAADkJAAAyiQAAAAAAADKJAAA5SQAAMskAAAAAAAAyyQAAOYkAADMJAAAAAAAAMwkAADnJAAAzSQAAAAAAADNJAAA6CQAAM4kAAAAAAAAziQAAOkkAADPJAAAAAAAAM8kAAAALAAAAAAAADAsAAAAAAAAASwAAAAAAAAxLAAAAAAAAAIsAAAAAAAAMiwAAAAAAAADLAAAAAAAADMsAAAAAAAABCwAAAAAAAA0LAAAAAAAAAUsAAAAAAAANSwAAAAAAAAGLAAAAAAAADYsAAAAAAAABywAAAAAAAA3LAAAAAAAAAgsAAAAAAAAOCwAAAAAAAAJLAAAAAAAADksAAAAAAAACiwAAAAAAAA6LAAAAAAAAAssAAAAAAAAOywAAAAAAAAMLAAAAAAAADwsAAAAAAAADSwAAAAAAAA9LAAAAAAAAA4sAAAAAAAAPiwAAAAAAAAPLAAAAAAAAD8sAAAAAAAAECwAAAAAAABALAAAAAAAABEsAAAAAAAAQSwAAAAAAAASLAAAAAAAAEIsAAAAAAAAEywAAAAAAABDLAAAAAAAABQsAAAAAAAARCwAAAAAAAAVLAAAAAAAAEUsAAAAAAAAFiwAAAAAAABGLAAAAAAAABcsAAAAAAAARywAAAAAAAAYLAAAAAAAAEgsAAAAAAAAGSwAAAAAAABJLAAAAAAAABosAAAAAAAASiwAAAAAAAAbLAAAAAAAAEssAAAAAAAAHCwAAAAAAABMLAAAAAAAAB0sAAAAAAAATSwAAAAAAAAeLAAAAAAAAE4sAAAAAAAAHywAAAAAAABPLAAAAAAAACAsAAAAAAAAUCwAAAAAAAAhLAAAAAAAAFEsAAAAAAAAIiwAAAAAAABSLAAAAAAAACMsAAAAAAAAUywAAAAAAAAkLAAAAAAAAFQsAAAAAAAAJSwAAAAAAABVLAAAAAAAACYsAAAAAAAAViwAAAAAAAAnLAAAAAAAAFcsAAAAAAAAKCwAAAAAAABYLAAAAAAAACksAAAAAAAAWSwAAAAAAAAqLAAAAAAAAFosAAAAAAAAKywAAAAAAABbLAAAAAAAACwsAAAAAAAAXCwAAAAAAAAtLAAAAAAAAF0sAAAAAAAALiwAAAAAAABeLAAAAAAAADAsAAAALAAAAAAAAAAsAAAxLAAAASwAAAAAAAABLAAAMiwAAAIsAAAAAAAAAiwAADMsAAADLAAAAAAAAAMsAAA0LAAABCwAAAAAAAAELAAANSwAAAUsAAAAAAAABSwAADYsAAAGLAAAAAAAAAYsAAA3LAAABywAAAAAAAAHLAAAOCwAAAgsAAAAAAAACCwAADksAAAJLAAAAAAAAAksAAA6LAAACiwAAAAAAAAKLAAAOywAAAssAAAAAAAACywAADwsAAAMLAAAAAAAAAwsAAA9LAAADSwAAAAAAAANLAAAPiwAAA4sAAAAAAAADiwAAD8sAAAPLAAAAAAAAA8sAABALAAAECwAAAAAAAAQLAAAQSwAABEsAAAAAAAAESwAAEIsAAASLAAAAAAAABIsAABDLAAAEywAAAAAAAATLAAARCwAABQsAAAAAAAAFCwAAEUsAAAVLAAAAAAAABUsAABGLAAAFiwAAAAAAAAWLAAARywAABcsAAAAAAAAFywAAEgsAAAYLAAAAAAAABgsAABJLAAAGSwAAAAAAAAZLAAASiwAABosAAAAAAAAGiwAAEssAAAbLAAAAAAAABssAABMLAAAHCwAAAAAAAAcLAAATSwAAB0sAAAAAAAAHSwAAE4sAAAeLAAAAAAAAB4sAABPLAAAHywAAAAAAAAfLAAAUCwAACAsAAAAAAAAICwAAFEsAAAhLAAAAAAAACEsAABSLAAAIiwAAAAAAAAiLAAAUywAACMsAAAAAAAAIywAAFQsAAAkLAAAAAAAACQsAABVLAAAJSwAAAAAAAAlLAAAViwAACYsAAAAAAAAJiwAAFcsAAAnLAAAAAAAACcsAABYLAAAKCwAAAAAAAAoLAAAWSwAACksAAAAAAAAKSwAAFosAAAqLAAAAAAAACosAABbLAAAKywAAAAAAAArLAAAXCwAACwsAAAAAAAALCwAAF0sAAAtLAAAAAAAAC0sAABeLAAALiwAAAAAAAAuLAAAYCwAAAAAAABhLAAAAAAAAGEsAABgLAAAAAAAAGAsAABiLAAAAAAAAGsCAAAAAAAAYywAAAAAAAB9HQAAAAAAAGQsAAAAAAAAfQIAAAAAAABlLAAAOgIAAAAAAAA6AgAAZiwAAD4CAAAAAAAAPgIAAGcsAAAAAAAAaCwAAAAAAABoLAAAZywAAAAAAABnLAAAaSwAAAAAAABqLAAAAAAAAGosAABpLAAAAAAAAGksAABrLAAAAAAAAGwsAAAAAAAAbCwAAGssAAAAAAAAaywAAG0sAAAAAAAAUQIAAAAAAABuLAAAAAAAAHECAAAAAAAAbywAAAAAAABQAgAAAAAAAHAsAAAAAAAAUgIAAAAAAAByLAAAAAAAAHMsAAAAAAAAcywAAHIsAAAAAAAAciwAAHUsAAAAAAAAdiwAAAAAAAB2LAAAdSwAAAAAAAB1LAAAfiwAAAAAAAA/AgAAAAAAAH8sAAAAAAAAQAIAAAAAAACALAAAAAAAAIEsAAAAAAAAgSwAAIAsAAAAAAAAgCwAAIIsAAAAAAAAgywAAAAAAACDLAAAgiwAAAAAAACCLAAAhCwAAAAAAACFLAAAAAAAAIUsAACELAAAAAAAAIQsAACGLAAAAAAAAIcsAAAAAAAAhywAAIYsAAAAAAAAhiwAAIgsAAAAAAAAiSwAAAAAAACJLAAAiCwAAAAAAACILAAAiiwAAAAAAACLLAAAAAAAAIssAACKLAAAAAAAAIosAACMLAAAAAAAAI0sAAAAAAAAjSwAAIwsAAAAAAAAjCwAAI4sAAAAAAAAjywAAAAAAACPLAAAjiwAAAAAAACOLAAAkCwAAAAAAACRLAAAAAAAAJEsAACQLAAAAAAAAJAsAACSLAAAAAAAAJMsAAAAAAAAkywAAJIsAAAAAAAAkiwAAJQsAAAAAAAAlSwAAAAAAACVLAAAlCwAAAAAAACULAAAliwAAAAAAACXLAAAAAAAAJcsAACWLAAAAAAAAJYsAACYLAAAAAAAAJksAAAAAAAAmSwAAJgsAAAAAAAAmCwAAJosAAAAAAAAmywAAAAAAACbLAAAmiwAAAAAAACaLAAAnCwAAAAAAACdLAAAAAAAAJ0sAACcLAAAAAAAAJwsAACeLAAAAAAAAJ8sAAAAAAAAnywAAJ4sAAAAAAAAniwAAKAsAAAAAAAAoSwAAAAAAAChLAAAoCwAAAAAAACgLAAAoiwAAAAAAACjLAAAAAAAAKMsAACiLAAAAAAAAKIsAACkLAAAAAAAAKUsAAAAAAAApSwAAKQsAAAAAAAApCwAAKYsAAAAAAAApywAAAAAAACnLAAApiwAAAAAAACmLAAAqCwAAAAAAACpLAAAAAAAAKksAACoLAAAAAAAAKgsAACqLAAAAAAAAKssAAAAAAAAqywAAKosAAAAAAAAqiwAAKwsAAAAAAAArSwAAAAAAACtLAAArCwAAAAAAACsLAAAriwAAAAAAACvLAAAAAAAAK8sAACuLAAAAAAAAK4sAACwLAAAAAAAALEsAAAAAAAAsSwAALAsAAAAAAAAsCwAALIsAAAAAAAAsywAAAAAAACzLAAAsiwAAAAAAACyLAAAtCwAAAAAAAC1LAAAAAAAALUsAAC0LAAAAAAAALQsAAC2LAAAAAAAALcsAAAAAAAAtywAALYsAAAAAAAAtiwAALgsAAAAAAAAuSwAAAAAAAC5LAAAuCwAAAAAAAC4LAAAuiwAAAAAAAC7LAAAAAAAALssAAC6LAAAAAAAALosAAC8LAAAAAAAAL0sAAAAAAAAvSwAALwsAAAAAAAAvCwAAL4sAAAAAAAAvywAAAAAAAC/LAAAviwAAAAAAAC+LAAAwCwAAAAAAADBLAAAAAAAAMEsAADALAAAAAAAAMAsAADCLAAAAAAAAMMsAAAAAAAAwywAAMIsAAAAAAAAwiwAAMQsAAAAAAAAxSwAAAAAAADFLAAAxCwAAAAAAADELAAAxiwAAAAAAADHLAAAAAAAAMcsAADGLAAAAAAAAMYsAADILAAAAAAAAMksAAAAAAAAySwAAMgsAAAAAAAAyCwAAMosAAAAAAAAyywAAAAAAADLLAAAyiwAAAAAAADKLAAAzCwAAAAAAADNLAAAAAAAAM0sAADMLAAAAAAAAMwsAADOLAAAAAAAAM8sAAAAAAAAzywAAM4sAAAAAAAAziwAANAsAAAAAAAA0SwAAAAAAADRLAAA0CwAAAAAAADQLAAA0iwAAAAAAADTLAAAAAAAANMsAADSLAAAAAAAANIsAADULAAAAAAAANUsAAAAAAAA1SwAANQsAAAAAAAA1CwAANYsAAAAAAAA1ywAAAAAAADXLAAA1iwAAAAAAADWLAAA2CwAAAAAAADZLAAAAAAAANksAADYLAAAAAAAANgsAADaLAAAAAAAANssAAAAAAAA2ywAANosAAAAAAAA2iwAANwsAAAAAAAA3SwAAAAAAADdLAAA3CwAAAAAAADcLAAA3iwAAAAAAADfLAAAAAAAAN8sAADeLAAAAAAAAN4sAADgLAAAAAAAAOEsAAAAAAAA4SwAAOAsAAAAAAAA4CwAAOIsAAAAAAAA4ywAAAAAAADjLAAA4iwAAAAAAADiLAAA6ywAAAAAAADsLAAAAAAAAOwsAADrLAAAAAAAAOssAADtLAAAAAAAAO4sAAAAAAAA7iwAAO0sAAAAAAAA7SwAAPIsAAAAAAAA8ywAAAAAAADzLAAA8iwAAAAAAADyLAAAAC0AAKAQAAAAAAAAoBAAAAEtAAChEAAAAAAAAKEQAAACLQAAohAAAAAAAACiEAAAAy0AAKMQAAAAAAAAoxAAAAQtAACkEAAAAAAAAKQQAAAFLQAApRAAAAAAAAClEAAABi0AAKYQAAAAAAAAphAAAActAACnEAAAAAAAAKcQAAAILQAAqBAAAAAAAACoEAAACS0AAKkQAAAAAAAAqRAAAAotAACqEAAAAAAAAKoQAAALLQAAqxAAAAAAAACrEAAADC0AAKwQAAAAAAAArBAAAA0tAACtEAAAAAAAAK0QAAAOLQAArhAAAAAAAACuEAAADy0AAK8QAAAAAAAArxAAABAtAACwEAAAAAAAALAQAAARLQAAsRAAAAAAAACxEAAAEi0AALIQAAAAAAAAshAAABMtAACzEAAAAAAAALMQAAAULQAAtBAAAAAAAAC0EAAAFS0AALUQAAAAAAAAtRAAABYtAAC2EAAAAAAAALYQAAAXLQAAtxAAAAAAAAC3EAAAGC0AALgQAAAAAAAAuBAAABktAAC5EAAAAAAAALkQAAAaLQAAuhAAAAAAAAC6EAAAGy0AALsQAAAAAAAAuxAAABwtAAC8EAAAAAAAALwQAAAdLQAAvRAAAAAAAAC9EAAAHi0AAL4QAAAAAAAAvhAAAB8tAAC/EAAAAAAAAL8QAAAgLQAAwBAAAAAAAADAEAAAIS0AAMEQAAAAAAAAwRAAACItAADCEAAAAAAAAMIQAAAjLQAAwxAAAAAAAADDEAAAJC0AAMQQAAAAAAAAxBAAACUtAADFEAAAAAAAAMUQAAAnLQAAxxAAAAAAAADHEAAALS0AAM0QAAAAAAAAzRAAAECmAAAAAAAAQaYAAAAAAABBpgAAQKYAAAAAAABApgAAQqYAAAAAAABDpgAAAAAAAEOmAABCpgAAAAAAAEKmAABEpgAAAAAAAEWmAAAAAAAARaYAAESmAAAAAAAARKYAAEamAAAAAAAAR6YAAAAAAABHpgAARqYAAAAAAABGpgAASKYAAAAAAABJpgAAAAAAAEmmAABIpgAAAAAAAEimAABKpgAAAAAAAEumAAAAAAAAS6YAAEqmAAAAAAAASqYAAEymAAAAAAAATaYAAAAAAABNpgAATKYAAAAAAABMpgAATqYAAAAAAABPpgAAAAAAAE+mAABOpgAAAAAAAE6mAABQpgAAAAAAAFGmAAAAAAAAUaYAAFCmAAAAAAAAUKYAAFKmAAAAAAAAU6YAAAAAAABTpgAAUqYAAAAAAABSpgAAVKYAAAAAAABVpgAAAAAAAFWmAABUpgAAAAAAAFSmAABWpgAAAAAAAFemAAAAAAAAV6YAAFamAAAAAAAAVqYAAFimAAAAAAAAWaYAAAAAAABZpgAAWKYAAAAAAABYpgAAWqYAAAAAAABbpgAAAAAAAFumAABapgAAAAAAAFqmAABcpgAAAAAAAF2mAAAAAAAAXaYAAFymAAAAAAAAXKYAAF6mAAAAAAAAX6YAAAAAAABfpgAAXqYAAAAAAABepgAAYKYAAAAAAABhpgAAAAAAAGGmAABgpgAAAAAAAGCmAABipgAAAAAAAGOmAAAAAAAAY6YAAGKmAAAAAAAAYqYAAGSmAAAAAAAAZaYAAAAAAABlpgAAZKYAAAAAAABkpgAAZqYAAAAAAABnpgAAAAAAAGemAABmpgAAAAAAAGamAABopgAAAAAAAGmmAAAAAAAAaaYAAGimAAAAAAAAaKYAAGqmAAAAAAAAa6YAAAAAAABrpgAAaqYAAAAAAABqpgAAbKYAAAAAAABtpgAAAAAAAG2mAABspgAAAAAAAGymAACApgAAAAAAAIGmAAAAAAAAgaYAAICmAAAAAAAAgKYAAIKmAAAAAAAAg6YAAAAAAACDpgAAgqYAAAAAAACCpgAAhKYAAAAAAACFpgAAAAAAAIWmAACEpgAAAAAAAISmAACGpgAAAAAAAIemAAAAAAAAh6YAAIamAAAAAAAAhqYAAIimAAAAAAAAiaYAAAAAAACJpgAAiKYAAAAAAACIpgAAiqYAAAAAAACLpgAAAAAAAIumAACKpgAAAAAAAIqmAACMpgAAAAAAAI2mAAAAAAAAjaYAAIymAAAAAAAAjKYAAI6mAAAAAAAAj6YAAAAAAACPpgAAjqYAAAAAAACOpgAAkKYAAAAAAACRpgAAAAAAAJGmAACQpgAAAAAAAJCmAACSpgAAAAAAAJOmAAAAAAAAk6YAAJKmAAAAAAAAkqYAAJSmAAAAAAAAlaYAAAAAAACVpgAAlKYAAAAAAACUpgAAlqYAAAAAAACXpgAAAAAAAJemAACWpgAAAAAAAJamAACYpgAAAAAAAJmmAAAAAAAAmaYAAJimAAAAAAAAmKYAAJqmAAAAAAAAm6YAAAAAAACbpgAAmqYAAAAAAACapgAAIqcAAAAAAAAjpwAAAAAAACOnAAAipwAAAAAAACKnAAAkpwAAAAAAACWnAAAAAAAAJacAACSnAAAAAAAAJKcAACanAAAAAAAAJ6cAAAAAAAAnpwAAJqcAAAAAAAAmpwAAKKcAAAAAAAAppwAAAAAAACmnAAAopwAAAAAAACinAAAqpwAAAAAAACunAAAAAAAAK6cAACqnAAAAAAAAKqcAACynAAAAAAAALacAAAAAAAAtpwAALKcAAAAAAAAspwAALqcAAAAAAAAvpwAAAAAAAC+nAAAupwAAAAAAAC6nAAAypwAAAAAAADOnAAAAAAAAM6cAADKnAAAAAAAAMqcAADSnAAAAAAAANacAAAAAAAA1pwAANKcAAAAAAAA0pwAANqcAAAAAAAA3pwAAAAAAADenAAA2pwAAAAAAADanAAA4pwAAAAAAADmnAAAAAAAAOacAADinAAAAAAAAOKcAADqnAAAAAAAAO6cAAAAAAAA7pwAAOqcAAAAAAAA6pwAAPKcAAAAAAAA9pwAAAAAAAD2nAAA8pwAAAAAAADynAAA+pwAAAAAAAD+nAAAAAAAAP6cAAD6nAAAAAAAAPqcAAECnAAAAAAAAQacAAAAAAABBpwAAQKcAAAAAAABApwAAQqcAAAAAAABDpwAAAAAAAEOnAABCpwAAAAAAAEKnAABEpwAAAAAAAEWnAAAAAAAARacAAESnAAAAAAAARKcAAEanAAAAAAAAR6cAAAAAAABHpwAARqcAAAAAAABGpwAASKcAAAAAAABJpwAAAAAAAEmnAABIpwAAAAAAAEinAABKpwAAAAAAAEunAAAAAAAAS6cAAEqnAAAAAAAASqcAAEynAAAAAAAATacAAAAAAABNpwAATKcAAAAAAABMpwAATqcAAAAAAABPpwAAAAAAAE+nAABOpwAAAAAAAE6nAABQpwAAAAAAAFGnAAAAAAAAUacAAFCnAAAAAAAAUKcAAFKnAAAAAAAAU6cAAAAAAABTpwAAUqcAAAAAAABSpwAAVKcAAAAAAABVpwAAAAAAAFWnAABUpwAAAAAAAFSnAABWpwAAAAAAAFenAAAAAAAAV6cAAFanAAAAAAAAVqcAAFinAAAAAAAAWacAAAAAAABZpwAAWKcAAAAAAABYpwAAWqcAAAAAAABbpwAAAAAAAFunAABapwAAAAAAAFqnAABcpwAAAAAAAF2nAAAAAAAAXacAAFynAAAAAAAAXKcAAF6nAAAAAAAAX6cAAAAAAABfpwAAXqcAAAAAAABepwAAYKcAAAAAAABhpwAAAAAAAGGnAABgpwAAAAAAAGCnAABipwAAAAAAAGOnAAAAAAAAY6cAAGKnAAAAAAAAYqcAAGSnAAAAAAAAZacAAAAAAABlpwAAZKcAAAAAAABkpwAAZqcAAAAAAABnpwAAAAAAAGenAABmpwAAAAAAAGanAABopwAAAAAAAGmnAAAAAAAAaacAAGinAAAAAAAAaKcAAGqnAAAAAAAAa6cAAAAAAABrpwAAaqcAAAAAAABqpwAAbKcAAAAAAABtpwAAAAAAAG2nAABspwAAAAAAAGynAABupwAAAAAAAG+nAAAAAAAAb6cAAG6nAAAAAAAAbqcAAHmnAAAAAAAAeqcAAAAAAAB6pwAAeacAAAAAAAB5pwAAe6cAAAAAAAB8pwAAAAAAAHynAAB7pwAAAAAAAHunAAB9pwAAAAAAAHkdAAAAAAAAfqcAAAAAAAB/pwAAAAAAAH+nAAB+pwAAAAAAAH6nAACApwAAAAAAAIGnAAAAAAAAgacAAICnAAAAAAAAgKcAAIKnAAAAAAAAg6cAAAAAAACDpwAAgqcAAAAAAACCpwAAhKcAAAAAAACFpwAAAAAAAIWnAACEpwAAAAAAAISnAACGpwAAAAAAAIenAAAAAAAAh6cAAIanAAAAAAAAhqcAAIunAAAAAAAAjKcAAAAAAACMpwAAi6cAAAAAAACLpwAAjacAAAAAAABlAgAAAAAAAJCnAAAAAAAAkacAAAAAAACRpwAAkKcAAAAAAACQpwAAkqcAAAAAAACTpwAAAAAAAJOnAACSpwAAAAAAAJKnAACWpwAAAAAAAJenAAAAAAAAl6cAAJanAAAAAAAAlqcAAJinAAAAAAAAmacAAAAAAACZpwAAmKcAAAAAAACYpwAAmqcAAAAAAACbpwAAAAAAAJunAACapwAAAAAAAJqnAACcpwAAAAAAAJ2nAAAAAAAAnacAAJynAAAAAAAAnKcAAJ6nAAAAAAAAn6cAAAAAAACfpwAAnqcAAAAAAACepwAAoKcAAAAAAAChpwAAAAAAAKGnAACgpwAAAAAAAKCnAACipwAAAAAAAKOnAAAAAAAAo6cAAKKnAAAAAAAAoqcAAKSnAAAAAAAApacAAAAAAAClpwAApKcAAAAAAACkpwAApqcAAAAAAACnpwAAAAAAAKenAACmpwAAAAAAAKanAACopwAAAAAAAKmnAAAAAAAAqacAAKinAAAAAAAAqKcAAKqnAAAAAAAAZgIAAAAAAACrpwAAAAAAAFwCAAAAAAAArKcAAAAAAABhAgAAAAAAAK2nAAAAAAAAbAIAAAAAAACupwAAAAAAAGoCAAAAAAAAsKcAAAAAAACeAgAAAAAAALGnAAAAAAAAhwIAAAAAAACypwAAAAAAAJ0CAAAAAAAAs6cAAAAAAABTqwAAAAAAALSnAAAAAAAAtacAAAAAAAC1pwAAtKcAAAAAAAC0pwAAtqcAAAAAAAC3pwAAAAAAALenAAC2pwAAAAAAALanAAC4pwAAAAAAALmnAAAAAAAAuacAALinAAAAAAAAuKcAAFOrAACzpwAAAAAAALOnAABwqwAAoBMAAAAAAACgEwAAcasAAKETAAAAAAAAoRMAAHKrAACiEwAAAAAAAKITAABzqwAAoxMAAAAAAACjEwAAdKsAAKQTAAAAAAAApBMAAHWrAAClEwAAAAAAAKUTAAB2qwAAphMAAAAAAACmEwAAd6sAAKcTAAAAAAAApxMAAHirAACoEwAAAAAAAKgTAAB5qwAAqRMAAAAAAACpEwAAeqsAAKoTAAAAAAAAqhMAAHurAACrEwAAAAAAAKsTAAB8qwAArBMAAAAAAACsEwAAfasAAK0TAAAAAAAArRMAAH6rAACuEwAAAAAAAK4TAAB/qwAArxMAAAAAAACvEwAAgKsAALATAAAAAAAAsBMAAIGrAACxEwAAAAAAALETAACCqwAAshMAAAAAAACyEwAAg6sAALMTAAAAAAAAsxMAAISrAAC0EwAAAAAAALQTAACFqwAAtRMAAAAAAAC1EwAAhqsAALYTAAAAAAAAthMAAIerAAC3EwAAAAAAALcTAACIqwAAuBMAAAAAAAC4EwAAiasAALkTAAAAAAAAuRMAAIqrAAC6EwAAAAAAALoTAACLqwAAuxMAAAAAAAC7EwAAjKsAALwTAAAAAAAAvBMAAI2rAAC9EwAAAAAAAL0TAACOqwAAvhMAAAAAAAC+EwAAj6sAAL8TAAAAAAAAvxMAAJCrAADAEwAAAAAAAMATAACRqwAAwRMAAAAAAADBEwAAkqsAAMITAAAAAAAAwhMAAJOrAADDEwAAAAAAAMMTAACUqwAAxBMAAAAAAADEEwAAlasAAMUTAAAAAAAAxRMAAJarAADGEwAAAAAAAMYTAACXqwAAxxMAAAAAAADHEwAAmKsAAMgTAAAAAAAAyBMAAJmrAADJEwAAAAAAAMkTAACaqwAAyhMAAAAAAADKEwAAm6sAAMsTAAAAAAAAyxMAAJyrAADMEwAAAAAAAMwTAACdqwAAzRMAAAAAAADNEwAAnqsAAM4TAAAAAAAAzhMAAJ+rAADPEwAAAAAAAM8TAACgqwAA0BMAAAAAAADQEwAAoasAANETAAAAAAAA0RMAAKKrAADSEwAAAAAAANITAACjqwAA0xMAAAAAAADTEwAApKsAANQTAAAAAAAA1BMAAKWrAADVEwAAAAAAANUTAACmqwAA1hMAAAAAAADWEwAAp6sAANcTAAAAAAAA1xMAAKirAADYEwAAAAAAANgTAACpqwAA2RMAAAAAAADZEwAAqqsAANoTAAAAAAAA2hMAAKurAADbEwAAAAAAANsTAACsqwAA3BMAAAAAAADcEwAArasAAN0TAAAAAAAA3RMAAK6rAADeEwAAAAAAAN4TAACvqwAA3xMAAAAAAADfEwAAsKsAAOATAAAAAAAA4BMAALGrAADhEwAAAAAAAOETAACyqwAA4hMAAAAAAADiEwAAs6sAAOMTAAAAAAAA4xMAALSrAADkEwAAAAAAAOQTAAC1qwAA5RMAAAAAAADlEwAAtqsAAOYTAAAAAAAA5hMAALerAADnEwAAAAAAAOcTAAC4qwAA6BMAAAAAAADoEwAAuasAAOkTAAAAAAAA6RMAALqrAADqEwAAAAAAAOoTAAC7qwAA6xMAAAAAAADrEwAAvKsAAOwTAAAAAAAA7BMAAL2rAADtEwAAAAAAAO0TAAC+qwAA7hMAAAAAAADuEwAAv6sAAO8TAAAAAAAA7xMAACH/AAAAAAAAQf8AAAAAAAAi/wAAAAAAAEL/AAAAAAAAI/8AAAAAAABD/wAAAAAAACT/AAAAAAAARP8AAAAAAAAl/wAAAAAAAEX/AAAAAAAAJv8AAAAAAABG/wAAAAAAACf/AAAAAAAAR/8AAAAAAAAo/wAAAAAAAEj/AAAAAAAAKf8AAAAAAABJ/wAAAAAAACr/AAAAAAAASv8AAAAAAAAr/wAAAAAAAEv/AAAAAAAALP8AAAAAAABM/wAAAAAAAC3/AAAAAAAATf8AAAAAAAAu/wAAAAAAAE7/AAAAAAAAL/8AAAAAAABP/wAAAAAAADD/AAAAAAAAUP8AAAAAAAAx/wAAAAAAAFH/AAAAAAAAMv8AAAAAAABS/wAAAAAAADP/AAAAAAAAU/8AAAAAAAA0/wAAAAAAAFT/AAAAAAAANf8AAAAAAABV/wAAAAAAADb/AAAAAAAAVv8AAAAAAAA3/wAAAAAAAFf/AAAAAAAAOP8AAAAAAABY/wAAAAAAADn/AAAAAAAAWf8AAAAAAAA6/wAAAAAAAFr/AAAAAAAAQf8AACH/AAAAAAAAIf8AAEL/AAAi/wAAAAAAACL/AABD/wAAI/8AAAAAAAAj/wAARP8AACT/AAAAAAAAJP8AAEX/AAAl/wAAAAAAACX/AABG/wAAJv8AAAAAAAAm/wAAR/8AACf/AAAAAAAAJ/8AAEj/AAAo/wAAAAAAACj/AABJ/wAAKf8AAAAAAAAp/wAASv8AACr/AAAAAAAAKv8AAEv/AAAr/wAAAAAAACv/AABM/wAALP8AAAAAAAAs/wAATf8AAC3/AAAAAAAALf8AAE7/AAAu/wAAAAAAAC7/AABP/wAAL/8AAAAAAAAv/wAAUP8AADD/AAAAAAAAMP8AAFH/AAAx/wAAAAAAADH/AABS/wAAMv8AAAAAAAAy/wAAU/8AADP/AAAAAAAAM/8AAFT/AAA0/wAAAAAAADT/AABV/wAANf8AAAAAAAA1/wAAVv8AADb/AAAAAAAANv8AAFf/AAA3/wAAAAAAADf/AABY/wAAOP8AAAAAAAA4/wAAWf8AADn/AAAAAAAAOf8AAFr/AAA6/wAAAAAAADr/AAAABAEAAAAAACgEAQAAAAAAAQQBAAAAAAApBAEAAAAAAAIEAQAAAAAAKgQBAAAAAAADBAEAAAAAACsEAQAAAAAABAQBAAAAAAAsBAEAAAAAAAUEAQAAAAAALQQBAAAAAAAGBAEAAAAAAC4EAQAAAAAABwQBAAAAAAAvBAEAAAAAAAgEAQAAAAAAMAQBAAAAAAAJBAEAAAAAADEEAQAAAAAACgQBAAAAAAAyBAEAAAAAAAsEAQAAAAAAMwQBAAAAAAAMBAEAAAAAADQEAQAAAAAADQQBAAAAAAA1BAEAAAAAAA4EAQAAAAAANgQBAAAAAAAPBAEAAAAAADcEAQAAAAAAEAQBAAAAAAA4BAEAAAAAABEEAQAAAAAAOQQBAAAAAAASBAEAAAAAADoEAQAAAAAAEwQBAAAAAAA7BAEAAAAAABQEAQAAAAAAPAQBAAAAAAAVBAEAAAAAAD0EAQAAAAAAFgQBAAAAAAA+BAEAAAAAABcEAQAAAAAAPwQBAAAAAAAYBAEAAAAAAEAEAQAAAAAAGQQBAAAAAABBBAEAAAAAABoEAQAAAAAAQgQBAAAAAAAbBAEAAAAAAEMEAQAAAAAAHAQBAAAAAABEBAEAAAAAAB0EAQAAAAAARQQBAAAAAAAeBAEAAAAAAEYEAQAAAAAAHwQBAAAAAABHBAEAAAAAACAEAQAAAAAASAQBAAAAAAAhBAEAAAAAAEkEAQAAAAAAIgQBAAAAAABKBAEAAAAAACMEAQAAAAAASwQBAAAAAAAkBAEAAAAAAEwEAQAAAAAAJQQBAAAAAABNBAEAAAAAACYEAQAAAAAATgQBAAAAAAAnBAEAAAAAAE8EAQAAAAAAKAQBAAAEAQAAAAAAAAQBACkEAQABBAEAAAAAAAEEAQAqBAEAAgQBAAAAAAACBAEAKwQBAAMEAQAAAAAAAwQBACwEAQAEBAEAAAAAAAQEAQAtBAEABQQBAAAAAAAFBAEALgQBAAYEAQAAAAAABgQBAC8EAQAHBAEAAAAAAAcEAQAwBAEACAQBAAAAAAAIBAEAMQQBAAkEAQAAAAAACQQBADIEAQAKBAEAAAAAAAoEAQAzBAEACwQBAAAAAAALBAEANAQBAAwEAQAAAAAADAQBADUEAQANBAEAAAAAAA0EAQA2BAEADgQBAAAAAAAOBAEANwQBAA8EAQAAAAAADwQBADgEAQAQBAEAAAAAABAEAQA5BAEAEQQBAAAAAAARBAEAOgQBABIEAQAAAAAAEgQBADsEAQATBAEAAAAAABMEAQA8BAEAFAQBAAAAAAAUBAEAPQQBABUEAQAAAAAAFQQBAD4EAQAWBAEAAAAAABYEAQA/BAEAFwQBAAAAAAAXBAEAQAQBABgEAQAAAAAAGAQBAEEEAQAZBAEAAAAAABkEAQBCBAEAGgQBAAAAAAAaBAEAQwQBABsEAQAAAAAAGwQBAEQEAQAcBAEAAAAAABwEAQBFBAEAHQQBAAAAAAAdBAEARgQBAB4EAQAAAAAAHgQBAEcEAQAfBAEAAAAAAB8EAQBIBAEAIAQBAAAAAAAgBAEASQQBACEEAQAAAAAAIQQBAEoEAQAiBAEAAAAAACIEAQBLBAEAIwQBAAAAAAAjBAEATAQBACQEAQAAAAAAJAQBAE0EAQAlBAEAAAAAACUEAQBOBAEAJgQBAAAAAAAmBAEATwQBACcEAQAAAAAAJwQBALAEAQAAAAAA2AQBAAAAAACxBAEAAAAAANkEAQAAAAAAsgQBAAAAAADaBAEAAAAAALMEAQAAAAAA2wQBAAAAAAC0BAEAAAAAANwEAQAAAAAAtQQBAAAAAADdBAEAAAAAALYEAQAAAAAA3gQBAAAAAAC3BAEAAAAAAN8EAQAAAAAAuAQBAAAAAADgBAEAAAAAALkEAQAAAAAA4QQBAAAAAAC6BAEAAAAAAOIEAQAAAAAAuwQBAAAAAADjBAEAAAAAALwEAQAAAAAA5AQBAAAAAAC9BAEAAAAAAOUEAQAAAAAAvgQBAAAAAADmBAEAAAAAAL8EAQAAAAAA5wQBAAAAAADABAEAAAAAAOgEAQAAAAAAwQQBAAAAAADpBAEAAAAAAMIEAQAAAAAA6gQBAAAAAADDBAEAAAAAAOsEAQAAAAAAxAQBAAAAAADsBAEAAAAAAMUEAQAAAAAA7QQBAAAAAADGBAEAAAAAAO4EAQAAAAAAxwQBAAAAAADvBAEAAAAAAMgEAQAAAAAA8AQBAAAAAADJBAEAAAAAAPEEAQAAAAAAygQBAAAAAADyBAEAAAAAAMsEAQAAAAAA8wQBAAAAAADMBAEAAAAAAPQEAQAAAAAAzQQBAAAAAAD1BAEAAAAAAM4EAQAAAAAA9gQBAAAAAADPBAEAAAAAAPcEAQAAAAAA0AQBAAAAAAD4BAEAAAAAANEEAQAAAAAA+QQBAAAAAADSBAEAAAAAAPoEAQAAAAAA0wQBAAAAAAD7BAEAAAAAANgEAQCwBAEAAAAAALAEAQDZBAEAsQQBAAAAAACxBAEA2gQBALIEAQAAAAAAsgQBANsEAQCzBAEAAAAAALMEAQDcBAEAtAQBAAAAAAC0BAEA3QQBALUEAQAAAAAAtQQBAN4EAQC2BAEAAAAAALYEAQDfBAEAtwQBAAAAAAC3BAEA4AQBALgEAQAAAAAAuAQBAOEEAQC5BAEAAAAAALkEAQDiBAEAugQBAAAAAAC6BAEA4wQBALsEAQAAAAAAuwQBAOQEAQC8BAEAAAAAALwEAQDlBAEAvQQBAAAAAAC9BAEA5gQBAL4EAQAAAAAAvgQBAOcEAQC/BAEAAAAAAL8EAQDoBAEAwAQBAAAAAADABAEA6QQBAMEEAQAAAAAAwQQBAOoEAQDCBAEAAAAAAMIEAQDrBAEAwwQBAAAAAADDBAEA7AQBAMQEAQAAAAAAxAQBAO0EAQDFBAEAAAAAAMUEAQDuBAEAxgQBAAAAAADGBAEA7wQBAMcEAQAAAAAAxwQBAPAEAQDIBAEAAAAAAMgEAQDxBAEAyQQBAAAAAADJBAEA8gQBAMoEAQAAAAAAygQBAPMEAQDLBAEAAAAAAMsEAQD0BAEAzAQBAAAAAADMBAEA9QQBAM0EAQAAAAAAzQQBAPYEAQDOBAEAAAAAAM4EAQD3BAEAzwQBAAAAAADPBAEA+AQBANAEAQAAAAAA0AQBAPkEAQDRBAEAAAAAANEEAQD6BAEA0gQBAAAAAADSBAEA+wQBANMEAQAAAAAA0wQBAIAMAQAAAAAAwAwBAAAAAACBDAEAAAAAAMEMAQAAAAAAggwBAAAAAADCDAEAAAAAAIMMAQAAAAAAwwwBAAAAAACEDAEAAAAAAMQMAQAAAAAAhQwBAAAAAADFDAEAAAAAAIYMAQAAAAAAxgwBAAAAAACHDAEAAAAAAMcMAQAAAAAAiAwBAAAAAADIDAEAAAAAAIkMAQAAAAAAyQwBAAAAAACKDAEAAAAAAMoMAQAAAAAAiwwBAAAAAADLDAEAAAAAAIwMAQAAAAAAzAwBAAAAAACNDAEAAAAAAM0MAQAAAAAAjgwBAAAAAADODAEAAAAAAI8MAQAAAAAAzwwBAAAAAACQDAEAAAAAANAMAQAAAAAAkQwBAAAAAADRDAEAAAAAAJIMAQAAAAAA0gwBAAAAAACTDAEAAAAAANMMAQAAAAAAlAwBAAAAAADUDAEAAAAAAJUMAQAAAAAA1QwBAAAAAACWDAEAAAAAANYMAQAAAAAAlwwBAAAAAADXDAEAAAAAAJgMAQAAAAAA2AwBAAAAAACZDAEAAAAAANkMAQAAAAAAmgwBAAAAAADaDAEAAAAAAJsMAQAAAAAA2wwBAAAAAACcDAEAAAAAANwMAQAAAAAAnQwBAAAAAADdDAEAAAAAAJ4MAQAAAAAA3gwBAAAAAACfDAEAAAAAAN8MAQAAAAAAoAwBAAAAAADgDAEAAAAAAKEMAQAAAAAA4QwBAAAAAACiDAEAAAAAAOIMAQAAAAAAowwBAAAAAADjDAEAAAAAAKQMAQAAAAAA5AwBAAAAAAClDAEAAAAAAOUMAQAAAAAApgwBAAAAAADmDAEAAAAAAKcMAQAAAAAA5wwBAAAAAACoDAEAAAAAAOgMAQAAAAAAqQwBAAAAAADpDAEAAAAAAKoMAQAAAAAA6gwBAAAAAACrDAEAAAAAAOsMAQAAAAAArAwBAAAAAADsDAEAAAAAAK0MAQAAAAAA7QwBAAAAAACuDAEAAAAAAO4MAQAAAAAArwwBAAAAAADvDAEAAAAAALAMAQAAAAAA8AwBAAAAAACxDAEAAAAAAPEMAQAAAAAAsgwBAAAAAADyDAEAAAAAAMAMAQCADAEAAAAAAIAMAQDBDAEAgQwBAAAAAACBDAEAwgwBAIIMAQAAAAAAggwBAMMMAQCDDAEAAAAAAIMMAQDEDAEAhAwBAAAAAACEDAEAxQwBAIUMAQAAAAAAhQwBAMYMAQCGDAEAAAAAAIYMAQDHDAEAhwwBAAAAAACHDAEAyAwBAIgMAQAAAAAAiAwBAMkMAQCJDAEAAAAAAIkMAQDKDAEAigwBAAAAAACKDAEAywwBAIsMAQAAAAAAiwwBAMwMAQCMDAEAAAAAAIwMAQDNDAEAjQwBAAAAAACNDAEAzgwBAI4MAQAAAAAAjgwBAM8MAQCPDAEAAAAAAI8MAQDQDAEAkAwBAAAAAACQDAEA0QwBAJEMAQAAAAAAkQwBANIMAQCSDAEAAAAAAJIMAQDTDAEAkwwBAAAAAACTDAEA1AwBAJQMAQAAAAAAlAwBANUMAQCVDAEAAAAAAJUMAQDWDAEAlgwBAAAAAACWDAEA1wwBAJcMAQAAAAAAlwwBANgMAQCYDAEAAAAAAJgMAQDZDAEAmQwBAAAAAACZDAEA2gwBAJoMAQAAAAAAmgwBANsMAQCbDAEAAAAAAJsMAQDcDAEAnAwBAAAAAACcDAEA3QwBAJ0MAQAAAAAAnQwBAN4MAQCeDAEAAAAAAJ4MAQDfDAEAnwwBAAAAAACfDAEA4AwBAKAMAQAAAAAAoAwBAOEMAQChDAEAAAAAAKEMAQDiDAEAogwBAAAAAACiDAEA4wwBAKMMAQAAAAAAowwBAOQMAQCkDAEAAAAAAKQMAQDlDAEApQwBAAAAAAClDAEA5gwBAKYMAQAAAAAApgwBAOcMAQCnDAEAAAAAAKcMAQDoDAEAqAwBAAAAAACoDAEA6QwBAKkMAQAAAAAAqQwBAOoMAQCqDAEAAAAAAKoMAQDrDAEAqwwBAAAAAACrDAEA7AwBAKwMAQAAAAAArAwBAO0MAQCtDAEAAAAAAK0MAQDuDAEArgwBAAAAAACuDAEA7wwBAK8MAQAAAAAArwwBAPAMAQCwDAEAAAAAALAMAQDxDAEAsQwBAAAAAACxDAEA8gwBALIMAQAAAAAAsgwBAKAYAQAAAAAAwBgBAAAAAAChGAEAAAAAAMEYAQAAAAAAohgBAAAAAADCGAEAAAAAAKMYAQAAAAAAwxgBAAAAAACkGAEAAAAAAMQYAQAAAAAApRgBAAAAAADFGAEAAAAAAKYYAQAAAAAAxhgBAAAAAACnGAEAAAAAAMcYAQAAAAAAqBgBAAAAAADIGAEAAAAAAKkYAQAAAAAAyRgBAAAAAACqGAEAAAAAAMoYAQAAAAAAqxgBAAAAAADLGAEAAAAAAKwYAQAAAAAAzBgBAAAAAACtGAEAAAAAAM0YAQAAAAAArhgBAAAAAADOGAEAAAAAAK8YAQAAAAAAzxgBAAAAAACwGAEAAAAAANAYAQAAAAAAsRgBAAAAAADRGAEAAAAAALIYAQAAAAAA0hgBAAAAAACzGAEAAAAAANMYAQAAAAAAtBgBAAAAAADUGAEAAAAAALUYAQAAAAAA1RgBAAAAAAC2GAEAAAAAANYYAQAAAAAAtxgBAAAAAADXGAEAAAAAALgYAQAAAAAA2BgBAAAAAAC5GAEAAAAAANkYAQAAAAAAuhgBAAAAAADaGAEAAAAAALsYAQAAAAAA2xgBAAAAAAC8GAEAAAAAANwYAQAAAAAAvRgBAAAAAADdGAEAAAAAAL4YAQAAAAAA3hgBAAAAAAC/GAEAAAAAAN8YAQAAAAAAwBgBAKAYAQAAAAAAoBgBAMEYAQChGAEAAAAAAKEYAQDCGAEAohgBAAAAAACiGAEAwxgBAKMYAQAAAAAAoxgBAMQYAQCkGAEAAAAAAKQYAQDFGAEApRgBAAAAAAClGAEAxhgBAKYYAQAAAAAAphgBAMcYAQCnGAEAAAAAAKcYAQDIGAEAqBgBAAAAAACoGAEAyRgBAKkYAQAAAAAAqRgBAMoYAQCqGAEAAAAAAKoYAQDLGAEAqxgBAAAAAACrGAEAzBgBAKwYAQAAAAAArBgBAM0YAQCtGAEAAAAAAK0YAQDOGAEArhgBAAAAAACuGAEAzxgBAK8YAQAAAAAArxgBANAYAQCwGAEAAAAAALAYAQDRGAEAsRgBAAAAAACxGAEA0hgBALIYAQAAAAAAshgBANMYAQCzGAEAAAAAALMYAQDUGAEAtBgBAAAAAAC0GAEA1RgBALUYAQAAAAAAtRgBANYYAQC2GAEAAAAAALYYAQDXGAEAtxgBAAAAAAC3GAEA2BgBALgYAQAAAAAAuBgBANkYAQC5GAEAAAAAALkYAQDaGAEAuhgBAAAAAAC6GAEA2xgBALsYAQAAAAAAuxgBANwYAQC8GAEAAAAAALwYAQDdGAEAvRgBAAAAAAC9GAEA3hgBAL4YAQAAAAAAvhgBAN8YAQC/GAEAAAAAAL8YAQBAbgEAAAAAAGBuAQAAAAAAQW4BAAAAAABhbgEAAAAAAEJuAQAAAAAAYm4BAAAAAABDbgEAAAAAAGNuAQAAAAAARG4BAAAAAABkbgEAAAAAAEVuAQAAAAAAZW4BAAAAAABGbgEAAAAAAGZuAQAAAAAAR24BAAAAAABnbgEAAAAAAEhuAQAAAAAAaG4BAAAAAABJbgEAAAAAAGluAQAAAAAASm4BAAAAAABqbgEAAAAAAEtuAQAAAAAAa24BAAAAAABMbgEAAAAAAGxuAQAAAAAATW4BAAAAAABtbgEAAAAAAE5uAQAAAAAAbm4BAAAAAABPbgEAAAAAAG9uAQAAAAAAUG4BAAAAAABwbgEAAAAAAFFuAQAAAAAAcW4BAAAAAABSbgEAAAAAAHJuAQAAAAAAU24BAAAAAABzbgEAAAAAAFRuAQAAAAAAdG4BAAAAAABVbgEAAAAAAHVuAQAAAAAAVm4BAAAAAAB2bgEAAAAAAFduAQAAAAAAd24BAAAAAABYbgEAAAAAAHhuAQAAAAAAWW4BAAAAAAB5bgEAAAAAAFpuAQAAAAAAem4BAAAAAABbbgEAAAAAAHtuAQAAAAAAXG4BAAAAAAB8bgEAAAAAAF1uAQAAAAAAfW4BAAAAAABebgEAAAAAAH5uAQAAAAAAX24BAAAAAAB/bgEAAAAAAGBuAQBAbgEAAAAAAEBuAQBhbgEAQW4BAAAAAABBbgEAYm4BAEJuAQAAAAAAQm4BAGNuAQBDbgEAAAAAAENuAQBkbgEARG4BAAAAAABEbgEAZW4BAEVuAQAAAAAARW4BAGZuAQBGbgEAAAAAAEZuAQBnbgEAR24BAAAAAABHbgEAaG4BAEhuAQAAAAAASG4BAGluAQBJbgEAAAAAAEluAQBqbgEASm4BAAAAAABKbgEAa24BAEtuAQAAAAAAS24BAGxuAQBMbgEAAAAAAExuAQBtbgEATW4BAAAAAABNbgEAbm4BAE5uAQAAAAAATm4BAG9uAQBPbgEAAAAAAE9uAQBwbgEAUG4BAAAAAABQbgEAcW4BAFFuAQAAAAAAUW4BAHJuAQBSbgEAAAAAAFJuAQBzbgEAU24BAAAAAABTbgEAdG4BAFRuAQAAAAAAVG4BAHVuAQBVbgEAAAAAAFVuAQB2bgEAVm4BAAAAAABWbgEAd24BAFduAQAAAAAAV24BAHhuAQBYbgEAAAAAAFhuAQB5bgEAWW4BAAAAAABZbgEAem4BAFpuAQAAAAAAWm4BAHtuAQBbbgEAAAAAAFtuAQB8bgEAXG4BAAAAAABcbgEAfW4BAF1uAQAAAAAAXW4BAH5uAQBebgEAAAAAAF5uAQB/bgEAX24BAAAAAABfbgEAAOkBAAAAAAAi6QEAAAAAAAHpAQAAAAAAI+kBAAAAAAAC6QEAAAAAACTpAQAAAAAAA+kBAAAAAAAl6QEAAAAAAATpAQAAAAAAJukBAAAAAAAF6QEAAAAAACfpAQAAAAAABukBAAAAAAAo6QEAAAAAAAfpAQAAAAAAKekBAAAAAAAI6QEAAAAAACrpAQAAAAAACekBAAAAAAAr6QEAAAAAAArpAQAAAAAALOkBAAAAAAAL6QEAAAAAAC3pAQAAAAAADOkBAAAAAAAu6QEAAAAAAA3pAQAAAAAAL+kBAAAAAAAO6QEAAAAAADDpAQAAAAAAD+kBAAAAAAAx6QEAAAAAABDpAQAAAAAAMukBAAAAAAAR6QEAAAAAADPpAQAAAAAAEukBAAAAAAA06QEAAAAAABPpAQAAAAAANekBAAAAAAAU6QEAAAAAADbpAQAAAAAAFekBAAAAAAA36QEAAAAAABbpAQAAAAAAOOkBAAAAAAAX6QEAAAAAADnpAQAAAAAAGOkBAAAAAAA66QEAAAAAABnpAQAAAAAAO+kBAAAAAAAa6QEAAAAAADzpAQAAAAAAG+kBAAAAAAA96QEAAAAAABzpAQAAAAAAPukBAAAAAAAd6QEAAAAAAD/pAQAAAAAAHukBAAAAAABA6QEAAAAAAB/pAQAAAAAAQekBAAAAAAAg6QEAAAAAAELpAQAAAAAAIekBAAAAAABD6QEAAAAAACLpAQAA6QEAAAAAAADpAQAj6QEAAekBAAAAAAAB6QEAJOkBAALpAQAAAAAAAukBACXpAQAD6QEAAAAAAAPpAQAm6QEABOkBAAAAAAAE6QEAJ+kBAAXpAQAAAAAABekBACjpAQAG6QEAAAAAAAbpAQAp6QEAB+kBAAAAAAAH6QEAKukBAAjpAQAAAAAACOkBACvpAQAJ6QEAAAAAAAnpAQAs6QEACukBAAAAAAAK6QEALekBAAvpAQAAAAAAC+kBAC7pAQAM6QEAAAAAAAzpAQAv6QEADekBAAAAAAAN6QEAMOkBAA7pAQAAAAAADukBADHpAQAP6QEAAAAAAA/pAQAy6QEAEOkBAAAAAAAQ6QEAM+kBABHpAQAAAAAAEekBADTpAQAS6QEAAAAAABLpAQA16QEAE+kBAAAAAAAT6QEANukBABTpAQAAAAAAFOkBADfpAQAV6QEAAAAAABXpAQA46QEAFukBAAAAAAAW6QEAOekBABfpAQAAAAAAF+kBADrpAQAY6QEAAAAAABjpAQA76QEAGekBAAAAAAAZ6QEAPOkBABrpAQAAAAAAGukBAD3pAQAb6QEAAAAAABvpAQA+6QEAHOkBAAAAAAAc6QEAP+kBAB3pAQAAAAAAHekBAEDpAQAe6QEAAAAAAB7pAQBB6QEAH+kBAAAAAAAf6QEAQukBACDpAQAAAAAAIOkBAEPpAQAh6QEAAAAAACHpAQ==`),i(t,45536,`HhYWFhgWFhYXExYaFhIWFg4ODg4ODg4ODg4WFhoaGhYWCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoXFhMZERkGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBhcaExo=`),i(t,45664,`HhYYGBgYGxYZGwgVGgEbGRsaEBAZBhYWGRAIFBAQEBYKCgoKCgoKCgoKCgoKCgoKCgoKCgoKChoKCgoKCgoKBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGGgYGBgYGBgYGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYGCgYKBgoGCgYKBgoGCgYKBgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgoGCgYKBgYGCgoGCgYKCgYKCgoGBgoKCgoGCgoGCgoKBgYGCgoGCgoGCgYKBgoKBgoGBgoGCgoGCgoKBgoGCgoGBggKBgYGCAgICAoJBgoJBgoJBgoGCgYKBgoGCgYKBgoGCgYGCgYKBgoGCgYKBgoGCgYKBgoGBgoJBgoGCgoKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYGBgYGBgYKCgYKCgYGCgYKCgoKBgoGCgYKBgoGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYIBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBwcHBwcHBwcHBwcHBwcHBwcHGRkZGQcHBwcHBwcHBwcHBxkZGRkZGRkZGRkZGRkZBwcHBwcZGRkZGRkZBxkHGRkZGRkZGRkZGRkZGRkZGRkNDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NCgYKBgcZCgYCAgcGBgYWCgICAgIZGQoWCgoKAgoCCgoGCgoKCgoKCgoKCgoKCgoKCgoCCgoKCgoKCgoKBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYKBgYKCgoGBgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYGBgYGCgYaCgYKCgYGCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBhsNDQ0NDQwMCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgoGCgYKBgoGCgYKBgoGBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgIKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgICBxYWFhYWFgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGFhICAhsbGAINDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0SDRYNDRYNDRYNAgICAgICAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICCAgICBYWAgICAgICAgICAgIBAQEBAQEaGhoWFhgWFhsbDQ0NDQ0NDQ0NDQ0WAQIWFggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBwgICAgICAgICAgNDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0ODg4ODg4ODg4OFhYWFggIDQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBYIDQ0NDQ0NDQEbDQ0NDQ0NBwcNDRsNDQ0NCAgODg4ODg4ODg4OCAgIGxsIFhYWFhYWFhYWFhYWFhYCAQgNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NDQ0NDQ0NDQ0NCAICAgICAgICAgICAgICDg4ODg4ODg4ODggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NDQ0NDQ0NDQcHGxYWFgcCAg0YGAgICAgICAgICAgICAgICAgICAgICAgNDQ0NBw0NDQ0NDQ0NDQcNDQ0HDQ0NDQ0CAhYWFhYWFhYWFhYWFhYWFgIICAgICAgICAgICAgICAgICAgICAgICAgIDQ0NAgIWAggICAgICAgICAgIAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIICAgICAgICAgICAgICAgICAgICAgCCAgICAgICAgCAgICAgICAgICAgICAgICAgICAgINDQ0NDQ0NDQ0NDQ0NDQ0BDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQsNCAsLCw0NDQ0NDQ0NCwsLCw0LCwgNDQ0NDQ0NCAgICAgICAgICA0NFhYODg4ODg4ODg4OFgcICAgICAgICAgICAgICAgNCwsCCAgICAgICAgCAggIAgIICAgICAgICAgICAgICAgICAgICAgIAggICAgICAgCCAICAggICAgCAg0ICwsLDQ0NDQICCwsCAgsLDQgCAgICAgICAgsCAgICCAgCCAgIDQ0CAg4ODg4ODg4ODg4ICBgYEBAQEBAQGxgIFg0CAg0NCwIICAgICAgCAgICCAgCAggICAgICAgICAgICAgICAgICAgICAgCCAgICAgICAIICAIICAIICAICDQILCwsNDQICAgINDQICDQ0NAgICDQICAgICAgIICAgIAggCAgICAgICDg4ODg4ODg4ODg0NCAgIDRYCAgICAgICAgICDQ0LAggICAgICAgICAIICAgCCAgICAgICAgICAgICAgICAgICAgICAIICAgICAgIAggIAggICAgIAgINCAsLCw0NDQ0NAg0NCwILCw0CAggCAgICAgICAgICAgICAgIICA0NAgIODg4ODg4ODg4OFhgCAgICAgICCA0NDQ0NDQINCwsCCAgICAgICAgCAggIAgIICAgICAgICAgICAgICAgICAgICAgIAggICAgICAgCCAgCCAgICAgCAg0ICw0LDQ0NDQICCwsCAgsLDQICAgICAgICDQsCAgICCAgCCAgIDQ0CAg4ODg4ODg4ODg4bCBAQEBAQEAICAgICAgICAgINCAIICAgICAgCAgIICAgCCAgICAICAggIAggCCAgCAgIICAICAggICAICAggICAgICAgICAgICAICAgILCw0LCwICAgsLCwILCwsNAgIIAgICAgICCwICAgICAgICAgICAgICDg4ODg4ODg4ODhAQEBsbGxsbGxgbAgICAgINCwsLDQgICAgICAgIAggICAIICAgICAgICAgICAgICAgICAgICAgICAIICAgICAgICAgICAgICAgIAgICCA0NDQsLCwsCDQ0NAg0NDQ0CAgICAgICDQ0CCAgIAgICAgIICA0NAgIODg4ODg4ODg4OAgICAgICAgIQEBAQEBAQGwgNCwsWCAgICAgICAgCCAgIAggICAgICAgICAgICAgICAgICAgICAgIAggICAgICAgICAgCCAgICAgCAg0ICw0LCwsLCwINCwsCCwsNDQICAgICAgILCwICAgICAgIIAggIDQ0CAg4ODg4ODg4ODg4CCAgCAgICAgICAgICAgICDQ0LCwIICAgICAgICAIICAgCCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDQgLCwsNDQ0NAgsLCwILCwsNCBsCAgICCAgICxAQEBAQEBAICAgNDQICDg4ODg4ODg4ODhAQEBAQEBAQEBsICAgICAgCAgsLAggICAgICAgICAgICAgICAgICAICAggICAgICAgICAgICAgICAgICAgICAgICAIICAgICAgICAgCCAICCAgICAgICAICAg0CAgICCwsLDQ0NAg0CCwsLCwsLCwsCAgICAgIODg4ODg4ODg4OAgILCxYCAgICAgICAgICAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCAgNDQ0NDQ0NAgICAhgICAgICAgHDQ0NDQ0NDQ0WDg4ODg4ODg4ODhYWAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAggIAggCAggIAggCAggCAgICAgIICAgIAggICAgICAgCCAgIAggCCAICCAgCCAgICA0ICA0NDQ0NDQINDQgCAggICAgIAgcCDQ0NDQ0NAgIODg4ODg4ODg4OAgIICAgIAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIIGxsbFhYWFhYWFhYWFhYWFhYWGxYbGxsNDRsbGxsbGw4ODg4ODg4ODg4QEBAQEBAQEBAQGw0bDRsNFxMXEwsLCAgICAgICAgCCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICAg0NDQ0NDQ0NDQ0NDQ0NCw0NDQ0NFg0NCAgICAgNDQ0NDQ0NDQ0NDQINDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0CGxsbGxsbGxsNGxsbGxsbAhsbFhYWFhYbGxsbFhYCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsLDQ0NDQsNDQ0NDQ0LDQ0LCw0NCA4ODg4ODg4ODg4WFhYWFhYICAgICAgLCw0NCAgICA0NDQgLCwsICAsLCwsLCwsICAgNDQ0NCAgICAgICAgICAgICA0LCw0NCwsLCwsLDQgLDg4ODg4ODg4ODgsLCw0bGwoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKAgoCAgICAgoCAgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYWBwYGBggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAggICAgCAggICAgICAgCCAIICAgIAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAIICAgIAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCCAgICAICCAgICAgICAIIAggICAgCAggICAgICAgICAgICAgICAIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCCAgICAICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICDQ0NFhYWFhYWFhYWEBAQEBAQEBAQEBAQEBAQEBAQEBACAgIICAgICAgICAgICAgICAgIGxsbGxsbGxsbGwICAgICAgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKAgIGBgYGBgYCAhIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFhYICAgICAgICAgICAgICAgICB4ICAgICAgICAgICAgICAgICAgICAgICAgICBcTAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFhYWDw8PCAgICAgICAgCAgICAgICCAgICAgICAgICAgICAIICAgIDQ0NAgICAgICAgICAgIICAgICAgICAgICAgICAgICAgNDQ0WFgICAgICAgICAggICAgICAgICAgICAgICAgICA0NAgICAgICAgICAgICCAgICAgICAgICAgICAIICAgCDQ0CAgICAgICAgICAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ0LDQ0NDQ0NDQsLCwsLCwsLDQsLDQ0NDQ0NDQ0NDQ0WFhYHFhYWGAgNAgIODg4ODg4ODg4OAgICAgICEBAQEBAQEBAQEAICAgICAhYWFhYWFhIWFhYWDQ0NAQIODg4ODg4ODg4OAgICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgHCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICAgICCAgICAgNDQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCAICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICAgICAgICAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAg0NDQsLCwsNDQsLCwICAgILCw0LCwsLCwsNDQ0CAgICGwICAhYWDg4ODg4ODg4ODggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICCAgICAgCAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICAggICAgICAgICAgICAgICAgICAgICAgICAgIAgICAgICDg4ODg4ODg4ODhACAgIbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbCAgICAgICAgICAgICAgICAgICAgICAgNDQsLDQICFhYICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsNCw0NDQ0NDQ0CDQsNCwsNDQ0NDQ0NDQsLCwsLCw0NDQ0NDQ0NDQ0CAg0ODg4ODg4ODg4OAgICAgICDg4ODg4ODg4ODgICAgICAhYWFhYWFhYHFhYWFhYWAgINDQ0NDQ0NDQ0NDQ0NDQwCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg0NDQ0LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCw0NDQ0NCw0LCwsLCw0LCwgICAgICAgCAgICDg4ODg4ODg4ODhYWFhYWFhYbGxsbGxsbGxsbDQ0NDQ0NDQ0NGxsbGxsbGxsbAgICDQ0LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICw0NDQ0LCw0NCw0NDQgIDg4ODg4ODg4ODggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQsNDQsLCw0LDQ0NCwsCAgICAgICAhYWFhYICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCwsLCwsLCw0NDQ0NDQ0NCwsNDQICAhYWFhYWDg4ODg4ODg4ODgICAggICA4ODg4ODg4ODg4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgHBwcHBwcWFgYGBgYGBgYGBgICAgICAgIKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKAgIKCgoWFhYWFhYWFgICAgICAgICDQ0NFg0NDQ0NDQ0NDQ0NDQ0LDQ0NDQ0NDQgICAgNCAgICAsLDQgICw0NAgICAgICBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcGBgYGBgYGBgYGBgYGBwYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQINDQ0NDQoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgYGBgYGBgYGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYGBgYGBgYGBgoKCgoKCgoKBgYGBgYGAgIKCgoKCgoCAgYGBgYGBgYGCgoKCgoKCgoGBgYGBgYGBgoKCgoKCgoKBgYGBgYGAgIKCgoKCgoCAgYGBgYGBgYGAgoCCgIKAgoGBgYGBgYGBgoKCgoKCgoKBgYGBgYGBgYGBgYGBgYCAgYGBgYGBgYGCQkJCQkJCQkGBgYGBgYGBgkJCQkJCQkJBgYGBgYGBgYJCQkJCQkJCQYGBgYGAgYGCgoKCgkZBhkZGQYGBgIGBgoKCgoJGRkZBgYGBgICBgYKCgoKAhkZGQYGBgYGBgYGCgoKCgoZGRkCAgYGBgIGBgoKCgoJGRkCHh4eHh4eHh4eHh4BAQEBARISEhISEhYWFRQXFRUUFxUWFhYWFhYWFhwdAQEBAQEeFhYWFhYWFhYWFRQWFhYWEREWFhYaFxMWFhYWFhYWFhYWFhoWERYWFhYWFhYWFhYeAQEBAQECAQEBAQEBAQEBARAHAgIQEBAQEBAaGhoXEwcQEBAQEBAQEBAQGhoaFxMCBwcHBwcHBwcHBwcHBwICAhgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYAgICAgICAgICAgICAgICAg0NDQ0NDQ0NDQ0NDQ0MDAwMDQwMDA0NDQ0NDQ0NDQ0NDQICAgICAgICAgICAgICAhsbChsbGxsKGxsGCgoKBgYKCgoGGwobGxoKCgoKChsbGxsbGwobChsKGwoKCgobBgoKCgoGCAgICAYbGwYGCgoaGhoaGgoGBgYGGxobGwYbEBAQEBAQEBAQEBAQEBAQEA8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PCgYPDw8PEBsbAgICAhoaGhoaGxsbGxsaGhsbGxsaGxsaGxsaGxsbGxsbGxobGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGhobGxobGhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGxsbGxsbGxsXExcTGxsbGxsbGxsbGxsbGxsbGxsbGxsaGhsbGxsbGxsXExsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxobGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxoaGhoaGhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGwICAgICAgICAgICAgICAgICAgICAgICAgIbGxsbGxsbGxsbGwICAgICAgICAgICAgICAgICAgICAhAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxAQEBAQEBAQEBAQEBAQEBAQEBAQEBAbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsaGxsbGxsbGxsbGhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxoaGhoaGhoaGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbFxMXExcTFxMXExcTFxMQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxoaGhoaFxMaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaFxMXExcTFxMXExoaGhoaGhoaGhoaGhoaGhobGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoXExcTFxMXExcTFxMXExcTFxMXExcTGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaFxMXExoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaFxMaGhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxoaGhoaGhoaGhoaGhoaGhoaGhoaGhsbGhoaGhoaGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbAgIbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGwICGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGwIbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGwIKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgIKBgoKCgYGCgYKBgoGCgoKCgYKBgYKBgYGBgYGBwcKCgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYGGxsbGxsbCgYKBg0NDQoGAgICAgIWFhYWEBYWBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYCBgICAgICBgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICAgICBxYCAgICAgICAgICAgICAg0ICAgICAgICAgICAgICAgICAgICAgICAICAgICAgICAggICAgICAgCCAgICAgICAIICAgICAgIAggICAgICAgCCAgICAgICAIICAgICAgIAggICAgICAgCCAgICAgICAINDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDRYWFRQVFBYWFhUUFhUUFhYWFhYWFhYWEhYWEhYVFBYWFRQXExcTFxMXExYWFhYWBxYWFhYWFhYWFhYSEhYWFhYSFhcWFhYWFhYWFhYWFhYCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsCGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsCAgICAgICAgICAgIbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbAgICAgICAgICAgICAgICAgICAgICAgICAgIbGxsbGxsbGxsbGxsCAgICHhYWFhsHCA8XExcTFxMXExcTGxsXExcTFxMXExIXExMbDw8PDw8PDw8PDQ0NDQsLEgcHBwcHGxsPDw8HCBYbGwIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICDQ0ZGQcHCBIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWBwcHCAICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAhsbEBAQEBsbGxsbGxsbGxsICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICAhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGwICAgICAgICAgICAggICAgICAgICAgICAgICAgbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbAhAQEBAQEBAQEBAbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsQEBAQEBAQEBsQEBAQEBAQEBAQEBAQEBAbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxAQEBAQEBAQEBAbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsQEBAQEBAQEBAQEBAQEBAbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsCCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICAgICAgICGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICAgICAgICAgICAgICAgIICAgICAgICAgICAgICAgICAgICAgHCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGwICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgHBwcHBwcWFggICAgICAgICAgICAcWFhYICAgICAgICAgICAgICAgIDg4ODg4ODg4ODggIAgICAgICAgICAgICAgICAgICAgIKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCA0MDAwWDQ0NDQ0NDQ0NDRYHCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgcHDQ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDw8PDw8PDw8PDw0NFhYWFhYWAgICAgICAgIZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGQcHBwcHBwcHBxkZCgYKBgoGCgYKBgoGCgYGBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoGBwYGBgYGBgYGCgYKBgoKBgoGCgYKBgoGBxkZCgYKBggKBgoGBgYKBgoGCgYKBgoGCgYKBgoGCgYKBgoKCgoKBgoKCgoKBgoGCgYCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCAcHBggICAgICAgNCAgIDQgICAgNCAgICAgICAgICAgICAgICAgICAgICAgLCw0NCxsbGxsCAgICEBAQEBAQGxsYGwICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWFhYWAgICAgICAgILCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICwsLCwsLCwsLCwsLCwsLCw0NAgICAgICAgIWFg4ODg4ODg4ODg4CAgICAgINDQ0NDQ0NDQ0NDQ0NDQ0NDQ0ICAgICAgWFhYIFggIDQ4ODg4ODg4ODg4ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ0NDQ0NDQ0WFggICAgICAgICAgICAgICAgICAgICAgIDQ0NDQ0NDQ0NDQ0LCwICAgICAgICAgICFggICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICDQ0NCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQsLDQ0NDQsLDQsLCwsWFhYWFhYWFhYWFhYWAgcODg4ODg4ODg4OAgICAhYWCAgICAgNBwgICAgICAgICA4ODg4ODg4ODg4ICAgICAIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NDQ0NDQsLDQ0LCw0NAgICAgICAgICCAgIDQgICAgICAgIDQsCAg4ODg4ODg4ODg4CAhYWFhYICAgICAgICAgICAgICAgIBwgICAgICBsbGwgLDQsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0IDQ0NCAgNDQgICAgIDQ0IDQgCAgICAgICAgICAgICAgICAgICAgICAgIICAcWFggICAgICAgICAgICw0NCwsWFggHBwsNAgICAgICAgICAggICAgICAICCAgICAgIAgIICAgICAgCAgICAgICAgIICAgICAgIAggICAgICAgCBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBhkHBwcHBgYGBgYGAgICAgICAgICAgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCw0LCw0LCxYLDQICDg4ODg4ODg4ODgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICAgICAgICAgICCAgICAgICAgICAgICAgICAgICAgICAgCAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICAgIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYGBgYGBgYCAgICAgICAgICAgIGBgYGBgICAgICCA0ICAgICAgICAgIGggICAgICAgICAgICAgCCAgICAgCCAIICAIICAIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGRkZGRkZGRkZGRkZGRkZAgICAgICAgICAgICAgICAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMXAgICAgICAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIICAgICAgICAgICAgYGwICDQ0NDQ0NDQ0NDQ0NDQ0NDRYWFhYWFhYXExYCAgICAgINDQ0NDQ0NDQ0NDQ0NDQ0NFhISEREXExcTFxMXExcTFxMXExcTFhYXExYWFhYREREWFhYCFhYWFhIXExcTFxMWFhYaEhoaGgIWGBYWAgICAggICAgIAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICAQIWFhYYFhYWFxMWGhYSFhYODg4ODg4ODg4OFhYaGhoWFgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKFxYTGREZBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYXGhMaFxMWFxMWFggICAgICAgICAgHCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBwcICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICCAgICAgIAgIICAgICAgCAggICAgICAICCAgIAgICGBgaGRsYGAIbGhoaGhsbAgICAgICAgICAgEBARsbAgIICAgICAgICAgICAgCCAgICAgICAgICAgICAgICAgICAgICAgICAgCCAgICAgICAgICAgICAgICAgICAIICAIICAgICAgICAgICAgICAgCAggICAgICAgICAgICAgIAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICAgICFhYWAgICAhAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAICAhsbGxsbGxsbGw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PEBAQEBsbGxsbGxsbGxsbGxsbGxsbEBAbGxsCGxsbGxsbGxsbGxsbAgICAhsCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGw0CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICAgICAgICAgICAgICDRAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAICAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBAQEBACAgICAgICAgIICAgICAgICAgICAgICAgICAgICA8ICAgICAgICA8CAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ0NDQ0CAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAIWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICAggICAgICAgIFg8PDw8PAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAg4ODg4ODg4ODg4CAgICAgIKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoCAgICBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICAgICAgICAhYCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICAgICAgICCAgICAgICAgICAgICAgICAgICAgICAICAgICAgICAgIICAgICAgICAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCAgICAgIAgIIAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAggIAgICCAICCAgICAgICAgICAgICAgICAgICAgICAgCFhAQEBAQEBAQCAgICAgICAgICAgICAgICAgICAgICAgbGxAQEBAQEBAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICAgICAgIQEBAQEBAQEBACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIICAgICAgICAgICAgICAgICAgIAggIAgICAgIQEBAQEAgICAgICAgICAgICAgICAgICAgICAgQEBAQEBACAgIWCAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICAhYCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICEBAICBAQEBAQEBAQEBAQEBAQEBACAhAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAIDQ0NAg0NAgICAgINDQ0NCAgICAIICAgCCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAg0NDQICAgINEBAQEBAQEBAQAgICAgICAhYWFhYWFhYWFgICAgICAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICBAQFggICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBAQAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIICAgICAgICBsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ0CAgICEBAQEBAWFhYWFhYWAgICAgICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICFhYWFhYWFggICAgICAgICAgICAgICAgICAgICAgCAhAQEBAQEBAQCAgICAgICAgICAgICAgICAgICAICAgICEBAQEBAQEBAICAgICAgICAgICAgICAgICAgCAgICAgICFhYWFgICAgICAgICAgICAhAQEBAQEBACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKAgICAgICAgICAgICAgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgICAgICAgIQEBAQEBAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDQ0NAgICAgICAgIODg4ODg4ODg4OAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBAQEBAQEBAQEAgCAgICAgICAggICAgICAgICAgICAgICAgICAgICAgNDQ0NDQ0NDQ0NDRAQEBAWFhYWFgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgILDQsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NDQ0NDQ0NDQ0NDQ0NDRYWFhYWFhYCAgICEBAQEBAQEBAQEBAQEBAQEBAQEBAODg4ODg4ODg4OAgICAgICAgICAgICAgICDQ0NCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAsLCw0NDQ0LCw0NFhYBFhYWFgICAgICAgICAgICAQICCAgICAgICAgICAgICAgICAgICAgICAgICAICAgICAgIODg4ODg4ODg4OAgICAgICDQ0NCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ0NDQ0LDQ0NDQ0NDQ0CDg4ODg4ODg4ODhYWFhYICwsCAgICAgICAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0WFggCAgICAgICAgINDQsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCwsNDQ0NDQ0NDQ0LCwgICAgWFhYWDQ0NDRYCAg4ODg4ODg4ODg4IFggWFhYCEBAQEBAQEBAQEBAQEBAQEBAQEBACAgICAgICAgICAggICAgICAgICAgICAgICAgICAIICAgICAgICAgICAgICAgICAgICAgICAgICwsLDQ0NCwsNCw0NFhYWFhYWDQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCAgICAgICAIIAggICAgCCAgICAgICAgICAgICAgIAggICAgICAgICAgWAgICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCwsLDQ0NDQ0NDQ0CAgICAg4ODg4ODg4ODg4CAgICAgINDQsLAggICAgICAgIAgIICAICCAgICAgICAgICAgICAgICAgICAgICAIICAgICAgIAggIAggICAgIAg0NCAsLDQsLCwsCAgsLAgILCwsCAggCAgICAgILAgICAgIICAgICAsLAgINDQ0NDQ0NAgICDQ0NDQ0CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCwsNDQ0NDQ0NDQsLDQ0NCw0ICAgIFhYWFhYODg4ODg4ODg4OAhYCFg0CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCwsNDQ0NDQ0LDQsLCwsNDQsNDQgIFggCAgICAgICAg4ODg4ODg4ODg4CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCwsNDQ0NAgILCwsLDQ0LDQ0WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFggICAgNDQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCwsNDQ0NDQ0NDQsLDQsNDRYWFggCAgICAgICAgICAg4ODg4ODg4ODg4CAgICAgIWFhYWFhYWFhYWFhYWAgICAgICAgICAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCw0LCw0NDQ0NDQsNAgICAgICAgIODg4ODg4ODg4OAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgIAgINDQ0LCw0NDQ0LDQ0NDQ0CAgICDg4ODg4ODg4ODhAQFhYWGwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICwsLDQ0NDQ0NDQ0NCw0NFgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGDg4ODg4ODg4ODhAQEBAQEBAQEAICAgICAgICAgICAggCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCA0NDQ0NDQ0NDQ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ0NDQ0NCwgNDQ0NFhYWFhYWFhYNAgICAgICAgIIDQ0NDQ0NCwsNDQ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgIICAgIDQ0NDQ0NDQ0NDQ0NDQsNDRYWFggWFhYWFgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICAgICAggICAgICAgICAIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICw0NDQ0NDQ0CDQ0NDQ0NCw0IFhYWFhYCAgICAgICAgICDg4ODg4ODg4ODhAQEBAQEBAQEBAQEBAQEBAQEBACAgIWFggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQILDQ0NDQ0NDQsNDQsNDQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIICAgICAgIAggIAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ0NDQ0NAgICDQINDQINDQ0NDQ0NCA0CAgICAgICAg4ODg4ODg4ODg4CAgICAgIICAgICAgCCAgCCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCwsLCwINDQILCw0LDQgCAgICAgICDg4ODg4ODg4ODgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIICAgICAgICAgICAgICAgICAgIDQ0LCxYWAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIPDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8CFhYWFhYCAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCDg4ODg4ODg4ODgICAgIWFgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICDQ0NDQ0WAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NDQ0NDQ0WFhYWFhsbGxsHBwcHFhsCAgICAgICAgICDg4ODg4ODg4ODgIQEBAQEBAQAggICAgICAgICAgICAgICAgICAgICAICAgICCAgICAgICAgICAgICAgICAgICAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBhAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFhYWFgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICAgICAgICAgIICwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwICAgICAgICAgICAgICAgINDQ0NBwcHBwcHBwcHBwcHBwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICAgICAgICAgICAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICAgICAgICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICAgICCAgICAgICAgICAgICAICAggICAgICAgICAICAgICAgIICAgICAgICAgIAgIbDQ0WAQEBAQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbAgICAgICAgICAhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGwICGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbCwsNDQ0bGxsLCwsLCwsBAQEBAQEBAQ0NDQ0NDQ0NGxsNDQ0NDQ0NGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbDQ0NDRsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbAgICAgICAgICAgICAgICAgICAgICAgIbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsNDQ0bAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhAQEBAQEBAQEBAQEBAQEBAQEBAQAgICAgICAgICAgICGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbAgICAgICAgICEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgYGBgYGBgYCBgYGBgYGBgYGBgYGBgYGBgYGCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgoCCgoCAgoCAgoKAgIKCgoKAgoKCgoKCgoKBgYGBgIGAgYGBgYGBgYCBgYGBgYGBgYGBgYKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGCgoCCgoKCgICCgoKCgoKCgoCCgoKCgoKCgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgoKAgoKCgoCCgoKCgoCCgICAgoKCgoKCgoCBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgICCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKChoGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGGgYGBgYGBgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoaBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBhoGBgYGBgYKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKGgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYaBgYGBgYGCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKChoGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGGgYGBgYGBgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoaBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBhoGBgYGBgYKBgICDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NGxsbGw0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NGxsbGxsbGxsNGxsbGxsbGxsbGxsbGxsNGxsWFhYWFgICAgICAgICAgICAgICAg0NDQ0NAg0NDQ0NDQ0NDQ0NDQ0NDQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDQ0NDQ0NDQINDQ0NDQ0NDQ0NDQ0NDQ0NDQICDQ0NDQ0NDQINDQINDQ0NDQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgIQEBAQEBAQEBANDQ0NDQ0NAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBg0NDQ0NDQ0CAgICAg4ODg4ODg4ODg4CAgICFhYCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBsQEBAYEBAQEAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAggICAgCCAgICAgICAgICAgICAgICAgICAgICAgICAgIAggIAggCAggCCAgICAgICAgICAIICAgIAggCCAICAgICAggCAgICCAIIAggCCAgIAggIAggCAggCCAIIAggCCAIICAIIAgIICAgIAggICAgICAgCCAgICAIICAgIAggCCAgICAgICAgICAIICAgICAgICAgICAgICAgICAICAgICCAgIAggICAgIAggICAgICAgICAgICAgICAgIAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhoaAgICAgICAgICAgICAgIbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGwICAgIbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbAgICAgICAgICAgICGxsbGxsbGxsbGxsbGxsbAgIbGxsbGxsbGxsbGxsbGxsCGxsbGxsbGxsbGxsbGxsbAhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsCAgICAgICAgICEBAQEBAQEBAQEBAQEAICAhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbAgICAhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGwICAgICAgICAgICAgIbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGwICAgIbGxsbGxsbGxsCAgICAgICGxsCAgICAgICAgICAgICAhsbGxsbGwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxkZGRkZGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbAgICAgICAgICAgIbGxsbGxsbGxsbGxsbAgICGxsbGxsbGxsbGwICAgICAhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbAgICAgICAgICAgICGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIbGxsbGxsbGxsbGxsCAgICGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsCAgICAgICAhsbGxsbGxsbGxsCAgICAgIbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbAgICAgICAgIbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICGxsbGxsbGxsbGxsbAgICAhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbAhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsCAhsbGxsCAgIbAhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGwICAgICAgICAgICAgIbGxsbGxsbGxsbAgICAgICGxsbAgICAgICAgICAgICAhsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhsbGxsbGxsbGxsbGxsbAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCAgICAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NAgICAgICAgICAgICAgICAoAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAIA=`),i(t,81428,`ggAAAAAAAAIAAAAAAAAAAgAAAAAAAAAC`),i(t,81475,`AgAAAAAAACAAAAAAAAAAIA==`),i(t,81506,`IA==`),i(t,81522,`IAAAAAAAAAAg`),i(t,81618,`IA==`),i(t,81634,`IA==`),i(t,81650,`IAAAAAAAAAAg`),i(t,81682,`IAAAAAAAAAAgAAAAAAAAACAAAAAAAIAAAAAAAAAAgA==`),i(t,81728,`gAAAAAAAAACAAAAAAAAAAIA=`),i(t,81760,`gAAAAAAAAACA`),i(t,81904,`gAAAAAAAAACAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAAAU`),i(t,81961,`FAAAAAAAAAAU`),i(t,81985,`FAAAAAAAAAAE`),i(t,82009,`BAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABA=`),i(t,82097,`EAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABA=`),i(t,82169,`EAAAAAAAAAAQAAAAAAAAABAAAAAAAACA`),i(t,82224,`gAAAAAAAAACA`),i(t,82272,`gAAAAAAAAACAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABA==`),i(t,82353,`BAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABA==`),i(t,82393,`BAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAABAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABA==`),i(t,82625,`BAAAAAAAAAAE`),i(t,82649,`BAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABA==`),i(t,83033,`BAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABA==`),i(t,83097,`BAAAAAAAAAAE`),i(t,83121,`BAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAQAAAEAAAAAFAAAAQAAAAgEAAABAAAAAQQAAAAAAAACBAAAAAAAAAgEAAAAAAAAAAQAAAAAAAAABAAAAQAAAAgEAAAAAAAAAQQAAAAAAAAARAAAAAAAAAAEAAAAAAAAAAQA==`),i(t,83288,`QA==`),i(t,83303,`AkAAAAAAAAAQQAAAEAAAAIBAAAAAAAAACEA=`),i(t,83352,`QAAAAAAAABBAAAAQAAAAgAAg`),i(t,83379,`gAAAAABAAACQggAAIEAAAJAAAAAAAAAAgAAAAABAAACQggAAIEAAAJCCAAAgAAAAgAAAAAAAAACAAAAAAAAAAIAAAAAAQAAAkIIAACBAAACQggAAIEAAAJCCAAAgQAAAkAAAAEBAAACQAAAAYEAAAJCCAABgQAAAkIIAACBAAACQggAAIEAAAJCCAAAgQAAAkIIAACBAAACQggAAIAAAAIAAAAAEAAAAAAAAAIAAAAAAAAAACAAAAAAAAAAEAAAAAAAAACAAAAAAAAAAQAAAAAAAAACAAAAAAAAAAIAAAAAAAAAAAkAAAAAAAAAQQAAAEAAAAIBAAAAAAAAABEAAAAAAAAAIAAAAgIIAAAAAAACAgAAAAAAAAIAAAAAAAAAAgIYAAAAAAACAhgAAAAAAAICAAAAAAAAAgIAAAAAAAACAggAAAAAAAICAAAAAAAAAgIAAAAAAAACAgAAAAAAAAICAAAAAAAAAgJIAAACAAACAggAAAIAAAICCAAAAAAAAgIIAAAAAAACAggAAAIAAAICCAAAAAAAAgIIAAAAAAACAggAAAAAAAICAAAAAAAAAgIAAAAAAAACAggAAAAAAAICGAAAAAAAAgIIAAAAAAACAhgAAAAAAAICCAAAAAAAAgIIAAAAAAACAggAAAAAAAICCAAAAAAAAgIAAAAAAAACAggAAAAAAAICAAAAAAAAAgIIAAAAAAACAggAAAAAAAICCAAAAAAAAgIAAAAAAAACAggAAAAAAAICGAAAAAAAAgJIAAAAAAACAhgAAAAAAAICAAAAAAAAAgIAAAAAAAACAhg==`),i(t,83999,`IAAAAACCAAAgAAAAAIIAAAAAAAAAggAAAAAAAACGAAAAAAAAAIIAAAAAAAAAggAAAAAAAACCAAAAaW5maW5pdHkALSsgICAwWDB4AHN0ZDo6YmFkX2Nhc3QAJXMlYyVzX2RpY3QAJXMlYyVzJWMlcyVzACVzJWNzb3VuZGljb25zJWMlcwBDb21waWxlIGVycm9yAHN0ZDo6ZXhjZXB0aW9uAHRlcm1pbmF0aW5nAF8wbGFuZwB1bmV4cGVjdGVkX2hhbmRsZXIgdW5leHBlY3RlZGx5IHJldHVybmVkACVkICVkICVkICVkICVkICVkICVkICVkICVkICVkACVzJWMlYwByYgBwaG9udGFiAHJ3YQBYWFhYWFgAR01UAExDX0FMTABFU1BFQUtfREFUQV9QQVRIAEMAQU5TSV9YMy40LTE5NjgAMy4xLjMwACEtLQBQdXJlIHZpcnR1YWwgZnVuY3Rpb24gY2FsbGVkIQAlcwoAZXNwZWFrOiBCYWQgaW50b25hdGlvbiBkYXRhCgAAAQIEBwMGBQAAAABAAAAAAAAAAHBob25pbmRleAAlcyVjJWMlcwAgJXMAc3RkOjpiYWRfZXhjZXB0aW9uAEVtc2NyaXB0ZW4AbmFuAD94bWwAJXMvLi4vcGhzb3VyY2UAc3RkOjpiYWRfdHlwZWlkAHRlcm1pbmF0ZV9oYW5kbGVyIHVuZXhwZWN0ZWRseSByZXR1cm5lZAAlZCAlZCAlZCAlZCAlZCAlZCAlZCAlZAByYgBXcm9uZyB2ZXJzaW9uIG9mIGVzcGVhay1uZy1kYXRhAEkATEFORwBIT01FAEFOU0lfWDMuNC0xOTg2AChudWxsKQBGYWlsZWQgdG8gb3BlbjogJyVzJwBEZWxldGVkIHZpcnR1YWwgZnVuY3Rpb24gY2FsbGVkIQBudW1iZXJzOiBCYWQgb3B0aW9uIG51bWJlciAlZAoAX2NhcABlbXNjcmlwdGVuAFRoZSBGSUZPIGJ1ZmZlciBpcyBmdWxsAGVzcGVhawAlZCAlZCAlZABzdGQ6OmJhZF9hbGxvYwAlYyVzJWMlcyVjAHBob25kYXRhAC91c3Ivc2hhcmUvZXNwZWFrLW5nLWRhdGEAL3RtcC9lc3BlYWtYWFhYWFgATABQU0FSSFRJVllNVUJGAEFTTU8tNzA4AEMuVVRGLTgAICgAJXM6IEJhZCBvcHRpb24gbnVtYmVyICVkCgBVbnN1cHBvcnRlZCBzcGVjdHJhbCBmaWxlIGZvcm1hdC4KAENhbid0IHJlYWQgZGljdGlvbmFyeSBmaWxlOiAnJXMnCgAtMFgrMFggMFgtMHgrMHggMHgAaW50b25hdGlvbnMAcGhvbmVtZXMAJXMgJXMgJXMgJXMgJXMgJXMAZW4AYmFkX2FycmF5X25ld19sZW5ndGgAbm9uZQBUaGUgZXNwZWFrLW5nIGxpYnJhcnkgaGFzIG5vdCBiZWVuIGluaXRpYWxpemVkACVjJWQAUE9TSVgATQBDLlVURi04AEVDTUEtMTE0ACMxAEVtcHR5IF9kaWN0IGZpbGU6ICclcwoAUmVwbGFjZTogJXMgPiAlcwoAICBzdWZmaXggWyVzXQoKACVzL3Bob25lbWVzACVzJXMlcwBicABhbGwAaW5mAENhbm5vdCBpbml0aWFsaXplIHRoZSBhdWRpbyBkZXZpY2UAJXMlY3ZvaWNlcyVjAE4ATlVMTABFQ01BLTExOABVVEYtOAB3YXNtMzIAZXNwZWFrOiBObyBlbnZlbG9wZQoAQmFkIGRhdGE6ICclcycgKCV4IGxlbmd0aD0leCkKAFRoZSBzcGVjaWZpZWQgZXNwZWFrLW5nIHZvaWNlIGRvZXMgbm90IGV4aXN0ACVzJXMAJXMlYyVzAF9jYXAAYmhmAHNvbWUAWwIlc11dAFAASU5GAEVMT1RfOTI4AGVuX1VTLlVURi04AF8jJWQgAENvbXBpbGluZyBwaG9uZW1lIGRhdGE6ICVzCgBGdWxsIGRpY3Rpb25hcnkgaXMgbm90IGluc3RhbGxlZCBmb3IgJyVzJwoAVW5rbm93biB0dW5lICclcycKACU1ZDoJAGR0AG5vAGVuAG5hbgBfcm9tYW4AQ291bGQgbm90IGxvYWQgdGhlIG1icm9sYS5kbGwgZmlsZQAlZCAlZAAlcyVjbGFuZyVjAHJiAFsCX15fJXMgJXMgX15fJXNdXQBTAF8/QQBJQk0zNjcAPyVkIAAlcyVjJXMAJXMvJXMAcgBpY29uAGVuAENvdWxkIG5vdCBsb2FkIHRoZSBzcGVjaWZpZWQgbWJyb2xhIHZvaWNlIGZpbGUAZ2MAWgBOQU4AXz8/ADxzYXktYXMgaW50ZXJwcmV0LWFzPSJ0dHM6Y2hhciI+JiMlZDs8L3NheS1hcz4ASUJNODE5ACogACAgJWQgJXMgICAgAEludmFsaWQgaW5zdHJ1Y3Rpb24gJS40eCBmb3IgcGhvbmVtZSAnJXMnCgAAcGhvbmRhdGEtbWFuaWZlc3QAVGhlIGV2ZW50IGJ1ZmZlciBpcyBmdWxsAHNwZWxsaW5nAF9saWcAY29uZmlnACVzL2VzcGVhay1uZy1kYXRhACVzJXNfAElTQ0lJAGhBAGwnZXRAAC4ALQAoJXMpAAElZEkgACV4AHcAJXNydWxlcy50eHQAKyVzAHIAXy5wAHBpdGNoAFRoZSByZXF1ZXN0ZWQgZnVuY3Rpb25hbGl0eSBoYXMgbm90IGJlZW4gYnVpbHQgaW50byBlc3BlYWstbmcAX3NtYwBDYwBtYgBJU09fNjQ2LmlydjoxOTkxAHYgPD0gdm93ZWxfY291bnQAVGhlIHBob25lbWUgZmlsZSBpcyBub3QgaW4gYSBzdXBwb3J0ZWQgZm9ybWF0AGNoYXJhY3RlcnMAJWMlcyVzJXMAICVzAF90dXIAZW4AQ2YAbmQAJXMgJWQASVNPXzg4NTktMQAjIFRoaXMgZmlsZSBsaXN0cyB0aGUgdHlwZSBvZiBkYXRhIHRoYXQgaGFzIGJlZW4gY29tcGlsZWQgaW50byB0aGUKIyBwaG9uZGF0YSBmaWxlCiMKIyBUaGUgZmlyc3QgY2hhcmFjdGVyIG9mIGEgbGluZSBpbmRpY2F0ZXMgdGhlIHR5cGUgb2YgZGF0YToKIyAgIFMgLSBBIFNQRUNUX1NFUSBzdHJ1Y3R1cmUKIyAgIFcgLSBBIHdhdmVmaWxlIHNlZ21lbnQKIyAgIEUgLSBBbiBlbnZlbG9wZQojCiMgQWRkcmVzcyBpcyB0aGUgZGlzcGxhY2VtZW50IHdpdGhpbiBwaG9uZGF0YSBvZiB0aGlzIGl0ZW0KIwojICBBZGRyZXNzICBEYXRhIGZpbGUKIyAgLS0tLS0tLSAgLS0tLS0tLS0tCgBfcmV2AHZhcmlhbnQAJXNydWxlcwB0dHM6Y2hhcgBzb3VuZGljb24AQ24AX2VsAG5nAHNyYy9saWJlc3BlYWstbmcvZGljdGlvbmFyeS5jAF9zdWIAcGhvbmRhdGEAVGhlIHNwZWN0cmFsIGZpbGUgZG9lcyBub3QgY29udGFpbiBhbnkgZnJhbWUgZGF0YQABKzEwUwBJU09fODg1OS0xOjE5ODcAdHRzOmtleQAlcyVjJXNfZGljdAB0cwBUaGUgcGhvbmVtZSBtYW5pZmVzdCBmaWxlIGRvZXMgbm90IGNvbnRhaW4gYW55IHBob25lbWVzAF8lYyAlcwBfY3lyAF9zdXAAQ28AX2NybAB3YgAgAS0xMFMASVNPXzg4NTktMgAtAFVucHJvbm91bmNhYmxlPyAnJXMnCgBfaHkAcGhvbmluZGV4AF9hY3UAdHRzOmRpZ2l0cwBDcwAgJXMgJWQgJXMAJ2U6agBhcG9zdHJvcGhlAFRoZSBwaG9uZW1lIGZlYXR1cmUgaXMgbm90IHJlY29nbmlzZWQAdEEASVNPXzg4NTktMjoxOTg3AHdiKwBUcmFuc2xhdGUgJyVzJwoAX2JydgBicmFja2V0cwAlY2VuAElpAHRlbGVwaG9uZQBfaGUAVGhlIHRleHQgZW5jb2RpbmcgaXMgbm90IHN1cHBvcnRlZAAlZCAlZABwaG9udGFiAFsCKFgxKShYMSkoWDEpXV0AbkEAYidpOgBJU09fODg1OS0zAFVzaW5nIHBob25lbWV0YWJsZTogJyVzJwoAVW5zcGVjaWZpZWQgZXJyb3IgMHgleAByb290cwBnbHlwaHMAJWMlcwBfYXIATGwAJXMvY29tcGlsZV9wcm9nX2xvZwBicmFja2V0c0Fubm91bmNlZAAlZABfaGFjAF9eXwBzJ2k6AElTT184ODU5LTM6MTk4OABsaXN0AGRpY3RfbWluAGVuAExtAHgtd2VhawBiYXNlAF9jZWQAX3N5YwBkJ2k6AElTT184ODU5LTQAQmFkIHZvaWNlIGF0dHJpYnV0ZTogJXMKAEVycm9yIHByb2Nlc3NpbmcgZmlsZSAnJXMnOiAlcy4KAGxpc3R4AGRpY3RydWxlcwBfY2lyAExvAHdlYWsAX2hpACdpOgBJU09fODg1OS00OjE5ODgAJXMgAEludmFsaWQgcGhvbmVtZSBjb2RlICVkCgAKUmVmcyAlZCwgIFJldXNlZCAlZAoARXJyb3I6ICVzIGF0ICclcycgKGV4cGVjdGVkIDB4JXgsIGdvdCAweCV4KS4KAFVua25vd24gcGhvbmVtZSB0YWJsZTogJyVzJwoATHQAJWMlcwBpbnRvbmF0aW9uAF9ibgBtZWRpdW0AZW1vamkAJ2VmAF9kaWEASVNPXzg4NTktNQBSZXBsYWNlOiAlcyAgJXMKAENvbXBpbGVkIHBob25lbWVzOiAlZCBlcnJvcnMuCgBFcnJvcjogJXMuCgBoc3gATHUAJXMvLi4vcGhzb3VyY2UvaW50b25hdGlvbi50eHQAbF9kaWVyZXNpcwAlcyslcwBfZ3VyAGlvbgBzdHJvbmcAZXh0cmEASVNPXzg4NTktNToxOTg4AF9hYzIAbF9wcmVmaXgAX2d1AF9kb3QAJXMlY3ZvaWNlcwByAHgtc3Ryb25nAE1jAElTT184ODU5LTYAQ29tcGlsaW5nOiAnJXMnCgBfZ3J2AGxfcmVncmVzc2l2ZV92AHJzAF9vcgAlcy8uLi9waHNvdXJjZS9pbnRvbmF0aW9uACVzJWNsYW5nAE1lAHJlZHVjZWQASVNPXzg4NTktNjoxOTg3ACQxAGlyAF9tY24ATW4AbW9kZXJhdGUAdHVuZQBsX3VucHJvbm91bmNhYmxlAF90YQBJU09fODg1OS03ACQyAG1iLwAlcy9pbnRvbmF0aW9ucwB1cgBfb2dvAGxfc29ub3JhbnRfbWluAHJhdGUAX3RlAE5kAElTT184ODU5LTc6MTk4NwAkMwAvLwBfa24ATmwAYXRoAF9ybmcAdm9sdW1lAGFwb3N0cm9waGUAbG93ZXJjYXNlU2VudGVuY2UASVNPXzg4NTktOAAkNABEdXBsaWNhdGUgdHVuZSBuYW1lOiAnJXMnAGJyYWNrZXRzAG51bWJlcnMAbnMATm8AX21sAF9zdGsAcmFuZ2UAQmFkIHR1bmUgbmFtZTogJyVzOwBJU09fODg1OS04OjE5ODgAJDUAc3BlbGxpbmdTdHJlc3MAX3NpAF90bGQAZmllbGQAYnJhY2tldHNBbm5vdW5jZWQAUGMASVNPXzg4NTktOQAkNgBCYWQgZW52ZWxvcGUgbmFtZTogJyVzJwBfYmFyAGRpY3RfbWluAF90aABzcG9uZwBtb2RlAFR1bmUgJyVzJyBub3QgZm91bmQAc3RyZXNzQWRkAFBkAElTT184ODU5LTk6MTk4OQAkNwBfcmZ4ACR1AGRpY3RydWxlcwBzdHJlc3NBbXAAX2xvAHB1bmN0dWF0aW9uAHJhbmcAUGUASVNPXzg4NTktMTAAVW5leHBlY3RlZDogJyVzJwBjYXBpdGFsX2xldHRlcnMAaW50b25hdGlvbgBfaG9rAF90aQBzdHJlc3NMZW5ndGgAbGFyZwBQZgBUdW5lICclcycgbm90IGRlZmluZWQASVNPXzg4NTktMTA6MTk5MgAkdTEAX215AHN0cmVzc09wdABsX2RpZXJlc2lzAF8jJXMAbGV2ZWwAUGkASVNPXzg4NTktMTQAJHUyAGFkZCBlCgBDb21waWxlZCAlZCBpbnRvbmF0aW9uIHR1bmVzOiAlZCBlcnJvcnMuCgBsX3ByZWZpeABhbHBoYWJldABUb28gbWFueSBwaG9uZW1ldGFibGVzAF94IyVzAFBvAHN0cmVzc1J1bGUAX2thAElTT184ODU5LTE0OjE5OTgAJHUzAE91dCBvZiBtZW1vcnkAbF9yZWdyZXNzaXZlX3YAdHVuZXMAUHMAX2tvAHBoAElTT184ODU5LTE1AF8wACR1KwBfZHB0AHdvcmRzAGludGVycHJldC1hcwBfZXRoAGxfdW5wcm9ub3VuY2FibGUAU2MAXwBJU09fODg1OS0xNgAkdTErAEJhZCBydWxlcyBkYXRhIGluICclc19kaWN0JyBhdCAweCV4ICglYykKAGZvcm1hdABsX3Nvbm9yYW50X21pbgBTawBfYnJhaWxsZQBfME0lZABJU09fODg1OS0xNjoyMDAxACR1MisAQ2FuJ3QgZmluZCBiYXNlIHBob25lbWV0YWJsZSAnJXMnACUzZAklcyBbJXNdCgBDYW5ub3Qgc2V0ICVzOiBsYW5ndWFnZSBub3Qgc2V0LCBvciBpcyBpbnZhbGlkLgoAU20AZGV0YWlsAGxvd2VyY2FzZVNlbnRlbmNlAF9qYQBJU082NDYtVVMAXy4AJHUzKwBfAQBudW1iZXJzAFNvAF8lZG4AX3poACRwYXVzZQAlYyVkWQBwaG9uZW1lX2xlbiA8IE5fUEhPTkVNRV9CWVRFUwBJU08tMTA2NDYtVUNTLTIAJQBzcGVsbGluZ1N0cmVzcwBhbGlhcwBabAAkc3RyZW5kAElTTy04ODU5LTEAJSUARmxhZ3M6ICAlcyAgJXMKACVzJXMlYyVzJXMAWnAAbmFtZQBzdHJlc3NBZGQAJHN0cmVuZDIASVNPLTg4NTktMgAsAEZvdW5kOiAnJXMgJXMKAFpzACVzJXMlcyVjJXMARm91bmQ6ICclcwBzdHJlc3NBbXAAJHVuc3RyZXNzZW5kACVjJWRNAElTTy04ODU5LTMALCwAc3RyZXNzTGVuZ3RoACRhY2NlbnRfYmVmb3JlAF8wWiVkAHNyYwBJU08tODg1OS00AC0tACcAJyBbJXNdICAlcwoAJGFiYnJldgBzdHJlc3NPcHQAJXMvJXMAQWRsbQBfJWNkAElTTy04ODU5LTUAJycAJWMlcwBBZmFrAHN0cmVzc1J1bGUAJGRvdWJsZQAlYyVkSQA9AElTTy04ODU5LTYAJGFsdAB0dW5lcwBBZ2hiACVjJWRVAF86AElTTy04ODU5LTcAX2RwdDIA2Y4gINmPICDZkAB3b3JkcwBfJWRNJWRvAEFob20Ac3RyZW5ndGgASVNPLTg4NTktOAAkYWx0MQBfIQDYpyDZiCDZigBuYW1lAF8lZE0lZGUAQXJhYgAlYyVkQgA6AElTTy04ODU5LTkAJGFsdDIA2Kgg2b4g2Kog2Kkg2Ksg2Kwg2K0g2K4g2K8g2LAg2LEg2LIg2LMg2LQg2LUg2LYg2Lcg2Lgg2Lkg2Log2YEg2YIg2YMg2YQg2YUg2YYg2KYg2KQg2KEg2KMg2KIg2KUg2YcAXyVkTSVkeABBcm1pAHRpbWUAbGFuZ3VhZ2UAQAAkYWx0MwBJU08tODg1OS0xMADYtSDYtiDYtyDYuABnZW5kZXIAQXJtbgB4bWw6YmFzZQBfJWRNJWQAJGFsdDQASVNPLTg4NTktMTEAQC0AfHwAJXgAQXZzdAB2YXJpYW50cwBfMG9mACRhbHQ1AElTTy04ODU5LTEzACDZkSAAZm9ybWFudABfJXMlZG8AQmFsaQAlZAAkYWx0NgBJU08tODg1OS0xNAAxAEJhbXUAc3BlYWsAcGl0Y2gAXyVzJWRlACRhbHQ3AElTTy04ODU5LTE1ACNYMQBfJXMlZHgAQmFzcwBwaG9uZW1lcwAkY29tYmluZQB2b2ljZQA/AElTTy04ODU5LTE2AGRpY3Rpb25hcnkAcHJvc29keQAkZG90AEJhdGsAXyVzJWQAS09JOC1SAC0AJGhhc2RvdABzYXktYXMAQmVuZwByZXBsYWNlAF9eXwBMYXRpbi05AF8wTTIAQmhrcwBlY2hvAG1hcmsAJG1heDMAX1gxAF8lZE0xAFRJUy02MjAAX3wAQmxpcwBmbHV0dGVyACRicmsAVVMtQVNDSUkAXzBNMQAkdGV4dAByb3VnaG5lc3MAJXMlcwBwAEJvcG8AXzo6AFVURi04AGNsYXJpdHkAQnJhaAAkdmVyYmYAcGhvbmVtZQAxTUEAY3AzNjcAdCMAQnJhaQAkdmVyYnNmAHRvbmUAc3ViADBNQQBjcDgxOQAnIQBCdWdpAHZvaWNpbmcAJG5vdW5mAHR0czpzdHlsZQBfO18AY3NBU0NJSQAwTUIAYXVkaW8AYnJlYXRoACRwYXN0ZgBCdWhkADFNACNAAGNzSVNPODg1OTEzAGJyZWF0aHcAZW1waGFzaXMAQ2FrbQAkdmVyYgAjYQAwTQBjc0lTTzg4NTkxNABDYW5zAF8wQ28AJG5vdW4AYnJlYWsAI2UAbWJyb2xhAGNzSVNPODg1OTE1ACRwYXN0AGNvbnNvbmFudHMAQ2FyaQAjaQBtZXRhZGF0YQBjc0lTTzg4NTkxNgBfMEMwAGtsYXR0AGJyACNvAENoYW0AJHZlcmJleHRlbmQAXzBDAGNzSVNPTGF0aW4xACN1AENoZXIAJGNhcGl0YWwAbGkAJXMlYyVzJWMAZmFzdF90ZXN0MgBjc0lTT0xhdGluMgBDaXJ0ACRhbGxjYXBzAE1pc3NpbmcgZmlsZTogJXMAXzBhbmQAc3BlZWQAZGQAY3NJU09MYXRpbjMAQ29wdAAkYWNjZW50AG1haW50YWluZXIAXyVkQ28AcGhvbmVtZXRhYmxlIGlzIG1pc3NpbmcAaW1nAGNzSVNPTGF0aW40AENwcnQAc3RhdHVzACRzZW50ZW5jZQB0ZABLZXl3b3JkICdwaG9uZW1lJyBleHBlY3RlZABjc0lTT0xhdGluNQBfJWRDMAAkb25seQBUb28gbWFueSBwcm9jZWR1cmVzAEN5cmwAbWFsZQBfJWRDAGNzSVNPTGF0aW42AGgxACRvbmx5cwBDeXJzACVzJXMlcyVzAGZlbWFsZQBjc0lTT0xhdGluQXJhYmljACUuM2RQAGgyACVzJXMlYyVzACRzdGVtAE1pc3NpbmcgJ2VuZHBob25lbWUnIGJlZm9yZSBlbmQtb2YtZmlsZQAlZCAlZCAlZCAlZCAlZABjc0lTT0xhdGluQ3lyaWxsaWMARGV2YQBoMwBfJWRmeABNb3JlIHRoYW4gb25lIHBob25lbWUgdHlwZTogJXMARG9ncgBjc0lTT0xhdGluR3JlZWsAJGF0ZW5kAE5VTEwAaDQAY3NJU09MYXRpbkhlYnJldwBEc3J0ACRhdHN0YXJ0ACVkICVzICVzAGhyAF8lZGYATlVMTABfJWQlY3gAc2NyaXB0AER1cGwAJG5hdGl2ZQAhdiVjAGNzS09JOFIAJXgAc3R5bGUARWd5ZAAlc20lZABfJWQlYwAkPwBjc1RJUzYyMABmb250AEVneWgAYSBwaG9uZW1lIHR5cGUgb3IgbWFubmVyIG9mIGFydGljdWxhdGlvbiBtdXN0IGJlIHNwZWNpZmllZCBiZWZvcmUgc3RhcnR0eXBlACR0ZXh0bW9kZQBfJWRlACVzZiVkAGNzVVRGOAAlcy92b2ljZXMvJXMARWd5cABfJWRvAGEgcGhvbmVtZSB0eXBlIG9yIG1hbm5lciBvZiBhcnRpY3VsYXRpb24gbXVzdCBiZSBzcGVjaWZpZWQgYmVmb3JlIGVuZHR5cGUAJHBob25lbWVtb2RlAGNzVW5pY29kZQBiAGVuZHR5cGUgbXVzdCBlcXVhbCBzdGFydHR5cGUgZm9yIGNvbnNvbmFudHMAdW5wcgBhbGwAaQBhcmFiaWMAXyVkYQBFbGJhAG5vcHJlZml4AHZvaWNpbmdzd2l0Y2ggY2Fubm90IGJlIHVzZWQgb24gdm93ZWxzAGVtAEV0aGkAXyVkAGN5cmlsbGljAHN0cmVzcyBwaG9uZW1lcyBjYW4ndCBjb250YWluIHByb2dyYW0gaW5zdHJ1Y3Rpb25zAEdlb2sAZ3JlZWsAY29kZQBfJWRYJWMAd19hbHQxAFdhcm5pbmc6IG1heGltdW0gbnVtYmVyICVkIG9mIChOX1ZPSUNFU19MSVNUID0gJWQgLSAxKSByZWFjaGVkCgAlcyVjJXMAR2VvcgBfJWRYZgAlYyVkJWMAZ3JlZWs4AHdfYWx0MgBNaXNzaW5nICdlbmRwaG9uZW1lJyBiZWZvcmUgJyVzJwBoZWJyZXcAZGVmYXVsdABHbGFnAF8lZFgATWlzc2luZyBFTkRJRgB3X2FsdDMARXJyb3IgKCVzKTogZ2VuZGVyIGF0dHJpYnV0ZSBzcGVjaWZpZWQgb24gYSBsYW5ndWFnZSBmaWxlCgBzaWxlbnQAR29uZwAnZW5kcGhvbmVtZScgbm90IGV4cGVjdGVkIGhlcmUAaXNvLWNlbHRpYwB3X2FsdDQAX29yZDIwAHgtc29mdABHb25tAFBob25lbWUgdHlwZSBpcyBtaXNzaW5nAF9vcmQAaXNvLWlyLTYAd19hbHQ1AHNvZnQAR290aAB3X2FsdDYAaXNvLWlyLTEwMABCYWQgcGhvbmVtZSBuYW1lICclcycAd19hbHQAJXMlcyVzAEdyYW4AbG91ZABpc28taXItMTAxACVzOiAnJXMnLgBHcmVrAHgtbG91ZABpc28taXItMTA5AHBfYWx0MQB4LXNsb3cAR3VqcgBwX2FsdDIAaXNvLWlyLTExMABFeHBlY3RlZCAnKCcAc2xvdwBHdXJ1AGlzby1pci0xMjYAcF9hbHQzAEV4cGVjdGVkICcpJwBmYXN0AEhhbmcAVmFsdWUgJWQgaXMgZ3JlYXRlciB0aGFuIG1heGltdW0gJWQAaXNvLWlyLTEyNwBwX2FsdDQAeC1mYXN0AEhhbmkAaXNvLWlyLTEzOABwX2FsdDUAQ2Fubm90IGZpbmQgcGhvbmVtZSAnJXMnIHRvIGltcG9ydC4AeC1sb3cASGFubwBwX2FsdDYAaXNvLWlyLTE0NABQaG9uZW1lIGltcG9ydCB3aWxsIG92ZXJyaWRlIHNldCBwcm9wZXJ0aWVzLgBsb3cAcF9hbHQASGFucwBpc28taXItMTQ4AFBob25lbWUgcmVmZXJlbmNlIG5vdCBmb3VuZDogJyVzJwAlcyVzLnR4dABIYW50AGhpZ2gAaXNvLWlyLTE1NwBjb21waWxlOiB1bmtub3duIHBob25lbWUgdGFibGU6ICclcycAJXMlcwBIYXRyAHgtaGlnaABQaG9uZW1lIHByb2dyYW0gdG9vIGxhcmdlAGlzby1pci0xOTkASGVicgBpc28taXItMjI2AEV4cGVjdGVkIGEgY29uZGl0aW9uLCBub3QgJyVzJwBzcGFjZSAAQ2FuJ3QgYWxsb2NhdGUgbWVtb3J5CgBFeHBlY3RlZCBsaXN0IG9mIHN0cmVzcyBsZXZlbHMASGlyYQBsYXRpbjEAdGFiIAAJJWQgZW50cmllcwoASGx1dwBsYXRpbjIAVW5leHBlY3RlZCBrZXl3b3JkICclcycAdW5kZXJzY29yZSAAJTVkOiBVbmtub3duIGtleXdvcmQ6ICVzCgBIbW5nAHBob25lbWUAbGF0aW4zAGRvdWJsZS1xdW90ZSAAJTVkOiBNaXNzaW5nICcoJwoASHJrdABlbmRwaG9uZW1lAG1hbGUAbGF0aW40AEh1bmcAZmVtYWxlAEV4cGVjdGVkIEFORCwgT1IsIFRIRU4AbGF0aW41ACU1ZDogTmVlZCB0byBjb21waWxlIGRpY3Rpb25hcnkgYWdhaW4KAEluZHMAbmV1dHJhbABFTFNFIG5vdCBleHBlY3RlZABsYXRpbjYAJTVkOiBCYWQgcGhvbmVtZSBbJXNdIChVKyV4KSBpbjogJXMgICVzCgBVKyV4AEl0YWwASUYgYmxvY2sgaXMgdG9vIGxvbmcAeG1sOmxhbmcAbGF0aW44AHZhcmlhbnQARUxJRiBub3QgZXhwZWN0ZWQASmF2YQBsYXRpbjEwACU1ZDogRGljdGlvbmFyeSBsaW5lIGxlbmd0aCB3b3VsZCBvdmVyZmxvdyB0aGUgZGF0YSBidWZmZXI6ICVkCgBKcGFuAGFnZQBFTkRJRiBub3QgZXhwZWN0ZWQAbDEAJTVkOiBUd28gbWFueSBwYXJ0cyBpbiBhIG11bHRpLXdvcmQgZW50cnk6ICVkCgBnZW5kZXIASnVyYwBQYXJhbWV0ZXIgPiAxMjcAbDIALy8AJXMrJXMAS2FsaQAuTABQYXJhbWV0ZXIgPCAtMTI4AGwzAGd0AC5yZXBsYWNlAEthbmEAUGFyYW1ldGVyID4gMjU1AGw0AGx0AEtoYXIALmdyb3VwAERGVABsNQAweCV4ACVzLyVzLndhdgBLaG1yAGFtcABsNgBxdW90AENhbid0IHJlYWQgZmlsZTogJXMAS2hvagBsOAAlNWQ6IEdyb3VwIG5hbWUgbG9uZ2VyIHRoYW4gMiBieXRlcyAoVVRGOCkARmlsZSBub3QgU1BFQyBvciBSSUZGOiAlcwBuYnNwAEtuZGEAbDEwAApFeGNlZWRlZCBsaW1pdCBvZiBydWxlcyAoJWQpIGluIGdyb3VwICclcycKAHVzAGFwb3MAS29yZQAlYyAgMHglLjV4ICAlcwoAAMDg8P8fDwdwCnEKAAAoACkAWwBdAHsAfQA8AD4AIgAnAGAAqwC7AAowCzA84A==`),i(t,93904,`ICAgICAgICAgICYlKyNTRFpBTCEgQD9KTktWP1RYP1dBQkNIRkdZPT0sLCcqICAAIAAhACIAsAIkACUA5gDIAigAKQB+AisAzAItAC4ALwBSAjEAMgBcAjQANQA2ADcAdQI5ANACsgI8AD0APgCUAlkCUQKyA+cA8ABbAkYAYgInAWoCXwJLAGsCcQJLAVQCpgNjAoACgwK4A4oCjAJTAccD+ACSAioDXABdAF4AXwBgAGEAYgBjAGQAZQBmAGECaABpAGoAawBsAG0AbgBvAHAAcQByAHMAdAB1AHYAdwB4AHkAegB7AHwAfQADA38APT0sLCcnAAMCBAUGBxoAAAAAAQECAwMEBQYHBwgJCgsAAAEBAgIDAwQFBgcHCAkKAAABAgMDAwQFBgcHBwgJClNldFdvcmRTdHJlc3MA5ADrAO8A9gD8AP8AAAAAAAAAYWFhYWFhYWNlZWVlaWlpaWRub29vb28Ab3V1dXV5dHNhYWFhYWFhY2VlZWVpaWlpZG5vb29vbwBvdXV1dXl0eWFhYWFhYWNjY2NjY2NjZGRkZGVlZWVlZWVlZWVnZ2dnZ2dnZ2hoaGhpaWlpaWlpaWlpaWlqamtra2xsbGxsbGxsbGxubm5ubm5ubm5vb29vb29vb3JycnJycnNzc3Nzc3NzdHR0dHR0dXV1dXV1dXV1dXV1d3d5eXl6enp6enpzYmJiYgAAb2NjZGRkZGRlZWVmZmdnaGlpa2tsbG1ubm9vb29vcHB5AABzc3R0dHR1dXV2eXl6enp6enp6AAAAd3R0dGtkZGRsbGxubm5hYWlpb291dXV1dXV1dXV1ZWFhYWFhYWdnZ2dra29vb296empkZGRnZ3d3bm5hYWFhb29hYWFhZWVlZWlpaWlvb29vcnJycnV1dXVzc3R0eXloaG5kb296emFhZWVvb29vb29vb3l5bG50amRxYWNjbHRzegAAYnV2ZWVqanFxcnJ5eWFhYWJvY2RkZWVlZWVl`),i(t,94846,`TG9va3VwRGljdDIAAAAAAAAAgACBAIIAgwCEAIUAhgCHAIgAiQCKAIsAjACNAI4AjwCQAJEAkgCTAJQAlQCWAJcAmACZAJoAmwCcAJ0AngCfAKAAoQCiAKMApAClAKYApwCoAKkAqgCrAKwArQCuAK8AsACxALIAswC0ALUAtgC3ALgAuQC6ALsAvAC9AL4AvwDAAMEAwgDDAMQAxQDGAMcAyADJAMoAywDMAM0AzgDPANAA0QDSANMA1ADVANYA1wDYANkA2gDbANwA3QDeAN8A4ADhAOIA4wDkAOUA5gDnAOgA6QDqAOsA7ADtAO4A7wDwAPEA8gDzAPQA9QD2APcA+AD5APoA+wD8AP0A/gD/AIAAgQCCAIMAhACFAIYAhwCIAIkAigCLAIwAjQCOAI8AkACRAJIAkwCUAJUAlgCXAJgAmQCaAJsAnACdAJ4AnwCgAAQB2AJBAaQAPQFaAacAqABgAV4BZAF5Aa0AfQF7AbAABQHbAkIBtAA+AVsBxwK4AGEBXwFlAXoB3QJ+AXwBVAHBAMIAAgHEADkBBgHHAAwByQAYAcsAGgHNAM4ADgEQAUMBRwHTANQAUAHWANcAWAFuAdoAcAHcAN0AYgHfAFUB4QDiAAMB5AA6AQcB5wANAekAGQHrABsB7QDuAA8BEQFEAUgB8wD0AFEB9gD3AFkBbwH6AHEB/AD9AGMB2QKAAIEAggCDAIQAhQCGAIcAiACJAIoAiwCMAI0AjgCPAJAAkQCSAJMAlACVAJYAlwCYAJkAmgCbAJwAnQCeAJ8AoAAmAdgCowCkAP3/JAGnAKgAMAFeAR4BNAGtAP3/ewGwACcBsgCzALQAtQAlAbcAuAAxAV8BHwE1Ab0A/f98AcAAwQDCAP3/xAAKAQgBxwDIAMkAygDLAMwAzQDOAM8A/f/RANIA0wDUACAB1gDXABwB2QDaANsA3ABsAVwB3wDgAOEA4gD9/+QACwEJAecA6ADpAOoA6wDsAO0A7gDvAP3/8QDyAPMA9AAhAfYA9wAdAfkA+gD7APwAbQFdAdkCgACBAIIAgwCEAIUAhgCHAIgAiQCKAIsAjACNAI4AjwCQAJEAkgCTAJQAlQCWAJcAmACZAJoAmwCcAJ0AngCfAKAABAE4AVYBpAAoATsBpwCoAGABEgEiAWYBrQB9Aa8AsAAFAdsCVwG0ACkBPAHHArgAYQETASMBZwFKAX4BSwEAAcEAwgDDAMQAxQDGAC4BDAHJABgBywAWAc0AzgAqARABRQFMATYB1ADVANYA1wDYAHIB2gDbANwAaAFqAd8AAQHhAOIA4wDkAOUA5gAvAQ0B6QAZAesAFwHtAO4AKwERAUYBTQE3AfQA9QD2APcA+ABzAfoA+wD8AGkBawHZAoAAgQCCAIMAhACFAIYAhwCIAIkAigCLAIwAjQCOAI8AkACRAJIAkwCUAJUAlgCXAJgAmQCaAJsAnACdAJ4AnwCgAAEEAgQDBAQEBQQGBAcECAQJBAoECwQMBK0ADgQPBBAEEQQSBBMEFAQVBBYEFwQYBBkEGgQbBBwEHQQeBB8EIAQhBCIEIwQkBCUEJgQnBCgEKQQqBCsELAQtBC4ELwQwBDEEMgQzBDQENQQ2BDcEOAQ5BDoEOwQ8BD0EPgQ/BEAEQQRCBEMERARFBEYERwRIBEkESgRLBEwETQROBE8EFiFRBFIEUwRUBFUEVgRXBFgEWQRaBFsEXASnAF4EXwSAAIEAggCDAIQAhQCGAIcAiACJAIoAiwCMAI0AjgCPAJAAkQCSAJMAlACVAJYAlwCYAJkAmgCbAJwAnQCeAJ8AoAD9//3//f+kAP3//f/9//3//f/9//3/DAatAP3//f/9//3//f/9//3//f/9//3//f/9//3/Gwb9//3//f8fBv3/IQYiBiMGJAYlBiYGJwYoBikGKgYrBiwGLQYuBi8GMAYxBjIGMwY0BjUGNgY3BjgGOQY6Bv3//f/9//3//f9ABkEGQgZDBkQGRQZGBkcGSAZJBkoGSwZMBk0GTgZPBlAGUQZSBv3//f/9//3//f/9//3//f/9//3//f/9//3/gACBAIIAgwCEAIUAhgCHAIgAiQCKAIsAjACNAI4AjwCQAJEAkgCTAJQAlQCWAJcAmACZAJoAmwCcAJ0AngCfAKAAGCAZIKMArCCvIKYApwCoAKkAegOrAKwArQD9/xUgsACxALIAswCEA4UDhgO3AIgDiQOKA7sAjAO9AI4DjwOQA5EDkgOTA5QDlQOWA5cDmAOZA5oDmwOcA50DngOfA6ADoQP9/6MDpAOlA6YDpwOoA6kDqgOrA6wDrQOuA68DsAOxA7IDswO0A7UDtgO3A7gDuQO6A7sDvAO9A74DvwPAA8EDwgPDA8QDxQPGA8cDyAPJA8oDywPMA80DzgP9/4AAgQCCAIMAhACFAIYAhwCIAIkAigCLAIwAjQCOAI8AkACRAJIAkwCUAJUAlgCXAJgAmQCaAJsAnACdAJ4AnwCgAP3/ogCjAKQApQCmAKcAqACpANcAqwCsAK0ArgCvALAAsQCyALMAtAC1ALYAtwC4ALkA9wC7ALwAvQC+AP3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f8XINAF0QXSBdMF1AXVBdYF1wXYBdkF2gXbBdwF3QXeBd8F4AXhBeIF4wXkBeUF5gXnBegF6QXqBf3//f8OIA8g/f+AAIEAggCDAIQAhQCGAIcAiACJAIoAiwCMAI0AjgCPAJAAkQCSAJMAlACVAJYAlwCYAJkAmgCbAJwAnQCeAJ8AoAChAKIAowCkAKUApgCnAKgAqQCqAKsArACtAK4ArwCwALEAsgCzALQAtQC2ALcAuAC5ALoAuwC8AL0AvgC/AMAAwQDCAMMAxADFAMYAxwDIAMkAygDLAMwAzQDOAM8AHgHRANIA0wDUANUA1gDXANgA2QDaANsA3AAwAV4B3wDgAOEA4gDjAOQA5QDmAOcA6ADpAOoA6wDsAO0A7gDvAB8B8QDyAPMA9AD1APYA9wD4APkA+gD7APwAMQFfAf8AgACBAIIAgwCEAIUAhgCHAIgAiQCKAIsAjACNAI4AjwCQAJEAkgCTAJQAlQCWAJcAmACZAJoAmwCcAJ0AngCfAKAABAESASIBKgEoATYBpwA7ARABYAFmAX0BrQBqAUoBsAAFARMBIwErASkBNwG3ADwBEQFhAWcBfgEVIGsBSwEAAcEAwgDDAMQAxQDGAC4BDAHJABgBywAWAc0AzgDPANAARQFMAdMA1ADVANYAaAHYAHIB2gDbANwA3QDeAN8AAQHhAOIA4wDkAOUA5gAvAQ0B6QAZAesAFwHtAO4A7wDwAEYBTQHzAPQA9QD2AGkB+ABzAfoA+wD8AP0A/gA4AYAAgQCCAIMAhACFAIYAhwCIAIkAigCLAIwAjQCOAI8AkACRAJIAkwCUAJUAlgCXAJgAmQCaAJsAnACdAJ4AnwCgAAEOAg4DDgQOBQ4GDgcOCA4JDgoOCw4MDg0ODg4PDhAOEQ4SDhMOFA4VDhYOFw4YDhkOGg4bDhwOHQ4eDh8OIA4hDiIOIw4kDiUOJg4nDigOKQ4qDisOLA4tDi4OLw4wDjEOMg4zDjQONQ42DjcOOA45DjoO/f/9//3//f8/DkAOQQ5CDkMORA5FDkYORw5IDkkOSg5LDkwOTQ5ODk8OUA5RDlIOUw5UDlUOVg5XDlgOWQ5aDlsO/f/9//3//f+AAIEAggCDAIQAhQCGAIcAiACJAIoAiwCMAI0AjgCPAJAAkQCSAJMAlACVAJYAlwCYAJkAmgCbAJwAnQCeAJ8AoAAdIKIAowCkAB4gpgCnANgAqQBWAasArACtAK4AxgCwALEAsgCzABwgtQC2ALcA+AC5AFcBuwC8AL0AvgDmAAQBLgEAAQYBxADFABgBEgEMAckAeQEWASIBNgEqATsBYAFDAUUB0wBMAdUA1gDXAHIBQQFaAWoB3AB7AX0B3wAFAS8BAQEHAeQA5QAZARMBDQHpAHoBFwEjATcBKwE8AWEBRAFGAfMATQH1APYA9wBzAUIBWwFrAfwAfAF+ARkggACBAIIAgwCEAIUAhgCHAIgAiQCKAIsAjACNAI4AjwCQAJEAkgCTAJQAlQCWAJcAmACZAJoAmwCcAJ0AngCfAKAAAh4DHqMACgELAQoepwCAHqkAgh4LHvIerQCuAHgBHh4fHiABIQFAHkEetgBWHoEeVx6DHmAe8x6EHoUeYR7AAMEAwgDDAMQAxQDGAMcAyADJAMoAywDMAM0AzgDPAHQB0QDSANMA1ADVANYAah7YANkA2gDbANwA3QB2Ad8A4ADhAOIA4wDkAOUA5gDnAOgA6QDqAOsA7ADtAO4A7wB1AfEA8gDzAPQA9QD2AGse+AD5APoA+wD8AP0AdwH/AIAAgQCCAIMAhACFAIYAhwCIAIkAigCLAIwAjQCOAI8AkACRAJIAkwCUAJUAlgCXAJgAmQCaAJsAnACdAJ4AnwCgAKEAogCjAKwgpQBgAacAYQGpAKoAqwCsAK0ArgCvALAAsQCyALMAfQG1ALYAtwB+AbkAugC7AFIBUwF4Ab8AwADBAMIAwwDEAMUAxgDHAMgAyQDKAMsAzADNAM4AzwDQANEA0gDTANQA1QDWANcA2ADZANoA2wDcAN0A3gDfAOAA4QDiAOMA5ADlAOYA5wDoAOkA6gDrAOwA7QDuAO8A8ADxAPIA8wD0APUA9gD3APgA+QD6APsA/AD9AP4A/wCAAIEAggCDAIQAhQCGAIcAiACJAIoAiwCMAI0AjgCPAJAAkQCSAJMAlACVAJYAlwCYAJkAmgCbAJwAnQCeAJ8AoAAEAQUBQQGsIB4gYAGnAGEBqQAYAqsAeQGtAHoBewGwALEADAFCAX0BHSC2ALcAfgENARkCuwBSAVMBeAF8AcAAwQDCAAIBxAAGAcYAxwDIAMkAygDLAMwAzQDOAM8AEAFDAdIA0wDUAFAB1gBaAXAB2QDaANsA3AAYARoC3wDgAOEA4gADAeQABwHmAOcA6ADpAOoA6wDsAO0A7gDvABEBRAHyAPMA9ABRAfYAWwFxAfkA+gD7APwAGQEbAv8AgACBAIIAgwCEAIUAhgCHAIgAiQCKAIsAjACNAI4AjwCQAJEAkgCTAJQAlQCWAJcAmACZAJoAmwCcAJ0AngCfAKAABAEFAUEBrCAeIGABpwBhAakAGAKrAHkBrQB6AXsBsACxAAwBQgF9AR0gtgC3AH4BDQEZArsAUgFTAXgBfAHAAMEAwgACAcQABgHGAMcAyADJAMoAywDMAM0AzgDPABABQwHSANMA1ABQAdYAWgFwAdkA2gDbANwAGAEaAt8A4ADhAOIAAwHkAAcB5gDnAOgA6QDqAOsA7ADtAO4A7wARAUQB8gDzAPQAUQH2AFsBcQH5APoA+wD8ABkBGwL/AP3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9//3//f/9/wEJAgkDCQUJBgkHCQgJCQkKCQsJDgkPCRAJDQkSCRMJFAkRCRUJFgkXCRgJGQkaCRsJHAkdCR4JHwkgCSEJIgkjCSQJJQkmCScJKAkpCSoJKwksCS0JLgkvCV8JMAkxCTIJMwk0CTUJNgk3CTgJOQkgAD4JPwlACUEJQglDCUYJRwlICUUJSglLCUwJSQlNCTwJZAn9//3//f/9//3/IAAwADEAMgAzADQANQA2ADcAOAA5AP3//f/9//3//f8CAAAAAAAAAAEAAAADAAAA//36+Pb08vDu7Oro5uTi4N7c2tjW1NLQzszKyMbEwsC+vLq4trSysK6sqqimpKKgnpyamJaUkpCOjIqIhoSCgH58enh2dHJwbmxqaGZkYmBeXFpYVlRSUE5MSkhGREJAPjw6ODY0MjAuLCooJiQiIB4cGhgWFBIQDgwKCAYEAgAAAgQGCAoMDhASFBYYGhweICIkJigqLC4wMjQ2ODo8PkBCREZISkxOUFJUVlhaXF5gYmRmaGpsbnBydHZ4enx+gIKEhoiKjI6QkpSWmJqcnqCipKaoqqyusLK0tri6vL7AwsTGyMrMztDS1NbY2tze4OLk5ujq7O7w8vT2+Pr9///06uDWzMO6saifl4+Hf3hxamNcVlBKRD85NC8rJiIeGhcTEA0LCAYEAgEAAAAAAAAAAQIDBAUHCAoMDhATFRcaHR8iJSgsLjAyNDY5Oz1AQkVHSkxPUVRXWl1fYmVoa25xdHh7foGFiIuPkpaZnaCkqKyvs7e7v8PHy8/T19vgz8zJxsPAvbm0sKunopyXkoyGgXt1b2ljXVdQSkQ+ODMtJyIcFxINCAQCAgEAAAAAAAEBAgMEBQcICgwNDxIUFhkbHiEkJyotMDQ2ODo8P0FDRkhLTVBSVVhaXWBjZmlsb3J1eHt+gYWIi4+SlpmdoKSorK+zt7u/w8fLz9PX2+D/+fTu6eTf2tXQy8bBvbizr6qmoZ2ZlZCMiISAfXl1cW5qZ2NgXVlWU1BNSkdEQT48OTc0Mi8tKygmJCIgHhwaGRcVFBIRDw4NDAoJCAcGBQUEAwICAQE=`),i(t,99845,`AQECAgMEBAUGBwgJCgsMDg8QEhMVFxgaHB4g0M7NzMrIx8XDwcC9u7i1s7CtqqejoJ2ZlpKPi4eEgHx4dHBtaWVhXVlVUU1KRkI+Ozc0MS8tKigmJCIgHhwaGRcVFBIRDw4NDAoJCAcGBQUEAwICAQE=`),i(t,99973,`AQECAgMEBAUGBwgJCgsMDg8QEhMVFxgaHB4gmJmZmpydn6Gkp6mssLO2ur7BxcnN0dTY3N/j5urt8PL19/n7/P3+/v////////79+/r49vPx7uzp5uTg3drX09DMyMTAvLi0sKyno5+alpGNiIR/e3ZybWllYFxYVFBMSERAPDk1Mi8rKCYjIB0aFxUSDw0KCAcFAwIBAAAAAAD+///////+/fz6+Pb08e7r6OXh3trW0s3JxL+6trCrpqGclpGLhoB7dW9qZF9ZVE9JRD86NTArJiIdGRURDQoHBAMBAAAAAAAAAAABAQIEBQcJCw0QEhUYGx4iJSktMTU6PkNITFFXW15iZWhrbnF0dnh7fH6AgYKDg4SEg4OCgXJycXFwb21samhmZGFfXFpXVFFOS0hFQj87ODUyLywpJiMgHRsYFhQSEA4MCwoJCAcHBwcHBgUFBQUFBQUFBQYHBwgJCgwNDxASFBYYGx0gIyYpLC8zNzs/Q0dMUVZbYGVqb3R5f4SJj5Wboaets7rAx87V3OPq8fX3+vz9/v///v79/fz7+/r6+fj49/f29vX09PPz8vLx8PDv7u7t7Ovq6uno5+bl5OPi4eDe3dzb2djW1dPS0M7My8nHxcPAvry5t7Wyr62qp6ShnpqXlJCNiYWBfXl1cW1oZGFeW1dUUU1KRkNAPDk1Mi4qJyMfHBgUEQ0LCQcFBAMCAQAAAAAAAAAAAQEBAgIDAwQEBQYGBwgICQoLDAwNDg8QERITFBYXGBkbHB0fICIjJSYoKSstLzAyNDY4Ojw+QEJER0lLTlBSVVdaXV9iZWdqbXBzdnl8f4KGiYyQk5aanaCjpqmsr7K1uLu+wcTHys3Q09bZ3N/i5Ofp7O7w8vT2+Pr7/X9/f4CBg4SHiYyPkpaZnaGlqq6yt7vAxcnN0tba3uLm6u3w8/X4+vv8/f7+/fz7+ff08Ozn4tzVzsa9tKmekoiCfXdybGZgWlROSUI8NzItKCQfGxgUEQ4MCQcGBQQEBAQFBggKDRAUGB0jKS83PkdQWmRwfIOFiIqMjo+RkpOTAEAIAEYSAAAAAAAAGAwAAARQEgZOFgAAAAAAACI0AAAEWBYGUhYAAAAAAAAiQAAAAFwIAFxQAAAAAAAATAgBAABWBABeQgAAAAAAACIKAAAAPgoAPhQAAAAAAAAcEAAABEQSBkQWAAAAAAAAHiwAAAZAEABCIAAAAAAAACASAAACRC4AKiAAAAAAAAAuOgAABE4YBkgWAAAAAAAAKjQAAARYIgBAIAAAAAAAAC5SAAAAOAwAOBQAAAAAAAAYDAAAAEYSAEYYAAAAAAAAIBQAAAkAAAAJAAAAEAAAABAAAAAQAAAAFwAAADcAAAAgAAAAACgYCAAKNCAUCgYmGA4EAAYAAAAHAAAACQAAAAkAAAAUAAAAFAAAABQAAAAZAAAA5iAUCA==`),i(t,101072,`ZgNmAWYCpgSmAiYEpoooAmoDagFqAqoCbgNuAW4CrgIpALMEdAN0AXQCtAS0AgAAdAR6A3oBegK6An4BOQC+AgAApgMAAKYBAADmAwAAaAEAAGgCAAAoAwAA6AEAAOkBAABpBAAAqgMAAKoBAAAqAwAA6gMAAOoBAABsAgAArAEAACwDAAAsAgAAbQIAAG0EAACuBAAArgMAAK4BAADuAwAALgAAAO6LAABvAgAAMAIwAAAAcQEAADECAADxAQAAMQMAAHEEAABzAQAAMwIAAPMBMwAAADMAAAC0AwAAtAEAAPQCAAC0igAAdwEAADcCAAD3AQAAeAEAAHgCAAA4AgAA+AEAADkCAAD5AQAAeQQAALoEAAC6AwAAugEAADoEAAD6AgAA+gMAAHwCAAB+AgAAAAB/AQAAPwMAAP8BOACmAAEAgQBnBQAAKAEpBWkF6gAAAEIFAADDAEMdAADvBGwFLABsAAQAAACtAG0FAADuBAUAbgCxBPEEMQXxj7IAAAByBQAAMwVzAPQEtJoAAAgAtwCOADcVAAA3BQAAzQB3ALcIOAUAAG8FyQAJAbkAOQX6BAoAewW7ALwAvgB+AD8FPwEAAAsBAADMAIwAAAAAAGcAAABsDW0ALwGwAHEAdgVMBEwc6Y8AAOnPOY4AADnO`),i(t,101586,`sQNZAlsCswO5A1MByQPGA4MCxQOSApQCfgJ8AgAAqgBhgLIAMoCzADOAuQAxgLoAb4CwAmiAsQJmgrICaoCzAnKAtAJ5grUCe4K2AoGCtwJ3gLgCeYDAApSCwQKVguACY4LhAmyA4gJzgOMCeIBwIDCAcSBpgHQgNIB1IDWAdiA2gHcgN4B4IDiAeSA5gHogK4B7IC2AfCA9gH0gKIB+ICmAfyBugIAgMECBIDFAgiAyQIMgM0CEIDRAhSA1QIYgNkCHIDdAiCA4QIkgOUCKICtAiyAtQIwgPUCNIChAjiApQJAgYUCRIGVAkiBvQJMgeECUIFlClSBoQJYga0CXIGxAmCBtQJkgbkCaIHBAmyBzQJwgdEAAAAAAaXhjbXZsZA==`),i(t,101888,`AQAAAAoAAABkAAAA6AMAAAUAAAAyAAAA9AEAAAAXCgkYExgY`),i(t,101936,`///////9+fXy7uvo5OHe2tjV0s/MycbEwb+8ure1s7CurKmopaOhn56bmZiWlJKRj42LiYiHhYOCgX9+fHt6eHd2dXNycXBvbm1ramloZ2ZlZGNiYWBfXl1cW1pZWVhXVlVUU1JSUVBQT05NTExLS0pJSEdHRkVFRENDQkJBQEA/Pj49PTw7Ozo6OTk4ODc2NjU1NDQ0MzIyMTEwMC8vLi4uLS0sLCwrKyopKCgoJycnJiYmJSUlJCQjIyMjIiIiISEhICAfHx8eHh4dHR0dHBwbGxsbGhoaGhkZGRgYGBgXFxcXFhYWFRUVFRQUFBQTExMSEhERERAQEBAQEA8PDw8ODg4NDQ0MDAwMCwsLCwoKCgkJCQgICAAAAAAAAAAAeHl4d3d2dnV0dHNycXBwb29ubWxrampoZ2dmZmZlZWNiYmFgYF9eXVtaW1pZWFZVVlVVVFJRUE9NTk5MTUtLSklHSEZFRUVDQUA/Pz89PTs7Ozo4OTo4NjU0NDU0NDIwLy8tLi0=`),i(t,102336,`FhYWFhYWFhUVFRUUFBMTEhEQDw8PDw8PDwAAAAAAAABkeGRpZG5uZF9kaXhpbn2Ch3N9ZGl4S2RLaXhVS2RpeFVpX3N4ZF9kbnhfaWRzeGRkZGl4ZGlfc3huX2RpeGRpaXp9bmlkaXhkaWl6fW5pZGl4X2lkc3huZGRkeGRkZGRkZGRk`),i(t,102480,`ZJZkaW5zbm5uZGmWaW59h4xzh2RpllppWnqHZFpkaZZkaWR6h2RkZGmWZGlpc4duaWRplmRpaXqCeH1kaZZkaW56fXNuZGmWZGlpeod4aWRplmRpaXOHbmlkZGRkZGRkZGRkZA==`),i(t,102592,`bnhkbm5ubm5ubm54ZG5ubm5ubm5ueGRuZG5ubmRubnhkbm5ubm5ubm54ZG5ubm5ubm5ueGRubm5ubm5ubnhkbm5ubm5ubm54ZG5ubm5ubm5ueGRubm5ubm5ubnhkbm5ubm5ubg==`),i(t,102708,`rwAAAGQAAAAyAAAAMg==`),i(t,102744,`ZA==`),i(t,102764,`MjIoRlpkZGRGboeWZGRLZHiWAAAAAAAABwAAAA4AAAAVAAAAKAAAAFAAAAAAAAAAAFNBUFIAQwAAAAAARgAAAAAAAAABAAAAAgAAAAQAAAAPAAAAAAEAAAEBAAEBAgQAAAAAAPMAEAEAAQABAAEAAQAB8ADwAPA=`),i(t,102898,`QABaAG4AgACPAJwAqQC1AMAAygDUAN0A5gDvAPcAAAEHAQ8BFgEeASUBLAEyATkBQAFGAUwBUgFYAV4BZAFqAW8BdQF6AYABhQGKAY8BlAGZAZ4BowGoAa0BsgG2AbsBwAHEAckBzQHRAdYB2gHeAeMB5wHrAe8B8wH3AfsBAAIDAgcCCwIPAhMCFwIbAh8CIgImAioCLQIxAjUCOAI8AkACQwJHAkoCTgJRAlQCWAJbAl8CYgJlAmkCbAJvAnMCdgJ5AnwCgAKDAoYCiQKMAo8CkgKWApkCnAKfAqICpQKoAqsCrgKxArQCtwK6Ar0CwALCAsUCyALLAs4C0QLUAtYC2QLcAt8C4gLkAucC6gLtAu8C8gL1AvcC+gL9AgADAgMFAwcDCgMNAw8DEgMVAxcDGgMcAx8DIQMkAycDKQMsAy4DMQMzAzYDOAM7Az0DQANCA0QDRwNJA0wDTgNRA1MDVQNYA1oDXQNfA2EDZANmA2gDawNtA28DcgN0A3YDeQN7A30DgAOCA4QDhgMAAAGqAqytAwQFsLGys7S0tgYHCLkJCrwMDQ4PEBESYWJjZGVmZ2hpamtsbW5vcHFyc3R1`),i(t,103360,`YAYAAPAGAABmCQAA5gkAAGYKAADmCgAAZgsAAOYLAABmDAAA5gwAAGYNAABQDgAA0A4AACAPAABAEAAAkBA=`),i(t,103440,`5gDmAOYA5gAAAAAA5gDmAL4AqgC+AMgAAAAAAL4A8AC+AL4A0gDSAAAAAADSANIAyADIANIA0gAAAAAA5gDmAOYA5gDwAPAAAAAAAAQBBAGqAIwA3ADcAAAAAAD6AA4BoACMAMgAjAAAAAAA8ACgALQAtADSANIAAAAAAOYA8ACqANwAtAC0AAAAAAD6AA4BlgCCAMgAyAAAAAAADgEOAbYAjADcANwAAAAAAPgAEwGbALQA0gDSAAAAAAAOASwBwwMAAAAAAABsAAAAAAAAAKAAkQCbAJYAAAAAAMgA9QAnAAAAtwAAAAAAAADCugAAyADIAMgAyAAAAAAA0gDmAAABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGgAAAAAAABscHR4fICEiIyQlJicoKSorAAAs`),i(t,103790,`LQAAAAAAAAAu`),i(t,103816,`Lw==`),i(t,103833,`MAAAAAAAMQ==`),i(t,103856,`Mg==`),i(t,103868,`MwAAAK0AAQBABgEADCAtAAAAAAC+AL4A0gDSAAAAAADmAPoAoACWAMgAyAAAAAAA+gAEAbkAwwDDAL4AAAAAANIA3AD6AMgA+gD6AAAAAAD6APoAMjM0Njk6PD0+P0BBQkNERkdJSktMTU5PUFFSU1RWAACWAIwAtAC0AAAAAADIAMgAbA==`),i(t,104016,`oADIALQAtAAAAAAA3ADwALQAoADIAMgAAAAAAPAA+gBjAAAAZgAAAGgAAABrAAAAcAAAAHQAAAB4AAAA/g==`),i(t,104096,`oACMAJYApQAAAAAA2gAxAZEAkQCqAKAAAAAAAEoBXgEuAAAALAAAACcAAADIAg==`),i(t,104160,`MTIzNTY3OTo7PD4/QEFCREVGR0hJSktMTU5PUFFSU1RW`),i(t,104208,`vgC0AOYA5gAAAAAA+gD6ABESExQWFxkaGxwdHyAhIiQlJicoKSosc3uDmwAAAAAAtAC0AL4AtAAAAAAA5gDwALQAtAC0AKAAAAAAAOYAtABABAAAMAQAADUEAAA4BAAAOQQAAD4EAABDBAAASwQAAE0EAABOBAAATwQAAFAEAABRBAAAVgQAAFcEAABdBAAAXgQ=`),i(t,104368,`tACgAMgAyAAAAAAA3ADmAKAAhwDSANIAAAAAAAQBGAGgAIwAyADIAAAAAADcAOYAyADIAMgAyAAAAAAAyADIAKAAvgCvAK8AAAAAAMgA0gCqAHMA0gDwAAAAAAAEARgBqgCqALQAtAAAAAAA8AAEAZYAtADIAMgAAAAAANIA+gCWAJYAtAC0AAAAAAAsASwBoACHANwA3AAAAAAA+gAYAaAAqgDIAMgAAAAAAEABVAG0AKAA8ADwAAAAAAAEAQQBvgC0AMgA5gAAAAAA8AD6AJYAlgC0ALQA0gDmAOYA8ABhAAAA4AAAAOEAAACjHgAA4wAAAKEeAAADAQAAsR4AAK8eAACzHgAAtR4AALceAADiAAAApx4AAKUeAACpHgAAqx4AAK0eAABlAAAA6AAAAOkAAAC7HgAAvR4AALkeAADqAAAAwR4AAL8eAADDHgAAxR4AAMceAABpAAAA7AAAAO0AAADJHgAAKQEAAMseAABvAAAA8gAAAPMAAADPHgAA9QAAAM0eAAD0AAAA0x4AANEeAADVHgAA1x4AANkeAAChAQAA3R4AANseAADfHgAA4R4AAOMeAAB1AAAA+QAAAPoAAADnHgAAaQEAAOUeAACwAQAA6x4AAOkeAADtHgAA7x4AAPEeAAB5AAAA8x4AAP0AAAD3HgAA+R4AAPUe`),i(t,104896,`5gCWAOYA5gDmAAAA8AD6AAAAAAAnAAAAAAAAAAABAgM=`),i(t,104945,`AQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRo=`),i(t,105072,`GxwdAAAeHyAhIiMkACUmAAAAACcAACgAKQAqACsAAAAAAAAsAC0ALgAAAAAALwAAADAAAAAAAAAAMQ==`),i(t,105170,`MgAz`),i(t,105195,`NAAAAAAANQA2`),i(t,105226,`NwA4ADkArQABAAwgAQ==`),i(t,105249,`AQIDAAQAAQIDAAQFBgIDAAQFBwEDAAQICQoDAAAICAoDAAALCwsLAAAMDAwMAAAMAQ4BEwEBAw8DDgYRBgMJAQsPCwEMCQwBDgYOCQ4ODg8OHA4DDxEPEg8PEBEQAREGEQkRDxETEiAS/38AAAAAlgCMANwA3AAAAAAABAEYAYKAeHRkZICAgIyAgKCrq4CAgA==`),i(t,105412,`yAAAAMgAAACQAQAAkAEAAJABAABYAgAAWAIAAFgC`),i(t,105456,`8AAAAKoAAACqAAAAqgAAAKoAAACqAAAAqgAAAKoAAACqAAAAAQIMAw0EDgULAAAAAQIDBAUGAAAAAAAACwwNDg==`),i(t,105540,`MgAAAK8AAABkAAAAMg==`),i(t,105568,`rw==`),i(t,105596,`EBAKEBY=`),i(t,105620,`/38AANAHAAAsAQAAYwAAAGMAAABjAAAAAAAAANAH`),i(t,105668,`BA==`),i(t,105680,`QEFCQ0RFRkdISUpLTE1OT1BRUlNUVldYWVtcXV5gYWJkZWdoaWtsbm9xc3R2d3l7fH6AgoSFh4mLjY+Rk5WXmZueoKKkp6mrrrCztbi6vb/CxcfKzdDT1tnc3+Ll6Ozv8vb5/P7/`),i(t,105792,`//7+/v7+/v7+/v39/f38/Pz7+/v6+vn5+Pj39/b19fTz8/Lx7+3r6efl4+Hf3drY1dPQzcvIxcK/u7i1sq6rp6OgnJiUkIyIhH97d3JuaWRgXltYVlNRTkxKR0VCQD48OTc1MzEvLCooJiQiIB4dGxkXFRMSEA4MCwkHBgQDAQ==`),i(t,106064,`//7+/v7+/f38+/v6+fj39vX08vHv7uzq6efl4+Hf3NrY1dPRz83LycfFw8G/vbu5t7SysK2rqaakoZ+cmpeUko+MioeEgX57eHZzcGxpZmNgX11bWlhWVVNSUE9NTEpJSEZFRENCQD8+PTw7Ojk4Nzc2NTQ0MzIyMTAwLy8uLi4tLS0sLCwsLCwsKysrKywrKiopKCgnJiYlJCQjIyIhISAgHx4eHR0cHBsaGhkZGBgXFxYWFRUUFBMTEhISEREQEA8PDw4ODQ0NDAwLCwsKCgoJCQkICAgHBwcHBgYGBQUFBQQEBAQEAwMDAwICAgICAgEBAQEBAQ==`),i(t,106341,`RvIpAC8ALwBF8ikALwAuAEXyKAAuAC0ANPIoAC0tLAA08igAKysrADTyKAAqKioANPIoACkpKQA08igAAOf/zv+1/5z/g/9q/1H/N/8e/wX/7P7T/rr+of6I/m/+Vf48/iP+Cv7x/dj9v/2m/Y39dP1b/UL9Kf0Q/ff83vzF/Kz8k/x6/GH8SPwv/Bb8/fvk+8v7svuZ+4D7Z/tP+zb7HfsE++v60vq6+qH6iPpv+lf6Pvol+g369Pnb+cP5qvmR+Xn5YPlH+S/5Fvn++OX4zfi0+Jz4g/hr+FP4Ovgi+Ar48ffZ98H3qPeQ93j3YPdH9y/3F/f/9uf2z/a39p/2h/Zv9lf2P/Yn9g/29/Xf9cf1sPWY9YD1aPVR9Tn1IfUK9fL02/TD9Kz0lPR99GX0TvQ29B/0CPTw89nzwvOr85TzfPNl807zN/Mg8wnz8vLb8sTyrvKX8oDyafJS8jzyJfIO8vjx4fHL8bTxnvGH8XHxW/FE8S7xGPEB8evw1fC/8Knwk/B98GfwUfA78CXwEPD67+Tvzu+576Pvje9472LvTe847yLvDe/47uLuze647qPuju557mTuT+467iXuEO777eft0u297antlO2A7WvtV+1C7S7tGu0F7fHs3ezJ7LXsoeyN7HnsZexR7D3sKuwW7ALs7+vb68jrtOuh643reutn61TrQest6xrrB+v06uLqz+q86qnqluqE6nHqX+pM6jrqJ+oV6gPq8One6czpuumo6ZbphOly6WHpT+k96SzpGukI6ffo5ujU6MPosuig6I/ofuht6FzoS+g76CroGegI6Pjn5+fX58bntuel55Xnhed152XnVedF5zXnJecV5wXn9ubm5tfmx+a45qjmmeaK5nvma+Zc5k3mPuYw5iHmEuYD5vXl5uXY5cnlu+Wt5Z7lkOWC5XTlZuVY5UrlPOUv5SHlE+UG5fjk6+Te5NDkw+S25KnknOSP5ILkdeRo5FzkT+RD5DbkKuQd5BHkBeT54+3j4ePV48njveOx46XjmuOO44Pjd+Ns42HjVuNL4z/jNOMq4x/jFOMJ4//i9OLq4t/i1eLK4sDituKs4qLimOKO4oTie+Jx4mfiXuJU4kviQuI54i/iJuId4hTiDOID4vrh8eHp4eDh2OHQ4cfhv+G34a/hp+Gf4Zfhj+GI4YDheOFx4WrhYuFb4VThTeFG4T/hOOEx4SrhJOEd4RbhEOEK4QPh/eD34PHg6+Dl4N/g2eDU4M7gyeDD4L7guOCz4K7gqeCk4J/gmuCV4JHgjOCH4IPgfuB64HbgcuBu4GrgZuBi4F7gWuBX4FPgT+BM4EngReBC4D/gPOA54DbgM+Ax4C7gK+Ap4CfgJOAi4CDgHuAc4BrgGOAW4BTgEuAR4A/gDuAN4AvgCuAJ4AjgB+AG4AXgBeAE4APgA+AC4ALgAuAC4ALgAeAC4ALgAuAC4ALgA+AD4ATgBeAF4AbgB+AI4AngCuAL4A3gDuAP4BHgEuAU4BbgGOAa4BzgHuAg4CLgJOAn4CngK+Au4DHgM+A24DngPOA/4ELgReBJ4EzgT+BT4FfgWuBe4GLgZuBq4G7gcuB24HrgfuCD4IfgjOCR4JXgmuCf4KTgqeCu4LPguOC+4MPgyeDO4NTg2eDf4OXg6+Dx4Pfg/eAD4QrhEOEW4R3hJOEq4THhOOE/4UbhTeFU4VvhYuFq4XHheOGA4Yjhj+GX4Z/hp+Gv4bfhv+HH4dDh2OHg4enh8eH64QPiDOIU4h3iJuIv4jniQuJL4lTiXuJn4nHie+KE4o7imOKi4qzituLA4sri1eLf4uri9OL/4gnjFOMf4yrjNOM/40vjVuNh42zjd+OD447jmuOl47HjvePJ49Xj4ePt4/njBeQR5B3kKuQ25EPkT+Rc5GjkdeSC5I/knOSp5Lbkw+TQ5N7k6+T45AblE+Uh5S/lPOVK5VjlZuV05YLlkOWe5a3lu+XJ5djl5uX15QPmEuYh5jDmPuZN5lzma+Z75ormmeao5rjmx+bX5ubm9uYF5xXnJec150XnVedl53XnheeV56XntufG59fn5+f45wjoGegq6DvoS+hc6G3ofuiP6KDosujD6NTo5uj36AjpGuks6T3pT+lh6XLphOmW6ajpuunM6d7p8OkD6hXqJ+o66kzqX+px6oTqluqp6rzqz+ri6vTqB+sa6y3rQetU62freuuN66HrtOvI69vr7+sC7BbsKuw97FHsZex57I3soey17Mns3ezx7AXtGu0u7ULtV+1r7YDtlO2p7b3t0u3n7fvtEO4l7jruT+5k7nnuju6j7rjuze7i7vjuDe8i7zjvTe9i73jvje+j77nvzu/k7/rvEPAl8DvwUfBn8H3wk/Cp8L/w1fDr8AHxGPEu8UTxW/Fx8YfxnvG08cvx4fH48Q7yJfI88lLyafKA8pfyrvLE8tvy8vIJ8yDzN/NO82XzfPOU86vzwvPZ8/DzCPQf9Db0TvRl9H30lPSs9MP02/Ty9Ar1IfU59VH1aPWA9Zj1sPXH9d/19/UP9if2P/ZX9m/2h/af9rf2z/bn9v/2F/cv90f3YPd495D3qPfB99n38fcK+CL4OvhT+Gv4g/ic+LT4zfjl+P74Fvkv+Uf5YPl5+ZH5qvnD+dv59PkN+iX6PvpX+m/6iPqh+rr60vrr+gT7Hfs2+0/7Z/uA+5n7svvL++T7/fsW/C/8SPxh/Hr8k/ys/MX83vz3/BD9Kf1C/Vv9dP2N/ab9v/3Y/fH9Cv4j/jz+Vf5v/oj+of66/tP+7P4F/x7/N/9R/2r/g/+c/7X/zv/n/wAAGQAyAEsAZAB9AJYArwDJAOIA+wAUAS0BRgFfAXgBkQGrAcQB3QH2AQ8CKAJBAloCcwKMAqUCvgLXAvACCQMiAzsDVANtA4YDnwO4A9ED6gMDBBwENQROBGcEgASZBLEEygTjBPwEFQUuBUYFXwV4BZEFqQXCBdsF8wUMBiUGPQZWBm8GhwagBrkG0QbqBgIHGwczB0wHZAd9B5UHrQfGB94H9gcPCCcIPwhYCHAIiAigCLkI0QjpCAEJGQkxCUkJYQl5CZEJqQnBCdkJ8QkJCiEKOQpQCmgKgAqYCq8KxwrfCvYKDgslCz0LVAtsC4MLmwuyC8oL4Qv4CxAMJww+DFUMbAyEDJsMsgzJDOAM9wwODSUNPA1SDWkNgA2XDa4NxA3bDfINCA4fDjUOTA5iDnkOjw6lDrwO0g7oDv8OFQ8rD0EPVw9tD4MPmQ+vD8UP2w/wDwYQHBAyEEcQXRBzEIgQnhCzEMgQ3hDzEAgRHhEzEUgRXRFyEYcRnBGxEcYR2xHwEQUSGRIuEkMSVxJsEoASlRKpEr4S0hLmEvsSDxMjEzcTSxNfE3MThxObE68TwxPWE+oT/hMRFCUUOBRMFF8UcxSGFJkUrBS/FNMU5hT5FAwVHhUxFUQVVxVqFXwVjxWhFbQVxhXZFesV/RUQFiIWNBZGFlgWahZ8Fo4WnxaxFsMW1BbmFvgWCRcaFywXPRdOF2AXcReCF5MXpBe1F8UX1hfnF/gXCBgZGCkYOhhKGFsYaxh7GIsYmxirGLsYyxjbGOsY+xgKGRoZKRk5GUgZWBlnGXYZhRmVGaQZsxnCGdAZ3xnuGf0ZCxoaGigaNxpFGlMaYhpwGn4ajBqaGqgathrEGtEa3xrtGvoaCBsVGyIbMBs9G0obVxtkG3EbfhuLG5gbpBuxG70byhvWG+Mb7xv7GwccExwfHCscNxxDHE8cWxxmHHIcfRyJHJQcnxyqHLUcwRzMHNYc4RzsHPccAR0MHRYdIR0rHTYdQB1KHVQdXh1oHXIdfB2FHY8dmR2iHawdtR2+Hccd0R3aHeMd7B30Hf0dBh4PHhceIB4oHjAeOR5BHkkeUR5ZHmEeaR5xHngegB6IHo8elh6eHqUerB6zHroewR7IHs8e1h7cHuMe6h7wHvYe/R4DHwkfDx8VHxsfIR8nHywfMh83Hz0fQh9IH00fUh9XH1wfYR9mH2sfbx90H3kffR+CH4Yfih+OH5Iflh+aH54foh+mH6kfrR+xH7Qftx+7H74fwR/EH8cfyh/NH88f0h/VH9cf2R/cH94f4B/iH+Qf5h/oH+of7B/uH+8f8R/yH/Mf9R/2H/cf+B/5H/of+x/7H/wf/R/9H/4f/h/+H/4f/h//H/4f/h/+H/4f/h/9H/0f/B/7H/sf+h/5H/gf9x/2H/Uf8x/yH/Ef7x/uH+wf6h/oH+Yf5B/iH+Af3h/cH9kf1x/VH9Ifzx/NH8ofxx/EH8Efvh+7H7cftB+xH60fqR+mH6Ifnh+aH5Yfkh+OH4ofhh+CH30feR90H28fax9mH2EfXB9XH1IfTR9IH0IfPR83HzIfLB8nHyEfGx8VHw8fCR8DH/0e9h7wHuoe4x7cHtYezx7IHsEeuh6zHqwepR6eHpYejx6IHoAeeB5xHmkeYR5ZHlEeSR5BHjkeMB4oHiAeFx4PHgYe/R30Hewd4x3aHdEdxx2+HbUdrB2iHZkdjx2FHXwdch1oHV4dVB1KHUAdNh0rHSEdFh0MHQEd9xzsHOEc1hzMHMEctRyqHJ8clByJHH0cchxmHFscTxxDHDccKxwfHBMcBxz7G+8b4xvWG8obvRuxG6QbmBuLG34bcRtkG1cbShs9GzAbIhsVGwgb+hrtGt8a0RrEGrYaqBqaGowafhpwGmIaUxpFGjcaKBoaGgsa/RnuGd8Z0BnCGbMZpBmVGYUZdhlnGVgZSBk5GSkZGhkKGfsY6xjbGMsYuxirGJsYixh7GGsYWxhKGDoYKRgZGAgY+BfnF9YXxRe1F6QXkxeCF3EXYBdOFz0XLBcaFwkX+BbmFtQWwxaxFp8WjhZ8FmoWWBZGFjQWIhYQFv0V6xXZFcYVtBWhFY8VfBVqFVcVRBUxFR4VDBX5FOYU0xS/FKwUmRSGFHMUXxRMFDgUJRQRFP4T6hPWE8MTrxObE4cTcxNfE0sTNxMjEw8T+xLmEtISvhKpEpUSgBJsElcSQxIuEhkSBRLwEdsRxhGxEZwRhxFyEV0RSBEzER4RCBHzEN4QyBCzEJ4QiBBzEF0QRxAyEBwQBhDwD9sPxQ+vD5kPgw9tD1cPQQ8rDxUP/w7oDtIOvA6lDo8OeQ5iDkwONQ4fDggO8g3bDcQNrg2XDYANaQ1SDTwNJQ0ODfcM4AzJDLIMmwyEDGwMVQw+DCcMEAz4C+ELyguyC5sLgwtsC1QLPQslCw4L9grfCscKrwqYCoAKaApQCjkKIQoJCvEJ2QnBCakJkQl5CWEJSQkxCRkJAQnpCNEIuQigCIgIcAhYCD8IJwgPCPYH3gfGB60HlQd9B2QHTAczBxsHAgfqBtEGuQagBocGbwZWBj0GJQYMBvMF2wXCBakFkQV4BV8FRgUuBRUF/ATjBMoEsQSZBIAEZwROBDUEHAQDBOoD0QO4A58DhgNtA1QDOwMiAwkD8ALXAr4CpQKMAnMCWgJBAigCDwL2Ad0BxAGrAZEBeAFfAUYBLQEUAfsA4gDJAK8AlgB9AGQASwAyABkAMAAAADAAAABAAAAAUAAAAJAAAACgAAAAsAAAAMAAAACAm7XL3Ojt7Obczr+wo5iQjIuMj5KUlZKMg3hpWUk8MSopLTZEVml9j5+qsbKtpJaHeGlcU09PVV5reoiWoquwsa6ooJiRi4iJjZSdqLK7wMG9tKWSfGNKMh4OBQIFDx4wRFltf4yWnJ+fnZuZmZyhqbO/ytXc4N7YzLumj3dgSzouKCkvOkhZanqGkJSVkYmAdWtiXFpcYWl0gIqUmp6dmJCGfHFoYmBja3iIm6/C0t/m5+LXxrKchG9bS0A5Nzg9Q0pQVFZVUk1IQj8+QUlWZ3yTq8PZ6vb8+/Tn1cCqlIBxZF1aXGFocHd9f397dGthV05IRkhOWWZ1hJOfp6uqpJmLe2pbTkZDRU1aa3+SprjFz9PSzcS5raGWjomHh4qNkZKRjIR4aFVBLhwOBQEFDx80TWiBmrDBzdPT0Mi/taukn5ydoKWqrrGwq6OWh3ZjUUI2Ly0xOkhZa36OnKaqqaOYintsXVJKSEpQWmd1gi0AAAAmAAAALQAAAC0AAAA3AAAALQ==`),i(t,110928,`yv5w/hICZAHgAFkAFwD2/8b/8P/NAVcCGAK9AgIDXQLxAc0BMAKUAW4A4ACDAGgAn/+bABYBZv9z+6r94QJ9ALD9KQALAAn/9v9BAFwAUADQ/kcApwD//3oA6QChANX/FgHfAeUBlwEKAYoChgBQAOwARAAEAQ0BswA1AIwAEwElASgBaAABAZgANwG2AAcB9QB9ADoBjAAsAMsA5gAV/+L+FwBrAFwApf8mANABuwGwAGIA8Pxv9p346/vA+Ur6mPoT+0v8Jv0=`),i(t,111162,`BgAHAAgACQAKAAsADQAOABAAEgAUABYAGQAcACAAIwAoAC0AMwA5AEAARwBQAFoAZQByAIAAjgCfALMAygDjAAABHAE+AWcBlQHHAQACOAJ+As8CcQOPAwAEcQT8BJ4FVgYfBwAI4Qj4CTsLrAw9DgAQwxHwE3cWWBl7HAAghSPfJ+4ssDL2OABArkekUIVbZmYzc/9/`),i(t,111324,`qMtoQQAAAACoy2jBAAAAAAAAAAAXCtQJkglQCQ8JzgiPCE8IEwjVB5oHYgcoB/MGvgaLBloGKwb9BdMFqQWBBVwFOAUWBfcE1wS7BKAEhgRuBFcEQQQtBBkEBwT1A+QD1APFA7YDqAOZA40DfwNxA2UDVwNLAz4DMgMkAxgDCwP+AvIC5ALYAssCvgKxAqQClwKLAn0CcgJkAlkCTAJAAjQCKAIcAhICBQL7AfAB5QHbAdABxgG7AbIBqAGeAZQBigGBAXcBbgFjAVsBUAFIAT0BNAErASABGAENAQQB+gDwAOcA3ADUAMgAwAC1AKwAoQCYAI4AhQB7AHEAaQBeAFYATABDADkAMQAnAB4AFgALAAQA+//y/+n/4P/X/87/xP+7/7L/qf+g/5X/jf+C/3r/cP9m/1z/Uv9J/z//Nf8r/yL/F/8O/wT/+v7x/uf+3f7T/sr+wP62/q3+o/6b/pD+h/59/nP+av5f/lb+TP5C/jj+Lf4j/hn+Df4D/vf97P3h/dX9yf29/bH9pf2Y/Yz9f/1z/Wb9Wf1M/T/9M/0k/Rn9Cv3//PH85fzY/Mz8vvyz/KT8mPyL/H78cfxi/FX8Rfw4/Cb8GfwG/Pb74vvQ+7r7pfuO+3b7XPtB+yT7Bvvl+sT6n/p5+lP6KPr++dD5oflw+Tz5CfnR+Jr4YPgm+Oj3q/ds9yz36/aq9mj2Jvbj9bAEdgRABA4E3wO0A4sDZQNBAx8DAAPiAsYCqwKSAnoCZAJOAjoCJwIVAgMC8wHjAdQBxgG4AasBnwGTAYcBfAFyAWgBXgFVAUwBQwE7ATMBLAEkAR0BFgEQAQkBAwH9APcA8gDtAOcA4gDdANkA1ADQAMwAxwDDAMAAvAC4ALQAsQCuAKoApwCkAKEAngCbAJkAlgCTAJEAjgCMAIkAhwCFAIMAgAB+AHwAegB4AHcAdQBzAHEAbwBuAGwAagBpAGcAZgBkAGMAYQBgAF8AXQBcAFsAWgBYAFcAVgBVAFQAUwBSAFAATwBOAE0ATABLAEsASgBJAEgARwBGAEUARABEAEMAQgBBAEAAQAA/AD4APQA9ADwAOwA7ADoAOQA5ADgAOAA3ADcANgA2ADUANQA0ADQAMwAzADIAMgAxADEAMAAwAC8ALwAuAC4ALQAtACwALAArACsAKgAqACkAKQApACkAKAAoACcAJwAmACYAJgAmACUAJQAkACQAJAAkACMAIwAjACMAIgAiACEAIQAhACEAIAAgACAAIAAfAB8AHwAfAB4AHgAeAB4AHQAdAB0AHQAcABwAHAAcABsAGwAxNkZyYW1lTWFuYWdlckltcGwAMTJGcmFtZU1hbmFnZXIAMjNTcGVlY2hXYXZlR2VuZXJhdG9ySW1wbAAxOVNwZWVjaFdhdmVHZW5lcmF0b3IAMTNXYXZlR2VuZXJhdG9y`),i(t,112416,`AwAAAAQAAAAEAAAABgAAAIP5ogBETm4A/CkVANFXJwDdNPUAYtvAADyZlQBBkEMAY1H+ALveqwC3YcUAOm4kANJNQgBJBuAACeouAByS0QDrHf4AKbEcAOg+pwD1NYIARLsuAJzphAC0JnAAQX5fANaROQBTgzkAnPQ5AItfhAAo+b0A+B87AN7/lwAPmAUAES/vAApaiwBtH20Az342AAnLJwBGT7cAnmY/AC3qXwC6J3UA5evHAD178QD3OQcAklKKAPtr6gAfsV8ACF2NADADVgB7/EYA8KtrACC8zwA29JoA46kdAF5hkQAIG+YAhZllAKAUXwCNQGgAgNj/ACdzTQAGBjEAylYVAMmocwB74mAAa4zAABnERwDNZ8MACejcAFmDKgCLdsQAphyWAESv3QAZV9EApT4FAAUH/wAzfj8AwjLoAJhP3gC7fTIAJj3DAB5r7wCf+F4ANR86AH/yygDxhx0AfJAhAGokfADVbvoAMC13ABU7QwC1FMYAwxmdAK3EwgAsTUEADABdAIZ9RgDjcS0Am8aaADNiAAC00nwAtKeXADdV1QDXPvYAoxAYAE12/ABknSoAcNerAGN8+AB6sFcAFxXnAMBJVgA71tkAp4Q4ACQjywDWincAWlQjAAAfuQDxChsAGc7fAJ8x/wBmHmoAmVdhAKz7RwB+f9gAImW3ADLoiQDmv2AA78TNAGw2CQBdP9QAFt7XAFg73gDem5IA0iIoACiG6ADiWE0AxsoyAAjjFgDgfcsAF8BQAPMdpwAY4FsALhM0AIMSYgCDSAEA9Y5bAK2wfwAe6fIASEpDABBn0wCq3dgArl9CAGphzgAKKKQA05m0AAam8gBcd38Ao8KDAGE8iACKc3gAr4xaAG/XvQAtpmMA9L/LAI2B7wAmwWcAVcpFAMrZNgAoqNIAwmGNABLJdwAEJhQAEkabAMRZxADIxUQATbKRAAAX8wDUQ60AKUnlAP3VEAAAvvwAHpTMAHDO7gATPvUA7PGAALPnwwDH+CgAkwWUAMFxPgAuCbMAC0XzAIgSnACrIHsALrWfAEeSwgB7Mi8ADFVtAHKnkABr5x8AMcuWAHkWSgBBeeIA9N+JAOiUlwDi5oQAmTGXAIjtawBfXzYAu/0OAEiatABnpGwAcXJCAI1dMgCfFbgAvOUJAI0xJQD3dDkAMAUcAA0MAQBLCGgALO5YAEeqkAB05wIAvdYkAPd9pgBuSHIAnxbvAI6UpgC0kfYA0VNRAM8K8gAgmDMA9Ut+ALJjaADdPl8AQF0DAIWJfwBVUikAN2TAAG3YEAAySDIAW0x1AE5x1ABFVG4ACwnBACr1aQAUZtUAJwedAF0EUAC0O9sA6nbFAIf5FwBJa30AHSe6AJZpKQDGzKwArRRUAJDiagCI2YkALHJQAASkvgB3B5QA8zBwAAD8JwDqcagAZsJJAGTgPQCX3YMAoz+XAEOU/QANhowAMUHeAJI5nQDdcIwAF7fnAAjfOwAVNysAXICgAFqAkwAQEZIAD+jYAGyArwDb/0sAOJAPAFkYdgBipRUAYcu7AMeJuQAQQL0A0vIEAEl1JwDrtvYA2yK7AAoUqgCJJi8AZIN2AAk7MwAOlBoAUTqqAB2jwgCv7a4AXCYSAG3CTQAtepwAwFaXAAM/gwAJ8PYAK0CMAG0xmQA5tAcADCAVANjDWwD1ksQAxq1LAE7KpQCnN80A5qk2AKuSlADdQmgAGWPeAHaM7wBoi1IA/Ns3AK6hqwDfFTEAAK6hAAz72gBkTWYA7QW3ACllMABXVr8AR/86AGr5uQB1vvMAKJPfAKuAMABmjPYABMsVAPoiBgDZ5B0APbOkAFcbjwA2zQkATkLpABO+pAAzI7UA8KoaAE9lqADSwaUACz8PAFt4zQAj+XYAe4sEAIkXcgDGplMAb27iAO/rAACbSlgAxNq3AKpmugB2z88A0QIdALHxLQCMmcEAw613AIZI2gD3XaAAxoD0AKzwLwDd7JoAP1y8ANDebQCQxx8AKtu2AKMlOgAAr5oArVOTALZXBAApLbQAS4B+ANoHpwB2qg4Ae1mhABYSKgDcty0A+uX9AInb/gCJvv0A5HZsAAap/AA+gHAAhW4VAP2H/wAoPgcAYWczACoYhgBNveoAs+evAI9tbgCVZzkAMb9bAITXSAAw3xYAxy1DACVhNQDJcM4AMMu4AL9s/QCkAKIABWzkAFrdoAAhb0cAYhLSALlchABwYUkAa1bgAJlSAQBQVTcAHtW3ADPxxAATbl8AXTDkAIUuqQAdssMAoTI2AAi3pADqsdQAFvchAI9p5AAn/3cADAOAAI1ALQBPzaAAIKWZALOi0wAvXQoAtPlCABHaywB9vtAAm9vBAKsXvQDKooEACGpcAC5VFwAnAFUAfxTwAOEHhgAUC2QAlkGNAIe+3gDa/SoAayW2AHuJNAAF8/4Aub+eAGhqTwBKKqgAT8RaAC34vADXWpgA9MeVAA1NjQAgOqYApFdfABQ/sQCAOJUAzCABAHHdhgDJ3rYAv2D1AE1lEQABB2sAjLCsALLA0ABRVUgAHvsOAJVywwCjBjsAwEA1AAbcewDgRcwATin6ANbKyADo80EAfGTeAJtk2ADZvjEApJfDAHdY1ABp48UA8NoTALo6PABGGEYAVXVfANK99QBuksYArC5dAA5E7QAcPkIAYcSHACn96QDn1vMAInzKAG+RNQAI4MUA/9eNAG5q4gCw/cYAkwjBAHxddABrrbIAzW6dAD5yewDGEWoA98+pAClz3wC1yboAtwBRAOKyDQB0uiQA5X1gAHTYigANFSwAgRgMAH5mlAABKRYAn3p2AP39vgBWRe8A2X42AOzZEwCLurkAxJf8ADGoJwDxbsMAlMU2ANioVgC0qLUAz8wOABKJLQBvVzQALFaJAJnO4wDWILkAa16qAD4qnAARX8wA/QtKAOH0+wCOO20A4oYsAOnUhAD8tKkA7+7RAC41yQAvOWEAOCFEABvZyACB/AoA+0pqAC8c2ABTtIQATpmMAFQizAAqVdwAwMbWAAsZlgAacLgAaZVkACZaYAA/Uu4AfxEPAPS1EQD8y/UANLwtADS87gDoXcwA3V5gAGeOmwCSM+8AyRe4AGFYmwDhV7wAUYPGANg+EADdcUgALRzdAK8YoQAhLEYAWfPXANl6mACeVMAAT4b6AFYG/ADlea4AiSI2ADitIgBnk9wAVeiqAIImOADK55sAUQ2kAJkzsQCp1w4AaQVIAGWy8AB/iKcAiEyXAPnRNgAhkrMAe4JKAJjPIQBAn9wA3EdVAOF0OgBn60IA/p3fAF7UXwB7Z6QAuqx6AFX2ogAriCMAQbpVAFluCAAhKoYAOUeDAInj5gDlntQASftAAP9W6QAcD8oAxVmKAJT6KwDTwcUAD8XPANtargBHxYYAhUNiACGGOwAseZQAEGGHACpMewCALBoAQ78SAIgmkAB4PIkAqMTkAOXbewDEOsIAJvTqAPdnigANkr8AZaMrAD2TsQC9fAsApFHcACfdYwBp4d0AmpQZAKgplQBozigACe20AESfIABOmMoAcIJjAH58IwAPuTIAp/WOABRW5wAh8QgAtZ0qAG9+TQClGVEAtfmrAILf1gCW3WEAFjYCAMQ6nwCDoqEAcu1tADmNegCCuKkAazJcAEYnWwAANO0A0gB3APz0VQABWU0A4HGA`),i(t,115203,`QPsh+T8AAAAALUR0PgAAAICYRvg8AAAAYFHMeDsAAACAgxvwOQAAAEAgJXo4AAAAgCKC4zYAAAAAHfNpNf6CK2VHFWdAAAAAAAAAOEMAAPr+Qi52vzo7nrya9wy9vf3/////3z88VFVVVVXFP5ErF89VVaU/F9CkZxERgT8AAAAAAADIQu85+v5CLuY/JMSC/72/zj+19AzXCGusP8xQRtKrsoM/hDpOm+DXVT8=`),i(t,115390,`8D9uv4gaTzubPDUz+6k99u8/XdzYnBNgcbxhgHc+muzvP9FmhxB6XpC8hX9u6BXj7z8T9mc1UtKMPHSFFdOw2e8/+o75I4DOi7ze9t0pa9DvP2HI5mFO92A8yJt1GEXH7z+Z0zNb5KOQPIPzxso+vu8/bXuDXaaalzwPiflsWLXvP/zv/ZIatY4890dyK5Ks7z/RnC9wPb4+PKLR0zLso+8/C26QiTQDarwb0/6vZpvvPw69LypSVpW8UVsS0AGT7z9V6k6M74BQvMwxbMC9iu8/FvTVuSPJkbzgLamumoLvP69VXOnj04A8UY6lyJh67z9Ik6XqFRuAvHtRfTy4cu8/PTLeVfAfj7zqjYw4+WrvP79TEz+MiYs8dctv61tj7z8m6xF2nNmWvNRcBITgW+8/YC86PvfsmjyquWgxh1TvP504hsuC54+8Hdn8IlBN7z+Nw6ZEQW+KPNaMYog7Ru8/fQTksAV6gDyW3H2RST/vP5SoqOP9jpY8OGJ1bno47z99SHTyGF6HPD+msk/OMe8/8ucfmCtHgDzdfOJlRSvvP14IcT97uJa8gWP14d8k7z8xqwlt4feCPOHeH/WdHu8/+r9vGpshPbyQ2drQfxjvP7QKDHKCN4s8CwPkpoUS7z+Py86JkhRuPFYvPqmvDO8/tquwTXVNgzwVtzEK/gbvP0x0rOIBQoY8MdhM/HAB7z9K+NNdOd2PPP8WZLII/O4/BFuOO4Cjhrzxn5JfxfbuP2hQS8ztSpK8y6k6N6fx7j+OLVEb+AeZvGbYBW2u7O4/0jaUPujRcbz3n+U02+fuPxUbzrMZGZm85agTwy3j7j9tTCqnSJ+FPCI0Ekym3u4/imkoemASk7wcgKwERdruP1uJF0iPp1i8Ki73IQrW7j8bmklnmyx8vJeoUNn10e4/EazCYO1jQzwtiWFgCM7uP+9kBjsJZpY8VwAd7UHK7j95A6Ha4cxuPNA8wbWixu4/MBIPP47/kzze09fwKsPuP7CvervOkHY8Jyo21dq/7j934FTrvR2TPA3d/ZmyvO4/jqNxADSUj7ynLJ12srnuP0mjk9zM3oe8QmbPotq27j9fOA+9xt54vIJPnVYrtO4/9lx77EYShrwPkl3KpLHuP47X/RgFNZM82ie1Nkev7j8Fm4ovt5h7PP3Hl9QSre4/CVQc4uFjkDwpVEjdB6vuP+rGGVCFxzQ8t0ZZiiap7j81wGQr5jKUPEghrRVvp+4/n3aZYUrkjLwJ3Ha54aXuP6hN7zvFM4y8hVU6sH6k7j+u6SuJeFOEvCDDzDRGo+4/WFhWeN3Ok7wlIlWCOKLuP2QZfoCqEFc8c6lM1FWh7j8oIl6/77OTvM07f2aeoO4/grk0h60Sary/2gt1EqDuP+6pbbjvZ2O8LxplPLKf7j9RiOBUPdyAvISUUfl9n+4/zz5afmQfeLx0X+zodZ/uP7B9i8BK7oa8dIGlSJqf7j+K5lUeMhmGvMlnQlbrn+4/09QJXsuckDw/Xd5PaaDuPx2lTbncMnu8hwHrcxSh7j9rwGdU/eyUPDLBMAHtoe4/VWzWq+HrZTxiTs8286LuP0LPsy/FoYi8Eho+VCek7j80NzvxtmmTvBPOTJmJpe4/Hv8ZOoRegLytxyNGGqfuP25XcthQ1JS87ZJEm9mo7j8Aig5bZ62QPJlmitnHqu4/tOrwwS+3jTzboCpC5azuP//nxZxgtmW8jES1FjKv7j9EX/NZg/Z7PDZ3FZmuse4/gz0epx8Jk7zG/5ELW7TuPykebIu4qV285cXNsDe37j9ZuZB8+SNsvA9SyMtEuu4/qvn0IkNDkrxQTt6fgr3uP0uOZtdsyoW8ugfKcPHA7j8nzpEr/K9xPJDwo4KRxO4/u3MK4TXSbTwjI+MZY8juP2MiYiIExYe8ZeVde2bM7j/VMeLjhhyLPDMtSuyb0O4/Fbu809G7kbxdJT6yA9XuP9Ix7pwxzJA8WLMwE57Z7j+zWnNuhGmEPL/9eVVr3u4/tJ2Ol83fgrx689O/a+PuP4czy5J3Gow8rdNamZ/o7j/62dFKj3uQvGa2jSkH7u4/uq7cVtnDVbz7FU+4ovPuP0D2pj0OpJC8OlnljXL57j80k6049NZovEde+/J2/+4/NYpYa+LukbxKBqEwsAXvP83dXwrX/3Q80sFLkB4M7z+smJL6+72RvAke11vCEu8/swyvMK5uczycUoXdmxnvP5T9n1wy4448etD/X6sg7z+sWQnRj+CEPEvRVy7xJ+8/ZxpOOK/NYzy15waUbS/vP2gZkmwsa2c8aZDv3CA37z/StcyDGIqAvPrDXVULP+8/b/r/P12tj7x8iQdKLUfvP0mpdTiuDZC88okNCIdP7z+nBz2mhaN0PIek+9wYWO8/DyJAIJ6RgryYg8kW42DvP6ySwdVQWo48hTLbA+Zp7z9LawGsWTqEPGC0AfMhc+8/Hz60ByHVgrxfm3szl3zvP8kNRzu5Kom8KaH1FEaG7z/TiDpgBLZ0PPY/i+cukO8/cXKdUezFgzyDTMf7UZrvP/CR048S94+82pCkoq+k7z99dCPimK6NvPFnji1Ir+8/CCCqQbzDjjwnWmHuG7rvPzLrqcOUK4Q8l7prNyvF7z/uhdExqWSKPEBFblt20O8/7eM75Lo3jrwUvpyt/dvvP53NkU07iXc82JCegcHn7z+JzGBBwQVTPPFxjyvC8+8/EhETFBUWFxgZGhscHR4fICERIiMkESUmJygpKissES0uLxAQMBAQEBAQEBAxMjMQNDUQEBERERERERERERERERERERERERERERERERE2ERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERNxERERE4ETk6Ozw9PhERERERERERERERERERERERERERERERERERERERERERERERERERERERERE/EBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEUBBEUJDREVGR0hJShFLTE1OT1BREFJTVFVWV1hZWltcXRBeX2AQERERYWJjEBAQEBAQEBAQEBERERFkEBAQEBAQEBAQEBAQEBAQERFlEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQERFmZxAQaGkREREREREREREREREREREREREREREREWoREWsQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEWxtEBAQEBAQEBAQbhAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQb3BxchAQEBAQEBAQc3R1EBAQEBB2dxAQEBB4EBB5EBAQEBAQEBAQEBAQEBA=`),i(t,117968,`//////////////////////////////////////////8AAAAAAAAAAP7//wf+//8HAAAAAAAEIAT//3////9//////////////////////////////////8P/AwAfUA==`),i(t,118072,`IAAAAAAA37xA1///+////////////7///////////////////////wP8///////////////////////////+////fwL//////wEAAAAA/7+2AP///4cHAAAA/wf//////////v/D////////////////7x/+4f+fAAD///////8A4P///////////////wMA//////8HMAT////8/x8AAP///wH/BwAAAAAAAP//3z8AAPD/+AP////////////v/9/h/8///v/vn/n///3F459ZgLDP/wMQ7of5///9bcOHGQJewP8/AO6/+////e3jvxsBAM//AB7un/n///3t458ZwLDP/wIA7Mc91hjH/8PHHYEAwP8AAO/f/f///f/j3x1gB8//AADv3/3///3v498dYEDP/wYA79/9/////+ffXfCAz/8A/Oz/f/z///svf4Bf/8D/DAD+/////3//Bz8g/wMAAAAA1vf//6///ztfIP/zAAAAAAEAAAD/AwAA//7///8f/v8D///+////HwAAAAAAAAAA////////f/n/A////////////z//////vyD///////f///////////89fz3//////z3/////PX89/3//////////Pf//////////BwAAAAD//wAA/////////////z8//v//////////////////////////////////////////////////////////n////v//B////////////8f/Af/fDwD//w8A//8PAP/fDQD////////P//8BgBD/AwAAAAD/A///////////////Af//////B///////////PwD///9//w//AcD/////Px8A//////8P////A/8DAAAAAP///w//////////f/7/HwD/A/8DgA==`),i(t,118768,`////////7//vD/8DAAAAAP//////8////////7//AwD///////9/AP/j//////8//wH//////+cAAAAAAN5vBP///////////////////////////////wAAAACA/x8A//8/P/////8/P/+q////P////////99f3B/PD/8f3B8=`),i(t,118910,`AoAAAP8f`),i(t,118928,`hPwvPlC9//PgQwAA//////8B`),i(t,118982,`wP///////wMAAP//////f///////f/////////////////////8feAwA/////78g/////////4AAAP//fwB/f39/f39/f/////8AAAAAAIA=`),i(t,119088,`4AAAAP4DPh/+////////////f+D+//////////////fg///////+/////////////38AAP///wcAAAAAAAD///////////////////////////////8/`),i(t,119184,`////////////////////////////////////////AAD//////////////////////x8AAAAAAAAAAP//////P/8f////DwAA//////9/8I///////////////////wAAAACA//z////////////////5////////fAAAAAAAgP+//////wAAAP///////w8A//////////8vAP8DAAD86P//////B/////8HAP///x/////////3/wCA/wP///9/////////fwD/P/8D//9//P////////9/BQAAOP//PAB+fn4Af3////////f/AP///////////////////wf/A///////////////////////////DwD//3/4//////8P/////////////////z//////////////////AwAAAAB/APjg//1/X9v/////////////////AwAAAPj///////////////8/AAD///////////z///////8AAAAAAP8P`),i(t,119582,`3/////////////////////8fAAD/A/7//wf+//8HwP////////////9//Pz8HAAAAAD/7///f///t/8//z8AAAAA////////////////////BwAAAAAAAAAA////////Hw==`),i(t,119712,`////H////////wEAAAAAAP////8A4P///wf//////wf///8//////w//PgAAAAAA/////////////////////////z//A/////8P/////w///////wD///////8P`),i(t,119824,`////////fwD//z8A/w==`),i(t,119856,`P/3/////v5H//z8A//9/AP///38AAAAAAAAAAP//NwD//z8A////AwAAAAAAAAAA/////////8AAAAAAAAAAAG/w7/7//z8AAAAAAP///x////8fAAAAAP/+//8fAAAA////////PwD//z8A//8HAP//Aw==`),i(t,119984,`////////////AQAAAAAAAP///////wcA////////BwD//////wD/Aw==`),i(t,120048,`////H4AA//8/`),i(t,120076,`//9/AP//////////PwAAAMD/AAD8////////AQAA////Af8D////////x/9wAP////9HAP//////////HgD/FwAAAAD///v///+fQAAAAAAAAAAAf73/v/8B/////////wH/A++f+f///e3jnxmB4A8=`),i(t,120208,`//////////+7B/+DAAAAAP//////////swD/Aw==`),i(t,120256,`////////P38AAAA/AAAAAP////////9/EQD/AwAAAAD///////8/Af8DAAAAAAAA////5/8H/wM=`),i(t,120336,`/////////wE=`),i(t,120356,`////////////AwCA`),i(t,120388,`//z///////waAAAA////////538AAP///////////yAAAAAA/////////wH//f////9/fwEA/wMAAPz////8///+fw==`),i(t,120464,`f/v/////f7TLAP8Dv/3///9/ewH/Aw==`),i(t,120524,`//9/AP////////////////////////8D`),i(t,120560,`/////////////////38AAP///////////////////////////////w8=`),i(t,120624,`//////9/`),i(t,120656,`//////////9/`),i(t,120688,`/////////wH///9//wM=`),i(t,120714,`////PwAA////////AAAPAP8D+P//4P//`),i(t,120760,`//////////8=`),i(t,120784,`////////////h/////////+A//8AAAAAAAAAAAsAAAD/////////////////////////////////////////AP///////////////////////////////////////wcA////fwAAAAAAAAcA8AD/////////////////////////////////////////////////////////////////D/////////////////8H/x//Af9D`),i(t,120976,`/////////////9///////////99k3v/r7/////////+/59/f////e1/8/f//////////////////////////////////////////////////////P/////3///f////3///f////3///f////3/////9/////f//98////////9////52wc=`),i(t,121136,`//////8fgD//Qw==`),i(t,121192,`//////8P/wP///////////////////////////////8fAAAAAAAAAP//////////jwj/Aw==`),i(t,121264,`7////5b+9wqE6paqlvf3Xv/7/w/u+/8P`),i(t,121302,`////A////wP///8D`),i(t,121328,`/////////////////////////////////////////////////////////////////wABAgMEBQYHCAn/////////CgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiP///////8KCwwNDg8QERITFBUWFxgZGhscHR4fICEiI/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8=`),i(t,121601,`ARcCHRgTAx4bGQsUCAQNHxYcEhoKBwwVEQkGEAUPDt4SBJUAAAAA////////////////INsBABQAAABDLlVURi04`),i(t,121696,`TENfQ1RZUEUAAAAATENfTlVNRVJJQwAATENfVElNRQAAAAAATENfQ09MTEFURQAATENfTU9ORVRBUlkATENfTUVTU0FHRVM=`),i(t,121776,`Qy5VVEYtOA==`),i(t,121800,`MAUCAE5vIGVycm9yIGluZm9ybWF0aW9uAElsbGVnYWwgYnl0ZSBzZXF1ZW5jZQBEb21haW4gZXJyb3IAUmVzdWx0IG5vdCByZXByZXNlbnRhYmxlAE5vdCBhIHR0eQBQZXJtaXNzaW9uIGRlbmllZABPcGVyYXRpb24gbm90IHBlcm1pdHRlZABObyBzdWNoIGZpbGUgb3IgZGlyZWN0b3J5AE5vIHN1Y2ggcHJvY2VzcwBGaWxlIGV4aXN0cwBWYWx1ZSB0b28gbGFyZ2UgZm9yIGRhdGEgdHlwZQBObyBzcGFjZSBsZWZ0IG9uIGRldmljZQBPdXQgb2YgbWVtb3J5AFJlc291cmNlIGJ1c3kASW50ZXJydXB0ZWQgc3lzdGVtIGNhbGwAUmVzb3VyY2UgdGVtcG9yYXJpbHkgdW5hdmFpbGFibGUASW52YWxpZCBzZWVrAENyb3NzLWRldmljZSBsaW5rAFJlYWQtb25seSBmaWxlIHN5c3RlbQBEaXJlY3Rvcnkgbm90IGVtcHR5AENvbm5lY3Rpb24gcmVzZXQgYnkgcGVlcgBPcGVyYXRpb24gdGltZWQgb3V0AENvbm5lY3Rpb24gcmVmdXNlZABIb3N0IGlzIGRvd24ASG9zdCBpcyB1bnJlYWNoYWJsZQBBZGRyZXNzIGluIHVzZQBCcm9rZW4gcGlwZQBJL08gZXJyb3IATm8gc3VjaCBkZXZpY2Ugb3IgYWRkcmVzcwBCbG9jayBkZXZpY2UgcmVxdWlyZWQATm8gc3VjaCBkZXZpY2UATm90IGEgZGlyZWN0b3J5AElzIGEgZGlyZWN0b3J5AFRleHQgZmlsZSBidXN5AEV4ZWMgZm9ybWF0IGVycm9yAEludmFsaWQgYXJndW1lbnQAQXJndW1lbnQgbGlzdCB0b28gbG9uZwBTeW1ib2xpYyBsaW5rIGxvb3AARmlsZW5hbWUgdG9vIGxvbmcAVG9vIG1hbnkgb3BlbiBmaWxlcyBpbiBzeXN0ZW0ATm8gZmlsZSBkZXNjcmlwdG9ycyBhdmFpbGFibGUAQmFkIGZpbGUgZGVzY3JpcHRvcgBObyBjaGlsZCBwcm9jZXNzAEJhZCBhZGRyZXNzAEZpbGUgdG9vIGxhcmdlAFRvbyBtYW55IGxpbmtzAE5vIGxvY2tzIGF2YWlsYWJsZQBSZXNvdXJjZSBkZWFkbG9jayB3b3VsZCBvY2N1cgBTdGF0ZSBub3QgcmVjb3ZlcmFibGUAUHJldmlvdXMgb3duZXIgZGllZABPcGVyYXRpb24gY2FuY2VsZWQARnVuY3Rpb24gbm90IGltcGxlbWVudGVkAE5vIG1lc3NhZ2Ugb2YgZGVzaXJlZCB0eXBlAElkZW50aWZpZXIgcmVtb3ZlZABEZXZpY2Ugbm90IGEgc3RyZWFtAE5vIGRhdGEgYXZhaWxhYmxlAERldmljZSB0aW1lb3V0AE91dCBvZiBzdHJlYW1zIHJlc291cmNlcwBMaW5rIGhhcyBiZWVuIHNldmVyZWQAUHJvdG9jb2wgZXJyb3IAQmFkIG1lc3NhZ2UARmlsZSBkZXNjcmlwdG9yIGluIGJhZCBzdGF0ZQBOb3QgYSBzb2NrZXQARGVzdGluYXRpb24gYWRkcmVzcyByZXF1aXJlZABNZXNzYWdlIHRvbyBsYXJnZQBQcm90b2NvbCB3cm9uZyB0eXBlIGZvciBzb2NrZXQAUHJvdG9jb2wgbm90IGF2YWlsYWJsZQBQcm90b2NvbCBub3Qgc3VwcG9ydGVkAFNvY2tldCB0eXBlIG5vdCBzdXBwb3J0ZWQATm90IHN1cHBvcnRlZABQcm90b2NvbCBmYW1pbHkgbm90IHN1cHBvcnRlZABBZGRyZXNzIGZhbWlseSBub3Qgc3VwcG9ydGVkIGJ5IHByb3RvY29sAEFkZHJlc3Mgbm90IGF2YWlsYWJsZQBOZXR3b3JrIGlzIGRvd24ATmV0d29yayB1bnJlYWNoYWJsZQBDb25uZWN0aW9uIHJlc2V0IGJ5IG5ldHdvcmsAQ29ubmVjdGlvbiBhYm9ydGVkAE5vIGJ1ZmZlciBzcGFjZSBhdmFpbGFibGUAU29ja2V0IGlzIGNvbm5lY3RlZABTb2NrZXQgbm90IGNvbm5lY3RlZABDYW5ub3Qgc2VuZCBhZnRlciBzb2NrZXQgc2h1dGRvd24AT3BlcmF0aW9uIGFscmVhZHkgaW4gcHJvZ3Jlc3MAT3BlcmF0aW9uIGluIHByb2dyZXNzAFN0YWxlIGZpbGUgaGFuZGxlAFJlbW90ZSBJL08gZXJyb3IAUXVvdGEgZXhjZWVkZWQATm8gbWVkaXVtIGZvdW5kAFdyb25nIG1lZGl1bSB0eXBlAE11bHRpaG9wIGF0dGVtcHRlZABSZXF1aXJlZCBrZXkgbm90IGF2YWlsYWJsZQBLZXkgaGFzIGV4cGlyZWQAS2V5IGhhcyBiZWVuIHJldm9rZWQAS2V5IHdhcyByZWplY3RlZCBieSBzZXJ2aWNl`),i(t,123730,`pQJbAPABtQWMBSUBgwYdA5QE/wDHAzEDCwa8AY8BfwPKBCsA2gavAEIDTgPcAQ4EFQChBg0BlAILAjgGZAK8Av8CXQPnBAsHzwLLBe8F2wXhAh4GRQKFAIICbANvBPEA8wMYBdkA2gNMBlQCewGdA70EAABRABUCuwCzA20A/wGFBC8F+QQ4AGUBRgGfALcGqAFzAlMB`),i(t,123928,`IQQAAAAAAAAAAC8C`),i(t,123960,`NQRHBFYE`),i(t,123982,`oAQ=`),i(t,124002,`RgVgBW4FYQYAAM8BAAAAAAAAAADJBukG+QYeBzkHSQdeBw==`),i(t,124048,`GQAKABkZGQAAAAAFAAAAAAAACQAAAAALAAAAAAAAAAAZABEKGRkZAwoHAAEACQsYAAAJBgsAAAsABhkAAAAZGRk=`),i(t,124129,`DgAAAAAAAAAAGQAKDRkZGQANAAACAAkOAAAACQAOAAAO`),i(t,124187,`DA==`),i(t,124199,`EwAAAAATAAAAAAkMAAAAAAAMAAAM`),i(t,124245,`EA==`),i(t,124257,`DwAAAAQPAAAAAAkQAAAAAAAQAAAQ`),i(t,124303,`Eg==`),i(t,124315,`EQAAAAARAAAAAAkSAAAAAAASAAASAAAaAAAAGhoa`),i(t,124370,`GgAAABoaGgAAAAAAAAk=`),i(t,124419,`FA==`),i(t,124431,`FwAAAAAXAAAAAAkUAAAAAAAUAAAU`),i(t,124477,`Fg==`),i(t,124489,`FQAAAAAVAAAAAAkWAAAAAAAWAAAWAAAwMTIzNDU2Nzg5QUJDREVG`),i(t,124564,`EQ==`),i(t,124604,`//////////8=`),i(t,124672,`0XSeAFedvSqAcFIP//8+JwoAAABkAAAA6AMAABAnAACghgEAQEIPAICWmAAA4fUFGAAAADUAAABxAAAAa////877//+Sv///AAAAAAAAAAACAADAAwAAwAQAAMAFAADABgAAwAcAAMAIAADACQAAwAoAAMALAADADAAAwA0AAMAOAADADwAAwBAAAMARAADAEgAAwBMAAMAUAADAFQAAwBYAAMAXAADAGAAAwBkAAMAaAADAGwAAwBwAAMAdAADAHgAAwB8AAMAAAACzAQAAwwIAAMMDAADDBAAAwwUAAMMGAADDBwAAwwgAAMMJAADDCgAAwwsAAMMMAADDDQAA0w4AAMMPAADDAAAMuwEADMMCAAzDAwAMwwQADNsAAAAAIAAAAAkAAAAKAAAADQAAAAsAAAAMAAAAhQAAAAAgAAABIAAAAiAAAAMgAAAEIAAABSAAAAYgAAAIIAAACSAAAAogAAAoIAAAKSAAAF8gAAAAMAAAAAAAAE4xMF9fY3h4YWJpdjExNl9fc2hpbV90eXBlX2luZm9FAAAAAGjpAQB46AEAZOoBAE4xMF9fY3h4YWJpdjExN19fY2xhc3NfdHlwZV9pbmZvRQAAAGjpAQCo6AEAnOgBAE4xMF9fY3h4YWJpdjExN19fcGJhc2VfdHlwZV9pbmZvRQAAAGjpAQDY6AEAnOgBAE4xMF9fY3h4YWJpdjExOV9fcG9pbnRlcl90eXBlX2luZm9FAGjpAQAI6QEA/OgBAAAAAADM6AEAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAAAAAAsOkBABQAAAAcAAAAFgAAABcAAAAYAAAAHQAAAB4AAAAfAAAATjEwX19jeHhhYml2MTIwX19zaV9jbGFzc190eXBlX2luZm9FAAAAAGjpAQCI6QEAzOgBAAAAAAAg6gEACQAAACAAAAAhAAAAAAAAAEjqAQAJAAAAIgAAACMAAAAAAAAACOoBAAkAAAAkAAAAJQAAAFN0OWV4Y2VwdGlvbgAAAABA6QEA+OkBAFN0OWJhZF9hbGxvYwAAAABo6QEAEOoBAAjqAQBTdDIwYmFkX2FycmF5X25ld19sZW5ndGgAAAAAaOkBACzqAQAg6gEAU3Q5dHlwZV9pbmZvAAAAAEDpAQBU6gE=`),i(t,125552,`wLEAAMCyAADAswAAwLQAAMC1AADAtgAAwLcAAMC4AADAuQAAwLoAAMC7AADAvAAAwL0AAMC+AADAvwAAwMAAAMDBAADAwgAAwMMAAMDEAADAxQAAwMIAAMDGAADAxwAAwMgAAMDJAADAygAAwMsAAMDMAADAzQAAwM4AAMDPAADA0AAAwNEAAMDSAADA0wAAwNQAAMDVAADA1gAAwNcAAMDYAADA2QAAwNIAAMDaAADA2wAAwNwAAMDdAADA3gAAwN8AAMDgAADA4QAAwNgAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADA4gAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwOMAAMDkAADAwgAAwMIAAMDCAADA5QAAwMIAAMDmAADA5wAAwOgAAMDpAADA6gAAwOsAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADA7AAAwO0AAMDCAADA7gAAwO8AAMDCAADA8AAAwPEAAMDyAADA8wAAwPQAAMD1AADA9gAAwPcAAMD4AADAwgAAwPkAAMD6AADA+wAAwPwAAMD9AADA/gAAwP8AAMAAAQDAAQEAwAIBAMADAQDABAEAwAUBAMAGAQDABwEAwAgBAMAJAQDACgEAwAsBAMAMAQDACwEAwA0BAMAOAQDADwEAwAsBAMDCAADAwgAAwMIAAMAQAQDAEQEAwBIBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDAwgAAwMIAAMDCAADAwgAAwBMBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMDCAADAwgAAwBQBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMDCAADAwgAAwBUBAMAWAQDACwEAwAsBAMAXAQDAGAEAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAGQEAwMIAAMDCAADAGgEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMDCAADAGwEAwBwBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMAdAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwB4BAMAfAQDAIAEAwCEBAMAiAQDAIwEAwCQBAMAlAQDA2AAAwNgAAMAmAQDACwEAwAsBAMALAQDACwEAwAsBAMAnAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwCgBAMApAQDACwEAwAsBAMAqAQDACwEAwCsBAMALAQDALAEAwC0BAMAuAQDALwEAwNgAAMDYAADAMAEAwDEBAMAyAQDAMwEAwDQBAMALAQDACwEAwAsBAMALAQDACwEAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMA1AQDAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwDYBAMA3AQDAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAOAEAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMDCAADAwgAAwMIAAMA5AQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDACwEAwAsBAMALAQDAwgAAwMIAAMA6AQDAOwEAwDwB`),i(t,128496,`oVcBAEEAAADdVwEAQgAAACZYAQBDAAAAa1gBAEQAAADSWAEARQAAABNZAQBGAAAAfFkBAEcAAACEWQEASAAAADBaAQBJAAAAZ1oBAEoAAADuWgEASwAAAC5bAQBMAAAAcVsBAE0AAADZWwEATgAAAGtcAQBPAAAAh1wBAAgAAADcXAEACQAAAB9dAQAKAAAAZ10BAAsAAACVXQEADAAAAMpdAQANAAAAD14BAA4AAAAqXgEADwAAAIZeAQAPAAAAvV4BABAAAABDXwEAEQAAAH1fAQASAAAAq18BABMAAADZXwEAFAAAAAVgAQAVAAAAMGABABcAAABgYAEAGAAAAHlgAQAZAAAAtWABABsAAADdYAEAHAAAAPBgAQAdAAAAI2EBACAAAABEYQEAIQAAAG9hAQAiAAAAnWEBACMAAADRYQEAJAAAAPNhAQAlAAAAFWIBACYAAABZYgEAKAAAAH1iAQApAAAArmIBACoAAADoYgEAKwAAADVjAQAtAAAAb2MBAC4AAACnYwEALwAAAOZjAQAwAAAAeGQBADEAAACdZAEAMgAAAM9kAQAzAAAA/mQBAGQAAABgZQEAyAAAAN1lAQDJAAAAAAAAAP////8iZgEAAQAAAD5mAQACAAAABVUBAAMAAADNZgEAEQAAADRnAQASAAAAg2cBABMAAAD7ZwEAFAAAADtoAQAVAAAATGgBABYAAAB0aAEAEQAAALdoAQAhAAAAymgBACIAAAD+aAEAIwAAAEtpAQAkAAAAaWkBACUAAACfaQEAJgAAAOJpAQAhAAAAAAAAAP////8AAAAAAAAAACYAAAAAAAAAAQAAAJByAQABAAAAkHMBAAEAAACQdAEAAQAAAJB1AQABAAAAkHYBAAEAAACQdwEAAQAAAJB4AQABAAAAkHkBAAEAAACQegEAAQAAAJB7AQABAAAAkHwBAAEAAACQfQEAAQAAAJB+AQABAAAAkH8BAAEAAACQgAEAAQAAAJCBAQABAAAAkIIBAAUAAAAAAAAABg==`),i(t,129280,`oIMBAKCDAQAghAEAIIQBAKCEAQAghQEAoIUBACCGAQCghgEAoIYBACCHAQAghwEAoIcBAKCHAQAgiAEAIIgBAKCIAQCgiAEAIIkBACCJAQAuOU4ycIoBAAMHBQCQigEALjlOLnCKAQADBwUAkIoBAC45Ti5wigEAAwcFAJCKAQAuOVoycIoBAAMJBQCVigEALjlOMnCKAQADBwUAkIoBAC45SjdwigEABAcFAJqKAQAuOUo3cIoBAAQHBQCaigEALjlKN3CKAQAEBwUAmooBAC45TjJwigEAAwcFAJCKAQAuOU4ucIoBAAMHBQCQigEALjlOMnCKAQADBwUAkIoBACIpKSBwigEAAwcFAJqKAQAuOTcycIoBAAMHBQCaigEAo1MBABABAAAAVAEADAEAANJUAQARAQAAClUBACMAAAB/VQEAGwAAADRWAQAVAAAAxVYBAAABAAABVwEAAgEAAE1XAQADAQAAvVcBAAQBAAD7VwEABQEAAE5YAQATAAAAkVgBAB4AAADVWAEAFwAAAF9ZAQAaAAAAkVkBABkAAAD0WQEAGAAAADhaAQAdAAAAzloBABwAAAAPWwEAFgAAADdbAQAU`),i(t,129744,`Q1gBABABAACIWAEADAEAAPNYAQARAQAAM1kBACMAAACHWQEAGwAAAOBZAQAVAAAAQloBAAABAACcWgEAAgEAAABbAQADAQAAT1sBAAQBAACnWwEABQEAAEhcAQATAAAAc1wBAB4AAADEXAEAFwAAABVdAQAaAAAAXV0BABkAAACIXQEAGAAAANJdAQAdAAAABF4BABwAAAAvXgEAFgAAAF9eAQAU`),i(t,129920,`u08BAAEAAABcUAEAAAAAAM9QAQAAAAAAOFIBAAAAAABBUwEAAAAAAIFTAQAAAAAA+1MBAAAAAADnVAEAAAAAACVVAQAAAAAAiVUBAAAAAABUVgEAAAAAAPxWAQAAAAAADlcBAAAAAABIVwEAAAAAAKdXAQAAAAAA9lcBAAAAAAA3WAEAAAAAAKNYAQAAAAAA6FgBAAAAAAAuWQEAAAAAAH9ZAQAAAAAA61kBAAAAAAD/////g00BAIIAAAB5AAAAdg==`),i(t,130128,`4I8BAOCPAQBQkAEAwJABAMCQAQDAkAEAAQAAANQKAwCMCgMAROcC`),i(t,130176,`I0sBAAEAAAAAAAAA/////1dMAQABAAAA+0wBAAIAAADGTQEAAwAAAAAAAAD/////Vk4BAAAAAADSTgEAAQAAALJPAQACAAAAGFABABQAAAAAAAAA/////wAAAAAAAAAAt1ABABIAAABNUgEAFAAAAN5SAQAkAAAAhlMBAEAAAAARVAEAwQAAAAAAAAD/////q1QBAAEAAAAAAAAA/////1dMAQAAAAAAGVUBAAEAAACRVQEAAgAAAENWAQADAAAA31YBAAQAAAAgVwEABQAAAAAAAAD/////AAAAAAAAAABXTAEAAQAAAIlXAQACAAAAr1cBAAMAAADfVgEABAAAACBXAQAFAAAAAAAAAP////8AAAAAClgBADxYAQAYUAEAqFgB`),i(t,130480,`8l8BAAEAAAA5YAEAAgAAAFhgAQADAAAAgWABAAQAAACwYAEABQAAANNgAQAGAAAABWEBAAcAAAAqYQEACAAAAFFhAQAJAAAAdmEBAAoAAACQYQEACwAAAMNhAQAMAAAA+WEBAA0AAAAuYgEADgAAAE5iAQAPAAAAhmIBAA8AAADUYgEADwAAABljAQAPAAAAP2MBAA8AAACkYwEABwAAANpjAQAHAAAAO2QBAAcAAACEZAEABwAAAK9kAQAHAAAAw2QBAA4AAADnZAEADgAAAAplAQAQAAAA9GUBABAAAAArZgEAEAAAAN9WAQAQAAAAbmYBABAAAADBZgEAEA==`),i(t,130752,`f20BAD4AAACjbQEAPOAAAM1tAQAmAAAA1G0BACIAAAA6bgEAIAAAAHhuAQAnAAAAAAAAAP////8AAAAAAAAAAGNnAQBkAAAAxWcBAAAAAAAJaAEAHgAAAEJoAQBBAAAAQ1YBAGQAAACGaAEAlgAAAKVoAQDmAAAAAAAAAP////9jZwEAZAAAAL5oAQA8AAAA6WgBAFAAAABDVgEAZAAAABJpAQB9AAAAUmkBAKAAAAAAAAAA/////wAAAAAAAAAAY2cBAGQAAACUaQEARgAAAN5pAQBVAAAAQ1YBAGQAAAAoagEAbgAAAGdqAQB4AAAAAAAAAP////8AAAAAAAAAAGNnAQBkAAAAlGkBABQAAADeaQEAMgAAAENWAQBkAAAAKGoBAIwAAABnagEAtAAAAAAAAAD/////`),i(t,131076,`QP8BAAD/AQCA/wEAwP8B`),i(t,131104,`wmoBACDgAAALawEACeAAAEFrAQBf4AAAe2sBACI=`),i(t,131152,`q2sBAAEAAAC8awEAAgAAAA1sAQAD`),i(t,131184,`+EwBAMJNAQBTTgEACU8BAOVPAQBkUAEA2lABAGdSAQDyUgEA1FMBAGFUAQ==`),i(t,131236,`iFIBADlTAQAAAAAAnlMBAGRUAQDwVAEAL1UBAJpVAQBQVgE=`),i(t,131280,`Y1IBAIADAACAA/8DbGUAAAcAAAA0UwEAIAQAAAAELwUAAAAAAAAAAHNTAQAwBQAAMAWPBXloAAAEAAAAG1QBAJAFAACQBf8FAAAAAAAAAAC3VAEAAAYAAAAG/wYAAAAAAAAAACpVAQAABwAAAAdPBwAAAAAAAAAAllUBAAAJAAAACX8JaWgAAAQAAAA/VgEAgAkAAIAJ/wluYgAABAAAANZWAQAACgAAAAp/CmFwAAAEAAAAClcBAIAKAACACv8KdWcAAAQAAABfVwEAAAsAAAALfwsAAAAAAAAAAM5XAQCACwAAgAv/C2F0AAAEAAAAD1gBAAAMAAAADH8MZXQAAAAAAAAsWAEAgAwAAIAM/wxuawAABAAAAJ9YAQAADQAAAA1/DWxtAAAEAAAA5FgBAIANAACADf8NaXMAAAQAAAA8WQEAAA4AAAAOfw4AAAAAAAAAAJtZAQCADgAAgA7/DgAAAAAAAAAA8FkBAAAPAAAAD/8PAAAAAAAAAAA0WgEAABAAAAAQnxAAAAAAAAAAANlaAQCgEAAAoBD/EGFrAAAEAAAAGFsBAAARAAAAEf8Rb2sAAAQAAABKWwEAABIAAAASnxMAAAAAAAAAALlbAQAAKAAAACj/KAAAAAAQAAAAWlwBAEAwAABAMP8wAAAAAAgAAACDXAEAADEAAAAx/58AAAAACAAAABhbAQAApwAAAKf/129rAAAM`),i(t,131840,`WAIAAKoAAACwBAAAhwAAANAHAABuAAAAuAsAAG4AAAD/////`),i(t,131888,`qAsD`),i(t,131904,`mF4BAAEAAAA4XwEAAgAAAGFfAQADAAAAnV8BAAYAAADCXwEACQAAAPhfAQAKAAAAJ2ABAAQAAABNYAEABQAAAI1gAQAkAAAAq2ABAAsAAADVYAEADAAAAPZgAQANAAAAFmEBAA4AAABMYQEADwAAAGdhAQAQAAAAlmEBABEAAAC7YQEAEgAAAAJiAQAfAAAAG2IBACUAAABIYgEAIAAAAJJiAQAhAAAAzmIBACIAAADwYgEABwAAAC5jAQAI`),i(t,132112,`jmMBAAEAAAC8YwEAAgAAAAAAAAABAAAAFJwBACCcAQAsnAEAPAAAABo=`),i(t,132163,`AgMFCAsOEhYbICUrMTc+RUxTWmJpcXmAiJCYn6autbzCyc/V2uDk6e3w9Pb5+/z9/f39/Pv59vTw7enk4NrVz8nCvLWupp+YkIiAeXFpYlpTTEU+NzErJSAbFhIOCwgFAwI=`),i(t,132288,`QAAAAAABAAAAAAAA7AQCACcAAAAoAAAAKQAAACoAAAArAAAAQOkBAMO2AQBo6QEAsLYBAOQEAgAAAAAAJAUCACwAAAAtAAAALgAAAC8AAABA6QEAArcBAGjpAQDstgEAEAUCAGjpAQDStgEAGAUCAAU=`),i(t,132412,`DQ==`),i(t,132436,`CwAAAAoAAADoeAM=`),i(t,132460,`Ag==`),i(t,132476,`//////////8=`),i(t,132544,`MAUCAAAAAAAF`),i(t,132564,`MA==`),i(t,132588,`CwAAADEAAAD4eAMAAAQ=`),i(t,132612,`AQ==`),i(t,132628,`/////wo=`),i(t,132696,`yAUCAAB/BA==`);var Hi,Ui=(Hi=[null,function(e){var t,n=0;return n=s[(e|=0)>>2],s[e>>2]=n+1,n=255&(t=a[0|n]),(0|t)<0&&(n=h[(s[e+12>>2]+(n<<1)|0)-256>>1]),0|n},zi,function(e){var t,n;return t=s[(e|=0)>>2],n=s[t>>2],s[e>>2]=t+4,0|n},function(e){var t=0,n=0;return t=s[(e|=0)>>2],(0|(n=wt(e)))==65533&&(s[e>>2]=t+1,s[e+8>>2]=1,n=255&(t=a[0|t]),(0|t)>=0||(n=h[(s[e+12>>2]+(n<<1)|0)-256>>1])),0|n},wt,function(e){var t,n,r=0;return(r=s[4+(e|=0)>>2])>>>0<=(n=(t=s[e>>2])+1|0)>>>0?(s[e>>2]=r,65533):(s[e>>2]=n,r=c[0|t],s[e>>2]=t+2,r|c[t+1|0]<<8)},function(e,t){var n,r,i;return t|=0,e=s[(e|=0)>>2],n=s[e+4>>2],r=s[t>>2],(t=Or(n+1|0,(i=s[r+4>>2])+1|0))||(t=a[0|n]-a[0|i]|0)||(t=Or(s[e>>2],s[r>>2])),0|t},function(e,t){var n;return e|=0,t=s[(t|=0)>>2],n=s[e>>2],(e=s[t+16>>2]-s[n+16>>2]|0)||(e=Or(s[n>>2],s[t>>2])),0|e},Ri,function(e,t,n,r){var i;return t|=0,n|=0,r|=0,z=i=z-16|0,(e=0|P(s[60+(e|=0)>>2],0|t,0|n,255&r,i+8|0))?(s[56798]=e,e=-1):e=0,z=i+16|0,B=e?-1:s[i+12>>2],0|(e?-1:s[i+8>>2])},function(e,t,n){t|=0,n|=0;var r,i=0,a=0,o=0,c=0,l=0,u=0;z=r=z-32|0,i=s[28+(e|=0)>>2],s[r+16>>2]=i,o=s[e+20>>2],s[r+28>>2]=n,s[r+24>>2]=t,t=o-i|0,s[r+20>>2]=t,o=t+n|0,l=2;A:{e:{t=r+16|0,(i=0|E(s[e+60>>2],0|t,2,r+12|0))?(s[56798]=i,i=-1):i=0;g:{if(i)i=t;else for(;;){if((0|(a=s[r+12>>2]))==(0|o))break g;if((0|a)<0){i=t;break e}if(c=a-((u=(c=s[t+4>>2])>>>0>>0)?c:0)|0,s[(i=(u<<3)+t|0)>>2]=c+s[i>>2],s[(t=(u?12:4)+t|0)>>2]=s[t>>2]-c,o=o-a|0,t=i,l=l-u|0,(a=0|E(s[e+60>>2],0|t,0|l,r+12|0))?(s[56798]=a,a=-1):a=0,a)break}if((0|o)!=-1)break e}t=s[e+44>>2],s[e+28>>2]=t,s[e+20>>2]=t,s[e+16>>2]=t+s[e+48>>2],e=n;break A}s[e+28>>2]=0,s[e+16>>2]=0,s[e+20>>2]=0,s[e>>2]=32|s[e>>2],e=0,(0|l)!=2&&(e=n-s[i+4>>2]|0)}return z=r+32|0,0|e},function(e,t,n){e|=0,t|=0,n|=0;var r,i=0,o=0,l=0;z=r=z-32|0,s[r+16>>2]=t,i=s[e+48>>2],s[r+20>>2]=n-!!(0|i),o=s[e+44>>2],s[r+28>>2]=i,s[r+24>>2]=o;A:{e:{if((i=0|ie(s[e+60>>2],r+16|0,2,r+12|0))?(s[56798]=i,i=-1):i=0,i)t=32;else{if((0|(i=s[r+12>>2]))>0)break e;t=i?32:16}s[e>>2]=t|s[e>>2];break A}l=i,(o=s[r+20>>2])>>>0>=i>>>0||(i=s[e+44>>2],s[e+4>>2]=i,s[e+8>>2]=i+(l-o|0),s[e+48>>2]&&(s[e+4>>2]=i+1,a[(t+n|0)-1|0]=c[0|i]),l=n)}return z=r+32|0,0|l},function(e){return 0|T(s[60+(e|=0)>>2])},bi,function(e,t,n,r,i,o){e|=0,t=+t,n|=0,r|=0,i|=0,o|=0;var u,d=0,p=0,m=0,h=0,g=0,_=0,y=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0;z=u=z-560|0,s[u+44>>2]=0,f(+t),d=0|l(1),l(0),(0|d)<0?(T=1,A=84997,f(+(t=-t)),d=0|l(1),l(0)):2048&i?(T=1,A=85e3):(A=(T=1&i)?85003:84998,j=!T);A:if(2146435072&~d){D=u+16|0;e:{g:{r:{if(t=nr(t,u+44|0),(t+=t)!=0){if(d=s[u+44>>2],s[u+44>>2]=d-1,(0|(O=32|o))!=97)break r;break e}if((0|(O=32|o))==97)break e;g=s[u+44>>2],_=(0|r)<0?6:r;break g}g=d-29|0,s[u+44>>2]=g,t*=268435456,_=(0|r)<0?6:r}for(p=C=(u+48|0)+((0|g)>=0?288:0)|0;r=t<4294967296&t>=0?~~t>>>0:0,s[p>>2]=r,p=p+4|0,(t=1e9*(t-+(r>>>0)))!=0;);if((0|g)<=0)r=g,d=p,m=C;else for(m=C,r=g;;){if(x=(0|r)>=29?29:r,!(m>>>0>(d=p-4|0)>>>0)){for(r=0;h=s[d>>2],k=r,r=31&x,(63&x)>>>0>=32?(y=h<>>32-r,r=h<>>0>k>>>0?h+1|0:h,1e9),s[d>>2]=k-hr(r,B,1e9,0),m>>>0<=(d=d-4|0)>>>0;);r&&(s[(m=m-4|0)>>2]=r)}for(;m>>>0<(d=p)>>>0&&!s[(p=d-4|0)>>2];);if(r=s[u+44>>2]-x|0,s[u+44>>2]=r,p=d,!((0|r)>0))break}if((0|r)<0)for(E=1+((_+25>>>0)/9|0)|0,S=(0|O)==102;;){if(y=(0|(r=0-r|0))>=9?9:r,d>>>0<=m>>>0)p=s[m>>2];else{for(x=1e9>>>y|0,h=~(-1<>2],s[p>>2]=k+(r>>>y|0),r=v(x,r&h),(p=p+4|0)>>>0>>0;);p=s[m>>2],r&&(s[d>>2]=r,d=d+4|0)}if(r=y+s[u+44>>2]|0,s[u+44>>2]=r,m=(!p<<2)+m|0,d=d-(p=S?C:m)>>2>(0|E)?p+(E<<2)|0:d,!((0|r)<0))break}if(r=0,!(d>>>0<=m>>>0||(r=v(C-m>>2,9),p=10,(h=s[m>>2])>>>0<10)))for(;r=r+1|0,h>>>0>=(p=v(p,10))>>>0;);if((0|(p=(_-((0|O)==102?0:r)|0)-((0|O)==103&!!(0|_))|0))<(v(d-C>>2,9)-9|0)){if(g=((((0|g)<0?4:292)+u|0)+((h=(0|(x=p+9216|0))/9|0)<<2)|0)-4048|0,p=10,(0|(y=x-v(h,9)|0))<=7)for(;p=v(p,10),(0|(y=y+1|0))!=8;);if(!(!(S=(x=s[g>>2])-v(p,E=(x>>>0)/(p>>>0)|0)|0)&(0|(h=g+4|0))==(0|d))&&(!(1&E)&&(t=9007199254740992,!(1&a[g-4|0])|(0|p)!=1e9|m>>>0>=g>>>0)||(t=9007199254740994),w=(0|d)==(0|h)?1:1.5,w=(h=p>>>1|0)>>>0>S>>>0?.5:(0|h)==(0|S)?w:1.5,c[0|A]!=45|j||(w=-w,t=-t),h=x-S|0,s[g>>2]=h,t+w!=t)){if(r=p+h|0,s[g>>2]=r,r>>>0>=1e9)for(;s[g>>2]=0,(g=g-4|0)>>>0>>0&&(s[(m=m-4|0)>>2]=0),r=s[g>>2]+1|0,s[g>>2]=r,r>>>0>999999999;);if(r=v(C-m>>2,9),p=10,!((h=s[m>>2])>>>0<10))for(;r=r+1|0,h>>>0>=(p=v(p,10))>>>0;);}d=d>>>0>(p=g+4|0)>>>0?p:d}for(;h=d,!(x=d>>>0<=m>>>0)&&!s[(d=h-4|0)>>2];);if((0|O)==103){if(_=((d=(0|(p=_||1))>(0|r)&(0|r)>-5)?~r:-1)+p|0,o=(d?-1:-2)+o|0,!(g=8&i)){if(d=-9,!x&&(g=s[h-4>>2])&&(y=10,d=0,!((g>>>0)%10|0))){for(;p=d,d=d+1|0,!((g>>>0)%((y=v(y,10))>>>0)|0););d=~p}p=v(h-C>>2,9),(-33&o)==70?(g=0,_=(0|(d=(0|(d=(d+p|0)-9|0))>0?d:0))>(0|_)?_:d):(g=0,_=(0|(d=(0|(d=((r+p|0)+d|0)-9|0))>0?d:0))>(0|_)?_:d)}}else g=8&i;if(y=-1,(0|((x=g|_)?2147483645:2147483646))<(0|_))break A;if(S=1+(!!(0|x)+_|0)|0,(0|(p=-33&o))!=70){if((D-(d=ar(((d=r>>31)^r)-d|0,0,D))|0)<=1)for(;a[0|(d=d-1|0)]=48,(D-d|0)<2;);if(a[0|(E=d-2|0)]=o,a[d-1|0]=(0|r)<0?45:43,(0|(d=D-E|0))>(2147483647^S))break A}else{if((2147483647^S)<(0|r))break A;d=(0|r)>0?r:0}if((0|(r=d+S|0))>(2147483647^T))break A;br(e,32,n,S=r+T|0,i),wi(e,A,T),br(e,48,n,S,65536^i);g:{r:{C:{if((0|p)==70){for(r=8|(o=u+16|0),g=9|o,m=p=m>>>0>C>>>0?C:m;;){d=ar(s[m>>2],0,g);a:if((0|p)==(0|m))(0|d)==(0|g)&&(a[u+24|0]=48,d=r);else{if(u+16>>>0>=d>>>0)break a;for(;a[0|(d=d-1|0)]=48,u+16>>>0>>0;);}if(wi(e,d,g-d|0),!(C>>>0>=(m=m+4|0)>>>0))break}if(x&&wi(e,85998,1),(0|_)<=0|m>>>0>=h>>>0)break C;for(;;){if((d=ar(s[m>>2],0,g))>>>0>u+16>>>0)for(;a[0|(d=d-1|0)]=48,u+16>>>0>>0;);if(wi(e,d,(0|_)>=9?9:_),d=_-9|0,h>>>0<=(m=m+4|0)>>>0)break r;if(r=(0|_)>9,_=d,!r)break}break r}a:if(!((0|_)<0))for(C=m>>>0>>0?h:m+4|0,r=8|(o=u+16|0),h=9|o,p=m;;){(0|h)==(0|(d=ar(s[p>>2],0,h)))&&(a[u+24|0]=48,d=r);I:if((0|p)==(0|m))wi(e,d,1),d=d+1|0,g|_&&wi(e,85998,1);else{if(u+16>>>0>=d>>>0)break I;for(;a[0|(d=d-1|0)]=48,u+16>>>0>>0;);}if(wi(e,d,(0|(o=h-d|0))>(0|_)?_:o),_=_-o|0,C>>>0<=(p=p+4|0)>>>0)break a;if(!((0|_)>=0))break}br(e,48,_+18|0,18,0),wi(e,E,D-E|0);break g}d=_}br(e,48,d+9|0,9,0)}br(e,32,n,S,8192^i),y=(0|n)<(0|S)?S:n;break A}if(g=(o<<26>>31&9)+A|0,!(r>>>0>11)){for(d=12-r|0,w=16;w*=16,d=d-1|0;);t=c[0|g]==45?-(w+(-t-w)):t+w-w}for((0|D)==(0|(d=ar(((d=s[u+44>>2])^(p=d>>31))-p|0,0,D)))&&(a[u+15|0]=48,d=u+15|0),C=2|T,m=32&o,p=s[u+44>>2],a[0|(_=d-2|0)]=o+15,a[d-1|0]=(0|p)<0?45:43,d=8&i,p=u+16|0;o=p,h=b(t)<2147483648?~~t:-2147483648,a[0|p]=m|c[h+124512|0],!((0|r)>0|d)&(t=16*(t-+(0|h)))==0|((p=o+1|0)-(u+16|0)|0)!=1||(a[o+1|0]=46,p=o+2|0),t!=0;);y=-1,(2147483645-(o=(d=D-_|0)+C|0)|0)<(0|r)||(br(e,32,n,o=(r=!r||((m=p-(u+16|0)|0)-2|0)>=(0|r)?m=p-(u+16|0)|0:r+2|0)+o|0,i),wi(e,g,C),br(e,48,n,o,65536^i),wi(e,u+16|0,m),br(e,48,r-m|0,0,0),wi(e,_,d),br(e,32,n,o,8192^i),y=(0|n)<(0|o)?o:n)}else br(e,32,n,d=T+3|0,-65537&i),wi(e,A,T),r=32&o,wi(e,t==t?r?85247:85460:r?85596:85774,3),br(e,32,n,d,8192^i),y=(0|n)<(0|d)?d:n;return z=u+560|0,0|y},function(e,t){var n;e|=0,n=t|=0,t=s[t>>2]+7&-8,s[n>>2]=t+16,_[e>>3]=mt(s[t>>2],s[t+4>>2],s[t+8>>2],s[t+12>>2])},function(e,t,n){t|=0,n|=0;var r,i,o=0,c=0;return r=s[84+(e|=0)>>2],c=s[r+4>>2],i=s[e+28>>2],(o=(o=s[e+20>>2]-i|0)>>>0>c>>>0?c:o)&&(ut(s[r>>2],i,o),s[r>>2]=o+s[r>>2],c=s[r+4>>2]-o|0,s[r+4>>2]=c),o=s[r>>2],(c=n>>>0>c>>>0?c:n)&&(ut(o,t,c),o=c+s[r>>2]|0,s[r>>2]=o,s[r+4>>2]=s[r+4>>2]-c),a[0|o]=0,t=s[e+44>>2],s[e+28>>2]=t,s[e+20>>2]=t,0|n},function(e,t,n){n|=0;var r,i,a=0;return ut(t|=0,r=s[84+(e|=0)>>2],n=n>>>0>(a=(i=un(r,0,a=n+256|0))?i-r|0:a)>>>0?a:n),t=r+a|0,s[e+84>>2]=t,s[e+8>>2]=t,s[e+4>>2]=n+r,0|n},function(e,t,n){t|=0,n|=0;var r,i=0,o=0,l=0;i=s[84+(e|=0)>>2],r=s[i>>2]?i:84412,i=0;A:if(s[e+48>>2])for(;;){if(!(o=s[(i<<2)+r>>2]))break A;if(a[s[e+44>>2]+i|0]=(0|o)>=128?64:o,!((i=i+1|0)>>>0>2]))break}return o=s[e+44>>2],s[e+4>>2]=o,s[e+84>>2]=(i<<2)+r,s[e+8>>2]=i+o,!n|!i||(s[e+4>>2]=o+1,a[0|t]=c[0|o],l=1),0|l},Ri,Bi,Vi,Vi,function(e,t,n){n|=0;var r,i=0;return z=r=z+-64|0,i=1,Qr(e|=0,t|=0,0)||(i=0,t&&(i=0,(t=Mt(t,125132))&&(Pt(4|(i=r+8|0),0,52),s[r+56>>2]=1,s[r+20>>2]=-1,s[r+16>>2]=e,s[r+8>>2]=t,Ui[s[s[t>>2]+28>>2]](t,i,s[n>>2],1),(0|(e=s[r+32>>2]))==1&&(s[n>>2]=s[r+24>>2]),i=(0|e)==1))),z=r- -64|0,0|i},function(e,t,n,r,i,a){n|=0,r|=0,i|=0,a|=0,Qr(e|=0,s[8+(t|=0)>>2],a)&&On(t,n,r,i)},function(e,t,n,r,i){if(n|=0,r|=0,i|=0,Qr(e|=0,s[8+(t|=0)>>2],i))s[t+28>>2]==1|s[t+4>>2]!=(0|n)||(s[t+28>>2]=r);else A:if(Qr(e,s[t>>2],i)){if(!(s[t+16>>2]!=(0|n)&s[t+20>>2]!=(0|n))){if((0|r)!=1)break A;s[t+32>>2]=1;return}s[t+20>>2]=n,s[t+32>>2]=r,s[t+40>>2]=s[t+40>>2]+1,s[t+36>>2]!=1|s[t+24>>2]!=2||(a[t+54|0]=1),s[t+44>>2]=4}},function(e,t,n,r){n|=0,r|=0,Qr(e|=0,s[8+(t|=0)>>2],0)&&yr(t,n,r)},Bi,function(e,t,n,r,i,a){n|=0,r|=0,i|=0,a|=0,Qr(e|=0,s[8+(t|=0)>>2],a)?On(t,n,r,i):(e=s[e+8>>2],Ui[s[s[e>>2]+20>>2]](e,t,n,r,i,a))},function(e,t,n,r,i){if(n|=0,r|=0,i|=0,Qr(e|=0,s[8+(t|=0)>>2],i))s[t+28>>2]==1|s[t+4>>2]!=(0|n)||(s[t+28>>2]=r);else A:{if(Qr(e,s[t>>2],i)){if(!(s[t+16>>2]!=(0|n)&s[t+20>>2]!=(0|n))){if((0|r)!=1)break A;s[t+32>>2]=1;return}s[t+32>>2]=r;e:if(s[t+44>>2]!=4){if(o[t+52>>1]=0,e=s[e+8>>2],Ui[s[s[e>>2]+20>>2]](e,t,n,n,1,i),c[t+53|0]){if(s[t+44>>2]=3,!c[t+52|0])break e;break A}s[t+44>>2]=4}if(s[t+20>>2]=n,s[t+40>>2]=s[t+40>>2]+1,s[t+36>>2]!=1|s[t+24>>2]!=2)break A;a[t+54|0]=1;return}e=s[e+8>>2],Ui[s[s[e>>2]+24>>2]](e,t,n,r,i)}},function(e,t,n,r){n|=0,r|=0,Qr(e|=0,s[8+(t|=0)>>2],0)?yr(t,n,r):(e=s[e+8>>2],Ui[s[s[e>>2]+28>>2]](e,t,n,r))},Bi,function(e){return 84787},Bi,function(e){return 85058},Bi,function(e){return 84147},function(e){var t;return t=e|=0,e=s[e>>2],s[t>>2]=e+1,0|((0|(e=a[0|e]))<0?65533:255&e)},function(e,t,n,r,i,o){e|=0,t|=0,n|=0,r|=0,i|=0,o|=0;var l,u=0,d=0,f=0,m=0,h=0,g=0,v=0,y=0;if(l=Yr(408),s[l+4>>2]=r,s[l>>2]=n,t?(ut(l+16|0,t,376),_[l+392>>3]=(_[t+368>>3]-_[t>>3])/+(n>>>0),t=0):t=1,s[l+400>>2]=i,a[l+8|0]=t,o){if(n=s[e+24>>2])for(t=s[e+20>>2],r=s[e+8>>2];(i=s[s[(t>>>8&16777212)+r>>2]+((1023&t)<<2)>>2])&&(Re(i),n=s[e+24>>2],r=s[e+8>>2],t=s[e+20>>2]),t=t+1|0,s[e+20>>2]=t,n=n-1|0,s[e+24>>2]=n,t>>>0>=2048&&(Re(s[r>>2]),r=s[e+8>>2]+4|0,s[e+8>>2]=r,t=s[e+20>>2]-1024|0,s[e+20>>2]=t,n=s[e+24>>2]),n;);t=s[e+28>>2],s[e+420>>2]=s[t>>2],(n=s[e+32>>2])&&(a[t+8|0]=c[n+8|0],ut(t+16|0,e+40|0,376),(t=s[e+32>>2])&&Re(t),s[e+32>>2]=0)}if(n=(r=s[e+24>>2])+s[e+20>>2]|0,i=s[e+12>>2],(0|n)==(0|((0|(t=s[e+8>>2]))==(0|i)?0:(i-t<<8)-1))){z=u=z-32|0;A:{e:{g:{r:{if((t=s[16+(o=e+4|0)>>2])>>>0>=1024){if(s[o+16>>2]=t-1024,t=s[o+4>>2],g=s[t>>2],i=t+4|0,s[o+4>>2]=i,(0|(t=s[o+8>>2]))==s[o+12>>2])if((d=s[o>>2])>>>0>>0)n=kt((r=(1+(i-d>>2)|0)/-2<<2)+i|0,i,t=t-i|0)+t|0,s[o+8>>2]=n,s[o+4>>2]=r+s[o+4>>2];else{if((n=(0|t)==(0|d)?1:t-d>>1)>>>0>=1073741824)break r;if(v=(r=n<<2)+(f=Yr(r))|0,n=r=f+(-4&n)|0,(0|t)!=(0|i)){if(y=-4&(t=t-i|0),h=1+((m=t-4|0)>>>2|0)&7)for(n=0,t=r;s[t>>2]=s[i>>2],i=i+4|0,t=t+4|0,(0|h)!=(0|(n=n+1|0)););else t=r;if(n=r+y|0,!(m>>>0<28))for(;s[t>>2]=s[i>>2],s[t+4>>2]=s[i+4>>2],s[t+8>>2]=s[i+8>>2],s[t+12>>2]=s[i+12>>2],s[t+16>>2]=s[i+16>>2],s[t+20>>2]=s[i+20>>2],s[t+24>>2]=s[i+24>>2],s[t+28>>2]=s[i+28>>2],i=i+32|0,(0|n)!=(0|(t=t+32|0)););}s[o+12>>2]=v,s[o+8>>2]=n,s[o+4>>2]=r,s[o>>2]=f,d&&(Re(d),n=s[o+8>>2])}else n=t;s[n>>2]=g,s[o+8>>2]=s[o+8>>2]+4;break A}if((d=(i=s[o+8>>2])-s[o+4>>2]>>2)>>>0<(r=(t=s[o+12>>2])-(n=s[o>>2])|0)>>2>>>0){if((0|t)!=(0|i)){s[u+8>>2]=Yr(4096),St(o,u+8|0);break A}if(s[u+8>>2]=Yr(4096),bt(o,u+8|0),t=s[o+4>>2],g=s[t>>2],i=t+4|0,s[o+4>>2]=i,(0|(t=s[o+8>>2]))==s[o+12>>2])if((d=s[o>>2])>>>0>>0)n=kt((r=(1+(i-d>>2)|0)/-2<<2)+i|0,i,t=t-i|0)+t|0,s[o+8>>2]=n,s[o+4>>2]=r+s[o+4>>2];else{if((n=(0|t)==(0|d)?1:t-d>>1)>>>0>=1073741824)break r;if(v=(r=n<<2)+(f=Yr(r))|0,n=r=f+(-4&n)|0,(0|t)!=(0|i)){if(y=-4&(t=t-i|0),h=1+((m=t-4|0)>>>2|0)&7)for(n=0,t=r;s[t>>2]=s[i>>2],i=i+4|0,t=t+4|0,(0|h)!=(0|(n=n+1|0)););else t=r;if(n=r+y|0,!(m>>>0<28))for(;s[t>>2]=s[i>>2],s[t+4>>2]=s[i+4>>2],s[t+8>>2]=s[i+8>>2],s[t+12>>2]=s[i+12>>2],s[t+16>>2]=s[i+16>>2],s[t+20>>2]=s[i+20>>2],s[t+24>>2]=s[i+24>>2],s[t+28>>2]=s[i+28>>2],i=i+32|0,(0|n)!=(0|(t=t+32|0)););}s[o+12>>2]=v,s[o+8>>2]=n,s[o+4>>2]=r,s[o>>2]=f,d&&(Re(d),n=s[o+8>>2])}else n=t;s[n>>2]=g,s[o+8>>2]=s[o+8>>2]+4;break A}if(s[u+24>>2]=o+12,!((t=(0|t)==(0|n)?1:r>>1)>>>0>=1073741824)){if(t=Yr(n=t<<2),s[u+8>>2]=t,r=t+(d<<2)|0,s[u+16>>2]=r,s[u+20>>2]=t+n,s[u+12>>2]=r,s[u+4>>2]=Yr(4096),St(u+8|0,u+4|0),(0|(i=s[o+8>>2]))==s[o+4>>2]){t=i;break e}for(;bt(u+8|0,i=i-4|0),s[o+4>>2]!=(0|i););break g}}ei(),p()}t=s[o+8>>2]}n=s[o>>2],s[o>>2]=s[u+8>>2],s[u+8>>2]=n,s[o+4>>2]=s[u+12>>2],s[u+12>>2]=i,s[o+8>>2]=s[u+16>>2],s[u+16>>2]=t,r=s[o+12>>2],s[o+12>>2]=s[u+20>>2],s[u+20>>2]=r,(0|t)!=(0|i)&&(s[u+16>>2]=t+(3+(i-t|0)&-4)),n&&Re(n)}z=u+32|0,n=(r=s[e+24>>2])+s[e+20>>2]|0,t=s[e+8>>2]}s[s[t+(n>>>8&16777212)>>2]+((1023&n)<<2)>>2]=l,s[e+24>>2]=r+1},function(e){var t=0,n=0,r=0,i=0,o=0,l=0,u=0,d=0,f=0;n=s[420+(e|=0)>>2]+1|0,s[e+420>>2]=n;A:{if(t=s[e+32>>2]){if(n>>>0>(u=s[t+4>>2])>>>0){(n=s[e+28>>2])&&(Re(n),t=s[e+32>>2]),s[e+32>>2]=0,s[e+28>>2]=t;break A}for(o=e+40|0,l=t+16|0,d=s[e+28>>2]+16|0,f=(n>>>0)/(u>>>0),t=0;;){if(r=_[(n=t<<3)+l>>3],i=_[n+d>>3],_[n+o>>3]=r==r?(r-i)*f+i:i,(0|(n=1|t))==47)break A;r=_[(n<<=3)+l>>3],i=_[n+d>>3],_[n+o>>3]=r==r?(r-i)*f+i:i,t=t+2|0}}if(t=s[e+28>>2],n>>>0>g[t>>2]){if(o=s[e+24>>2]){if(a[e+416|0]=0,l=s[e+8>>2],n=s[e+20>>2],t=s[s[l+(n>>>8&16777212)>>2]+((1023&n)<<2)>>2],s[e+32>>2]=t,s[e+24>>2]=o-1,n=n+1|0,s[e+20>>2]=n,n>>>0>=2048&&(Re(s[l>>2]),s[e+8>>2]=s[e+8>>2]+4,s[e+20>>2]=s[e+20>>2]-1024,t=s[e+32>>2]),c[t+8|0])ut(t+16|0,s[e+28>>2]+16|0,376),t=s[e+32>>2],s[t+368>>2]=0,s[t+372>>2]=0,r=_[e+40>>3],s[t+392>>2]=0,s[t+396>>2]=0,_[t+16>>3]=r;else if(n=s[e+28>>2],c[n+8|0]&&(ut(n+16|0,t+16|0,376),t=s[e+28>>2],s[t+368>>2]=0,s[t+372>>2]=0,!(t=s[e+32>>2])))break A;(0|(n=s[t+400>>2]))!=-1&&(s[e+424>>2]=n),s[e+420>>2]=0,_[t+16>>3]=_[t+392>>3]*+g[t+4>>2]+_[t+16>>3];break A}a[e+416|0]=1}else r=_[t+392>>3]+_[e+40>>3],_[e+40>>3]=r,_[t+16>>3]=r}return 0|(c[e+416|0]?0:e+40)},function(e){return s[424+(e|=0)>>2]},function(e){var t=0;return s[(e|=0)>>2]=132304,(t=s[e+28>>2])&&Re(t),(t=s[e+32>>2])&&Re(t),ln(e+4|0),0|e},function(e){var t=0;s[(e|=0)>>2]=132304,(t=s[e+28>>2])&&Re(t),(t=s[e+32>>2])&&Re(t),ln(e+4|0),Re(e)},function(e,t,n){t|=0,n|=0;var r=0,i=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,v=0,y=0,x=0,S=0,C=0,w=0,T=0,E=0;if(!s[1088+(e|=0)>>2])return 0;A:if(t){for(f=e+648|0,d=e- -64|0;;){if(r=s[e+1088>>2],!(r=0|Ui[s[s[r>>2]+4>>2]](r)))break A;if(i=ht(_[e+32>>3]+_[r+16>>3]/+s[e+24>>2]),_[e+32>>3]=i,i=yn(6.283185307179586*i),i=ht(_[e+16>>3]+_[r>>3]*(.06*i*_[r+8>>3]+1)/s[e+8>>2]),_[e+16>>3]=i,u=hr(s[56848],s[56849],1284865837,1481765933),c=B,c=(u=u+1|0)?c:c+1|0,s[56848]=u,s[56849]=c,l=.75*_[e+40>>3]+(c>>>1|0)/2147483647,_[e+40>>3]=l,p=_[r+24>>3],c=i>=_[r+32>>3],a[e+48|0]=c,l=(h=p)*(p=.2*l),l=Xt(d+512|0,Xt(d+440|0,i=_[r+352>>3]*(p*_[r+48>>3]+_[r+40>>3]*(i+i+-1+(c?l:.01*l)))*.5,_[r+104>>3],_[r+168>>3]),_[r+112>>3],_[r+176>>3]),l=Xt(d+8|0,Xt(d+80|0,Xt(d+152|0,Xt(d+224|0,Xt(d+296|0,Xt(d+368|0,l==l?(l-i)*_[r+184>>3]+i:i,_[r+96>>3],_[r+160>>3]),_[r+88>>3],_[r+152>>3]),_[r+80>>3],_[r+144>>3]),_[r+72>>3],_[r+136>>3]),_[r+64>>3],_[r+128>>3]),_[r+56>>3],_[r+120>>3]),u=hr(s[56848],s[56849],1284865837,1481765933),c=B,c=(u=u+1|0)?c:c+1|0,s[56848]=u,s[56849]=c,i=.75*_[e+56>>3]+(c>>>1|0)/2147483647,_[e+56>>3]=i,c=(m<<1)+n|0,p=Xt(f+8|0,i=_[r+352>>3]*(_[r+192>>3]*(.3*i))*.5,_[r+200>>3],_[r+248>>3]),g=_[r+296>>3],v=Xt(f+80|0,i,_[r+208>>3],_[r+256>>3]),y=_[r+304>>3],x=Xt(f+152|0,i,_[r+216>>3],_[r+264>>3]),S=_[r+312>>3],C=Xt(f+224|0,i,_[r+224>>3],_[r+272>>3]),w=_[r+320>>3],T=Xt(f+296|0,i,_[r+232>>3],_[r+280>>3]),E=_[r+328>>3],h=l,l=(Xt(f+368|0,i,_[r+240>>3],_[r+288>>3])-i)*_[r+336>>3]+(E*(T-i)+(w*(C-i)+(S*(x-i)+(y*(v-i)+(g*(p-i)+0))))),i=(h+(i==i?(i-l)*_[r+344>>3]+l:l))*_[r+360>>3]*4e3,r=(0|(r=b(i)<2147483648?~~i:-2147483648))>=32e3?32e3:r,o[c>>1]=(0|r)<=-32e3?-32e3:r,(0|(m=m+1|0))==(0|t))break}m=t}return 0|(t>>>0>m>>>0?m:t)},function(e,t){t|=0,s[1088+(e|=0)>>2]=t},Ri,Bi,zi,function(e,t,n,r){return B=0,0}],Hi.grow=function(e){var t=this.length;return this.length+=e,t},Hi.set=function(e,t){this[e]=t},Hi.get=function(e){return this[e]},Hi);return{v:function(){var e,t=0;z=e=z-16|0,0|re(e+12|0,e+8|0)||(t=ve(4+(s[e+12>>2]<<2)|0),s[56800]=t,t&&(!(t=ve(s[e+8>>2]))||(s[s[56800]+(s[e+12>>2]<<2)>>2]=0,0|ne(s[56800],0|t)))&&(s[56800]=0)),z=e+16|0,s[56841]=227236,s[56823]=42},w:Ii,x:Pi,y:function(e,t){t|=0,s[(e|=0)>>2]=t},z:function(e,t){return t|=0,a[s[(e|=0)+4>>2]+t|0]},A:Mi,B:Di,C:function(e){return c[(e|=0)+12|0]},D:function(e,t){t|=0,a[(e|=0)+12|0]=t},E:function(e){return c[(e|=0)+13|0]},F:function(e,t){t|=0,a[(e|=0)+13|0]=t},G:function(e){return c[(e|=0)+14|0]},H:function(e,t){t|=0,a[(e|=0)+14|0]=t},I:function(e){return c[(e|=0)+15|0]},J:function(e,t){t|=0,a[(e|=0)+15|0]=t},K:Ai,L:function(e,t){t|=0,s[(e|=0)+16>>2]=t},M:ji,N:function(e,t){t|=0,s[(e|=0)+20>>2]=t},O:Ii,P:Pi,Q:Ni,R:Mi,S:ki,T:Ai,U:ji,V:function(e){return s[(e|=0)+24>>2]},W:Ii,X:function(){var e,t=0,n=0,r=0,i=0,l=0,u=0,d=0,f=0,p=0,m=0,y=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,A=0,j=0,M=0,N=0;if(e=Yr(20),s[e+16>>2]=0,s[e+8>>2]=175,s[e+12>>2]=50,!(t=s[33208])){z=t=(z=O=z-16|0)-80|0;A:{if((n=Wn(84292))&&(s[t+32>>2]=n,jn(137584,160,85959,t+32|0),(0|vr(137584))==-31||(s[t+16>>2]=n,jn(137584,160,86031,t+16|0),(0|vr(137584))==-31)))break A;(n=Wn(84619))&&(s[t>>2]=n,jn(137584,160,85959,t),(0|vr(137584))==-31)||(n=c[84826]|c[84827]<<8|c[84828]<<16|c[84829]<<24,s[34396]=c[84822]|c[84823]<<8|c[84824]<<16|c[84825]<<24,s[34397]=n,o[68804]=c[84846]|c[84847]<<8,n=c[84842]|c[84843]<<8|c[84844]<<16|c[84845]<<24,s[34400]=c[84838]|c[84839]<<8|c[84840]<<16|c[84841]<<24,s[34401]=n,n=c[84834]|c[84835]<<8|c[84836]<<16|c[84837]<<24,s[34398]=c[84830]|c[84831]<<8|c[84832]<<16|c[84833]<<24,s[34399]=n)}if(z=t+80|0,s[O+12>>2]=0,i=O+12|0,z=d=z-16|0,s[d+12>>2]=22050,Dt(85144)||Dt(85315)||Dt(85473)||Dt(85698),y=d+12|0,z=l=z-16|0,s[l+12>>2]=0,!((t=tn(137832,84262,0,i))||(t=tn(137836,84420,0,i))||(t=tn(137840,84813,0,i))||(t=tn(137820,85016,l+12|0,i))))if(s[34454]=g[l+12>>2]/68,n=s[34460],s[34456]=n,n&&(0|(p=c[0|n]|c[n+1|0]<<8|c[n+2|0]<<16|c[n+3|0]<<24))==83969){if(x=c[n+4|0]|c[n+5|0]<<8|c[n+6|0]<<16|c[n+7|0]<<24,n=s[34458],C=c[0|n],s[34461]=C,C)for(t=n+4|0,p=0;r=v(p,44)+137856|0,i=c[0|t],s[r+36>>2]=i,s[r+40>>2]=c[t+1|0],u=c[t+8|0]|c[t+9|0]<<8|c[t+10|0]<<16|c[t+11|0]<<24,n=c[t+4|0]|c[t+5|0]<<8|c[t+6|0]<<16|c[t+7|0]<<24,a[0|r]=n,a[r+1|0]=n>>>8,a[r+2|0]=n>>>16,a[r+3|0]=n>>>24,a[r+4|0]=u,a[r+5|0]=u>>>8,a[r+6|0]=u>>>16,a[r+7|0]=u>>>24,u=c[t+16|0]|c[t+17|0]<<8|c[t+18|0]<<16|c[t+19|0]<<24,n=c[t+12|0]|c[t+13|0]<<8|c[t+14|0]<<16|c[t+15|0]<<24,a[r+8|0]=n,a[r+9|0]=n>>>8,a[r+10|0]=n>>>16,a[r+11|0]=n>>>24,a[r+12|0]=u,a[r+13|0]=u>>>8,a[r+14|0]=u>>>16,a[r+15|0]=u>>>24,u=c[t+24|0]|c[t+25|0]<<8|c[t+26|0]<<16|c[t+27|0]<<24,n=c[t+20|0]|c[t+21|0]<<8|c[t+22|0]<<16|c[t+23|0]<<24,a[r+16|0]=n,a[r+17|0]=n>>>8,a[r+18|0]=n>>>16,a[r+19|0]=n>>>24,a[r+20|0]=u,a[r+21|0]=u>>>8,a[r+22|0]=u>>>16,a[r+23|0]=u>>>24,u=c[t+32|0]|c[t+33|0]<<8|c[t+34|0]<<16|c[t+35|0]<<24,n=c[t+28|0]|c[t+29|0]<<8|c[t+30|0]<<16|c[t+31|0]<<24,a[r+24|0]=n,a[r+25|0]=n>>>8,a[r+26|0]=n>>>16,a[r+27|0]=n>>>24,a[r+28|0]=u,a[r+29|0]=u>>>8,a[r+30|0]=u>>>16,a[r+31|0]=u>>>24,n=t+36|0,s[r+32>>2]=n,t=n+(i<<4)|0,(0|C)!=(0|(p=p+1|0)););(0|C)<=s[34457]&&(s[34457]=0),t=0,y&&(s[y>>2]=x)}else A:{e:{if(i){if(n=s[i>>2]){Re(s[n+4>>2]),t=s[i>>2];break e}if(t=ve(16),s[i>>2]=t,t)break e;t=48}else t=268436223;break A}s[t>>2]=1,s[t+4>>2]=ui(137584),n=s[i>>2],s[n+12>>2]=83969,s[n+8>>2]=p,t=268436223}if(z=l+16|0,n=t,!t){if(y=s[d+12>>2],s[50754]=y,s[50759]=0,s[50760]=134217728/(0|y),s[50762]=0,s[50763]=0,s[50765]=2147483647,s[50781]=100,s[50779]=32,s[50761]=(y<<6)/(0|y),t=s[26385],s[50784]=s[26384],s[50785]=t,t=s[26387],s[50786]=s[26386],s[50787]=t,t=s[26389],s[50788]=s[26388],s[50789]=t,t=s[26391],s[50790]=s[26390],s[50791]=t,t=s[26393],s[50792]=s[26392],s[50793]=t,t=s[26395],s[50794]=s[26394],s[50795]=t,t=s[26397],s[50796]=s[26396],s[50797]=t,s[50798]=s[26398],x=(0|(t=(0|(i=v(y,60)))/12800|0))>=128?128:t,s[50799]=x,s[50800]=(0|x)/2,!((0|y)==22050|(0|i)<12800)){if(y=1&(t=(0|x)<=1?1:x),E=+(0|x),p=0,(0|x)>=2)for(x=2147483646&t,t=0;w=p+132160|0,f=127*(1-_n(6.283185307179586*(0|p)/E)),S=b(f)<2147483648?~~f:-2147483648,a[0|w]=S,w=(i=1|p)+132160|0,f=127*(1-_n(6.283185307179586*(0|i)/E)),S=b(f)<2147483648?~~f:-2147483648,a[0|w]=S,p=p+2|0,(0|x)!=(0|(t=t+2|0)););y&&(t=p+132160|0,f=127*(1-_n(6.283185307179586*(0|p)/E)),w=b(f)<2147483648?~~f:-2147483648,a[0|t]=w)}if(s[50801]=105792,s[56797]=Ze(),s[55964]=38,s[55921]=1,s[55918]=22050,s[56606]=0,s[55960]=110928,s[55958]=0,s[55959]=1074266112,s[55956]=100,s[55922]=20,s[55923]=220,s[55916]=1,s[55917]=0,zr(),s[56244]=0,s[56245]=0,s[55928]=0,s[55926]=0,s[55927]=0,s[55924]=0,s[56246]=0,s[56247]=0,s[56260]=0,s[56261]=0,s[56262]=0,s[56263]=0,s[56276]=0,s[56277]=0,s[56278]=0,s[56279]=0,s[55974]=0,s[55975]=0,s[55972]=0,s[55973]=0,E=-3.141592653589793/(0|(t=s[55918])),_[27967]=E,i=(0|v(t,630))/1e4|0,s[55920]=i,t=(0|v(t,950))/1e4|0,s[55919]=t,f=-2*E,_[27968]=f,E=(M=dt(E*+(0|i)))*-M,_[28129]=E,f=M*_n(f*+(0|t)),f+=f,_[28128]=f,_[28127]=1-f-E,s[55990]=0,s[55991]=0,s[55988]=0,s[55989]=0,s[56006]=0,s[56007]=0,s[56004]=0,s[56005]=0,s[56022]=0,s[56023]=0,s[56020]=0,s[56021]=0,s[56038]=0,s[56039]=0,s[56036]=0,s[56037]=0,s[56054]=0,s[56055]=0,s[56052]=0,s[56053]=0,s[56070]=0,s[56071]=0,s[56068]=0,s[56069]=0,s[56086]=0,s[56087]=0,s[56084]=0,s[56085]=0,s[56102]=0,s[56103]=0,s[56100]=0,s[56101]=0,s[56118]=0,s[56119]=0,s[56116]=0,s[56117]=0,s[56134]=0,s[56135]=0,s[56132]=0,s[56133]=0,s[56150]=0,s[56151]=0,s[56148]=0,s[56149]=0,s[56166]=0,s[56167]=0,s[56164]=0,s[56165]=0,s[56182]=0,s[56183]=0,s[56180]=0,s[56181]=0,s[56198]=0,s[56199]=0,s[56196]=0,s[56197]=0,s[56214]=0,s[56215]=0,s[56212]=0,s[56213]=0,s[56230]=0,s[56231]=0,s[56228]=0,s[56229]=0,s[56639]=59,s[56640]=59,s[56629]=0,s[56630]=59,s[56619]=89,s[56620]=160,s[56609]=280,s[56610]=688,s[56611]=1064,s[56621]=70,s[56631]=59,s[56612]=2806,s[56613]=3260,s[56622]=160,s[56623]=200,s[56632]=59,s[56633]=59,s[56641]=89,s[56642]=149,s[56643]=200,s[56644]=200,s[56634]=59,s[56635]=59,s[56624]=200,s[56625]=500,s[56614]=3700,s[56615]=6500,s[56645]=500,s[56646]=0,s[56616]=7e3,s[56626]=500,s[56636]=0,s[56647]=0,s[56637]=0,s[56627]=500,s[56617]=8e3,s[56669]=89,s[56648]=0,s[56638]=0,s[56628]=89,s[56618]=280,s[56657]=62,s[56655]=0,s[56656]=0,s[56653]=50,s[56654]=0,s[56651]=0,s[56652]=0,s[56649]=0,s[56650]=40,s[56607]=1e3,s[56608]=59,z=l=z-416|0,s[l+16>>2]=137584,s[l+20>>2]=47,s[l+24>>2]=85952,H(t=l+240|0,85699,l+16|0),u=ft(t,86034)){if(It(l+240|0,170,u))for(y=5|(t=l+240|0),x=10|t;c[l+240|0]!=47&&(s[l+240>>2]==1701736308?(z=t=z-48|0,s[32960]=-1,s[32961]=-1,s[32970]=-1,s[32971]=-1,s[32968]=-1,s[32969]=-1,s[32966]=-1,s[32967]=-1,s[32964]=-1,s[32965]=-1,s[32962]=-1,s[32963]=-1,s[t+36>>2]=131876,s[t+32>>2]=131872,s[t+28>>2]=131868,s[t+24>>2]=131864,s[t+20>>2]=131860,s[t+16>>2]=131856,s[t+12>>2]=131852,s[t+8>>2]=131848,s[t+4>>2]=131844,s[t>>2]=131840,_e(y,84222,t),z=t+48|0):Hn(l+240|0,86614,9)||(s[l+4>>2]=l+32,s[l>>2]=l+239,(0|_e(x,86829,l))==2&&(i=s[34064],s[(C=136272+(i<<4)|0)>>2]=a[l+239|0],t=ui(l+32|0),s[34064]=i+1,s[C+12>>2]=t,s[C+4>>2]=0))),It(l+240|0,170,u););Sr(u)}z=l+416|0,s[50297]=0,s[50298]=0,s[50301]=0,s[50302]=0,s[50299]=0,s[50300]=0,Dn(0,85698),s[36425]=0,s[36424]=0,s[36426]=0,s[36427]=-1,di(),Ue(0),r=s[25690],s[34062]=r,m=s[25689],l=s[25688],s[34060]=l,s[34061]=m,T=s[25687],u=s[25686],s[34058]=u,s[34059]=T,D=s[25685],C=s[25684],s[34056]=C,s[34057]=D,A=s[25683],y=s[25682],s[34054]=y,s[34055]=A,j=s[25681],x=s[25680],s[34052]=x,s[34053]=j,S=s[25679],i=s[25678],s[34050]=i,s[34051]=S,w=s[25677],t=s[25676],s[34048]=t,s[34049]=w,s[33729]=t,s[33730]=w,s[33731]=i,s[33732]=S,s[33733]=x,s[33734]=j,s[33735]=y,s[33736]=A,s[33737]=C,s[33738]=D,s[33739]=u,s[33740]=T,s[33741]=l,s[33742]=m,s[33743]=r,Jt(1,175),Jt(2,100),Jt(6,s[47200]),Jt(5,s[47201]),Jt(7,0),s[47198]=0,s[47197]=0,f=k()/1e3,i=hr(t=b(f)<0x8000000000000000?~~f>>>0:0,0,1103515245,0),t=B,t=(i=i+12345|0)>>>0<12345?t+1|0:t,s[33209]=Si(i,t)}if(z=d+16|0,n){w=s[30450],A=s[O+12>>2],d=(m=z-560|0)+48|0,z=r=(z=m)-16|0;A:{e:switch(0|oi(n-268435967|0,24)){case 0:Ti(d,84133,512);break A;case 1:Ti(d,84580,512);break A;case 2:Ti(d,84747,512);break A;case 3:Ti(d,85084,512);break A;case 4:Ti(d,85251,512);break A;case 5:Ti(d,85380,512);break A;case 6:Ti(d,85607,512);break A;case 7:Ti(d,85722,512);break A;case 8:Ti(d,85913,512);break A;case 9:Ti(d,86046,512);break A;case 10:Ti(d,86153,512);break A;case 11:Ti(d,86678,512);break A;case 12:Ti(d,86773,512);break A;case 14:Ti(d,86958,512);break A;case 15:Ti(d,87071,512);break A;default:break e}if(1879048192&n)s[r>>2]=n,jn(d,512,87182,r);else{if(p=0,l=h[123728+((n>>>0<=153?n:0)<<1)>>1]+121804|0,n=s[s[56841]+20>>2]){j=s[n+4>>2],T=s[n>>2],D=s[T>>2]+1794895138|0,S=mi(s[T+8>>2],D),i=mi(s[T+12>>2],D),t=mi(s[T+16>>2],D);e:if(!(j>>>2>>>0<=S>>>0||3&(t|i)|(n=j-(S<<2)|0)>>>0<=i>>>0|t>>>0>=n>>>0))for(y=t>>>2|0,x=i>>>2|0;;){if(C=mi(s[(n=((t=(i=(u=S>>>1|0)+N|0)<<1)+x<<2)+T|0)>>2],D),(n=mi(s[n+4>>2],D))>>>0>=j>>>0|C>>>0>=j-n>>>0|c[(n+C|0)+T|0])break e;if(!(n=Or(l,n+T|0))){if(t=mi(s[(n=(t+y<<2)+T|0)>>2],D),(n=mi(s[n+4>>2],D))>>>0>=j>>>0|t>>>0>=j-n>>>0)break e;p=c[(t+n|0)+T|0]?0:n+T|0;break e}if((0|S)==1)break e;S=(n=(0|n)<0)?u:S-u|0,N=n?N:i}}if((n=U(t=p||l))>>>0>=512){ut(d,t,511),a[d+511|0]=0;break A}ut(d,t,n+1|0)}}z=r+16|0;A:if(A){e:switch(s[A>>2]){case 0:s[m+16>>2]=s[A+4>>2],s[m+20>>2]=m+48,fi(w,87384,m+16|0);break A;case 1:break e;default:break A}t=s[A+12>>2],n=s[A+8>>2],s[m+36>>2]=s[A+4>>2],B=n,s[m+40>>2]=t,s[m+44>>2]=B,s[m+32>>2]=m+48,fi(w,87521,m+32|0)}else s[m>>2]=m+48,fi(w,87700,m);z=m+560|0,(0|O)!=-12&&(n=s[O+12>>2])&&(Re(s[n+4>>2]),Re(s[O+12>>2]),s[O+12>>2]=0)}n=s[24806],s[34389]=0,s[32538]=n,n=(1e3+((n=v(s[50754],100))-((0|n)%1e3|0)|0)|0)/500|0,s[34390]=n,n=Xe(s[34391],n),s[34392]=n,n&&(s[34391]=n,s[34393]=40,(n=Xe(s[34388],1440))&&(s[34388]=n)),s[47198]=0,z=O+16|0,t=s[50754],s[33208]=t}return s[e+4>>2]=t,s[e>>2]=Ft(),0|e},Y:function(e,t,n){e|=0,t|=0,n|=0,s[34440]=n,Fr(3,s[e+12>>2]),Fr(1,s[e+8>>2]),(e=s[e+16>>2])?mn(e):er(1024),de(t),s[34440]=0},Z:function(e,t,n){return e|=0,t|=0,n|=0,s[34440]=0,(e=ft(n,1032))?(s[47195]=e,s[47197]=130,e||(s[47195]=s[30450]),de(t),s[47195]=0,s[47197]=0,s[47195]=s[30450],Sr(e),0):-1},_:function(e){return 36},$:function(e,t,n){var r;return e|=0,t|=0,z=r=z-32|0,(n|=0)?(s[r+24>>2]=0,s[r+28>>2]=0,s[r+16>>2]=0,s[r+20>>2]=0,s[r+12>>2]=n,s[r+8>>2]=t,a[r+21|0]=0,t=mn(r+8|0)):t=er(t),s[e+16>>2]=201188,z=r+32|0,0|t},aa:function(e,t,n,r){var i;return e|=0,t|=0,z=i=z-32|0,(n|=0)|(r|=0)?(s[i+24>>2]=0,s[i+28>>2]=0,s[i+16>>2]=0,s[i+20>>2]=0,s[i+12>>2]=n,s[i+8>>2]=t,a[i+22|0]=0,a[i+20|0]=r,t=mn(i+8|0)):t=er(t),s[e+16>>2]=201188,z=i+32|0,0|t},ba:function(e,t,n,r,i){var o;return e|=0,t|=0,z=o=z-32|0,(r|=0)|(i|=0)|(n|=0)?(s[o+24>>2]=0,s[o+28>>2]=0,s[o+16>>2]=0,s[o+20>>2]=0,s[o+12>>2]=n,s[o+8>>2]=t,a[o+21|0]=i,a[o+20|0]=r,t=mn(o+8|0)):t=er(t),s[e+16>>2]=201188,z=o+32|0,0|t},ca:function(e,t,n,r,i,o){var c;return e|=0,t|=0,z=c=z-32|0,(r|=0)|(i|=0)|(o|=0)|(n|=0)?(s[c+24>>2]=0,s[c+28>>2]=0,s[c+16>>2]=0,s[c+20>>2]=0,s[c+12>>2]=n,s[c+8>>2]=t,a[c+22|0]=o,a[c+21|0]=i,a[c+20|0]=r,t=mn(c+8|0)):t=er(t),s[e+16>>2]=201188,z=c+32|0,0|t},da:function(e,t){return t|=0,s[s[(e|=0)>>2]+(t<<2)>>2]},ea:function(e,t,n){t|=0,n|=0,s[s[(e|=0)>>2]+(t<<2)>>2]=n},fa:Ni,ga:Mi,ha:Di,ia:ki,ja:function(e,t){t|=0,s[(e|=0)+12>>2]=t},ka:Ii,la:function(){return 0},ma:function(){return 1},na:function(){return 2},oa:function(){return 3},pa:function(){return 4},qa:function(){return 5},ra:function(){return 6},sa:function(){return 7},ta:function(){return 8},ua:Ui,va:function(){return 227192},wa:Re,xa:ve,ya:function(e){return(e|=0)?0|!!(0|Mt(e,125228)):0}}}(e)}(t)},instantiate:function(e,t){return{then:function(n){var r=new RH.Module(e);n({instance:new RH.Instance(r,t)})}}},RuntimeError:Error};typeof RH!=`object`&&fU(`no native wasm support detected`);var zH=!1;function BH(e,t){e||fU(t)}var VH,HH,UH,WH,GH,KH,qH,JH=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function YH(e,t,n){for(var r=t+n,i=t;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&JH)return JH.decode(e.subarray(t,i));for(var a=``;t>10,56320|1023&l)}}else a+=String.fromCharCode((31&o)<<6|s)}else a+=String.fromCharCode(o)}return a}function XH(e,t){return e?YH(HH,e,t):``}function ZH(e,t,n,r){if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++o)),s<=127){if(n>=a)break;t[n++]=s}else if(s<=2047){if(n+1>=a)break;t[n++]=192|s>>6,t[n++]=128|63&s}else if(s<=65535){if(n+2>=a)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|63&s}else{if(n+3>=a)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|63&s}}return t[n]=0,n-i}function QH(e){for(var t=0,n=0;n=55296&&r<=57343?(t+=4,++n):t+=3}return t}var $H,eU=Q.INITIAL_MEMORY||16777216;LH=Q.wasmMemory?Q.wasmMemory:new RH.Memory({initial:eU/65536,maximum:eU/65536}),$H=LH.buffer,Q.HEAP8=VH=new Int8Array($H),Q.HEAP16=UH=new Int16Array($H),Q.HEAP32=WH=new Int32Array($H),Q.HEAPU8=HH=new Uint8Array($H),Q.HEAPU16=new Uint16Array($H),Q.HEAPU32=GH=new Uint32Array($H),Q.HEAPF32=KH=new Float32Array($H),Q.HEAPF64=qH=new Float64Array($H),eU=LH.buffer.byteLength;var tU=[],nU=[],rU=[],iU=!1;function aU(e){nU.unshift(e)}var oU,sU,cU=0,lU=null;function uU(e){cU++,Q.monitorRunDependencies&&Q.monitorRunDependencies(cU)}function dU(e){if(cU--,Q.monitorRunDependencies&&Q.monitorRunDependencies(cU),cU==0&&lU){var t=lU;lU=null,t()}}function fU(e){throw Q.onAbort&&Q.onAbort(e),IH(e=`Aborted(`+e+`)`),zH=!0,e+=`. Build with -sASSERTIONS for more info.`,new RH.RuntimeError(e)}function pU(e){this.name=`ExitStatus`,this.message=`Program terminated with exit(`+e+`)`,this.status=e}function mU(e){for(;e.length>0;)e.shift()(Q)}function hU(e,t=`i8`){switch(t.endsWith(`*`)&&(t=`*`),t){case`i1`:case`i8`:return VH[e|0];case`i16`:return UH[e>>1];case`i32`:case`i64`:return WH[e>>2];case`float`:return KH[e>>2];case`double`:return qH[e>>3];case`*`:return GH[e>>2];default:fU(`invalid type for getValue: `+t)}return null}function gU(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){GH[this.ptr+4>>2]=e},this.get_type=function(){return GH[this.ptr+4>>2]},this.set_destructor=function(e){GH[this.ptr+8>>2]=e},this.get_destructor=function(){return GH[this.ptr+8>>2]},this.set_refcount=function(e){WH[this.ptr>>2]=e},this.set_caught=function(e){e=+!!e,VH[this.ptr+12|0]=e},this.get_caught=function(){return VH[this.ptr+12|0]!=0},this.set_rethrown=function(e){e=+!!e,VH[this.ptr+13|0]=e},this.get_rethrown=function(){return VH[this.ptr+13|0]!=0},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=WH[this.ptr>>2];WH[this.ptr>>2]=e+1},this.release_ref=function(){var e=WH[this.ptr>>2];return WH[this.ptr>>2]=e-1,e===1},this.set_adjusted_ptr=function(e){GH[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return GH[this.ptr+16>>2]},this.get_exception_ptr=function(){if(OW(this.get_type()))return GH[this.excPtr>>2];var e=this.get_adjusted_ptr();return e===0?this.excPtr:e}}var _U={isAbs:e=>e.charAt(0)===`/`,splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];i===`.`?e.splice(r,1):i===`..`?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift(`..`);return e},normalize:e=>{var t=_U.isAbs(e),n=e.substr(-1)===`/`;return(e=_U.normalizeArray(e.split(`/`).filter((e=>!!e)),!t).join(`/`))||t||(e=`.`),e&&n&&(e+=`/`),(t?`/`:``)+e},dirname:e=>{var t=_U.splitPath(e),n=t[0],r=t[1];return n||r?(r&&=r.substr(0,r.length-1),n+r):`.`},basename:e=>{if(e===`/`)return`/`;var t=(e=(e=_U.normalize(e)).replace(/\/$/,``)).lastIndexOf(`/`);return t===-1?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return _U.normalize(e.join(`/`))},join2:(e,t)=>_U.normalize(e+`/`+t)},vU={resolve:function(){for(var e=``,t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:$.cwd();if(typeof r!=`string`)throw TypeError(`Arguments to path.resolve must be strings`);if(!r)return``;e=r+`/`+e,t=_U.isAbs(r)}return(t?`/`:``)+(e=_U.normalizeArray(e.split(`/`).filter((e=>!!e)),!t).join(`/`))||`.`},relative:(e,t)=>{function n(e){for(var t=0;t=0&&e[n]===``;n--);return t>n?[]:e.slice(t,n-t+1)}e=vU.resolve(e).substr(1),t=vU.resolve(t).substr(1);for(var r=n(e.split(`/`)),i=n(t.split(`/`)),a=Math.min(r.length,i.length),o=a,s=0;s0&&(FH(YH(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){t===null||t===10?(IH(YH(e.output,0)),e.output=[]):t!=0&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(IH(YH(e.output,0)),e.output=[])}}};function xU(e){fU()}var SU={ops_table:null,mount:function(e){return SU.createNode(null,`/`,16895,0)},createNode:function(e,t,n,r){if($.isBlkdev(n)||$.isFIFO(n))throw new $.ErrnoError(63);SU.ops_table||={dir:{node:{getattr:SU.node_ops.getattr,setattr:SU.node_ops.setattr,lookup:SU.node_ops.lookup,mknod:SU.node_ops.mknod,rename:SU.node_ops.rename,unlink:SU.node_ops.unlink,rmdir:SU.node_ops.rmdir,readdir:SU.node_ops.readdir,symlink:SU.node_ops.symlink},stream:{llseek:SU.stream_ops.llseek}},file:{node:{getattr:SU.node_ops.getattr,setattr:SU.node_ops.setattr},stream:{llseek:SU.stream_ops.llseek,read:SU.stream_ops.read,write:SU.stream_ops.write,allocate:SU.stream_ops.allocate,mmap:SU.stream_ops.mmap,msync:SU.stream_ops.msync}},link:{node:{getattr:SU.node_ops.getattr,setattr:SU.node_ops.setattr,readlink:SU.node_ops.readlink},stream:{}},chrdev:{node:{getattr:SU.node_ops.getattr,setattr:SU.node_ops.setattr},stream:$.chrdev_stream_ops}};var i=$.createNode(e,t,n,r);return $.isDir(i.mode)?(i.node_ops=SU.ops_table.dir.node,i.stream_ops=SU.ops_table.dir.stream,i.contents={}):$.isFile(i.mode)?(i.node_ops=SU.ops_table.file.node,i.stream_ops=SU.ops_table.file.stream,i.usedBytes=0,i.contents=null):$.isLink(i.mode)?(i.node_ops=SU.ops_table.link.node,i.stream_ops=SU.ops_table.link.stream):$.isChrdev(i.mode)&&(i.node_ops=SU.ops_table.chrdev.node,i.stream_ops=SU.ops_table.chrdev.stream),i.timestamp=Date.now(),e&&(e.contents[t]=i,e.timestamp=i.timestamp),i},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array},expandFileStorage:function(e,t){var n=e.contents?e.contents.length:0;if(!(n>=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),n!=0&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(t==0)e.contents=null,e.usedBytes=0;else{var n=e.contents;e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=$.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,$.isDir(e.mode)?t.size=4096:$.isFile(e.mode)?t.size=e.usedBytes:$.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){t.mode!==void 0&&(e.mode=t.mode),t.timestamp!==void 0&&(e.timestamp=t.timestamp),t.size!==void 0&&SU.resizeFileStorage(e,t.size)},lookup:function(e,t){throw $.genericErrors[44]},mknod:function(e,t,n,r){return SU.createNode(e,t,n,r)},rename:function(e,t,n){if($.isDir(e.mode)){var r;try{r=$.lookupNode(t,n)}catch{}if(r)for(var i in r.contents)throw new $.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=n,t.contents[n]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){for(var n in $.lookupNode(e,t).contents)throw new $.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[`.`,`..`];for(var n in e.contents)e.contents.hasOwnProperty(n)&&t.push(n);return t},symlink:function(e,t,n){var r=SU.createNode(e,t,41471,0);return r.link=n,r},readlink:function(e){if(!$.isLink(e.mode))throw new $.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,n,r,i){var a=e.node.contents;if(i>=e.node.usedBytes)return 0;var o=Math.min(e.node.usedBytes-i,r);if(o>8&&a.subarray)t.set(a.subarray(i,i+o),n);else for(var s=0;s0||n+t{if(!(e=vU.resolve(e)))return{path:``,node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new $.ErrnoError(32);for(var n=e.split(`/`).filter((e=>!!e)),r=$.root,i=`/`,a=0;a40)throw new $.ErrnoError(32)}}return{path:i,node:r}},getPath:e=>{for(var t;;){if($.isRoot(e)){var n=e.mount.mountpoint;return t?n[n.length-1]===`/`?n+t:n+`/`+t:n}t=t?e.name+`/`+t:e.name,e=e.parent}},hashName:(e,t)=>{for(var n=0,r=0;r>>0)%$.nameTable.length},hashAddNode:e=>{var t=$.hashName(e.parent.id,e.name);e.name_next=$.nameTable[t],$.nameTable[t]=e},hashRemoveNode:e=>{var t=$.hashName(e.parent.id,e.name);if($.nameTable[t]===e)$.nameTable[t]=e.name_next;else for(var n=$.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode:(e,t)=>{var n=$.mayLookup(e);if(n)throw new $.ErrnoError(n,e);for(var r=$.hashName(e.id,t),i=$.nameTable[r];i;i=i.name_next){var a=i.name;if(i.parent.id===e.id&&a===t)return i}return $.lookup(e,t)},createNode:(e,t,n,r)=>{var i=new $.FSNode(e,t,n,r);return $.hashAddNode(i),i},destroyNode:e=>{$.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>(61440&e)==32768,isDir:e=>(61440&e)==16384,isLink:e=>(61440&e)==40960,isChrdev:e=>(61440&e)==8192,isBlkdev:e=>(61440&e)==24576,isFIFO:e=>(61440&e)==4096,isSocket:e=>!(49152&~e),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=$.flagModes[e];if(t===void 0)throw Error(`Unknown file open mode: `+e);return t},flagsToPermissionString:e=>{var t=[`r`,`w`,`rw`][3&e];return 512&e&&(t+=`w`),t},nodePermissions:(e,t)=>$.ignorePermissions||(!t.includes(`r`)||292&e.mode)&&(!t.includes(`w`)||146&e.mode)&&(!t.includes(`x`)||73&e.mode)?0:2,mayLookup:e=>$.nodePermissions(e,`x`)||(e.node_ops.lookup?0:2),mayCreate:(e,t)=>{try{return $.lookupNode(e,t),20}catch{}return $.nodePermissions(e,`wx`)},mayDelete:(e,t,n)=>{var r;try{r=$.lookupNode(e,t)}catch(e){return e.errno}var i=$.nodePermissions(e,`wx`);if(i)return i;if(n){if(!$.isDir(r.mode))return 54;if($.isRoot(r)||$.getPath(r)===$.cwd())return 10}else if($.isDir(r.mode))return 31;return 0},mayOpen:(e,t)=>e?$.isLink(e.mode)?32:$.isDir(e.mode)&&($.flagsToPermissionString(t)!==`r`||512&t)?31:$.nodePermissions(e,$.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=$.MAX_OPEN_FDS)=>{for(var n=e;n<=t;n++)if(!$.streams[n])return n;throw new $.ErrnoError(33)},getStream:e=>$.streams[e],createStream:(e,t,n)=>{$.FSStream||($.FSStream=function(){this.shared={}},$.FSStream.prototype={},Object.defineProperties($.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return(2097155&this.flags)!=1}},isWrite:{get:function(){return!!(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new $.FSStream,e);var r=$.nextfd(t,n);return e.fd=r,$.streams[r]=e,e},closeStream:e=>{$.streams[e]=null},chrdev_stream_ops:{open:e=>{e.stream_ops=$.getDevice(e.node.rdev).stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new $.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{$.devices[e]={stream_ops:t}},getDevice:e=>$.devices[e],getMounts:e=>{for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push.apply(n,r.mounts)}return t},syncfs:(e,t)=>{typeof e==`function`&&(t=e,e=!1),$.syncFSRequests++,$.syncFSRequests>1&&IH(`warning: `+$.syncFSRequests+` FS.syncfs operations in flight at once, probably just doing extra work`);var n=$.getMounts($.root.mount),r=0;function i(e){return $.syncFSRequests--,t(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,i(e));++r>=n.length&&i(null)}n.forEach((t=>{if(!t.type.syncfs)return a(null);t.type.syncfs(t,e,a)}))},mount:(e,t,n)=>{var r,i=n===`/`,a=!n;if(i&&$.root)throw new $.ErrnoError(10);if(!i&&!a){var o=$.lookupPath(n,{follow_mount:!1});if(n=o.path,r=o.node,$.isMountpoint(r))throw new $.ErrnoError(10);if(!$.isDir(r.mode))throw new $.ErrnoError(54)}var s={type:e,opts:t,mountpoint:n,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,i?$.root=c:r&&(r.mounted=s,r.mount&&r.mount.mounts.push(s)),c},unmount:e=>{var t=$.lookupPath(e,{follow_mount:!1});if(!$.isMountpoint(t.node))throw new $.ErrnoError(28);var n=t.node,r=n.mounted,i=$.getMounts(r);Object.keys($.nameTable).forEach((e=>{for(var t=$.nameTable[e];t;){var n=t.name_next;i.includes(t.mount)&&$.destroyNode(t),t=n}})),n.mounted=null;var a=n.mount.mounts.indexOf(r);n.mount.mounts.splice(a,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,n)=>{var r=$.lookupPath(e,{parent:!0}).node,i=_U.basename(e);if(!i||i===`.`||i===`..`)throw new $.ErrnoError(28);var a=$.mayCreate(r,i);if(a)throw new $.ErrnoError(a);if(!r.node_ops.mknod)throw new $.ErrnoError(63);return r.node_ops.mknod(r,i,t,n)},create:(e,t)=>(t=t===void 0?438:t,t&=4095,t|=32768,$.mknod(e,t,0)),mkdir:(e,t)=>(t=t===void 0?511:t,t&=1023,t|=16384,$.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var n=e.split(`/`),r=``,i=0;i(n===void 0&&(n=t,t=438),t|=8192,$.mknod(e,t,n)),symlink:(e,t)=>{if(!vU.resolve(e))throw new $.ErrnoError(44);var n=$.lookupPath(t,{parent:!0}).node;if(!n)throw new $.ErrnoError(44);var r=_U.basename(t),i=$.mayCreate(n,r);if(i)throw new $.ErrnoError(i);if(!n.node_ops.symlink)throw new $.ErrnoError(63);return n.node_ops.symlink(n,r,e)},rename:(e,t)=>{var n,r,i=_U.dirname(e),a=_U.dirname(t),o=_U.basename(e),s=_U.basename(t);if(n=$.lookupPath(e,{parent:!0}).node,r=$.lookupPath(t,{parent:!0}).node,!n||!r)throw new $.ErrnoError(44);if(n.mount!==r.mount)throw new $.ErrnoError(75);var c,l=$.lookupNode(n,o),u=vU.relative(e,a);if(u.charAt(0)!==`.`)throw new $.ErrnoError(28);if((u=vU.relative(t,i)).charAt(0)!==`.`)throw new $.ErrnoError(55);try{c=$.lookupNode(r,s)}catch{}if(l!==c){var d=$.isDir(l.mode),f=$.mayDelete(n,o,d);if(f||=c?$.mayDelete(r,s,d):$.mayCreate(r,s))throw new $.ErrnoError(f);if(!n.node_ops.rename)throw new $.ErrnoError(63);if($.isMountpoint(l)||c&&$.isMountpoint(c))throw new $.ErrnoError(10);if(r!==n&&(f=$.nodePermissions(n,`w`)))throw new $.ErrnoError(f);$.hashRemoveNode(l);try{n.node_ops.rename(l,r,s)}catch(e){throw e}finally{$.hashAddNode(l)}}},rmdir:e=>{var t=$.lookupPath(e,{parent:!0}).node,n=_U.basename(e),r=$.lookupNode(t,n),i=$.mayDelete(t,n,!0);if(i)throw new $.ErrnoError(i);if(!t.node_ops.rmdir)throw new $.ErrnoError(63);if($.isMountpoint(r))throw new $.ErrnoError(10);t.node_ops.rmdir(t,n),$.destroyNode(r)},readdir:e=>{var t=$.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new $.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=$.lookupPath(e,{parent:!0}).node;if(!t)throw new $.ErrnoError(44);var n=_U.basename(e),r=$.lookupNode(t,n),i=$.mayDelete(t,n,!1);if(i)throw new $.ErrnoError(i);if(!t.node_ops.unlink)throw new $.ErrnoError(63);if($.isMountpoint(r))throw new $.ErrnoError(10);t.node_ops.unlink(t,n),$.destroyNode(r)},readlink:e=>{var t=$.lookupPath(e).node;if(!t)throw new $.ErrnoError(44);if(!t.node_ops.readlink)throw new $.ErrnoError(28);return vU.resolve($.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var n=$.lookupPath(e,{follow:!t}).node;if(!n)throw new $.ErrnoError(44);if(!n.node_ops.getattr)throw new $.ErrnoError(63);return n.node_ops.getattr(n)},lstat:e=>$.stat(e,!0),chmod:(e,t,n)=>{var r=typeof e==`string`?$.lookupPath(e,{follow:!n}).node:e;if(!r.node_ops.setattr)throw new $.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})},lchmod:(e,t)=>{$.chmod(e,t,!0)},fchmod:(e,t)=>{var n=$.getStream(e);if(!n)throw new $.ErrnoError(8);$.chmod(n.node,t)},chown:(e,t,n,r)=>{var i=typeof e==`string`?$.lookupPath(e,{follow:!r}).node:e;if(!i.node_ops.setattr)throw new $.ErrnoError(63);i.node_ops.setattr(i,{timestamp:Date.now()})},lchown:(e,t,n)=>{$.chown(e,t,n,!0)},fchown:(e,t,n)=>{var r=$.getStream(e);if(!r)throw new $.ErrnoError(8);$.chown(r.node,t,n)},truncate:(e,t)=>{if(t<0)throw new $.ErrnoError(28);var n=typeof e==`string`?$.lookupPath(e,{follow:!0}).node:e;if(!n.node_ops.setattr)throw new $.ErrnoError(63);if($.isDir(n.mode))throw new $.ErrnoError(31);if(!$.isFile(n.mode))throw new $.ErrnoError(28);var r=$.nodePermissions(n,`w`);if(r)throw new $.ErrnoError(r);n.node_ops.setattr(n,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var n=$.getStream(e);if(!n)throw new $.ErrnoError(8);if(!(2097155&n.flags))throw new $.ErrnoError(28);$.truncate(n.node,t)},utime:(e,t,n)=>{var r=$.lookupPath(e,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(t,n)})},open:(e,t,n)=>{if(e===``)throw new $.ErrnoError(44);var r;if(n=n===void 0?438:n,n=64&(t=typeof t==`string`?$.modeStringToFlags(t):t)?4095&n|32768:0,typeof e==`object`)r=e;else{e=_U.normalize(e);try{r=$.lookupPath(e,{follow:!(131072&t)}).node}catch{}}var i=!1;if(64&t)if(r){if(128&t)throw new $.ErrnoError(20)}else r=$.mknod(e,n,0),i=!0;if(!r)throw new $.ErrnoError(44);if($.isChrdev(r.mode)&&(t&=-513),65536&t&&!$.isDir(r.mode))throw new $.ErrnoError(54);if(!i){var a=$.mayOpen(r,t);if(a)throw new $.ErrnoError(a)}512&t&&!i&&$.truncate(r,0),t&=-131713;var o=$.createStream({node:r,path:$.getPath(r),flags:t,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return o.stream_ops.open&&o.stream_ops.open(o),!Q.logReadFiles||1&t||($.readFiles||={},e in $.readFiles||($.readFiles[e]=1)),o},close:e=>{if($.isClosed(e))throw new $.ErrnoError(8);e.getdents&&=null;try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{$.closeStream(e.fd)}e.fd=null},isClosed:e=>e.fd===null,llseek:(e,t,n)=>{if($.isClosed(e))throw new $.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new $.ErrnoError(70);if(n!=0&&n!=1&&n!=2)throw new $.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read:(e,t,n,r,i)=>{if(r<0||i<0)throw new $.ErrnoError(28);if($.isClosed(e)||(2097155&e.flags)==1)throw new $.ErrnoError(8);if($.isDir(e.node.mode))throw new $.ErrnoError(31);if(!e.stream_ops.read)throw new $.ErrnoError(28);var a=i!==void 0;if(a){if(!e.seekable)throw new $.ErrnoError(70)}else i=e.position;var o=e.stream_ops.read(e,t,n,r,i);return a||(e.position+=o),o},write:(e,t,n,r,i,a)=>{if(r<0||i<0)throw new $.ErrnoError(28);if($.isClosed(e)||!(2097155&e.flags))throw new $.ErrnoError(8);if($.isDir(e.node.mode))throw new $.ErrnoError(31);if(!e.stream_ops.write)throw new $.ErrnoError(28);e.seekable&&1024&e.flags&&$.llseek(e,0,2);var o=i!==void 0;if(o){if(!e.seekable)throw new $.ErrnoError(70)}else i=e.position;var s=e.stream_ops.write(e,t,n,r,i,a);return o||(e.position+=s),s},allocate:(e,t,n)=>{if($.isClosed(e))throw new $.ErrnoError(8);if(t<0||n<=0)throw new $.ErrnoError(28);if(!(2097155&e.flags))throw new $.ErrnoError(8);if(!$.isFile(e.node.mode)&&!$.isDir(e.node.mode))throw new $.ErrnoError(43);if(!e.stream_ops.allocate)throw new $.ErrnoError(138);e.stream_ops.allocate(e,t,n)},mmap:(e,t,n,r,i)=>{if(2&r&&!(2&i)&&(2097155&e.flags)!=2||(2097155&e.flags)==1)throw new $.ErrnoError(2);if(!e.stream_ops.mmap)throw new $.ErrnoError(43);return e.stream_ops.mmap(e,t,n,r,i)},msync:(e,t,n,r,i)=>e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,i):0,munmap:e=>0,ioctl:(e,t,n)=>{if(!e.stream_ops.ioctl)throw new $.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||`binary`,t.encoding!==`utf8`&&t.encoding!==`binary`)throw Error(`Invalid encoding type "`+t.encoding+`"`);var n,r=$.open(e,t.flags),i=$.stat(e).size,a=new Uint8Array(i);return $.read(r,a,0,i,0),t.encoding===`utf8`?n=YH(a,0):t.encoding===`binary`&&(n=a),$.close(r),n},writeFile:(e,t,n={})=>{n.flags=n.flags||577;var r=$.open(e,n.flags,n.mode);if(typeof t==`string`){var i=new Uint8Array(QH(t)+1),a=ZH(t,i,0,i.length);$.write(r,i,0,a,void 0,n.canOwn)}else{if(!ArrayBuffer.isView(t))throw Error(`Unsupported data type`);$.write(r,t,0,t.byteLength,void 0,n.canOwn)}$.close(r)},cwd:()=>$.currentPath,chdir:e=>{var t=$.lookupPath(e,{follow:!0});if(t.node===null)throw new $.ErrnoError(44);if(!$.isDir(t.node.mode))throw new $.ErrnoError(54);var n=$.nodePermissions(t.node,`x`);if(n)throw new $.ErrnoError(n);$.currentPath=t.path},createDefaultDirectories:()=>{$.mkdir(`/tmp`),$.mkdir(`/home`),$.mkdir(`/home/web_user`)},createDefaultDevices:()=>{$.mkdir(`/dev`),$.registerDevice($.makedev(1,3),{read:()=>0,write:(e,t,n,r,i)=>r}),$.mkdev(`/dev/null`,$.makedev(1,3)),bU.register($.makedev(5,0),bU.default_tty_ops),bU.register($.makedev(6,0),bU.default_tty1_ops),$.mkdev(`/dev/tty`,$.makedev(5,0)),$.mkdev(`/dev/tty1`,$.makedev(6,0)),$.mkdir(`/dev/shm`),$.mkdir(`/dev/shm/tmp`)},createSpecialDirectories:()=>{$.mkdir(`/proc`);var e=$.mkdir(`/proc/self`);$.mkdir(`/proc/self/fd`),$.mount({mount:()=>{var t=$.createNode(e,`fd`,16895,73);return t.node_ops={lookup:(e,t)=>{var n=+t,r=$.getStream(n);if(!r)throw new $.ErrnoError(8);var i={parent:null,mount:{mountpoint:`fake`},node_ops:{readlink:()=>r.path}};return i.parent=i,i}},t}},{},`/proc/self/fd`)},createStandardStreams:()=>{Q.stdin?$.createDevice(`/dev`,`stdin`,Q.stdin):$.symlink(`/dev/tty`,`/dev/stdin`),Q.stdout?$.createDevice(`/dev`,`stdout`,null,Q.stdout):$.symlink(`/dev/tty`,`/dev/stdout`),Q.stderr?$.createDevice(`/dev`,`stderr`,null,Q.stderr):$.symlink(`/dev/tty1`,`/dev/stderr`),$.open(`/dev/stdin`,0),$.open(`/dev/stdout`,1),$.open(`/dev/stderr`,1)},ensureErrnoError:()=>{$.ErrnoError||($.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message=`FS error`},$.ErrnoError.prototype=Error(),$.ErrnoError.prototype.constructor=$.ErrnoError,[44].forEach((e=>{$.genericErrors[e]=new $.ErrnoError(e),$.genericErrors[e].stack=``})))},staticInit:()=>{$.ensureErrnoError(),$.nameTable=Array(4096),$.mount(SU,{},`/`),$.createDefaultDirectories(),$.createDefaultDevices(),$.createSpecialDirectories(),$.filesystems={MEMFS:SU}},init:(e,t,n)=>{$.init.initialized=!0,$.ensureErrnoError(),Q.stdin=e||Q.stdin,Q.stdout=t||Q.stdout,Q.stderr=n||Q.stderr,$.createStandardStreams()},quit:()=>{$.init.initialized=!1;for(var e=0;e<$.streams.length;e++){var t=$.streams[e];t&&$.close(t)}},getMode:(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},findObject:(e,t)=>{var n=$.analyzePath(e,t);return n.exists?n.object:null},analyzePath:(e,t)=>{try{e=(r=$.lookupPath(e,{follow:!t})).path}catch{}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var r=$.lookupPath(e,{parent:!0});n.parentExists=!0,n.parentPath=r.path,n.parentObject=r.node,n.name=_U.basename(e),r=$.lookupPath(e,{follow:!t}),n.exists=!0,n.path=r.path,n.object=r.node,n.name=r.node.name,n.isRoot=r.path===`/`}catch(e){n.error=e.errno}return n},createPath:(e,t,n,r)=>{e=typeof e==`string`?e:$.getPath(e);for(var i=t.split(`/`).reverse();i.length;){var a=i.pop();if(a){var o=_U.join2(e,a);try{$.mkdir(o)}catch{}e=o}}return o},createFile:(e,t,n,r,i)=>{var a=_U.join2(typeof e==`string`?e:$.getPath(e),t),o=$.getMode(r,i);return $.create(a,o)},createDataFile:(e,t,n,r,i,a)=>{var o=t;e&&(e=typeof e==`string`?e:$.getPath(e),o=t?_U.join2(e,t):e);var s=$.getMode(r,i),c=$.create(o,s);if(n){if(typeof n==`string`){for(var l=Array(n.length),u=0,d=n.length;u{var i=_U.join2(typeof e==`string`?e:$.getPath(e),t),a=$.getMode(!!n,!!r);$.createDevice.major||($.createDevice.major=64);var o=$.makedev($.createDevice.major++,0);return $.registerDevice(o,{open:e=>{e.seekable=!1},close:e=>{r&&r.buffer&&r.buffer.length&&r(10)},read:(e,t,r,i,a)=>{for(var o=0,s=0;s{for(var o=0;o{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;throw Error(typeof XMLHttpRequest<`u`?`Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.`:`Cannot load without read() or XMLHttpRequest.`)},createLazyFile:(e,t,n,r,i)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,n=e/this.chunkSize|0;return this.getter(n)[t]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open(`HEAD`,n,!1),e.send(null),!(e.status>=200&&e.status<300||e.status===304))throw Error(`Couldn't load `+n+`. Status: `+e.status);var t,r=Number(e.getResponseHeader(`Content-length`)),i=(t=e.getResponseHeader(`Accept-Ranges`))&&t===`bytes`,a=(t=e.getResponseHeader(`Content-Encoding`))&&t===`gzip`,o=1048576;i||(o=r);var s=this;s.setDataGetter((e=>{var t=e*o,i=(e+1)*o-1;if(i=Math.min(i,r-1),s.chunks[e]===void 0&&(s.chunks[e]=((e,t)=>{if(e>t)throw Error(`invalid range (`+e+`, `+t+`) or no bytes requested!`);if(t>r-1)throw Error(`only `+r+` bytes available! programmer error!`);var i=new XMLHttpRequest;if(i.open(`GET`,n,!1),r!==o&&i.setRequestHeader(`Range`,`bytes=`+e+`-`+t),i.responseType=`arraybuffer`,i.overrideMimeType&&i.overrideMimeType(`text/plain; charset=x-user-defined`),i.send(null),!(i.status>=200&&i.status<300||i.status===304))throw Error(`Couldn't load `+n+`. Status: `+i.status);return i.response===void 0?yU(i.responseText||``,!0):new Uint8Array(i.response||[])})(t,i)),s.chunks[e]===void 0)throw Error(`doXHR failed!`);return s.chunks[e]})),!a&&r||(o=r=1,r=this.getter(0).length,o=r,FH(`LazyFiles on gzip forces download of the whole file when length is accessed`)),this._length=r,this._chunkSize=o,this.lengthKnown=!0},typeof XMLHttpRequest<`u`){if(!AH)throw`Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc`;var o=new a;Object.defineProperties(o,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:o}}else s={isDevice:!1,url:n};var c=$.createFile(e,t,s,r,i);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var l={};function u(e,t,n,r,i){var a=e.node.contents;if(i>=a.length)return 0;var o=Math.min(a.length-i,r);if(a.slice)for(var s=0;s{var t=c.stream_ops[e];l[e]=function(){return $.forceLoadFile(c),t.apply(null,arguments)}})),l.read=(e,t,n,r,i)=>($.forceLoadFile(c),u(e,t,n,r,i)),l.mmap=(e,t,n,r,i)=>{$.forceLoadFile(c);var a=xU();if(!a)throw new $.ErrnoError(48);return u(e,VH,a,t,n),{ptr:a,allocated:!0}},c.stream_ops=l,c},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>`EM_FS_`+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:`FILE_DATA`,saveFilesToDB:(e,t,n)=>{t||=(()=>{}),n||=(()=>{});var r=$.indexedDB();try{var i=r.open($.DB_NAME(),$.DB_VERSION)}catch(e){return n(e)}i.onupgradeneeded=()=>{FH(`creating db`),i.result.createObjectStore($.DB_STORE_NAME)},i.onsuccess=()=>{var r=i.result.transaction([$.DB_STORE_NAME],`readwrite`),a=r.objectStore($.DB_STORE_NAME),o=0,s=0,c=e.length;function l(){s==0?t():n()}e.forEach((e=>{var t=a.put($.analyzePath(e).object.contents,e);t.onsuccess=()=>{++o+s==c&&l()},t.onerror=()=>{s++,o+s==c&&l()}})),r.onerror=n},i.onerror=n},loadFilesFromDB:(e,t,n)=>{t||=(()=>{}),n||=(()=>{});var r=$.indexedDB();try{var i=r.open($.DB_NAME(),$.DB_VERSION)}catch(e){return n(e)}i.onupgradeneeded=n,i.onsuccess=()=>{var r=i.result;try{var a=r.transaction([$.DB_STORE_NAME],`readonly`)}catch(e){n(e);return}var o=a.objectStore($.DB_STORE_NAME),s=0,c=0,l=e.length;function u(){c==0?t():n()}e.forEach((e=>{var t=o.get(e);t.onsuccess=()=>{$.analyzePath(e).exists&&$.unlink(e),$.createDataFile(_U.dirname(e),_U.basename(e),t.result,!0,!0,!0),++s+c==l&&u()},t.onerror=()=>{c++,s+c==l&&u()}})),a.onerror=n},i.onerror=n}},CU={DEFAULT_POLLMASK:5,calculateAt:function(e,t,n){if(_U.isAbs(t))return t;var r=e===-100?$.cwd():CU.getStreamFromFD(e).path;if(t.length==0){if(!n)throw new $.ErrnoError(44);return r}return _U.join2(r,t)},doStat:function(e,t,n){try{var r=e(t)}catch(e){if(e&&e.node&&_U.normalize(t)!==_U.normalize($.getPath(e.node)))return-54;throw e}WH[n>>2]=r.dev,WH[n+8>>2]=r.ino,WH[n+12>>2]=r.mode,GH[n+16>>2]=r.nlink,WH[n+20>>2]=r.uid,WH[n+24>>2]=r.gid,WH[n+28>>2]=r.rdev,sU=[r.size>>>0,(oU=r.size,+Math.abs(oU)>=1?oU>0?(0|Math.min(+Math.floor(oU/4294967296),4294967295))>>>0:~~+Math.ceil((oU-+(~~oU>>>0))/4294967296)>>>0:0)],WH[n+40>>2]=sU[0],WH[n+44>>2]=sU[1],WH[n+48>>2]=4096,WH[n+52>>2]=r.blocks;var i=r.atime.getTime(),a=r.mtime.getTime(),o=r.ctime.getTime();return sU=[Math.floor(i/1e3)>>>0,(oU=Math.floor(i/1e3),+Math.abs(oU)>=1?oU>0?(0|Math.min(+Math.floor(oU/4294967296),4294967295))>>>0:~~+Math.ceil((oU-+(~~oU>>>0))/4294967296)>>>0:0)],WH[n+56>>2]=sU[0],WH[n+60>>2]=sU[1],GH[n+64>>2]=i%1e3*1e3,sU=[Math.floor(a/1e3)>>>0,(oU=Math.floor(a/1e3),+Math.abs(oU)>=1?oU>0?(0|Math.min(+Math.floor(oU/4294967296),4294967295))>>>0:~~+Math.ceil((oU-+(~~oU>>>0))/4294967296)>>>0:0)],WH[n+72>>2]=sU[0],WH[n+76>>2]=sU[1],GH[n+80>>2]=a%1e3*1e3,sU=[Math.floor(o/1e3)>>>0,(oU=Math.floor(o/1e3),+Math.abs(oU)>=1?oU>0?(0|Math.min(+Math.floor(oU/4294967296),4294967295))>>>0:~~+Math.ceil((oU-+(~~oU>>>0))/4294967296)>>>0:0)],WH[n+88>>2]=sU[0],WH[n+92>>2]=sU[1],GH[n+96>>2]=o%1e3*1e3,sU=[r.ino>>>0,(oU=r.ino,+Math.abs(oU)>=1?oU>0?(0|Math.min(+Math.floor(oU/4294967296),4294967295))>>>0:~~+Math.ceil((oU-+(~~oU>>>0))/4294967296)>>>0:0)],WH[n+104>>2]=sU[0],WH[n+108>>2]=sU[1],0},doMsync:function(e,t,n,r,i){if(!$.isFile(t.node.mode))throw new $.ErrnoError(43);if(2&r)return 0;var a=HH.slice(e,e+n);$.msync(t,a,i,n,r)},varargs:void 0,get:function(){return CU.varargs+=4,WH[CU.varargs-4>>2]},getStr:function(e){return XH(e)},getStreamFromFD:function(e){var t=$.getStream(e);if(!t)throw new $.ErrnoError(8);return t}},wU={};function TU(){if(!TU.strings){var e={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(typeof navigator==`object`&&navigator.languages&&navigator.languages[0]||`C`).replace(`-`,`_`)+`.UTF-8`,_:PH||`./this.program`};for(var t in wU)wU[t]===void 0?delete e[t]:e[t]=wU[t];var n=[];for(var t in e)n.push(t+`=`+e[t]);TU.strings=n}return TU.strings}var EU=function(e,t,n,r){e||=this,this.parent=e,this.mount=e.mount,this.mounted=null,this.id=$.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r};Object.defineProperties(EU.prototype,{read:{get:function(){return!(365&~this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return!(146&~this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return $.isDir(this.mode)}},isDevice:{get:function(){return $.isChrdev(this.mode)}}}),$.FSNode=EU,$.staticInit(),Q.FS_createPath=$.createPath,Q.FS_createDataFile=$.createDataFile,Q.FS_unlink=$.unlink,Q.FS_createLazyFile=$.createLazyFile,Q.FS_createDevice=$.createDevice;var DU={g:function(e,t,n,r){fU(`Assertion failed: `+XH(e)+`, at: `+[t?XH(t):`unknown filename`,n,r?XH(r):`unknown function`])},u:function(e,t,n){throw new gU(e).init(t,n),e},d:function(e,t,n){CU.varargs=n;try{var r=CU.getStreamFromFD(e);switch(t){case 0:return(i=CU.get())<0?-28:$.createStream(r,i).fd;case 1:case 2:case 6:case 7:return 0;case 3:return r.flags;case 4:var i=CU.get();return r.flags|=i,0;case 5:return i=CU.get(),UH[i+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return a=28,WH[EW()>>2]=a,-1}}catch(e){if($===void 0||!(e instanceof $.ErrnoError))throw e;return-e.errno}var a},q:function(e,t,n){try{var r=CU.getStreamFromFD(e);r.getdents||=$.readdir(r.path);for(var i=280,a=0,o=$.llseek(r,0,1),s=Math.floor(o/i);s>>0,(oU=c,+Math.abs(oU)>=1?oU>0?(0|Math.min(+Math.floor(oU/4294967296),4294967295))>>>0:~~+Math.ceil((oU-+(~~oU>>>0))/4294967296)>>>0:0)],WH[t+a>>2]=sU[0],WH[t+a+4>>2]=sU[1],sU=[(s+1)*i>>>0,(oU=(s+1)*i,+Math.abs(oU)>=1?oU>0?(0|Math.min(+Math.floor(oU/4294967296),4294967295))>>>0:~~+Math.ceil((oU-+(~~oU>>>0))/4294967296)>>>0:0)],WH[t+a+8>>2]=sU[0],WH[t+a+12>>2]=sU[1],UH[t+a+16>>1]=280,VH[t+a+18|0]=l,ZH(u,HH,t+a+19,256),a+=i,s+=1}return $.llseek(r,s*i,0),a}catch(e){if($===void 0||!(e instanceof $.ErrnoError))throw e;return-e.errno}},h:function(e,t,n){CU.varargs=n;try{var r=CU.getStreamFromFD(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return r.tty?0:-59;case 21519:if(!r.tty)return-59;var i=CU.get();return WH[i>>2]=0,0;case 21520:return r.tty?-28:-59;case 21531:return i=CU.get(),$.ioctl(r,t,i);default:return-28}}catch(e){if($===void 0||!(e instanceof $.ErrnoError))throw e;return-e.errno}},e:function(e,t,n,r){CU.varargs=r;try{t=CU.getStr(t),t=CU.calculateAt(e,t);var i=r?CU.get():0;return $.open(t,n,i).fd}catch(e){if($===void 0||!(e instanceof $.ErrnoError))throw e;return-e.errno}},o:function(e){try{return e=CU.getStr(e),$.rmdir(e),0}catch(e){if($===void 0||!(e instanceof $.ErrnoError))throw e;return-e.errno}},n:function(e,t){try{return e=CU.getStr(e),CU.doStat($.stat,e,t)}catch(e){if($===void 0||!(e instanceof $.ErrnoError))throw e;return-e.errno}},p:function(e,t,n){try{return t=CU.getStr(t),t=CU.calculateAt(e,t),n===0?$.unlink(t):n===512?$.rmdir(t):fU(`Invalid flags passed to unlinkat`),0}catch(e){if($===void 0||!(e instanceof $.ErrnoError))throw e;return-e.errno}},i:function(){return!0},l:function(){fU(``)},f:function(){return Date.now()},j:function(e,t,n){HH.copyWithin(e,t,t+n)},m:function(e){HH.length,fU(`OOM`)},r:function(e,t){var n=0;return TU().forEach((function(r,i){var a=t+n;GH[e+4*i>>2]=a,function(e,t){for(var n=0;n>2]=n.length;var r=0;return n.forEach((function(e){r+=e.length+1})),GH[t>>2]=r,0},b:function(e){try{var t=CU.getStreamFromFD(e);return $.close(t),0}catch(e){if($===void 0||!(e instanceof $.ErrnoError))throw e;return e.errno}},t:function(e,t,n,r){try{var i=function(e,t,n,r){for(var i=0,a=0;a>2],s=GH[t+4>>2];t+=8;var c=$.read(e,VH,o,s,r);if(c<0)return-1;if(i+=c,c>2]=i,0}catch(e){if($===void 0||!(e instanceof $.ErrnoError))throw e;return e.errno}},k:function(e,t,n,r,i){try{var a=(c=n)+2097152>>>0<4194305-!!(s=t)?(s>>>0)+4294967296*c:NaN;if(isNaN(a))return 61;var o=CU.getStreamFromFD(e);return $.llseek(o,a,r),sU=[o.position>>>0,(oU=o.position,+Math.abs(oU)>=1?oU>0?(0|Math.min(+Math.floor(oU/4294967296),4294967295))>>>0:~~+Math.ceil((oU-+(~~oU>>>0))/4294967296)>>>0:0)],WH[i>>2]=sU[0],WH[i+4>>2]=sU[1],o.getdents&&a===0&&r===0&&(o.getdents=null),0}catch(e){if($===void 0||!(e instanceof $.ErrnoError))throw e;return e.errno}var s,c},c:function(e,t,n,r){try{var i=function(e,t,n,r){for(var i=0,a=0;a>2],s=GH[t+4>>2];t+=8;var c=$.write(e,VH,o,s,r);if(c<0)return-1;i+=c}return i}(CU.getStreamFromFD(e),t,n);return GH[r>>2]=i,0}catch(e){if($===void 0||!(e instanceof $.ErrnoError))throw e;return e.errno}},a:LH};(function(){var e,t={a:DU};function n(e,t){Q.asm=e.exports,Q.asm.ua,aU(Q.asm.v),dU()}function r(e){n(e.instance)}if(uU(),Q.instantiateWasm)try{return Q.instantiateWasm(t,n)}catch(e){return IH(`Module.instantiateWasm callback failed with error: `+e),!1}e=r,async function(){return[]}().then((function(e){return RH.instantiate(e,t)})).then((function(e){return e})).then(e,(function(e){IH(`failed to asynchronously prepare wasm: `+e),fU(e)}))})(),Q.___wasm_call_ctors=function(){return(Q.___wasm_call_ctors=Q.asm.v).apply(null,arguments)};var OU=Q._emscripten_bind_VoidPtr___destroy___0=function(){return(OU=Q._emscripten_bind_VoidPtr___destroy___0=Q.asm.w).apply(null,arguments)},kU=Q._emscripten_bind_espeak_VOICE_get_name_0=function(){return(kU=Q._emscripten_bind_espeak_VOICE_get_name_0=Q.asm.x).apply(null,arguments)},AU=Q._emscripten_bind_espeak_VOICE_set_name_1=function(){return(AU=Q._emscripten_bind_espeak_VOICE_set_name_1=Q.asm.y).apply(null,arguments)},jU=Q._emscripten_bind_espeak_VOICE_get_languages_1=function(){return(jU=Q._emscripten_bind_espeak_VOICE_get_languages_1=Q.asm.z).apply(null,arguments)},MU=Q._emscripten_bind_espeak_VOICE_get_identifier_0=function(){return(MU=Q._emscripten_bind_espeak_VOICE_get_identifier_0=Q.asm.A).apply(null,arguments)},NU=Q._emscripten_bind_espeak_VOICE_set_identifier_1=function(){return(NU=Q._emscripten_bind_espeak_VOICE_set_identifier_1=Q.asm.B).apply(null,arguments)},PU=Q._emscripten_bind_espeak_VOICE_get_gender_0=function(){return(PU=Q._emscripten_bind_espeak_VOICE_get_gender_0=Q.asm.C).apply(null,arguments)},FU=Q._emscripten_bind_espeak_VOICE_set_gender_1=function(){return(FU=Q._emscripten_bind_espeak_VOICE_set_gender_1=Q.asm.D).apply(null,arguments)},IU=Q._emscripten_bind_espeak_VOICE_get_age_0=function(){return(IU=Q._emscripten_bind_espeak_VOICE_get_age_0=Q.asm.E).apply(null,arguments)},LU=Q._emscripten_bind_espeak_VOICE_set_age_1=function(){return(LU=Q._emscripten_bind_espeak_VOICE_set_age_1=Q.asm.F).apply(null,arguments)},RU=Q._emscripten_bind_espeak_VOICE_get_variant_0=function(){return(RU=Q._emscripten_bind_espeak_VOICE_get_variant_0=Q.asm.G).apply(null,arguments)},zU=Q._emscripten_bind_espeak_VOICE_set_variant_1=function(){return(zU=Q._emscripten_bind_espeak_VOICE_set_variant_1=Q.asm.H).apply(null,arguments)},BU=Q._emscripten_bind_espeak_VOICE_get_xx1_0=function(){return(BU=Q._emscripten_bind_espeak_VOICE_get_xx1_0=Q.asm.I).apply(null,arguments)},VU=Q._emscripten_bind_espeak_VOICE_set_xx1_1=function(){return(VU=Q._emscripten_bind_espeak_VOICE_set_xx1_1=Q.asm.J).apply(null,arguments)},HU=Q._emscripten_bind_espeak_VOICE_get_score_0=function(){return(HU=Q._emscripten_bind_espeak_VOICE_get_score_0=Q.asm.K).apply(null,arguments)},UU=Q._emscripten_bind_espeak_VOICE_set_score_1=function(){return(UU=Q._emscripten_bind_espeak_VOICE_set_score_1=Q.asm.L).apply(null,arguments)},WU=Q._emscripten_bind_espeak_VOICE_get_spare_0=function(){return(WU=Q._emscripten_bind_espeak_VOICE_get_spare_0=Q.asm.M).apply(null,arguments)},GU=Q._emscripten_bind_espeak_VOICE_set_spare_1=function(){return(GU=Q._emscripten_bind_espeak_VOICE_set_spare_1=Q.asm.N).apply(null,arguments)},KU=Q._emscripten_bind_espeak_VOICE___destroy___0=function(){return(KU=Q._emscripten_bind_espeak_VOICE___destroy___0=Q.asm.O).apply(null,arguments)},qU=Q._emscripten_bind_espeak_EVENT_get_type_0=function(){return(qU=Q._emscripten_bind_espeak_EVENT_get_type_0=Q.asm.P).apply(null,arguments)},JU=Q._emscripten_bind_espeak_EVENT_get_unique_identifier_0=function(){return(JU=Q._emscripten_bind_espeak_EVENT_get_unique_identifier_0=Q.asm.Q).apply(null,arguments)},YU=Q._emscripten_bind_espeak_EVENT_get_text_position_0=function(){return(YU=Q._emscripten_bind_espeak_EVENT_get_text_position_0=Q.asm.R).apply(null,arguments)},XU=Q._emscripten_bind_espeak_EVENT_get_length_0=function(){return(XU=Q._emscripten_bind_espeak_EVENT_get_length_0=Q.asm.S).apply(null,arguments)},ZU=Q._emscripten_bind_espeak_EVENT_get_audio_position_0=function(){return(ZU=Q._emscripten_bind_espeak_EVENT_get_audio_position_0=Q.asm.T).apply(null,arguments)},QU=Q._emscripten_bind_espeak_EVENT_get_sample_0=function(){return(QU=Q._emscripten_bind_espeak_EVENT_get_sample_0=Q.asm.U).apply(null,arguments)},$U=Q._emscripten_bind_espeak_EVENT_get_user_data_0=function(){return($U=Q._emscripten_bind_espeak_EVENT_get_user_data_0=Q.asm.V).apply(null,arguments)},eW=Q._emscripten_bind_espeak_EVENT___destroy___0=function(){return(eW=Q._emscripten_bind_espeak_EVENT___destroy___0=Q.asm.W).apply(null,arguments)},tW=Q._emscripten_bind_eSpeakNGWorker_eSpeakNGWorker_0=function(){return(tW=Q._emscripten_bind_eSpeakNGWorker_eSpeakNGWorker_0=Q.asm.X).apply(null,arguments)},nW=Q._emscripten_bind_eSpeakNGWorker_synth__2=function(){return(nW=Q._emscripten_bind_eSpeakNGWorker_synth__2=Q.asm.Y).apply(null,arguments)},rW=Q._emscripten_bind_eSpeakNGWorker_synth_ipa__2=function(){return(rW=Q._emscripten_bind_eSpeakNGWorker_synth_ipa__2=Q.asm.Z).apply(null,arguments)},iW=Q._emscripten_bind_eSpeakNGWorker_getSizeOfEventStruct__0=function(){return(iW=Q._emscripten_bind_eSpeakNGWorker_getSizeOfEventStruct__0=Q.asm._).apply(null,arguments)},aW=Q._emscripten_bind_eSpeakNGWorker_set_voice_2=function(){return(aW=Q._emscripten_bind_eSpeakNGWorker_set_voice_2=Q.asm.$).apply(null,arguments)},oW=Q._emscripten_bind_eSpeakNGWorker_set_voice_3=function(){return(oW=Q._emscripten_bind_eSpeakNGWorker_set_voice_3=Q.asm.aa).apply(null,arguments)},sW=Q._emscripten_bind_eSpeakNGWorker_set_voice_4=function(){return(sW=Q._emscripten_bind_eSpeakNGWorker_set_voice_4=Q.asm.ba).apply(null,arguments)},cW=Q._emscripten_bind_eSpeakNGWorker_set_voice_5=function(){return(cW=Q._emscripten_bind_eSpeakNGWorker_set_voice_5=Q.asm.ca).apply(null,arguments)},lW=Q._emscripten_bind_eSpeakNGWorker_get_voices_1=function(){return(lW=Q._emscripten_bind_eSpeakNGWorker_get_voices_1=Q.asm.da).apply(null,arguments)},uW=Q._emscripten_bind_eSpeakNGWorker_set_voices_2=function(){return(uW=Q._emscripten_bind_eSpeakNGWorker_set_voices_2=Q.asm.ea).apply(null,arguments)},dW=Q._emscripten_bind_eSpeakNGWorker_get_samplerate_0=function(){return(dW=Q._emscripten_bind_eSpeakNGWorker_get_samplerate_0=Q.asm.fa).apply(null,arguments)},fW=Q._emscripten_bind_eSpeakNGWorker_get_rate_0=function(){return(fW=Q._emscripten_bind_eSpeakNGWorker_get_rate_0=Q.asm.ga).apply(null,arguments)},pW=Q._emscripten_bind_eSpeakNGWorker_set_rate_1=function(){return(pW=Q._emscripten_bind_eSpeakNGWorker_set_rate_1=Q.asm.ha).apply(null,arguments)},mW=Q._emscripten_bind_eSpeakNGWorker_get_pitch_0=function(){return(mW=Q._emscripten_bind_eSpeakNGWorker_get_pitch_0=Q.asm.ia).apply(null,arguments)},hW=Q._emscripten_bind_eSpeakNGWorker_set_pitch_1=function(){return(hW=Q._emscripten_bind_eSpeakNGWorker_set_pitch_1=Q.asm.ja).apply(null,arguments)},gW=Q._emscripten_bind_eSpeakNGWorker___destroy___0=function(){return(gW=Q._emscripten_bind_eSpeakNGWorker___destroy___0=Q.asm.ka).apply(null,arguments)},_W=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_LIST_TERMINATED=function(){return(_W=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_LIST_TERMINATED=Q.asm.la).apply(null,arguments)},vW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_WORD=function(){return(vW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_WORD=Q.asm.ma).apply(null,arguments)},yW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SENTENCE=function(){return(yW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SENTENCE=Q.asm.na).apply(null,arguments)},bW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MARK=function(){return(bW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MARK=Q.asm.oa).apply(null,arguments)},xW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PLAY=function(){return(xW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PLAY=Q.asm.pa).apply(null,arguments)},SW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_END=function(){return(SW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_END=Q.asm.qa).apply(null,arguments)},CW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MSG_TERMINATED=function(){return(CW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_MSG_TERMINATED=Q.asm.ra).apply(null,arguments)},wW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PHONEME=function(){return(wW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_PHONEME=Q.asm.sa).apply(null,arguments)},TW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SAMPLERATE=function(){return(TW=Q._emscripten_enum_espeak_EVENT_TYPE_espeakEVENT_SAMPLERATE=Q.asm.ta).apply(null,arguments)},EW=Q.___errno_location=function(){return(EW=Q.___errno_location=Q.asm.va).apply(null,arguments)};Q._free=function(){return(Q._free=Q.asm.wa).apply(null,arguments)},Q._malloc=function(){return(Q._malloc=Q.asm.xa).apply(null,arguments)};var DW,OW=Q.___cxa_is_pointer_type=function(){return(OW=Q.___cxa_is_pointer_type=Q.asm.ya).apply(null,arguments)};function kW(e){function t(){DW||(DW=!0,Q.calledRun=!0,zH||(iU=!0,Q.noFSInit||$.init.initialized||$.init(),$.ignorePermissions=!1,mU(nU),Q.onRuntimeInitialized&&Q.onRuntimeInitialized(),function(){if(Q.postRun)for(typeof Q.postRun==`function`&&(Q.postRun=[Q.postRun]);Q.postRun.length;)e=Q.postRun.shift(),rU.unshift(e);var e;mU(rU)}()))}cU>0||(function(){if(Q.preRun)for(typeof Q.preRun==`function`&&(Q.preRun=[Q.preRun]);Q.preRun.length;)e=Q.preRun.shift(),tU.unshift(e);var e;mU(tU)}(),cU>0||(Q.setStatus?(Q.setStatus(`Running...`),setTimeout((function(){setTimeout((function(){Q.setStatus(``)}),1),t()}),1)):t()))}if(Q.___start_em_js=132724,Q.___stop_em_js=132822,Q.addRunDependency=uU,Q.removeRunDependency=dU,Q.FS_createPath=$.createPath,Q.FS_createDataFile=$.createDataFile,Q.FS_createLazyFile=$.createLazyFile,Q.FS_createDevice=$.createDevice,Q.FS_unlink=$.unlink,lU=function e(){DW||kW(),DW||(lU=e)},Q.preInit)for(typeof Q.preInit==`function`&&(Q.preInit=[Q.preInit]);Q.preInit.length>0;)Q.preInit.pop()();function AW(){}function jW(e){return(e||AW).__cache__}function MW(e,t){var n=jW(t),r=n[e];return r||((r=Object.create((t||AW).prototype)).ptr=e,n[e]=r)}kW(),AW.prototype=Object.create(AW.prototype),AW.prototype.constructor=AW,AW.prototype.__class__=AW,AW.__cache__={},Q.WrapperObject=AW,Q.getCache=jW,Q.wrapPointer=MW,Q.castObject=function(e,t){return MW(e.ptr,t)},Q.NULL=MW(0),Q.destroy=function(e){if(!e.__destroy__)throw`Error: Cannot destroy object. (Did you create it yourself?)`;e.__destroy__(),delete jW(e.__class__)[e.ptr]},Q.compare=function(e,t){return e.ptr===t.ptr},Q.getPointer=function(e){return e.ptr},Q.getClass=function(e){return e.__class__};var NW={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(NW.needed){for(var e=0;e=NW.size?(BH(i>0),NW.needed+=i,n=Q._malloc(i),NW.temps.push(n)):(n=NW.buffer+NW.pos,NW.pos+=i),n},copy:function(e,t,n){switch(n>>>=0,t.BYTES_PER_ELEMENT){case 2:n>>>=1;break;case 4:n>>>=2;break;case 8:n>>>=3}for(var r=0;r{Q.calledRun?e(new Q.eSpeakNGWorker):Q.onRuntimeInitialized=()=>e(new Q.eSpeakNGWorker)})),VW=[`en`],HW=BW.then((e=>{let t=e.list_voices().map((({name:e,identifier:t,languages:n})=>({name:e,identifier:t,languages:n.filter((e=>VW.includes(e.name.split(`-`)[0])))}))).filter((e=>e.languages.length>0)),n=new Set;for(let e of t){n.add(e.identifier);for(let t of e.languages)n.add(t.name)}return{voices:t,identifiers:n}})),UW=async(e,t=`en-us`)=>{let n=await BW,{identifiers:r}=await HW;if(!r.has(t))throw Error(`Invalid language identifier: "${t}". Should be one of: ${Array.from(r).toSorted().join(`, `)}.`);return n.set_voice(t),n.synthesize_ipa(e).ipa?.split(` +`).filter((e=>e.length>0))??[]};var WW=l(o(((e,t)=>{t.exports={}}))(),1);function GW(e){if(e.includes(`.`))return e;if(e.includes(`:`)){let[t,n]=e.split(`:`).map(Number);return n===0?`${t} o'clock`:n<10?`${t} oh ${n}`:`${t} ${n}`}let t=parseInt(e.slice(0,4),10);if(t<1100||t%1e3<10)return e;let n=e.slice(0,2),r=parseInt(e.slice(2,4),10),i=e.endsWith(`s`)?`s`:``;if(t%1e3>=100&&t%1e3<=999){if(r===0)return`${n} hundred${i}`;if(r<10)return`${n} oh ${r}${i}`}return`${n} ${r}${i}`}function KW(e){let t=e[0]===`$`?`dollar`:`pound`;if(isNaN(Number(e.slice(1))))return`${e.slice(1)} ${t}s`;if(!e.includes(`.`)){let n=e.slice(1)===`1`?``:`s`;return`${e.slice(1)} ${t}${n}`}let[n,r]=e.slice(1).split(`.`),i=parseInt(r.padEnd(2,`0`),10);return`${n} ${t}${n===`1`?``:`s`} and ${i} ${e[0]===`$`?i===1?`cent`:`cents`:i===1?`penny`:`pence`}`}function qW(e){let[t,n]=e.split(`.`);return`${t} point ${n.split(``).join(` `)}`}let JW=RegExp(`(\\s*[${YW=`;:,.!?¡¿—…"«»“”(){}[]`,YW.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}]+\\s*)+`,`g`);var YW;async function XW(e,t=`a`,n=!0){n&&(e=function(e){return e.replace(/[‘’]/g,`'`).replace(/«/g,`“`).replace(/»/g,`”`).replace(/[“”]/g,`"`).replace(/\(/g,`«`).replace(/\)/g,`»`).replace(/、/g,`, `).replace(/。/g,`. `).replace(/!/g,`! `).replace(/,/g,`, `).replace(/:/g,`: `).replace(/;/g,`; `).replace(/?/g,`? `).replace(/[^\S \n]/g,` `).replace(/ +/,` `).replace(/(?<=\n) +(?=\n)/g,``).replace(/\bD[Rr]\.(?= [A-Z])/g,`Doctor`).replace(/\b(?:Mr\.|MR\.(?= [A-Z]))/g,`Mister`).replace(/\b(?:Ms\.|MS\.(?= [A-Z]))/g,`Miss`).replace(/\b(?:Mrs\.|MRS\.(?= [A-Z]))/g,`Mrs`).replace(/\betc\.(?! [A-Z])/gi,`etc`).replace(/\b(y)eah?\b/gi,`$1e'a`).replace(/\d*\.\d+|\b\d{4}s?\b|(?e.replace(/\./g,`-`))).replace(/(?<=[A-Z])\.(?=[A-Z])/gi,`-`).trim()}(e));let r=function(e,t){let n=[],r=0;for(let i of e.matchAll(t)){let t=i[0];r0&&n.push({match:!0,text:t}),r=i.index+t.length}return re?t:(await UW(t,i)).join(` `))))).join(``).replace(/kəkˈoːɹoʊ/g,`kˈoʊkəɹoʊ`).replace(/kəkˈɔːɹəʊ/g,`kˈəʊkəɹəʊ`).replace(/ʲ/g,`j`).replace(/r/g,`ɹ`).replace(/x/g,`k`).replace(/ɬ/g,`l`).replace(/(?<=[a-zɹː])(?=hˈʌndɹɪd)/g,` `).replace(/ z(?=[;:,.!?¡¿—…"«»“” ]|$)/g,`z`);return t===`a`&&(a=a.replace(/(?<=nˈaɪn)ti(?!ː)/g,`di`)),a.trim()}function ZW(e,t=!0){return`.!?…。?!`.includes(e)||t&&e===` +`}function QW(e,t){let n=t;for(;n0&&n0&&this._sentences.push(e),this._buffer=``,this._resolve()}_resolve(){this._resolver&&=(this._resolver(),null)}_process(){let e=0,t=this._buffer,n=t.length,r=0,i=[],a=e=>{let r=e;for(;r+1=0&&/\S/.test(t[l]);)l--;l=Math.max(e,l+1);let u=QW(t,l);if(!u){++r;continue}if((/https?[,:]\/\//.test(u)||u.includes(`@`))&&!ZW(u.at(-1))){r=l+u.length;continue}if(eG(u)){++r;continue}if(/^([A-Za-z]\.)+$/.test(u)&&c0&&this._resolve()}async*[Symbol.asyncIterator](){if(this._resolver)throw Error(`Another iterator is already active.`);for(;;)if(this._sentences.length>0)yield this._sentences.shift();else{if(this._closed)break;await new Promise((e=>{this._resolver=e}))}}[Symbol.iterator](){this.flush();let e=this._sentences[Symbol.iterator]();return this._sentences=[],e}get sentences(){return this._sentences}};let aG=Object.freeze({af_heart:{name:`Heart`,language:`en-us`,gender:`Female`,traits:`❤️`,targetQuality:`A`,overallGrade:`A`},af_alloy:{name:`Alloy`,language:`en-us`,gender:`Female`,targetQuality:`B`,overallGrade:`C`},af_aoede:{name:`Aoede`,language:`en-us`,gender:`Female`,targetQuality:`B`,overallGrade:`C+`},af_bella:{name:`Bella`,language:`en-us`,gender:`Female`,traits:`🔥`,targetQuality:`A`,overallGrade:`A-`},af_jessica:{name:`Jessica`,language:`en-us`,gender:`Female`,targetQuality:`C`,overallGrade:`D`},af_kore:{name:`Kore`,language:`en-us`,gender:`Female`,targetQuality:`B`,overallGrade:`C+`},af_nicole:{name:`Nicole`,language:`en-us`,gender:`Female`,traits:`🎧`,targetQuality:`B`,overallGrade:`B-`},af_nova:{name:`Nova`,language:`en-us`,gender:`Female`,targetQuality:`B`,overallGrade:`C`},af_river:{name:`River`,language:`en-us`,gender:`Female`,targetQuality:`C`,overallGrade:`D`},af_sarah:{name:`Sarah`,language:`en-us`,gender:`Female`,targetQuality:`B`,overallGrade:`C+`},af_sky:{name:`Sky`,language:`en-us`,gender:`Female`,targetQuality:`B`,overallGrade:`C-`},am_adam:{name:`Adam`,language:`en-us`,gender:`Male`,targetQuality:`D`,overallGrade:`F+`},am_echo:{name:`Echo`,language:`en-us`,gender:`Male`,targetQuality:`C`,overallGrade:`D`},am_eric:{name:`Eric`,language:`en-us`,gender:`Male`,targetQuality:`C`,overallGrade:`D`},am_fenrir:{name:`Fenrir`,language:`en-us`,gender:`Male`,targetQuality:`B`,overallGrade:`C+`},am_liam:{name:`Liam`,language:`en-us`,gender:`Male`,targetQuality:`C`,overallGrade:`D`},am_michael:{name:`Michael`,language:`en-us`,gender:`Male`,targetQuality:`B`,overallGrade:`C+`},am_onyx:{name:`Onyx`,language:`en-us`,gender:`Male`,targetQuality:`C`,overallGrade:`D`},am_puck:{name:`Puck`,language:`en-us`,gender:`Male`,targetQuality:`B`,overallGrade:`C+`},am_santa:{name:`Santa`,language:`en-us`,gender:`Male`,targetQuality:`C`,overallGrade:`D-`},bf_emma:{name:`Emma`,language:`en-gb`,gender:`Female`,traits:`🚺`,targetQuality:`B`,overallGrade:`B-`},bf_isabella:{name:`Isabella`,language:`en-gb`,gender:`Female`,targetQuality:`B`,overallGrade:`C`},bm_george:{name:`George`,language:`en-gb`,gender:`Male`,targetQuality:`B`,overallGrade:`C`},bm_lewis:{name:`Lewis`,language:`en-gb`,gender:`Male`,targetQuality:`C`,overallGrade:`D+`},bf_alice:{name:`Alice`,language:`en-gb`,gender:`Female`,traits:`🚺`,targetQuality:`C`,overallGrade:`D`},bf_lily:{name:`Lily`,language:`en-gb`,gender:`Female`,traits:`🚺`,targetQuality:`C`,overallGrade:`D`},bm_daniel:{name:`Daniel`,language:`en-gb`,gender:`Male`,traits:`🚹`,targetQuality:`C`,overallGrade:`D`},bm_fable:{name:`Fable`,language:`en-gb`,gender:`Male`,traits:`🚹`,targetQuality:`B`,overallGrade:`C`}}),oG=new Map;async function sG(e){if(oG.has(e))return oG.get(e);let t=new Float32Array(await async function(e){if(WW.default&&Object.hasOwn(WW.default,`readFile`)){let t=typeof __dirname<`u`?__dirname:{}.dirname,n=WW.default.resolve(t,`../voices/${e}.bin`),{buffer:r}=await WW.default.readFile(n);return r}let t=`https://huggingface.co/onnx-community/Kokoro-82M-v1.0-ONNX/resolve/main/voices/${e}.bin`,n;try{n=await caches.open(`kokoro-voices`);let e=await n.match(t);if(e)return await e.arrayBuffer()}catch(e){console.warn(`Unable to open cache`,e)}let r=await fetch(t),i=await r.arrayBuffer();if(n)try{await n.put(t,new Response(i,{headers:r.headers}))}catch(e){console.warn(`Unable to cache file`,e)}return i}(e));return oG.set(e,t),t}var cG=class e{constructor(e,t){this.model=e,this.tokenizer=t}static async from_pretrained(t,{dtype:n=`fp32`,device:r=null,progress_callback:i=null}={}){let a=OH.from_pretrained(t,{progress_callback:i,dtype:n,device:r}),o=EH.from_pretrained(t,{progress_callback:i});return new e(...await Promise.all([a,o]))}get voices(){return aG}list_voices(){console.table(aG)}_validate_voice(e){if(!aG.hasOwnProperty(e))throw console.error(`Voice "${e}" not found. Available voices:`),console.table(aG),Error(`Voice "${e}" not found. Should be one of: ${Object.keys(aG).join(`, `)}.`);return e.at(0)}async generate(e,{voice:t=`af_heart`,speed:n=1}={}){let r=await XW(e,this._validate_voice(t)),{input_ids:i}=this.tokenizer(r,{truncation:!0});return this.generate_from_ids(i,{voice:t,speed:n})}async generate_from_ids(e,{voice:t=`af_heart`,speed:n=1}={}){let r=256*Math.min(Math.max(e.dims.at(-1)-2,0),509),i={input_ids:e,style:new kH(`float32`,(await sG(t)).slice(r,r+256),[1,256]),speed:new kH(`float32`,[n],[1])},{waveform:a}=await this.model(i);return new DH(a.data,24e3)}async*stream(e,{voice:t=`af_heart`,speed:n=1,split_pattern:r=null}={}){let i=this._validate_voice(t),a;if(e instanceof iG)a=e;else{if(typeof e!=`string`)throw Error(`Invalid input type. Expected string or TextSplitterStream.`);{a=new iG;let t=r?e.split(r).map((e=>e.trim())).filter((e=>e.length>0)):[e];a.push(...t)}}for await(let e of a){let r=await XW(e,i),{input_ids:a}=this.tokenizer(r,{truncation:!0});yield{text:e,phonemes:r,audio:await this.generate_from_ids(a,{voice:t,speed:n})}}}};di.useBrowserCache=!0,di.allowLocalModels=!1;let lG=null,uG=null,dG=null,fG=(e,t)=>self.postMessage(e,t??[]);async function pG(){let e=e=>fG({type:`progress`,data:e});lG??=await aA(`automatic-speech-recognition`,`onnx-community/moonshine-tiny-ONNX`,{device:`webgpu`,dtype:{encoder_model:`fp32`,decoder_model_merged:`q4`},progress_callback:e}),uG??=await cG.from_pretrained(`onnx-community/Kokoro-82M-v1.0-ONNX`,{dtype:`fp32`,device:`webgpu`,progress_callback:e}),fG({type:`ready`})}self.addEventListener(`message`,async e=>{let{type:t,data:n}=e.data??{};try{if(t===`load`)await pG();else if(t===`transcribe`){if(!lG)throw Error(`STT not loaded`);let e=await lG(n.audio),t=(Array.isArray(e)?e[0]?.text:e?.text)??``;fG({type:`transcript`,text:String(t).trim()})}else if(t===`tts-start`){if(!uG)throw Error(`TTS not loaded`);dG=new iG;let e=uG.stream(dG,{voice:n?.voice??`af_heart`});(async()=>{try{for await(let{audio:t}of e){let e=t.audio;fG({type:`tts-chunk`,pcm:e,rate:t.sampling_rate},[e.buffer])}}catch(e){fG({type:`error`,data:String(e?.message??e)})}finally{fG({type:`tts-done`})}})()}else t===`tts-push`?dG?.push(String(n?.text??``)):t===`tts-close`&&dG?.close()}catch(e){fG({type:`error`,data:String(e?.message??e)})}})})(); \ No newline at end of file diff --git a/sites/demo/public/favicon.svg b/sites/demo/dist/favicon.svg similarity index 100% rename from sites/demo/public/favicon.svg rename to sites/demo/dist/favicon.svg diff --git a/sites/demo/index.html b/sites/demo/dist/index.html similarity index 65% rename from sites/demo/index.html rename to sites/demo/dist/index.html index 4412dcb9..7ba1315c 100644 --- a/sites/demo/index.html +++ b/sites/demo/dist/index.html @@ -2,16 +2,17 @@ - + ORBIS — Browser Preview + +

- diff --git a/sites/demo/package.json b/sites/demo/package.json deleted file mode 100644 index 5a7d705e..00000000 --- a/sites/demo/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "orbis-demo", - "private": true, - "version": "0.1.0", - "type": "module", - "scripts": { - "dev": "vite", - "build": "vite build", - "preview": "vite preview" - }, - "//": "Runtime deps mirror web/package.json so the real app source (aliased via @ -> ../../web/src) bundles cleanly. The @tauri-apps/* packages are intentionally absent — every entrypoint the app imports is aliased to src/tauri-shim/* instead (see vite.config.ts). A missing alias therefore fails the build loudly rather than resolving to a real Tauri call that throws at runtime.", - "dependencies": { - "@fontsource-variable/geist": "^5.2.8", - "@huggingface/transformers": "^4.2.0", - "@protolabsai/design": "^0.5.0", - "@protolabsai/ui": "^0.26.2", - "@react-three/drei": "^10.7.7", - "@react-three/fiber": "^9.6.0", - "@react-three/postprocessing": "^3.0.4", - "class-variance-authority": "^0.7.1", - "clsx": "^2.1.1", - "kokoro-js": "^1.2.1", - "lucide-react": "^1.8.0", - "postprocessing": "^6.39.1", - "radix-ui": "^1.4.3", - "react": "^19.2.5", - "react-dom": "^19.2.5", - "react-markdown": "^9", - "remark-gfm": "^4", - "shadcn": "^4.4.0", - "tailwind-merge": "^3.5.0", - "three": "^0.184.0", - "tw-animate-css": "^1.4.0" - }, - "devDependencies": { - "@tailwindcss/vite": "^4.2.4", - "@types/node": "^24.12.2", - "@types/react": "^19.2.14", - "@types/react-dom": "^19.2.3", - "@types/three": "^0.184.0", - "@vitejs/plugin-react": "^6.0.1", - "tailwindcss": "^4.2.4", - "typescript": "~6.0.2", - "vite": "^8.0.9", - "vite-plugin-glsl": "^1.6.0" - } -} diff --git a/sites/demo/src/backend/router.ts b/sites/demo/src/backend/router.ts deleted file mode 100644 index ba91c49e..00000000 --- a/sites/demo/src/backend/router.ts +++ /dev/null @@ -1,134 +0,0 @@ -/** - * In-browser stand-in for the Python sidecar's /api/* surface. - * - * The real ORBIS frontend (web/src) only ever talks to its backend through - * invoke('api_request', …) — never fetch (a deliberate Tauri-only choice; - * see web/src/lib/api.ts). Here we answer those calls with local, canned - * data so the mirrored app boots straight into the live UI with no server. - * - * PR1 keeps this read-mostly: GETs return sensible defaults, writes are - * accepted and echoed. The conversational brain is scripted (mockEngine); - * PR2 wires the on-device LLM in front of these same routes. - */ -import type { OrbisConfig } from '@/lib/api'; - -export interface ApiRequestArgs { - method: string; - path: string; - body: string | null; - headers?: Record; -} - -export interface ApiResponse { - status: number; - body: string; -} - -function ok(data: unknown): ApiResponse { - return { status: 200, body: JSON.stringify(data) }; -} - -// The setup-wizard orb pool, mirrored from config/starter_orbs.yaml. Each -// is a complete (variant, palette) pair — the palette's defaults render a -// visible orb, so params can stay empty. -const STARTERS = [ - { slug: 'aurora', name: 'Aurora', description: 'Shifting green-blue light, patient and wide.', variant: 'fractal', palette: 'Aurora', params: {} }, - { slug: 'ember', name: 'Ember', description: 'Warm crackling light with hot core.', variant: 'fractal', palette: 'Ember', params: {} }, - { slug: 'forest', name: 'Forest', description: 'Green-gold canopy light, deep and settled.', variant: 'fractal', palette: 'Forest', params: {} }, - { slug: 'andromeda', name: 'Andromeda', description: 'Deep cosmic clouds with drifting dust.', variant: 'nebula', palette: 'Andromeda', params: {} }, - { slug: 'helios', name: 'Helios', description: 'Solar and radiant, humming with energy.', variant: 'nebula', palette: 'Helios', params: {} }, - { slug: 'prism', name: 'Prism', description: 'Faceted refracted light, crystalline and bright.', variant: 'crystal', palette: 'Prism', params: {} }, - { slug: 'obsidian', name: 'Obsidian', description: 'Sharp and dark with hidden edges.', variant: 'crystal', palette: 'Obsidian', params: {} }, - { slug: 'constellation', name: 'Constellation', description: 'Scattered stars in slow orbit.', variant: 'particles', palette: 'Constellation', params: {} }, -]; - -// The demo's persistent-enough config. setup.complete=true skips the -// first-run wizard; orb seeds the visible orb. Edits made in Settings are -// merged here for the session (lost on reload — no server, by design). -let config: OrbisConfig = { - persona: { slug: 'orbis', name: 'Orbis', user_name: 'You', filler_verbosity: 'narrated' }, - voice: { tts_backend: 'kokoro', voice: 'af_heart', local_models: 'on_device' }, - llm: { model: 'gemma-4-e2b (on-device)' }, - stt: { backend: 'local', whisper_model: 'whisper-base' }, - // variant + palette are BOTH required — applyPreset(palette) is what - // fills the shader params; without a palette the orb renders invisible. - orb: { variant: 'fractal', palette: 'Aurora' }, - wakeword: { enabled: false }, - setup: { complete: true }, - agent: { allow_orb_control: true }, -}; - -function mergeConfig(patch: Partial): void { - config = { ...config, ...patch }; -} - -export async function httpRequest(args: ApiRequestArgs): Promise { - const { method, path, body } = args; - const p = path.split('?')[0]; - - if (method === 'GET') { - switch (p) { - case '/api/whoami': - return ok({ id: 'you', display_name: 'You', auth_source: 'empty' }); - case '/api/config': - return ok({ config }); - case '/api/verbosity': - return ok({ verbosity: config.persona?.filler_verbosity ?? 'narrated' }); - case '/api/personality': - return ok({ - axes: [], - mood: null, - recent_events: [], - sessions: { count: 0, last_ended_at: null }, - }); - case '/api/starter_orbs': - return ok({ starters: STARTERS }); - case '/api/orbs': - return ok({ orbs: [] }); - case '/api/reminders': - return ok({ ok: true, reminders: [] }); - case '/api/delegates': - return ok({ delegates: [] }); - case '/api/delegate-types': - return ok({ types: [] }); - case '/api/wakeword/models': - return ok({ models: [] }); - case '/api/llm/detect_local': - return ok({}); - default: - return ok({}); - } - } - - // Writes: accept and echo so the UI's optimistic flows succeed. - if (method === 'POST' || method === 'PUT') { - let parsed: unknown = undefined; - if (body) { - try { - parsed = JSON.parse(body); - } catch { - /* ignore */ - } - } - if (p === '/api/config') { - if (parsed && typeof parsed === 'object') mergeConfig(parsed as Partial); - return ok({ ok: true, config }); - } - if (p === '/api/orb/select_starter') { - const slug = (parsed as { slug?: string } | undefined)?.slug; - const starter = STARTERS.find((s) => s.slug === slug); - if (starter) { - config = { ...config, orb: { variant: starter.variant, palette: starter.palette } }; - return ok({ ok: true, starter }); - } - return { status: 404, body: JSON.stringify({ ok: false, error: 'unknown starter' }) }; - } - return ok({ ok: true }); - } - - if (method === 'DELETE') { - return ok({ ok: true }); - } - - return ok({}); -} diff --git a/sites/demo/src/components/DemoComposer.tsx b/sites/demo/src/components/DemoComposer.tsx deleted file mode 100644 index 9ffe16df..00000000 --- a/sites/demo/src/components/DemoComposer.tsx +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Voice-first demo control (a sibling of , so web/src stays untouched). - * - * One affordance: tap to talk. First tap primes mic permission, downloads - * the on-device models (brain + voice) with a progress label, then listens; - * after that it's just tap → talk → it replies out loud. Double-clicking the - * orb does the same (via the app's set_mic_listening). Typing is a thin - * fallback that runs the identical pipeline and speaks the reply too. - */ -import { useEffect, useState, type FormEvent } from 'react'; -import { Mic, Square, Loader2 } from 'lucide-react'; -import { voiceEngine } from '../engine/voiceEngine'; -import { hasWebGPU } from '../engine/webgpu'; -import { useVoiceStateSelector } from '@/voice/hooks'; - -export function DemoComposer() { - const [supported] = useState(hasWebGPU); - const [progress, setProgress] = useState<{ label: string; pct: number | null } | null>(null); - const [preparing, setPreparing] = useState(false); - const [text, setText] = useState(''); - const state = useVoiceStateSelector((s) => s.state); - const listening = state === 'listening'; - const busy = state === 'thinking' || state === 'speaking'; - - useEffect(() => { - voiceEngine.onProgress = (label, pct) => setProgress(pct === 100 ? null : { label, pct }); - return () => { - voiceEngine.onProgress = null; - }; - }, []); - - const wrap = - 'fixed bottom-14 left-1/2 -translate-x-1/2 z-50 flex flex-col items-center gap-2 w-[min(34rem,92vw)]'; - - if (!supported) { - return ( - - ); - } - - const tap = async () => { - if (busy) return; - setPreparing(true); - try { - await voiceEngine.activate(); - } finally { - setPreparing(false); - setProgress(null); - } - }; - - const submit = async (e: FormEvent) => { - e.preventDefault(); - const t = text.trim(); - if (!t || busy || listening) return; - setText(''); - setPreparing(true); - try { - await voiceEngine.submitText(t); - } finally { - setPreparing(false); - setProgress(null); - } - }; - - const loading = !!progress || (preparing && !listening && !busy); - const label = progress - ? `${progress.label}${progress.pct != null ? ` ${Math.round(progress.pct)}%` : ''}` - : listening - ? 'Listening — tap to stop' - : state === 'thinking' - ? 'Thinking…' - : state === 'speaking' - ? 'Speaking…' - : preparing - ? 'Preparing…' - : 'Tap to talk'; - - const Icon = loading || busy ? Loader2 : listening ? Square : Mic; - - return ( -
- - -
- setText(e.target.value)} - disabled={busy || listening} - placeholder="…or type to Orbis" - className="w-full rounded-full border border-white/10 bg-black/50 px-4 py-2 text-center text-xs text-white placeholder:text-zinc-600 backdrop-blur outline-none focus:border-indigo-400/50 disabled:opacity-50" - /> -
-

- {loading - ? 'one-time download — cached after this, then instant' - : 'on-device · nothing leaves your machine · or double-click the orb'} -

-
- ); -} diff --git a/sites/demo/src/components/DemoPanel.tsx b/sites/demo/src/components/DemoPanel.tsx deleted file mode 100644 index 7a51848c..00000000 --- a/sites/demo/src/components/DemoPanel.tsx +++ /dev/null @@ -1,110 +0,0 @@ -/** - * The demo's single minimal panel — system info + links. - * - * No audio-device pickers: the browser/OS already routes to the default mic - * and speaker, and in-page routing (getUserMedia deviceId / setSinkId) is - * flaky across browsers, so we defer to the system default. This panel just - * surfaces what's running and where to get the full app. - */ -import { useEffect, useState } from 'react'; -import { Settings2, X } from 'lucide-react'; -import { getWebGPUInfo } from '../engine/webgpu'; -import { voiceEngine } from '../engine/voiceEngine'; -import { gemmaEngine } from '../engine/gemmaEngine'; - -const REPO_URL = 'https://github.com/protoLabsAI/ORBIS'; -const ORG_URL = 'https://protolabs.studio'; - -export function DemoPanel() { - const [open, setOpen] = useState(false); - const [gpu, setGpu] = useState<{ supported: boolean; adapter?: string }>({ supported: false }); - - useEffect(() => { - void getWebGPUInfo().then(setGpu); - }, []); - - const brainReady = gemmaEngine.isLoaded; - const voiceReady = voiceEngine.voiceReady; - - return ( - <> - - - {open && ( -
-
- System - -
- -
- - {gpu.adapter && ( -
- GPU - {gpu.adapter} -
- )} - - -

- Everything runs on your device — nothing leaves it. Audio uses your system's default - mic & speaker. Speed depends on your GPU; this in-browser preview isn't - representative of the native app. -

-
- - {/* CTA — the full, more powerful version */} -
-

Want the full, more powerful version?

- -
- - {/* About */} - -
- )} - - ); -} - -function Row({ label, value, good }: { label: string; value: string; good: boolean }) { - return ( -
- {label} - {value} -
- ); -} diff --git a/sites/demo/src/components/IntroDialog.tsx b/sites/demo/src/components/IntroDialog.tsx deleted file mode 100644 index 7191a6fe..00000000 --- a/sites/demo/src/components/IntroDialog.tsx +++ /dev/null @@ -1,101 +0,0 @@ -/** - * One-per-session intro. Explains what the demo is and — importantly — that - * the first tap downloads the on-device models (so the ~730 MB pull isn't a - * surprise). Gated on sessionStorage so it shows once per tab session. - */ -import { useState } from 'react'; -import { Brain, Ear, Volume2 } from 'lucide-react'; - -const SESSION_KEY = 'orbis-demo-intro-seen'; - -const MODELS = [ - { Icon: Brain, label: 'Brain', sub: 'Gemma · language model', size: '~500 MB' }, - { Icon: Ear, label: 'Ears', sub: 'Moonshine · speech-to-text', size: '~60 MB' }, - { Icon: Volume2, label: 'Voice', sub: 'Kokoro · text-to-speech', size: '~80 MB' }, -]; - -export function IntroDialog() { - const [open, setOpen] = useState(() => { - try { - return sessionStorage.getItem(SESSION_KEY) !== '1'; - } catch { - return true; - } - }); - - if (!open) return null; - - const dismiss = () => { - try { - sessionStorage.setItem(SESSION_KEY, '1'); - } catch { - /* private mode — just close for this view */ - } - setOpen(false); - }; - - return ( -
-
e.stopPropagation()} - className="w-[min(30rem,92vw)] rounded-2xl border border-white/10 bg-zinc-950/95 p-6 text-zinc-200 shadow-2xl" - > -
- Browser preview -
-

Meet your first orb

-

- A taste of ORBIS running 100% on your device — you - talk, a local model thinks, and it answers out loud. Nothing leaves your machine. -

- -
-

- The first time you tap to talk, three on-device models download once, then cache for - instant loads after: -

-
    - {MODELS.map(({ Icon, label, sub, size }) => ( -
  • - - - - - {label}{' '} - · {sub} - - {size} -
  • - ))} -
-

- ~640 MB total · requires WebGPU (Chrome, Edge, or Safari 26+) -

-
- -

- It runs smaller models in your browser, so speed depends on your GPU — this preview isn't - representative of the native Mac app's performance. -

- - - - Built by protoLabs.studio ↗ - -
-
- ); -} diff --git a/sites/demo/src/demo/DemoApp.tsx b/sites/demo/src/demo/DemoApp.tsx deleted file mode 100644 index 4ec8cb87..00000000 --- a/sites/demo/src/demo/DemoApp.tsx +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Lightweight "my first orb" shell — the demo's own chrome instead of the - * full app Drawer (delegates / wake-word / brain / personality settings are - * gutted; they don't belong in a browser taste). Still the REAL orb engine - * + voice bridge, so the orb looks and reacts exactly like the app — just - * wrapped in a minimal surface: orb, a transcript line, the tap-to-talk - * control, and one small settings panel. - */ -import { useEffect } from 'react'; -import { useVoiceBridge } from '@/voice/useVoiceBridge'; -import { OrbStage } from '@/plugins/orb/OrbStage'; -import { loadOrbOverrides } from '@/plugins/orb/configDriver'; -import { useVoiceStateSelector } from '@/voice/hooks'; -import { DemoComposer } from '../components/DemoComposer'; -import { DemoPanel } from '../components/DemoPanel'; -import { IntroDialog } from '../components/IntroDialog'; - -function Transcript() { - // Voice-first: the orb speaks the reply, so we only print what the user - // said (handy to confirm what was heard) — not the bot's response text. - const userText = useVoiceStateSelector((s) => s.lastUserTranscript); - return ( -
- {userText &&

“{userText}”

} -
- ); -} - -export function DemoApp() { - useVoiceBridge(); // orb + transcript react to the in-browser engine's events - useEffect(() => { - void loadOrbOverrides(); // seed orb variant/palette from the canned config - }, []); - - return ( -
- - - - - -
- ); -} diff --git a/sites/demo/src/engine/audio.ts b/sites/demo/src/engine/audio.ts deleted file mode 100644 index d65514ea..00000000 --- a/sites/demo/src/engine/audio.ts +++ /dev/null @@ -1,226 +0,0 @@ -/** - * Browser audio I/O for the voice loop. - * - * Capture: getUserMedia → 16 kHz mono Float32 PCM (what Moonshine/Whisper - * want), with an AnalyserNode feeding levels.mic so the orb pulses while - * you talk. Playback: Kokoro's Float32 → an AudioBuffer with an - * AnalyserNode feeding levels.playback so the orb pulses while it speaks. - */ -import { setMic, setPlayback } from './levels'; - -function rms(buf: Float32Array): number { - let sum = 0; - for (let i = 0; i < buf.length; i++) sum += buf[i] * buf[i]; - return Math.sqrt(sum / buf.length); -} - -// ---- Mic capture (16 kHz mono Float32) ---- -interface Capture { - ctx: AudioContext; - stream: MediaStream; - node: ScriptProcessorNode; - analyser: AnalyserNode; - chunks: Float32Array[]; - raf: number; -} -let cap: Capture | null = null; - -/** Request mic permission within a user gesture (then release). Lets us - * open the mic later, post-model-load, without a fresh gesture. */ -export async function primeMicPermission(): Promise { - try { - const s = await navigator.mediaDevices.getUserMedia({ audio: true }); - s.getTracks().forEach((t) => t.stop()); - return true; - } catch { - return false; - } -} - -export async function startCapture(onEndpoint?: () => void): Promise { - const stream = await navigator.mediaDevices.getUserMedia({ - audio: { channelCount: 1, echoCancellation: true, noiseSuppression: true }, - }); - const ctx = new AudioContext({ sampleRate: 16000 }); - if (ctx.state === 'suspended') await ctx.resume(); - const src = ctx.createMediaStreamSource(stream); - const analyser = ctx.createAnalyser(); - analyser.fftSize = 1024; - src.connect(analyser); - const node = ctx.createScriptProcessor(4096, 1, 1); - const chunks: Float32Array[] = []; - node.onaudioprocess = (e) => { - chunks.push(new Float32Array(e.inputBuffer.getChannelData(0))); - }; - src.connect(node); - node.connect(ctx.destination); // SP only fires when connected; output is silent - const buf = new Float32Array(analyser.fftSize); - // Voice-activity endpointing: once you've spoken, a ~1.3s pause (or a 20s - // hard cap) auto-stops capture so it replies without a second tap. - const SPEECH_RMS = 0.015; - const SILENCE_HANG_MS = 1300; // pause after speech that ends a turn - const NO_SPEECH_MS = 6000; // tapped but never spoke → give up - const MAX_MS = 20000; // hard cap on a single utterance - const startedAt = performance.now(); - let spoke = false; - let lastVoiceAt = startedAt; - let fired = false; - const tick = () => { - if (!cap) return; // capture stopped — end the loop - analyser.getFloatTimeDomainData(buf); - const level = rms(buf); - setMic(level); - const now = performance.now(); - if (level > SPEECH_RMS) { - spoke = true; - lastVoiceAt = now; - } - if ( - !fired && - onEndpoint && - ((spoke && now - lastVoiceAt > SILENCE_HANG_MS) || - (!spoke && now - startedAt > NO_SPEECH_MS) || - now - startedAt > MAX_MS) - ) { - fired = true; - onEndpoint(); // may synchronously stop capture (nulls cap) - } - if (cap) cap.raf = requestAnimationFrame(tick); // don't reschedule after stop - }; - cap = { ctx, stream, node, analyser, chunks, raf: 0 }; - tick(); -} - -/** Stop capture; return the recorded mono Float32 PCM at 16 kHz. */ -export async function stopCapture(): Promise { - if (!cap) return new Float32Array(0); - const c = cap; - cap = null; - cancelAnimationFrame(c.raf); - setMic(0); - try { - c.node.disconnect(); - c.analyser.disconnect(); - } catch { - /* noop */ - } - c.stream.getTracks().forEach((t) => t.stop()); - const total = c.chunks.reduce((n, ch) => n + ch.length, 0); - const out = new Float32Array(total); - let o = 0; - for (const ch of c.chunks) { - out.set(ch, o); - o += ch.length; - } - try { - await c.ctx.close(); - } catch { - /* noop */ - } - return out; -} - -// ---- Streaming playback (Kokoro sentence chunks → gapless speakers) ---- -// Chunks arrive while earlier ones are still playing, so each is scheduled -// back-to-back on a shared AudioContext; one AnalyserNode drives -// levels.playback so the orb pulses for the whole utterance. -let playCtx: AudioContext | null = null; -let playAnalyser: AnalyserNode | null = null; -let nextStartAt = 0; -let active = 0; // scheduled-but-not-ended sources -let closed = true; // no more chunks coming -let started = false; // at least one chunk enqueued this session -let lastLoudAt = 0; // last time playback actually had sound -let drainResolve: (() => void) | null = null; -let levelRaf = 0; - -// Safety net: if playback stays silent this long after speaking has started, -// end the turn regardless of the chunk/closed bookkeeping. Covers a stalled -// stream (a tts-done / onended that never arrives) that would otherwise leave -// the orb stuck in "speaking". -const SILENCE_END_MS = 1500; - -function ensurePlayCtx(): AudioContext { - if (!playCtx) { - playCtx = new AudioContext(); - playAnalyser = playCtx.createAnalyser(); - playAnalyser.fftSize = 1024; - playAnalyser.connect(playCtx.destination); - } - return playCtx; -} - -function finishDrain(): void { - if (!drainResolve) return; // idempotent — drain once per session - cancelAnimationFrame(levelRaf); - setPlayback(0); - const resolve = drainResolve; - drainResolve = null; - resolve(); -} - -function levelLoop(): void { - const a = playAnalyser; - if (!a) return; - const b = new Float32Array(a.fftSize); - cancelAnimationFrame(levelRaf); - const tick = () => { - if (!drainResolve) return; // session already drained - a.getFloatTimeDomainData(b); - const level = rms(b); - setPlayback(level); - const now = performance.now(); - if (level > 0.01) lastLoudAt = now; - if (started && now - lastLoudAt > SILENCE_END_MS) { - finishDrain(); // stalled or finished — stop "speaking" - return; - } - levelRaf = requestAnimationFrame(tick); - }; - tick(); -} - -/** Open a playback session; resolves once playback finishes (queue drained - * after endPlayback(), or the silence safety net trips). */ -export function beginPlayback(): Promise { - const ctx = ensurePlayCtx(); - if (ctx.state === 'suspended') void ctx.resume(); - nextStartAt = ctx.currentTime; - active = 0; - closed = false; - started = false; - lastLoudAt = performance.now(); - const p = new Promise((resolve) => { - drainResolve = resolve; - }); - levelLoop(); - return p; -} - -/** Queue one synthesized chunk, scheduled right after the previous one. */ -export function enqueuePlayback(pcm: Float32Array, rate: number): void { - const ctx = playCtx; - const a = playAnalyser; - if (!ctx || !a || pcm.length === 0) return; - const buffer = ctx.createBuffer(1, pcm.length, rate); - buffer.getChannelData(0).set(pcm); - const src = ctx.createBufferSource(); - src.buffer = buffer; - src.connect(a); - const startAt = Math.max(ctx.currentTime, nextStartAt); - src.start(startAt); - nextStartAt = startAt + buffer.duration; - started = true; - lastLoudAt = performance.now(); // reset the silence timer for the new chunk - active++; - src.onended = () => { - active--; - if (active === 0 && closed) finishDrain(); - }; -} - -/** No more chunks coming; drains once playback catches up. */ -export function endPlayback(): void { - closed = true; - if (active === 0) finishDrain(); -} diff --git a/sites/demo/src/engine/gemmaEngine.ts b/sites/demo/src/engine/gemmaEngine.ts deleted file mode 100644 index ca10d4f8..00000000 --- a/sites/demo/src/engine/gemmaEngine.ts +++ /dev/null @@ -1,108 +0,0 @@ -/** - * On-device LLM (Gemma) — worker wrapper. - * - * Pure LLM: load the model and complete a turn, streaming tokens via a - * callback. It emits NO orbis-sse events — the voice orchestrator - * (voiceEngine) owns conversation state + presentation so the same LLM - * serves both the voice loop and the typed fallback. - */ -import { trackProgress, type FileProgress } from './progress'; - -export type ProgressCb = (status: string, pct: number | null) => void; - -const SYSTEM = - 'You are Orbis, a warm, concise voice companion. Answer the user directly ' + - 'in a natural, spoken style — one or two short sentences. No markdown, no ' + - 'lists, no emoji. Do not describe yourself or mention being an AI unless the ' + - 'user explicitly asks who or what you are.'; - -class GemmaEngine { - private worker: Worker | null = null; - private messages: Array<{ role: string; content: string }> = [ - { role: 'system', content: SYSTEM }, - ]; - private loaded = false; - private loading: Promise | null = null; - private loadResolve: (() => void) | null = null; - private loadReject: ((e: Error) => void) | null = null; - private onProgress: ProgressCb | null = null; - private acc = ''; - private onToken: ((full: string, delta: string) => void) | null = null; - private genResolve: (() => void) | null = null; - private fileProg: FileProgress = new Map(); - - get isLoaded(): boolean { - return this.loaded; - } - - private ensureWorker(): void { - if (this.worker) return; - this.worker = new Worker(new URL('./llm.worker.ts', import.meta.url), { - type: 'module', - }); - this.worker.addEventListener('message', (e) => this.onMessage(e)); - } - - load(onProgress: ProgressCb): Promise { - this.onProgress = onProgress; - if (this.loaded) return Promise.resolve(); - if (this.loading) return this.loading; - this.ensureWorker(); - this.loading = new Promise((resolve, reject) => { - this.loadResolve = resolve; - this.loadReject = reject; - }); - this.worker!.postMessage({ type: 'load' }); - return this.loading; - } - - /** Complete one turn. Streams the running text via onToken; resolves with - * the full reply. No state events — the caller presents it. */ - async complete(userText: string, onToken?: (full: string, delta: string) => void): Promise { - if (!this.loaded || !this.worker) return ''; - this.messages.push({ role: 'user', content: userText }); - this.acc = ''; - this.onToken = onToken ?? null; - await new Promise((resolve) => { - this.genResolve = resolve; - this.worker!.postMessage({ type: 'generate', data: this.messages }); - }); - this.messages.push({ role: 'assistant', content: this.acc }); - return this.acc; - } - - private onMessage(e: MessageEvent): void { - const { type, data } = e.data ?? {}; - switch (type) { - case 'progress': - // One aggregate %, no file names (see progress.ts). - this.onProgress?.('downloading', trackProgress(this.fileProg, data)); - break; - case 'ready': - this.loaded = true; - this.onProgress?.('ready', 100); - this.loadResolve?.(); - this.loadResolve = this.loadReject = null; - break; - case 'token': { - const delta = String(data ?? ''); - this.acc += delta; - this.onToken?.(this.acc, delta); - break; - } - case 'done': - this.genResolve?.(); - this.genResolve = null; - break; - case 'error': - this.onProgress?.('error: ' + String(data), null); - this.loadReject?.(new Error(String(data))); - this.loadResolve = this.loadReject = null; - this.genResolve?.(); - this.genResolve = null; - break; - } - } -} - -export const gemmaEngine = new GemmaEngine(); diff --git a/sites/demo/src/engine/levels.ts b/sites/demo/src/engine/levels.ts deleted file mode 100644 index 2c003ec7..00000000 --- a/sites/demo/src/engine/levels.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Live audio-level bus (raw RMS, ~0..0.3) shared with the orb. - * - * The Tauri shim's get_audio_levels reads this; the orb's useAudioEnvelopes - * gains it (mic ×6, playback ×4) into a punchy reactive range. So mic - * capture and TTS playback drive the orb pulse exactly like the native - * Rust engine's levels — no orb changes needed. - */ -export interface Levels { - mic: number; - playback: number; -} - -const levels: Levels = { mic: 0, playback: 0 }; - -export const getLevels = (): Levels => levels; -export const setMic = (v: number): void => { - levels.mic = v; -}; -export const setPlayback = (v: number): void => { - levels.playback = v; -}; diff --git a/sites/demo/src/engine/llm.worker.ts b/sites/demo/src/engine/llm.worker.ts deleted file mode 100644 index 1cd5dda1..00000000 --- a/sites/demo/src/engine/llm.worker.ts +++ /dev/null @@ -1,84 +0,0 @@ -/// -/** - * On-device Gemma worker. Loads google/gemma-4-E2B (ONNX, q4f16) on WebGPU - * via Transformers.js and streams tokens back. Runs off the main thread so - * model load + generation never stall the orb's render loop. - * - * Protocol (main → worker): { type: 'load' } | { type: 'generate', data: messages } | { type: 'interrupt' } - * Protocol (worker → main): 'progress' | 'ready' | 'start' | 'token' | 'done' | 'error' - */ -import { - AutoTokenizer, - AutoModelForCausalLM, - TextStreamer, - InterruptableStoppingCriteria, - env, - type PreTrainedTokenizer, - type PreTrainedModel, -} from '@huggingface/transformers'; - -// Persist model files in the browser Cache API so a full download only -// happens once; always resolve from the HF hub. -env.useBrowserCache = true; -env.allowLocalModels = false; - -const MODEL_ID = 'onnx-community/gemma-4-E2B-it-ONNX'; - -let tokenizer: PreTrainedTokenizer | null = null; -let model: PreTrainedModel | null = null; -const stopper = new InterruptableStoppingCriteria(); - -const post = (msg: Record) => self.postMessage(msg); - -async function load(): Promise { - const progress_callback = (p: unknown) => post({ type: 'progress', data: p }); - tokenizer ??= await AutoTokenizer.from_pretrained(MODEL_ID, { progress_callback }); - model ??= await AutoModelForCausalLM.from_pretrained(MODEL_ID, { - dtype: 'q4f16', - device: 'webgpu', - progress_callback, - }); - // Tiny warm-up compile so the first real turn isn't cold. - const warm = tokenizer!.apply_chat_template([{ role: 'user', content: 'hi' }], { - add_generation_prompt: true, - return_dict: true, - }); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - await model!.generate({ ...(warm as any), max_new_tokens: 1 }); - post({ type: 'ready' }); -} - -async function generate(messages: Array<{ role: string; content: string }>): Promise { - if (!tokenizer || !model) throw new Error('model not loaded'); - stopper.reset(); - const inputs = tokenizer.apply_chat_template(messages, { - add_generation_prompt: true, - return_dict: true, - }); - const streamer = new TextStreamer(tokenizer, { - skip_prompt: true, - skip_special_tokens: true, - callback_function: (text: string) => post({ type: 'token', data: text }), - }); - post({ type: 'start' }); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - await model.generate({ - ...(inputs as any), - max_new_tokens: 128, - do_sample: false, - streamer, - stopping_criteria: stopper, - }); - post({ type: 'done' }); -} - -self.addEventListener('message', async (e: MessageEvent) => { - const { type, data } = e.data ?? {}; - try { - if (type === 'load') await load(); - else if (type === 'generate') await generate(data); - else if (type === 'interrupt') stopper.interrupt(); - } catch (err) { - post({ type: 'error', data: String((err as Error)?.message ?? err) }); - } -}); diff --git a/sites/demo/src/engine/progress.ts b/sites/demo/src/engine/progress.ts deleted file mode 100644 index 4e323ddd..00000000 --- a/sites/demo/src/engine/progress.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Download-progress aggregator. - * - * Transformers.js fires a progress event per model FILE, and several files - * download concurrently — so naively showing the latest event makes the - * label bounce between file names and the percent jump around. Instead we - * sum bytes across all files into one monotonic percent and never surface a - * file name. - */ -export type FileProgress = Map; - -interface RawProgress { - status?: string; - file?: string; - loaded?: number; - total?: number; -} - -/** Fold one raw progress event into the running totals; return overall % - * (0–100), or null until any file has reported a size. */ -export function trackProgress(files: FileProgress, p: RawProgress): number | null { - if (p?.file) { - if (p.status === 'done') { - const f = files.get(p.file); - if (f) f.loaded = f.total; - } else { - files.set(p.file, { loaded: p.loaded ?? 0, total: p.total ?? 0 }); - } - } - let loaded = 0; - let total = 0; - for (const f of files.values()) { - loaded += f.loaded; - total += f.total; - } - return total > 0 ? Math.min(100, Math.round((loaded / total) * 100)) : null; -} diff --git a/sites/demo/src/engine/speech.worker.ts b/sites/demo/src/engine/speech.worker.ts deleted file mode 100644 index 36f83fd0..00000000 --- a/sites/demo/src/engine/speech.worker.ts +++ /dev/null @@ -1,83 +0,0 @@ -/// -/** - * Speech worker — on-device STT (Moonshine) + TTS (Kokoro) on WebGPU. - * - * Kept off the main thread so model load + inference never stall the orb. - * Audio playback itself happens on the main thread (Web Audio); this worker - * just returns the synthesized Float32 PCM. - * - * Protocol (main → worker): 'load' | { transcribe, audio } | { synthesize, text, voice } - * Protocol (worker → main): 'progress' | 'ready' | 'transcript' | 'audio' | 'error' - */ -import { pipeline, env, type AutomaticSpeechRecognitionPipeline } from '@huggingface/transformers'; -import { KokoroTTS, TextSplitterStream } from 'kokoro-js'; - -// Cache model files (Moonshine here; Kokoro's bundled transformers caches -// by default too) so a download happens once. -env.useBrowserCache = true; -env.allowLocalModels = false; - -const STT_MODEL = 'onnx-community/moonshine-tiny-ONNX'; -const TTS_MODEL = 'onnx-community/Kokoro-82M-v1.0-ONNX'; - -let asr: AutomaticSpeechRecognitionPipeline | null = null; -let tts: KokoroTTS | null = null; -let splitter: TextSplitterStream | null = null; - -const post = (msg: Record, transfer?: Transferable[]) => - (self as unknown as Worker).postMessage(msg, transfer ?? []); - -async function load(): Promise { - const progress_callback = (p: unknown) => post({ type: 'progress', data: p }); - asr ??= (await pipeline('automatic-speech-recognition', STT_MODEL, { - device: 'webgpu', - // Moonshine: fp32 encoder, q4 decoder is the recommended browser combo. - dtype: { encoder_model: 'fp32', decoder_model_merged: 'q4' }, - progress_callback, - })) as AutomaticSpeechRecognitionPipeline; - tts ??= await KokoroTTS.from_pretrained(TTS_MODEL, { - dtype: 'fp32', // WebGPU recommends fp32 for Kokoro - device: 'webgpu', - progress_callback, - }); - post({ type: 'ready' }); -} - -self.addEventListener('message', async (e: MessageEvent) => { - const { type, data } = e.data ?? {}; - try { - if (type === 'load') { - await load(); - } else if (type === 'transcribe') { - if (!asr) throw new Error('STT not loaded'); - const out = await asr(data.audio as Float32Array); - const text = (Array.isArray(out) ? out[0]?.text : out?.text) ?? ''; - post({ type: 'transcript', text: String(text).trim() }); - } else if (type === 'tts-start') { - // Streaming TTS: tokens are pushed into a splitter; Kokoro yields one - // audio chunk per sentence as soon as it's ready, so playback starts - // before the full reply is generated. - if (!tts) throw new Error('TTS not loaded'); - splitter = new TextSplitterStream(); - const stream = tts.stream(splitter, { voice: data?.voice ?? 'af_heart' }); - void (async () => { - try { - for await (const { audio } of stream) { - const pcm = audio.audio as Float32Array; - post({ type: 'tts-chunk', pcm, rate: audio.sampling_rate }, [pcm.buffer]); - } - } catch (err) { - post({ type: 'error', data: String((err as Error)?.message ?? err) }); - } finally { - post({ type: 'tts-done' }); - } - })(); - } else if (type === 'tts-push') { - splitter?.push(String(data?.text ?? '')); - } else if (type === 'tts-close') { - splitter?.close(); - } - } catch (err) { - post({ type: 'error', data: String((err as Error)?.message ?? err) }); - } -}); diff --git a/sites/demo/src/engine/voiceEngine.ts b/sites/demo/src/engine/voiceEngine.ts deleted file mode 100644 index 524af944..00000000 --- a/sites/demo/src/engine/voiceEngine.ts +++ /dev/null @@ -1,231 +0,0 @@ -/** - * Voice orchestrator — the in-browser pipeline behind the orb. - * - * Wires mic capture → STT (Moonshine) → LLM (Gemma) → TTS (Kokoro) → - * playback, emitting the exact orbis-sse events the real app consumes - * (session / bot-state / transcript). The orb pulses through the levels - * bus (audio.ts → get_audio_levels), so listening/speaking look alive. - * - * Voice-first: one entry point — activate() (the orb tap / mic button) — - * loads what's needed on first use (priming mic permission within the - * gesture first), then runs the loop. Typing is a thin fallback that goes - * through the same handleInput → speaks the reply too. - */ -import { emitSse } from '../tauri-shim/bus'; -import { gemmaEngine, type ProgressCb } from './gemmaEngine'; -import { - primeMicPermission, - startCapture, - stopCapture, - beginPlayback, - enqueuePlayback, - endPlayback, -} from './audio'; -import { trackProgress, type FileProgress } from './progress'; - -const VOICE = 'af_heart'; - -class VoiceEngine { - onProgress: ProgressCb | null = null; - - private speech: Worker | null = null; - private speechLoaded = false; - private speechLoading: Promise | null = null; - private speechResolve: (() => void) | null = null; - private speechReject: ((e: Error) => void) | null = null; - private pendingTranscribe: ((t: string) => void) | null = null; - private speechFileProg: FileProgress = new Map(); - - private listening = false; - private busy = false; - private transitioning = false; - private firstChunk = false; - - /** Open a session so the app's bridge flips to connected/idle. */ - init(): void { - emitSse('session', { event: 'start', session_id: 'demo' }); - emitSse('bot-state', { state: 'idle' }); - } - - get ready(): boolean { - return gemmaEngine.isLoaded && this.speechLoaded; - } - get voiceReady(): boolean { - return this.speechLoaded; - } - get isListening(): boolean { - return this.listening; - } - get isBusy(): boolean { - return this.busy || this.transitioning; - } - - // ---- loading ---- - async load(onProgress: ProgressCb): Promise { - this.onProgress = onProgress; - await gemmaEngine.load((s, p) => onProgress(s === 'ready' ? 'Brain ready' : 'Downloading brain', p)); - await this.loadSpeech((s, p) => onProgress(s === 'ready' ? 'Voice ready' : 'Downloading voice', p)); - } - - private loadSpeech(onProgress: ProgressCb): Promise { - if (this.speechLoaded) return Promise.resolve(); - if (this.speechLoading) return this.speechLoading; - if (!this.speech) { - this.speech = new Worker(new URL('./speech.worker.ts', import.meta.url), { - type: 'module', - }); - this.speech.addEventListener('message', (e) => this.onSpeech(e, onProgress)); - } - this.speechLoading = new Promise((resolve, reject) => { - this.speechResolve = resolve; - this.speechReject = reject; - }); - this.speech.postMessage({ type: 'load' }); - return this.speechLoading; - } - - // ---- the one-tap entry point (orb tap / mic button) ---- - async activate(): Promise { - if (this.busy || this.transitioning) return; - if (this.listening) { - await this.stopListening(); - return; - } - if (!this.ready) { - this.transitioning = true; - try { - await primeMicPermission(); // bank permission inside the user gesture - await this.load(this.onProgress ?? (() => {})); - } finally { - this.transitioning = false; - } - } - await this.startListening(); - } - - /** For the orb's set_mic_listening invoke. */ - setListening(on: boolean): void { - if (on) { - if (!this.listening && !this.busy && !this.transitioning) void this.activate(); - } else { - void this.stopListening(); - } - } - - private async startListening(): Promise { - if (!this.ready || this.listening || this.busy) return; - this.listening = true; - emitSse('bot-state', { state: 'listening' }); - try { - await startCapture(() => { - void this.stopListening(); - }); - } catch { - this.listening = false; - emitSse('bot-state', { state: 'idle' }); - } - } - - private async stopListening(): Promise { - if (!this.listening) return; - this.listening = false; - const pcm = await stopCapture(); - console.info('[orbis-demo] captured', pcm.length, 'samples'); - if (pcm.length < 8000) { - // < ~0.5s of audio — treat as a mis-tap. - emitSse('bot-state', { state: 'idle' }); - return; - } - emitSse('bot-state', { state: 'thinking' }); - const text = await this.transcribe(pcm); - console.info('[orbis-demo] transcript:', JSON.stringify(text)); - if (!text) { - emitSse('bot-state', { state: 'idle' }); - return; - } - await this.handleInput(text); - } - - /** Typed fallback — loads on demand, then runs the same loop (speaks too). */ - async submitText(text: string): Promise { - if (this.busy || this.listening || this.transitioning) return; - if (!this.ready) { - this.transitioning = true; - try { - await this.load(this.onProgress ?? (() => {})); - } finally { - this.transitioning = false; - } - } - await this.handleInput(text); - } - - private async handleInput(text: string): Promise { - this.busy = true; - this.firstChunk = true; - emitSse('transcript', { source: 'user', text, final: true }); - emitSse('bot-state', { state: 'thinking' }); - try { - // Open playback + a streaming TTS session, then pipe Gemma's tokens - // into the splitter so it speaks sentence-by-sentence while generating. - const drained = beginPlayback(); - this.speech!.postMessage({ type: 'tts-start', data: { voice: VOICE } }); - const reply = await gemmaEngine.complete(text, (full, delta) => { - emitSse('transcript', { source: 'bot', text: full, final: false }); - if (delta) this.speech!.postMessage({ type: 'tts-push', data: { text: delta } }); - }); - console.info('[orbis-demo] reply:', JSON.stringify(reply)); - emitSse('transcript', { source: 'bot', text: reply, final: true }); - this.speech!.postMessage({ type: 'tts-close' }); - await drained; // resolves once all spoken audio has played out - } finally { - emitSse('bot-state', { state: 'idle' }); - this.busy = false; - } - } - - private transcribe(pcm: Float32Array): Promise { - return new Promise((resolve) => { - this.pendingTranscribe = resolve; - this.speech!.postMessage({ type: 'transcribe', data: { audio: pcm } }, [pcm.buffer]); - }); - } - - private onSpeech(e: MessageEvent, onProgress: ProgressCb): void { - const { type, data, text, pcm, rate } = e.data ?? {}; - switch (type) { - case 'progress': - onProgress('downloading', trackProgress(this.speechFileProg, data)); - break; - case 'ready': - this.speechLoaded = true; - this.speechResolve?.(); - this.speechResolve = this.speechReject = null; - break; - case 'transcript': - this.pendingTranscribe?.(String(text ?? '')); - this.pendingTranscribe = null; - break; - case 'tts-chunk': - if (this.firstChunk) { - this.firstChunk = false; - emitSse('bot-state', { state: 'speaking' }); - } - enqueuePlayback(pcm as Float32Array, rate as number); - break; - case 'tts-done': - endPlayback(); - break; - case 'error': - console.error('[orbis-demo] speech worker error:', data); - this.speechReject?.(new Error(String(data))); - this.speechResolve = this.speechReject = null; - this.pendingTranscribe?.(''); - this.pendingTranscribe = null; - // The turn resolves via tts-done → endPlayback; don't force idle here. - break; - } - } -} - -export const voiceEngine = new VoiceEngine(); diff --git a/sites/demo/src/engine/webgpu.ts b/sites/demo/src/engine/webgpu.ts deleted file mode 100644 index c818d576..00000000 --- a/sites/demo/src/engine/webgpu.ts +++ /dev/null @@ -1,31 +0,0 @@ -// WebGPU feature detection. The on-device LLM/STT/TTS all require it; when -// absent the demo falls back to a "download the app" message. -export function hasWebGPU(): boolean { - return ( - typeof navigator !== 'undefined' && - 'gpu' in navigator && - !!(navigator as unknown as { gpu?: unknown }).gpu - ); -} - -interface GPUAdapterInfoLike { - vendor?: string; - architecture?: string; - description?: string; -} - -/** WebGPU support + a human adapter string for the system-info panel. */ -export async function getWebGPUInfo(): Promise<{ supported: boolean; adapter?: string }> { - if (!hasWebGPU()) return { supported: false }; - try { - const gpu = (navigator as unknown as { gpu: { requestAdapter(): Promise } }).gpu; - const adapter = (await gpu.requestAdapter()) as { info?: GPUAdapterInfoLike } | null; - const info = adapter?.info; - const label = info - ? [info.vendor, info.architecture, info.description].filter(Boolean).join(' ').trim() - : ''; - return { supported: true, adapter: label || 'available' }; - } catch { - return { supported: true }; - } -} diff --git a/sites/demo/src/main.tsx b/sites/demo/src/main.tsx deleted file mode 100644 index ce35a6e4..00000000 --- a/sites/demo/src/main.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; -import './styles.css'; -import { DemoApp } from './demo/DemoApp'; -import { voiceEngine } from './engine/voiceEngine'; - -// The real ORBIS app expects a dark, data-theme="dark" document (set by -// the Tauri shell's index.html). index.html here mirrors that; belt-and- -// braces in case a host strips the attributes. -document.documentElement.classList.add('dark'); -document.documentElement.dataset.theme = 'dark'; - -// Open a session so the app's bridge flips to connected/idle. Models load -// lazily on first interaction (tap the orb or the mic button). -voiceEngine.init(); - -createRoot(document.getElementById('root')!).render( - - - , -); diff --git a/sites/demo/src/styles.css b/sites/demo/src/styles.css deleted file mode 100644 index 03311b87..00000000 --- a/sites/demo/src/styles.css +++ /dev/null @@ -1,6 +0,0 @@ -/* Pull in the real app's stylesheet (Tailwind + design-system tokens + - ORBIS chrome tokens). It lives outside this vite root, so Tailwind's - automatic content detection won't find the app's class usage — point - it at the real sources explicitly with @source. */ -@import "../../../web/src/index.css"; -@source "../../../web/src"; diff --git a/sites/demo/src/tauri-shim/app.ts b/sites/demo/src/tauri-shim/app.ts deleted file mode 100644 index 1557cfbe..00000000 --- a/sites/demo/src/tauri-shim/app.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Browser stand-in for @tauri-apps/api/app. -export async function getVersion(): Promise { - return '0.0.0-demo'; -} diff --git a/sites/demo/src/tauri-shim/bus.ts b/sites/demo/src/tauri-shim/bus.ts deleted file mode 100644 index de2abd63..00000000 --- a/sites/demo/src/tauri-shim/bus.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * A tiny in-process event bus that stands in for Tauri's event system. - * - * The shim's listen() (event.ts) subscribes here; the in-browser engine - * publishes here. The app's useVoiceBridge listens for 'orbis-sse' with a - * { event, data } envelope — emitSse() produces exactly that shape so the - * orb / status pill / transcripts react identically to the native app. - */ -type Handler = (payload: unknown) => void; - -const handlers = new Map>(); - -export function on(name: string, handler: Handler): () => void { - let set = handlers.get(name); - if (!set) { - set = new Set(); - handlers.set(name, set); - } - set.add(handler); - return () => { - set!.delete(handler); - }; -} - -export function emit(name: string, payload: unknown): void { - handlers.get(name)?.forEach((h) => h(payload)); -} - -/** Emit one ORBIS SSE event in the { event, data } envelope the app's - * useVoiceBridge unpacks (data is a JSON string, as on the wire). */ -export function emitSse(event: string, data: Record): void { - emit('orbis-sse', { event, data: JSON.stringify(data) }); -} diff --git a/sites/demo/src/tauri-shim/commands.ts b/sites/demo/src/tauri-shim/commands.ts deleted file mode 100644 index 06b5ae89..00000000 --- a/sites/demo/src/tauri-shim/commands.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * The invoke() router — every native command the app calls, answered for - * the browser. HTTP (api_request) delegates to the local backend router; - * device/window commands return safe defaults or no-op (PR1 has no real - * audio engine — that arrives with the on-device voice loop in PR3). - */ -import { httpRequest, type ApiRequestArgs } from '../backend/router'; -import { getLevels } from '../engine/levels'; -import { voiceEngine } from '../engine/voiceEngine'; - -export async function handleInvoke( - cmd: string, - args: Record, -): Promise { - switch (cmd) { - // --- backend --- - case 'api_request': - return httpRequest(args as unknown as ApiRequestArgs); - case 'backend_url': - // backendBase() has already resolved to the page origin (https), so - // returning null here is fine — the proxy URL is never actually used. - return null; - case 'boot_status': - // BootStatus opens the gate the moment it sees a 'ready' marker. - return JSON.stringify({ stage: 'ready', detail: 'Ready' }); - - // --- audio / mic getters: no device backend in the browser (PR1) --- - case 'get_audio_level': - return 0; - case 'get_audio_levels': - // Live RMS from mic capture + TTS playback (audio.ts → levels bus), - // so the orb pulses to your voice and hers. Shape MUST match the Rust - // command: { mic, playback } — the orb reads nat.playback / nat.mic. - return getLevels(); - case 'list_audio_inputs': - case 'list_audio_outputs': - return []; - case 'get_audio_input_mode': - return 'half_duplex'; - case 'get_microphone_permission_status': - return 'granted'; - case 'mic_listening': - return false; - - // --- config getters --- - case 'get_activation_config': - return { - enabled: false, - model: null, - threshold: 0.5, - listen_window_secs: 30, - full_duplex: false, - }; - case 'get_discoverable': - return false; - case 'surface_enabled': - return false; - - // --- side effects we can honor in the browser --- - case 'open_url': { - const url = args.url as string | undefined; - if (url) window.open(url, '_blank', 'noopener,noreferrer'); - return null; - } - case 'set_mic_listening': - // The orb's double-click push-to-talk drives the voice loop. - voiceEngine.setListening(!!args.on); - return null; - - // --- setters / window ops / one-shots: no-op in the demo --- - case 'set_mic_muted': - case 'set_input_device': - case 'set_output_device': - case 'start_audio_engine': - case 'set_activation_config': - case 'set_full_duplex': - case 'set_discoverable': - case 'request_microphone_permission': - case 'open_microphone_settings': - case 'reveal_logs': - case 'clear_browsing_data': - case 'show_main': - case 'open_widget_window': - case 'close_widget_window': - return null; - - default: - console.warn(`[demo] unhandled invoke('${cmd}')`); - return null; - } -} diff --git a/sites/demo/src/tauri-shim/core.ts b/sites/demo/src/tauri-shim/core.ts deleted file mode 100644 index 7e45f92b..00000000 --- a/sites/demo/src/tauri-shim/core.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Browser stand-in for @tauri-apps/api/core. The app calls invoke() for -// its backend (api_request) and for native device/window commands; all of -// it routes through handleInvoke (commands.ts). -import { handleInvoke } from './commands'; - -export async function invoke( - cmd: string, - args?: Record, -): Promise { - return handleInvoke(cmd, args ?? {}) as Promise; -} diff --git a/sites/demo/src/tauri-shim/event.ts b/sites/demo/src/tauri-shim/event.ts deleted file mode 100644 index adc5fa3e..00000000 --- a/sites/demo/src/tauri-shim/event.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Browser stand-in for @tauri-apps/api/event. Only listen() + UnlistenFn -// are used by the app (useVoiceBridge, BootStatus, visibility). -import { on } from './bus'; - -export type UnlistenFn = () => void; - -export interface Event { - event: string; - id: number; - payload: T; -} - -export type EventCallback = (event: Event) => void; - -let nextId = 0; - -export async function listen( - event: string, - handler: EventCallback, -): Promise { - return on(event, (payload) => - handler({ event, id: nextId++, payload: payload as T }), - ); -} diff --git a/sites/demo/src/tauri-shim/path.ts b/sites/demo/src/tauri-shim/path.ts deleted file mode 100644 index bcac00bb..00000000 --- a/sites/demo/src/tauri-shim/path.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Browser stand-in for @tauri-apps/api/path. Only appLogDir() is used -// (Diagnostics); there's no filesystem in the browser, so report a label. -export async function appLogDir(): Promise { - return '/orbis-demo/logs/'; -} diff --git a/sites/demo/src/tauri-shim/process.ts b/sites/demo/src/tauri-shim/process.ts deleted file mode 100644 index cac272da..00000000 --- a/sites/demo/src/tauri-shim/process.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Browser stand-in for @tauri-apps/plugin-process. -export async function relaunch(): Promise {} -export async function exit(_code?: number): Promise {} diff --git a/sites/demo/src/tauri-shim/updater.ts b/sites/demo/src/tauri-shim/updater.ts deleted file mode 100644 index 401b953d..00000000 --- a/sites/demo/src/tauri-shim/updater.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Browser stand-in for @tauri-apps/plugin-updater. No auto-update in the -// browser demo: check() reports "no update", so UpdateNotice stays hidden. -export type Update = { - available: boolean; - version?: string; - downloadAndInstall?: () => Promise; -} | null; - -export async function check(): Promise { - return null; -} diff --git a/sites/demo/src/tauri-shim/window.ts b/sites/demo/src/tauri-shim/window.ts deleted file mode 100644 index 7aacdacd..00000000 --- a/sites/demo/src/tauri-shim/window.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Browser stand-in for @tauri-apps/api/window. The demo is always the -// single "main" window; close/hide are no-ops. -export interface ShimWindow { - label: string; - close(): Promise; - hide(): Promise; -} - -const mainWindow: ShimWindow = { - label: 'main', - async close() {}, - async hide() {}, -}; - -export function getCurrentWindow(): ShimWindow { - return mainWindow; -} diff --git a/sites/demo/tsconfig.json b/sites/demo/tsconfig.json deleted file mode 100644 index 9072cf98..00000000 --- a/sites/demo/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "useDefineForClassFields": true, - "lib": ["ES2022", "DOM", "DOM.Iterable"], - "module": "ESNext", - "skipLibCheck": true, - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "resolveJsonModule": true, - "isolatedModules": true, - "moduleDetection": "force", - "noEmit": true, - "jsx": "react-jsx", - "strict": true, - "baseUrl": ".", - "paths": { - "@/*": ["../../web/src/*"], - "@orbis/orb-runtime": ["../../packages/orb-runtime/src/index.ts"] - } - }, - "include": ["src"] -} diff --git a/sites/demo/vite.config.ts b/sites/demo/vite.config.ts deleted file mode 100644 index 7cf8475b..00000000 --- a/sites/demo/vite.config.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { defineConfig } from 'vite'; -import react from '@vitejs/plugin-react'; -import tailwindcss from '@tailwindcss/vite'; -import glsl from 'vite-plugin-glsl'; -import path from 'node:path'; - -// The browser demo — orbis.protolabs.studio/demo. It runs the REAL ORBIS -// frontend (web/src) in a plain browser by aliasing the Tauri API -// entrypoints to a browser shim (src/tauri-shim/*). The app's backend -// (invoke('api_request', …)) is answered locally (src/backend/router.ts) -// and voice events (the orbis-sse stream) are emitted by an in-browser -// engine — a mock in PR1, on-device Gemma/Whisper/Kokoro on WebGPU next. -// -// Built as a standalone SPA and folded into the marketing Cloudflare -// Pages bundle at dist/demo (same posture as /editor and /docs). See -// .github/workflows/marketing-deploy.yml. -// -// Nothing here leaks back into web/src: the app stays Tauri-only (no -// fetch fallback in api.ts) — the browser backend lives entirely in this -// app's module-resolution layer. -const r = (p: string) => path.resolve(__dirname, p); - -export default defineConfig({ - base: '/demo/', - plugins: [ - react(), - tailwindcss(), - // The orb variants import .glsl/.frag/.vert as strings. - glsl({ minify: false }), - ], - resolve: { - alias: { - // Tauri shim — MUST precede '@' so these specific keys win. (They - // wouldn't collide anyway: '@' only matches '@/…', not '@tauri-apps/…'.) - '@tauri-apps/api/core': r('./src/tauri-shim/core.ts'), - '@tauri-apps/api/event': r('./src/tauri-shim/event.ts'), - '@tauri-apps/api/window': r('./src/tauri-shim/window.ts'), - '@tauri-apps/api/path': r('./src/tauri-shim/path.ts'), - '@tauri-apps/api/app': r('./src/tauri-shim/app.ts'), - '@tauri-apps/plugin-updater': r('./src/tauri-shim/updater.ts'), - '@tauri-apps/plugin-process': r('./src/tauri-shim/process.ts'), - // Consume the real app + shared orb runtime as source. - '@orbis/orb-runtime': r('../../packages/orb-runtime/src/index.ts'), - '@': r('../../web/src'), - }, - // web/src + orb-runtime live outside this root; pin their peer deps - // to this app's single copy or R3F/three break with duplicate instances. - dedupe: ['react', 'react-dom', 'three', '@react-three/fiber'], - }, - server: { - port: 5175, - // web/src and packages/* sit above this vite root. - fs: { allow: ['../..'] }, - }, -}); diff --git a/sites/marketing/src/pages/index.astro b/sites/marketing/src/pages/index.astro index a5891938..c3c7c9fc 100644 --- a/sites/marketing/src/pages/index.astro +++ b/sites/marketing/src/pages/index.astro @@ -73,15 +73,6 @@ import { OrbHero } from '../components/OrbHero'; > Download for Mac - - Try in your browser → -