From bccb5bbe4b938afbafacc9b86c7e2d8e9bff35f1 Mon Sep 17 00:00:00 2001 From: ash Date: Fri, 24 Jul 2026 18:04:36 +0800 Subject: [PATCH 01/13] Add pagx-preview MCP playground for inline pagx animation preview in AI coding assistants. --- playground/pagx-preview/README.md | 303 + playground/pagx-preview/README.zh_CN.md | 207 + playground/pagx-preview/package-lock.json | 1765 ++ playground/pagx-preview/package.json | 54 + .../pagx-preview/scripts/check-artifacts.js | 77 + playground/pagx-preview/scripts/prebuild.js | 214 + playground/pagx-preview/src/cli.js | 343 + playground/pagx-preview/src/daemon.js | 296 + playground/pagx-preview/src/mcp/server.js | 129 + playground/pagx-preview/src/mcp/tools.js | 293 + .../pagx-preview/src/server/font-cache.js | 183 + playground/pagx-preview/src/server/fonts.js | 123 + playground/pagx-preview/src/server/index.js | 570 + playground/pagx-preview/src/server/lock.js | 107 + playground/pagx-preview/src/server/session.js | 130 + .../pagx-preview/static/ext/app-with-deps.js | 78 + playground/pagx-preview/static/icons/next.png | 3 + .../pagx-preview/static/icons/pause.png | 3 + playground/pagx-preview/static/icons/play.png | 3 + .../pagx-preview/static/icons/previous.png | 3 + playground/pagx-preview/static/index.css | 134 + playground/pagx-preview/static/index.html | 33 + playground/pagx-preview/static/index.js | 596 + .../pagx-preview/static/mcp-widget.bundle.js | 667 + .../pagx-preview/static/mcp-widget.html | 100 + playground/pagx-preview/static/mcp-widget.js | 207 + .../static/player/pagx-player.esm.js | 24757 ++++++++++++++++ .../static/player/pagx-player.esm.js.map | 1 + .../pagx-preview/static/viewer/info.json | 6 + .../static/viewer/pagx-viewer.st.esm.js | 8662 ++++++ .../static/viewer/pagx-viewer.st.wasm | 3 + 31 files changed, 40050 insertions(+) create mode 100644 playground/pagx-preview/README.md create mode 100644 playground/pagx-preview/README.zh_CN.md create mode 100644 playground/pagx-preview/package-lock.json create mode 100644 playground/pagx-preview/package.json create mode 100644 playground/pagx-preview/scripts/check-artifacts.js create mode 100644 playground/pagx-preview/scripts/prebuild.js create mode 100755 playground/pagx-preview/src/cli.js create mode 100644 playground/pagx-preview/src/daemon.js create mode 100644 playground/pagx-preview/src/mcp/server.js create mode 100644 playground/pagx-preview/src/mcp/tools.js create mode 100644 playground/pagx-preview/src/server/font-cache.js create mode 100644 playground/pagx-preview/src/server/fonts.js create mode 100644 playground/pagx-preview/src/server/index.js create mode 100644 playground/pagx-preview/src/server/lock.js create mode 100644 playground/pagx-preview/src/server/session.js create mode 100644 playground/pagx-preview/static/ext/app-with-deps.js create mode 100755 playground/pagx-preview/static/icons/next.png create mode 100644 playground/pagx-preview/static/icons/pause.png create mode 100755 playground/pagx-preview/static/icons/play.png create mode 100755 playground/pagx-preview/static/icons/previous.png create mode 100644 playground/pagx-preview/static/index.css create mode 100644 playground/pagx-preview/static/index.html create mode 100644 playground/pagx-preview/static/index.js create mode 100644 playground/pagx-preview/static/mcp-widget.bundle.js create mode 100644 playground/pagx-preview/static/mcp-widget.html create mode 100644 playground/pagx-preview/static/mcp-widget.js create mode 100644 playground/pagx-preview/static/player/pagx-player.esm.js create mode 100644 playground/pagx-preview/static/player/pagx-player.esm.js.map create mode 100644 playground/pagx-preview/static/viewer/info.json create mode 100644 playground/pagx-preview/static/viewer/pagx-viewer.st.esm.js create mode 100755 playground/pagx-preview/static/viewer/pagx-viewer.st.wasm diff --git a/playground/pagx-preview/README.md b/playground/pagx-preview/README.md new file mode 100644 index 0000000000..145c783b45 --- /dev/null +++ b/playground/pagx-preview/README.md @@ -0,0 +1,303 @@ +# PAGX Preview + +Local live-reload preview server for [PAGX](https://pag.io/pagx/latest/) files. Provides a +`pagx-preview` CLI that renders a `.pagx` file in the browser and automatically refreshes on +file changes. + +Companion tool to [`@libpag/pagx`](https://www.npmjs.com/package/@libpag/pagx) and +[`pagx-viewer`](../pagx-viewer). See [PAGX](https://pag.io/pagx/latest/) for the format +specification. + +## Introduction + +`pagx-preview` starts a local HTTP server, watches the target `.pagx` file (and any external +resources it references) with `chokidar`, and pushes reload events to the browser over +Server-Sent Events. The rendering itself is delegated to `pagx-viewer` (WebAssembly). The first +invocation spawns a detached daemon so the shell returns immediately; subsequent invocations +reuse the running daemon and open additional tabs for different files. + +## Requirements + +- Node.js ≥ 16.7 +- A built `pagx-viewer` (either multi-threaded or single-threaded variant) + +## Quick Start (End Users) + +```bash +# Install (from an npm tarball; publishing to the registry is planned) +npm install -g ./libpag-pagx-preview-.tgz + +# Open a PAGX file +pagx-preview /path/to/animation.pagx + +# Open another file (reuses the same background server, opens a new tab) +pagx-preview /path/to/other.pagx + +# Stop the background server +pagx-preview stop + +# Inspect the server log +pagx-preview --log +``` + +On first run, fallback fonts (~18 MB) are lazily downloaded to `~/.pagx/fonts/`. Subsequent +runs use the cached copies. + +### CLI options + +| Option | Description | +|--------|-------------| +| `--port ` | Bind to a specific port (default: system-assigned) | +| `--host ` | Bind host (default: `127.0.0.1`) | +| `--fonts ` | Override the fonts directory | +| `--no-open` | Do not open the browser automatically | +| `--foreground` | Run the server in the foreground instead of detaching | +| `--log` | Print the server log and exit | +| `-h, --help` | Show help | + +### Playback controls (in-browser) + +- **Space** — Play / Pause +- **Previous / Next frame buttons** — Step one frame at a time +- **Progress slider** — Scrub the timeline +- **Loop toggle** — Sequence loop vs. play-once +- **Drop a `.pagx` file into the window** — Open a one-shot preview in a new tab (not watched) + +### Font resolution + +Fallback fonts (`NotoSansSC-Regular.otf` + `NotoColorEmoji.ttf`) are resolved in priority order: + +1. `--fonts ` CLI argument +2. `PAGX_FONTS_DIR` environment variable +3. `~/.pagx/fonts/` (populated by lazy download from `pag.qq.com/wx_pagx_demo/fonts/`) +4. `resources/font/` in an ancestor `libpag` checkout + +Set `PAGX_FONTS_NO_AUTO_DOWNLOAD=1` to disable the lazy download step (for offline / CI hosts). + +### Files created at runtime + +| Path | Purpose | +|------|---------| +| `~/.pagx/preview.lock` | Currently-running daemon's pid/port (cleared on shutdown) | +| `~/.pagx/preview.log` | Daemon stdout/stderr; truncated on each spawn | +| `~/.pagx/fonts/` | Cached fallback fonts | + +## MCP Server Mode + +`pagx-preview` can run as an [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) +server, allowing AI coding assistants to preview `.pagx` files directly in conversation. The +server exposes tools (`preview_pagx`, `reload_file`, `get_document`) and an MCP Apps UI +resource that renders the pagx animation inline as a widget. + +### How it works + +When started with `--mcp`, the process communicates over stdio (JSON-RPC) and automatically +spawns a local HTTP server for the widget to load WASM, fonts, and pagx bytes. The user does +not need to manually start any services — the MCP client handles process lifecycle. + +### Platform deployment + +#### CodeBuddy IDE / VS Code (CodeBuddy plugin) + +Add to `~/.codebuddy/mcp.json`: + +```json +{ + "mcpServers": { + "pagx-preview": { + "command": "pagx-preview", + "args": ["--mcp"] + } + } +} +``` + +#### Claude Desktop + +Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or +`%APPDATA%\Claude\claude_desktop_config.json` (Windows): + +```json +{ + "mcpServers": { + "pagx-preview": { + "command": "pagx-preview", + "args": ["--mcp"] + } + } +} +``` + +#### VS Code GitHub Copilot + +Add to `.vscode/mcp.json` in your project: + +```json +{ + "servers": { + "pagx-preview": { + "type": "http", + "url": "http://127.0.0.1:/mcp" + } + } +} +``` + +Note: Copilot uses HTTP transport. Start the preview server first (`pagx-preview --port +`) then configure the URL. + +### Known compatibility issues + +The inline MCP Apps widget renders correctly in the official +[ext-apps basic-host](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-host) +reference implementation. However, due to varying MCP Apps support across hosts: + +- **Claude Desktop**: The widget iframe may not be mounted by the host (known issue tracked at + [claude-ai-mcp#165](https://github.com/anthropics/claude-ai-mcp/issues/165)). When the + inline widget is blank, open the browser URL returned by `preview_pagx` instead. +- **CodeBuddy IDE**: MCP Apps inline widget rendering is not yet supported. Use the browser URL. +- **VS Code Copilot**: Opens the preview in Simple Browser (editor tab), not as an inline + widget. Functionally equivalent. + +In all cases, the browser URL (`http://127.0.0.1:/session//`) provides a fully +functional preview with live reload. + +## Architecture + +- **`src/cli.js`** — Command entry, argument parsing, daemon / foreground dispatch, session + reuse over HTTP. +- **`src/daemon.js`** — Detached child process handling, log capture, `stop` / `--log` + commands. +- **`src/server/index.js`** — Express-based HTTP server with SSE, static asset routing, and + the `/sessions` reuse endpoint. +- **`src/server/session.js`** — Per-file session: watches the entry PAGX and its external + resources; emits `reload` events to subscribers. +- **`src/server/fonts.js`** / **`font-cache.js`** — Font resolution and lazy download. +- **`src/server/lock.js`** — Cross-invocation lock file at `~/.pagx/preview.lock`. +- **`static/`** — Browser client: vanilla ES modules that boot `pagx-viewer`, subscribe to + SSE, and drive the playback bar. + +## Development + +### First-time setup + +```bash +# 1. Build pagx-viewer artifacts (either variant works) +cd ../pagx-viewer +npm run build:debug:st # single-threaded (recommended for IDE embedding) +# or: +# npm run build:debug # multi-threaded (better rendering performance) + +# 2. Install deps and stage viewer artifacts +cd ../pagx-preview +npm install +npm run prebuild # copies pagx-viewer wasm / glue into static/viewer/ +``` + +`prebuild` auto-detects whichever variant exists in `../pagx-viewer/lib/` and writes +`static/viewer/info.json` so the server knows whether to attach COOP/COEP headers (only +required by the multi-threaded build). + +### Run from source + +```bash +# Standard run (spawns a detached daemon) +node src/cli.js /path/to/file.pagx + +# Foreground run (keeps the server attached to the terminal; Ctrl+C stops it) +node src/cli.js --foreground /path/to/file.pagx +``` + +### Test as a globally installed command + +```bash +# Link the package so the `pagx-preview` binary points at your working tree +npm link +pagx-preview /path/to/file.pagx + +# Unlink when done +npm unlink -g @libpag/pagx-preview +``` + +### Build and test a tarball locally + +```bash +# Optional: use the release build of pagx-viewer for a realistic install +cd ../pagx-viewer +npm run build:release:st + +# Build the tarball +cd ../pagx-preview +npm run prebuild +npm pack --dry-run # inspect what will be included +npm pack # writes libpag-pagx-preview-.tgz + +# Install the tarball as if it were published +npm unlink -g @libpag/pagx-preview # remove any existing link +npm install -g ./libpag-pagx-preview-.tgz +pagx-preview --help +pagx-preview /path/to/file.pagx + +# Cleanup +npm uninstall -g @libpag/pagx-preview +``` + +### Publish to npm + +```bash +# Bump the version in package.json first (semver-compatible; prerelease tags allowed) +npm publish --dry-run # sanity-check without pushing +npm publish # `prepack` auto-runs prebuild + check-artifacts +``` + +`prepack` (declared in `package.json`) runs `scripts/prebuild.js` and +`scripts/check-artifacts.js` to guarantee the tarball ships with the viewer wasm, glue file, +and playback icons; the release fails loudly otherwise. + +### Force a font-download rehearsal + +The server prefers a `libpag` checkout's `resources/font/` over the lazy-download cache when +both are available, so testing the download path requires shadowing the checkout: + +```bash +pagx-preview stop +export PAGX_FONTS_DIR=/nonexistent # blocks the checkout fallback +rm -rf ~/.pagx/fonts # clear the cache +unset PAGX_FONTS_DIR # let the download resolve to the cache +pagx-preview /path/to/file.pagx +pagx-preview --log # watch the download progress +``` + +## Server endpoints + +The server exposes a small HTTP surface consumed by the browser client and, for reuse across +CLI invocations, by the CLI itself. + +| Path | Purpose | +|------|---------| +| `GET /health` | Liveness probe used by the CLI lock check | +| `POST /sessions` | Create or reuse a session for a filesystem path | +| `GET /session/:id/` | Serve the client `index.html` | +| `GET /session/:id/pagx` | Serve the entry PAGX bytes | +| `GET /session/:id/info` | Session metadata (name, watched vs. one-shot) | +| `GET /session/:id/resources/*` | Serve external resources under the entry file's directory | +| `POST /session/:id/resources` | Browser reports the PAGX's external file list | +| `GET /session/:id/events` | Server-Sent Events stream (`reload`, `fonts-ready`, `focus`) | +| `POST /session/drop` | Upload dropped bytes as a one-shot ephemeral session | +| `GET /fonts/list` | Enumerate available fallback fonts | +| `GET /fonts/:name` | Serve a fallback font | +| `GET /static/*` | Client bundle (viewer wasm/glue, index.js, index.css) | + +## Related packages + +- [`pagx-viewer`](../pagx-viewer) — The WebAssembly rendering core loaded by the browser + client. +- [`pagx-playground`](../pagx-playground) — The hosted online viewer at + [pag.io/pagx](https://pag.io/pagx/). Reuses the same viewer with a richer editing UI. +- [`@libpag/pagx`](https://www.npmjs.com/package/@libpag/pagx) — The main PAGX command-line + tool (validate, render, optimize, format, etc.). Not yet integrated with `pagx-preview` + as a subcommand. + +## License + +Apache-2.0 diff --git a/playground/pagx-preview/README.zh_CN.md b/playground/pagx-preview/README.zh_CN.md new file mode 100644 index 0000000000..10c667af31 --- /dev/null +++ b/playground/pagx-preview/README.zh_CN.md @@ -0,0 +1,207 @@ +# PAGX Preview + +本地实时预览服务器,用于 [PAGX](https://pag.io/pagx/latest/) 动画文件的渲染和调试。支持文件变更自动刷新、MCP 协议接入 AI 编码助手。 + +## 功能 + +- 一行命令启动,浏览器自动打开预览 +- 文件修改自动检测、实时重新渲染(SSE 推送) +- 后台常驻守护进程,多文件复用同一服务 +- 支持拖放 `.pagx` 文件到浏览器窗口预览 +- 作为 MCP Server 接入 AI 编码助手(CodeBuddy / Claude Desktop / VS Code Copilot) +- 字体自动下载(NotoSansSC + NotoColorEmoji) + +## 依赖 + +- Node.js >= 16.7 +- 已构建的 `pagx-viewer`(多线程或单线程版本) + +## 快速开始 + +```bash +# 全局安装 +npm install -g ./libpag-pagx-preview-.tgz + +# 预览文件 +pagx-preview /path/to/animation.pagx + +# 预览另一个文件(复用已有服务) +pagx-preview /path/to/other.pagx + +# 停止后台服务 +pagx-preview stop +``` + +## CLI 参数 + +| 参数 | 说明 | +|------|------| +| `--port ` | 指定端口(默认:系统分配) | +| `--host ` | 绑定地址(默认:127.0.0.1) | +| `--fonts ` | 指定字体目录 | +| `--no-open` | 不自动打开浏览器 | +| `--foreground` | 前台运行(不后台化) | +| `--mcp` | 作为 MCP stdio 服务器运行(见下方 MCP 章节) | +| `--log` | 查看服务日志 | +| `stop` | 停止后台服务 | + +## MCP Server 模式 + +`pagx-preview` 可作为 MCP (Model Context Protocol) 服务器运行,让 AI 编码助手在对话中直接预览 `.pagx` 文件。 + +### 工作原理 + +使用 `--mcp` 启动时,进程通过 stdin/stdout 通信 MCP 协议,同时自动启动本地 HTTP 服务器用于 WASM 渲染。用户无需手动启动任何服务——MCP 客户端管理进程生命周期。 + +### 提供的工具 + +| 工具 | 说明 | +|------|------| +| `preview_pagx` | 加载 .pagx 文件预览,返回内联 widget + 浏览器 URL | +| `reload_file` | 强制重新加载文件 | +| `get_document` | 获取文档信息(尺寸、时长等) | + +### 各平台配置 + +#### CodeBuddy IDE + +在 `~/.codebuddy/mcp.json` 中添加: + +```json +{ + "mcpServers": { + "pagx-preview": { + "command": "pagx-preview", + "args": ["--mcp"] + } + } +} +``` + +#### Claude Desktop + +macOS: `~/Library/Application Support/Claude/claude_desktop_config.json` +Windows: `%APPDATA%\Claude\claude_desktop_config.json` + +```json +{ + "mcpServers": { + "pagx-preview": { + "command": "pagx-preview", + "args": ["--mcp"] + } + } +} +``` + +#### VS Code GitHub Copilot + +在项目中创建 `.vscode/mcp.json`: + +```json +{ + "servers": { + "pagx-preview": { + "type": "http", + "url": "http://127.0.0.1:<端口>/mcp" + } + } +} +``` + +注意:Copilot 使用 HTTP 传输,需先手动启动服务(`pagx-preview --port <端口> <文件>`)。 + +### 已知兼容性问题 + +内联 MCP Apps widget 已在官方 [ext-apps basic-host](https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/basic-host) 参考宿主中验证通过。但各平台宿主的支持情况: + +| 宿主 | 状态 | 替代方案 | +|------|------|----------| +| Claude Desktop | widget 可能不渲染(已知 host 侧 bug) | 使用返回的浏览器 URL | +| CodeBuddy IDE | 暂不支持 MCP Apps widget | 使用返回的浏览器 URL | +| VS Code Copilot | 在 Simple Browser 中打开 | 功能等价 | + +所有情况下,`preview_pagx` 返回的浏览器 URL(`http://127.0.0.1:<端口>/session//`)都能正常预览。 + +## 开发 + +### 首次设置 + +```bash +# 1. 构建 pagx-viewer +cd ../pagx-viewer +npm run build:debug:st # 单线程版(推荐用于 IDE 嵌入) + +# 2. 构建 pagx-player +cd ../pagx-player +npm install && npm run build + +# 3. 安装依赖并预构建 +cd ../pagx-preview +npm install +npm run prebuild # 复制 viewer/player 产物到 static/ +``` + +`prebuild` 会自动: +- 检测 viewer 构建变体(MT/ST),复制 wasm + glue 到 `static/viewer/` +- 复制 pagx-player ESM bundle 到 `static/player/` +- 复制 ext-apps SDK bundle 到 `static/ext/` +- 用 esbuild 打包 MCP widget bundle 到 `static/mcp-widget.bundle.js` + +### 从源码运行 + +```bash +node src/cli.js /path/to/file.pagx # 后台 +node src/cli.js --foreground /path/to/file.pagx # 前台 +node src/cli.js --mcp # MCP 模式 +``` + +### 全局链接测试 + +```bash +npm link +pagx-preview /path/to/file.pagx +npm unlink -g @libpag/pagx-preview +``` + +## 目录结构 + +``` +pagx-preview/ +├── src/ +│ ├── cli.js # CLI 入口,参数解析 +│ ├── daemon.js # 后台进程管理、stdio MCP 启动 +│ ├── server/ +│ │ ├── index.js # Express HTTP 服务器(SSE、静态资源、MCP 挂载) +│ │ ├── session.js # 文件监听 session(chokidar) +│ │ ├── fonts.js # 字体查找 +│ │ ├── font-cache.js # 字体懒下载 +│ │ └── lock.js # 进程锁 +│ └── mcp/ +│ ├── server.js # MCP Server 构建(stdio + HTTP) +│ └── tools.js # MCP 工具 + 资源定义 +├── static/ +│ ├── index.js / index.html / index.css # 浏览器客户端 +│ ├── viewer/ # pagx-viewer WASM + glue(prebuild 生成) +│ ├── player/ # pagx-player ESM bundle(prebuild 生成) +│ ├── ext/ # ext-apps SDK bundle(prebuild 生成) +│ ├── icons/ # 播放控制图标 +│ ├── mcp-widget.js # MCP Apps widget 源码 +│ ├── mcp-widget.html # MCP Apps widget HTML 壳 +│ └── mcp-widget.bundle.js # 打包后的 widget(prebuild 生成) +├── scripts/ +│ ├── prebuild.js # 产物复制 + bundle 构建 +│ └── check-artifacts.js # 发布前检查 +└── package.json +``` + +## 字体 + +首次运行时自动下载 NotoSansSC-Regular.otf + NotoColorEmoji.ttf 到 `~/.pagx/fonts/`。 +优先级:`--fonts` 参数 > `PAGX_FONTS_DIR` 环境变量 > `~/.pagx/fonts/` > libpag 仓库内 `resources/font/`。 + +设置 `PAGX_FONTS_NO_AUTO_DOWNLOAD=1` 禁用自动下载。 + +## 许可证 + +Apache-2.0 diff --git a/playground/pagx-preview/package-lock.json b/playground/pagx-preview/package-lock.json new file mode 100644 index 0000000000..344fea03b1 --- /dev/null +++ b/playground/pagx-preview/package-lock.json @@ -0,0 +1,1765 @@ +{ + "name": "@libpag/pagx-preview", + "version": "0.1.0-alpha.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@libpag/pagx-preview", + "version": "0.1.0-alpha.1", + "license": "Apache-2.0", + "dependencies": { + "@modelcontextprotocol/sdk": "^1.0.0", + "chokidar": "^3.6.0", + "express": "^4.21.1" + }, + "bin": { + "pagx-preview": "src/cli.js" + }, + "devDependencies": { + "@modelcontextprotocol/ext-apps": "^1.0.0" + }, + "engines": { + "node": ">=16.7.0" + } + }, + "node_modules/@hono/node-server": { + "version": "1.19.14", + "resolved": "https://mirrors.tencent.com/npm/@hono/node-server/-/node-server-1.19.14.tgz", + "integrity": "sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw==", + "license": "MIT", + "engines": { + "node": ">=18.14.1" + }, + "peerDependencies": { + "hono": "^4" + } + }, + "node_modules/@modelcontextprotocol/ext-apps": { + "version": "1.7.4", + "resolved": "https://mirrors.tencent.com/npm/@modelcontextprotocol/ext-apps/-/ext-apps-1.7.4.tgz", + "integrity": "sha512-QQqysE549cf/Y0VabBmAACXhj92EhB3t8yVct2BHbkWiPTFA1S91EqTVjYXXcZEefXU0pmHcdObhsNMcomJIOQ==", + "dev": true, + "license": "MIT", + "workspaces": [ + "examples/*" + ], + "dependencies": { + "@standard-schema/spec": "^1.1.0" + }, + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@modelcontextprotocol/sdk": "^1.29.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0", + "zod": "^3.25.0 || ^4.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/@modelcontextprotocol/sdk": { + "version": "1.29.0", + "resolved": "https://mirrors.tencent.com/npm/@modelcontextprotocol/sdk/-/sdk-1.29.0.tgz", + "integrity": "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ==", + "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" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@cfworker/json-schema": "^4.1.1", + "zod": "^3.25 || ^4.0" + }, + "peerDependenciesMeta": { + "@cfworker/json-schema": { + "optional": true + }, + "zod": { + "optional": false + } + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/body-parser": { + "version": "2.3.0", + "resolved": "https://mirrors.tencent.com/npm/body-parser/-/body-parser-2.3.0.tgz", + "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==", + "license": "MIT", + "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" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/body-parser/node_modules/content-type": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/content-type/-/content-type-2.0.0.tgz", + "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/content-disposition": { + "version": "1.1.0", + "resolved": "https://mirrors.tencent.com/npm/content-disposition/-/content-disposition-1.1.0.tgz", + "integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://mirrors.tencent.com/npm/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.tencent.com/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/express": { + "version": "5.2.1", + "resolved": "https://mirrors.tencent.com/npm/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "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" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://mirrors.tencent.com/npm/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "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" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite": { + "version": "0.7.3", + "resolved": "https://mirrors.tencent.com/npm/iconv-lite/-/iconv-lite-0.7.3.tgz", + "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://mirrors.tencent.com/npm/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://mirrors.tencent.com/npm/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://mirrors.tencent.com/npm/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://mirrors.tencent.com/npm/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://mirrors.tencent.com/npm/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/send": { + "version": "1.2.1", + "resolved": "https://mirrors.tencent.com/npm/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "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" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://mirrors.tencent.com/npm/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/type-is": { + "version": "2.1.0", + "resolved": "https://mirrors.tencent.com/npm/type-is/-/type-is-2.1.0.tgz", + "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==", + "license": "MIT", + "dependencies": { + "content-type": "^2.0.0", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/type-is/node_modules/content-type": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/content-type/-/content-type-2.0.0.tgz", + "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://mirrors.tencent.com/npm/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "dev": true, + "license": "MIT" + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://mirrors.tencent.com/npm/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://mirrors.tencent.com/npm/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://mirrors.tencent.com/npm/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://mirrors.tencent.com/npm/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://mirrors.tencent.com/npm/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://mirrors.tencent.com/npm/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "1.20.6", + "resolved": "https://mirrors.tencent.com/npm/body-parser/-/body-parser-1.20.6.tgz", + "integrity": "sha512-p5tAzS57i5MV9fZFDj9LeIiTZEufbSe2eDozP+ElheSUq1m74CRq1jI4mYNDdVs9vQztXFLuk/Gd6BWTdwRJ5g==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "~1.2.0", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "on-finished": "~2.4.1", + "qs": "~6.15.1", + "raw-body": "~2.5.3", + "type-is": "~1.6.18", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://mirrors.tencent.com/npm/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://mirrors.tencent.com/npm/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://mirrors.tencent.com/npm/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://mirrors.tencent.com/npm/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://mirrors.tencent.com/npm/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://mirrors.tencent.com/npm/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://mirrors.tencent.com/npm/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.7", + "resolved": "https://mirrors.tencent.com/npm/cookie-signature/-/cookie-signature-1.0.7.tgz", + "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==", + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.6", + "resolved": "https://mirrors.tencent.com/npm/cors/-/cors-2.8.6.tgz", + "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://mirrors.tencent.com/npm/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://mirrors.tencent.com/npm/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://mirrors.tencent.com/npm/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://mirrors.tencent.com/npm/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://mirrors.tencent.com/npm/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://mirrors.tencent.com/npm/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://mirrors.tencent.com/npm/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://mirrors.tencent.com/npm/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eventsource": { + "version": "3.0.7", + "resolved": "https://mirrors.tencent.com/npm/eventsource/-/eventsource-3.0.7.tgz", + "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", + "dependencies": { + "eventsource-parser": "^3.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/eventsource-parser": { + "version": "3.1.0", + "resolved": "https://mirrors.tencent.com/npm/eventsource-parser/-/eventsource-parser-3.1.0.tgz", + "integrity": "sha512-kJezFj9YFAMLeORyi7aCLxLbD5/qWMQnoMVlVPyHIll7lgRJCc3JVln9Vgl9nwQi0YkMnhdGTMNn7CkRRAptMg==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/express": { + "version": "4.22.2", + "resolved": "https://mirrors.tencent.com/npm/express/-/express-4.22.2.tgz", + "integrity": "sha512-IuL+Elrou2ZvCFHs18/CIzy2Nzvo25nZ1/D2eIZlz7c+QUayAcYoiM2BthCjs+EBHVpjYjcuLDAiCWgeIX3X1Q==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "~1.20.5", + "content-disposition": "~0.5.4", + "content-type": "~1.0.4", + "cookie": "~0.7.1", + "cookie-signature": "~1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.3.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "~0.1.12", + "proxy-addr": "~2.0.7", + "qs": "~6.15.1", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "~0.19.0", + "serve-static": "~1.16.2", + "setprototypeof": "1.2.0", + "statuses": "~2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express-rate-limit": { + "version": "8.6.0", + "resolved": "https://mirrors.tencent.com/npm/express-rate-limit/-/express-rate-limit-8.6.0.tgz", + "integrity": "sha512-XKJXDsASUOo0LLtFwW5hCcQGH0N4WQc/Rn8/Pvoia+TJFOkkFPvrtW9lZOeeNcxQJspvOIERMwiRLsVFlhHEkA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "ip-address": "^10.2.0" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/express-rate-limit" + }, + "peerDependencies": { + "express": ">= 4.11" + } + }, + "node_modules/express-rate-limit/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.tencent.com/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/express-rate-limit/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://mirrors.tencent.com/npm/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://mirrors.tencent.com/npm/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-uri": { + "version": "3.1.4", + "resolved": "https://mirrors.tencent.com/npm/fast-uri/-/fast-uri-3.1.4.tgz", + "integrity": "sha512-8JnbkQ4juDyvYs4mgFGQqg4yCYtFDtUtmp2QIQq11ZZe5CFQ5wcqm1rqDgAh/QdMySuBnPzMUiJUNZG5N/AiQw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://mirrors.tencent.com/npm/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.3.2", + "resolved": "https://mirrors.tencent.com/npm/finalhandler/-/finalhandler-1.3.2.tgz", + "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "statuses": "~2.0.2", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://mirrors.tencent.com/npm/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://mirrors.tencent.com/npm/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://mirrors.tencent.com/npm/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://mirrors.tencent.com/npm/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://mirrors.tencent.com/npm/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "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" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://mirrors.tencent.com/npm/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://mirrors.tencent.com/npm/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://mirrors.tencent.com/npm/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://mirrors.tencent.com/npm/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hono": { + "version": "4.12.31", + "resolved": "https://mirrors.tencent.com/npm/hono/-/hono-4.12.31.tgz", + "integrity": "sha512-zJIHFrl6bq3RDd2YusFNCDlM8qUprxKswyi/OPzPyzKDdyBXDqWx8bZlZ7R+saTdSTatUmb3O7K4SspGPaEOQg==", + "license": "MIT", + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://mirrors.tencent.com/npm/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://mirrors.tencent.com/npm/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://mirrors.tencent.com/npm/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ip-address": { + "version": "10.2.0", + "resolved": "https://mirrors.tencent.com/npm/ip-address/-/ip-address-10.2.0.tgz", + "integrity": "sha512-/+S6j4E9AHvW9SWMSEY9Xfy66O5PWvVEJ08O0y5JGyEKQpojb0K0GKpz/v5HJ/G0vi3D2sjGK78119oXZeE0qA==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://mirrors.tencent.com/npm/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://mirrors.tencent.com/npm/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://mirrors.tencent.com/npm/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://mirrors.tencent.com/npm/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://mirrors.tencent.com/npm/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://mirrors.tencent.com/npm/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/jose": { + "version": "6.2.4", + "resolved": "https://mirrors.tencent.com/npm/jose/-/jose-6.2.4.tgz", + "integrity": "sha512-N8acGzVsQy6M/fjFcxtysNc4Q379TcM5dM/qKkNtsHFji88yANnXTr7BLeP75iPnFwBfQzM/jg2BZ9+HZrHCZA==", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/json-schema-typed": { + "version": "8.0.2", + "resolved": "https://mirrors.tencent.com/npm/json-schema-typed/-/json-schema-typed-8.0.2.tgz", + "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==", + "license": "BSD-2-Clause" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://mirrors.tencent.com/npm/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://mirrors.tencent.com/npm/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://mirrors.tencent.com/npm/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://mirrors.tencent.com/npm/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://mirrors.tencent.com/npm/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://mirrors.tencent.com/npm/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://mirrors.tencent.com/npm/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://mirrors.tencent.com/npm/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://mirrors.tencent.com/npm/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://mirrors.tencent.com/npm/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://mirrors.tencent.com/npm/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://mirrors.tencent.com/npm/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://mirrors.tencent.com/npm/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://mirrors.tencent.com/npm/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://mirrors.tencent.com/npm/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.13", + "resolved": "https://mirrors.tencent.com/npm/path-to-regexp/-/path-to-regexp-0.1.13.tgz", + "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==", + "license": "MIT" + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://mirrors.tencent.com/npm/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkce-challenge": { + "version": "5.0.1", + "resolved": "https://mirrors.tencent.com/npm/pkce-challenge/-/pkce-challenge-5.0.1.tgz", + "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==", + "license": "MIT", + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://mirrors.tencent.com/npm/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.15.3", + "resolved": "https://mirrors.tencent.com/npm/qs/-/qs-6.15.3.tgz", + "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==", + "license": "BSD-3-Clause", + "dependencies": { + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://mirrors.tencent.com/npm/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.3", + "resolved": "https://mirrors.tencent.com/npm/raw-body/-/raw-body-2.5.3.tgz", + "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://mirrors.tencent.com/npm/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://mirrors.tencent.com/npm/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://mirrors.tencent.com/npm/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/router/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://mirrors.tencent.com/npm/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/router/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://mirrors.tencent.com/npm/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/router/node_modules/path-to-regexp": { + "version": "8.4.2", + "resolved": "https://mirrors.tencent.com/npm/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://mirrors.tencent.com/npm/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://mirrors.tencent.com/npm/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/send": { + "version": "0.19.2", + "resolved": "https://mirrors.tencent.com/npm/send/-/send-0.19.2.tgz", + "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.4.1", + "range-parser": "~1.2.1", + "statuses": "~2.0.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://mirrors.tencent.com/npm/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/serve-static": { + "version": "1.16.3", + "resolved": "https://mirrors.tencent.com/npm/serve-static/-/serve-static-1.16.3.tgz", + "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "~0.19.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://mirrors.tencent.com/npm/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://mirrors.tencent.com/npm/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.1", + "resolved": "https://mirrors.tencent.com/npm/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", + "license": "MIT", + "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" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "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" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://mirrors.tencent.com/npm/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://mirrors.tencent.com/npm/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://mirrors.tencent.com/npm/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://mirrors.tencent.com/npm/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://mirrors.tencent.com/npm/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/zod": { + "version": "4.4.3", + "resolved": "https://mirrors.tencent.com/npm/zod/-/zod-4.4.3.tgz", + "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-to-json-schema": { + "version": "3.25.2", + "resolved": "https://mirrors.tencent.com/npm/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz", + "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==", + "license": "ISC", + "peerDependencies": { + "zod": "^3.25.28 || ^4" + } + } + } +} diff --git a/playground/pagx-preview/package.json b/playground/pagx-preview/package.json new file mode 100644 index 0000000000..cb0d2741c6 --- /dev/null +++ b/playground/pagx-preview/package.json @@ -0,0 +1,54 @@ +{ + "name": "@libpag/pagx-preview", + "version": "0.1.0-alpha.1", + "description": "Local PAGX preview server with live reload. Run `pagx-preview file.pagx` to view a PAGX in the browser with automatic refresh on file changes.", + "license": "Apache-2.0", + "author": "Tencent", + "keywords": [ + "pagx", + "pag", + "libpag", + "preview", + "live-reload", + "animation" + ], + "repository": { + "type": "git", + "url": "https://github.com/Tencent/libpag", + "directory": "playground/pagx-preview" + }, + "bugs": { + "url": "https://github.com/Tencent/libpag/issues" + }, + "homepage": "https://github.com/Tencent/libpag#readme", + "type": "module", + "engines": { + "node": ">=16.7.0" + }, + "bin": { + "pagx-preview": "src/cli.js" + }, + "files": [ + "src/", + "static/", + "scripts/check-artifacts.js", + "README.md" + ], + "scripts": { + "prebuild": "node scripts/prebuild.js", + "preview": "node src/cli.js", + "prepack": "node scripts/prebuild.js && node scripts/check-artifacts.js", + "prepublishOnly": "node scripts/check-artifacts.js" + }, + "dependencies": { + "@modelcontextprotocol/sdk": "^1.0.0", + "chokidar": "^3.6.0", + "express": "^4.21.1" + }, + "devDependencies": { + "@modelcontextprotocol/ext-apps": "^1.0.0" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/playground/pagx-preview/scripts/check-artifacts.js b/playground/pagx-preview/scripts/check-artifacts.js new file mode 100644 index 0000000000..31fc9e3887 --- /dev/null +++ b/playground/pagx-preview/scripts/check-artifacts.js @@ -0,0 +1,77 @@ +#!/usr/bin/env node +///////////////////////////////////////////////////////////////////////////////////////////////// +// +// Tencent is pleased to support the open source community by making libpag available. +// +// Copyright (C) 2026 Tencent. 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. +// +///////////////////////////////////////////////////////////////////////////////////////////////// + +// Guard for `npm publish` / `npm pack`: verifies that prebuild has staged the pagx-viewer +// artifacts and playback icons into static/, otherwise the published tarball would be broken. +// Mirrors the intent of cli/npm/scripts/check-binaries.js. + +import fs from 'fs'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const PKG_DIR = path.resolve(__dirname, '..'); + +const REQUIRED = [ + 'static/index.html', + 'static/index.css', + 'static/index.js', + 'static/viewer/info.json', + 'static/player/pagx-player.esm.js', + 'static/icons/play.png', + 'static/icons/pause.png', + 'static/icons/previous.png', + 'static/icons/next.png', +]; + +function main() { + if (process.env.PAGX_PREVIEW_SKIP_ARTIFACT_CHECK === '1') { + process.stderr.write('check-artifacts: skipped (PAGX_PREVIEW_SKIP_ARTIFACT_CHECK=1)\n'); + return; + } + + const missing = REQUIRED.filter((rel) => !fs.existsSync(path.join(PKG_DIR, rel))); + if (missing.length > 0) { + process.stderr.write('check-artifacts: ERROR: missing required artifacts:\n'); + for (const rel of missing) process.stderr.write(` ${rel}\n`); + process.stderr.write( + 'check-artifacts: run `npm run prebuild` from the pagx-preview directory ' + + 'and make sure pagx-viewer has been built first.\n' + ); + process.exit(1); + } + + // Extra: the wasm/glue files referenced by info.json must exist too. + const infoPath = path.join(PKG_DIR, 'static/viewer/info.json'); + const info = JSON.parse(fs.readFileSync(infoPath, 'utf8')); + for (const rel of [info.wasmFile, info.glueFile]) { + const abs = path.join(PKG_DIR, 'static/viewer', rel); + if (!fs.existsSync(abs)) { + process.stderr.write( + `check-artifacts: ERROR: info.json references ${rel} but the file is missing.\n` + ); + process.exit(1); + } + } + + process.stderr.write('check-artifacts: all required artifacts present.\n'); +} + +main(); diff --git a/playground/pagx-preview/scripts/prebuild.js b/playground/pagx-preview/scripts/prebuild.js new file mode 100644 index 0000000000..541fc7b844 --- /dev/null +++ b/playground/pagx-preview/scripts/prebuild.js @@ -0,0 +1,214 @@ +#!/usr/bin/env node +///////////////////////////////////////////////////////////////////////////////////////////////// +// +// Tencent is pleased to support the open source community by making libpag available. +// +// Copyright (C) 2026 Tencent. 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. +// +///////////////////////////////////////////////////////////////////////////////////////////////// + +// Detects which pagx-viewer build is available (multi-threaded or single-threaded), copies its +// artifacts into static/viewer/, and writes info.json so both the server (COOP/COEP headers) +// and the client (dynamic import path) know which variant is in use. Also copies the compiled +// pagx-player esm bundle into static/player/ so the client can import it without going through +// a bundler; pagx-player is workspace-local and has no npm publish target, so the preview owns +// the file copy the same way it owns the pagx-viewer copy. + +import fs from 'fs'; +import path from 'path'; +import { execSync } from 'child_process'; +import { fileURLToPath } from 'url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const PREVIEW_DIR = path.dirname(__dirname); +const VIEWER_LIB_DIR = path.resolve(PREVIEW_DIR, '../pagx-viewer/lib'); +const PLAYER_LIB_DIR = path.resolve(PREVIEW_DIR, '../pagx-player/lib'); +const OUTPUT_DIR = path.join(PREVIEW_DIR, 'static', 'viewer'); +const PLAYER_OUTPUT_DIR = path.join(PREVIEW_DIR, 'static', 'player'); + +// (infix, humanLabel, isMultiThreaded). Order matters: MT is preferred when both are present +// so the preview matches pagx-playground's default flavor. +const VARIANTS = [ + { infix: '', label: 'multi-threaded', multiThreaded: true }, + { infix: '.st', label: 'single-threaded', multiThreaded: false }, +]; + +function detectVariant() { + for (const variant of VARIANTS) { + const wasm = path.join(VIEWER_LIB_DIR, `pagx-viewer${variant.infix}.wasm`); + const glue = path.join(VIEWER_LIB_DIR, `pagx-viewer${variant.infix}.esm.js`); + if (fs.existsSync(wasm) && fs.existsSync(glue)) { + return variant; + } + } + return null; +} + +function cleanOldArtifacts() { + if (!fs.existsSync(OUTPUT_DIR)) return; + for (const entry of fs.readdirSync(OUTPUT_DIR)) { + if (entry.startsWith('pagx-viewer') || entry === 'info.json') { + fs.unlinkSync(path.join(OUTPUT_DIR, entry)); + } + } +} + +function copyPagxPlayerArtifacts() { + if (!fs.existsSync(PLAYER_LIB_DIR)) { + console.error('\npagx-preview prebuild: ERROR: pagx-player has not been built.'); + console.error(`Looked in: ${PLAYER_LIB_DIR}`); + console.error('Please build pagx-player first:'); + console.error(` cd ${path.dirname(PLAYER_LIB_DIR)} && npm install && npm run build\n`); + process.exit(1); + } + const bundleFile = 'pagx-player.esm.js'; + const src = path.join(PLAYER_LIB_DIR, bundleFile); + if (!fs.existsSync(src)) { + console.error(`\npagx-preview prebuild: ERROR: ${bundleFile} not found in ${PLAYER_LIB_DIR}.`); + console.error('Please rebuild pagx-player:'); + console.error(` cd ${path.dirname(PLAYER_LIB_DIR)} && npm run build\n`); + process.exit(1); + } + if (!fs.existsSync(PLAYER_OUTPUT_DIR)) { + fs.mkdirSync(PLAYER_OUTPUT_DIR, { recursive: true }); + } + // Clean previous copies so an older bundle can't shadow the newly built one. + for (const entry of fs.readdirSync(PLAYER_OUTPUT_DIR)) { + if (entry.startsWith('pagx-player')) { + fs.unlinkSync(path.join(PLAYER_OUTPUT_DIR, entry)); + } + } + fs.copyFileSync(src, path.join(PLAYER_OUTPUT_DIR, bundleFile)); + console.log(` Copied: ${bundleFile}`); + // Also copy the source map when the debug build was produced; harmless when absent. + const mapFile = bundleFile + '.map'; + const mapSrc = path.join(PLAYER_LIB_DIR, mapFile); + if (fs.existsSync(mapSrc)) { + fs.copyFileSync(mapSrc, path.join(PLAYER_OUTPUT_DIR, mapFile)); + console.log(` Copied: ${mapFile}`); + } +} + +// Copies the @modelcontextprotocol/ext-apps browser bundle (app-with-deps.js) into static/ext/ +// so the MCP widget HTML can import it from the same origin without depending on esm.sh. The +// bundle is self-contained (includes all transitive runtime deps) so no further bundling is +// needed. If the package is not installed (e.g. dev environment without MCP support), the copy +// is skipped with a warning — the widget will fail to load but the rest of pagx-preview works. +function copyExtAppsBundle() { + const EXT_OUTPUT_DIR = path.join(PREVIEW_DIR, 'static', 'ext'); + // Try to locate the ext-apps package via node_modules resolution. The package may be hoisted + // to a parent node_modules in a monorepo / npm workspace setup, so we walk up from the preview + // dir rather than hard-coding a single path. + const candidatePaths = [ + path.join(PREVIEW_DIR, 'node_modules', '@modelcontextprotocol', 'ext-apps'), + path.join(path.dirname(PREVIEW_DIR), 'node_modules', '@modelcontextprotocol', 'ext-apps'), + path.join(path.dirname(path.dirname(PREVIEW_DIR)), 'node_modules', '@modelcontextprotocol', 'ext-apps'), + ]; + const pkgDir = candidatePaths.find((p) => fs.existsSync(path.join(p, 'package.json'))); + if (!pkgDir) { + console.log(' Skipped: @modelcontextprotocol/ext-apps not installed (MCP widget disabled)'); + return; + } + const src = path.join(pkgDir, 'dist', 'src', 'app-with-deps.js'); + if (!fs.existsSync(src)) { + console.log(` Skipped: ext-apps bundle not found at ${src}`); + return; + } + if (!fs.existsSync(EXT_OUTPUT_DIR)) { + fs.mkdirSync(EXT_OUTPUT_DIR, { recursive: true }); + } + fs.copyFileSync(src, path.join(EXT_OUTPUT_DIR, 'app-with-deps.js')); + console.log(' Copied: ext/app-with-deps.js'); +} + +function main() { + const variant = detectVariant(); + if (!variant) { + console.error('\npagx-preview prebuild: ERROR: no pagx-viewer build found.'); + console.error(`Looked in: ${VIEWER_LIB_DIR}`); + console.error('Please build pagx-viewer first (either variant works):'); + console.error(` cd ${path.dirname(VIEWER_LIB_DIR)} && npm run build:debug # multi-threaded`); + console.error(` cd ${path.dirname(VIEWER_LIB_DIR)} && npm run build:debug:st # single-threaded\n`); + process.exit(1); + } + + console.log(`pagx-preview prebuild: detected pagx-viewer (${variant.label}) build.`); + + if (!fs.existsSync(OUTPUT_DIR)) { + fs.mkdirSync(OUTPUT_DIR, { recursive: true }); + } + cleanOldArtifacts(); + + const files = [`pagx-viewer${variant.infix}.wasm`, `pagx-viewer${variant.infix}.esm.js`]; + for (const file of files) { + fs.copyFileSync(path.join(VIEWER_LIB_DIR, file), path.join(OUTPUT_DIR, file)); + console.log(` Copied: ${file}`); + } + + // Consumed by both the server (to decide whether COOP/COEP headers are required) and the + // client (to dynamically import the correct glue file). + const info = { + variant: variant.multiThreaded ? 'mt' : 'st', + multiThreaded: variant.multiThreaded, + glueFile: `pagx-viewer${variant.infix}.esm.js`, + wasmFile: `pagx-viewer${variant.infix}.wasm`, + }; + fs.writeFileSync( + path.join(OUTPUT_DIR, 'info.json'), + JSON.stringify(info, null, 2) + '\n' + ); + console.log(` Wrote: info.json (${info.variant})`); + + copyPagxPlayerArtifacts(); + copyExtAppsBundle(); + buildMcpWidgetBundle(); + + console.log('pagx-preview prebuild: done.'); +} + +// Builds the MCP widget bundle: a single minified ES module that inlines app-with-deps.js, +// pagx-player.esm.js, and mcp-widget.js. This bundle is base64-encoded and injected into the +// widget HTML at runtime by the readResource handler so the MCP Apps sandbox iframe does not +// need to load external scripts (which many hosts block). +function buildMcpWidgetBundle() { + const STATIC_DIR = path.join(PREVIEW_DIR, 'static'); + const widgetSrc = path.join(STATIC_DIR, 'mcp-widget.js'); + if (!fs.existsSync(widgetSrc)) { + console.log(' Skipped: mcp-widget.js not found (MCP widget bundle not built)'); + return; + } + // Create a temp entry with relative imports (esbuild cannot resolve absolute /static/... paths) + const entryPath = path.join(STATIC_DIR, '_mcp_bundle_entry.js'); + let src = fs.readFileSync(widgetSrc, 'utf8'); + src = src + .replace(/from '\/static\/ext\/app-with-deps\.js'/g, "from './ext/app-with-deps.js'") + .replace(/from '\/static\/player\/pagx-player\.esm\.js'/g, "from './player/pagx-player.esm.js'"); + fs.writeFileSync(entryPath, src); + try { + const outPath = path.join(STATIC_DIR, 'mcp-widget.bundle.js'); + execSync(`npx esbuild "${entryPath}" --bundle --format=esm --outfile="${outPath}" --minify`, { + cwd: PREVIEW_DIR, + stdio: 'pipe', + }); + console.log(` Built: mcp-widget.bundle.js (${(fs.statSync(outPath).size / 1024).toFixed(0)} KB)`); + } catch (err) { + console.log(` Warning: mcp-widget.bundle.js build failed: ${err.message}`); + console.log(' The MCP widget will fall back to external script loading.'); + } finally { + if (fs.existsSync(entryPath)) fs.unlinkSync(entryPath); + } +} + +main(); diff --git a/playground/pagx-preview/src/cli.js b/playground/pagx-preview/src/cli.js new file mode 100755 index 0000000000..6815cc014c --- /dev/null +++ b/playground/pagx-preview/src/cli.js @@ -0,0 +1,343 @@ +#!/usr/bin/env node +///////////////////////////////////////////////////////////////////////////////////////////////// +// +// Tencent is pleased to support the open source community by making libpag available. +// +// Copyright (C) 2026 Tencent. 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. +// +///////////////////////////////////////////////////////////////////////////////////////////////// + +import fs from 'fs'; +import http from 'http'; +import path from 'path'; +import { execFile } from 'child_process'; +import { fileURLToPath } from 'url'; +import { probeLiveServer, readLock, clearLock } from './server/lock.js'; +import { runServer, runStdioServer, spawnDaemon, stopDaemon, printLog, LOG_FILE } from './daemon.js'; + +const USAGE = `Usage: pagx-preview [options] + pagx-preview --mcp + pagx-preview stop + pagx-preview --log + +Options: + --mcp Run as a self-bootstrapping stdio MCP server (see "MCP / CodeBuddy" below). + No file argument is needed; files are opened via the preview_pagx tool. + --port Bind to a specific port (default: 0 = system-assigned) + For the HTTP MCP endpoint, pin a port (e.g. --port 7300) so the mcp.json URL + stays stable across restarts. Not needed for --mcp (stdio) mode. + --host Bind host (default: 127.0.0.1) + --fonts Directory containing NotoSansSC-Regular.otf / NotoColorEmoji.ttf + (falls back to PAGX_FONTS_DIR env, then a libpag checkout if detected) + --no-open Do not open the browser automatically (auto-enabled when stdout isn't a TTY) + --json Emit a single-line JSON record ({url, pid, logFile, reused}) instead of the + human-readable banner. Implies --no-open. Intended for IDE / agent callers. + --foreground Run the server in the foreground (default: run detached in the background) + --log Print the server's log file (${LOG_FILE}) and exit + -h, --help Show this help + +Commands: + stop Stop the background server (if any) + +MCP / CodeBuddy: + Recommended (self-starting, stdio). The MCP client spawns pagx-preview on demand and manages its + lifetime; the user never starts a server manually. Add to ~/.codebuddy/mcp.json: + { "mcpServers": { "pagx-preview": { "command": "pagx-preview", "args": ["--mcp"] } } } + Then just ask the assistant to preview a .pagx file; the preview_pagx tool renders an inline + widget and returns a url you can open in a browser / webview. + + Alternative (HTTP, manual start). Pre-start a server, then point mcp.json at its /mcp endpoint: + pagx-preview --port 7300 + { "mcpServers": { "pagx-preview": { "type": "http", "url": "http://127.0.0.1:7300/mcp" } } } +`; + +function parseArgs(argv) { + const args = { + port: 0, + host: '127.0.0.1', + // Default: open when stdout is a real TTY. Non-TTY invocations (piped stdout, IDE agents, + // CI) almost always want the URL emitted but no browser stealing focus. --no-open forces + // it off explicitly; --json also implies no-open. + open: process.stdout.isTTY === true, + json: false, + file: null, + fonts: null, + foreground: false, + // Run as a stdio MCP server instead of an HTTP preview daemon. Self-bootstrapping entry used + // by MCP clients (CodeBuddy) that spawn pagx-preview on demand. + mcp: false, + // Internal-only: instructs cli.js to run the server directly in this process instead of + // spawning a daemon. Used by spawnDaemon() when it re-execs itself. + serverMode: false, + command: null, + }; + for (let i = 0; i < argv.length; i++) { + const a = argv[i]; + if (a === '-h' || a === '--help') { + args.help = true; + } else if (a === '--no-open') { + args.open = false; + } else if (a === '--json') { + args.json = true; + args.open = false; + } else if (a === '--foreground') { + args.foreground = true; + } else if (a === '--mcp') { + args.mcp = true; + } else if (a === '--__server') { + args.serverMode = true; + } else if (a === '--log') { + args.command = 'log'; + } else if (a === '--port') { + const value = argv[++i]; + const parsed = Number.parseInt(value, 10); + if (!Number.isFinite(parsed) || parsed < 0 || parsed > 65535) { + throw new Error(`invalid --port value: ${value}`); + } + args.port = parsed; + } else if (a === '--host') { + args.host = argv[++i]; + } else if (a === '--fonts') { + args.fonts = argv[++i]; + } else if (a === 'stop' && args.file === null && args.command === null) { + args.command = 'stop'; + } else if (a.startsWith('-')) { + throw new Error(`unknown option: ${a}`); + } else if (args.file === null) { + args.file = a; + } else { + throw new Error(`unexpected argument: ${a}`); + } + } + return args; +} + +function openBrowser(url) { + if (process.platform === 'darwin') { + execFile('open', [url]); + } else if (process.platform === 'win32') { + execFile('cmd', ['/c', 'start', '', url]); + } else { + execFile('xdg-open', [url]); + } +} + +/** POST /sessions on the given running server to reuse or create a session. */ +function requestSession({ host, port }, filePath) { + return new Promise((resolve, reject) => { + const body = JSON.stringify({ file: filePath }); + const req = http.request( + { + host, + port, + method: 'POST', + path: '/sessions', + headers: { + 'Content-Type': 'application/json', + 'Content-Length': Buffer.byteLength(body), + }, + timeout: 2000, + }, + (res) => { + const chunks = []; + res.on('data', (chunk) => chunks.push(chunk)); + res.on('end', () => { + const text = Buffer.concat(chunks).toString('utf8'); + if (res.statusCode !== 200) { + reject(new Error(`server returned ${res.statusCode}: ${text}`)); + return; + } + try { + resolve(JSON.parse(text)); + } catch (err) { + reject(new Error(`invalid session response: ${err.message}`)); + } + }); + } + ); + req.on('error', reject); + req.on('timeout', () => { + req.destroy(); + reject(new Error('session request timed out')); + }); + req.write(body); + req.end(); + }); +} + +function sessionUrl(lock, sessionPath) { + const displayHost = lock.host === '0.0.0.0' ? 'localhost' : (lock.host || '127.0.0.1'); + return `http://${displayHost}:${lock.port}${sessionPath}`; +} + +export async function run(argv) { + let args; + try { + args = parseArgs(argv); + } catch (err) { + process.stderr.write(`pagx-preview: ${err.message}\n\n${USAGE}`); + process.exit(2); + } + + if (args.help) { + process.stdout.write(USAGE); + process.exit(0); + } + + // Stdio MCP mode: keep this process in the foreground speaking MCP over stdin/stdout. No file + // argument is required — files are opened lazily through the preview_pagx tool. Handled before + // the file-required checks below so `pagx-preview --mcp` works with no positional argument. + if (args.mcp) { + await runStdioServer({ port: args.port, host: args.host, fontsDir: args.fonts }); + return; + } + + // Internal server mode: the detached child re-executes this script with --__server so the + // actual event loop that hosts express + chokidar lives here. + if (args.serverMode) { + if (!args.file) { + process.stderr.write('pagx-preview: internal error: --__server without file\n'); + process.exit(2); + } + const absoluteFile = path.resolve(args.file); + await runServer({ + entryFile: absoluteFile, + port: args.port, + host: args.host, + fontsDir: args.fonts, + }); + return; + } + + if (args.command === 'log') { + printLog(); + return; + } + if (args.command === 'stop') { + await stopDaemon(); + return; + } + + if (args.file === null) { + process.stdout.write(USAGE); + process.exit(2); + } + + const absoluteFile = path.resolve(args.file); + if (!fs.existsSync(absoluteFile)) { + process.stderr.write(`pagx-preview: file not found: ${absoluteFile}\n`); + process.exit(1); + } + + // 1) Try to reuse an already-running server. + const existing = await probeLiveServer(); + if (existing) { + try { + const info = await requestSession(existing, absoluteFile); + const url = sessionUrl(existing, info.url); + if (args.json) { + emitJson({ url, pid: existing.pid, logFile: LOG_FILE, reused: true }); + return; + } + // Only auto-open the browser when there isn't already a live tab for this session. + // Chrome (and several other browsers) treat `open ` as "open a new tab" even + // when the URL is already displayed elsewhere, which piles up duplicate tabs on repeated + // pagx-preview invocations. When a tab is already active we surface the URL and rely on + // the user's browser being one Cmd+Tab away. + if (info.reused && info.hadActiveTab) { + process.stdout.write(`pagx-preview: already open at ${url}\n`); + } else { + process.stdout.write(`pagx-preview: ${url}\n`); + if (args.open) openBrowser(url); + } + return; + } catch (err) { + process.stderr.write( + `pagx-preview: existing server unreachable (${err.message}); starting a new one\n` + ); + clearLock(); + } + } + + // 2) Foreground mode: run the server directly in this process. Useful for debugging or when + // the user wants Ctrl+C to control the server lifetime. + if (args.foreground) { + await runServer({ + entryFile: absoluteFile, + port: args.port, + host: args.host, + fontsDir: args.fonts, + }); + return; + } + + // 3) Default: spawn a detached background server, then hand back the shell prompt. + let lock; + try { + lock = await spawnDaemon({ + entryFile: absoluteFile, + port: args.port, + host: args.host, + fontsDir: args.fonts, + }); + } catch (err) { + process.stderr.write(`pagx-preview: ${err.message}\n`); + process.exit(1); + } + + // The daemon just came up; ask it for the session URL so we can print it and open a browser. + let info; + try { + info = await requestSession(lock, absoluteFile); + } catch (err) { + process.stderr.write(`pagx-preview: server started but session request failed: ${err.message}\n`); + process.exit(1); + } + + const url = sessionUrl(lock, info.url); + if (args.json) { + emitJson({ url, pid: lock.pid, logFile: LOG_FILE, reused: false }); + return; + } + process.stdout.write(`pagx-preview: ${url}\n`); + process.stdout.write( + `pagx-preview: server running in background (pid ${lock.pid}, log ${LOG_FILE})\n` + ); + process.stdout.write('pagx-preview: run `pagx-preview stop` to stop it.\n'); + if (args.open) openBrowser(url); +} + +// Emit a single-line JSON record on stdout. Kept as a one-liner (no trailing newline concerns +// beyond the write itself) so callers can pipe pagx-preview into `jq` or `JSON.parse(line)` +// without splitting on multiple messages. +function emitJson(payload) { + process.stdout.write(JSON.stringify(payload) + '\n'); +} + +// When executed directly (node src/cli.js ..., or via the bin symlink created by npm link / +// npm install -g), run immediately. Both sides are resolved through realpath so a symlinked +// entry (which is how npm exposes the bin script) still matches the module file. +function isDirectlyInvoked() { + const modulePath = fileURLToPath(import.meta.url); + const entry = process.argv[1]; + if (!entry) return false; + try { + return fs.realpathSync(entry) === fs.realpathSync(modulePath); + } catch (_) { + return path.resolve(entry) === modulePath; + } +} + +if (isDirectlyInvoked()) { + run(process.argv.slice(2)); +} diff --git a/playground/pagx-preview/src/daemon.js b/playground/pagx-preview/src/daemon.js new file mode 100644 index 0000000000..916574bebc --- /dev/null +++ b/playground/pagx-preview/src/daemon.js @@ -0,0 +1,296 @@ +///////////////////////////////////////////////////////////////////////////////////////////////// +// +// Tencent is pleased to support the open source community by making libpag available. +// +// Copyright (C) 2026 Tencent. 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. +// +///////////////////////////////////////////////////////////////////////////////////////////////// + +// Detached server helpers. +// +// A `pagx-preview ` invocation is expected to return the shell prompt immediately after the +// server is reachable, so the user can keep issuing commands. We achieve this by re-executing +// this script with `--__server` (an internal-only flag) as a detached child process whose stdio +// is redirected to ~/.pagx/preview.log. The parent process waits until the lock file appears +// (indicating the child has bound its port) and then exits. + +import fs from 'fs'; +import os from 'os'; +import path from 'path'; +import { spawn } from 'child_process'; +import { fileURLToPath } from 'url'; +import { readLock, writeLock, clearLock } from './server/lock.js'; +import { startServer } from './server/index.js'; +import { connectStdioMcpServer } from './mcp/server.js'; + +const HOME_DIR = path.join(os.homedir(), '.pagx'); +export const LOG_FILE = path.join(HOME_DIR, 'preview.log'); +const SPAWN_READY_TIMEOUT_MS = 3000; +const SPAWN_POLL_INTERVAL_MS = 50; + +/** Ensures ~/.pagx/ exists. */ +function ensureHomeDir() { + fs.mkdirSync(HOME_DIR, { recursive: true }); +} + +/** Truncates the log file so each daemon lifetime starts with a fresh log. */ +function truncateLog() { + ensureHomeDir(); + try { + fs.writeFileSync(LOG_FILE, ''); + } catch (_) { + // ignore + } +} + +/** Opens the log file for the child stdio. Returns a file descriptor suitable for spawn(). */ +function openLogFd() { + ensureHomeDir(); + // Append mode so the child can keep writing after the parent detaches; truncateLog() already + // reset the contents before we get here, so the log still starts empty on this lifetime. + return fs.openSync(LOG_FILE, 'a'); +} + +/** + * Runs the actual preview server in the current process. Used by: + * - The detached child spawned by spawnDaemon() below. + * - `pagx-preview --foreground` for debugging. + */ +export async function runServer({ entryFile, port, host, fontsDir }) { + let server; + try { + server = await startServer({ entryFile, port, host, fontsDir }); + } catch (err) { + process.stderr.write(`pagx-preview: failed to start server: ${err.message}\n`); + process.exit(1); + } + + try { + writeLock({ port: server.port, host: server.host, pid: process.pid }); + } catch (err) { + process.stderr.write(`pagx-preview: warning: could not write lock file: ${err.message}\n`); + } + + process.stdout.write(`pagx-preview: watching ${entryFile}\n`); + if (server.fontsDir) { + process.stdout.write(`pagx-preview: fonts from ${server.fontsDir}\n`); + } else if (server.useLazyDownload) { + process.stdout.write('pagx-preview: fonts downloading in background; text may render blank until ready\n'); + } else { + process.stderr.write( + 'pagx-preview: no fonts directory found. Text glyphs will render blank. ' + + 'Pass --fonts or set PAGX_FONTS_DIR to a directory containing ' + + 'NotoSansSC-Regular.otf and NotoColorEmoji.ttf.\n' + ); + } + process.stdout.write(`pagx-preview: ${server.url}\n`); + + let shuttingDown = false; + const shutdown = async (reason) => { + if (shuttingDown) { + process.stderr.write('pagx-preview: force exit.\n'); + process.exit(1); + } + shuttingDown = true; + process.stdout.write(`\npagx-preview: ${reason}, shutting down...\n`); + const forceTimer = setTimeout(() => { + process.stderr.write('pagx-preview: graceful shutdown timed out, forcing exit.\n'); + process.exit(1); + }, 3000); + forceTimer.unref(); + try { + await server.close(); + } finally { + clearLock(); + process.exit(0); + } + }; + process.on('SIGINT', () => shutdown('received SIGINT')); + process.on('SIGTERM', () => shutdown('received SIGTERM')); + server.onIdle(() => shutdown('all tabs closed')); +} + +/** + * Runs pagx-preview as a self-bootstrapping stdio MCP server (`pagx-preview --mcp`). This is the + * entry an MCP client (CodeBuddy) spawns on demand via a `command` config, so the user never has + * to start a server manually. + * + * Two things live in this single process: + * 1. An in-process preview HTTP server (for the widget iframe and the browser-openable webview). + * 2. An MCP server speaking JSON-RPC over stdin/stdout. + * They share the same session maps directly (no network hop). Process lifetime is owned by the MCP + * client through stdin: when the client disconnects, the transport closes and we tear everything + * down. Crucially we do NOT register server.onIdle() here — unlike the daemon, this server must + * stay alive even when no browser tab is open, otherwise the widget/webview would hit a dead port. + */ +export async function runStdioServer({ port, host, fontsDir }) { + // stdout is reserved for the MCP JSON-RPC framing (StdioServerTransport writes there directly). + // Redirect console logging to stderr so any stray log line can't corrupt the protocol stream. + // eslint-disable-next-line no-console + console.log = (...parts) => process.stderr.write(parts.join(' ') + '\n'); + // eslint-disable-next-line no-console + console.info = console.log; + + let server; + try { + server = await startServer({ entryFile: null, port, host, fontsDir }); + } catch (err) { + process.stderr.write(`pagx-preview: failed to start server: ${err.message}\n`); + process.exit(1); + return; + } + process.stderr.write(`pagx-preview: MCP stdio server ready (preview at ${server.url})\n`); + + const mcp = await connectStdioMcpServer({ + sessions: server.sessions, + dropSessions: server.dropSessions, + createOrGetSession: server.createOrGetSession, + staticDir: server.staticDir, + getServerBaseUrl: server.getServerBaseUrl, + }); + + let shuttingDown = false; + const shutdown = async () => { + if (shuttingDown) process.exit(1); + shuttingDown = true; + try { + await mcp.close(); + } catch (_) { + // ignore + } + try { + await server.close(); + } catch (_) { + // ignore + } + process.exit(0); + }; + // The transport closes when the client disconnects stdin; mirror that into a full teardown. + mcp.onclose = shutdown; + process.on('SIGINT', shutdown); + process.on('SIGTERM', shutdown); +} + +/** + * Spawns this same script as a detached child running the server, then waits until the child + * writes its lock file (or SPAWN_READY_TIMEOUT_MS elapses). + * + * Returns the lock payload on success, or throws with the log tail on failure. + */ +export async function spawnDaemon({ entryFile, port, host, fontsDir }) { + ensureHomeDir(); + clearLock(); + truncateLog(); + + const scriptPath = fileURLToPath(new URL('./cli.js', import.meta.url)); + const childArgs = [scriptPath, '--__server', entryFile]; + if (port) childArgs.push('--port', String(port)); + if (host) childArgs.push('--host', host); + if (fontsDir) childArgs.push('--fonts', fontsDir); + + const logFd = openLogFd(); + const child = spawn(process.execPath, childArgs, { + detached: true, + stdio: ['ignore', logFd, logFd], + // windowsHide keeps `cmd.exe` from popping a console window when the parent is a GUI shell. + windowsHide: true, + }); + // Break the parent<->child reference so the parent can exit while the child keeps running. + child.unref(); + + // Poll for the lock file. The child writes it after successfully binding its port; anything + // before that (missing wasm artifacts, bad --port, etc.) will show up in the log tail below. + const started = Date.now(); + let lastError = null; + child.on('error', (err) => { + lastError = err; + }); + + while (Date.now() - started < SPAWN_READY_TIMEOUT_MS) { + const lock = readLock(); + if (lock && lock.pid === child.pid) return lock; + if (child.exitCode !== null) break; + await sleep(SPAWN_POLL_INTERVAL_MS); + } + + // Give the child one last chance in case the exit happened right before we sampled. + const finalLock = readLock(); + if (finalLock && finalLock.pid === child.pid) return finalLock; + + const tail = readLogTail(20); + const err = new Error( + `daemon failed to start${lastError ? `: ${lastError.message}` : ''}\n` + + (tail ? `\n---- last 20 log lines ----\n${tail}` : '') + ); + throw err; +} + +/** Returns the last N lines of the log file, or an empty string if unreadable. */ +export function readLogTail(lines = 40) { + try { + const text = fs.readFileSync(LOG_FILE, 'utf8'); + const arr = text.split(/\r?\n/); + return arr.slice(-lines - 1).join('\n'); + } catch (_) { + return ''; + } +} + +/** Sends SIGTERM to the daemon process referenced by the lock file. */ +export async function stopDaemon() { + const lock = readLock(); + if (!lock) { + process.stdout.write('pagx-preview: no running server.\n'); + return; + } + try { + process.kill(lock.pid, 'SIGTERM'); + } catch (err) { + if (err.code === 'ESRCH') { + clearLock(); + process.stdout.write('pagx-preview: server was not running (stale lock cleared).\n'); + return; + } + process.stderr.write(`pagx-preview: failed to stop server (pid ${lock.pid}): ${err.message}\n`); + process.exit(1); + } + + // Wait a beat for the graceful shutdown to remove the lock file. Not strictly required, but + // gives useful feedback that the peer actually acted on our SIGTERM. + const deadline = Date.now() + 3000; + while (Date.now() < deadline) { + if (!readLock()) { + process.stdout.write(`pagx-preview: stopped (pid ${lock.pid}).\n`); + return; + } + await sleep(50); + } + process.stdout.write( + `pagx-preview: sent SIGTERM to pid ${lock.pid}; lock still present (shutdown in progress).\n` + ); +} + +/** Prints the log file to stdout. */ +export function printLog() { + if (!fs.existsSync(LOG_FILE)) { + process.stdout.write('pagx-preview: no log file yet.\n'); + return; + } + const data = fs.readFileSync(LOG_FILE, 'utf8'); + process.stdout.write(data); + if (!data.endsWith('\n')) process.stdout.write('\n'); +} + +function sleep(ms) { + return new Promise((r) => setTimeout(r, ms)); +} diff --git a/playground/pagx-preview/src/mcp/server.js b/playground/pagx-preview/src/mcp/server.js new file mode 100644 index 0000000000..97089b5a97 --- /dev/null +++ b/playground/pagx-preview/src/mcp/server.js @@ -0,0 +1,129 @@ +///////////////////////////////////////////////////////////////////////////////////////////////// +// +// Tencent is pleased to support the open source community by making libpag available. +// +// Copyright (C) 2026 Tencent. 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. +// +///////////////////////////////////////////////////////////////////////////////////////////////// + +import { Server } from '@modelcontextprotocol/sdk/server/index.js'; +import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js'; +import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; +import { + CallToolRequestSchema, + ListToolsRequestSchema, + ListResourcesRequestSchema, + ReadResourceRequestSchema, +} from '@modelcontextprotocol/sdk/types.js'; +import { buildToolHandlers, buildResourceHandlers } from './tools.js'; + +/** + * Builds a configured MCP Server instance with all pagx-preview tool / resource handlers + * registered. The handlers are plain closures over the shared session maps, so the same builder + * serves both the HTTP (per-request) and stdio (long-lived) transports. + * + * @param {object} opts + * @param {Map} opts.sessions - live PreviewSession map keyed by session id. + * @param {Function} opts.createOrGetSession - creates or reuses a session for a file path. + * @param {string} opts.staticDir - directory holding mcp-widget.html and static assets. + * @param {Function} [opts.getServerBaseUrl] - returns the preview server's base URL (used to + * rewrite widget resource URLs and to build the browser-openable session url). + * @returns {Server} a ready-to-connect MCP Server. + */ +export function createMcpServer(opts) { + const { sessions, createOrGetSession, staticDir, getServerBaseUrl } = opts; + const server = new Server( + { name: 'pagx-preview', version: '0.1.0' }, + { capabilities: { tools: {}, resources: {} } }, + ); + + const handlers = buildToolHandlers({ sessions, createOrGetSession, getServerBaseUrl }); + const resourceHandlers = buildResourceHandlers({ staticDir, getServerBaseUrl }); + + server.setRequestHandler(ListToolsRequestSchema, handlers.listTools); + server.setRequestHandler(CallToolRequestSchema, handlers.callTool); + server.setRequestHandler(ListResourcesRequestSchema, resourceHandlers.listResources); + server.setRequestHandler(ReadResourceRequestSchema, resourceHandlers.readResource); + return server; +} + +/** + * Connects a single long-lived MCP Server to a stdio transport. This is the self-bootstrapping + * entry point: an MCP client (CodeBuddy) spawns `pagx-preview --mcp` on demand and speaks MCP over + * stdin/stdout, so the user never has to start a server manually. The caller owns the in-process + * preview HTTP server whose session maps are shared here. + * + * @returns {Promise} the connected Server (its `onclose` fires when stdin closes). + */ +export async function connectStdioMcpServer(opts) { + const server = createMcpServer(opts); + const transport = new StdioServerTransport(); + await server.connect(transport); + return server; +} + +/** + * Mounts the MCP server onto the given express app. The MCP server shares the same process, + * port, and session map as the rest of pagx-preview so that tool calls can directly access + * PreviewSession objects without a network round-trip. + * + * The endpoint is POST /mcp (Streamable HTTP transport). CodeBuddy connects by adding: + * { "mcpServers": { "pagx-preview": { "type": "http", "url": "http://127.0.0.1:/mcp" } } } + * to its mcp.json. Use `pagx-preview --port 7300 ` to pin a port for MCP config stability. + * + * Each POST /mcp request creates a fresh Server + Transport pair. The MCP SDK's Server.connect() + * binds the Server to a single Transport for its lifetime, so reusing a Server across requests + * triggers "Already connected to a transport". Creating per-request instances is cheap (handlers + * are plain closures over the shared session map) and keeps the stateless request model clean. + */ +export function mountMcpServer(app, opts) { + app.post('/mcp', async (req, res) => { + const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined }); + const server = createMcpServer(opts); + + try { + await server.connect(transport); + // The app-level express.json() middleware has already consumed the request stream, so the + // transport cannot re-read it. Pass the parsed body explicitly; otherwise handleRequest + // reads an empty stream and reports "Parse error: Invalid JSON". + await transport.handleRequest(req, res, req.body); + } catch (err) { + if (!res.headersSent) { + res.status(500).json({ error: err.message }); + } + } finally { + // Close the Server so its internal transport reference is released. The Transport itself + // is per-request and will be GC'd; the Server's handler closures only reference the + // shared session maps, not per-request state, so no data leaks. + try { + await server.close(); + } catch (_) { + // ignore + } + } + }); + + // GET/DELETE are not supported in stateless mode: there is no long-lived session to attach a + // server-initiated SSE stream to, and every POST already spins up its own transport. Returning + // a JSON-RPC "Method not allowed" here matches the official stateless server example, so an MCP + // client that probes the legacy GET-SSE channel backs off cleanly instead of retrying. + const methodNotAllowed = (req, res) => { + res.status(405).json({ + jsonrpc: '2.0', + error: { code: -32000, message: 'Method not allowed.' }, + id: null, + }); + }; + app.get('/mcp', methodNotAllowed); + app.delete('/mcp', methodNotAllowed); +} diff --git a/playground/pagx-preview/src/mcp/tools.js b/playground/pagx-preview/src/mcp/tools.js new file mode 100644 index 0000000000..f1e09e2694 --- /dev/null +++ b/playground/pagx-preview/src/mcp/tools.js @@ -0,0 +1,293 @@ +///////////////////////////////////////////////////////////////////////////////////////////////// +// +// Tencent is pleased to support the open source community by making libpag available. +// +// Copyright (C) 2026 Tencent. 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. +// +///////////////////////////////////////////////////////////////////////////////////////////////// + +import fs from 'fs'; +import path from 'path'; + +export const UI_MIME = 'text/html;profile=mcp-app'; +export const UI_URI = 'ui://pagx-preview/main'; + +// After this many consecutive get_document calls with no summary, assume the host is not +// rendering the inline widget and fall back to returning the browser-openable webview url so the +// caller can open the preview there instead of polling a widget that will never load. +const MAX_DOCUMENT_QUERY_FAILURES = 3; + +// Tool definitions. Kept as plain objects so both listTools and callTool can reference the same +// schema without duplicating field names / descriptions. +const TOOLS = [ + { + name: 'preview_pagx', + description: + 'Load a pagx file for preview. Renders an interactive widget in the conversation showing the pagx animation, and returns a url that can be opened in a browser / webview. Returns session info including sessionId for use with reload_file / get_document.', + inputSchema: { + type: 'object', + properties: { + file: { type: 'string', description: 'Absolute path to the .pagx file to preview.' }, + }, + required: ['file'], + }, + // MCP Apps: associate this tool with the UI resource so the host renders the widget inline. + // Both nested and flat keys are required — Claude Desktop reads the flat key "ui/resourceUri" + // to decide whether to mount an iframe. The nested form is for other hosts. + _meta: { ui: { resourceUri: UI_URI }, 'ui/resourceUri': UI_URI }, + }, + { + name: 'reload_file', + description: + 'Force a full reload of the pagx file from disk. The preview widget automatically reloads on file change, but this tool can trigger a manual reload if needed.', + inputSchema: { + type: 'object', + properties: { + sessionId: { type: 'string', description: 'Session ID returned by preview_pagx.' }, + }, + required: ['sessionId'], + }, + }, + { + name: 'get_document', + description: + 'Get a summary of the loaded pagx document: dimensions and animation duration. The summary is uploaded by the client after load; it may be null if the client has not finished loading yet. If it keeps returning "not loaded" for several consecutive calls, the inline widget is likely not rendering in this host and the result will switch to a fallback that returns a browser-openable url (fallbackToWebview: true) — open that url in a webview / browser instead of polling further.', + inputSchema: { + type: 'object', + properties: { + sessionId: { type: 'string', description: 'Session ID returned by preview_pagx.' }, + }, + required: ['sessionId'], + }, + }, +]; + +/** + * Builds the listTools / callTool handlers for the MCP server. + * @returns {{ listTools: Function, callTool: Function }} + */ +export function buildToolHandlers({ sessions, createOrGetSession, getServerBaseUrl }) { + return { + async listTools() { + return { tools: TOOLS }; + }, + + async callTool(req) { + const { name, arguments: args } = req.params; + + if (name === 'preview_pagx') { + return handlePreviewPagx(args, { createOrGetSession, getServerBaseUrl }); + } + if (name === 'reload_file') { + return handleReloadFile(args, { sessions }); + } + if (name === 'get_document') { + return handleGetDocument(args, { sessions, getServerBaseUrl }); + } + return { + content: [{ type: 'text', text: `unknown tool: ${name}` }], + isError: true, + }; + }, + }; +} + +function handlePreviewPagx(args, { createOrGetSession, getServerBaseUrl }) { + const file = args?.file; + if (!file || !fs.existsSync(file)) { + return { + content: [{ type: 'text', text: `file not found: ${file}` }], + isError: true, + }; + } + const { session, reused } = createOrGetSession(path.resolve(file)); + const baseUrl = getServerBaseUrl ? getServerBaseUrl() : ''; + const url = baseUrl ? `${baseUrl}/session/${session.id}/` : `/session/${session.id}/`; + const summary = session.documentSummary; + // The summary is uploaded by the client (widget or browser tab) only after it finishes + // rendering, so on the first preview_pagx call it is usually still null. Report "rendering" + // instead of a misleading "0 nodes, 0.0s"; get_document can be polled once the widget appears. + const stats = summary + ? `${summary.nodeCount} nodes, ${(summary.duration / 1000000).toFixed(1)}s duration` + : 'rendering (document summary available after the widget finishes loading)'; + return { + content: [ + { + type: 'text', + text: `Previewing ${path.basename(file)}${reused ? ' (reusing existing session)' : ''}. Open in browser: ${url} — ${stats}. Note: the inline widget may not render in all hosts; if the preview area is blank, open the browser URL above instead.`, + }, + ], + structuredContent: { + sessionId: session.id, + file: session.entryFile, + fileName: path.basename(session.entryFile), + url, + nodeCount: summary?.nodeCount ?? 0, + duration: summary?.duration ?? 0, + reused, + }, + }; +} + +function handleReloadFile(args, { sessions }) { + const { sessionId } = args ?? {}; + const session = sessions.get(sessionId); + if (!session) { + return { + content: [{ type: 'text', text: `session not found: ${sessionId}` }], + isError: true, + }; + } + session.emit({ type: 'reload', file: session.entryFile, event: 'mcp-reload' }); + return { + content: [{ type: 'text', text: `reload triggered for session ${sessionId}` }], + structuredContent: { sessionId, reloaded: true }, + }; +} + +function handleGetDocument(args, { sessions, getServerBaseUrl }) { + const { sessionId } = args ?? {}; + const session = sessions.get(sessionId); + if (!session) { + return { + content: [{ type: 'text', text: `session not found: ${sessionId}` }], + isError: true, + }; + } + const summary = session.documentSummary; + if (!summary) { + // The inline widget uploads its summary only after it renders. If the host does not render + // the widget at all, the summary never arrives and every poll returns null. Count consecutive + // misses; once we hit the threshold, stop reporting an error and instead hand back the + // browser-openable webview url so the caller opens the preview there rather than polling a + // widget that will never load. + session.documentQueryFailures += 1; + if (session.documentQueryFailures >= MAX_DOCUMENT_QUERY_FAILURES) { + const baseUrl = getServerBaseUrl ? getServerBaseUrl() : ''; + const url = baseUrl ? `${baseUrl}/session/${session.id}/` : `/session/${session.id}/`; + return { + content: [ + { + type: 'text', + text: `The inline widget has not reported a document after ${session.documentQueryFailures} consecutive attempts, so it is likely not rendering in this host. Open the preview in a webview / browser instead: ${url}`, + }, + ], + structuredContent: { + sessionId: session.id, + loaded: false, + attempts: session.documentQueryFailures, + fallbackToWebview: true, + url, + }, + }; + } + return { + content: [{ type: 'text', text: `document not loaded yet for session ${sessionId}` }], + isError: true, + }; + } + session.documentQueryFailures = 0; + return { + content: [ + { + type: 'text', + text: `${summary.nodeCount} nodes, ${summary.width}x${summary.height}, ${(summary.duration / 1000000).toFixed(1)}s`, + }, + ], + structuredContent: summary, + }; +} + +/** + * Builds the listResources / readResource handlers for the MCP server. + * @returns {{ listResources: Function, readResource: Function }} + */ +export function buildResourceHandlers({ staticDir, getServerBaseUrl }) { + return { + async listResources() { + return { + resources: [ + { + uri: UI_URI, + name: 'pagx-preview-widget', + mimeType: UI_MIME, + description: 'Interactive pagx preview widget', + }, + ], + }; + }, + + async readResource(req) { + if (req.params.uri !== UI_URI) { + return { contents: [] }; + } + const widgetPath = path.join(staticDir, 'mcp-widget.html'); + let html; + if (fs.existsSync(widgetPath)) { + html = fs.readFileSync(widgetPath, 'utf8'); + } else { + html = 'pagx-preview widget not found. Run npm run prebuild.'; + } + // Inline the pre-built widget bundle (app-with-deps + pagx-player + mcp-widget merged + // by esbuild into one minified file). This avoids external , quotes, etc.) from + // breaking `document.write()` or the `; + html = html.replace( + /<\/script>/, + loader + ); + // Remove meta CSP — let host control it + html = html.replace(//m, ''); + html = html.replace(/\s*\s*/m, '\n '); + return { + contents: [ + { + uri: UI_URI, + mimeType: UI_MIME, + text: html, + _meta: connectDomains.length ? { + ui: { + csp: { + resourceDomains: connectDomains, + connectDomains, + baseUriDomains: connectDomains, + }, + }, + } : undefined, + }, + ], + }; + }, + }; +} diff --git a/playground/pagx-preview/src/server/font-cache.js b/playground/pagx-preview/src/server/font-cache.js new file mode 100644 index 0000000000..bd13d6aeb4 --- /dev/null +++ b/playground/pagx-preview/src/server/font-cache.js @@ -0,0 +1,183 @@ +///////////////////////////////////////////////////////////////////////////////////////////////// +// +// Tencent is pleased to support the open source community by making libpag available. +// +// Copyright (C) 2026 Tencent. 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. +// +///////////////////////////////////////////////////////////////////////////////////////////////// + +// Lazy-download the fallback fonts (NotoSansSC + NotoColorEmoji) into ~/.pagx/fonts/ so a +// globally installed pagx-preview works without a libpag checkout. Modeled after +// cli/npm/html-snapshot/launch.js: the download runs on first use, output goes to stderr, and +// PAGX_FONTS_NO_AUTO_DOWNLOAD=1 disables it for offline / CI hosts. + +import fs from 'fs'; +import os from 'os'; +import path from 'path'; +import https from 'https'; +import http from 'http'; + +const CACHE_DIR = path.join(os.homedir(), '.pagx', 'fonts'); +// Any file smaller than this is considered a failed download (e.g. HTML error page) and will +// be retried on the next startup. Real NotoSansSC / NotoColorEmoji are ~8 MB / ~10 MB. +const MIN_VALID_SIZE = 100 * 1024; + +// The catalog mirrors the CDN used by pagx/wechat/wx_demo, which is where pag.qq.com already +// serves the two fonts pagx-viewer needs. Bumping the URL here is the only step required to +// switch to a different origin later. +export const FONT_CATALOG = [ + { + role: 'primary', + name: 'NotoSansSC-Regular.otf', + url: 'https://pag.qq.com/wx_pagx_demo/fonts/NotoSansSC-Regular.otf', + }, + { + role: 'emoji', + name: 'NotoColorEmoji.ttf', + url: 'https://pag.qq.com/wx_pagx_demo/fonts/NotoColorEmoji.ttf', + }, +]; + +export function cacheDir() { + return CACHE_DIR; +} + +function ensureCacheDir() { + fs.mkdirSync(CACHE_DIR, { recursive: true }); +} + +function log(msg) { + process.stderr.write(`pagx-preview font-cache: ${msg}\n`); +} + +/** Returns true when a cached font file exists and looks intact. */ +export function isFontCached(name) { + const abs = path.join(CACHE_DIR, name); + try { + const stat = fs.statSync(abs); + return stat.isFile() && stat.size >= MIN_VALID_SIZE; + } catch (_) { + return false; + } +} + +/** Returns absolute path to the cached font (regardless of validity). */ +export function fontPath(name) { + return path.join(CACHE_DIR, name); +} + +/** Downloads a single URL to `destPath`, following up to 3 redirects. Rejects on non-2xx. */ +function downloadOnce(url, destPath, maxRedirects = 3) { + return new Promise((resolve, reject) => { + const client = url.startsWith('https:') ? https : http; + const tmpPath = destPath + '.part'; + const file = fs.createWriteStream(tmpPath); + const req = client.get(url, (res) => { + if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location && maxRedirects > 0) { + // Follow redirect. Close the file (it will be overwritten on the next attempt). + file.close(); + fs.unlink(tmpPath, () => {}); + downloadOnce(res.headers.location, destPath, maxRedirects - 1).then(resolve, reject); + return; + } + if (res.statusCode !== 200) { + file.close(); + fs.unlink(tmpPath, () => {}); + reject(new Error(`HTTP ${res.statusCode} for ${url}`)); + return; + } + res.pipe(file); + file.on('finish', () => { + file.close((err) => { + if (err) { + fs.unlink(tmpPath, () => {}); + reject(err); + return; + } + try { + const stat = fs.statSync(tmpPath); + if (stat.size < MIN_VALID_SIZE) { + fs.unlink(tmpPath, () => {}); + reject(new Error(`downloaded file too small (${stat.size} bytes)`)); + return; + } + fs.renameSync(tmpPath, destPath); + resolve(); + } catch (e) { + fs.unlink(tmpPath, () => {}); + reject(e); + } + }); + }); + }); + req.on('error', (err) => { + file.close(); + fs.unlink(tmpPath, () => {}); + reject(err); + }); + req.setTimeout(30000, () => { + req.destroy(new Error('download timed out')); + }); + }); +} + +// Tracks per-role in-flight downloads so overlapping requests coalesce. First call kicks off the +// download; concurrent callers await the same promise. +const inFlight = new Map(); + +/** + * Ensures a font exists in the cache. Returns absolute path on success, null on failure. Safe to + * call from multiple places at once — downloads are deduplicated. + */ +export async function ensureFont(entry) { + if (isFontCached(entry.name)) return fontPath(entry.name); + if (process.env.PAGX_FONTS_NO_AUTO_DOWNLOAD === '1') { + log(`auto-download disabled (PAGX_FONTS_NO_AUTO_DOWNLOAD=1); skipping ${entry.name}`); + return null; + } + + let promise = inFlight.get(entry.name); + if (!promise) { + promise = (async () => { + ensureCacheDir(); + const dest = fontPath(entry.name); + log(`downloading ${entry.name} from ${entry.url}...`); + const started = Date.now(); + try { + await downloadOnce(entry.url, dest); + const secs = ((Date.now() - started) / 1000).toFixed(1); + log(`downloaded ${entry.name} (${secs}s)`); + return dest; + } catch (err) { + log(`failed to download ${entry.name}: ${err.message}`); + return null; + } + })(); + inFlight.set(entry.name, promise); + // Clear the entry once resolved so a later retry can try again. + promise.finally(() => inFlight.delete(entry.name)); + } + return await promise; +} + +/** Downloads any missing font in parallel. Returns a map of role -> absolute path (or null). */ +export async function ensureAllFonts() { + const results = await Promise.all(FONT_CATALOG.map(async (entry) => ({ + role: entry.role, + name: entry.name, + path: await ensureFont(entry), + }))); + const map = {}; + for (const r of results) map[r.role] = r; + return map; +} diff --git a/playground/pagx-preview/src/server/fonts.js b/playground/pagx-preview/src/server/fonts.js new file mode 100644 index 0000000000..e455d899a0 --- /dev/null +++ b/playground/pagx-preview/src/server/fonts.js @@ -0,0 +1,123 @@ +///////////////////////////////////////////////////////////////////////////////////////////////// +// +// Tencent is pleased to support the open source community by making libpag available. +// +// Copyright (C) 2026 Tencent. 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. +// +///////////////////////////////////////////////////////////////////////////////////////////////// + +// Font source discovery for the preview server. +// +// The viewer needs a fallback font (typically NotoSansSC) plus an emoji font (NotoColorEmoji) to +// render text and emoji glyphs. This module picks a directory that holds those files, in order of +// preference: +// 1. explicit override (--fonts ) passed from the CLI +// 2. PAGX_FONTS_DIR environment variable +// 3. lazy-download cache under ~/.pagx/fonts/ (populated by font-cache.js on first use) +// 4. libpag checkout's resources/font/ when running from a source tree +// +// The lazy-download step ensures a globally installed pagx-preview works out of the box; the +// libpag fallback keeps the source-tree workflow zero-config. + +import fs from 'fs'; +import path from 'path'; +import { fileURLToPath } from 'url'; +import { cacheDir, isFontCached, fontPath } from './font-cache.js'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const PREVIEW_DIR = path.resolve(__dirname, '../..'); + +// Font role -> ordered list of preferred filenames. The first file that exists on disk is used. +export const FONT_ROLES = { + primary: ['NotoSansSC-Regular.otf'], + emoji: ['NotoColorEmoji.ttf'], +}; + +/** Walks upward looking for a libpag checkout by locating resources/font/. */ +function detectResourcesFontDir() { + let dir = PREVIEW_DIR; + for (let i = 0; i < 6; i++) { + const candidate = path.join(dir, 'resources', 'font'); + if (fs.existsSync(candidate) && fs.statSync(candidate).isDirectory()) { + return candidate; + } + const parent = path.dirname(dir); + if (parent === dir) break; + dir = parent; + } + return null; +} + +function isUsableDir(candidate) { + return candidate && fs.existsSync(candidate) && fs.statSync(candidate).isDirectory(); +} + +/** + * Resolves the fonts directory using the priority order documented at the top of this file. + * The download cache directory qualifies only when at least one expected font is already + * present, so a fresh install still falls through to the libpag checkout during the initial + * download window. + */ +export function resolveFontsDir(explicitDir) { + if (isUsableDir(explicitDir)) return path.resolve(explicitDir); + if (isUsableDir(process.env.PAGX_FONTS_DIR)) return path.resolve(process.env.PAGX_FONTS_DIR); + + const cache = cacheDir(); + const cacheHasAny = Object.values(FONT_ROLES).some((names) => + names.some((name) => isFontCached(name)) + ); + if (cacheHasAny) return cache; + + const checkout = detectResourcesFontDir(); + if (checkout) return checkout; + + return null; +} + +/** For each role, returns the absolute path of the first candidate file that exists, or null. */ +export function listFonts(fontsDir) { + if (!fontsDir) return {}; + const result = {}; + for (const [role, names] of Object.entries(FONT_ROLES)) { + for (const name of names) { + const abs = path.join(fontsDir, name); + if (fs.existsSync(abs) && fs.statSync(abs).isFile()) { + result[role] = { name, path: abs }; + break; + } + } + } + return result; +} + +/** + * Same as listFonts() but always uses the download cache dir when a font exists there, even if + * the caller preferred another directory. Used for hot-swapping after a lazy download completes: + * the /fonts endpoints resolve here so a re-request after the download picks up the new file + * without a server restart. + */ +export function listFontsPreferringCache(fontsDir) { + const result = listFonts(fontsDir); + for (const [role, names] of Object.entries(FONT_ROLES)) { + if (result[role]) continue; + for (const name of names) { + if (isFontCached(name)) { + result[role] = { name, path: fontPath(name) }; + break; + } + } + } + return result; +} diff --git a/playground/pagx-preview/src/server/index.js b/playground/pagx-preview/src/server/index.js new file mode 100644 index 0000000000..77b55c6fc7 --- /dev/null +++ b/playground/pagx-preview/src/server/index.js @@ -0,0 +1,570 @@ +///////////////////////////////////////////////////////////////////////////////////////////////// +// +// Tencent is pleased to support the open source community by making libpag available. +// +// Copyright (C) 2026 Tencent. 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. +// +///////////////////////////////////////////////////////////////////////////////////////////////// + +import path from 'path'; +import fs from 'fs'; +import crypto from 'crypto'; +import express from 'express'; +import { fileURLToPath } from 'url'; +import { PreviewSession } from './session.js'; +import { resolveFontsDir, listFonts, listFontsPreferringCache } from './fonts.js'; +import { ensureAllFonts } from './font-cache.js'; +import { mountMcpServer } from '../mcp/server.js'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const PREVIEW_DIR = path.resolve(__dirname, '../..'); +const STATIC_DIR = path.join(PREVIEW_DIR, 'static'); +const VIEWER_INFO_PATH = path.join(STATIC_DIR, 'viewer', 'info.json'); + +// Once every tab has closed its SSE stream, wait this long before shutting the server down. +// A short grace period covers "close tab, immediately re-run pagx-preview" without a respawn. +const IDLE_SHUTDOWN_MS = 30_000; + +/** Short deterministic id for a file path so the same file always maps to the same session. */ +function sessionIdFor(filePath) { + return crypto.createHash('sha1').update(path.resolve(filePath)).digest('hex').slice(0, 10); +} + +/** Short random id for one-shot drop sessions (files opened via browser drag-and-drop). */ +function randomSessionId() { + return 'drop-' + crypto.randomBytes(5).toString('hex'); +} + +/** Reads the prebuild-produced info.json describing which pagx-viewer variant was staged. */ +function readViewerInfo() { + if (!fs.existsSync(VIEWER_INFO_PATH)) { + throw new Error( + `pagx-preview: viewer artifacts not found at ${STATIC_DIR}/viewer. Run "npm run prebuild" first.` + ); + } + return JSON.parse(fs.readFileSync(VIEWER_INFO_PATH, 'utf8')); +} + +/** + * Starts the preview server and creates the initial session for `entryFile` (if provided). + * + * The returned object exposes: + * - port / host / url / sessionId: connection info for the initial session + * - fontsDir: absolute path used for fallback fonts (null if none) + * - close(): stop the server and all its watchers + * - onIdle(callback): fired when the last SSE subscriber leaves after IDLE_SHUTDOWN_MS + */ +export async function startServer({ entryFile = null, port = 0, host = '127.0.0.1', fontsDir = null }) { + let resolvedFontsDir = resolveFontsDir(fontsDir); + // Endpoints look up the current font list on every request so a background lazy-download can + // become visible without a restart. Explicit --fonts / PAGX_FONTS_DIR overrides skip the + // download path entirely. + const useLazyDownload = !fontsDir && !process.env.PAGX_FONTS_DIR; + function currentFontEntries() { + // When lazy-downloading, prefer any file that has already landed in the cache. Otherwise + // stick to the resolved directory so overrides remain authoritative. + return useLazyDownload + ? listFontsPreferringCache(resolvedFontsDir) + : listFonts(resolvedFontsDir); + } + + const viewerInfo = readViewerInfo(); + + const app = express(); + app.use(express.json({ limit: '4mb' })); + + // MCP Apps hosts (Claude Desktop, CodeBuddy, etc.) load the widget HTML inside a cross-origin + // sandbox iframe. All resource fetches (ES module imports, pagx bytes, fonts, SSE) from the + // iframe to this server are cross-origin, so without CORS headers the browser blocks them and + // the widget stays blank. This is a local-only preview server, so a permissive CORS policy is + // safe here. + app.use((req, res, next) => { + res.set('Access-Control-Allow-Origin', '*'); + res.set('Access-Control-Allow-Methods', 'GET, POST, DELETE, OPTIONS'); + res.set('Access-Control-Allow-Headers', 'Content-Type, MCP-Protocol-Version, Accept'); + if (req.method === 'OPTIONS') { + res.status(204).end(); + return; + } + next(); + }); + + // The multi-threaded pagx-viewer needs SharedArrayBuffer, which browsers only expose in a + // cross-origin-isolated context. The single-threaded build has no such requirement. + if (viewerInfo.multiThreaded) { + app.use((req, res, next) => { + res.set('Cross-Origin-Opener-Policy', 'same-origin'); + res.set('Cross-Origin-Embedder-Policy', 'require-corp'); + next(); + }); + } + + const sessions = new Map(); + // Tracks how many SSE responses are open per session id. When it drops to zero for every + // session, the idle timer fires. + const sseCountBySession = new Map(); + + // Track live TCP sockets and SSE responses so shutdown can force-close them. Node's + // http.Server.close() only stops accepting new connections and waits for existing ones to + // drain; without this an open SSE stream keeps the process alive forever after Ctrl+C. + const sockets = new Set(); + const sseResponses = new Set(); + + let idleCallback = null; + let idleTimer = null; + + function totalSseCount() { + let n = 0; + for (const c of sseCountBySession.values()) n += c; + return n; + } + + function scheduleIdleCheck() { + if (!idleCallback) return; + if (idleTimer !== null) return; + if (totalSseCount() > 0) return; + idleTimer = setTimeout(() => { + idleTimer = null; + if (totalSseCount() === 0 && idleCallback) idleCallback(); + }, IDLE_SHUTDOWN_MS); + } + + function cancelIdleCheck() { + if (idleTimer !== null) { + clearTimeout(idleTimer); + idleTimer = null; + } + } + + function createOrGetSession(filePath) { + const id = sessionIdFor(filePath); + let session = sessions.get(id); + let reused = true; + if (!session) { + session = new PreviewSession(id, filePath); + sessions.set(id, session); + reused = false; + } + return { session, reused }; + } + + const initialSession = entryFile ? createOrGetSession(path.resolve(entryFile)).session : null; + + // Lightweight probe used by the CLI's health check when deciding whether to reuse a running + // server. Kept intentionally trivial so a lock check finishes in ~1ms. + app.get('/health', (req, res) => { + res.json({ ok: true, sessions: sessions.size }); + }); + + // Session index for CLI reuse. POST creates or returns an existing session for a filesystem + // path; a session id of "drop" indicates a one-shot ephemeral upload from the browser drop + // handler (see the /session/drop endpoint below). + app.post('/sessions', (req, res) => { + const filePath = typeof req.body?.file === 'string' ? req.body.file : null; + if (!filePath) { + res.status(400).json({ error: 'missing file' }); + return; + } + const absolute = path.resolve(filePath); + if (!fs.existsSync(absolute)) { + res.status(404).json({ error: 'file not found', file: absolute }); + return; + } + const { session, reused } = createOrGetSession(absolute); + const hadActiveTab = (sseCountBySession.get(session.id) || 0) > 0; + if (reused && hadActiveTab) { + // Ask the existing tab to bring itself to the front. Browsers usually refuse this outside + // a user gesture, so the CLI must not depend on it — see cli.js for the fallback path. + session.emit({ type: 'focus' }); + } + res.json({ + id: session.id, + url: `/session/${session.id}/`, + reused, + hadActiveTab, + }); + }); + + // One-shot ephemeral session for files dropped into the browser. The file bytes are held in + // memory only (never written to disk) and the session watches nothing: dropped files are + // preview-only. Storing on disk with live watch would require the browser to give us a real + // absolute path, which it never does. + const dropSessions = new Map(); + app.post('/session/drop', express.raw({ type: '*/*', limit: '32mb' }), (req, res) => { + if (!req.body || req.body.length === 0) { + res.status(400).json({ error: 'empty body' }); + return; + } + const name = String(req.query.name || 'dropped.pagx'); + const id = randomSessionId(); + dropSessions.set(id, { name, data: Buffer.from(req.body) }); + res.json({ id, url: `/session/${id}/`, name }); + }); + + // Session page. All same-origin fetches issued by the page are scoped under /session/:id/ + // so the browser sees a single origin per document; the routes below key on :id. + app.get('/session/:id/', (req, res) => { + if (!sessions.has(req.params.id) && !dropSessions.has(req.params.id)) { + res.status(404).send('unknown session'); + return; + } + res.sendFile(path.join(STATIC_DIR, 'index.html')); + }); + + // Entry PAGX bytes. + app.get('/session/:id/pagx', (req, res) => { + const drop = dropSessions.get(req.params.id); + if (drop) { + res.set('Content-Type', 'application/octet-stream'); + res.send(drop.data); + return; + } + const session = sessions.get(req.params.id); + if (!session) { + res.status(404).send('unknown session'); + return; + } + res.sendFile(session.entryFile, (err) => { + if (err && !res.headersSent) { + res.status(500).send('failed to read entry file'); + } + }); + }); + + // Overwrite the entry pagx file with the request body. Used by the editor's "Save" button so + // in-browser edits become durable on disk. The path is fixed to the session's entryFile and + // never taken from the URL / body, keeping this endpoint from being turned into an + // arbitrary-file-write primitive. Drop sessions have no on-disk file so they get a clear 400. + // The write itself will trigger the session's file watcher, which broadcasts a `reload` SSE + // event that all connected tabs pick up naturally - so this endpoint stops at persistence and + // leaves refresh to the existing reload path. + app.put( + '/session/:id/pagx', + express.raw({ type: '*/*', limit: '32mb' }), + async (req, res) => { + if (dropSessions.has(req.params.id)) { + res.status(400).json({ error: 'save is not available for dropped files' }); + return; + } + const session = sessions.get(req.params.id); + if (!session) { + res.status(404).json({ error: 'unknown session' }); + return; + } + if (!req.body || req.body.length === 0) { + res.status(400).json({ error: 'empty body' }); + return; + } + try { + await fs.promises.writeFile(session.entryFile, req.body); + res.json({ ok: true, bytes: req.body.length }); + } catch (err) { + console.error(`pagx-preview: failed to save ${session.entryFile}`, err); + res.status(500).json({ error: err && err.message ? err.message : 'write failed' }); + } + }, + ); + + // Session metadata (label shown in the tab title, watch mode, etc.). + app.get('/session/:id/info', (req, res) => { + const drop = dropSessions.get(req.params.id); + if (drop) { + res.json({ name: drop.name, mode: 'drop', watched: false }); + return; + } + const session = sessions.get(req.params.id); + if (!session) { + res.status(404).send('unknown session'); + return; + } + res.json({ name: path.basename(session.entryFile), mode: 'watch', watched: true }); + }); + + // External resource fetch. The path is browser-supplied and must stay under the entry file's + // directory; PreviewSession.resolveResource() enforces that. Drop sessions cannot reference + // external files (they're one-shot in-memory previews). + app.get('/session/:id/resources/*', (req, res) => { + const session = sessions.get(req.params.id); + if (!session) { + res.status(404).send('unknown session'); + return; + } + const relativePath = req.params[0]; + const absolute = session.resolveResource(relativePath); + if (!absolute) { + res.status(400).send('invalid resource path'); + return; + } + res.sendFile(absolute, (err) => { + if (err && !res.headersSent) { + res.status(404).send('resource not found'); + } + }); + }); + + // Browser reports the PAGX's external file list once the document is parsed. The server uses + // the list to extend its filesystem watch, so edits to referenced images also trigger reload. + app.post('/session/:id/resources', (req, res) => { + const session = sessions.get(req.params.id); + if (!session) { + // Drop sessions ignore this endpoint silently: they never watch anything. + if (dropSessions.has(req.params.id)) { + res.json({ ok: true, watched: false }); + return; + } + res.status(404).send('unknown session'); + return; + } + const paths = Array.isArray(req.body?.paths) ? req.body.paths : []; + session.updateResources(paths); + res.json({ ok: true, count: paths.length }); + }); + + // Client uploads a document summary (node list, dimensions, duration) after a successful load. + // The MCP get_document tool reads this cache to answer AI queries without a client round-trip. + app.post('/session/:id/document', (req, res) => { + const session = sessions.get(req.params.id); + if (!session) { + res.status(404).json({ error: 'unknown session' }); + return; + } + session.setDocumentSummary(req.body ?? null); + res.json({ ok: true }); + }); + + // Returns the cached document summary. null when the client hasn't uploaded one yet (e.g. the + // pagx is still loading or the client doesn't support summary upload). + app.get('/session/:id/document', (req, res) => { + const session = sessions.get(req.params.id); + if (!session) { + res.status(404).json({ error: 'unknown session' }); + return; + } + res.json(session.documentSummary); + }); + + // Server-Sent Events: one long-lived response per open tab. The browser reconnects on drop. + app.get('/session/:id/events', (req, res) => { + const id = req.params.id; + const session = sessions.get(id); + if (!session && !dropSessions.has(id)) { + res.status(404).end(); + return; + } + res.set({ + 'Content-Type': 'text/event-stream', + 'Cache-Control': 'no-cache', + Connection: 'keep-alive', + 'X-Accel-Buffering': 'no', + }); + res.flushHeaders(); + res.write(': connected\n\n'); + sseResponses.add(res); + sseCountBySession.set(id, (sseCountBySession.get(id) || 0) + 1); + cancelIdleCheck(); + + let unsubscribe = () => {}; + if (session) { + unsubscribe = session.subscribe((event) => { + res.write(`event: ${event.type}\n`); + res.write(`data: ${JSON.stringify(event)}\n\n`); + }); + } + + // Periodic comment keeps intermediaries from closing an idle connection. + const keepAlive = setInterval(() => res.write(': ping\n\n'), 25000); + + req.on('close', () => { + clearInterval(keepAlive); + unsubscribe(); + sseResponses.delete(res); + const remaining = (sseCountBySession.get(id) || 1) - 1; + if (remaining <= 0) { + sseCountBySession.delete(id); + } else { + sseCountBySession.set(id, remaining); + } + scheduleIdleCheck(); + }); + }); + + // Static assets for the client bundle (viewer wasm/glue, index.js, index.css). + app.use( + '/static', + express.static(STATIC_DIR, { + setHeaders: (res, filePath) => { + if (filePath.endsWith('.wasm')) { + res.set('Content-Type', 'application/wasm'); + } + }, + }) + ); + + // Silence the browser's default /favicon.ico probe; we don't ship one and the 404 clutters + // the Network panel on every reload. + app.get('/favicon.ico', (req, res) => { + res.status(204).end(); + }); + + // Fallback fonts served for the viewer. The client fetches /fonts/list first, then downloads + // each referenced file. When no font source is available the list is empty and the client + // proceeds without registering fonts (text glyphs will render blank). + app.get('/fonts/list', (req, res) => { + const entries = currentFontEntries(); + const list = {}; + for (const [role, entry] of Object.entries(entries)) { + list[role] = entry.name; + } + // Surface whether a background download is still working so the client can retry politely. + res.json({ + fontsDir: resolvedFontsDir, + fonts: list, + downloading: useLazyDownload && Object.keys(list).length < 2, + }); + }); + + app.get('/fonts/:name', (req, res) => { + // Only serve files explicitly enumerated by the current font list to keep the endpoint + // from turning into a generic file server for the fonts directory. + const match = Object.values(currentFontEntries()).find((entry) => entry.name === req.params.name); + if (!match) { + res.status(404).send('font not found'); + return; + } + res.sendFile(match.path); + }); + + // MCP Apps endpoint. CodeBuddy (or any MCP client) connects to /mcp via Streamable HTTP + // transport. The MCP server exposes 5 tools (preview_pagx, set_channel, reset_channel, + // reload_file, get_document) and 1 HTML resource (ui://pagx-preview/main) so that the host + // can render a pagx widget directly inside the conversation flow. The MCP server shares the + // same express app, port, and session state as the rest of pagx-preview. + // + // serverBaseUrl is assigned after app.listen resolves the actual port. readResource reads it + // lazily (via getServerBaseUrl) to inject into the widget HTML, so the widget's relative + // URLs resolve against the server even when it runs inside a sandbox iframe with opaque origin. + let serverBaseUrl = ''; + mountMcpServer(app, { + sessions, + dropSessions, + createOrGetSession, + staticDir: STATIC_DIR, + getServerBaseUrl: () => serverBaseUrl, + }); + + // Root redirects to the initial session, which is what CLI users hit when the browser opens. + app.get('/', (req, res) => { + if (initialSession) { + res.redirect(`/session/${initialSession.id}/`); + return; + } + res.status(404).send('no default session'); + }); + + // Broadcasts an event to every active SSE subscriber. Used by the lazy font download to nudge + // clients into re-registering their fallback fonts once the download completes. + function broadcastToAll(event) { + for (const session of sessions.values()) { + session.emit(event); + } + } + + // Kick off a background download so a globally installed pagx-preview eventually gets fonts + // even without a libpag checkout. The download is fire-and-forget: server responsiveness + // never waits on it, and clients poll /fonts/list via SSE-driven retry. + if (useLazyDownload) { + (async () => { + const before = Object.keys(currentFontEntries()).length; + const result = await ensureAllFonts(); + // If the initial resolveFontsDir() picked null (nothing existed yet) but the cache is now + // populated, promote it so the /fonts/:name handler can serve out of it. + if (!resolvedFontsDir && Object.values(result).some((r) => r.path)) { + resolvedFontsDir = resolveFontsDir(null); + } + const after = Object.keys(currentFontEntries()).length; + if (after > before) { + broadcastToAll({ type: 'fonts-ready' }); + } + })().catch((err) => { + process.stderr.write(`pagx-preview: font download failed: ${err.message}\n`); + }); + } + + return await new Promise((resolve, reject) => { + const server = app.listen(port, host, () => { + const actualPort = server.address().port; + const displayHost = host === '0.0.0.0' ? 'localhost' : host; + serverBaseUrl = `http://${displayHost}:${actualPort}`; + const url = initialSession + ? `http://${displayHost}:${actualPort}/session/${initialSession.id}/` + : `http://${displayHost}:${actualPort}/`; + resolve({ + server, + port: actualPort, + host, + url, + sessionId: initialSession ? initialSession.id : null, + // Exposed so a stdio MCP server (see connectStdioMcpServer) can share this in-process + // preview server's live state instead of talking to it over HTTP. + sessions, + dropSessions, + createOrGetSession, + staticDir: STATIC_DIR, + getServerBaseUrl: () => serverBaseUrl, + get fontsDir() { + // Reflects the currently-resolved directory: with lazy download, initial startup can + // return null but a later access (after the download finishes) sees the cache dir. + return resolvedFontsDir; + }, + useLazyDownload, + onIdle(cb) { + idleCallback = cb; + scheduleIdleCheck(); + }, + async close() { + cancelIdleCheck(); + idleCallback = null; + // Terminate any live SSE streams first so their sockets become drainable. + for (const res of sseResponses) { + try { + res.end(); + } catch (_) { + // ignore + } + } + sseResponses.clear(); + sseCountBySession.clear(); + // Force-destroy remaining sockets: keep-alive TCP connections would otherwise keep + // server.close() pending until the peer times out. + for (const socket of sockets) { + socket.destroy(); + } + sockets.clear(); + for (const session of sessions.values()) { + await session.close(); + } + sessions.clear(); + dropSessions.clear(); + await new Promise((r) => server.close(() => r())); + }, + }); + }); + server.on('connection', (socket) => { + sockets.add(socket); + socket.on('close', () => sockets.delete(socket)); + }); + server.on('error', reject); + }); +} diff --git a/playground/pagx-preview/src/server/lock.js b/playground/pagx-preview/src/server/lock.js new file mode 100644 index 0000000000..f3a6c32c15 --- /dev/null +++ b/playground/pagx-preview/src/server/lock.js @@ -0,0 +1,107 @@ +///////////////////////////////////////////////////////////////////////////////////////////////// +// +// Tencent is pleased to support the open source community by making libpag available. +// +// Copyright (C) 2026 Tencent. 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. +// +///////////////////////////////////////////////////////////////////////////////////////////////// + +// Cross-invocation lock file so a second `pagx-preview` call can discover a running server +// instead of spawning its own. Layout: ~/.pagx/preview.lock is a small JSON blob describing +// the currently-live server. A missing/stale lock (pid gone, unresponsive port) is treated as +// no server, and the caller is expected to spawn a new one. + +import fs from 'fs'; +import path from 'path'; +import os from 'os'; +import http from 'http'; + +const LOCK_DIR = path.join(os.homedir(), '.pagx'); +const LOCK_FILE = path.join(LOCK_DIR, 'preview.lock'); +// Time-boxed health probe to keep CLI startup snappy when the peer process is unhealthy. +const HEALTH_TIMEOUT_MS = 500; + +function pidAlive(pid) { + if (!pid || pid <= 0) return false; + try { + // Signal 0 checks process existence without actually delivering a signal. + process.kill(pid, 0); + return true; + } catch (err) { + // ESRCH: no such process. EPERM: process exists but we can't signal it (still counts as alive). + return err.code === 'EPERM'; + } +} + +function healthCheck(host, port) { + return new Promise((resolve) => { + const req = http.get( + { host, port, path: '/health', timeout: HEALTH_TIMEOUT_MS }, + (res) => { + // Drain the body so the socket can be freed even on unexpected content. + res.resume(); + resolve(res.statusCode === 200); + } + ); + req.on('error', () => resolve(false)); + req.on('timeout', () => { + req.destroy(); + resolve(false); + }); + }); +} + +/** Reads the lock file. Returns null if missing or unparsable. */ +export function readLock() { + try { + return JSON.parse(fs.readFileSync(LOCK_FILE, 'utf8')); + } catch (_) { + return null; + } +} + +/** Writes the lock file with the current server's identity. */ +export function writeLock({ port, host, pid }) { + fs.mkdirSync(LOCK_DIR, { recursive: true }); + const payload = { port, host, pid, startedAt: new Date().toISOString() }; + fs.writeFileSync(LOCK_FILE, JSON.stringify(payload, null, 2) + '\n'); +} + +/** Deletes the lock file (idempotent). */ +export function clearLock() { + try { + fs.unlinkSync(LOCK_FILE); + } catch (err) { + if (err.code !== 'ENOENT') throw err; + } +} + +/** + * Checks whether a live pagx-preview server is reachable via the lock file. Returns the lock + * payload on success, or null when no usable server exists (missing lock, dead pid, or + * unresponsive port). + */ +export async function probeLiveServer() { + const lock = readLock(); + if (!lock) return null; + if (!pidAlive(lock.pid)) { + clearLock(); + return null; + } + const ok = await healthCheck(lock.host || '127.0.0.1', lock.port); + if (!ok) { + clearLock(); + return null; + } + return lock; +} diff --git a/playground/pagx-preview/src/server/session.js b/playground/pagx-preview/src/server/session.js new file mode 100644 index 0000000000..f14626a085 --- /dev/null +++ b/playground/pagx-preview/src/server/session.js @@ -0,0 +1,130 @@ +///////////////////////////////////////////////////////////////////////////////////////////////// +// +// Tencent is pleased to support the open source community by making libpag available. +// +// Copyright (C) 2026 Tencent. 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. +// +///////////////////////////////////////////////////////////////////////////////////////////////// + +import path from 'path'; +import chokidar from 'chokidar'; + +// Delay between raw chokidar events and the reload emission. Absorbs the burst that editors +// produce when saving (temp file + rename + attr touch) into a single reload. +const RELOAD_DEBOUNCE_MS = 80; + +/** + * PreviewSession tracks one PAGX file plus its external resources (images, embedded fonts, etc.) + * and turns filesystem changes into reload events for subscribers. + * + * The entry file is watched from construction. Resource files reported by the browser via + * updateResources() are added incrementally; stale entries are unwatched on the next update. + */ +export class PreviewSession { + constructor(id, entryFile) { + this.id = id; + this.entryFile = path.resolve(entryFile); + this.entryDir = path.dirname(this.entryFile); + this.resources = new Set(); + this.listeners = new Set(); + this.reloadTimer = null; + // Cached document summary uploaded by the client after a successful load. Used by the MCP + // get_document tool to answer AI queries without round-tripping through the client. Stale + // data is acceptable — the client overwrites it on every load. + this.documentSummary = null; + // Count of consecutive get_document calls that found no summary. When a host does not render + // the inline widget, the summary never arrives; this lets the MCP tool detect that case and + // fall back to the browser-openable webview after a few misses. Reset to 0 on a successful + // get_document (i.e. once the client has uploaded a summary). + this.documentQueryFailures = 0; + this.watcher = chokidar.watch(this.entryFile, { + ignoreInitial: true, + awaitWriteFinish: { stabilityThreshold: 40, pollInterval: 20 }, + }); + this.watcher.on('all', (event, file) => this.onFsEvent(event, file)); + } + + /** Resolves a browser-supplied relative path to an absolute path under entryDir, or null if + * the path escapes the entry directory (defense against `../` traversal). */ + resolveResource(relativePath) { + if (typeof relativePath !== 'string' || relativePath.length === 0) return null; + if (relativePath.includes('\0')) return null; + const absolute = path.resolve(this.entryDir, relativePath); + const rel = path.relative(this.entryDir, absolute); + if (rel.startsWith('..') || path.isAbsolute(rel)) return null; + return absolute; + } + + /** Replaces the resource watch list with the browser-reported set. */ + updateResources(paths) { + const nextAbs = new Set(); + for (const p of paths) { + const abs = this.resolveResource(p); + if (abs) nextAbs.add(abs); + } + const toAdd = []; + const toRemove = []; + for (const abs of nextAbs) { + if (!this.resources.has(abs)) toAdd.push(abs); + } + for (const abs of this.resources) { + if (!nextAbs.has(abs)) toRemove.push(abs); + } + if (toAdd.length > 0) this.watcher.add(toAdd); + if (toRemove.length > 0) this.watcher.unwatch(toRemove); + this.resources = nextAbs; + } + + subscribe(listener) { + this.listeners.add(listener); + return () => this.listeners.delete(listener); + } + + hasSubscribers() { + return this.listeners.size > 0; + } + + /** Stores a document summary uploaded by the client after load. See documentSummary comment. */ + setDocumentSummary(summary) { + this.documentSummary = summary; + this.documentQueryFailures = 0; + } + + onFsEvent(event, file) { + if (event !== 'add' && event !== 'change' && event !== 'unlink') return; + if (this.reloadTimer !== null) return; + this.reloadTimer = setTimeout(() => { + this.reloadTimer = null; + this.emit({ type: 'reload', file, event }); + }, RELOAD_DEBOUNCE_MS); + } + + emit(payload) { + for (const listener of this.listeners) { + try { + listener(payload); + } catch (err) { + console.error('pagx-preview: subscriber threw', err); + } + } + } + + async close() { + if (this.reloadTimer !== null) { + clearTimeout(this.reloadTimer); + this.reloadTimer = null; + } + this.listeners.clear(); + await this.watcher.close(); + } +} diff --git a/playground/pagx-preview/static/ext/app-with-deps.js b/playground/pagx-preview/static/ext/app-with-deps.js new file mode 100644 index 0000000000..e758942541 --- /dev/null +++ b/playground/pagx-preview/static/ext/app-with-deps.js @@ -0,0 +1,78 @@ +var fI=Object.defineProperty;var dI=(r)=>r;function hI(r,i){this[r]=dI.bind(null,i)}var Lr=(r,i)=>{for(var v in i)fI(r,v,{get:i[v],enumerable:!0,configurable:!0,set:hI.bind(i,v)})};var S=(r,i)=>()=>(r&&(i=r(r=0)),i);function I(r,i,v){function u(g,b){if(!g._zod)Object.defineProperty(g,"_zod",{value:{def:b,constr:t,traits:new Set},enumerable:!1});if(g._zod.traits.has(r))return;g._zod.traits.add(r),i(g,b);let o=t.prototype,_=Object.keys(o);for(let w=0;w<_.length;w++){let N=_[w];if(!(N in g))g[N]=o[N].bind(g)}}let n=v?.Parent??Object;class $ extends n{}Object.defineProperty($,"name",{value:r});function t(g){var b;let o=v?.Parent?new $:this;u(o,g),(b=o._zod).deferred??(b.deferred=[]);for(let _ of o._zod.deferred)_();return o}return Object.defineProperty(t,"init",{value:u}),Object.defineProperty(t,Symbol.hasInstance,{value:(g)=>{if(v?.Parent&&g instanceof v.Parent)return!0;return g?._zod?.traits?.has(r)}}),Object.defineProperty(t,"name",{value:r}),t}function R(r){if(r)Object.assign(an,r);return an}var Pv,Sv,Ar,yr,an;var kn=S(()=>{Pv=Object.freeze({status:"aborted"});Sv=Symbol("zod_brand");Ar=class Ar extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};yr=class yr extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`);this.name="ZodEncodeError"}};an={}});var c={};Lr(c,{unwrapMessage:()=>sn,uint8ArrayToHex:()=>PU,uint8ArrayToBase64url:()=>cU,uint8ArrayToBase64:()=>Gb,stringifyPrimitive:()=>k,slugify:()=>Ru,shallowClone:()=>eu,safeExtend:()=>UU,required:()=>NU,randomString:()=>tU,propertyKeyTypes:()=>ii,promiseAllObject:()=>uU,primitiveTypes:()=>yu,prefixIssues:()=>Ir,pick:()=>bU,partial:()=>wU,parsedType:()=>O,optionalKeys:()=>fu,omit:()=>_U,objectClone:()=>iU,numKeys:()=>gU,nullish:()=>Br,normalizeParams:()=>z,mergeDefs:()=>Gr,merge:()=>DU,jsonStringifyReplacer:()=>On,joinValues:()=>U,issue:()=>zn,isPlainObject:()=>Hr,isObject:()=>fr,hexToUint8Array:()=>zU,getSizableOrigin:()=>vi,getParsedType:()=>oU,getLengthableOrigin:()=>$i,getEnumValues:()=>ri,getElementAtPath:()=>$U,floatSafeRemainder:()=>mu,finalizeIssue:()=>gr,extend:()=>IU,escapeRegex:()=>wr,esc:()=>Jv,defineLazy:()=>G,createTransparentProxy:()=>lU,cloneDef:()=>vU,clone:()=>rr,cleanRegex:()=>ni,cleanEnum:()=>kU,captureStackTrace:()=>Lv,cached:()=>cn,base64urlToUint8Array:()=>OU,base64ToUint8Array:()=>Xb,assignProp:()=>Fr,assertNotEqual:()=>aI,assertNever:()=>rU,assertIs:()=>sI,assertEqual:()=>pI,assert:()=>nU,allowsEval:()=>Cu,aborted:()=>Er,NUMBER_FORMAT_RANGES:()=>du,Class:()=>Vb,BIGINT_FORMAT_RANGES:()=>hu});function pI(r){return r}function aI(r){return r}function sI(r){}function rU(r){throw Error("Unexpected value in exhaustive check")}function nU(r){}function ri(r){let i=Object.values(r).filter((u)=>typeof u==="number");return Object.entries(r).filter(([u,n])=>i.indexOf(+u)===-1).map(([u,n])=>n)}function U(r,i="|"){return r.map((v)=>k(v)).join(i)}function On(r,i){if(typeof i==="bigint")return i.toString();return i}function cn(r){return{get value(){{let v=r();return Object.defineProperty(this,"value",{value:v}),v}throw Error("cached value already set")}}}function Br(r){return r===null||r===void 0}function ni(r){let i=r.startsWith("^")?1:0,v=r.endsWith("$")?r.length-1:r.length;return r.slice(i,v)}function mu(r,i){let v=(r.toString().split(".")[1]||"").length,u=i.toString(),n=(u.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(u)){let b=u.match(/\d?e-(\d?)/);if(b?.[1])n=Number.parseInt(b[1])}let $=v>n?v:n,t=Number.parseInt(r.toFixed($).replace(".","")),g=Number.parseInt(i.toFixed($).replace(".",""));return t%g/10**$}function G(r,i,v){let u=void 0;Object.defineProperty(r,i,{get(){if(u===Wb)return;if(u===void 0)u=Wb,u=v();return u},set(n){Object.defineProperty(r,i,{value:n})},configurable:!0})}function iU(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function Fr(r,i,v){Object.defineProperty(r,i,{value:v,writable:!0,enumerable:!0,configurable:!0})}function Gr(...r){let i={};for(let v of r){let u=Object.getOwnPropertyDescriptors(v);Object.assign(i,u)}return Object.defineProperties({},i)}function vU(r){return Gr(r._zod.def)}function $U(r,i){if(!i)return r;return i.reduce((v,u)=>v?.[u],r)}function uU(r){let i=Object.keys(r),v=i.map((u)=>r[u]);return Promise.all(v).then((u)=>{let n={};for(let $=0;$i};if(i?.message!==void 0){if(i?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");i.error=i.message}if(delete i.message,typeof i.error==="string")return{...i,error:()=>i.error};return i}function lU(r){let i;return new Proxy({},{get(v,u,n){return i??(i=r()),Reflect.get(i,u,n)},set(v,u,n,$){return i??(i=r()),Reflect.set(i,u,n,$)},has(v,u){return i??(i=r()),Reflect.has(i,u)},deleteProperty(v,u){return i??(i=r()),Reflect.deleteProperty(i,u)},ownKeys(v){return i??(i=r()),Reflect.ownKeys(i)},getOwnPropertyDescriptor(v,u){return i??(i=r()),Reflect.getOwnPropertyDescriptor(i,u)},defineProperty(v,u,n){return i??(i=r()),Reflect.defineProperty(i,u,n)}})}function k(r){if(typeof r==="bigint")return r.toString()+"n";if(typeof r==="string")return`"${r}"`;return`${r}`}function fu(r){return Object.keys(r).filter((i)=>{return r[i]._zod.optin==="optional"&&r[i]._zod.optout==="optional"})}function bU(r,i){let v=r._zod.def,u=v.checks;if(u&&u.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let $=Gr(r._zod.def,{get shape(){let t={};for(let g in i){if(!(g in v.shape))throw Error(`Unrecognized key: "${g}"`);if(!i[g])continue;t[g]=v.shape[g]}return Fr(this,"shape",t),t},checks:[]});return rr(r,$)}function _U(r,i){let v=r._zod.def,u=v.checks;if(u&&u.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let $=Gr(r._zod.def,{get shape(){let t={...r._zod.def.shape};for(let g in i){if(!(g in v.shape))throw Error(`Unrecognized key: "${g}"`);if(!i[g])continue;delete t[g]}return Fr(this,"shape",t),t},checks:[]});return rr(r,$)}function IU(r,i){if(!Hr(i))throw Error("Invalid input to extend: expected a plain object");let v=r._zod.def.checks;if(v&&v.length>0){let $=r._zod.def.shape;for(let t in i)if(Object.getOwnPropertyDescriptor($,t)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Gr(r._zod.def,{get shape(){let $={...r._zod.def.shape,...i};return Fr(this,"shape",$),$}});return rr(r,n)}function UU(r,i){if(!Hr(i))throw Error("Invalid input to safeExtend: expected a plain object");let v=Gr(r._zod.def,{get shape(){let u={...r._zod.def.shape,...i};return Fr(this,"shape",u),u}});return rr(r,v)}function DU(r,i){let v=Gr(r._zod.def,{get shape(){let u={...r._zod.def.shape,...i._zod.def.shape};return Fr(this,"shape",u),u},get catchall(){return i._zod.def.catchall},checks:[]});return rr(r,v)}function wU(r,i,v){let n=i._zod.def.checks;if(n&&n.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let t=Gr(i._zod.def,{get shape(){let g=i._zod.def.shape,b={...g};if(v)for(let o in v){if(!(o in g))throw Error(`Unrecognized key: "${o}"`);if(!v[o])continue;b[o]=r?new r({type:"optional",innerType:g[o]}):g[o]}else for(let o in g)b[o]=r?new r({type:"optional",innerType:g[o]}):g[o];return Fr(this,"shape",b),b},checks:[]});return rr(i,t)}function NU(r,i,v){let u=Gr(i._zod.def,{get shape(){let n=i._zod.def.shape,$={...n};if(v)for(let t in v){if(!(t in $))throw Error(`Unrecognized key: "${t}"`);if(!v[t])continue;$[t]=new r({type:"nonoptional",innerType:n[t]})}else for(let t in n)$[t]=new r({type:"nonoptional",innerType:n[t]});return Fr(this,"shape",$),$}});return rr(i,u)}function Er(r,i=0){if(r.aborted===!0)return!0;for(let v=i;v{var u;return(u=v).path??(u.path=[]),v.path.unshift(r),v})}function sn(r){return typeof r==="string"?r:r?.message}function gr(r,i,v){let u={...r,path:r.path??[]};if(!r.message){let n=sn(r.inst?._zod.def?.error?.(r))??sn(i?.error?.(r))??sn(v.customError?.(r))??sn(v.localeError?.(r))??"Invalid input";u.message=n}if(delete u.inst,delete u.continue,!i?.reportInput)delete u.input;return u}function vi(r){if(r instanceof Set)return"set";if(r instanceof Map)return"map";if(r instanceof File)return"file";return"unknown"}function $i(r){if(Array.isArray(r))return"array";if(typeof r==="string")return"string";return"unknown"}function O(r){let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"nan":"number";case"object":{if(r===null)return"null";if(Array.isArray(r))return"array";let v=r;if(v&&Object.getPrototypeOf(v)!==Object.prototype&&"constructor"in v&&v.constructor)return v.constructor.name}}return i}function zn(...r){let[i,v,u]=r;if(typeof i==="string")return{message:i,code:"custom",input:v,inst:u};return{...i}}function kU(r){return Object.entries(r).filter(([i,v])=>{return Number.isNaN(Number.parseInt(i,10))}).map((i)=>i[1])}function Xb(r){let i=atob(r),v=new Uint8Array(i.length);for(let u=0;ui.toString(16).padStart(2,"0")).join("")}class Vb{constructor(...r){}}var Wb,Lv,Cu,oU=(r)=>{let i=typeof r;switch(i){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(r)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(r))return"array";if(r===null)return"null";if(r.then&&typeof r.then==="function"&&r.catch&&typeof r.catch==="function")return"promise";if(typeof Map<"u"&&r instanceof Map)return"map";if(typeof Set<"u"&&r instanceof Set)return"set";if(typeof Date<"u"&&r instanceof Date)return"date";if(typeof File<"u"&&r instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${i}`)}},ii,yu,du,hu;var j=S(()=>{Wb=Symbol("evaluating");Lv="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};Cu=cn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(r){return!1}});ii=new Set(["string","number","symbol"]),yu=new Set(["string","number","bigint","boolean","symbol","undefined"]);du={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},hu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]}});function Pn(r,i=(v)=>v.message){let v={},u=[];for(let n of r.issues)if(n.path.length>0)v[n.path[0]]=v[n.path[0]]||[],v[n.path[0]].push(i(n));else u.push(i(n));return{formErrors:u,fieldErrors:v}}function Sn(r,i=(v)=>v.message){let v={_errors:[]},u=(n)=>{for(let $ of n.issues)if($.code==="invalid_union"&&$.errors.length)$.errors.map((t)=>u({issues:t}));else if($.code==="invalid_key")u({issues:$.issues});else if($.code==="invalid_element")u({issues:$.issues});else if($.path.length===0)v._errors.push(i($));else{let t=v,g=0;while(g<$.path.length){let b=$.path[g];if(g!==$.path.length-1)t[b]=t[b]||{_errors:[]};else t[b]=t[b]||{_errors:[]},t[b]._errors.push(i($));t=t[b],g++}}};return u(r),v}function Av(r,i=(v)=>v.message){let v={errors:[]},u=(n,$=[])=>{var t,g;for(let b of n.issues)if(b.code==="invalid_union"&&b.errors.length)b.errors.map((o)=>u({issues:o},b.path));else if(b.code==="invalid_key")u({issues:b.issues},b.path);else if(b.code==="invalid_element")u({issues:b.issues},b.path);else{let o=[...$,...b.path];if(o.length===0){v.errors.push(i(b));continue}let _=v,w=0;while(wtypeof u==="object"?u.key:u);for(let u of v)if(typeof u==="number")i.push(`[${u}]`);else if(typeof u==="symbol")i.push(`[${JSON.stringify(String(u))}]`);else if(/[^\w$]/.test(u))i.push(`[${JSON.stringify(u)}]`);else{if(i.length)i.push(".");i.push(u)}return i.join("")}function jv(r){let i=[],v=[...r.issues].sort((u,n)=>(u.path??[]).length-(n.path??[]).length);for(let u of v)if(i.push(`✖ ${u.message}`),u.path?.length)i.push(` → at ${Yb(u.path)}`);return i.join(` +`)}var Kb=(r,i)=>{r.name="$ZodError",Object.defineProperty(r,"_zod",{value:r._zod,enumerable:!1}),Object.defineProperty(r,"issues",{value:i,enumerable:!1}),r.message=JSON.stringify(i,On,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},ui,or;var pu=S(()=>{kn();j();ui=I("$ZodError",Kb),or=I("$ZodError",Kb,{Parent:Error})});var Jn=(r)=>(i,v,u,n)=>{let $=u?Object.assign(u,{async:!1}):{async:!1},t=i._zod.run({value:v,issues:[]},$);if(t instanceof Promise)throw new Ar;if(t.issues.length){let g=new(n?.Err??r)(t.issues.map((b)=>gr(b,$,R())));throw Lv(g,n?.callee),g}return t.value},ti,Ln=(r)=>async(i,v,u,n)=>{let $=u?Object.assign(u,{async:!0}):{async:!0},t=i._zod.run({value:v,issues:[]},$);if(t instanceof Promise)t=await t;if(t.issues.length){let g=new(n?.Err??r)(t.issues.map((b)=>gr(b,$,R())));throw Lv(g,n?.callee),g}return t.value},gi,An=(r)=>(i,v,u)=>{let n=u?{...u,async:!1}:{async:!1},$=i._zod.run({value:v,issues:[]},n);if($ instanceof Promise)throw new Ar;return $.issues.length?{success:!1,error:new(r??ui)($.issues.map((t)=>gr(t,n,R())))}:{success:!0,data:$.value}},jn,Wn=(r)=>async(i,v,u)=>{let n=u?Object.assign(u,{async:!0}):{async:!0},$=i._zod.run({value:v,issues:[]},n);if($ instanceof Promise)$=await $;return $.issues.length?{success:!1,error:new r($.issues.map((t)=>gr(t,n,R())))}:{success:!0,data:$.value}},oi,Wv=(r)=>(i,v,u)=>{let n=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return Jn(r)(i,v,n)},Qb,Xv=(r)=>(i,v,u)=>{return Jn(r)(i,v,u)},Bb,Gv=(r)=>async(i,v,u)=>{let n=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return Ln(r)(i,v,n)},Fb,Vv=(r)=>async(i,v,u)=>{return Ln(r)(i,v,u)},Hb,Kv=(r)=>(i,v,u)=>{let n=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return An(r)(i,v,n)},Eb,Yv=(r)=>(i,v,u)=>{return An(r)(i,v,u)},Tb,Qv=(r)=>async(i,v,u)=>{let n=u?Object.assign(u,{direction:"backward"}):{direction:"backward"};return Wn(r)(i,v,n)},Mb,Bv=(r)=>async(i,v,u)=>{return Wn(r)(i,v,u)},qb;var au=S(()=>{kn();pu();j();ti=Jn(or),gi=Ln(or),jn=An(or),oi=Wn(or),Qb=Wv(or),Bb=Xv(or),Fb=Gv(or),Hb=Vv(or),Eb=Kv(or),Tb=Yv(or),Mb=Qv(or),qb=Bv(or)});var Ur={};Lr(Ur,{xid:()=>it,uuid7:()=>jU,uuid6:()=>AU,uuid4:()=>LU,uuid:()=>dr,uppercase:()=>jt,unicodeEmail:()=>xb,undefined:()=>Lt,ulid:()=>nt,time:()=>kt,string:()=>ct,sha512_hex:()=>yU,sha512_base64url:()=>dU,sha512_base64:()=>fU,sha384_hex:()=>RU,sha384_base64url:()=>eU,sha384_base64:()=>CU,sha256_hex:()=>xU,sha256_base64url:()=>mU,sha256_base64:()=>ZU,sha1_hex:()=>TU,sha1_base64url:()=>qU,sha1_base64:()=>MU,rfc5322Email:()=>XU,number:()=>li,null:()=>Jt,nanoid:()=>$t,md5_hex:()=>FU,md5_base64url:()=>EU,md5_base64:()=>HU,mac:()=>_t,lowercase:()=>At,ksuid:()=>vt,ipv6:()=>bt,ipv4:()=>lt,integer:()=>Pt,idnEmail:()=>GU,html5Email:()=>WU,hostname:()=>YU,hex:()=>BU,guid:()=>tt,extendedDuration:()=>JU,emoji:()=>ot,email:()=>gt,e164:()=>wt,duration:()=>ut,domain:()=>QU,datetime:()=>Ot,date:()=>Nt,cuid2:()=>rt,cuid:()=>su,cidrv6:()=>Ut,cidrv4:()=>It,browserEmail:()=>VU,boolean:()=>St,bigint:()=>zt,base64url:()=>Fv,base64:()=>Dt});function ot(){return new RegExp(KU,"u")}function mb(r){return typeof r.precision==="number"?r.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":r.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${r.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function kt(r){return new RegExp(`^${mb(r)}$`)}function Ot(r){let i=mb({precision:r.precision}),v=["Z"];if(r.local)v.push("");if(r.offset)v.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let u=`${i}(?:${v.join("|")})`;return new RegExp(`^${Zb}T(?:${u})$`)}function bi(r,i){return new RegExp(`^[A-Za-z0-9+/]{${r}}${i}$`)}function _i(r){return new RegExp(`^[A-Za-z0-9_-]{${r}}$`)}var su,rt,nt,it,vt,$t,ut,JU,tt,dr=(r)=>{if(!r)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${r}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},LU,AU,jU,gt,WU,XU,xb,GU,VU,KU="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",lt,bt,_t=(r)=>{let i=wr(r??":");return new RegExp(`^(?:[0-9A-F]{2}${i}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${i}){5}[0-9a-f]{2}$`)},It,Ut,Dt,Fv,YU,QU,wt,Zb="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Nt,ct=(r)=>{let i=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${i}$`)},zt,Pt,li,St,Jt,Lt,At,jt,BU,FU,HU,EU,TU,MU,qU,xU,ZU,mU,RU,CU,eU,yU,fU,dU;var Hv=S(()=>{j();su=/^[cC][^\s-]{8,}$/,rt=/^[0-9a-z]+$/,nt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,it=/^[0-9a-vA-V]{20}$/,vt=/^[A-Za-z0-9]{27}$/,$t=/^[a-zA-Z0-9_-]{21}$/,ut=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,JU=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,LU=dr(4),AU=dr(6),jU=dr(7),gt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,WU=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,XU=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,xb=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,GU=xb,VU=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;lt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,bt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,It=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ut=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Dt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Fv=/^[A-Za-z0-9_-]*$/,YU=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,QU=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,wt=/^\+[1-9]\d{6,14}$/,Nt=new RegExp(`^${Zb}$`);zt=/^-?\d+n?$/,Pt=/^-?\d+$/,li=/^-?\d+(?:\.\d+)?$/,St=/^(?:true|false)$/i,Jt=/^null$/i,Lt=/^undefined$/i,At=/^[^A-Z]*$/,jt=/^[^a-z]*$/,BU=/^[0-9a-fA-F]*$/;FU=/^[0-9a-fA-F]{32}$/,HU=bi(22,"=="),EU=_i(22),TU=/^[0-9a-fA-F]{40}$/,MU=bi(27,"="),qU=_i(27),xU=/^[0-9a-fA-F]{64}$/,ZU=bi(43,"="),mU=_i(43),RU=/^[0-9a-fA-F]{96}$/,CU=bi(64,""),eU=_i(64),yU=/^[0-9a-fA-F]{128}$/,fU=bi(86,"=="),dU=_i(86)});function Rb(r,i,v){if(r.issues.length)i.issues.push(...Ir(v,r.issues))}var m,Cb,Ev,Tv,Wt,Xt,Gt,Vt,Kt,Yt,Qt,Bt,Ft,Xn,Ht,Et,Tt,Mt,qt,xt,Zt,mt,Rt;var Mv=S(()=>{kn();Hv();j();m=I("$ZodCheck",(r,i)=>{var v;r._zod??(r._zod={}),r._zod.def=i,(v=r._zod).onattach??(v.onattach=[])}),Cb={number:"number",bigint:"bigint",object:"date"},Ev=I("$ZodCheckLessThan",(r,i)=>{m.init(r,i);let v=Cb[typeof i.value];r._zod.onattach.push((u)=>{let n=u._zod.bag,$=(i.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(i.value<$)if(i.inclusive)n.maximum=i.value;else n.exclusiveMaximum=i.value}),r._zod.check=(u)=>{if(i.inclusive?u.value<=i.value:u.value{m.init(r,i);let v=Cb[typeof i.value];r._zod.onattach.push((u)=>{let n=u._zod.bag,$=(i.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(i.value>$)if(i.inclusive)n.minimum=i.value;else n.exclusiveMinimum=i.value}),r._zod.check=(u)=>{if(i.inclusive?u.value>=i.value:u.value>i.value)return;u.issues.push({origin:v,code:"too_small",minimum:typeof i.value==="object"?i.value.getTime():i.value,input:u.value,inclusive:i.inclusive,inst:r,continue:!i.abort})}}),Wt=I("$ZodCheckMultipleOf",(r,i)=>{m.init(r,i),r._zod.onattach.push((v)=>{var u;(u=v._zod.bag).multipleOf??(u.multipleOf=i.value)}),r._zod.check=(v)=>{if(typeof v.value!==typeof i.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof v.value==="bigint"?v.value%i.value===BigInt(0):mu(v.value,i.value)===0)return;v.issues.push({origin:typeof v.value,code:"not_multiple_of",divisor:i.value,input:v.value,inst:r,continue:!i.abort})}}),Xt=I("$ZodCheckNumberFormat",(r,i)=>{m.init(r,i),i.format=i.format||"float64";let v=i.format?.includes("int"),u=v?"int":"number",[n,$]=du[i.format];r._zod.onattach.push((t)=>{let g=t._zod.bag;if(g.format=i.format,g.minimum=n,g.maximum=$,v)g.pattern=Pt}),r._zod.check=(t)=>{let g=t.value;if(v){if(!Number.isInteger(g)){t.issues.push({expected:u,format:i.format,code:"invalid_type",continue:!1,input:g,inst:r});return}if(!Number.isSafeInteger(g)){if(g>0)t.issues.push({input:g,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:u,inclusive:!0,continue:!i.abort});else t.issues.push({input:g,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:u,inclusive:!0,continue:!i.abort});return}}if(g$)t.issues.push({origin:"number",input:g,code:"too_big",maximum:$,inclusive:!0,inst:r,continue:!i.abort})}}),Gt=I("$ZodCheckBigIntFormat",(r,i)=>{m.init(r,i);let[v,u]=hu[i.format];r._zod.onattach.push((n)=>{let $=n._zod.bag;$.format=i.format,$.minimum=v,$.maximum=u}),r._zod.check=(n)=>{let $=n.value;if($u)n.issues.push({origin:"bigint",input:$,code:"too_big",maximum:u,inclusive:!0,inst:r,continue:!i.abort})}}),Vt=I("$ZodCheckMaxSize",(r,i)=>{var v;m.init(r,i),(v=r._zod.def).when??(v.when=(u)=>{let n=u.value;return!Br(n)&&n.size!==void 0}),r._zod.onattach.push((u)=>{let n=u._zod.bag.maximum??Number.POSITIVE_INFINITY;if(i.maximum{let n=u.value;if(n.size<=i.maximum)return;u.issues.push({origin:vi(n),code:"too_big",maximum:i.maximum,inclusive:!0,input:n,inst:r,continue:!i.abort})}}),Kt=I("$ZodCheckMinSize",(r,i)=>{var v;m.init(r,i),(v=r._zod.def).when??(v.when=(u)=>{let n=u.value;return!Br(n)&&n.size!==void 0}),r._zod.onattach.push((u)=>{let n=u._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(i.minimum>n)u._zod.bag.minimum=i.minimum}),r._zod.check=(u)=>{let n=u.value;if(n.size>=i.minimum)return;u.issues.push({origin:vi(n),code:"too_small",minimum:i.minimum,inclusive:!0,input:n,inst:r,continue:!i.abort})}}),Yt=I("$ZodCheckSizeEquals",(r,i)=>{var v;m.init(r,i),(v=r._zod.def).when??(v.when=(u)=>{let n=u.value;return!Br(n)&&n.size!==void 0}),r._zod.onattach.push((u)=>{let n=u._zod.bag;n.minimum=i.size,n.maximum=i.size,n.size=i.size}),r._zod.check=(u)=>{let n=u.value,$=n.size;if($===i.size)return;let t=$>i.size;u.issues.push({origin:vi(n),...t?{code:"too_big",maximum:i.size}:{code:"too_small",minimum:i.size},inclusive:!0,exact:!0,input:u.value,inst:r,continue:!i.abort})}}),Qt=I("$ZodCheckMaxLength",(r,i)=>{var v;m.init(r,i),(v=r._zod.def).when??(v.when=(u)=>{let n=u.value;return!Br(n)&&n.length!==void 0}),r._zod.onattach.push((u)=>{let n=u._zod.bag.maximum??Number.POSITIVE_INFINITY;if(i.maximum{let n=u.value;if(n.length<=i.maximum)return;let t=$i(n);u.issues.push({origin:t,code:"too_big",maximum:i.maximum,inclusive:!0,input:n,inst:r,continue:!i.abort})}}),Bt=I("$ZodCheckMinLength",(r,i)=>{var v;m.init(r,i),(v=r._zod.def).when??(v.when=(u)=>{let n=u.value;return!Br(n)&&n.length!==void 0}),r._zod.onattach.push((u)=>{let n=u._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(i.minimum>n)u._zod.bag.minimum=i.minimum}),r._zod.check=(u)=>{let n=u.value;if(n.length>=i.minimum)return;let t=$i(n);u.issues.push({origin:t,code:"too_small",minimum:i.minimum,inclusive:!0,input:n,inst:r,continue:!i.abort})}}),Ft=I("$ZodCheckLengthEquals",(r,i)=>{var v;m.init(r,i),(v=r._zod.def).when??(v.when=(u)=>{let n=u.value;return!Br(n)&&n.length!==void 0}),r._zod.onattach.push((u)=>{let n=u._zod.bag;n.minimum=i.length,n.maximum=i.length,n.length=i.length}),r._zod.check=(u)=>{let n=u.value,$=n.length;if($===i.length)return;let t=$i(n),g=$>i.length;u.issues.push({origin:t,...g?{code:"too_big",maximum:i.length}:{code:"too_small",minimum:i.length},inclusive:!0,exact:!0,input:u.value,inst:r,continue:!i.abort})}}),Xn=I("$ZodCheckStringFormat",(r,i)=>{var v,u;if(m.init(r,i),r._zod.onattach.push((n)=>{let $=n._zod.bag;if($.format=i.format,i.pattern)$.patterns??($.patterns=new Set),$.patterns.add(i.pattern)}),i.pattern)(v=r._zod).check??(v.check=(n)=>{if(i.pattern.lastIndex=0,i.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:i.format,input:n.value,...i.pattern?{pattern:i.pattern.toString()}:{},inst:r,continue:!i.abort})});else(u=r._zod).check??(u.check=()=>{})}),Ht=I("$ZodCheckRegex",(r,i)=>{Xn.init(r,i),r._zod.check=(v)=>{if(i.pattern.lastIndex=0,i.pattern.test(v.value))return;v.issues.push({origin:"string",code:"invalid_format",format:"regex",input:v.value,pattern:i.pattern.toString(),inst:r,continue:!i.abort})}}),Et=I("$ZodCheckLowerCase",(r,i)=>{i.pattern??(i.pattern=At),Xn.init(r,i)}),Tt=I("$ZodCheckUpperCase",(r,i)=>{i.pattern??(i.pattern=jt),Xn.init(r,i)}),Mt=I("$ZodCheckIncludes",(r,i)=>{m.init(r,i);let v=wr(i.includes),u=new RegExp(typeof i.position==="number"?`^.{${i.position}}${v}`:v);i.pattern=u,r._zod.onattach.push((n)=>{let $=n._zod.bag;$.patterns??($.patterns=new Set),$.patterns.add(u)}),r._zod.check=(n)=>{if(n.value.includes(i.includes,i.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:i.includes,input:n.value,inst:r,continue:!i.abort})}}),qt=I("$ZodCheckStartsWith",(r,i)=>{m.init(r,i);let v=new RegExp(`^${wr(i.prefix)}.*`);i.pattern??(i.pattern=v),r._zod.onattach.push((u)=>{let n=u._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(v)}),r._zod.check=(u)=>{if(u.value.startsWith(i.prefix))return;u.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:i.prefix,input:u.value,inst:r,continue:!i.abort})}}),xt=I("$ZodCheckEndsWith",(r,i)=>{m.init(r,i);let v=new RegExp(`.*${wr(i.suffix)}$`);i.pattern??(i.pattern=v),r._zod.onattach.push((u)=>{let n=u._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(v)}),r._zod.check=(u)=>{if(u.value.endsWith(i.suffix))return;u.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:i.suffix,input:u.value,inst:r,continue:!i.abort})}});Zt=I("$ZodCheckProperty",(r,i)=>{m.init(r,i),r._zod.check=(v)=>{let u=i.schema._zod.run({value:v.value[i.property],issues:[]},{});if(u instanceof Promise)return u.then((n)=>Rb(n,v,i.property));Rb(u,v,i.property);return}}),mt=I("$ZodCheckMimeType",(r,i)=>{m.init(r,i);let v=new Set(i.mime);r._zod.onattach.push((u)=>{u._zod.bag.mime=i.mime}),r._zod.check=(u)=>{if(v.has(u.value.type))return;u.issues.push({code:"invalid_value",values:i.mime,input:u.value.type,inst:r,continue:!i.abort})}}),Rt=I("$ZodCheckOverwrite",(r,i)=>{m.init(r,i),r._zod.check=(v)=>{v.value=i.tx(v.value)}})});class qv{constructor(r=[]){if(this.content=[],this.indent=0,this)this.args=r}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r==="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}let v=r.split(` +`).filter(($)=>$),u=Math.min(...v.map(($)=>$.length-$.trimStart().length)),n=v.map(($)=>$.slice(u)).map(($)=>" ".repeat(this.indent*2)+$);for(let $ of n)this.content.push($)}compile(){let r=Function,i=this?.args,u=[...(this?.content??[""]).map((n)=>` ${n}`)];return new r(...i,u.join(` +`))}}var Ct;var et=S(()=>{Ct={major:4,minor:3,patch:5}});function Dg(r){if(r==="")return!0;if(r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}function $_(r){if(!Fv.test(r))return!1;let i=r.replace(/[-_]/g,(u)=>u==="-"?"+":"/"),v=i.padEnd(Math.ceil(i.length/4)*4,"=");return Dg(v)}function u_(r,i=null){try{let v=r.split(".");if(v.length!==3)return!1;let[u]=v;if(!u)return!1;let n=JSON.parse(atob(u));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(i&&(!("alg"in n)||n.alg!==i))return!1;return!0}catch{return!1}}function yb(r,i,v){if(r.issues.length)i.issues.push(...Ir(v,r.issues));i.value[v]=r.value}function Cv(r,i,v,u,n){if(r.issues.length){if(n&&!(v in u))return;i.issues.push(...Ir(v,r.issues))}if(r.value===void 0){if(v in u)i.value[v]=void 0}else i.value[v]=r.value}function t_(r){let i=Object.keys(r.shape);for(let u of i)if(!r.shape?.[u]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${u}": expected a Zod schema`);let v=fu(r.shape);return{...r,keys:i,keySet:new Set(i),numKeys:i.length,optionalKeys:new Set(v)}}function g_(r,i,v,u,n,$){let t=[],g=n.keySet,b=n.catchall._zod,o=b.def.type,_=b.optout==="optional";for(let w in i){if(g.has(w))continue;if(o==="never"){t.push(w);continue}let N=b.run({value:i[w],issues:[]},u);if(N instanceof Promise)r.push(N.then((P)=>Cv(P,v,w,i,_)));else Cv(N,v,w,i,_)}if(t.length)v.issues.push({code:"unrecognized_keys",keys:t,input:i,inst:$});if(!r.length)return v;return Promise.all(r).then(()=>{return v})}function fb(r,i,v,u){for(let $ of r)if($.issues.length===0)return i.value=$.value,i;let n=r.filter(($)=>!Er($));if(n.length===1)return i.value=n[0].value,n[0];return i.issues.push({code:"invalid_union",input:i.value,inst:v,errors:r.map(($)=>$.issues.map((t)=>gr(t,u,R())))}),i}function db(r,i,v,u){let n=r.filter(($)=>$.issues.length===0);if(n.length===1)return i.value=n[0].value,i;if(n.length===0)i.issues.push({code:"invalid_union",input:i.value,inst:v,errors:r.map(($)=>$.issues.map((t)=>gr(t,u,R())))});else i.issues.push({code:"invalid_union",input:i.value,inst:v,errors:[],inclusive:!1});return i}function yt(r,i){if(r===i)return{valid:!0,data:r};if(r instanceof Date&&i instanceof Date&&+r===+i)return{valid:!0,data:r};if(Hr(r)&&Hr(i)){let v=Object.keys(i),u=Object.keys(r).filter(($)=>v.indexOf($)!==-1),n={...r,...i};for(let $ of u){let t=yt(r[$],i[$]);if(!t.valid)return{valid:!1,mergeErrorPath:[$,...t.mergeErrorPath]};n[$]=t.data}return{valid:!0,data:n}}if(Array.isArray(r)&&Array.isArray(i)){if(r.length!==i.length)return{valid:!1,mergeErrorPath:[]};let v=[];for(let u=0;ug.l&&g.r).map(([g])=>g);if($.length&&n)r.issues.push({...n,keys:$});if(Er(r))return r;let t=yt(i.value,v.value);if(!t.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(t.mergeErrorPath)}`);return r.value=t.data,r}function xv(r,i,v){if(r.issues.length)i.issues.push(...Ir(v,r.issues));i.value[v]=r.value}function pb(r,i,v,u,n,$,t){if(r.issues.length)if(ii.has(typeof u))v.issues.push(...Ir(u,r.issues));else v.issues.push({code:"invalid_key",origin:"map",input:n,inst:$,issues:r.issues.map((g)=>gr(g,t,R()))});if(i.issues.length)if(ii.has(typeof u))v.issues.push(...Ir(u,i.issues));else v.issues.push({origin:"map",code:"invalid_element",input:n,inst:$,key:u,issues:i.issues.map((g)=>gr(g,t,R()))});v.value.set(r.value,i.value)}function ab(r,i){if(r.issues.length)i.issues.push(...r.issues);i.value.add(r.value)}function sb(r,i){if(r.issues.length&&i===void 0)return{issues:[],value:void 0};return r}function r_(r,i){if(r.value===void 0)r.value=i.defaultValue;return r}function n_(r,i){if(!r.issues.length&&r.value===void 0)r.issues.push({code:"invalid_type",expected:"nonoptional",input:r.value,inst:i});return r}function Zv(r,i,v){if(r.issues.length)return r.aborted=!0,r;return i._zod.run({value:r.value,issues:r.issues},v)}function mv(r,i,v){if(r.issues.length)return r.aborted=!0,r;if((v.direction||"forward")==="forward"){let n=i.transform(r.value,r);if(n instanceof Promise)return n.then(($)=>Rv(r,$,i.out,v));return Rv(r,n,i.out,v)}else{let n=i.reverseTransform(r.value,r);if(n instanceof Promise)return n.then(($)=>Rv(r,$,i.in,v));return Rv(r,n,i.in,v)}}function Rv(r,i,v,u){if(r.issues.length)return r.aborted=!0,r;return v._zod.run({value:i,issues:r.issues},u)}function i_(r){return r.value=Object.freeze(r.value),r}function v_(r,i,v,u){if(!r){let n={code:"custom",input:v,inst:u,path:[...u._zod.def.path??[]],continue:!u._zod.def.abort};if(u._zod.def.params)n.params=u._zod.def.params;i.issues.push(zn(n))}}var W,hr,x,ft,dt,ht,pt,at,st,rg,ng,ig,vg,$g,ug,tg,gg,og,lg,bg,_g,Ig,Ug,wg,Ng,kg,Og,cg,ev,zg,Ii,yv,Pg,Sg,Jg,Lg,Ag,jg,Wg,Xg,Gg,Vg,o_,Kg,Ui,Yg,Qg,Bg,fv,Fg,Hg,Eg,Tg,Mg,qg,xg,dv,Zg,mg,Rg,Cg,eg,yg,fg,dg,hg,Di,pg,ag,sg,ro,no,io;var vo=S(()=>{Mv();kn();au();Hv();j();et();j();W=I("$ZodType",(r,i)=>{var v;r??(r={}),r._zod.def=i,r._zod.bag=r._zod.bag||{},r._zod.version=Ct;let u=[...r._zod.def.checks??[]];if(r._zod.traits.has("$ZodCheck"))u.unshift(r);for(let n of u)for(let $ of n._zod.onattach)$(r);if(u.length===0)(v=r._zod).deferred??(v.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{let n=(t,g,b)=>{let o=Er(t),_;for(let w of g){if(w._zod.def.when){if(!w._zod.def.when(t))continue}else if(o)continue;let N=t.issues.length,P=w._zod.check(t);if(P instanceof Promise&&b?.async===!1)throw new Ar;if(_||P instanceof Promise)_=(_??Promise.resolve()).then(async()=>{if(await P,t.issues.length===N)return;if(!o)o=Er(t,N)});else{if(t.issues.length===N)continue;if(!o)o=Er(t,N)}}if(_)return _.then(()=>{return t});return t},$=(t,g,b)=>{if(Er(t))return t.aborted=!0,t;let o=n(g,u,b);if(o instanceof Promise){if(b.async===!1)throw new Ar;return o.then((_)=>r._zod.parse(_,b))}return r._zod.parse(o,b)};r._zod.run=(t,g)=>{if(g.skipChecks)return r._zod.parse(t,g);if(g.direction==="backward"){let o=r._zod.parse({value:t.value,issues:[]},{...g,skipChecks:!0});if(o instanceof Promise)return o.then((_)=>{return $(_,t,g)});return $(o,t,g)}let b=r._zod.parse(t,g);if(b instanceof Promise){if(g.async===!1)throw new Ar;return b.then((o)=>n(o,u,g))}return n(b,u,g)}}G(r,"~standard",()=>({validate:(n)=>{try{let $=jn(r,n);return $.success?{value:$.data}:{issues:$.error?.issues}}catch($){return oi(r,n).then((t)=>t.success?{value:t.data}:{issues:t.error?.issues})}},vendor:"zod",version:1}))}),hr=I("$ZodString",(r,i)=>{W.init(r,i),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??ct(r._zod.bag),r._zod.parse=(v,u)=>{if(i.coerce)try{v.value=String(v.value)}catch(n){}if(typeof v.value==="string")return v;return v.issues.push({expected:"string",code:"invalid_type",input:v.value,inst:r}),v}}),x=I("$ZodStringFormat",(r,i)=>{Xn.init(r,i),hr.init(r,i)}),ft=I("$ZodGUID",(r,i)=>{i.pattern??(i.pattern=tt),x.init(r,i)}),dt=I("$ZodUUID",(r,i)=>{if(i.version){let u={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[i.version];if(u===void 0)throw Error(`Invalid UUID version: "${i.version}"`);i.pattern??(i.pattern=dr(u))}else i.pattern??(i.pattern=dr());x.init(r,i)}),ht=I("$ZodEmail",(r,i)=>{i.pattern??(i.pattern=gt),x.init(r,i)}),pt=I("$ZodURL",(r,i)=>{x.init(r,i),r._zod.check=(v)=>{try{let u=v.value.trim(),n=new URL(u);if(i.hostname){if(i.hostname.lastIndex=0,!i.hostname.test(n.hostname))v.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:i.hostname.source,input:v.value,inst:r,continue:!i.abort})}if(i.protocol){if(i.protocol.lastIndex=0,!i.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol))v.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:i.protocol.source,input:v.value,inst:r,continue:!i.abort})}if(i.normalize)v.value=n.href;else v.value=u;return}catch(u){v.issues.push({code:"invalid_format",format:"url",input:v.value,inst:r,continue:!i.abort})}}}),at=I("$ZodEmoji",(r,i)=>{i.pattern??(i.pattern=ot()),x.init(r,i)}),st=I("$ZodNanoID",(r,i)=>{i.pattern??(i.pattern=$t),x.init(r,i)}),rg=I("$ZodCUID",(r,i)=>{i.pattern??(i.pattern=su),x.init(r,i)}),ng=I("$ZodCUID2",(r,i)=>{i.pattern??(i.pattern=rt),x.init(r,i)}),ig=I("$ZodULID",(r,i)=>{i.pattern??(i.pattern=nt),x.init(r,i)}),vg=I("$ZodXID",(r,i)=>{i.pattern??(i.pattern=it),x.init(r,i)}),$g=I("$ZodKSUID",(r,i)=>{i.pattern??(i.pattern=vt),x.init(r,i)}),ug=I("$ZodISODateTime",(r,i)=>{i.pattern??(i.pattern=Ot(i)),x.init(r,i)}),tg=I("$ZodISODate",(r,i)=>{i.pattern??(i.pattern=Nt),x.init(r,i)}),gg=I("$ZodISOTime",(r,i)=>{i.pattern??(i.pattern=kt(i)),x.init(r,i)}),og=I("$ZodISODuration",(r,i)=>{i.pattern??(i.pattern=ut),x.init(r,i)}),lg=I("$ZodIPv4",(r,i)=>{i.pattern??(i.pattern=lt),x.init(r,i),r._zod.bag.format="ipv4"}),bg=I("$ZodIPv6",(r,i)=>{i.pattern??(i.pattern=bt),x.init(r,i),r._zod.bag.format="ipv6",r._zod.check=(v)=>{try{new URL(`http://[${v.value}]`)}catch{v.issues.push({code:"invalid_format",format:"ipv6",input:v.value,inst:r,continue:!i.abort})}}}),_g=I("$ZodMAC",(r,i)=>{i.pattern??(i.pattern=_t(i.delimiter)),x.init(r,i),r._zod.bag.format="mac"}),Ig=I("$ZodCIDRv4",(r,i)=>{i.pattern??(i.pattern=It),x.init(r,i)}),Ug=I("$ZodCIDRv6",(r,i)=>{i.pattern??(i.pattern=Ut),x.init(r,i),r._zod.check=(v)=>{let u=v.value.split("/");try{if(u.length!==2)throw Error();let[n,$]=u;if(!$)throw Error();let t=Number($);if(`${t}`!==$)throw Error();if(t<0||t>128)throw Error();new URL(`http://[${n}]`)}catch{v.issues.push({code:"invalid_format",format:"cidrv6",input:v.value,inst:r,continue:!i.abort})}}});wg=I("$ZodBase64",(r,i)=>{i.pattern??(i.pattern=Dt),x.init(r,i),r._zod.bag.contentEncoding="base64",r._zod.check=(v)=>{if(Dg(v.value))return;v.issues.push({code:"invalid_format",format:"base64",input:v.value,inst:r,continue:!i.abort})}});Ng=I("$ZodBase64URL",(r,i)=>{i.pattern??(i.pattern=Fv),x.init(r,i),r._zod.bag.contentEncoding="base64url",r._zod.check=(v)=>{if($_(v.value))return;v.issues.push({code:"invalid_format",format:"base64url",input:v.value,inst:r,continue:!i.abort})}}),kg=I("$ZodE164",(r,i)=>{i.pattern??(i.pattern=wt),x.init(r,i)});Og=I("$ZodJWT",(r,i)=>{x.init(r,i),r._zod.check=(v)=>{if(u_(v.value,i.alg))return;v.issues.push({code:"invalid_format",format:"jwt",input:v.value,inst:r,continue:!i.abort})}}),cg=I("$ZodCustomStringFormat",(r,i)=>{x.init(r,i),r._zod.check=(v)=>{if(i.fn(v.value))return;v.issues.push({code:"invalid_format",format:i.format,input:v.value,inst:r,continue:!i.abort})}}),ev=I("$ZodNumber",(r,i)=>{W.init(r,i),r._zod.pattern=r._zod.bag.pattern??li,r._zod.parse=(v,u)=>{if(i.coerce)try{v.value=Number(v.value)}catch(t){}let n=v.value;if(typeof n==="number"&&!Number.isNaN(n)&&Number.isFinite(n))return v;let $=typeof n==="number"?Number.isNaN(n)?"NaN":!Number.isFinite(n)?"Infinity":void 0:void 0;return v.issues.push({expected:"number",code:"invalid_type",input:n,inst:r,...$?{received:$}:{}}),v}}),zg=I("$ZodNumberFormat",(r,i)=>{Xt.init(r,i),ev.init(r,i)}),Ii=I("$ZodBoolean",(r,i)=>{W.init(r,i),r._zod.pattern=St,r._zod.parse=(v,u)=>{if(i.coerce)try{v.value=Boolean(v.value)}catch($){}let n=v.value;if(typeof n==="boolean")return v;return v.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:r}),v}}),yv=I("$ZodBigInt",(r,i)=>{W.init(r,i),r._zod.pattern=zt,r._zod.parse=(v,u)=>{if(i.coerce)try{v.value=BigInt(v.value)}catch(n){}if(typeof v.value==="bigint")return v;return v.issues.push({expected:"bigint",code:"invalid_type",input:v.value,inst:r}),v}}),Pg=I("$ZodBigIntFormat",(r,i)=>{Gt.init(r,i),yv.init(r,i)}),Sg=I("$ZodSymbol",(r,i)=>{W.init(r,i),r._zod.parse=(v,u)=>{let n=v.value;if(typeof n==="symbol")return v;return v.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:r}),v}}),Jg=I("$ZodUndefined",(r,i)=>{W.init(r,i),r._zod.pattern=Lt,r._zod.values=new Set([void 0]),r._zod.optin="optional",r._zod.optout="optional",r._zod.parse=(v,u)=>{let n=v.value;if(typeof n>"u")return v;return v.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:r}),v}}),Lg=I("$ZodNull",(r,i)=>{W.init(r,i),r._zod.pattern=Jt,r._zod.values=new Set([null]),r._zod.parse=(v,u)=>{let n=v.value;if(n===null)return v;return v.issues.push({expected:"null",code:"invalid_type",input:n,inst:r}),v}}),Ag=I("$ZodAny",(r,i)=>{W.init(r,i),r._zod.parse=(v)=>v}),jg=I("$ZodUnknown",(r,i)=>{W.init(r,i),r._zod.parse=(v)=>v}),Wg=I("$ZodNever",(r,i)=>{W.init(r,i),r._zod.parse=(v,u)=>{return v.issues.push({expected:"never",code:"invalid_type",input:v.value,inst:r}),v}}),Xg=I("$ZodVoid",(r,i)=>{W.init(r,i),r._zod.parse=(v,u)=>{let n=v.value;if(typeof n>"u")return v;return v.issues.push({expected:"void",code:"invalid_type",input:n,inst:r}),v}}),Gg=I("$ZodDate",(r,i)=>{W.init(r,i),r._zod.parse=(v,u)=>{if(i.coerce)try{v.value=new Date(v.value)}catch(g){}let n=v.value,$=n instanceof Date;if($&&!Number.isNaN(n.getTime()))return v;return v.issues.push({expected:"date",code:"invalid_type",input:n,...$?{received:"Invalid Date"}:{},inst:r}),v}});Vg=I("$ZodArray",(r,i)=>{W.init(r,i),r._zod.parse=(v,u)=>{let n=v.value;if(!Array.isArray(n))return v.issues.push({expected:"array",code:"invalid_type",input:n,inst:r}),v;v.value=Array(n.length);let $=[];for(let t=0;tyb(o,v,t)));else yb(b,v,t)}if($.length)return Promise.all($).then(()=>v);return v}});o_=I("$ZodObject",(r,i)=>{if(W.init(r,i),!Object.getOwnPropertyDescriptor(i,"shape")?.get){let g=i.shape;Object.defineProperty(i,"shape",{get:()=>{let b={...g};return Object.defineProperty(i,"shape",{value:b}),b}})}let u=cn(()=>t_(i));G(r._zod,"propValues",()=>{let g=i.shape,b={};for(let o in g){let _=g[o]._zod;if(_.values){b[o]??(b[o]=new Set);for(let w of _.values)b[o].add(w)}}return b});let n=fr,$=i.catchall,t;r._zod.parse=(g,b)=>{t??(t=u.value);let o=g.value;if(!n(o))return g.issues.push({expected:"object",code:"invalid_type",input:o,inst:r}),g;g.value={};let _=[],w=t.shape;for(let N of t.keys){let P=w[N],K=P._zod.optout==="optional",q=P._zod.run({value:o[N],issues:[]},b);if(q instanceof Promise)_.push(q.then((Xr)=>Cv(Xr,g,N,o,K)));else Cv(q,g,N,o,K)}if(!$)return _.length?Promise.all(_).then(()=>g):g;return g_(_,o,g,b,u.value,r)}}),Kg=I("$ZodObjectJIT",(r,i)=>{o_.init(r,i);let v=r._zod.parse,u=cn(()=>t_(i)),n=(N)=>{let P=new qv(["shape","payload","ctx"]),K=u.value,q=(vr)=>{let tr=Jv(vr);return`shape[${tr}]._zod.run({ value: input[${tr}], issues: [] }, ctx)`};P.write("const input = payload.value;");let Xr=Object.create(null),y=0;for(let vr of K.keys)Xr[vr]=`key_${y++}`;P.write("const newResult = {};");for(let vr of K.keys){let tr=Xr[vr],cr=Jv(vr),yI=N[vr]?._zod?.optout==="optional";if(P.write(`const ${tr} = ${q(vr)};`),yI)P.write(` + if (${tr}.issues.length) { + if (${cr} in input) { + payload.issues = payload.issues.concat(${tr}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${cr}, ...iss.path] : [${cr}] + }))); + } + } + + if (${tr}.value === undefined) { + if (${cr} in input) { + newResult[${cr}] = undefined; + } + } else { + newResult[${cr}] = ${tr}.value; + } + + `);else P.write(` + if (${tr}.issues.length) { + payload.issues = payload.issues.concat(${tr}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${cr}, ...iss.path] : [${cr}] + }))); + } + + if (${tr}.value === undefined) { + if (${cr} in input) { + newResult[${cr}] = undefined; + } + } else { + newResult[${cr}] = ${tr}.value; + } + + `)}P.write("payload.value = newResult;"),P.write("return payload;");let _r=P.compile();return(vr,tr)=>_r(N,vr,tr)},$,t=fr,g=!an.jitless,o=g&&Cu.value,_=i.catchall,w;r._zod.parse=(N,P)=>{w??(w=u.value);let K=N.value;if(!t(K))return N.issues.push({expected:"object",code:"invalid_type",input:K,inst:r}),N;if(g&&o&&P?.async===!1&&P.jitless!==!0){if(!$)$=n(i.shape);if(N=$(N,P),!_)return N;return g_([],K,N,P,w,r)}return v(N,P)}});Ui=I("$ZodUnion",(r,i)=>{W.init(r,i),G(r._zod,"optin",()=>i.options.some((n)=>n._zod.optin==="optional")?"optional":void 0),G(r._zod,"optout",()=>i.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),G(r._zod,"values",()=>{if(i.options.every((n)=>n._zod.values))return new Set(i.options.flatMap((n)=>Array.from(n._zod.values)));return}),G(r._zod,"pattern",()=>{if(i.options.every((n)=>n._zod.pattern)){let n=i.options.map(($)=>$._zod.pattern);return new RegExp(`^(${n.map(($)=>ni($.source)).join("|")})$`)}return});let v=i.options.length===1,u=i.options[0]._zod.run;r._zod.parse=(n,$)=>{if(v)return u(n,$);let t=!1,g=[];for(let b of i.options){let o=b._zod.run({value:n.value,issues:[]},$);if(o instanceof Promise)g.push(o),t=!0;else{if(o.issues.length===0)return o;g.push(o)}}if(!t)return fb(g,n,r,$);return Promise.all(g).then((b)=>{return fb(b,n,r,$)})}});Yg=I("$ZodXor",(r,i)=>{Ui.init(r,i),i.inclusive=!1;let v=i.options.length===1,u=i.options[0]._zod.run;r._zod.parse=(n,$)=>{if(v)return u(n,$);let t=!1,g=[];for(let b of i.options){let o=b._zod.run({value:n.value,issues:[]},$);if(o instanceof Promise)g.push(o),t=!0;else g.push(o)}if(!t)return db(g,n,r,$);return Promise.all(g).then((b)=>{return db(b,n,r,$)})}}),Qg=I("$ZodDiscriminatedUnion",(r,i)=>{i.inclusive=!1,Ui.init(r,i);let v=r._zod.parse;G(r._zod,"propValues",()=>{let n={};for(let $ of i.options){let t=$._zod.propValues;if(!t||Object.keys(t).length===0)throw Error(`Invalid discriminated union option at index "${i.options.indexOf($)}"`);for(let[g,b]of Object.entries(t)){if(!n[g])n[g]=new Set;for(let o of b)n[g].add(o)}}return n});let u=cn(()=>{let n=i.options,$=new Map;for(let t of n){let g=t._zod.propValues?.[i.discriminator];if(!g||g.size===0)throw Error(`Invalid discriminated union option at index "${i.options.indexOf(t)}"`);for(let b of g){if($.has(b))throw Error(`Duplicate discriminator value "${String(b)}"`);$.set(b,t)}}return $});r._zod.parse=(n,$)=>{let t=n.value;if(!fr(t))return n.issues.push({code:"invalid_type",expected:"object",input:t,inst:r}),n;let g=u.value.get(t?.[i.discriminator]);if(g)return g._zod.run(n,$);if(i.unionFallback)return v(n,$);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:i.discriminator,input:t,path:[i.discriminator],inst:r}),n}}),Bg=I("$ZodIntersection",(r,i)=>{W.init(r,i),r._zod.parse=(v,u)=>{let n=v.value,$=i.left._zod.run({value:n,issues:[]},u),t=i.right._zod.run({value:n,issues:[]},u);if($ instanceof Promise||t instanceof Promise)return Promise.all([$,t]).then(([b,o])=>{return hb(v,b,o)});return hb(v,$,t)}});fv=I("$ZodTuple",(r,i)=>{W.init(r,i);let v=i.items;r._zod.parse=(u,n)=>{let $=u.value;if(!Array.isArray($))return u.issues.push({input:$,inst:r,expected:"tuple",code:"invalid_type"}),u;u.value=[];let t=[],g=[...v].reverse().findIndex((_)=>_._zod.optin!=="optional"),b=g===-1?0:v.length-g;if(!i.rest){let _=$.length>v.length,w=$.length=$.length){if(o>=b)continue}let w=_._zod.run({value:$[o],issues:[]},n);if(w instanceof Promise)t.push(w.then((N)=>xv(N,u,o)));else xv(w,u,o)}if(i.rest){let _=$.slice(v.length);for(let w of _){o++;let N=i.rest._zod.run({value:w,issues:[]},n);if(N instanceof Promise)t.push(N.then((P)=>xv(P,u,o)));else xv(N,u,o)}}if(t.length)return Promise.all(t).then(()=>u);return u}});Fg=I("$ZodRecord",(r,i)=>{W.init(r,i),r._zod.parse=(v,u)=>{let n=v.value;if(!Hr(n))return v.issues.push({expected:"record",code:"invalid_type",input:n,inst:r}),v;let $=[],t=i.keyType._zod.values;if(t){v.value={};let g=new Set;for(let o of t)if(typeof o==="string"||typeof o==="number"||typeof o==="symbol"){g.add(typeof o==="number"?o.toString():o);let _=i.valueType._zod.run({value:n[o],issues:[]},u);if(_ instanceof Promise)$.push(_.then((w)=>{if(w.issues.length)v.issues.push(...Ir(o,w.issues));v.value[o]=w.value}));else{if(_.issues.length)v.issues.push(...Ir(o,_.issues));v.value[o]=_.value}}let b;for(let o in n)if(!g.has(o))b=b??[],b.push(o);if(b&&b.length>0)v.issues.push({code:"unrecognized_keys",input:n,inst:r,keys:b})}else{v.value={};for(let g of Reflect.ownKeys(n)){if(g==="__proto__")continue;let b=i.keyType._zod.run({value:g,issues:[]},u);if(b instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof g==="string"&&li.test(g)&&b.issues.length&&b.issues.some((w)=>w.code==="invalid_type"&&w.expected==="number")){let w=i.keyType._zod.run({value:Number(g),issues:[]},u);if(w instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(w.issues.length===0)b=w}if(b.issues.length){if(i.mode==="loose")v.value[g]=n[g];else v.issues.push({code:"invalid_key",origin:"record",issues:b.issues.map((w)=>gr(w,u,R())),input:g,path:[g],inst:r});continue}let _=i.valueType._zod.run({value:n[g],issues:[]},u);if(_ instanceof Promise)$.push(_.then((w)=>{if(w.issues.length)v.issues.push(...Ir(g,w.issues));v.value[b.value]=w.value}));else{if(_.issues.length)v.issues.push(...Ir(g,_.issues));v.value[b.value]=_.value}}}if($.length)return Promise.all($).then(()=>v);return v}}),Hg=I("$ZodMap",(r,i)=>{W.init(r,i),r._zod.parse=(v,u)=>{let n=v.value;if(!(n instanceof Map))return v.issues.push({expected:"map",code:"invalid_type",input:n,inst:r}),v;let $=[];v.value=new Map;for(let[t,g]of n){let b=i.keyType._zod.run({value:t,issues:[]},u),o=i.valueType._zod.run({value:g,issues:[]},u);if(b instanceof Promise||o instanceof Promise)$.push(Promise.all([b,o]).then(([_,w])=>{pb(_,w,v,t,n,r,u)}));else pb(b,o,v,t,n,r,u)}if($.length)return Promise.all($).then(()=>v);return v}});Eg=I("$ZodSet",(r,i)=>{W.init(r,i),r._zod.parse=(v,u)=>{let n=v.value;if(!(n instanceof Set))return v.issues.push({input:n,inst:r,expected:"set",code:"invalid_type"}),v;let $=[];v.value=new Set;for(let t of n){let g=i.valueType._zod.run({value:t,issues:[]},u);if(g instanceof Promise)$.push(g.then((b)=>ab(b,v)));else ab(g,v)}if($.length)return Promise.all($).then(()=>v);return v}});Tg=I("$ZodEnum",(r,i)=>{W.init(r,i);let v=ri(i.entries),u=new Set(v);r._zod.values=u,r._zod.pattern=new RegExp(`^(${v.filter((n)=>ii.has(typeof n)).map((n)=>typeof n==="string"?wr(n):n.toString()).join("|")})$`),r._zod.parse=(n,$)=>{let t=n.value;if(u.has(t))return n;return n.issues.push({code:"invalid_value",values:v,input:t,inst:r}),n}}),Mg=I("$ZodLiteral",(r,i)=>{if(W.init(r,i),i.values.length===0)throw Error("Cannot create literal schema with no valid values");let v=new Set(i.values);r._zod.values=v,r._zod.pattern=new RegExp(`^(${i.values.map((u)=>typeof u==="string"?wr(u):u?wr(u.toString()):String(u)).join("|")})$`),r._zod.parse=(u,n)=>{let $=u.value;if(v.has($))return u;return u.issues.push({code:"invalid_value",values:i.values,input:$,inst:r}),u}}),qg=I("$ZodFile",(r,i)=>{W.init(r,i),r._zod.parse=(v,u)=>{let n=v.value;if(n instanceof File)return v;return v.issues.push({expected:"file",code:"invalid_type",input:n,inst:r}),v}}),xg=I("$ZodTransform",(r,i)=>{W.init(r,i),r._zod.parse=(v,u)=>{if(u.direction==="backward")throw new yr(r.constructor.name);let n=i.transform(v.value,v);if(u.async)return(n instanceof Promise?n:Promise.resolve(n)).then((t)=>{return v.value=t,v});if(n instanceof Promise)throw new Ar;return v.value=n,v}});dv=I("$ZodOptional",(r,i)=>{W.init(r,i),r._zod.optin="optional",r._zod.optout="optional",G(r._zod,"values",()=>{return i.innerType._zod.values?new Set([...i.innerType._zod.values,void 0]):void 0}),G(r._zod,"pattern",()=>{let v=i.innerType._zod.pattern;return v?new RegExp(`^(${ni(v.source)})?$`):void 0}),r._zod.parse=(v,u)=>{if(i.innerType._zod.optin==="optional"){let n=i.innerType._zod.run(v,u);if(n instanceof Promise)return n.then(($)=>sb($,v.value));return sb(n,v.value)}if(v.value===void 0)return v;return i.innerType._zod.run(v,u)}}),Zg=I("$ZodExactOptional",(r,i)=>{dv.init(r,i),G(r._zod,"values",()=>i.innerType._zod.values),G(r._zod,"pattern",()=>i.innerType._zod.pattern),r._zod.parse=(v,u)=>{return i.innerType._zod.run(v,u)}}),mg=I("$ZodNullable",(r,i)=>{W.init(r,i),G(r._zod,"optin",()=>i.innerType._zod.optin),G(r._zod,"optout",()=>i.innerType._zod.optout),G(r._zod,"pattern",()=>{let v=i.innerType._zod.pattern;return v?new RegExp(`^(${ni(v.source)}|null)$`):void 0}),G(r._zod,"values",()=>{return i.innerType._zod.values?new Set([...i.innerType._zod.values,null]):void 0}),r._zod.parse=(v,u)=>{if(v.value===null)return v;return i.innerType._zod.run(v,u)}}),Rg=I("$ZodDefault",(r,i)=>{W.init(r,i),r._zod.optin="optional",G(r._zod,"values",()=>i.innerType._zod.values),r._zod.parse=(v,u)=>{if(u.direction==="backward")return i.innerType._zod.run(v,u);if(v.value===void 0)return v.value=i.defaultValue,v;let n=i.innerType._zod.run(v,u);if(n instanceof Promise)return n.then(($)=>r_($,i));return r_(n,i)}});Cg=I("$ZodPrefault",(r,i)=>{W.init(r,i),r._zod.optin="optional",G(r._zod,"values",()=>i.innerType._zod.values),r._zod.parse=(v,u)=>{if(u.direction==="backward")return i.innerType._zod.run(v,u);if(v.value===void 0)v.value=i.defaultValue;return i.innerType._zod.run(v,u)}}),eg=I("$ZodNonOptional",(r,i)=>{W.init(r,i),G(r._zod,"values",()=>{let v=i.innerType._zod.values;return v?new Set([...v].filter((u)=>u!==void 0)):void 0}),r._zod.parse=(v,u)=>{let n=i.innerType._zod.run(v,u);if(n instanceof Promise)return n.then(($)=>n_($,r));return n_(n,r)}});yg=I("$ZodSuccess",(r,i)=>{W.init(r,i),r._zod.parse=(v,u)=>{if(u.direction==="backward")throw new yr("ZodSuccess");let n=i.innerType._zod.run(v,u);if(n instanceof Promise)return n.then(($)=>{return v.value=$.issues.length===0,v});return v.value=n.issues.length===0,v}}),fg=I("$ZodCatch",(r,i)=>{W.init(r,i),G(r._zod,"optin",()=>i.innerType._zod.optin),G(r._zod,"optout",()=>i.innerType._zod.optout),G(r._zod,"values",()=>i.innerType._zod.values),r._zod.parse=(v,u)=>{if(u.direction==="backward")return i.innerType._zod.run(v,u);let n=i.innerType._zod.run(v,u);if(n instanceof Promise)return n.then(($)=>{if(v.value=$.value,$.issues.length)v.value=i.catchValue({...v,error:{issues:$.issues.map((t)=>gr(t,u,R()))},input:v.value}),v.issues=[];return v});if(v.value=n.value,n.issues.length)v.value=i.catchValue({...v,error:{issues:n.issues.map(($)=>gr($,u,R()))},input:v.value}),v.issues=[];return v}}),dg=I("$ZodNaN",(r,i)=>{W.init(r,i),r._zod.parse=(v,u)=>{if(typeof v.value!=="number"||!Number.isNaN(v.value))return v.issues.push({input:v.value,inst:r,expected:"nan",code:"invalid_type"}),v;return v}}),hg=I("$ZodPipe",(r,i)=>{W.init(r,i),G(r._zod,"values",()=>i.in._zod.values),G(r._zod,"optin",()=>i.in._zod.optin),G(r._zod,"optout",()=>i.out._zod.optout),G(r._zod,"propValues",()=>i.in._zod.propValues),r._zod.parse=(v,u)=>{if(u.direction==="backward"){let $=i.out._zod.run(v,u);if($ instanceof Promise)return $.then((t)=>Zv(t,i.in,u));return Zv($,i.in,u)}let n=i.in._zod.run(v,u);if(n instanceof Promise)return n.then(($)=>Zv($,i.out,u));return Zv(n,i.out,u)}});Di=I("$ZodCodec",(r,i)=>{W.init(r,i),G(r._zod,"values",()=>i.in._zod.values),G(r._zod,"optin",()=>i.in._zod.optin),G(r._zod,"optout",()=>i.out._zod.optout),G(r._zod,"propValues",()=>i.in._zod.propValues),r._zod.parse=(v,u)=>{if((u.direction||"forward")==="forward"){let $=i.in._zod.run(v,u);if($ instanceof Promise)return $.then((t)=>mv(t,i,u));return mv($,i,u)}else{let $=i.out._zod.run(v,u);if($ instanceof Promise)return $.then((t)=>mv(t,i,u));return mv($,i,u)}}});pg=I("$ZodReadonly",(r,i)=>{W.init(r,i),G(r._zod,"propValues",()=>i.innerType._zod.propValues),G(r._zod,"values",()=>i.innerType._zod.values),G(r._zod,"optin",()=>i.innerType?._zod?.optin),G(r._zod,"optout",()=>i.innerType?._zod?.optout),r._zod.parse=(v,u)=>{if(u.direction==="backward")return i.innerType._zod.run(v,u);let n=i.innerType._zod.run(v,u);if(n instanceof Promise)return n.then(i_);return i_(n)}});ag=I("$ZodTemplateLiteral",(r,i)=>{W.init(r,i);let v=[];for(let u of i.parts)if(typeof u==="object"&&u!==null){if(!u._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...u._zod.traits].shift()}`);let n=u._zod.pattern instanceof RegExp?u._zod.pattern.source:u._zod.pattern;if(!n)throw Error(`Invalid template literal part: ${u._zod.traits}`);let $=n.startsWith("^")?1:0,t=n.endsWith("$")?n.length-1:n.length;v.push(n.slice($,t))}else if(u===null||yu.has(typeof u))v.push(wr(`${u}`));else throw Error(`Invalid template literal part: ${u}`);r._zod.pattern=new RegExp(`^${v.join("")}$`),r._zod.parse=(u,n)=>{if(typeof u.value!=="string")return u.issues.push({input:u.value,inst:r,expected:"string",code:"invalid_type"}),u;if(r._zod.pattern.lastIndex=0,!r._zod.pattern.test(u.value))return u.issues.push({input:u.value,inst:r,code:"invalid_format",format:i.format??"template_literal",pattern:r._zod.pattern.source}),u;return u}}),sg=I("$ZodFunction",(r,i)=>{return W.init(r,i),r._def=i,r._zod.def=i,r.implement=(v)=>{if(typeof v!=="function")throw Error("implement() must be called with a function");return function(...u){let n=r._def.input?ti(r._def.input,u):u,$=Reflect.apply(v,this,n);if(r._def.output)return ti(r._def.output,$);return $}},r.implementAsync=(v)=>{if(typeof v!=="function")throw Error("implementAsync() must be called with a function");return async function(...u){let n=r._def.input?await gi(r._def.input,u):u,$=await Reflect.apply(v,this,n);if(r._def.output)return await gi(r._def.output,$);return $}},r._zod.parse=(v,u)=>{if(typeof v.value!=="function")return v.issues.push({code:"invalid_type",expected:"function",input:v.value,inst:r}),v;if(r._def.output&&r._def.output._zod.def.type==="promise")v.value=r.implementAsync(v.value);else v.value=r.implement(v.value);return v},r.input=(...v)=>{let u=r.constructor;if(Array.isArray(v[0]))return new u({type:"function",input:new fv({type:"tuple",items:v[0],rest:v[1]}),output:r._def.output});return new u({type:"function",input:v[0],output:r._def.output})},r.output=(v)=>{return new r.constructor({type:"function",input:r._def.input,output:v})},r}),ro=I("$ZodPromise",(r,i)=>{W.init(r,i),r._zod.parse=(v,u)=>{return Promise.resolve(v.value).then((n)=>i.innerType._zod.run({value:n,issues:[]},u))}}),no=I("$ZodLazy",(r,i)=>{W.init(r,i),G(r._zod,"innerType",()=>i.getter()),G(r._zod,"pattern",()=>r._zod.innerType?._zod?.pattern),G(r._zod,"propValues",()=>r._zod.innerType?._zod?.propValues),G(r._zod,"optin",()=>r._zod.innerType?._zod?.optin??void 0),G(r._zod,"optout",()=>r._zod.innerType?._zod?.optout??void 0),r._zod.parse=(v,u)=>{return r._zod.innerType._zod.run(v,u)}}),io=I("$ZodCustom",(r,i)=>{m.init(r,i),W.init(r,i),r._zod.parse=(v,u)=>{return v},r._zod.check=(v)=>{let u=v.value,n=i.fn(u);if(n instanceof Promise)return n.then(($)=>v_($,v,u,r));v_(n,v,u,r);return}})});function $o(){return{localeError:aU()}}var aU=()=>{let r={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function i(n){return r[n]??null}let v={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},u={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${n.expected}، ولكن تم إدخال ${g}`;return`مدخلات غير مقبولة: يفترض إدخال ${$}، ولكن تم إدخال ${g}`}case"invalid_value":if(n.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${k(n.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${$} ${n.maximum.toString()} ${t.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${$} ${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${$} ${n.minimum.toString()} ${t.unit}`;return`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${$} ${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`;if($.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${$.suffix}"`;if($.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${$.includes}"`;if($.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${$.pattern}`;return`${v[$.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${U(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};var l_=S(()=>{j()});function uo(){return{localeError:sU()}}var sU=()=>{let r={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function i(n){return r[n]??null}let v={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Yanlış dəyər: gözlənilən instanceof ${n.expected}, daxil olan ${g}`;return`Yanlış dəyər: gözlənilən ${$}, daxil olan ${g}`}case"invalid_value":if(n.values.length===1)return`Yanlış dəyər: gözlənilən ${k(n.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${$}${n.maximum.toString()} ${t.unit??"element"}`;return`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Çox kiçik: gözlənilən ${n.origin} ${$}${n.minimum.toString()} ${t.unit}`;return`Çox kiçik: gözlənilən ${n.origin} ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Yanlış mətn: "${$.prefix}" ilə başlamalıdır`;if($.format==="ends_with")return`Yanlış mətn: "${$.suffix}" ilə bitməlidir`;if($.format==="includes")return`Yanlış mətn: "${$.includes}" daxil olmalıdır`;if($.format==="regex")return`Yanlış mətn: ${$.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${v[$.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${U(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};var b_=S(()=>{j()});function __(r,i,v,u){let n=Math.abs(r),$=n%10,t=n%100;if(t>=11&&t<=19)return u;if($===1)return i;if($>=2&&$<=4)return v;return u}function to(){return{localeError:rD()}}var rD=()=>{let r={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function i(n){return r[n]??null}let v={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},u={nan:"NaN",number:"лік",array:"масіў"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Няправільны ўвод: чакаўся instanceof ${n.expected}, атрымана ${g}`;return`Няправільны ўвод: чакаўся ${$}, атрымана ${g}`}case"invalid_value":if(n.values.length===1)return`Няправільны ўвод: чакалася ${k(n.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t){let g=Number(n.maximum),b=__(g,t.unit.one,t.unit.few,t.unit.many);return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна ${t.verb} ${$}${n.maximum.toString()} ${b}`}return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна быць ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t){let g=Number(n.minimum),b=__(g,t.unit.one,t.unit.few,t.unit.many);return`Занадта малы: чакалася, што ${n.origin} павінна ${t.verb} ${$}${n.minimum.toString()} ${b}`}return`Занадта малы: чакалася, што ${n.origin} павінна быць ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${$.prefix}"`;if($.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${$.suffix}"`;if($.format==="includes")return`Няправільны радок: павінен змяшчаць "${$.includes}"`;if($.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${$.pattern}`;return`Няправільны ${v[$.format]??n.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${n.keys.length>1?"ключы":"ключ"}: ${U(n.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${n.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${n.origin}`;default:return"Няправільны ўвод"}}};var I_=S(()=>{j()});function go(){return{localeError:nD()}}var nD=()=>{let r={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function i(n){return r[n]??null}let v={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},u={nan:"NaN",number:"число",array:"масив"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Невалиден вход: очакван instanceof ${n.expected}, получен ${g}`;return`Невалиден вход: очакван ${$}, получен ${g}`}case"invalid_value":if(n.values.length===1)return`Невалиден вход: очакван ${k(n.values[0])}`;return`Невалидна опция: очаквано едно от ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Твърде голямо: очаква се ${n.origin??"стойност"} да съдържа ${$}${n.maximum.toString()} ${t.unit??"елемента"}`;return`Твърде голямо: очаква се ${n.origin??"стойност"} да бъде ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Твърде малко: очаква се ${n.origin} да съдържа ${$}${n.minimum.toString()} ${t.unit}`;return`Твърде малко: очаква се ${n.origin} да бъде ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Невалиден низ: трябва да започва с "${$.prefix}"`;if($.format==="ends_with")return`Невалиден низ: трябва да завършва с "${$.suffix}"`;if($.format==="includes")return`Невалиден низ: трябва да включва "${$.includes}"`;if($.format==="regex")return`Невалиден низ: трябва да съвпада с ${$.pattern}`;let t="Невалиден";if($.format==="emoji")t="Невалидно";if($.format==="datetime")t="Невалидно";if($.format==="date")t="Невалидна";if($.format==="time")t="Невалидно";if($.format==="duration")t="Невалидна";return`${t} ${v[$.format]??n.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${n.divisor}`;case"unrecognized_keys":return`Неразпознат${n.keys.length>1?"и":""} ключ${n.keys.length>1?"ове":""}: ${U(n.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${n.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${n.origin}`;default:return"Невалиден вход"}}};var U_=S(()=>{j()});function oo(){return{localeError:iD()}}var iD=()=>{let r={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function i(n){return r[n]??null}let v={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},u={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Tipus invàlid: s'esperava instanceof ${n.expected}, s'ha rebut ${g}`;return`Tipus invàlid: s'esperava ${$}, s'ha rebut ${g}`}case"invalid_value":if(n.values.length===1)return`Valor invàlid: s'esperava ${k(n.values[0])}`;return`Opció invàlida: s'esperava una de ${U(n.values," o ")}`;case"too_big":{let $=n.inclusive?"com a màxim":"menys de",t=i(n.origin);if(t)return`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${$} ${n.maximum.toString()} ${t.unit??"elements"}`;return`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${$} ${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?"com a mínim":"més de",t=i(n.origin);if(t)return`Massa petit: s'esperava que ${n.origin} contingués ${$} ${n.minimum.toString()} ${t.unit}`;return`Massa petit: s'esperava que ${n.origin} fos ${$} ${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Format invàlid: ha de començar amb "${$.prefix}"`;if($.format==="ends_with")return`Format invàlid: ha d'acabar amb "${$.suffix}"`;if($.format==="includes")return`Format invàlid: ha d'incloure "${$.includes}"`;if($.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${$.pattern}`;return`Format invàlid per a ${v[$.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${U(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};var D_=S(()=>{j()});function lo(){return{localeError:vD()}}var vD=()=>{let r={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function i(n){return r[n]??null}let v={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},u={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Neplatný vstup: očekáváno instanceof ${n.expected}, obdrženo ${g}`;return`Neplatný vstup: očekáváno ${$}, obdrženo ${g}`}case"invalid_value":if(n.values.length===1)return`Neplatný vstup: očekáváno ${k(n.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${$}${n.maximum.toString()} ${t.unit??"prvků"}`;return`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${$}${n.minimum.toString()} ${t.unit??"prvků"}`;return`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Neplatný řetězec: musí začínat na "${$.prefix}"`;if($.format==="ends_with")return`Neplatný řetězec: musí končit na "${$.suffix}"`;if($.format==="includes")return`Neplatný řetězec: musí obsahovat "${$.includes}"`;if($.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${$.pattern}`;return`Neplatný formát ${v[$.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${U(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};var w_=S(()=>{j()});function bo(){return{localeError:$D()}}var $D=()=>{let r={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function i(n){return r[n]??null}let v={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},u={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Ugyldigt input: forventede instanceof ${n.expected}, fik ${g}`;return`Ugyldigt input: forventede ${$}, fik ${g}`}case"invalid_value":if(n.values.length===1)return`Ugyldig værdi: forventede ${k(n.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin),g=u[n.origin]??n.origin;if(t)return`For stor: forventede ${g??"value"} ${t.verb} ${$} ${n.maximum.toString()} ${t.unit??"elementer"}`;return`For stor: forventede ${g??"value"} havde ${$} ${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin),g=u[n.origin]??n.origin;if(t)return`For lille: forventede ${g} ${t.verb} ${$} ${n.minimum.toString()} ${t.unit}`;return`For lille: forventede ${g} havde ${$} ${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Ugyldig streng: skal starte med "${$.prefix}"`;if($.format==="ends_with")return`Ugyldig streng: skal ende med "${$.suffix}"`;if($.format==="includes")return`Ugyldig streng: skal indeholde "${$.includes}"`;if($.format==="regex")return`Ugyldig streng: skal matche mønsteret ${$.pattern}`;return`Ugyldig ${v[$.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${U(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${n.origin}`;default:return"Ugyldigt input"}}};var N_=S(()=>{j()});function _o(){return{localeError:uD()}}var uD=()=>{let r={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function i(n){return r[n]??null}let v={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},u={nan:"NaN",number:"Zahl",array:"Array"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Ungültige Eingabe: erwartet instanceof ${n.expected}, erhalten ${g}`;return`Ungültige Eingabe: erwartet ${$}, erhalten ${g}`}case"invalid_value":if(n.values.length===1)return`Ungültige Eingabe: erwartet ${k(n.values[0])}`;return`Ungültige Option: erwartet eine von ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Zu groß: erwartet, dass ${n.origin??"Wert"} ${$}${n.maximum.toString()} ${t.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${n.origin??"Wert"} ${$}${n.maximum.toString()} ist`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Zu klein: erwartet, dass ${n.origin} ${$}${n.minimum.toString()} ${t.unit} hat`;return`Zu klein: erwartet, dass ${n.origin} ${$}${n.minimum.toString()} ist`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Ungültiger String: muss mit "${$.prefix}" beginnen`;if($.format==="ends_with")return`Ungültiger String: muss mit "${$.suffix}" enden`;if($.format==="includes")return`Ungültiger String: muss "${$.includes}" enthalten`;if($.format==="regex")return`Ungültiger String: muss dem Muster ${$.pattern} entsprechen`;return`Ungültig: ${v[$.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${U(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};var k_=S(()=>{j()});function wi(){return{localeError:tD()}}var tD=()=>{let r={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function i(n){return r[n]??null}let v={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;return`Invalid input: expected ${$}, received ${g}`}case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${k(n.values[0])}`;return`Invalid option: expected one of ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Too big: expected ${n.origin??"value"} to have ${$}${n.maximum.toString()} ${t.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Too small: expected ${n.origin} to have ${$}${n.minimum.toString()} ${t.unit}`;return`Too small: expected ${n.origin} to be ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Invalid string: must start with "${$.prefix}"`;if($.format==="ends_with")return`Invalid string: must end with "${$.suffix}"`;if($.format==="includes")return`Invalid string: must include "${$.includes}"`;if($.format==="regex")return`Invalid string: must match pattern ${$.pattern}`;return`Invalid ${v[$.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${U(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};var Io=S(()=>{j()});function Uo(){return{localeError:gD()}}var gD=()=>{let r={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function i(n){return r[n]??null}let v={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},u={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Nevalida enigo: atendiĝis instanceof ${n.expected}, riceviĝis ${g}`;return`Nevalida enigo: atendiĝis ${$}, riceviĝis ${g}`}case"invalid_value":if(n.values.length===1)return`Nevalida enigo: atendiĝis ${k(n.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${$}${n.maximum.toString()} ${t.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Tro malgranda: atendiĝis ke ${n.origin} havu ${$}${n.minimum.toString()} ${t.unit}`;return`Tro malgranda: atendiĝis ke ${n.origin} estu ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${$.prefix}"`;if($.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${$.suffix}"`;if($.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${$.includes}"`;if($.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${$.pattern}`;return`Nevalida ${v[$.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} ŝlosilo${n.keys.length>1?"j":""}: ${U(n.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};var O_=S(()=>{j()});function Do(){return{localeError:oD()}}var oD=()=>{let r={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function i(n){return r[n]??null}let v={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},u={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Entrada inválida: se esperaba instanceof ${n.expected}, recibido ${g}`;return`Entrada inválida: se esperaba ${$}, recibido ${g}`}case"invalid_value":if(n.values.length===1)return`Entrada inválida: se esperaba ${k(n.values[0])}`;return`Opción inválida: se esperaba una de ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin),g=u[n.origin]??n.origin;if(t)return`Demasiado grande: se esperaba que ${g??"valor"} tuviera ${$}${n.maximum.toString()} ${t.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${g??"valor"} fuera ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin),g=u[n.origin]??n.origin;if(t)return`Demasiado pequeño: se esperaba que ${g} tuviera ${$}${n.minimum.toString()} ${t.unit}`;return`Demasiado pequeño: se esperaba que ${g} fuera ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Cadena inválida: debe comenzar con "${$.prefix}"`;if($.format==="ends_with")return`Cadena inválida: debe terminar en "${$.suffix}"`;if($.format==="includes")return`Cadena inválida: debe incluir "${$.includes}"`;if($.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${$.pattern}`;return`Inválido ${v[$.format]??n.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${U(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${u[n.origin]??n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${u[n.origin]??n.origin}`;default:return"Entrada inválida"}}};var c_=S(()=>{j()});function wo(){return{localeError:lD()}}var lD=()=>{let r={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function i(n){return r[n]??null}let v={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},u={nan:"NaN",number:"عدد",array:"آرایه"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`ورودی نامعتبر: می‌بایست instanceof ${n.expected} می‌بود، ${g} دریافت شد`;return`ورودی نامعتبر: می‌بایست ${$} می‌بود، ${g} دریافت شد`}case"invalid_value":if(n.values.length===1)return`ورودی نامعتبر: می‌بایست ${k(n.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${U(n.values,"|")} می‌بود`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`خیلی بزرگ: ${n.origin??"مقدار"} باید ${$}${n.maximum.toString()} ${t.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${n.origin??"مقدار"} باید ${$}${n.maximum.toString()} باشد`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`خیلی کوچک: ${n.origin} باید ${$}${n.minimum.toString()} ${t.unit} باشد`;return`خیلی کوچک: ${n.origin} باید ${$}${n.minimum.toString()} باشد`}case"invalid_format":{let $=n;if($.format==="starts_with")return`رشته نامعتبر: باید با "${$.prefix}" شروع شود`;if($.format==="ends_with")return`رشته نامعتبر: باید با "${$.suffix}" تمام شود`;if($.format==="includes")return`رشته نامعتبر: باید شامل "${$.includes}" باشد`;if($.format==="regex")return`رشته نامعتبر: باید با الگوی ${$.pattern} مطابقت داشته باشد`;return`${v[$.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${U(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};var z_=S(()=>{j()});function No(){return{localeError:bD()}}var bD=()=>{let r={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function i(n){return r[n]??null}let v={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},u={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${g}`;return`Virheellinen tyyppi: odotettiin ${$}, oli ${g}`}case"invalid_value":if(n.values.length===1)return`Virheellinen syöte: täytyy olla ${k(n.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Liian suuri: ${t.subject} täytyy olla ${$}${n.maximum.toString()} ${t.unit}`.trim();return`Liian suuri: arvon täytyy olla ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Liian pieni: ${t.subject} täytyy olla ${$}${n.minimum.toString()} ${t.unit}`.trim();return`Liian pieni: arvon täytyy olla ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${$.prefix}"`;if($.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${$.suffix}"`;if($.format==="includes")return`Virheellinen syöte: täytyy sisältää "${$.includes}"`;if($.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${$.pattern}`;return`Virheellinen ${v[$.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${U(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};var P_=S(()=>{j()});function ko(){return{localeError:_D()}}var _D=()=>{let r={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function i(n){return r[n]??null}let v={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},u={nan:"NaN",number:"nombre",array:"tableau"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Entrée invalide : instanceof ${n.expected} attendu, ${g} reçu`;return`Entrée invalide : ${$} attendu, ${g} reçu`}case"invalid_value":if(n.values.length===1)return`Entrée invalide : ${k(n.values[0])} attendu`;return`Option invalide : une valeur parmi ${U(n.values,"|")} attendue`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Trop grand : ${n.origin??"valeur"} doit ${t.verb} ${$}${n.maximum.toString()} ${t.unit??"élément(s)"}`;return`Trop grand : ${n.origin??"valeur"} doit être ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Trop petit : ${n.origin} doit ${t.verb} ${$}${n.minimum.toString()} ${t.unit}`;return`Trop petit : ${n.origin} doit être ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Chaîne invalide : doit commencer par "${$.prefix}"`;if($.format==="ends_with")return`Chaîne invalide : doit se terminer par "${$.suffix}"`;if($.format==="includes")return`Chaîne invalide : doit inclure "${$.includes}"`;if($.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${$.pattern}`;return`${v[$.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${U(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};var S_=S(()=>{j()});function Oo(){return{localeError:ID()}}var ID=()=>{let r={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function i(n){return r[n]??null}let v={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},u={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Entrée invalide : attendu instanceof ${n.expected}, reçu ${g}`;return`Entrée invalide : attendu ${$}, reçu ${g}`}case"invalid_value":if(n.values.length===1)return`Entrée invalide : attendu ${k(n.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"≤":"<",t=i(n.origin);if(t)return`Trop grand : attendu que ${n.origin??"la valeur"} ait ${$}${n.maximum.toString()} ${t.unit}`;return`Trop grand : attendu que ${n.origin??"la valeur"} soit ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?"≥":">",t=i(n.origin);if(t)return`Trop petit : attendu que ${n.origin} ait ${$}${n.minimum.toString()} ${t.unit}`;return`Trop petit : attendu que ${n.origin} soit ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Chaîne invalide : doit commencer par "${$.prefix}"`;if($.format==="ends_with")return`Chaîne invalide : doit se terminer par "${$.suffix}"`;if($.format==="includes")return`Chaîne invalide : doit inclure "${$.includes}"`;if($.format==="regex")return`Chaîne invalide : doit correspondre au motif ${$.pattern}`;return`${v[$.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${U(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};var J_=S(()=>{j()});function co(){return{localeError:UD()}}var UD=()=>{let r={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},i={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},v=(o)=>o?r[o]:void 0,u=(o)=>{let _=v(o);if(_)return _.label;return o??r.unknown.label},n=(o)=>`ה${u(o)}`,$=(o)=>{return(v(o)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},t=(o)=>{if(!o)return null;return i[o]??null},g={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},b={nan:"NaN"};return(o)=>{switch(o.code){case"invalid_type":{let _=o.expected,w=b[_??""]??u(_),N=O(o.input),P=b[N]??r[N]?.label??N;if(/^[A-Z]/.test(o.expected))return`קלט לא תקין: צריך להיות instanceof ${o.expected}, התקבל ${P}`;return`קלט לא תקין: צריך להיות ${w}, התקבל ${P}`}case"invalid_value":{if(o.values.length===1)return`ערך לא תקין: הערך חייב להיות ${k(o.values[0])}`;let _=o.values.map((P)=>k(P));if(o.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${_[0]} או ${_[1]}`;let w=_[_.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${_.slice(0,-1).join(", ")} או ${w}`}case"too_big":{let _=t(o.origin),w=n(o.origin??"value");if(o.origin==="string")return`${_?.longLabel??"ארוך"} מדי: ${w} צריכה להכיל ${o.maximum.toString()} ${_?.unit??""} ${o.inclusive?"או פחות":"לכל היותר"}`.trim();if(o.origin==="number"){let K=o.inclusive?`קטן או שווה ל-${o.maximum}`:`קטן מ-${o.maximum}`;return`גדול מדי: ${w} צריך להיות ${K}`}if(o.origin==="array"||o.origin==="set"){let K=o.origin==="set"?"צריכה":"צריך",q=o.inclusive?`${o.maximum} ${_?.unit??""} או פחות`:`פחות מ-${o.maximum} ${_?.unit??""}`;return`גדול מדי: ${w} ${K} להכיל ${q}`.trim()}let N=o.inclusive?"<=":"<",P=$(o.origin??"value");if(_?.unit)return`${_.longLabel} מדי: ${w} ${P} ${N}${o.maximum.toString()} ${_.unit}`;return`${_?.longLabel??"גדול"} מדי: ${w} ${P} ${N}${o.maximum.toString()}`}case"too_small":{let _=t(o.origin),w=n(o.origin??"value");if(o.origin==="string")return`${_?.shortLabel??"קצר"} מדי: ${w} צריכה להכיל ${o.minimum.toString()} ${_?.unit??""} ${o.inclusive?"או יותר":"לפחות"}`.trim();if(o.origin==="number"){let K=o.inclusive?`גדול או שווה ל-${o.minimum}`:`גדול מ-${o.minimum}`;return`קטן מדי: ${w} צריך להיות ${K}`}if(o.origin==="array"||o.origin==="set"){let K=o.origin==="set"?"צריכה":"צריך";if(o.minimum===1&&o.inclusive){let Xr=o.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${w} ${K} להכיל ${Xr}`}let q=o.inclusive?`${o.minimum} ${_?.unit??""} או יותר`:`יותר מ-${o.minimum} ${_?.unit??""}`;return`קטן מדי: ${w} ${K} להכיל ${q}`.trim()}let N=o.inclusive?">=":">",P=$(o.origin??"value");if(_?.unit)return`${_.shortLabel} מדי: ${w} ${P} ${N}${o.minimum.toString()} ${_.unit}`;return`${_?.shortLabel??"קטן"} מדי: ${w} ${P} ${N}${o.minimum.toString()}`}case"invalid_format":{let _=o;if(_.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${_.prefix}"`;if(_.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${_.suffix}"`;if(_.format==="includes")return`המחרוזת חייבת לכלול "${_.includes}"`;if(_.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${_.pattern}`;let w=g[_.format],N=w?.label??_.format,K=(w?.gender??"m")==="f"?"תקינה":"תקין";return`${N} לא ${K}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${o.divisor}`;case"unrecognized_keys":return`מפתח${o.keys.length>1?"ות":""} לא מזוה${o.keys.length>1?"ים":"ה"}: ${U(o.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n(o.origin??"array")}`;default:return"קלט לא תקין"}}};var L_=S(()=>{j()});function zo(){return{localeError:DD()}}var DD=()=>{let r={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function i(n){return r[n]??null}let v={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},u={nan:"NaN",number:"szám",array:"tömb"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Érvénytelen bemenet: a várt érték instanceof ${n.expected}, a kapott érték ${g}`;return`Érvénytelen bemenet: a várt érték ${$}, a kapott érték ${g}`}case"invalid_value":if(n.values.length===1)return`Érvénytelen bemenet: a várt érték ${k(n.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${$}${n.maximum.toString()} ${t.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${$}${n.minimum.toString()} ${t.unit}`;return`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Érvénytelen string: "${$.prefix}" értékkel kell kezdődnie`;if($.format==="ends_with")return`Érvénytelen string: "${$.suffix}" értékkel kell végződnie`;if($.format==="includes")return`Érvénytelen string: "${$.includes}" értéket kell tartalmaznia`;if($.format==="regex")return`Érvénytelen string: ${$.pattern} mintának kell megfelelnie`;return`Érvénytelen ${v[$.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${U(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};var A_=S(()=>{j()});function j_(r,i,v){return Math.abs(r)===1?i:v}function Gn(r){if(!r)return"";let i=["ա","ե","ը","ի","ո","ու","օ"],v=r[r.length-1];return r+(i.includes(v)?"ն":"ը")}function Po(){return{localeError:wD()}}var wD=()=>{let r={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function i(n){return r[n]??null}let v={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},u={nan:"NaN",number:"թիվ",array:"զանգված"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${n.expected}, ստացվել է ${g}`;return`Սխալ մուտքագրում․ սպասվում էր ${$}, ստացվել է ${g}`}case"invalid_value":if(n.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${k(n.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t){let g=Number(n.maximum),b=j_(g,t.unit.one,t.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Gn(n.origin??"արժեք")} կունենա ${$}${n.maximum.toString()} ${b}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Gn(n.origin??"արժեք")} լինի ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t){let g=Number(n.minimum),b=j_(g,t.unit.one,t.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Gn(n.origin)} կունենա ${$}${n.minimum.toString()} ${b}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Gn(n.origin)} լինի ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${$.prefix}"-ով`;if($.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${$.suffix}"-ով`;if($.format==="includes")return`Սխալ տող․ պետք է պարունակի "${$.includes}"`;if($.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${$.pattern} ձևաչափին`;return`Սխալ ${v[$.format]??n.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${n.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${n.keys.length>1?"ներ":""}. ${U(n.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${Gn(n.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${Gn(n.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};var W_=S(()=>{j()});function So(){return{localeError:ND()}}var ND=()=>{let r={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function i(n){return r[n]??null}let v={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},u={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${g}`;return`Input tidak valid: diharapkan ${$}, diterima ${g}`}case"invalid_value":if(n.values.length===1)return`Input tidak valid: diharapkan ${k(n.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${$}${n.maximum.toString()} ${t.unit??"elemen"}`;return`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Terlalu kecil: diharapkan ${n.origin} memiliki ${$}${n.minimum.toString()} ${t.unit}`;return`Terlalu kecil: diharapkan ${n.origin} menjadi ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`String tidak valid: harus dimulai dengan "${$.prefix}"`;if($.format==="ends_with")return`String tidak valid: harus berakhir dengan "${$.suffix}"`;if($.format==="includes")return`String tidak valid: harus menyertakan "${$.includes}"`;if($.format==="regex")return`String tidak valid: harus sesuai pola ${$.pattern}`;return`${v[$.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${U(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};var X_=S(()=>{j()});function Jo(){return{localeError:kD()}}var kD=()=>{let r={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function i(n){return r[n]??null}let v={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},u={nan:"NaN",number:"númer",array:"fylki"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Rangt gildi: Þú slóst inn ${g} þar sem á að vera instanceof ${n.expected}`;return`Rangt gildi: Þú slóst inn ${g} þar sem á að vera ${$}`}case"invalid_value":if(n.values.length===1)return`Rangt gildi: gert ráð fyrir ${k(n.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} hafi ${$}${n.maximum.toString()} ${t.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} sé ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Of lítið: gert er ráð fyrir að ${n.origin} hafi ${$}${n.minimum.toString()} ${t.unit}`;return`Of lítið: gert er ráð fyrir að ${n.origin} sé ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Ógildur strengur: verður að byrja á "${$.prefix}"`;if($.format==="ends_with")return`Ógildur strengur: verður að enda á "${$.suffix}"`;if($.format==="includes")return`Ógildur strengur: verður að innihalda "${$.includes}"`;if($.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${$.pattern}`;return`Rangt ${v[$.format]??n.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`Óþekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${U(n.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${n.origin}`;default:return"Rangt gildi"}}};var G_=S(()=>{j()});function Lo(){return{localeError:OD()}}var OD=()=>{let r={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function i(n){return r[n]??null}let v={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"numero",array:"vettore"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Input non valido: atteso instanceof ${n.expected}, ricevuto ${g}`;return`Input non valido: atteso ${$}, ricevuto ${g}`}case"invalid_value":if(n.values.length===1)return`Input non valido: atteso ${k(n.values[0])}`;return`Opzione non valida: atteso uno tra ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Troppo grande: ${n.origin??"valore"} deve avere ${$}${n.maximum.toString()} ${t.unit??"elementi"}`;return`Troppo grande: ${n.origin??"valore"} deve essere ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Troppo piccolo: ${n.origin} deve avere ${$}${n.minimum.toString()} ${t.unit}`;return`Troppo piccolo: ${n.origin} deve essere ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Stringa non valida: deve iniziare con "${$.prefix}"`;if($.format==="ends_with")return`Stringa non valida: deve terminare con "${$.suffix}"`;if($.format==="includes")return`Stringa non valida: deve includere "${$.includes}"`;if($.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${$.pattern}`;return`Invalid ${v[$.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${U(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};var V_=S(()=>{j()});function Ao(){return{localeError:cD()}}var cD=()=>{let r={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function i(n){return r[n]??null}let v={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},u={nan:"NaN",number:"数値",array:"配列"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`無効な入力: instanceof ${n.expected}が期待されましたが、${g}が入力されました`;return`無効な入力: ${$}が期待されましたが、${g}が入力されました`}case"invalid_value":if(n.values.length===1)return`無効な入力: ${k(n.values[0])}が期待されました`;return`無効な選択: ${U(n.values,"、")}のいずれかである必要があります`;case"too_big":{let $=n.inclusive?"以下である":"より小さい",t=i(n.origin);if(t)return`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${t.unit??"要素"}${$}必要があります`;return`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${$}必要があります`}case"too_small":{let $=n.inclusive?"以上である":"より大きい",t=i(n.origin);if(t)return`小さすぎる値: ${n.origin}は${n.minimum.toString()}${t.unit}${$}必要があります`;return`小さすぎる値: ${n.origin}は${n.minimum.toString()}${$}必要があります`}case"invalid_format":{let $=n;if($.format==="starts_with")return`無効な文字列: "${$.prefix}"で始まる必要があります`;if($.format==="ends_with")return`無効な文字列: "${$.suffix}"で終わる必要があります`;if($.format==="includes")return`無効な文字列: "${$.includes}"を含む必要があります`;if($.format==="regex")return`無効な文字列: パターン${$.pattern}に一致する必要があります`;return`無効な${v[$.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${U(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};var K_=S(()=>{j()});function jo(){return{localeError:zD()}}var zD=()=>{let r={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function i(n){return r[n]??null}let v={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},u={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${n.expected}, მიღებული ${g}`;return`არასწორი შეყვანა: მოსალოდნელი ${$}, მიღებული ${g}`}case"invalid_value":if(n.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${k(n.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${U(n.values,"|")}-დან`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} ${t.verb} ${$}${n.maximum.toString()} ${t.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} იყოს ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`ზედმეტად პატარა: მოსალოდნელი ${n.origin} ${t.verb} ${$}${n.minimum.toString()} ${t.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${n.origin} იყოს ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${$.prefix}"-ით`;if($.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${$.suffix}"-ით`;if($.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${$.includes}"-ს`;if($.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${$.pattern}`;return`არასწორი ${v[$.format]??n.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${n.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${n.keys.length>1?"ები":"ი"}: ${U(n.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${n.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${n.origin}-ში`;default:return"არასწორი შეყვანა"}}};var Y_=S(()=>{j()});function Ni(){return{localeError:PD()}}var PD=()=>{let r={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function i(n){return r[n]??null}let v={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},u={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${n.expected} ប៉ុន្តែទទួលបាន ${g}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${$} ប៉ុន្តែទទួលបាន ${g}`}case"invalid_value":if(n.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${k(n.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${$} ${n.maximum.toString()} ${t.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${$} ${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`តូចពេក៖ ត្រូវការ ${n.origin} ${$} ${n.minimum.toString()} ${t.unit}`;return`តូចពេក៖ ត្រូវការ ${n.origin} ${$} ${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${$.prefix}"`;if($.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${$.suffix}"`;if($.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${$.includes}"`;if($.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${$.pattern}`;return`មិនត្រឹមត្រូវ៖ ${v[$.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${U(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};var Wo=S(()=>{j()});function Xo(){return Ni()}var Q_=S(()=>{Wo()});function Go(){return{localeError:SD()}}var SD=()=>{let r={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function i(n){return r[n]??null}let v={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},u={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`잘못된 입력: 예상 타입은 instanceof ${n.expected}, 받은 타입은 ${g}입니다`;return`잘못된 입력: 예상 타입은 ${$}, 받은 타입은 ${g}입니다`}case"invalid_value":if(n.values.length===1)return`잘못된 입력: 값은 ${k(n.values[0])} 이어야 합니다`;return`잘못된 옵션: ${U(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let $=n.inclusive?"이하":"미만",t=$==="미만"?"이어야 합니다":"여야 합니다",g=i(n.origin),b=g?.unit??"요소";if(g)return`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${b} ${$}${t}`;return`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${$}${t}`}case"too_small":{let $=n.inclusive?"이상":"초과",t=$==="이상"?"이어야 합니다":"여야 합니다",g=i(n.origin),b=g?.unit??"요소";if(g)return`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${b} ${$}${t}`;return`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${$}${t}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`잘못된 문자열: "${$.prefix}"(으)로 시작해야 합니다`;if($.format==="ends_with")return`잘못된 문자열: "${$.suffix}"(으)로 끝나야 합니다`;if($.format==="includes")return`잘못된 문자열: "${$.includes}"을(를) 포함해야 합니다`;if($.format==="regex")return`잘못된 문자열: 정규식 ${$.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${v[$.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${U(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};var B_=S(()=>{j()});function F_(r){let i=Math.abs(r),v=i%10,u=i%100;if(u>=11&&u<=19||v===0)return"many";if(v===1)return"one";return"few"}function Vo(){return{localeError:JD()}}var ki=(r)=>{return r.charAt(0).toUpperCase()+r.slice(1)},JD=()=>{let r={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function i(n,$,t,g){let b=r[n]??null;if(b===null)return b;return{unit:b.unit[$],verb:b.verb[g][t?"inclusive":"notInclusive"]}}let v={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},u={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Gautas tipas ${g}, o tikėtasi - instanceof ${n.expected}`;return`Gautas tipas ${g}, o tikėtasi - ${$}`}case"invalid_value":if(n.values.length===1)return`Privalo būti ${k(n.values[0])}`;return`Privalo būti vienas iš ${U(n.values,"|")} pasirinkimų`;case"too_big":{let $=u[n.origin]??n.origin,t=i(n.origin,F_(Number(n.maximum)),n.inclusive??!1,"smaller");if(t?.verb)return`${ki($??n.origin??"reikšmė")} ${t.verb} ${n.maximum.toString()} ${t.unit??"elementų"}`;let g=n.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${ki($??n.origin??"reikšmė")} turi būti ${g} ${n.maximum.toString()} ${t?.unit}`}case"too_small":{let $=u[n.origin]??n.origin,t=i(n.origin,F_(Number(n.minimum)),n.inclusive??!1,"bigger");if(t?.verb)return`${ki($??n.origin??"reikšmė")} ${t.verb} ${n.minimum.toString()} ${t.unit??"elementų"}`;let g=n.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${ki($??n.origin??"reikšmė")} turi būti ${g} ${n.minimum.toString()} ${t?.unit}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Eilutė privalo prasidėti "${$.prefix}"`;if($.format==="ends_with")return`Eilutė privalo pasibaigti "${$.suffix}"`;if($.format==="includes")return`Eilutė privalo įtraukti "${$.includes}"`;if($.format==="regex")return`Eilutė privalo atitikti ${$.pattern}`;return`Neteisingas ${v[$.format]??n.format}`}case"not_multiple_of":return`Skaičius privalo būti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${U(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let $=u[n.origin]??n.origin;return`${ki($??n.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};var H_=S(()=>{j()});function Ko(){return{localeError:LD()}}var LD=()=>{let r={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function i(n){return r[n]??null}let v={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},u={nan:"NaN",number:"број",array:"низа"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Грешен внес: се очекува instanceof ${n.expected}, примено ${g}`;return`Грешен внес: се очекува ${$}, примено ${g}`}case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${k(n.values[0])}`;return`Грешана опција: се очекува една ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${$}${n.maximum.toString()} ${t.unit??"елементи"}`;return`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Премногу мал: се очекува ${n.origin} да има ${$}${n.minimum.toString()} ${t.unit}`;return`Премногу мал: се очекува ${n.origin} да биде ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Неважечка низа: мора да започнува со "${$.prefix}"`;if($.format==="ends_with")return`Неважечка низа: мора да завршува со "${$.suffix}"`;if($.format==="includes")return`Неважечка низа: мора да вклучува "${$.includes}"`;if($.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${$.pattern}`;return`Invalid ${v[$.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${U(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};var E_=S(()=>{j()});function Yo(){return{localeError:AD()}}var AD=()=>{let r={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function i(n){return r[n]??null}let v={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"nombor"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${g}`;return`Input tidak sah: dijangka ${$}, diterima ${g}`}case"invalid_value":if(n.values.length===1)return`Input tidak sah: dijangka ${k(n.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Terlalu besar: dijangka ${n.origin??"nilai"} ${t.verb} ${$}${n.maximum.toString()} ${t.unit??"elemen"}`;return`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Terlalu kecil: dijangka ${n.origin} ${t.verb} ${$}${n.minimum.toString()} ${t.unit}`;return`Terlalu kecil: dijangka ${n.origin} adalah ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`String tidak sah: mesti bermula dengan "${$.prefix}"`;if($.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${$.suffix}"`;if($.format==="includes")return`String tidak sah: mesti mengandungi "${$.includes}"`;if($.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${$.pattern}`;return`${v[$.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${U(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};var T_=S(()=>{j()});function Qo(){return{localeError:jD()}}var jD=()=>{let r={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function i(n){return r[n]??null}let v={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},u={nan:"NaN",number:"getal"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${g}`;return`Ongeldige invoer: verwacht ${$}, ontving ${g}`}case"invalid_value":if(n.values.length===1)return`Ongeldige invoer: verwacht ${k(n.values[0])}`;return`Ongeldige optie: verwacht één van ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin),g=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";if(t)return`Te ${g}: verwacht dat ${n.origin??"waarde"} ${$}${n.maximum.toString()} ${t.unit??"elementen"} ${t.verb}`;return`Te ${g}: verwacht dat ${n.origin??"waarde"} ${$}${n.maximum.toString()} is`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin),g=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";if(t)return`Te ${g}: verwacht dat ${n.origin} ${$}${n.minimum.toString()} ${t.unit} ${t.verb}`;return`Te ${g}: verwacht dat ${n.origin} ${$}${n.minimum.toString()} is`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Ongeldige tekst: moet met "${$.prefix}" beginnen`;if($.format==="ends_with")return`Ongeldige tekst: moet op "${$.suffix}" eindigen`;if($.format==="includes")return`Ongeldige tekst: moet "${$.includes}" bevatten`;if($.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${$.pattern}`;return`Ongeldig: ${v[$.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${U(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};var M_=S(()=>{j()});function Bo(){return{localeError:WD()}}var WD=()=>{let r={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function i(n){return r[n]??null}let v={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"tall",array:"liste"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Ugyldig input: forventet instanceof ${n.expected}, fikk ${g}`;return`Ugyldig input: forventet ${$}, fikk ${g}`}case"invalid_value":if(n.values.length===1)return`Ugyldig verdi: forventet ${k(n.values[0])}`;return`Ugyldig valg: forventet en av ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`For stor(t): forventet ${n.origin??"value"} til å ha ${$}${n.maximum.toString()} ${t.unit??"elementer"}`;return`For stor(t): forventet ${n.origin??"value"} til å ha ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`For lite(n): forventet ${n.origin} til å ha ${$}${n.minimum.toString()} ${t.unit}`;return`For lite(n): forventet ${n.origin} til å ha ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Ugyldig streng: må starte med "${$.prefix}"`;if($.format==="ends_with")return`Ugyldig streng: må ende med "${$.suffix}"`;if($.format==="includes")return`Ugyldig streng: må inneholde "${$.includes}"`;if($.format==="regex")return`Ugyldig streng: må matche mønsteret ${$.pattern}`;return`Ugyldig ${v[$.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${U(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};var q_=S(()=>{j()});function Fo(){return{localeError:XD()}}var XD=()=>{let r={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function i(n){return r[n]??null}let v={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},u={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Fâsit giren: umulan instanceof ${n.expected}, alınan ${g}`;return`Fâsit giren: umulan ${$}, alınan ${g}`}case"invalid_value":if(n.values.length===1)return`Fâsit giren: umulan ${k(n.values[0])}`;return`Fâsit tercih: mûteberler ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Fazla büyük: ${n.origin??"value"}, ${$}${n.maximum.toString()} ${t.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${n.origin??"value"}, ${$}${n.maximum.toString()} olmalıydı.`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Fazla küçük: ${n.origin}, ${$}${n.minimum.toString()} ${t.unit} sahip olmalıydı.`;return`Fazla küçük: ${n.origin}, ${$}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Fâsit metin: "${$.prefix}" ile başlamalı.`;if($.format==="ends_with")return`Fâsit metin: "${$.suffix}" ile bitmeli.`;if($.format==="includes")return`Fâsit metin: "${$.includes}" ihtivâ etmeli.`;if($.format==="regex")return`Fâsit metin: ${$.pattern} nakşına uymalı.`;return`Fâsit ${v[$.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${U(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};var x_=S(()=>{j()});function Ho(){return{localeError:GD()}}var GD=()=>{let r={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function i(n){return r[n]??null}let v={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},u={nan:"NaN",number:"عدد",array:"ارې"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`ناسم ورودي: باید instanceof ${n.expected} وای, مګر ${g} ترلاسه شو`;return`ناسم ورودي: باید ${$} وای, مګر ${g} ترلاسه شو`}case"invalid_value":if(n.values.length===1)return`ناسم ورودي: باید ${k(n.values[0])} وای`;return`ناسم انتخاب: باید یو له ${U(n.values,"|")} څخه وای`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`ډیر لوی: ${n.origin??"ارزښت"} باید ${$}${n.maximum.toString()} ${t.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${n.origin??"ارزښت"} باید ${$}${n.maximum.toString()} وي`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`ډیر کوچنی: ${n.origin} باید ${$}${n.minimum.toString()} ${t.unit} ولري`;return`ډیر کوچنی: ${n.origin} باید ${$}${n.minimum.toString()} وي`}case"invalid_format":{let $=n;if($.format==="starts_with")return`ناسم متن: باید د "${$.prefix}" سره پیل شي`;if($.format==="ends_with")return`ناسم متن: باید د "${$.suffix}" سره پای ته ورسيږي`;if($.format==="includes")return`ناسم متن: باید "${$.includes}" ولري`;if($.format==="regex")return`ناسم متن: باید د ${$.pattern} سره مطابقت ولري`;return`${v[$.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${U(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};var Z_=S(()=>{j()});function Eo(){return{localeError:VD()}}var VD=()=>{let r={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function i(n){return r[n]??null}let v={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},u={nan:"NaN",number:"liczba",array:"tablica"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${n.expected}, otrzymano ${g}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${$}, otrzymano ${g}`}case"invalid_value":if(n.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${k(n.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${$}${n.maximum.toString()} ${t.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${$}${n.minimum.toString()} ${t.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${$.prefix}"`;if($.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${$.suffix}"`;if($.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${$.includes}"`;if($.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${$.pattern}`;return`Nieprawidłow(y/a/e) ${v[$.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${U(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};var m_=S(()=>{j()});function To(){return{localeError:KD()}}var KD=()=>{let r={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function i(n){return r[n]??null}let v={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},u={nan:"NaN",number:"número",null:"nulo"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Tipo inválido: esperado instanceof ${n.expected}, recebido ${g}`;return`Tipo inválido: esperado ${$}, recebido ${g}`}case"invalid_value":if(n.values.length===1)return`Entrada inválida: esperado ${k(n.values[0])}`;return`Opção inválida: esperada uma das ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Muito grande: esperado que ${n.origin??"valor"} tivesse ${$}${n.maximum.toString()} ${t.unit??"elementos"}`;return`Muito grande: esperado que ${n.origin??"valor"} fosse ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Muito pequeno: esperado que ${n.origin} tivesse ${$}${n.minimum.toString()} ${t.unit}`;return`Muito pequeno: esperado que ${n.origin} fosse ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Texto inválido: deve começar com "${$.prefix}"`;if($.format==="ends_with")return`Texto inválido: deve terminar com "${$.suffix}"`;if($.format==="includes")return`Texto inválido: deve incluir "${$.includes}"`;if($.format==="regex")return`Texto inválido: deve corresponder ao padrão ${$.pattern}`;return`${v[$.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${U(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};var R_=S(()=>{j()});function C_(r,i,v,u){let n=Math.abs(r),$=n%10,t=n%100;if(t>=11&&t<=19)return u;if($===1)return i;if($>=2&&$<=4)return v;return u}function Mo(){return{localeError:YD()}}var YD=()=>{let r={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function i(n){return r[n]??null}let v={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},u={nan:"NaN",number:"число",array:"массив"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Неверный ввод: ожидалось instanceof ${n.expected}, получено ${g}`;return`Неверный ввод: ожидалось ${$}, получено ${g}`}case"invalid_value":if(n.values.length===1)return`Неверный ввод: ожидалось ${k(n.values[0])}`;return`Неверный вариант: ожидалось одно из ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t){let g=Number(n.maximum),b=C_(g,t.unit.one,t.unit.few,t.unit.many);return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет иметь ${$}${n.maximum.toString()} ${b}`}return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t){let g=Number(n.minimum),b=C_(g,t.unit.one,t.unit.few,t.unit.many);return`Слишком маленькое значение: ожидалось, что ${n.origin} будет иметь ${$}${n.minimum.toString()} ${b}`}return`Слишком маленькое значение: ожидалось, что ${n.origin} будет ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Неверная строка: должна начинаться с "${$.prefix}"`;if($.format==="ends_with")return`Неверная строка: должна заканчиваться на "${$.suffix}"`;if($.format==="includes")return`Неверная строка: должна содержать "${$.includes}"`;if($.format==="regex")return`Неверная строка: должна соответствовать шаблону ${$.pattern}`;return`Неверный ${v[$.format]??n.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспознанн${n.keys.length>1?"ые":"ый"} ключ${n.keys.length>1?"и":""}: ${U(n.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${n.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${n.origin}`;default:return"Неверные входные данные"}}};var e_=S(()=>{j()});function qo(){return{localeError:QD()}}var QD=()=>{let r={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function i(n){return r[n]??null}let v={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},u={nan:"NaN",number:"število",array:"tabela"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Neveljaven vnos: pričakovano instanceof ${n.expected}, prejeto ${g}`;return`Neveljaven vnos: pričakovano ${$}, prejeto ${g}`}case"invalid_value":if(n.values.length===1)return`Neveljaven vnos: pričakovano ${k(n.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${$}${n.maximum.toString()} ${t.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Premajhno: pričakovano, da bo ${n.origin} imelo ${$}${n.minimum.toString()} ${t.unit}`;return`Premajhno: pričakovano, da bo ${n.origin} ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Neveljaven niz: mora se začeti z "${$.prefix}"`;if($.format==="ends_with")return`Neveljaven niz: mora se končati z "${$.suffix}"`;if($.format==="includes")return`Neveljaven niz: mora vsebovati "${$.includes}"`;if($.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${$.pattern}`;return`Neveljaven ${v[$.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${U(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};var y_=S(()=>{j()});function xo(){return{localeError:BD()}}var BD=()=>{let r={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function i(n){return r[n]??null}let v={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},u={nan:"NaN",number:"antal",array:"lista"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Ogiltig inmatning: förväntat instanceof ${n.expected}, fick ${g}`;return`Ogiltig inmatning: förväntat ${$}, fick ${g}`}case"invalid_value":if(n.values.length===1)return`Ogiltig inmatning: förväntat ${k(n.values[0])}`;return`Ogiltigt val: förväntade en av ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`För stor(t): förväntade ${n.origin??"värdet"} att ha ${$}${n.maximum.toString()} ${t.unit??"element"}`;return`För stor(t): förväntat ${n.origin??"värdet"} att ha ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`För lite(t): förväntade ${n.origin??"värdet"} att ha ${$}${n.minimum.toString()} ${t.unit}`;return`För lite(t): förväntade ${n.origin??"värdet"} att ha ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Ogiltig sträng: måste börja med "${$.prefix}"`;if($.format==="ends_with")return`Ogiltig sträng: måste sluta med "${$.suffix}"`;if($.format==="includes")return`Ogiltig sträng: måste innehålla "${$.includes}"`;if($.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${$.pattern}"`;return`Ogiltig(t) ${v[$.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${U(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};var f_=S(()=>{j()});function Zo(){return{localeError:FD()}}var FD=()=>{let r={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function i(n){return r[n]??null}let v={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},u={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${n.expected}, பெறப்பட்டது ${g}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${$}, பெறப்பட்டது ${g}`}case"invalid_value":if(n.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${k(n.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${U(n.values,"|")} இல் ஒன்று`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${$}${n.maximum.toString()} ${t.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${$}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${$}${n.minimum.toString()} ${t.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${$}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let $=n;if($.format==="starts_with")return`தவறான சரம்: "${$.prefix}" இல் தொடங்க வேண்டும்`;if($.format==="ends_with")return`தவறான சரம்: "${$.suffix}" இல் முடிவடைய வேண்டும்`;if($.format==="includes")return`தவறான சரம்: "${$.includes}" ஐ உள்ளடக்க வேண்டும்`;if($.format==="regex")return`தவறான சரம்: ${$.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${v[$.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${U(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};var d_=S(()=>{j()});function mo(){return{localeError:HD()}}var HD=()=>{let r={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function i(n){return r[n]??null}let v={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},u={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${n.expected} แต่ได้รับ ${g}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${$} แต่ได้รับ ${g}`}case"invalid_value":if(n.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${k(n.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"ไม่เกิน":"น้อยกว่า",t=i(n.origin);if(t)return`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${$} ${n.maximum.toString()} ${t.unit??"รายการ"}`;return`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${$} ${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?"อย่างน้อย":"มากกว่า",t=i(n.origin);if(t)return`น้อยกว่ากำหนด: ${n.origin} ควรมี${$} ${n.minimum.toString()} ${t.unit}`;return`น้อยกว่ากำหนด: ${n.origin} ควรมี${$} ${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${$.prefix}"`;if($.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${$.suffix}"`;if($.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${$.includes}" อยู่ในข้อความ`;if($.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${$.pattern}`;return`รูปแบบไม่ถูกต้อง: ${v[$.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${U(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};var h_=S(()=>{j()});function Ro(){return{localeError:ED()}}var ED=()=>{let r={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function i(n){return r[n]??null}let v={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},u={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Geçersiz değer: beklenen instanceof ${n.expected}, alınan ${g}`;return`Geçersiz değer: beklenen ${$}, alınan ${g}`}case"invalid_value":if(n.values.length===1)return`Geçersiz değer: beklenen ${k(n.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Çok büyük: beklenen ${n.origin??"değer"} ${$}${n.maximum.toString()} ${t.unit??"öğe"}`;return`Çok büyük: beklenen ${n.origin??"değer"} ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Çok küçük: beklenen ${n.origin} ${$}${n.minimum.toString()} ${t.unit}`;return`Çok küçük: beklenen ${n.origin} ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Geçersiz metin: "${$.prefix}" ile başlamalı`;if($.format==="ends_with")return`Geçersiz metin: "${$.suffix}" ile bitmeli`;if($.format==="includes")return`Geçersiz metin: "${$.includes}" içermeli`;if($.format==="regex")return`Geçersiz metin: ${$.pattern} desenine uymalı`;return`Geçersiz ${v[$.format]??n.format}`}case"not_multiple_of":return`Geçersiz sayı: ${n.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${n.keys.length>1?"lar":""}: ${U(n.keys,", ")}`;case"invalid_key":return`${n.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${n.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};var p_=S(()=>{j()});function Oi(){return{localeError:TD()}}var TD=()=>{let r={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function i(n){return r[n]??null}let v={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},u={nan:"NaN",number:"число",array:"масив"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Неправильні вхідні дані: очікується instanceof ${n.expected}, отримано ${g}`;return`Неправильні вхідні дані: очікується ${$}, отримано ${g}`}case"invalid_value":if(n.values.length===1)return`Неправильні вхідні дані: очікується ${k(n.values[0])}`;return`Неправильна опція: очікується одне з ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Занадто велике: очікується, що ${n.origin??"значення"} ${t.verb} ${$}${n.maximum.toString()} ${t.unit??"елементів"}`;return`Занадто велике: очікується, що ${n.origin??"значення"} буде ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Занадто мале: очікується, що ${n.origin} ${t.verb} ${$}${n.minimum.toString()} ${t.unit}`;return`Занадто мале: очікується, що ${n.origin} буде ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Неправильний рядок: повинен починатися з "${$.prefix}"`;if($.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${$.suffix}"`;if($.format==="includes")return`Неправильний рядок: повинен містити "${$.includes}"`;if($.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${$.pattern}`;return`Неправильний ${v[$.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${U(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};var Co=S(()=>{j()});function eo(){return Oi()}var a_=S(()=>{Co()});function yo(){return{localeError:MD()}}var MD=()=>{let r={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function i(n){return r[n]??null}let v={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},u={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`غلط ان پٹ: instanceof ${n.expected} متوقع تھا، ${g} موصول ہوا`;return`غلط ان پٹ: ${$} متوقع تھا، ${g} موصول ہوا`}case"invalid_value":if(n.values.length===1)return`غلط ان پٹ: ${k(n.values[0])} متوقع تھا`;return`غلط آپشن: ${U(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`بہت بڑا: ${n.origin??"ویلیو"} کے ${$}${n.maximum.toString()} ${t.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${n.origin??"ویلیو"} کا ${$}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`بہت چھوٹا: ${n.origin} کے ${$}${n.minimum.toString()} ${t.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${n.origin} کا ${$}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let $=n;if($.format==="starts_with")return`غلط سٹرنگ: "${$.prefix}" سے شروع ہونا چاہیے`;if($.format==="ends_with")return`غلط سٹرنگ: "${$.suffix}" پر ختم ہونا چاہیے`;if($.format==="includes")return`غلط سٹرنگ: "${$.includes}" شامل ہونا چاہیے`;if($.format==="regex")return`غلط سٹرنگ: پیٹرن ${$.pattern} سے میچ ہونا چاہیے`;return`غلط ${v[$.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${U(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};var s_=S(()=>{j()});function fo(){return{localeError:qD()}}var qD=()=>{let r={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function i(n){return r[n]??null}let v={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},u={nan:"NaN",number:"raqam",array:"massiv"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${g}`;return`Noto‘g‘ri kirish: kutilgan ${$}, qabul qilingan ${g}`}case"invalid_value":if(n.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${k(n.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Juda katta: kutilgan ${n.origin??"qiymat"} ${$}${n.maximum.toString()} ${t.unit} ${t.verb}`;return`Juda katta: kutilgan ${n.origin??"qiymat"} ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Juda kichik: kutilgan ${n.origin} ${$}${n.minimum.toString()} ${t.unit} ${t.verb}`;return`Juda kichik: kutilgan ${n.origin} ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Noto‘g‘ri satr: "${$.prefix}" bilan boshlanishi kerak`;if($.format==="ends_with")return`Noto‘g‘ri satr: "${$.suffix}" bilan tugashi kerak`;if($.format==="includes")return`Noto‘g‘ri satr: "${$.includes}" ni o‘z ichiga olishi kerak`;if($.format==="regex")return`Noto‘g‘ri satr: ${$.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${v[$.format]??n.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${n.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${n.keys.length>1?"lar":""}: ${U(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${n.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};var rI=S(()=>{j()});function ho(){return{localeError:xD()}}var xD=()=>{let r={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function i(n){return r[n]??null}let v={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},u={nan:"NaN",number:"số",array:"mảng"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${n.expected}, nhận được ${g}`;return`Đầu vào không hợp lệ: mong đợi ${$}, nhận được ${g}`}case"invalid_value":if(n.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${k(n.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Quá lớn: mong đợi ${n.origin??"giá trị"} ${t.verb} ${$}${n.maximum.toString()} ${t.unit??"phần tử"}`;return`Quá lớn: mong đợi ${n.origin??"giá trị"} ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Quá nhỏ: mong đợi ${n.origin} ${t.verb} ${$}${n.minimum.toString()} ${t.unit}`;return`Quá nhỏ: mong đợi ${n.origin} ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${$.prefix}"`;if($.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${$.suffix}"`;if($.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${$.includes}"`;if($.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${$.pattern}`;return`${v[$.format]??n.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${U(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};var nI=S(()=>{j()});function po(){return{localeError:ZD()}}var ZD=()=>{let r={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function i(n){return r[n]??null}let v={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},u={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`无效输入:期望 instanceof ${n.expected},实际接收 ${g}`;return`无效输入:期望 ${$},实际接收 ${g}`}case"invalid_value":if(n.values.length===1)return`无效输入:期望 ${k(n.values[0])}`;return`无效选项:期望以下之一 ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`数值过大:期望 ${n.origin??"值"} ${$}${n.maximum.toString()} ${t.unit??"个元素"}`;return`数值过大:期望 ${n.origin??"值"} ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`数值过小:期望 ${n.origin} ${$}${n.minimum.toString()} ${t.unit}`;return`数值过小:期望 ${n.origin} ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`无效字符串:必须以 "${$.prefix}" 开头`;if($.format==="ends_with")return`无效字符串:必须以 "${$.suffix}" 结尾`;if($.format==="includes")return`无效字符串:必须包含 "${$.includes}"`;if($.format==="regex")return`无效字符串:必须满足正则表达式 ${$.pattern}`;return`无效${v[$.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${U(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};var iI=S(()=>{j()});function ao(){return{localeError:mD()}}var mD=()=>{let r={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function i(n){return r[n]??null}let v={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},u={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`無效的輸入值:預期為 instanceof ${n.expected},但收到 ${g}`;return`無效的輸入值:預期為 ${$},但收到 ${g}`}case"invalid_value":if(n.values.length===1)return`無效的輸入值:預期為 ${k(n.values[0])}`;return`無效的選項:預期為以下其中之一 ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`數值過大:預期 ${n.origin??"值"} 應為 ${$}${n.maximum.toString()} ${t.unit??"個元素"}`;return`數值過大:預期 ${n.origin??"值"} 應為 ${$}${n.maximum.toString()}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`數值過小:預期 ${n.origin} 應為 ${$}${n.minimum.toString()} ${t.unit}`;return`數值過小:預期 ${n.origin} 應為 ${$}${n.minimum.toString()}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`無效的字串:必須以 "${$.prefix}" 開頭`;if($.format==="ends_with")return`無效的字串:必須以 "${$.suffix}" 結尾`;if($.format==="includes")return`無效的字串:必須包含 "${$.includes}"`;if($.format==="regex")return`無效的字串:必須符合格式 ${$.pattern}`;return`無效的 ${v[$.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${U(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};var vI=S(()=>{j()});function so(){return{localeError:RD()}}var RD=()=>{let r={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function i(n){return r[n]??null}let v={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},u={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(n)=>{switch(n.code){case"invalid_type":{let $=u[n.expected]??n.expected,t=O(n.input),g=u[t]??t;if(/^[A-Z]/.test(n.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${n.expected}, àmọ̀ a rí ${g}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${$}, àmọ̀ a rí ${g}`}case"invalid_value":if(n.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${k(n.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${U(n.values,"|")}`;case"too_big":{let $=n.inclusive?"<=":"<",t=i(n.origin);if(t)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${n.origin??"iye"} ${t.verb} ${$}${n.maximum} ${t.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${$}${n.maximum}`}case"too_small":{let $=n.inclusive?">=":">",t=i(n.origin);if(t)return`Kéré ju: a ní láti jẹ́ pé ${n.origin} ${t.verb} ${$}${n.minimum} ${t.unit}`;return`Kéré ju: a ní láti jẹ́ ${$}${n.minimum}`}case"invalid_format":{let $=n;if($.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${$.prefix}"`;if($.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${$.suffix}"`;if($.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${$.includes}"`;if($.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${$.pattern}`;return`Aṣìṣe: ${v[$.format]??n.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${n.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${U(n.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${n.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${n.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};var $I=S(()=>{j()});var Vn={};Lr(Vn,{zhTW:()=>ao,zhCN:()=>po,yo:()=>so,vi:()=>ho,uz:()=>fo,ur:()=>yo,uk:()=>Oi,ua:()=>eo,tr:()=>Ro,th:()=>mo,ta:()=>Zo,sv:()=>xo,sl:()=>qo,ru:()=>Mo,pt:()=>To,ps:()=>Ho,pl:()=>Eo,ota:()=>Fo,no:()=>Bo,nl:()=>Qo,ms:()=>Yo,mk:()=>Ko,lt:()=>Vo,ko:()=>Go,km:()=>Ni,kh:()=>Xo,ka:()=>jo,ja:()=>Ao,it:()=>Lo,is:()=>Jo,id:()=>So,hy:()=>Po,hu:()=>zo,he:()=>co,frCA:()=>Oo,fr:()=>ko,fi:()=>No,fa:()=>wo,es:()=>Do,eo:()=>Uo,en:()=>wi,de:()=>_o,da:()=>bo,cs:()=>lo,ca:()=>oo,bg:()=>go,be:()=>to,az:()=>uo,ar:()=>$o});var rl=S(()=>{l_();b_();I_();U_();D_();w_();N_();k_();Io();O_();c_();z_();P_();S_();J_();L_();A_();W_();X_();G_();V_();K_();Y_();Q_();Wo();B_();H_();E_();T_();M_();q_();x_();Z_();m_();R_();e_();y_();f_();d_();h_();p_();a_();Co();s_();rI();nI();iI();vI();$I()});class nl{constructor(){this._map=new WeakMap,this._idmap=new Map}add(r,...i){let v=i[0];if(this._map.set(r,v),v&&typeof v==="object"&&"id"in v)this._idmap.set(v.id,r);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(r){let i=this._map.get(r);if(i&&typeof i==="object"&&"id"in i)this._idmap.delete(i.id);return this._map.delete(r),this}get(r){let i=r._zod.parent;if(i){let v={...this.get(i)??{}};delete v.id;let u={...v,...this._map.get(r)};return Object.keys(u).length?u:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function ci(){return new nl}var uI,hv,pv,f;var zi=S(()=>{hv=Symbol("ZodOutput"),pv=Symbol("ZodInput");(uI=globalThis).__zod_globalRegistry??(uI.__zod_globalRegistry=ci());f=globalThis.__zod_globalRegistry});function il(r,i){return new r({type:"string",...z(i)})}function vl(r,i){return new r({type:"string",coerce:!0,...z(i)})}function av(r,i){return new r({type:"string",format:"email",check:"string_format",abort:!1,...z(i)})}function Pi(r,i){return new r({type:"string",format:"guid",check:"string_format",abort:!1,...z(i)})}function sv(r,i){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,...z(i)})}function r$(r,i){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(i)})}function n$(r,i){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(i)})}function i$(r,i){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(i)})}function Si(r,i){return new r({type:"string",format:"url",check:"string_format",abort:!1,...z(i)})}function v$(r,i){return new r({type:"string",format:"emoji",check:"string_format",abort:!1,...z(i)})}function $$(r,i){return new r({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(i)})}function u$(r,i){return new r({type:"string",format:"cuid",check:"string_format",abort:!1,...z(i)})}function t$(r,i){return new r({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(i)})}function g$(r,i){return new r({type:"string",format:"ulid",check:"string_format",abort:!1,...z(i)})}function o$(r,i){return new r({type:"string",format:"xid",check:"string_format",abort:!1,...z(i)})}function l$(r,i){return new r({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(i)})}function b$(r,i){return new r({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(i)})}function _$(r,i){return new r({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(i)})}function $l(r,i){return new r({type:"string",format:"mac",check:"string_format",abort:!1,...z(i)})}function I$(r,i){return new r({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(i)})}function U$(r,i){return new r({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(i)})}function D$(r,i){return new r({type:"string",format:"base64",check:"string_format",abort:!1,...z(i)})}function w$(r,i){return new r({type:"string",format:"base64url",check:"string_format",abort:!1,...z(i)})}function N$(r,i){return new r({type:"string",format:"e164",check:"string_format",abort:!1,...z(i)})}function k$(r,i){return new r({type:"string",format:"jwt",check:"string_format",abort:!1,...z(i)})}function ul(r,i){return new r({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(i)})}function tl(r,i){return new r({type:"string",format:"date",check:"string_format",...z(i)})}function gl(r,i){return new r({type:"string",format:"time",check:"string_format",precision:null,...z(i)})}function ol(r,i){return new r({type:"string",format:"duration",check:"string_format",...z(i)})}function ll(r,i){return new r({type:"number",checks:[],...z(i)})}function bl(r,i){return new r({type:"number",coerce:!0,checks:[],...z(i)})}function _l(r,i){return new r({type:"number",check:"number_format",abort:!1,format:"safeint",...z(i)})}function Il(r,i){return new r({type:"number",check:"number_format",abort:!1,format:"float32",...z(i)})}function Ul(r,i){return new r({type:"number",check:"number_format",abort:!1,format:"float64",...z(i)})}function Dl(r,i){return new r({type:"number",check:"number_format",abort:!1,format:"int32",...z(i)})}function wl(r,i){return new r({type:"number",check:"number_format",abort:!1,format:"uint32",...z(i)})}function Nl(r,i){return new r({type:"boolean",...z(i)})}function kl(r,i){return new r({type:"boolean",coerce:!0,...z(i)})}function Ol(r,i){return new r({type:"bigint",...z(i)})}function cl(r,i){return new r({type:"bigint",coerce:!0,...z(i)})}function zl(r,i){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...z(i)})}function Pl(r,i){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...z(i)})}function Sl(r,i){return new r({type:"symbol",...z(i)})}function Jl(r,i){return new r({type:"undefined",...z(i)})}function Ll(r,i){return new r({type:"null",...z(i)})}function Al(r){return new r({type:"any"})}function jl(r){return new r({type:"unknown"})}function Wl(r,i){return new r({type:"never",...z(i)})}function Xl(r,i){return new r({type:"void",...z(i)})}function Gl(r,i){return new r({type:"date",...z(i)})}function Vl(r,i){return new r({type:"date",coerce:!0,...z(i)})}function Kl(r,i){return new r({type:"nan",...z(i)})}function zr(r,i){return new Ev({check:"less_than",...z(i),value:r,inclusive:!1})}function lr(r,i){return new Ev({check:"less_than",...z(i),value:r,inclusive:!0})}function Pr(r,i){return new Tv({check:"greater_than",...z(i),value:r,inclusive:!1})}function nr(r,i){return new Tv({check:"greater_than",...z(i),value:r,inclusive:!0})}function Ji(r){return Pr(0,r)}function Li(r){return zr(0,r)}function Ai(r){return lr(0,r)}function ji(r){return nr(0,r)}function Vr(r,i){return new Wt({check:"multiple_of",...z(i),value:r})}function Kr(r,i){return new Vt({check:"max_size",...z(i),maximum:r})}function Sr(r,i){return new Kt({check:"min_size",...z(i),minimum:r})}function Tr(r,i){return new Yt({check:"size_equals",...z(i),size:r})}function Mr(r,i){return new Qt({check:"max_length",...z(i),maximum:r})}function jr(r,i){return new Bt({check:"min_length",...z(i),minimum:r})}function qr(r,i){return new Ft({check:"length_equals",...z(i),length:r})}function pr(r,i){return new Ht({check:"string_format",format:"regex",...z(i),pattern:r})}function ar(r){return new Et({check:"string_format",format:"lowercase",...z(r)})}function sr(r){return new Tt({check:"string_format",format:"uppercase",...z(r)})}function rn(r,i){return new Mt({check:"string_format",format:"includes",...z(i),includes:r})}function nn(r,i){return new qt({check:"string_format",format:"starts_with",...z(i),prefix:r})}function vn(r,i){return new xt({check:"string_format",format:"ends_with",...z(i),suffix:r})}function Wi(r,i,v){return new Zt({check:"property",property:r,schema:i,...z(v)})}function $n(r,i){return new mt({check:"mime_type",mime:r,...z(i)})}function Nr(r){return new Rt({check:"overwrite",tx:r})}function un(r){return Nr((i)=>i.normalize(r))}function tn(){return Nr((r)=>r.trim())}function gn(){return Nr((r)=>r.toLowerCase())}function on(){return Nr((r)=>r.toUpperCase())}function ln(){return Nr((r)=>Ru(r))}function Yl(r,i,v){return new r({type:"array",element:i,...z(v)})}function eD(r,i,v){return new r({type:"union",options:i,...z(v)})}function yD(r,i,v){return new r({type:"union",options:i,inclusive:!1,...z(v)})}function fD(r,i,v,u){return new r({type:"union",options:v,discriminator:i,...z(u)})}function dD(r,i,v){return new r({type:"intersection",left:i,right:v})}function hD(r,i,v,u){let n=v instanceof W;return new r({type:"tuple",items:i,rest:n?v:null,...z(n?u:v)})}function pD(r,i,v,u){return new r({type:"record",keyType:i,valueType:v,...z(u)})}function aD(r,i,v,u){return new r({type:"map",keyType:i,valueType:v,...z(u)})}function sD(r,i,v){return new r({type:"set",valueType:i,...z(v)})}function rw(r,i,v){let u=Array.isArray(i)?Object.fromEntries(i.map((n)=>[n,n])):i;return new r({type:"enum",entries:u,...z(v)})}function nw(r,i,v){return new r({type:"enum",entries:i,...z(v)})}function iw(r,i,v){return new r({type:"literal",values:Array.isArray(i)?i:[i],...z(v)})}function Ql(r,i){return new r({type:"file",...z(i)})}function vw(r,i){return new r({type:"transform",transform:i})}function $w(r,i){return new r({type:"optional",innerType:i})}function uw(r,i){return new r({type:"nullable",innerType:i})}function tw(r,i,v){return new r({type:"default",innerType:i,get defaultValue(){return typeof v==="function"?v():eu(v)}})}function gw(r,i,v){return new r({type:"nonoptional",innerType:i,...z(v)})}function ow(r,i){return new r({type:"success",innerType:i})}function lw(r,i,v){return new r({type:"catch",innerType:i,catchValue:typeof v==="function"?v:()=>v})}function bw(r,i,v){return new r({type:"pipe",in:i,out:v})}function _w(r,i){return new r({type:"readonly",innerType:i})}function Iw(r,i,v){return new r({type:"template_literal",parts:i,...z(v)})}function Uw(r,i){return new r({type:"lazy",getter:i})}function Dw(r,i){return new r({type:"promise",innerType:i})}function Bl(r,i,v){let u=z(v);return u.abort??(u.abort=!0),new r({type:"custom",check:"custom",fn:i,...u})}function Fl(r,i,v){return new r({type:"custom",check:"custom",fn:i,...z(v)})}function Hl(r){let i=tI((v)=>{return v.addIssue=(u)=>{if(typeof u==="string")v.issues.push(zn(u,v.value,i._zod.def));else{let n=u;if(n.fatal)n.continue=!1;n.code??(n.code="custom"),n.input??(n.input=v.value),n.inst??(n.inst=i),n.continue??(n.continue=!i._zod.def.abort),v.issues.push(zn(n))}},r(v.value,v)});return i}function tI(r,i){let v=new m({check:"custom",...z(i)});return v._zod.check=r,v}function El(r){let i=new m({check:"describe"});return i._zod.onattach=[(v)=>{let u=f.get(v)??{};f.add(v,{...u,description:r})}],i._zod.check=()=>{},i}function Tl(r){let i=new m({check:"meta"});return i._zod.onattach=[(v)=>{let u=f.get(v)??{};f.add(v,{...u,...r})}],i._zod.check=()=>{},i}function Ml(r,i){let v=z(i),u=v.truthy??["true","1","yes","on","y","enabled"],n=v.falsy??["false","0","no","off","n","disabled"];if(v.case!=="sensitive")u=u.map((P)=>typeof P==="string"?P.toLowerCase():P),n=n.map((P)=>typeof P==="string"?P.toLowerCase():P);let $=new Set(u),t=new Set(n),g=r.Codec??Di,b=r.Boolean??Ii,_=new(r.String??hr)({type:"string",error:v.error}),w=new b({type:"boolean",error:v.error}),N=new g({type:"pipe",in:_,out:w,transform:(P,K)=>{let q=P;if(v.case!=="sensitive")q=q.toLowerCase();if($.has(q))return!0;else if(t.has(q))return!1;else return K.issues.push({code:"invalid_value",expected:"stringbool",values:[...$,...t],input:K.value,inst:N,continue:!1}),{}},reverseTransform:(P,K)=>{if(P===!0)return u[0]||"true";else return n[0]||"false"},error:v.error});return N}function Kn(r,i,v,u={}){let n=z(u),$={...z(u),check:"string_format",type:"string",format:i,fn:typeof v==="function"?v:(g)=>v.test(g),...n};if(v instanceof RegExp)$.pattern=v;return new r($)}var O$;var gI=S(()=>{Mv();zi();vo();j();O$={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function xr(r){let i=r?.target??"draft-2020-12";if(i==="draft-4")i="draft-04";if(i==="draft-7")i="draft-07";return{processors:r.processors??{},metadataRegistry:r?.metadata??f,target:i,unrepresentable:r?.unrepresentable??"throw",override:r?.override??(()=>{}),io:r?.io??"output",counter:0,seen:new Map,cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0}}function B(r,i,v={path:[],schemaPath:[]}){var u;let n=r._zod.def,$=i.seen.get(r);if($){if($.count++,v.schemaPath.includes(r))$.cycle=v.path;return $.schema}let t={schema:{},count:1,cycle:void 0,path:v.path};i.seen.set(r,t);let g=r._zod.toJSONSchema?.();if(g)t.schema=g;else{let _={...v,schemaPath:[...v.schemaPath,r],path:v.path};if(r._zod.processJSONSchema)r._zod.processJSONSchema(i,t.schema,_);else{let N=t.schema,P=i.processors[n.type];if(!P)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);P(r,i,N,_)}let w=r._zod.parent;if(w){if(!t.ref)t.ref=w;B(w,i,_),i.seen.get(w).isParent=!0}}let b=i.metadataRegistry.get(r);if(b)Object.assign(t.schema,b);if(i.io==="input"&&$r(r))delete t.schema.examples,delete t.schema.default;if(i.io==="input"&&t.schema._prefault)(u=t.schema).default??(u.default=t.schema._prefault);return delete t.schema._prefault,i.seen.get(r).schema}function Zr(r,i){let v=r.seen.get(i);if(!v)throw Error("Unprocessed schema. This is a bug in Zod.");let u=new Map;for(let t of r.seen.entries()){let g=r.metadataRegistry.get(t[0])?.id;if(g){let b=u.get(g);if(b&&b!==t[0])throw Error(`Duplicate schema id "${g}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);u.set(g,t[0])}}let n=(t)=>{let g=r.target==="draft-2020-12"?"$defs":"definitions";if(r.external){let w=r.external.registry.get(t[0])?.id,N=r.external.uri??((K)=>K);if(w)return{ref:N(w)};let P=t[1].defId??t[1].schema.id??`schema${r.counter++}`;return t[1].defId=P,{defId:P,ref:`${N("__shared")}#/${g}/${P}`}}if(t[1]===v)return{ref:"#"};let o=`${"#"}/${g}/`,_=t[1].schema.id??`__schema${r.counter++}`;return{defId:_,ref:o+_}},$=(t)=>{if(t[1].schema.$ref)return;let g=t[1],{ref:b,defId:o}=n(t);if(g.def={...g.schema},o)g.defId=o;let _=g.schema;for(let w in _)delete _[w];_.$ref=b};if(r.cycles==="throw")for(let t of r.seen.entries()){let g=t[1];if(g.cycle)throw Error(`Cycle detected: #/${g.cycle?.join("/")}/ + +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let t of r.seen.entries()){let g=t[1];if(i===t[0]){$(t);continue}if(r.external){let o=r.external.registry.get(t[0])?.id;if(i!==t[0]&&o){$(t);continue}}if(r.metadataRegistry.get(t[0])?.id){$(t);continue}if(g.cycle){$(t);continue}if(g.count>1){if(r.reused==="ref"){$(t);continue}}}}function mr(r,i){let v=r.seen.get(i);if(!v)throw Error("Unprocessed schema. This is a bug in Zod.");let u=(t)=>{let g=r.seen.get(t);if(g.ref===null)return;let b=g.def??g.schema,o={...b},_=g.ref;if(g.ref=null,_){u(_);let N=r.seen.get(_),P=N.schema;if(P.$ref&&(r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"))b.allOf=b.allOf??[],b.allOf.push(P);else Object.assign(b,P);if(Object.assign(b,o),t._zod.parent===_)for(let q in b){if(q==="$ref"||q==="allOf")continue;if(!(q in o))delete b[q]}if(P.$ref)for(let q in b){if(q==="$ref"||q==="allOf")continue;if(q in N.def&&JSON.stringify(b[q])===JSON.stringify(N.def[q]))delete b[q]}}let w=t._zod.parent;if(w&&w!==_){u(w);let N=r.seen.get(w);if(N?.schema.$ref){if(b.$ref=N.schema.$ref,N.def)for(let P in b){if(P==="$ref"||P==="allOf")continue;if(P in N.def&&JSON.stringify(b[P])===JSON.stringify(N.def[P]))delete b[P]}}}r.override({zodSchema:t,jsonSchema:b,path:g.path??[]})};for(let t of[...r.seen.entries()].reverse())u(t[0]);let n={};if(r.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(r.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(r.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(r.target==="openapi-3.0");if(r.external?.uri){let t=r.external.registry.get(i)?.id;if(!t)throw Error("Schema is missing an `id` property");n.$id=r.external.uri(t)}Object.assign(n,v.def??v.schema);let $=r.external?.defs??{};for(let t of r.seen.entries()){let g=t[1];if(g.def&&g.defId)$[g.defId]=g.def}if(r.external);else if(Object.keys($).length>0)if(r.target==="draft-2020-12")n.$defs=$;else n.definitions=$;try{let t=JSON.parse(JSON.stringify(n));return Object.defineProperty(t,"~standard",{value:{...i["~standard"],jsonSchema:{input:Yn(i,"input",r.processors),output:Yn(i,"output",r.processors)}},enumerable:!1,writable:!1}),t}catch(t){throw Error("Error converting schema to JSON.")}}function $r(r,i){let v=i??{seen:new Set};if(v.seen.has(r))return!1;v.seen.add(r);let u=r._zod.def;if(u.type==="transform")return!0;if(u.type==="array")return $r(u.element,v);if(u.type==="set")return $r(u.valueType,v);if(u.type==="lazy")return $r(u.getter(),v);if(u.type==="promise"||u.type==="optional"||u.type==="nonoptional"||u.type==="nullable"||u.type==="readonly"||u.type==="default"||u.type==="prefault")return $r(u.innerType,v);if(u.type==="intersection")return $r(u.left,v)||$r(u.right,v);if(u.type==="record"||u.type==="map")return $r(u.keyType,v)||$r(u.valueType,v);if(u.type==="pipe")return $r(u.in,v)||$r(u.out,v);if(u.type==="object"){for(let n in u.shape)if($r(u.shape[n],v))return!0;return!1}if(u.type==="union"){for(let n of u.options)if($r(n,v))return!0;return!1}if(u.type==="tuple"){for(let n of u.items)if($r(n,v))return!0;if(u.rest&&$r(u.rest,v))return!0;return!1}return!1}var ql=(r,i={})=>(v)=>{let u=xr({...v,processors:i});return B(r,u),Zr(u,r),mr(u,r)},Yn=(r,i,v={})=>(u)=>{let{libraryOptions:n,target:$}=u??{},t=xr({...n??{},target:$,io:i,processors:v});return B(r,t),Zr(t,r),mr(t,r)};var Xi=S(()=>{zi()});function Gi(r,i){if("_idmap"in r){let u=r,n=xr({...i,processors:c$}),$={};for(let b of u._idmap.entries()){let[o,_]=b;B(_,n)}let t={},g={registry:u,uri:i?.uri,defs:$};n.external=g;for(let b of u._idmap.entries()){let[o,_]=b;Zr(n,_),t[o]=mr(n,_)}if(Object.keys($).length>0){let b=n.target==="draft-2020-12"?"$defs":"definitions";t.__shared={[b]:$}}return{schemas:t}}let v=xr({...i,processors:c$});return B(r,v),Zr(v,r),mr(v,r)}var ww,xl=(r,i,v,u)=>{let n=v;n.type="string";let{minimum:$,maximum:t,format:g,patterns:b,contentEncoding:o}=r._zod.bag;if(typeof $==="number")n.minLength=$;if(typeof t==="number")n.maxLength=t;if(g){if(n.format=ww[g]??g,n.format==="")delete n.format;if(g==="time")delete n.format}if(o)n.contentEncoding=o;if(b&&b.size>0){let _=[...b];if(_.length===1)n.pattern=_[0].source;else if(_.length>1)n.allOf=[..._.map((w)=>({...i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0"?{type:"string"}:{},pattern:w.source}))]}},Zl=(r,i,v,u)=>{let n=v,{minimum:$,maximum:t,format:g,multipleOf:b,exclusiveMaximum:o,exclusiveMinimum:_}=r._zod.bag;if(typeof g==="string"&&g.includes("int"))n.type="integer";else n.type="number";if(typeof _==="number")if(i.target==="draft-04"||i.target==="openapi-3.0")n.minimum=_,n.exclusiveMinimum=!0;else n.exclusiveMinimum=_;if(typeof $==="number"){if(n.minimum=$,typeof _==="number"&&i.target!=="draft-04")if(_>=$)delete n.minimum;else delete n.exclusiveMinimum}if(typeof o==="number")if(i.target==="draft-04"||i.target==="openapi-3.0")n.maximum=o,n.exclusiveMaximum=!0;else n.exclusiveMaximum=o;if(typeof t==="number"){if(n.maximum=t,typeof o==="number"&&i.target!=="draft-04")if(o<=t)delete n.maximum;else delete n.exclusiveMaximum}if(typeof b==="number")n.multipleOf=b},ml=(r,i,v,u)=>{v.type="boolean"},Rl=(r,i,v,u)=>{if(i.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},Cl=(r,i,v,u)=>{if(i.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},el=(r,i,v,u)=>{if(i.target==="openapi-3.0")v.type="string",v.nullable=!0,v.enum=[null];else v.type="null"},yl=(r,i,v,u)=>{if(i.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},fl=(r,i,v,u)=>{if(i.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},dl=(r,i,v,u)=>{v.not={}},hl=(r,i,v,u)=>{},pl=(r,i,v,u)=>{},al=(r,i,v,u)=>{if(i.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},sl=(r,i,v,u)=>{let n=r._zod.def,$=ri(n.entries);if($.every((t)=>typeof t==="number"))v.type="number";if($.every((t)=>typeof t==="string"))v.type="string";v.enum=$},r6=(r,i,v,u)=>{let n=r._zod.def,$=[];for(let t of n.values)if(t===void 0){if(i.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof t==="bigint")if(i.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else $.push(Number(t));else $.push(t);if($.length===0);else if($.length===1){let t=$[0];if(v.type=t===null?"null":typeof t,i.target==="draft-04"||i.target==="openapi-3.0")v.enum=[t];else v.const=t}else{if($.every((t)=>typeof t==="number"))v.type="number";if($.every((t)=>typeof t==="string"))v.type="string";if($.every((t)=>typeof t==="boolean"))v.type="boolean";if($.every((t)=>t===null))v.type="null";v.enum=$}},n6=(r,i,v,u)=>{if(i.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},i6=(r,i,v,u)=>{let n=v,$=r._zod.pattern;if(!$)throw Error("Pattern not found in template literal");n.type="string",n.pattern=$.source},v6=(r,i,v,u)=>{let n=v,$={type:"string",format:"binary",contentEncoding:"binary"},{minimum:t,maximum:g,mime:b}=r._zod.bag;if(t!==void 0)$.minLength=t;if(g!==void 0)$.maxLength=g;if(b)if(b.length===1)$.contentMediaType=b[0],Object.assign(n,$);else Object.assign(n,$),n.anyOf=b.map((o)=>({contentMediaType:o}));else Object.assign(n,$)},$6=(r,i,v,u)=>{v.type="boolean"},u6=(r,i,v,u)=>{if(i.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},t6=(r,i,v,u)=>{if(i.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},g6=(r,i,v,u)=>{if(i.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},o6=(r,i,v,u)=>{if(i.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},l6=(r,i,v,u)=>{if(i.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},b6=(r,i,v,u)=>{let n=v,$=r._zod.def,{minimum:t,maximum:g}=r._zod.bag;if(typeof t==="number")n.minItems=t;if(typeof g==="number")n.maxItems=g;n.type="array",n.items=B($.element,i,{...u,path:[...u.path,"items"]})},_6=(r,i,v,u)=>{let n=v,$=r._zod.def;n.type="object",n.properties={};let t=$.shape;for(let o in t)n.properties[o]=B(t[o],i,{...u,path:[...u.path,"properties",o]});let g=new Set(Object.keys(t)),b=new Set([...g].filter((o)=>{let _=$.shape[o]._zod;if(i.io==="input")return _.optin===void 0;else return _.optout===void 0}));if(b.size>0)n.required=Array.from(b);if($.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!$.catchall){if(i.io==="output")n.additionalProperties=!1}else if($.catchall)n.additionalProperties=B($.catchall,i,{...u,path:[...u.path,"additionalProperties"]})},z$=(r,i,v,u)=>{let n=r._zod.def,$=n.inclusive===!1,t=n.options.map((g,b)=>B(g,i,{...u,path:[...u.path,$?"oneOf":"anyOf",b]}));if($)v.oneOf=t;else v.anyOf=t},I6=(r,i,v,u)=>{let n=r._zod.def,$=B(n.left,i,{...u,path:[...u.path,"allOf",0]}),t=B(n.right,i,{...u,path:[...u.path,"allOf",1]}),g=(o)=>("allOf"in o)&&Object.keys(o).length===1,b=[...g($)?$.allOf:[$],...g(t)?t.allOf:[t]];v.allOf=b},U6=(r,i,v,u)=>{let n=v,$=r._zod.def;n.type="array";let t=i.target==="draft-2020-12"?"prefixItems":"items",g=i.target==="draft-2020-12"?"items":i.target==="openapi-3.0"?"items":"additionalItems",b=$.items.map((N,P)=>B(N,i,{...u,path:[...u.path,t,P]})),o=$.rest?B($.rest,i,{...u,path:[...u.path,g,...i.target==="openapi-3.0"?[$.items.length]:[]]}):null;if(i.target==="draft-2020-12"){if(n.prefixItems=b,o)n.items=o}else if(i.target==="openapi-3.0"){if(n.items={anyOf:b},o)n.items.anyOf.push(o);if(n.minItems=b.length,!o)n.maxItems=b.length}else if(n.items=b,o)n.additionalItems=o;let{minimum:_,maximum:w}=r._zod.bag;if(typeof _==="number")n.minItems=_;if(typeof w==="number")n.maxItems=w},D6=(r,i,v,u)=>{let n=v,$=r._zod.def;n.type="object";let t=$.keyType,b=t._zod.bag?.patterns;if($.mode==="loose"&&b&&b.size>0){let _=B($.valueType,i,{...u,path:[...u.path,"patternProperties","*"]});n.patternProperties={};for(let w of b)n.patternProperties[w.source]=_}else{if(i.target==="draft-07"||i.target==="draft-2020-12")n.propertyNames=B($.keyType,i,{...u,path:[...u.path,"propertyNames"]});n.additionalProperties=B($.valueType,i,{...u,path:[...u.path,"additionalProperties"]})}let o=t._zod.values;if(o){let _=[...o].filter((w)=>typeof w==="string"||typeof w==="number");if(_.length>0)n.required=_}},w6=(r,i,v,u)=>{let n=r._zod.def,$=B(n.innerType,i,u),t=i.seen.get(r);if(i.target==="openapi-3.0")t.ref=n.innerType,v.nullable=!0;else v.anyOf=[$,{type:"null"}]},N6=(r,i,v,u)=>{let n=r._zod.def;B(n.innerType,i,u);let $=i.seen.get(r);$.ref=n.innerType},k6=(r,i,v,u)=>{let n=r._zod.def;B(n.innerType,i,u);let $=i.seen.get(r);$.ref=n.innerType,v.default=JSON.parse(JSON.stringify(n.defaultValue))},O6=(r,i,v,u)=>{let n=r._zod.def;B(n.innerType,i,u);let $=i.seen.get(r);if($.ref=n.innerType,i.io==="input")v._prefault=JSON.parse(JSON.stringify(n.defaultValue))},c6=(r,i,v,u)=>{let n=r._zod.def;B(n.innerType,i,u);let $=i.seen.get(r);$.ref=n.innerType;let t;try{t=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}v.default=t},z6=(r,i,v,u)=>{let n=r._zod.def,$=i.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;B($,i,u);let t=i.seen.get(r);t.ref=$},P6=(r,i,v,u)=>{let n=r._zod.def;B(n.innerType,i,u);let $=i.seen.get(r);$.ref=n.innerType,v.readOnly=!0},S6=(r,i,v,u)=>{let n=r._zod.def;B(n.innerType,i,u);let $=i.seen.get(r);$.ref=n.innerType},P$=(r,i,v,u)=>{let n=r._zod.def;B(n.innerType,i,u);let $=i.seen.get(r);$.ref=n.innerType},J6=(r,i,v,u)=>{let n=r._zod.innerType;B(n,i,u);let $=i.seen.get(r);$.ref=n},c$;var Vi=S(()=>{Xi();j();ww={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},c$={string:xl,number:Zl,boolean:ml,bigint:Rl,symbol:Cl,null:el,undefined:yl,void:fl,never:dl,any:hl,unknown:pl,date:al,enum:sl,literal:r6,nan:n6,template_literal:i6,file:v6,success:$6,custom:u6,function:t6,transform:g6,map:o6,set:l6,array:b6,object:_6,union:z$,intersection:I6,tuple:U6,record:D6,nullable:w6,nonoptional:N6,default:k6,prefault:O6,catch:c6,pipe:z6,readonly:P6,promise:S6,optional:P$,lazy:J6}});class L6{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(r){this.ctx.counter=r}get seen(){return this.ctx.seen}constructor(r){let i=r?.target??"draft-2020-12";if(i==="draft-4")i="draft-04";if(i==="draft-7")i="draft-07";this.ctx=xr({processors:c$,target:i,...r?.metadata&&{metadata:r.metadata},...r?.unrepresentable&&{unrepresentable:r.unrepresentable},...r?.override&&{override:r.override},...r?.io&&{io:r.io}})}process(r,i={path:[],schemaPath:[]}){return B(r,this.ctx,i)}emit(r,i){if(i){if(i.cycles)this.ctx.cycles=i.cycles;if(i.reused)this.ctx.reused=i.reused;if(i.external)this.ctx.external=i.external}Zr(this.ctx,r);let v=mr(this.ctx,r),{"~standard":u,...n}=v;return n}}var oI=S(()=>{Vi();Xi()});var lI={};var bI=()=>{};var Wr={};Lr(Wr,{version:()=>Ct,util:()=>c,treeifyError:()=>Av,toJSONSchema:()=>Gi,toDotPath:()=>Yb,safeParseAsync:()=>oi,safeParse:()=>jn,safeEncodeAsync:()=>Mb,safeEncode:()=>Eb,safeDecodeAsync:()=>qb,safeDecode:()=>Tb,registry:()=>ci,regexes:()=>Ur,process:()=>B,prettifyError:()=>jv,parseAsync:()=>gi,parse:()=>ti,meta:()=>Tl,locales:()=>Vn,isValidJWT:()=>u_,isValidBase64URL:()=>$_,isValidBase64:()=>Dg,initializeContext:()=>xr,globalRegistry:()=>f,globalConfig:()=>an,formatError:()=>Sn,flattenError:()=>Pn,finalize:()=>mr,extractDefs:()=>Zr,encodeAsync:()=>Fb,encode:()=>Qb,describe:()=>El,decodeAsync:()=>Hb,decode:()=>Bb,createToJSONSchemaMethod:()=>ql,createStandardJSONSchemaMethod:()=>Yn,config:()=>R,clone:()=>rr,_xor:()=>yD,_xid:()=>o$,_void:()=>Xl,_uuidv7:()=>i$,_uuidv6:()=>n$,_uuidv4:()=>r$,_uuid:()=>sv,_url:()=>Si,_uppercase:()=>sr,_unknown:()=>jl,_union:()=>eD,_undefined:()=>Jl,_ulid:()=>g$,_uint64:()=>Pl,_uint32:()=>wl,_tuple:()=>hD,_trim:()=>tn,_transform:()=>vw,_toUpperCase:()=>on,_toLowerCase:()=>gn,_templateLiteral:()=>Iw,_symbol:()=>Sl,_superRefine:()=>Hl,_success:()=>ow,_stringbool:()=>Ml,_stringFormat:()=>Kn,_string:()=>il,_startsWith:()=>nn,_slugify:()=>ln,_size:()=>Tr,_set:()=>sD,_safeParseAsync:()=>Wn,_safeParse:()=>An,_safeEncodeAsync:()=>Qv,_safeEncode:()=>Kv,_safeDecodeAsync:()=>Bv,_safeDecode:()=>Yv,_regex:()=>pr,_refine:()=>Fl,_record:()=>pD,_readonly:()=>_w,_property:()=>Wi,_promise:()=>Dw,_positive:()=>Ji,_pipe:()=>bw,_parseAsync:()=>Ln,_parse:()=>Jn,_overwrite:()=>Nr,_optional:()=>$w,_number:()=>ll,_nullable:()=>uw,_null:()=>Ll,_normalize:()=>un,_nonpositive:()=>Ai,_nonoptional:()=>gw,_nonnegative:()=>ji,_never:()=>Wl,_negative:()=>Li,_nativeEnum:()=>nw,_nanoid:()=>$$,_nan:()=>Kl,_multipleOf:()=>Vr,_minSize:()=>Sr,_minLength:()=>jr,_min:()=>nr,_mime:()=>$n,_maxSize:()=>Kr,_maxLength:()=>Mr,_max:()=>lr,_map:()=>aD,_mac:()=>$l,_lte:()=>lr,_lt:()=>zr,_lowercase:()=>ar,_literal:()=>iw,_length:()=>qr,_lazy:()=>Uw,_ksuid:()=>l$,_jwt:()=>k$,_isoTime:()=>gl,_isoDuration:()=>ol,_isoDateTime:()=>ul,_isoDate:()=>tl,_ipv6:()=>_$,_ipv4:()=>b$,_intersection:()=>dD,_int64:()=>zl,_int32:()=>Dl,_int:()=>_l,_includes:()=>rn,_guid:()=>Pi,_gte:()=>nr,_gt:()=>Pr,_float64:()=>Ul,_float32:()=>Il,_file:()=>Ql,_enum:()=>rw,_endsWith:()=>vn,_encodeAsync:()=>Gv,_encode:()=>Wv,_emoji:()=>v$,_email:()=>av,_e164:()=>N$,_discriminatedUnion:()=>fD,_default:()=>tw,_decodeAsync:()=>Vv,_decode:()=>Xv,_date:()=>Gl,_custom:()=>Bl,_cuid2:()=>t$,_cuid:()=>u$,_coercedString:()=>vl,_coercedNumber:()=>bl,_coercedDate:()=>Vl,_coercedBoolean:()=>kl,_coercedBigint:()=>cl,_cidrv6:()=>U$,_cidrv4:()=>I$,_check:()=>tI,_catch:()=>lw,_boolean:()=>Nl,_bigint:()=>Ol,_base64url:()=>w$,_base64:()=>D$,_array:()=>Yl,_any:()=>Al,TimePrecision:()=>O$,NEVER:()=>Pv,JSONSchemaGenerator:()=>L6,JSONSchema:()=>lI,Doc:()=>qv,$output:()=>hv,$input:()=>pv,$constructor:()=>I,$brand:()=>Sv,$ZodXor:()=>Yg,$ZodXID:()=>vg,$ZodVoid:()=>Xg,$ZodUnknown:()=>jg,$ZodUnion:()=>Ui,$ZodUndefined:()=>Jg,$ZodUUID:()=>dt,$ZodURL:()=>pt,$ZodULID:()=>ig,$ZodType:()=>W,$ZodTuple:()=>fv,$ZodTransform:()=>xg,$ZodTemplateLiteral:()=>ag,$ZodSymbol:()=>Sg,$ZodSuccess:()=>yg,$ZodStringFormat:()=>x,$ZodString:()=>hr,$ZodSet:()=>Eg,$ZodRegistry:()=>nl,$ZodRecord:()=>Fg,$ZodRealError:()=>or,$ZodReadonly:()=>pg,$ZodPromise:()=>ro,$ZodPrefault:()=>Cg,$ZodPipe:()=>hg,$ZodOptional:()=>dv,$ZodObjectJIT:()=>Kg,$ZodObject:()=>o_,$ZodNumberFormat:()=>zg,$ZodNumber:()=>ev,$ZodNullable:()=>mg,$ZodNull:()=>Lg,$ZodNonOptional:()=>eg,$ZodNever:()=>Wg,$ZodNanoID:()=>st,$ZodNaN:()=>dg,$ZodMap:()=>Hg,$ZodMAC:()=>_g,$ZodLiteral:()=>Mg,$ZodLazy:()=>no,$ZodKSUID:()=>$g,$ZodJWT:()=>Og,$ZodIntersection:()=>Bg,$ZodISOTime:()=>gg,$ZodISODuration:()=>og,$ZodISODateTime:()=>ug,$ZodISODate:()=>tg,$ZodIPv6:()=>bg,$ZodIPv4:()=>lg,$ZodGUID:()=>ft,$ZodFunction:()=>sg,$ZodFile:()=>qg,$ZodExactOptional:()=>Zg,$ZodError:()=>ui,$ZodEnum:()=>Tg,$ZodEncodeError:()=>yr,$ZodEmoji:()=>at,$ZodEmail:()=>ht,$ZodE164:()=>kg,$ZodDiscriminatedUnion:()=>Qg,$ZodDefault:()=>Rg,$ZodDate:()=>Gg,$ZodCustomStringFormat:()=>cg,$ZodCustom:()=>io,$ZodCodec:()=>Di,$ZodCheckUpperCase:()=>Tt,$ZodCheckStringFormat:()=>Xn,$ZodCheckStartsWith:()=>qt,$ZodCheckSizeEquals:()=>Yt,$ZodCheckRegex:()=>Ht,$ZodCheckProperty:()=>Zt,$ZodCheckOverwrite:()=>Rt,$ZodCheckNumberFormat:()=>Xt,$ZodCheckMultipleOf:()=>Wt,$ZodCheckMinSize:()=>Kt,$ZodCheckMinLength:()=>Bt,$ZodCheckMimeType:()=>mt,$ZodCheckMaxSize:()=>Vt,$ZodCheckMaxLength:()=>Qt,$ZodCheckLowerCase:()=>Et,$ZodCheckLessThan:()=>Ev,$ZodCheckLengthEquals:()=>Ft,$ZodCheckIncludes:()=>Mt,$ZodCheckGreaterThan:()=>Tv,$ZodCheckEndsWith:()=>xt,$ZodCheckBigIntFormat:()=>Gt,$ZodCheck:()=>m,$ZodCatch:()=>fg,$ZodCUID2:()=>ng,$ZodCUID:()=>rg,$ZodCIDRv6:()=>Ug,$ZodCIDRv4:()=>Ig,$ZodBoolean:()=>Ii,$ZodBigIntFormat:()=>Pg,$ZodBigInt:()=>yv,$ZodBase64URL:()=>Ng,$ZodBase64:()=>wg,$ZodAsyncError:()=>Ar,$ZodArray:()=>Vg,$ZodAny:()=>Ag});var br=S(()=>{j();Hv();rl();Vi();oI();bI();kn();au();pu();vo();Mv();et();zi();gI();Xi()});var L$={};Lr(L$,{uppercase:()=>sr,trim:()=>tn,toUpperCase:()=>on,toLowerCase:()=>gn,startsWith:()=>nn,slugify:()=>ln,size:()=>Tr,regex:()=>pr,property:()=>Wi,positive:()=>Ji,overwrite:()=>Nr,normalize:()=>un,nonpositive:()=>Ai,nonnegative:()=>ji,negative:()=>Li,multipleOf:()=>Vr,minSize:()=>Sr,minLength:()=>jr,mime:()=>$n,maxSize:()=>Kr,maxLength:()=>Mr,lte:()=>lr,lt:()=>zr,lowercase:()=>ar,length:()=>qr,includes:()=>rn,gte:()=>nr,gt:()=>Pr,endsWith:()=>vn});var A$=S(()=>{br()});var Yr={};Lr(Yr,{time:()=>W6,duration:()=>X6,datetime:()=>A6,date:()=>j6,ZodISOTime:()=>Qi,ZodISODuration:()=>Bi,ZodISODateTime:()=>Ki,ZodISODate:()=>Yi});function A6(r){return ul(Ki,r)}function j6(r){return tl(Yi,r)}function W6(r){return gl(Qi,r)}function X6(r){return ol(Bi,r)}var Ki,Yi,Qi,Bi;var Fi=S(()=>{br();Ei();Ki=I("ZodISODateTime",(r,i)=>{ug.init(r,i),E.init(r,i)});Yi=I("ZodISODate",(r,i)=>{tg.init(r,i),E.init(r,i)});Qi=I("ZodISOTime",(r,i)=>{gg.init(r,i),E.init(r,i)});Bi=I("ZodISODuration",(r,i)=>{og.init(r,i),E.init(r,i)})});var UI=(r,i)=>{ui.init(r,i),r.name="ZodError",Object.defineProperties(r,{format:{value:(v)=>Sn(r,v)},flatten:{value:(v)=>Pn(r,v)},addIssue:{value:(v)=>{r.issues.push(v),r.message=JSON.stringify(r.issues,On,2)}},addIssues:{value:(v)=>{r.issues.push(...v),r.message=JSON.stringify(r.issues,On,2)}},isEmpty:{get(){return r.issues.length===0}}})},DI,ur;var G6=S(()=>{br();br();j();DI=I("ZodError",UI),ur=I("ZodError",UI,{Parent:Error})});var j$,W$,X$,G$,V$,K$,Y$,Q$,B$,F$,H$,E$;var V6=S(()=>{br();G6();j$=Jn(ur),W$=Ln(ur),X$=An(ur),G$=Wn(ur),V$=Wv(ur),K$=Xv(ur),Y$=Gv(ur),Q$=Vv(ur),B$=Kv(ur),F$=Yv(ur),H$=Qv(ur),E$=Bv(ur)});var Hi={};Lr(Hi,{xor:()=>c4,xid:()=>R6,void:()=>w4,uuidv7:()=>H6,uuidv6:()=>F6,uuidv4:()=>B6,uuid:()=>Q6,url:()=>E6,unknown:()=>T,union:()=>M,undefined:()=>U4,ulid:()=>m6,uint64:()=>_4,uint32:()=>o4,tuple:()=>p$,transform:()=>$v,templateLiteral:()=>V4,symbol:()=>I4,superRefine:()=>Ju,success:()=>W4,stringbool:()=>E4,stringFormat:()=>n4,string:()=>D,strictObject:()=>O4,set:()=>J4,refine:()=>Su,record:()=>F,readonly:()=>Nu,promise:()=>K4,preprocess:()=>Rn,prefault:()=>lu,pipe:()=>Fn,partialRecord:()=>z4,optional:()=>Z,object:()=>L,number:()=>Y,nullish:()=>j4,nullable:()=>Bn,null:()=>En,nonoptional:()=>bu,never:()=>vv,nativeEnum:()=>L4,nanoid:()=>q6,nan:()=>X4,meta:()=>F4,map:()=>S4,mac:()=>y6,looseRecord:()=>P4,looseObject:()=>d,literal:()=>A,lazy:()=>cu,ksuid:()=>C6,keyof:()=>k4,jwt:()=>r4,json:()=>T4,ipv6:()=>f6,ipv4:()=>e6,intersection:()=>Nn,int64:()=>b4,int32:()=>g4,int:()=>Ti,instanceof:()=>H4,httpUrl:()=>T6,hostname:()=>i4,hex:()=>v4,hash:()=>$4,guid:()=>Y6,function:()=>Y4,float64:()=>t4,float32:()=>u4,file:()=>A4,exactOptional:()=>$u,enum:()=>h,emoji:()=>M6,email:()=>K6,e164:()=>s6,discriminatedUnion:()=>xn,describe:()=>B4,date:()=>N4,custom:()=>lv,cuid2:()=>Z6,cuid:()=>x6,codec:()=>G4,cidrv6:()=>h6,cidrv4:()=>d6,check:()=>Q4,catch:()=>Uu,boolean:()=>C,bigint:()=>l4,base64url:()=>a6,base64:()=>p6,array:()=>V,any:()=>D4,_function:()=>Y4,_default:()=>gu,_ZodString:()=>Mi,ZodXor:()=>y$,ZodXID:()=>ei,ZodVoid:()=>C$,ZodUnknown:()=>m$,ZodUnion:()=>qn,ZodUndefined:()=>q$,ZodUUID:()=>Jr,ZodURL:()=>Hn,ZodULID:()=>Ci,ZodType:()=>X,ZodTuple:()=>h$,ZodTransform:()=>iu,ZodTemplateLiteral:()=>ku,ZodSymbol:()=>M$,ZodSuccess:()=>_u,ZodStringFormat:()=>E,ZodString:()=>_n,ZodSet:()=>s$,ZodRecord:()=>Zn,ZodReadonly:()=>wu,ZodPromise:()=>zu,ZodPrefault:()=>ou,ZodPipe:()=>gv,ZodOptional:()=>uv,ZodObject:()=>Mn,ZodNumberFormat:()=>Rr,ZodNumber:()=>Un,ZodNullable:()=>uu,ZodNull:()=>x$,ZodNonOptional:()=>tv,ZodNever:()=>R$,ZodNanoID:()=>Zi,ZodNaN:()=>Du,ZodMap:()=>a$,ZodMAC:()=>T$,ZodLiteral:()=>ru,ZodLazy:()=>Ou,ZodKSUID:()=>yi,ZodJWT:()=>nv,ZodIntersection:()=>d$,ZodIPv6:()=>di,ZodIPv4:()=>fi,ZodGUID:()=>Qn,ZodFunction:()=>Pu,ZodFile:()=>nu,ZodExactOptional:()=>vu,ZodEnum:()=>bn,ZodEmoji:()=>xi,ZodEmail:()=>qi,ZodE164:()=>rv,ZodDiscriminatedUnion:()=>f$,ZodDefault:()=>tu,ZodDate:()=>Tn,ZodCustomStringFormat:()=>In,ZodCustom:()=>mn,ZodCodec:()=>ov,ZodCatch:()=>Iu,ZodCUID2:()=>Ri,ZodCUID:()=>mi,ZodCIDRv6:()=>pi,ZodCIDRv4:()=>hi,ZodBoolean:()=>Dn,ZodBigIntFormat:()=>iv,ZodBigInt:()=>wn,ZodBase64URL:()=>si,ZodBase64:()=>ai,ZodArray:()=>e$,ZodAny:()=>Z$});function D(r){return il(_n,r)}function K6(r){return av(qi,r)}function Y6(r){return Pi(Qn,r)}function Q6(r){return sv(Jr,r)}function B6(r){return r$(Jr,r)}function F6(r){return n$(Jr,r)}function H6(r){return i$(Jr,r)}function E6(r){return Si(Hn,r)}function T6(r){return Si(Hn,{protocol:/^https?$/,hostname:Ur.domain,...c.normalizeParams(r)})}function M6(r){return v$(xi,r)}function q6(r){return $$(Zi,r)}function x6(r){return u$(mi,r)}function Z6(r){return t$(Ri,r)}function m6(r){return g$(Ci,r)}function R6(r){return o$(ei,r)}function C6(r){return l$(yi,r)}function e6(r){return b$(fi,r)}function y6(r){return $l(T$,r)}function f6(r){return _$(di,r)}function d6(r){return I$(hi,r)}function h6(r){return U$(pi,r)}function p6(r){return D$(ai,r)}function a6(r){return w$(si,r)}function s6(r){return N$(rv,r)}function r4(r){return k$(nv,r)}function n4(r,i,v={}){return Kn(In,r,i,v)}function i4(r){return Kn(In,"hostname",Ur.hostname,r)}function v4(r){return Kn(In,"hex",Ur.hex,r)}function $4(r,i){let v=i?.enc??"hex",u=`${r}_${v}`,n=Ur[u];if(!n)throw Error(`Unrecognized hash format: ${u}`);return Kn(In,u,n,i)}function Y(r){return ll(Un,r)}function Ti(r){return _l(Rr,r)}function u4(r){return Il(Rr,r)}function t4(r){return Ul(Rr,r)}function g4(r){return Dl(Rr,r)}function o4(r){return wl(Rr,r)}function C(r){return Nl(Dn,r)}function l4(r){return Ol(wn,r)}function b4(r){return zl(iv,r)}function _4(r){return Pl(iv,r)}function I4(r){return Sl(M$,r)}function U4(r){return Jl(q$,r)}function En(r){return Ll(x$,r)}function D4(){return Al(Z$)}function T(){return jl(m$)}function vv(r){return Wl(R$,r)}function w4(r){return Xl(C$,r)}function N4(r){return Gl(Tn,r)}function V(r,i){return Yl(e$,r,i)}function k4(r){let i=r._zod.def.shape;return h(Object.keys(i))}function L(r,i){let v={type:"object",shape:r??{},...c.normalizeParams(i)};return new Mn(v)}function O4(r,i){return new Mn({type:"object",shape:r,catchall:vv(),...c.normalizeParams(i)})}function d(r,i){return new Mn({type:"object",shape:r,catchall:T(),...c.normalizeParams(i)})}function M(r,i){return new qn({type:"union",options:r,...c.normalizeParams(i)})}function c4(r,i){return new y$({type:"union",options:r,inclusive:!1,...c.normalizeParams(i)})}function xn(r,i,v){return new f$({type:"union",options:i,discriminator:r,...c.normalizeParams(v)})}function Nn(r,i){return new d$({type:"intersection",left:r,right:i})}function p$(r,i,v){let u=i instanceof W,n=u?v:i;return new h$({type:"tuple",items:r,rest:u?i:null,...c.normalizeParams(n)})}function F(r,i,v){return new Zn({type:"record",keyType:r,valueType:i,...c.normalizeParams(v)})}function z4(r,i,v){let u=rr(r);return u._zod.values=void 0,new Zn({type:"record",keyType:u,valueType:i,...c.normalizeParams(v)})}function P4(r,i,v){return new Zn({type:"record",keyType:r,valueType:i,mode:"loose",...c.normalizeParams(v)})}function S4(r,i,v){return new a$({type:"map",keyType:r,valueType:i,...c.normalizeParams(v)})}function J4(r,i){return new s$({type:"set",valueType:r,...c.normalizeParams(i)})}function h(r,i){let v=Array.isArray(r)?Object.fromEntries(r.map((u)=>[u,u])):r;return new bn({type:"enum",entries:v,...c.normalizeParams(i)})}function L4(r,i){return new bn({type:"enum",entries:r,...c.normalizeParams(i)})}function A(r,i){return new ru({type:"literal",values:Array.isArray(r)?r:[r],...c.normalizeParams(i)})}function A4(r){return Ql(nu,r)}function $v(r){return new iu({type:"transform",transform:r})}function Z(r){return new uv({type:"optional",innerType:r})}function $u(r){return new vu({type:"optional",innerType:r})}function Bn(r){return new uu({type:"nullable",innerType:r})}function j4(r){return Z(Bn(r))}function gu(r,i){return new tu({type:"default",innerType:r,get defaultValue(){return typeof i==="function"?i():c.shallowClone(i)}})}function lu(r,i){return new ou({type:"prefault",innerType:r,get defaultValue(){return typeof i==="function"?i():c.shallowClone(i)}})}function bu(r,i){return new tv({type:"nonoptional",innerType:r,...c.normalizeParams(i)})}function W4(r){return new _u({type:"success",innerType:r})}function Uu(r,i){return new Iu({type:"catch",innerType:r,catchValue:typeof i==="function"?i:()=>i})}function X4(r){return Kl(Du,r)}function Fn(r,i){return new gv({type:"pipe",in:r,out:i})}function G4(r,i,v){return new ov({type:"pipe",in:r,out:i,transform:v.decode,reverseTransform:v.encode})}function Nu(r){return new wu({type:"readonly",innerType:r})}function V4(r,i){return new ku({type:"template_literal",parts:r,...c.normalizeParams(i)})}function cu(r){return new Ou({type:"lazy",getter:r})}function K4(r){return new zu({type:"promise",innerType:r})}function Y4(r){return new Pu({type:"function",input:Array.isArray(r?.input)?p$(r?.input):r?.input??V(T()),output:r?.output??T()})}function Q4(r){let i=new m({check:"custom"});return i._zod.check=r,i}function lv(r,i){return Bl(mn,r??(()=>!0),i)}function Su(r,i={}){return Fl(mn,r,i)}function Ju(r){return Hl(r)}function H4(r,i={}){let v=new mn({type:"custom",check:"custom",fn:(u)=>u instanceof r,abort:!0,...c.normalizeParams(i)});return v._zod.bag.Class=r,v._zod.check=(u)=>{if(!(u.value instanceof r))u.issues.push({code:"invalid_type",expected:r.name,input:u.value,inst:v,path:[...v._zod.def.path??[]]})},v}function T4(r){let i=cu(()=>{return M([D(r),Y(),C(),En(),V(i),F(D(),i)])});return i}function Rn(r,i){return Fn($v(r),i)}var X,Mi,_n,E,qi,Qn,Jr,Hn,xi,Zi,mi,Ri,Ci,ei,yi,fi,T$,di,hi,pi,ai,si,rv,nv,In,Un,Rr,Dn,wn,iv,M$,q$,x$,Z$,m$,R$,C$,Tn,e$,Mn,qn,y$,f$,d$,h$,Zn,a$,s$,bn,ru,nu,iu,uv,vu,uu,tu,ou,tv,_u,Iu,Du,gv,ov,wu,ku,Ou,zu,Pu,mn,B4,F4,E4=(...r)=>Ml({Codec:ov,Boolean:Dn,String:_n},...r);var Ei=S(()=>{br();br();Vi();Xi();A$();Fi();V6();X=I("ZodType",(r,i)=>{return W.init(r,i),Object.assign(r["~standard"],{jsonSchema:{input:Yn(r,"input"),output:Yn(r,"output")}}),r.toJSONSchema=ql(r,{}),r.def=i,r.type=i.type,Object.defineProperty(r,"_def",{value:i}),r.check=(...v)=>{return r.clone(c.mergeDefs(i,{checks:[...i.checks??[],...v.map((u)=>typeof u==="function"?{_zod:{check:u,def:{check:"custom"},onattach:[]}}:u)]}),{parent:!0})},r.with=r.check,r.clone=(v,u)=>rr(r,v,u),r.brand=()=>r,r.register=(v,u)=>{return v.add(r,u),r},r.parse=(v,u)=>j$(r,v,u,{callee:r.parse}),r.safeParse=(v,u)=>X$(r,v,u),r.parseAsync=async(v,u)=>W$(r,v,u,{callee:r.parseAsync}),r.safeParseAsync=async(v,u)=>G$(r,v,u),r.spa=r.safeParseAsync,r.encode=(v,u)=>V$(r,v,u),r.decode=(v,u)=>K$(r,v,u),r.encodeAsync=async(v,u)=>Y$(r,v,u),r.decodeAsync=async(v,u)=>Q$(r,v,u),r.safeEncode=(v,u)=>B$(r,v,u),r.safeDecode=(v,u)=>F$(r,v,u),r.safeEncodeAsync=async(v,u)=>H$(r,v,u),r.safeDecodeAsync=async(v,u)=>E$(r,v,u),r.refine=(v,u)=>r.check(Su(v,u)),r.superRefine=(v)=>r.check(Ju(v)),r.overwrite=(v)=>r.check(Nr(v)),r.optional=()=>Z(r),r.exactOptional=()=>$u(r),r.nullable=()=>Bn(r),r.nullish=()=>Z(Bn(r)),r.nonoptional=(v)=>bu(r,v),r.array=()=>V(r),r.or=(v)=>M([r,v]),r.and=(v)=>Nn(r,v),r.transform=(v)=>Fn(r,$v(v)),r.default=(v)=>gu(r,v),r.prefault=(v)=>lu(r,v),r.catch=(v)=>Uu(r,v),r.pipe=(v)=>Fn(r,v),r.readonly=()=>Nu(r),r.describe=(v)=>{let u=r.clone();return f.add(u,{description:v}),u},Object.defineProperty(r,"description",{get(){return f.get(r)?.description},configurable:!0}),r.meta=(...v)=>{if(v.length===0)return f.get(r);let u=r.clone();return f.add(u,v[0]),u},r.isOptional=()=>r.safeParse(void 0).success,r.isNullable=()=>r.safeParse(null).success,r.apply=(v)=>v(r),r}),Mi=I("_ZodString",(r,i)=>{hr.init(r,i),X.init(r,i),r._zod.processJSONSchema=(u,n,$)=>xl(r,u,n,$);let v=r._zod.bag;r.format=v.format??null,r.minLength=v.minimum??null,r.maxLength=v.maximum??null,r.regex=(...u)=>r.check(pr(...u)),r.includes=(...u)=>r.check(rn(...u)),r.startsWith=(...u)=>r.check(nn(...u)),r.endsWith=(...u)=>r.check(vn(...u)),r.min=(...u)=>r.check(jr(...u)),r.max=(...u)=>r.check(Mr(...u)),r.length=(...u)=>r.check(qr(...u)),r.nonempty=(...u)=>r.check(jr(1,...u)),r.lowercase=(u)=>r.check(ar(u)),r.uppercase=(u)=>r.check(sr(u)),r.trim=()=>r.check(tn()),r.normalize=(...u)=>r.check(un(...u)),r.toLowerCase=()=>r.check(gn()),r.toUpperCase=()=>r.check(on()),r.slugify=()=>r.check(ln())}),_n=I("ZodString",(r,i)=>{hr.init(r,i),Mi.init(r,i),r.email=(v)=>r.check(av(qi,v)),r.url=(v)=>r.check(Si(Hn,v)),r.jwt=(v)=>r.check(k$(nv,v)),r.emoji=(v)=>r.check(v$(xi,v)),r.guid=(v)=>r.check(Pi(Qn,v)),r.uuid=(v)=>r.check(sv(Jr,v)),r.uuidv4=(v)=>r.check(r$(Jr,v)),r.uuidv6=(v)=>r.check(n$(Jr,v)),r.uuidv7=(v)=>r.check(i$(Jr,v)),r.nanoid=(v)=>r.check($$(Zi,v)),r.guid=(v)=>r.check(Pi(Qn,v)),r.cuid=(v)=>r.check(u$(mi,v)),r.cuid2=(v)=>r.check(t$(Ri,v)),r.ulid=(v)=>r.check(g$(Ci,v)),r.base64=(v)=>r.check(D$(ai,v)),r.base64url=(v)=>r.check(w$(si,v)),r.xid=(v)=>r.check(o$(ei,v)),r.ksuid=(v)=>r.check(l$(yi,v)),r.ipv4=(v)=>r.check(b$(fi,v)),r.ipv6=(v)=>r.check(_$(di,v)),r.cidrv4=(v)=>r.check(I$(hi,v)),r.cidrv6=(v)=>r.check(U$(pi,v)),r.e164=(v)=>r.check(N$(rv,v)),r.datetime=(v)=>r.check(A6(v)),r.date=(v)=>r.check(j6(v)),r.time=(v)=>r.check(W6(v)),r.duration=(v)=>r.check(X6(v))});E=I("ZodStringFormat",(r,i)=>{x.init(r,i),Mi.init(r,i)}),qi=I("ZodEmail",(r,i)=>{ht.init(r,i),E.init(r,i)});Qn=I("ZodGUID",(r,i)=>{ft.init(r,i),E.init(r,i)});Jr=I("ZodUUID",(r,i)=>{dt.init(r,i),E.init(r,i)});Hn=I("ZodURL",(r,i)=>{pt.init(r,i),E.init(r,i)});xi=I("ZodEmoji",(r,i)=>{at.init(r,i),E.init(r,i)});Zi=I("ZodNanoID",(r,i)=>{st.init(r,i),E.init(r,i)});mi=I("ZodCUID",(r,i)=>{rg.init(r,i),E.init(r,i)});Ri=I("ZodCUID2",(r,i)=>{ng.init(r,i),E.init(r,i)});Ci=I("ZodULID",(r,i)=>{ig.init(r,i),E.init(r,i)});ei=I("ZodXID",(r,i)=>{vg.init(r,i),E.init(r,i)});yi=I("ZodKSUID",(r,i)=>{$g.init(r,i),E.init(r,i)});fi=I("ZodIPv4",(r,i)=>{lg.init(r,i),E.init(r,i)});T$=I("ZodMAC",(r,i)=>{_g.init(r,i),E.init(r,i)});di=I("ZodIPv6",(r,i)=>{bg.init(r,i),E.init(r,i)});hi=I("ZodCIDRv4",(r,i)=>{Ig.init(r,i),E.init(r,i)});pi=I("ZodCIDRv6",(r,i)=>{Ug.init(r,i),E.init(r,i)});ai=I("ZodBase64",(r,i)=>{wg.init(r,i),E.init(r,i)});si=I("ZodBase64URL",(r,i)=>{Ng.init(r,i),E.init(r,i)});rv=I("ZodE164",(r,i)=>{kg.init(r,i),E.init(r,i)});nv=I("ZodJWT",(r,i)=>{Og.init(r,i),E.init(r,i)});In=I("ZodCustomStringFormat",(r,i)=>{cg.init(r,i),E.init(r,i)});Un=I("ZodNumber",(r,i)=>{ev.init(r,i),X.init(r,i),r._zod.processJSONSchema=(u,n,$)=>Zl(r,u,n,$),r.gt=(u,n)=>r.check(Pr(u,n)),r.gte=(u,n)=>r.check(nr(u,n)),r.min=(u,n)=>r.check(nr(u,n)),r.lt=(u,n)=>r.check(zr(u,n)),r.lte=(u,n)=>r.check(lr(u,n)),r.max=(u,n)=>r.check(lr(u,n)),r.int=(u)=>r.check(Ti(u)),r.safe=(u)=>r.check(Ti(u)),r.positive=(u)=>r.check(Pr(0,u)),r.nonnegative=(u)=>r.check(nr(0,u)),r.negative=(u)=>r.check(zr(0,u)),r.nonpositive=(u)=>r.check(lr(0,u)),r.multipleOf=(u,n)=>r.check(Vr(u,n)),r.step=(u,n)=>r.check(Vr(u,n)),r.finite=()=>r;let v=r._zod.bag;r.minValue=Math.max(v.minimum??Number.NEGATIVE_INFINITY,v.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,r.maxValue=Math.min(v.maximum??Number.POSITIVE_INFINITY,v.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,r.isInt=(v.format??"").includes("int")||Number.isSafeInteger(v.multipleOf??0.5),r.isFinite=!0,r.format=v.format??null});Rr=I("ZodNumberFormat",(r,i)=>{zg.init(r,i),Un.init(r,i)});Dn=I("ZodBoolean",(r,i)=>{Ii.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>ml(r,v,u,n)});wn=I("ZodBigInt",(r,i)=>{yv.init(r,i),X.init(r,i),r._zod.processJSONSchema=(u,n,$)=>Rl(r,u,n,$),r.gte=(u,n)=>r.check(nr(u,n)),r.min=(u,n)=>r.check(nr(u,n)),r.gt=(u,n)=>r.check(Pr(u,n)),r.gte=(u,n)=>r.check(nr(u,n)),r.min=(u,n)=>r.check(nr(u,n)),r.lt=(u,n)=>r.check(zr(u,n)),r.lte=(u,n)=>r.check(lr(u,n)),r.max=(u,n)=>r.check(lr(u,n)),r.positive=(u)=>r.check(Pr(BigInt(0),u)),r.negative=(u)=>r.check(zr(BigInt(0),u)),r.nonpositive=(u)=>r.check(lr(BigInt(0),u)),r.nonnegative=(u)=>r.check(nr(BigInt(0),u)),r.multipleOf=(u,n)=>r.check(Vr(u,n));let v=r._zod.bag;r.minValue=v.minimum??null,r.maxValue=v.maximum??null,r.format=v.format??null});iv=I("ZodBigIntFormat",(r,i)=>{Pg.init(r,i),wn.init(r,i)});M$=I("ZodSymbol",(r,i)=>{Sg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>Cl(r,v,u,n)});q$=I("ZodUndefined",(r,i)=>{Jg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>yl(r,v,u,n)});x$=I("ZodNull",(r,i)=>{Lg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>el(r,v,u,n)});Z$=I("ZodAny",(r,i)=>{Ag.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>hl(r,v,u,n)});m$=I("ZodUnknown",(r,i)=>{jg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>pl(r,v,u,n)});R$=I("ZodNever",(r,i)=>{Wg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>dl(r,v,u,n)});C$=I("ZodVoid",(r,i)=>{Xg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>fl(r,v,u,n)});Tn=I("ZodDate",(r,i)=>{Gg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(u,n,$)=>al(r,u,n,$),r.min=(u,n)=>r.check(nr(u,n)),r.max=(u,n)=>r.check(lr(u,n));let v=r._zod.bag;r.minDate=v.minimum?new Date(v.minimum):null,r.maxDate=v.maximum?new Date(v.maximum):null});e$=I("ZodArray",(r,i)=>{Vg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>b6(r,v,u,n),r.element=i.element,r.min=(v,u)=>r.check(jr(v,u)),r.nonempty=(v)=>r.check(jr(1,v)),r.max=(v,u)=>r.check(Mr(v,u)),r.length=(v,u)=>r.check(qr(v,u)),r.unwrap=()=>r.element});Mn=I("ZodObject",(r,i)=>{Kg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>_6(r,v,u,n),c.defineLazy(r,"shape",()=>{return i.shape}),r.keyof=()=>h(Object.keys(r._zod.def.shape)),r.catchall=(v)=>r.clone({...r._zod.def,catchall:v}),r.passthrough=()=>r.clone({...r._zod.def,catchall:T()}),r.loose=()=>r.clone({...r._zod.def,catchall:T()}),r.strict=()=>r.clone({...r._zod.def,catchall:vv()}),r.strip=()=>r.clone({...r._zod.def,catchall:void 0}),r.extend=(v)=>{return c.extend(r,v)},r.safeExtend=(v)=>{return c.safeExtend(r,v)},r.merge=(v)=>c.merge(r,v),r.pick=(v)=>c.pick(r,v),r.omit=(v)=>c.omit(r,v),r.partial=(...v)=>c.partial(uv,r,v[0]),r.required=(...v)=>c.required(tv,r,v[0])});qn=I("ZodUnion",(r,i)=>{Ui.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>z$(r,v,u,n),r.options=i.options});y$=I("ZodXor",(r,i)=>{qn.init(r,i),Yg.init(r,i),r._zod.processJSONSchema=(v,u,n)=>z$(r,v,u,n),r.options=i.options});f$=I("ZodDiscriminatedUnion",(r,i)=>{qn.init(r,i),Qg.init(r,i)});d$=I("ZodIntersection",(r,i)=>{Bg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>I6(r,v,u,n)});h$=I("ZodTuple",(r,i)=>{fv.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>U6(r,v,u,n),r.rest=(v)=>r.clone({...r._zod.def,rest:v})});Zn=I("ZodRecord",(r,i)=>{Fg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>D6(r,v,u,n),r.keyType=i.keyType,r.valueType=i.valueType});a$=I("ZodMap",(r,i)=>{Hg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>o6(r,v,u,n),r.keyType=i.keyType,r.valueType=i.valueType,r.min=(...v)=>r.check(Sr(...v)),r.nonempty=(v)=>r.check(Sr(1,v)),r.max=(...v)=>r.check(Kr(...v)),r.size=(...v)=>r.check(Tr(...v))});s$=I("ZodSet",(r,i)=>{Eg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>l6(r,v,u,n),r.min=(...v)=>r.check(Sr(...v)),r.nonempty=(v)=>r.check(Sr(1,v)),r.max=(...v)=>r.check(Kr(...v)),r.size=(...v)=>r.check(Tr(...v))});bn=I("ZodEnum",(r,i)=>{Tg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(u,n,$)=>sl(r,u,n,$),r.enum=i.entries,r.options=Object.values(i.entries);let v=new Set(Object.keys(i.entries));r.extract=(u,n)=>{let $={};for(let t of u)if(v.has(t))$[t]=i.entries[t];else throw Error(`Key ${t} not found in enum`);return new bn({...i,checks:[],...c.normalizeParams(n),entries:$})},r.exclude=(u,n)=>{let $={...i.entries};for(let t of u)if(v.has(t))delete $[t];else throw Error(`Key ${t} not found in enum`);return new bn({...i,checks:[],...c.normalizeParams(n),entries:$})}});ru=I("ZodLiteral",(r,i)=>{Mg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>r6(r,v,u,n),r.values=new Set(i.values),Object.defineProperty(r,"value",{get(){if(i.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return i.values[0]}})});nu=I("ZodFile",(r,i)=>{qg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>v6(r,v,u,n),r.min=(v,u)=>r.check(Sr(v,u)),r.max=(v,u)=>r.check(Kr(v,u)),r.mime=(v,u)=>r.check($n(Array.isArray(v)?v:[v],u))});iu=I("ZodTransform",(r,i)=>{xg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>g6(r,v,u,n),r._zod.parse=(v,u)=>{if(u.direction==="backward")throw new yr(r.constructor.name);v.addIssue=($)=>{if(typeof $==="string")v.issues.push(c.issue($,v.value,i));else{let t=$;if(t.fatal)t.continue=!1;t.code??(t.code="custom"),t.input??(t.input=v.value),t.inst??(t.inst=r),v.issues.push(c.issue(t))}};let n=i.transform(v.value,v);if(n instanceof Promise)return n.then(($)=>{return v.value=$,v});return v.value=n,v}});uv=I("ZodOptional",(r,i)=>{dv.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>P$(r,v,u,n),r.unwrap=()=>r._zod.def.innerType});vu=I("ZodExactOptional",(r,i)=>{Zg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>P$(r,v,u,n),r.unwrap=()=>r._zod.def.innerType});uu=I("ZodNullable",(r,i)=>{mg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>w6(r,v,u,n),r.unwrap=()=>r._zod.def.innerType});tu=I("ZodDefault",(r,i)=>{Rg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>k6(r,v,u,n),r.unwrap=()=>r._zod.def.innerType,r.removeDefault=r.unwrap});ou=I("ZodPrefault",(r,i)=>{Cg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>O6(r,v,u,n),r.unwrap=()=>r._zod.def.innerType});tv=I("ZodNonOptional",(r,i)=>{eg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>N6(r,v,u,n),r.unwrap=()=>r._zod.def.innerType});_u=I("ZodSuccess",(r,i)=>{yg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>$6(r,v,u,n),r.unwrap=()=>r._zod.def.innerType});Iu=I("ZodCatch",(r,i)=>{fg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>c6(r,v,u,n),r.unwrap=()=>r._zod.def.innerType,r.removeCatch=r.unwrap});Du=I("ZodNaN",(r,i)=>{dg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>n6(r,v,u,n)});gv=I("ZodPipe",(r,i)=>{hg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>z6(r,v,u,n),r.in=i.in,r.out=i.out});ov=I("ZodCodec",(r,i)=>{gv.init(r,i),Di.init(r,i)});wu=I("ZodReadonly",(r,i)=>{pg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>P6(r,v,u,n),r.unwrap=()=>r._zod.def.innerType});ku=I("ZodTemplateLiteral",(r,i)=>{ag.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>i6(r,v,u,n)});Ou=I("ZodLazy",(r,i)=>{no.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>J6(r,v,u,n),r.unwrap=()=>r._zod.def.getter()});zu=I("ZodPromise",(r,i)=>{ro.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>S6(r,v,u,n),r.unwrap=()=>r._zod.def.innerType});Pu=I("ZodFunction",(r,i)=>{sg.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>t6(r,v,u,n)});mn=I("ZodCustom",(r,i)=>{io.init(r,i),X.init(r,i),r._zod.processJSONSchema=(v,u,n)=>u6(r,v,u,n)});B4=El,F4=Tl});function NI(r){R({customError:r})}function kI(){return R().customError}var wI,Lu;var OI=S(()=>{br();wI={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};(function(r){})(Lu||(Lu={}))});function cw(r,i){let v=r.$schema;if(v==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(v==="http://json-schema.org/draft-07/schema#")return"draft-7";if(v==="http://json-schema.org/draft-04/schema#")return"draft-4";return i??"draft-2020-12"}function zw(r,i){if(!r.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let v=r.slice(1).split("/").filter(Boolean);if(v.length===0)return i.rootSchema;let u=i.version==="draft-2020-12"?"$defs":"definitions";if(v[0]===u){let n=v[1];if(!n||!i.defs[n])throw Error(`Reference not found: ${r}`);return i.defs[n]}throw Error(`Reference not found: ${r}`)}function cI(r,i){if(r.not!==void 0){if(typeof r.not==="object"&&Object.keys(r.not).length===0)return J.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(r.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(r.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(r.if!==void 0||r.then!==void 0||r.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(r.dependentSchemas!==void 0||r.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(r.$ref){let n=r.$ref;if(i.refs.has(n))return i.refs.get(n);if(i.processing.has(n))return J.lazy(()=>{if(!i.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return i.refs.get(n)});i.processing.add(n);let $=zw(n,i),t=ir($,i);return i.refs.set(n,t),i.processing.delete(n),t}if(r.enum!==void 0){let n=r.enum;if(i.version==="openapi-3.0"&&r.nullable===!0&&n.length===1&&n[0]===null)return J.null();if(n.length===0)return J.never();if(n.length===1)return J.literal(n[0]);if(n.every((t)=>typeof t==="string"))return J.enum(n);let $=n.map((t)=>J.literal(t));if($.length<2)return $[0];return J.union([$[0],$[1],...$.slice(2)])}if(r.const!==void 0)return J.literal(r.const);let v=r.type;if(Array.isArray(v)){let n=v.map(($)=>{let t={...r,type:$};return cI(t,i)});if(n.length===0)return J.never();if(n.length===1)return n[0];return J.union(n)}if(!v)return J.any();let u;switch(v){case"string":{let n=J.string();if(r.format){let $=r.format;if($==="email")n=n.check(J.email());else if($==="uri"||$==="uri-reference")n=n.check(J.url());else if($==="uuid"||$==="guid")n=n.check(J.uuid());else if($==="date-time")n=n.check(J.iso.datetime());else if($==="date")n=n.check(J.iso.date());else if($==="time")n=n.check(J.iso.time());else if($==="duration")n=n.check(J.iso.duration());else if($==="ipv4")n=n.check(J.ipv4());else if($==="ipv6")n=n.check(J.ipv6());else if($==="mac")n=n.check(J.mac());else if($==="cidr")n=n.check(J.cidrv4());else if($==="cidr-v6")n=n.check(J.cidrv6());else if($==="base64")n=n.check(J.base64());else if($==="base64url")n=n.check(J.base64url());else if($==="e164")n=n.check(J.e164());else if($==="jwt")n=n.check(J.jwt());else if($==="emoji")n=n.check(J.emoji());else if($==="nanoid")n=n.check(J.nanoid());else if($==="cuid")n=n.check(J.cuid());else if($==="cuid2")n=n.check(J.cuid2());else if($==="ulid")n=n.check(J.ulid());else if($==="xid")n=n.check(J.xid());else if($==="ksuid")n=n.check(J.ksuid())}if(typeof r.minLength==="number")n=n.min(r.minLength);if(typeof r.maxLength==="number")n=n.max(r.maxLength);if(r.pattern)n=n.regex(new RegExp(r.pattern));u=n;break}case"number":case"integer":{let n=v==="integer"?J.number().int():J.number();if(typeof r.minimum==="number")n=n.min(r.minimum);if(typeof r.maximum==="number")n=n.max(r.maximum);if(typeof r.exclusiveMinimum==="number")n=n.gt(r.exclusiveMinimum);else if(r.exclusiveMinimum===!0&&typeof r.minimum==="number")n=n.gt(r.minimum);if(typeof r.exclusiveMaximum==="number")n=n.lt(r.exclusiveMaximum);else if(r.exclusiveMaximum===!0&&typeof r.maximum==="number")n=n.lt(r.maximum);if(typeof r.multipleOf==="number")n=n.multipleOf(r.multipleOf);u=n;break}case"boolean":{u=J.boolean();break}case"null":{u=J.null();break}case"object":{let n={},$=r.properties||{},t=new Set(r.required||[]);for(let[b,o]of Object.entries($)){let _=ir(o,i);n[b]=t.has(b)?_:_.optional()}if(r.propertyNames){let b=ir(r.propertyNames,i),o=r.additionalProperties&&typeof r.additionalProperties==="object"?ir(r.additionalProperties,i):J.any();if(Object.keys(n).length===0){u=J.record(b,o);break}let _=J.object(n).passthrough(),w=J.looseRecord(b,o);u=J.intersection(_,w);break}if(r.patternProperties){let b=r.patternProperties,o=Object.keys(b),_=[];for(let N of o){let P=ir(b[N],i),K=J.string().regex(new RegExp(N));_.push(J.looseRecord(K,P))}let w=[];if(Object.keys(n).length>0)w.push(J.object(n).passthrough());if(w.push(..._),w.length===0)u=J.object({}).passthrough();else if(w.length===1)u=w[0];else{let N=J.intersection(w[0],w[1]);for(let P=2;Pir(b,i)),g=$&&typeof $==="object"&&!Array.isArray($)?ir($,i):void 0;if(g)u=J.tuple(t).rest(g);else u=J.tuple(t);if(typeof r.minItems==="number")u=u.check(J.minLength(r.minItems));if(typeof r.maxItems==="number")u=u.check(J.maxLength(r.maxItems))}else if(Array.isArray($)){let t=$.map((b)=>ir(b,i)),g=r.additionalItems&&typeof r.additionalItems==="object"?ir(r.additionalItems,i):void 0;if(g)u=J.tuple(t).rest(g);else u=J.tuple(t);if(typeof r.minItems==="number")u=u.check(J.minLength(r.minItems));if(typeof r.maxItems==="number")u=u.check(J.maxLength(r.maxItems))}else if($!==void 0){let t=ir($,i),g=J.array(t);if(typeof r.minItems==="number")g=g.min(r.minItems);if(typeof r.maxItems==="number")g=g.max(r.maxItems);u=g}else u=J.array(J.any());break}default:throw Error(`Unsupported type: ${v}`)}if(r.description)u=u.describe(r.description);if(r.default!==void 0)u=u.default(r.default);return u}function ir(r,i){if(typeof r==="boolean")return r?J.any():J.never();let v=cI(r,i),u=r.type||r.enum!==void 0||r.const!==void 0;if(r.anyOf&&Array.isArray(r.anyOf)){let g=r.anyOf.map((o)=>ir(o,i)),b=J.union(g);v=u?J.intersection(v,b):b}if(r.oneOf&&Array.isArray(r.oneOf)){let g=r.oneOf.map((o)=>ir(o,i)),b=J.xor(g);v=u?J.intersection(v,b):b}if(r.allOf&&Array.isArray(r.allOf))if(r.allOf.length===0)v=u?v:J.any();else{let g=u?v:ir(r.allOf[0],i),b=u?0:1;for(let o=b;o0)i.registry.add(v,n);return v}function M4(r,i){if(typeof r==="boolean")return r?J.any():J.never();let v=cw(r,i?.defaultTarget),u=r.$defs||r.definitions||{},n={version:v,defs:u,refs:new Map,processing:new Set,rootSchema:r,registry:i?.registry??f};return ir(r,n)}var J,Ow;var zI=S(()=>{zi();A$();Fi();Ei();J={...Hi,...L$,iso:Yr},Ow=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var Au={};Lr(Au,{string:()=>Pw,number:()=>Sw,date:()=>Aw,boolean:()=>Jw,bigint:()=>Lw});function Pw(r){return vl(_n,r)}function Sw(r){return bl(Un,r)}function Jw(r){return kl(Dn,r)}function Lw(r){return cl(wn,r)}function Aw(r){return Vl(Tn,r)}var PI=S(()=>{br();Ei()});var l={};Lr(l,{xor:()=>c4,xid:()=>R6,void:()=>w4,uuidv7:()=>H6,uuidv6:()=>F6,uuidv4:()=>B6,uuid:()=>Q6,util:()=>c,url:()=>E6,uppercase:()=>sr,unknown:()=>T,union:()=>M,undefined:()=>U4,ulid:()=>m6,uint64:()=>_4,uint32:()=>o4,tuple:()=>p$,trim:()=>tn,treeifyError:()=>Av,transform:()=>$v,toUpperCase:()=>on,toLowerCase:()=>gn,toJSONSchema:()=>Gi,templateLiteral:()=>V4,symbol:()=>I4,superRefine:()=>Ju,success:()=>W4,stringbool:()=>E4,stringFormat:()=>n4,string:()=>D,strictObject:()=>O4,startsWith:()=>nn,slugify:()=>ln,size:()=>Tr,setErrorMap:()=>NI,set:()=>J4,safeParseAsync:()=>G$,safeParse:()=>X$,safeEncodeAsync:()=>H$,safeEncode:()=>B$,safeDecodeAsync:()=>E$,safeDecode:()=>F$,registry:()=>ci,regexes:()=>Ur,regex:()=>pr,refine:()=>Su,record:()=>F,readonly:()=>Nu,property:()=>Wi,promise:()=>K4,prettifyError:()=>jv,preprocess:()=>Rn,prefault:()=>lu,positive:()=>Ji,pipe:()=>Fn,partialRecord:()=>z4,parseAsync:()=>W$,parse:()=>j$,overwrite:()=>Nr,optional:()=>Z,object:()=>L,number:()=>Y,nullish:()=>j4,nullable:()=>Bn,null:()=>En,normalize:()=>un,nonpositive:()=>Ai,nonoptional:()=>bu,nonnegative:()=>ji,never:()=>vv,negative:()=>Li,nativeEnum:()=>L4,nanoid:()=>q6,nan:()=>X4,multipleOf:()=>Vr,minSize:()=>Sr,minLength:()=>jr,mime:()=>$n,meta:()=>F4,maxSize:()=>Kr,maxLength:()=>Mr,map:()=>S4,mac:()=>y6,lte:()=>lr,lt:()=>zr,lowercase:()=>ar,looseRecord:()=>P4,looseObject:()=>d,locales:()=>Vn,literal:()=>A,length:()=>qr,lazy:()=>cu,ksuid:()=>C6,keyof:()=>k4,jwt:()=>r4,json:()=>T4,iso:()=>Yr,ipv6:()=>f6,ipv4:()=>e6,intersection:()=>Nn,int64:()=>b4,int32:()=>g4,int:()=>Ti,instanceof:()=>H4,includes:()=>rn,httpUrl:()=>T6,hostname:()=>i4,hex:()=>v4,hash:()=>$4,guid:()=>Y6,gte:()=>nr,gt:()=>Pr,globalRegistry:()=>f,getErrorMap:()=>kI,function:()=>Y4,fromJSONSchema:()=>M4,formatError:()=>Sn,float64:()=>t4,float32:()=>u4,flattenError:()=>Pn,file:()=>A4,exactOptional:()=>$u,enum:()=>h,endsWith:()=>vn,encodeAsync:()=>Y$,encode:()=>V$,emoji:()=>M6,email:()=>K6,e164:()=>s6,discriminatedUnion:()=>xn,describe:()=>B4,decodeAsync:()=>Q$,decode:()=>K$,date:()=>N4,custom:()=>lv,cuid2:()=>Z6,cuid:()=>x6,core:()=>Wr,config:()=>R,coerce:()=>Au,codec:()=>G4,clone:()=>rr,cidrv6:()=>h6,cidrv4:()=>d6,check:()=>Q4,catch:()=>Uu,boolean:()=>C,bigint:()=>l4,base64url:()=>a6,base64:()=>p6,array:()=>V,any:()=>D4,_function:()=>Y4,_default:()=>gu,_ZodString:()=>Mi,ZodXor:()=>y$,ZodXID:()=>ei,ZodVoid:()=>C$,ZodUnknown:()=>m$,ZodUnion:()=>qn,ZodUndefined:()=>q$,ZodUUID:()=>Jr,ZodURL:()=>Hn,ZodULID:()=>Ci,ZodType:()=>X,ZodTuple:()=>h$,ZodTransform:()=>iu,ZodTemplateLiteral:()=>ku,ZodSymbol:()=>M$,ZodSuccess:()=>_u,ZodStringFormat:()=>E,ZodString:()=>_n,ZodSet:()=>s$,ZodRecord:()=>Zn,ZodRealError:()=>ur,ZodReadonly:()=>wu,ZodPromise:()=>zu,ZodPrefault:()=>ou,ZodPipe:()=>gv,ZodOptional:()=>uv,ZodObject:()=>Mn,ZodNumberFormat:()=>Rr,ZodNumber:()=>Un,ZodNullable:()=>uu,ZodNull:()=>x$,ZodNonOptional:()=>tv,ZodNever:()=>R$,ZodNanoID:()=>Zi,ZodNaN:()=>Du,ZodMap:()=>a$,ZodMAC:()=>T$,ZodLiteral:()=>ru,ZodLazy:()=>Ou,ZodKSUID:()=>yi,ZodJWT:()=>nv,ZodIssueCode:()=>wI,ZodIntersection:()=>d$,ZodISOTime:()=>Qi,ZodISODuration:()=>Bi,ZodISODateTime:()=>Ki,ZodISODate:()=>Yi,ZodIPv6:()=>di,ZodIPv4:()=>fi,ZodGUID:()=>Qn,ZodFunction:()=>Pu,ZodFirstPartyTypeKind:()=>Lu,ZodFile:()=>nu,ZodExactOptional:()=>vu,ZodError:()=>DI,ZodEnum:()=>bn,ZodEmoji:()=>xi,ZodEmail:()=>qi,ZodE164:()=>rv,ZodDiscriminatedUnion:()=>f$,ZodDefault:()=>tu,ZodDate:()=>Tn,ZodCustomStringFormat:()=>In,ZodCustom:()=>mn,ZodCodec:()=>ov,ZodCatch:()=>Iu,ZodCUID2:()=>Ri,ZodCUID:()=>mi,ZodCIDRv6:()=>pi,ZodCIDRv4:()=>hi,ZodBoolean:()=>Dn,ZodBigIntFormat:()=>iv,ZodBigInt:()=>wn,ZodBase64URL:()=>si,ZodBase64:()=>ai,ZodArray:()=>e$,ZodAny:()=>Z$,TimePrecision:()=>O$,NEVER:()=>Pv,$output:()=>hv,$input:()=>pv,$brand:()=>Sv});var q4=S(()=>{br();br();Io();br();Vi();zI();rl();Fi();Fi();PI();Ei();A$();G6();V6();OI();R(wi())});var SI;var x4=S(()=>{q4();q4();SI=l});var Z4={};Lr(Z4,{z:()=>l,xor:()=>c4,xid:()=>R6,void:()=>w4,uuidv7:()=>H6,uuidv6:()=>F6,uuidv4:()=>B6,uuid:()=>Q6,util:()=>c,url:()=>E6,uppercase:()=>sr,unknown:()=>T,union:()=>M,undefined:()=>U4,ulid:()=>m6,uint64:()=>_4,uint32:()=>o4,tuple:()=>p$,trim:()=>tn,treeifyError:()=>Av,transform:()=>$v,toUpperCase:()=>on,toLowerCase:()=>gn,toJSONSchema:()=>Gi,templateLiteral:()=>V4,symbol:()=>I4,superRefine:()=>Ju,success:()=>W4,stringbool:()=>E4,stringFormat:()=>n4,string:()=>D,strictObject:()=>O4,startsWith:()=>nn,slugify:()=>ln,size:()=>Tr,setErrorMap:()=>NI,set:()=>J4,safeParseAsync:()=>G$,safeParse:()=>X$,safeEncodeAsync:()=>H$,safeEncode:()=>B$,safeDecodeAsync:()=>E$,safeDecode:()=>F$,registry:()=>ci,regexes:()=>Ur,regex:()=>pr,refine:()=>Su,record:()=>F,readonly:()=>Nu,property:()=>Wi,promise:()=>K4,prettifyError:()=>jv,preprocess:()=>Rn,prefault:()=>lu,positive:()=>Ji,pipe:()=>Fn,partialRecord:()=>z4,parseAsync:()=>W$,parse:()=>j$,overwrite:()=>Nr,optional:()=>Z,object:()=>L,number:()=>Y,nullish:()=>j4,nullable:()=>Bn,null:()=>En,normalize:()=>un,nonpositive:()=>Ai,nonoptional:()=>bu,nonnegative:()=>ji,never:()=>vv,negative:()=>Li,nativeEnum:()=>L4,nanoid:()=>q6,nan:()=>X4,multipleOf:()=>Vr,minSize:()=>Sr,minLength:()=>jr,mime:()=>$n,meta:()=>F4,maxSize:()=>Kr,maxLength:()=>Mr,map:()=>S4,mac:()=>y6,lte:()=>lr,lt:()=>zr,lowercase:()=>ar,looseRecord:()=>P4,looseObject:()=>d,locales:()=>Vn,literal:()=>A,length:()=>qr,lazy:()=>cu,ksuid:()=>C6,keyof:()=>k4,jwt:()=>r4,json:()=>T4,iso:()=>Yr,ipv6:()=>f6,ipv4:()=>e6,intersection:()=>Nn,int64:()=>b4,int32:()=>g4,int:()=>Ti,instanceof:()=>H4,includes:()=>rn,httpUrl:()=>T6,hostname:()=>i4,hex:()=>v4,hash:()=>$4,guid:()=>Y6,gte:()=>nr,gt:()=>Pr,globalRegistry:()=>f,getErrorMap:()=>kI,function:()=>Y4,fromJSONSchema:()=>M4,formatError:()=>Sn,float64:()=>t4,float32:()=>u4,flattenError:()=>Pn,file:()=>A4,exactOptional:()=>$u,enum:()=>h,endsWith:()=>vn,encodeAsync:()=>Y$,encode:()=>V$,emoji:()=>M6,email:()=>K6,e164:()=>s6,discriminatedUnion:()=>xn,describe:()=>B4,default:()=>jw,decodeAsync:()=>Q$,decode:()=>K$,date:()=>N4,custom:()=>lv,cuid2:()=>Z6,cuid:()=>x6,core:()=>Wr,config:()=>R,coerce:()=>Au,codec:()=>G4,clone:()=>rr,cidrv6:()=>h6,cidrv4:()=>d6,check:()=>Q4,catch:()=>Uu,boolean:()=>C,bigint:()=>l4,base64url:()=>a6,base64:()=>p6,array:()=>V,any:()=>D4,_function:()=>Y4,_default:()=>gu,_ZodString:()=>Mi,ZodXor:()=>y$,ZodXID:()=>ei,ZodVoid:()=>C$,ZodUnknown:()=>m$,ZodUnion:()=>qn,ZodUndefined:()=>q$,ZodUUID:()=>Jr,ZodURL:()=>Hn,ZodULID:()=>Ci,ZodType:()=>X,ZodTuple:()=>h$,ZodTransform:()=>iu,ZodTemplateLiteral:()=>ku,ZodSymbol:()=>M$,ZodSuccess:()=>_u,ZodStringFormat:()=>E,ZodString:()=>_n,ZodSet:()=>s$,ZodRecord:()=>Zn,ZodRealError:()=>ur,ZodReadonly:()=>wu,ZodPromise:()=>zu,ZodPrefault:()=>ou,ZodPipe:()=>gv,ZodOptional:()=>uv,ZodObject:()=>Mn,ZodNumberFormat:()=>Rr,ZodNumber:()=>Un,ZodNullable:()=>uu,ZodNull:()=>x$,ZodNonOptional:()=>tv,ZodNever:()=>R$,ZodNanoID:()=>Zi,ZodNaN:()=>Du,ZodMap:()=>a$,ZodMAC:()=>T$,ZodLiteral:()=>ru,ZodLazy:()=>Ou,ZodKSUID:()=>yi,ZodJWT:()=>nv,ZodIssueCode:()=>wI,ZodIntersection:()=>d$,ZodISOTime:()=>Qi,ZodISODuration:()=>Bi,ZodISODateTime:()=>Ki,ZodISODate:()=>Yi,ZodIPv6:()=>di,ZodIPv4:()=>fi,ZodGUID:()=>Qn,ZodFunction:()=>Pu,ZodFirstPartyTypeKind:()=>Lu,ZodFile:()=>nu,ZodExactOptional:()=>vu,ZodError:()=>DI,ZodEnum:()=>bn,ZodEmoji:()=>xi,ZodEmail:()=>qi,ZodE164:()=>rv,ZodDiscriminatedUnion:()=>f$,ZodDefault:()=>tu,ZodDate:()=>Tn,ZodCustomStringFormat:()=>In,ZodCustom:()=>mn,ZodCodec:()=>ov,ZodCatch:()=>Iu,ZodCUID2:()=>Ri,ZodCUID:()=>mi,ZodCIDRv6:()=>pi,ZodCIDRv4:()=>hi,ZodBoolean:()=>Dn,ZodBigIntFormat:()=>iv,ZodBigInt:()=>wn,ZodBase64URL:()=>si,ZodBase64:()=>ai,ZodArray:()=>e$,ZodAny:()=>Z$,TimePrecision:()=>O$,NEVER:()=>Pv,$output:()=>hv,$input:()=>pv,$brand:()=>Sv});var jw;var bv=S(()=>{x4();x4();jw=SI});br();function S$(r){return!!r._zod}function J$(r,i){if(S$(r))return jn(r,i);return r.safeParse(i)}function _I(r){if(!r)return;let i;if(S$(r))i=r._zod?.def?.shape;else i=r.shape;if(!i)return;if(typeof i==="function")try{return i()}catch{return}return i}function II(r){if(S$(r)){let $=r._zod?.def;if($){if($.value!==void 0)return $.value;if(Array.isArray($.values)&&$.values.length>0)return $.values[0]}}let v=r._def;if(v){if(v.value!==void 0)return v.value;if(Array.isArray(v.values)&&v.values.length>0)return v.values[0]}let u=r.value;if(u!==void 0)return u;return}bv();var Cr="io.modelcontextprotocol/related-task",Wu="2.0",e=lv((r)=>r!==null&&(typeof r==="object"||typeof r==="function")),JI=M([D(),Y().int()]),LI=D(),ec=d({ttl:Y().optional(),pollInterval:Y().optional()}),Ww=L({ttl:Y().optional()}),Xw=L({taskId:D()}),m4=d({progressToken:JI.optional(),[Cr]:Xw.optional()}),Dr=L({_meta:m4.optional()}),_v=Dr.extend({task:Ww.optional()}),AI=(r)=>_v.safeParse(r).success,p=L({method:D(),params:Dr.loose().optional()}),kr=L({_meta:m4.optional()}),Or=L({method:D(),params:kr.loose().optional()}),a=d({_meta:m4.optional()}),en=M([D(),Y().int()]),jI=L({jsonrpc:A(Wu),id:en,...p.shape}).strict(),R4=(r)=>jI.safeParse(r).success,WI=L({jsonrpc:A(Wu),...Or.shape}).strict(),XI=(r)=>WI.safeParse(r).success,C4=L({jsonrpc:A(Wu),id:en,result:a}).strict(),Iv=(r)=>C4.safeParse(r).success;var H;(function(r){r[r.ConnectionClosed=-32000]="ConnectionClosed",r[r.RequestTimeout=-32001]="RequestTimeout",r[r.ParseError=-32700]="ParseError",r[r.InvalidRequest=-32600]="InvalidRequest",r[r.MethodNotFound=-32601]="MethodNotFound",r[r.InvalidParams=-32602]="InvalidParams",r[r.InternalError=-32603]="InternalError",r[r.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(H||(H={}));var e4=L({jsonrpc:A(Wu),id:en.optional(),error:L({code:Y().int(),message:D(),data:T().optional()})}).strict();var GI=(r)=>e4.safeParse(r).success;var VI=M([jI,WI,C4,e4]),yc=M([C4,e4]),Xu=a.strict(),Gw=kr.extend({requestId:en.optional(),reason:D().optional()}),Gu=Or.extend({method:A("notifications/cancelled"),params:Gw}),Vw=L({src:D(),mimeType:D().optional(),sizes:V(D()).optional(),theme:h(["light","dark"]).optional()}),Uv=L({icons:V(Vw).optional()}),Cn=L({name:D(),title:D().optional()}),Dv=Cn.extend({...Cn.shape,...Uv.shape,version:D(),websiteUrl:D().optional(),description:D().optional()}),Kw=Nn(L({applyDefaults:C().optional()}),F(D(),T())),Yw=Rn((r)=>{if(r&&typeof r==="object"&&!Array.isArray(r)){if(Object.keys(r).length===0)return{form:{}}}return r},Nn(L({form:Kw.optional(),url:e.optional()}),F(D(),T()).optional())),Qw=d({list:e.optional(),cancel:e.optional(),requests:d({sampling:d({createMessage:e.optional()}).optional(),elicitation:d({create:e.optional()}).optional()}).optional()}),Bw=d({list:e.optional(),cancel:e.optional(),requests:d({tools:d({call:e.optional()}).optional()}).optional()}),Fw=L({experimental:F(D(),e).optional(),sampling:L({context:e.optional(),tools:e.optional()}).optional(),elicitation:Yw.optional(),roots:L({listChanged:C().optional()}).optional(),tasks:Qw.optional(),extensions:F(D(),e).optional()}),Hw=Dr.extend({protocolVersion:D(),capabilities:Fw,clientInfo:Dv}),Ew=p.extend({method:A("initialize"),params:Hw});var Tw=L({experimental:F(D(),e).optional(),logging:e.optional(),completions:e.optional(),prompts:L({listChanged:C().optional()}).optional(),resources:L({subscribe:C().optional(),listChanged:C().optional()}).optional(),tools:L({listChanged:C().optional()}).optional(),tasks:Bw.optional(),extensions:F(D(),e).optional()}),Mw=a.extend({protocolVersion:D(),capabilities:Tw,serverInfo:Dv,instructions:D().optional()}),qw=Or.extend({method:A("notifications/initialized"),params:kr.optional()});var yn=p.extend({method:A("ping"),params:Dr.optional()}),xw=L({progress:Y(),total:Z(Y()),message:Z(D())}),Zw=L({...kr.shape,...xw.shape,progressToken:JI}),Vu=Or.extend({method:A("notifications/progress"),params:Zw}),mw=Dr.extend({cursor:LI.optional()}),wv=p.extend({params:mw.optional()}),Nv=a.extend({nextCursor:LI.optional()}),Rw=h(["working","input_required","completed","failed","cancelled"]),kv=L({taskId:D(),status:Rw,ttl:M([Y(),En()]),createdAt:D(),lastUpdatedAt:D(),pollInterval:Z(Y()),statusMessage:Z(D())}),Ku=a.extend({task:kv}),Cw=kr.merge(kv),Ov=Or.extend({method:A("notifications/tasks/status"),params:Cw}),Yu=p.extend({method:A("tasks/get"),params:Dr.extend({taskId:D()})}),Qu=a.merge(kv),Bu=p.extend({method:A("tasks/result"),params:Dr.extend({taskId:D()})}),fc=a.loose(),Fu=wv.extend({method:A("tasks/list")}),Hu=Nv.extend({tasks:V(kv)}),Eu=p.extend({method:A("tasks/cancel"),params:Dr.extend({taskId:D()})}),KI=a.merge(kv),YI=L({uri:D(),mimeType:Z(D()),_meta:F(D(),T()).optional()}),QI=YI.extend({text:D()}),y4=D().refine((r)=>{try{return atob(r),!0}catch{return!1}},{message:"Invalid Base64 string"}),BI=YI.extend({blob:y4}),cv=h(["user","assistant"]),fn=L({audience:V(cv).optional(),priority:Y().min(0).max(1).optional(),lastModified:Yr.datetime({offset:!0}).optional()}),FI=L({...Cn.shape,...Uv.shape,uri:D(),description:Z(D()),mimeType:Z(D()),size:Z(Y()),annotations:fn.optional(),_meta:Z(d({}))}),ew=L({...Cn.shape,...Uv.shape,uriTemplate:D(),description:Z(D()),mimeType:Z(D()),annotations:fn.optional(),_meta:Z(d({}))}),yw=wv.extend({method:A("resources/list")}),f4=Nv.extend({resources:V(FI)}),fw=wv.extend({method:A("resources/templates/list")}),dw=Nv.extend({resourceTemplates:V(ew)}),d4=Dr.extend({uri:D()}),hw=d4,pw=p.extend({method:A("resources/read"),params:hw}),h4=a.extend({contents:V(M([QI,BI]))}),aw=Or.extend({method:A("notifications/resources/list_changed"),params:kr.optional()}),sw=d4,r1=p.extend({method:A("resources/subscribe"),params:sw}),n1=d4,i1=p.extend({method:A("resources/unsubscribe"),params:n1}),v1=kr.extend({uri:D()}),$1=Or.extend({method:A("notifications/resources/updated"),params:v1}),u1=L({name:D(),description:Z(D()),required:Z(C())}),t1=L({...Cn.shape,...Uv.shape,description:Z(D()),arguments:Z(V(u1)),_meta:Z(d({}))}),g1=wv.extend({method:A("prompts/list")}),o1=Nv.extend({prompts:V(t1)}),l1=Dr.extend({name:D(),arguments:F(D(),D()).optional()}),b1=p.extend({method:A("prompts/get"),params:l1}),p4=L({type:A("text"),text:D(),annotations:fn.optional(),_meta:F(D(),T()).optional()}),a4=L({type:A("image"),data:y4,mimeType:D(),annotations:fn.optional(),_meta:F(D(),T()).optional()}),s4=L({type:A("audio"),data:y4,mimeType:D(),annotations:fn.optional(),_meta:F(D(),T()).optional()}),_1=L({type:A("tool_use"),name:D(),id:D(),input:F(D(),T()),_meta:F(D(),T()).optional()}),rb=L({type:A("resource"),resource:M([QI,BI]),annotations:fn.optional(),_meta:F(D(),T()).optional()}),nb=FI.extend({type:A("resource_link")}),dn=M([p4,a4,s4,nb,rb]),I1=L({role:cv,content:dn}),U1=a.extend({description:D().optional(),messages:V(I1)}),D1=Or.extend({method:A("notifications/prompts/list_changed"),params:kr.optional()}),w1=L({title:D().optional(),readOnlyHint:C().optional(),destructiveHint:C().optional(),idempotentHint:C().optional(),openWorldHint:C().optional()}),N1=L({taskSupport:h(["required","optional","forbidden"]).optional()}),Tu=L({...Cn.shape,...Uv.shape,description:D().optional(),inputSchema:L({type:A("object"),properties:F(D(),e).optional(),required:V(D()).optional()}).catchall(T()),outputSchema:L({type:A("object"),properties:F(D(),e).optional(),required:V(D()).optional()}).catchall(T()).optional(),annotations:w1.optional(),execution:N1.optional(),_meta:F(D(),T()).optional()}),ib=wv.extend({method:A("tools/list")}),k1=Nv.extend({tools:V(Tu)}),hn=a.extend({content:V(dn).default([]),structuredContent:F(D(),T()).optional(),isError:C().optional()}),dc=hn.or(a.extend({toolResult:T()})),O1=_v.extend({name:D(),arguments:F(D(),T()).optional()}),vb=p.extend({method:A("tools/call"),params:O1}),c1=Or.extend({method:A("notifications/tools/list_changed"),params:kr.optional()}),hc=L({autoRefresh:C().default(!0),debounceMs:Y().int().nonnegative().default(300)}),HI=h(["debug","info","notice","warning","error","critical","alert","emergency"]),z1=Dr.extend({level:HI}),P1=p.extend({method:A("logging/setLevel"),params:z1}),S1=kr.extend({level:HI,logger:D().optional(),data:T()}),J1=Or.extend({method:A("notifications/message"),params:S1}),L1=L({name:D().optional()}),A1=L({hints:V(L1).optional(),costPriority:Y().min(0).max(1).optional(),speedPriority:Y().min(0).max(1).optional(),intelligencePriority:Y().min(0).max(1).optional()}),j1=L({mode:h(["auto","required","none"]).optional()}),W1=L({type:A("tool_result"),toolUseId:D().describe("The unique identifier for the corresponding tool call."),content:V(dn).default([]),structuredContent:L({}).loose().optional(),isError:C().optional(),_meta:F(D(),T()).optional()}),X1=xn("type",[p4,a4,s4]),ju=xn("type",[p4,a4,s4,_1,W1]),G1=L({role:cv,content:M([ju,V(ju)]),_meta:F(D(),T()).optional()}),V1=_v.extend({messages:V(G1),modelPreferences:A1.optional(),systemPrompt:D().optional(),includeContext:h(["none","thisServer","allServers"]).optional(),temperature:Y().optional(),maxTokens:Y().int(),stopSequences:V(D()).optional(),metadata:e.optional(),tools:V(Tu).optional(),toolChoice:j1.optional()}),K1=p.extend({method:A("sampling/createMessage"),params:V1}),$b=a.extend({model:D(),stopReason:Z(h(["endTurn","stopSequence","maxTokens"]).or(D())),role:cv,content:X1}),ub=a.extend({model:D(),stopReason:Z(h(["endTurn","stopSequence","maxTokens","toolUse"]).or(D())),role:cv,content:M([ju,V(ju)])}),Y1=L({type:A("boolean"),title:D().optional(),description:D().optional(),default:C().optional()}),Q1=L({type:A("string"),title:D().optional(),description:D().optional(),minLength:Y().optional(),maxLength:Y().optional(),format:h(["email","uri","date","date-time"]).optional(),default:D().optional()}),B1=L({type:h(["number","integer"]),title:D().optional(),description:D().optional(),minimum:Y().optional(),maximum:Y().optional(),default:Y().optional()}),F1=L({type:A("string"),title:D().optional(),description:D().optional(),enum:V(D()),default:D().optional()}),H1=L({type:A("string"),title:D().optional(),description:D().optional(),oneOf:V(L({const:D(),title:D()})),default:D().optional()}),E1=L({type:A("string"),title:D().optional(),description:D().optional(),enum:V(D()),enumNames:V(D()).optional(),default:D().optional()}),T1=M([F1,H1]),M1=L({type:A("array"),title:D().optional(),description:D().optional(),minItems:Y().optional(),maxItems:Y().optional(),items:L({type:A("string"),enum:V(D())}),default:V(D()).optional()}),q1=L({type:A("array"),title:D().optional(),description:D().optional(),minItems:Y().optional(),maxItems:Y().optional(),items:L({anyOf:V(L({const:D(),title:D()}))}),default:V(D()).optional()}),x1=M([M1,q1]),Z1=M([E1,T1,x1]),m1=M([Z1,Y1,Q1,B1]),R1=_v.extend({mode:A("form").optional(),message:D(),requestedSchema:L({type:A("object"),properties:F(D(),m1),required:V(D()).optional()})}),C1=_v.extend({mode:A("url"),message:D(),elicitationId:D(),url:D().url()}),e1=M([R1,C1]),y1=p.extend({method:A("elicitation/create"),params:e1}),f1=kr.extend({elicitationId:D()}),d1=Or.extend({method:A("notifications/elicitation/complete"),params:f1}),h1=a.extend({action:h(["accept","decline","cancel"]),content:Rn((r)=>r===null?void 0:r,F(D(),M([D(),Y(),C(),V(D())])).optional())}),p1=L({type:A("ref/resource"),uri:D()});var a1=L({type:A("ref/prompt"),name:D()}),s1=Dr.extend({ref:M([a1,p1]),argument:L({name:D(),value:D()}),context:L({arguments:F(D(),D()).optional()}).optional()}),rN=p.extend({method:A("completion/complete"),params:s1});var nN=a.extend({completion:d({values:V(D()).max(100),total:Z(Y().int()),hasMore:Z(C())})}),iN=L({uri:D().startsWith("file://"),name:D().optional(),_meta:F(D(),T()).optional()}),vN=p.extend({method:A("roots/list"),params:Dr.optional()}),$N=a.extend({roots:V(iN)}),uN=Or.extend({method:A("notifications/roots/list_changed"),params:kr.optional()}),pc=M([yn,Ew,rN,P1,b1,g1,yw,fw,pw,r1,i1,vb,ib,Yu,Bu,Fu,Eu]),ac=M([Gu,Vu,qw,uN,Ov]),sc=M([Xu,$b,ub,h1,$N,Qu,Hu,Ku]),rz=M([yn,K1,y1,vN,Yu,Bu,Fu,Eu]),nz=M([Gu,Vu,J1,$1,aw,c1,D1,Ov,d1]),iz=M([Xu,Mw,nN,U1,o1,f4,dw,h4,hn,k1,Qu,Hu,Ku]);class Q extends Error{constructor(r,i,v){super(`MCP error ${r}: ${i}`);this.code=r,this.data=v,this.name="McpError"}static fromError(r,i,v){if(r===H.UrlElicitationRequired&&v){let u=v;if(u.elicitations)return new EI(u.elicitations,i)}return new Q(r,i,v)}}class EI extends Q{constructor(r,i=`URL elicitation${r.length>1?"s":""} required`){super(H.UrlElicitationRequired,i,{elicitations:r})}get elicitations(){return this.data?.elicitations??[]}}function er(r){return r==="completed"||r==="failed"||r==="cancelled"}var tN=Symbol("Let zodToJsonSchema decide on which parser to use");var Fz=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function tb(r){let v=_I(r)?.method;if(!v)throw Error("Schema is missing a method literal");let u=II(v);if(typeof u!=="string")throw Error("Schema method literal must be a string");return u}function gb(r,i){let v=J$(r,i);if(!v.success)throw v.error;return v.data}var IN=60000;class ob{constructor(r){if(this._options=r,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Gu,(i)=>{this._oncancel(i)}),this.setNotificationHandler(Vu,(i)=>{this._onprogress(i)}),this.setRequestHandler(yn,(i)=>({})),this._taskStore=r?.taskStore,this._taskMessageQueue=r?.taskMessageQueue,this._taskStore)this.setRequestHandler(Yu,async(i,v)=>{let u=await this._taskStore.getTask(i.params.taskId,v.sessionId);if(!u)throw new Q(H.InvalidParams,"Failed to retrieve task: Task not found");return{...u}}),this.setRequestHandler(Bu,async(i,v)=>{let u=async()=>{let n=i.params.taskId;if(this._taskMessageQueue){let t;while(t=await this._taskMessageQueue.dequeue(n,v.sessionId)){if(t.type==="response"||t.type==="error"){let g=t.message,b=g.id,o=this._requestResolvers.get(b);if(o)if(this._requestResolvers.delete(b),t.type==="response")o(g);else{let _=g,w=new Q(_.error.code,_.error.message,_.error.data);o(w)}else{let _=t.type==="response"?"Response":"Error";this._onerror(Error(`${_} handler missing for request ${b}`))}continue}await this._transport?.send(t.message,{relatedRequestId:v.requestId})}}let $=await this._taskStore.getTask(n,v.sessionId);if(!$)throw new Q(H.InvalidParams,`Task not found: ${n}`);if(!er($.status))return await this._waitForTaskUpdate(n,v.signal),await u();if(er($.status)){let t=await this._taskStore.getTaskResult(n,v.sessionId);return this._clearTaskQueue(n),{...t,_meta:{...t._meta,[Cr]:{taskId:n}}}}return await u()};return await u()}),this.setRequestHandler(Fu,async(i,v)=>{try{let{tasks:u,nextCursor:n}=await this._taskStore.listTasks(i.params?.cursor,v.sessionId);return{tasks:u,nextCursor:n,_meta:{}}}catch(u){throw new Q(H.InvalidParams,`Failed to list tasks: ${u instanceof Error?u.message:String(u)}`)}}),this.setRequestHandler(Eu,async(i,v)=>{try{let u=await this._taskStore.getTask(i.params.taskId,v.sessionId);if(!u)throw new Q(H.InvalidParams,`Task not found: ${i.params.taskId}`);if(er(u.status))throw new Q(H.InvalidParams,`Cannot cancel task in terminal status: ${u.status}`);await this._taskStore.updateTaskStatus(i.params.taskId,"cancelled","Client cancelled task execution.",v.sessionId),this._clearTaskQueue(i.params.taskId);let n=await this._taskStore.getTask(i.params.taskId,v.sessionId);if(!n)throw new Q(H.InvalidParams,`Task not found after cancellation: ${i.params.taskId}`);return{_meta:{},...n}}catch(u){if(u instanceof Q)throw u;throw new Q(H.InvalidRequest,`Failed to cancel task: ${u instanceof Error?u.message:String(u)}`)}})}async _oncancel(r){if(!r.params.requestId)return;this._requestHandlerAbortControllers.get(r.params.requestId)?.abort(r.params.reason)}_setupTimeout(r,i,v,u,n=!1){this._timeoutInfo.set(r,{timeoutId:setTimeout(u,i),startTime:Date.now(),timeout:i,maxTotalTimeout:v,resetTimeoutOnProgress:n,onTimeout:u})}_resetTimeout(r){let i=this._timeoutInfo.get(r);if(!i)return!1;let v=Date.now()-i.startTime;if(i.maxTotalTimeout&&v>=i.maxTotalTimeout)throw this._timeoutInfo.delete(r),Q.fromError(H.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:v});return clearTimeout(i.timeoutId),i.timeoutId=setTimeout(i.onTimeout,i.timeout),!0}_cleanupTimeout(r){let i=this._timeoutInfo.get(r);if(i)clearTimeout(i.timeoutId),this._timeoutInfo.delete(r)}async connect(r){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=r;let i=this.transport?.onclose;this._transport.onclose=()=>{i?.(),this._onclose()};let v=this.transport?.onerror;this._transport.onerror=(n)=>{v?.(n),this._onerror(n)};let u=this._transport?.onmessage;this._transport.onmessage=(n,$)=>{if(u?.(n,$),Iv(n)||GI(n))this._onresponse(n);else if(R4(n))this._onrequest(n,$);else if(XI(n))this._onnotification(n);else this._onerror(Error(`Unknown message type: ${JSON.stringify(n)}`))},await this._transport.start()}_onclose(){let r=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let v of this._timeoutInfo.values())clearTimeout(v.timeoutId);this._timeoutInfo.clear();for(let v of this._requestHandlerAbortControllers.values())v.abort();this._requestHandlerAbortControllers.clear();let i=Q.fromError(H.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let v of r.values())v(i)}_onerror(r){this.onerror?.(r)}_onnotification(r){let i=this._notificationHandlers.get(r.method)??this.fallbackNotificationHandler;if(i===void 0)return;Promise.resolve().then(()=>i(r)).catch((v)=>this._onerror(Error(`Uncaught error in notification handler: ${v}`)))}_onrequest(r,i){let v=this._requestHandlers.get(r.method)??this.fallbackRequestHandler,u=this._transport,n=r.params?._meta?.[Cr]?.taskId;if(v===void 0){let o={jsonrpc:"2.0",id:r.id,error:{code:H.MethodNotFound,message:"Method not found"}};if(n&&this._taskMessageQueue)this._enqueueTaskMessage(n,{type:"error",message:o,timestamp:Date.now()},u?.sessionId).catch((_)=>this._onerror(Error(`Failed to enqueue error response: ${_}`)));else u?.send(o).catch((_)=>this._onerror(Error(`Failed to send an error response: ${_}`)));return}let $=new AbortController;this._requestHandlerAbortControllers.set(r.id,$);let t=AI(r.params)?r.params.task:void 0,g=this._taskStore?this.requestTaskStore(r,u?.sessionId):void 0,b={signal:$.signal,sessionId:u?.sessionId,_meta:r.params?._meta,sendNotification:async(o)=>{if($.signal.aborted)return;let _={relatedRequestId:r.id};if(n)_.relatedTask={taskId:n};await this.notification(o,_)},sendRequest:async(o,_,w)=>{if($.signal.aborted)throw new Q(H.ConnectionClosed,"Request was cancelled");let N={...w,relatedRequestId:r.id};if(n&&!N.relatedTask)N.relatedTask={taskId:n};let P=N.relatedTask?.taskId??n;if(P&&g)await g.updateTaskStatus(P,"input_required");return await this.request(o,_,N)},authInfo:i?.authInfo,requestId:r.id,requestInfo:i?.requestInfo,taskId:n,taskStore:g,taskRequestedTtl:t?.ttl,closeSSEStream:i?.closeSSEStream,closeStandaloneSSEStream:i?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(t)this.assertTaskHandlerCapability(r.method)}).then(()=>v(r,b)).then(async(o)=>{if($.signal.aborted)return;let _={result:o,jsonrpc:"2.0",id:r.id};if(n&&this._taskMessageQueue)await this._enqueueTaskMessage(n,{type:"response",message:_,timestamp:Date.now()},u?.sessionId);else await u?.send(_)},async(o)=>{if($.signal.aborted)return;let _={jsonrpc:"2.0",id:r.id,error:{code:Number.isSafeInteger(o.code)?o.code:H.InternalError,message:o.message??"Internal error",...o.data!==void 0&&{data:o.data}}};if(n&&this._taskMessageQueue)await this._enqueueTaskMessage(n,{type:"error",message:_,timestamp:Date.now()},u?.sessionId);else await u?.send(_)}).catch((o)=>this._onerror(Error(`Failed to send response: ${o}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(r.id)===$)this._requestHandlerAbortControllers.delete(r.id)})}_onprogress(r){let{progressToken:i,...v}=r.params,u=Number(i),n=this._progressHandlers.get(u);if(!n){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(r)}`));return}let $=this._responseHandlers.get(u),t=this._timeoutInfo.get(u);if(t&&$&&t.resetTimeoutOnProgress)try{this._resetTimeout(u)}catch(g){this._responseHandlers.delete(u),this._progressHandlers.delete(u),this._cleanupTimeout(u),$(g);return}n(v)}_onresponse(r){let i=Number(r.id),v=this._requestResolvers.get(i);if(v){if(this._requestResolvers.delete(i),Iv(r))v(r);else{let $=new Q(r.error.code,r.error.message,r.error.data);v($)}return}let u=this._responseHandlers.get(i);if(u===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(r)}`));return}this._responseHandlers.delete(i),this._cleanupTimeout(i);let n=!1;if(Iv(r)&&r.result&&typeof r.result==="object"){let $=r.result;if($.task&&typeof $.task==="object"){let t=$.task;if(typeof t.taskId==="string")n=!0,this._taskProgressTokens.set(t.taskId,i)}}if(!n)this._progressHandlers.delete(i);if(Iv(r))u(r);else{let $=Q.fromError(r.error.code,r.error.message,r.error.data);u($)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(r,i,v){let{task:u}=v??{};if(!u){try{yield{type:"result",result:await this.request(r,i,v)}}catch($){yield{type:"error",error:$ instanceof Q?$:new Q(H.InternalError,String($))}}return}let n;try{let $=await this.request(r,Ku,v);if($.task)n=$.task.taskId,yield{type:"taskCreated",task:$.task};else throw new Q(H.InternalError,"Task creation did not return a task");while(!0){let t=await this.getTask({taskId:n},v);if(yield{type:"taskStatus",task:t},er(t.status)){if(t.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:n},i,v)};else if(t.status==="failed")yield{type:"error",error:new Q(H.InternalError,`Task ${n} failed`)};else if(t.status==="cancelled")yield{type:"error",error:new Q(H.InternalError,`Task ${n} was cancelled`)};return}if(t.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:n},i,v)};return}let g=t.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((b)=>setTimeout(b,g)),v?.signal?.throwIfAborted()}}catch($){yield{type:"error",error:$ instanceof Q?$:new Q(H.InternalError,String($))}}}request(r,i,v){let{relatedRequestId:u,resumptionToken:n,onresumptiontoken:$,task:t,relatedTask:g}=v??{};return new Promise((b,o)=>{let _=(y)=>{o(y)};if(!this._transport){_(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod(r.method),t)this.assertTaskCapability(r.method)}catch(y){_(y);return}v?.signal?.throwIfAborted();let w=this._requestMessageId++,N={...r,jsonrpc:"2.0",id:w};if(v?.onprogress)this._progressHandlers.set(w,v.onprogress),N.params={...r.params,_meta:{...r.params?._meta||{},progressToken:w}};if(t)N.params={...N.params,task:t};if(g)N.params={...N.params,_meta:{...N.params?._meta||{},[Cr]:g}};let P=(y)=>{this._responseHandlers.delete(w),this._progressHandlers.delete(w),this._cleanupTimeout(w),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:w,reason:String(y)}},{relatedRequestId:u,resumptionToken:n,onresumptiontoken:$}).catch((vr)=>this._onerror(Error(`Failed to send cancellation: ${vr}`)));let _r=y instanceof Q?y:new Q(H.RequestTimeout,String(y));o(_r)};this._responseHandlers.set(w,(y)=>{if(v?.signal?.aborted)return;if(y instanceof Error)return o(y);try{let _r=J$(i,y.result);if(!_r.success)o(_r.error);else b(_r.data)}catch(_r){o(_r)}}),v?.signal?.addEventListener("abort",()=>{P(v?.signal?.reason)});let K=v?.timeout??IN,q=()=>P(Q.fromError(H.RequestTimeout,"Request timed out",{timeout:K}));this._setupTimeout(w,K,v?.maxTotalTimeout,q,v?.resetTimeoutOnProgress??!1);let Xr=g?.taskId;if(Xr){let y=(_r)=>{let vr=this._responseHandlers.get(w);if(vr)vr(_r);else this._onerror(Error(`Response handler missing for side-channeled request ${w}`))};this._requestResolvers.set(w,y),this._enqueueTaskMessage(Xr,{type:"request",message:N,timestamp:Date.now()}).catch((_r)=>{this._cleanupTimeout(w),o(_r)})}else this._transport.send(N,{relatedRequestId:u,resumptionToken:n,onresumptiontoken:$}).catch((y)=>{this._cleanupTimeout(w),o(y)})})}async getTask(r,i){return this.request({method:"tasks/get",params:r},Qu,i)}async getTaskResult(r,i,v){return this.request({method:"tasks/result",params:r},i,v)}async listTasks(r,i){return this.request({method:"tasks/list",params:r},Hu,i)}async cancelTask(r,i){return this.request({method:"tasks/cancel",params:r},KI,i)}async notification(r,i){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(r.method);let v=i?.relatedTask?.taskId;if(v){let t={...r,jsonrpc:"2.0",params:{...r.params,_meta:{...r.params?._meta||{},[Cr]:i.relatedTask}}};await this._enqueueTaskMessage(v,{type:"notification",message:t,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(r.method)&&!r.params&&!i?.relatedRequestId&&!i?.relatedTask){if(this._pendingDebouncedNotifications.has(r.method))return;this._pendingDebouncedNotifications.add(r.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(r.method),!this._transport)return;let t={...r,jsonrpc:"2.0"};if(i?.relatedTask)t={...t,params:{...t.params,_meta:{...t.params?._meta||{},[Cr]:i.relatedTask}}};this._transport?.send(t,i).catch((g)=>this._onerror(g))});return}let $={...r,jsonrpc:"2.0"};if(i?.relatedTask)$={...$,params:{...$.params,_meta:{...$.params?._meta||{},[Cr]:i.relatedTask}}};await this._transport.send($,i)}setRequestHandler(r,i){let v=tb(r);this.assertRequestHandlerCapability(v),this._requestHandlers.set(v,(u,n)=>{let $=gb(r,u);return Promise.resolve(i($,n))})}removeRequestHandler(r){this._requestHandlers.delete(r)}assertCanSetRequestHandler(r){if(this._requestHandlers.has(r))throw Error(`A request handler for ${r} already exists, which would be overridden`)}setNotificationHandler(r,i){let v=tb(r);this._notificationHandlers.set(v,(u)=>{let n=gb(r,u);return Promise.resolve(i(n))})}removeNotificationHandler(r){this._notificationHandlers.delete(r)}_cleanupTaskProgressHandler(r){let i=this._taskProgressTokens.get(r);if(i!==void 0)this._progressHandlers.delete(i),this._taskProgressTokens.delete(r)}async _enqueueTaskMessage(r,i,v){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let u=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(r,i,v,u)}async _clearTaskQueue(r,i){if(this._taskMessageQueue){let v=await this._taskMessageQueue.dequeueAll(r,i);for(let u of v)if(u.type==="request"&&R4(u.message)){let n=u.message.id,$=this._requestResolvers.get(n);if($)$(new Q(H.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(n);else this._onerror(Error(`Resolver missing for request ${n} during task ${r} cleanup`))}}}async _waitForTaskUpdate(r,i){let v=this._options?.defaultTaskPollInterval??1000;try{let u=await this._taskStore?.getTask(r);if(u?.pollInterval)v=u.pollInterval}catch{}return new Promise((u,n)=>{if(i.aborted){n(new Q(H.InvalidRequest,"Request cancelled"));return}let $=setTimeout(u,v);i.addEventListener("abort",()=>{clearTimeout($),n(new Q(H.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(r,i){let v=this._taskStore;if(!v)throw Error("No task store configured");return{createTask:async(u)=>{if(!r)throw Error("No request provided");return await v.createTask(u,r.id,{method:r.method,params:r.params},i)},getTask:async(u)=>{let n=await v.getTask(u,i);if(!n)throw new Q(H.InvalidParams,"Failed to retrieve task: Task not found");return n},storeTaskResult:async(u,n,$)=>{await v.storeTaskResult(u,n,$,i);let t=await v.getTask(u,i);if(t){let g=Ov.parse({method:"notifications/tasks/status",params:t});if(await this.notification(g),er(t.status))this._cleanupTaskProgressHandler(u)}},getTaskResult:(u)=>{return v.getTaskResult(u,i)},updateTaskStatus:async(u,n,$)=>{let t=await v.getTask(u,i);if(!t)throw new Q(H.InvalidParams,`Task "${u}" not found - it may have been cleaned up`);if(er(t.status))throw new Q(H.InvalidParams,`Cannot update task "${u}" from terminal status "${t.status}" to "${n}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await v.updateTaskStatus(u,n,$,i);let g=await v.getTask(u,i);if(g){let b=Ov.parse({method:"notifications/tasks/status",params:g});if(await this.notification(b),er(g.status))this._cleanupTaskProgressHandler(u)}},listTasks:(u)=>{return v.listTasks(u,i)}}}}function TI(r){return r!==null&&typeof r==="object"&&!Array.isArray(r)}function MI(r,i){let v={...r};for(let u in i){let n=u,$=i[n];if($===void 0)continue;let t=v[n];if(TI(t)&&TI($))v[n]={...t,...$};else v[n]=$}return v}class lb extends ob{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(r,i){}_ensureEventSlot(r){let i=this._eventSlots.get(r);if(!i){let v=this.eventSchemas[r];if(!v)throw Error(`Unknown event: ${String(r)}`);i={listeners:[]},this._eventSlots.set(r,i);let u=v.shape.method.value;this._registeredMethods.add(u);let n=i;super.setNotificationHandler(v,($)=>{let t=$.params;this.onEventDispatch(r,t),n.onHandler?.(t);for(let g of[...n.listeners])g(t)})}return i}setEventHandler(r,i){let v=this._ensureEventSlot(r);if(v.onHandler&&i)console.warn(`[MCP Apps] on${String(r)} handler replaced. Use addEventListener("${String(r)}", …) to add multiple listeners without replacing.`);v.onHandler=i}getEventHandler(r){return this._eventSlots.get(r)?.onHandler}addEventListener(r,i){this._ensureEventSlot(r).listeners.push(i)}removeEventListener(r,i){let v=this._eventSlots.get(r);if(!v)return;let u=v.listeners.indexOf(i);if(u!==-1)v.listeners.splice(u,1)}setRequestHandler=(r,i)=>{this._assertMethodNotRegistered(r,"setRequestHandler"),super.setRequestHandler(r,i)};setNotificationHandler=(r,i)=>{this._assertMethodNotRegistered(r,"setNotificationHandler"),super.setNotificationHandler(r,i)};warnIfRequestHandlerReplaced(r,i,v){if(i&&v)console.warn(`[MCP Apps] ${r} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(r,i)=>{let v=r.shape.method.value;this._registeredMethods.add(v),super.setRequestHandler(r,i)};_assertMethodNotRegistered(r,i){let v=r.shape.method.value;if(this._registeredMethods.has(v))throw Error(`Handler for "${v}" already registered (via ${i}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(v)}}var bb="2026-01-26",UN="ui/open-link",DN="ui/download-file",wN="ui/message",NN="ui/notifications/sandbox-proxy-ready",kN="ui/notifications/sandbox-resource-ready",ON="ui/notifications/size-changed",cN="ui/notifications/tool-input",_b="ui/notifications/tool-input-partial",zN="ui/notifications/tool-result",PN="ui/notifications/tool-cancelled",SN="ui/notifications/host-context-changed",JN="ui/notifications/request-teardown",LN="ui/resource-teardown",AN="ui/initialize",jN="ui/notifications/initialized",WN="ui/request-display-mode";class Mu{eventTarget;eventSource;messageListener;constructor(r=window.parent,i){this.eventTarget=r;this.eventSource=i;this.messageListener=(v)=>{if(i&&v.source!==this.eventSource){console.debug("Ignoring message from unknown source",v);return}let u=VI.safeParse(v.data);if(u.success)console.debug("Parsed message",u.data),this.onmessage?.(u.data);else if(v.data?.jsonrpc!=="2.0")console.debug("Ignoring non-JSON-RPC message",u.error.message,v);else console.error("Failed to parse message",u.error.message,v),this.onerror?.(Error("Invalid JSON-RPC message received: "+u.error.message))}}async start(){window.addEventListener("message",this.messageListener)}async send(r,i){if(r.method!==_b)console.debug("Sending message",r);this.eventTarget.postMessage(r,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}bv();var qI=l.union([l.literal("light"),l.literal("dark")]).describe("Color theme preference for the host environment."),pn=l.union([l.literal("inline"),l.literal("fullscreen"),l.literal("pip")]).describe("Display mode for UI presentation."),XN=l.union([l.literal("--color-background-primary"),l.literal("--color-background-secondary"),l.literal("--color-background-tertiary"),l.literal("--color-background-inverse"),l.literal("--color-background-ghost"),l.literal("--color-background-info"),l.literal("--color-background-danger"),l.literal("--color-background-success"),l.literal("--color-background-warning"),l.literal("--color-background-disabled"),l.literal("--color-text-primary"),l.literal("--color-text-secondary"),l.literal("--color-text-tertiary"),l.literal("--color-text-inverse"),l.literal("--color-text-ghost"),l.literal("--color-text-info"),l.literal("--color-text-danger"),l.literal("--color-text-success"),l.literal("--color-text-warning"),l.literal("--color-text-disabled"),l.literal("--color-border-primary"),l.literal("--color-border-secondary"),l.literal("--color-border-tertiary"),l.literal("--color-border-inverse"),l.literal("--color-border-ghost"),l.literal("--color-border-info"),l.literal("--color-border-danger"),l.literal("--color-border-success"),l.literal("--color-border-warning"),l.literal("--color-border-disabled"),l.literal("--color-ring-primary"),l.literal("--color-ring-secondary"),l.literal("--color-ring-inverse"),l.literal("--color-ring-info"),l.literal("--color-ring-danger"),l.literal("--color-ring-success"),l.literal("--color-ring-warning"),l.literal("--font-sans"),l.literal("--font-mono"),l.literal("--font-weight-normal"),l.literal("--font-weight-medium"),l.literal("--font-weight-semibold"),l.literal("--font-weight-bold"),l.literal("--font-text-xs-size"),l.literal("--font-text-sm-size"),l.literal("--font-text-md-size"),l.literal("--font-text-lg-size"),l.literal("--font-heading-xs-size"),l.literal("--font-heading-sm-size"),l.literal("--font-heading-md-size"),l.literal("--font-heading-lg-size"),l.literal("--font-heading-xl-size"),l.literal("--font-heading-2xl-size"),l.literal("--font-heading-3xl-size"),l.literal("--font-text-xs-line-height"),l.literal("--font-text-sm-line-height"),l.literal("--font-text-md-line-height"),l.literal("--font-text-lg-line-height"),l.literal("--font-heading-xs-line-height"),l.literal("--font-heading-sm-line-height"),l.literal("--font-heading-md-line-height"),l.literal("--font-heading-lg-line-height"),l.literal("--font-heading-xl-line-height"),l.literal("--font-heading-2xl-line-height"),l.literal("--font-heading-3xl-line-height"),l.literal("--border-radius-xs"),l.literal("--border-radius-sm"),l.literal("--border-radius-md"),l.literal("--border-radius-lg"),l.literal("--border-radius-xl"),l.literal("--border-radius-full"),l.literal("--border-width-regular"),l.literal("--shadow-hairline"),l.literal("--shadow-sm"),l.literal("--shadow-md"),l.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),GN=l.record(XN.describe(`Style variables for theming MCP apps. + +Individual style keys are optional - hosts may provide any subset of these values. +Values are strings containing CSS values (colors, sizes, font stacks, etc.). + +Note: This type uses \`Record\` rather than \`Partial>\` +for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),l.union([l.string(),l.undefined()]).describe(`Style variables for theming MCP apps. + +Individual style keys are optional - hosts may provide any subset of these values. +Values are strings containing CSS values (colors, sizes, font stacks, etc.). + +Note: This type uses \`Record\` rather than \`Partial>\` +for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps. + +Individual style keys are optional - hosts may provide any subset of these values. +Values are strings containing CSS values (colors, sizes, font stacks, etc.). + +Note: This type uses \`Record\` rather than \`Partial>\` +for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),VN=l.object({method:l.literal("ui/open-link"),params:l.object({url:l.string().describe("URL to open in the host's browser")})}),Ub=l.object({isError:l.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),Db=l.object({isError:l.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),wb=l.object({isError:l.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),KN=l.object({method:l.literal("ui/notifications/sandbox-proxy-ready"),params:l.object({})}),qu=l.object({connectDomains:l.array(l.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket). + +- Maps to CSP \`connect-src\` directive +- Empty or omitted → no network connections (secure default)`),resourceDomains:l.array(l.string()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:l.array(l.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:l.array(l.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),xu=l.object({camera:l.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:l.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:l.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:l.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),YN=l.object({method:l.literal("ui/notifications/size-changed"),params:l.object({width:l.number().optional().describe("New width in pixels."),height:l.number().optional().describe("New height in pixels.")})}),Nb=l.object({method:l.literal("ui/notifications/tool-input"),params:l.object({arguments:l.record(l.string(),l.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),kb=l.object({method:l.literal("ui/notifications/tool-input-partial"),params:l.object({arguments:l.record(l.string(),l.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),Ob=l.object({method:l.literal("ui/notifications/tool-cancelled"),params:l.object({reason:l.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),xI=l.object({fonts:l.string().optional()}),ZI=l.object({variables:GN.optional().describe("CSS variables for theming the app."),css:xI.optional().describe("CSS blocks that apps can inject.")}),cb=l.object({method:l.literal("ui/resource-teardown"),params:l.object({})}),QN=l.record(l.string(),l.unknown()),Ib=l.object({text:l.object({}).optional().describe("Host supports text content blocks."),image:l.object({}).optional().describe("Host supports image content blocks."),audio:l.object({}).optional().describe("Host supports audio content blocks."),resource:l.object({}).optional().describe("Host supports resource content blocks."),resourceLink:l.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:l.object({}).optional().describe("Host supports structured content.")}),BN=l.object({method:l.literal("ui/notifications/request-teardown"),params:l.object({}).optional()}),mI=l.object({experimental:l.object({}).optional().describe("Experimental features (structure TBD)."),openLinks:l.object({}).optional().describe("Host supports opening external URLs."),downloadFile:l.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:l.object({listChanged:l.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:l.object({listChanged:l.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:l.object({}).optional().describe("Host accepts log messages."),sandbox:l.object({permissions:xu.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:qu.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:Ib.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:Ib.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:l.object({tools:l.object({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),RI=l.object({experimental:l.object({}).optional().describe("Experimental features (structure TBD)."),tools:l.object({listChanged:l.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:l.array(pn).optional().describe("Display modes the app supports.")}),FN=l.object({method:l.literal("ui/notifications/initialized"),params:l.object({}).optional()}),HN=l.object({csp:qu.optional().describe("Content Security Policy configuration for UI resources."),permissions:xu.optional().describe("Sandbox permissions requested by the UI resource."),domain:l.string().optional().describe(`Dedicated origin for view sandbox. + +Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists. + +**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include: +- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`) +- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`) + +If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:l.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border. + +Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary. + +- \`true\`: request visible border + background +- \`false\`: request no visible border + background +- omitted: host decides border`)}),EN=l.object({method:l.literal("ui/request-display-mode"),params:l.object({mode:pn.describe("The display mode being requested.")})}),zb=l.object({mode:pn.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),CI=l.union([l.literal("model"),l.literal("app")]).describe("Tool visibility scope - who can access the tool."),TN=l.object({resourceUri:l.string().optional(),visibility:l.array(CI).optional().describe(`Who can access this tool. Default: ["model", "app"] +- "model": Tool visible to and callable by the agent +- "app": Tool callable by the app from this server only`),csp:l.never().optional(),permissions:l.never().optional()}),mS=l.object({mimeTypes:l.array(l.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),MN=l.object({method:l.literal("ui/download-file"),params:l.object({contents:l.array(l.union([rb,nb])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),qN=l.object({method:l.literal("ui/message"),params:l.object({role:l.literal("user").describe('Message role, currently only "user" is supported.'),content:l.array(dn).describe("Message content blocks (text, image, etc.).")})}),xN=l.object({method:l.literal("ui/notifications/sandbox-resource-ready"),params:l.object({html:l.string().describe("HTML content to load into the inner iframe."),sandbox:l.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:qu.optional().describe("CSP configuration from resource metadata."),permissions:xu.optional().describe("Sandbox permissions from resource metadata.")})}),Pb=l.object({method:l.literal("ui/notifications/tool-result"),params:hn.describe("Standard MCP tool execution result.")}),Sb=l.object({toolInfo:l.object({id:en.optional().describe("JSON-RPC id of the tools/call request."),tool:Tu.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:qI.optional().describe("Current color theme preference."),styles:ZI.optional().describe("Style configuration for theming the app."),displayMode:pn.optional().describe("How the UI is currently displayed."),availableDisplayModes:l.array(pn).optional().describe("Display modes the host supports."),containerDimensions:l.union([l.object({height:l.number().describe("Fixed container height in pixels.")}),l.object({maxHeight:l.union([l.number(),l.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(l.union([l.object({width:l.number().describe("Fixed container width in pixels.")}),l.object({maxWidth:l.union([l.number(),l.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other +container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:l.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:l.string().optional().describe("User's timezone in IANA format."),userAgent:l.string().optional().describe("Host application identifier."),platform:l.union([l.literal("web"),l.literal("desktop"),l.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:l.object({touch:l.boolean().optional().describe("Whether the device supports touch input."),hover:l.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:l.object({top:l.number().describe("Top safe area inset in pixels."),right:l.number().describe("Right safe area inset in pixels."),bottom:l.number().describe("Bottom safe area inset in pixels."),left:l.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),Jb=l.object({method:l.literal("ui/notifications/host-context-changed"),params:Sb.describe("Partial context update containing only changed fields.")}),ZN=l.object({method:l.literal("ui/update-model-context"),params:l.object({content:l.array(dn).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:l.record(l.string(),l.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),mN=l.object({method:l.literal("ui/initialize"),params:l.object({appInfo:Dv.describe("App identification (name and version)."),appCapabilities:RI.describe("Features and capabilities this app provides."),protocolVersion:l.string().describe("Protocol version this app supports.")})}),Lb=l.object({protocolVersion:l.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Dv.describe("Host application identification and version."),hostCapabilities:mI.describe("Features and capabilities provided by the host."),hostContext:Sb.describe("Rich context about the host environment.")}).passthrough();var RN={target:"draft-2020-12"};async function Ab(r,i){let v=r["~standard"];if(v.jsonSchema)return v.jsonSchema[i](RN);if(v.vendor==="zod"){let{z:u}=await Promise.resolve().then(() => (bv(),Z4));return u.toJSONSchema(r,{io:i})}throw Error(`Schema (vendor: ${v.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function jb(r,i,v=""){let u=await r["~standard"].validate(i);if(u.issues){let n=u.issues.map(($)=>{let t=$.path?.map((g)=>typeof g==="object"?g.key:g).join(".");return t?`${t}: ${$.message}`:$.message}).join("; ");throw Error(v+n)}return u.value}bv();function CN(){let r=document.documentElement.getAttribute("data-theme");if(r==="dark"||r==="light")return r;return document.documentElement.classList.contains("dark")?"dark":"light"}function eN(r){let i=document.documentElement;i.setAttribute("data-theme",r),i.style.colorScheme=r}function yN(r,i=document.documentElement){for(let[v,u]of Object.entries(r))if(u!==void 0)i.style.setProperty(v,u)}function fN(r){if(document.getElementById("__mcp-host-fonts"))return;let v=document.createElement("style");v.id="__mcp-host-fonts",v.textContent=r,document.head.appendChild(v)}var qJ="ui/resourceUri",xJ="text/html;profile=mcp-app";class eI extends lb{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(r){if(this._initializedSent)return;let i=`[ext-apps] App.${r}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(i);console.warn(`${i}. This will throw in a future release.`)}eventSchemas={toolinput:Nb,toolinputpartial:kb,toolresult:Pb,toolcancelled:Ob,hostcontextchanged:Jb};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(r){if(!eI.ONE_SHOT_EVENTS.has(r)||this._everHadListener.has(r))return;if(this._everHadListener.add(r),!this._initializedSent)return;let i=`[ext-apps] "${String(r)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(i);console.warn(i)}setEventHandler(r,i){if(i)this._assertHandlerTiming(r);super.setEventHandler(r,i)}addEventListener(r,i){this._assertHandlerTiming(r),super.addEventListener(r,i)}onEventDispatch(r,i){if(r==="hostcontextchanged")this._hostContext={...this._hostContext,...i}}constructor(r,i={},v={autoResize:!0}){super(v);this._appInfo=r;this._capabilities=i;this.options=v;if(!v.allowUnsafeEval)l.config({jitless:!0});this.setRequestHandler(yn,(u)=>{return console.log("Received ping:",u.params),{}}),this.setEventHandler("hostcontextchanged",void 0)}registerCapabilities(r){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._capabilities=MI(this._capabilities,r)}registerTool(r,i,v){if(this._registeredTools[r])throw Error(`Tool ${r} is already registered`);let u=this,n=()=>{if(u._initializedSent&&u._capabilities.tools?.listChanged)u.sendToolListChanged()},$=i.inputSchema!==void 0,t={title:i.title,description:i.description,inputSchema:i.inputSchema,outputSchema:i.outputSchema,annotations:i.annotations,_meta:i._meta,enabled:!0,enable(){this.enabled=!0,n()},disable(){this.enabled=!1,n()},update(g){Object.assign(this,g),n()},remove(){if(u._registeredTools[r]!==t)return;delete u._registeredTools[r],n()},handler:async(g,b)=>{if(!t.enabled)throw Error(`Tool ${r} is disabled`);let o;if($){let _=t.inputSchema,w=_?await jb(_,g??{},`Invalid input for tool ${r}: `):g??{};o=await v(w,b)}else o=await v(b);if(t.outputSchema&&!o.isError)o.structuredContent=await jb(t.outputSchema,o.structuredContent,`Invalid output for tool ${r}: `);return o}};if(this._registeredTools[r]=t,!this._capabilities.tools&&!this.transport)this.registerCapabilities({tools:{listChanged:!0}});return this.ensureToolHandlersInitialized(),n(),t}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){if(this._toolHandlersInitialized)return;this._toolHandlersInitialized=!0,this.oncalltool=async(r,i)=>{let v=this._registeredTools[r.name];if(!v)throw Error(`Tool ${r.name} not found`);return v.handler(r.arguments,i)},this.onlisttools=async(r,i)=>{return{tools:await Promise.all(Object.entries(this._registeredTools).filter(([u,n])=>n.enabled).map(async([u,n])=>{let $={name:u,title:n.title,description:n.description,inputSchema:n.inputSchema?await Ab(n.inputSchema,"input"):{type:"object",properties:{}}};if(n.outputSchema)$.outputSchema=await Ab(n.outputSchema,"output");if(n.annotations)$.annotations=n.annotations;if(n._meta)$._meta=n._meta;return $}))}}}async sendToolListChanged(r={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:r})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(r){this.setEventHandler("toolinput",r)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(r){this.setEventHandler("toolinputpartial",r)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(r){this.setEventHandler("toolresult",r)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(r){this.setEventHandler("toolcancelled",r)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(r){this.setEventHandler("hostcontextchanged",r)}_onteardown;get onteardown(){return this._onteardown}set onteardown(r){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,r),this._onteardown=r,this.replaceRequestHandler(cb,(i,v)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(i.params,v)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(r){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,r),this._oncalltool=r,this.replaceRequestHandler(vb,(i,v)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(i.params,v)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(r){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,r),this._onlisttools=r,this.replaceRequestHandler(ib,(i,v)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(i.params,v)})}assertCapabilityForMethod(r){switch(r){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${r})`);break}}assertRequestHandlerCapability(r){switch(r){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${r})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${r} registered`)}}assertNotificationCapability(r){}assertTaskCapability(r){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(r){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(r,i){if(this._assertInitialized("callServerTool"),typeof r==="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${r}"). Did you mean: callServerTool({ name: "${r}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:r},hn,{onprogress:()=>{},resetTimeoutOnProgress:!0,...i})}async readServerResource(r,i){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:r},h4,i)}async listServerResources(r,i){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:r},f4,i)}async createSamplingMessage(r,i){this._assertInitialized("createSamplingMessage");let v=r.tools?ub:$b;return await this.request({method:"sampling/createMessage",params:r},v,i)}sendMessage(r,i){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:r},wb,i)}sendLog(r){return this.notification({method:"notifications/message",params:r})}updateModelContext(r,i){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:r},Xu,i)}openLink(r,i){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:r},Ub,i)}sendOpenLink=this.openLink;downloadFile(r,i){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:r},Db,i)}requestTeardown(r={}){return this.notification({method:"ui/notifications/request-teardown",params:r})}requestDisplayMode(r,i){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:r},zb,i)}sendSizeChanged(r){return this.notification({method:"ui/notifications/size-changed",params:r})}setupSizeChangedNotifications(){let r=!1,i=0,v=0,u=()=>{if(r)return;r=!0,requestAnimationFrame(()=>{r=!1;let $=document.documentElement,t=$.style.height;$.style.height="max-content";let g=Math.ceil($.getBoundingClientRect().height);$.style.height=t;let b=Math.ceil(window.innerWidth);if(b!==i||g!==v)i=b,v=g,this.sendSizeChanged({width:b,height:g})})};u();let n=new ResizeObserver(u);return n.observe(document.documentElement),n.observe(document.body),()=>n.disconnect()}async connect(r=new Mu(window.parent,window.parent),i){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1,await super.connect(r);try{let v=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:bb}},Lb,i);if(v===void 0)throw Error(`Server sent invalid initialize result: ${v}`);if(this._hostCapabilities=v.hostCapabilities,this._hostInfo=v.hostInfo,this._hostContext=v.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize)this.setupSizeChangedNotifications()}catch(v){throw this.close(),v}}}export{CN as getDocumentTheme,yN as applyHostStyleVariables,fN as applyHostFonts,eN as applyDocumentTheme,zN as TOOL_RESULT_METHOD,_b as TOOL_INPUT_PARTIAL_METHOD,cN as TOOL_INPUT_METHOD,PN as TOOL_CANCELLED_METHOD,ON as SIZE_CHANGED_METHOD,kN as SANDBOX_RESOURCE_READY_METHOD,NN as SANDBOX_PROXY_READY_METHOD,qJ as RESOURCE_URI_META_KEY,LN as RESOURCE_TEARDOWN_METHOD,xJ as RESOURCE_MIME_TYPE,JN as REQUEST_TEARDOWN_METHOD,WN as REQUEST_DISPLAY_MODE_METHOD,lb as ProtocolWithEvents,Mu as PostMessageTransport,UN as OPEN_LINK_METHOD,ZN as McpUiUpdateModelContextRequestSchema,CI as McpUiToolVisibilitySchema,Pb as McpUiToolResultNotificationSchema,TN as McpUiToolMetaSchema,kb as McpUiToolInputPartialNotificationSchema,Nb as McpUiToolInputNotificationSchema,Ob as McpUiToolCancelledNotificationSchema,qI as McpUiThemeSchema,Ib as McpUiSupportedContentBlockModalitiesSchema,YN as McpUiSizeChangedNotificationSchema,xN as McpUiSandboxResourceReadyNotificationSchema,KN as McpUiSandboxProxyReadyNotificationSchema,QN as McpUiResourceTeardownResultSchema,cb as McpUiResourceTeardownRequestSchema,xu as McpUiResourcePermissionsSchema,HN as McpUiResourceMetaSchema,qu as McpUiResourceCspSchema,BN as McpUiRequestTeardownNotificationSchema,zb as McpUiRequestDisplayModeResultSchema,EN as McpUiRequestDisplayModeRequestSchema,Ub as McpUiOpenLinkResultSchema,VN as McpUiOpenLinkRequestSchema,wb as McpUiMessageResultSchema,qN as McpUiMessageRequestSchema,FN as McpUiInitializedNotificationSchema,Lb as McpUiInitializeResultSchema,mN as McpUiInitializeRequestSchema,ZI as McpUiHostStylesSchema,xI as McpUiHostCssSchema,Sb as McpUiHostContextSchema,Jb as McpUiHostContextChangedNotificationSchema,mI as McpUiHostCapabilitiesSchema,Db as McpUiDownloadFileResultSchema,MN as McpUiDownloadFileRequestSchema,pn as McpUiDisplayModeSchema,RI as McpUiAppCapabilitiesSchema,wN as MESSAGE_METHOD,bb as LATEST_PROTOCOL_VERSION,AN as INITIALIZE_METHOD,jN as INITIALIZED_METHOD,SN as HOST_CONTEXT_CHANGED_METHOD,DN as DOWNLOAD_FILE_METHOD,eI as App}; diff --git a/playground/pagx-preview/static/icons/next.png b/playground/pagx-preview/static/icons/next.png new file mode 100755 index 0000000000..988a0d2e32 --- /dev/null +++ b/playground/pagx-preview/static/icons/next.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18ebfd712d4bd763b6e991a90718737f02718dc151bd1718c3da3535b9eabd17 +size 1827 diff --git a/playground/pagx-preview/static/icons/pause.png b/playground/pagx-preview/static/icons/pause.png new file mode 100644 index 0000000000..cca72b0404 --- /dev/null +++ b/playground/pagx-preview/static/icons/pause.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47f8a2689ab77e45f245ce1be9463328dd28f40a6bda77f385d92c2b5525c4c5 +size 9465 diff --git a/playground/pagx-preview/static/icons/play.png b/playground/pagx-preview/static/icons/play.png new file mode 100755 index 0000000000..e96dd9160c --- /dev/null +++ b/playground/pagx-preview/static/icons/play.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02d6327ab57f8d524c942c12648ea8ceb6be2accf10948b5039585e4578e22c2 +size 10365 diff --git a/playground/pagx-preview/static/icons/previous.png b/playground/pagx-preview/static/icons/previous.png new file mode 100755 index 0000000000..05de8888b5 --- /dev/null +++ b/playground/pagx-preview/static/icons/previous.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51be6154e4d8b6b0568c1b9d2d7ee745bb07049ea6a169da3b67232c13bba76d +size 1813 diff --git a/playground/pagx-preview/static/index.css b/playground/pagx-preview/static/index.css new file mode 100644 index 0000000000..e74965669b --- /dev/null +++ b/playground/pagx-preview/static/index.css @@ -0,0 +1,134 @@ +/* + * Tencent is pleased to support the open source community by making libpag available. + * Copyright (C) 2026 Tencent. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + */ + +/* Preview-only chrome around the shared PAGXPlayer component. Canvas / toolbar / playback bar + * styles ship with pagx-player itself (see pagx-player/src/styles.ts) so this file only owns + * the base layout and the preview-specific overlays. */ + +html, body { + padding: 0; + margin: 0; + height: 100%; + overflow: hidden; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif; + background: #1a1a2e; + color: #fff; +} + +#container { + position: relative; + width: 100%; + height: 100%; + overflow: hidden; +} + +/* Editor-open layout (canvas / toolbar / playback bar reflow next to the panel) is handled + entirely inside the pagx-player root wrapper - see pagx-player/src/styles.ts's + .pagx-player-root.with-editor rule. #container just provides the sizing frame. */ + +/* Status pill styles live in pagx-player (see pagx-player/src/styles.ts) so both playground and + preview render identical status chrome; the preview only owns the elements that don't belong + to the component. */ + +/* Refresh banner shown when the tab regains focus after the file changed in the background. + More prominent than .status so users returning to the tab immediately notice the update. */ +.refresh-banner { + position: absolute; + left: 50%; + top: 24px; + transform: translateX(-50%); + padding: 10px 20px; + background: rgba(76, 124, 243, 0.92); + color: #fff; + border-radius: 999px; + font-size: 13px; + font-weight: 500; + letter-spacing: 0.02em; + box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); + pointer-events: none; + z-index: 250; + opacity: 1; + transition: opacity 0.4s ease; +} + +.refresh-banner.hidden { + opacity: 0; +} + +/* Persistent advisory shown only in drop sessions. Amber, distinct from the blue refresh + banner so users don't confuse "your file just changed" with "your file can't change". + Positioned in the top-right so it stays out of the drop-overlay's centered target. */ +.drop-hint { + position: absolute; + right: 24px; + top: 20px; + max-width: 360px; + display: flex; + align-items: flex-start; + gap: 8px; + padding: 10px 12px 10px 14px; + background: rgba(51, 39, 20, 0.95); + color: #f7d992; + border: 1px solid rgba(247, 217, 146, 0.35); + border-radius: 8px; + font-size: 12px; + line-height: 1.4; + box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); + z-index: 200; +} + +.drop-hint.hidden { + display: none; +} + +.drop-hint code { + padding: 0 4px; + background: rgba(247, 217, 146, 0.14); + border-radius: 3px; + font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, monospace; + font-size: 11px; +} + +.drop-hint-close { + flex-shrink: 0; + padding: 0; + width: 18px; + height: 18px; + line-height: 1; + background: transparent; + color: inherit; + border: none; + font-size: 16px; + cursor: pointer; + opacity: 0.7; +} + +.drop-hint-close:hover { + opacity: 1; +} + +/* Drag overlay for dropping .pagx files. Kept subtle so it doesn't blow up on stray drags but + clearly signals the drop zone once a file is over the window. */ +.drop-overlay { + position: absolute; + inset: 0; + background: rgba(26, 26, 46, 0.7); + border: 3px dashed rgba(255, 255, 255, 0.45); + display: flex; + align-items: center; + justify-content: center; + color: #fff; + font-size: 20px; + font-weight: 500; + pointer-events: none; + opacity: 0; + transition: opacity 0.15s ease; + z-index: 300; +} + +.drop-overlay.active { + opacity: 1; +} diff --git a/playground/pagx-preview/static/index.html b/playground/pagx-preview/static/index.html new file mode 100644 index 0000000000..ae8b37e63a --- /dev/null +++ b/playground/pagx-preview/static/index.html @@ -0,0 +1,33 @@ + + + + + + + PAGX Preview + + + + +
+ + + +
Drop .pagx file to preview
+
+ + + diff --git a/playground/pagx-preview/static/index.js b/playground/pagx-preview/static/index.js new file mode 100644 index 0000000000..7e45418214 --- /dev/null +++ b/playground/pagx-preview/static/index.js @@ -0,0 +1,596 @@ +/* + * Tencent is pleased to support the open source community by making libpag available. + * Copyright (C) 2026 Tencent. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + */ + +// Preview client: instantiates the shared PAGXPlayer component (canvas / gestures / playback +// bar / toolbar) and layers preview-only chrome on top - session-aware fetches, SSE-driven +// reloads, drop-to-open, status pill, refresh banner. Everything player-related now lives in +// pagx-player; this file is deliberately kept small and preview-specific. + +import { PAGXPlayer } from '/static/player/pagx-player.esm.js'; + +const SESSION_MATCH = window.location.pathname.match(/^\/session\/([^/]+)\//); +if (!SESSION_MATCH) { + // No player yet at this point, so fall back to a plain full-screen text overlay for the + // one bad-URL case; the normal status pill is a player concern and is unavailable here. + const el = document.createElement('div'); + el.textContent = 'Invalid session URL'; + el.style.cssText = + 'position:fixed;inset:0;display:flex;align-items:center;justify-content:center;' + + 'color:#fff;background:rgba(220,53,69,0.85);font-size:14px;z-index:9999;'; + document.body.appendChild(el); + throw new Error('pagx-preview: cannot determine session id from URL'); +} +const SESSION_ID = SESSION_MATCH[1]; +const SESSION_BASE = `/session/${SESSION_ID}`; + +const container = document.getElementById('container'); +const refreshBanner = document.getElementById('refresh-banner'); +const dropOverlay = document.getElementById('drop-overlay'); +const dropHint = document.getElementById('drop-hint'); + +// Drop sessions are identified server-side by a `drop-` prefix on the random session id. Those +// sessions are memory-only and can't be watched for filesystem changes (the browser never gives +// us the file's absolute path), so surface a persistent hint pointing users at the CLI when we +// detect we're rendering one of them. +if (/\/session\/drop-/.test(window.location.pathname)) { + dropHint?.classList.remove('hidden'); + document.getElementById('drop-hint-close')?.addEventListener('click', () => { + dropHint?.classList.add('hidden'); + }); +} + +// ---------- Status pill + refresh banner ---------- + +// Thin wrapper around player.showStatus so preview code keeps its concise call sites. Declared +// as a function (hoisted) because a few status calls sit above the player instantiation below. +// The player instance is initialized before any of these calls actually run (all callers are +// inside async functions or event handlers), so `player` is guaranteed to exist by then. +function showStatus(text, isError = false, autoHideMs = 0) { + player.showStatus(text, { + kind: isError ? 'error' : 'info', + autoHideMs, + }); +} + +let refreshBannerTimer = null; +function showRefreshBanner(text, autoHideMs = 1600) { + refreshBanner.textContent = text; + refreshBanner.classList.remove('hidden'); + clearTimeout(refreshBannerTimer); + if (autoHideMs > 0) { + refreshBannerTimer = setTimeout(() => refreshBanner.classList.add('hidden'), autoHideMs); + } +} + +// ---------- Viewer module loading (glue file + wasm) ---------- + +let PAGXInit = null; +let viewerInfo = null; +let fontsRegistered = false; + +async function loadPagxInit() { + if (PAGXInit) return PAGXInit; + const infoResp = await fetch('/static/viewer/info.json', { cache: 'no-store' }); + if (!infoResp.ok) throw new Error(`fetch viewer info failed: ${infoResp.status}`); + viewerInfo = await infoResp.json(); + const glueUrl = `/static/viewer/${viewerInfo.glueFile}`; + const mod = await import(glueUrl); + PAGXInit = mod.PAGXInit; + return PAGXInit; +} + +async function moduleFactory() { + const init = await loadPagxInit(); + return init({ + locateFile: (file) => `/static/viewer/${file}`, + }); +} + +// ---------- Font registration ---------- + +// Downloads the primary + emoji fallback fonts from the server and hands them to the viewer. +// Empty buffers are acceptable (the C++ side treats them as "no override") so a partial +// availability (only primary, only emoji) still works. When the server reports that a lazy +// background download is in progress, an SSE 'fonts-ready' event later triggers another call +// to this function so the current view picks up the fonts without a manual refresh. +async function registerFallbackFonts(view) { + if (fontsRegistered) return; + try { + const listResp = await fetch('/fonts/list', { cache: 'no-store' }); + if (!listResp.ok) return; + const info = await listResp.json(); + const fonts = info?.fonts || {}; + const primaryName = fonts.primary; + const emojiName = fonts.emoji; + if (!primaryName && !emojiName) { + if (info?.downloading) { + console.info('pagx-preview: fonts downloading in background; will retry on fonts-ready.'); + } else { + console.warn('pagx-preview: no fallback fonts available; text will render blank.'); + } + return; + } + const [primaryData, emojiData] = await Promise.all([ + fetchFontBytes(primaryName), + fetchFontBytes(emojiName), + ]); + view.registerFonts(primaryData, emojiData); + // Consider registration complete only when both slots are populated; partial results still + // allow a retry after the background download fills in the missing role. + if (primaryName && emojiName) fontsRegistered = true; + } catch (err) { + console.warn('pagx-preview: font registration failed', err); + } +} + +async function fetchFontBytes(name) { + if (!name) return new Uint8Array(0); + const resp = await fetch(`/fonts/${encodeURIComponent(name)}`, { cache: 'force-cache' }); + if (!resp.ok) { + console.warn(`pagx-preview: font ${name} -> ${resp.status}`); + return new Uint8Array(0); + } + return new Uint8Array(await resp.arrayBuffer()); +} + +// ---------- Resource cache and invalidation ---------- + +// Client-side cache for external resource bytes keyed by the relative path the pagx references. +// External resources rarely change compared to the pagx XML itself (AI edits typically only +// tweak colors/positions/text), so caching them saves the whole fetch + arrayBuffer decode +// round-trip on every reload. The wasm loadFileData() call still has to run every time because +// parsePAGX() resets the underlying document. +const resourceCache = new Map(); + +// Absolute paths (as reported by the server's `reload` event) whose bytes we need to re-fetch +// on the next loadPAGX. Populated when the SSE payload names a specific changed file so the +// resource cache below only invalidates that one entry instead of dumping everything. +let invalidatedResources = new Set(); + +function consumeInvalidations() { + const invalidations = invalidatedResources; + invalidatedResources = new Set(); + if (invalidations === null) { + resourceCache.clear(); + } else if (invalidations.size > 0) { + // We can't map absolute watcher paths back to the relative paths the client cache uses + // without rebuilding the server's rel->abs table here, so simplify: if any invalidated + // path doesn't look like a .pagx source, treat it as "some resource changed" and drop + // the whole resource cache. When *only* .pagx files show up we keep every cached resource. + const nonPagx = [...invalidations].some((p) => !p.toLowerCase().endsWith('.pagx')); + if (nonPagx) resourceCache.clear(); + } +} + +// External paths in PAGX are '/'-separated and may contain characters that must be encoded per +// URL segment while preserving the segment structure. +function encodeExternalPath(rel) { + return rel + .split('/') + .map((seg) => encodeURIComponent(seg)) + .join('/'); +} + +// Records how many cache hits occurred during the current load pipeline. The player calls the +// resolveResource callback for every relative path, and we want to log the aggregate count in +// the summary line, so we track it on a module-scoped counter rather than plumbing an extra +// return value through the resolver signature. +let cacheHitsThisLoad = 0; + +async function resolveResource(rel) { + const cached = resourceCache.get(rel); + if (cached) { + cacheHitsThisLoad += 1; + return cached; + } + try { + const resp = await fetch( + `${SESSION_BASE}/resources/${encodeExternalPath(rel)}`, + { cache: 'no-store' } + ); + if (!resp.ok) { + console.warn(`pagx-preview: resource ${rel} -> ${resp.status}`); + return null; + } + const buf = new Uint8Array(await resp.arrayBuffer()); + resourceCache.set(rel, buf); + return buf; + } catch (err) { + console.warn(`pagx-preview: resource ${rel} failed`, err); + return null; + } +} + +// ---------- Performance measurement ---------- + +// Wraps the User Timing API so every load cycle marks distinct start/end points that the +// browser Performance panel can visualize, plus emits a compact console summary that's useful +// when DevTools is closed. +let perfCycleId = 0; +function makePerf(label) { + const cycle = ++perfCycleId; + const total = `${label}.${cycle}.total`; + performance.mark(`${total}.start`); + const stages = []; + return { + begin(stage) { + performance.mark(`${label}.${cycle}.${stage}.start`); + }, + end(stage) { + performance.mark(`${label}.${cycle}.${stage}.end`); + const measure = performance.measure( + `${label}.${cycle}.${stage}`, + `${label}.${cycle}.${stage}.start`, + `${label}.${cycle}.${stage}.end` + ); + stages.push({ stage, dur: measure.duration }); + }, + summarize() { + performance.mark(`${total}.end`); + const measure = performance.measure(total, `${total}.start`, `${total}.end`); + const stageStrs = stages.map((s) => `${s.stage}=${s.dur.toFixed(1)}ms`).join(' '); + // eslint-disable-next-line no-console + console.log( + `[pagx-preview] loadPAGX total=${measure.duration.toFixed(1)}ms | ${stageStrs}` + ); + }, + }; +} + +// Give the browser one frame + one microtask hop so any pending status/DOM updates paint +// before the caller launches another multi-second synchronous wasm call. Two-step wait: rAF +// alone can coalesce with the same task, chaining a subsequent setTimeout(0) makes the paint +// definitely land first. Cheap when the browser is idle; the cost is negligible compared to +// parsePAGX/buildLayers timings on large documents. +function yieldToBrowser() { + return new Promise((resolve) => { + requestAnimationFrame(() => setTimeout(resolve, 0)); + }); +} + +// ---------- Player instance ---------- + +const player = new PAGXPlayer({ + container, + moduleFactory, + iconBaseUrl: '/static/icons/', + // Source editor is enabled here so `L` opens the panel and the toolbar shows the + // button. Apply routes the edited XML back through the wasm pipeline; Save downloads a + // copy since the preview server never persists edits (the file on disk is authoritative + // and the user is expected to edit it directly for durable changes). + enableEditor: true, + editorCallbacks: { + // Async apply: the editor awaits this and keeps the buttons disabled + "Applying..." + // status visible until the whole pipeline settles. Errors returned as a non-empty string + // are rendered by the editor as a red status pill; a thrown error is treated the same + // way. `silent: true` prevents the internal loadPAGX status ("Parsing.../Loaded") from + // fighting with the editor's own "Applying.../Changes applied" for the shared pill. + onApply: async (xmlText) => { + try { + const bytes = new TextEncoder().encode(xmlText); + await loadPAGXFromBytes(bytes, { silent: true }); + return ''; + } catch (err) { + return `Apply failed: ${err && err.message ? err.message : String(err)}`; + } + }, + // Preview owns a real filesystem path (unlike the playground which downloads a copy), so + // Save writes back to the entry pagx via the server. The write triggers the session's + // file watcher, which broadcasts a `reload` SSE - the client picks that up on the same + // loop it uses for external IDE edits, so no manual refresh is needed here. + onSave: async (xmlText) => { + try { + const resp = await fetch(`${SESSION_BASE}/pagx`, { + method: 'PUT', + headers: { 'Content-Type': 'application/xml' }, + body: xmlText, + }); + if (!resp.ok) { + const info = await resp.json().catch(() => ({ error: `status ${resp.status}` })); + return `Save failed: ${info.error}`; + } + return ''; + } catch (err) { + return `Save failed: ${err && err.message ? err.message : String(err)}`; + } + }, + }, +}); + +// ---------- Load pipeline ---------- + +let loading = false; +let reloadQueued = false; +// Captures the strategy chosen by the most recent player.load() call. Populated by the 'loaded' +// event listener installed below and consumed once per load in loadPAGXFromBytes. A plain module +// scoped variable is enough because player.load()'s internal generation gate guarantees a single +// 'loaded' dispatch per completed load and loadPAGXFromBytes drains this value in the same +// microtask that resolves the await. +let lastLoadStrategy = 'fullReplace'; +player.addEventListener('loaded', (event) => { + // 'strategy' was added by the V0 update pipeline; older host builds still fire 'loaded' + // without it, in which case we assume the historical full-replace behavior for backward + // compatibility. + lastLoadStrategy = event.detail.strategy || 'fullReplace'; +}); + +// Wraps player.load() with preview chrome (status/perf/invalidation/external-path report). +// Split from loadPAGX() so the editor's Apply callback can feed edited XML through the exact +// same pipeline as an SSE-driven reload without re-fetching from the server. +// `silent` suppresses the pipeline's own status updates so a caller that already owns the +// status slot (e.g. the editor showing "Changes applied") isn't fighting with "Parsing..." +// and "Loaded" for the same pill - which would otherwise leave the caller's message visible +// for only a fraction of a second before the wasm-load path overwrites it. +async function loadPAGXFromBytes(pagxBuf, { silent = false } = {}) { + if (loading) { + reloadQueued = true; + return; + } + loading = true; + cacheHitsThisLoad = 0; + consumeInvalidations(); + + const perf = makePerf('loadPAGX'); + try { + if (!silent) showStatus('Parsing document...'); + await yieldToBrowser(); + + perf.begin('load'); + // The player performs updatePAGX -> font registration -> resource fetch -> buildLayers -> + // first draw internally. Font registration and resource resolution are handled via the + // callbacks below. The pagx-preview stage-level timing that the old flat pipeline reported + // is now folded into the single 'load' stage; the component's internal marks still show up + // in the Performance panel for detailed profiling. + await player.load(pagxBuf, { + registerFonts: async (view) => { + // Font registration is idempotent and fast (bytes come from HTTP cache after the first + // hit), so calling it on every reload keeps behavior consistent whether or not the + // wasm view was recycled by the player. + await registerFallbackFonts(view); + }, + resolveResource, + preserveCurrentTime: true, + }); + perf.end('load'); + + // Skip the noise-side-effects entirely on a noChange short-circuit. The bytes were + // byte-identical to the previously accepted document, so the external path list can't + // have changed and re-POSTing it would only expand the server's watcher noise. The + // "Loaded" pill is also suppressed: chokidar's rename/attr/content bursts routinely fire + // 2-3 SSE reloads for a single save, and after V0 only the first one produces a real + // update — flashing three "Loaded" pills for what the user perceives as a single save + // is exactly what the equality short-circuit is meant to fix. + if (lastLoadStrategy === 'noChange') { + perf.summarize(); + // eslint-disable-next-line no-console + console.log('[pagx-preview] noChange short-circuit'); + return; + } + + // Report the resource list so the server extends its watch to referenced images/fonts. + // Fire-and-forget: only used to widen the file watcher scope on the server side. + try { + const view = player.getView(); + const externalPaths = view ? view.getExternalFilePaths() : []; + fetch(`${SESSION_BASE}/resources`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ paths: externalPaths }), + }).catch(() => {}); + // eslint-disable-next-line no-console + console.log( + `[pagx-preview] resources=${externalPaths.length} (cache hits=${cacheHitsThisLoad})` + ); + // Upload a document summary so the MCP get_document tool can answer AI queries without a + // client round-trip. nodeCount is not exposed by the viewer yet; we send 0 and let the + // MCP tool report "0 nodes" rather than blocking. A future viewer API can populate it. + if (view) { + const summary = { + nodeCount: 0, + width: view.contentWidth(), + height: view.contentHeight(), + duration: view.durationMicros(), + frameRate: view.frameRate(), + }; + fetch(`${SESSION_BASE}/document`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(summary), + }).catch(() => {}); + } + } catch (_) { + // getView() may return null in a very narrow race (destroy fired mid-load); ignore. + } + + perf.summarize(); + if (!silent) showStatus('Loaded', false, 1200); + } catch (err) { + console.error('pagx-preview: load failed', err); + if (silent) { + // Silent callers (editor Apply) own their own status pill; rethrow so they can surface + // the error via the editor's own feedback path instead of the pipeline stealing focus + // with a global "Load failed" pill. + throw err; + } + showStatus(`Load failed: ${err.message || err}`, true); + } finally { + loading = false; + if (reloadQueued) { + reloadQueued = false; + // Refetch the server's current bytes rather than replaying the buffer we just loaded: + // a reload arriving while a load was in flight means the file changed again on disk. + loadPAGX(); + } + } +} + +// Server-fetch wrapper around loadPAGXFromBytes(). Used by boot, SSE reload, and every other +// "re-fetch and render" path. +async function loadPAGX() { + try { + showStatus('Loading document...'); + const perf = makePerf('fetchPagx'); + perf.begin('fetch'); + const pagxResp = await fetch(`${SESSION_BASE}/pagx`, { cache: 'no-store' }); + if (!pagxResp.ok) throw new Error(`fetch pagx failed: ${pagxResp.status}`); + const pagxBuf = new Uint8Array(await pagxResp.arrayBuffer()); + perf.end('fetch'); + perf.summarize(); + await loadPAGXFromBytes(pagxBuf); + } catch (err) { + console.error('pagx-preview: fetch failed', err); + showStatus(`Fetch failed: ${err.message || err}`, true); + } +} + +// ---------- SSE (server-sent events) ---------- + +// Set to true when a 'reload' arrives while the tab is hidden. On visibilitychange -> visible +// we consume the flag and refresh once, so a background tab doesn't burn cycles reloading +// (and potentially reloading again while still loading) while its user isn't looking. +let pendingBackgroundReload = false; + +function connectSSE() { + const es = new EventSource(`${SESSION_BASE}/events`); + es.addEventListener('reload', (ev) => { + // The server emits payloads like {type:'reload', file:'/abs/path', event:'change'}. `file` + // may point at the pagx itself or at an external resource; either way, remember it so the + // resource cache can skip untouched files. Silently degrade if the payload is malformed. + try { + const data = JSON.parse(ev.data); + if (typeof data?.file === 'string' && data.file.length > 0) { + invalidatedResources.add(data.file); + } + } catch (_) { + // No payload / bad JSON: fall back to a full cache flush so we don't render stale bytes. + invalidatedResources = null; + } + if (document.hidden) { + // Coalesce every reload received while hidden into a single refresh on return. + pendingBackgroundReload = true; + return; + } + showStatus('Reloading...'); + loadPAGX(); + }); + es.addEventListener('focus', () => { + // Browsers routinely ignore window.focus() outside a user gesture; call it anyway so the + // CLI's "reuse existing tab" flow at least has a chance to work on browsers that allow it. + try { + window.focus(); + } catch (_) { + // ignore + } + }); + es.addEventListener('patch', (ev) => { + // MCP-driven incremental patch: the server emitted a set of channel ops for the live + // document. Forward to player.applyPatch for <10ms incremental update without reload. + try { + const data = JSON.parse(ev.data); + if (data.ops && player) { + const result = player.applyPatch(data.ops); + // eslint-disable-next-line no-console + console.log('[patch] applied:', result); + } + } catch (e) { + // eslint-disable-next-line no-console + console.error('[patch] failed:', e); + } + }); + es.addEventListener('fonts-ready', async () => { + // The background font download finished. Re-register so the currently displayed PAGX picks + // up the newly available glyphs; then repaint by re-running the load pipeline. + const view = player.getView(); + if (view) await registerFallbackFonts(view); + if (fontsRegistered) { + showStatus('Fonts loaded', false, 1200); + loadPAGX(); + } + }); + es.onerror = () => { + if (es.readyState === EventSource.CLOSED) { + showStatus('Disconnected', true); + } + }; + return es; +} + +document.addEventListener('visibilitychange', () => { + // Apply any file changes that arrived while the tab was hidden. The banner makes the update + // visible enough that the user notices even if the visual delta is subtle. The player itself + // handles start()/stop() on visibility change internally. + if (!document.hidden && pendingBackgroundReload) { + pendingBackgroundReload = false; + showRefreshBanner('File updated, refreshing...'); + loadPAGX(); + } +}); + +// ---------- Drag & drop for opening additional PAGX files ---------- + +let dragCounter = 0; + +function isPagxDrag(e) { + const items = e.dataTransfer?.items; + if (!items) return false; + for (const item of items) { + if (item.kind === 'file') return true; + } + return false; +} + +window.addEventListener('dragenter', (e) => { + if (!isPagxDrag(e)) return; + e.preventDefault(); + dragCounter++; + dropOverlay.classList.add('active'); +}); +window.addEventListener('dragover', (e) => { + if (!isPagxDrag(e)) return; + // preventDefault is required for the browser to treat the element as a drop target. + e.preventDefault(); +}); +window.addEventListener('dragleave', (e) => { + if (!isPagxDrag(e)) return; + dragCounter = Math.max(0, dragCounter - 1); + if (dragCounter === 0) dropOverlay.classList.remove('active'); +}); +window.addEventListener('drop', async (e) => { + if (!isPagxDrag(e)) return; + e.preventDefault(); + dragCounter = 0; + dropOverlay.classList.remove('active'); + const file = e.dataTransfer?.files?.[0]; + if (!file) return; + if (!file.name.toLowerCase().endsWith('.pagx')) { + showStatus('Only .pagx files can be dropped', true, 2500); + return; + } + try { + const buf = await file.arrayBuffer(); + // Browsers don't hand us the absolute filesystem path, so live watch isn't possible for + // dropped files. The server keeps the bytes in memory for a one-shot preview. + const resp = await fetch(`/session/drop?name=${encodeURIComponent(file.name)}`, { + method: 'POST', + headers: { 'Content-Type': 'application/octet-stream' }, + body: buf, + }); + if (!resp.ok) throw new Error(`server returned ${resp.status}`); + const info = await resp.json(); + const target = window.location.origin + info.url; + window.open(target, '_blank', 'noopener'); + } catch (err) { + console.error('pagx-preview: drop upload failed', err); + showStatus(`Drop failed: ${err.message || err}`, true, 3000); + } +}); + +// ---------- Boot ---------- + +(async function main() { + await loadPAGX(); + connectSSE(); +})(); diff --git a/playground/pagx-preview/static/mcp-widget.bundle.js b/playground/pagx-preview/static/mcp-widget.bundle.js new file mode 100644 index 0000000000..029fd9aba8 --- /dev/null +++ b/playground/pagx-preview/static/mcp-widget.bundle.js @@ -0,0 +1,667 @@ +var Kw=Object.defineProperty,Gw=i=>i;function Yw(i,e){this[i]=Gw.bind(null,e)}var Et=(i,e)=>{for(var t in e)Kw(i,t,{get:e[t],enumerable:!0,configurable:!0,set:Yw.bind(e,t)})},T=(i,e)=>()=>(i&&(e=i(i=0)),e);function y(i,e,t){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(i))return;a._zod.traits.add(i),e(a,l);let u=o.prototype,c=Object.keys(u);for(let h=0;ht?.Parent&&a instanceof t.Parent?!0:a?._zod?.traits?.has(i)}),Object.defineProperty(o,"name",{value:i}),o}function Te(i){return i&&Object.assign(xr,i),xr}var Ho,Wo,ti,kr,xr,Or=T(()=>{Ho=Object.freeze({status:"aborted"}),Wo=Symbol("zod_brand"),ti=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},kr=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},xr={}}),X={};Et(X,{unwrapMessage:()=>vr,uint8ArrayToHex:()=>w$,uint8ArrayToBase64url:()=>k$,uint8ArrayToBase64:()=>av,stringifyPrimitive:()=>L,slugify:()=>nv,shallowClone:()=>rv,safeExtend:()=>p$,required:()=>v$,randomString:()=>l$,propertyKeyTypes:()=>wr,promiseAllObject:()=>a$,primitiveTypes:()=>Ou,prefixIssues:()=>kt,pick:()=>h$,partial:()=>g$,parsedType:()=>B,optionalKeys:()=>sv,omit:()=>d$,objectClone:()=>r$,numKeys:()=>u$,nullish:()=>$i,normalizeParams:()=>_,mergeDefs:()=>Vt,merge:()=>m$,jsonStringifyReplacer:()=>Oo,joinValues:()=>S,issue:()=>Io,isPlainObject:()=>Ei,isObject:()=>on,hexToUint8Array:()=>x$,getSizableOrigin:()=>So,getParsedType:()=>$$,getLengthableOrigin:()=>_o,getEnumValues:()=>Su,getElementAtPath:()=>o$,floatSafeRemainder:()=>iv,finalizeIssue:()=>ct,extend:()=>f$,escapeRegex:()=>qt,esc:()=>hu,defineLazy:()=>W,createTransparentProxy:()=>c$,cloneDef:()=>s$,clone:()=>Ye,cleanRegex:()=>$o,cleanEnum:()=>b$,captureStackTrace:()=>Vo,cached:()=>br,base64urlToUint8Array:()=>y$,base64ToUint8Array:()=>ov,assignProp:()=>ri,assertNotEqual:()=>e$,assertNever:()=>i$,assertIs:()=>t$,assertEqual:()=>Qw,assert:()=>n$,allowsEval:()=>_u,aborted:()=>_i,NUMBER_FORMAT_RANGES:()=>Iu,Class:()=>du,BIGINT_FORMAT_RANGES:()=>Cu});function Qw(i){return i}function e$(i){return i}function t$(i){}function i$(i){throw Error("Unexpected value in exhaustive check")}function n$(i){}function Su(i){let e=Object.values(i).filter(t=>typeof t=="number");return Object.entries(i).filter(([t,r])=>e.indexOf(+t)===-1).map(([t,r])=>r)}function S(i,e="|"){return i.map(t=>L(t)).join(e)}function Oo(i,e){return typeof e=="bigint"?e.toString():e}function br(i){return{get value(){{let e=i();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function $i(i){return i==null}function $o(i){let e=i.startsWith("^")?1:0,t=i.endsWith("$")?i.length-1:i.length;return i.slice(e,t)}function iv(i,e){let t=(i.toString().split(".")[1]||"").length,r=e.toString(),n=(r.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(r)){let l=r.match(/\d?e-(\d?)/);l?.[1]&&(n=Number.parseInt(l[1]))}let s=t>n?t:n,o=Number.parseInt(i.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return o%a/10**s}function W(i,e,t){let r;Object.defineProperty(i,e,{get(){if(r!==fu)return r===void 0&&(r=fu,r=t()),r},set(n){Object.defineProperty(i,e,{value:n})},configurable:!0})}function r$(i){return Object.create(Object.getPrototypeOf(i),Object.getOwnPropertyDescriptors(i))}function ri(i,e,t){Object.defineProperty(i,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Vt(...i){let e={};for(let t of i){let r=Object.getOwnPropertyDescriptors(t);Object.assign(e,r)}return Object.defineProperties({},e)}function s$(i){return Vt(i._zod.def)}function o$(i,e){return e?e.reduce((t,r)=>t?.[r],i):i}function a$(i){let e=Object.keys(i),t=e.map(r=>i[r]);return Promise.all(t).then(r=>{let n={};for(let s=0;se};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function c$(i){let e;return new Proxy({},{get(t,r,n){return e??(e=i()),Reflect.get(e,r,n)},set(t,r,n,s){return e??(e=i()),Reflect.set(e,r,n,s)},has(t,r){return e??(e=i()),Reflect.has(e,r)},deleteProperty(t,r){return e??(e=i()),Reflect.deleteProperty(e,r)},ownKeys(t){return e??(e=i()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(t,r){return e??(e=i()),Reflect.getOwnPropertyDescriptor(e,r)},defineProperty(t,r,n){return e??(e=i()),Reflect.defineProperty(e,r,n)}})}function L(i){return typeof i=="bigint"?i.toString()+"n":typeof i=="string"?`"${i}"`:`${i}`}function sv(i){return Object.keys(i).filter(e=>i[e]._zod.optin==="optional"&&i[e]._zod.optout==="optional")}function h$(i,e){let t=i._zod.def,r=t.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let n=Vt(i._zod.def,{get shape(){let s={};for(let o in e){if(!(o in t.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&(s[o]=t.shape[o])}return ri(this,"shape",s),s},checks:[]});return Ye(i,n)}function d$(i,e){let t=i._zod.def,r=t.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let n=Vt(i._zod.def,{get shape(){let s={...i._zod.def.shape};for(let o in e){if(!(o in t.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&delete s[o]}return ri(this,"shape",s),s},checks:[]});return Ye(i,n)}function f$(i,e){if(!Ei(e))throw Error("Invalid input to extend: expected a plain object");let t=i._zod.def.checks;if(t&&t.length>0){let n=i._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=Vt(i._zod.def,{get shape(){let n={...i._zod.def.shape,...e};return ri(this,"shape",n),n}});return Ye(i,r)}function p$(i,e){if(!Ei(e))throw Error("Invalid input to safeExtend: expected a plain object");let t=Vt(i._zod.def,{get shape(){let r={...i._zod.def.shape,...e};return ri(this,"shape",r),r}});return Ye(i,t)}function m$(i,e){let t=Vt(i._zod.def,{get shape(){let r={...i._zod.def.shape,...e._zod.def.shape};return ri(this,"shape",r),r},get catchall(){return e._zod.def.catchall},checks:[]});return Ye(i,t)}function g$(i,e,t){let r=e._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let n=Vt(e._zod.def,{get shape(){let s=e._zod.def.shape,o={...s};if(t)for(let a in t){if(!(a in s))throw Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=i?new i({type:"optional",innerType:s[a]}):s[a])}else for(let a in s)o[a]=i?new i({type:"optional",innerType:s[a]}):s[a];return ri(this,"shape",o),o},checks:[]});return Ye(e,n)}function v$(i,e,t){let r=Vt(e._zod.def,{get shape(){let n=e._zod.def.shape,s={...n};if(t)for(let o in t){if(!(o in s))throw Error(`Unrecognized key: "${o}"`);t[o]&&(s[o]=new i({type:"nonoptional",innerType:n[o]}))}else for(let o in n)s[o]=new i({type:"nonoptional",innerType:n[o]});return ri(this,"shape",s),s}});return Ye(e,r)}function _i(i,e=0){if(i.aborted===!0)return!0;for(let t=e;t{var r;return(r=t).path??(r.path=[]),t.path.unshift(i),t})}function vr(i){return typeof i=="string"?i:i?.message}function ct(i,e,t){let r={...i,path:i.path??[]};if(!i.message){let n=vr(i.inst?._zod.def?.error?.(i))??vr(e?.error?.(i))??vr(t.customError?.(i))??vr(t.localeError?.(i))??"Invalid input";r.message=n}return delete r.inst,delete r.continue,!e?.reportInput&&delete r.input,r}function So(i){return i instanceof Set?"set":i instanceof Map?"map":i instanceof File?"file":"unknown"}function _o(i){return Array.isArray(i)?"array":typeof i=="string"?"string":"unknown"}function B(i){let e=typeof i;switch(e){case"number":return Number.isNaN(i)?"nan":"number";case"object":{if(i===null)return"null";if(Array.isArray(i))return"array";let t=i;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return e}function Io(...i){let[e,t,r]=i;return typeof e=="string"?{message:e,code:"custom",input:t,inst:r}:{...e}}function b$(i){return Object.entries(i).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function ov(i){let e=atob(i),t=new Uint8Array(e.length);for(let r=0;re.toString(16).padStart(2,"0")).join("")}var du=class{constructor(...e){}},fu,Vo,_u,$$=i=>{let e=typeof i;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(i)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(i)?"array":i===null?"null":i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?"promise":typeof Map<"u"&&i instanceof Map?"map":typeof Set<"u"&&i instanceof Set?"set":typeof Date<"u"&&i instanceof Date?"date":typeof File<"u"&&i instanceof File?"file":"object";default:throw Error(`Unknown data type: ${e}`)}},wr,Ou,Iu,Cu,U=T(()=>{fu=Symbol("evaluating"),Vo="captureStackTrace"in Error?Error.captureStackTrace:(...i)=>{},_u=br(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}}),wr=new Set(["string","number","symbol"]),Ou=new Set(["string","number","bigint","boolean","symbol","undefined"]),Iu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Cu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]}});function Xo(i,e=t=>t.message){let t={},r=[];for(let n of i.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}function Jo(i,e=t=>t.message){let t={_errors:[]},r=n=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>r({issues:o}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)t._errors.push(e(s));else{let o=t,a=0;for(;at.message){let t={errors:[]},r=(n,s=[])=>{var o,a;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>r({issues:u},l.path));else if(l.code==="invalid_key")r({issues:l.issues},l.path);else if(l.code==="invalid_element")r({issues:l.issues},l.path);else{let u=[...s,...l.path];if(u.length===0){t.errors.push(e(l));continue}let c=t,h=0;for(;htypeof r=="object"?r.key:r);for(let r of t)typeof r=="number"?e.push(`[${r}]`):typeof r=="symbol"?e.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?e.push(`[${JSON.stringify(r)}]`):(e.length&&e.push("."),e.push(r));return e.join("")}function Eu(i){let e=[],t=[...i.issues].sort((r,n)=>(r.path??[]).length-(n.path??[]).length);for(let r of t)e.push(`\u2716 ${r.message}`),r.path?.length&&e.push(` \u2192 at ${lv(r.path)}`);return e.join(` +`)}var Og=(i,e)=>{i.name="$ZodError",Object.defineProperty(i,"_zod",{value:i._zod,enumerable:!1}),Object.defineProperty(i,"issues",{value:e,enumerable:!1}),i.message=JSON.stringify(e,Oo,2),Object.defineProperty(i,"toString",{value:()=>i.message,enumerable:!1})},Ko,He,uv=T(()=>{Or(),U(),Ko=y("$ZodError",Og),He=y("$ZodError",Og,{Parent:Error})}),Ir=i=>(e,t,r,n)=>{let s=r?Object.assign(r,{async:!1}):{async:!1},o=e._zod.run({value:t,issues:[]},s);if(o instanceof Promise)throw new ti;if(o.issues.length){let a=new(n?.Err??i)(o.issues.map(l=>ct(l,s,Te())));throw Vo(a,n?.callee),a}return o.value},Co,Cr=i=>async(e,t,r,n)=>{let s=r?Object.assign(r,{async:!0}):{async:!0},o=e._zod.run({value:t,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){let a=new(n?.Err??i)(o.issues.map(l=>ct(l,s,Te())));throw Vo(a,n?.callee),a}return o.value},To,Tr=i=>(e,t,r)=>{let n=r?{...r,async:!1}:{async:!1},s=e._zod.run({value:t,issues:[]},n);if(s instanceof Promise)throw new ti;return s.issues.length?{success:!1,error:new(i??Ko)(s.issues.map(o=>ct(o,n,Te())))}:{success:!0,data:s.value}},Go,Er=i=>async(e,t,r)=>{let n=r?Object.assign(r,{async:!0}):{async:!0},s=e._zod.run({value:t,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new i(s.issues.map(o=>ct(o,n,Te())))}:{success:!0,data:s.value}},Au,Du=i=>(e,t,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ir(i)(e,t,n)},cv,zu=i=>(e,t,r)=>Ir(i)(e,t,r),hv,Pu=i=>async(e,t,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Cr(i)(e,t,n)},dv,Mu=i=>async(e,t,r)=>Cr(i)(e,t,r),fv,Nu=i=>(e,t,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Tr(i)(e,t,n)},pv,Ru=i=>(e,t,r)=>Tr(i)(e,t,r),mv,Uu=i=>async(e,t,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Er(i)(e,t,n)},gv,Lu=i=>async(e,t,r)=>Er(i)(e,t,r),vv,bv=T(()=>{Or(),uv(),U(),Co=Ir(He),To=Cr(He),Go=Tr(He),Au=Er(He),cv=Du(He),hv=zu(He),dv=Pu(He),fv=Mu(He),pv=Nu(He),mv=Ru(He),gv=Uu(He),vv=Lu(He)}),si={};Et(si,{xid:()=>Fu,uuid7:()=>Ov,uuid6:()=>_v,uuid4:()=>Sv,uuid:()=>an,uppercase:()=>lc,unicodeEmail:()=>pu,undefined:()=>oc,ulid:()=>Zu,time:()=>xv,string:()=>Mv,sha512_hex:()=>Jv,sha512_base64url:()=>Gv,sha512_base64:()=>Kv,sha384_hex:()=>Wv,sha384_base64url:()=>Xv,sha384_base64:()=>Vv,sha256_hex:()=>Fv,sha256_base64url:()=>Hv,sha256_base64:()=>qv,sha1_hex:()=>jv,sha1_base64url:()=>Zv,sha1_base64:()=>Bv,rfc5322Email:()=>Cv,number:()=>Eo,null:()=>sc,nanoid:()=>Hu,md5_hex:()=>Rv,md5_base64url:()=>Lv,md5_base64:()=>Uv,mac:()=>Av,lowercase:()=>ac,ksuid:()=>qu,ipv6:()=>Ku,ipv4:()=>Ju,integer:()=>nc,idnEmail:()=>Tv,html5Email:()=>Iv,hostname:()=>Dv,hex:()=>Nv,guid:()=>Vu,extendedDuration:()=>$v,emoji:()=>yv,email:()=>Xu,e164:()=>ec,duration:()=>Wu,domain:()=>zv,datetime:()=>wv,date:()=>tc,cuid2:()=>Bu,cuid:()=>ju,cidrv6:()=>Yu,cidrv4:()=>Gu,browserEmail:()=>Ev,boolean:()=>rc,bigint:()=>ic,base64url:()=>Yo,base64:()=>Qu});function yv(){return new RegExp(S$,"u")}function kv(i){return typeof i.precision=="number"?i.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":i.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${i.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function xv(i){return new RegExp(`^${kv(i)}$`)}function wv(i){let e=kv({precision:i.precision}),t=["Z"];i.local&&t.push(""),i.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${e}(?:${t.join("|")})`;return new RegExp(`^${Pv}T(?:${r})$`)}function pr(i,e){return new RegExp(`^[A-Za-z0-9+/]{${i}}${e}$`)}function mr(i){return new RegExp(`^[A-Za-z0-9_-]{${i}}$`)}var ju,Bu,Zu,Fu,qu,Hu,Wu,$v,Vu,an=i=>i?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${i}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Sv,_v,Ov,Xu,Iv,Cv,pu,Tv,Ev,S$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ju,Ku,Av=i=>{let e=qt(i??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Gu,Yu,Qu,Yo,Dv,zv,ec,Pv="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",tc,Mv=i=>{let e=i?`[\\s\\S]{${i?.minimum??0},${i?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},ic,nc,Eo,rc,sc,oc,ac,lc,Nv,Rv,Uv,Lv,jv,Bv,Zv,Fv,qv,Hv,Wv,Vv,Xv,Jv,Kv,Gv,uc=T(()=>{U(),ju=/^[cC][^\s-]{8,}$/,Bu=/^[0-9a-z]+$/,Zu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Fu=/^[0-9a-vA-V]{20}$/,qu=/^[A-Za-z0-9]{27}$/,Hu=/^[a-zA-Z0-9_-]{21}$/,Wu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,$v=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Vu=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Sv=an(4),_v=an(6),Ov=an(7),Xu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Iv=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Cv=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,pu=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Tv=pu,Ev=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ju=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ku=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Gu=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Yu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Qu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yo=/^[A-Za-z0-9_-]*$/,Dv=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,zv=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ec=/^\+[1-9]\d{6,14}$/,tc=new RegExp(`^${Pv}$`),ic=/^-?\d+n?$/,nc=/^-?\d+$/,Eo=/^-?\d+(?:\.\d+)?$/,rc=/^(?:true|false)$/i,sc=/^null$/i,oc=/^undefined$/i,ac=/^[^A-Z]*$/,lc=/^[^a-z]*$/,Nv=/^[0-9a-fA-F]*$/,Rv=/^[0-9a-fA-F]{32}$/,Uv=pr(22,"=="),Lv=mr(22),jv=/^[0-9a-fA-F]{40}$/,Bv=pr(27,"="),Zv=mr(27),Fv=/^[0-9a-fA-F]{64}$/,qv=pr(43,"="),Hv=mr(43),Wv=/^[0-9a-fA-F]{96}$/,Vv=pr(64,""),Xv=mr(64),Jv=/^[0-9a-fA-F]{128}$/,Kv=pr(86,"=="),Gv=mr(86)});function Ig(i,e,t){i.issues.length&&e.issues.push(...kt(t,i.issues))}var ve,cu,Qo,ea,cc,hc,dc,fc,pc,mc,gc,vc,bc,sn,yc,kc,xc,wc,$c,Sc,_c,Oc,Ic,Cc=T(()=>{Or(),uc(),U(),ve=y("$ZodCheck",(i,e)=>{var t;i._zod??(i._zod={}),i._zod.def=e,(t=i._zod).onattach??(t.onattach=[])}),cu={number:"number",bigint:"bigint",object:"date"},Qo=y("$ZodCheckLessThan",(i,e)=>{ve.init(i,e);let t=cu[typeof e.value];i._zod.onattach.push(r=>{let n=r._zod.bag,s=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?r.value<=e.value:r.value{ve.init(i,e);let t=cu[typeof e.value];i._zod.onattach.push(r=>{let n=r._zod.bag,s=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),i._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:t,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:i,continue:!e.abort})}}),cc=y("$ZodCheckMultipleOf",(i,e)=>{ve.init(i,e),i._zod.onattach.push(t=>{var r;(r=t._zod.bag).multipleOf??(r.multipleOf=e.value)}),i._zod.check=t=>{if(typeof t.value!=typeof e.value)throw Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):iv(t.value,e.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:e.value,input:t.value,inst:i,continue:!e.abort})}}),hc=y("$ZodCheckNumberFormat",(i,e)=>{ve.init(i,e),e.format=e.format||"float64";let t=e.format?.includes("int"),r=t?"int":"number",[n,s]=Iu[e.format];i._zod.onattach.push(o=>{let a=o._zod.bag;a.format=e.format,a.minimum=n,a.maximum=s,t&&(a.pattern=nc)}),i._zod.check=o=>{let a=o.value;if(t){if(!Number.isInteger(a)){o.issues.push({expected:r,format:e.format,code:"invalid_type",continue:!1,input:a,inst:i});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:r,inclusive:!0,continue:!e.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:r,inclusive:!0,continue:!e.abort});return}}as&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:i,continue:!e.abort})}}),dc=y("$ZodCheckBigIntFormat",(i,e)=>{ve.init(i,e);let[t,r]=Cu[e.format];i._zod.onattach.push(n=>{let s=n._zod.bag;s.format=e.format,s.minimum=t,s.maximum=r}),i._zod.check=n=>{let s=n.value;sr&&n.issues.push({origin:"bigint",input:s,code:"too_big",maximum:r,inclusive:!0,inst:i,continue:!e.abort})}}),fc=y("$ZodCheckMaxSize",(i,e)=>{var t;ve.init(i,e),(t=i._zod.def).when??(t.when=r=>{let n=r.value;return!$i(n)&&n.size!==void 0}),i._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let n=r.value;n.size<=e.maximum||r.issues.push({origin:So(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:i,continue:!e.abort})}}),pc=y("$ZodCheckMinSize",(i,e)=>{var t;ve.init(i,e),(t=i._zod.def).when??(t.when=r=>{let n=r.value;return!$i(n)&&n.size!==void 0}),i._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),i._zod.check=r=>{let n=r.value;n.size>=e.minimum||r.issues.push({origin:So(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:i,continue:!e.abort})}}),mc=y("$ZodCheckSizeEquals",(i,e)=>{var t;ve.init(i,e),(t=i._zod.def).when??(t.when=r=>{let n=r.value;return!$i(n)&&n.size!==void 0}),i._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),i._zod.check=r=>{let n=r.value,s=n.size;if(s===e.size)return;let o=s>e.size;r.issues.push({origin:So(n),...o?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:r.value,inst:i,continue:!e.abort})}}),gc=y("$ZodCheckMaxLength",(i,e)=>{var t;ve.init(i,e),(t=i._zod.def).when??(t.when=r=>{let n=r.value;return!$i(n)&&n.length!==void 0}),i._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let n=r.value;if(n.length<=e.maximum)return;let s=_o(n);r.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:i,continue:!e.abort})}}),vc=y("$ZodCheckMinLength",(i,e)=>{var t;ve.init(i,e),(t=i._zod.def).when??(t.when=r=>{let n=r.value;return!$i(n)&&n.length!==void 0}),i._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),i._zod.check=r=>{let n=r.value;if(n.length>=e.minimum)return;let s=_o(n);r.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:i,continue:!e.abort})}}),bc=y("$ZodCheckLengthEquals",(i,e)=>{var t;ve.init(i,e),(t=i._zod.def).when??(t.when=r=>{let n=r.value;return!$i(n)&&n.length!==void 0}),i._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),i._zod.check=r=>{let n=r.value,s=n.length;if(s===e.length)return;let o=_o(n),a=s>e.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:i,continue:!e.abort})}}),sn=y("$ZodCheckStringFormat",(i,e)=>{var t,r;ve.init(i,e),i._zod.onattach.push(n=>{let s=n._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(t=i._zod).check??(t.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:i,continue:!e.abort})}):(r=i._zod).check??(r.check=()=>{})}),yc=y("$ZodCheckRegex",(i,e)=>{sn.init(i,e),i._zod.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:e.pattern.toString(),inst:i,continue:!e.abort})}}),kc=y("$ZodCheckLowerCase",(i,e)=>{e.pattern??(e.pattern=ac),sn.init(i,e)}),xc=y("$ZodCheckUpperCase",(i,e)=>{e.pattern??(e.pattern=lc),sn.init(i,e)}),wc=y("$ZodCheckIncludes",(i,e)=>{ve.init(i,e);let t=qt(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=r,i._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),i._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:i,continue:!e.abort})}}),$c=y("$ZodCheckStartsWith",(i,e)=>{ve.init(i,e);let t=new RegExp(`^${qt(e.prefix)}.*`);e.pattern??(e.pattern=t),i._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),i._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:i,continue:!e.abort})}}),Sc=y("$ZodCheckEndsWith",(i,e)=>{ve.init(i,e);let t=new RegExp(`.*${qt(e.suffix)}$`);e.pattern??(e.pattern=t),i._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),i._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:i,continue:!e.abort})}}),_c=y("$ZodCheckProperty",(i,e)=>{ve.init(i,e),i._zod.check=t=>{let r=e.schema._zod.run({value:t.value[e.property],issues:[]},{});if(r instanceof Promise)return r.then(n=>Ig(n,t,e.property));Ig(r,t,e.property)}}),Oc=y("$ZodCheckMimeType",(i,e)=>{ve.init(i,e);let t=new Set(e.mime);i._zod.onattach.push(r=>{r._zod.bag.mime=e.mime}),i._zod.check=r=>{t.has(r.value.type)||r.issues.push({code:"invalid_value",values:e.mime,input:r.value.type,inst:i,continue:!e.abort})}}),Ic=y("$ZodCheckOverwrite",(i,e)=>{ve.init(i,e),i._zod.check=t=>{t.value=e.tx(t.value)}})}),Ao=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split(` +`).filter(s=>s),r=Math.min(...t.map(s=>s.length-s.trimStart().length)),n=t.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of n)this.content.push(s)}compile(){let e=Function,t=this?.args,r=[...(this?.content??[""]).map(n=>` ${n}`)];return new e(...t,r.join(` +`))}},Tc,Yv=T(()=>{Tc={major:4,minor:3,patch:5}});function Ec(i){if(i==="")return!0;if(i.length%4!==0)return!1;try{return atob(i),!0}catch{return!1}}function Qv(i){if(!Yo.test(i))return!1;let e=i.replace(/[-_]/g,r=>r==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return Ec(t)}function eb(i,e=null){try{let t=i.split(".");if(t.length!==3)return!1;let[r]=t;if(!r)return!1;let n=JSON.parse(atob(r));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}function Cg(i,e,t){i.issues.length&&e.issues.push(...kt(t,i.issues)),e.value[t]=i.value}function Do(i,e,t,r,n){if(i.issues.length){if(n&&!(t in r))return;e.issues.push(...kt(t,i.issues))}i.value===void 0?t in r&&(e.value[t]=void 0):e.value[t]=i.value}function Tg(i){let e=Object.keys(i.shape);for(let r of e)if(!i.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let t=sv(i.shape);return{...i,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function Eg(i,e,t,r,n,s){let o=[],a=n.keySet,l=n.catchall._zod,u=l.def.type,c=l.optout==="optional";for(let h in e){if(a.has(h))continue;if(u==="never"){o.push(h);continue}let d=l.run({value:e[h],issues:[]},r);d instanceof Promise?i.push(d.then(f=>Do(f,t,h,e,c))):Do(d,t,h,e,c)}return o.length&&t.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:s}),i.length?Promise.all(i).then(()=>t):t}function Ag(i,e,t,r){for(let s of i)if(s.issues.length===0)return e.value=s.value,e;let n=i.filter(s=>!_i(s));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:i.map(s=>s.issues.map(o=>ct(o,r,Te())))}),e)}function Dg(i,e,t,r){let n=i.filter(s=>s.issues.length===0);return n.length===1?(e.value=n[0].value,e):(n.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:i.map(s=>s.issues.map(o=>ct(o,r,Te())))}):e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:[],inclusive:!1}),e)}function mu(i,e){if(i===e)return{valid:!0,data:i};if(i instanceof Date&&e instanceof Date&&+i==+e)return{valid:!0,data:i};if(Ei(i)&&Ei(e)){let t=Object.keys(e),r=Object.keys(i).filter(s=>t.indexOf(s)!==-1),n={...i,...e};for(let s of r){let o=mu(i[s],e[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};n[s]=o.data}return{valid:!0,data:n}}if(Array.isArray(i)&&Array.isArray(e)){if(i.length!==e.length)return{valid:!1,mergeErrorPath:[]};let t=[];for(let r=0;ra.l&&a.r).map(([a])=>a);if(s.length&&n&&i.issues.push({...n,keys:s}),_i(i))return i;let o=mu(e.value,t.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return i.value=o.data,i}function bo(i,e,t){i.issues.length&&e.issues.push(...kt(t,i.issues)),e.value[t]=i.value}function Pg(i,e,t,r,n,s,o){i.issues.length&&(wr.has(typeof r)?t.issues.push(...kt(r,i.issues)):t.issues.push({code:"invalid_key",origin:"map",input:n,inst:s,issues:i.issues.map(a=>ct(a,o,Te()))})),e.issues.length&&(wr.has(typeof r)?t.issues.push(...kt(r,e.issues)):t.issues.push({origin:"map",code:"invalid_element",input:n,inst:s,key:r,issues:e.issues.map(a=>ct(a,o,Te()))})),t.value.set(i.value,e.value)}function Mg(i,e){i.issues.length&&e.issues.push(...i.issues),e.value.add(i.value)}function Ng(i,e){return i.issues.length&&e===void 0?{issues:[],value:void 0}:i}function Rg(i,e){return i.value===void 0&&(i.value=e.defaultValue),i}function Ug(i,e){return!i.issues.length&&i.value===void 0&&i.issues.push({code:"invalid_type",expected:"nonoptional",input:i.value,inst:e}),i}function yo(i,e,t){return i.issues.length?(i.aborted=!0,i):e._zod.run({value:i.value,issues:i.issues},t)}function ko(i,e,t){if(i.issues.length)return i.aborted=!0,i;if((t.direction||"forward")==="forward"){let r=e.transform(i.value,i);return r instanceof Promise?r.then(n=>xo(i,n,e.out,t)):xo(i,r,e.out,t)}else{let r=e.reverseTransform(i.value,i);return r instanceof Promise?r.then(n=>xo(i,n,e.in,t)):xo(i,r,e.in,t)}}function xo(i,e,t,r){return i.issues.length?(i.aborted=!0,i):t._zod.run({value:e,issues:i.issues},r)}function Lg(i){return i.value=Object.freeze(i.value),i}function jg(i,e,t,r){if(!i){let n={code:"custom",input:t,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(n.params=r._zod.def.params),e.issues.push(Io(n))}}var F,un,ae,Ac,Dc,zc,Pc,Mc,Nc,Rc,Uc,Lc,jc,Bc,Zc,Fc,qc,Hc,Wc,Vc,Xc,Jc,Kc,Gc,Yc,Qc,eh,th,zo,ih,ta,Po,nh,rh,sh,oh,ah,lh,uh,ch,hh,dh,gu,fh,yr,ph,mh,gh,Mo,vh,bh,yh,kh,xh,wh,$h,No,Sh,_h,Oh,Ih,Ch,Th,Eh,Ah,Dh,ia,zh,Ph,Mh,Nh,Rh,Uh,tb=T(()=>{Cc(),Or(),bv(),uc(),U(),Yv(),U(),F=y("$ZodType",(i,e)=>{var t;i??(i={}),i._zod.def=e,i._zod.bag=i._zod.bag||{},i._zod.version=Tc;let r=[...i._zod.def.checks??[]];i._zod.traits.has("$ZodCheck")&&r.unshift(i);for(let n of r)for(let s of n._zod.onattach)s(i);if(r.length===0)(t=i._zod).deferred??(t.deferred=[]),i._zod.deferred?.push(()=>{i._zod.run=i._zod.parse});else{let n=(o,a,l)=>{let u=_i(o),c;for(let h of a){if(h._zod.def.when){if(!h._zod.def.when(o))continue}else if(u)continue;let d=o.issues.length,f=h._zod.check(o);if(f instanceof Promise&&l?.async===!1)throw new ti;if(c||f instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await f,o.issues.length!==d&&(u||(u=_i(o,d)))});else{if(o.issues.length===d)continue;u||(u=_i(o,d))}}return c?c.then(()=>o):o},s=(o,a,l)=>{if(_i(o))return o.aborted=!0,o;let u=n(a,r,l);if(u instanceof Promise){if(l.async===!1)throw new ti;return u.then(c=>i._zod.parse(c,l))}return i._zod.parse(u,l)};i._zod.run=(o,a)=>{if(a.skipChecks)return i._zod.parse(o,a);if(a.direction==="backward"){let u=i._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(c=>s(c,o,a)):s(u,o,a)}let l=i._zod.parse(o,a);if(l instanceof Promise){if(a.async===!1)throw new ti;return l.then(u=>n(u,r,a))}return n(l,r,a)}}W(i,"~standard",()=>({validate:n=>{try{let s=Go(i,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Au(i,n).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),un=y("$ZodString",(i,e)=>{F.init(i,e),i._zod.pattern=[...i?._zod.bag?.patterns??[]].pop()??Mv(i._zod.bag),i._zod.parse=(t,r)=>{if(e.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:i}),t}}),ae=y("$ZodStringFormat",(i,e)=>{sn.init(i,e),un.init(i,e)}),Ac=y("$ZodGUID",(i,e)=>{e.pattern??(e.pattern=Vu),ae.init(i,e)}),Dc=y("$ZodUUID",(i,e)=>{if(e.version){let t={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(t===void 0)throw Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=an(t))}else e.pattern??(e.pattern=an());ae.init(i,e)}),zc=y("$ZodEmail",(i,e)=>{e.pattern??(e.pattern=Xu),ae.init(i,e)}),Pc=y("$ZodURL",(i,e)=>{ae.init(i,e),i._zod.check=t=>{try{let r=t.value.trim(),n=new URL(r);e.hostname&&(e.hostname.lastIndex=0,!e.hostname.test(n.hostname)&&t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:t.value,inst:i,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,!e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)&&t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:i,continue:!e.abort})),e.normalize?t.value=n.href:t.value=r;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:i,continue:!e.abort})}}}),Mc=y("$ZodEmoji",(i,e)=>{e.pattern??(e.pattern=yv()),ae.init(i,e)}),Nc=y("$ZodNanoID",(i,e)=>{e.pattern??(e.pattern=Hu),ae.init(i,e)}),Rc=y("$ZodCUID",(i,e)=>{e.pattern??(e.pattern=ju),ae.init(i,e)}),Uc=y("$ZodCUID2",(i,e)=>{e.pattern??(e.pattern=Bu),ae.init(i,e)}),Lc=y("$ZodULID",(i,e)=>{e.pattern??(e.pattern=Zu),ae.init(i,e)}),jc=y("$ZodXID",(i,e)=>{e.pattern??(e.pattern=Fu),ae.init(i,e)}),Bc=y("$ZodKSUID",(i,e)=>{e.pattern??(e.pattern=qu),ae.init(i,e)}),Zc=y("$ZodISODateTime",(i,e)=>{e.pattern??(e.pattern=wv(e)),ae.init(i,e)}),Fc=y("$ZodISODate",(i,e)=>{e.pattern??(e.pattern=tc),ae.init(i,e)}),qc=y("$ZodISOTime",(i,e)=>{e.pattern??(e.pattern=xv(e)),ae.init(i,e)}),Hc=y("$ZodISODuration",(i,e)=>{e.pattern??(e.pattern=Wu),ae.init(i,e)}),Wc=y("$ZodIPv4",(i,e)=>{e.pattern??(e.pattern=Ju),ae.init(i,e),i._zod.bag.format="ipv4"}),Vc=y("$ZodIPv6",(i,e)=>{e.pattern??(e.pattern=Ku),ae.init(i,e),i._zod.bag.format="ipv6",i._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:i,continue:!e.abort})}}}),Xc=y("$ZodMAC",(i,e)=>{e.pattern??(e.pattern=Av(e.delimiter)),ae.init(i,e),i._zod.bag.format="mac"}),Jc=y("$ZodCIDRv4",(i,e)=>{e.pattern??(e.pattern=Gu),ae.init(i,e)}),Kc=y("$ZodCIDRv6",(i,e)=>{e.pattern??(e.pattern=Yu),ae.init(i,e),i._zod.check=t=>{let r=t.value.split("/");try{if(r.length!==2)throw Error();let[n,s]=r;if(!s)throw Error();let o=Number(s);if(`${o}`!==s||o<0||o>128)throw Error();new URL(`http://[${n}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:i,continue:!e.abort})}}}),Gc=y("$ZodBase64",(i,e)=>{e.pattern??(e.pattern=Qu),ae.init(i,e),i._zod.bag.contentEncoding="base64",i._zod.check=t=>{Ec(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:i,continue:!e.abort})}}),Yc=y("$ZodBase64URL",(i,e)=>{e.pattern??(e.pattern=Yo),ae.init(i,e),i._zod.bag.contentEncoding="base64url",i._zod.check=t=>{Qv(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:i,continue:!e.abort})}}),Qc=y("$ZodE164",(i,e)=>{e.pattern??(e.pattern=ec),ae.init(i,e)}),eh=y("$ZodJWT",(i,e)=>{ae.init(i,e),i._zod.check=t=>{eb(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:i,continue:!e.abort})}}),th=y("$ZodCustomStringFormat",(i,e)=>{ae.init(i,e),i._zod.check=t=>{e.fn(t.value)||t.issues.push({code:"invalid_format",format:e.format,input:t.value,inst:i,continue:!e.abort})}}),zo=y("$ZodNumber",(i,e)=>{F.init(i,e),i._zod.pattern=i._zod.bag.pattern??Eo,i._zod.parse=(t,r)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}let n=t.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return t;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:n,inst:i,...s?{received:s}:{}}),t}}),ih=y("$ZodNumberFormat",(i,e)=>{hc.init(i,e),zo.init(i,e)}),ta=y("$ZodBoolean",(i,e)=>{F.init(i,e),i._zod.pattern=rc,i._zod.parse=(t,r)=>{if(e.coerce)try{t.value=!!t.value}catch{}let n=t.value;return typeof n=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:i}),t}}),Po=y("$ZodBigInt",(i,e)=>{F.init(i,e),i._zod.pattern=ic,i._zod.parse=(t,r)=>{if(e.coerce)try{t.value=BigInt(t.value)}catch{}return typeof t.value=="bigint"||t.issues.push({expected:"bigint",code:"invalid_type",input:t.value,inst:i}),t}}),nh=y("$ZodBigIntFormat",(i,e)=>{dc.init(i,e),Po.init(i,e)}),rh=y("$ZodSymbol",(i,e)=>{F.init(i,e),i._zod.parse=(t,r)=>{let n=t.value;return typeof n=="symbol"||t.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:i}),t}}),sh=y("$ZodUndefined",(i,e)=>{F.init(i,e),i._zod.pattern=oc,i._zod.values=new Set([void 0]),i._zod.optin="optional",i._zod.optout="optional",i._zod.parse=(t,r)=>{let n=t.value;return typeof n>"u"||t.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:i}),t}}),oh=y("$ZodNull",(i,e)=>{F.init(i,e),i._zod.pattern=sc,i._zod.values=new Set([null]),i._zod.parse=(t,r)=>{let n=t.value;return n===null||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:i}),t}}),ah=y("$ZodAny",(i,e)=>{F.init(i,e),i._zod.parse=t=>t}),lh=y("$ZodUnknown",(i,e)=>{F.init(i,e),i._zod.parse=t=>t}),uh=y("$ZodNever",(i,e)=>{F.init(i,e),i._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:i}),t)}),ch=y("$ZodVoid",(i,e)=>{F.init(i,e),i._zod.parse=(t,r)=>{let n=t.value;return typeof n>"u"||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:i}),t}}),hh=y("$ZodDate",(i,e)=>{F.init(i,e),i._zod.parse=(t,r)=>{if(e.coerce)try{t.value=new Date(t.value)}catch{}let n=t.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||t.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:i}),t}}),dh=y("$ZodArray",(i,e)=>{F.init(i,e),i._zod.parse=(t,r)=>{let n=t.value;if(!Array.isArray(n))return t.issues.push({expected:"array",code:"invalid_type",input:n,inst:i}),t;t.value=Array(n.length);let s=[];for(let o=0;oCg(u,t,o))):Cg(l,t,o)}return s.length?Promise.all(s).then(()=>t):t}}),gu=y("$ZodObject",(i,e)=>{if(F.init(i,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let o=e.shape;Object.defineProperty(e,"shape",{get:()=>{let a={...o};return Object.defineProperty(e,"shape",{value:a}),a}})}let t=br(()=>Tg(e));W(i._zod,"propValues",()=>{let o=e.shape,a={};for(let l in o){let u=o[l]._zod;if(u.values){a[l]??(a[l]=new Set);for(let c of u.values)a[l].add(c)}}return a});let r=on,n=e.catchall,s;i._zod.parse=(o,a)=>{s??(s=t.value);let l=o.value;if(!r(l))return o.issues.push({expected:"object",code:"invalid_type",input:l,inst:i}),o;o.value={};let u=[],c=s.shape;for(let h of s.keys){let d=c[h],f=d._zod.optout==="optional",p=d._zod.run({value:l[h],issues:[]},a);p instanceof Promise?u.push(p.then(g=>Do(g,o,h,l,f))):Do(p,o,h,l,f)}return n?Eg(u,l,o,a,t.value,i):u.length?Promise.all(u).then(()=>o):o}}),fh=y("$ZodObjectJIT",(i,e)=>{gu.init(i,e);let t=i._zod.parse,r=br(()=>Tg(e)),n=h=>{let d=new Ao(["shape","payload","ctx"]),f=r.value,p=x=>{let $=hu(x);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};d.write("const input = payload.value;");let g=Object.create(null),b=0;for(let x of f.keys)g[x]=`key_${b++}`;d.write("const newResult = {};");for(let x of f.keys){let $=g[x],R=hu(x),A=h[x]?._zod?.optout==="optional";d.write(`const ${$} = ${p(x)};`),A?d.write(` + if (${$}.issues.length) { + if (${R} in input) { + payload.issues = payload.issues.concat(${$}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${R}, ...iss.path] : [${R}] + }))); + } + } + + if (${$}.value === undefined) { + if (${R} in input) { + newResult[${R}] = undefined; + } + } else { + newResult[${R}] = ${$}.value; + } + + `):d.write(` + if (${$}.issues.length) { + payload.issues = payload.issues.concat(${$}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${R}, ...iss.path] : [${R}] + }))); + } + + if (${$}.value === undefined) { + if (${R} in input) { + newResult[${R}] = undefined; + } + } else { + newResult[${R}] = ${$}.value; + } + + `)}d.write("payload.value = newResult;"),d.write("return payload;");let v=d.compile();return(x,$)=>v(h,x,$)},s,o=on,a=!xr.jitless,l=a&&_u.value,u=e.catchall,c;i._zod.parse=(h,d)=>{c??(c=r.value);let f=h.value;return o(f)?a&&l&&d?.async===!1&&d.jitless!==!0?(s||(s=n(e.shape)),h=s(h,d),u?Eg([],f,h,d,c,i):h):t(h,d):(h.issues.push({expected:"object",code:"invalid_type",input:f,inst:i}),h)}}),yr=y("$ZodUnion",(i,e)=>{F.init(i,e),W(i._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),W(i._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),W(i._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),W(i._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${n.map(s=>$o(s.source)).join("|")})$`)}});let t=e.options.length===1,r=e.options[0]._zod.run;i._zod.parse=(n,s)=>{if(t)return r(n,s);let o=!1,a=[];for(let l of e.options){let u=l._zod.run({value:n.value,issues:[]},s);if(u instanceof Promise)a.push(u),o=!0;else{if(u.issues.length===0)return u;a.push(u)}}return o?Promise.all(a).then(l=>Ag(l,n,i,s)):Ag(a,n,i,s)}}),ph=y("$ZodXor",(i,e)=>{yr.init(i,e),e.inclusive=!1;let t=e.options.length===1,r=e.options[0]._zod.run;i._zod.parse=(n,s)=>{if(t)return r(n,s);let o=!1,a=[];for(let l of e.options){let u=l._zod.run({value:n.value,issues:[]},s);u instanceof Promise?(a.push(u),o=!0):a.push(u)}return o?Promise.all(a).then(l=>Dg(l,n,i,s)):Dg(a,n,i,s)}}),mh=y("$ZodDiscriminatedUnion",(i,e)=>{e.inclusive=!1,yr.init(i,e);let t=i._zod.parse;W(i._zod,"propValues",()=>{let n={};for(let s of e.options){let o=s._zod.propValues;if(!o||Object.keys(o).length===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[a,l]of Object.entries(o)){n[a]||(n[a]=new Set);for(let u of l)n[a].add(u)}}return n});let r=br(()=>{let n=e.options,s=new Map;for(let o of n){let a=o._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let l of a){if(s.has(l))throw Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,o)}}return s});i._zod.parse=(n,s)=>{let o=n.value;if(!on(o))return n.issues.push({code:"invalid_type",expected:"object",input:o,inst:i}),n;let a=r.value.get(o?.[e.discriminator]);return a?a._zod.run(n,s):e.unionFallback?t(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:o,path:[e.discriminator],inst:i}),n)}}),gh=y("$ZodIntersection",(i,e)=>{F.init(i,e),i._zod.parse=(t,r)=>{let n=t.value,s=e.left._zod.run({value:n,issues:[]},r),o=e.right._zod.run({value:n,issues:[]},r);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([a,l])=>zg(t,a,l)):zg(t,s,o)}}),Mo=y("$ZodTuple",(i,e)=>{F.init(i,e);let t=e.items;i._zod.parse=(r,n)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:i,expected:"tuple",code:"invalid_type"}),r;r.value=[];let o=[],a=[...t].reverse().findIndex(c=>c._zod.optin!=="optional"),l=a===-1?0:t.length-a;if(!e.rest){let c=s.length>t.length,h=s.length=s.length&&u>=l)continue;let h=c._zod.run({value:s[u],issues:[]},n);h instanceof Promise?o.push(h.then(d=>bo(d,r,u))):bo(h,r,u)}if(e.rest){let c=s.slice(t.length);for(let h of c){u++;let d=e.rest._zod.run({value:h,issues:[]},n);d instanceof Promise?o.push(d.then(f=>bo(f,r,u))):bo(d,r,u)}}return o.length?Promise.all(o).then(()=>r):r}}),vh=y("$ZodRecord",(i,e)=>{F.init(i,e),i._zod.parse=(t,r)=>{let n=t.value;if(!Ei(n))return t.issues.push({expected:"record",code:"invalid_type",input:n,inst:i}),t;let s=[],o=e.keyType._zod.values;if(o){t.value={};let a=new Set;for(let u of o)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let c=e.valueType._zod.run({value:n[u],issues:[]},r);c instanceof Promise?s.push(c.then(h=>{h.issues.length&&t.issues.push(...kt(u,h.issues)),t.value[u]=h.value})):(c.issues.length&&t.issues.push(...kt(u,c.issues)),t.value[u]=c.value)}let l;for(let u in n)a.has(u)||(l=l??[],l.push(u));l&&l.length>0&&t.issues.push({code:"unrecognized_keys",input:n,inst:i,keys:l})}else{t.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__")continue;let l=e.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Eo.test(a)&&l.issues.length&&l.issues.some(c=>c.code==="invalid_type"&&c.expected==="number")){let c=e.keyType._zod.run({value:Number(a),issues:[]},r);if(c instanceof Promise)throw Error("Async schemas not supported in object keys currently");c.issues.length===0&&(l=c)}if(l.issues.length){e.mode==="loose"?t.value[a]=n[a]:t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(c=>ct(c,r,Te())),input:a,path:[a],inst:i});continue}let u=e.valueType._zod.run({value:n[a],issues:[]},r);u instanceof Promise?s.push(u.then(c=>{c.issues.length&&t.issues.push(...kt(a,c.issues)),t.value[l.value]=c.value})):(u.issues.length&&t.issues.push(...kt(a,u.issues)),t.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>t):t}}),bh=y("$ZodMap",(i,e)=>{F.init(i,e),i._zod.parse=(t,r)=>{let n=t.value;if(!(n instanceof Map))return t.issues.push({expected:"map",code:"invalid_type",input:n,inst:i}),t;let s=[];t.value=new Map;for(let[o,a]of n){let l=e.keyType._zod.run({value:o,issues:[]},r),u=e.valueType._zod.run({value:a,issues:[]},r);l instanceof Promise||u instanceof Promise?s.push(Promise.all([l,u]).then(([c,h])=>{Pg(c,h,t,o,n,i,r)})):Pg(l,u,t,o,n,i,r)}return s.length?Promise.all(s).then(()=>t):t}}),yh=y("$ZodSet",(i,e)=>{F.init(i,e),i._zod.parse=(t,r)=>{let n=t.value;if(!(n instanceof Set))return t.issues.push({input:n,inst:i,expected:"set",code:"invalid_type"}),t;let s=[];t.value=new Set;for(let o of n){let a=e.valueType._zod.run({value:o,issues:[]},r);a instanceof Promise?s.push(a.then(l=>Mg(l,t))):Mg(a,t)}return s.length?Promise.all(s).then(()=>t):t}}),kh=y("$ZodEnum",(i,e)=>{F.init(i,e);let t=Su(e.entries),r=new Set(t);i._zod.values=r,i._zod.pattern=new RegExp(`^(${t.filter(n=>wr.has(typeof n)).map(n=>typeof n=="string"?qt(n):n.toString()).join("|")})$`),i._zod.parse=(n,s)=>{let o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:t,input:o,inst:i}),n}}),xh=y("$ZodLiteral",(i,e)=>{if(F.init(i,e),e.values.length===0)throw Error("Cannot create literal schema with no valid values");let t=new Set(e.values);i._zod.values=t,i._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?qt(r):r?qt(r.toString()):String(r)).join("|")})$`),i._zod.parse=(r,n)=>{let s=r.value;return t.has(s)||r.issues.push({code:"invalid_value",values:e.values,input:s,inst:i}),r}}),wh=y("$ZodFile",(i,e)=>{F.init(i,e),i._zod.parse=(t,r)=>{let n=t.value;return n instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:n,inst:i}),t}}),$h=y("$ZodTransform",(i,e)=>{F.init(i,e),i._zod.parse=(t,r)=>{if(r.direction==="backward")throw new kr(i.constructor.name);let n=e.transform(t.value,t);if(r.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(t.value=s,t));if(n instanceof Promise)throw new ti;return t.value=n,t}}),No=y("$ZodOptional",(i,e)=>{F.init(i,e),i._zod.optin="optional",i._zod.optout="optional",W(i._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),W(i._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${$o(t.source)})?$`):void 0}),i._zod.parse=(t,r)=>{if(e.innerType._zod.optin==="optional"){let n=e.innerType._zod.run(t,r);return n instanceof Promise?n.then(s=>Ng(s,t.value)):Ng(n,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,r)}}),Sh=y("$ZodExactOptional",(i,e)=>{No.init(i,e),W(i._zod,"values",()=>e.innerType._zod.values),W(i._zod,"pattern",()=>e.innerType._zod.pattern),i._zod.parse=(t,r)=>e.innerType._zod.run(t,r)}),_h=y("$ZodNullable",(i,e)=>{F.init(i,e),W(i._zod,"optin",()=>e.innerType._zod.optin),W(i._zod,"optout",()=>e.innerType._zod.optout),W(i._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${$o(t.source)}|null)$`):void 0}),W(i._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),i._zod.parse=(t,r)=>t.value===null?t:e.innerType._zod.run(t,r)}),Oh=y("$ZodDefault",(i,e)=>{F.init(i,e),i._zod.optin="optional",W(i._zod,"values",()=>e.innerType._zod.values),i._zod.parse=(t,r)=>{if(r.direction==="backward")return e.innerType._zod.run(t,r);if(t.value===void 0)return t.value=e.defaultValue,t;let n=e.innerType._zod.run(t,r);return n instanceof Promise?n.then(s=>Rg(s,e)):Rg(n,e)}}),Ih=y("$ZodPrefault",(i,e)=>{F.init(i,e),i._zod.optin="optional",W(i._zod,"values",()=>e.innerType._zod.values),i._zod.parse=(t,r)=>(r.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,r))}),Ch=y("$ZodNonOptional",(i,e)=>{F.init(i,e),W(i._zod,"values",()=>{let t=e.innerType._zod.values;return t?new Set([...t].filter(r=>r!==void 0)):void 0}),i._zod.parse=(t,r)=>{let n=e.innerType._zod.run(t,r);return n instanceof Promise?n.then(s=>Ug(s,i)):Ug(n,i)}}),Th=y("$ZodSuccess",(i,e)=>{F.init(i,e),i._zod.parse=(t,r)=>{if(r.direction==="backward")throw new kr("ZodSuccess");let n=e.innerType._zod.run(t,r);return n instanceof Promise?n.then(s=>(t.value=s.issues.length===0,t)):(t.value=n.issues.length===0,t)}}),Eh=y("$ZodCatch",(i,e)=>{F.init(i,e),W(i._zod,"optin",()=>e.innerType._zod.optin),W(i._zod,"optout",()=>e.innerType._zod.optout),W(i._zod,"values",()=>e.innerType._zod.values),i._zod.parse=(t,r)=>{if(r.direction==="backward")return e.innerType._zod.run(t,r);let n=e.innerType._zod.run(t,r);return n instanceof Promise?n.then(s=>(t.value=s.value,s.issues.length&&(t.value=e.catchValue({...t,error:{issues:s.issues.map(o=>ct(o,r,Te()))},input:t.value}),t.issues=[]),t)):(t.value=n.value,n.issues.length&&(t.value=e.catchValue({...t,error:{issues:n.issues.map(s=>ct(s,r,Te()))},input:t.value}),t.issues=[]),t)}}),Ah=y("$ZodNaN",(i,e)=>{F.init(i,e),i._zod.parse=(t,r)=>((typeof t.value!="number"||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:i,expected:"nan",code:"invalid_type"}),t)}),Dh=y("$ZodPipe",(i,e)=>{F.init(i,e),W(i._zod,"values",()=>e.in._zod.values),W(i._zod,"optin",()=>e.in._zod.optin),W(i._zod,"optout",()=>e.out._zod.optout),W(i._zod,"propValues",()=>e.in._zod.propValues),i._zod.parse=(t,r)=>{if(r.direction==="backward"){let s=e.out._zod.run(t,r);return s instanceof Promise?s.then(o=>yo(o,e.in,r)):yo(s,e.in,r)}let n=e.in._zod.run(t,r);return n instanceof Promise?n.then(s=>yo(s,e.out,r)):yo(n,e.out,r)}}),ia=y("$ZodCodec",(i,e)=>{F.init(i,e),W(i._zod,"values",()=>e.in._zod.values),W(i._zod,"optin",()=>e.in._zod.optin),W(i._zod,"optout",()=>e.out._zod.optout),W(i._zod,"propValues",()=>e.in._zod.propValues),i._zod.parse=(t,r)=>{if((r.direction||"forward")==="forward"){let n=e.in._zod.run(t,r);return n instanceof Promise?n.then(s=>ko(s,e,r)):ko(n,e,r)}else{let n=e.out._zod.run(t,r);return n instanceof Promise?n.then(s=>ko(s,e,r)):ko(n,e,r)}}}),zh=y("$ZodReadonly",(i,e)=>{F.init(i,e),W(i._zod,"propValues",()=>e.innerType._zod.propValues),W(i._zod,"values",()=>e.innerType._zod.values),W(i._zod,"optin",()=>e.innerType?._zod?.optin),W(i._zod,"optout",()=>e.innerType?._zod?.optout),i._zod.parse=(t,r)=>{if(r.direction==="backward")return e.innerType._zod.run(t,r);let n=e.innerType._zod.run(t,r);return n instanceof Promise?n.then(Lg):Lg(n)}}),Ph=y("$ZodTemplateLiteral",(i,e)=>{F.init(i,e);let t=[];for(let r of e.parts)if(typeof r=="object"&&r!==null){if(!r._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);let n=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!n)throw Error(`Invalid template literal part: ${r._zod.traits}`);let s=n.startsWith("^")?1:0,o=n.endsWith("$")?n.length-1:n.length;t.push(n.slice(s,o))}else if(r===null||Ou.has(typeof r))t.push(qt(`${r}`));else throw Error(`Invalid template literal part: ${r}`);i._zod.pattern=new RegExp(`^${t.join("")}$`),i._zod.parse=(r,n)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:i,expected:"string",code:"invalid_type"}),r):(i._zod.pattern.lastIndex=0,i._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:i,code:"invalid_format",format:e.format??"template_literal",pattern:i._zod.pattern.source}),r)}),Mh=y("$ZodFunction",(i,e)=>(F.init(i,e),i._def=e,i._zod.def=e,i.implement=t=>{if(typeof t!="function")throw Error("implement() must be called with a function");return function(...r){let n=i._def.input?Co(i._def.input,r):r,s=Reflect.apply(t,this,n);return i._def.output?Co(i._def.output,s):s}},i.implementAsync=t=>{if(typeof t!="function")throw Error("implementAsync() must be called with a function");return async function(...r){let n=i._def.input?await To(i._def.input,r):r,s=await Reflect.apply(t,this,n);return i._def.output?await To(i._def.output,s):s}},i._zod.parse=(t,r)=>typeof t.value!="function"?(t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:i}),t):(i._def.output&&i._def.output._zod.def.type==="promise"?t.value=i.implementAsync(t.value):t.value=i.implement(t.value),t),i.input=(...t)=>{let r=i.constructor;return Array.isArray(t[0])?new r({type:"function",input:new Mo({type:"tuple",items:t[0],rest:t[1]}),output:i._def.output}):new r({type:"function",input:t[0],output:i._def.output})},i.output=t=>new i.constructor({type:"function",input:i._def.input,output:t}),i)),Nh=y("$ZodPromise",(i,e)=>{F.init(i,e),i._zod.parse=(t,r)=>Promise.resolve(t.value).then(n=>e.innerType._zod.run({value:n,issues:[]},r))}),Rh=y("$ZodLazy",(i,e)=>{F.init(i,e),W(i._zod,"innerType",()=>e.getter()),W(i._zod,"pattern",()=>i._zod.innerType?._zod?.pattern),W(i._zod,"propValues",()=>i._zod.innerType?._zod?.propValues),W(i._zod,"optin",()=>i._zod.innerType?._zod?.optin??void 0),W(i._zod,"optout",()=>i._zod.innerType?._zod?.optout??void 0),i._zod.parse=(t,r)=>i._zod.innerType._zod.run(t,r)}),Uh=y("$ZodCustom",(i,e)=>{ve.init(i,e),F.init(i,e),i._zod.parse=(t,r)=>t,i._zod.check=t=>{let r=t.value,n=e.fn(r);if(n instanceof Promise)return n.then(s=>jg(s,t,r,i));jg(n,t,r,i)}})});function _$(){return{localeError:O$()}}var O$=()=>{let i={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(n){return i[n]??null}let t={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${s}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${L(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${n.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${n.minimum.toString()} ${o.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${t[s.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${S(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},I$=T(()=>{U()});function C$(){return{localeError:T$()}}var T$=()=>{let i={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(n){return i[n]??null}let t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${s}, daxil olan ${a}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${L(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${s}${n.maximum.toString()} ${o.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${s}${n.minimum.toString()} ${o.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${t[s.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${S(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},E$=T(()=>{U()});function Bg(i,e,t,r){let n=Math.abs(i),s=n%10,o=n%100;return o>=11&&o<=19?r:s===1?e:s>=2&&s<=4?t:r}function A$(){return{localeError:D$()}}var D$=()=>{let i={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(n){return i[n]??null}let t={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},r={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${s}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${L(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);if(o){let a=Number(n.maximum),l=Bg(a,o.unit.one,o.unit.few,o.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${o.verb} ${s}${n.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);if(o){let a=Number(n.minimum),l=Bg(a,o.unit.one,o.unit.few,o.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${o.verb} ${s}${n.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${t[s.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${S(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},z$=T(()=>{U()});function P$(){return{localeError:M$()}}var M$=()=>{let i={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(n){return i[n]??null}let t={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},r={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${s}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${L(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${s}${n.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${s}${n.minimum.toString()} ${o.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;if(s.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${s.prefix}"`;if(s.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${s.suffix}"`;if(s.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${s.includes}"`;if(s.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${s.pattern}`;let o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return s.format==="emoji"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="datetime"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="date"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),s.format==="time"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="duration"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${o} ${t[s.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${S(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}},N$=T(()=>{U()});function R$(){return{localeError:U$()}}var U$=()=>{let i={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return i[n]??null}let t={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${s}, s'ha rebut ${a}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${L(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${S(n.values," o ")}`;case"too_big":{let s=n.inclusive?"com a m\xE0xim":"menys de",o=e(n.origin);return o?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${s} ${n.maximum.toString()} ${o.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${s} ${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?"com a m\xEDnim":"m\xE9s de",o=e(n.origin);return o?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${s} ${n.minimum.toString()} ${o.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${s} ${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${t[s.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${S(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}},L$=T(()=>{U()});function j$(){return{localeError:B$()}}var B$=()=>{let i={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(n){return i[n]??null}let t={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},r={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${s}, obdr\u017Eeno ${a}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${L(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${s}${n.maximum.toString()} ${o.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${s}${n.minimum.toString()} ${o.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${t[s.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${S(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}},Z$=T(()=>{U()});function F$(){return{localeError:q$()}}var q$=()=>{let i={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(n){return i[n]??null}let t={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},r={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${s}, fik ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${L(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin),a=r[n.origin]??n.origin;return o?`For stor: forventede ${a??"value"} ${o.verb} ${s} ${n.maximum.toString()} ${o.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${s} ${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin),a=r[n.origin]??n.origin;return o?`For lille: forventede ${a} ${o.verb} ${s} ${n.minimum.toString()} ${o.unit}`:`For lille: forventede ${a} havde ${s} ${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Ugyldig streng: skal starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: skal ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: skal indeholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${t[s.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${S(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}},H$=T(()=>{U()});function W$(){return{localeError:V$()}}var V$=()=>{let i={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(n){return i[n]??null}let t={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},r={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${s}, erhalten ${a}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${L(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${s}${n.maximum.toString()} ${o.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${s}${n.maximum.toString()} ist`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Zu klein: erwartet, dass ${n.origin} ${s}${n.minimum.toString()} ${o.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${s}${n.minimum.toString()} ist`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${t[s.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${S(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}},X$=T(()=>{U()});function ib(){return{localeError:J$()}}var J$=()=>{let i={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(n){return i[n]??null}let t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${L(n.values[0])}`:`Invalid option: expected one of ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Too big: expected ${n.origin??"value"} to have ${s}${n.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Too small: expected ${n.origin} to have ${s}${n.minimum.toString()} ${o.unit}`:`Too small: expected ${n.origin} to be ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${t[s.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${S(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}},nb=T(()=>{U()});function K$(){return{localeError:G$()}}var G$=()=>{let i={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return i[n]??null}let t={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},r={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${s}, ricevi\u011Dis ${a}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${L(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${s}${n.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${s}${n.minimum.toString()} ${o.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${s.prefix}"`:s.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${s.suffix}"`:s.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${s.includes}"`:s.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${s.pattern}`:`Nevalida ${t[s.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${S(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}},Y$=T(()=>{U()});function Q$(){return{localeError:eS()}}var eS=()=>{let i={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(n){return i[n]??null}let t={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${s}, recibido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${L(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin),a=r[n.origin]??n.origin;return o?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${s}${n.maximum.toString()} ${o.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin),a=r[n.origin]??n.origin;return o?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${s}${n.minimum.toString()} ${o.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${t[s.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${S(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${r[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${r[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}},tS=T(()=>{U()});function iS(){return{localeError:nS()}}var nS=()=>{let i={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(n){return i[n]??null}let t={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},r={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${s} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${L(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${S(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${n.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${s}${n.minimum.toString()} ${o.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${s}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${t[s.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${S(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},rS=T(()=>{U()});function sS(){return{localeError:oS()}}var oS=()=>{let i={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(n){return i[n]??null}let t={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${s}, oli ${a}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${L(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Liian suuri: ${o.subject} t\xE4ytyy olla ${s}${n.maximum.toString()} ${o.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Liian pieni: ${o.subject} t\xE4ytyy olla ${s}${n.minimum.toString()} ${o.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${t[s.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${S(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},aS=T(()=>{U()});function lS(){return{localeError:uS()}}var uS=()=>{let i={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return i[n]??null}let t={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},r={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${s} attendu, ${a} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${L(n.values[0])} attendu`:`Option invalide : une valeur parmi ${S(n.values,"|")} attendue`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Trop grand : ${n.origin??"valeur"} doit ${o.verb} ${s}${n.maximum.toString()} ${o.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Trop petit : ${n.origin} doit ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${t[s.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${S(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}},cS=T(()=>{U()});function hS(){return{localeError:dS()}}var dS=()=>{let i={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return i[n]??null}let t={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${s}, re\xE7u ${a}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${L(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"\u2264":"<",o=e(n.origin);return o?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${s}${n.maximum.toString()} ${o.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?"\u2265":">",o=e(n.origin);return o?`Trop petit : attendu que ${n.origin} ait ${s}${n.minimum.toString()} ${o.unit}`:`Trop petit : attendu que ${n.origin} soit ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${t[s.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${S(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}},fS=T(()=>{U()});function pS(){return{localeError:mS()}}var mS=()=>{let i={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},t=u=>u?i[u]:void 0,r=u=>{let c=t(u);return c?c.label:u??i.unknown.label},n=u=>`\u05D4${r(u)}`,s=u=>(t(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",o=u=>u?e[u]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},l={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let c=u.expected,h=l[c??""]??r(c),d=B(u.input),f=l[d]??i[d]?.label??d;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(u.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${L(u.values[0])}`;let c=u.values.map(d=>L(d));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${c[0]} \u05D0\u05D5 ${c[1]}`;let h=c[c.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${c.slice(0,-1).join(", ")} \u05D0\u05D5 ${h}`}case"too_big":{let c=o(u.origin),h=n(u.origin??"value");if(u.origin==="string")return`${c?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${c?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let p=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}`}if(u.origin==="array"||u.origin==="set"){let p=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",g=u.inclusive?`${u.maximum} ${c?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${c?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${h} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let d=u.inclusive?"<=":"<",f=s(u.origin??"value");return c?.unit?`${c.longLabel} \u05DE\u05D3\u05D9: ${h} ${f} ${d}${u.maximum.toString()} ${c.unit}`:`${c?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${h} ${f} ${d}${u.maximum.toString()}`}case"too_small":{let c=o(u.origin),h=n(u.origin??"value");if(u.origin==="string")return`${c?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${c?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let p=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}`}if(u.origin==="array"||u.origin==="set"){let p=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let b=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`}let g=u.inclusive?`${u.minimum} ${c?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${c?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let d=u.inclusive?">=":">",f=s(u.origin??"value");return c?.unit?`${c.shortLabel} \u05DE\u05D3\u05D9: ${h} ${f} ${d}${u.minimum.toString()} ${c.unit}`:`${c?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${h} ${f} ${d}${u.minimum.toString()}`}case"invalid_format":{let c=u;if(c.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${c.prefix}"`;if(c.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${c.suffix}"`;if(c.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${c.includes}"`;if(c.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${c.pattern}`;let h=a[c.format],d=h?.label??c.format,f=(h?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${d} \u05DC\u05D0 ${f}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${S(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},gS=T(()=>{U()});function vS(){return{localeError:bS()}}var bS=()=>{let i={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){return i[n]??null}let t={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},r={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${s}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${L(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${n.maximum.toString()} ${o.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${s}${n.minimum.toString()} ${o.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${t[s.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${S(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},yS=T(()=>{U()});function Zg(i,e,t){return Math.abs(i)===1?e:t}function rn(i){if(!i)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],t=i[i.length-1];return i+(e.includes(t)?"\u0576":"\u0568")}function kS(){return{localeError:xS()}}var xS=()=>{let i={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(n){return i[n]??null}let t={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},r={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${s}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${L(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);if(o){let a=Number(n.maximum),l=Zg(a,o.unit.one,o.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rn(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${s}${n.maximum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rn(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);if(o){let a=Number(n.minimum),l=Zg(a,o.unit.one,o.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rn(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${s}${n.minimum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rn(n.origin)} \u056C\u056B\u0576\u056B ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${s.prefix}"-\u0578\u057E`:s.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${s.suffix}"-\u0578\u057E`:s.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${s.includes}"`:s.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${s.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${t[s.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${S(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${rn(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${rn(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}},wS=T(()=>{U()});function $S(){return{localeError:SS()}}var SS=()=>{let i={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){return i[n]??null}let t={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${s}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${L(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${s}${n.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Terlalu kecil: diharapkan ${n.origin} memiliki ${s}${n.minimum.toString()} ${o.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${t[s.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${S(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}},_S=T(()=>{U()});function OS(){return{localeError:IS()}}var IS=()=>{let i={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(n){return i[n]??null}let t={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},r={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${s}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${L(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${s}${n.maximum.toString()} ${o.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${s}${n.minimum.toString()} ${o.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${s.prefix}"`:s.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${s.suffix}"`:s.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${s.includes}"`:s.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${s.pattern}`:`Rangt ${t[s.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${S(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}},CS=T(()=>{U()});function TS(){return{localeError:ES()}}var ES=()=>{let i={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){return i[n]??null}let t={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${s}, ricevuto ${a}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${L(n.values[0])}`:`Opzione non valida: atteso uno tra ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Troppo grande: ${n.origin??"valore"} deve avere ${s}${n.maximum.toString()} ${o.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Troppo piccolo: ${n.origin} deve avere ${s}${n.minimum.toString()} ${o.unit}`:`Troppo piccolo: ${n.origin} deve essere ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Invalid ${t[s.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${S(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}},AS=T(()=>{U()});function DS(){return{localeError:zS()}}var zS=()=>{let i={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(n){return i[n]??null}let t={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},r={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${s}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${L(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${S(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let s=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",o=e(n.origin);return o?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let s=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",o=e(n.origin);return o?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${t[s.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${S(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},PS=T(()=>{U()});function MS(){return{localeError:NS()}}var NS=()=>{let i={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(n){return i[n]??null}let t={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},r={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${s}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${L(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${S(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${o.verb} ${s}${n.maximum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${s.prefix}"-\u10D8\u10D7`:s.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${s.suffix}"-\u10D8\u10D7`:s.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${s.includes}"-\u10E1`:s.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${s.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${t[s.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${S(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}},RS=T(()=>{U()});function rb(){return{localeError:US()}}var US=()=>{let i={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(n){return i[n]??null}let t={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},r={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${s} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${L(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${n.maximum.toString()} ${o.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${s} ${n.minimum.toString()} ${o.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${s} ${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${t[s.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${S(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},sb=T(()=>{U()});function LS(){return rb()}var jS=T(()=>{sb()});function BS(){return{localeError:ZS()}}var ZS=()=>{let i={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(n){return i[n]??null}let t={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${s}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${L(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${S(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let s=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",o=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),l=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${s}${o}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${s}${o}`}case"too_small":{let s=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",o=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),l=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${s}${o}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${s}${o}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${t[s.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${S(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},FS=T(()=>{U()});function Fg(i){let e=Math.abs(i),t=e%10,r=e%100;return r>=11&&r<=19||t===0?"many":t===1?"one":"few"}function qS(){return{localeError:HS()}}var gr=i=>i.charAt(0).toUpperCase()+i.slice(1),HS=()=>{let i={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(n,s,o,a){let l=i[n]??null;return l===null?l:{unit:l.unit[s],verb:l.verb[a][o?"inclusive":"notInclusive"]}}let t={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},r={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${s}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${L(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${S(n.values,"|")} pasirinkim\u0173`;case"too_big":{let s=r[n.origin]??n.origin,o=e(n.origin,Fg(Number(n.maximum)),n.inclusive??!1,"smaller");if(o?.verb)return`${gr(s??n.origin??"reik\u0161m\u0117")} ${o.verb} ${n.maximum.toString()} ${o.unit??"element\u0173"}`;let a=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${gr(s??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.maximum.toString()} ${o?.unit}`}case"too_small":{let s=r[n.origin]??n.origin,o=e(n.origin,Fg(Number(n.minimum)),n.inclusive??!1,"bigger");if(o?.verb)return`${gr(s??n.origin??"reik\u0161m\u0117")} ${o.verb} ${n.minimum.toString()} ${o.unit??"element\u0173"}`;let a=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${gr(s??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.minimum.toString()} ${o?.unit}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${s.prefix}"`:s.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${s.suffix}"`:s.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${s.includes}"`:s.format==="regex"?`Eilut\u0117 privalo atitikti ${s.pattern}`:`Neteisingas ${t[s.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${S(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let s=r[n.origin]??n.origin;return`${gr(s??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}},WS=T(()=>{U()});function VS(){return{localeError:XS()}}var XS=()=>{let i={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(n){return i[n]??null}let t={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},r={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${s}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${L(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${n.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${n.minimum.toString()} ${o.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${t[s.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${S(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},JS=T(()=>{U()});function KS(){return{localeError:GS()}}var GS=()=>{let i={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){return i[n]??null}let t={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${s}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${L(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Terlalu besar: dijangka ${n.origin??"nilai"} ${o.verb} ${s}${n.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Terlalu kecil: dijangka ${n.origin} ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${t[s.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${S(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}},YS=T(()=>{U()});function QS(){return{localeError:e1()}}var e1=()=>{let i={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(n){return i[n]??null}let t={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},r={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${s}, ontving ${a}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${L(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return o?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${s}${n.maximum.toString()} ${o.unit??"elementen"} ${o.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${s}${n.maximum.toString()} is`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return o?`Te ${a}: verwacht dat ${n.origin} ${s}${n.minimum.toString()} ${o.unit} ${o.verb}`:`Te ${a}: verwacht dat ${n.origin} ${s}${n.minimum.toString()} is`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${t[s.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${S(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}},t1=T(()=>{U()});function i1(){return{localeError:n1()}}var n1=()=>{let i={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(n){return i[n]??null}let t={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${s}, fikk ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${L(n.values[0])}`:`Ugyldig valg: forventet en av ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${s}${n.maximum.toString()} ${o.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`For lite(n): forventet ${n.origin} til \xE5 ha ${s}${n.minimum.toString()} ${o.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${t[s.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${S(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}},r1=T(()=>{U()});function s1(){return{localeError:o1()}}var o1=()=>{let i={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(n){return i[n]??null}let t={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},r={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${s}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${L(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${s}${n.maximum.toString()} ${o.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${s}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${s}${n.minimum.toString()} ${o.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${s}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let s=n;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${t[s.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${S(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},a1=T(()=>{U()});function l1(){return{localeError:u1()}}var u1=()=>{let i={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(n){return i[n]??null}let t={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},r={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${s} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${L(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${S(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${n.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${s}${n.minimum.toString()} ${o.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${s}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${t[s.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${S(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},c1=T(()=>{U()});function h1(){return{localeError:d1()}}var d1=()=>{let i={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(n){return i[n]??null}let t={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},r={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${s}, otrzymano ${a}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${L(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${n.maximum.toString()} ${o.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${n.minimum.toString()} ${o.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${t[s.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${S(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},f1=T(()=>{U()});function p1(){return{localeError:m1()}}var m1=()=>{let i={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){return i[n]??null}let t={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${s}, recebido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${L(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${s}${n.maximum.toString()} ${o.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Muito pequeno: esperado que ${n.origin} tivesse ${s}${n.minimum.toString()} ${o.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${t[s.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${S(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}},g1=T(()=>{U()});function qg(i,e,t,r){let n=Math.abs(i),s=n%10,o=n%100;return o>=11&&o<=19?r:s===1?e:s>=2&&s<=4?t:r}function v1(){return{localeError:b1()}}var b1=()=>{let i={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(n){return i[n]??null}let t={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},r={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${s}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${L(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);if(o){let a=Number(n.maximum),l=qg(a,o.unit.one,o.unit.few,o.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${n.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);if(o){let a=Number(n.minimum),l=qg(a,o.unit.one,o.unit.few,o.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${n.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${t[s.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${S(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},y1=T(()=>{U()});function k1(){return{localeError:x1()}}var x1=()=>{let i={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return i[n]??null}let t={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},r={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${s}, prejeto ${a}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${L(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${s}${n.maximum.toString()} ${o.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${s}${n.minimum.toString()} ${o.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${t[s.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${S(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}},w1=T(()=>{U()});function $1(){return{localeError:S1()}}var S1=()=>{let i={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(n){return i[n]??null}let t={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},r={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${s}, fick ${a}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${L(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${s}${n.maximum.toString()} ${o.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${s}${n.minimum.toString()} ${o.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${t[s.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${S(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},_1=T(()=>{U()});function O1(){return{localeError:I1()}}var I1=()=>{let i={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(n){return i[n]??null}let t={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${L(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${S(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${n.maximum.toString()} ${o.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${s}${n.minimum.toString()} ${o.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${s}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${t[s.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${S(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},C1=T(()=>{U()});function T1(){return{localeError:E1()}}var E1=()=>{let i={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(n){return i[n]??null}let t={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},r={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${s} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${L(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",o=e(n.origin);return o?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${n.maximum.toString()} ${o.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",o=e(n.origin);return o?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${n.minimum.toString()} ${o.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${t[s.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${S(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},A1=T(()=>{U()});function D1(){return{localeError:z1()}}var z1=()=>{let i={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return i[n]??null}let t={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${s}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${L(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${s}${n.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${s}${n.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Ge\xE7ersiz metin: "${s.prefix}" ile ba\u015Flamal\u0131`:s.format==="ends_with"?`Ge\xE7ersiz metin: "${s.suffix}" ile bitmeli`:s.format==="includes"?`Ge\xE7ersiz metin: "${s.includes}" i\xE7ermeli`:s.format==="regex"?`Ge\xE7ersiz metin: ${s.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${t[s.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${S(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},P1=T(()=>{U()});function ob(){return{localeError:M1()}}var M1=()=>{let i={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(n){return i[n]??null}let t={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},r={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${s}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${L(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${o.verb} ${s}${n.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${t[s.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${S(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},ab=T(()=>{U()});function N1(){return ob()}var R1=T(()=>{ab()});function U1(){return{localeError:L1()}}var L1=()=>{let i={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(n){return i[n]??null}let t={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},r={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${s} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${L(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${S(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${n.maximum.toString()} ${o.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${s}${n.minimum.toString()} ${o.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${s}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${t[s.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${S(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},j1=T(()=>{U()});function B1(){return{localeError:Z1()}}var Z1=()=>{let i={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function e(n){return i[n]??null}let t={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},r={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${s}, qabul qilingan ${a}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${L(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Juda katta: kutilgan ${n.origin??"qiymat"} ${s}${n.maximum.toString()} ${o.unit} ${o.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Juda kichik: kutilgan ${n.origin} ${s}${n.minimum.toString()} ${o.unit} ${o.verb}`:`Juda kichik: kutilgan ${n.origin} ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${s.prefix}" bilan boshlanishi kerak`:s.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${s.suffix}" bilan tugashi kerak`:s.format==="includes"?`Noto\u2018g\u2018ri satr: "${s.includes}" ni o\u2018z ichiga olishi kerak`:s.format==="regex"?`Noto\u2018g\u2018ri satr: ${s.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${t[s.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${S(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}},F1=T(()=>{U()});function q1(){return{localeError:H1()}}var H1=()=>{let i={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(n){return i[n]??null}let t={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},r={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${s}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${L(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o.verb} ${s}${n.maximum.toString()} ${o.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${t[s.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${S(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},W1=T(()=>{U()});function V1(){return{localeError:X1()}}var X1=()=>{let i={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(n){return i[n]??null}let t={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},r={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${s}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${L(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${s}${n.maximum.toString()} ${o.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${s}${n.minimum.toString()} ${o.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${t[s.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${S(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},J1=T(()=>{U()});function K1(){return{localeError:G1()}}var G1=()=>{let i={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(n){return i[n]??null}let t={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${s}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${L(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${s}${n.maximum.toString()} ${o.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${s}${n.minimum.toString()} ${o.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${t[s.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${S(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},Y1=T(()=>{U()});function Q1(){return{localeError:e_()}}var e_=()=>{let i={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(n){return i[n]??null}let t={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},r={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let s=r[n.expected]??n.expected,o=B(n.input),a=r[o]??o;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${s}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${L(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${S(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${o.verb} ${s}${n.maximum} ${o.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${s}${n.maximum}`}case"too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${o.verb} ${s}${n.minimum} ${o.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${s}${n.minimum}`}case"invalid_format":{let s=n;return s.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${s.prefix}"`:s.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${s.suffix}"`:s.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${s.includes}"`:s.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${s.pattern}`:`A\u1E63\xEC\u1E63e: ${t[s.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${S(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}},t_=T(()=>{U()}),na={};Et(na,{zhTW:()=>K1,zhCN:()=>V1,yo:()=>Q1,vi:()=>q1,uz:()=>B1,ur:()=>U1,uk:()=>ob,ua:()=>N1,tr:()=>D1,th:()=>T1,ta:()=>O1,sv:()=>$1,sl:()=>k1,ru:()=>v1,pt:()=>p1,ps:()=>l1,pl:()=>h1,ota:()=>s1,no:()=>i1,nl:()=>QS,ms:()=>KS,mk:()=>VS,lt:()=>qS,ko:()=>BS,km:()=>rb,kh:()=>LS,ka:()=>MS,ja:()=>DS,it:()=>TS,is:()=>OS,id:()=>$S,hy:()=>kS,hu:()=>vS,he:()=>pS,frCA:()=>hS,fr:()=>lS,fi:()=>sS,fa:()=>iS,es:()=>Q$,eo:()=>K$,en:()=>ib,de:()=>W$,da:()=>F$,cs:()=>j$,ca:()=>R$,bg:()=>P$,be:()=>A$,az:()=>C$,ar:()=>_$});var lb=T(()=>{I$(),E$(),z$(),N$(),L$(),Z$(),H$(),X$(),nb(),Y$(),tS(),rS(),aS(),cS(),fS(),gS(),yS(),wS(),_S(),CS(),AS(),PS(),RS(),jS(),sb(),FS(),WS(),JS(),YS(),t1(),r1(),a1(),c1(),f1(),g1(),y1(),w1(),_1(),C1(),A1(),P1(),R1(),ab(),j1(),F1(),W1(),J1(),Y1(),t_()}),Ro=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ra(){return new Ro}var Hg,sa,oa,We,aa=T(()=>{sa=Symbol("ZodOutput"),oa=Symbol("ZodInput"),(Hg=globalThis).__zod_globalRegistry??(Hg.__zod_globalRegistry=ra()),We=globalThis.__zod_globalRegistry});function ub(i,e){return new i({type:"string",..._(e)})}function cb(i,e){return new i({type:"string",coerce:!0,..._(e)})}function Lh(i,e){return new i({type:"string",format:"email",check:"string_format",abort:!1,..._(e)})}function Uo(i,e){return new i({type:"string",format:"guid",check:"string_format",abort:!1,..._(e)})}function jh(i,e){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,..._(e)})}function Bh(i,e){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._(e)})}function Zh(i,e){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._(e)})}function Fh(i,e){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._(e)})}function la(i,e){return new i({type:"string",format:"url",check:"string_format",abort:!1,..._(e)})}function qh(i,e){return new i({type:"string",format:"emoji",check:"string_format",abort:!1,..._(e)})}function Hh(i,e){return new i({type:"string",format:"nanoid",check:"string_format",abort:!1,..._(e)})}function Wh(i,e){return new i({type:"string",format:"cuid",check:"string_format",abort:!1,..._(e)})}function Vh(i,e){return new i({type:"string",format:"cuid2",check:"string_format",abort:!1,..._(e)})}function Xh(i,e){return new i({type:"string",format:"ulid",check:"string_format",abort:!1,..._(e)})}function Jh(i,e){return new i({type:"string",format:"xid",check:"string_format",abort:!1,..._(e)})}function Kh(i,e){return new i({type:"string",format:"ksuid",check:"string_format",abort:!1,..._(e)})}function Gh(i,e){return new i({type:"string",format:"ipv4",check:"string_format",abort:!1,..._(e)})}function Yh(i,e){return new i({type:"string",format:"ipv6",check:"string_format",abort:!1,..._(e)})}function hb(i,e){return new i({type:"string",format:"mac",check:"string_format",abort:!1,..._(e)})}function Qh(i,e){return new i({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._(e)})}function ed(i,e){return new i({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._(e)})}function td(i,e){return new i({type:"string",format:"base64",check:"string_format",abort:!1,..._(e)})}function id(i,e){return new i({type:"string",format:"base64url",check:"string_format",abort:!1,..._(e)})}function nd(i,e){return new i({type:"string",format:"e164",check:"string_format",abort:!1,..._(e)})}function rd(i,e){return new i({type:"string",format:"jwt",check:"string_format",abort:!1,..._(e)})}function db(i,e){return new i({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._(e)})}function fb(i,e){return new i({type:"string",format:"date",check:"string_format",..._(e)})}function pb(i,e){return new i({type:"string",format:"time",check:"string_format",precision:null,..._(e)})}function mb(i,e){return new i({type:"string",format:"duration",check:"string_format",..._(e)})}function gb(i,e){return new i({type:"number",checks:[],..._(e)})}function vb(i,e){return new i({type:"number",coerce:!0,checks:[],..._(e)})}function bb(i,e){return new i({type:"number",check:"number_format",abort:!1,format:"safeint",..._(e)})}function yb(i,e){return new i({type:"number",check:"number_format",abort:!1,format:"float32",..._(e)})}function kb(i,e){return new i({type:"number",check:"number_format",abort:!1,format:"float64",..._(e)})}function xb(i,e){return new i({type:"number",check:"number_format",abort:!1,format:"int32",..._(e)})}function wb(i,e){return new i({type:"number",check:"number_format",abort:!1,format:"uint32",..._(e)})}function $b(i,e){return new i({type:"boolean",..._(e)})}function Sb(i,e){return new i({type:"boolean",coerce:!0,..._(e)})}function _b(i,e){return new i({type:"bigint",..._(e)})}function Ob(i,e){return new i({type:"bigint",coerce:!0,..._(e)})}function Ib(i,e){return new i({type:"bigint",check:"bigint_format",abort:!1,format:"int64",..._(e)})}function Cb(i,e){return new i({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",..._(e)})}function Tb(i,e){return new i({type:"symbol",..._(e)})}function Eb(i,e){return new i({type:"undefined",..._(e)})}function Ab(i,e){return new i({type:"null",..._(e)})}function Db(i){return new i({type:"any"})}function zb(i){return new i({type:"unknown"})}function Pb(i,e){return new i({type:"never",..._(e)})}function Mb(i,e){return new i({type:"void",..._(e)})}function Nb(i,e){return new i({type:"date",..._(e)})}function Rb(i,e){return new i({type:"date",coerce:!0,..._(e)})}function Ub(i,e){return new i({type:"nan",..._(e)})}function Ht(i,e){return new Qo({check:"less_than",..._(e),value:i,inclusive:!1})}function Ke(i,e){return new Qo({check:"less_than",..._(e),value:i,inclusive:!0})}function Wt(i,e){return new ea({check:"greater_than",..._(e),value:i,inclusive:!1})}function Ze(i,e){return new ea({check:"greater_than",..._(e),value:i,inclusive:!0})}function ua(i){return Wt(0,i)}function ca(i){return Ht(0,i)}function ha(i){return Ke(0,i)}function da(i){return Ze(0,i)}function Oi(i,e){return new cc({check:"multiple_of",..._(e),value:i})}function Ii(i,e){return new fc({check:"max_size",..._(e),maximum:i})}function Ft(i,e){return new pc({check:"min_size",..._(e),minimum:i})}function cn(i,e){return new mc({check:"size_equals",..._(e),size:i})}function hn(i,e){return new gc({check:"max_length",..._(e),maximum:i})}function ii(i,e){return new vc({check:"min_length",..._(e),minimum:i})}function dn(i,e){return new bc({check:"length_equals",..._(e),length:i})}function Ar(i,e){return new yc({check:"string_format",format:"regex",..._(e),pattern:i})}function Dr(i){return new kc({check:"string_format",format:"lowercase",..._(i)})}function zr(i){return new xc({check:"string_format",format:"uppercase",..._(i)})}function Pr(i,e){return new wc({check:"string_format",format:"includes",..._(e),includes:i})}function Mr(i,e){return new $c({check:"string_format",format:"starts_with",..._(e),prefix:i})}function Nr(i,e){return new Sc({check:"string_format",format:"ends_with",..._(e),suffix:i})}function fa(i,e,t){return new _c({check:"property",property:i,schema:e,..._(t)})}function Rr(i,e){return new Oc({check:"mime_type",mime:i,..._(e)})}function At(i){return new Ic({check:"overwrite",tx:i})}function Ur(i){return At(e=>e.normalize(i))}function Lr(){return At(i=>i.trim())}function jr(){return At(i=>i.toLowerCase())}function Br(){return At(i=>i.toUpperCase())}function Zr(){return At(i=>nv(i))}function Lb(i,e,t){return new i({type:"array",element:e,..._(t)})}function i_(i,e,t){return new i({type:"union",options:e,..._(t)})}function n_(i,e,t){return new i({type:"union",options:e,inclusive:!1,..._(t)})}function r_(i,e,t,r){return new i({type:"union",options:t,discriminator:e,..._(r)})}function s_(i,e,t){return new i({type:"intersection",left:e,right:t})}function o_(i,e,t,r){let n=t instanceof F;return new i({type:"tuple",items:e,rest:n?t:null,..._(n?r:t)})}function a_(i,e,t,r){return new i({type:"record",keyType:e,valueType:t,..._(r)})}function l_(i,e,t,r){return new i({type:"map",keyType:e,valueType:t,..._(r)})}function u_(i,e,t){return new i({type:"set",valueType:e,..._(t)})}function c_(i,e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new i({type:"enum",entries:r,..._(t)})}function h_(i,e,t){return new i({type:"enum",entries:e,..._(t)})}function d_(i,e,t){return new i({type:"literal",values:Array.isArray(e)?e:[e],..._(t)})}function jb(i,e){return new i({type:"file",..._(e)})}function f_(i,e){return new i({type:"transform",transform:e})}function p_(i,e){return new i({type:"optional",innerType:e})}function m_(i,e){return new i({type:"nullable",innerType:e})}function g_(i,e,t){return new i({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():rv(t)}})}function v_(i,e,t){return new i({type:"nonoptional",innerType:e,..._(t)})}function b_(i,e){return new i({type:"success",innerType:e})}function y_(i,e,t){return new i({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function k_(i,e,t){return new i({type:"pipe",in:e,out:t})}function x_(i,e){return new i({type:"readonly",innerType:e})}function w_(i,e,t){return new i({type:"template_literal",parts:e,..._(t)})}function $_(i,e){return new i({type:"lazy",getter:e})}function S_(i,e){return new i({type:"promise",innerType:e})}function Bb(i,e,t){let r=_(t);return r.abort??(r.abort=!0),new i({type:"custom",check:"custom",fn:e,...r})}function Zb(i,e,t){return new i({type:"custom",check:"custom",fn:e,..._(t)})}function Fb(i){let e=qb(t=>(t.addIssue=r=>{if(typeof r=="string")t.issues.push(Io(r,t.value,e._zod.def));else{let n=r;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=t.value),n.inst??(n.inst=e),n.continue??(n.continue=!e._zod.def.abort),t.issues.push(Io(n))}},i(t.value,t)));return e}function qb(i,e){let t=new ve({check:"custom",..._(e)});return t._zod.check=i,t}function Hb(i){let e=new ve({check:"describe"});return e._zod.onattach=[t=>{let r=We.get(t)??{};We.add(t,{...r,description:i})}],e._zod.check=()=>{},e}function Wb(i){let e=new ve({check:"meta"});return e._zod.onattach=[t=>{let r=We.get(t)??{};We.add(t,{...r,...i})}],e._zod.check=()=>{},e}function Vb(i,e){let t=_(e),r=t.truthy??["true","1","yes","on","y","enabled"],n=t.falsy??["false","0","no","off","n","disabled"];t.case!=="sensitive"&&(r=r.map(d=>typeof d=="string"?d.toLowerCase():d),n=n.map(d=>typeof d=="string"?d.toLowerCase():d));let s=new Set(r),o=new Set(n),a=i.Codec??ia,l=i.Boolean??ta,u=new(i.String??un)({type:"string",error:t.error}),c=new l({type:"boolean",error:t.error}),h=new a({type:"pipe",in:u,out:c,transform:(d,f)=>{let p=d;return t.case!=="sensitive"&&(p=p.toLowerCase()),s.has(p)?!0:o.has(p)?!1:(f.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...o],input:f.value,inst:h,continue:!1}),{})},reverseTransform:(d,f)=>d===!0?r[0]||"true":n[0]||"false",error:t.error});return h}function Fr(i,e,t,r={}){let n=_(r),s={..._(r),check:"string_format",type:"string",format:e,fn:typeof t=="function"?t:o=>t.test(o),...n};return t instanceof RegExp&&(s.pattern=t),new i(s)}var pa,__=T(()=>{Cc(),aa(),tb(),U(),pa={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function fn(i){let e=i?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:i.processors??{},metadataRegistry:i?.metadata??We,target:e,unrepresentable:i?.unrepresentable??"throw",override:i?.override??(()=>{}),io:i?.io??"output",counter:0,seen:new Map,cycles:i?.cycles??"ref",reused:i?.reused??"inline",external:i?.external??void 0}}function le(i,e,t={path:[],schemaPath:[]}){var r;let n=i._zod.def,s=e.seen.get(i);if(s)return s.count++,t.schemaPath.includes(i)&&(s.cycle=t.path),s.schema;let o={schema:{},count:1,cycle:void 0,path:t.path};e.seen.set(i,o);let a=i._zod.toJSONSchema?.();if(a)o.schema=a;else{let u={...t,schemaPath:[...t.schemaPath,i],path:t.path};if(i._zod.processJSONSchema)i._zod.processJSONSchema(e,o.schema,u);else{let h=o.schema,d=e.processors[n.type];if(!d)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);d(i,e,h,u)}let c=i._zod.parent;c&&(o.ref||(o.ref=c),le(c,e,u),e.seen.get(c).isParent=!0)}let l=e.metadataRegistry.get(i);return l&&Object.assign(o.schema,l),e.io==="input"&&je(i)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(i).schema}function pn(i,e){let t=i.seen.get(e);if(!t)throw Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let o of i.seen.entries()){let a=i.metadataRegistry.get(o[0])?.id;if(a){let l=r.get(a);if(l&&l!==o[0])throw Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,o[0])}}let n=o=>{let a=i.target==="draft-2020-12"?"$defs":"definitions";if(i.external){let c=i.external.registry.get(o[0])?.id,h=i.external.uri??(f=>f);if(c)return{ref:h(c)};let d=o[1].defId??o[1].schema.id??`schema${i.counter++}`;return o[1].defId=d,{defId:d,ref:`${h("__shared")}#/${a}/${d}`}}if(o[1]===t)return{ref:"#"};let l=`#/${a}/`,u=o[1].schema.id??`__schema${i.counter++}`;return{defId:u,ref:l+u}},s=o=>{if(o[1].schema.$ref)return;let a=o[1],{ref:l,defId:u}=n(o);a.def={...a.schema},u&&(a.defId=u);let c=a.schema;for(let h in c)delete c[h];c.$ref=l};if(i.cycles==="throw")for(let o of i.seen.entries()){let a=o[1];if(a.cycle)throw Error(`Cycle detected: #/${a.cycle?.join("/")}/ + +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of i.seen.entries()){let a=o[1];if(e===o[0]){s(o);continue}if(i.external){let l=i.external.registry.get(o[0])?.id;if(e!==o[0]&&l){s(o);continue}}if(i.metadataRegistry.get(o[0])?.id){s(o);continue}if(a.cycle){s(o);continue}if(a.count>1&&i.reused==="ref"){s(o);continue}}}function mn(i,e){let t=i.seen.get(e);if(!t)throw Error("Unprocessed schema. This is a bug in Zod.");let r=o=>{let a=i.seen.get(o);if(a.ref===null)return;let l=a.def??a.schema,u={...l},c=a.ref;if(a.ref=null,c){r(c);let d=i.seen.get(c),f=d.schema;if(f.$ref&&(i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(f)):Object.assign(l,f),Object.assign(l,u),o._zod.parent===c)for(let p in l)p==="$ref"||p==="allOf"||p in u||delete l[p];if(f.$ref)for(let p in l)p==="$ref"||p==="allOf"||p in d.def&&JSON.stringify(l[p])===JSON.stringify(d.def[p])&&delete l[p]}let h=o._zod.parent;if(h&&h!==c){r(h);let d=i.seen.get(h);if(d?.schema.$ref&&(l.$ref=d.schema.$ref,d.def))for(let f in l)f==="$ref"||f==="allOf"||f in d.def&&JSON.stringify(l[f])===JSON.stringify(d.def[f])&&delete l[f]}i.override({zodSchema:o,jsonSchema:l,path:a.path??[]})};for(let o of[...i.seen.entries()].reverse())r(o[0]);let n={};if(i.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":i.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":i.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":i.target,i.external?.uri){let o=i.external.registry.get(e)?.id;if(!o)throw Error("Schema is missing an `id` property");n.$id=i.external.uri(o)}Object.assign(n,t.def??t.schema);let s=i.external?.defs??{};for(let o of i.seen.entries()){let a=o[1];a.def&&a.defId&&(s[a.defId]=a.def)}i.external||Object.keys(s).length>0&&(i.target==="draft-2020-12"?n.$defs=s:n.definitions=s);try{let o=JSON.parse(JSON.stringify(n));return Object.defineProperty(o,"~standard",{value:{...e["~standard"],jsonSchema:{input:$r(e,"input",i.processors),output:$r(e,"output",i.processors)}},enumerable:!1,writable:!1}),o}catch{throw Error("Error converting schema to JSON.")}}function je(i,e){let t=e??{seen:new Set};if(t.seen.has(i))return!1;t.seen.add(i);let r=i._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return je(r.element,t);if(r.type==="set")return je(r.valueType,t);if(r.type==="lazy")return je(r.getter(),t);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return je(r.innerType,t);if(r.type==="intersection")return je(r.left,t)||je(r.right,t);if(r.type==="record"||r.type==="map")return je(r.keyType,t)||je(r.valueType,t);if(r.type==="pipe")return je(r.in,t)||je(r.out,t);if(r.type==="object"){for(let n in r.shape)if(je(r.shape[n],t))return!0;return!1}if(r.type==="union"){for(let n of r.options)if(je(n,t))return!0;return!1}if(r.type==="tuple"){for(let n of r.items)if(je(n,t))return!0;return!!(r.rest&&je(r.rest,t))}return!1}var Xb=(i,e={})=>t=>{let r=fn({...t,processors:e});return le(i,r),pn(r,i),mn(r,i)},$r=(i,e,t={})=>r=>{let{libraryOptions:n,target:s}=r??{},o=fn({...n??{},target:s,io:e,processors:t});return le(i,o),pn(o,i),mn(o,i)},ma=T(()=>{aa()});function sd(i,e){if("_idmap"in i){let r=i,n=fn({...e,processors:Lo}),s={};for(let l of r._idmap.entries()){let[u,c]=l;le(c,n)}let o={},a={registry:r,uri:e?.uri,defs:s};n.external=a;for(let l of r._idmap.entries()){let[u,c]=l;pn(n,c),o[u]=mn(n,c)}if(Object.keys(s).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[l]:s}}return{schemas:o}}let t=fn({...e,processors:Lo});return le(i,t),pn(t,i),mn(t,i)}var Jb,Kb=(i,e,t,r)=>{let n=t;n.type="string";let{minimum:s,maximum:o,format:a,patterns:l,contentEncoding:u}=i._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof o=="number"&&(n.maxLength=o),a&&(n.format=Jb[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),u&&(n.contentEncoding=u),l&&l.size>0){let c=[...l];c.length===1?n.pattern=c[0].source:c.length>1&&(n.allOf=[...c.map(h=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},Gb=(i,e,t,r)=>{let n=t,{minimum:s,maximum:o,format:a,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:c}=i._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number",typeof c=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(n.minimum=c,n.exclusiveMinimum=!0):n.exclusiveMinimum=c),typeof s=="number"&&(n.minimum=s,typeof c=="number"&&e.target!=="draft-04"&&(c>=s?delete n.minimum:delete n.exclusiveMinimum)),typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u),typeof o=="number"&&(n.maximum=o,typeof u=="number"&&e.target!=="draft-04"&&(u<=o?delete n.maximum:delete n.exclusiveMaximum)),typeof l=="number"&&(n.multipleOf=l)},Yb=(i,e,t,r)=>{t.type="boolean"},Qb=(i,e,t,r)=>{if(e.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},ey=(i,e,t,r)=>{if(e.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},ty=(i,e,t,r)=>{e.target==="openapi-3.0"?(t.type="string",t.nullable=!0,t.enum=[null]):t.type="null"},iy=(i,e,t,r)=>{if(e.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},ny=(i,e,t,r)=>{if(e.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},ry=(i,e,t,r)=>{t.not={}},sy=(i,e,t,r)=>{},oy=(i,e,t,r)=>{},ay=(i,e,t,r)=>{if(e.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},ly=(i,e,t,r)=>{let n=i._zod.def,s=Su(n.entries);s.every(o=>typeof o=="number")&&(t.type="number"),s.every(o=>typeof o=="string")&&(t.type="string"),t.enum=s},uy=(i,e,t,r)=>{let n=i._zod.def,s=[];for(let o of n.values)if(o===void 0){if(e.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o))}else s.push(o);if(s.length!==0)if(s.length===1){let o=s[0];t.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?t.enum=[o]:t.const=o}else s.every(o=>typeof o=="number")&&(t.type="number"),s.every(o=>typeof o=="string")&&(t.type="string"),s.every(o=>typeof o=="boolean")&&(t.type="boolean"),s.every(o=>o===null)&&(t.type="null"),t.enum=s},cy=(i,e,t,r)=>{if(e.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},hy=(i,e,t,r)=>{let n=t,s=i._zod.pattern;if(!s)throw Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},dy=(i,e,t,r)=>{let n=t,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:a,mime:l}=i._zod.bag;o!==void 0&&(s.minLength=o),a!==void 0&&(s.maxLength=a),l?l.length===1?(s.contentMediaType=l[0],Object.assign(n,s)):(Object.assign(n,s),n.anyOf=l.map(u=>({contentMediaType:u}))):Object.assign(n,s)},fy=(i,e,t,r)=>{t.type="boolean"},py=(i,e,t,r)=>{if(e.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},my=(i,e,t,r)=>{if(e.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},gy=(i,e,t,r)=>{if(e.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},vy=(i,e,t,r)=>{if(e.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},by=(i,e,t,r)=>{if(e.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},yy=(i,e,t,r)=>{let n=t,s=i._zod.def,{minimum:o,maximum:a}=i._zod.bag;typeof o=="number"&&(n.minItems=o),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=le(s.element,e,{...r,path:[...r.path,"items"]})},ky=(i,e,t,r)=>{let n=t,s=i._zod.def;n.type="object",n.properties={};let o=s.shape;for(let u in o)n.properties[u]=le(o[u],e,{...r,path:[...r.path,"properties",u]});let a=new Set(Object.keys(o)),l=new Set([...a].filter(u=>{let c=s.shape[u]._zod;return e.io==="input"?c.optin===void 0:c.optout===void 0}));l.size>0&&(n.required=Array.from(l)),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=le(s.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=!1)},vu=(i,e,t,r)=>{let n=i._zod.def,s=n.inclusive===!1,o=n.options.map((a,l)=>le(a,e,{...r,path:[...r.path,s?"oneOf":"anyOf",l]}));s?t.oneOf=o:t.anyOf=o},xy=(i,e,t,r)=>{let n=i._zod.def,s=le(n.left,e,{...r,path:[...r.path,"allOf",0]}),o=le(n.right,e,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(s)?s.allOf:[s],...a(o)?o.allOf:[o]];t.allOf=l},wy=(i,e,t,r)=>{let n=t,s=i._zod.def;n.type="array";let o=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",l=s.items.map((d,f)=>le(d,e,{...r,path:[...r.path,o,f]})),u=s.rest?le(s.rest,e,{...r,path:[...r.path,a,...e.target==="openapi-3.0"?[s.items.length]:[]]}):null;e.target==="draft-2020-12"?(n.prefixItems=l,u&&(n.items=u)):e.target==="openapi-3.0"?(n.items={anyOf:l},u&&n.items.anyOf.push(u),n.minItems=l.length,!u&&(n.maxItems=l.length)):(n.items=l,u&&(n.additionalItems=u));let{minimum:c,maximum:h}=i._zod.bag;typeof c=="number"&&(n.minItems=c),typeof h=="number"&&(n.maxItems=h)},$y=(i,e,t,r)=>{let n=t,s=i._zod.def;n.type="object";let o=s.keyType,a=o._zod.bag?.patterns;if(s.mode==="loose"&&a&&a.size>0){let u=le(s.valueType,e,{...r,path:[...r.path,"patternProperties","*"]});n.patternProperties={};for(let c of a)n.patternProperties[c.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(n.propertyNames=le(s.keyType,e,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=le(s.valueType,e,{...r,path:[...r.path,"additionalProperties"]});let l=o._zod.values;if(l){let u=[...l].filter(c=>typeof c=="string"||typeof c=="number");u.length>0&&(n.required=u)}},Sy=(i,e,t,r)=>{let n=i._zod.def,s=le(n.innerType,e,r),o=e.seen.get(i);e.target==="openapi-3.0"?(o.ref=n.innerType,t.nullable=!0):t.anyOf=[s,{type:"null"}]},_y=(i,e,t,r)=>{let n=i._zod.def;le(n.innerType,e,r);let s=e.seen.get(i);s.ref=n.innerType},Oy=(i,e,t,r)=>{let n=i._zod.def;le(n.innerType,e,r);let s=e.seen.get(i);s.ref=n.innerType,t.default=JSON.parse(JSON.stringify(n.defaultValue))},Iy=(i,e,t,r)=>{let n=i._zod.def;le(n.innerType,e,r);let s=e.seen.get(i);s.ref=n.innerType,e.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Cy=(i,e,t,r)=>{let n=i._zod.def;le(n.innerType,e,r);let s=e.seen.get(i);s.ref=n.innerType;let o;try{o=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}t.default=o},Ty=(i,e,t,r)=>{let n=i._zod.def,s=e.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;le(s,e,r);let o=e.seen.get(i);o.ref=s},Ey=(i,e,t,r)=>{let n=i._zod.def;le(n.innerType,e,r);let s=e.seen.get(i);s.ref=n.innerType,t.readOnly=!0},Ay=(i,e,t,r)=>{let n=i._zod.def;le(n.innerType,e,r);let s=e.seen.get(i);s.ref=n.innerType},bu=(i,e,t,r)=>{let n=i._zod.def;le(n.innerType,e,r);let s=e.seen.get(i);s.ref=n.innerType},Dy=(i,e,t,r)=>{let n=i._zod.innerType;le(n,e,r);let s=e.seen.get(i);s.ref=n},Lo,ga=T(()=>{ma(),U(),Jb={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Lo={string:Kb,number:Gb,boolean:Yb,bigint:Qb,symbol:ey,null:ty,undefined:iy,void:ny,never:ry,any:sy,unknown:oy,date:ay,enum:ly,literal:uy,nan:cy,template_literal:hy,file:dy,success:fy,custom:py,function:my,transform:gy,map:vy,set:by,array:yy,object:ky,union:vu,intersection:xy,tuple:wy,record:$y,nullable:Sy,nonoptional:_y,default:Oy,prefault:Iy,catch:Cy,pipe:Ty,readonly:Ey,promise:Ay,optional:bu,lazy:Dy}}),yu=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),this.ctx=fn({processors:Lo,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return le(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),pn(this.ctx,e);let r=mn(this.ctx,e),{"~standard":n,...s}=r;return s}},O_=T(()=>{ga(),ma()}),I_={},C_=()=>{},od={};Et(od,{version:()=>Tc,util:()=>X,treeifyError:()=>Tu,toJSONSchema:()=>sd,toDotPath:()=>lv,safeParseAsync:()=>Au,safeParse:()=>Go,safeEncodeAsync:()=>gv,safeEncode:()=>pv,safeDecodeAsync:()=>vv,safeDecode:()=>mv,registry:()=>ra,regexes:()=>si,process:()=>le,prettifyError:()=>Eu,parseAsync:()=>To,parse:()=>Co,meta:()=>Wb,locales:()=>na,isValidJWT:()=>eb,isValidBase64URL:()=>Qv,isValidBase64:()=>Ec,initializeContext:()=>fn,globalRegistry:()=>We,globalConfig:()=>xr,formatError:()=>Jo,flattenError:()=>Xo,finalize:()=>mn,extractDefs:()=>pn,encodeAsync:()=>dv,encode:()=>cv,describe:()=>Hb,decodeAsync:()=>fv,decode:()=>hv,createToJSONSchemaMethod:()=>Xb,createStandardJSONSchemaMethod:()=>$r,config:()=>Te,clone:()=>Ye,_xor:()=>n_,_xid:()=>Jh,_void:()=>Mb,_uuidv7:()=>Fh,_uuidv6:()=>Zh,_uuidv4:()=>Bh,_uuid:()=>jh,_url:()=>la,_uppercase:()=>zr,_unknown:()=>zb,_union:()=>i_,_undefined:()=>Eb,_ulid:()=>Xh,_uint64:()=>Cb,_uint32:()=>wb,_tuple:()=>o_,_trim:()=>Lr,_transform:()=>f_,_toUpperCase:()=>Br,_toLowerCase:()=>jr,_templateLiteral:()=>w_,_symbol:()=>Tb,_superRefine:()=>Fb,_success:()=>b_,_stringbool:()=>Vb,_stringFormat:()=>Fr,_string:()=>ub,_startsWith:()=>Mr,_slugify:()=>Zr,_size:()=>cn,_set:()=>u_,_safeParseAsync:()=>Er,_safeParse:()=>Tr,_safeEncodeAsync:()=>Uu,_safeEncode:()=>Nu,_safeDecodeAsync:()=>Lu,_safeDecode:()=>Ru,_regex:()=>Ar,_refine:()=>Zb,_record:()=>a_,_readonly:()=>x_,_property:()=>fa,_promise:()=>S_,_positive:()=>ua,_pipe:()=>k_,_parseAsync:()=>Cr,_parse:()=>Ir,_overwrite:()=>At,_optional:()=>p_,_number:()=>gb,_nullable:()=>m_,_null:()=>Ab,_normalize:()=>Ur,_nonpositive:()=>ha,_nonoptional:()=>v_,_nonnegative:()=>da,_never:()=>Pb,_negative:()=>ca,_nativeEnum:()=>h_,_nanoid:()=>Hh,_nan:()=>Ub,_multipleOf:()=>Oi,_minSize:()=>Ft,_minLength:()=>ii,_min:()=>Ze,_mime:()=>Rr,_maxSize:()=>Ii,_maxLength:()=>hn,_max:()=>Ke,_map:()=>l_,_mac:()=>hb,_lte:()=>Ke,_lt:()=>Ht,_lowercase:()=>Dr,_literal:()=>d_,_length:()=>dn,_lazy:()=>$_,_ksuid:()=>Kh,_jwt:()=>rd,_isoTime:()=>pb,_isoDuration:()=>mb,_isoDateTime:()=>db,_isoDate:()=>fb,_ipv6:()=>Yh,_ipv4:()=>Gh,_intersection:()=>s_,_int64:()=>Ib,_int32:()=>xb,_int:()=>bb,_includes:()=>Pr,_guid:()=>Uo,_gte:()=>Ze,_gt:()=>Wt,_float64:()=>kb,_float32:()=>yb,_file:()=>jb,_enum:()=>c_,_endsWith:()=>Nr,_encodeAsync:()=>Pu,_encode:()=>Du,_emoji:()=>qh,_email:()=>Lh,_e164:()=>nd,_discriminatedUnion:()=>r_,_default:()=>g_,_decodeAsync:()=>Mu,_decode:()=>zu,_date:()=>Nb,_custom:()=>Bb,_cuid2:()=>Vh,_cuid:()=>Wh,_coercedString:()=>cb,_coercedNumber:()=>vb,_coercedDate:()=>Rb,_coercedBoolean:()=>Sb,_coercedBigint:()=>Ob,_cidrv6:()=>ed,_cidrv4:()=>Qh,_check:()=>qb,_catch:()=>y_,_boolean:()=>$b,_bigint:()=>_b,_base64url:()=>id,_base64:()=>td,_array:()=>Lb,_any:()=>Db,TimePrecision:()=>pa,NEVER:()=>Ho,JSONSchemaGenerator:()=>yu,JSONSchema:()=>I_,Doc:()=>Ao,$output:()=>sa,$input:()=>oa,$constructor:()=>y,$brand:()=>Wo,$ZodXor:()=>ph,$ZodXID:()=>jc,$ZodVoid:()=>ch,$ZodUnknown:()=>lh,$ZodUnion:()=>yr,$ZodUndefined:()=>sh,$ZodUUID:()=>Dc,$ZodURL:()=>Pc,$ZodULID:()=>Lc,$ZodType:()=>F,$ZodTuple:()=>Mo,$ZodTransform:()=>$h,$ZodTemplateLiteral:()=>Ph,$ZodSymbol:()=>rh,$ZodSuccess:()=>Th,$ZodStringFormat:()=>ae,$ZodString:()=>un,$ZodSet:()=>yh,$ZodRegistry:()=>Ro,$ZodRecord:()=>vh,$ZodRealError:()=>He,$ZodReadonly:()=>zh,$ZodPromise:()=>Nh,$ZodPrefault:()=>Ih,$ZodPipe:()=>Dh,$ZodOptional:()=>No,$ZodObjectJIT:()=>fh,$ZodObject:()=>gu,$ZodNumberFormat:()=>ih,$ZodNumber:()=>zo,$ZodNullable:()=>_h,$ZodNull:()=>oh,$ZodNonOptional:()=>Ch,$ZodNever:()=>uh,$ZodNanoID:()=>Nc,$ZodNaN:()=>Ah,$ZodMap:()=>bh,$ZodMAC:()=>Xc,$ZodLiteral:()=>xh,$ZodLazy:()=>Rh,$ZodKSUID:()=>Bc,$ZodJWT:()=>eh,$ZodIntersection:()=>gh,$ZodISOTime:()=>qc,$ZodISODuration:()=>Hc,$ZodISODateTime:()=>Zc,$ZodISODate:()=>Fc,$ZodIPv6:()=>Vc,$ZodIPv4:()=>Wc,$ZodGUID:()=>Ac,$ZodFunction:()=>Mh,$ZodFile:()=>wh,$ZodExactOptional:()=>Sh,$ZodError:()=>Ko,$ZodEnum:()=>kh,$ZodEncodeError:()=>kr,$ZodEmoji:()=>Mc,$ZodEmail:()=>zc,$ZodE164:()=>Qc,$ZodDiscriminatedUnion:()=>mh,$ZodDefault:()=>Oh,$ZodDate:()=>hh,$ZodCustomStringFormat:()=>th,$ZodCustom:()=>Uh,$ZodCodec:()=>ia,$ZodCheckUpperCase:()=>xc,$ZodCheckStringFormat:()=>sn,$ZodCheckStartsWith:()=>$c,$ZodCheckSizeEquals:()=>mc,$ZodCheckRegex:()=>yc,$ZodCheckProperty:()=>_c,$ZodCheckOverwrite:()=>Ic,$ZodCheckNumberFormat:()=>hc,$ZodCheckMultipleOf:()=>cc,$ZodCheckMinSize:()=>pc,$ZodCheckMinLength:()=>vc,$ZodCheckMimeType:()=>Oc,$ZodCheckMaxSize:()=>fc,$ZodCheckMaxLength:()=>gc,$ZodCheckLowerCase:()=>kc,$ZodCheckLessThan:()=>Qo,$ZodCheckLengthEquals:()=>bc,$ZodCheckIncludes:()=>wc,$ZodCheckGreaterThan:()=>ea,$ZodCheckEndsWith:()=>Sc,$ZodCheckBigIntFormat:()=>dc,$ZodCheck:()=>ve,$ZodCatch:()=>Eh,$ZodCUID2:()=>Uc,$ZodCUID:()=>Rc,$ZodCIDRv6:()=>Kc,$ZodCIDRv4:()=>Jc,$ZodBoolean:()=>ta,$ZodBigIntFormat:()=>nh,$ZodBigInt:()=>Po,$ZodBase64URL:()=>Yc,$ZodBase64:()=>Gc,$ZodAsyncError:()=>ti,$ZodArray:()=>dh,$ZodAny:()=>ah});var Ge=T(()=>{U(),uc(),lb(),ga(),O_(),C_(),Or(),bv(),uv(),tb(),Cc(),Yv(),aa(),__(),ma()}),zy={};Et(zy,{uppercase:()=>zr,trim:()=>Lr,toUpperCase:()=>Br,toLowerCase:()=>jr,startsWith:()=>Mr,slugify:()=>Zr,size:()=>cn,regex:()=>Ar,property:()=>fa,positive:()=>ua,overwrite:()=>At,normalize:()=>Ur,nonpositive:()=>ha,nonnegative:()=>da,negative:()=>ca,multipleOf:()=>Oi,minSize:()=>Ft,minLength:()=>ii,mime:()=>Rr,maxSize:()=>Ii,maxLength:()=>hn,lte:()=>Ke,lt:()=>Ht,lowercase:()=>Dr,length:()=>dn,includes:()=>Pr,gte:()=>Ze,gt:()=>Wt,endsWith:()=>Nr});var ad=T(()=>{Ge()}),qr={};Et(qr,{time:()=>Ny,duration:()=>Ry,datetime:()=>Py,date:()=>My,ZodISOTime:()=>Vr,ZodISODuration:()=>Xr,ZodISODateTime:()=>Hr,ZodISODate:()=>Wr});function Py(i){return db(Hr,i)}function My(i){return fb(Wr,i)}function Ny(i){return pb(Vr,i)}function Ry(i){return mb(Xr,i)}var Hr,Wr,Vr,Xr,jo=T(()=>{Ge(),Za(),Hr=y("ZodISODateTime",(i,e)=>{Zc.init(i,e),se.init(i,e)}),Wr=y("ZodISODate",(i,e)=>{Fc.init(i,e),se.init(i,e)}),Vr=y("ZodISOTime",(i,e)=>{qc.init(i,e),se.init(i,e)}),Xr=y("ZodISODuration",(i,e)=>{Hc.init(i,e),se.init(i,e)})}),Wg=(i,e)=>{Ko.init(i,e),i.name="ZodError",Object.defineProperties(i,{format:{value:t=>Jo(i,t)},flatten:{value:t=>Xo(i,t)},addIssue:{value:t=>{i.issues.push(t),i.message=JSON.stringify(i.issues,Oo,2)}},addIssues:{value:t=>{i.issues.push(...t),i.message=JSON.stringify(i.issues,Oo,2)}},isEmpty:{get(){return i.issues.length===0}}})},ld,Be,Uy=T(()=>{Ge(),Ge(),U(),ld=y("ZodError",Wg),Be=y("ZodError",Wg,{Parent:Error})}),va,ba,ya,ka,xa,wa,$a,Sa,_a,Oa,Ia,Ca,Ly=T(()=>{Ge(),Uy(),va=Ir(Be),ba=Cr(Be),ya=Tr(Be),ka=Er(Be),xa=Du(Be),wa=zu(Be),$a=Pu(Be),Sa=Mu(Be),_a=Nu(Be),Oa=Ru(Be),Ia=Uu(Be),Ca=Lu(Be)}),jy={};Et(jy,{xor:()=>Gd,xid:()=>wd,void:()=>Vd,uuidv7:()=>pd,uuidv6:()=>fd,uuidv4:()=>dd,uuid:()=>hd,url:()=>md,unknown:()=>ue,union:()=>ce,undefined:()=>Hd,ulid:()=>xd,uint64:()=>Fd,uint32:()=>jd,tuple:()=>Ta,transform:()=>Yr,templateLiteral:()=>uf,symbol:()=>qd,superRefine:()=>La,success:()=>of,stringbool:()=>pf,stringFormat:()=>zd,string:()=>k,strictObject:()=>Kd,set:()=>tf,refine:()=>Ua,record:()=>oe,readonly:()=>Ma,promise:()=>cf,preprocess:()=>Qr,prefault:()=>Da,pipe:()=>vn,partialRecord:()=>Yd,optional:()=>de,object:()=>z,number:()=>ee,nullish:()=>sf,nullable:()=>gn,null:()=>Jr,nonoptional:()=>za,never:()=>Kr,nativeEnum:()=>nf,nanoid:()=>bd,nan:()=>af,meta:()=>Ba,map:()=>ef,mac:()=>_d,looseRecord:()=>Qd,looseObject:()=>Ce,literal:()=>M,lazy:()=>Na,ksuid:()=>$d,keyof:()=>Jd,jwt:()=>Dd,json:()=>ff,ipv6:()=>Od,ipv4:()=>Sd,intersection:()=>Ln,int64:()=>Zd,int32:()=>Ld,int:()=>Sr,instanceof:()=>df,httpUrl:()=>gd,hostname:()=>Pd,hex:()=>Md,hash:()=>Nd,guid:()=>cd,function:()=>bn,float64:()=>Ud,float32:()=>Rd,file:()=>rf,exactOptional:()=>Ea,enum:()=>Ee,emoji:()=>vd,email:()=>ud,e164:()=>Ad,discriminatedUnion:()=>Gr,describe:()=>ja,date:()=>Xd,custom:()=>Ra,cuid2:()=>kd,cuid:()=>yd,codec:()=>lf,cidrv6:()=>Cd,cidrv4:()=>Id,check:()=>hf,catch:()=>Pa,boolean:()=>xe,bigint:()=>Bd,base64url:()=>Ed,base64:()=>Td,array:()=>V,any:()=>Wd,_function:()=>bn,_default:()=>Aa,_ZodString:()=>ln,ZodXor:()=>us,ZodXID:()=>_n,ZodVoid:()=>as,ZodUnknown:()=>ss,ZodUnion:()=>Ti,ZodUndefined:()=>is,ZodUUID:()=>ut,ZodURL:()=>Ai,ZodULID:()=>Sn,ZodType:()=>q,ZodTuple:()=>ds,ZodTransform:()=>vs,ZodTemplateLiteral:()=>Os,ZodSymbol:()=>ts,ZodSuccess:()=>ws,ZodStringFormat:()=>se,ZodString:()=>Pi,ZodSet:()=>ps,ZodRecord:()=>Ri,ZodReadonly:()=>_s,ZodPromise:()=>Cs,ZodPrefault:()=>xs,ZodPipe:()=>Rn,ZodOptional:()=>Mn,ZodObject:()=>Ni,ZodNumberFormat:()=>Xt,ZodNumber:()=>Di,ZodNullable:()=>ys,ZodNull:()=>ns,ZodNonOptional:()=>Nn,ZodNever:()=>os,ZodNanoID:()=>xn,ZodNaN:()=>Ss,ZodMap:()=>fs,ZodMAC:()=>es,ZodLiteral:()=>ms,ZodLazy:()=>Is,ZodKSUID:()=>On,ZodJWT:()=>Pn,ZodIntersection:()=>hs,ZodIPv6:()=>Cn,ZodIPv4:()=>In,ZodGUID:()=>Ci,ZodFunction:()=>Ts,ZodFile:()=>gs,ZodExactOptional:()=>bs,ZodEnum:()=>ni,ZodEmoji:()=>kn,ZodEmail:()=>yn,ZodE164:()=>zn,ZodDiscriminatedUnion:()=>cs,ZodDefault:()=>ks,ZodDate:()=>Bn,ZodCustomStringFormat:()=>oi,ZodCustom:()=>Ui,ZodCodec:()=>Zn,ZodCatch:()=>$s,ZodCUID2:()=>$n,ZodCUID:()=>wn,ZodCIDRv6:()=>En,ZodCIDRv4:()=>Tn,ZodBoolean:()=>Mi,ZodBigIntFormat:()=>jn,ZodBigInt:()=>zi,ZodBase64URL:()=>Dn,ZodBase64:()=>An,ZodArray:()=>ls,ZodAny:()=>rs});function k(i){return ub(Pi,i)}function ud(i){return Lh(yn,i)}function cd(i){return Uo(Ci,i)}function hd(i){return jh(ut,i)}function dd(i){return Bh(ut,i)}function fd(i){return Zh(ut,i)}function pd(i){return Fh(ut,i)}function md(i){return la(Ai,i)}function gd(i){return la(Ai,{protocol:/^https?$/,hostname:si.domain,...X.normalizeParams(i)})}function vd(i){return qh(kn,i)}function bd(i){return Hh(xn,i)}function yd(i){return Wh(wn,i)}function kd(i){return Vh($n,i)}function xd(i){return Xh(Sn,i)}function wd(i){return Jh(_n,i)}function $d(i){return Kh(On,i)}function Sd(i){return Gh(In,i)}function _d(i){return hb(es,i)}function Od(i){return Yh(Cn,i)}function Id(i){return Qh(Tn,i)}function Cd(i){return ed(En,i)}function Td(i){return td(An,i)}function Ed(i){return id(Dn,i)}function Ad(i){return nd(zn,i)}function Dd(i){return rd(Pn,i)}function zd(i,e,t={}){return Fr(oi,i,e,t)}function Pd(i){return Fr(oi,"hostname",si.hostname,i)}function Md(i){return Fr(oi,"hex",si.hex,i)}function Nd(i,e){let t=e?.enc??"hex",r=`${i}_${t}`,n=si[r];if(!n)throw Error(`Unrecognized hash format: ${r}`);return Fr(oi,r,n,e)}function ee(i){return gb(Di,i)}function Sr(i){return bb(Xt,i)}function Rd(i){return yb(Xt,i)}function Ud(i){return kb(Xt,i)}function Ld(i){return xb(Xt,i)}function jd(i){return wb(Xt,i)}function xe(i){return $b(Mi,i)}function Bd(i){return _b(zi,i)}function Zd(i){return Ib(jn,i)}function Fd(i){return Cb(jn,i)}function qd(i){return Tb(ts,i)}function Hd(i){return Eb(is,i)}function Jr(i){return Ab(ns,i)}function Wd(){return Db(rs)}function ue(){return zb(ss)}function Kr(i){return Pb(os,i)}function Vd(i){return Mb(as,i)}function Xd(i){return Nb(Bn,i)}function V(i,e){return Lb(ls,i,e)}function Jd(i){let e=i._zod.def.shape;return Ee(Object.keys(e))}function z(i,e){let t={type:"object",shape:i??{},...X.normalizeParams(e)};return new Ni(t)}function Kd(i,e){return new Ni({type:"object",shape:i,catchall:Kr(),...X.normalizeParams(e)})}function Ce(i,e){return new Ni({type:"object",shape:i,catchall:ue(),...X.normalizeParams(e)})}function ce(i,e){return new Ti({type:"union",options:i,...X.normalizeParams(e)})}function Gd(i,e){return new us({type:"union",options:i,inclusive:!1,...X.normalizeParams(e)})}function Gr(i,e,t){return new cs({type:"union",options:e,discriminator:i,...X.normalizeParams(t)})}function Ln(i,e){return new hs({type:"intersection",left:i,right:e})}function Ta(i,e,t){let r=e instanceof F,n=r?t:e;return new ds({type:"tuple",items:i,rest:r?e:null,...X.normalizeParams(n)})}function oe(i,e,t){return new Ri({type:"record",keyType:i,valueType:e,...X.normalizeParams(t)})}function Yd(i,e,t){let r=Ye(i);return r._zod.values=void 0,new Ri({type:"record",keyType:r,valueType:e,...X.normalizeParams(t)})}function Qd(i,e,t){return new Ri({type:"record",keyType:i,valueType:e,mode:"loose",...X.normalizeParams(t)})}function ef(i,e,t){return new fs({type:"map",keyType:i,valueType:e,...X.normalizeParams(t)})}function tf(i,e){return new ps({type:"set",valueType:i,...X.normalizeParams(e)})}function Ee(i,e){let t=Array.isArray(i)?Object.fromEntries(i.map(r=>[r,r])):i;return new ni({type:"enum",entries:t,...X.normalizeParams(e)})}function nf(i,e){return new ni({type:"enum",entries:i,...X.normalizeParams(e)})}function M(i,e){return new ms({type:"literal",values:Array.isArray(i)?i:[i],...X.normalizeParams(e)})}function rf(i){return jb(gs,i)}function Yr(i){return new vs({type:"transform",transform:i})}function de(i){return new Mn({type:"optional",innerType:i})}function Ea(i){return new bs({type:"optional",innerType:i})}function gn(i){return new ys({type:"nullable",innerType:i})}function sf(i){return de(gn(i))}function Aa(i,e){return new ks({type:"default",innerType:i,get defaultValue(){return typeof e=="function"?e():X.shallowClone(e)}})}function Da(i,e){return new xs({type:"prefault",innerType:i,get defaultValue(){return typeof e=="function"?e():X.shallowClone(e)}})}function za(i,e){return new Nn({type:"nonoptional",innerType:i,...X.normalizeParams(e)})}function of(i){return new ws({type:"success",innerType:i})}function Pa(i,e){return new $s({type:"catch",innerType:i,catchValue:typeof e=="function"?e:()=>e})}function af(i){return Ub(Ss,i)}function vn(i,e){return new Rn({type:"pipe",in:i,out:e})}function lf(i,e,t){return new Zn({type:"pipe",in:i,out:e,transform:t.decode,reverseTransform:t.encode})}function Ma(i){return new _s({type:"readonly",innerType:i})}function uf(i,e){return new Os({type:"template_literal",parts:i,...X.normalizeParams(e)})}function Na(i){return new Is({type:"lazy",getter:i})}function cf(i){return new Cs({type:"promise",innerType:i})}function bn(i){return new Ts({type:"function",input:Array.isArray(i?.input)?Ta(i?.input):i?.input??V(ue()),output:i?.output??ue()})}function hf(i){let e=new ve({check:"custom"});return e._zod.check=i,e}function Ra(i,e){return Bb(Ui,i??(()=>!0),e)}function Ua(i,e={}){return Zb(Ui,i,e)}function La(i){return Fb(i)}function df(i,e={}){let t=new Ui({type:"custom",check:"custom",fn:r=>r instanceof i,abort:!0,...X.normalizeParams(e)});return t._zod.bag.Class=i,t._zod.check=r=>{r.value instanceof i||r.issues.push({code:"invalid_type",expected:i.name,input:r.value,inst:t,path:[...t._zod.def.path??[]]})},t}function ff(i){let e=Na(()=>ce([k(i),ee(),xe(),Jr(),V(e),oe(k(),e)]));return e}function Qr(i,e){return vn(Yr(i),e)}var q,ln,Pi,se,yn,Ci,ut,Ai,kn,xn,wn,$n,Sn,_n,On,In,es,Cn,Tn,En,An,Dn,zn,Pn,oi,Di,Xt,Mi,zi,jn,ts,is,ns,rs,ss,os,as,Bn,ls,Ni,Ti,us,cs,hs,ds,Ri,fs,ps,ni,ms,gs,vs,Mn,bs,ys,ks,xs,Nn,ws,$s,Ss,Rn,Zn,_s,Os,Is,Cs,Ts,Ui,ja,Ba,pf=(...i)=>Vb({Codec:Zn,Boolean:Mi,String:Pi},...i),Za=T(()=>{Ge(),Ge(),ga(),ma(),ad(),jo(),Ly(),q=y("ZodType",(i,e)=>(F.init(i,e),Object.assign(i["~standard"],{jsonSchema:{input:$r(i,"input"),output:$r(i,"output")}}),i.toJSONSchema=Xb(i,{}),i.def=e,i.type=e.type,Object.defineProperty(i,"_def",{value:e}),i.check=(...t)=>i.clone(X.mergeDefs(e,{checks:[...e.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),i.with=i.check,i.clone=(t,r)=>Ye(i,t,r),i.brand=()=>i,i.register=(t,r)=>(t.add(i,r),i),i.parse=(t,r)=>va(i,t,r,{callee:i.parse}),i.safeParse=(t,r)=>ya(i,t,r),i.parseAsync=async(t,r)=>ba(i,t,r,{callee:i.parseAsync}),i.safeParseAsync=async(t,r)=>ka(i,t,r),i.spa=i.safeParseAsync,i.encode=(t,r)=>xa(i,t,r),i.decode=(t,r)=>wa(i,t,r),i.encodeAsync=async(t,r)=>$a(i,t,r),i.decodeAsync=async(t,r)=>Sa(i,t,r),i.safeEncode=(t,r)=>_a(i,t,r),i.safeDecode=(t,r)=>Oa(i,t,r),i.safeEncodeAsync=async(t,r)=>Ia(i,t,r),i.safeDecodeAsync=async(t,r)=>Ca(i,t,r),i.refine=(t,r)=>i.check(Ua(t,r)),i.superRefine=t=>i.check(La(t)),i.overwrite=t=>i.check(At(t)),i.optional=()=>de(i),i.exactOptional=()=>Ea(i),i.nullable=()=>gn(i),i.nullish=()=>de(gn(i)),i.nonoptional=t=>za(i,t),i.array=()=>V(i),i.or=t=>ce([i,t]),i.and=t=>Ln(i,t),i.transform=t=>vn(i,Yr(t)),i.default=t=>Aa(i,t),i.prefault=t=>Da(i,t),i.catch=t=>Pa(i,t),i.pipe=t=>vn(i,t),i.readonly=()=>Ma(i),i.describe=t=>{let r=i.clone();return We.add(r,{description:t}),r},Object.defineProperty(i,"description",{get(){return We.get(i)?.description},configurable:!0}),i.meta=(...t)=>{if(t.length===0)return We.get(i);let r=i.clone();return We.add(r,t[0]),r},i.isOptional=()=>i.safeParse(void 0).success,i.isNullable=()=>i.safeParse(null).success,i.apply=t=>t(i),i)),ln=y("_ZodString",(i,e)=>{un.init(i,e),q.init(i,e),i._zod.processJSONSchema=(r,n,s)=>Kb(i,r,n,s);let t=i._zod.bag;i.format=t.format??null,i.minLength=t.minimum??null,i.maxLength=t.maximum??null,i.regex=(...r)=>i.check(Ar(...r)),i.includes=(...r)=>i.check(Pr(...r)),i.startsWith=(...r)=>i.check(Mr(...r)),i.endsWith=(...r)=>i.check(Nr(...r)),i.min=(...r)=>i.check(ii(...r)),i.max=(...r)=>i.check(hn(...r)),i.length=(...r)=>i.check(dn(...r)),i.nonempty=(...r)=>i.check(ii(1,...r)),i.lowercase=r=>i.check(Dr(r)),i.uppercase=r=>i.check(zr(r)),i.trim=()=>i.check(Lr()),i.normalize=(...r)=>i.check(Ur(...r)),i.toLowerCase=()=>i.check(jr()),i.toUpperCase=()=>i.check(Br()),i.slugify=()=>i.check(Zr())}),Pi=y("ZodString",(i,e)=>{un.init(i,e),ln.init(i,e),i.email=t=>i.check(Lh(yn,t)),i.url=t=>i.check(la(Ai,t)),i.jwt=t=>i.check(rd(Pn,t)),i.emoji=t=>i.check(qh(kn,t)),i.guid=t=>i.check(Uo(Ci,t)),i.uuid=t=>i.check(jh(ut,t)),i.uuidv4=t=>i.check(Bh(ut,t)),i.uuidv6=t=>i.check(Zh(ut,t)),i.uuidv7=t=>i.check(Fh(ut,t)),i.nanoid=t=>i.check(Hh(xn,t)),i.guid=t=>i.check(Uo(Ci,t)),i.cuid=t=>i.check(Wh(wn,t)),i.cuid2=t=>i.check(Vh($n,t)),i.ulid=t=>i.check(Xh(Sn,t)),i.base64=t=>i.check(td(An,t)),i.base64url=t=>i.check(id(Dn,t)),i.xid=t=>i.check(Jh(_n,t)),i.ksuid=t=>i.check(Kh(On,t)),i.ipv4=t=>i.check(Gh(In,t)),i.ipv6=t=>i.check(Yh(Cn,t)),i.cidrv4=t=>i.check(Qh(Tn,t)),i.cidrv6=t=>i.check(ed(En,t)),i.e164=t=>i.check(nd(zn,t)),i.datetime=t=>i.check(Py(t)),i.date=t=>i.check(My(t)),i.time=t=>i.check(Ny(t)),i.duration=t=>i.check(Ry(t))}),se=y("ZodStringFormat",(i,e)=>{ae.init(i,e),ln.init(i,e)}),yn=y("ZodEmail",(i,e)=>{zc.init(i,e),se.init(i,e)}),Ci=y("ZodGUID",(i,e)=>{Ac.init(i,e),se.init(i,e)}),ut=y("ZodUUID",(i,e)=>{Dc.init(i,e),se.init(i,e)}),Ai=y("ZodURL",(i,e)=>{Pc.init(i,e),se.init(i,e)}),kn=y("ZodEmoji",(i,e)=>{Mc.init(i,e),se.init(i,e)}),xn=y("ZodNanoID",(i,e)=>{Nc.init(i,e),se.init(i,e)}),wn=y("ZodCUID",(i,e)=>{Rc.init(i,e),se.init(i,e)}),$n=y("ZodCUID2",(i,e)=>{Uc.init(i,e),se.init(i,e)}),Sn=y("ZodULID",(i,e)=>{Lc.init(i,e),se.init(i,e)}),_n=y("ZodXID",(i,e)=>{jc.init(i,e),se.init(i,e)}),On=y("ZodKSUID",(i,e)=>{Bc.init(i,e),se.init(i,e)}),In=y("ZodIPv4",(i,e)=>{Wc.init(i,e),se.init(i,e)}),es=y("ZodMAC",(i,e)=>{Xc.init(i,e),se.init(i,e)}),Cn=y("ZodIPv6",(i,e)=>{Vc.init(i,e),se.init(i,e)}),Tn=y("ZodCIDRv4",(i,e)=>{Jc.init(i,e),se.init(i,e)}),En=y("ZodCIDRv6",(i,e)=>{Kc.init(i,e),se.init(i,e)}),An=y("ZodBase64",(i,e)=>{Gc.init(i,e),se.init(i,e)}),Dn=y("ZodBase64URL",(i,e)=>{Yc.init(i,e),se.init(i,e)}),zn=y("ZodE164",(i,e)=>{Qc.init(i,e),se.init(i,e)}),Pn=y("ZodJWT",(i,e)=>{eh.init(i,e),se.init(i,e)}),oi=y("ZodCustomStringFormat",(i,e)=>{th.init(i,e),se.init(i,e)}),Di=y("ZodNumber",(i,e)=>{zo.init(i,e),q.init(i,e),i._zod.processJSONSchema=(r,n,s)=>Gb(i,r,n,s),i.gt=(r,n)=>i.check(Wt(r,n)),i.gte=(r,n)=>i.check(Ze(r,n)),i.min=(r,n)=>i.check(Ze(r,n)),i.lt=(r,n)=>i.check(Ht(r,n)),i.lte=(r,n)=>i.check(Ke(r,n)),i.max=(r,n)=>i.check(Ke(r,n)),i.int=r=>i.check(Sr(r)),i.safe=r=>i.check(Sr(r)),i.positive=r=>i.check(Wt(0,r)),i.nonnegative=r=>i.check(Ze(0,r)),i.negative=r=>i.check(Ht(0,r)),i.nonpositive=r=>i.check(Ke(0,r)),i.multipleOf=(r,n)=>i.check(Oi(r,n)),i.step=(r,n)=>i.check(Oi(r,n)),i.finite=()=>i;let t=i._zod.bag;i.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,i.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,i.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),i.isFinite=!0,i.format=t.format??null}),Xt=y("ZodNumberFormat",(i,e)=>{ih.init(i,e),Di.init(i,e)}),Mi=y("ZodBoolean",(i,e)=>{ta.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>Yb(i,t,r,n)}),zi=y("ZodBigInt",(i,e)=>{Po.init(i,e),q.init(i,e),i._zod.processJSONSchema=(r,n,s)=>Qb(i,r,n,s),i.gte=(r,n)=>i.check(Ze(r,n)),i.min=(r,n)=>i.check(Ze(r,n)),i.gt=(r,n)=>i.check(Wt(r,n)),i.gte=(r,n)=>i.check(Ze(r,n)),i.min=(r,n)=>i.check(Ze(r,n)),i.lt=(r,n)=>i.check(Ht(r,n)),i.lte=(r,n)=>i.check(Ke(r,n)),i.max=(r,n)=>i.check(Ke(r,n)),i.positive=r=>i.check(Wt(BigInt(0),r)),i.negative=r=>i.check(Ht(BigInt(0),r)),i.nonpositive=r=>i.check(Ke(BigInt(0),r)),i.nonnegative=r=>i.check(Ze(BigInt(0),r)),i.multipleOf=(r,n)=>i.check(Oi(r,n));let t=i._zod.bag;i.minValue=t.minimum??null,i.maxValue=t.maximum??null,i.format=t.format??null}),jn=y("ZodBigIntFormat",(i,e)=>{nh.init(i,e),zi.init(i,e)}),ts=y("ZodSymbol",(i,e)=>{rh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>ey(i,t,r,n)}),is=y("ZodUndefined",(i,e)=>{sh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>iy(i,t,r,n)}),ns=y("ZodNull",(i,e)=>{oh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>ty(i,t,r,n)}),rs=y("ZodAny",(i,e)=>{ah.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>sy(i,t,r,n)}),ss=y("ZodUnknown",(i,e)=>{lh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>oy(i,t,r,n)}),os=y("ZodNever",(i,e)=>{uh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>ry(i,t,r,n)}),as=y("ZodVoid",(i,e)=>{ch.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>ny(i,t,r,n)}),Bn=y("ZodDate",(i,e)=>{hh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(r,n,s)=>ay(i,r,n,s),i.min=(r,n)=>i.check(Ze(r,n)),i.max=(r,n)=>i.check(Ke(r,n));let t=i._zod.bag;i.minDate=t.minimum?new Date(t.minimum):null,i.maxDate=t.maximum?new Date(t.maximum):null}),ls=y("ZodArray",(i,e)=>{dh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>yy(i,t,r,n),i.element=e.element,i.min=(t,r)=>i.check(ii(t,r)),i.nonempty=t=>i.check(ii(1,t)),i.max=(t,r)=>i.check(hn(t,r)),i.length=(t,r)=>i.check(dn(t,r)),i.unwrap=()=>i.element}),Ni=y("ZodObject",(i,e)=>{fh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>ky(i,t,r,n),X.defineLazy(i,"shape",()=>e.shape),i.keyof=()=>Ee(Object.keys(i._zod.def.shape)),i.catchall=t=>i.clone({...i._zod.def,catchall:t}),i.passthrough=()=>i.clone({...i._zod.def,catchall:ue()}),i.loose=()=>i.clone({...i._zod.def,catchall:ue()}),i.strict=()=>i.clone({...i._zod.def,catchall:Kr()}),i.strip=()=>i.clone({...i._zod.def,catchall:void 0}),i.extend=t=>X.extend(i,t),i.safeExtend=t=>X.safeExtend(i,t),i.merge=t=>X.merge(i,t),i.pick=t=>X.pick(i,t),i.omit=t=>X.omit(i,t),i.partial=(...t)=>X.partial(Mn,i,t[0]),i.required=(...t)=>X.required(Nn,i,t[0])}),Ti=y("ZodUnion",(i,e)=>{yr.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>vu(i,t,r,n),i.options=e.options}),us=y("ZodXor",(i,e)=>{Ti.init(i,e),ph.init(i,e),i._zod.processJSONSchema=(t,r,n)=>vu(i,t,r,n),i.options=e.options}),cs=y("ZodDiscriminatedUnion",(i,e)=>{Ti.init(i,e),mh.init(i,e)}),hs=y("ZodIntersection",(i,e)=>{gh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>xy(i,t,r,n)}),ds=y("ZodTuple",(i,e)=>{Mo.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>wy(i,t,r,n),i.rest=t=>i.clone({...i._zod.def,rest:t})}),Ri=y("ZodRecord",(i,e)=>{vh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>$y(i,t,r,n),i.keyType=e.keyType,i.valueType=e.valueType}),fs=y("ZodMap",(i,e)=>{bh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>vy(i,t,r,n),i.keyType=e.keyType,i.valueType=e.valueType,i.min=(...t)=>i.check(Ft(...t)),i.nonempty=t=>i.check(Ft(1,t)),i.max=(...t)=>i.check(Ii(...t)),i.size=(...t)=>i.check(cn(...t))}),ps=y("ZodSet",(i,e)=>{yh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>by(i,t,r,n),i.min=(...t)=>i.check(Ft(...t)),i.nonempty=t=>i.check(Ft(1,t)),i.max=(...t)=>i.check(Ii(...t)),i.size=(...t)=>i.check(cn(...t))}),ni=y("ZodEnum",(i,e)=>{kh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(r,n,s)=>ly(i,r,n,s),i.enum=e.entries,i.options=Object.values(e.entries);let t=new Set(Object.keys(e.entries));i.extract=(r,n)=>{let s={};for(let o of r)if(t.has(o))s[o]=e.entries[o];else throw Error(`Key ${o} not found in enum`);return new ni({...e,checks:[],...X.normalizeParams(n),entries:s})},i.exclude=(r,n)=>{let s={...e.entries};for(let o of r)if(t.has(o))delete s[o];else throw Error(`Key ${o} not found in enum`);return new ni({...e,checks:[],...X.normalizeParams(n),entries:s})}}),ms=y("ZodLiteral",(i,e)=>{xh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>uy(i,t,r,n),i.values=new Set(e.values),Object.defineProperty(i,"value",{get(){if(e.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})}),gs=y("ZodFile",(i,e)=>{wh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>dy(i,t,r,n),i.min=(t,r)=>i.check(Ft(t,r)),i.max=(t,r)=>i.check(Ii(t,r)),i.mime=(t,r)=>i.check(Rr(Array.isArray(t)?t:[t],r))}),vs=y("ZodTransform",(i,e)=>{$h.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>gy(i,t,r,n),i._zod.parse=(t,r)=>{if(r.direction==="backward")throw new kr(i.constructor.name);t.addIssue=s=>{if(typeof s=="string")t.issues.push(X.issue(s,t.value,e));else{let o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=t.value),o.inst??(o.inst=i),t.issues.push(X.issue(o))}};let n=e.transform(t.value,t);return n instanceof Promise?n.then(s=>(t.value=s,t)):(t.value=n,t)}}),Mn=y("ZodOptional",(i,e)=>{No.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>bu(i,t,r,n),i.unwrap=()=>i._zod.def.innerType}),bs=y("ZodExactOptional",(i,e)=>{Sh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>bu(i,t,r,n),i.unwrap=()=>i._zod.def.innerType}),ys=y("ZodNullable",(i,e)=>{_h.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>Sy(i,t,r,n),i.unwrap=()=>i._zod.def.innerType}),ks=y("ZodDefault",(i,e)=>{Oh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>Oy(i,t,r,n),i.unwrap=()=>i._zod.def.innerType,i.removeDefault=i.unwrap}),xs=y("ZodPrefault",(i,e)=>{Ih.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>Iy(i,t,r,n),i.unwrap=()=>i._zod.def.innerType}),Nn=y("ZodNonOptional",(i,e)=>{Ch.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>_y(i,t,r,n),i.unwrap=()=>i._zod.def.innerType}),ws=y("ZodSuccess",(i,e)=>{Th.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>fy(i,t,r,n),i.unwrap=()=>i._zod.def.innerType}),$s=y("ZodCatch",(i,e)=>{Eh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>Cy(i,t,r,n),i.unwrap=()=>i._zod.def.innerType,i.removeCatch=i.unwrap}),Ss=y("ZodNaN",(i,e)=>{Ah.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>cy(i,t,r,n)}),Rn=y("ZodPipe",(i,e)=>{Dh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>Ty(i,t,r,n),i.in=e.in,i.out=e.out}),Zn=y("ZodCodec",(i,e)=>{Rn.init(i,e),ia.init(i,e)}),_s=y("ZodReadonly",(i,e)=>{zh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>Ey(i,t,r,n),i.unwrap=()=>i._zod.def.innerType}),Os=y("ZodTemplateLiteral",(i,e)=>{Ph.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>hy(i,t,r,n)}),Is=y("ZodLazy",(i,e)=>{Rh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>Dy(i,t,r,n),i.unwrap=()=>i._zod.def.getter()}),Cs=y("ZodPromise",(i,e)=>{Nh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>Ay(i,t,r,n),i.unwrap=()=>i._zod.def.innerType}),Ts=y("ZodFunction",(i,e)=>{Mh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>my(i,t,r,n)}),Ui=y("ZodCustom",(i,e)=>{Uh.init(i,e),q.init(i,e),i._zod.processJSONSchema=(t,r,n)=>py(i,t,r,n)}),ja=Hb,Ba=Wb});function By(i){Te({customError:i})}function Zy(){return Te().customError}var mf,Bo,T_=T(()=>{Ge(),mf={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"},Bo||(Bo={})});function E_(i,e){let t=i.$schema;return t==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":t==="http://json-schema.org/draft-07/schema#"?"draft-7":t==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function A_(i,e){if(!i.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let t=i.slice(1).split("/").filter(Boolean);if(t.length===0)return e.rootSchema;let r=e.version==="draft-2020-12"?"$defs":"definitions";if(t[0]===r){let n=t[1];if(!n||!e.defs[n])throw Error(`Reference not found: ${i}`);return e.defs[n]}throw Error(`Reference not found: ${i}`)}function Fy(i,e){if(i.not!==void 0){if(typeof i.not=="object"&&Object.keys(i.not).length===0)return C.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(i.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(i.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(i.if!==void 0||i.then!==void 0||i.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(i.dependentSchemas!==void 0||i.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(i.$ref){let n=i.$ref;if(e.refs.has(n))return e.refs.get(n);if(e.processing.has(n))return C.lazy(()=>{if(!e.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return e.refs.get(n)});e.processing.add(n);let s=A_(n,e),o=Pe(s,e);return e.refs.set(n,o),e.processing.delete(n),o}if(i.enum!==void 0){let n=i.enum;if(e.version==="openapi-3.0"&&i.nullable===!0&&n.length===1&&n[0]===null)return C.null();if(n.length===0)return C.never();if(n.length===1)return C.literal(n[0]);if(n.every(o=>typeof o=="string"))return C.enum(n);let s=n.map(o=>C.literal(o));return s.length<2?s[0]:C.union([s[0],s[1],...s.slice(2)])}if(i.const!==void 0)return C.literal(i.const);let t=i.type;if(Array.isArray(t)){let n=t.map(s=>{let o={...i,type:s};return Fy(o,e)});return n.length===0?C.never():n.length===1?n[0]:C.union(n)}if(!t)return C.any();let r;switch(t){case"string":{let n=C.string();if(i.format){let s=i.format;s==="email"?n=n.check(C.email()):s==="uri"||s==="uri-reference"?n=n.check(C.url()):s==="uuid"||s==="guid"?n=n.check(C.uuid()):s==="date-time"?n=n.check(C.iso.datetime()):s==="date"?n=n.check(C.iso.date()):s==="time"?n=n.check(C.iso.time()):s==="duration"?n=n.check(C.iso.duration()):s==="ipv4"?n=n.check(C.ipv4()):s==="ipv6"?n=n.check(C.ipv6()):s==="mac"?n=n.check(C.mac()):s==="cidr"?n=n.check(C.cidrv4()):s==="cidr-v6"?n=n.check(C.cidrv6()):s==="base64"?n=n.check(C.base64()):s==="base64url"?n=n.check(C.base64url()):s==="e164"?n=n.check(C.e164()):s==="jwt"?n=n.check(C.jwt()):s==="emoji"?n=n.check(C.emoji()):s==="nanoid"?n=n.check(C.nanoid()):s==="cuid"?n=n.check(C.cuid()):s==="cuid2"?n=n.check(C.cuid2()):s==="ulid"?n=n.check(C.ulid()):s==="xid"?n=n.check(C.xid()):s==="ksuid"&&(n=n.check(C.ksuid()))}typeof i.minLength=="number"&&(n=n.min(i.minLength)),typeof i.maxLength=="number"&&(n=n.max(i.maxLength)),i.pattern&&(n=n.regex(new RegExp(i.pattern))),r=n;break}case"number":case"integer":{let n=t==="integer"?C.number().int():C.number();typeof i.minimum=="number"&&(n=n.min(i.minimum)),typeof i.maximum=="number"&&(n=n.max(i.maximum)),typeof i.exclusiveMinimum=="number"?n=n.gt(i.exclusiveMinimum):i.exclusiveMinimum===!0&&typeof i.minimum=="number"&&(n=n.gt(i.minimum)),typeof i.exclusiveMaximum=="number"?n=n.lt(i.exclusiveMaximum):i.exclusiveMaximum===!0&&typeof i.maximum=="number"&&(n=n.lt(i.maximum)),typeof i.multipleOf=="number"&&(n=n.multipleOf(i.multipleOf)),r=n;break}case"boolean":{r=C.boolean();break}case"null":{r=C.null();break}case"object":{let n={},s=i.properties||{},o=new Set(i.required||[]);for(let[l,u]of Object.entries(s)){let c=Pe(u,e);n[l]=o.has(l)?c:c.optional()}if(i.propertyNames){let l=Pe(i.propertyNames,e),u=i.additionalProperties&&typeof i.additionalProperties=="object"?Pe(i.additionalProperties,e):C.any();if(Object.keys(n).length===0){r=C.record(l,u);break}let c=C.object(n).passthrough(),h=C.looseRecord(l,u);r=C.intersection(c,h);break}if(i.patternProperties){let l=i.patternProperties,u=Object.keys(l),c=[];for(let d of u){let f=Pe(l[d],e),p=C.string().regex(new RegExp(d));c.push(C.looseRecord(p,f))}let h=[];if(Object.keys(n).length>0&&h.push(C.object(n).passthrough()),h.push(...c),h.length===0)r=C.object({}).passthrough();else if(h.length===1)r=h[0];else{let d=C.intersection(h[0],h[1]);for(let f=2;fPe(l,e)),a=s&&typeof s=="object"&&!Array.isArray(s)?Pe(s,e):void 0;a?r=C.tuple(o).rest(a):r=C.tuple(o),typeof i.minItems=="number"&&(r=r.check(C.minLength(i.minItems))),typeof i.maxItems=="number"&&(r=r.check(C.maxLength(i.maxItems)))}else if(Array.isArray(s)){let o=s.map(l=>Pe(l,e)),a=i.additionalItems&&typeof i.additionalItems=="object"?Pe(i.additionalItems,e):void 0;a?r=C.tuple(o).rest(a):r=C.tuple(o),typeof i.minItems=="number"&&(r=r.check(C.minLength(i.minItems))),typeof i.maxItems=="number"&&(r=r.check(C.maxLength(i.maxItems)))}else if(s!==void 0){let o=Pe(s,e),a=C.array(o);typeof i.minItems=="number"&&(a=a.min(i.minItems)),typeof i.maxItems=="number"&&(a=a.max(i.maxItems)),r=a}else r=C.array(C.any());break}default:throw Error(`Unsupported type: ${t}`)}return i.description&&(r=r.describe(i.description)),i.default!==void 0&&(r=r.default(i.default)),r}function Pe(i,e){if(typeof i=="boolean")return i?C.any():C.never();let t=Fy(i,e),r=i.type||i.enum!==void 0||i.const!==void 0;if(i.anyOf&&Array.isArray(i.anyOf)){let a=i.anyOf.map(u=>Pe(u,e)),l=C.union(a);t=r?C.intersection(t,l):l}if(i.oneOf&&Array.isArray(i.oneOf)){let a=i.oneOf.map(u=>Pe(u,e)),l=C.xor(a);t=r?C.intersection(t,l):l}if(i.allOf&&Array.isArray(i.allOf))if(i.allOf.length===0)t=r?t:C.any();else{let a=r?t:Pe(i.allOf[0],e),l=r?0:1;for(let u=l;u0&&e.registry.add(t,n),t}function qy(i,e){if(typeof i=="boolean")return i?C.any():C.never();let t=E_(i,e?.defaultTarget),r=i.$defs||i.definitions||{},n={version:t,defs:r,refs:new Map,processing:new Set,rootSchema:i,registry:e?.registry??We};return Pe(i,n)}var C,Hy,D_=T(()=>{aa(),ad(),jo(),Za(),C={...jy,...zy,iso:qr},Hy=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])}),gf={};Et(gf,{string:()=>z_,number:()=>P_,date:()=>R_,boolean:()=>M_,bigint:()=>N_});function z_(i){return cb(Pi,i)}function P_(i){return vb(Di,i)}function M_(i){return Sb(Mi,i)}function N_(i){return Ob(zi,i)}function R_(i){return Rb(Bn,i)}var U_=T(()=>{Ge(),Za()}),m={};Et(m,{xor:()=>Gd,xid:()=>wd,void:()=>Vd,uuidv7:()=>pd,uuidv6:()=>fd,uuidv4:()=>dd,uuid:()=>hd,util:()=>X,url:()=>md,uppercase:()=>zr,unknown:()=>ue,union:()=>ce,undefined:()=>Hd,ulid:()=>xd,uint64:()=>Fd,uint32:()=>jd,tuple:()=>Ta,trim:()=>Lr,treeifyError:()=>Tu,transform:()=>Yr,toUpperCase:()=>Br,toLowerCase:()=>jr,toJSONSchema:()=>sd,templateLiteral:()=>uf,symbol:()=>qd,superRefine:()=>La,success:()=>of,stringbool:()=>pf,stringFormat:()=>zd,string:()=>k,strictObject:()=>Kd,startsWith:()=>Mr,slugify:()=>Zr,size:()=>cn,setErrorMap:()=>By,set:()=>tf,safeParseAsync:()=>ka,safeParse:()=>ya,safeEncodeAsync:()=>Ia,safeEncode:()=>_a,safeDecodeAsync:()=>Ca,safeDecode:()=>Oa,registry:()=>ra,regexes:()=>si,regex:()=>Ar,refine:()=>Ua,record:()=>oe,readonly:()=>Ma,property:()=>fa,promise:()=>cf,prettifyError:()=>Eu,preprocess:()=>Qr,prefault:()=>Da,positive:()=>ua,pipe:()=>vn,partialRecord:()=>Yd,parseAsync:()=>ba,parse:()=>va,overwrite:()=>At,optional:()=>de,object:()=>z,number:()=>ee,nullish:()=>sf,nullable:()=>gn,null:()=>Jr,normalize:()=>Ur,nonpositive:()=>ha,nonoptional:()=>za,nonnegative:()=>da,never:()=>Kr,negative:()=>ca,nativeEnum:()=>nf,nanoid:()=>bd,nan:()=>af,multipleOf:()=>Oi,minSize:()=>Ft,minLength:()=>ii,mime:()=>Rr,meta:()=>Ba,maxSize:()=>Ii,maxLength:()=>hn,map:()=>ef,mac:()=>_d,lte:()=>Ke,lt:()=>Ht,lowercase:()=>Dr,looseRecord:()=>Qd,looseObject:()=>Ce,locales:()=>na,literal:()=>M,length:()=>dn,lazy:()=>Na,ksuid:()=>$d,keyof:()=>Jd,jwt:()=>Dd,json:()=>ff,iso:()=>qr,ipv6:()=>Od,ipv4:()=>Sd,intersection:()=>Ln,int64:()=>Zd,int32:()=>Ld,int:()=>Sr,instanceof:()=>df,includes:()=>Pr,httpUrl:()=>gd,hostname:()=>Pd,hex:()=>Md,hash:()=>Nd,guid:()=>cd,gte:()=>Ze,gt:()=>Wt,globalRegistry:()=>We,getErrorMap:()=>Zy,function:()=>bn,fromJSONSchema:()=>qy,formatError:()=>Jo,float64:()=>Ud,float32:()=>Rd,flattenError:()=>Xo,file:()=>rf,exactOptional:()=>Ea,enum:()=>Ee,endsWith:()=>Nr,encodeAsync:()=>$a,encode:()=>xa,emoji:()=>vd,email:()=>ud,e164:()=>Ad,discriminatedUnion:()=>Gr,describe:()=>ja,decodeAsync:()=>Sa,decode:()=>wa,date:()=>Xd,custom:()=>Ra,cuid2:()=>kd,cuid:()=>yd,core:()=>od,config:()=>Te,coerce:()=>gf,codec:()=>lf,clone:()=>Ye,cidrv6:()=>Cd,cidrv4:()=>Id,check:()=>hf,catch:()=>Pa,boolean:()=>xe,bigint:()=>Bd,base64url:()=>Ed,base64:()=>Td,array:()=>V,any:()=>Wd,_function:()=>bn,_default:()=>Aa,_ZodString:()=>ln,ZodXor:()=>us,ZodXID:()=>_n,ZodVoid:()=>as,ZodUnknown:()=>ss,ZodUnion:()=>Ti,ZodUndefined:()=>is,ZodUUID:()=>ut,ZodURL:()=>Ai,ZodULID:()=>Sn,ZodType:()=>q,ZodTuple:()=>ds,ZodTransform:()=>vs,ZodTemplateLiteral:()=>Os,ZodSymbol:()=>ts,ZodSuccess:()=>ws,ZodStringFormat:()=>se,ZodString:()=>Pi,ZodSet:()=>ps,ZodRecord:()=>Ri,ZodRealError:()=>Be,ZodReadonly:()=>_s,ZodPromise:()=>Cs,ZodPrefault:()=>xs,ZodPipe:()=>Rn,ZodOptional:()=>Mn,ZodObject:()=>Ni,ZodNumberFormat:()=>Xt,ZodNumber:()=>Di,ZodNullable:()=>ys,ZodNull:()=>ns,ZodNonOptional:()=>Nn,ZodNever:()=>os,ZodNanoID:()=>xn,ZodNaN:()=>Ss,ZodMap:()=>fs,ZodMAC:()=>es,ZodLiteral:()=>ms,ZodLazy:()=>Is,ZodKSUID:()=>On,ZodJWT:()=>Pn,ZodIssueCode:()=>mf,ZodIntersection:()=>hs,ZodISOTime:()=>Vr,ZodISODuration:()=>Xr,ZodISODateTime:()=>Hr,ZodISODate:()=>Wr,ZodIPv6:()=>Cn,ZodIPv4:()=>In,ZodGUID:()=>Ci,ZodFunction:()=>Ts,ZodFirstPartyTypeKind:()=>Bo,ZodFile:()=>gs,ZodExactOptional:()=>bs,ZodError:()=>ld,ZodEnum:()=>ni,ZodEmoji:()=>kn,ZodEmail:()=>yn,ZodE164:()=>zn,ZodDiscriminatedUnion:()=>cs,ZodDefault:()=>ks,ZodDate:()=>Bn,ZodCustomStringFormat:()=>oi,ZodCustom:()=>Ui,ZodCodec:()=>Zn,ZodCatch:()=>$s,ZodCUID2:()=>$n,ZodCUID:()=>wn,ZodCIDRv6:()=>En,ZodCIDRv4:()=>Tn,ZodBoolean:()=>Mi,ZodBigIntFormat:()=>jn,ZodBigInt:()=>zi,ZodBase64URL:()=>Dn,ZodBase64:()=>An,ZodArray:()=>ls,ZodAny:()=>rs,TimePrecision:()=>pa,NEVER:()=>Ho,$output:()=>sa,$input:()=>oa,$brand:()=>Wo});var Vg=T(()=>{Ge(),Ge(),nb(),Ge(),ga(),D_(),lb(),jo(),jo(),U_(),Za(),ad(),Uy(),Ly(),T_(),Te(ib())}),Wy,Xg=T(()=>{Vg(),Vg(),Wy=m}),Vy={};Et(Vy,{z:()=>m,xor:()=>Gd,xid:()=>wd,void:()=>Vd,uuidv7:()=>pd,uuidv6:()=>fd,uuidv4:()=>dd,uuid:()=>hd,util:()=>X,url:()=>md,uppercase:()=>zr,unknown:()=>ue,union:()=>ce,undefined:()=>Hd,ulid:()=>xd,uint64:()=>Fd,uint32:()=>jd,tuple:()=>Ta,trim:()=>Lr,treeifyError:()=>Tu,transform:()=>Yr,toUpperCase:()=>Br,toLowerCase:()=>jr,toJSONSchema:()=>sd,templateLiteral:()=>uf,symbol:()=>qd,superRefine:()=>La,success:()=>of,stringbool:()=>pf,stringFormat:()=>zd,string:()=>k,strictObject:()=>Kd,startsWith:()=>Mr,slugify:()=>Zr,size:()=>cn,setErrorMap:()=>By,set:()=>tf,safeParseAsync:()=>ka,safeParse:()=>ya,safeEncodeAsync:()=>Ia,safeEncode:()=>_a,safeDecodeAsync:()=>Ca,safeDecode:()=>Oa,registry:()=>ra,regexes:()=>si,regex:()=>Ar,refine:()=>Ua,record:()=>oe,readonly:()=>Ma,property:()=>fa,promise:()=>cf,prettifyError:()=>Eu,preprocess:()=>Qr,prefault:()=>Da,positive:()=>ua,pipe:()=>vn,partialRecord:()=>Yd,parseAsync:()=>ba,parse:()=>va,overwrite:()=>At,optional:()=>de,object:()=>z,number:()=>ee,nullish:()=>sf,nullable:()=>gn,null:()=>Jr,normalize:()=>Ur,nonpositive:()=>ha,nonoptional:()=>za,nonnegative:()=>da,never:()=>Kr,negative:()=>ca,nativeEnum:()=>nf,nanoid:()=>bd,nan:()=>af,multipleOf:()=>Oi,minSize:()=>Ft,minLength:()=>ii,mime:()=>Rr,meta:()=>Ba,maxSize:()=>Ii,maxLength:()=>hn,map:()=>ef,mac:()=>_d,lte:()=>Ke,lt:()=>Ht,lowercase:()=>Dr,looseRecord:()=>Qd,looseObject:()=>Ce,locales:()=>na,literal:()=>M,length:()=>dn,lazy:()=>Na,ksuid:()=>$d,keyof:()=>Jd,jwt:()=>Dd,json:()=>ff,iso:()=>qr,ipv6:()=>Od,ipv4:()=>Sd,intersection:()=>Ln,int64:()=>Zd,int32:()=>Ld,int:()=>Sr,instanceof:()=>df,includes:()=>Pr,httpUrl:()=>gd,hostname:()=>Pd,hex:()=>Md,hash:()=>Nd,guid:()=>cd,gte:()=>Ze,gt:()=>Wt,globalRegistry:()=>We,getErrorMap:()=>Zy,function:()=>bn,fromJSONSchema:()=>qy,formatError:()=>Jo,float64:()=>Ud,float32:()=>Rd,flattenError:()=>Xo,file:()=>rf,exactOptional:()=>Ea,enum:()=>Ee,endsWith:()=>Nr,encodeAsync:()=>$a,encode:()=>xa,emoji:()=>vd,email:()=>ud,e164:()=>Ad,discriminatedUnion:()=>Gr,describe:()=>ja,default:()=>Xy,decodeAsync:()=>Sa,decode:()=>wa,date:()=>Xd,custom:()=>Ra,cuid2:()=>kd,cuid:()=>yd,core:()=>od,config:()=>Te,coerce:()=>gf,codec:()=>lf,clone:()=>Ye,cidrv6:()=>Cd,cidrv4:()=>Id,check:()=>hf,catch:()=>Pa,boolean:()=>xe,bigint:()=>Bd,base64url:()=>Ed,base64:()=>Td,array:()=>V,any:()=>Wd,_function:()=>bn,_default:()=>Aa,_ZodString:()=>ln,ZodXor:()=>us,ZodXID:()=>_n,ZodVoid:()=>as,ZodUnknown:()=>ss,ZodUnion:()=>Ti,ZodUndefined:()=>is,ZodUUID:()=>ut,ZodURL:()=>Ai,ZodULID:()=>Sn,ZodType:()=>q,ZodTuple:()=>ds,ZodTransform:()=>vs,ZodTemplateLiteral:()=>Os,ZodSymbol:()=>ts,ZodSuccess:()=>ws,ZodStringFormat:()=>se,ZodString:()=>Pi,ZodSet:()=>ps,ZodRecord:()=>Ri,ZodRealError:()=>Be,ZodReadonly:()=>_s,ZodPromise:()=>Cs,ZodPrefault:()=>xs,ZodPipe:()=>Rn,ZodOptional:()=>Mn,ZodObject:()=>Ni,ZodNumberFormat:()=>Xt,ZodNumber:()=>Di,ZodNullable:()=>ys,ZodNull:()=>ns,ZodNonOptional:()=>Nn,ZodNever:()=>os,ZodNanoID:()=>xn,ZodNaN:()=>Ss,ZodMap:()=>fs,ZodMAC:()=>es,ZodLiteral:()=>ms,ZodLazy:()=>Is,ZodKSUID:()=>On,ZodJWT:()=>Pn,ZodIssueCode:()=>mf,ZodIntersection:()=>hs,ZodISOTime:()=>Vr,ZodISODuration:()=>Xr,ZodISODateTime:()=>Hr,ZodISODate:()=>Wr,ZodIPv6:()=>Cn,ZodIPv4:()=>In,ZodGUID:()=>Ci,ZodFunction:()=>Ts,ZodFirstPartyTypeKind:()=>Bo,ZodFile:()=>gs,ZodExactOptional:()=>bs,ZodError:()=>ld,ZodEnum:()=>ni,ZodEmoji:()=>kn,ZodEmail:()=>yn,ZodE164:()=>zn,ZodDiscriminatedUnion:()=>cs,ZodDefault:()=>ks,ZodDate:()=>Bn,ZodCustomStringFormat:()=>oi,ZodCustom:()=>Ui,ZodCodec:()=>Zn,ZodCatch:()=>$s,ZodCUID2:()=>$n,ZodCUID:()=>wn,ZodCIDRv6:()=>En,ZodCIDRv4:()=>Tn,ZodBoolean:()=>Mi,ZodBigIntFormat:()=>jn,ZodBigInt:()=>zi,ZodBase64URL:()=>Dn,ZodBase64:()=>An,ZodArray:()=>ls,ZodAny:()=>rs,TimePrecision:()=>pa,NEVER:()=>Ho,$output:()=>sa,$input:()=>oa,$brand:()=>Wo});var Xy,Fa=T(()=>{Xg(),Xg(),Xy=Wy});Ge();function vf(i){return!!i._zod}function Jy(i,e){return vf(i)?Go(i,e):i.safeParse(e)}function L_(i){if(!i)return;let e;if(vf(i)?e=i._zod?.def?.shape:e=i.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function j_(i){if(vf(i)){let r=i._zod?.def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}}let e=i._def;if(e){if(e.value!==void 0)return e.value;if(Array.isArray(e.values)&&e.values.length>0)return e.values[0]}let t=i.value;if(t!==void 0)return t}Fa();var Si="io.modelcontextprotocol/related-task",qa="2.0",Oe=Ra(i=>i!==null&&(typeof i=="object"||typeof i=="function")),Ky=ce([k(),ee().int()]),Gy=k(),iz=Ce({ttl:ee().optional(),pollInterval:ee().optional()}),B_=z({ttl:ee().optional()}),Z_=z({taskId:k()}),bf=Ce({progressToken:Ky.optional(),[Si]:Z_.optional()}),Qe=z({_meta:bf.optional()}),Es=Qe.extend({task:B_.optional()}),F_=i=>Es.safeParse(i).success,Ae=z({method:k(),params:Qe.loose().optional()}),ht=z({_meta:bf.optional()}),dt=z({method:k(),params:ht.loose().optional()}),De=Ce({_meta:bf.optional()}),As=ce([k(),ee().int()]),Yy=z({jsonrpc:M(qa),id:As,...Ae.shape}).strict(),Jg=i=>Yy.safeParse(i).success,Qy=z({jsonrpc:M(qa),...dt.shape}).strict(),q_=i=>Qy.safeParse(i).success,yf=z({jsonrpc:M(qa),id:As,result:De}).strict(),wo=i=>yf.safeParse(i).success,re;(function(i){i[i.ConnectionClosed=-32e3]="ConnectionClosed",i[i.RequestTimeout=-32001]="RequestTimeout",i[i.ParseError=-32700]="ParseError",i[i.InvalidRequest=-32600]="InvalidRequest",i[i.MethodNotFound=-32601]="MethodNotFound",i[i.InvalidParams=-32602]="InvalidParams",i[i.InternalError=-32603]="InternalError",i[i.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(re||(re={}));var kf=z({jsonrpc:M(qa),id:As.optional(),error:z({code:ee().int(),message:k(),data:ue().optional()})}).strict(),H_=i=>kf.safeParse(i).success,W_=ce([Yy,Qy,yf,kf]),nz=ce([yf,kf]),xf=De.strict(),V_=ht.extend({requestId:As.optional(),reason:k().optional()}),wf=dt.extend({method:M("notifications/cancelled"),params:V_}),X_=z({src:k(),mimeType:k().optional(),sizes:V(k()).optional(),theme:Ee(["light","dark"]).optional()}),Ds=z({icons:V(X_).optional()}),Un=z({name:k(),title:k().optional()}),Ha=Un.extend({...Un.shape,...Ds.shape,version:k(),websiteUrl:k().optional(),description:k().optional()}),J_=Ln(z({applyDefaults:xe().optional()}),oe(k(),ue())),K_=Qr(i=>i&&typeof i=="object"&&!Array.isArray(i)&&Object.keys(i).length===0?{form:{}}:i,Ln(z({form:J_.optional(),url:Oe.optional()}),oe(k(),ue()).optional())),G_=Ce({list:Oe.optional(),cancel:Oe.optional(),requests:Ce({sampling:Ce({createMessage:Oe.optional()}).optional(),elicitation:Ce({create:Oe.optional()}).optional()}).optional()}),Y_=Ce({list:Oe.optional(),cancel:Oe.optional(),requests:Ce({tools:Ce({call:Oe.optional()}).optional()}).optional()}),Q_=z({experimental:oe(k(),Oe).optional(),sampling:z({context:Oe.optional(),tools:Oe.optional()}).optional(),elicitation:K_.optional(),roots:z({listChanged:xe().optional()}).optional(),tasks:G_.optional(),extensions:oe(k(),Oe).optional()}),eO=Qe.extend({protocolVersion:k(),capabilities:Q_,clientInfo:Ha}),tO=Ae.extend({method:M("initialize"),params:eO}),iO=z({experimental:oe(k(),Oe).optional(),logging:Oe.optional(),completions:Oe.optional(),prompts:z({listChanged:xe().optional()}).optional(),resources:z({subscribe:xe().optional(),listChanged:xe().optional()}).optional(),tools:z({listChanged:xe().optional()}).optional(),tasks:Y_.optional(),extensions:oe(k(),Oe).optional()}),nO=De.extend({protocolVersion:k(),capabilities:iO,serverInfo:Ha,instructions:k().optional()}),rO=dt.extend({method:M("notifications/initialized"),params:ht.optional()}),Wa=Ae.extend({method:M("ping"),params:Qe.optional()}),sO=z({progress:ee(),total:de(ee()),message:de(k())}),oO=z({...ht.shape,...sO.shape,progressToken:Ky}),$f=dt.extend({method:M("notifications/progress"),params:oO}),aO=Qe.extend({cursor:Gy.optional()}),zs=Ae.extend({params:aO.optional()}),Ps=De.extend({nextCursor:Gy.optional()}),lO=Ee(["working","input_required","completed","failed","cancelled"]),Ms=z({taskId:k(),status:lO,ttl:ce([ee(),Jr()]),createdAt:k(),lastUpdatedAt:k(),pollInterval:de(ee()),statusMessage:de(k())}),Sf=De.extend({task:Ms}),uO=ht.merge(Ms),Zo=dt.extend({method:M("notifications/tasks/status"),params:uO}),_f=Ae.extend({method:M("tasks/get"),params:Qe.extend({taskId:k()})}),Of=De.merge(Ms),If=Ae.extend({method:M("tasks/result"),params:Qe.extend({taskId:k()})}),rz=De.loose(),Cf=zs.extend({method:M("tasks/list")}),Tf=Ps.extend({tasks:V(Ms)}),Ef=Ae.extend({method:M("tasks/cancel"),params:Qe.extend({taskId:k()})}),cO=De.merge(Ms),e0=z({uri:k(),mimeType:de(k()),_meta:oe(k(),ue()).optional()}),t0=e0.extend({text:k()}),Af=k().refine(i=>{try{return atob(i),!0}catch{return!1}},{message:"Invalid Base64 string"}),i0=e0.extend({blob:Af}),Ns=Ee(["user","assistant"]),Fn=z({audience:V(Ns).optional(),priority:ee().min(0).max(1).optional(),lastModified:qr.datetime({offset:!0}).optional()}),n0=z({...Un.shape,...Ds.shape,uri:k(),description:de(k()),mimeType:de(k()),size:de(ee()),annotations:Fn.optional(),_meta:de(Ce({}))}),hO=z({...Un.shape,...Ds.shape,uriTemplate:k(),description:de(k()),mimeType:de(k()),annotations:Fn.optional(),_meta:de(Ce({}))}),dO=zs.extend({method:M("resources/list")}),r0=Ps.extend({resources:V(n0)}),fO=zs.extend({method:M("resources/templates/list")}),pO=Ps.extend({resourceTemplates:V(hO)}),Df=Qe.extend({uri:k()}),mO=Df,gO=Ae.extend({method:M("resources/read"),params:mO}),s0=De.extend({contents:V(ce([t0,i0]))}),vO=dt.extend({method:M("notifications/resources/list_changed"),params:ht.optional()}),bO=Df,yO=Ae.extend({method:M("resources/subscribe"),params:bO}),kO=Df,xO=Ae.extend({method:M("resources/unsubscribe"),params:kO}),wO=ht.extend({uri:k()}),$O=dt.extend({method:M("notifications/resources/updated"),params:wO}),SO=z({name:k(),description:de(k()),required:de(xe())}),_O=z({...Un.shape,...Ds.shape,description:de(k()),arguments:de(V(SO)),_meta:de(Ce({}))}),OO=zs.extend({method:M("prompts/list")}),IO=Ps.extend({prompts:V(_O)}),CO=Qe.extend({name:k(),arguments:oe(k(),k()).optional()}),TO=Ae.extend({method:M("prompts/get"),params:CO}),zf=z({type:M("text"),text:k(),annotations:Fn.optional(),_meta:oe(k(),ue()).optional()}),Pf=z({type:M("image"),data:Af,mimeType:k(),annotations:Fn.optional(),_meta:oe(k(),ue()).optional()}),Mf=z({type:M("audio"),data:Af,mimeType:k(),annotations:Fn.optional(),_meta:oe(k(),ue()).optional()}),EO=z({type:M("tool_use"),name:k(),id:k(),input:oe(k(),ue()),_meta:oe(k(),ue()).optional()}),o0=z({type:M("resource"),resource:ce([t0,i0]),annotations:Fn.optional(),_meta:oe(k(),ue()).optional()}),a0=n0.extend({type:M("resource_link")}),Rs=ce([zf,Pf,Mf,a0,o0]),AO=z({role:Ns,content:Rs}),DO=De.extend({description:k().optional(),messages:V(AO)}),zO=dt.extend({method:M("notifications/prompts/list_changed"),params:ht.optional()}),PO=z({title:k().optional(),readOnlyHint:xe().optional(),destructiveHint:xe().optional(),idempotentHint:xe().optional(),openWorldHint:xe().optional()}),MO=z({taskSupport:Ee(["required","optional","forbidden"]).optional()}),Nf=z({...Un.shape,...Ds.shape,description:k().optional(),inputSchema:z({type:M("object"),properties:oe(k(),Oe).optional(),required:V(k()).optional()}).catchall(ue()),outputSchema:z({type:M("object"),properties:oe(k(),Oe).optional(),required:V(k()).optional()}).catchall(ue()).optional(),annotations:PO.optional(),execution:MO.optional(),_meta:oe(k(),ue()).optional()}),l0=zs.extend({method:M("tools/list")}),NO=Ps.extend({tools:V(Nf)}),Va=De.extend({content:V(Rs).default([]),structuredContent:oe(k(),ue()).optional(),isError:xe().optional()}),sz=Va.or(De.extend({toolResult:ue()})),RO=Es.extend({name:k(),arguments:oe(k(),ue()).optional()}),u0=Ae.extend({method:M("tools/call"),params:RO}),UO=dt.extend({method:M("notifications/tools/list_changed"),params:ht.optional()}),oz=z({autoRefresh:xe().default(!0),debounceMs:ee().int().nonnegative().default(300)}),c0=Ee(["debug","info","notice","warning","error","critical","alert","emergency"]),LO=Qe.extend({level:c0}),jO=Ae.extend({method:M("logging/setLevel"),params:LO}),BO=ht.extend({level:c0,logger:k().optional(),data:ue()}),ZO=dt.extend({method:M("notifications/message"),params:BO}),FO=z({name:k().optional()}),qO=z({hints:V(FO).optional(),costPriority:ee().min(0).max(1).optional(),speedPriority:ee().min(0).max(1).optional(),intelligencePriority:ee().min(0).max(1).optional()}),HO=z({mode:Ee(["auto","required","none"]).optional()}),WO=z({type:M("tool_result"),toolUseId:k().describe("The unique identifier for the corresponding tool call."),content:V(Rs).default([]),structuredContent:z({}).loose().optional(),isError:xe().optional(),_meta:oe(k(),ue()).optional()}),VO=Gr("type",[zf,Pf,Mf]),Fo=Gr("type",[zf,Pf,Mf,EO,WO]),XO=z({role:Ns,content:ce([Fo,V(Fo)]),_meta:oe(k(),ue()).optional()}),JO=Es.extend({messages:V(XO),modelPreferences:qO.optional(),systemPrompt:k().optional(),includeContext:Ee(["none","thisServer","allServers"]).optional(),temperature:ee().optional(),maxTokens:ee().int(),stopSequences:V(k()).optional(),metadata:Oe.optional(),tools:V(Nf).optional(),toolChoice:HO.optional()}),KO=Ae.extend({method:M("sampling/createMessage"),params:JO}),h0=De.extend({model:k(),stopReason:de(Ee(["endTurn","stopSequence","maxTokens"]).or(k())),role:Ns,content:VO}),d0=De.extend({model:k(),stopReason:de(Ee(["endTurn","stopSequence","maxTokens","toolUse"]).or(k())),role:Ns,content:ce([Fo,V(Fo)])}),GO=z({type:M("boolean"),title:k().optional(),description:k().optional(),default:xe().optional()}),YO=z({type:M("string"),title:k().optional(),description:k().optional(),minLength:ee().optional(),maxLength:ee().optional(),format:Ee(["email","uri","date","date-time"]).optional(),default:k().optional()}),QO=z({type:Ee(["number","integer"]),title:k().optional(),description:k().optional(),minimum:ee().optional(),maximum:ee().optional(),default:ee().optional()}),eI=z({type:M("string"),title:k().optional(),description:k().optional(),enum:V(k()),default:k().optional()}),tI=z({type:M("string"),title:k().optional(),description:k().optional(),oneOf:V(z({const:k(),title:k()})),default:k().optional()}),iI=z({type:M("string"),title:k().optional(),description:k().optional(),enum:V(k()),enumNames:V(k()).optional(),default:k().optional()}),nI=ce([eI,tI]),rI=z({type:M("array"),title:k().optional(),description:k().optional(),minItems:ee().optional(),maxItems:ee().optional(),items:z({type:M("string"),enum:V(k())}),default:V(k()).optional()}),sI=z({type:M("array"),title:k().optional(),description:k().optional(),minItems:ee().optional(),maxItems:ee().optional(),items:z({anyOf:V(z({const:k(),title:k()}))}),default:V(k()).optional()}),oI=ce([rI,sI]),aI=ce([iI,nI,oI]),lI=ce([aI,GO,YO,QO]),uI=Es.extend({mode:M("form").optional(),message:k(),requestedSchema:z({type:M("object"),properties:oe(k(),lI),required:V(k()).optional()})}),cI=Es.extend({mode:M("url"),message:k(),elicitationId:k(),url:k().url()}),hI=ce([uI,cI]),dI=Ae.extend({method:M("elicitation/create"),params:hI}),fI=ht.extend({elicitationId:k()}),pI=dt.extend({method:M("notifications/elicitation/complete"),params:fI}),mI=De.extend({action:Ee(["accept","decline","cancel"]),content:Qr(i=>i===null?void 0:i,oe(k(),ce([k(),ee(),xe(),V(k())])).optional())}),gI=z({type:M("ref/resource"),uri:k()}),vI=z({type:M("ref/prompt"),name:k()}),bI=Qe.extend({ref:ce([vI,gI]),argument:z({name:k(),value:k()}),context:z({arguments:oe(k(),k()).optional()}).optional()}),yI=Ae.extend({method:M("completion/complete"),params:bI}),kI=De.extend({completion:Ce({values:V(k()).max(100),total:de(ee().int()),hasMore:de(xe())})}),xI=z({uri:k().startsWith("file://"),name:k().optional(),_meta:oe(k(),ue()).optional()}),wI=Ae.extend({method:M("roots/list"),params:Qe.optional()}),$I=De.extend({roots:V(xI)}),SI=dt.extend({method:M("notifications/roots/list_changed"),params:ht.optional()}),az=ce([Wa,tO,yI,jO,TO,OO,dO,fO,gO,yO,xO,u0,l0,_f,If,Cf,Ef]),lz=ce([wf,$f,rO,SI,Zo]),uz=ce([xf,h0,d0,mI,$I,Of,Tf,Sf]),cz=ce([Wa,KO,dI,wI,_f,If,Cf,Ef]),hz=ce([wf,$f,ZO,$O,vO,UO,zO,Zo,pI]),dz=ce([xf,nO,kI,DO,IO,r0,pO,s0,Va,NO,Of,Tf,Sf]),Q=class i extends Error{constructor(e,t,r){super(`MCP error ${e}: ${t}`),this.code=e,this.data=r,this.name="McpError"}static fromError(e,t,r){if(e===re.UrlElicitationRequired&&r){let n=r;if(n.elicitations)return new ku(n.elicitations,t)}return new i(e,t,r)}},ku=class extends Q{constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(re.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function wi(i){return i==="completed"||i==="failed"||i==="cancelled"}var fz=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Kg(i){let e=L_(i)?.method;if(!e)throw Error("Schema is missing a method literal");let t=j_(e);if(typeof t!="string")throw Error("Schema method literal must be a string");return t}function Gg(i,e){let t=Jy(i,e);if(!t.success)throw t.error;return t.data}var _I=6e4,xu=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(wf,t=>{this._oncancel(t)}),this.setNotificationHandler($f,t=>{this._onprogress(t)}),this.setRequestHandler(Wa,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(_f,async(t,r)=>{let n=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!n)throw new Q(re.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(If,async(t,r)=>{let n=async()=>{let s=t.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(s,r.sessionId);){if(a.type==="response"||a.type==="error"){let l=a.message,u=l.id,c=this._requestResolvers.get(u);if(c)if(this._requestResolvers.delete(u),a.type==="response")c(l);else{let h=l,d=new Q(h.error.code,h.error.message,h.error.data);c(d)}else{let h=a.type==="response"?"Response":"Error";this._onerror(Error(`${h} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:r.requestId})}}let o=await this._taskStore.getTask(s,r.sessionId);if(!o)throw new Q(re.InvalidParams,`Task not found: ${s}`);if(!wi(o.status))return await this._waitForTaskUpdate(s,r.signal),await n();if(wi(o.status)){let a=await this._taskStore.getTaskResult(s,r.sessionId);return this._clearTaskQueue(s),{...a,_meta:{...a._meta,[Si]:{taskId:s}}}}return await n()};return await n()}),this.setRequestHandler(Cf,async(t,r)=>{try{let{tasks:n,nextCursor:s}=await this._taskStore.listTasks(t.params?.cursor,r.sessionId);return{tasks:n,nextCursor:s,_meta:{}}}catch(n){throw new Q(re.InvalidParams,`Failed to list tasks: ${n instanceof Error?n.message:String(n)}`)}}),this.setRequestHandler(Ef,async(t,r)=>{try{let n=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!n)throw new Q(re.InvalidParams,`Task not found: ${t.params.taskId}`);if(wi(n.status))throw new Q(re.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",r.sessionId),this._clearTaskQueue(t.params.taskId);let s=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!s)throw new Q(re.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...s}}catch(n){throw n instanceof Q?n:new Q(re.InvalidRequest,`Failed to cancel task: ${n instanceof Error?n.message:String(n)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,n,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:s,onTimeout:n})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),Q.fromError(re.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let r=this.transport?.onerror;this._transport.onerror=s=>{r?.(s),this._onerror(s)};let n=this._transport?.onmessage;this._transport.onmessage=(s,o)=>{n?.(s,o),wo(s)||H_(s)?this._onresponse(s):Jg(s)?this._onrequest(s,o):q_(s)?this._onnotification(s):this._onerror(Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let r of this._timeoutInfo.values())clearTimeout(r.timeoutId);this._timeoutInfo.clear();for(let r of this._requestHandlerAbortControllers.values())r.abort();this._requestHandlerAbortControllers.clear();let t=Q.fromError(re.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let r of e.values())r(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(r=>this._onerror(Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){let r=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,n=this._transport,s=e.params?._meta?.[Si]?.taskId;if(r===void 0){let c={jsonrpc:"2.0",id:e.id,error:{code:re.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:c,timestamp:Date.now()},n?.sessionId).catch(h=>this._onerror(Error(`Failed to enqueue error response: ${h}`))):n?.send(c).catch(h=>this._onerror(Error(`Failed to send an error response: ${h}`)));return}let o=new AbortController;this._requestHandlerAbortControllers.set(e.id,o);let a=F_(e.params)?e.params.task:void 0,l=this._taskStore?this.requestTaskStore(e,n?.sessionId):void 0,u={signal:o.signal,sessionId:n?.sessionId,_meta:e.params?._meta,sendNotification:async c=>{if(o.signal.aborted)return;let h={relatedRequestId:e.id};s&&(h.relatedTask={taskId:s}),await this.notification(c,h)},sendRequest:async(c,h,d)=>{if(o.signal.aborted)throw new Q(re.ConnectionClosed,"Request was cancelled");let f={...d,relatedRequestId:e.id};s&&!f.relatedTask&&(f.relatedTask={taskId:s});let p=f.relatedTask?.taskId??s;return p&&l&&await l.updateTaskStatus(p,"input_required"),await this.request(c,h,f)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:s,taskStore:l,taskRequestedTtl:a?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>r(e,u)).then(async c=>{if(o.signal.aborted)return;let h={result:c,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:h,timestamp:Date.now()},n?.sessionId):await n?.send(h)},async c=>{if(o.signal.aborted)return;let h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(c.code)?c.code:re.InternalError,message:c.message??"Internal error",...c.data!==void 0&&{data:c.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:h,timestamp:Date.now()},n?.sessionId):await n?.send(h)}).catch(c=>this._onerror(Error(`Failed to send response: ${c}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===o&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,n=Number(t),s=this._progressHandlers.get(n);if(!s){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let o=this._responseHandlers.get(n),a=this._timeoutInfo.get(n);if(a&&o&&a.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(l){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),o(l);return}s(r)}_onresponse(e){let t=Number(e.id),r=this._requestResolvers.get(t);if(r){if(this._requestResolvers.delete(t),wo(e))r(e);else{let o=new Q(e.error.code,e.error.message,e.error.data);r(o)}return}let n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let s=!1;if(wo(e)&&e.result&&typeof e.result=="object"){let o=e.result;if(o.task&&typeof o.task=="object"){let a=o.task;typeof a.taskId=="string"&&(s=!0,this._taskProgressTokens.set(a.taskId,t))}}if(s||this._progressHandlers.delete(t),wo(e))n(e);else{let o=Q.fromError(e.error.code,e.error.message,e.error.data);n(o)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,r){let{task:n}=r??{};if(!n){try{yield{type:"result",result:await this.request(e,t,r)}}catch(o){yield{type:"error",error:o instanceof Q?o:new Q(re.InternalError,String(o))}}return}let s;try{let o=await this.request(e,Sf,r);if(o.task)s=o.task.taskId,yield{type:"taskCreated",task:o.task};else throw new Q(re.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:s},r);if(yield{type:"taskStatus",task:a},wi(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},t,r)}:a.status==="failed"?yield{type:"error",error:new Q(re.InternalError,`Task ${s} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new Q(re.InternalError,`Task ${s} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},t,r)};return}let l=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,l)),r?.signal?.throwIfAborted()}}catch(o){yield{type:"error",error:o instanceof Q?o:new Q(re.InternalError,String(o))}}}request(e,t,r){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:o,task:a,relatedTask:l}=r??{};return new Promise((u,c)=>{let h=x=>{c(x)};if(!this._transport){h(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(x){h(x);return}r?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:d};r?.onprogress&&(this._progressHandlers.set(d,r.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),a&&(f.params={...f.params,task:a}),l&&(f.params={...f.params,_meta:{...f.params?._meta||{},[Si]:l}});let p=x=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:d,reason:String(x)}},{relatedRequestId:n,resumptionToken:s,onresumptiontoken:o}).catch(R=>this._onerror(Error(`Failed to send cancellation: ${R}`)));let $=x instanceof Q?x:new Q(re.RequestTimeout,String(x));c($)};this._responseHandlers.set(d,x=>{if(!r?.signal?.aborted){if(x instanceof Error)return c(x);try{let $=Jy(t,x.result);$.success?u($.data):c($.error)}catch($){c($)}}}),r?.signal?.addEventListener("abort",()=>{p(r?.signal?.reason)});let g=r?.timeout??_I,b=()=>p(Q.fromError(re.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(d,g,r?.maxTotalTimeout,b,r?.resetTimeoutOnProgress??!1);let v=l?.taskId;if(v){let x=$=>{let R=this._responseHandlers.get(d);R?R($):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))};this._requestResolvers.set(d,x),this._enqueueTaskMessage(v,{type:"request",message:f,timestamp:Date.now()}).catch($=>{this._cleanupTimeout(d),c($)})}else this._transport.send(f,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:o}).catch(x=>{this._cleanupTimeout(d),c(x)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Of,t)}async getTaskResult(e,t,r){return this.request({method:"tasks/result",params:e},t,r)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},Tf,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},cO,t)}async notification(e,t){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(e.method);let r=t?.relatedTask?.taskId;if(r){let s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Si]:t.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let s={...e,jsonrpc:"2.0"};t?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Si]:t.relatedTask}}}),this._transport?.send(s,t).catch(o=>this._onerror(o))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[Si]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){let r=Kg(e);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(n,s)=>{let o=Gg(e,n);return Promise.resolve(t(o,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let r=Kg(e);this._notificationHandlers.set(r,n=>{let s=Gg(e,n);return Promise.resolve(t(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,r){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let n=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,r,n)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let r=await this._taskMessageQueue.dequeueAll(e,t);for(let n of r)if(n.type==="request"&&Jg(n.message)){let s=n.message.id,o=this._requestResolvers.get(s);o?(o(new Q(re.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let r=this._options?.defaultTaskPollInterval??1e3;try{let n=await this._taskStore?.getTask(e);n?.pollInterval&&(r=n.pollInterval)}catch{}return new Promise((n,s)=>{if(t.aborted){s(new Q(re.InvalidRequest,"Request cancelled"));return}let o=setTimeout(n,r);t.addEventListener("abort",()=>{clearTimeout(o),s(new Q(re.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){let r=this._taskStore;if(!r)throw Error("No task store configured");return{createTask:async n=>{if(!e)throw Error("No request provided");return await r.createTask(n,e.id,{method:e.method,params:e.params},t)},getTask:async n=>{let s=await r.getTask(n,t);if(!s)throw new Q(re.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(n,s,o)=>{await r.storeTaskResult(n,s,o,t);let a=await r.getTask(n,t);if(a){let l=Zo.parse({method:"notifications/tasks/status",params:a});await this.notification(l),wi(a.status)&&this._cleanupTaskProgressHandler(n)}},getTaskResult:n=>r.getTaskResult(n,t),updateTaskStatus:async(n,s,o)=>{let a=await r.getTask(n,t);if(!a)throw new Q(re.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(wi(a.status))throw new Q(re.InvalidParams,`Cannot update task "${n}" from terminal status "${a.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(n,s,o,t);let l=await r.getTask(n,t);if(l){let u=Zo.parse({method:"notifications/tasks/status",params:l});await this.notification(u),wi(l.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>r.listTasks(n,t)}}};function Yg(i){return i!==null&&typeof i=="object"&&!Array.isArray(i)}function OI(i,e){let t={...i};for(let r in e){let n=r,s=e[n];if(s===void 0)continue;let o=t[n];Yg(o)&&Yg(s)?t[n]={...o,...s}:t[n]=s}return t}var wu=class extends xu{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,t){}_ensureEventSlot(e){let t=this._eventSlots.get(e);if(!t){let r=this.eventSchemas[e];if(!r)throw Error(`Unknown event: ${String(e)}`);t={listeners:[]},this._eventSlots.set(e,t);let n=r.shape.method.value;this._registeredMethods.add(n);let s=t;super.setNotificationHandler(r,o=>{let a=o.params;this.onEventDispatch(e,a),s.onHandler?.(a);for(let l of[...s.listeners])l(a)})}return t}setEventHandler(e,t){let r=this._ensureEventSlot(e);r.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", \u2026) to add multiple listeners without replacing.`),r.onHandler=t}getEventHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let r=this._eventSlots.get(e);if(!r)return;let n=r.listeners.indexOf(t);n!==-1&&r.listeners.splice(n,1)}setRequestHandler=(e,t)=>{this._assertMethodNotRegistered(e,"setRequestHandler"),super.setRequestHandler(e,t)};setNotificationHandler=(e,t)=>{this._assertMethodNotRegistered(e,"setNotificationHandler"),super.setNotificationHandler(e,t)};warnIfRequestHandlerReplaced(e,t,r){t&&r&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,t)=>{let r=e.shape.method.value;this._registeredMethods.add(r),super.setRequestHandler(e,t)};_assertMethodNotRegistered(e,t){let r=e.shape.method.value;if(this._registeredMethods.has(r))throw Error(`Handler for "${r}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(r)}},II="2026-01-26";var CI="ui/notifications/tool-input-partial";var $u=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=r=>{if(t&&r.source!==this.eventSource){console.debug("Ignoring message from unknown source",r);return}let n=W_.safeParse(r.data);n.success?(console.debug("Parsed message",n.data),this.onmessage?.(n.data)):r.data?.jsonrpc!=="2.0"?console.debug("Ignoring non-JSON-RPC message",n.error.message,r):(console.error("Failed to parse message",n.error.message,r),this.onerror?.(Error("Invalid JSON-RPC message received: "+n.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(e,t){e.method!==CI&&console.debug("Sending message",e),this.eventTarget.postMessage(e,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion};Fa();var TI=m.union([m.literal("light"),m.literal("dark")]).describe("Color theme preference for the host environment."),_r=m.union([m.literal("inline"),m.literal("fullscreen"),m.literal("pip")]).describe("Display mode for UI presentation."),EI=m.union([m.literal("--color-background-primary"),m.literal("--color-background-secondary"),m.literal("--color-background-tertiary"),m.literal("--color-background-inverse"),m.literal("--color-background-ghost"),m.literal("--color-background-info"),m.literal("--color-background-danger"),m.literal("--color-background-success"),m.literal("--color-background-warning"),m.literal("--color-background-disabled"),m.literal("--color-text-primary"),m.literal("--color-text-secondary"),m.literal("--color-text-tertiary"),m.literal("--color-text-inverse"),m.literal("--color-text-ghost"),m.literal("--color-text-info"),m.literal("--color-text-danger"),m.literal("--color-text-success"),m.literal("--color-text-warning"),m.literal("--color-text-disabled"),m.literal("--color-border-primary"),m.literal("--color-border-secondary"),m.literal("--color-border-tertiary"),m.literal("--color-border-inverse"),m.literal("--color-border-ghost"),m.literal("--color-border-info"),m.literal("--color-border-danger"),m.literal("--color-border-success"),m.literal("--color-border-warning"),m.literal("--color-border-disabled"),m.literal("--color-ring-primary"),m.literal("--color-ring-secondary"),m.literal("--color-ring-inverse"),m.literal("--color-ring-info"),m.literal("--color-ring-danger"),m.literal("--color-ring-success"),m.literal("--color-ring-warning"),m.literal("--font-sans"),m.literal("--font-mono"),m.literal("--font-weight-normal"),m.literal("--font-weight-medium"),m.literal("--font-weight-semibold"),m.literal("--font-weight-bold"),m.literal("--font-text-xs-size"),m.literal("--font-text-sm-size"),m.literal("--font-text-md-size"),m.literal("--font-text-lg-size"),m.literal("--font-heading-xs-size"),m.literal("--font-heading-sm-size"),m.literal("--font-heading-md-size"),m.literal("--font-heading-lg-size"),m.literal("--font-heading-xl-size"),m.literal("--font-heading-2xl-size"),m.literal("--font-heading-3xl-size"),m.literal("--font-text-xs-line-height"),m.literal("--font-text-sm-line-height"),m.literal("--font-text-md-line-height"),m.literal("--font-text-lg-line-height"),m.literal("--font-heading-xs-line-height"),m.literal("--font-heading-sm-line-height"),m.literal("--font-heading-md-line-height"),m.literal("--font-heading-lg-line-height"),m.literal("--font-heading-xl-line-height"),m.literal("--font-heading-2xl-line-height"),m.literal("--font-heading-3xl-line-height"),m.literal("--border-radius-xs"),m.literal("--border-radius-sm"),m.literal("--border-radius-md"),m.literal("--border-radius-lg"),m.literal("--border-radius-xl"),m.literal("--border-radius-full"),m.literal("--border-width-regular"),m.literal("--shadow-hairline"),m.literal("--shadow-sm"),m.literal("--shadow-md"),m.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),AI=m.record(EI.describe(`Style variables for theming MCP apps. + +Individual style keys are optional - hosts may provide any subset of these values. +Values are strings containing CSS values (colors, sizes, font stacks, etc.). + +Note: This type uses \`Record\` rather than \`Partial>\` +for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),m.union([m.string(),m.undefined()]).describe(`Style variables for theming MCP apps. + +Individual style keys are optional - hosts may provide any subset of these values. +Values are strings containing CSS values (colors, sizes, font stacks, etc.). + +Note: This type uses \`Record\` rather than \`Partial>\` +for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps. + +Individual style keys are optional - hosts may provide any subset of these values. +Values are strings containing CSS values (colors, sizes, font stacks, etc.). + +Note: This type uses \`Record\` rather than \`Partial>\` +for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),pz=m.object({method:m.literal("ui/open-link"),params:m.object({url:m.string().describe("URL to open in the host's browser")})}),DI=m.object({isError:m.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),zI=m.object({isError:m.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),PI=m.object({isError:m.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),mz=m.object({method:m.literal("ui/notifications/sandbox-proxy-ready"),params:m.object({})}),Rf=m.object({connectDomains:m.array(m.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket). + +- Maps to CSP \`connect-src\` directive +- Empty or omitted \u2192 no network connections (secure default)`),resourceDomains:m.array(m.string()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted \u2192 no network resources (secure default)"),frameDomains:m.array(m.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted \u2192 no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:m.array(m.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted \u2192 only same origin allowed (`base-uri 'self'`)")}),Uf=m.object({camera:m.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:m.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:m.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:m.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),gz=m.object({method:m.literal("ui/notifications/size-changed"),params:m.object({width:m.number().optional().describe("New width in pixels."),height:m.number().optional().describe("New height in pixels.")})}),MI=m.object({method:m.literal("ui/notifications/tool-input"),params:m.object({arguments:m.record(m.string(),m.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),NI=m.object({method:m.literal("ui/notifications/tool-input-partial"),params:m.object({arguments:m.record(m.string(),m.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),RI=m.object({method:m.literal("ui/notifications/tool-cancelled"),params:m.object({reason:m.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),UI=m.object({fonts:m.string().optional()}),LI=m.object({variables:AI.optional().describe("CSS variables for theming the app."),css:UI.optional().describe("CSS blocks that apps can inject.")}),jI=m.object({method:m.literal("ui/resource-teardown"),params:m.object({})}),vz=m.record(m.string(),m.unknown()),Qg=m.object({text:m.object({}).optional().describe("Host supports text content blocks."),image:m.object({}).optional().describe("Host supports image content blocks."),audio:m.object({}).optional().describe("Host supports audio content blocks."),resource:m.object({}).optional().describe("Host supports resource content blocks."),resourceLink:m.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:m.object({}).optional().describe("Host supports structured content.")}),bz=m.object({method:m.literal("ui/notifications/request-teardown"),params:m.object({}).optional()}),BI=m.object({experimental:m.object({}).optional().describe("Experimental features (structure TBD)."),openLinks:m.object({}).optional().describe("Host supports opening external URLs."),downloadFile:m.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:m.object({listChanged:m.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:m.object({listChanged:m.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:m.object({}).optional().describe("Host accepts log messages."),sandbox:m.object({permissions:Uf.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:Rf.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:Qg.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:Qg.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:m.object({tools:m.object({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),ZI=m.object({experimental:m.object({}).optional().describe("Experimental features (structure TBD)."),tools:m.object({listChanged:m.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:m.array(_r).optional().describe("Display modes the app supports.")}),yz=m.object({method:m.literal("ui/notifications/initialized"),params:m.object({}).optional()}),kz=m.object({csp:Rf.optional().describe("Content Security Policy configuration for UI resources."),permissions:Uf.optional().describe("Sandbox permissions requested by the UI resource."),domain:m.string().optional().describe(`Dedicated origin for view sandbox. + +Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists. + +**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include: +- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`) +- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`) + +If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:m.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border. + +Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary. + +- \`true\`: request visible border + background +- \`false\`: request no visible border + background +- omitted: host decides border`)}),xz=m.object({method:m.literal("ui/request-display-mode"),params:m.object({mode:_r.describe("The display mode being requested.")})}),FI=m.object({mode:_r.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),qI=m.union([m.literal("model"),m.literal("app")]).describe("Tool visibility scope - who can access the tool."),wz=m.object({resourceUri:m.string().optional(),visibility:m.array(qI).optional().describe(`Who can access this tool. Default: ["model", "app"] +- "model": Tool visible to and callable by the agent +- "app": Tool callable by the app from this server only`),csp:m.never().optional(),permissions:m.never().optional()}),$z=m.object({mimeTypes:m.array(m.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),Sz=m.object({method:m.literal("ui/download-file"),params:m.object({contents:m.array(m.union([o0,a0])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),_z=m.object({method:m.literal("ui/message"),params:m.object({role:m.literal("user").describe('Message role, currently only "user" is supported.'),content:m.array(Rs).describe("Message content blocks (text, image, etc.).")})}),Oz=m.object({method:m.literal("ui/notifications/sandbox-resource-ready"),params:m.object({html:m.string().describe("HTML content to load into the inner iframe."),sandbox:m.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:Rf.optional().describe("CSP configuration from resource metadata."),permissions:Uf.optional().describe("Sandbox permissions from resource metadata.")})}),HI=m.object({method:m.literal("ui/notifications/tool-result"),params:Va.describe("Standard MCP tool execution result.")}),f0=m.object({toolInfo:m.object({id:As.optional().describe("JSON-RPC id of the tools/call request."),tool:Nf.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:TI.optional().describe("Current color theme preference."),styles:LI.optional().describe("Style configuration for theming the app."),displayMode:_r.optional().describe("How the UI is currently displayed."),availableDisplayModes:m.array(_r).optional().describe("Display modes the host supports."),containerDimensions:m.union([m.object({height:m.number().describe("Fixed container height in pixels.")}),m.object({maxHeight:m.union([m.number(),m.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(m.union([m.object({width:m.number().describe("Fixed container width in pixels.")}),m.object({maxWidth:m.union([m.number(),m.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other +container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:m.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:m.string().optional().describe("User's timezone in IANA format."),userAgent:m.string().optional().describe("Host application identifier."),platform:m.union([m.literal("web"),m.literal("desktop"),m.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:m.object({touch:m.boolean().optional().describe("Whether the device supports touch input."),hover:m.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:m.object({top:m.number().describe("Top safe area inset in pixels."),right:m.number().describe("Right safe area inset in pixels."),bottom:m.number().describe("Bottom safe area inset in pixels."),left:m.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),WI=m.object({method:m.literal("ui/notifications/host-context-changed"),params:f0.describe("Partial context update containing only changed fields.")}),Iz=m.object({method:m.literal("ui/update-model-context"),params:m.object({content:m.array(Rs).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:m.record(m.string(),m.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),Cz=m.object({method:m.literal("ui/initialize"),params:m.object({appInfo:Ha.describe("App identification (name and version)."),appCapabilities:ZI.describe("Features and capabilities this app provides."),protocolVersion:m.string().describe("Protocol version this app supports.")})}),VI=m.object({protocolVersion:m.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Ha.describe("Host application identification and version."),hostCapabilities:BI.describe("Features and capabilities provided by the host."),hostContext:f0.describe("Rich context about the host environment.")}).passthrough(),XI={target:"draft-2020-12"};async function ev(i,e){let t=i["~standard"];if(t.jsonSchema)return t.jsonSchema[e](XI);if(t.vendor==="zod"){let{z:r}=await Promise.resolve().then(()=>(Fa(),Vy));return r.toJSONSchema(i,{io:e})}throw Error(`Schema (vendor: ${t.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function tv(i,e,t=""){let r=await i["~standard"].validate(e);if(r.issues){let n=r.issues.map(s=>{let o=s.path?.map(a=>typeof a=="object"?a.key:a).join(".");return o?`${o}: ${s.message}`:s.message}).join("; ");throw Error(t+n)}return r.value}Fa();var qo=class i extends wu{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:MI,toolinputpartial:NI,toolresult:HI,toolcancelled:RI,hostcontextchanged:WI};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(e){if(!i.ONE_SHOT_EVENTS.has(e)||this._everHadListener.has(e)||(this._everHadListener.add(e),!this._initializedSent))return;let t=`[ext-apps] "${String(e)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(t);console.warn(t)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},r={autoResize:!0}){super(r),this._appInfo=e,this._capabilities=t,this.options=r,r.allowUnsafeEval||m.config({jitless:!0}),this.setRequestHandler(Wa,n=>(console.log("Received ping:",n.params),{})),this.setEventHandler("hostcontextchanged",void 0)}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._capabilities=OI(this._capabilities,e)}registerTool(e,t,r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let n=this,s=()=>{n._initializedSent&&n._capabilities.tools?.listChanged&&n.sendToolListChanged()},o=t.inputSchema!==void 0,a={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,s()},disable(){this.enabled=!1,s()},update(l){Object.assign(this,l),s()},remove(){n._registeredTools[e]===a&&(delete n._registeredTools[e],s())},handler:async(l,u)=>{if(!a.enabled)throw Error(`Tool ${e} is disabled`);let c;if(o){let h=a.inputSchema,d=h?await tv(h,l??{},`Invalid input for tool ${e}: `):l??{};c=await r(d,u)}else c=await r(u);return a.outputSchema&&!c.isError&&(c.structuredContent=await tv(a.outputSchema,c.structuredContent,`Invalid output for tool ${e}: `)),c}};return this._registeredTools[e]=a,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),s(),a}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let r=this._registeredTools[e.name];if(!r)throw Error(`Tool ${e.name} not found`);return r.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([r,n])=>n.enabled).map(async([r,n])=>{let s={name:r,title:n.title,description:n.description,inputSchema:n.inputSchema?await ev(n.inputSchema,"input"):{type:"object",properties:{}}};return n.outputSchema&&(s.outputSchema=await ev(n.outputSchema,"output")),n.annotations&&(s.annotations=n.annotations),n._meta&&(s._meta=n._meta),s}))}))}async sendToolListChanged(e={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(e){this.setEventHandler("toolinput",e)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(e){this.setEventHandler("toolinputpartial",e)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(e){this.setEventHandler("toolresult",e)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(e){this.setEventHandler("toolcancelled",e)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(e){this.setEventHandler("hostcontextchanged",e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(jI,(t,r)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(t.params,r)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(u0,(t,r)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(t.params,r)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(l0,(t,r)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(t.params,r)})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`);break}}assertRequestHandlerCapability(e){switch(e){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(e){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(e,t){if(this._assertInitialized("callServerTool"),typeof e=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:e},Va,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:e},s0,t)}async listServerResources(e,t){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:e},r0,t)}async createSamplingMessage(e,t){this._assertInitialized("createSamplingMessage");let r=e.tools?d0:h0;return await this.request({method:"sampling/createMessage",params:e},r,t)}sendMessage(e,t){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:e},PI,t)}sendLog(e){return this.notification({method:"notifications/message",params:e})}updateModelContext(e,t){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:e},xf,t)}openLink(e,t){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:e},DI,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:e},zI,t)}requestTeardown(e={}){return this.notification({method:"ui/notifications/request-teardown",params:e})}requestDisplayMode(e,t){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:e},FI,t)}sendSizeChanged(e){return this.notification({method:"ui/notifications/size-changed",params:e})}setupSizeChangedNotifications(){let e=!1,t=0,r=0,n=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let o=document.documentElement,a=o.style.height;o.style.height="max-content";let l=Math.ceil(o.getBoundingClientRect().height);o.style.height=a;let u=Math.ceil(window.innerWidth);(u!==t||l!==r)&&(t=u,r=l,this.sendSizeChanged({width:u,height:l}))}))};n();let s=new ResizeObserver(n);return s.observe(document.documentElement),s.observe(document.body),()=>s.disconnect()}async connect(e=new $u(window.parent,window.parent),t){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1,await super.connect(e);try{let r=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:II}},VI,t);if(r===void 0)throw Error(`Server sent invalid initialize result: ${r}`);this._hostCapabilities=r.hostCapabilities,this._hostInfo=r.hostInfo,this._hostContext=r.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(r){throw this.close(),r}}};var op=class{constructor(e){this.getView=e,this.scaleY=1,this.pinchTimeout=150,this.scaleStartZoom=1,this.lastEventTime=0,this.lastDeltaY=0,this.timeThreshold=50,this.deltaYThreshold=50,this.deltaYChangeThreshold=10,this.mouseWheelRatio=800,this.touchWheelRatio=100,this.isDragging=!1,this.dragStartX=0,this.dragStartY=0,this.dragStartOffsetX=0,this.dragStartOffsetY=0,this.startTouchDistance=0,this.lastTouchCenterX=0,this.lastTouchCenterY=0,this.isTouchPanning=!1,this.isTouchZooming=!1,this.zoom=1,this.offsetX=0,this.offsetY=0}applyToView(){this.getView()?.updateZoomScaleAndOffset(this.zoom,this.offsetX,this.offsetY)}handleScrollEvent(e,t){t===1&&(this.scaleStartZoom=this.zoom,this.scaleY=1,e.shiftKey&&e.deltaX===0&&e.deltaY!==0?this.offsetX-=e.deltaY*window.devicePixelRatio:(this.offsetX-=e.deltaX*window.devicePixelRatio,this.offsetY-=e.deltaY*window.devicePixelRatio),this.applyToView())}handleScaleEvent(e,t,r){if(t===0&&(this.scaleY=1,this.scaleStartZoom=this.zoom),t===1){let n=r.getBoundingClientRect(),s=(e.clientX-n.left)*window.devicePixelRatio,o=(e.clientY-n.top)*window.devicePixelRatio,a=Math.max(.001,Math.min(1e3,this.scaleStartZoom*this.scaleY));this.offsetX=(this.offsetX-s)*(a/this.zoom)+s,this.offsetY=(this.offsetY-o)*(a/this.zoom)+o,this.zoom=a}t===2&&(this.scaleY=1,this.scaleStartZoom=this.zoom),this.applyToView()}clearState(){this.scaleY=1,this.timer=void 0}resetTransform(){this.zoom=1,this.offsetX=0,this.offsetY=0,this.clearState(),this.applyToView()}resetScrollTimeout(e){clearTimeout(this.timer),this.timer=window.setTimeout(()=>{this.timer=void 0,this.handleScrollEvent(e,2),this.clearState()},this.pinchTimeout)}resetScaleTimeout(e,t){clearTimeout(this.timer),this.timer=window.setTimeout(()=>{this.timer=void 0,this.handleScaleEvent(e,2,t),this.clearState()},this.pinchTimeout)}getDeviceType(e){let t=Date.now(),r=t-this.lastEventTime,n=Math.abs(e.deltaY-this.lastDeltaY),s=!1;return e.deltaMode===e.DOM_DELTA_PIXEL&&r0){let c=r/this.startTouchDistance,h=Math.max(.001,Math.min(1e3,this.scaleStartZoom*c));this.offsetX=(this.offsetX-o)*(h/this.zoom)+o,this.offsetY=(this.offsetY-a)*(h/this.zoom)+a,this.zoom=h}let l=(n.x-this.lastTouchCenterX)*window.devicePixelRatio,u=(n.y-this.lastTouchCenterY)*window.devicePixelRatio;this.offsetX+=l,this.offsetY+=u,this.lastTouchCenterX=n.x,this.lastTouchCenterY=n.y,this.applyToView()}}onTouchEnd(e){e.touches.length===0?(this.isTouchPanning=!1,this.isTouchZooming=!1):e.touches.length===1&&(this.isTouchPanning=!0,this.isTouchZooming=!1,this.dragStartX=e.touches[0].clientX,this.dragStartY=e.touches[0].clientY,this.dragStartOffsetX=this.offsetX,this.dragStartOffsetY=this.offsetY)}onGestureStart(e){this.scaleStartZoom=this.zoom,this.dragStartOffsetX=this.offsetX,this.dragStartOffsetY=this.offsetY}onGestureChange(e,t){let r=t.getBoundingClientRect(),n=(e.clientX-r.left)*window.devicePixelRatio,s=(e.clientY-r.top)*window.devicePixelRatio,o=Math.max(.001,Math.min(1e3,this.scaleStartZoom*e.scale));this.offsetX=(this.offsetX-n)*(o/this.zoom)+n,this.offsetY=(this.offsetY-s)*(o/this.zoom)+s,this.zoom=o,this.applyToView()}onGestureEnd(){}};function JI(i,e,t){i.style.cursor="grab";let r=0,n=0,s=v=>{v.preventDefault(),e.onWheel(v,i)},o=v=>{v.preventDefault(),r=v.clientX,n=v.clientY,e.onMouseDown(v,i)},a=v=>{e.onMouseMove(v)},l=v=>{e.onMouseUp(i),v.button===0&&Math.abs(v.clientX-r)<5&&Math.abs(v.clientY-n)<5&&t()},u=()=>{e.onMouseUp(i)},c=v=>{v.preventDefault(),v.touches.length===1&&(r=v.touches[0].clientX,n=v.touches[0].clientY),e.onTouchStart(v)},h=v=>{v.preventDefault(),e.onTouchMove(v,i)},d=v=>{let x=v.touches.length===0&&v.changedTouches.length===1;if(e.onTouchEnd(v),x){let $=v.changedTouches[0];Math.abs($.clientX-r)<5&&Math.abs($.clientY-n)<5&&t()}},f=v=>{e.onTouchEnd(v)},p=v=>{v.preventDefault(),e.onGestureStart(v)},g=v=>{v.preventDefault(),e.onGestureChange(v,i)},b=v=>{v.preventDefault(),e.onGestureEnd()};return i.addEventListener("wheel",s,{passive:!1}),i.addEventListener("mousedown",o),i.addEventListener("mousemove",a),i.addEventListener("mouseup",l),i.addEventListener("mouseleave",u),i.addEventListener("touchstart",c,{passive:!1}),i.addEventListener("touchmove",h,{passive:!1}),i.addEventListener("touchend",d),i.addEventListener("touchcancel",f),i.addEventListener("gesturestart",p),i.addEventListener("gesturechange",g),i.addEventListener("gestureend",b),()=>{i.removeEventListener("wheel",s),i.removeEventListener("mousedown",o),i.removeEventListener("mousemove",a),i.removeEventListener("mouseup",l),i.removeEventListener("mouseleave",u),i.removeEventListener("touchstart",c),i.removeEventListener("touchmove",h),i.removeEventListener("touchend",d),i.removeEventListener("touchcancel",f),i.removeEventListener("gesturestart",p),i.removeEventListener("gesturechange",g),i.removeEventListener("gestureend",b)}}var KI=` + + + + +`,GI=` + + + + +`,YI=` + +`,QI=` + +`;function Xa(i,e){return i?i.endsWith("/")?i+e:i+"/"+e:e}var ap=class{constructor(e){this.isDraggingSlider=!1,this.wasPlayingBeforeDrag=!1,this.wasPlaying=!1,this.tickHandle=null,this.parent=e.parent,this.getView=e.getView,this.callbacks=e.callbacks??{},this.iconBaseUrl=e.iconBaseUrl,this.build(),this.startTick()}isVisible(){return!this.root.classList.contains("hidden")}setVisible(e){this.root.classList.toggle("hidden",!e),e&&(this.updateAll(),this.updateLoopIcon())}updateAll(){this.updatePlayPauseIcon(),this.updateProgressSlider(),this.updateTimeDisplay()}togglePlayback(){let e=this.getView();!e||e.durationMicros()<=0||(e.isPlaying()?(e.pause(),this.callbacks.onPause?.()):(e.currentTimeMicros()>=e.durationMicros()&&e.setCurrentTimeMicros(0),e.play(),this.callbacks.onPlay?.()),this.updateAll())}stepFrame(e){let t=this.getView();if(!t)return;let r=t.frameRate(),n=t.durationMicros();if(r<=0||n<=0)return;t.pause(),this.callbacks.onPause?.();let s=1e6/r,o=t.currentTimeMicros()+e*s,a=Math.max(0,Math.min(n,o));t.setCurrentTimeMicros(a),this.callbacks.onSeek?.(a),this.updateAll()}destroy(){this.tickHandle!==null&&(window.clearInterval(this.tickHandle),this.tickHandle=null),this.root.remove()}build(){this.root=document.createElement("div"),this.root.id="playback-bar",this.root.className="pagx-player-playback-bar playback-bar hidden",this.playPauseBtn=document.createElement("button"),this.playPauseBtn.id="play-pause-btn",this.playPauseBtn.className="playback-btn playback-btn-primary",this.playPauseImg=document.createElement("img"),this.playPauseImg.id="play-pause-img",this.playPauseImg.src=Xa(this.iconBaseUrl,"play.png"),this.playPauseImg.alt="",this.playPauseBtn.appendChild(this.playPauseImg),this.playPauseBtn.addEventListener("click",()=>{this.togglePlayback(),this.playPauseBtn.blur()}),this.prevFrameBtn=document.createElement("button"),this.prevFrameBtn.id="prev-frame-btn",this.prevFrameBtn.className="playback-btn playback-btn-step";let e=document.createElement("img");e.src=Xa(this.iconBaseUrl,"previous.png"),e.alt="",this.prevFrameBtn.appendChild(e),this.prevFrameBtn.addEventListener("click",()=>{this.stepFrame(-1),this.prevFrameBtn.blur()}),this.nextFrameBtn=document.createElement("button"),this.nextFrameBtn.id="next-frame-btn",this.nextFrameBtn.className="playback-btn playback-btn-step";let t=document.createElement("img");t.src=Xa(this.iconBaseUrl,"next.png"),t.alt="",this.nextFrameBtn.appendChild(t),this.nextFrameBtn.addEventListener("click",()=>{this.stepFrame(1),this.nextFrameBtn.blur()});let r=document.createElement("div");r.className="progress-wrapper",this.progressSlider=document.createElement("input"),this.progressSlider.id="progress-slider",this.progressSlider.className="progress-slider",this.progressSlider.type="range",this.progressSlider.min="0",this.progressSlider.max="1000",this.progressSlider.value="0",this.progressSlider.step="1",this.bindSlider(),r.appendChild(this.progressSlider);let n=document.createElement("div");n.id="time-display",n.className="time-display",this.timeText=document.createElement("span"),this.timeText.id="time-text",this.timeText.className="time-text",this.timeText.textContent="0.00s / 0.00s";let s=document.createElement("span");s.className="time-divider",this.frameText=document.createElement("span"),this.frameText.id="frame-text",this.frameText.className="frame-text",this.frameText.textContent="0 / 0",n.appendChild(this.timeText),n.appendChild(s),n.appendChild(this.frameText),this.loopBtn=document.createElement("button"),this.loopBtn.id="loop-btn",this.loopBtn.className="playback-btn playback-btn-loop",this.loopBtn.setAttribute("aria-label","Loop"),this.loopBtn.innerHTML=YI+QI,this.loopBtn.addEventListener("click",()=>{let o=this.getView();o&&(o.setLoop(!o.isLoop()),this.updateLoopIcon(),this.loopBtn.blur())}),this.root.appendChild(this.playPauseBtn),this.root.appendChild(this.prevFrameBtn),this.root.appendChild(this.nextFrameBtn),this.root.appendChild(r),this.root.appendChild(n),this.root.appendChild(this.loopBtn),this.parent.appendChild(this.root)}bindSlider(){let e=()=>{let t=this.getView();if(!t)return;let r=t.durationMicros();if(r<=0)return;let s=parseFloat(this.progressSlider.value)/1e3*r;t.setCurrentTimeMicros(s),this.callbacks.onSeek?.(s)};this.progressSlider.addEventListener("input",()=>{let t=this.getView();t&&(this.isDraggingSlider||(this.isDraggingSlider=!0,this.wasPlayingBeforeDrag=t.isPlaying(),this.wasPlayingBeforeDrag&&(t.pause(),this.callbacks.onPause?.())),this.updateSliderFill(),e(),this.updateTimeDisplay(),this.updatePlayPauseIcon())}),this.progressSlider.addEventListener("change",()=>{this.isDraggingSlider=!1;let t=this.getView();t&&(e(),this.wasPlayingBeforeDrag&&(t.play(),this.callbacks.onPlay?.(),this.wasPlayingBeforeDrag=!1),this.updateAll(),this.progressSlider.blur())})}startTick(){this.tickHandle=window.setInterval(()=>{let e=this.getView();if(!e||!this.isVisible())return;let t=e.isPlaying();!this.isDraggingSlider&&(t||this.wasPlaying)&&(this.updateAll(),this.callbacks.onFrameChange?.(e.currentTimeMicros())),this.wasPlaying=t},100)}updatePlayPauseIcon(){let e=this.getView();if(!e)return;let t=e.isPlaying();this.playPauseImg.src=Xa(this.iconBaseUrl,t?"pause.png":"play.png")}updateSliderFill(){let e=parseFloat(this.progressSlider.value)/1e3*100;this.progressSlider.style.background="linear-gradient(90deg, #4c7cf3, #8b5cf0, #ec5b9c) no-repeat 0 0 / "+e+"% 100%, rgba(255, 255, 255, 0.18)"}updateProgressSlider(){let e=this.getView();if(!e)return;let t=e.durationMicros();if(t<=0){this.progressSlider.value="0",this.updateSliderFill();return}let r=Math.max(0,e.currentTimeMicros());this.progressSlider.value=String(Math.round(r/t*1e3)),this.updateSliderFill()}updateTimeDisplay(){let e=this.getView();if(!e)return;let t=e.currentTimeMicros(),r=e.durationMicros();this.timeText.textContent=p0(t)+" / "+p0(r),this.frameText.textContent=String(eC(e))+" / "+String(tC(e))}updateLoopIcon(){let e=this.getView();e&&this.loopBtn.classList.toggle("active",e.isLoop())}};function p0(i){return Math.max(0,i/1e6).toFixed(2)+"s"}function eC(i){let e=i.frameRate();return e<=0?0:Math.round(Math.max(0,i.currentTimeMicros())*e/1e6)}function tC(i){let e=i.frameRate();return e<=0?0:Math.ceil(i.durationMicros()*e/1e6)}function iC(i,e={}){let t=document.createElement("div");t.className="pagx-player-toolbar hidden";for(let n of e.before??[])m0(t,n);let r=document.createElement("button");if(r.id="reset-btn",r.className="toolbar-btn",r.title="Reset View",r.innerHTML=KI,r.addEventListener("click",()=>{i.onResetView(),r.blur()}),t.appendChild(r),i.onToggleEditor){let n=document.createElement("button");n.id="source-editor-btn",n.className="toolbar-btn",n.title="Source Editor (L)",n.innerHTML=GI;let s=i.onToggleEditor;n.addEventListener("click",()=>{s(),n.blur()}),t.appendChild(n)}for(let n of e.after??[])m0(t,n);return t}function m0(i,e){if(e.divider){let r=document.createElement("span");r.className="toolbar-divider",e.id&&(r.id=e.id),i.appendChild(r);return}let t=document.createElement("button");if(t.id=e.id,t.className="toolbar-btn"+(e.extraClass?" "+e.extraClass:""),e.title&&(t.title=e.title),e.html&&(t.innerHTML=e.html),e.onClick){let r=e.onClick;t.addEventListener("click",n=>{r(n),t.blur()})}i.appendChild(t)}function Ja(i,e){i.classList.toggle("hidden",!e)}var lp=[],qk=[];(()=>{let i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(i=qk[r])e=r+1;else return!0;if(e==t)return!1}}function g0(i){return i>=127462&&i<=127487}var v0=8205;function rC(i,e,t=!0,r=!0){return(t?Hk:sC)(i,e,r)}function Hk(i,e,t){if(e==i.length)return e;e&&Wk(i.charCodeAt(e))&&Vk(i.charCodeAt(e-1))&&e--;let r=Lf(i,e);for(e+=b0(r);e=0&&g0(Lf(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function sC(i,e,t){for(;e>1;){let r=Hk(i,e-2,t);if(r=56320&&i<57344}function Vk(i){return i>=55296&&i<56320}function b0(i){return i<65536?1:2}var te=class i{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){[e,t]=nr(this,e,t);let n=[];return this.decompose(0,e,n,2),r.length&&r.decompose(0,r.length,n,3),this.decompose(t,this.length,n,1),Kn.from(n,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=nr(this,e,t);let r=[];return this.decompose(e,t,r,0),Kn.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),n=new Hi(this),s=new Hi(e);for(let o=t,a=t;;){if(n.next(o),s.next(o),o=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(a+=n.value.length,n.done||a>=r)return!0}}iter(e=1){return new Hi(this,e)}iterRange(e,t=this.length){return new xl(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let n=this.line(e).from;r=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new wl(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?i.empty:e.length<=32?new it(e):Kn.from(it.split(e,[]))}},it=class i extends te{constructor(e,t=oC(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,n){for(let s=0;;s++){let o=this.text[s],a=n+o.length;if((t?r:a)>=e)return new up(n,a,r,o);n=a+1,r++}}decompose(e,t,r,n){let s=e<=0&&t>=this.length?this:new i(y0(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(n&1){let o=r.pop(),a=fl(s.text,o.text.slice(),0,s.length);if(a.length<=32)r.push(new i(a,o.length+s.length));else{let l=a.length>>1;r.push(new i(a.slice(0,l)),new i(a.slice(l)))}}else r.push(s)}replace(e,t,r){if(!(r instanceof i))return super.replace(e,t,r);[e,t]=nr(this,e,t);let n=fl(this.text,fl(r.text,y0(this.text,0,e)),t),s=this.length+r.length-(t-e);return n.length<=32?new i(n,s):Kn.from(i.split(n,[]),s)}sliceString(e,t=this.length,r=` +`){[e,t]=nr(this,e,t);let n="";for(let s=0,o=0;s<=t&&oe&&o&&(n+=r),es&&(n+=a.slice(Math.max(0,e-s),t-s)),s=l+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],n=-1;for(let s of e)r.push(s),n+=s.length+1,r.length==32&&(t.push(new i(r,n)),r=[],n=-1);return n>-1&&t.push(new i(r,n)),t}},Kn=class i extends te{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,n){for(let s=0;;s++){let o=this.children[s],a=n+o.length,l=r+o.lines-1;if((t?l:a)>=e)return o.lineInner(e,t,r,n);n=a+1,r=l+1}}decompose(e,t,r,n){for(let s=0,o=0;o<=t&&s=o){let u=n&((o<=e?1:0)|(l>=t?2:0));o>=e&&l<=t&&!u?r.push(a):a.decompose(e-o,t-o,r,u)}o=l+1}}replace(e,t,r){if([e,t]=nr(this,e,t),r.lines=s&&t<=a){let l=o.replace(e-s,t-s,r),u=this.lines-o.lines+l.lines;if(l.lines>4&&l.lines>u>>6){let c=this.children.slice();return c[n]=l,new i(c,this.length-(t-e)+r.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=` +`){[e,t]=nr(this,e,t);let n="";for(let s=0,o=0;se&&s&&(n+=r),eo&&(n+=a.sliceString(e-o,t-o,r)),o=l+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof i))return 0;let r=0,[n,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,s+=t){if(n==o||s==a)return r;let l=this.children[n],u=e.children[s];if(l!=u)return r+l.scanIdentical(u,t);r+=l.length+1}}static from(e,t=e.reduce((r,n)=>r+n.length+1,-1)){let r=0;for(let f of e)r+=f.lines;if(r<32){let f=[];for(let p of e)p.flatten(f);return new it(f,t)}let n=Math.max(32,r>>5),s=n<<1,o=n>>1,a=[],l=0,u=-1,c=[];function h(f){let p;if(f.lines>s&&f instanceof i)for(let g of f.children)h(g);else f.lines>o&&(l>o||!l)?(d(),a.push(f)):f instanceof it&&l&&(p=c[c.length-1])instanceof it&&f.lines+p.lines<=32?(l+=f.lines,u+=f.length+1,c[c.length-1]=new it(p.text.concat(f.text),p.length+1+f.length)):(l+f.lines>n&&d(),l+=f.lines,u+=f.length+1,c.push(f))}function d(){l!=0&&(a.push(c.length==1?c[0]:i.from(c,u)),u=-1,l=c.length=0)}for(let f of e)h(f);return d(),a.length==1?a[0]:new i(a,t)}};te.empty=new it([""],0);function oC(i){let e=-1;for(let t of i)e+=t.length+1;return e}function fl(i,e,t=0,r=1e9){for(let n=0,s=0,o=!0;s=t&&(l>r&&(a=a.slice(0,r-n)),n0?1:(e instanceof it?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,n=this.nodes[r],s=this.offsets[r],o=s>>1,a=n instanceof it?n.text.length:n.children.length;if(o==(t>0?a:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(n instanceof it){let l=n.text[o+(t<0?-1:0)];if(this.offsets[r]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=n.children[o+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof it?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},xl=class{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new Hi(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=r?n:t<0?n.slice(n.length-r):n.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},wl=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(te.prototype[Symbol.iterator]=function(){return this.iter()},Hi.prototype[Symbol.iterator]=xl.prototype[Symbol.iterator]=wl.prototype[Symbol.iterator]=function(){return this});var up=class{constructor(e,t,r,n){this.from=e,this.to=t,this.number=r,this.text=n}get length(){return this.to-this.from}};function nr(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function Ne(i,e,t=!0,r=!0){return rC(i,e,t,r)}function aC(i){return i>=56320&&i<57344}function lC(i){return i>=55296&&i<56320}function tg(i,e){let t=i.charCodeAt(e);if(!lC(t)||e+1==i.length)return t;let r=i.charCodeAt(e+1);return aC(r)?(t-55296<<10)+(r-56320)+65536:t}function uC(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function Xk(i){return i<65536?1:2}var cp=/\r\n?|\n/,tt=(function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i})(tt||(tt={})),hi=class i{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-n);s+=a}else{if(r!=tt.Simple&&u>=e&&(r==tt.TrackDel&&ne||r==tt.TrackBefore&&ne))return null;if(u>e||u==e&&t<0&&!a)return e==n||t<0?s:s+l;s+=l}n=u}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return s}touchesRange(e,t=e){for(let r=0,n=0;r=0&&n<=t&&a>=e)return nt?"cover":!0;n=a}return!1}toString(){let e="";for(let t=0;t=0?":"+n:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new i(e)}static create(e){return new i(e)}},ot=class i extends hi{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return hp(this,(t,r,n,s,o)=>e=e.replace(n,n+(r-t),o),!1),e}mapDesc(e,t=!1){return dp(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let n=0,s=0;n=0){t[n]=a,t[n+1]=o;let l=n>>1;for(;r.length0&&ci(r,t,s.text),s.forward(c),a+=c}let u=e[o++];for(;a>1].toJSON()))}return e}static of(e,t,r){let n=[],s=[],o=0,a=null;function l(c=!1){if(!c&&!n.length)return;od||h<0||d>t)throw new RangeError(`Invalid change range ${h} to ${d} (in doc of length ${t})`);let p=f?typeof f=="string"?te.of(f.split(r||cp)):f:te.empty,g=p.length;if(h==d&&g==0)return;ho&&Me(n,h-o,-1),Me(n,d-h,g),ci(s,n,p),o=d}}return u(e),l(!a),a}static empty(e){return new i(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let n=0;na&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;r.length=0&&t<=0&&t==i[n+1]?i[n]+=e:n>=0&&e==0&&i[n]==0?i[n+1]+=t:r?(i[n]+=e,i[n+1]+=t):i.push(e,t)}function ci(i,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)a=i.sections[o++],l=i.sections[o++];e(n,u,s,c,h),n=u,s=c}}}function dp(i,e,t,r=!1){let n=[],s=r?[]:null,o=new Ji(i),a=new Ji(e);for(let l=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let u=Math.min(o.len,a.len);Me(n,u,-1),o.forward(u),a.forward(u)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len=0&&l=0){let u=0,c=o.len;for(;c;)if(a.ins==-1){let h=Math.min(c,a.len);u+=h,c-=h,a.forward(h)}else if(a.ins==0&&a.lenl||o.ins>=0&&o.len>l)&&(a||r.length>u),s.forward2(l),o.forward(l)}}}}var Ji=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?te.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?te.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},Bi=class i{constructor(e,t,r,n){this.from=e,this.to=t,this.flags=r,this.goalColumn=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,t=-1){let r,n;return this.empty?r=n=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),n=e.mapPos(this.to,-1)),r==this.from&&n==this.to?this:new i(r,n,this.flags,this.goalColumn)}extend(e,t=e,r=0){if(e<=this.anchor&&t>=this.anchor)return O.range(e,t,void 0,void 0,r);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return O.range(this.anchor,n,void 0,void 0,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return O.range(e.anchor,e.head)}static create(e,t,r,n){return new i(e,t,r,n)}},O=class i{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:i.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new i(e.ranges.map(t=>Bi.fromJSON(t)),e.main)}static single(e,t=e){return new i([i.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,n=0;nn.from-s.from),t=e.indexOf(r);for(let n=1;ns.head?i.range(l,a):i.range(a,l))}}return new i(e,t)}};function Kk(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}var ig=0,N=class i{constructor(e,t,r,n,s){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=n,this.id=ig++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new i(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:ng),!!e.static,e.enables)}of(e){return new Gn([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gn(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gn(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}};function ng(i,e){return i==e||i.length==e.length&&i.every((t,r)=>t===e[r])}var Gn=class{constructor(e,t,r,n){this.dependencies=e,this.facet=t,this.type=r,this.value=n,this.id=ig++}dynamicSlot(e){var t;let r=this.value,n=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,u=!1,c=[];for(let h of this.dependencies)h=="doc"?l=!0:h=="selection"?u=!0:(((t=e[h.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[h.id]);return{create(h){return h.values[o]=r(h),1},update(h,d){if(l&&d.docChanged||u&&(d.docChanged||d.selection)||fp(h,c)){let f=r(h);if(a?!k0(f,h.values[o],n):!n(f,h.values[o]))return h.values[o]=f,1}return 0},reconfigure:(h,d)=>{let f,p=d.config.address[s];if(p!=null){let g=Ol(d,p);if(this.dependencies.every(b=>b instanceof N?d.facet(b)===h.facet(b):b instanceof pi?d.field(b,!1)==h.field(b,!1):!0)||(a?k0(f=r(h),g,n):n(f=r(h),g)))return h.values[o]=g,0}else f=r(h);return h.values[o]=f,1}}}get extension(){return this}};function k0(i,e,t){if(i.length!=e.length)return!1;for(let r=0;ri[l.id]),n=t.map(l=>l.type),s=r.filter(l=>!(l&1)),o=i[e.id]>>1;function a(l){let u=[];for(let c=0;cr===n),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Ka).find(r=>r.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,n)=>{let s=r.values[t],o=this.updateF(s,n);return this.compareF(s,o)?0:(r.values[t]=o,1)},reconfigure:(r,n)=>{let s=r.facet(Ka),o=n.facet(Ka),a;return(a=s.find(l=>l.field==this))&&a!=o.find(l=>l.field==this)?(r.values[t]=a.create(r),1):n.config.address[this.id]!=null?(r.values[t]=n.field(this),0):(r.values[t]=this.create(r),1)}}}init(e){return[this,Ka.of({field:this,create:e})]}get extension(){return this}},Zi={lowest:4,low:3,default:2,high:1,highest:0};function Us(i){return e=>new $l(e,i)}var Ql={highest:Us(Zi.highest),high:Us(Zi.high),default:Us(Zi.default),low:Us(Zi.low),lowest:Us(Zi.lowest)},$l=class{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}},Sl=class i{of(e){return new eo(this,e)}reconfigure(e){return i.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},eo=class{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}},_l=class i{constructor(e,t,r,n,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=n,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,r){let n=[],s=Object.create(null),o=new Map;for(let d of hC(e,t,o))d instanceof pi?n.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],u=[];for(let d of n)a[d.id]=u.length<<1,u.push(f=>d.slot(f));let c=r?.config.facets;for(let d in s){let f=s[d],p=f[0].facet,g=c&&c[d]||[];if(f.every(b=>b.type==0))if(a[p.id]=l.length<<1|1,ng(g,f))l.push(r.facet(p));else{let b=p.combine(f.map(v=>v.value));l.push(r&&p.compare(b,r.facet(p))?r.facet(p):b)}else{for(let b of f)b.type==0?(a[b.id]=l.length<<1|1,l.push(b.value)):(a[b.id]=u.length<<1,u.push(v=>b.dynamicSlot(v)));a[p.id]=u.length<<1,u.push(b=>cC(b,p,f))}}let h=u.map(d=>d(a));return new i(e,o,h,a,l,s)}};function hC(i,e,t){let r=[[],[],[],[],[]],n=new Map;function s(o,a){let l=n.get(o);if(l!=null){if(l<=a)return;let u=r[l].indexOf(o);u>-1&&r[l].splice(u,1),o instanceof eo&&t.delete(o.compartment)}if(n.set(o,a),Array.isArray(o))for(let u of o)s(u,a);else if(o instanceof eo){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(o.compartment)||o.inner;t.set(o.compartment,u),s(u,a)}else if(o instanceof $l)s(o.inner,o.prec);else if(o instanceof pi)r[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof Gn)r[a].push(o),o.facet.extensions&&s(o.facet.extensions,Zi.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(u==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,a)}}return s(i,Zi.default),r.reduce((o,a)=>o.concat(a))}function qs(i,e){if(e&1)return 2;let t=e>>1,r=i.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;i.status[t]=4;let n=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|n}function Ol(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}var Gk=N.define(),pp=N.define({combine:i=>i.some(e=>e),static:!0}),Yk=N.define({combine:i=>i.length?i[0]:void 0,static:!0}),Qk=N.define(),ex=N.define(),tx=N.define(),ix=N.define({combine:i=>i.length?i[0]:!1}),Ut=class{constructor(e,t){this.type=e,this.value=t}static define(){return new mp}},mp=class{of(e){return new Ut(this,e)}},gp=class{constructor(e){this.map=e}of(e){return new we(this,e)}},we=class i{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new i(this.type,t)}is(e){return this.type==e}static define(e={}){return new gp(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let n of e){let s=n.map(t);s&&r.push(s)}return r}};we.reconfigure=we.define();we.appendConfig=we.define();var Re=class i{constructor(e,t,r,n,s,o){this.startState=e,this.changes=t,this.selection=r,this.effects=n,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,r&&Kk(r,t.newLength),s.some(a=>a.type==i.time)||(this.annotations=s.concat(i.time.of(Date.now())))}static create(e,t,r,n,s,o){return new i(e,t,r,n,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(i.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}};Re.time=Ut.define();Re.userEvent=Ut.define();Re.addToHistory=Ut.define();Re.remote=Ut.define();function dC(i,e){let t=[];for(let r=0,n=0;;){let s,o;if(r=i[r]))s=i[r++],o=i[r++];else if(n=0;n--){let s=r[n](i);s instanceof Re?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Re?i=s[0]:i=rx(e,Yn(s),!1)}return i}function pC(i){let e=i.startState,t=e.facet(tx),r=i;for(let n=t.length-1;n>=0;n--){let s=t[n](i);s&&Object.keys(s).length&&(r=nx(r,vp(e,s,i.changes.newLength),!0))}return r==i?i:Re.create(e,i.changes,i.selection,r.effects,r.annotations,r.scrollIntoView)}var mC=[];function Yn(i){return i==null?mC:Array.isArray(i)?i:[i]}var nt=(function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i})(nt||(nt={})),gC=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,bp;try{bp=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function vC(i){if(bp)return bp.test(i);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||gC.test(t)))return!0}return!1}function bC(i){return e=>{if(!/\S/.test(e))return nt.Space;if(vC(e))return nt.Word;for(let t=0;t-1)return nt.Word;return nt.Other}}var $e=class i{constructor(e,t,r,n,s,o){this.config=e,this.doc=t,this.selection=r,this.values=n,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;an.set(u,l)),t=null),n.set(a.value.compartment,a.value.extension)):a.is(we.reconfigure)?(t=null,r=a.value):a.is(we.appendConfig)&&(t=null,r=Yn(r).concat(a.value));let s;t?s=e.startState.values.slice():(t=_l.resolve(r,n,this),s=new i(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,u)=>u.reconfigure(l,this),null).values);let o=e.startState.facet(pp)?e.newSelection:e.newSelection.asSingle();new i(t,e.newDoc,o,s,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:O.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),n=this.changes(r.changes),s=[r.range],o=Yn(r.effects);for(let a=1;ao.spec.fromJSON(a,l)))}}return i.create({doc:e.doc,selection:O.fromJSON(e.selection),extensions:t.extensions?n.concat([t.extensions]):n})}static create(e={}){let t=_l.resolve(e.extensions||[],new Map),r=e.doc instanceof te?e.doc:te.of((e.doc||"").split(t.staticFacet(i.lineSeparator)||cp)),n=e.selection?e.selection instanceof O?e.selection:O.single(e.selection.anchor,e.selection.head):O.single(0);return Kk(n,r.length),t.staticFacet(pp)||(n=n.asSingle()),new i(t,r,n,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(i.tabSize)}get lineBreak(){return this.facet(i.lineSeparator)||` +`}get readOnly(){return this.facet(ix)}phrase(e,...t){for(let r of this.facet(i.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,n)=>{if(n=="$")return"$";let s=+(n||1);return!s||s>t.length?r:t[s-1]})),e}languageDataAt(e,t,r=-1){let n=[];for(let s of this.facet(Gk))for(let o of s(this,t,r))Object.prototype.hasOwnProperty.call(o,e)&&n.push(o[e]);return n}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return bC(t.length?t[0]:"")}wordAt(e){let{text:t,from:r,length:n}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let l=Ne(t,o,!1);if(s(t.slice(l,o))!=nt.Word)break;o=l}for(;ai.length?i[0]:4});$e.lineSeparator=Yk;$e.readOnly=ix;$e.phrases=N.define({compare(i,e){let t=Object.keys(i),r=Object.keys(e);return t.length==r.length&&t.every(n=>i[n]==e[n])}});$e.languageData=Gk;$e.changeFilter=Qk;$e.transactionFilter=ex;$e.transactionExtender=tx;Sl.reconfigure=we.define();function fo(i,e,t={}){let r={};for(let n of i)for(let s of Object.keys(n)){let o=n[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))r[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let n in e)r[n]===void 0&&(r[n]=e[n]);return r}var Yt=class{eq(e){return this==e}range(e,t=e){return yp.create(e,t,this)}};Yt.prototype.startSide=Yt.prototype.endSide=0;Yt.prototype.point=!1;Yt.prototype.mapMode=tt.TrackDel;function rg(i,e){return i==e||i.constructor==e.constructor&&i.eq(e)}var yp=class sx{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new sx(e,t,r)}};function kp(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}var xp=class i{constructor(e,t,r,n){this.from=e,this.to=t,this.value=r,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,n=0){let s=r?this.to:this.from;for(let o=n,a=s.length;;){if(o==a)return o;let l=o+a>>1,u=s[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-t;if(l==o)return u>=0?o:a;u>=0?a=l:o=l+1}}between(e,t,r,n){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(r,1e9,!1,s);sf||d==f&&u.startSide>0&&u.endSide<=0)continue;(f-d||u.endSide-u.startSide)<0||(o<0&&(o=d),u.point&&(a=Math.max(a,f-d)),r.push(u),n.push(d-o),s.push(f-o))}return{mapped:r.length?new i(n,s,r,a):null,pos:o}}},ge=class i{constructor(e,t,r,n){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=n}static create(e,t,r,n){return new i(e,t,r,n)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:n=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(r&&(t=t.slice().sort(kp)),this.isEmpty)return t.length?i.of(t):this;let a=new Il(this,null,-1).goto(0),l=0,u=[],c=new rr;for(;a.value||l=0){let h=t[l++];c.addInner(h.from,h.to,h.value)||u.push(h)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||sa.to||s=s&&e<=s+o.length&&o.between(s,e-s,t-s,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return to.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return to.from(e).goto(t)}static compare(e,t,r,n,s=-1){let o=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),a=t.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),l=x0(o,a,r),u=new Fi(o,l,s),c=new Fi(a,l,s);r.iterGaps((h,d,f)=>w0(u,h,c,d,f,n)),r.empty&&r.length==0&&w0(u,0,c,0,0,n)}static eq(e,t,r=0,n){n==null&&(n=999999999);let s=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=x0(s,o),l=new Fi(s,a,0).goto(r),u=new Fi(o,a,0).goto(r);for(;;){if(l.to!=u.to||!wp(l.active,u.active)||l.point&&(!u.point||!rg(l.point,u.point)))return!1;if(l.to>n)return!0;l.next(),u.next()}}static spans(e,t,r,n,s=-1){let o=new Fi(e,null,s).goto(t),a=t,l=o.openStart;for(;;){let u=Math.min(o.to,r);if(o.point){let c=o.activeForPoint(o.to),h=o.pointFroma&&(n.span(a,u,o.active,l),l=o.openEnd(u));if(o.to>r)return l+(o.point&&o.to>r?1:0);a=o.to,o.next()}}static of(e,t=!1){let r=new rr;for(let n of e instanceof yp?[e]:t?yC(e):e)r.add(n.from,n.to,n.value);return r.finish()}static join(e){if(!e.length)return i.empty;let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let n=e[r];n!=i.empty;n=n.nextLayer)t=new i(n.chunkPos,n.chunk,t,Math.max(n.maxPoint,t.maxPoint));return t}};ge.empty=new ge([],[],null,-1);function yC(i){if(i.length>1)for(let e=i[0],t=1;t0)return i.slice().sort(kp);e=r}return i}ge.empty.nextLayer=ge.empty;var rr=class i{finishChunk(e){this.chunks.push(new xp(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new i)).add(e,t,r)}addInner(e,t,r){let n=e-this.lastTo||r.startSide-this.last.endSide;if(n<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return n<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner(ge.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=ge.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function x0(i,e,t){let r=new Map;for(let s of i)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&n.push(new Il(o,t,r,s));return n.length==1?n[0]:new i(n)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)jf(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)jf(this.heap,r);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),jf(this.heap,0)}}};function jf(i,e){for(let t=i[e];;){let r=(e<<1)+1;if(r>=i.length)break;let n=i[r];if(r+1=0&&(n=i[r+1],r++),t.compare(n)<0)break;i[r]=t,i[e]=n,e=r}}var Fi=class{constructor(e,t,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=to.from(e,t,r)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Ga(this.active,e),Ga(this.activeTo,e),Ga(this.activeRank,e),this.minActive=$0(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:n,rank:s}=this.cursor;for(;t0;)t++;Ya(this.active,t,r),Ya(this.activeTo,t,n),Ya(this.activeRank,t,s),e&&Ya(e,t,this.cursor.from),this.minActive=$0(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>e){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),r&&Ga(r,n)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&r[n]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}};function w0(i,e,t,r,n,s){i.goto(e),t.goto(r);let o=r+n,a=r,l=r-e,u=!!s.boundChange;for(let c=!1;;){let h=i.to+l-t.to,d=h||i.endSide-t.endSide,f=d<0?i.to+l:t.to,p=Math.min(f,o);if(i.point||t.point?(i.point&&t.point&&rg(i.point,t.point)&&wp(i.activeForPoint(i.to),t.activeForPoint(t.to))||s.comparePoint(a,p,i.point,t.point),c=!1):(c&&s.boundChange(a),p>a&&!wp(i.active,t.active)&&s.compareRange(a,p,i.active,t.active),u&&po)break;a=f,d<=0&&i.next(),d>=0&&t.next()}}function wp(i,e){if(i.length!=e.length)return!1;for(let t=0;t=e;r--)i[r+1]=i[r];i[e]=t}function $0(i,e){let t=-1,r=1e9;for(let n=0;n=e)return n;if(n==i.length)break;s+=i.charCodeAt(n)==9?t-s%t:1,n=Ne(i,n)}return r===!0?-1:i.length}var $p="\u037C",S0=typeof Symbol>"u"?"__"+$p:Symbol.for($p),Sp=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),_0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Lt=class{constructor(e,t){this.rules=[];let{finish:r}=t||{};function n(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,l,u){let c=[],h=/^@(\w+)\b/.exec(o[0]),d=h&&h[1]=="keyframes";if(h&&a==null)return l.push(o[0]+";");for(let f in a){let p=a[f];if(/&/.test(f))s(f.split(/,\s*/).map(g=>o.map(b=>g.replace(/&/,b))).reduce((g,b)=>g.concat(b)),p,l);else if(p&&typeof p=="object"){if(!h)throw new RangeError("The value of a property ("+f+") should be a primitive value.");s(n(f),p,c,d)}else p!=null&&c.push(f.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(c.length||d)&&l.push((r&&!h&&!u?o.map(r):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)s(n(o),e[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=_0[S0]||1;return _0[S0]=e+1,$p+e.toString(36)}static mount(e,t,r){let n=e[Sp],s=r&&r.nonce;n?s&&n.setNonce(s):n=new _p(e,s),n.mount(Array.isArray(t)?t:[t],e)}},O0=new Map,_p=class{constructor(e,t){let r=e.ownerDocument||e,n=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let s=O0.get(r);if(s)return e[Sp]=s;this.sheet=new n.CSSStyleSheet,O0.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Sp]=this}mount(e,t){let r=this.sheet,n=0,s=0;for(let o=0;o-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,a),r)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},xC=typeof navigator<"u"&&/Mac/.test(navigator.platform),wC=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(Se=0;Se<10;Se++)mi[48+Se]=mi[96+Se]=String(Se);var Se;for(Se=1;Se<=24;Se++)mi[Se+111]="F"+Se;var Se;for(Se=65;Se<=90;Se++)mi[Se]=String.fromCharCode(Se+32),io[Se]=String.fromCharCode(Se);var Se;for(Qa in mi)io.hasOwnProperty(Qa)||(io[Qa]=mi[Qa]);var Qa;function $C(i){var e=xC&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||wC&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?io:mi)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}var Fe=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Op=typeof document<"u"?document:{documentElement:{style:{}}},Ip=/Edge\/(\d+)/.exec(Fe.userAgent),ox=/MSIE \d/.test(Fe.userAgent),Cp=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Fe.userAgent),eu=!!(ox||Cp||Ip),I0=!eu&&/gecko\/(\d+)/i.test(Fe.userAgent),Bf=!eu&&/Chrome\/(\d+)/.exec(Fe.userAgent),C0="webkitFontSmoothing"in Op.documentElement.style,Tp=!eu&&/Apple Computer/.test(Fe.vendor),T0=Tp&&(/Mobile\/\w+/.test(Fe.userAgent)||Fe.maxTouchPoints>2),D={mac:T0||/Mac/.test(Fe.platform),windows:/Win/.test(Fe.platform),linux:/Linux|X11/.test(Fe.platform),ie:eu,ie_version:ox?Op.documentMode||6:Cp?+Cp[1]:Ip?+Ip[1]:0,gecko:I0,gecko_version:I0?+(/Firefox\/(\d+)/.exec(Fe.userAgent)||[0,0])[1]:0,chrome:!!Bf,chrome_version:Bf?+Bf[1]:0,ios:T0,android:/Android\b/.test(Fe.userAgent),webkit:C0,webkit_version:C0?+(/\bAppleWebKit\/(\d+)/.exec(Fe.userAgent)||[0,0])[1]:0,safari:Tp,safari_version:Tp?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Fe.userAgent)||[0,0])[1]:0,tabSize:Op.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function sg(i,e){for(let t in i)t=="class"&&e.class?e.class+=" "+i.class:t=="style"&&e.style?e.style+=";"+i.style:e[t]=i[t];return e}var Cl=Object.create(null);function og(i,e,t){if(i==e)return!0;i||(i=Cl),e||(e=Cl);let r=Object.keys(i),n=Object.keys(e);if(r.length-0!=n.length-0)return!1;for(let s of r)if(s!=t&&(n.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function SC(i,e){for(let t=i.attributes.length-1;t>=0;t--){let r=i.attributes[t].name;e[r]==null&&i.removeAttribute(r)}for(let t in e){let r=e[t];t=="style"?i.style.cssText=r:i.getAttribute(t)!=r&&i.setAttribute(t,r)}}function E0(i,e,t){let r=!1;if(e)for(let n in e)t&&n in t||(r=!0,n=="style"?i.style.cssText="":i.removeAttribute(n));if(t)for(let n in t)e&&e[n]==t[n]||(r=!0,n=="style"?i.style.cssText=t[n]:i.setAttribute(n,t[n]));return r}function _C(i){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new Ki(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,n;if(e.isBlockGap)r=-5e8,n=4e8;else{let{start:s,end:o}=ax(e,t);r=(s?t?-3e8:-1:5e8)-1,n=(o?t?2e8:1:-6e8)+1}return new Ki(e,r,n,t,e.widget||null,!0)}static line(e){return new ro(e)}static set(e,t=!1){return ge.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};G.none=ge.empty;var no=class i extends G{constructor(e){let{start:t,end:r}=ax(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?sg(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Cl}eq(e){return this==e||e instanceof i&&this.tagName==e.tagName&&og(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}};no.prototype.point=!1;var ro=class i extends G{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof i&&this.spec.class==e.spec.class&&og(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}};ro.prototype.mapMode=tt.TrackBefore;ro.prototype.point=!0;var Ki=class i extends G{constructor(e,t,r,n,s,o){super(t,r,s,e),this.block=n,this.isReplace=o,this.mapMode=n?t<=0?tt.TrackBefore:tt.TrackAfter:tt.TrackDel}get type(){return this.startSide!=this.endSide?ze.WidgetRange:this.startSide<=0?ze.WidgetBefore:ze.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof i&&OC(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}};Ki.prototype.point=!0;function ax(i,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=i;return t==null&&(t=i.inclusive),r==null&&(r=i.inclusive),{start:t??e,end:r??e}}function OC(i,e){return i==e||!!(i&&e&&i.compare(e))}function Qn(i,e,t,r=0){let n=t.length-1;n>=0&&t[n]+r>=i?t[n]=Math.max(t[n],e):t.push(i,e)}var Tl=class i extends Yt{constructor(e,t,r){super(),this.tagName=e,this.attributes=t,this.rank=r}eq(e){return e==this||e instanceof i&&this.tagName==e.tagName&&og(this.attributes,e.attributes)}static create(e){return new i(e.tagName,e.attributes||Cl,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return ge.of(e,t)}};Tl.prototype.startSide=Tl.prototype.endSide=-1;function so(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function Ep(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function Hs(i,e){if(!e.anchorNode)return!1;try{return Ep(i,e.anchorNode)}catch{return!1}}function pl(i){return i.nodeType==3?oo(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function Ws(i,e,t,r){return t?A0(i,e,t,r,-1)||A0(i,e,t,r,1):!1}function vi(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function El(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function A0(i,e,t,r,n){for(;;){if(i==t&&e==r)return!0;if(e==(n<0?0:Qt(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=vi(i)+(n<0?0:1),i=s}else if(i.nodeType==1){if(i=i.childNodes[e+(n<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=n<0?Qt(i):0}else return!1}}function Qt(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function Al(i,e){let{left:t,right:r}=i;if(t==r)return i;let n=e?t:r;return{left:n,right:n,top:i.top,bottom:i.bottom}}function IC(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function lx(i,e){let t=e.width/i.offsetWidth,r=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-i.offsetHeight)<1)&&(r=1),{scaleX:t,scaleY:r}}function CC(i,e,t,r,n,s,o,a){let l=i.ownerDocument,u=l.defaultView||window;for(let c=i,h=!1;c&&!h;)if(c.nodeType==1){let d,f=c==l.body,p=1,g=1;if(f)d=IC(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(h=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let x=c.getBoundingClientRect();({scaleX:p,scaleY:g}=lx(c,x)),d={left:x.left,right:x.left+c.clientWidth*p,top:x.top,bottom:x.top+c.clientHeight*g}}let b=0,v=0;if(n=="nearest")e.top0&&e.bottom>d.bottom+v&&(v=e.bottom-d.bottom+o)):e.bottom>d.bottom-o&&(v=e.bottom-d.bottom+o,t<0&&e.top-v0&&e.right>d.right+b&&(b=e.right-d.right+s)):e.right>d.right-s&&(b=e.right-d.right+s,t<0&&e.leftd.bottom||e.leftd.right)&&(e={left:Math.max(e.left,d.left),right:Math.min(e.right,d.right),top:Math.max(e.top,d.top),bottom:Math.min(e.bottom,d.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function ux(i,e=!0){let t=i.ownerDocument,r=null,n=null;for(let s=i.parentNode;s&&!(s==t.body||(!e||r)&&n);)if(s.nodeType==1)!n&&s.scrollHeight>s.clientHeight&&(n=s),e&&!r&&s.scrollWidth>s.clientWidth&&(r=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:r,y:n}}var Ap=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?Qt(t):0),r,Math.min(e.focusOffset,r?Qt(r):0))}set(e,t,r,n){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=n}},ji=null;D.safari&&D.safari_version>=26&&(ji=!1);function cx(i){if(i.setActive)return i.setActive();if(ji)return i.focus(ji);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(ji==null?{get preventScroll(){return ji={preventScroll:!0},!0}}:void 0),!ji){ji=!1;for(let t=0;tMath.max(0,i.document.documentElement.scrollHeight-i.innerHeight-4):i.scrollTop>Math.max(1,i.scrollHeight-i.clientHeight-4)}function dx(i,e){for(let t=i,r=e;;){if(t.nodeType==3&&r>0)return{node:t,offset:r};if(t.nodeType==1&&r>0){if(t.contentEditable=="false")return null;t=t.childNodes[r-1],r=Qt(t)}else if(t.parentNode&&!El(t))r=vi(t),t=t.parentNode;else return null}}function fx(i,e){for(let t=i,r=e;;){if(t.nodeType==3&&r=t){if(a.level==r)return o;(s<0||(n!=0?n<0?a.fromt:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}};function gx(i,e){if(i.length!=e.length)return!1;for(let t=0;t=0;g-=3)if(Dt[g+1]==-f){let b=Dt[g+2],v=b&2?n:b&4?b&1?s:n:0;v&&(fe[h]=fe[Dt[g]]=v),a=g;break}}else{if(Dt.length==189)break;Dt[a++]=h,Dt[a++]=d,Dt[a++]=l}else if((p=fe[h])==2||p==1){let g=p==n;l=g?0:1;for(let b=a-3;b>=0;b-=3){let v=Dt[b+2];if(v&2)break;if(g)Dt[b+2]|=2;else{if(v&4)break;Dt[b+2]|=4}}}}}function NC(i,e,t,r){for(let n=0,s=r;n<=t.length;n++){let o=n?t[n-1].to:i,a=nl;)p==b&&(p=t[--g].from,b=g?t[g-1].to:i),fe[--p]=f;l=c}else s=u,l++}}}function zp(i,e,t,r,n,s,o){let a=r%2?2:1;if(r%2==n%2)for(let l=e,u=0;ll&&o.push(new mt(l,g.from,f));let b=g.direction==Gi!=!(f%2);Pp(i,b?r+1:r,n,g.inner,g.from,g.to,o),l=g.to}p=g.to}else{if(p==t||(c?fe[p]!=a:fe[p]==a))break;p++}d?zp(i,l,p,r+1,n,d,o):le;){let c=!0,h=!1;if(!u||l>s[u-1].to){let g=fe[l-1];g!=a&&(c=!1,h=g==16)}let d=!c&&a==1?[]:null,f=c?r:r+1,p=l;e:for(;;)if(u&&p==s[u-1].to){if(h)break e;let g=s[--u];if(!c)for(let b=g.from,v=u;;){if(b==e)break e;if(v&&s[v-1].to==b)b=s[--v].from;else{if(fe[b-1]==a)break e;break}}if(d)d.push(g);else{g.tofe.length;)fe[fe.length]=256;let r=[],n=e==Gi?0:1;return Pp(i,n,n,t,0,i.length,r),r}function vx(i){return[new mt(0,i,0)]}var bx="";function UC(i,e,t,r,n){var s;let o=r.head-i.from,a=mt.find(e,o,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),l=e[a],u=l.side(n,t);if(o==u){let d=a+=n?1:-1;if(d<0||d>=e.length)return null;l=e[a=d],o=l.side(!n,t),u=l.side(n,t)}let c=Ne(i.text,o,l.forward(n,t));(cl.to)&&(c=u),bx=i.text.slice(Math.min(o,c),Math.max(o,c));let h=a==(n?e.length-1:0)?null:e[a+(n?1:-1)];return h&&c==u&&h.level+(n?0:1)i.some(e=>e)}),Ox=N.define({combine:i=>i.some(e=>e)}),Ix=N.define(),Vs=class i{constructor(e,t,r,n,s,o=!1){this.range=e,this.y=t,this.x=r,this.yMargin=n,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new i(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new i(O.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},el=we.define({map:(i,e)=>i.map(e)}),Cx=we.define();function Rt(i,e,t){let r=i.facet(wx);r.length?r[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}var Kt=N.define({combine:i=>i.length?i[0]:!0}),jC=0,Hn=N.define({combine(i){return i.filter((e,t)=>{for(let r=0;r{let l=[];return o&&l.push(tu.of(u=>{let c=u.plugin(a);return c?o(c):G.none})),s&&l.push(s(a)),l})}static fromClass(e,t){return i.define((r,n)=>new e(r,n),t)}},Xs=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(r){if(Rt(t.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Rt(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){Rt(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}},Tx=N.define(),cg=N.define(),tu=N.define(),Ex=N.define(),hg=N.define(),mo=N.define(),Ax=N.define();function z0(i,e){let t=i.state.facet(Ax);if(!t.length)return t;let r=t.map(s=>s instanceof Function?s(i):s),n=[];return ge.spans(r,e.from,e.to,{point(){},span(s,o,a,l){let u=s-e.from,c=o-e.from,h=n;for(let d=a.length-1;d>=0;d--,l--){let f=a[d].spec.bidiIsolate,p;if(f==null&&(f=LC(e.text,u,c)),l>0&&h.length&&(p=h[h.length-1]).to==u&&p.direction==f)p.to=c,h=p.inner;else{let g={from:u,to:c,direction:f,inner:[]};h.push(g),h=g.inner}}}}),n}var Dx=N.define();function zx(i){let e=0,t=0,r=0,n=0;for(let s of i.state.facet(Dx)){let o=s(i);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(n=Math.max(n,o.bottom)))}return{left:e,right:t,top:r,bottom:n}}var Zs=N.define(),$t=class i{constructor(e,t,r,n){this.fromA=e,this.toA=t,this.fromB=r,this.toB=n}join(e){return new i(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,r=this;for(;t>0;t--){let n=e[t-1];if(!(n.fromA>r.toA)){if(n.toAn.push(new $t(s,o,a,l))),this.changedRanges=n}static create(e,t,r){return new i(e,t,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},BC=[],ye=class{constructor(e,t,r=0){this.dom=e,this.length=t,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return BC}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&SC(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let r=t;for(let n of this.children){if(n==e)return r;r+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t,r){return null}domPosFor(e,t){let r=vi(this.dom),n=this.length?e>0:t>0;return new Nt(this.parent.dom,r+(n?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof or)return e;return null}static get(e){return e.cmTile}},sr=class extends ye{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,r=null,n,s=e?.node==t?e:null,o=0;for(let a of this.children){if(a.sync(e),o+=a.length+a.breakAfter,n=r?r.nextSibling:t.firstChild,s&&n!=a.dom&&(s.written=!0),a.dom.parentNode==t)for(;n&&n!=a.dom;)n=P0(n);else t.insertBefore(a.dom,n);r=a.dom}for(n=r?r.nextSibling:t.firstChild,s&&n&&(s.written=!0);n;)n=P0(n);this.length=o}};function P0(i){let e=i.nextSibling;return i.parentNode.removeChild(i),e}var or=class extends sr{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=ye.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],r=this,n=0,s=0;;)if(n==r.children.length){if(!t.length)return;r=r.parent,r.breakAfter&&s++,n=t.pop()}else{let o=r.children[n++];if(o instanceof Gt)t.push(n),r=o,n=0;else{let a=s+o.length,l=e(o,s);if(l!==void 0)return l;s=a+o.breakAfter}}}resolveBlock(e,t){let r,n=-1,s,o=-1;if(this.blockTiles((a,l)=>{let u=l+a.length;if(e>=l&&e<=u){if(a.isWidget()&&t>=-1&&t<=1){if(a.flags&32)return!0;a.flags&16&&(r=void 0)}(le||e==l&&(t>1?a.length:a.covers(-1)))&&(!s||!a.isWidget()&&s.isWidget())&&(s=a,o=e-l)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&t<0||!s?{tile:r,offset:n}:{tile:s,offset:o}}},Gt=class i extends sr{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let r=new i(t||document.createElement(e.tagName),e);return t||(r.flags|=4),r}},ar=class i extends sr{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,r){let n=new i(t||document.createElement("div"),e);return(!t||!r)&&(n.flags|=4),n}get domAttrs(){return this.attrs}resolveInline(e,t,r){let n=null,s=-1,o=null,a=-1;function l(c,h){for(let d=0,f=0;d=h&&(p.isComposite()?l(p,h-f):(!o||o.isHidden&&(t>0&&!(o.flags&32)||r&&FC(o,p)))&&(g>h||p.flags&32)?(o=p,a=h-f):(fn&&(e=n);let s=e,o=e,a=0;e==0&&t<0||e==n&&t>=0?D.chrome||D.gecko||(e?(s--,a=1):o=0)?0:l.length-1];return D.safari&&!a&&u.width==0&&(u=Array.prototype.find.call(l,c=>c.width)||u),r==null?u:Al(u,(a?a>0:t<0)==r)}static of(e,t){let r=new i(t||document.createTextNode(e),e);return t||(r.flags|=2),r}},Yi=class i extends ye{constructor(e,t,r,n){super(e,t,n),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,r){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;if(r)return Al(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let a=this.flags&16?!0:this.flags&32?!1:e>0;for(let l=a?s.length-1:0;o=s[l],!(e>0?l==0:l==s.length-1||o.top0==r)}},Np=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,r){let{tile:n,index:s,beforeBreak:o,parents:a}=this;for(;e||t>0;)if(n.isComposite())if(o){if(!e)break;r&&r.break(),e--,o=!1}else if(s==n.children.length){if(!e&&!a.length)break;r&&r.leave(n),o=!!n.breakAfter,{tile:n,index:s}=a.pop(),s++}else{let l=n.children[s],u=l.breakAfter;(t>0?l.length<=e:l.length=0;a--){let l=t.marks[a],u=n.lastChild;if(u instanceof Ve&&u.mark.eq(l.mark))u.dom!=l.dom&&u.setDOM(Zf(l.dom)),n=u;else{if(this.cache.reused.get(l)){let h=ye.get(l.dom);h&&h.setDOM(Zf(l.dom))}let c=Ve.of(l.mark,l.dom);n.append(c),n=c}this.cache.reused.set(l,2)}let s=ye.get(e.text);s&&this.cache.reused.set(s,2);let o=new qi(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,n.append(o)}addInlineWidget(e,t,r){let n=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);n||this.flushBuffer();let s=this.ensureMarks(t,r);!n&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,r){this.flushBuffer(),this.ensureMarks(t,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var r;e||(e=Px);let n=ar.start(e,t||((r=this.cache.find(ar))===null||r===void 0?void 0:r.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var r;let n=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],a;if(t>0&&(a=n.lastChild)&&a instanceof Ve&&a.mark.eq(o))n=a,t--;else{let l=Ve.of(o,(r=this.cache.find(Ve,u=>u.mark.eq(o)))===null||r===void 0?void 0:r.dom);n.append(l),n=l,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!M0(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(D.ios&&M0(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Ff,0,32)||new Yi(Ff.toDOM(),0,Ff,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to=this.pos){let t=e.rank*102+e.value.rank,r=new Rp(e.from,e.to,e.value,t),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-r.rank||this.wrappers[n-1].to-r.to)<0;)n--;this.wrappers.splice(n,0,r)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let r of this.wrappers){let n=t.lastChild;if(r.fromo.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);t.append(s),t=s}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),r=this.cache.find(lr,void 0,1);return r&&(r.flags=t),r||new lr(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},Lp=class{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:n,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=n;let a=this.textOff=Math.min(e,n.length);return s?null:n.slice(0,a)}let t=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,t);return this.textOff=t,r}},zl=[Yi,ar,qi,Ve,lr,Gt,or];for(let i=0;i[]),this.index=zl.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,r=this.buckets[t];r.length<6?r.push(e):r[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,r=2){let n=e.bucket,s=this.buckets[n],o=this.index[n];for(let a=0;a{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,t){let r=t&&this.getCompositionContext(t.text);for(let n=0,s=0,o=0;;){let a=on){let u=l-n;this.preserve(u,!o,!a),n=l,s+=u}if(!a)break;t&&a.fromA<=t.range.fromA&&a.toA>=t.range.toA?(this.forward(a.fromA,t.range.fromA,t.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(l-a);else{let u=l>0||a{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Ve&&n.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?n.length&&(n.length=s=0):o instanceof Ve&&(n.shift(),s=Math.min(s,n.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let r=null,n=this.builder,s=-1,o=ge.spans(this.decorations,e,t,{point:(a,l,u,c,h,d)=>{if(u instanceof Ki){if(this.disallowBlockEffectsFor[d]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(a).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=c.length,h>c.length)n.continueWidget(l-a);else{let f=u.widget||(u.block?bi.block:bi.inline),p=qC(u),g=this.cache.findWidget(f,l-a,p)||Yi.of(f,this.view,l-a,p);u.block?(u.startSide>0&&n.addLineStartIfNotCovered(r),n.addBlockWidget(g)):(n.ensureLine(r),n.addInlineWidget(g,c,h))}r=null}else r=HC(r,u);l>a&&this.text.skip(l-a)},span:(a,l,u,c)=>{for(let h=a;h-1&&(this.openWidget=o>s),this.openWidget||n.addLineStartIfNotCovered(r),this.openMarks=o}forward(e,t,r=1){t-e<=10?this.old.advance(t-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let t=[],r=null;for(let n=e.parentNode;;n=n.parentNode){let s=ye.get(n);if(n==this.view.contentDOM)break;s instanceof Ve?t.push(s):s?.isLine()?r=s:s instanceof Gt||(n.nodeName=="DIV"&&!r&&n!=this.view.contentDOM?r=new ar(n,Px):r||t.push(Ve.of(new no({tagName:n.nodeName.toLowerCase(),attributes:_C(n)}),n)))}return{line:r,marks:t}}};function M0(i,e){let t=r=>{for(let n of r.children)if((e?n.isText():n.length)||t(n))return!0;return!1};return t(i)}function qC(i){let e=i.isReplace?(i.startSide<0?64:0)|(i.endSide>0?128:0):i.startSide>0?32:16;return i.block&&(e|=256),e}var Px={class:"cm-line"};function HC(i,e){let t=e.spec.attributes,r=e.spec.class;return!t&&!r||(i||(i={class:"cm-line"}),t&&sg(t,i),r&&(i.class+=" "+r)),i}function WC(i){let e=[];for(let t=i.parents.length;t>1;t--){let r=t==i.parents.length?i.tile:i.parents[t].tile;r instanceof Ve&&e.push(r.mark)}return e}function Zf(i){let e=ye.get(i);return e&&e.setDOM(i.cloneNode()),i}var bi=class extends gi{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};bi.inline=new bi("span");bi.block=new bi("div");var Ff=new class extends gi{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}},Pl=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=G.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new or(e,e.contentDOM),this.updateInner([new $t(0,0,0,e.state.doc.length)],null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?n=this.domChanged.newSel.head:!eT(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let s=n>-1?XC(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:c,to:h}=this.hasComposition;r=new $t(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(D.ie||D.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.blockWrappers;this.updateDeco();let l=GC(o,this.decorations,e.changes);l.length&&(r=$t.extendWithRanges(r,l));let u=YC(a,this.blockWrappers,e.changes);return u.length&&(r=$t.extendWithRanges(r,u)),s&&!r.some(c=>c.fromA<=s.range.fromA&&c.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(t||e.length){let o=this.tile,a=new Bp(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&ye.get(t.text)&&a.cache.reused.set(ye.get(t.text),2),this.tile=a.run(e,t),Zp(o,a.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=D.chrome||D.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let n=[];if(this.view.viewport.from||this.view.viewport.to-1)&&Hs(r,this.view.observer.selectionRange)&&!(n&&r.contains(n));if(!(s||t||o))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,u,c;if(l.empty?c=u=this.inlineDOMNearPos(l.anchor,l.assoc||1):(c=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),u=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),D.gecko&&l.empty&&!this.hasComposition&&VC(u)){let d=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(d,u.node.childNodes[u.offset]||null)),u=c=new Nt(d,0),a=!0}let h=this.view.observer.selectionRange;(a||!h.focusNode||(!Ws(u.node,u.offset,h.anchorNode,h.anchorOffset)||!Ws(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{D.android&&D.chrome&&r.contains(h.focusNode)&&QC(h.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let d=so(this.view.root);if(d)if(l.empty){if(D.gecko){let f=JC(u.node,u.offset);if(f&&f!=3){let p=(f==1?dx:fx)(u.node,u.offset);p&&(u=new Nt(p.node,p.offset))}}d.collapse(u.node,u.offset),l.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=l.bidiLevel)}else if(d.extend){d.collapse(u.node,u.offset);try{d.extend(c.node,c.offset)}catch{}}else{let f=document.createRange();l.anchor>l.head&&([u,c]=[c,u]),f.setEnd(c.node,c.offset),f.setStart(u.node,u.offset),d.removeAllRanges(),d.addRange(f)}o&&this.view.root.activeElement==r&&(r.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(u,c)),this.impreciseAnchor=u.precise?null:new Nt(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new Nt(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Ws(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=so(e.root),{anchorNode:n,anchorOffset:s}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let l=this.coordsAt(t.head,-1),u=this.coordsAt(t.head,1);if(!l||!u||l.bottom>u.top)return;let c=this.domAtPos(t.head+t.assoc,t.assoc);r.collapse(c.node,c.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=t.from&&r.collapse(n,s)}posFromDOM(e,t){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let n=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[t];else{let o=Qt(e)==0?0:t==0?-1:1;for(;;){let a=e.parentNode;if(a==r.dom)break;o==0&&a.firstChild!=a.lastChild&&(e==a.firstChild?o=-1:o=1),e=a}o<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return n;for(;s&&!ye.get(s);)s=s.nextSibling;if(!s)return n+r.length;for(let o=0,a=n;;o++){let l=r.children[o];if(l.dom==s)return a;a+=l.length+l.breakAfter}}else return r.isText()?e==r.dom?n+t:n+(t?r.length:0):n}domAtPos(e,t){let{tile:r,offset:n}=this.tile.resolveBlock(e,t);return r.isWidget()?r.domPosFor(n,t):r.domIn(n,t)}inlineDOMNearPos(e,t){let r,n=-1,s=!1,o,a=-1,l=!1;return this.tile.blockTiles((u,c)=>{if(u.isWidget()){if(u.flags&32&&c>=e)return!0;u.flags&16&&(s=!0)}else{let h=c+u.length;if(c<=e&&(r=u,n=e-c,s=h=e&&!o&&(o=u,a=e-c,l=c>e),c>e&&o)return!0}}),!r&&!o?this.domAtPos(e,t):(s&&o?r=null:l&&r&&(o=null),r&&t<0||!o?r.domIn(n,t):o.domIn(a,t))}coordsAt(e,t,r){let{tile:n,offset:s}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof Js?null:n.coordsInWidget(s,t,!0):n.coordsIn(s,t,r)}lineAt(e,t){let{tile:r}=this.tile.resolveBlock(e,t);return r.isLine()?r:null}coordsForChar(e){let{tile:t,offset:r}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function n(s,o){if(s.isComposite())for(let a of s.children){if(a.length>=o){let l=n(a,o);if(l)return l}if(o-=a.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==be.LTR,u=0,c=(h,d,f)=>{for(let p=0;pn);p++){let g=h.children[p],b=d+g.length,v=g.dom.getBoundingClientRect(),{height:x}=v;if(f&&!p&&(u+=v.top-f.top),g instanceof Gt)b>r&&c(g,d,v);else if(d>=r&&(u>0&&t.push(-u),t.push(x+u),u=0,o)){let $=g.dom.lastChild,R=$?pl($):[];if(R.length){let A=R[R.length-1],P=l?A.right-v.left:v.right-A.left;P>a&&(a=P,this.minWidth=s,this.minWidthFrom=d,this.minWidthTo=b)}}f&&p==h.children.length-1&&(u+=f.bottom-v.bottom),d=b+g.breakAfter}};return c(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?be.RTL:be.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let a=0,l;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let c=pl(u.dom);if(c.length!=1)return;a+=c[0].width,l=c[0].height}if(a)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:a/o.length,textHeight:l}}});if(e)return e;let t=document.createElement("div"),r,n,s;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let o=pl(t.firstChild)[0];r=t.getBoundingClientRect().height,n=o&&o.width?o.width/27:7,s=o&&o.height?o.height:r,t.remove()}),{lineHeight:r,charWidth:n,textHeight:s}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,n=0;;n++){let s=n==t.viewports.length?null:t.viewports[n],o=s?s.from-1:this.view.state.doc.length;if(o>r){let a=(t.lineBlockAt(o).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(G.replace({widget:new Js(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!s)break;r=s.to+1}return G.set(e)}updateDeco(){let e=1,t=this.view.state.facet(tu).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,n=this.view.state.facet(hg).map((s,o)=>{let a=typeof s=="function";return a&&(r=!0),a?s(this.view):s});for(n.length&&(this.dynamicDecorationMap[e++]=r,t.push(ge.join(n))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];etypeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let u=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=u.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let u of this.view.state.facet(Ix))try{if(u(this.view,e.range,e))return!0}catch(c){Rt(this.view.state,c,"scroll handler")}let{range:t}=e,r=this.coordsAt(t.head,t.assoc||(t.head>t.anchor?-1:1)),n;if(!r)return;!t.empty&&(n=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,n.left),top:Math.min(r.top,n.top),right:Math.max(r.right,n.right),bottom:Math.max(r.bottom,n.bottom)});let s=zx(this.view),o={left:r.left-s.left,top:r.top-s.top,right:r.right+s.right,bottom:r.bottom+s.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;if(CC(this.view.scrollDOM,o,t.head1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.bottomr.isWidget()||r.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Zp(this.tile)}};function Zp(i,e){let t=e?.get(i);if(t!=1){t==null&&i.destroy();for(let r of i.children)Zp(r,e)}}function VC(i){return i.node.nodeType==1&&i.node.firstChild&&(i.offset==0||i.node.childNodes[i.offset-1].contentEditable=="false")&&(i.offset==i.node.childNodes.length||i.node.childNodes[i.offset].contentEditable=="false")}function Mx(i,e){let t=i.observer.selectionRange;if(!t.focusNode)return null;let r=dx(t.focusNode,t.focusOffset),n=fx(t.focusNode,t.focusOffset),s=r||n;if(n&&r&&n.node!=r.node){let a=ye.get(n.node);if(!a||a.isText()&&a.text!=n.node.nodeValue)s=n;else if(i.docView.lastCompositionAfterCursor){let l=ye.get(r.node);!l||l.isText()&&l.text!=r.node.nodeValue||(s=n)}}if(i.docView.lastCompositionAfterCursor=s!=r,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function XC(i,e,t){let r=Mx(i,t);if(!r)return null;let{node:n,from:s,to:o}=r,a=n.nodeValue;if(/[\n\r]/.test(a)||i.state.doc.sliceString(r.from,r.to)!=a)return null;let l=e.invertedDesc;return{range:new $t(l.mapPos(s),l.mapPos(o),s,o),text:n}}function JC(i,e){return i.nodeType!=1?0:(e&&i.childNodes[e-1].contentEditable=="false"?1:0)|(e{re.from&&(t=!0)}),t}var Js=class extends gi{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function tT(i,e,t=1){let r=i.charCategorizer(e),n=i.doc.lineAt(e),s=e-n.from;if(n.length==0)return O.cursor(e);s==0?t=1:s==n.length&&(t=-1);let o=s,a=s;t<0?o=Ne(n.text,s,!1):a=Ne(n.text,s);let l=r(n.text.slice(o,a));for(;o>0;){let u=Ne(n.text,o,!1);if(r(n.text.slice(u,o))!=l)break;o=u}for(;ai.defaultLineHeight*1.5){let a=i.viewState.heightOracle.textHeight,l=Math.floor((n-t.top-(i.defaultLineHeight-a)*.5)/a);s+=l*i.viewState.heightOracle.lineLength}let o=i.state.sliceDoc(t.from,t.to);return t.from+kC(o,s,i.state.tabSize)}function qp(i,e,t){let r=i.lineBlockAt(e);if(Array.isArray(r.type)){let n;for(let s of r.type){if(s.from>e)break;if(!(s.toe)return s;(!n||s.type==ze.Text&&(n.type!=s.type||(t<0?s.frome)))&&(n=s)}}return n||r}return r}function nT(i,e,t,r){let n=qp(i,e.head,e.assoc||-1),s=!r||n.type!=ze.Text||!(i.lineWrapping||n.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>n.from?e.head-1:e.head);if(s){let o=i.dom.getBoundingClientRect(),a=i.textDirectionAt(n.from),l=i.posAtCoords({x:t==(a==be.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(l!=null)return O.cursor(l,t?-1:1)}return O.cursor(t?n.to:n.from,t?-1:1)}function N0(i,e,t,r){let n=i.state.doc.lineAt(e.head),s=i.bidiSpans(n),o=i.textDirectionAt(n.from);for(let a=e,l=null;;){let u=UC(n,s,o,a,t),c=bx;if(!u){if(n.number==(t?i.state.doc.lines:1))return a;c=` +`,n=i.state.doc.line(n.number+(t?1:-1)),s=i.bidiSpans(n),u=i.visualLineSide(n,!t)}if(l){if(!l(c))return a}else{if(!r)return u;l=r(c)}a=u}}function rT(i,e,t){let r=i.state.charCategorizer(e),n=r(t);return s=>{let o=r(s);return n==nt.Space&&(n=o),n==o}}function sT(i,e,t,r){let n=e.head,s=t?1:-1;if(n==(t?i.state.doc.length:0))return O.cursor(n,e.assoc);let o=e.goalColumn,a,l=i.contentDOM.getBoundingClientRect(),u=i.coordsAtPos(n,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),c=i.documentTop;if(u)o==null&&(o=u.left-l.left),a=s<0?u.top:u.bottom;else{let p=i.viewState.lineBlockAt(n);o==null&&(o=Math.min(l.right-l.left,i.defaultCharacterWidth*(n-p.from))),a=(s<0?p.top:p.bottom)+c}let h=l.left+o,d=i.viewState.heightOracle.textHeight>>1,f=r??d;for(let p=0;;p+=d){let g=a+(f+p)*s,b=Hp(i,{x:h,y:g},!1,s);if(t?g>l.bottom:ga:x{if(e>s&&en(i)),t.from,e.head>t.from?-1:1);return r==t.from?t:O.cursor(r,ri.viewState.docHeight)return new pt(i.state.doc.length,-1);if(u=i.elementAtHeight(l),r==null)break;if(u.type==ze.Text){if(r<0?u.toi.viewport.to)break;let d=i.docView.coordsAt(r<0?u.from:u.to,r>0?-1:1);if(d&&(r<0?d.top<=l+s:d.bottom>=l+s))break}let h=i.viewState.heightOracle.textHeight/2;l=r>0?u.bottom+h:u.top-h}if(i.viewport.from>=u.to||i.viewport.to<=u.from){if(t)return null;if(u.type==ze.Text){let h=iT(i,n,u,o,a);return new pt(h,h==u.from?1:-1)}}if(u.type!=ze.Text)return l<(u.top+u.bottom)/2?new pt(u.from,1):new pt(u.to,-1);let c=i.docView.lineAt(u.from,2);return(!c||c.length!=u.length)&&(c=i.docView.lineAt(u.from,-2)),new Wp(i,o,a,i.textDirectionAt(u.from)).scanTile(c,u.from)}var Wp=class{constructor(e,t,r,n){this.view=e,this.x=t,this.y=r,this.baseDir=n,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to1||r.length&&(r[0].level!=this.baseDir||r[0].to+n.from>1;t:if(o.has(g)){let v=n+Math.floor(Math.random()*p);for(let x=0;x1)){if(x.bottomthis.y)(!u||u.top>x.top)&&(u=x),$=-1;else{let R=x.left>this.x?this.x-x.left:x.right(p+p+g)/3)return this.y=l.bottom-1,this.scan(e,t,!0);if(u&&u.top<(p+g+g)/3)return this.y=u.top+1,this.scan(e,t,!0)}let f=(a?this.dirAt(e[c],1):this.baseDir)==be.LTR;return{i:c,after:this.x>(d.left+d.right)/2==f}}scanText(e,t){let r=[];for(let s=0;s{let o=r[s]-t,a=r[s+1]-t;return oo(e.dom,o,a).getClientRects()});return n.after?new pt(r[n.i+1],-1):new pt(r[n.i],1)}scanTile(e,t){if(!e.length)return new pt(t,1);if(e.children.length==1){let a=e.children[0];if(a.isText())return this.scanText(a,t);if(a.isComposite())return this.scanTile(a,t)}let r=[t];for(let a=0,l=t;a{let l=e.children[a];return l.flags&48?null:(l.dom.nodeType==1?l.dom:oo(l.dom,0,l.length)).getClientRects()}),s=e.children[n.i],o=r[n.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):n.after?new pt(r[n.i+1],-1):new pt(o,1)}},qn="\uFFFF",Vp=class{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet($e.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=qn}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let n=e;;){this.findPointBefore(r,n);let s=this.text.length;this.readNode(n);let o=ye.get(n),a=n.nextSibling;if(a==t){o?.breakAfter&&!a&&r!=this.view.contentDOM&&this.lineBreak();break}let l=ye.get(a);(o&&l?o.breakAfter:(o?o.breakAfter:El(n))||El(a)&&(n.nodeName!="BR"||o?.isWidget())&&this.text.length>s)&&!aT(a,t)&&this.lineBreak(),n=a}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(a=n.exec(t))&&(s=a.index,o=a[0].length),this.append(t.slice(r,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);r=s+o}}readNode(e){let t=ye.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let n=r.iter();!n.next().done;)n.lineBreak?this.lineBreak():this.append(n.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(oT(e,r.node,r.offset)?t:0))}};function oT(i,e,t){for(;;){if(!e||t-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,a=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=Rx(e.docView.tile,t,r,0))){let l=s||o?[]:uT(e),u=new Vp(l,e);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=cT(l,this.bounds.from)}else{let l=e.observer.selectionRange,u=s&&s.node==l.focusNode&&s.offset==l.focusOffset||!Ep(e.contentDOM,l.focusNode)?a.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Ep(e.contentDOM,l.anchorNode)?a.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((D.ios||D.chrome)&&u!=c&&Math.min(u,c)<=a.main.from&&Math.max(u,c)>=a.main.to&&(h.from>0||h.to-1&&a.ranges.length>1)this.newSel=a.replaceRange(O.range(c,u));else if(e.lineWrapping&&c==u&&!(a.main.empty&&a.main.head==u)&&e.inputState.lastTouchTime>Date.now()-100){let d=e.coordsAtPos(u,-1),f=0;d&&(f=e.inputState.lastTouchY<=d.bottom?-1:1),this.newSel=O.create([O.cursor(u,f)])}else this.newSel=O.single(c,u)}}};function Rx(i,e,t,r){if(i.isComposite()){let n=-1,s=-1,o=-1,a=-1;for(let l=0,u=r,c=r;lt)return Rx(h,e,t,u);if(d>=e&&n==-1&&(n=l,s=u),u>t&&h.dom.parentNode==i.dom){o=l,a=c;break}c=d,u=d+h.breakAfter}return{from:s,to:a<0?r+i.length:a,startDOM:(n?i.children[n-1].dom.nextSibling:null)||i.dom.firstChild,endDOM:o=0?i.children[o].dom:null}}else return i.isText()?{from:r,to:r+i.length,startDOM:i.dom,endDOM:i.dom.nextSibling}:null}function Ux(i,e){let t,{newSel:r}=e,{state:n}=i,s=n.selection.main,o=i.inputState.lastKeyTime>Date.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:l}=e.bounds,u=s.from,c=null;(o===8||D.android&&e.text.length=a&&s.to<=l&&(e.typeOver||h!=e.text)&&h.slice(0,s.from-a)==e.text.slice(0,s.from-a)&&h.slice(s.to-a)==e.text.slice(d=e.text.length-(h.length-(s.to-a)))?t={from:s.from,to:s.to,insert:te.of(e.text.slice(s.from-a,d).split(qn))}:(f=Lx(h,e.text,u-a,c))&&(D.chrome&&o==13&&f.toB==f.from+2&&e.text.slice(f.from,f.toB)==qn+qn&&f.toB--,t={from:a+f.from,to:a+f.toA,insert:te.of(e.text.slice(f.from,f.toB).split(qn))})}else r&&(!i.hasFocus&&n.facet(Kt)||Nl(r,s))&&(r=null);if(!t&&!r)return!1;if((D.mac||D.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&i.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=O.single(r.main.anchor-1,r.main.head-1)),t={from:t.from,to:t.to,insert:te.of([t.insert.toString().replace("."," ")])}):n.doc.lineAt(s.from).toDate.now()-50?t={from:s.from,to:s.to,insert:n.toText(i.inputState.insertingText)}:D.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` + `&&i.lineWrapping&&(r&&(r=O.single(r.main.anchor-1,r.main.head-1)),t={from:s.from,to:s.to,insert:te.of([" "])}),t)return dg(i,t,r,o);if(r&&!Nl(r,s)){let a=!1,l="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(a=!0),l=i.inputState.lastSelectionOrigin,l=="select.pointer"&&(r=Nx(n.facet(mo).map(u=>u(i)),r))),i.dispatch({selection:r,scrollIntoView:a,userEvent:l}),!0}else return!1}function dg(i,e,t,r=-1){if(D.ios&&i.inputState.flushIOSKey(e))return!0;let n=i.state.selection.main;if(D.android&&(e.to==n.to&&(e.from==n.from||e.from==n.from-1&&i.state.sliceDoc(e.from,n.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&er(i.contentDOM,"Enter",13)||(e.from==n.from-1&&e.to==n.to&&e.insert.length==0||r==8&&e.insert.lengthn.head)&&er(i.contentDOM,"Backspace",8)||e.from==n.from&&e.to==n.to+1&&e.insert.length==0&&er(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,a=()=>o||(o=lT(i,e,t));return i.state.facet($x).some(l=>l(i,e.from,e.to,s,a))||i.dispatch(a()),!0}function lT(i,e,t){let r,n=i.state,s=n.selection.main,o=-1;if(e.from==e.to&&e.froms.to){let l=e.fromh(i)),u,l);e.from==c&&(o=c)}if(o>-1)r={changes:e,selection:O.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let l=s.frome.to?n.sliceDoc(e.to,s.to):"";r=n.replaceSelection(i.state.toText(l+e.insert.sliceString(0,void 0,i.state.lineBreak)+u))}else{let l=n.changes(e),u=t&&t.main.to<=l.newLength?t.main:void 0;if(n.selection.ranges.length>1&&(i.inputState.composing>=0||i.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let c=i.state.sliceDoc(e.from,e.to),h,d=t&&Mx(i,t.main.head);if(d){let p=e.insert.length-(e.to-e.from);h={from:d.from,to:d.to-p}}else h=i.state.doc.lineAt(s.head);let f=s.to-e.to;r=n.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:l,range:u||p.map(l)};let g=p.to-f,b=g-c.length;if(i.state.sliceDoc(b,g)!=c||g>=h.from&&b<=h.to)return{range:p};let v=n.changes({from:b,to:g,insert:e.insert}),x=p.to-s.to;return{changes:v,range:u?O.range(Math.max(0,u.anchor+x),Math.max(0,u.head+x)):p.map(v)}})}else r={changes:l,selection:u&&n.selection.replaceRange(u)}}let a="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,a+=".compose",i.inputState.compositionFirstChange&&(a+=".start",i.inputState.compositionFirstChange=!1)),n.update(r,{userEvent:a,scrollIntoView:!0})}function Lx(i,e,t,r){let n=Math.min(i.length,e.length),s=0;for(;s0&&a>0&&i.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let l=Math.max(0,s-Math.min(o,a));t-=o+l-s}if(o=o?s-t:0;s-=l,a=s+(a-o),o=s}else if(a=a?s-t:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function uT(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:n,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new Ml(t,r)),(n!=t||s!=r)&&e.push(new Ml(n,s))),e}function cT(i,e){if(i.length==0)return null;let t=i[0].pos,r=i.length==2?i[1].pos:t;return t>-1&&r>-1?O.single(t+e,r+e):null}function Nl(i,e){return e.head==i.main.head&&e.anchor==i.main.anchor}var Jp=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,D.safari&&e.contentDOM.addEventListener("input",()=>null),D.gecko&&_T(e.contentDOM.ownerDocument)}handleEvent(e){!bT(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let r=this.handlers[e];if(r){for(let n of r.observers)n(this.view,t);for(let n of r.handlers){if(t.defaultPrevented)break;if(n(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=dT(e),r=this.handlers,n=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,a=r[s];a&&o!=!a.handlers.length&&(n.removeEventListener(s,this.handleEvent),a=null),a||n.addEventListener(s,this.handleEvent,{passive:o})}for(let s in r)s!="scroll"&&!t[s]&&n.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Bx.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),D.android&&D.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(D.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(jx.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||fT.indexOf(e.key)>-1&&e.ctrlKey)){let t={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return t.shiftKey&&D.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&hT(this.view.win)&&(t.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:t},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:D.safari&&!D.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function hT(i){return i.visualViewport?i.visualViewport.height*i.visualViewport.scale/i.document.documentElement.clientHeight<.85:!1}function R0(i,e){return(t,r)=>{try{return e.call(i,r,t)}catch(n){Rt(t.state,n)}}}function dT(i){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of i){let n=r.spec,s=n&&n.plugin.domEventHandlers,o=n&&n.plugin.domEventObservers;if(s)for(let a in s){let l=s[a];l&&t(a).handlers.push(R0(r.value,l))}if(o)for(let a in o){let l=o[a];l&&t(a).observers.push(R0(r.value,l))}}for(let r in _t)t(r).handlers.push(_t[r]);for(let r in qe)t(r).observers.push(qe[r]);return e}var jx=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],fT="dthko",Bx=[16,17,18,20,91,92,224,225],tl=6;function il(i){return Math.max(0,i)*.7+8}function pT(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}var Kp=class{constructor(e,t,r,n){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=ux(e.contentDOM),this.atoms=e.state.facet(mo).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet($e.allowMultipleSelections)&&mT(e,t),this.dragging=vT(e,t)&&qx(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&pT(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,r=0,n=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:n,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=zx(this.view);e.clientX-l.left<=n+tl?t=-il(n-e.clientX):e.clientX+l.right>=o-tl&&(t=il(e.clientX-o)),e.clientY-l.top<=s+tl?r=-il(s-e.clientY):e.clientY+l.bottom>=a-tl&&(r=il(e.clientY-a)),this.setScrollSpeed(t,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,r=Nx(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function mT(i,e){let t=i.state.facet(yx);return t.length?t[0](e):D.mac?e.metaKey:e.ctrlKey}function gT(i,e){let t=i.state.facet(kx);return t.length?t[0](e):D.mac?!e.altKey:!e.ctrlKey}function vT(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let r=so(i.root);if(!r||r.rangeCount==0)return!0;let n=r.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function bT(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=ye.get(t))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}var _t=Object.create(null),qe=Object.create(null),Zx=D.ie&&D.ie_version<15||D.ios&&D.webkit_version<604;function yT(i){let e=i.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{i.focus(),t.remove(),Fx(i,t.value)},50)}function iu(i,e,t){for(let r of i.facet(e))t=r(t,i);return t}function Fx(i,e){e=iu(i.state,lg,e);let{state:t}=i,r,n=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(Gp!=null&&t.selection.ranges.every(l=>l.empty)&&Gp==s.toString()){let l=-1;r=t.changeByRange(u=>{let c=t.doc.lineAt(u.from);if(c.from==l)return{range:u};l=c.from;let h=t.toText((o?s.line(n++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:h},range:O.cursor(u.from+h.length)}})}else o?r=t.changeByRange(l=>{let u=s.line(n++);return{changes:{from:l.from,to:l.to,insert:u.text},range:O.cursor(l.from+u.length)}}):r=t.replaceSelection(s);i.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}qe.scroll=i=>{let e=i.inputState;e.lastScrollTop=i.scrollDOM.scrollTop,e.lastScrollLeft=i.scrollDOM.scrollLeft,D.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};qe.wheel=qe.mousewheel=i=>{i.inputState.lastWheelEvent=Date.now()};_t.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);qe.touchstart=(i,e)=>{let t=i.inputState,r=e.targetTouches[0];t.touchActive=!0,t.lastTouchTime=Date.now(),r&&(t.lastTouchX=r.clientX,t.lastTouchY=r.clientY),t.setSelectionOrigin("select.pointer")};qe.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};qe.touchend=(i,e)=>{i.inputState.touchActive=!1};_t.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of i.state.facet(xx))if(t=r(i,e),t)break;if(!t&&e.button==0&&(t=xT(i,e)),t){let r=!i.hasFocus;i.inputState.startMouseSelection(new Kp(i,e,t,r)),r&&i.observer.ignore(()=>{cx(i.contentDOM);let s=i.root.activeElement;s&&!s.contains(i.contentDOM)&&s.blur()});let n=i.inputState.mouseSelection;if(n)return n.start(e),n.dragging===!1}else i.inputState.setSelectionOrigin("select.pointer");return!1};function U0(i,e,t,r){if(r==1)return O.cursor(e,t);if(r==2)return tT(i.state,e,t);{let n=i.docView.lineAt(e,t),s=i.state.doc.lineAt(n?n.posAtEnd:e),o=n?n.posAtStart:s.from,a=n?n.posAtEnd:s.to;return aDate.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(j0+1)%3:1}function xT(i,e){let t=i.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=qx(e),n=i.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),n=n.map(s.changes))},get(s,o,a){let l=i.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,c=U0(i,l.pos,l.assoc,r);if(t.pos!=l.pos&&!o){let h=U0(i,t.pos,t.assoc,r),d=Math.min(h.from,c.from),f=Math.max(h.to,c.to);c=d1&&(u=wT(n,l.pos))?u:a?n.addRange(c):O.create([c])}}}function wT(i,e){for(let t=0;t=e)return O.create(i.ranges.slice(0,t).concat(i.ranges.slice(t+1)),i.mainIndex==t?0:i.mainIndex-(i.mainIndex>t?1:0))}return null}_t.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let n=i.docView.tile.nearest(e.target);if(n&&n.isWidget()){let s=n.posAtStart,o=s+n.length;(s>=t.to||o<=t.from)&&(t=O.undirectionalRange(s,o))}}let{inputState:r}=i;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",iu(i.state,ug,i.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};_t.dragend=i=>(i.inputState.draggedContent=null,!1);function Z0(i,e,t,r){if(t=iu(i.state,lg,t),!t)return;let n=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=i.inputState,o=r&&s&&gT(i,e)?{from:s.from,to:s.to}:null,a={from:n,insert:t},l=i.state.changes(o?[o,a]:a);i.focus(),i.dispatch({changes:l,selection:{anchor:l.mapPos(n,-1),head:l.mapPos(n,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}_t.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),n=0,s=()=>{++n==t.length&&Z0(i,e,r.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[o]=a.result),s()},a.readAsText(t[o])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Z0(i,e,r,!0),!0}return!1};_t.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=Zx?null:e.clipboardData;return t?(Fx(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(yT(i),!1)};function $T(i,e){let t=i.dom.parentNode;if(!t)return;let r=t.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),i.focus()},50)}function ST(i){let e=[],t=[],r=!1;for(let n of i.selection.ranges)n.empty||(e.push(i.sliceDoc(n.from,n.to)),t.push(n));if(!e.length){let n=-1;for(let{from:s}of i.selection.ranges){let o=i.doc.lineAt(s);o.number>n&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),n=o.number}r=!0}return{text:iu(i,ug,e.join(i.lineBreak)),ranges:t,linewise:r}}var Gp=null;_t.copy=_t.cut=(i,e)=>{if(!Hs(i.contentDOM,i.observer.selectionRange))return!1;let{text:t,ranges:r,linewise:n}=ST(i.state);if(!t&&!n)return!1;Gp=n?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=Zx?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):($T(i,t),!1)};var Hx=Ut.define();function Wx(i,e){let t=[];for(let r of i.facet(Sx)){let n=r(i,e);n&&t.push(n)}return t.length?i.update({effects:t,annotations:Hx.of(!0)}):null}function Vx(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=Wx(i.state,e);t?i.dispatch(t):i.update([])}},10)}qe.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),Vx(i)};qe.blur=i=>{i.observer.clearSelectionRange(),Vx(i)};qe.compositionstart=qe.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};qe.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,D.chrome&&D.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};qe.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};_t.beforeinput=(i,e)=>{var t,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(i.inputState.insertingText=e.data,i.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&i.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let a=o[0],l=i.posAtDOM(a.startContainer,a.startOffset),u=i.posAtDOM(a.endContainer,a.endOffset);return dg(i,{from:l,to:u,insert:i.state.toText(s)},null),!0}}let n;if(D.chrome&&D.android&&(n=jx.find(s=>s.inputType==e.inputType))&&(i.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return D.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),D.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>qe.compositionend(i,e),20),!1};var F0=new Set;function _T(i){F0.has(i)||(F0.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}var q0=["pre-wrap","normal","pre-line","break-spaces"],ur=!1;function H0(){ur=!1}var Yp=class{constructor(e){this.lineWrapping=e,this.doc=te.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return q0.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r-1,l=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=r,this.textHeight=n,this.lineLength=s,l){this.heightSamples={};for(let u=0;u0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ml&&(ur=!0),this.height=e)}replace(e,t,r){return i.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,n){let s=this,o=r.doc;for(let a=n.length-1;a>=0;a--){let{fromA:l,toA:u,fromB:c,toB:h}=n[a],d=s.lineAt(l,me.ByPosNoHeight,r.setDoc(t),0,0),f=d.to>=u?d:s.lineAt(u,me.ByPosNoHeight,r,0,0);for(h+=f.to-u,u=f.to;a>0&&d.from<=n[a-1].toA;)l=n[a-1].fromA,c=n[a-1].fromB,a--,ls*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),r+=1+a.break,n-=a.size}else if(s>n*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,s-=a.size}else break;else if(n=s&&o(this.lineAt(0,me.ByPos,r,n,s))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,r=!1,n){return n&&n.from<=t&&n.more&&this.setMeasuredHeight(n),this.outdated=!1,this}toString(){return`block(${this.length})`}},ft=class i extends Ul{constructor(e,t,r){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,t){return new wt(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,r){let n=r[0];return r.length==1&&(n instanceof i||n instanceof di&&n.flags&4)&&Math.abs(this.length-n.length)<10?(n instanceof di?n=new i(n.length,this.height,this.spaceAbove):n.height=this.height,this.outdated||(n.outdated=!1),n):st.of(r)}updateHeight(e,t=0,r=!1,n){return n&&n.from<=t&&n.more?this.setMeasuredHeight(n):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}},di=class i extends st{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,n=e.doc.lineAt(t+this.length).number,s=n-r+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*s);o=l/s,this.length>s+1&&(a=(this.height-l)/(this.length-s-1))}else o=this.height/s;return{firstLine:r,lastLine:n,perLine:o,perChar:a}}blockAt(e,t,r,n){let{firstLine:s,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(t,n);if(t.lineWrapping){let u=n+(e0){let s=r[r.length-1];s instanceof i?r[r.length-1]=new i(s.length+n):r.push(null,new i(n-1))}if(e>0){let s=r[0];s instanceof i?r[0]=new i(e+s.length):r.unshift(new i(e-1),null)}return st.of(r)}decomposeLeft(e,t){t.push(new i(e-1),null)}decomposeRight(e,t){t.push(null,new i(this.length-e-1))}updateHeight(e,t=0,r=!1,n){let s=t+this.length;if(n&&n.from<=t+this.length&&n.more){let o=[],a=Math.max(t,n.from),l=-1;for(n.from>t&&o.push(new i(n.from-t-1).updateHeight(e,t));a<=s&&n.more;){let c=e.doc.lineAt(a).length;o.length&&o.push(null);let h=n.heights[n.index++],d=0;h<0&&(d=-h,h=n.heights[n.index++]),l==-1?l=h:Math.abs(h-l)>=ml&&(l=-2);let f=new ft(c,h,d);f.outdated=!1,o.push(f),a+=c+1}a<=s&&o.push(null,new i(s-a).updateHeight(e,a));let u=st.of(o);return(l<0||Math.abs(u.height-this.height)>=ml||Math.abs(l-this.heightMetrics(e,t).perLine)>=ml)&&(ur=!0),Rl(this,u)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},em=class extends st{constructor(e,t,r){super(e.length+t+r.length,e.height+r.height,t|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,t,r,n){let s=r+this.left.height;return ea))return u;let c=t==me.ByPosNoHeight?me.ByPosNoHeight:me.ByPos;return l?u.join(this.right.lineAt(a,c,r,o,a)):this.left.lineAt(a,c,r,n,s).join(u)}forEachLine(e,t,r,n,s,o){let a=n+this.left.height,l=s+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,t,r,a,l,o);else{let u=this.lineAt(l,me.ByPos,r,n,s);e=e&&u.from<=t&&o(u),t>u.to&&this.right.forEachLine(u.to+1,t,r,a,l,o)}}replace(e,t,r){let n=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-n,t-n,r));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of r)s.push(a);if(e>0&&W0(s,o-1),t=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,n=r+this.break;if(e>=n)return this.right.decomposeRight(e-n,t);e2*t.size||t.size>2*e.size?st.of(this.break?[e,null,t]:[e,t]):(this.left=Rl(this.left,e),this.right=Rl(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,r=!1,n){let{left:s,right:o}=this,a=t+s.length+this.break,l=null;return n&&n.from<=t+s.length&&n.more?l=s=s.updateHeight(e,t,r,n):s.updateHeight(e,t,r),n&&n.from<=a+o.length&&n.more?l=o=o.updateHeight(e,a,r,n):o.updateHeight(e,a,r),l?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function W0(i,e){let t,r;i[e]==null&&(t=i[e-1])instanceof di&&(r=i[e+1])instanceof di&&i.splice(e-1,3,new di(t.length+1+r.length))}var IT=5,tm=class i{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let r=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof ft?n.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new ft(r-this.pos,-1,0)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e=IT)&&this.addLineDeco(n,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new ft(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let r=new di(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ft)return e;let t=new ft(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let n=this.ensureLine();n.length+=r,n.collapsed+=r,n.widgetHeight=Math.max(n.widgetHeight,e),n.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof ft)&&!this.isCovered?this.nodes.push(new ft(0,-1,0)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&h.overflow!="visible"){let d=c.getBoundingClientRect();s=Math.max(s,d.left),o=Math.min(o,d.right),a=Math.max(a,d.top),l=Math.min(u==i.parentNode?n.innerHeight:l,d.bottom)}u=h.position=="absolute"||h.position=="fixed"?c.offsetParent:c.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:a-(t.top+e),bottom:Math.max(a,l)-(t.top+e)}}function ET(i){let e=i.getBoundingClientRect(),t=i.ownerDocument.defaultView||window;return e.left0&&e.top0}function AT(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}var Gs=class{constructor(e,t,r,n){this.from=e,this.to=t,this.size=r,this.displaySize=n}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;rtypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new Yp(r),this.stateDeco=X0(t),this.heightMap=st.empty().applyChanges(this.stateDeco,te.empty,this.heightOracle.setDoc(t.doc),[new $t(0,0,0,t.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=G.set(this.lineGaps.map(n=>n.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let n=r?t.head:t.anchor;if(!e.some(({from:s,to:o})=>n>=s&&n<=o)){let{from:s,to:o}=this.lineBlockAt(n);e.push(new Wn(s,o))}}return this.viewports=e.sort((r,n)=>r.from-n.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?V0:new rm(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Fs(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=X0(this.state);let n=e.changedRanges,s=$t.extendWithRanges(n,CT(r,this.stateDeco,e?e.changes:ot.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);H0(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||ur)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let u=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(u||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Ox)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,r=window.getComputedStyle(t),n=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?be.RTL:be.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",a=t.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let u=0,c=0;if(a.width&&a.height){let{scaleX:A,scaleY:P}=lx(t,a);(A>.005&&Math.abs(this.scaleX-A)>.005||P>.005&&Math.abs(this.scaleY-P)>.005)&&(this.scaleX=A,this.scaleY=P,u|=16,o=l=!0)}let h=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=d)&&(this.paddingTop=h,this.paddingBottom=d,u|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(n.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=16);let f=ux(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=hx(this.scrollParent||e.win);let g=(this.printing?AT:TT)(t,this.paddingTop),b=g.top-this.pixelViewport.top,v=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let x=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(x!=this.inView&&(this.inView=x,x&&(l=!0)),!this.inView&&!this.scrollTarget&&!ET(e.dom))return 0;let $=a.width;if((this.contentDOMWidth!=$||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,u|=16),l){let A=e.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(A)&&(o=!0),o||n.lineWrapping&&Math.abs($-this.contentDOMWidth)>n.charWidth){let{lineHeight:P,charWidth:E,textHeight:Y}=e.docView.measureTextSize();o=P>0&&n.refresh(s,P,E,Y,Math.max(5,$/E),A),o&&(e.docView.minWidth=0,u|=16)}b>0&&v>0?c=Math.max(b,v):b<0&&v<0&&(c=Math.min(b,v)),H0();for(let P of this.viewports){let E=P.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(P);this.heightMap=(o?st.empty().applyChanges(this.stateDeco,te.empty,this.heightOracle,[new $t(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(n,0,o,new Qp(P.from,E))}ur&&(u|=2)}let R=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return R&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),u|=this.updateForViewport()),(u&2||R)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),n=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new Wn(n.lineAt(o-r*1e3,me.ByHeight,s,0,0).from,n.lineAt(a+(1-r)*1e3,me.ByHeight,s,0,0).to);if(t){let{head:u}=t.range;if(ul.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=n.lineAt(u,me.ByPos,s,0,0),d;t.y=="center"?d=(h.top+h.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&u=a+Math.max(10,Math.min(r,250)))&&n>o-2*1e3&&s>1,o=n<<1;if(this.defaultTextDirection!=be.LTR&&!r)return[];let a=[],l=(c,h,d,f)=>{if(h-cc&&vv.from>=d.from&&v.to<=d.to&&Math.abs(v.from-c)v.fromx));if(!b){if(h$.from<=h&&$.to>=h)){let $=t.moveToLineBoundary(O.cursor(h),!1,!0).head;$>c&&(h=$)}let v=this.gapSize(d,c,h,f),x=r||v<2e6?v:2e6;b=new Gs(c,h,v,x)}a.push(b)},u=c=>{if(c.length2e6)for(let P of e)P.from>=c.from&&P.fromc.from&&l(c.from,f,c,h),pt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let r=[];ge.spans(t,this.viewport.from,this.viewport.to,{span(s,o){r.push({from:s,to:o})},point(){}},20);let n=0;if(r.length!=this.visibleRanges.length)n=12;else for(let s=0;s=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Fs(this.heightMap.lineAt(e,me.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Fs(this.heightMap.lineAt(this.scaler.fromDOM(e),me.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Fs(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},Wn=class{constructor(e,t){this.from=e,this.to=t}};function DT(i,e,t){let r=[],n=i,s=0;return ge.spans(t,i,e,{span(){},point(o,a){o>n&&(r.push({from:n,to:o}),s+=o-n),n=a}},20),n=1)return e[e.length-1].to;let r=Math.floor(i*t);for(let n=0;;n++){let{from:s,to:o}=e[n],a=o-s;if(r<=a)return s+r;r-=a}}function rl(i,e){let t=0;for(let{from:r,to:n}of i.ranges){if(e<=n){t+=e-r;break}t+=n-r}return t/i.total}function zT(i,e){for(let t of i)if(e(t))return t}var V0={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}};function X0(i){let e=i.facet(tu).filter(r=>typeof r!="function"),t=i.facet(hg).filter(r=>typeof r!="function");return t.length&&e.push(ge.join(t)),e}var rm=class i{constructor(e,t,r){let n=0,s=0,o=0;this.viewports=r.map(({from:a,to:l})=>{let u=t.lineAt(a,me.ByPos,e,0,0).top,c=t.lineAt(l,me.ByPos,e,0,0).bottom;return n+=c-u,{from:a,to:l,top:u,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-n)/(t.height-n);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let t=0,r=0,n=0;;t++){let s=tt.from==e.viewports[r].from&&t.to==e.viewports[r].to):!1}};function Fs(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),r=e.toDOM(i.bottom);return new wt(i.from,i.length,t,r-t,Array.isArray(i._content)?i._content.map(n=>Fs(n,e)):i._content)}var sl=N.define({combine:i=>i.join(" ")}),sm=N.define({combine:i=>i.indexOf(!0)>-1}),om=Lt.newName(),Xx=Lt.newName(),Jx=Lt.newName(),Kx={"&light":"."+Xx,"&dark":"."+Jx};function am(i,e,t){return new Lt(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,n=>{if(n=="&")return i;if(!t||!t[n])throw new RangeError(`Unsupported selector: ${n}`);return t[n]}):i+" "+r}})}var PT=am("."+om,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Kx),MT={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Hf=D.ie&&D.ie_version<=11,lm=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Ap,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let r of t)this.queue.push(r);(D.ie&&D.ie_version<=11||D.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&D.android&&e.constructor.EDIT_CONTEXT!==!1&&!(D.chrome&&D.chrome_version<126)&&(this.editContext=new um(e),e.state.facet(Kt)&&(e.contentDOM.editContext=this.editContext.editContext)),Hf&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,n=this.selectionRange;if(r.state.facet(Kt)?r.root.activeElement!=this.dom:!Hs(this.dom,n))return;let s=n.anchorNode&&r.docView.tile.nearest(n.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(D.ie&&D.ie_version<=11||D.android&&D.chrome)&&!r.state.selection.main.empty&&n.focusNode&&Ws(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=so(e.root);if(!t)return!1;let r=D.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&NT(this.view,t)||t;if(!r||this.selectionRange.eq(r))return!1;let n=Hs(this.dom,r);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&er(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(n)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,r=-1,n=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(n=!0),t==-1?{from:t,to:r}=o:(t=Math.min(o.from,t),r=Math.max(o.to,r)))}return{from:t,to:r,typeOver:n}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),n=this.selectionChanged&&Hs(this.dom,this.selectionRange);if(e<0&&!n)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Xp(this.view,e,t,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let r=this.view.state,n=Ux(this.view,t);return this.view.state==r&&(t.domChanged||t.newSel&&!Nl(this.view.state.selection,t.newSel.main))&&this.view.update([]),n}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let r=J0(t,e.previousSibling||e.target.previousSibling,-1),n=J0(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:n?t.posBefore(n):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Kt)!=e.state.facet(Kt)&&(e.view.contentDOM.editContext=e.state.facet(Kt)?this.editContext.editContext:null))}destroy(){var e,t,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function J0(i,e,t){for(;e;){let r=ye.get(e);if(r&&r.parent==i)return r;let n=e.parentNode;e=n!=i.dom?n:t>0?e.nextSibling:e.previousSibling}return null}function K0(i,e){let t=e.startContainer,r=e.startOffset,n=e.endContainer,s=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor,1);return Ws(o.node,o.offset,n,s)&&([t,r,n,s]=[n,s,t,r]),{anchorNode:t,anchorOffset:r,focusNode:n,focusOffset:s}}function NT(i,e){if(e.getComposedRanges){let n=e.getComposedRanges(i.root)[0];if(n)return K0(i,n)}let t=null;function r(n){n.preventDefault(),n.stopImmediatePropagation(),t=n.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",r,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",r,!0),t?K0(i,t):null}var um=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let n=e.state.selection.main,{anchor:s,head:o}=n,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let u=l-a>r.text.length;a==this.from&&sthis.to&&(l=s);let c=Lx(e.state.sliceDoc(a,l),r.text,(u?n.from:n.to)-a,u?"end":null);if(!c){let d=O.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));Nl(d,n)||e.dispatch({selection:d,userEvent:"select"});return}let h={from:c.from+a,to:c.toA+a,insert:te.of(r.text.slice(c.from,c.toB).split(` +`))};if((D.mac||D.android)&&h.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:a,to:l,insert:te.of([r.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let d=this.to-this.from+(h.to-h.from+h.insert.length);dg(e,h,O.single(this.toEditorPos(r.selectionStart,d),this.toEditorPos(r.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(t.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let n=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o{let n=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(l{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{let n=so(r.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,n=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,u)=>{if(r)return;let c=u.length-(o-s);if(n&&o>=n.to)if(n.from==s&&n.to==o&&n.insert.eq(u)){n=this.pendingContextChange=null,t+=c,this.to+=c;return}else n=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(sthis.to||this.to-this.from+u.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),u.toString()),this.to+=c}t+=c}),n&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(n=>!n.isUserEvent("input.type")&&n.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),n=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(r,n)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},Z=class i{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(n=>n.forEach(s=>r(s,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=e.root||TC(e.parent)||document,this.viewState=new Ll(this,e.state||$e.create(e)),e.scrollTo&&e.scrollTo.is(el)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Hn).map(n=>new Xs(n));for(let n of this.plugins)n.update(this);this.observer=new lm(this),this.inputState=new Jp(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Pl(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Re?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,n,s=this.state;for(let d of e){if(d.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=d.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(Hx))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=Wx(s,o),l||(a=1));let u=this.observer.delayedAndroidKey,c=null;if(u?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(c=null)):this.observer.clear(),s.facet($e.phrases)!=this.state.facet($e.phrases))return this.setState(s);n=Dl.create(this,s,e),n.flags|=a;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(h&&(h=h.map(d.changes)),d.scrollIntoView){let{main:f}=d.state.selection,{x:p,y:g}=this.state.facet(i.cursorScrollMargin);h=new Vs(f.empty?f:O.cursor(f.head,f.head>f.anchor?-1:1),"nearest","nearest",g,p)}for(let f of d.effects)f.is(el)&&(h=f.value.clip(this.state))}this.viewState.update(n,h),this.bidiCache=jl.update(this.bidiCache,n.changes),n.empty||(this.updatePlugins(n),this.inputState.update(n)),t=this.docView.update(n),this.state.facet(Zs)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(n.startState.facet(sl)!=n.state.facet(sl)&&(this.viewState.mustMeasureContent=!0),(t||r||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!n.empty)for(let d of this.state.facet(Mp))try{d(n)}catch(f){Rt(this.state,f,"update listener")}(l||c)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),c&&!Ux(this,c)&&u.force&&er(this.contentDOM,u.key,u.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new Ll(this,e),this.plugins=e.facet(Hn).map(r=>new Xs(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new Pl(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Hn),r=e.state.facet(Hn);if(t!=r){let n=[];for(let s of r){let o=t.indexOf(s);if(o<0)n.push(new Xs(s));else{let a=this.plugins[o];a.mustUpdate=e,n.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let n of this.plugins)n.mustUpdate=e;for(let n=0;n-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,r=this.viewState.scrollParent,n=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(n-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(hx(r||this.win))s=-1,o=this.viewState.heightMap.height;else{let f=this.viewState.scrollAnchorAt(n);s=f.from,o=f.top}this.updateState=1;let l=this.viewState.measure();if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];l&4||([this.measureRequests,u]=[u,this.measureRequests]);let c=u.map(f=>{try{return f.read(this)}catch(p){return Rt(this.state,p),G0}}),h=Dl.create(this,this.state,[]),d=!1;h.flags|=l,t?t.flags|=l:t=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),d=this.docView.update(h),d&&this.docViewUpdate());for(let f=0;f1||p<-1)&&!(D.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){n=n+p,r?r.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(Mp))a(t)}get themeClasses(){return om+" "+(this.state.facet(sm)?Jx:Xx)+" "+this.state.facet(sl)}updateAttrs(){let e=Y0(this,Tx,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Kt)?"true":"false",class:"cm-content",style:`${D.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Y0(this,cg,t);let r=this.observer.ignore(()=>{let n=E0(this.contentDOM,this.contentAttrs,t),s=E0(this.dom,this.editorAttrs,e);return n||s});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let n of r.effects)if(n.is(i.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=n.value}}mountStyles(){this.styleModules=this.state.facet(Zs);let e=this.state.facet(i.cspNonce);Lt.mount(this.root,this.styleModules.concat(PT).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;tr.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,r){return qf(this,e,N0(this,e,t,r))}moveByGroup(e,t){return qf(this,e,N0(this,e,t,r=>rT(this,e.head,r)))}visualLineSide(e,t){let r=this.bidiSpans(e),n=this.textDirectionAt(e.from),s=r[t?r.length-1:0];return O.cursor(s.side(t,n)+e.from,s.forward(!t,n)?1:-1)}moveToLineBoundary(e,t,r=!0){return nT(this,e,t,r)}moveVertically(e,t,r){return qf(this,e,sT(this,e,t,r))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let r=Hp(this,e,t);return r&&r.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Hp(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.state.doc.lineAt(e),n=this.bidiSpans(r),s=n[mt.find(n,e-r.from,-1,t)];return this.docView.coordsAt(e,t,s.dir==be.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(_x)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>RT)return vx(e.length);let t=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||gx(s.isolates,r=z0(this,e))))return s.order;r||(r=z0(this,e));let n=RC(e.text,t,r);return this.bidiCache.push(new jl(e.from,e.to,t,r,!0,n)),n}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||D.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{cx(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var r,n,s,o;return el.of(new Vs(typeof e=="number"?O.cursor(e):e,(r=t.y)!==null&&r!==void 0?r:"nearest",(n=t.x)!==null&&n!==void 0?n:"nearest",(s=t.yMargin)!==null&&s!==void 0?s:5,(o=t.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return el.of(new Vs(O.cursor(r.from),"start","start",r.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return jt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return jt.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=Lt.newName(),n=[sl.of(r),Zs.of(am(`.${r}`,e))];return t&&t.dark&&n.push(sm.of(!0)),n}static baseTheme(e){return Ql.lowest(Zs.of(am("."+om,e,Kx)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),n=r&&ye.get(r)||ye.get(e);return((t=n?.root)===null||t===void 0?void 0:t.view)||null}};Z.styleModule=Zs;Z.inputHandler=$x;Z.clipboardInputFilter=lg;Z.clipboardOutputFilter=ug;Z.scrollHandler=Ix;Z.focusChangeEffect=Sx;Z.perLineTextDirection=_x;Z.exceptionSink=wx;Z.updateListener=Mp;Z.editable=Kt;Z.mouseSelectionStyle=xx;Z.dragMovesSelection=kx;Z.clickAddsSelectionRange=yx;Z.decorations=tu;Z.blockWrappers=Ex;Z.outerDecorations=hg;Z.atomicRanges=mo;Z.bidiIsolatedRanges=Ax;Z.cursorScrollMargin=N.define({combine:i=>{let e=5,t=5;for(let r of i)typeof r=="number"?e=t=r:{x:e,y:t}=r;return{x:e,y:t}}});Z.scrollMargins=Dx;Z.darkTheme=sm;Z.cspNonce=N.define({combine:i=>i.length?i[0]:""});Z.contentAttributes=cg;Z.editorAttributes=Tx;Z.lineWrapping=Z.contentAttributes.of({class:"cm-lineWrapping"});Z.announce=we.define();var RT=4096,G0={},jl=class i{constructor(e,t,r,n,s,o){this.from=e,this.to=t,this.dir=r,this.isolates=n,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let r=[],n=e.length?e[e.length-1].dir:be.LTR;for(let s=Math.max(0,e.length-10);s=0;n--){let s=r[n],o=typeof s=="function"?s(i):s;o&&sg(o,t)}return t}var UT=D.mac?"mac":D.windows?"win":D.linux?"linux":"key";function LT(i,e){let t=i.split(/-(?!$)/),r=t[t.length-1];r=="Space"&&(r=" ");let n,s,o,a;for(let l=0;lr.concat(n),[]))),t}var ui=null,ZT=4e3;function FT(i,e=UT){let t=Object.create(null),r=Object.create(null),n=(o,a)=>{let l=r[o];if(l==null)r[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,u,c)=>{var h,d;let f=t[o]||(t[o]=Object.create(null)),p=a.split(/ (?!$)/).map(v=>LT(v,e));for(let v=1;v{let R=ui={view:$,prefix:x,scope:o};return setTimeout(()=>{ui==R&&(ui=null)},ZT),!0}]})}let g=p.join(" ");n(g,!1);let b=f[g]||(f[g]={preventDefault:!1,stopPropagation:!1,run:((d=(h=f._any)===null||h===void 0?void 0:h.run)===null||d===void 0?void 0:d.slice())||[]});l&&b.run.push(l),u&&(b.preventDefault=!0),c&&(b.stopPropagation=!0)};for(let o of i){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of a){let c=t[u]||(t[u]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=o;for(let d in c)c[d].run.push(f=>h(f,cm))}let l=o[e]||o.key;if(l)for(let u of a)s(u,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(u,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return t}var cm=null;function qT(i,e,t,r){cm=e;let n=$C(e),s=tg(n,0),o=Xk(s)==n.length&&n!=" ",a="",l=!1,u=!1,c=!1;ui&&ui.view==t&&ui.scope==r&&(a=ui.prefix+" ",Bx.indexOf(e.keyCode)<0&&(u=!0,ui=null));let h=new Set,d=b=>{if(b){for(let v of b.run)if(!h.has(v)&&(h.add(v),v(t)))return b.stopPropagation&&(c=!0),!0;b.preventDefault&&(b.stopPropagation&&(c=!0),u=!0)}return!1},f=i[r],p,g;return f&&(d(f[a+ol(n,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(D.windows&&e.ctrlKey&&e.altKey)&&!(D.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=mi[e.keyCode])&&p!=n?(d(f[a+ol(p,e,!0)])||e.shiftKey&&(g=io[e.keyCode])!=n&&g!=p&&d(f[a+ol(g,e,!1)]))&&(l=!0):o&&e.shiftKey&&d(f[a+ol(n,e,!0)])&&(l=!0),!l&&d(f._any)&&(l=!0)),u&&(l=!0),l&&c&&e.stopPropagation(),cm=null,l}var Wi=class i{constructor(e,t,r,n,s){this.className=e,this.left=t,this.top=r,this.width=n,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,r){if(r.empty){let n=e.coordsAtPos(r.head,r.assoc||1);if(!n)return[];let s=Gx(e);return[new i(t,n.left-s.left,n.top-s.top,null,n.bottom-n.top)]}else return HT(e,t,r)}};function Gx(i){let e=i.scrollDOM.getBoundingClientRect();return{left:(i.textDirection==be.LTR?e.left:e.right-i.scrollDOM.clientWidth*i.scaleX)-i.scrollDOM.scrollLeft*i.scaleX,top:e.top-i.scrollDOM.scrollTop*i.scaleY}}function ek(i,e,t,r){let n=i.coordsAtPos(e,t*2);if(!n)return r;let s=i.dom.getBoundingClientRect(),o=(n.top+n.bottom)/2,a=i.posAtCoords({x:s.left+1,y:o}),l=i.posAtCoords({x:s.right-1,y:o});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function HT(i,e,t){if(t.to<=i.viewport.from||t.from>=i.viewport.to)return[];let r=Math.max(t.from,i.viewport.from),n=Math.min(t.to,i.viewport.to),s=i.textDirection==be.LTR,o=i.contentDOM,a=o.getBoundingClientRect(),l=Gx(i),u=o.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),h=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),d=a.right-(c?parseInt(c.paddingRight):0),f=qp(i,r,1),p=qp(i,n,-1),g=f.type==ze.Text?f:null,b=p.type==ze.Text?p:null;if(g&&(i.lineWrapping||f.widgetLineBreaks)&&(g=ek(i,r,1,g)),b&&(i.lineWrapping||p.widgetLineBreaks)&&(b=ek(i,n,-1,b)),g&&b&&g.from==b.from&&g.to==b.to)return x($(t.from,t.to,g));{let A=g?$(t.from,null,g):R(f,!1),P=b?$(null,t.to,b):R(p,!0),E=[];return(g||f).to<(b||p).from-(g&&b?1:0)||f.widgetLineBreaks>1&&A.bottom+i.defaultLineHeight/2j&&ie.from=Le)break;at>pe&&J(Math.max(Ie,pe),A==null&&Ie<=j,Math.min(at,Le),P==null&&at>=ne,Ct.dir)}if(pe=Je.to+1,pe>=Le)break}return he.length==0&&J(j,A==null,ne,P==null,i.textDirection),{top:Y,bottom:K,horizontal:he}}function R(A,P){let E=a.top+(P?A.top:A.bottom);return{top:E,bottom:E,horizontal:[]}}}function WT(i,e){return i.constructor==e.constructor&&i.eq(e)}var hm=class{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(gl)!=e.state.facet(gl)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,r=e.facet(gl);for(;t!WT(t,this.drawn[r]))){let t=this.dom.firstChild,r=0;for(let n of e)n.update&&t&&n.constructor&&this.drawn[r].constructor&&n.update(t,this.drawn[r])?(t=t.nextSibling,r++):this.dom.insertBefore(n.draw(),t);for(;t;){let n=t.nextSibling;t.remove(),t=n}this.drawn=e,D.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},gl=N.define();function Yx(i){return[jt.define(e=>new hm(e,i)),gl.of(i)]}var cr=N.define({combine(i){return fo(i,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function VT(i={}){return[cr.of(i),XT,JT,KT,Ox.of(!0)]}function Qx(i){return i.startState.facet(cr)!=i.state.facet(cr)}var XT=Yx({above:!0,markers(i){let{state:e}=i,t=e.facet(cr),r=[];for(let n of e.selection.ranges){let s=n==e.selection.main;if(n.empty||t.drawRangeCursor&&!(s&&D.ios&&t.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=n.empty?n:O.cursor(n.head,n.assoc);for(let l of Wi.forRange(i,o,a))r.push(l)}}return r},update(i,e){i.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Qx(i);return t&&tk(i.state,e),i.docChanged||i.selectionSet||t},mount(i,e){tk(e.state,i)},class:"cm-cursorLayer"});function tk(i,e){e.style.animationDuration=i.facet(cr).cursorBlinkRate+"ms"}var JT=Yx({above:!1,markers(i){let e=[],{main:t,ranges:r}=i.state.selection;for(let n of r)if(!n.empty)for(let s of Wi.forRange(i,"cm-selectionBackground",n))e.push(s);if(D.ios&&!t.empty&&i.state.facet(cr).iosSelectionHandles){for(let n of Wi.forRange(i,"cm-selectionHandle cm-selectionHandle-start",O.cursor(t.from,1)))e.push(n);for(let n of Wi.forRange(i,"cm-selectionHandle cm-selectionHandle-end",O.cursor(t.to,1)))e.push(n)}return e},update(i,e){return i.docChanged||i.selectionSet||i.viewportChanged||Qx(i)},class:"cm-selectionLayer"}),KT=Ql.highest(Z.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));function ik(i,e,t,r,n){e.lastIndex=0;for(let s=i.iterRange(t,r),o=t,a;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;a=e.exec(s.value);)n(o+a.index,a)}function GT(i,e){let t=i.visibleRanges;if(t.length==1&&t[0].from==i.viewport.from&&t[0].to==i.viewport.to)return t;let r=[];for(let{from:n,to:s}of t)n=Math.max(i.state.doc.lineAt(n).from,n-e),s=Math.min(i.state.doc.lineAt(s).to,s+e),r.length&&r[r.length-1].to>=n?r[r.length-1].to=s:r.push({from:n,to:s});return r}var dm=class{constructor(e){let{regexp:t,decoration:r,decorate:n,boundary:s,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,n)this.addMatch=(a,l,u,c)=>n(c,u,u+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,u,c)=>{let h=r(a,l,u);h&&c(u,u+a[0].length,h)};else if(r)this.addMatch=(a,l,u,c)=>c(u,u+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let t=new rr,r=t.add.bind(t);for(let{from:n,to:s}of GT(e,this.maxLength))ik(e.state.doc,this.regexp,n,s,(o,a)=>this.addMatch(a,e,o,r));return t.finish()}updateDeco(e,t){let r=1e9,n=-1;return e.docChanged&&e.changes.iterChanges((s,o,a,l)=>{l>=e.view.viewport.from&&a<=e.view.viewport.to&&(r=Math.min(a,r),n=Math.max(l,n))}),e.viewportMoved||n-r>1e3?this.createDeco(e.view):n>-1?this.updateRange(e.view,t.map(e.changes),r,n):t}updateRange(e,t,r,n){for(let s of e.visibleRanges){let o=Math.max(s.from,r),a=Math.min(s.to,n);if(a>=o){let l=e.state.doc.lineAt(o),u=l.tol.from;o--)if(this.boundary.test(l.text[o-1-l.from])){c=o;break}for(;ad.push(v.range(g,b));if(l==u)for(this.regexp.lastIndex=c-l.from;(f=this.regexp.exec(l.text))&&f.indexthis.addMatch(b,e,g,p));t=t.update({filterFrom:c,filterTo:h,filter:(g,b)=>gh,add:d})}}return t}},fm=/x/.unicode!=null?"gu":"g",YT=new RegExp(`[\0-\b +-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,fm),QT={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},Wf=null;function eE(){var i;if(Wf==null&&typeof document<"u"&&document.body){let e=document.body.style;Wf=((i=e.tabSize)!==null&&i!==void 0?i:e.MozTabSize)!=null}return Wf||!1}var vl=N.define({combine(i){let e=fo(i,{render:null,specialChars:YT,addSpecialChars:null});return(e.replaceTabs=!eE())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,fm)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,fm)),e}});function tE(i={}){return[vl.of(i),iE()]}var nk=null;function iE(){return nk||(nk=jt.fromClass(class{constructor(i){this.view=i,this.decorations=G.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(i.state.facet(vl)),this.decorations=this.decorator.createDeco(i)}makeDecorator(i){return new dm({regexp:i.specialChars,decoration:(e,t,r)=>{let{doc:n}=t.state,s=tg(e[0],0);if(s==9){let o=n.lineAt(r),a=t.state.tabSize,l=po(o.text,a,r-o.from);return G.replace({widget:new mm((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=G.replace({widget:new pm(i,s)}))},boundary:i.replaceTabs?void 0:/[^]/})}update(i){let e=i.state.facet(vl);i.startState.facet(vl)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(i.view)):this.decorations=this.decorator.updateDeco(i,this.decorations)}},{decorations:i=>i.decorations}))}var nE="\u2022";function rE(i){return i>=32?nE:i==10?"\u2424":String.fromCharCode(9216+i)}var pm=class extends gi{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=rE(this.code),r=e.state.phrase("Control character")+" "+(QT[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,r,t);if(n)return n;let s=document.createElement("span");return s.textContent=t,s.title=r,s.setAttribute("aria-label",r),s.className="cm-specialChar",s}ignoreEvent(){return!1}},mm=class extends gi{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}},ei=class extends Yt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};ei.prototype.elementClass="";ei.prototype.toDOM=void 0;ei.prototype.mapMode=tt.TrackBefore;ei.prototype.startSide=ei.prototype.endSide=-1;ei.prototype.point=!0;var Vf=N.define(),sE=N.define(),bl=N.define(),rk=N.define({combine:i=>i.some(e=>e)});function oE(i){return[aE]}var aE=jt.fromClass(class{constructor(i){this.view=i,this.domAfter=null,this.prevViewport=i.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=i.state.facet(bl).map(e=>new Bl(i,e)),this.fixed=!i.state.facet(rk);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),i.scrollDOM.insertBefore(this.dom,i.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(i){if(this.updateGutters(i)){let e=this.prevViewport,t=i.view.viewport,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(t.to-t.from)*.8)}if(i.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(rk)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=i.view.viewport}syncGutters(i){let e=this.dom.nextSibling;i&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=ge.iter(this.view.state.facet(Vf),this.view.viewport.from),r=[],n=this.gutters.map(s=>new vm(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==ze.Text&&o){gm(t,r,a.from);for(let l of n)l.line(this.view,a,r);o=!1}else if(a.widget)for(let l of n)l.widget(this.view,a)}else if(s.type==ze.Text){gm(t,r,s.from);for(let o of n)o.line(this.view,s,r)}else if(s.widget)for(let o of n)o.widget(this.view,s);for(let s of n)s.finish();i&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(i){let e=i.startState.facet(bl),t=i.state.facet(bl),r=i.docChanged||i.heightChanged||i.viewportChanged||!ge.eq(i.startState.facet(Vf),i.state.facet(Vf),i.view.viewport.from,i.view.viewport.to);if(e==t)for(let n of this.gutters)n.update(i)&&(r=!0);else{r=!0;let n=[];for(let s of t){let o=e.indexOf(s);o<0?n.push(new Bl(this.view,s)):(this.gutters[o].update(i),n.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),n.indexOf(s)<0&&s.destroy();for(let s of n)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=n}return r}destroy(){for(let i of this.gutters)i.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:i=>Z.scrollMargins.of(e=>{let t=e.plugin(i);if(!t||t.gutters.length==0||!t.fixed)return null;let r=t.dom.offsetWidth*e.scaleX,n=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==be.LTR?{left:r,right:n}:{right:r,left:n}})});function sk(i){return Array.isArray(i)?i:[i]}function gm(i,e,t){for(;i.value&&i.from<=t;)i.from==t&&e.push(i.value),i.next()}var vm=class{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=ge.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:n}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==n.elements.length){let a=new Zl(e,o,s,r);n.elements.push(a),n.dom.appendChild(a.dom)}else n.elements[this.i].update(e,o,s,r);this.height=t.bottom,this.i++}line(e,t,r){let n=[];gm(this.cursor,n,t.from),r.length&&(n=n.concat(r));let s=this.gutter.config.lineMarker(e,t,n);s&&n.unshift(s);let o=this.gutter;n.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,n)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t),n=r?[r]:null;for(let s of e.state.facet(sE)){let o=s(e,t.widget,t);o&&(n||(n=[])).push(o)}n&&this.addElement(e,t,n)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},Bl=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in t.domEventHandlers)this.dom.addEventListener(r,n=>{let s=n.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=n.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[r](e,a,n)&&n.preventDefault()});this.markers=sk(t.markers(e)),t.initialSpacer&&(this.spacer=new Zl(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=sk(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let n=this.config.updateSpacer(this.spacer.markers[0],e);n!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[n])}let r=e.view.viewport;return!ge.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},Zl=class{constructor(e,t,r,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,n)}update(e,t,r,n){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),lE(this.markers,n)||this.setMarkers(e,n)}setMarkers(e,t){let r="cm-gutterElement",n=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=ss(a,l,u)||o(a,l,u):o}return r}})}}),Ys=class extends ei{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Xf(i,e){return i.state.facet(Vn).formatNumber(e,i.state)}var hE=bl.compute([Vn],i=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(uE)},lineMarker(e,t,r){return r.some(n=>n.toDOM)?null:new Ys(Xf(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,r)=>{for(let n of e.state.facet(cE)){let s=n(e,t,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(Vn)!=e.state.facet(Vn),initialSpacer(e){return new Ys(Xf(e,ok(e.state.doc.lines)))},updateSpacer(e,t){let r=Xf(t.view,ok(t.view.state.doc.lines));return r==e.number?e:new Ys(r)},domEventHandlers:i.facet(Vn).domEventHandlers,side:"before"}));function dE(i={}){return[Vn.of(i),oE(),hE]}function ok(i){let e=9;for(;e{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Xe.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}};H.closedBy=new H({deserialize:i=>i.split(" ")});H.openedBy=new H({deserialize:i=>i.split(" ")});H.group=new H({deserialize:i=>i.split(" ")});H.isolate=new H({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});H.contextHash=new H({perNode:!0});H.lookAhead=new H({perNode:!0});H.mounted=new H({perNode:!0});var Vi=class{constructor(e,t,r,n=!1){this.tree=e,this.overlay=t,this.parser=r,this.bracketed=n}static get(e){return e&&e.props&&e.props[H.mounted.id]}},pE=Object.create(null),Xe=class i{constructor(e,t,r,n=0){this.name=e,this.props=t,this.id=r,this.flags=n}static define(e){let t=e.props&&e.props.length?Object.create(null):pE,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),n=new i(e.name||"",t,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(n)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return n}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(H.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let n of r.split(" "))t[n]=e[r];return r=>{for(let n=r.prop(H.group),s=-1;s<(n?n.length:0);s++){let o=t[s<0?r.name:n[s]];if(o)return o}}}};Xe.none=new Xe("",Object.create(null),0,8);var bm=class i{constructor(e){this.types=e;for(let t=0;t0;for(let l=this.cursor(o|ke.IncludeAnonymous);;){let u=!1;if(l.from<=s&&l.to>=n&&(!a&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;u=!0}for(;u&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;u=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:mg(Xe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,n)=>new i(this.type,t,r,n,this.propValues),e.makeTree||((t,r,n)=>new i(Xe.none,t,r,n)))}static build(e){return gE(e)}};_e.empty=new _e(Xe.none,[],[],0);var ym=class i{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new i(this.buffer,this.index)}},yi=class i{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return Xe.none}toString(){let e=[];for(let t=0;t0));l=o[l+3]);return a}slice(e,t,r){let n=this.buffer,s=new Uint16Array(t-e),o=0;for(let a=e,l=0;a=e&&te;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function ao(i,e,t,r){for(var n;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?a.length:-1;e!=u;e+=t){let c=a[e],h=l[e]+o.from,d;if(!(!(s&ke.EnterBracketed&&c instanceof _e&&(d=Vi.get(c))&&!d.overlay&&d.bracketed&&r>=h&&r<=h+c.length)&&!tw(n,r,h,h+c.length))){if(c instanceof yi){if(s&ke.ExcludeBuffers)continue;let f=c.findChild(0,c.buffer.length,t,r-h,n);if(f>-1)return new lo(new xm(o,c,e,h),null,f)}else if(s&ke.IncludeAnonymous||!c.type.isAnonymous||pg(c)){let f;if(!(s&ke.IgnoreMounts)&&(f=Vi.get(c))&&!f.overlay)return new i(f.tree,h,e,o);let p=new i(c,h,e,o);return s&ke.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(t<0?c.children.length-1:0,t,r,n,s)}}}if(s&ke.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,r=0){let n;if(!(r&ke.IgnoreOverlays)&&(n=Vi.get(this._tree))&&n.overlay){let s=e-this.from,o=r&ke.EnterBracketed&&n.bracketed;for(let{from:a,to:l}of n.overlay)if((t>0||o?a<=s:a=s:l>s))return new i(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function lk(i,e,t,r){let n=i.cursor(),s=[];if(!n.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=n.type.is(t),!n.nextSibling())return s}for(;;){if(r!=null&&n.type.is(r))return s;if(n.type.is(e)&&s.push(n.node),!n.nextSibling())return r==null?s:[]}}function km(i,e,t=e.length-1){for(let r=i;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}var xm=class{constructor(e,t,r,n){this.parent=e,this.buffer=t,this.index=r,this.start=n}},lo=class i extends Fl{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:n}=this.context,s=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.context.start,r);return s<0?null:new i(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,r=0){if(r&ke.ExcludeBuffers)return null;let{buffer:n}=this.context,s=n.findChild(this.index+4,n.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new i(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new i(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new i(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,n=this.index+4,s=r.buffer[this.index+3];if(s>n){let o=r.buffer[this.index+1];e.push(r.slice(n,s,o)),t.push(0)}return new _e(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function iw(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;st.from||o.to=e){let a=new Bt(o.tree,o.overlay[0].from+s.from,-1,s);(n||(n=[r])).push(ao(a,e,t,!1))}}return n?iw(n):r}var uo=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~ke.EnterBracketed,e instanceof Bt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:n}=this.buffer;return this.type=t||n.set.types[n.buffer[e]],this.from=r+n.buffer[e+1],this.to=r+n.buffer[e+2],!0}yield(e){return e?e instanceof Bt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:n}=this.buffer,s=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&ke.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ke.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ke.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let n=r<0?0:this.stack[r]+4;if(this.index!=n)return this.yieldBuf(t.findChild(n,this.index,-1,0,4))}else{let n=t.buffer[this.index+3];if(n<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(n)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:n}=this;if(n){if(e>0){if(this.index-1)for(let s=t+e,o=e<0?-1:r._tree.children.length;s!=o;s+=e){let a=r._tree.children[s];if(this.mode&ke.IncludeAnonymous||a instanceof yi||!a.type.isAnonymous||pg(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==n){if(n==this.index)return o;t=o,r=s+1;break e}n=this.stack[--s]}for(let n=r;n=0;s--){if(s<0)return km(this._tree,e,n);let o=r[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[n]&&e[n]!=o.name)return!1;n--}}return!0}};function pg(i){return i.children.some(e=>e instanceof yi||!e.type.isAnonymous||pg(e))}function gE(i){var e;let{buffer:t,nodeSet:r,maxBufferLength:n=ew,reused:s=[],minRepeatType:o=r.types.length}=i,a=Array.isArray(t)?new ym(t,t.length):t,l=r.types,u=0,c=0;function h(A,P,E,Y,K,he){let{id:J,start:j,end:ne,size:ie}=a,pe=c,Le=u;if(ie<0)if(a.next(),ie==-1){let Zt=s[J];E.push(Zt),Y.push(j-A);return}else if(ie==-3){u=J;return}else if(ie==-4){c=J;return}else throw new RangeError(`Unrecognized record size: ${ie}`);let Je=l[J],Ct,Ie,at=j-A;if(ne-j<=n&&(Ie=b(a.pos-P,K))){let Zt=new Uint16Array(Ie.size-Ie.skip),lt=a.pos-Ie.size,Tt=Zt.length;for(;a.pos>lt;)Tt=v(Ie.start,Zt,Tt);Ct=new yi(Zt,ne-Ie.start,r),at=Ie.start-A}else{let Zt=a.pos-ie;a.next();let lt=[],Tt=[],xi=J>=o?J:-1,nn=0,vo=ne;for(;a.pos>Zt;)xi>=0&&a.id==xi&&a.size>=0?(a.end<=vo-n&&(p(lt,Tt,j,nn,a.end,vo,xi,pe,Le),nn=lt.length,vo=a.end),a.next()):he>2500?d(j,Zt,lt,Tt):h(j,Zt,lt,Tt,xi,he+1);if(xi>=0&&nn>0&&nn-1&&nn>0){let _g=f(Je,Le);Ct=mg(Je,lt,Tt,0,lt.length,0,ne-j,_g,_g)}else Ct=g(Je,lt,Tt,ne-j,pe-ne,Le)}E.push(Ct),Y.push(at)}function d(A,P,E,Y){let K=[],he=0,J=-1;for(;a.pos>P;){let{id:j,start:ne,end:ie,size:pe}=a;if(pe>4)a.next();else{if(J>-1&&ne=0;ie-=3)j[pe++]=K[ie],j[pe++]=K[ie+1]-ne,j[pe++]=K[ie+2]-ne,j[pe++]=pe;E.push(new yi(j,K[2]-ne,r)),Y.push(ne-A)}}function f(A,P){return(E,Y,K)=>{let he=0,J=E.length-1,j,ne;if(J>=0&&(j=E[J])instanceof _e){if(!J&&j.type==A&&j.length==K)return j;(ne=j.prop(H.lookAhead))&&(he=Y[J]+j.length+ne)}return g(A,E,Y,K,he,P)}}function p(A,P,E,Y,K,he,J,j,ne){let ie=[],pe=[];for(;A.length>Y;)ie.push(A.pop()),pe.push(P.pop()+E-K);A.push(g(r.types[J],ie,pe,he-K,j-he,ne)),P.push(K-E)}function g(A,P,E,Y,K,he,J){if(he){let j=[H.contextHash,he];J=J?[j].concat(J):[j]}if(K>25){let j=[H.lookAhead,K];J=J?[j].concat(J):[j]}return new _e(A,P,E,Y,J)}function b(A,P){let E=a.fork(),Y=0,K=0,he=0,J=E.end-n,j={size:0,start:0,skip:0};e:for(let ne=E.pos-A;E.pos>ne;){let ie=E.size;if(E.id==P&&ie>=0){j.size=Y,j.start=K,j.skip=he,he+=4,Y+=4,E.next();continue}let pe=E.pos-ie;if(ie<0||pe=o?4:0,Je=E.start;for(E.next();E.pos>pe;){if(E.size<0)if(E.size==-3||E.size==-4)Le+=4;else break e;else E.id>=o&&(Le+=4);E.next()}K=Je,Y+=ie,he+=Le}return(P<0||Y==A)&&(j.size=Y,j.start=K,j.skip=he),j.size>4?j:void 0}function v(A,P,E){let{id:Y,start:K,end:he,size:J}=a;if(a.next(),J>=0&&Y4){let ne=a.pos-(J-4);for(;a.pos>ne;)E=v(A,P,E)}P[--E]=j,P[--E]=he-A,P[--E]=K-A,P[--E]=Y}else J==-3?u=Y:J==-4&&(c=Y);return E}let x=[],$=[];for(;a.pos>0;)h(i.start||0,i.bufferStart||0,x,$,-1,0);let R=(e=i.length)!==null&&e!==void 0?e:x.length?$[0]+x[0].length:0;return new _e(l[i.topID],x.reverse(),$.reverse(),R)}var uk=new WeakMap;function yl(i,e){if(!i.isAnonymous||e instanceof yi||e.type!=i)return 1;let t=uk.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=i||!(r instanceof _e)){t=1;break}t+=yl(i,r)}uk.set(e,t)}return t}function mg(i,e,t,r,n,s,o,a,l){let u=0;for(let p=r;p=c)break;P+=E}if($==R+1){if(P>c){let E=p[R];f(E.children,E.positions,0,E.children.length,g[R]+x);continue}h.push(p[R])}else{let E=g[$-1]+p[$-1].length-A;h.push(mg(i,p,g,R,$,A,E,null,l))}d.push(A+x-s)}}return f(e,t,r,n,0),(a||l)(h,d,o)}var tr=class i{constructor(e,t,r,n,s=!1,o=!1){this.from=e,this.to=t,this.tree=r,this.offset=n,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let n=[new i(0,e.length,e,0,!1,r)];for(let s of t)s.to>e.length&&n.push(s);return n}static applyChanges(e,t,r=128){if(!t.length)return e;let n=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,u=0;;a++){let c=a=r)for(;o&&o.from=d.from||h<=d.to||u){let f=Math.max(d.from,l)-u,p=Math.min(d.to,h)-u;d=f>=p?null:new i(f,p,d.tree,d.offset+u,a>0,!!c)}if(d&&n.push(d),o.to>h)break;o=snew Qs(n.from,n.to)):[new Qs(0,0)]:[new Qs(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let n=this.startParse(e,t,r);for(;;){let s=n.advance();if(s)return s}}},$m=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};new H({perNode:!0});var vE=0,xt=class i{constructor(e,t,r,n){this.name=e,this.set=t,this.base=r,this.modified=n,this.id=vE++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof i&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let n=new i(r,[],null,[]);if(n.set.push(n),t)for(let s of t.set)n.set.push(s);return n}static defineModifier(e){let t=new Hl(e);return r=>r.modified.indexOf(t)>-1?r:Hl.get(r.base||r,r.modified.concat(t).sort((n,s)=>n.id-s.id))}},bE=0,Hl=class i{constructor(e){this.name=e,this.instances=[],this.id=bE++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(a=>a.base==e&&yE(t,a.modified));if(r)return r;let n=[],s=new xt(e.name,n,e,t);for(let a of t)a.instances.push(s);let o=kE(t);for(let a of e.set)if(!a.modified.length)for(let l of o)n.push(i.get(a,l));return s}};function yE(i,e){return i.length==e.length&&i.every((t,r)=>t==e[r])}function kE(i){let e=[[]];for(let t=0;tr.length-t.length)}function nw(i){let e=Object.create(null);for(let t in i){let r=i[t];Array.isArray(r)||(r=[r]);for(let n of t.split(" "))if(n){let s=[],o=2,a=n;for(let h=0;;){if(a=="..."&&h>0&&h+3==n.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+n);if(s.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),h+=d[0].length,h==n.length)break;let f=n[h++];if(h==n.length&&f=="!"){o=0;break}if(f!="/")throw new RangeError("Invalid path: "+n);a=n.slice(h)}let l=s.length-1,u=s[l];if(!u)throw new RangeError("Invalid path: "+n);let c=new Qi(r,o,l>0?s.slice(0,l):null);e[u]=c.sort(e[u])}}return rw.add(e)}var rw=new H({combine(i,e){let t,r,n;for(;i||e;){if(!i||e&&i.depth>=e.depth?(n=e,e=e.next):(n=i,i=i.next),t&&t.mode==n.mode&&!n.context&&!t.context)continue;let s=new Qi(n.tags,n.mode,n.context);t?t.next=s:r=s,t=s}return r}}),Qi=class{constructor(e,t,r,n){this.tags=e,this.mode=t,this.context=r,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=n;for(let a of s)for(let l of a.set){let u=t[l.id];if(u){o=o?o+" "+u:u;break}}return o},scope:r}}function xE(i,e){let t=null;for(let r of i){let n=r.style(e);n&&(t=t?t+" "+n:n)}return t}function wE(i,e,t,r=0,n=i.length){let s=new Sm(r,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),r,n,"",s.highlighters),s.flush(n)}var Sm=class{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,n,s){let{type:o,from:a,to:l}=e;if(a>=r||l<=t)return;o.isTop&&(s=this.highlighters.filter(f=>!f.scope||f.scope(o)));let u=n,c=$E(e)||Qi.empty,h=xE(s,c.tags);if(h&&(u&&(u+=" "),u+=h,c.mode==1&&(n+=(n?" ":"")+h)),this.startSpan(Math.max(t,a),u),c.opaque)return;let d=e.tree&&e.tree.prop(H.mounted);if(d&&d.overlay){let f=e.node.enter(d.overlay[0].from+a,1),p=this.highlighters.filter(b=>!b.scope||b.scope(d.tree.type)),g=e.firstChild();for(let b=0,v=a;;b++){let x=b=$||!e.nextSibling())););if(!x||$>r)break;v=x.to+a,v>t&&(this.highlightRange(f.cursor(),Math.max(t,x.from+a),Math.min(r,v),"",p),this.startSpan(Math.min(r,v),u))}g&&e.parent()}else if(e.firstChild()){d&&(n="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,n,s),this.startSpan(Math.min(r,e.to),u)}while(e.nextSibling());e.parent()}}};function $E(i){let e=i.type.prop(rw);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}var I=xt.define,ll=I(),ai=I(),ck=I(ai),hk=I(ai),li=I(),ul=I(li),Jf=I(li),Mt=I(),Li=I(Mt),zt=I(),Pt=I(),_m=I(),Ls=I(_m),cl=I(),w={comment:ll,lineComment:I(ll),blockComment:I(ll),docComment:I(ll),name:ai,variableName:I(ai),typeName:ck,tagName:I(ck),propertyName:hk,attributeName:I(hk),className:I(ai),labelName:I(ai),namespace:I(ai),macroName:I(ai),literal:li,string:ul,docString:I(ul),character:I(ul),attributeValue:I(ul),number:Jf,integer:I(Jf),float:I(Jf),bool:I(li),regexp:I(li),escape:I(li),color:I(li),url:I(li),keyword:zt,self:I(zt),null:I(zt),atom:I(zt),unit:I(zt),modifier:I(zt),operatorKeyword:I(zt),controlKeyword:I(zt),definitionKeyword:I(zt),moduleKeyword:I(zt),operator:Pt,derefOperator:I(Pt),arithmeticOperator:I(Pt),logicOperator:I(Pt),bitwiseOperator:I(Pt),compareOperator:I(Pt),updateOperator:I(Pt),definitionOperator:I(Pt),typeOperator:I(Pt),controlOperator:I(Pt),punctuation:_m,separator:I(_m),bracket:Ls,angleBracket:I(Ls),squareBracket:I(Ls),paren:I(Ls),brace:I(Ls),content:Mt,heading:Li,heading1:I(Li),heading2:I(Li),heading3:I(Li),heading4:I(Li),heading5:I(Li),heading6:I(Li),contentSeparator:I(Mt),list:I(Mt),quote:I(Mt),emphasis:I(Mt),strong:I(Mt),link:I(Mt),monospace:I(Mt),strikethrough:I(Mt),inserted:I(),deleted:I(),changed:I(),invalid:I(),meta:cl,documentMeta:I(cl),annotation:I(cl),processingInstruction:I(cl),definition:xt.defineModifier("definition"),constant:xt.defineModifier("constant"),function:xt.defineModifier("function"),standard:xt.defineModifier("standard"),local:xt.defineModifier("local"),special:xt.defineModifier("special")};for(let i in w){let e=w[i];e instanceof xt&&(e.name=i)}sw([{tag:w.link,class:"tok-link"},{tag:w.heading,class:"tok-heading"},{tag:w.emphasis,class:"tok-emphasis"},{tag:w.strong,class:"tok-strong"},{tag:w.keyword,class:"tok-keyword"},{tag:w.atom,class:"tok-atom"},{tag:w.bool,class:"tok-bool"},{tag:w.url,class:"tok-url"},{tag:w.labelName,class:"tok-labelName"},{tag:w.inserted,class:"tok-inserted"},{tag:w.deleted,class:"tok-deleted"},{tag:w.literal,class:"tok-literal"},{tag:w.string,class:"tok-string"},{tag:w.number,class:"tok-number"},{tag:[w.regexp,w.escape,w.special(w.string)],class:"tok-string2"},{tag:w.variableName,class:"tok-variableName"},{tag:w.local(w.variableName),class:"tok-variableName tok-local"},{tag:w.definition(w.variableName),class:"tok-variableName tok-definition"},{tag:w.special(w.variableName),class:"tok-variableName2"},{tag:w.definition(w.propertyName),class:"tok-propertyName tok-definition"},{tag:w.typeName,class:"tok-typeName"},{tag:w.namespace,class:"tok-namespace"},{tag:w.className,class:"tok-className"},{tag:w.macroName,class:"tok-macroName"},{tag:w.propertyName,class:"tok-propertyName"},{tag:w.operator,class:"tok-operator"},{tag:w.comment,class:"tok-comment"},{tag:w.meta,class:"tok-meta"},{tag:w.invalid,class:"tok-invalid"},{tag:w.punctuation,class:"tok-punctuation"}]);var Kf,Xn=new H;function SE(i){return N.define({combine:i?e=>e.concat(i):void 0})}var _E=new H,rt=class{constructor(e,t,r=[],n=""){this.data=e,this.name=n,$e.prototype.hasOwnProperty("tree")||Object.defineProperty($e.prototype,"tree",{get(){return vt(this)}}),this.parser=t,this.extension=[hr.of(this),$e.languageData.of((s,o,a)=>{let l=dk(s,o,a),u=l.type.prop(Xn);if(!u)return[];let c=s.facet(u),h=l.type.prop(_E);if(h){let d=l.resolve(o-l.from,a);for(let f of h)if(f.test(d,s)){let p=s.facet(f.facet);return f.type=="replace"?p:p.concat(c)}}return c})].concat(r)}isActiveAt(e,t,r=-1){return dk(e,t,r).type.prop(Xn)==this.data}findRegions(e){let t=e.facet(hr);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],n=(s,o)=>{if(s.prop(Xn)==this.data){r.push({from:o,to:o+s.length});return}let a=s.prop(H.mounted);if(a){if(a.tree.prop(Xn)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+o,to:l.to+o});else r.push({from:o,to:o+s.length});return}else if(a.overlay){let l=r.length;if(n(a.tree,a.overlay[0].from+o),r.length>l)return}}for(let l=0;lr.isTop?t:void 0)]}),e.name)}configure(e,t){return new i(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function vt(i){let e=i.field(rt.state,!1);return e?e.tree:_e.empty}var Im=class{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}},js=null,Cm=class i{constructor(e,t,r=[],n,s,o,a,l){this.parser=e,this.state=t,this.fragments=r,this.tree=n,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new i(e,t,[],_e.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Im(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=_e.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let n=Date.now()+e;e=()=>Date.now()>n}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(tr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=js;js=this;try{return e()}finally{js=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=fk(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:n,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((u,c,h,d)=>l.push({fromA:u,toA:c,fromB:h,toB:d})),r=tr.applyChanges(r,l),n=_e.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let u of this.skipped){let c=e.mapPos(u.from,1),h=e.mapPos(u.to,-1);ce.from&&(this.fragments=fk(this.fragments,n,s),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends ql{createParse(t,r,n){let s=n[0].from,o=n[n.length-1].to;return{parsedPos:s,advance(){let l=js;if(l){for(let u of n)l.tempSkipped.push(u);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new _e(Xe.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return js}};function fk(i,e,t){return tr.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}var co=class i{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new i(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=Cm.create(e.facet(hr).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new i(r)}};rt.state=pi.define({create:co.init,update(i,e){for(let t of e.effects)if(t.is(rt.setState))return t.value;return e.startState.facet(hr)!=e.state.facet(hr)?co.init(e.state):i.apply(e)}});var ow=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(ow=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});var Gf=typeof navigator<"u"&&(!((Kf=navigator.scheduling)===null||Kf===void 0)&&Kf.isInputPending)?()=>navigator.scheduling.isInputPending():null,OE=jt.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(rt.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(rt.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=ow(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndn+1e3,l=s.context.work(()=>Gf&&Gf()||Date.now()>o,n+(a?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:rt.setState.of(new co(s.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Rt(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),hr=N.define({combine(i){return i.length?i[0]:null},enables:i=>[rt.state,OE,Z.contentAttributes.compute([i],e=>{let t=e.facet(i);return t&&t.name?{"data-language":t.name}:{}})]}),Tm=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},IE=N.define(),gg=N.define({combine:i=>{if(!i.length)return" ";let e=i[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(i[0]));return e}});function Wl(i){let e=i.facet(gg);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function Vl(i,e){let t="",r=i.tabSize,n=i.facet(gg)[0];if(n==" "){for(;e>=r;)t+=" ",e-=r;n=" "}for(let s=0;s=e?CE(i,t,e):null}var dr=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=Wl(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:n,simulateDoubleBreak:s}=this.options;return n!=null&&n>=r.from&&n<=r.to?s&&n==e?{text:"",from:e}:(t<0?n-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,t=e.length){return po(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:n}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(n);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},lw=new H;function CE(i,e,t){let r=e.resolveStack(t),n=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(n!=r.node){let s=[];for(let o=n;o&&!(o.fromr.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return uw(r,i,t)}function uw(i,e,t){for(let r=i;r;r=r.next){let n=EE(r.node);if(n)return n(Em.create(e,t,r))}return 0}function TE(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function EE(i){let e=i.type.prop(lw);if(e)return e;let t=i.firstChild,r;if(t&&(r=t.type.prop(H.closedBy))){let n=i.lastChild,s=n&&r.indexOf(n.name)>-1;return o=>PE(o,!0,1,void 0,s&&!TE(o)?n.from:void 0)}return i.parent==null?AE:null}function AE(){return 0}var Em=class i extends dr{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new i(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(DE(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return uw(this.context.next,this.base,this.pos)}};function DE(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function zE(i){let e=i.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let n=i.options.simulateBreak,s=i.state.doc.lineAt(t.from),o=n==null||n<=s.from?s.to:Math.min(s.to,n);for(let a=t.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let u=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+u}}a=l.to}}function PE(i,e,t,r,n){let s=i.textAfter,o=s.match(/^\s*/)[0].length,a=n==i.pos+o,l=zE(i);return l?a?i.column(l.from):i.column(l.to):i.baseIndent+(a?0:i.unit*t)}var ME=new H,ho=class i{constructor(e,t){this.specs=e;let r;function n(a){let l=Lt.newName();return(r||(r=Object.create(null)))["."+l]=a,l}let s=typeof t.all=="string"?t.all:t.all?n(t.all):void 0,o=t.scope;this.scope=o instanceof rt?a=>a.prop(Xn)==o.data:o?a=>a==o:void 0,this.style=sw(e.map(a=>({tag:a.tag,class:a.class||n(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=r?new Lt(r):null,this.themeType=t.themeType}static define(e,t){return new i(e,t||{})}},Am=N.define(),cw=N.define({combine(i){return i.length?[i[0]]:null}});function Yf(i){let e=i.facet(Am);return e.length?e:i.facet(cw)}function hw(i,e){let t=[NE],r;return i instanceof ho&&(i.module&&t.push(Z.styleModule.of(i.module)),r=i.themeType),e?.fallback?t.push(cw.of(i)):r?t.push(Am.computeN([Z.darkTheme],n=>n.facet(Z.darkTheme)==(r=="dark")?[i]:[])):t.push(Am.of(i)),t}var Dm=class{constructor(e){this.markCache=Object.create(null),this.tree=vt(e.state),this.decorations=this.buildDeco(e,Yf(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=vt(e.state),r=Yf(e.state),n=r!=Yf(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||n)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return G.none;let r=new rr;for(let{from:n,to:s}of e.visibleRanges)wE(this.tree,t,(o,a,l)=>{r.add(o,a,this.markCache[l]||(this.markCache[l]=G.mark({class:l})))},n,s);return r.finish()}},NE=Ql.high(jt.fromClass(Dm,{decorations:i=>i.decorations})),RE=ho.define([{tag:w.meta,color:"#404740"},{tag:w.link,textDecoration:"underline"},{tag:w.heading,textDecoration:"underline",fontWeight:"bold"},{tag:w.emphasis,fontStyle:"italic"},{tag:w.strong,fontWeight:"bold"},{tag:w.strikethrough,textDecoration:"line-through"},{tag:w.keyword,color:"#708"},{tag:[w.atom,w.bool,w.url,w.contentSeparator,w.labelName],color:"#219"},{tag:[w.literal,w.inserted],color:"#164"},{tag:[w.string,w.deleted],color:"#a11"},{tag:[w.regexp,w.escape,w.special(w.string)],color:"#e40"},{tag:w.definition(w.variableName),color:"#00f"},{tag:w.local(w.variableName),color:"#30a"},{tag:[w.typeName,w.namespace],color:"#085"},{tag:w.className,color:"#167"},{tag:[w.special(w.variableName),w.macroName],color:"#256"},{tag:w.definition(w.propertyName),color:"#00c"},{tag:w.comment,color:"#940"},{tag:w.invalid,color:"#f00"}]),UE=1e4,LE="()[]{}",dw=new H;function zm(i,e,t){let r=i.prop(e<0?H.openedBy:H.closedBy);if(r)return r;if(i.name.length==1){let n=t.indexOf(i.name);if(n>-1&&n%2==(e<0?1:0))return[t[n+e]]}return null}function Pm(i){let e=i.type.prop(dw);return e?e(i.node):i}function Jn(i,e,t,r={}){let n=r.maxScanDistance||UE,s=r.brackets||LE,o=vt(i),a=o.resolveInner(e,t);for(let l=a;l;l=l.parent){let u=zm(l.type,t,s);if(u&&l.from0?e>=c.from&&ec.from&&e<=c.to))return jE(i,e,t,l,c,u,s)}}return BE(i,e,t,o,a.type,n,s)}function jE(i,e,t,r,n,s,o){let a=r.parent,l={from:n.from,to:n.to},u=0,c=a?.cursor();if(c&&(t<0?c.childBefore(r.from):c.childAfter(r.to)))do if(t<0?c.to<=r.from:c.from>=r.to){if(u==0&&s.indexOf(c.type.name)>-1&&c.from0)return null;let u={from:t<0?e-1:e,to:t>0?e+1:e},c=i.doc.iterRange(e,t>0?i.doc.length:0),h=0;for(let d=0;!c.next().done&&d<=s;){let f=c.value;t<0&&(d+=f.length);let p=e+d*t;for(let g=t>0?0:f.length-1,b=t>0?f.length:-1;g!=b;g+=t){let v=o.indexOf(f[g]);if(!(v<0||r.resolveInner(p+g,1).type!=n))if(v%2==0==t>0)h++;else{if(h==1)return{start:u,end:{from:p+g,to:p+g+1},matched:v>>1==l>>1};h--}}t>0&&(d+=f.length)}return c.done?{start:u,matched:!1}:null}var ZE=Object.create(null),pk=[Xe.none],mk=[],gk=Object.create(null),FE=Object.create(null);for(let[i,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])FE[i]=qE(ZE,e);function Qf(i,e){mk.indexOf(i)>-1||(mk.push(i),console.warn(e))}function qE(i,e){let t=[];for(let a of e.split(" ")){let l=[];for(let u of a.split(".")){let c=i[u]||w[u];c?typeof c=="function"?l.length?l=l.map(c):Qf(u,`Modifier ${u} used at start of tag`):l.length?Qf(u,`Tag ${u} used as modifier`):l=Array.isArray(c)?c:[c]:Qf(u,`Unknown highlighting tag ${u}`)}for(let u of l)t.push(u)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),n=r+" "+t.map(a=>a.id),s=gk[n];if(s)return s.id;let o=gk[n]=Xe.define({id:pk.length,name:r,props:[nw({[r]:t})]});return pk.push(o),o.id}be.RTL,be.LTR;var HE=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),r=bg(i.state,t.from);return r.line?WE(i):r.block?XE(i):!1};function vg(i,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let n=i(e,t);return n?(r(t.update(n)),!0):!1}}var WE=vg(GE,0),VE=vg(fw,0),XE=vg((i,e)=>fw(i,e,KE(e)),0);function bg(i,e){let t=i.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}var Bs=50;function JE(i,{open:e,close:t},r,n){let s=i.sliceDoc(r-Bs,r),o=i.sliceDoc(n,n+Bs),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,u=s.length-a;if(s.slice(u-e.length,u)==e&&o.slice(l,l+t.length)==t)return{open:{pos:r-a,margin:a&&1},close:{pos:n+l,margin:l&&1}};let c,h;n-r<=2*Bs?c=h=i.sliceDoc(r,n):(c=i.sliceDoc(r,r+Bs),h=i.sliceDoc(n-Bs,n));let d=/^\s*/.exec(c)[0].length,f=/\s*$/.exec(h)[0].length,p=h.length-f-t.length;return c.slice(d,d+e.length)==e&&h.slice(p,p+t.length)==t?{open:{pos:r+d+e.length,margin:/\s/.test(c.charAt(d+e.length))?1:0},close:{pos:n-f-t.length,margin:/\s/.test(h.charAt(p-1))?1:0}}:null}function KE(i){let e=[];for(let t of i.selection.ranges){let r=i.doc.lineAt(t.from),n=t.to<=r.to?r:i.doc.lineAt(t.to);n.from>r.from&&n.from==t.to&&(n=t.to==r.to+1?r:i.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=n.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:n.to})}return e}function fw(i,e,t=e.selection.ranges){let r=t.map(s=>bg(e,s.from).block);if(!r.every(s=>s))return null;let n=t.map((s,o)=>JE(e,r[o],s.from,s.to));if(i!=2&&!n.every(s=>s))return{changes:e.changes(t.map((s,o)=>n[o]?[]:[{from:s.from,insert:r[o].open+" "},{from:s.to,insert:" "+r[o].close}]))};if(i!=1&&n.some(s=>s)){let s=[];for(let o=0,a;on&&(s==o||o>h.from)){n=h.from;let d=/^\s*/.exec(h.text)[0].length,f=d==h.length,p=h.text.slice(d,d+u.length)==u?d:-1;ds.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:u,empty:c,single:h}of r)(h||!c)&&s.push({from:a.from+u,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(i!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of r)if(a>=0){let u=o.from+a,c=u+l.length;o.text[c-o.from]==" "&&c++,s.push({from:u,to:c})}return{changes:s}}return null}var Mm=Ut.define(),YE=Ut.define(),QE=N.define(),pw=N.define({combine(i){return fo(i,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,n)=>e(r,n)||t(r,n)})}}),mw=pi.define({create(){return Xi.empty},update(i,e){let t=e.state.facet(pw),r=e.annotation(Mm);if(r){let l=St.fromTransaction(e,r.selection),u=r.side,c=u==0?i.undone:i.done;return l?c=Xl(c,c.length,t.minDepth,l):c=bw(c,e.startState.selection),new Xi(u==0?r.rest:c,u==0?c:r.rest)}let n=e.annotation(YE);if((n=="full"||n=="before")&&(i=i.isolate()),e.annotation(Re.addToHistory)===!1)return e.changes.empty?i:i.addMapping(e.changes.desc);let s=St.fromTransaction(e),o=e.annotation(Re.time),a=e.annotation(Re.userEvent);return s?i=i.addChanges(s,o,a,t,e):e.selection&&(i=i.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(n=="full"||n=="after")&&(i=i.isolate()),i},toJSON(i){return{done:i.done.map(e=>e.toJSON()),undone:i.undone.map(e=>e.toJSON())}},fromJSON(i){return new Xi(i.done.map(St.fromJSON),i.undone.map(St.fromJSON))}});function eA(i={}){return[mw,pw.of(i),Z.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?gw:e.inputType=="historyRedo"?Nm:null;return r?(e.preventDefault(),r(t)):!1}})]}function nu(i,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let n=t.field(mw,!1);if(!n)return!1;let s=n.pop(i,t,e);return s?(r(s),!0):!1}}var gw=nu(0,!1),Nm=nu(1,!1),tA=nu(0,!0),iA=nu(1,!0),St=class i{constructor(e,t,r,n,s){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=n,this.selectionsAfter=s}setSelAfter(e){return new i(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(n=>n.toJSON())}}static fromJSON(e){return new i(e.changes&&ot.fromJSON(e.changes),[],e.mapped&&hi.fromJSON(e.mapped),e.startSelection&&O.fromJSON(e.startSelection),e.selectionsAfter.map(O.fromJSON))}static fromTransaction(e,t){let r=gt;for(let n of e.startState.facet(QE)){let s=n(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new i(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,gt)}static selection(e){return new i(void 0,gt,void 0,void 0,e)}};function Xl(i,e,t,r){let n=e+1>t+20?e-t-1:0,s=i.slice(n,e);return s.push(r),s}function nA(i,e){let t=[],r=!1;return i.iterChangedRanges((n,s)=>t.push(n,s)),e.iterChangedRanges((n,s,o,a)=>{for(let l=0;l=u&&o<=c&&(r=!0)}}),r}function rA(i,e){return i.ranges.length==e.ranges.length&&i.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function vw(i,e){return i.length?e.length?i.concat(e):i:e}var gt=[],sA=200;function bw(i,e){if(i.length){let t=i[i.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-sA));return r.length&&r[r.length-1].eq(e)?i:(r.push(e),Xl(i,i.length-1,1e9,t.setSelAfter(r)))}else return[St.selection([e])]}function oA(i){let e=i[i.length-1],t=i.slice();return t[i.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function ep(i,e){if(!i.length)return i;let t=i.length,r=gt;for(;t;){let n=aA(i[t-1],e,r);if(n.changes&&!n.changes.empty||n.effects.length){let s=i.slice(0,t);return s[t-1]=n,s}else e=n.mapped,t--,r=n.selectionsAfter}return r.length?[St.selection(r)]:gt}function aA(i,e,t){let r=vw(i.selectionsAfter.length?i.selectionsAfter.map(a=>a.map(e)):gt,t);if(!i.changes)return St.selection(r);let n=i.changes.map(e),s=e.mapDesc(i.changes,!0),o=i.mapped?i.mapped.composeDesc(s):s;return new St(n,we.mapEffects(i.effects,e),o,i.startSelection.map(s),r)}var lA=/^(input\.type|delete)($|\.)/,Xi=class i{constructor(e,t,r=0,n=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=n}isolate(){return this.prevTime?new i(this.done,this.undone):this}addChanges(e,t,r,n,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||lA.test(r))&&(!a.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?i.moveByChar(t,e):ru(t,e))}function Ue(i){return i.textDirectionAt(i.state.selection.main.head)==be.LTR}var xw=i=>kw(i,!Ue(i)),ww=i=>kw(i,Ue(i));function $w(i,e){return It(i,t=>t.empty?i.moveByGroup(t,e):ru(t,e))}var uA=i=>$w(i,!Ue(i)),cA=i=>$w(i,Ue(i));function hA(i,e,t){if(e.type.prop(t))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(i.sliceDoc(e.from,e.to)))||e.firstChild}function su(i,e,t){let r=vt(i).resolveInner(e.head),n=t?H.closedBy:H.openedBy;for(let l=e.head;;){let u=t?r.childAfter(l):r.childBefore(l);if(!u)break;hA(i,u,n)?r=u:l=t?u.to:u.from}let s=r.type.prop(n),o,a;return s&&(o=t?Jn(i,r.from,1):Jn(i,r.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?r.to:r.from,O.cursor(a,t?-1:1)}var dA=i=>It(i,e=>su(i.state,e,!Ue(i))),fA=i=>It(i,e=>su(i.state,e,Ue(i)));function Sw(i,e){return It(i,t=>{if(!t.empty)return ru(t,e);let r=i.moveVertically(t,e);return r.head!=t.head?r:i.moveToLineBoundary(t,e)})}var _w=i=>Sw(i,!1),Ow=i=>Sw(i,!0);function Iw(i){let e=i.scrollDOM.clientHeighto.empty?i.moveVertically(o,e,t.height):ru(o,e));if(n.eq(r.selection))return!1;let s;if(t.selfScroll){let o=i.coordsAtPos(r.selection.main.head),a=i.scrollDOM.getBoundingClientRect(),l=a.top+t.marginTop,u=a.bottom-t.marginBottom;o&&o.top>l&&o.bottomCw(i,!1),Rm=i=>Cw(i,!0);function ki(i,e,t){let r=i.lineBlockAt(e.head),n=i.moveToLineBoundary(e,t);if(n.head==e.head&&n.head!=(t?r.to:r.from)&&(n=i.moveToLineBoundary(e,t,!1)),!t&&n.head==r.from&&r.length){let s=/^\s*/.exec(i.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(n=O.cursor(r.from+s))}return n}var pA=i=>It(i,e=>ki(i,e,!0)),mA=i=>It(i,e=>ki(i,e,!1)),gA=i=>It(i,e=>ki(i,e,!Ue(i))),vA=i=>It(i,e=>ki(i,e,Ue(i))),bA=i=>It(i,e=>O.cursor(i.lineBlockAt(e.head).from,1)),yA=i=>It(i,e=>O.cursor(i.lineBlockAt(e.head).to,-1));function kA(i,e,t){let r=!1,n=fr(i.selection,s=>{let o=Jn(i,s.head,-1)||Jn(i,s.head,1)||s.head>0&&Jn(i,s.head-1,1)||s.headkA(i,e);function bt(i,e,t){let r=fr(i.state.selection,n=>{n.undirectional&&n.head>=n.anchor!=e&&(n=O.range(n.head,n.anchor));let s=t(n);return O.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return r.eq(i.state.selection)?!1:(i.dispatch(Ot(i.state,r)),!0)}function Tw(i,e){return bt(i,e,t=>i.moveByChar(t,e))}var Ew=i=>Tw(i,!Ue(i)),Aw=i=>Tw(i,Ue(i));function Dw(i,e){return bt(i,e,t=>i.moveByGroup(t,e))}var wA=i=>Dw(i,!Ue(i)),$A=i=>Dw(i,Ue(i)),SA=i=>{let e=!Ue(i);return bt(i,e,t=>su(i.state,t,e))},_A=i=>{let e=Ue(i);return bt(i,e,t=>su(i.state,t,e))};function zw(i,e){return bt(i,e,t=>i.moveVertically(t,e))}var Pw=i=>zw(i,!1),Mw=i=>zw(i,!0);function Nw(i,e){return bt(i,e,t=>i.moveVertically(t,e,Iw(i).height))}var bk=i=>Nw(i,!1),yk=i=>Nw(i,!0),OA=i=>bt(i,!0,e=>ki(i,e,!0)),IA=i=>bt(i,!1,e=>ki(i,e,!1)),CA=i=>{let e=!Ue(i);return bt(i,e,t=>ki(i,t,e))},TA=i=>{let e=Ue(i);return bt(i,e,t=>ki(i,t,e))},EA=i=>bt(i,!1,e=>O.cursor(i.lineBlockAt(e.head).from)),AA=i=>bt(i,!0,e=>O.cursor(i.lineBlockAt(e.head).to)),kk=({state:i,dispatch:e})=>(e(Ot(i,{anchor:0})),!0),xk=({state:i,dispatch:e})=>(e(Ot(i,{anchor:i.doc.length})),!0),wk=({state:i,dispatch:e})=>(e(Ot(i,{anchor:i.selection.main.anchor,head:0})),!0),$k=({state:i,dispatch:e})=>(e(Ot(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),DA=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),zA=({state:i,dispatch:e})=>{let t=ou(i).map(({from:r,to:n})=>O.range(r,Math.min(n+1,i.doc.length)));return e(i.update({selection:O.create(t),userEvent:"select"})),!0},PA=({state:i,dispatch:e})=>{let t=fr(i.selection,r=>{let n=vt(i),s=n.resolveStack(r.from,1);if(r.empty){let o=n.resolveStack(r.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:a}=o;if((a.from=r.to||a.to>r.to&&a.from<=r.from)&&o.next)return O.range(a.to,a.from)}return r});return t.eq(i.selection)?!1:(e(Ot(i,t)),!0)};function Rw(i,e){let{state:t}=i,r=t.selection,n=t.selection.ranges.slice();for(let s of t.selection.ranges){let o=t.doc.lineAt(s.head);if(e?o.to0)for(let a=s;;){let l=i.moveVertically(a,e);if(l.heado.to){n.some(u=>u.head==l.head)||n.push(l);break}else{if(l.head==a.head)break;a=l}}}return n.length==r.ranges.length?!1:(i.dispatch(Ot(t,O.create(n,n.length-1))),!0)}var MA=i=>Rw(i,!1),NA=i=>Rw(i,!0),RA=({state:i,dispatch:e})=>{let t=i.selection,r=null;return t.ranges.length>1?r=O.create([t.main]):t.main.empty||(r=O.create([O.cursor(t.main.head)])),r?(e(Ot(i,r)),!0):!1};function go(i,e){if(i.state.readOnly)return!1;let t="delete.selection",{state:r}=i,n=r.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let l=e(s);lo&&(t="delete.forward",l=hl(i,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=hl(i,o,!1),a=hl(i,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:O.cursor(o,on(i)))r.between(e,e,(n,s)=>{ne&&(e=t?s:n)});return e}var Uw=(i,e,t)=>go(i,r=>{let n=r.from,{state:s}=i,o=s.doc.lineAt(n),a,l;if(t&&!e&&n>o.from&&nUw(i,!1,!0),Lw=i=>Uw(i,!0,!1),jw=(i,e)=>go(i,t=>{let r=t.head,{state:n}=i,s=n.doc.lineAt(r),o=n.charCategorizer(r);for(let a=null;;){if(r==(e?s.to:s.from)){r==t.head&&s.number!=(e?n.doc.lines:1)&&(r+=e?1:-1);break}let l=Ne(s.text,r-s.from,e)+s.from,u=s.text.slice(Math.min(r,l)-s.from,Math.max(r,l)-s.from),c=o(u);if(a!=null&&c!=a)break;(u!=" "||r!=t.head)&&(a=c),r=l}return r}),Bw=i=>jw(i,!1),UA=i=>jw(i,!0),LA=i=>go(i,e=>{let t=i.lineBlockAt(e.head).to;return e.headgo(i,e=>{let t=i.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),BA=i=>go(i,e=>{let t=i.moveToLineBoundary(e,!0).head;return e.head{if(i.readOnly)return!1;let t=i.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:te.of(["",""])},range:O.cursor(r.from)}));return e(i.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},FA=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(r=>{if(!r.empty||r.from==0||r.from==i.doc.length)return{range:r};let n=r.from,s=i.doc.lineAt(n),o=n==s.from?n-1:Ne(s.text,n-s.from,!1)+s.from,a=n==s.to?n+1:Ne(s.text,n-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:i.doc.slice(n,a).append(i.doc.slice(o,n))},range:O.cursor(a)}});return t.changes.empty?!1:(e(i.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ou(i){let e=[],t=-1;for(let r of i.selection.ranges){let n=i.doc.lineAt(r.from),s=i.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=i.doc.lineAt(r.to-1)),t>=n.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(r)}else e.push({from:n.from,to:s.to,ranges:[r]});t=s.number+1}return e}function Zw(i,e,t){if(i.readOnly)return!1;let r=[],n=[];for(let s of ou(i)){if(t?s.to==i.doc.length:s.from==0)continue;let o=i.doc.lineAt(t?s.to+1:s.from-1),a=o.length+1;if(t){r.push({from:s.to,to:o.to},{from:s.from,insert:o.text+i.lineBreak});for(let l of s.ranges)n.push(O.range(Math.min(i.doc.length,l.anchor+a),Math.min(i.doc.length,l.head+a)))}else{r.push({from:o.from,to:s.from},{from:s.to,insert:i.lineBreak+o.text});for(let l of s.ranges)n.push(O.range(l.anchor-a,l.head-a))}}return r.length?(e(i.update({changes:r,scrollIntoView:!0,selection:O.create(n,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}var qA=({state:i,dispatch:e})=>Zw(i,e,!1),HA=({state:i,dispatch:e})=>Zw(i,e,!0);function Fw(i,e,t){if(i.readOnly)return!1;let r=[];for(let s of ou(i))t?r.push({from:s.from,insert:i.doc.slice(s.from,s.to)+i.lineBreak}):r.push({from:s.to,insert:i.lineBreak+i.doc.slice(s.from,s.to)});let n=i.changes(r);return e(i.update({changes:n,selection:i.selection.map(n,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}var WA=({state:i,dispatch:e})=>Fw(i,e,!1),VA=({state:i,dispatch:e})=>Fw(i,e,!0),XA=i=>{if(i.state.readOnly)return!1;let{state:e}=i,t=e.changes(ou(e).map(({from:n,to:s})=>(n>0?n--:s{let s;if(i.lineWrapping){let o=i.lineBlockAt(n.head),a=i.coordsAtPos(n.head,n.assoc||1);a&&(s=o.bottom+i.documentTop-a.bottom+i.defaultLineHeight/2)}return i.moveVertically(n,!0,s)}).map(t);return i.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function JA(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=vt(i).resolveInner(e),r=t.childBefore(e),n=t.childAfter(e),s;return r&&n&&r.to<=e&&n.from>=e&&(s=r.type.prop(H.closedBy))&&s.indexOf(n.name)>-1&&i.doc.lineAt(r.to).from==i.doc.lineAt(n.from).from&&!/\S/.test(i.sliceDoc(r.to,n.from))?{from:r.to,to:n.from}:null}var Sk=qw(!1),KA=qw(!0);function qw(i){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>{let{from:s,to:o}=n,a=e.doc.lineAt(s),l=!i&&s==o&&JA(e,s);i&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let u=new dr(e,{simulateBreak:s,simulateDoubleBreak:!!l}),c=aw(u,s);for(c==null&&(c=po(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));oa.from&&s{let n=[];for(let o=r.from;o<=r.to;){let a=i.doc.lineAt(o);a.number>t&&(r.empty||r.to>a.from)&&(e(a,n,r),t=a.number),o=a.to+1}let s=i.changes(n);return{changes:n,range:O.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}var GA=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=Object.create(null),r=new dr(i,{overrideIndentation:s=>{let o=t[s];return o??-1}}),n=yg(i,(s,o,a)=>{let l=aw(r,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let u=/^\s*/.exec(s.text)[0],c=Vl(i,l);(u!=c||a.fromi.readOnly?!1:(e(i.update(yg(i,(t,r)=>{r.push({from:t.from,insert:i.facet(gg)})}),{userEvent:"input.indent"})),!0),QA=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(yg(i,(t,r)=>{let n=/^\s*/.exec(t.text)[0];if(!n)return;let s=po(n,i.tabSize),o=0,a=Vl(i,Math.max(0,s-Wl(i)));for(;o(i.setTabFocusMode(),!0),tD=[{key:"Ctrl-b",run:xw,shift:Ew,preventDefault:!0},{key:"Ctrl-f",run:ww,shift:Aw},{key:"Ctrl-p",run:_w,shift:Pw},{key:"Ctrl-n",run:Ow,shift:Mw},{key:"Ctrl-a",run:bA,shift:EA},{key:"Ctrl-e",run:yA,shift:AA},{key:"Ctrl-d",run:Lw},{key:"Ctrl-h",run:Um},{key:"Ctrl-k",run:LA},{key:"Ctrl-Alt-h",run:Bw},{key:"Ctrl-o",run:ZA},{key:"Ctrl-t",run:FA},{key:"Ctrl-v",run:Rm}],iD=[{key:"ArrowLeft",run:xw,shift:Ew,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:uA,shift:wA,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:gA,shift:CA,preventDefault:!0},{key:"ArrowRight",run:ww,shift:Aw,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:cA,shift:$A,preventDefault:!0},{mac:"Cmd-ArrowRight",run:vA,shift:TA,preventDefault:!0},{key:"ArrowUp",run:_w,shift:Pw,preventDefault:!0},{mac:"Cmd-ArrowUp",run:kk,shift:wk},{mac:"Ctrl-ArrowUp",run:vk,shift:bk},{key:"ArrowDown",run:Ow,shift:Mw,preventDefault:!0},{mac:"Cmd-ArrowDown",run:xk,shift:$k},{mac:"Ctrl-ArrowDown",run:Rm,shift:yk},{key:"PageUp",run:vk,shift:bk},{key:"PageDown",run:Rm,shift:yk},{key:"Home",run:mA,shift:IA,preventDefault:!0},{key:"Mod-Home",run:kk,shift:wk},{key:"End",run:pA,shift:OA,preventDefault:!0},{key:"Mod-End",run:xk,shift:$k},{key:"Enter",run:Sk,shift:Sk},{key:"Mod-a",run:DA},{key:"Backspace",run:Um,shift:Um,preventDefault:!0},{key:"Delete",run:Lw,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Bw,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:UA,preventDefault:!0},{mac:"Mod-Backspace",run:jA,preventDefault:!0},{mac:"Mod-Delete",run:BA,preventDefault:!0}].concat(tD.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),Hw=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:dA,shift:SA},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:fA,shift:_A},{key:"Alt-ArrowUp",run:qA},{key:"Shift-Alt-ArrowUp",run:WA},{key:"Alt-ArrowDown",run:HA},{key:"Shift-Alt-ArrowDown",run:VA},{key:"Mod-Alt-ArrowUp",run:MA},{key:"Mod-Alt-ArrowDown",run:NA},{key:"Escape",run:RA},{key:"Mod-Enter",run:KA},{key:"Alt-l",mac:"Ctrl-l",run:zA},{key:"Mod-i",run:PA,preventDefault:!0},{key:"Mod-[",run:QA},{key:"Mod-]",run:YA},{key:"Mod-Alt-\\",run:GA},{key:"Shift-Mod-k",run:XA},{key:"Shift-Mod-\\",run:xA},{key:"Mod-/",run:HE},{key:"Alt-A",run:VE},{key:"Ctrl-m",mac:"Shift-Alt-m",run:eD}].concat(iD),Lm=class i{constructor(e,t,r,n,s,o,a,l,u,c=0,h){this.p=e,this.stack=t,this.state=r,this.reducePos=n,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=u,this.lookAhead=c,this.parent=h}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,r=0){let n=e.parser.context;return new i(e,[],t,r,r,0,[],0,n?new Jl(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let r=e>>19,n=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[n])===null||t===void 0)&&t.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(n,u)}storeNode(e,t,r,n=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(t==r)return;if(this.buffer[o-2]>=t){this.buffer[o-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,t,r,n);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let a=!1;for(let l=o;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;o>0&&this.buffer[o-2]>r;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,n>4&&(n-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=r,this.buffer[o+3]=n}}shift(e,t,r,n){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=n;let a=o.stateFlag(s,1);!a&&(n>r||t<=o.maxNode)&&(this.reducePos=n),this.pushState(s,a?r:Math.min(r,this.reducePos)),this.shiftContext(t,r),t<=o.maxNode&&this.buffer.push(t,r,n,4)}else this.pos=n,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,n,4)}apply(e,t,r,n){e&65536?this.reduce(e):this.shift(e,t,r,n)}useNode(e,t){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let n=this.pos;this.reducePos=this.pos=n+e.length,this.pushState(t,n),this.buffer.push(r,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let r=e.buffer.slice(t),n=e.bufferBase+t;for(;e&&n==e.bufferBase;)e=e.parent;return new i(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,n,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,r?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new jm(this);;){let r=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(r==0)return!1;if((r&65536)==0)return!0;t.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let s=0,o;sl&1&&a==o)||n.push(t[s],o)}t=n}let r=[];for(let n=0;n>19,n=t&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],n,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],r=(n,s)=>{if(!t.includes(n))return t.push(n),e.allActions(n,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let l=o&65535,u=this.stack.length-a*3;if(u>=0&&e.getGoto(this.stack[u],l,!1)>=0)return a<<19|65536|l}}else{let a=r(o,s+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t0&&this.emitLookAhead()}},Jl=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},jm=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=n}},Bm=class i{constructor(e,t,r){this.stack=e,this.pos=t,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new i(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new i(this.stack,this.pos,this.index)}};function dl(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let r=0,n=0;r=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}t?t[n++]=s:t=new e(s)}return t}var ir=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},_k=new ir,Zm=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=_k,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let r=this.range,n=this.rangeIndex,s=this.pos+e;for(;sr.to:s>=r.to;){if(n==this.ranges.length-1)return null;let o=this.ranges[++n];s+=o.from-r.to,r=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,r,n;if(t>=0&&t=this.chunk2Pos&&ra.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),n=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),n}acceptToken(e,t=0){let r=t?this.resolveOffset(t,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=_k,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let r="";for(let n of this.ranges){if(n.from>=t)break;n.to>e&&(r+=this.input.read(Math.max(n.from,e),Math.min(n.to,t)))}return r}},fi=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:r}=t.p;nD(this.data,e,t,this.id,r.data,r.tokenPrecTable)}};fi.prototype.contextual=fi.prototype.fallback=fi.prototype.extend=!1;fi.prototype.fallback=fi.prototype.extend=!1;var Kl=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function nD(i,e,t,r,n,s){let o=0,a=1<0){let p=i[f];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||rD(p,e.token.value,n,s))){e.acceptToken(p);break}}let c=e.next,h=0,d=i[o+2];if(e.next<0&&d>h&&i[u+d*3-3]==65535){o=i[u+d*3-1];continue e}for(;h>1,p=u+f+(f<<1),g=i[p],b=i[p+1]||65536;if(c=b)h=f+1;else{o=i[p+2],e.advance();continue e}}break}}function Ok(i,e,t){for(let r=e,n;(n=i[r])!=65535;r++)if(n==t)return r-e;return-1}function rD(i,e,t,r){let n=Ok(t,r,e);return n<0||Ok(t,r,i)e)&&!r.type.isError)return t<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(i.length,Math.max(r.from+1,e+25));if(t<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return t<0?0:i.length}}var Fm=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Ik(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Ik(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof _e){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}},qm=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new ir)}getActions(e){let t=0,r=null,{parser:n}=e.p,{tokenizers:s}=n,o=n.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let u=0;uh.end+25&&(l=Math.max(h.lookAhead,l)),h.value!=0)){let d=t;if(h.extended>-1&&(t=this.addActions(e,h.extended,h.end,t)),t=this.addActions(e,h.value,h.end,t),!c.extend&&(r=h,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new ir,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,t=this.addActions(e,r.value,r.end,t)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new ir,{pos:r,p:n}=e;return t.start=r,t.end=Math.min(r+1,n.stream.end),t.value=r==n.stream.end?n.parser.eofTerm:0,t}updateCachedToken(e,t,r){let n=this.stream.clipPos(r.pos);if(t.token(this.stream.reset(n,e),r),e.value>-1){let{parser:s}=r.p;for(let o=0;o=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(n+1)}putAction(e,t,r,n){for(let s=0;se.bufferLength*4?new Fm(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,r=this.stacks=[],n,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)r.push(a);else{if(this.advanceStack(a,r,e))continue;{n||(n=[],s=[]),n.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!r.length){let o=n&&sD(n);if(o)return et&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw et&&n&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&n){let o=this.stoppedAt!=null&&n[0].pos>this.stoppedAt?n[0]:this.runRecovery(n,s,r);if(o)return et&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(r.length>o)for(r.sort((a,l)=>l.score-a.score);r.length>o;)r.pop();r.some(a=>a.reducePos>t)&&this.recovering--}else if(r.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((a.score-u.score||a.buffer.length-u.buffer.length)>0)r.splice(l--,1);else{r.splice(o--,1);continue e}}}r.length>12&&(r.sort((o,a)=>a.score-o.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&n>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let u=e.curContext&&e.curContext.tracker.strict,c=u?e.curContext.hash:0;for(let h=this.fragments.nodeAt(n);h;){let d=this.parser.nodeSet.types[h.type.id]==h.type?s.getGoto(e.state,h.type.id):-1;if(d>-1&&h.length&&(!u||(h.prop(H.contextHash)||0)==c))return e.useNode(h,d),et&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(h.type.id)})`),!0;if(!(h instanceof _e)||h.children.length==0||h.positions[0]>0)break;let f=h.children[0];if(f instanceof _e&&h.positions[0]==0)h=f;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),et&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let u=0;un?t.push(p):r.push(p)}return!1}advanceFully(e,t){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return Ck(e,t),!0}}runRecovery(e,t,r){let n=null,s=!1;for(let o=0;o ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),et&&console.log(c+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let h=a.split(),d=c;for(let f=0;f<10&&h.forceReduce()&&(et&&console.log(d+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,r));f++)et&&(d=this.stackID(h)+" -> ");for(let f of a.recoverByInsert(l))et&&console.log(c+this.stackID(f)+" (via recover-insert)"),this.advanceFully(f,r);this.stream.end>a.pos?(u==a.pos&&(u++,l=0),a.recoverByDelete(l,u),et&&console.log(c+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),Ck(a,r)):(!n||n.scorei,Vm=class{constructor(e){this.start=e.start,this.shift=e.shift||ip,this.reduce=e.reduce||ip,this.reuse=e.reuse||ip,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},Xm=class i extends ql{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let a=0;ae.topRules[a][1]),n=[];for(let a=0;a=0)s(c,l,a[u++]);else{let h=a[u+-c];for(let d=-c;d>0;d--)s(a[u++],l,h);u++}}}this.nodeSet=new bm(t.map((a,l)=>Xe.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:n[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=ew;let o=dl(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new fi(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,r){let n=new Hm(this,e,t,r);for(let s of this.wrappers)n=s(n,e,t,r);return n}getGoto(e,t,r=!1){let n=this.goto;if(t>=n[0])return-1;for(let s=n[t+1];;){let o=n[s++],a=o&1,l=n[s++];if(a&&r)return l;for(let u=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,r=>r==t?!0:null)}allActions(e,t){let r=this.stateSlot(e,4),n=r?t(r):void 0;for(let s=this.stateSlot(e,1);n==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Jt(this.data,s+2);else break;n=t(Jt(this.data,s+1))}return n}nextStates(e){let t=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Jt(this.data,r+2);else break;if((this.data[r+2]&1)==0){let n=this.data[r+1];t.some((s,o)=>o&1&&s==n)||t.push(this.data[r],n)}}return t}configure(e){let t=Object.assign(Object.create(i.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=r}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(r=>{let n=e.tokenizers.find(s=>s.from==r);return n?n.to:r})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((r,n)=>{let s=e.specializers.find(a=>a.from==r.external);if(!s)return r;let o=Object.assign(Object.assign({},r),{external:s.to});return t.specializers[n]=Tk(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),r=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(r[o]=!0)}let n=null;for(let s=0;sr)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,r)<<1|e}return i.get}var Jm=1,oD=2,aD=3,lD=4,uD=5,cD=36,hD=37,dD=38,fD=11,pD=13;function mD(i){return i==45||i==46||i==58||i>=65&&i<=90||i==95||i>=97&&i<=122||i>=161}function gD(i){return i==9||i==10||i==13||i==32}var Ek=null,Ak=null,Dk=0;function Km(i,e){let t=i.pos+e;if(Ak==i&&Dk==t)return Ek;for(;gD(i.peek(e));)e++;let r="";for(;;){let n=i.peek(e);if(!mD(n))break;r+=String.fromCharCode(n),e++}return Ak=i,Dk=t,Ek=r||null}function zk(i,e){this.name=i,this.parent=e}var vD=new Vm({start:null,shift(i,e,t,r){return e==Jm?new zk(Km(r,1)||"",i):i},reduce(i,e){return e==fD&&i?i.parent:i},reuse(i,e,t,r){let n=e.type.id;return n==Jm||n==pD?new zk(Km(r,1)||"",i):i},strict:!1}),bD=new Kl((i,e)=>{if(i.next==60){if(i.advance(),i.next==47){i.advance();let t=Km(i,0);if(!t)return i.acceptToken(uD);if(e.context&&t==e.context.name)return i.acceptToken(oD);for(let r=e.context;r;r=r.parent)if(r.name==t)return i.acceptToken(aD,-2);i.acceptToken(lD)}else if(i.next!=33&&i.next!=63)return i.acceptToken(Jm)}},{contextual:!0});function kg(i,e){return new Kl(t=>{let r=0,n=e.charCodeAt(0);e:for(;!(t.next<0);t.advance(),r++)if(t.next==n){for(let s=1;s"),kD=kg(hD,"?>"),xD=kg(dD,"]]>"),wD=nw({Text:w.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":w.angleBracket,TagName:w.tagName,"MismatchedCloseTag/TagName":[w.tagName,w.invalid],AttributeName:w.attributeName,AttributeValue:w.attributeValue,Is:w.definitionOperator,"EntityReference CharacterReference":w.character,Comment:w.blockComment,ProcessingInst:w.processingInstruction,DoctypeDecl:w.documentMeta,Cdata:w.special(w.string)}),$D=Xm.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G.uO(TOpO7+$fOOOP7+$f7+$fO(]O!bO<c!|;'S(o;'S;=`)]<%lO(oi>jX|W!O`Or(ors&osv(owx'}x!r(o!r!s?V!s;'S(o;'S;=`)]<%lO(oi?^X|W!O`Or(ors&osv(owx'}x!g(o!g!h?y!h;'S(o;'S;=`)]<%lO(oi@QY|W!O`Or?yrs@psv?yvwA[wxBdx!`?y!`!aCr!a;'S?y;'S;=`Db<%lO?ya@uV!O`Ov@pvxA[x!`@p!`!aAy!a;'S@p;'S;=`B^<%lO@pPA_TO!`A[!`!aAn!a;'SA[;'S;=`As<%lOA[PAsOiPPAvP;=`<%lA[aBQSiP!O`Ov&ox;'S&o;'S;=`'Q<%lO&oaBaP;=`<%l@pXBiX|WOrBdrsA[svBdvwA[w!`Bd!`!aCU!a;'SBd;'S;=`Cl<%lOBdXC]TiP|WOr'}sv'}w;'S'};'S;=`(c<%lO'}XCoP;=`<%lBdiC{ViP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiDeP;=`<%l?yiDoZ|W!O`Or(ors&osv(owx'}x!e(o!e!fEb!f#V(o#V#WIr#W;'S(o;'S;=`)]<%lO(oiEiX|W!O`Or(ors&osv(owx'}x!f(o!f!gFU!g;'S(o;'S;=`)]<%lO(oiF]X|W!O`Or(ors&osv(owx'}x!c(o!c!dFx!d;'S(o;'S;=`)]<%lO(oiGPX|W!O`Or(ors&osv(owx'}x!v(o!v!wGl!w;'S(o;'S;=`)]<%lO(oiGsX|W!O`Or(ors&osv(owx'}x!c(o!c!dH`!d;'S(o;'S;=`)]<%lO(oiHgX|W!O`Or(ors&osv(owx'}x!}(o!}#OIS#O;'S(o;'S;=`)]<%lO(oiI]V|W!O`yPOr(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiIyX|W!O`Or(ors&osv(owx'}x#W(o#W#XJf#X;'S(o;'S;=`)]<%lO(oiJmX|W!O`Or(ors&osv(owx'}x#T(o#T#UKY#U;'S(o;'S;=`)]<%lO(oiKaX|W!O`Or(ors&osv(owx'}x#h(o#h#iK|#i;'S(o;'S;=`)]<%lO(oiLTX|W!O`Or(ors&osv(owx'}x#T(o#T#UH`#U;'S(o;'S;=`)]<%lO(oiLwX|W!O`Or(ors&osv(owx'}x#c(o#c#dMd#d;'S(o;'S;=`)]<%lO(oiMkX|W!O`Or(ors&osv(owx'}x#V(o#V#WNW#W;'S(o;'S;=`)]<%lO(oiN_X|W!O`Or(ors&osv(owx'}x#h(o#h#iNz#i;'S(o;'S;=`)]<%lO(oi! RX|W!O`Or(ors&osv(owx'}x#m(o#m#n! n#n;'S(o;'S;=`)]<%lO(oi! uX|W!O`Or(ors&osv(owx'}x#d(o#d#e!!b#e;'S(o;'S;=`)]<%lO(oi!!iX|W!O`Or(ors&osv(owx'}x#X(o#X#Y?y#Y;'S(o;'S;=`)]<%lO(oi!#_V!SP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(ok!$PXaQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo!$wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[bD,yD,kD,xD,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function kl(i,e){let t=e&&e.getChild("TagName");return t?i.sliceString(t.from,t.to):""}function np(i,e){let t=e&&e.firstChild;return!t||t.name!="OpenTag"?"":kl(i,t)}function SD(i,e,t){let r=e&&e.getChildren("Attribute").find(s=>s.from<=t&&s.to>=t),n=r&&r.getChild("AttributeName");return n?i.sliceString(n.from,n.to):""}function rp(i){for(let e=i&&i.parent;e;e=e.parent)if(e.name=="Element")return e;return null}function _D(i,e){var t;let r=vt(i).resolveInner(e,-1),n=null;for(let s=r;!n&&s.parent;s=s.parent)(s.name=="OpenTag"||s.name=="CloseTag"||s.name=="SelfClosingTag"||s.name=="MismatchedCloseTag")&&(n=s);if(n&&(n.to>e||n.lastChild.type.isError)){let s=n.parent;if(r.name=="TagName")return n.name=="CloseTag"||n.name=="MismatchedCloseTag"?{type:"closeTag",from:r.from,context:s}:{type:"openTag",from:r.from,context:rp(s)};if(r.name=="AttributeName")return{type:"attrName",from:r.from,context:n};if(r.name=="AttributeValue")return{type:"attrValue",from:r.from,context:n};let o=r==n||r.name=="Attribute"?r.childBefore(e):r;return o?.name=="StartTag"?{type:"openTag",from:e,context:rp(s)}:o?.name=="StartCloseTag"&&o.to<=e?{type:"closeTag",from:e,context:s}:o?.name=="Is"?{type:"attrValue",from:e,context:n}:o?{type:"attrName",from:e,context:n}:null}else if(r.name=="StartCloseTag")return{type:"closeTag",from:e,context:r.parent};for(;r.parent&&r.to==e&&!(!((t=r.lastChild)===null||t===void 0)&&t.type.isError);)r=r.parent;return r.name=="Element"||r.name=="Text"||r.name=="Document"?{type:"tag",from:e,context:r.name=="Element"?r:rp(r)}:null}var Gm=class{constructor(e,t,r){this.attrs=t,this.attrValues=r,this.children=[],this.name=e.name,this.completion=Object.assign(Object.assign({type:"type"},e.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=e.textContent?e.textContent.map(n=>({label:n,type:"text"})):[]}},sp=/^[:\-\.\w\u00b7-\uffff]*$/;function Pk(i){return Object.assign(Object.assign({type:"property"},i.completion||{}),{label:i.name})}function Mk(i){return typeof i=="string"?{label:`"${i}"`,type:"constant"}:/^"/.test(i.label)?i:Object.assign(Object.assign({},i),{label:`"${i.label}"`})}function OD(i,e){let t=[],r=[],n=Object.create(null);for(let l of e){let u=Pk(l);t.push(u),l.global&&r.push(u),l.values&&(n[l.name]=l.values.map(Mk))}let s=[],o=[],a=Object.create(null);for(let l of i){let u=r,c=n;l.attributes&&(u=u.concat(l.attributes.map(d=>typeof d=="string"?t.find(f=>f.label==d)||{label:d,type:"property"}:(d.values&&(c==n&&(c=Object.create(c)),c[d.name]=d.values.map(Mk)),Pk(d)))));let h=new Gm(l,u,c);a[h.name]=h,s.push(h),l.top&&o.push(h)}o.length||(o=s);for(let l=0;l{var u;let{doc:c}=l.state,h=_D(l.state,l.pos);if(!h||h.type=="tag"&&!l.explicit)return null;let{type:d,from:f,context:p}=h;if(d=="openTag"){let g=o,b=np(c,p);if(b){let v=a[b];g=v?.children||s}return{from:f,options:g.map(v=>v.completion),validFor:sp}}else if(d=="closeTag"){let g=np(c,p);return g?{from:f,to:l.pos+(c.sliceString(l.pos,l.pos+1)==">"?1:0),options:[((u=a[g])===null||u===void 0?void 0:u.closeNameCompletion)||{label:g+">",type:"type"}],validFor:sp}:null}else if(d=="attrName"){let g=a[kl(c,p)];return{from:f,options:g?.attrs||r,validFor:sp}}else if(d=="attrValue"){let g=SD(c,p,f);if(!g)return null;let b=a[kl(c,p)],v=(b?.attrValues||n)[g];return!v||!v.length?null:{from:f,to:l.pos+(c.sliceString(l.pos,l.pos+1)=='"'?1:0),options:v,validFor:/^"[^"]*"?$/}}else if(d=="tag"){let g=np(c,p),b=a[g],v=[],x=p&&p.lastChild;g&&(!x||x.name!="CloseTag"||kl(c,x)!=g)&&v.push(b?b.closeCompletion:{label:"",type:"type",boost:2});let $=v.concat((b?.children||(p?s:o)).map(R=>R.openCompletion));if(p&&b?.text.length){let R=p.firstChild;R.to>l.pos-20&&!/\S/.test(l.state.sliceDoc(R.to,l.pos))&&($=$.concat(b.text))}return{from:f,options:$,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}var Ym=Om.define({name:"xml",parser:$D.configure({props:[lw.add({Element(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"OpenTag CloseTag SelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),ME.add({Element(i){let e=i.firstChild,t=i.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:i.to}}}),dw.add({"OpenTag CloseTag":i=>i.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/$/}});function ID(i={}){let e=[Ym.data.of({autocomplete:OD(i.elements||[],i.attributes||[])})];return i.autoCloseTags!==!1&&e.push(CD),new Tm(Ym,e)}function Nk(i,e,t=i.length){if(!e)return"";let r=e.firstChild,n=r&&r.getChild("TagName");return n?i.sliceString(n.from,Math.min(n.to,t)):""}var CD=Z.inputHandler.of((i,e,t,r,n)=>{if(i.composing||i.state.readOnly||e!=t||r!=">"&&r!="/"||!Ym.isActiveAt(i.state,e,-1))return!1;let s=n(),{state:o}=s,a=o.changeByRange(l=>{var u,c,h;let{head:d}=l,f=o.doc.sliceString(d-1,d)==r,p=vt(o).resolveInner(d,-1),g;if(f&&r==">"&&p.name=="EndTag"){let b=p.parent;if(((c=(u=b.parent)===null||u===void 0?void 0:u.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(g=Nk(o.doc,b.parent,d))){let v=d+(o.doc.sliceString(d,d+1)===">"?1:0),x=``;return{range:l,changes:{from:d,to:v,insert:x}}}}else if(f&&r=="/"&&p.name=="StartCloseTag"){let b=p.parent;if(p.from==d-2&&((h=b.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(g=Nk(o.doc,b,d))){let v=d+(o.doc.sliceString(d,d+1)===">"?1:0),x=`${g}>`;return{range:O.cursor(d+x.length,-1),changes:{from:d,to:v,insert:x}}}}return{range:l}});return a.changes.empty?!1:(i.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Rk=typeof String.prototype.normalize=="function"?i=>i.normalize("NFKD"):i=>i,Gl=class{constructor(e,t,r=0,n=e.length,s,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,n),this.bufferStart=r,this.normalize=s?a=>s(Rk(a)):Rk,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return tg(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=uC(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Xk(e);let n=this.normalize(t);if(n.length)for(let s=0,o=r,a=!0;;s++){let l=n.charCodeAt(s),u=this.match(l,o,a,this.bufferPos+this.bufferStart,s==n.length-1);if(u)return this.value=u,this;if(s==n.length-1)break;a&&se||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function AD(i){return[ND,MD]}var DD=G.mark({class:"cm-selectionMatch"}),zD=G.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Uk(i,e,t,r){return(t==0||i(e.sliceDoc(t-1,t))!=nt.Word)&&(r==e.doc.length||i(e.sliceDoc(r,r+1))!=nt.Word)}function PD(i,e,t,r){return i(e.sliceDoc(t,t+1))==nt.Word&&i(e.sliceDoc(r-1,r))==nt.Word}var MD=jt.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.selectionSet||i.docChanged||i.viewportChanged)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=i.state.facet(ED),{state:t}=i,r=t.selection;if(r.ranges.length>1)return G.none;let n=r.main,s,o=null;if(n.empty){if(!e.highlightWordAroundCursor)return G.none;let l=t.wordAt(n.head);if(!l)return G.none;o=t.charCategorizer(n.head),s=t.sliceDoc(l.from,l.to)}else{let l=n.to-n.from;if(l200)return G.none;if(e.wholeWords){if(s=t.sliceDoc(n.from,n.to),o=t.charCategorizer(n.head),!(Uk(o,t,n.from,n.to)&&PD(o,t,n.from,n.to)))return G.none}else if(s=t.sliceDoc(n.from,n.to),!s)return G.none}let a=[];for(let l of i.visibleRanges){let u=new Gl(t.doc,s,l.from,l.to);for(;!u.next().done;){let{from:c,to:h}=u.value;if((!o||Uk(o,t,c,h))&&(n.empty&&c<=n.from&&h>=n.to?a.push(zD.range(c,h)):(c>=n.to||h<=n.from)&&a.push(DD.range(c,h)),a.length>e.maxMatches))return G.none}}return G.set(a)}},{decorations:i=>i.decorations}),ND=Z.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),RD=[tE(),eA(),VT(),hw(RE,{fallback:!0}),fg.of([...Hw,...yw])],UD=ho.define([{tag:w.tagName,color:"#569CD6"},{tag:w.attributeName,color:"#9CDCFE"},{tag:w.attributeValue,color:"#CE9178"},{tag:w.string,color:"#CE9178"},{tag:w.comment,color:"#6A9955"},{tag:w.meta,color:"#808080"},{tag:w.processingInstruction,color:"#808080"},{tag:w.content,color:"#D4D4D4"},{tag:w.angleBracket,color:"#569CD6"}]),Qm=class{constructor(e){this.view=null,this.host=e}createState(e){return $e.create({doc:e,extensions:[RD,dE(),ID(),hw(UD),AD(),fg.of([...Hw,...yw]),Z.theme({"&":{backgroundColor:"#1E1E1E",color:"#D4D4D4",height:"100%"},".cm-content":{fontFamily:'Menlo, Monaco, "Courier New", monospace',fontSize:"13px",caretColor:"#FFFFFF"},".cm-cursor":{borderLeftColor:"#FFFFFF",borderLeftWidth:"2px"},".cm-activeLine":{backgroundColor:"#2D2D2D"},".cm-activeLineGutter":{backgroundColor:"#2D2D2D"}})]})}createView(e){this.view=new Z({parent:this.host,state:this.createState(e)})}setContent(e){let t=e.charCodeAt(0)===65279?e.slice(1):e;if(this.view===null){this.createView(t);return}this.view.setState(this.createState(t))}getContent(){return this.view===null?"":this.view.state.doc.toString()}destroy(){this.view!==null&&(this.view.destroy(),this.view=null)}},LD=` +/* z-index sits above the player toolbar / playback bar (150) so a small viewport where those + controls can't fully fit in the shrunken container gets them cleanly clipped by the panel + instead of shown floating on top of the editor's own UI. The panel's opaque background acts + as the actual visual clip. */ +#editor-panel { + position: fixed; + top: 0; + right: 0; + bottom: 0; + /* Width is driven by the --editor-width variable set while dragging the resizer; falls back + to 50% before any drag. min-width guards the CSS-only case against an overly narrow panel. */ + width: var(--editor-width, 50%); + min-width: 320px; + display: none; + flex-direction: column; + background: #1E1E1E; + border-left: 1px solid #3C3C3C; + z-index: 300; +} + +#editor-panel .editor-resizer { + position: absolute; + top: 0; + bottom: 0; + left: -3px; + width: 6px; + cursor: ew-resize; + /* Sits above the panel body so the 6px-wide grabber stays clickable when the panel's + raised z-index brings its own children in front of it. */ + z-index: 320; + background: transparent; + transition: background 0.15s ease; +} + +#editor-panel .editor-resizer:hover, +#editor-panel .editor-resizer.dragging { + background: #448EF9; +} + +#editor-panel.visible { + display: flex; +} + +/* Note: the container shrinking rule (.with-editor { width: calc(...) }) is defined on the + .pagx-player-root wrapper in pagx-player/src/styles.ts so the editor doesn't leak layout + assumptions about the host container's class name. */ + +#editor-panel .editor-header { + display: flex; + align-items: center; + justify-content: space-between; + height: 40px; + padding: 0 12px; + background: #252526; + border-bottom: 1px solid #3C3C3C; + flex-shrink: 0; +} + +#editor-panel .editor-title { + color: #CCCCCC; + font-size: 13px; + font-weight: 500; + user-select: none; +} + +#editor-panel .editor-close-btn { + display: flex; + align-items: center; + justify-content: center; + width: 28px; + height: 28px; + border: none; + background: transparent; + color: #CCCCCC; + cursor: pointer; + border-radius: 4px; + padding: 0; +} + +#editor-panel .editor-close-btn:hover { + background: #3C3C3C; +} + +#editor-panel .editor-host { + flex: 1; + overflow: hidden; + position: relative; +} + +#editor-panel .editor-host .cm-editor { + height: 100%; + font-size: 13px; + font-family: Menlo, Monaco, 'Courier New', monospace; +} + +#editor-panel .editor-host .cm-scroller { + overflow: auto; +} + +/* Fix white square at scrollbar corner */ +#editor-panel .editor-host .cm-scroller::-webkit-scrollbar-corner { + background: #1E1E1E; +} + +#editor-panel .editor-host .cm-gutters { + background: #1E1E1E; + border-right: 1px solid #3C3C3C; + color: #6E7681; +} + +#editor-panel .editor-host .cm-focused { + outline: none; +} + +/* Selection highlight. !important guards against CodeMirror's baseTheme and any focused-state + rule that may be injected inline; specificity alone is not always enough. */ +#editor-panel .editor-host .cm-editor .cm-selectionBackground, +#editor-panel .editor-host .cm-editor.cm-focused .cm-selectionBackground, +#editor-panel .editor-host .cm-editor ::selection { + background-color: rgba(68, 142, 249, 0.35) !important; +} + +/* highlightSelectionMatches - subtle highlight for matching text under cursor */ +#editor-panel .editor-host .cm-editor .cm-selectionMatch { + background-color: rgba(234, 179, 8, 0.15); +} + +#editor-panel .editor-host .cm-editor .cm-selectionMatch-selected { + background-color: rgba(68, 142, 249, 0.3); +} + +/* Editor feedback ("Changes applied", validation errors, etc.) now flows through the player's + unified status pill (pagx-player styles.ts .pagx-player-status), so no dedicated .editor-toast + styles live here anymore. */ + +#editor-panel .editor-button-bar { + display: flex; + align-items: center; + justify-content: center; + gap: 12px; + height: 48px; + background: #16161D; + border-top: 1px solid #3C3C3C; + flex-shrink: 0; +} + +#editor-panel .editor-btn { + width: 80px; + height: 32px; + border: 1px solid; + border-radius: 4px; + color: #FFFFFF; + font-size: 12px; + cursor: pointer; + transition: background 0.1s, transform 0.1s; + padding: 0; +} + +#editor-panel .editor-btn:hover { + transform: scale(1.05); +} + +#editor-panel .editor-btn:active { + transform: scale(1.0); +} + +/* While the host's onApply/onSave is in flight the buttons are disabled to prevent + overlapping callbacks. Fades them and neutralizes hover so the pause is visible. */ +#editor-panel .editor-btn:disabled { + opacity: 0.45; + cursor: not-allowed; +} + +#editor-panel .editor-btn:disabled:hover { + transform: none; +} + +#editor-panel .editor-btn.discard { + background: #3C3C3C; + border-color: #4B4B5A; +} + +#editor-panel .editor-btn.discard:hover { + background: #5C5C6A; + border-color: #8B8B9A; +} + +#editor-panel .editor-btn.apply { + background: #448EF9; + border-color: #5BA3FF; +} + +#editor-panel .editor-btn.apply:hover { + background: #5BA3FF; + border-color: #8BC4FF; +} + +#editor-panel .editor-btn.save { + background: #388E3C; + border-color: #4CAF50; +} + +#editor-panel .editor-btn.save:hover { + background: #4CAF50; + border-color: #81C784; +} + +#editor-panel .editor-host .cm-scroller::-webkit-scrollbar { + width: 8px; + height: 8px; +} + +#editor-panel .editor-host .cm-scroller::-webkit-scrollbar-thumb { + background: rgba(75, 75, 90, 0.67); + border-radius: 4px; +} + +#editor-panel .editor-host .cm-scroller::-webkit-scrollbar-track { + background: transparent; +} + +#editor-panel .editor-host .cm-scroller::-webkit-scrollbar-thumb:hover { + background: rgba(90, 90, 110, 0.8); +} +`,jD=768,BD=2e3,Lk=320,ZD=360,jk="pagx-player-editor-styles";function FD(){if(typeof document>"u"||document.getElementById(jk))return;let i=document.createElement("style");i.id=jk,i.textContent=LD,document.head.appendChild(i)}function qD(i){if(!(i instanceof HTMLElement))return!1;let e=i.tagName;return e==="INPUT"||e==="TEXTAREA"||i.isContentEditable}function Bk(i){let r=new DOMParser().parseFromString(i,"application/xml").querySelector("parsererror");return r?(r.textContent||"Invalid XML").trim().split(` +`)[0].trim()||"Invalid XML format":""}var eg=class{constructor(e){this.editor=null,this.currentXmlText=null,this.documentGeneration=0,this.pendingApplyXml=null,this.panelWidthPx=null,this.resizing=!1,this.busy=!1,this.parent=e.parent,this.canvasContainer=e.canvasContainer,this.callbacks=e.callbacks,this.notify=e.notify,this.dismiss=e.dismiss,FD(),this.buildDom(),this.boundKeydown=this.handleKeydown.bind(this),this.boundResize=this.onWindowResize.bind(this),document.addEventListener("keydown",this.boundKeydown),window.addEventListener("resize",this.boundResize)}setDocumentXml(e){let t=e!==null&&this.pendingApplyXml!==null&&e===this.pendingApplyXml;if(this.currentXmlText=e,t||this.documentGeneration++,e===null){this.isOpen()&&this.close(),this.editor!==null&&(this.editor.destroy(),this.editor=null);return}this.isOpen()&&this.editor!==null&&this.editor.setContent(e)}isOpen(){return this.panel.classList.contains("visible")}open(){if(this.editor===null){let e=this.panel.querySelector(".editor-host");e instanceof HTMLElement&&(this.editor=new Qm(e))}this.editor!==null&&this.currentXmlText!==null&&this.editor.setContent(this.currentXmlText),this.panel.classList.add("visible"),this.canvasContainer.classList.add("with-editor")}close(){this.panel.classList.remove("visible"),this.canvasContainer.classList.remove("with-editor")}toggle(){this.isOpen()?this.close():this.open()}destroy(){document.removeEventListener("keydown",this.boundKeydown),window.removeEventListener("resize",this.boundResize),this.editor!==null&&(this.editor.destroy(),this.editor=null),this.canvasContainer.classList.remove("with-editor"),this.canvasContainer.style.removeProperty("--editor-width"),this.resizing&&(document.body.style.userSelect="",document.body.style.cursor="",this.resizing=!1),this.panel.remove()}buildDom(){this.panel=document.createElement("div"),this.panel.id="editor-panel",this.panel.innerHTML=` +
+
+ Source Editor + +
+
+
+ + + +
+ `,this.parent.appendChild(this.panel),this.resizer=this.panel.querySelector(".editor-resizer"),this.resizer.addEventListener("pointerdown",t=>this.onResizeStart(t)),this.resizer.addEventListener("pointermove",t=>this.onResizeMove(t)),this.resizer.addEventListener("pointerup",t=>this.onResizeEnd(t)),this.resizer.addEventListener("pointercancel",t=>this.onResizeEnd(t)),this.panel.querySelector(".editor-close-btn")?.addEventListener("click",()=>this.close()),this.discardBtn=this.panel.querySelector(".editor-btn.discard"),this.discardBtn.addEventListener("click",()=>this.handleDiscard()),this.applyBtn=this.panel.querySelector(".editor-btn.apply"),this.applyBtn.addEventListener("click",()=>{this.handleApply()}),this.saveBtn=this.panel.querySelector(".editor-btn.save"),this.saveBtn.addEventListener("click",()=>{this.handleSave()})}handleKeydown(e){if(!(e.key!=="l"&&e.key!=="L")&&!qD(e.target)&&!(e.ctrlKey||e.metaKey||e.altKey)&&this.currentXmlText!==null){if(window.innerWidth