Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .dockerignore +20 -0
- .env.example +27 -0
- .gitattributes +6 -0
- .gitignore +17 -0
- Dockerfile +52 -0
- LICENSE +21 -0
- README.md +516 -8
- client/.gitignore +24 -0
- client/README.md +73 -0
- client/components.json +25 -0
- client/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- client/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- client/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- client/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- client/dist/assets/geist-mono-cyrillic-ext-wght-normal-I4S5GZfc.woff2 +0 -0
- client/dist/assets/geist-mono-cyrillic-wght-normal-BmXc_FBt.woff2 +0 -0
- client/dist/assets/geist-mono-latin-ext-wght-normal-DrnZ1wKl.woff2 +0 -0
- client/dist/assets/geist-mono-latin-wght-normal-B_7UjwxQ.woff2 +0 -0
- client/dist/assets/geist-mono-symbols2-wght-normal-GZpp1pK2.woff2 +0 -0
- client/dist/assets/geist-mono-vietnamese-wght-normal-D8KDMBhC.woff2 +0 -0
- client/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- client/dist/assets/index-BpoX3Fkj.js +0 -0
- client/dist/assets/index-CBvmpuEj.css +2 -0
- client/dist/favicon.svg +9 -0
- client/dist/icons.svg +24 -0
- client/dist/index.html +25 -0
- client/eslint.config.js +23 -0
- client/index.html +24 -0
- client/node_modules/.tmp/tsconfig.app.tsbuildinfo +1 -0
- client/node_modules/.tmp/tsconfig.node.tsbuildinfo +1 -0
- client/node_modules/.vite/deps/@base-ui_react_button.js +27 -0
- client/node_modules/.vite/deps/@base-ui_react_button.js.map +1 -0
- client/node_modules/.vite/deps/@base-ui_react_input.js +107 -0
- client/node_modules/.vite/deps/@base-ui_react_input.js.map +1 -0
- client/node_modules/.vite/deps/@base-ui_react_menu.js +2119 -0
- client/node_modules/.vite/deps/@base-ui_react_menu.js.map +0 -0
- client/node_modules/.vite/deps/@base-ui_react_popover.js +809 -0
- client/node_modules/.vite/deps/@base-ui_react_popover.js.map +1 -0
- client/node_modules/.vite/deps/@base-ui_react_select.js +2009 -0
- client/node_modules/.vite/deps/@base-ui_react_select.js.map +0 -0
- client/node_modules/.vite/deps/@base-ui_react_switch.js +284 -0
- client/node_modules/.vite/deps/@base-ui_react_switch.js.map +1 -0
- client/node_modules/.vite/deps/@dnd-kit_core.js +3 -0
- client/node_modules/.vite/deps/@dnd-kit_sortable.js +510 -0
- client/node_modules/.vite/deps/@dnd-kit_sortable.js.map +1 -0
- client/node_modules/.vite/deps/@dnd-kit_utilities.js +191 -0
- client/node_modules/.vite/deps/@dnd-kit_utilities.js.map +1 -0
- client/node_modules/.vite/deps/@tanstack_react-query.js +0 -0
- client/node_modules/.vite/deps/@tanstack_react-query.js.map +0 -0
- client/node_modules/.vite/deps/FormContext-D8skpAva.js +19 -0
.dockerignore
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.git
|
| 2 |
+
.github
|
| 3 |
+
node_modules
|
| 4 |
+
client/node_modules
|
| 5 |
+
server/node_modules
|
| 6 |
+
shared/node_modules
|
| 7 |
+
client/dist
|
| 8 |
+
server/dist
|
| 9 |
+
server/data
|
| 10 |
+
dist
|
| 11 |
+
.env
|
| 12 |
+
.env.*
|
| 13 |
+
*.db
|
| 14 |
+
*.db-wal
|
| 15 |
+
*.db-shm
|
| 16 |
+
*.bak
|
| 17 |
+
.DS_Store
|
| 18 |
+
npm-debug.log*
|
| 19 |
+
repo-assets
|
| 20 |
+
free-ai-apis.pdf
|
.env.example
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Server encryption key for API key storage (generate with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))")
|
| 2 |
+
ENCRYPTION_KEY=your-64-char-hex-key-here
|
| 3 |
+
|
| 4 |
+
# Server port (default: 3001)
|
| 5 |
+
PORT=3001
|
| 6 |
+
|
| 7 |
+
# Docker only: which host interface the container's port is published on.
|
| 8 |
+
# Defaults to 127.0.0.1, so the dashboard/API is reachable only from the
|
| 9 |
+
# machine running Docker. To open it to other devices on your LAN (e.g. a
|
| 10 |
+
# Raspberry Pi reached at http://192.168.1.x:3001), set HOST_BIND=0.0.0.0.
|
| 11 |
+
# Only do this on a trusted network — the proxy is single-user and guarded
|
| 12 |
+
# only by the unified API key.
|
| 13 |
+
# HOST_BIND=0.0.0.0
|
| 14 |
+
|
| 15 |
+
# Max /v1 proxy requests per minute per client IP (default: 120). Set to 0
|
| 16 |
+
# to disable proxy rate limiting.
|
| 17 |
+
# PROXY_RATE_LIMIT_RPM=120
|
| 18 |
+
|
| 19 |
+
# Request analytics retention. Set either value to 0 to disable that limit.
|
| 20 |
+
REQUEST_ANALYTICS_RETENTION_DAYS=90
|
| 21 |
+
REQUEST_ANALYTICS_MAX_ROWS=100000
|
| 22 |
+
|
| 23 |
+
# Comma-separated extra origins allowed to call the API from a browser.
|
| 24 |
+
# localhost:5173, 127.0.0.1:5173, [::1]:5173 are allowed by default for the
|
| 25 |
+
# Vite dev dashboard. Only set this if you serve the dashboard from a
|
| 26 |
+
# different host than the API (e.g. http://my-server.local).
|
| 27 |
+
# DASHBOARD_ORIGINS=http://my-server.local,http://192.168.1.50
|
.gitattributes
CHANGED
|
@@ -33,3 +33,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
desktop/assets/icon.icns filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
repo-assets/analytics.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
repo-assets/desktop.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
repo-assets/fallback-chain.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
repo-assets/keys.png filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
repo-assets/playground.png filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
node_modules/
|
| 2 |
+
dist/
|
| 3 |
+
server/data/
|
| 4 |
+
*.db
|
| 5 |
+
*.db-wal
|
| 6 |
+
*.db-shm
|
| 7 |
+
*.bak
|
| 8 |
+
.env
|
| 9 |
+
.env.local
|
| 10 |
+
.DS_Store
|
| 11 |
+
|
| 12 |
+
# Personal deployment scripts (contain keys/credentials — kept local)
|
| 13 |
+
deploy-pi.sh
|
| 14 |
+
update-hermes.sh
|
| 15 |
+
|
| 16 |
+
# Monetization planning — private, never committed
|
| 17 |
+
monetization/
|
Dockerfile
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# syntax=docker/dockerfile:1.7
|
| 2 |
+
|
| 3 |
+
ARG NODE_IMAGE=node:20-bookworm-slim
|
| 4 |
+
|
| 5 |
+
FROM ${NODE_IMAGE} AS deps
|
| 6 |
+
WORKDIR /app
|
| 7 |
+
|
| 8 |
+
RUN apt-get update \
|
| 9 |
+
&& apt-get install -y --no-install-recommends python3 make g++ \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
COPY package.json package-lock.json ./
|
| 13 |
+
COPY shared/package.json ./shared/
|
| 14 |
+
COPY server/package.json ./server/
|
| 15 |
+
COPY client/package.json ./client/
|
| 16 |
+
|
| 17 |
+
RUN npm ci
|
| 18 |
+
|
| 19 |
+
FROM deps AS build
|
| 20 |
+
WORKDIR /app
|
| 21 |
+
|
| 22 |
+
COPY . .
|
| 23 |
+
|
| 24 |
+
RUN npm run build
|
| 25 |
+
RUN npm prune --omit=dev
|
| 26 |
+
|
| 27 |
+
FROM ${NODE_IMAGE} AS runtime
|
| 28 |
+
WORKDIR /app
|
| 29 |
+
|
| 30 |
+
ENV NODE_ENV=production
|
| 31 |
+
ENV PORT=7860
|
| 32 |
+
|
| 33 |
+
COPY --from=build --chown=node:node /app/package.json /app/package-lock.json ./
|
| 34 |
+
COPY --from=build --chown=node:node /app/node_modules ./node_modules
|
| 35 |
+
COPY --from=build --chown=node:node /app/shared ./shared
|
| 36 |
+
COPY --from=build --chown=node:node /app/server/package.json ./server/package.json
|
| 37 |
+
COPY --from=build --chown=node:node /app/server/dist ./server/dist
|
| 38 |
+
COPY --from=build --chown=node:node /app/client/dist ./client/dist
|
| 39 |
+
|
| 40 |
+
RUN mkdir -p /app/server/data && chown -R node:node /app/server/data
|
| 41 |
+
|
| 42 |
+
# Include the pre-seeded local database!
|
| 43 |
+
COPY --chown=node:node server/data/freeapi.db /app/server/data/freeapi.db
|
| 44 |
+
|
| 45 |
+
USER node
|
| 46 |
+
|
| 47 |
+
EXPOSE 7860
|
| 48 |
+
|
| 49 |
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
| 50 |
+
CMD node -e "fetch('http://127.0.0.1:7860/api/ping').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
|
| 51 |
+
|
| 52 |
+
CMD ["node", "server/dist/index.js"]
|
LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2026 Tashfeen Ahmed
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
README.md
CHANGED
|
@@ -1,10 +1,518 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
-
title: FreeLLMAPI
|
| 3 |
-
emoji: 🐨
|
| 4 |
-
colorFrom: yellow
|
| 5 |
-
colorTo: yellow
|
| 6 |
-
sdk: docker
|
| 7 |
-
pinned: false
|
| 8 |
-
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div align="center">
|
| 2 |
+
|
| 3 |
+
# FreeLLMAPI
|
| 4 |
+
|
| 5 |
+
**One OpenAI-compatible endpoint. Sixteen free LLM providers. ~1.7B tokens per month.**
|
| 6 |
+
|
| 7 |
+
Aggregate the free tiers from Google, Groq, Cerebras, NVIDIA, Mistral, OpenRouter, GitHub Models, Cohere, Cloudflare, HuggingFace, Z.ai (Zhipu), Ollama, Kilo, Pollinations, LLM7, and OpenCode Zen — plus any custom OpenAI-compatible endpoint (llama.cpp, LM Studio, vLLM, local Ollama) — behind a single `/v1/chat/completions` endpoint. Keys are stored encrypted. A router picks the best available model for each request, falls over to the next provider when one is rate-limited, and tracks per-key usage so you stay under every free-tier cap.
|
| 8 |
+
|
| 9 |
+
[](https://github.com/tashfeenahmed/freellmapi/actions/workflows/ci.yml)
|
| 10 |
+
[](./LICENSE)
|
| 11 |
+
[](#contributing)
|
| 12 |
+
[](https://github.com/tashfeenahmed/freellmapi/pkgs/container/freellmapi)
|
| 13 |
+
|
| 14 |
+

|
| 15 |
+
|
| 16 |
+
</div>
|
| 17 |
+
|
| 18 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
## Contents
|
| 21 |
+
|
| 22 |
+
- [Why this exists](#why-this-exists)
|
| 23 |
+
- [Supported providers](#supported-providers)
|
| 24 |
+
- [Features](#features)
|
| 25 |
+
- [Not yet supported](#not-yet-supported)
|
| 26 |
+
- [Quick start](#quick-start)
|
| 27 |
+
- [Docker](#docker)
|
| 28 |
+
- [Desktop app](#desktop-app)
|
| 29 |
+
- [Using the API](#using-the-api)
|
| 30 |
+
- [Screenshots](#screenshots)
|
| 31 |
+
- [How it works](#how-it-works)
|
| 32 |
+
- [Limitations](#limitations)
|
| 33 |
+
- [Contributing](#contributing)
|
| 34 |
+
- [Terms of Service review](#terms-of-service-review)
|
| 35 |
+
- [Disclaimer](#disclaimer)
|
| 36 |
+
|
| 37 |
+
## Why this exists
|
| 38 |
+
|
| 39 |
+
Every serious AI lab now offers a free tier — a few million tokens a month, a few thousand requests a day. On its own each tier is a toy. Stacked together, they add up to roughly **1.7 billion tokens per month** of working inference capacity, across 100+ models from small-and-fast to reasonably capable.
|
| 40 |
+
|
| 41 |
+
The problem is that stacking them by hand is painful: sixteen different SDKs, sixteen different rate limits, sixteen places a request can fail. FreeLLMAPI collapses that into one OpenAI-compatible endpoint. Point any OpenAI client library at your local server, and it routes transparently across whichever providers you've added keys for.
|
| 42 |
+
|
| 43 |
+
## Supported providers
|
| 44 |
+
|
| 45 |
+
<table>
|
| 46 |
+
<tr>
|
| 47 |
+
<td align="center" width="180"><a href="https://ai.google.dev"><b>Google</b><br/>Gemini 2.5 Flash · 3.x previews</a></td>
|
| 48 |
+
<td align="center" width="180"><a href="https://groq.com"><b>Groq</b><br/>Llama 3.3, Llama 4, GPT-OSS, Qwen3</a></td>
|
| 49 |
+
<td align="center" width="180"><a href="https://cerebras.ai"><b>Cerebras</b><br/>Qwen3 235B</a></td>
|
| 50 |
+
<td align="center" width="180"><a href="https://opencode.ai/zen"><b>OpenCode Zen</b><br/>DeepSeek V4 Flash · Nemotron (promo)</a></td>
|
| 51 |
+
</tr>
|
| 52 |
+
<tr>
|
| 53 |
+
<td align="center"><a href="https://mistral.ai"><b>Mistral</b><br/>Large 3 · Medium 3.5 · Codestral · Devstral</a></td>
|
| 54 |
+
<td align="center"><a href="https://openrouter.ai"><b>OpenRouter</b><br/>21 free-tier models</a></td>
|
| 55 |
+
<td align="center"><a href="https://github.com/marketplace/models"><b>GitHub Models</b><br/>GPT-4.1 · GPT-4o</a></td>
|
| 56 |
+
<td align="center"><a href="https://developers.cloudflare.com/workers-ai"><b>Cloudflare</b><br/>Kimi K2 · GLM-4.7 · GPT-OSS · Granite 4</a></td>
|
| 57 |
+
</tr>
|
| 58 |
+
<tr>
|
| 59 |
+
<td align="center"><a href="https://cohere.com"><b>Cohere</b><br/>Command R+ · Command-A (trial)</a></td>
|
| 60 |
+
<td align="center"><a href="https://docs.z.ai"><b>Z.ai (Zhipu)</b><br/>GLM-4.5 · GLM-4.7 Flash</a></td>
|
| 61 |
+
<td align="center"><a href="https://build.nvidia.com"><b>NVIDIA</b><br/>NIM (disabled by default)</a></td>
|
| 62 |
+
<td align="center"><a href="https://huggingface.co/docs/inference-providers"><b>HuggingFace</b><br/>Router → DeepSeek V4 · Kimi K2.6 · Qwen3</a></td>
|
| 63 |
+
</tr>
|
| 64 |
+
<tr>
|
| 65 |
+
<td align="center"><a href="https://ollama.com"><b>Ollama Cloud</b><br/>GLM-4.7 · Kimi K2 · gpt-oss · Qwen3</a></td>
|
| 66 |
+
<td align="center"><a href="https://kilo.ai"><b>Kilo Gateway</b><br/>:free routes (anon ok)</a></td>
|
| 67 |
+
<td align="center"><a href="https://pollinations.ai"><b>Pollinations</b><br/>GPT-OSS 20B (anon ok)</a></td>
|
| 68 |
+
<td align="center"><a href="https://llm7.io"><b>LLM7</b><br/>GPT-OSS · Llama 3.1 · GLM (anon ok)</a></td>
|
| 69 |
+
</tr>
|
| 70 |
+
</table>
|
| 71 |
+
|
| 72 |
+
Plus a **custom** provider — point at any OpenAI-compatible endpoint (llama.cpp, LM Studio, vLLM, a local Ollama, or a remote gateway) from the Keys page.
|
| 73 |
+
|
| 74 |
+
## Features
|
| 75 |
+
|
| 76 |
+
- **OpenAI-compatible** — `POST /v1/chat/completions` and `GET /v1/models` work with the official OpenAI SDKs and any OpenAI-compatible client (LangChain, LlamaIndex, Continue, Hermes, etc.). Just change `base_url`.
|
| 77 |
+
- **Responses API** — `POST /v1/responses` (the wire format current Codex CLI versions require) is implemented as a translating shim over the same router, with full streaming events and tool calls.
|
| 78 |
+
- **Streaming and non-streaming** — Server-Sent Events for `stream: true`, JSON response otherwise. Every provider adapter implements both.
|
| 79 |
+
- **Tool calling** — OpenAI-style `tools` / `tool_choice` requests are passed through, and assistant `tool_calls` + `tool` role follow-up messages round-trip across providers.
|
| 80 |
+
- **Embeddings** — `/v1/embeddings` with family-based routing: failover only ever happens between providers serving the *same* model (vectors from different models are incompatible), never across models. See [Embeddings](#embeddings).
|
| 81 |
+
- **Automatic fallover** — If the chosen provider returns a 429, 5xx, or times out, the router skips it, puts the key on a short cooldown, and retries on the next model in your fallback chain (up to 20 attempts).
|
| 82 |
+
- **Per-key rate tracking** — RPM, RPD, TPM, and TPD counters per `(platform, model, key)` so the router always picks a key that's under its caps.
|
| 83 |
+
- **Sticky sessions** — Multi-turn conversations keep talking to the same model for 30 minutes to avoid the hallucination spike that comes from mid-conversation model switches.
|
| 84 |
+
- **Encrypted key storage** — API keys are encrypted with AES-256-GCM before hitting SQLite; decryption happens in-memory just before a request.
|
| 85 |
+
- **Unified API key** — Clients authenticate to your proxy with a single `freellmapi-…` bearer token. You never expose upstream provider keys to your apps.
|
| 86 |
+
- **Dashboard login** — The admin UI and all `/api/*` routes are gated behind an email + password account (scrypt-hashed, session-token auth), set on first run. The `/v1` proxy keeps its own unified-key auth for apps.
|
| 87 |
+
- **Health checks** — Periodic probes mark keys as `healthy`, `rate_limited`, `invalid`, or `error` so the router skips dead ones automatically.
|
| 88 |
+
- **Admin dashboard** — React + Vite UI to manage keys, reorder the fallback chain, inspect analytics, and run prompts in a playground. Dark mode included.
|
| 89 |
+
- **Analytics** — Per-request logging with latency, token counts, success rate, and per-provider breakdowns.
|
| 90 |
+
- **Runs anywhere Node 20+ runs** — Windows, macOS, Linux servers, or a small ARM SBC (Raspberry Pi included). ~40 MB RSS at idle behind PM2 / systemd / whatever supervisor you prefer.
|
| 91 |
+
|
| 92 |
+
## Not yet supported
|
| 93 |
+
|
| 94 |
+
The scope is deliberately narrow. If a feature isn't on this list and isn't below, assume it isn't there yet.
|
| 95 |
+
|
| 96 |
+
- **Image generation** (`/v1/images/*`)
|
| 97 |
+
- **Audio / speech** (`/v1/audio/*`)
|
| 98 |
+
- **Legacy completions** (`/v1/completions`) — only the chat endpoint is implemented
|
| 99 |
+
- **Moderation** (`/v1/moderations`)
|
| 100 |
+
- **`n > 1`** (multiple completions per request)
|
| 101 |
+
- **Per-user billing / multi-tenant auth** — single-user by design
|
| 102 |
+
|
| 103 |
+
PRs that add any of these are very welcome. See [Contributing](#contributing).
|
| 104 |
+
|
| 105 |
+
## Quick start
|
| 106 |
+
|
| 107 |
+
**One-liner** (Docker required — sets up `~/freellmapi`, generates an encryption key, pulls the image, and starts the container):
|
| 108 |
+
|
| 109 |
+
```bash
|
| 110 |
+
curl -fsSL https://tashfeenahmed.github.io/freellmapi/install.sh | bash
|
| 111 |
+
```
|
| 112 |
+
|
| 113 |
+
Prefer to read before you pipe to bash? [The script is here](docs/install.sh). Re-running it is safe: your `.env` (and encryption key) is preserved and the container updates to `:latest`. Override the defaults with `FREELLMAPI_DIR`, `PORT`, or `HOST_BIND` env vars.
|
| 114 |
+
|
| 115 |
+
**Or manually with Docker Compose.** It runs the API and dashboard together on port 3001 and persists SQLite in a named volume.
|
| 116 |
+
|
| 117 |
+
**Prerequisites:** Docker, Docker Compose, OpenSSL.
|
| 118 |
+
|
| 119 |
+
```bash
|
| 120 |
+
git clone https://github.com/tashfeenahmed/freellmapi.git
|
| 121 |
+
cd freellmapi
|
| 122 |
+
|
| 123 |
+
# Generate an encryption key for at-rest key storage
|
| 124 |
+
ENCRYPTION_KEY="$(openssl rand -hex 32)"
|
| 125 |
+
printf "ENCRYPTION_KEY=%s\nPORT=3001\n" "$ENCRYPTION_KEY" > .env
|
| 126 |
+
|
| 127 |
+
docker compose up -d
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
Open http://localhost:3001, add your provider keys on the **Keys** page, reorder the **Fallback Chain** to taste, and grab your unified API key from the **Keys** page header. That unified key is what you point your OpenAI SDK at.
|
| 131 |
+
|
| 132 |
+
> **Reaching it from another machine?** By default the container is published only on `127.0.0.1`, so `http://<server-ip>:3001` won't load from another device (the page just hangs). To expose it on your LAN — e.g. a Raspberry Pi at `http://192.168.1.x:3001` — start it with `HOST_BIND=0.0.0.0`:
|
| 133 |
+
>
|
| 134 |
+
> ```bash
|
| 135 |
+
> HOST_BIND=0.0.0.0 docker compose up -d
|
| 136 |
+
> ```
|
| 137 |
+
>
|
| 138 |
+
> Only do this on a trusted network: the proxy is single-user and guarded only by the unified API key.
|
| 139 |
+
|
| 140 |
+
### Local development
|
| 141 |
+
|
| 142 |
+
**Prerequisites:** Node.js 20+, npm.
|
| 143 |
+
|
| 144 |
+
```bash
|
| 145 |
+
git clone https://github.com/tashfeenahmed/freellmapi.git
|
| 146 |
+
cd freellmapi
|
| 147 |
+
npm install
|
| 148 |
+
cp .env.example .env
|
| 149 |
+
ENCRYPTION_KEY="$(node -e 'console.log(require("crypto").randomBytes(32).toString("hex"))')"
|
| 150 |
+
printf "ENCRYPTION_KEY=%s\nPORT=3001\n" "$ENCRYPTION_KEY" > .env
|
| 151 |
+
npm run dev
|
| 152 |
+
```
|
| 153 |
+
|
| 154 |
+
`ENCRYPTION_KEY` is required for startup. The server only falls back to a
|
| 155 |
+
database-stored development key when `DEV_MODE=true` and `NODE_ENV` is not
|
| 156 |
+
`production`; do not use that fallback with real provider keys.
|
| 157 |
+
|
| 158 |
+
Request analytics are retained for 90 days or 100000 request rows by default,
|
| 159 |
+
whichever limit prunes first. Set `REQUEST_ANALYTICS_RETENTION_DAYS=0` or
|
| 160 |
+
`REQUEST_ANALYTICS_MAX_ROWS=0` in `.env` to disable either retention limit.
|
| 161 |
+
|
| 162 |
+
Open http://localhost:5173 (the Vite dev UI), add your provider keys on the **Keys** page, reorder the **Fallback Chain** to taste, and grab your unified API key from the **Keys** page header. That unified key is what you point your OpenAI SDK at.
|
| 163 |
+
|
| 164 |
+
> **Reaching the dev UI from another device on your LAN?** Use `npm run dev:lan` — it passes `--host` through to Vite, which then prints a `Network: http://<your-ip>:5173` URL you can open from a phone or another machine. (Plain `npm run dev -- --host` does *not* work here: the root `dev` script is a `concurrently` wrapper, so the flag never reaches Vite.) API calls go through Vite's dev proxy, so no extra server config is needed.
|
| 165 |
+
|
| 166 |
+
For a production build without Docker:
|
| 167 |
+
|
| 168 |
+
```bash
|
| 169 |
+
npm run build
|
| 170 |
+
node server/dist/index.js # server + dashboard both served on :3001
|
| 171 |
+
```
|
| 172 |
+
|
| 173 |
+
## Docker
|
| 174 |
+
|
| 175 |
+
FreeLLMAPI publishes a single production image that contains the Express server and the built React dashboard:
|
| 176 |
+
|
| 177 |
+
```bash
|
| 178 |
+
docker pull ghcr.io/tashfeenahmed/freellmapi:latest # or pin a release, e.g. :v1.2.3
|
| 179 |
+
```
|
| 180 |
+
|
| 181 |
+
The image is multi-arch (`linux/amd64` + `linux/arm64`, so it runs on a Raspberry Pi). Published tags: `latest` (default branch), `v*.*.*` (git release tags), and `sha-<commit>`.
|
| 182 |
+
|
| 183 |
+
The included `docker-compose.yml` is the recommended install path:
|
| 184 |
+
|
| 185 |
+
```bash
|
| 186 |
+
docker compose up -d
|
| 187 |
+
docker compose logs -f freellmapi
|
| 188 |
+
```
|
| 189 |
+
|
| 190 |
+
By default the container's port is bound to `127.0.0.1` (localhost only). To reach the dashboard/API from another machine on your network, publish it on all interfaces with `HOST_BIND=0.0.0.0 docker compose up -d` — only on a trusted LAN, since the proxy is single-user.
|
| 191 |
+
|
| 192 |
+
SQLite data is stored in the `freellmapi-data` volume at `/app/server/data`. Keep the same `.env` `ENCRYPTION_KEY` and volume when upgrading, because provider keys are encrypted at rest.
|
| 193 |
+
|
| 194 |
+
More Docker operations and examples live in [docker/README.md](./docker/README.md).
|
| 195 |
+
|
| 196 |
+
## Desktop app
|
| 197 |
+
|
| 198 |
+
A native menu-bar app lives in [`desktop/`](./desktop): the entire router +
|
| 199 |
+
dashboard running locally from your tray, with a glass popover showing live
|
| 200 |
+
request stats.
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
|
| 204 |
+
No published binaries — it builds from this repo in a few minutes:
|
| 205 |
+
|
| 206 |
+
```bash
|
| 207 |
+
npm install
|
| 208 |
+
npm run desktop:dist # macOS: desktop/dist-electron/FreeLLMAPI-…-arm64.dmg
|
| 209 |
+
npm run desktop:dist:win # Windows installer
|
| 210 |
+
```
|
| 211 |
+
|
| 212 |
+
> **Windows:** the build config is in place but not tested yet — if you try it,
|
| 213 |
+
> a quick report (working or not) in an issue would be much appreciated.
|
| 214 |
+
|
| 215 |
+
Locally built apps launch without Gatekeeper/SmartScreen warnings — no code
|
| 216 |
+
signing involved. Full instructions in [desktop/README.md](./desktop/README.md).
|
| 217 |
+
|
| 218 |
+
## Using the API
|
| 219 |
+
|
| 220 |
+
Any OpenAI-compatible client works. Examples:
|
| 221 |
+
|
| 222 |
+
**Python**
|
| 223 |
+
|
| 224 |
+
```python
|
| 225 |
+
from openai import OpenAI
|
| 226 |
+
|
| 227 |
+
client = OpenAI(
|
| 228 |
+
base_url="http://localhost:3001/v1",
|
| 229 |
+
api_key="freellmapi-your-unified-key",
|
| 230 |
+
)
|
| 231 |
+
|
| 232 |
+
resp = client.chat.completions.create(
|
| 233 |
+
model="auto", # let the router pick; or specify e.g. "gemini-2.5-flash"
|
| 234 |
+
messages=[{"role": "user", "content": "Summarise the fall of Rome in one sentence."}],
|
| 235 |
+
)
|
| 236 |
+
print(resp.choices[0].message.content)
|
| 237 |
+
print("Routed via:", resp.headers.get("x-routed-via"))
|
| 238 |
+
```
|
| 239 |
+
|
| 240 |
+
**curl**
|
| 241 |
+
|
| 242 |
+
```bash
|
| 243 |
+
curl http://localhost:3001/v1/chat/completions \
|
| 244 |
+
-H "Authorization: Bearer freellmapi-your-unified-key" \
|
| 245 |
+
-H "Content-Type: application/json" \
|
| 246 |
+
-d '{
|
| 247 |
+
"model": "auto",
|
| 248 |
+
"messages": [{"role": "user", "content": "hi"}]
|
| 249 |
+
}'
|
| 250 |
+
```
|
| 251 |
+
|
| 252 |
+
**Streaming**
|
| 253 |
+
|
| 254 |
+
```python
|
| 255 |
+
stream = client.chat.completions.create(
|
| 256 |
+
model="auto",
|
| 257 |
+
messages=[{"role": "user", "content": "Stream me a haiku about SQLite."}],
|
| 258 |
+
stream=True,
|
| 259 |
+
)
|
| 260 |
+
for chunk in stream:
|
| 261 |
+
print(chunk.choices[0].delta.content or "", end="", flush=True)
|
| 262 |
+
```
|
| 263 |
+
|
| 264 |
+
**Tool calling**
|
| 265 |
+
|
| 266 |
+
Pass OpenAI-style `tools` and `tool_choice`; the assistant response round-trips back through the proxy exactly like the OpenAI API. Multi-step flows (assistant `tool_calls` → `tool` role follow-up → final answer) work across every provider the router can reach.
|
| 267 |
+
|
| 268 |
+
```python
|
| 269 |
+
tools = [{
|
| 270 |
+
"type": "function",
|
| 271 |
+
"function": {
|
| 272 |
+
"name": "get_weather",
|
| 273 |
+
"description": "Get current weather for a city.",
|
| 274 |
+
"parameters": {
|
| 275 |
+
"type": "object",
|
| 276 |
+
"properties": {"city": {"type": "string"}},
|
| 277 |
+
"required": ["city"],
|
| 278 |
+
},
|
| 279 |
+
},
|
| 280 |
+
}]
|
| 281 |
+
|
| 282 |
+
# 1. Model asks for a tool call
|
| 283 |
+
first = client.chat.completions.create(
|
| 284 |
+
model="auto",
|
| 285 |
+
messages=[{"role": "user", "content": "What's the weather in Karachi?"}],
|
| 286 |
+
tools=tools,
|
| 287 |
+
tool_choice="required",
|
| 288 |
+
)
|
| 289 |
+
call = first.choices[0].message.tool_calls[0]
|
| 290 |
+
|
| 291 |
+
# 2. You execute the tool, feed the result back
|
| 292 |
+
final = client.chat.completions.create(
|
| 293 |
+
model="auto",
|
| 294 |
+
messages=[
|
| 295 |
+
{"role": "user", "content": "What's the weather in Karachi?"},
|
| 296 |
+
first.choices[0].message,
|
| 297 |
+
{"role": "tool", "tool_call_id": call.id, "content": '{"temp_c": 32, "cond": "sunny"}'},
|
| 298 |
+
],
|
| 299 |
+
tools=tools,
|
| 300 |
+
)
|
| 301 |
+
print(final.choices[0].message.content)
|
| 302 |
+
```
|
| 303 |
+
|
| 304 |
+
**Vision / image input**
|
| 305 |
+
|
| 306 |
+
Send images with the standard OpenAI `image_url` content blocks (base64 `data:` URLs or `http(s)` URLs). When a request contains an image, the router restricts itself to **vision-capable models** and ignores text-only ones. Vision models are tagged with a **Vision** badge on the Fallback Chain page; the current set includes Gemini (2.5 / 3.x), Llama 4 Scout/Maverick (Groq, NVIDIA), GLM-4.6V Flash (Z.ai), Nemotron Nano 12B VL (OpenRouter), and GitHub's GPT-4o / GPT-4.1.
|
| 307 |
+
|
| 308 |
+
```python
|
| 309 |
+
resp = client.chat.completions.create(
|
| 310 |
+
model="auto", # auto-routes to a vision model
|
| 311 |
+
messages=[{
|
| 312 |
+
"role": "user",
|
| 313 |
+
"content": [
|
| 314 |
+
{"type": "text", "text": "What's in this image?"},
|
| 315 |
+
{"type": "image_url", "image_url": {"url": "data:image/png;base64,<...>"}},
|
| 316 |
+
],
|
| 317 |
+
}],
|
| 318 |
+
)
|
| 319 |
+
print(resp.choices[0].message.content)
|
| 320 |
+
```
|
| 321 |
+
|
| 322 |
+
If no vision-capable model is enabled in your Fallback Chain, an image request returns a clear `422` (`code: "no_vision_model"`) rather than silently dropping the image. (Image input on `/v1/responses` isn't supported yet — use `/v1/chat/completions`.)
|
| 323 |
+
|
| 324 |
+
Works with `stream=True` as well — you'll get `delta.tool_calls` chunks followed by a `finish_reason: "tool_calls"` close. Under the hood, OpenAI-compatible providers (Groq, Cerebras, Mistral, OpenRouter, GitHub Models, HuggingFace, Cloudflare, Cohere compat) get the request passed through; Gemini requests get translated into Google's `functionDeclarations` / `functionResponse` shape and the response is translated back.
|
| 325 |
+
|
| 326 |
+
Every response carries an `X-Routed-Via: <platform>/<model>` header so you can see which provider actually served each call. If a request fell over between providers, you'll also see `X-Fallback-Attempts: N`.
|
| 327 |
+
|
| 328 |
+
### Embeddings
|
| 329 |
+
|
| 330 |
+
`/v1/embeddings` is OpenAI-compatible, with one deliberate difference from chat routing: **failover never crosses models.** Vectors from different models live in incompatible spaces — silently switching models would corrupt any vector store built on top of the proxy. So embeddings route by **family** (one model identity + dimension), and failover only walks the providers serving that same family.
|
| 331 |
+
|
| 332 |
+
```python
|
| 333 |
+
resp = client.embeddings.create(
|
| 334 |
+
model="auto", # default family; or a family name like "bge-m3"
|
| 335 |
+
input=["the quick brown fox", "pack my box with five dozen liquor jugs"],
|
| 336 |
+
)
|
| 337 |
+
print(len(resp.data), "vectors of", len(resp.data[0].embedding), "dims")
|
| 338 |
+
```
|
| 339 |
+
|
| 340 |
+
```bash
|
| 341 |
+
curl http://localhost:3001/v1/embeddings \
|
| 342 |
+
-H "Authorization: Bearer freellmapi-your-unified-key" \
|
| 343 |
+
-H "Content-Type: application/json" \
|
| 344 |
+
-d '{"model": "auto", "input": "hello world"}'
|
| 345 |
+
```
|
| 346 |
+
|
| 347 |
+
`model` accepts `auto` (the configured default family), a family name, or a provider-specific model id (which resolves to its family). Available families:
|
| 348 |
+
|
| 349 |
+
| Family (`model`) | Dims | Providers (failover order) |
|
| 350 |
+
| --- | --- | --- |
|
| 351 |
+
| `gemini-embedding-001` *(default)* | 3072 | Google |
|
| 352 |
+
| `text-embedding-3-large` | 3072 | GitHub Models |
|
| 353 |
+
| `text-embedding-3-small` | 1536 | GitHub Models |
|
| 354 |
+
| `embed-v4.0` | 1536 | Cohere |
|
| 355 |
+
| `bge-m3` | 1024 | Cloudflare → Hugging Face |
|
| 356 |
+
| `qwen3-embedding-0.6b` | 1024 | Cloudflare |
|
| 357 |
+
| `nv-embedqa-e5-v5` | 1024 | NVIDIA |
|
| 358 |
+
| `llama-nemotron-embed-1b-v2` | 2048 | NVIDIA |
|
| 359 |
+
| `llama-nemotron-embed-vl-1b-v2` | 2048 | NVIDIA → OpenRouter |
|
| 360 |
+
| `embeddinggemma-300m` | 768 | Cloudflare |
|
| 361 |
+
|
| 362 |
+
The default family, per-provider toggles, and priorities live on the dashboard's **Models → Embeddings** page. Pick your family once and stick with it for a given vector store — that's the whole point of the family model.
|
| 363 |
+
|
| 364 |
+
## Screenshots
|
| 365 |
+
|
| 366 |
+
### Keys
|
| 367 |
+
|
| 368 |
+
Manage provider credentials and grab the unified API key your apps connect with. Each key shows a status dot and when it was last health-checked.
|
| 369 |
+
|
| 370 |
+

|
| 371 |
+
|
| 372 |
+
### Playground
|
| 373 |
+
|
| 374 |
+
Send a chat completion through the router and see which provider served it, with the model ID and latency printed right on the message.
|
| 375 |
+
|
| 376 |
+

|
| 377 |
+
|
| 378 |
+
### Analytics
|
| 379 |
+
|
| 380 |
+
Request volume, success rate, tokens in and out, average latency, and per-provider breakdowns over 24h / 7d / 30d windows.
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
|
| 384 |
+
## How it works
|
| 385 |
+
|
| 386 |
+
```
|
| 387 |
+
┌──────────────────┐ Bearer freellmapi-… ┌─────────────────────────┐
|
| 388 |
+
│ OpenAI SDK / │ ──────────────────────▶ │ Express proxy (:3001) │
|
| 389 |
+
│ curl / any │ ◀────────────────────── │ /v1/chat/completions │
|
| 390 |
+
│ OpenAI client │ streamed tokens └────────────┬────────────┘
|
| 391 |
+
└──────────────────┘ │
|
| 392 |
+
▼
|
| 393 |
+
┌────────────────────────────────────────────────┐
|
| 394 |
+
│ Router │
|
| 395 |
+
│ 1. Pick highest-priority model that │
|
| 396 |
+
│ (a) has a healthy key and │
|
| 397 |
+
│ (b) is under all its rate limits. │
|
| 398 |
+
│ 2. Decrypt key, call provider SDK. │
|
| 399 |
+
│ 3. On 429/5xx → cooldown + retry next model. │
|
| 400 |
+
└────────────────────────────────────────────────┘
|
| 401 |
+
│
|
| 402 |
+
┌──────────────┬────────────┬──────────┴─────────┬─────────────┬──────────┐
|
| 403 |
+
▼ ▼ ▼ ▼ ▼ ▼
|
| 404 |
+
Google Groq Cerebras OpenRouter HF …10 more
|
| 405 |
+
```
|
| 406 |
+
|
| 407 |
+
- **Router** (`server/src/services/router.ts`) — picks a model per request.
|
| 408 |
+
- **Rate-limit ledger** (`server/src/services/ratelimit.ts`) — in-memory RPM/RPD/TPM/TPD counters backed by SQLite, with cooldowns on 429s.
|
| 409 |
+
- **Provider adapters** (`server/src/providers/*.ts`) — one file per provider, implementing the `Provider` base class: `chatCompletion()` and `streamChatCompletion()`.
|
| 410 |
+
- **Health service** (`server/src/services/health.ts`) — periodic probe keeps key status fresh.
|
| 411 |
+
- **Dashboard** (`client/`) — React + Vite + shadcn/ui admin surface.
|
| 412 |
+
- **Storage** — SQLite (`better-sqlite3`) with AES-256-GCM envelope encryption for keys.
|
| 413 |
+
|
| 414 |
+
## Limitations
|
| 415 |
+
|
| 416 |
+
Stacking free tiers has real trade-offs. Be honest with yourself about them:
|
| 417 |
+
|
| 418 |
+
- **No frontier models.** The free-tier catalog tops out around Llama 3.3 70B, GLM-4.5, Qwen 3 Coder, and Gemini 2.5 Pro. You will not get GPT-5 or Claude Opus class reasoning through this. For hard problems, pay for a real API.
|
| 419 |
+
- **Intelligence degrades as the day progresses.** Your top-ranked models (usually Gemini 2.5 Pro, GPT-4o via GitHub Models) have the lowest daily caps. Once they hit their limits, the router falls down your priority chain to smaller/weaker models. Expect the effective intelligence of the endpoint to drop in the late hours of each day — then reset at UTC midnight.
|
| 420 |
+
- **Latency is highly variable.** Cerebras and Groq are extremely fast; others are not. You get whichever one is available.
|
| 421 |
+
- **Free tiers can change without notice.** Providers regularly tighten, loosen, or remove free tiers. When that happens you'll see 429s or auth errors until you update the catalog. Re-seed scripts live in `server/src/scripts/`.
|
| 422 |
+
- **No SLA, by definition.** If you need reliability, use a paid provider with a contract.
|
| 423 |
+
- **Local-first.** There's no multi-tenant auth. Run this for yourself; don't expose it to the internet.
|
| 424 |
+
|
| 425 |
+
## Contributing
|
| 426 |
+
|
| 427 |
+
Contributors very welcome! Good first PRs:
|
| 428 |
+
|
| 429 |
+
- **Add a provider** — copy `server/src/providers/openai-compat.ts` as a template, wire it into `server/src/providers/index.ts`, seed its models in `server/src/db/index.ts`, add a test in `server/src/__tests__/providers/`.
|
| 430 |
+
- **Add an endpoint** — images, moderations, audio. The provider base class can grow new methods; adapters declare which they support.
|
| 431 |
+
- **Improve the router** — cost-aware routing (cheapest-healthy-fastest tradeoffs), better latency-weighted priority, regional pinning.
|
| 432 |
+
- **Dashboard polish** — charts on the Analytics page, key rotation UX, batch import of keys from `.env`.
|
| 433 |
+
- **Docs** — more examples, client library snippets for Go/Rust/etc., a deployment recipe for Docker or Fly.
|
| 434 |
+
|
| 435 |
+
**Development loop:**
|
| 436 |
+
|
| 437 |
+
```bash
|
| 438 |
+
npm install
|
| 439 |
+
npm run dev # server on :3001, dashboard on :5173, both with HMR
|
| 440 |
+
npm test # server vitest; also runs client tests if the workspace adds them
|
| 441 |
+
npm run build # compile server and dashboard
|
| 442 |
+
```
|
| 443 |
+
|
| 444 |
+
PRs should include a test, keep the existing test suite green, and match the `.editorconfig` / tsconfig defaults already in the repo. Issues and discussions are open.
|
| 445 |
+
|
| 446 |
+
### Contributors
|
| 447 |
+
|
| 448 |
+
<a href="https://github.com/moaaz12-web"><img src="https://images.weserv.nl/?url=github.com/moaaz12-web.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@moaaz12-web" /></a>
|
| 449 |
+
<a href="https://github.com/lukasulc"><img src="https://images.weserv.nl/?url=github.com/lukasulc.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@lukasulc" /></a>
|
| 450 |
+
<a href="https://github.com/VinhPhamAI"><img src="https://images.weserv.nl/?url=github.com/VinhPhamAI.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@VinhPhamAI" /></a>
|
| 451 |
+
<a href="https://github.com/deadc"><img src="https://images.weserv.nl/?url=github.com/deadc.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@deadc" /></a>
|
| 452 |
+
<a href="https://github.com/zhangyu1324"><img src="https://images.weserv.nl/?url=github.com/zhangyu1324.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@zhangyu1324" /></a>
|
| 453 |
+
<a href="https://github.com/Tazrif-Raim"><img src="https://images.weserv.nl/?url=github.com/Tazrif-Raim.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@Tazrif-Raim" /></a>
|
| 454 |
+
<a href="https://github.com/hodlmybeer69-bit"><img src="https://images.weserv.nl/?url=github.com/hodlmybeer69-bit.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@hodlmybeer69-bit" /></a>
|
| 455 |
+
<a href="https://github.com/phoenixikkifullstack"><img src="https://images.weserv.nl/?url=github.com/phoenixikkifullstack.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@phoenixikkifullstack" /></a>
|
| 456 |
+
<a href="https://github.com/jtbrennan-git"><img src="https://images.weserv.nl/?url=github.com/jtbrennan-git.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@jtbrennan-git" /></a>
|
| 457 |
+
<a href="https://github.com/praveenkumarpranjal"><img src="https://images.weserv.nl/?url=github.com/praveenkumarpranjal.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@praveenkumarpranjal" /></a>
|
| 458 |
+
<a href="https://github.com/nordbyte"><img src="https://images.weserv.nl/?url=github.com/nordbyte.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@nordbyte" /></a>
|
| 459 |
+
<a href="https://github.com/mybropro"><img src="https://images.weserv.nl/?url=github.com/mybropro.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@mybropro" /></a>
|
| 460 |
+
<a href="https://github.com/danscMax"><img src="https://images.weserv.nl/?url=github.com/danscMax.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@danscMax" /></a>
|
| 461 |
+
<a href="https://github.com/jhash"><img src="https://images.weserv.nl/?url=github.com/jhash.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@jhash" /></a>
|
| 462 |
+
<a href="https://github.com/JammyJames1234"><img src="https://images.weserv.nl/?url=github.com/JammyJames1234.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@JammyJames1234" /></a>
|
| 463 |
+
<a href="https://github.com/Sumit4codes"><img src="https://images.weserv.nl/?url=github.com/Sumit4codes.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@Sumit4codes" /></a>
|
| 464 |
+
<a href="https://github.com/meliani"><img src="https://images.weserv.nl/?url=github.com/meliani.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@meliani" /></a>
|
| 465 |
+
<a href="https://github.com/thedavidweng"><img src="https://images.weserv.nl/?url=github.com/thedavidweng.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@thedavidweng" /></a>
|
| 466 |
+
<a href="https://github.com/bharvey42"><img src="https://images.weserv.nl/?url=github.com/bharvey42.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@bharvey42" /></a>
|
| 467 |
+
<a href="https://github.com/yuvrxj-afk"><img src="https://images.weserv.nl/?url=github.com/yuvrxj-afk.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@yuvrxj-afk" /></a>
|
| 468 |
+
<a href="https://github.com/Tushar49"><img src="https://images.weserv.nl/?url=github.com/Tushar49.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@Tushar49" /></a>
|
| 469 |
+
<a href="https://github.com/nicyoong"><img src="https://images.weserv.nl/?url=github.com/nicyoong.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@nicyoong" /></a>
|
| 470 |
+
<a href="https://github.com/Aldo-f"><img src="https://images.weserv.nl/?url=github.com/Aldo-f.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@Aldo-f" /></a>
|
| 471 |
+
<a href="https://github.com/Tazrif-Raim"><img src="https://images.weserv.nl/?url=github.com/Tazrif-Raim.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@Tazrif-Raim" /></a>
|
| 472 |
+
<a href="https://github.com/m1nuzz"><img src="https://images.weserv.nl/?url=github.com/m1nuzz.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@m1nuzz" /></a>
|
| 473 |
+
<a href="https://github.com/LoneRifle"><img src="https://images.weserv.nl/?url=github.com/LoneRifle.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@LoneRifle" /></a>
|
| 474 |
+
<a href="https://github.com/ita333"><img src="https://images.weserv.nl/?url=github.com/ita333.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@ita333" /></a>
|
| 475 |
+
<a href="https://github.com/barbotkonv"><img src="https://images.weserv.nl/?url=github.com/barbotkonv.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@barbotkonv" /></a>
|
| 476 |
+
<a href="https://github.com/Naster17"><img src="https://images.weserv.nl/?url=github.com/Naster17.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@Naster17" /></a>
|
| 477 |
+
<a href="https://github.com/StealthTensor"><img src="https://images.weserv.nl/?url=github.com/StealthTensor.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@StealthTensor" /></a>
|
| 478 |
+
<a href="https://github.com/EmranAhmed"><img src="https://images.weserv.nl/?url=github.com/EmranAhmed.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@EmranAhmed" /></a>
|
| 479 |
+
<a href="https://github.com/itsfuad"><img src="https://images.weserv.nl/?url=github.com/itsfuad.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@itsfuad" /></a>
|
| 480 |
+
<a href="https://github.com/RobinHoodO"><img src="https://images.weserv.nl/?url=github.com/RobinHoodO.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@RobinHoodO" /></a>
|
| 481 |
+
<a href="https://github.com/hmm183"><img src="https://images.weserv.nl/?url=github.com/hmm183.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@hmm183" /></a>
|
| 482 |
+
<a href="https://github.com/duemilionidieuro-bot"><img src="https://images.weserv.nl/?url=github.com/duemilionidieuro-bot.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@duemilionidieuro-bot" /></a>
|
| 483 |
+
<a href="https://github.com/hjhhoni"><img src="https://images.weserv.nl/?url=github.com/hjhhoni.png&w=60&h=60&fit=cover&mask=circle" width="60" alt="@hjhhoni" /></a>
|
| 484 |
+
|
| 485 |
+
## Terms of Service review
|
| 486 |
+
|
| 487 |
+
A self-hosted, single-user, personal-use setup was re-reviewed against each provider's ToS (May 2026). Summary:
|
| 488 |
+
|
| 489 |
+
| Provider | Verdict | Notes |
|
| 490 |
+
|---|---|---|
|
| 491 |
+
| Google Gemini | ⚠️ Caution | March 2026 ToS narrows scope to *"professional or business purposes, not for consumer use"* — a self-hosted developer proxy is still defensible, but the clause is new. |
|
| 492 |
+
| Groq | ✅ Likely OK | GroqCloud Services Agreement permits Customer Application integration. |
|
| 493 |
+
| Cerebras | ✅ Likely OK | Permitted; explicitly forbids selling/transferring API keys. |
|
| 494 |
+
| Mistral | ✅ Likely OK | APIs allowed for personal/internal business use. |
|
| 495 |
+
| OpenRouter | ✅ Likely OK | April 2026 ToS sharpens the no-resale / no-competing-service clause; private single-user proxy still fine. |
|
| 496 |
+
| Cloudflare Workers AI | ⚠️ Ambiguous | No anti-proxy clause; covered by general Self-Serve Subscription Agreement. |
|
| 497 |
+
| NVIDIA NIM | ⚠️ Caution | Trial ToS §1.2 / §1.4: *"evaluation only, not production."* Disabled in default catalog. |
|
| 498 |
+
| GitHub Models | ⚠️ Caution | Free tier explicitly scoped to *"experimentation"* and *"prototyping."* |
|
| 499 |
+
| Cohere | ❌ Avoid | Terms §14 still forbids *"personal, family or household purposes."* |
|
| 500 |
+
| Zhipu (open.bigmodel.cn) | ✅ Likely OK | Personal/non-commercial research carve-out still in the platform docs. |
|
| 501 |
+
| Z.ai (api.z.ai) | ⚠️ Caution | New row — Singapore entity (distinct from Zhipu CN). §III.3(l) anti-traffic-redirect clause could plausibly be read against a proxy; no explicit personal-use carve-out. |
|
| 502 |
+
| Ollama Cloud | ✅ Likely OK | New row — Free plan permits cloud-model access (1 concurrent, 5-hour session caps). No anti-proxy / anti-resale clauses found. *(Integration tracked in #14.)* |
|
| 503 |
+
|
| 504 |
+
Rules of thumb that keep most providers happy: **one account per provider**, **no reselling**, **no sharing your endpoint with other humans**, **don't hammer a free tier as a paid production backend**. This is informational, not legal advice — read each provider's ToS and make your own call.
|
| 505 |
+
|
| 506 |
+
Removed since the April 2026 review: Hugging Face, Moonshot, and MiniMax direct integrations were dropped from the catalog (HF — tool-call format issues; Moonshot — moved to paid only; MiniMax — superseded by the OpenRouter `minimax/minimax-m2.5:free` route).
|
| 507 |
+
|
| 508 |
+
## Disclaimer
|
| 509 |
+
|
| 510 |
+
**This project is for personal experimentation and learning, not production.** Free tiers exist so developers can prototype against them; they aren't a stable, supported inference substrate and shouldn't be treated as one. If you build something real on top of FreeLLMAPI, swap in a paid API before you ship. Your relationship with each upstream provider is governed by the terms you accepted when you created your account — those terms still apply when the traffic is proxied through this project, and you're responsible for complying with them.
|
| 511 |
+
|
| 512 |
+
## Star History
|
| 513 |
+
|
| 514 |
+
[](https://www.star-history.com/?repos=tashfeenahmed%2Ffreellmapi&type=date&legend=top-left)
|
| 515 |
+
|
| 516 |
+
## License
|
| 517 |
+
|
| 518 |
+
[MIT](./LICENSE)
|
client/.gitignore
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Logs
|
| 2 |
+
logs
|
| 3 |
+
*.log
|
| 4 |
+
npm-debug.log*
|
| 5 |
+
yarn-debug.log*
|
| 6 |
+
yarn-error.log*
|
| 7 |
+
pnpm-debug.log*
|
| 8 |
+
lerna-debug.log*
|
| 9 |
+
|
| 10 |
+
node_modules
|
| 11 |
+
dist
|
| 12 |
+
dist-ssr
|
| 13 |
+
*.local
|
| 14 |
+
|
| 15 |
+
# Editor directories and files
|
| 16 |
+
.vscode/*
|
| 17 |
+
!.vscode/extensions.json
|
| 18 |
+
.idea
|
| 19 |
+
.DS_Store
|
| 20 |
+
*.suo
|
| 21 |
+
*.ntvs*
|
| 22 |
+
*.njsproj
|
| 23 |
+
*.sln
|
| 24 |
+
*.sw?
|
client/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# React + TypeScript + Vite
|
| 2 |
+
|
| 3 |
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
| 4 |
+
|
| 5 |
+
Currently, two official plugins are available:
|
| 6 |
+
|
| 7 |
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
|
| 8 |
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
|
| 9 |
+
|
| 10 |
+
## React Compiler
|
| 11 |
+
|
| 12 |
+
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
| 13 |
+
|
| 14 |
+
## Expanding the ESLint configuration
|
| 15 |
+
|
| 16 |
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
| 17 |
+
|
| 18 |
+
```js
|
| 19 |
+
export default defineConfig([
|
| 20 |
+
globalIgnores(['dist']),
|
| 21 |
+
{
|
| 22 |
+
files: ['**/*.{ts,tsx}'],
|
| 23 |
+
extends: [
|
| 24 |
+
// Other configs...
|
| 25 |
+
|
| 26 |
+
// Remove tseslint.configs.recommended and replace with this
|
| 27 |
+
tseslint.configs.recommendedTypeChecked,
|
| 28 |
+
// Alternatively, use this for stricter rules
|
| 29 |
+
tseslint.configs.strictTypeChecked,
|
| 30 |
+
// Optionally, add this for stylistic rules
|
| 31 |
+
tseslint.configs.stylisticTypeChecked,
|
| 32 |
+
|
| 33 |
+
// Other configs...
|
| 34 |
+
],
|
| 35 |
+
languageOptions: {
|
| 36 |
+
parserOptions: {
|
| 37 |
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
| 38 |
+
tsconfigRootDir: import.meta.dirname,
|
| 39 |
+
},
|
| 40 |
+
// other options...
|
| 41 |
+
},
|
| 42 |
+
},
|
| 43 |
+
])
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
| 47 |
+
|
| 48 |
+
```js
|
| 49 |
+
// eslint.config.js
|
| 50 |
+
import reactX from 'eslint-plugin-react-x'
|
| 51 |
+
import reactDom from 'eslint-plugin-react-dom'
|
| 52 |
+
|
| 53 |
+
export default defineConfig([
|
| 54 |
+
globalIgnores(['dist']),
|
| 55 |
+
{
|
| 56 |
+
files: ['**/*.{ts,tsx}'],
|
| 57 |
+
extends: [
|
| 58 |
+
// Other configs...
|
| 59 |
+
// Enable lint rules for React
|
| 60 |
+
reactX.configs['recommended-typescript'],
|
| 61 |
+
// Enable lint rules for React DOM
|
| 62 |
+
reactDom.configs.recommended,
|
| 63 |
+
],
|
| 64 |
+
languageOptions: {
|
| 65 |
+
parserOptions: {
|
| 66 |
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
| 67 |
+
tsconfigRootDir: import.meta.dirname,
|
| 68 |
+
},
|
| 69 |
+
// other options...
|
| 70 |
+
},
|
| 71 |
+
},
|
| 72 |
+
])
|
| 73 |
+
```
|
client/components.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://ui.shadcn.com/schema.json",
|
| 3 |
+
"style": "base-nova",
|
| 4 |
+
"rsc": false,
|
| 5 |
+
"tsx": true,
|
| 6 |
+
"tailwind": {
|
| 7 |
+
"config": "",
|
| 8 |
+
"css": "src/index.css",
|
| 9 |
+
"baseColor": "neutral",
|
| 10 |
+
"cssVariables": true,
|
| 11 |
+
"prefix": ""
|
| 12 |
+
},
|
| 13 |
+
"iconLibrary": "lucide",
|
| 14 |
+
"rtl": false,
|
| 15 |
+
"aliases": {
|
| 16 |
+
"components": "@/components",
|
| 17 |
+
"utils": "@/lib/utils",
|
| 18 |
+
"ui": "@/components/ui",
|
| 19 |
+
"lib": "@/lib",
|
| 20 |
+
"hooks": "@/hooks"
|
| 21 |
+
},
|
| 22 |
+
"menuColor": "default",
|
| 23 |
+
"menuAccent": "subtle",
|
| 24 |
+
"registries": {}
|
| 25 |
+
}
|
client/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2
ADDED
|
Binary file (7.42 kB). View file
|
|
|
client/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2
ADDED
|
Binary file (15.1 kB). View file
|
|
|
client/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2
ADDED
|
Binary file (16.5 kB). View file
|
|
|
client/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2
ADDED
|
Binary file (29.4 kB). View file
|
|
|
client/dist/assets/geist-mono-cyrillic-ext-wght-normal-I4S5GZfc.woff2
ADDED
|
Binary file (6.18 kB). View file
|
|
|
client/dist/assets/geist-mono-cyrillic-wght-normal-BmXc_FBt.woff2
ADDED
|
Binary file (12.9 kB). View file
|
|
|
client/dist/assets/geist-mono-latin-ext-wght-normal-DrnZ1wKl.woff2
ADDED
|
Binary file (14.8 kB). View file
|
|
|
client/dist/assets/geist-mono-latin-wght-normal-B_7UjwxQ.woff2
ADDED
|
Binary file (29.9 kB). View file
|
|
|
client/dist/assets/geist-mono-symbols2-wght-normal-GZpp1pK2.woff2
ADDED
|
Binary file (5.8 kB). View file
|
|
|
client/dist/assets/geist-mono-vietnamese-wght-normal-D8KDMBhC.woff2
ADDED
|
Binary file (7.72 kB). View file
|
|
|
client/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2
ADDED
|
Binary file (8 kB). View file
|
|
|
client/dist/assets/index-BpoX3Fkj.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
client/dist/assets/index-CBvmpuEj.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
| 2 |
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:"Geist Variable", ui-sans-serif, system-ui, -apple-system, sans-serif;--font-mono:"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, monospace;--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-emerald-500:oklch(69.6% .17 162.48);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-600:oklch(60.9% .126 221.723);--color-cyan-700:oklch(52% .105 223.128);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-600:oklch(54.1% .281 293.009);--color-violet-700:oklch(49.1% .27 292.581);--color-rose-500:oklch(64.5% .246 16.439);--spacing:.25rem;--container-sm:24rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-snug:1.375;--leading-relaxed:1.625;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-bounce:bounce 1s infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Geist Variable", ui-sans-serif, system-ui, -apple-system, sans-serif;--default-mono-font-family:"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, monospace}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab, var(--ring) 50%, transparent)}}html{font-feature-settings:"ss01", "cv11";text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Geist Variable,ui-sans-serif,system-ui,-apple-system,sans-serif}body{background-color:var(--background);color:var(--foreground);font-feature-settings:"ss01", "cv11", "tnum"}html.desktop body{background-color:#0000}html.desktop .desktop-backdrop{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){html.desktop .desktop-backdrop{background-color:color-mix(in oklab, var(--background) 55%, transparent)}}code,pre,kbd,samp{font-family:var(--font-mono);font-feature-settings:"ss02", "ss03"}.tabular-nums{font-variant-numeric:tabular-nums}input,textarea,select{font-feature-settings:"ss01"}}@layer components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.right-2{right:calc(var(--spacing) * 2)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-6{bottom:calc(var(--spacing) * 6)}.isolate{isolation:isolate}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.-mx-4{margin-inline:calc(var(--spacing) * -4)}.mx-1\.5{margin-inline:calc(var(--spacing) * 1.5)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing) * 1)}.my-2{margin-block:calc(var(--spacing) * 2)}.my-3{margin-block:calc(var(--spacing) * 3)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-5{margin-left:calc(var(--spacing) * 5)}.ml-10{margin-left:calc(var(--spacing) * 10)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.field-sizing-content{field-sizing:content}.size-1\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-\[calc\(100vh-8rem\)\]{height:calc(100vh - 8rem)}.h-full{height:100%}.h-px{height:1px}.max-h-\(--available-height\){max-height:var(--available-height)}.max-h-\[160px\]{max-height:160px}.max-h-\[240px\]{max-height:240px}.max-h-\[360px\]{max-height:360px}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-16{min-height:calc(var(--spacing) * 16)}.min-h-\[40px\]{min-height:40px}.min-h-screen{min-height:100vh}.w-\(--anchor-width\){width:var(--anchor-width)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-12{width:calc(var(--spacing) * 12)}.w-52{width:calc(var(--spacing) * 52)}.w-56{width:calc(var(--spacing) * 56)}.w-72{width:calc(var(--spacing) * 72)}.w-80{width:calc(var(--spacing) * 80)}.w-\[150px\]{width:150px}.w-\[160px\]{width:160px}.w-\[180px\]{width:180px}.w-\[200px\]{width:200px}.w-\[220px\]{width:220px}.w-\[260px\]{width:260px}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\[78\%\]{max-width:78%}.max-w-\[200px\]{max-width:200px}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-24{min-width:calc(var(--spacing) * 24)}.min-w-32{min-width:calc(var(--spacing) * 32)}.min-w-36{min-width:calc(var(--spacing) * 36)}.min-w-\[240px\]{min-width:240px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\(--transform-origin\){transform-origin:var(--transform-origin)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-bounce{animation:var(--animate-bounce)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-out{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-help{cursor:help}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.scroll-my-1{scroll-margin-block:calc(var(--spacing) * 1)}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-5{column-gap:calc(var(--spacing) * 5)}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 3) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:calc(var(--radius) * 2)}.rounded-3xl{border-radius:calc(var(--radius) * 3)}.rounded-4xl{border-radius:calc(var(--radius) * 4)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) * .75)}.rounded-sm{border-radius:calc(var(--radius) * .5)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.rounded-t-3xl{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.rounded-b-3xl{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-border{border-color:var(--border)}.border-destructive\/40{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.border-destructive\/40{border-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.border-foreground\/15{border-color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.border-foreground\/15{border-color:color-mix(in oklab, var(--foreground) 15%, transparent)}}.border-foreground\/20{border-color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.border-foreground\/20{border-color:color-mix(in oklab, var(--foreground) 20%, transparent)}}.border-input{border-color:var(--input)}.border-transparent{border-color:#0000}.bg-accent{background-color:var(--accent)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-600\/15{background-color:#dd740026}@supports (color:color-mix(in lab, red, red)){.bg-amber-600\/15{background-color:color-mix(in oklab, var(--color-amber-600) 15%, transparent)}}.bg-background,.bg-background\/40{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){.bg-background\/40{background-color:color-mix(in oklab, var(--background) 40%, transparent)}}.bg-background\/45{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){.bg-background\/45{background-color:color-mix(in oklab, var(--background) 45%, transparent)}}.bg-background\/50{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){.bg-background\/50{background-color:color-mix(in oklab, var(--background) 50%, transparent)}}.bg-background\/60{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){.bg-background\/60{background-color:color-mix(in oklab, var(--background) 60%, transparent)}}.bg-background\/80{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){.bg-background\/80{background-color:color-mix(in oklab, var(--background) 80%, transparent)}}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-cyan-600\/15{background-color:#0092b526}@supports (color:color-mix(in lab, red, red)){.bg-cyan-600\/15{background-color:color-mix(in oklab, var(--color-cyan-600) 15%, transparent)}}.bg-destructive\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\/10{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-foreground{background-color:var(--foreground)}.bg-muted{background-color:var(--muted)}.bg-muted-foreground\/30{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\/30{background-color:color-mix(in oklab, var(--muted-foreground) 30%, transparent)}}.bg-muted-foreground\/40{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\/40{background-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent)}}.bg-muted-foreground\/50{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\/50{background-color:color-mix(in oklab, var(--muted-foreground) 50%, transparent)}}.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\/50{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-rose-500{background-color:var(--color-rose-500)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-violet-600\/15{background-color:#7f22fe26}@supports (color:color-mix(in lab, red, red)){.bg-violet-600\/15{background-color:color-mix(in oklab, var(--color-violet-600) 15%, transparent)}}.bg-clip-padding{background-clip:padding-box}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-8{padding-block:calc(var(--spacing) * 8)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pr-1{padding-right:calc(var(--spacing) * 1)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-1\.5{padding-left:calc(var(--spacing) * 1.5)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-20{padding-left:calc(var(--spacing) * 20)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-top{vertical-align:top}.font-heading{font-family:var(--font-sans)}.font-mono{font-family:Geist Mono Variable,ui-monospace,SFMono-Regular,Menlo,monospace}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.8rem\]{font-size:.8rem}.text-\[0\.85em\]{font-size:.85em}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12\.5px\]{font-size:12.5px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.wrap-break-word{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent-foreground{color:var(--accent-foreground)}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-background{color:var(--background)}.text-card-foreground{color:var(--card-foreground)}.text-cyan-700{color:var(--color-cyan-700)}.text-destructive{color:var(--destructive)}.text-foreground,.text-foreground\/80{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\/80{color:color-mix(in oklab, var(--foreground) 80%, transparent)}}.text-muted-foreground,.text-muted-foreground\/30{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\/30{color:color-mix(in oklab, var(--muted-foreground) 30%, transparent)}}.text-muted-foreground\/50{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\/50{color:color-mix(in oklab, var(--muted-foreground) 50%, transparent)}}.text-muted-foreground\/60{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\/60{color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.text-muted-foreground\/70{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\/70{color:color-mix(in oklab, var(--muted-foreground) 70%, transparent)}}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-violet-700{color:var(--color-violet-700)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.decoration-foreground\/40{-webkit-text-decoration-color:var(--foreground);-webkit-text-decoration-color:var(--foreground);-webkit-text-decoration-color:var(--foreground);text-decoration-color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.decoration-foreground\/40{-webkit-text-decoration-color:color-mix(in oklab, var(--foreground) 40%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--foreground) 40%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--foreground) 40%, transparent);text-decoration-color:color-mix(in oklab, var(--foreground) 40%, transparent)}}.decoration-dotted{text-decoration-style:dotted}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-foreground\/10{--tw-ring-color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.ring-foreground\/10{--tw-ring-color:color-mix(in oklab, var(--foreground) 10%, transparent)}}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[max-height\]{transition-property:max-height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.fill-mode-forwards{--tw-animation-fill-mode:forwards;animation-fill-mode:forwards}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.fade-in{--tw-enter-opacity:0}.fade-out{--tw-exit-opacity:0}.running{animation-play-state:running}.slide-in-from-bottom-4{--tw-enter-translate-y:calc(4*var(--spacing))}.slide-out-to-bottom-4{--tw-exit-translate-y:calc(4*var(--spacing))}.group-focus\/dropdown-menu-item\:text-accent-foreground:is(:where(.group\/dropdown-menu-item):focus *){color:var(--accent-foreground)}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\[size\=default\]\/switch\:size-4:is(:where(.group\/switch)[data-size=default] *){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.group-data-\[size\=sm\]\/card\:p-3:is(:where(.group\/card)[data-size=sm] *){padding:calc(var(--spacing) * 3)}.group-data-\[size\=sm\]\/card\:px-3:is(:where(.group\/card)[data-size=sm] *){padding-inline:calc(var(--spacing) * 3)}.group-data-\[size\=sm\]\/card\:text-sm:is(:where(.group\/card)[data-size=sm] *){font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.group-data-\[size\=sm\]\/switch\:size-3:is(:where(.group\/switch)[data-size=sm] *){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-6::file-selector-button{height:calc(var(--spacing) * 6)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-x-3:after{content:var(--tw-content);inset-inline:calc(var(--spacing) * -3)}.after\:inset-x-0:after{content:var(--tw-content);inset-inline:calc(var(--spacing) * 0)}.after\:-inset-y-2:after{content:var(--tw-content);inset-block:calc(var(--spacing) * -2)}.after\:-bottom-px:after{content:var(--tw-content);bottom:-1px}.after\:h-px:after{content:var(--tw-content);height:1px}.after\:bg-foreground:after{content:var(--tw-content);background-color:var(--foreground)}.first\:mt-0:first-child{margin-top:calc(var(--spacing) * 0)}.last\:mb-0:last-child{margin-bottom:calc(var(--spacing) * 0)}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}@media (hover:hover){.hover\:bg-destructive\/20:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-destructive\/20:hover{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.hover\:bg-muted:hover,.hover\:bg-muted\/40:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-muted\/40:hover{background-color:color-mix(in oklab, var(--muted) 40%, transparent)}}.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.hover\:text-destructive:hover{color:var(--destructive)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-muted-foreground:hover{color:var(--muted-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:decoration-foreground:hover{-webkit-text-decoration-color:var(--foreground);-webkit-text-decoration-color:var(--foreground);-webkit-text-decoration-color:var(--foreground);text-decoration-color:var(--foreground)}.hover\:opacity-70:hover{opacity:.7}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-ring\/50:focus{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus\:ring-ring\/50:focus{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}:is(.focus\:\*\*\:text-accent-foreground:focus *),:is(.not-data-\[variant\=destructive\]\:focus\:\*\*\:text-accent-foreground:not([data-variant=destructive]):focus *){color:var(--accent-foreground)}.focus-visible\:border-destructive\/40:focus-visible{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:border-destructive\/40:focus-visible{border-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-3:focus-visible,.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.active\:cursor-grabbing:active{cursor:grabbing}.active\:not-aria-\[haspopup\]\:translate-y-px:active:not([aria-haspopup]){--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-input\/50:disabled{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.disabled\:bg-input\/50:disabled{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}.disabled\:opacity-25:disabled{opacity:.25}.disabled\:opacity-50:disabled{opacity:.5}:where([data-slot=button-group]) .in-data-\[slot\=button-group\]\:rounded-lg{border-radius:var(--radius)}.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.has-aria-expanded\:bg-muted\/50:has([aria-expanded=true]){background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}.has-data-\[icon\=inline-end\]\:pr-1\.5:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-end\]\:pr-2:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 2)}.has-data-\[icon\=inline-start\]\:pl-1\.5:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-start\]\:pl-2:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 2)}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\[slot\=card-description\]\:grid-rows-\[auto_auto\]:has([data-slot=card-description]){grid-template-rows:auto auto}.has-data-\[slot\=card-footer\]\:pb-0:has([data-slot=card-footer]){padding-bottom:calc(var(--spacing) * 0)}.has-\[\>img\:first-child\]\:pt-0:has(>img:first-child){padding-top:calc(var(--spacing) * 0)}.aria-expanded\:bg-muted[aria-expanded=true]{background-color:var(--muted)}.aria-expanded\:bg-secondary[aria-expanded=true]{background-color:var(--secondary)}.aria-expanded\:text-foreground[aria-expanded=true]{color:var(--foreground)}.aria-expanded\:text-secondary-foreground[aria-expanded=true]{color:var(--secondary-foreground)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-3[aria-invalid=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-inset\:pl-7[data-inset]{padding-left:calc(var(--spacing) * 7)}.data-placeholder\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-popup-open\:bg-accent[data-popup-open]{background-color:var(--accent)}.data-popup-open\:text-accent-foreground[data-popup-open]{color:var(--accent-foreground)}.data-\[align-trigger\=true\]\:animate-none[data-align-trigger=true]{animation:none}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=inline-end\]\:slide-in-from-left-2[data-side=inline-end]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=inline-start\]\:slide-in-from-right-2[data-side=inline-start],.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=default\]\:h-8[data-size=default]{height:calc(var(--spacing) * 8)}.data-\[size\=default\]\:h-\[18\.4px\][data-size=default]{height:18.4px}.data-\[size\=default\]\:w-\[32px\][data-size=default]{width:32px}.data-\[size\=sm\]\:h-7[data-size=sm]{height:calc(var(--spacing) * 7)}.data-\[size\=sm\]\:h-\[14px\][data-size=sm]{height:14px}.data-\[size\=sm\]\:w-\[24px\][data-size=sm]{width:24px}.data-\[size\=sm\]\:gap-3[data-size=sm]{gap:calc(var(--spacing) * 3)}.data-\[size\=sm\]\:rounded-lg[data-size=sm]{border-radius:var(--radius)}.data-\[size\=sm\]\:py-3[data-size=sm]{padding-block:calc(var(--spacing) * 3)}.data-\[size\=sm\]\:has-data-\[slot\=card-footer\]\:pb-0[data-size=sm]:has([data-slot=card-footer]){padding-bottom:calc(var(--spacing) * 0)}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-1\.5>*)[data-slot=select-value]{gap:calc(var(--spacing) * 1.5)}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--destructive)}@media (width>=40rem){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:pl-20{padding-left:calc(var(--spacing) * 20)}}@media (width>=48rem){.md\:flex{display:flex}.md\:hidden{display:none}.md\:flex-nowrap{flex-wrap:nowrap}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media (width>=64rem){.lg\:col-span-2{grid-column:span 2/span 2}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-amber-400\/15:is(.dark *){background-color:#fcbb0026}@supports (color:color-mix(in lab, red, red)){.dark\:bg-amber-400\/15:is(.dark *){background-color:color-mix(in oklab, var(--color-amber-400) 15%, transparent)}}.dark\:bg-cyan-400\/15:is(.dark *){background-color:#00d2ef26}@supports (color:color-mix(in lab, red, red)){.dark\:bg-cyan-400\/15:is(.dark *){background-color:color-mix(in oklab, var(--color-cyan-400) 15%, transparent)}}.dark\:bg-destructive\/20:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-destructive\/20:is(.dark *){background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab, var(--input) 30%, transparent)}}.dark\:bg-violet-400\/15:is(.dark *){background-color:#a685ff26}@supports (color:color-mix(in lab, red, red)){.dark\:bg-violet-400\/15:is(.dark *){background-color:color-mix(in oklab, var(--color-violet-400) 15%, transparent)}}.dark\:text-amber-400:is(.dark *){color:var(--color-amber-400)}.dark\:text-amber-500:is(.dark *){color:var(--color-amber-500)}.dark\:text-cyan-400:is(.dark *){color:var(--color-cyan-400)}.dark\:text-violet-400:is(.dark *){color:var(--color-violet-400)}@media (hover:hover){.dark\:hover\:bg-destructive\/30:is(.dark *):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-destructive\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}.dark\:hover\:bg-muted\/50:is(.dark *):hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-muted\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:disabled\:bg-input\/80:is(.dark *):disabled{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:disabled\:bg-input\/80:is(.dark *):disabled{background-color:color-mix(in oklab, var(--input) 80%, transparent)}}.dark\:aria-invalid\:border-destructive\/50:is(.dark *)[aria-invalid=true]{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:aria-invalid\:border-destructive\/50:is(.dark *)[aria-invalid=true]{border-color:color-mix(in oklab, var(--destructive) 50%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-open\:animate-in:where([data-state=open]),.data-open\:animate-in:where([data-open]:not([data-open=false])){animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-open\:bg-accent:where([data-state=open]),.data-open\:bg-accent:where([data-open]:not([data-open=false])){background-color:var(--accent)}.data-open\:text-accent-foreground:where([data-state=open]),.data-open\:text-accent-foreground:where([data-open]:not([data-open=false])){color:var(--accent-foreground)}.data-open\:fade-in-0:where([data-state=open]),.data-open\:fade-in-0:where([data-open]:not([data-open=false])){--tw-enter-opacity:0}.data-open\:zoom-in-95:where([data-state=open]),.data-open\:zoom-in-95:where([data-open]:not([data-open=false])){--tw-enter-scale:.95}.data-closed\:animate-out:where([data-state=closed]),.data-closed\:animate-out:where([data-closed]:not([data-closed=false])){animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-closed\:overflow-hidden:where([data-state=closed]),.data-closed\:overflow-hidden:where([data-closed]:not([data-closed=false])){overflow:hidden}.data-closed\:fade-out-0:where([data-state=closed]),.data-closed\:fade-out-0:where([data-closed]:not([data-closed=false])){--tw-exit-opacity:0}.data-closed\:zoom-out-95:where([data-state=closed]),.data-closed\:zoom-out-95:where([data-closed]:not([data-closed=false])){--tw-exit-scale:.95}.data-checked\:bg-primary:where([data-state=checked]),.data-checked\:bg-primary:where([data-checked]:not([data-checked=false])){background-color:var(--primary)}.group-data-\[size\=default\]\/switch\:data-checked\:translate-x-\[calc\(100\%-2px\)\]:is(:where(.group\/switch)[data-size=default] *):where([data-state=checked]),.group-data-\[size\=default\]\/switch\:data-checked\:translate-x-\[calc\(100\%-2px\)\]:is(:where(.group\/switch)[data-size=default] *):where([data-checked]:not([data-checked=false])),.group-data-\[size\=sm\]\/switch\:data-checked\:translate-x-\[calc\(100\%-2px\)\]:is(:where(.group\/switch)[data-size=sm] *):where([data-state=checked]),.group-data-\[size\=sm\]\/switch\:data-checked\:translate-x-\[calc\(100\%-2px\)\]:is(:where(.group\/switch)[data-size=sm] *):where([data-checked]:not([data-checked=false])){--tw-translate-x:calc(100% - 2px);translate:var(--tw-translate-x) var(--tw-translate-y)}.dark\:data-checked\:bg-primary-foreground:is(.dark *):where([data-state=checked]),.dark\:data-checked\:bg-primary-foreground:is(.dark *):where([data-checked]:not([data-checked=false])){background-color:var(--primary-foreground)}.data-unchecked\:bg-input:where([data-state=unchecked]),.data-unchecked\:bg-input:where([data-unchecked]:not([data-unchecked=false])){background-color:var(--input)}.group-data-\[size\=default\]\/switch\:data-unchecked\:translate-x-0:is(:where(.group\/switch)[data-size=default] *):where([data-state=unchecked]),.group-data-\[size\=default\]\/switch\:data-unchecked\:translate-x-0:is(:where(.group\/switch)[data-size=default] *):where([data-unchecked]:not([data-unchecked=false])),.group-data-\[size\=sm\]\/switch\:data-unchecked\:translate-x-0:is(:where(.group\/switch)[data-size=sm] *):where([data-state=unchecked]),.group-data-\[size\=sm\]\/switch\:data-unchecked\:translate-x-0:is(:where(.group\/switch)[data-size=sm] *):where([data-unchecked]:not([data-unchecked=false])){--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.dark\:data-unchecked\:bg-foreground:is(.dark *):where([data-state=unchecked]),.dark\:data-unchecked\:bg-foreground:is(.dark *):where([data-unchecked]:not([data-unchecked=false])){background-color:var(--foreground)}.dark\:data-unchecked\:bg-input\/80:is(.dark *):where([data-state=unchecked]),.dark\:data-unchecked\:bg-input\/80:is(.dark *):where([data-unchecked]:not([data-unchecked=false])){background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:data-unchecked\:bg-input\/80:is(.dark *):where([data-state=unchecked]),.dark\:data-unchecked\:bg-input\/80:is(.dark *):where([data-unchecked]:not([data-unchecked=false])){background-color:color-mix(in oklab, var(--input) 80%, transparent)}}.data-disabled\:pointer-events-none:where([data-disabled=true]),.data-disabled\:pointer-events-none:where([data-disabled]:not([data-disabled=false])){pointer-events:none}.data-disabled\:cursor-not-allowed:where([data-disabled=true]),.data-disabled\:cursor-not-allowed:where([data-disabled]:not([data-disabled=false])){cursor:not-allowed}.data-disabled\:opacity-50:where([data-disabled=true]),.data-disabled\:opacity-50:where([data-disabled]:not([data-disabled=false])){opacity:.5}.data-horizontal\:h-px:where([data-orientation=horizontal]){height:1px}.data-horizontal\:w-full:where([data-orientation=horizontal]){width:100%}.data-vertical\:w-px:where([data-orientation=vertical]){width:1px}.data-vertical\:self-stretch:where([data-orientation=vertical]){align-self:stretch}.\[\&_ol\]\:my-1 ol{margin-block:calc(var(--spacing) * 1)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3\.5 svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&_ul\]\:my-1 ul{margin-block:calc(var(--spacing) * 1)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing) * 0)}.\[\.border-b\]\:pb-4.border-b{padding-bottom:calc(var(--spacing) * 4)}.group-data-\[size\=sm\]\/card\:\[\.border-b\]\:pb-3:is(:where(.group\/card)[data-size=sm] *).border-b{padding-bottom:calc(var(--spacing) * 3)}@media (hover:hover){.\[a\]\:hover\:bg-destructive\/20:is(a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.\[a\]\:hover\:bg-destructive\/20:is(a):hover{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.\[a\]\:hover\:bg-muted:is(a):hover{background-color:var(--muted)}.\[a\]\:hover\:bg-primary\/80:is(a):hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.\[a\]\:hover\:bg-primary\/80:is(a):hover{background-color:color-mix(in oklab, var(--primary) 80%, transparent)}}.\[a\]\:hover\:bg-secondary\/80:is(a):hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.\[a\]\:hover\:bg-secondary\/80:is(a):hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.\[a\]\:hover\:text-muted-foreground:is(a):hover{color:var(--muted-foreground)}}:is(.\*\:\[img\:first-child\]\:rounded-t-3xl>*):is(img:first-child){border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}:is(.\*\:\[img\:last-child\]\:rounded-b-3xl>*):is(img:last-child){border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:text-destructive[data-variant=destructive]>*):is(svg){color:var(--destructive)}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3\!>svg{width:calc(var(--spacing) * 3)!important;height:calc(var(--spacing) * 3)!important}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-latin-wght-normal-BgDaEnEv.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-mono-cyrillic-ext-wght-normal-I4S5GZfc.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-mono-cyrillic-wght-normal-BmXc_FBt.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-mono-symbols2-wght-normal-GZpp1pK2.woff2)format("woff2-variations");unicode-range:U+2000-2001,U+2004-2008,U+200A,U+23B8-23BD,U+2500-259F}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-mono-vietnamese-wght-normal-D8KDMBhC.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-mono-latin-ext-wght-normal-DrnZ1wKl.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Mono Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(/assets/geist-mono-latin-wght-normal-B_7UjwxQ.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root{--background:oklch(99.5% 0 0);--foreground:oklch(18% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(18% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(18% 0 0);--primary:oklch(22% 0 0);--primary-foreground:oklch(98% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(22% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(52% 0 0);--accent:oklch(96% 0 0);--accent-foreground:oklch(22% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92% 0 0);--input:oklch(92% 0 0);--ring:oklch(55% 0 0);--chart-1:oklch(28% 0 0);--chart-2:oklch(45% 0 0);--chart-3:oklch(60% 0 0);--chart-4:oklch(75% 0 0);--chart-5:oklch(87% 0 0);--radius:.5rem;--sidebar:oklch(98% 0 0);--sidebar-foreground:oklch(18% 0 0);--sidebar-primary:oklch(22% 0 0);--sidebar-primary-foreground:oklch(98% 0 0);--sidebar-accent:oklch(96% 0 0);--sidebar-accent-foreground:oklch(22% 0 0);--sidebar-border:oklch(92% 0 0);--sidebar-ring:oklch(55% 0 0)}.dark{--background:oklch(13.5% 0 0);--foreground:oklch(98% 0 0);--card:oklch(17.5% 0 0);--card-foreground:oklch(98% 0 0);--popover:oklch(17.5% 0 0);--popover-foreground:oklch(98% 0 0);--primary:oklch(93% 0 0);--primary-foreground:oklch(18% 0 0);--secondary:oklch(24% 0 0);--secondary-foreground:oklch(98% 0 0);--muted:oklch(22% 0 0);--muted-foreground:oklch(68% 0 0);--accent:oklch(24% 0 0);--accent-foreground:oklch(98% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.14);--ring:oklch(60% 0 0);--chart-1:oklch(92% 0 0);--chart-2:oklch(78% 0 0);--chart-3:oklch(60% 0 0);--chart-4:oklch(45% 0 0);--chart-5:oklch(32% 0 0);--sidebar:oklch(17.5% 0 0);--sidebar-foreground:oklch(98% 0 0);--sidebar-primary:oklch(93% 0 0);--sidebar-primary-foreground:oklch(18% 0 0);--sidebar-accent:oklch(24% 0 0);--sidebar-accent-foreground:oklch(98% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(60% 0 0)}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}
|
client/dist/favicon.svg
ADDED
|
|
client/dist/icons.svg
ADDED
|
|
client/dist/index.html
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!doctype html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8" />
|
| 5 |
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
+
<script>
|
| 8 |
+
try {
|
| 9 |
+
const theme = localStorage.getItem('theme')
|
| 10 |
+
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches
|
| 11 |
+
if (theme === 'dark' || (!theme && prefersDark)) {
|
| 12 |
+
document.documentElement.classList.add('dark')
|
| 13 |
+
}
|
| 14 |
+
} catch {
|
| 15 |
+
// Keep the initial render working if localStorage is unavailable.
|
| 16 |
+
}
|
| 17 |
+
</script>
|
| 18 |
+
<title>FreeLLMAPI · Unified LLM Router</title>
|
| 19 |
+
<script type="module" crossorigin src="/assets/index-BpoX3Fkj.js"></script>
|
| 20 |
+
<link rel="stylesheet" crossorigin href="/assets/index-CBvmpuEj.css">
|
| 21 |
+
</head>
|
| 22 |
+
<body>
|
| 23 |
+
<div id="root"></div>
|
| 24 |
+
</body>
|
| 25 |
+
</html>
|
client/eslint.config.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import js from '@eslint/js'
|
| 2 |
+
import globals from 'globals'
|
| 3 |
+
import reactHooks from 'eslint-plugin-react-hooks'
|
| 4 |
+
import reactRefresh from 'eslint-plugin-react-refresh'
|
| 5 |
+
import tseslint from 'typescript-eslint'
|
| 6 |
+
import { defineConfig, globalIgnores } from 'eslint/config'
|
| 7 |
+
|
| 8 |
+
export default defineConfig([
|
| 9 |
+
globalIgnores(['dist']),
|
| 10 |
+
{
|
| 11 |
+
files: ['**/*.{ts,tsx}'],
|
| 12 |
+
extends: [
|
| 13 |
+
js.configs.recommended,
|
| 14 |
+
tseslint.configs.recommended,
|
| 15 |
+
reactHooks.configs.flat.recommended,
|
| 16 |
+
reactRefresh.configs.vite,
|
| 17 |
+
],
|
| 18 |
+
languageOptions: {
|
| 19 |
+
ecmaVersion: 2020,
|
| 20 |
+
globals: globals.browser,
|
| 21 |
+
},
|
| 22 |
+
},
|
| 23 |
+
])
|
client/index.html
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!doctype html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8" />
|
| 5 |
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
+
<script>
|
| 8 |
+
try {
|
| 9 |
+
const theme = localStorage.getItem('theme')
|
| 10 |
+
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches
|
| 11 |
+
if (theme === 'dark' || (!theme && prefersDark)) {
|
| 12 |
+
document.documentElement.classList.add('dark')
|
| 13 |
+
}
|
| 14 |
+
} catch {
|
| 15 |
+
// Keep the initial render working if localStorage is unavailable.
|
| 16 |
+
}
|
| 17 |
+
</script>
|
| 18 |
+
<title>FreeLLMAPI · Unified LLM Router</title>
|
| 19 |
+
</head>
|
| 20 |
+
<body>
|
| 21 |
+
<div id="root"></div>
|
| 22 |
+
<script type="module" src="/src/main.tsx"></script>
|
| 23 |
+
</body>
|
| 24 |
+
</html>
|
client/node_modules/.tmp/tsconfig.app.tsbuildinfo
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"root":["../../src/app.tsx","../../src/main.tsx","../../src/vite-env.d.ts","../../src/components/auth-gate.tsx","../../src/components/floating-bar.tsx","../../src/components/markdown.tsx","../../src/components/models-tabs.tsx","../../src/components/page-header.tsx","../../src/components/tooltip.tsx","../../src/components/ui/badge.tsx","../../src/components/ui/button.tsx","../../src/components/ui/card.tsx","../../src/components/ui/dropdown-menu.tsx","../../src/components/ui/input.tsx","../../src/components/ui/label.tsx","../../src/components/ui/popover.tsx","../../src/components/ui/select.tsx","../../src/components/ui/separator.tsx","../../src/components/ui/switch.tsx","../../src/components/ui/table.tsx","../../src/components/ui/textarea.tsx","../../src/lib/api.ts","../../src/lib/utils.ts","../../src/pages/analyticspage.tsx","../../src/pages/embeddingspage.tsx","../../src/pages/fallbackpage.tsx","../../src/pages/keyspage.tsx","../../src/pages/playgroundpage.tsx"],"version":"6.0.3"}
|
client/node_modules/.tmp/tsconfig.node.tsbuildinfo
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"root":["../../vite.config.ts"],"version":"6.0.3"}
|
client/node_modules/.vite/deps/@base-ui_react_button.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { i as __toESM, t as require_react } from "./react-DMmEJb6B.js";
|
| 2 |
+
import { t as useRenderElement } from "./useRenderElement-3Cwvu1gO.js";
|
| 3 |
+
import { t as useButton } from "./useButton-CBy-cFDk.js";
|
| 4 |
+
/**
|
| 5 |
+
* A button component that can be used to trigger actions.
|
| 6 |
+
* Renders a `<button>` element.
|
| 7 |
+
*
|
| 8 |
+
* Documentation: [Base UI Button](https://base-ui.com/react/components/button)
|
| 9 |
+
*/
|
| 10 |
+
var Button = /* @__PURE__ */ (/* @__PURE__ */ __toESM(require_react(), 1)).forwardRef(function Button(componentProps, forwardedRef) {
|
| 11 |
+
const { render, className, disabled = false, focusableWhenDisabled = false, nativeButton = true, style, ...elementProps } = componentProps;
|
| 12 |
+
const { getButtonProps, buttonRef } = useButton({
|
| 13 |
+
disabled,
|
| 14 |
+
focusableWhenDisabled,
|
| 15 |
+
native: nativeButton
|
| 16 |
+
});
|
| 17 |
+
return useRenderElement("button", componentProps, {
|
| 18 |
+
state: { disabled },
|
| 19 |
+
ref: [forwardedRef, buttonRef],
|
| 20 |
+
props: [elementProps, getButtonProps]
|
| 21 |
+
});
|
| 22 |
+
});
|
| 23 |
+
Button.displayName = "Button";
|
| 24 |
+
//#endregion
|
| 25 |
+
export { Button };
|
| 26 |
+
|
| 27 |
+
//# sourceMappingURL=@base-ui_react_button.js.map
|
client/node_modules/.vite/deps/@base-ui_react_button.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"@base-ui_react_button.js","names":[],"sources":["../../../../node_modules/@base-ui/react/esm/button/Button.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useButton } from \"../internals/use-button/useButton.js\";\nimport { useRenderElement } from \"../internals/useRenderElement.js\";\n/**\n * A button component that can be used to trigger actions.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Button](https://base-ui.com/react/components/button)\n */\nexport const Button = /*#__PURE__*/React.forwardRef(function Button(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled = false,\n focusableWhenDisabled = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled,\n native: nativeButton\n });\n const state = {\n disabled\n };\n return useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, buttonRef],\n props: [elementProps, getButtonProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") Button.displayName = \"Button\";"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AAWA,IAAa,SAAsB,2DAAA,GAAM,WAAW,SAAS,OAAO,gBAAgB,cAAc;CAChG,MAAM,EACJ,QACA,WACA,WAAW,OACX,wBAAwB,OACxB,eAAe,MACf,OACA,GAAG,iBACD;CACJ,MAAM,EACJ,gBACA,cACE,UAAU;EACZ;EACA;EACA,QAAQ;CACV,CAAC;CAID,OAAO,iBAAiB,UAAU,gBAAgB;EAChD,OAAA,EAHA,SAGI;EACJ,KAAK,CAAC,cAAc,SAAS;EAC7B,OAAO,CAAC,cAAc,cAAc;CACtC,CAAC;AACH,CAAC;AAC0C,OAAO,cAAc"}
|
client/node_modules/.vite/deps/@base-ui_react_input.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { i as __toESM, t as require_react } from "./react-DMmEJb6B.js";
|
| 2 |
+
import { t as require_jsx_runtime } from "./react_jsx-runtime.js";
|
| 3 |
+
import { f as useStableCallback, t as useRenderElement, u as useIsoLayoutEffect } from "./useRenderElement-3Cwvu1gO.js";
|
| 4 |
+
import { a as fieldValidityMapping, i as useFieldRootContext, n as useLabelableId, r as useLabelableContext, t as useRegisterFieldControl } from "./useRegisterFieldControl-CPlvTQh-.js";
|
| 5 |
+
import { g as ownerDocument, l as none, t as createChangeEventDetails } from "./createBaseUIEventDetails-CJxlTiBH.js";
|
| 6 |
+
import { t as activeElement } from "./shadowDom-kQ51Rhp9.js";
|
| 7 |
+
import { t as useControlled } from "./useControlled-B7gU8wdF.js";
|
| 8 |
+
//#region ../node_modules/@base-ui/react/esm/field/control/FieldControl.js
|
| 9 |
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
| 10 |
+
/**
|
| 11 |
+
* The form control to label and validate.
|
| 12 |
+
* Renders an `<input>` element.
|
| 13 |
+
*
|
| 14 |
+
* You can omit this part and use any Base UI input component instead. For example,
|
| 15 |
+
* [Input](https://base-ui.com/react/components/input), [Checkbox](https://base-ui.com/react/components/checkbox),
|
| 16 |
+
* or [Select](https://base-ui.com/react/components/select), among others, will work with Field out of the box.
|
| 17 |
+
*
|
| 18 |
+
* Documentation: [Base UI Field](https://base-ui.com/react/components/field)
|
| 19 |
+
*/
|
| 20 |
+
var FieldControl = /* @__PURE__ */ import_react.forwardRef(function FieldControl(componentProps, forwardedRef) {
|
| 21 |
+
const { render, className, id: idProp, name: nameProp, value: valueProp, disabled: disabledProp = false, onValueChange, defaultValue, autoFocus = false, style, ...elementProps } = componentProps;
|
| 22 |
+
const { state: fieldState, name: fieldName, disabled: fieldDisabled, setTouched, setDirty, validityData, setFocused, setFilled, validationMode, validation } = useFieldRootContext();
|
| 23 |
+
const disabled = fieldDisabled || disabledProp;
|
| 24 |
+
const name = fieldName ?? nameProp;
|
| 25 |
+
const state = {
|
| 26 |
+
...fieldState,
|
| 27 |
+
disabled
|
| 28 |
+
};
|
| 29 |
+
const { labelId } = useLabelableContext();
|
| 30 |
+
const id = useLabelableId({ id: idProp });
|
| 31 |
+
useIsoLayoutEffect(() => {
|
| 32 |
+
const hasExternalValue = valueProp != null;
|
| 33 |
+
if (validation.inputRef.current?.value || hasExternalValue && valueProp !== "") setFilled(true);
|
| 34 |
+
else if (hasExternalValue && valueProp === "") setFilled(false);
|
| 35 |
+
}, [
|
| 36 |
+
validation.inputRef,
|
| 37 |
+
setFilled,
|
| 38 |
+
valueProp
|
| 39 |
+
]);
|
| 40 |
+
const inputRef = import_react.useRef(null);
|
| 41 |
+
useIsoLayoutEffect(() => {
|
| 42 |
+
if (autoFocus && inputRef.current === activeElement(ownerDocument(inputRef.current))) setFocused(true);
|
| 43 |
+
}, [autoFocus, setFocused]);
|
| 44 |
+
const [valueUnwrapped] = useControlled({
|
| 45 |
+
controlled: valueProp,
|
| 46 |
+
default: defaultValue,
|
| 47 |
+
name: "FieldControl",
|
| 48 |
+
state: "value"
|
| 49 |
+
});
|
| 50 |
+
const isControlled = valueProp !== void 0;
|
| 51 |
+
const value = isControlled ? valueUnwrapped : void 0;
|
| 52 |
+
const getValueFromInput = useStableCallback(() => validation.inputRef.current?.value);
|
| 53 |
+
useRegisterFieldControl(validation.inputRef, id, value, getValueFromInput);
|
| 54 |
+
return useRenderElement("input", componentProps, {
|
| 55 |
+
ref: [forwardedRef, inputRef],
|
| 56 |
+
state,
|
| 57 |
+
props: [
|
| 58 |
+
{
|
| 59 |
+
id,
|
| 60 |
+
disabled,
|
| 61 |
+
name,
|
| 62 |
+
ref: validation.inputRef,
|
| 63 |
+
"aria-labelledby": labelId,
|
| 64 |
+
autoFocus,
|
| 65 |
+
...isControlled ? { value } : { defaultValue },
|
| 66 |
+
onChange(event) {
|
| 67 |
+
const inputValue = event.currentTarget.value;
|
| 68 |
+
onValueChange?.(inputValue, createChangeEventDetails(none, event.nativeEvent));
|
| 69 |
+
setDirty(inputValue !== validityData.initialValue);
|
| 70 |
+
setFilled(inputValue !== "");
|
| 71 |
+
},
|
| 72 |
+
onFocus() {
|
| 73 |
+
setFocused(true);
|
| 74 |
+
},
|
| 75 |
+
onBlur(event) {
|
| 76 |
+
setTouched(true);
|
| 77 |
+
setFocused(false);
|
| 78 |
+
if (validationMode === "onBlur") validation.commit(event.currentTarget.value);
|
| 79 |
+
},
|
| 80 |
+
onKeyDown(event) {
|
| 81 |
+
if (event.currentTarget.tagName === "INPUT" && event.key === "Enter") {
|
| 82 |
+
setTouched(true);
|
| 83 |
+
validation.commit(event.currentTarget.value);
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
},
|
| 87 |
+
validation.getInputValidationProps(),
|
| 88 |
+
elementProps
|
| 89 |
+
],
|
| 90 |
+
stateAttributesMapping: fieldValidityMapping
|
| 91 |
+
});
|
| 92 |
+
});
|
| 93 |
+
FieldControl.displayName = "FieldControl";
|
| 94 |
+
//#endregion
|
| 95 |
+
//#region ../node_modules/@base-ui/react/esm/input/Input.js
|
| 96 |
+
var import_jsx_runtime = require_jsx_runtime();
|
| 97 |
+
var Input = /* @__PURE__ */ import_react.forwardRef(function Input(props, forwardedRef) {
|
| 98 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldControl, {
|
| 99 |
+
ref: forwardedRef,
|
| 100 |
+
...props
|
| 101 |
+
});
|
| 102 |
+
});
|
| 103 |
+
Input.displayName = "Input";
|
| 104 |
+
//#endregion
|
| 105 |
+
export { Input };
|
| 106 |
+
|
| 107 |
+
//# sourceMappingURL=@base-ui_react_input.js.map
|
client/node_modules/.vite/deps/@base-ui_react_input.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"@base-ui_react_input.js","names":["REASONS.none","Field.Control"],"sources":["../../../../node_modules/@base-ui/react/esm/field/control/FieldControl.js","../../../../node_modules/@base-ui/react/esm/input/Input.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.js\";\nimport { useRegisterFieldControl } from \"../../internals/field-register-control/useRegisterFieldControl.js\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.js\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.js\";\nimport { fieldValidityMapping } from \"../../internals/field-constants/constants.js\";\nimport { useRenderElement } from \"../../internals/useRenderElement.js\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../internals/reasons.js\";\nimport { activeElement } from \"../../floating-ui-react/utils.js\";\n\n/**\n * The form control to label and validate.\n * Renders an `<input>` element.\n *\n * You can omit this part and use any Base UI input component instead. For example,\n * [Input](https://base-ui.com/react/components/input), [Checkbox](https://base-ui.com/react/components/checkbox),\n * or [Select](https://base-ui.com/react/components/select), among others, will work with Field out of the box.\n *\n * Documentation: [Base UI Field](https://base-ui.com/react/components/field)\n */\nexport const FieldControl = /*#__PURE__*/React.forwardRef(function FieldControl(componentProps, forwardedRef) {\n const {\n render,\n className,\n id: idProp,\n name: nameProp,\n value: valueProp,\n disabled: disabledProp = false,\n onValueChange,\n defaultValue,\n autoFocus = false,\n style,\n ...elementProps\n } = componentProps;\n const {\n state: fieldState,\n name: fieldName,\n disabled: fieldDisabled,\n setTouched,\n setDirty,\n validityData,\n setFocused,\n setFilled,\n validationMode,\n validation\n } = useFieldRootContext();\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const state = {\n ...fieldState,\n disabled\n };\n const {\n labelId\n } = useLabelableContext();\n const id = useLabelableId({\n id: idProp\n });\n useIsoLayoutEffect(() => {\n const hasExternalValue = valueProp != null;\n if (validation.inputRef.current?.value || hasExternalValue && valueProp !== '') {\n setFilled(true);\n } else if (hasExternalValue && valueProp === '') {\n setFilled(false);\n }\n }, [validation.inputRef, setFilled, valueProp]);\n const inputRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n if (autoFocus && inputRef.current === activeElement(ownerDocument(inputRef.current))) {\n setFocused(true);\n }\n }, [autoFocus, setFocused]);\n const [valueUnwrapped] = useControlled({\n controlled: valueProp,\n default: defaultValue,\n name: 'FieldControl',\n state: 'value'\n });\n const isControlled = valueProp !== undefined;\n const value = isControlled ? valueUnwrapped : undefined;\n const getValueFromInput = useStableCallback(() => validation.inputRef.current?.value);\n useRegisterFieldControl(validation.inputRef, id, value, getValueFromInput);\n const element = useRenderElement('input', componentProps, {\n ref: [forwardedRef, inputRef],\n state,\n props: [{\n id,\n disabled,\n name,\n ref: validation.inputRef,\n 'aria-labelledby': labelId,\n autoFocus,\n ...(isControlled ? {\n value\n } : {\n defaultValue\n }),\n onChange(event) {\n const inputValue = event.currentTarget.value;\n onValueChange?.(inputValue, createChangeEventDetails(REASONS.none, event.nativeEvent));\n setDirty(inputValue !== validityData.initialValue);\n setFilled(inputValue !== '');\n },\n onFocus() {\n setFocused(true);\n },\n onBlur(event) {\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(event.currentTarget.value);\n }\n },\n onKeyDown(event) {\n if (event.currentTarget.tagName === 'INPUT' && event.key === 'Enter') {\n setTouched(true);\n validation.commit(event.currentTarget.value);\n }\n }\n }, validation.getInputValidationProps(), elementProps],\n stateAttributesMapping: fieldValidityMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") FieldControl.displayName = \"FieldControl\";","'use client';\n\nimport * as React from 'react';\nimport { Field } from \"../field/index.js\";\n\n/**\n * A native input element that automatically works with [Field](https://base-ui.com/react/components/field).\n * Renders an `<input>` element.\n *\n * Documentation: [Base UI Input](https://base-ui.com/react/components/input)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const Input = /*#__PURE__*/React.forwardRef(function Input(props, forwardedRef) {\n return /*#__PURE__*/_jsx(Field.Control, {\n ref: forwardedRef,\n ...props\n });\n});\nif (process.env.NODE_ENV !== \"production\") Input.displayName = \"Input\";"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;;;;;;;;;;;AA2BA,IAAa,eAA4B,6BAAM,WAAW,SAAS,aAAa,gBAAgB,cAAc;CAC5G,MAAM,EACJ,QACA,WACA,IAAI,QACJ,MAAM,UACN,OAAO,WACP,UAAU,eAAe,OACzB,eACA,cACA,YAAY,OACZ,OACA,GAAG,iBACD;CACJ,MAAM,EACJ,OAAO,YACP,MAAM,WACN,UAAU,eACV,YACA,UACA,cACA,YACA,WACA,gBACA,eACE,oBAAoB;CACxB,MAAM,WAAW,iBAAiB;CAClC,MAAM,OAAO,aAAa;CAC1B,MAAM,QAAQ;EACZ,GAAG;EACH;CACF;CACA,MAAM,EACJ,YACE,oBAAoB;CACxB,MAAM,KAAK,eAAe,EACxB,IAAI,OACN,CAAC;CACD,yBAAyB;EACvB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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { i as __toESM, r as __exportAll, t as require_react } from "./react-DMmEJb6B.js";
|
| 2 |
+
import { t as require_jsx_runtime } from "./react_jsx-runtime.js";
|
| 3 |
+
import { C as getWindow, D as isLastTraversableNode, E as isHTMLElement, S as getParentNode, T as isElement, a as warn, f as useStableCallback, l as mergeProps, m as SafeReact, n as EMPTY_ARRAY, p as useRefWithInit, r as EMPTY_OBJECT, s as useMergedRefs, t as useRenderElement, u as useIsoLayoutEffect } from "./useRenderElement-3Cwvu1gO.js";
|
| 4 |
+
import { n as useCompositeRootContext, t as useButton } from "./useButton-CBy-cFDk.js";
|
| 5 |
+
import { _ as useBaseUiId, d as siblingOpen, f as triggerFocus, g as ownerDocument, n as cancelOpen, o as imperativeAction, s as itemPress, t as createChangeEventDetails, v as useId } from "./createBaseUIEventDetails-CJxlTiBH.js";
|
| 6 |
+
import { $ as addEventListener, B as useFloatingNodeId, E as useSyncedFloatingRootContext, F as useDismiss, H as useFloatingTree, Ht as isMac, I as useClick, It as isTypeableElement, K as DROPDOWN_COLLISION_AVOIDANCE, L as FloatingFocusManager, Lt as matchesFocusVisible, M as fastComponentRef, N as createSelector, O as ReactStore, Pt as isTargetInsideEnabledTrigger, Q as mergeCleanups, R as FloatingNode, T as useTriggerRegistration, U as FloatingTreeStore, Ut as isSafari, V as useFloatingParentNodeId, W as FloatingPortal, X as FocusGuard, Y as createAttribute, _ as FOCUSABLE_POPUP_PROPS, a as useAnchoredPopupScrollLock, at as useAnimationsFinished, b as useOpenStateTransitions, c as useAnchorPositioning, d as inertValue, et as popupStateMapping, f as getDisabledMountTransitionStyles, g as PopupTriggerMap, i as useOnFirstRender, it as useOpenChangeComplete, j as fastComponent, l as adaptiveOrigin, lt as useTimeout, m as useToolbarRootContext, n as useOpenInteractionType, nt as triggerOpenStateMapping, o as usePositioner, ot as transitionStatusMapping, p as COMPOSITE_KEYS, q as POPUP_COLLISION_AVOIDANCE, rt as useTransitionStatus, s as InternalBackdrop, tt as pressableTriggerOpenStateMapping, u as useDirection, w as useTriggerDataForwarding, x as usePopupInteractionProps, y as useImplicitActiveTrigger, z as FloatingTree } from "./usePreviousValue-rDCHxn0g.js";
|
| 7 |
+
import { n as contains, r as getTarget, t as activeElement } from "./shadowDom-kQ51Rhp9.js";
|
| 8 |
+
import { t as useControlled } from "./useControlled-B7gU8wdF.js";
|
| 9 |
+
import { a as useListNavigation, i as useTypeahead, n as getPseudoElementBounds, r as CompositeList, s as useCompositeListItem, t as Separator } from "./Separator-CTGaP8Tv.js";
|
| 10 |
+
import { a as useHoverFloatingInteraction, c as popupStoreSelectors, i as useHoverReferenceInteraction, n as useTriggerFocusGuards, o as createInitialPopupStoreState, r as safePolygon, t as usePopupViewport } from "./usePopupViewport-DbUbXryh.js";
|
| 11 |
+
//#region ../node_modules/@base-ui/react/esm/menu/positioner/MenuPositionerContext.js
|
| 12 |
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
| 13 |
+
var MenuPositionerContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 14 |
+
MenuPositionerContext.displayName = "MenuPositionerContext";
|
| 15 |
+
function useMenuPositionerContext(optional) {
|
| 16 |
+
const context = import_react.useContext(MenuPositionerContext);
|
| 17 |
+
if (context === void 0 && !optional) throw new Error("Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>.");
|
| 18 |
+
return context;
|
| 19 |
+
}
|
| 20 |
+
//#endregion
|
| 21 |
+
//#region ../node_modules/@base-ui/react/esm/menu/root/MenuRootContext.js
|
| 22 |
+
var MenuRootContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 23 |
+
MenuRootContext.displayName = "MenuRootContext";
|
| 24 |
+
function useMenuRootContext(optional) {
|
| 25 |
+
const context = import_react.useContext(MenuRootContext);
|
| 26 |
+
if (context === void 0 && !optional) throw new Error("Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>.");
|
| 27 |
+
return context;
|
| 28 |
+
}
|
| 29 |
+
//#endregion
|
| 30 |
+
//#region ../node_modules/@base-ui/react/esm/menu/arrow/MenuArrow.js
|
| 31 |
+
/**
|
| 32 |
+
* Displays an element positioned against the menu anchor.
|
| 33 |
+
* Renders a `<div>` element.
|
| 34 |
+
*
|
| 35 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 36 |
+
*/
|
| 37 |
+
var MenuArrow = /* @__PURE__ */ import_react.forwardRef(function MenuArrow(componentProps, forwardedRef) {
|
| 38 |
+
const { render, className, style, ...elementProps } = componentProps;
|
| 39 |
+
const { store } = useMenuRootContext();
|
| 40 |
+
const { arrowRef, side, align, arrowUncentered, arrowStyles } = useMenuPositionerContext();
|
| 41 |
+
const state = {
|
| 42 |
+
open: store.useState("open"),
|
| 43 |
+
side,
|
| 44 |
+
align,
|
| 45 |
+
uncentered: arrowUncentered
|
| 46 |
+
};
|
| 47 |
+
return useRenderElement("div", componentProps, {
|
| 48 |
+
ref: [arrowRef, forwardedRef],
|
| 49 |
+
stateAttributesMapping: popupStateMapping,
|
| 50 |
+
state,
|
| 51 |
+
props: {
|
| 52 |
+
style: arrowStyles,
|
| 53 |
+
"aria-hidden": true,
|
| 54 |
+
...elementProps
|
| 55 |
+
}
|
| 56 |
+
});
|
| 57 |
+
});
|
| 58 |
+
MenuArrow.displayName = "MenuArrow";
|
| 59 |
+
//#endregion
|
| 60 |
+
//#region ../node_modules/@base-ui/react/esm/context-menu/root/ContextMenuRootContext.js
|
| 61 |
+
var ContextMenuRootContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 62 |
+
ContextMenuRootContext.displayName = "ContextMenuRootContext";
|
| 63 |
+
function useContextMenuRootContext(optional = true) {
|
| 64 |
+
const context = import_react.useContext(ContextMenuRootContext);
|
| 65 |
+
if (context === void 0 && !optional) throw new Error("Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>.");
|
| 66 |
+
return context;
|
| 67 |
+
}
|
| 68 |
+
//#endregion
|
| 69 |
+
//#region ../node_modules/@base-ui/react/esm/menu/backdrop/MenuBackdrop.js
|
| 70 |
+
var stateAttributesMapping$2 = {
|
| 71 |
+
...popupStateMapping,
|
| 72 |
+
...transitionStatusMapping
|
| 73 |
+
};
|
| 74 |
+
/**
|
| 75 |
+
* An overlay displayed beneath the menu popup.
|
| 76 |
+
* Renders a `<div>` element.
|
| 77 |
+
*
|
| 78 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 79 |
+
*/
|
| 80 |
+
var MenuBackdrop = /* @__PURE__ */ import_react.forwardRef(function MenuBackdrop(componentProps, forwardedRef) {
|
| 81 |
+
const { render, className, style, ...elementProps } = componentProps;
|
| 82 |
+
const { store } = useMenuRootContext();
|
| 83 |
+
const open = store.useState("open");
|
| 84 |
+
const mounted = store.useState("mounted");
|
| 85 |
+
const transitionStatus = store.useState("transitionStatus");
|
| 86 |
+
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
|
| 87 |
+
const contextMenuContext = useContextMenuRootContext();
|
| 88 |
+
const state = {
|
| 89 |
+
open,
|
| 90 |
+
transitionStatus
|
| 91 |
+
};
|
| 92 |
+
return useRenderElement("div", componentProps, {
|
| 93 |
+
ref: contextMenuContext?.backdropRef ? [forwardedRef, contextMenuContext.backdropRef] : forwardedRef,
|
| 94 |
+
state,
|
| 95 |
+
stateAttributesMapping: stateAttributesMapping$2,
|
| 96 |
+
props: [{
|
| 97 |
+
role: "presentation",
|
| 98 |
+
hidden: !mounted,
|
| 99 |
+
style: {
|
| 100 |
+
pointerEvents: lastOpenChangeReason === "trigger-hover" ? "none" : void 0,
|
| 101 |
+
userSelect: "none",
|
| 102 |
+
WebkitUserSelect: "none"
|
| 103 |
+
}
|
| 104 |
+
}, elementProps]
|
| 105 |
+
});
|
| 106 |
+
});
|
| 107 |
+
MenuBackdrop.displayName = "MenuBackdrop";
|
| 108 |
+
//#endregion
|
| 109 |
+
//#region ../node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItemContext.js
|
| 110 |
+
var MenuCheckboxItemContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 111 |
+
MenuCheckboxItemContext.displayName = "MenuCheckboxItemContext";
|
| 112 |
+
function useMenuCheckboxItemContext() {
|
| 113 |
+
const context = import_react.useContext(MenuCheckboxItemContext);
|
| 114 |
+
if (context === void 0) throw new Error("Base UI: MenuCheckboxItemContext is missing. MenuCheckboxItem parts must be placed within <Menu.CheckboxItem>.");
|
| 115 |
+
return context;
|
| 116 |
+
}
|
| 117 |
+
//#endregion
|
| 118 |
+
//#region ../node_modules/@base-ui/react/esm/menu/item/useMenuItemCommonProps.js
|
| 119 |
+
/**
|
| 120 |
+
* Returns common props shared by all menu item types.
|
| 121 |
+
* This hook extracts the shared logic for id, role, tabIndex, onKeyDown,
|
| 122 |
+
* onMouseMove, onClick, and onMouseUp handlers.
|
| 123 |
+
*/
|
| 124 |
+
function useMenuItemCommonProps(params) {
|
| 125 |
+
const { closeOnClick, highlighted, id, nodeId, store, typingRef, itemRef, itemMetadata } = params;
|
| 126 |
+
const { events: menuEvents } = store.useState("floatingTreeRoot");
|
| 127 |
+
const contextMenuContext = useContextMenuRootContext(true);
|
| 128 |
+
const isContextMenu = contextMenuContext !== void 0;
|
| 129 |
+
return import_react.useMemo(() => ({
|
| 130 |
+
id,
|
| 131 |
+
role: "menuitem",
|
| 132 |
+
tabIndex: highlighted ? 0 : -1,
|
| 133 |
+
onKeyDown(event) {
|
| 134 |
+
if (event.key === " " && typingRef?.current) event.preventDefault();
|
| 135 |
+
},
|
| 136 |
+
onMouseMove(event) {
|
| 137 |
+
if (!nodeId) return;
|
| 138 |
+
menuEvents.emit("itemhover", {
|
| 139 |
+
nodeId,
|
| 140 |
+
target: event.currentTarget
|
| 141 |
+
});
|
| 142 |
+
},
|
| 143 |
+
onClick(event) {
|
| 144 |
+
if (closeOnClick) menuEvents.emit("close", {
|
| 145 |
+
domEvent: event,
|
| 146 |
+
reason: itemPress
|
| 147 |
+
});
|
| 148 |
+
},
|
| 149 |
+
onMouseUp(event) {
|
| 150 |
+
if (contextMenuContext) {
|
| 151 |
+
const initialCursorPoint = contextMenuContext.initialCursorPointRef.current;
|
| 152 |
+
contextMenuContext.initialCursorPointRef.current = null;
|
| 153 |
+
if (isContextMenu && initialCursorPoint && Math.abs(event.clientX - initialCursorPoint.x) <= 1 && Math.abs(event.clientY - initialCursorPoint.y) <= 1) return;
|
| 154 |
+
if (isContextMenu && !isMac && event.button === 2) return;
|
| 155 |
+
}
|
| 156 |
+
if (itemRef.current && store.context.allowMouseUpTriggerRef.current && (!isContextMenu || event.button === 2)) {
|
| 157 |
+
if (!itemMetadata || itemMetadata.type === "regular-item") itemRef.current.click();
|
| 158 |
+
}
|
| 159 |
+
}
|
| 160 |
+
}), [
|
| 161 |
+
closeOnClick,
|
| 162 |
+
highlighted,
|
| 163 |
+
id,
|
| 164 |
+
menuEvents,
|
| 165 |
+
nodeId,
|
| 166 |
+
store,
|
| 167 |
+
typingRef,
|
| 168 |
+
itemRef,
|
| 169 |
+
contextMenuContext,
|
| 170 |
+
isContextMenu,
|
| 171 |
+
itemMetadata
|
| 172 |
+
]);
|
| 173 |
+
}
|
| 174 |
+
//#endregion
|
| 175 |
+
//#region ../node_modules/@base-ui/react/esm/menu/item/useMenuItem.js
|
| 176 |
+
var REGULAR_ITEM = { type: "regular-item" };
|
| 177 |
+
function useMenuItem(params) {
|
| 178 |
+
const { closeOnClick, disabled = false, highlighted, id, store, typingRef = store.context.typingRef, nativeButton, itemMetadata, nodeId } = params;
|
| 179 |
+
const itemRef = import_react.useRef(null);
|
| 180 |
+
const { getButtonProps, buttonRef } = useButton({
|
| 181 |
+
disabled,
|
| 182 |
+
focusableWhenDisabled: true,
|
| 183 |
+
native: nativeButton,
|
| 184 |
+
composite: true
|
| 185 |
+
});
|
| 186 |
+
const commonProps = useMenuItemCommonProps({
|
| 187 |
+
closeOnClick,
|
| 188 |
+
highlighted,
|
| 189 |
+
id,
|
| 190 |
+
nodeId,
|
| 191 |
+
store,
|
| 192 |
+
typingRef,
|
| 193 |
+
itemRef,
|
| 194 |
+
itemMetadata
|
| 195 |
+
});
|
| 196 |
+
const getItemProps = import_react.useCallback((externalProps) => {
|
| 197 |
+
return mergeProps(commonProps, { onMouseEnter() {
|
| 198 |
+
if (itemMetadata.type !== "submenu-trigger") return;
|
| 199 |
+
itemMetadata.setActive();
|
| 200 |
+
} }, externalProps, getButtonProps);
|
| 201 |
+
}, [
|
| 202 |
+
commonProps,
|
| 203 |
+
getButtonProps,
|
| 204 |
+
itemMetadata
|
| 205 |
+
]);
|
| 206 |
+
const mergedRef = useMergedRefs(itemRef, buttonRef);
|
| 207 |
+
return import_react.useMemo(() => ({
|
| 208 |
+
getItemProps,
|
| 209 |
+
itemRef: mergedRef
|
| 210 |
+
}), [getItemProps, mergedRef]);
|
| 211 |
+
}
|
| 212 |
+
//#endregion
|
| 213 |
+
//#region ../node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItemDataAttributes.js
|
| 214 |
+
var MenuCheckboxItemDataAttributes = /* @__PURE__ */ function(MenuCheckboxItemDataAttributes) {
|
| 215 |
+
/**
|
| 216 |
+
* Present when the menu checkbox item is checked.
|
| 217 |
+
*/
|
| 218 |
+
MenuCheckboxItemDataAttributes["checked"] = "data-checked";
|
| 219 |
+
/**
|
| 220 |
+
* Present when the menu checkbox item is not checked.
|
| 221 |
+
*/
|
| 222 |
+
MenuCheckboxItemDataAttributes["unchecked"] = "data-unchecked";
|
| 223 |
+
/**
|
| 224 |
+
* Present when the menu checkbox item is disabled.
|
| 225 |
+
*/
|
| 226 |
+
MenuCheckboxItemDataAttributes["disabled"] = "data-disabled";
|
| 227 |
+
/**
|
| 228 |
+
* Present when the menu checkbox item is highlighted.
|
| 229 |
+
*/
|
| 230 |
+
MenuCheckboxItemDataAttributes["highlighted"] = "data-highlighted";
|
| 231 |
+
return MenuCheckboxItemDataAttributes;
|
| 232 |
+
}({});
|
| 233 |
+
//#endregion
|
| 234 |
+
//#region ../node_modules/@base-ui/react/esm/menu/utils/stateAttributesMapping.js
|
| 235 |
+
var itemMapping = {
|
| 236 |
+
checked(value) {
|
| 237 |
+
if (value) return { [MenuCheckboxItemDataAttributes.checked]: "" };
|
| 238 |
+
return { [MenuCheckboxItemDataAttributes.unchecked]: "" };
|
| 239 |
+
},
|
| 240 |
+
...transitionStatusMapping
|
| 241 |
+
};
|
| 242 |
+
//#endregion
|
| 243 |
+
//#region ../node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItem.js
|
| 244 |
+
var import_jsx_runtime = require_jsx_runtime();
|
| 245 |
+
/**
|
| 246 |
+
* A menu item that toggles a setting on or off.
|
| 247 |
+
* Renders a `<div>` element.
|
| 248 |
+
*
|
| 249 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 250 |
+
*/
|
| 251 |
+
var MenuCheckboxItem = /* @__PURE__ */ import_react.forwardRef(function MenuCheckboxItem(componentProps, forwardedRef) {
|
| 252 |
+
const { render, className, id: idProp, label, nativeButton = false, disabled = false, closeOnClick = false, checked: checkedProp, defaultChecked, onCheckedChange, style, ...elementProps } = componentProps;
|
| 253 |
+
const listItem = useCompositeListItem({ label });
|
| 254 |
+
const menuPositionerContext = useMenuPositionerContext(true);
|
| 255 |
+
const id = useBaseUiId(idProp);
|
| 256 |
+
const { store } = useMenuRootContext();
|
| 257 |
+
const highlighted = store.useState("isActive", listItem.index);
|
| 258 |
+
const itemProps = store.useState("itemProps");
|
| 259 |
+
const [checked, setChecked] = useControlled({
|
| 260 |
+
controlled: checkedProp,
|
| 261 |
+
default: defaultChecked ?? false,
|
| 262 |
+
name: "MenuCheckboxItem",
|
| 263 |
+
state: "checked"
|
| 264 |
+
});
|
| 265 |
+
const { getItemProps, itemRef } = useMenuItem({
|
| 266 |
+
closeOnClick,
|
| 267 |
+
disabled,
|
| 268 |
+
highlighted,
|
| 269 |
+
id,
|
| 270 |
+
store,
|
| 271 |
+
nativeButton,
|
| 272 |
+
nodeId: menuPositionerContext?.context.nodeId,
|
| 273 |
+
itemMetadata: REGULAR_ITEM
|
| 274 |
+
});
|
| 275 |
+
const state = import_react.useMemo(() => ({
|
| 276 |
+
disabled,
|
| 277 |
+
highlighted,
|
| 278 |
+
checked
|
| 279 |
+
}), [
|
| 280 |
+
disabled,
|
| 281 |
+
highlighted,
|
| 282 |
+
checked
|
| 283 |
+
]);
|
| 284 |
+
function handleClick(event) {
|
| 285 |
+
const details = createChangeEventDetails(itemPress, event.nativeEvent, void 0, { preventUnmountOnClose() {} });
|
| 286 |
+
onCheckedChange?.(!checked, details);
|
| 287 |
+
if (details.isCanceled) return;
|
| 288 |
+
setChecked((currentlyChecked) => !currentlyChecked);
|
| 289 |
+
}
|
| 290 |
+
const element = useRenderElement("div", componentProps, {
|
| 291 |
+
state,
|
| 292 |
+
stateAttributesMapping: itemMapping,
|
| 293 |
+
props: [
|
| 294 |
+
itemProps,
|
| 295 |
+
{
|
| 296 |
+
role: "menuitemcheckbox",
|
| 297 |
+
"aria-checked": checked,
|
| 298 |
+
onClick: handleClick
|
| 299 |
+
},
|
| 300 |
+
elementProps,
|
| 301 |
+
getItemProps
|
| 302 |
+
],
|
| 303 |
+
ref: [
|
| 304 |
+
itemRef,
|
| 305 |
+
forwardedRef,
|
| 306 |
+
listItem.ref
|
| 307 |
+
]
|
| 308 |
+
});
|
| 309 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuCheckboxItemContext.Provider, {
|
| 310 |
+
value: state,
|
| 311 |
+
children: element
|
| 312 |
+
});
|
| 313 |
+
});
|
| 314 |
+
MenuCheckboxItem.displayName = "MenuCheckboxItem";
|
| 315 |
+
//#endregion
|
| 316 |
+
//#region ../node_modules/@base-ui/react/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js
|
| 317 |
+
/**
|
| 318 |
+
* Indicates whether the checkbox item is ticked.
|
| 319 |
+
* Renders a `<span>` element.
|
| 320 |
+
*
|
| 321 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 322 |
+
*/
|
| 323 |
+
var MenuCheckboxItemIndicator = /* @__PURE__ */ import_react.forwardRef(function MenuCheckboxItemIndicator(componentProps, forwardedRef) {
|
| 324 |
+
const { render, className, style, keepMounted = false, ...elementProps } = componentProps;
|
| 325 |
+
const item = useMenuCheckboxItemContext();
|
| 326 |
+
const indicatorRef = import_react.useRef(null);
|
| 327 |
+
const { transitionStatus, setMounted } = useTransitionStatus(item.checked);
|
| 328 |
+
useOpenChangeComplete({
|
| 329 |
+
open: item.checked,
|
| 330 |
+
ref: indicatorRef,
|
| 331 |
+
onComplete() {
|
| 332 |
+
if (!item.checked) setMounted(false);
|
| 333 |
+
}
|
| 334 |
+
});
|
| 335 |
+
return useRenderElement("span", componentProps, {
|
| 336 |
+
state: {
|
| 337 |
+
checked: item.checked,
|
| 338 |
+
disabled: item.disabled,
|
| 339 |
+
highlighted: item.highlighted,
|
| 340 |
+
transitionStatus
|
| 341 |
+
},
|
| 342 |
+
ref: [forwardedRef, indicatorRef],
|
| 343 |
+
stateAttributesMapping: itemMapping,
|
| 344 |
+
props: {
|
| 345 |
+
"aria-hidden": true,
|
| 346 |
+
...elementProps
|
| 347 |
+
},
|
| 348 |
+
enabled: keepMounted || item.checked
|
| 349 |
+
});
|
| 350 |
+
});
|
| 351 |
+
MenuCheckboxItemIndicator.displayName = "MenuCheckboxItemIndicator";
|
| 352 |
+
//#endregion
|
| 353 |
+
//#region ../node_modules/@base-ui/react/esm/menu/group/MenuGroupContext.js
|
| 354 |
+
var MenuGroupContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 355 |
+
MenuGroupContext.displayName = "MenuGroupContext";
|
| 356 |
+
function useMenuGroupRootContext() {
|
| 357 |
+
const context = import_react.useContext(MenuGroupContext);
|
| 358 |
+
if (context === void 0) throw new Error("Base UI: MenuGroupContext is missing. Menu group parts must be used within <Menu.Group> or <Menu.RadioGroup>.");
|
| 359 |
+
return context;
|
| 360 |
+
}
|
| 361 |
+
//#endregion
|
| 362 |
+
//#region ../node_modules/@base-ui/react/esm/menu/group/MenuGroup.js
|
| 363 |
+
/**
|
| 364 |
+
* Groups related menu items with the corresponding label.
|
| 365 |
+
* Renders a `<div>` element.
|
| 366 |
+
*
|
| 367 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 368 |
+
*/
|
| 369 |
+
var MenuGroup = /* @__PURE__ */ import_react.forwardRef(function MenuGroup(componentProps, forwardedRef) {
|
| 370 |
+
const { render, className, style, ...elementProps } = componentProps;
|
| 371 |
+
const [labelId, setLabelId] = import_react.useState(void 0);
|
| 372 |
+
const element = useRenderElement("div", componentProps, {
|
| 373 |
+
ref: forwardedRef,
|
| 374 |
+
props: {
|
| 375 |
+
role: "group",
|
| 376 |
+
"aria-labelledby": labelId,
|
| 377 |
+
...elementProps
|
| 378 |
+
}
|
| 379 |
+
});
|
| 380 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuGroupContext.Provider, {
|
| 381 |
+
value: setLabelId,
|
| 382 |
+
children: element
|
| 383 |
+
});
|
| 384 |
+
});
|
| 385 |
+
MenuGroup.displayName = "MenuGroup";
|
| 386 |
+
//#endregion
|
| 387 |
+
//#region ../node_modules/@base-ui/react/esm/menu/group-label/MenuGroupLabel.js
|
| 388 |
+
/**
|
| 389 |
+
* An accessible label that is automatically associated with its parent group.
|
| 390 |
+
* Renders a `<div>` element.
|
| 391 |
+
*
|
| 392 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 393 |
+
*/
|
| 394 |
+
var MenuGroupLabel = /* @__PURE__ */ import_react.forwardRef(function MenuGroupLabel(componentProps, forwardedRef) {
|
| 395 |
+
const { render, className, style, id: idProp, ...elementProps } = componentProps;
|
| 396 |
+
const id = useBaseUiId(idProp);
|
| 397 |
+
const setLabelId = useMenuGroupRootContext();
|
| 398 |
+
useIsoLayoutEffect(() => {
|
| 399 |
+
setLabelId(id);
|
| 400 |
+
return () => {
|
| 401 |
+
setLabelId(void 0);
|
| 402 |
+
};
|
| 403 |
+
}, [setLabelId, id]);
|
| 404 |
+
return useRenderElement("div", componentProps, {
|
| 405 |
+
ref: forwardedRef,
|
| 406 |
+
props: {
|
| 407 |
+
id,
|
| 408 |
+
role: "presentation",
|
| 409 |
+
...elementProps
|
| 410 |
+
}
|
| 411 |
+
});
|
| 412 |
+
});
|
| 413 |
+
MenuGroupLabel.displayName = "MenuGroupLabel";
|
| 414 |
+
//#endregion
|
| 415 |
+
//#region ../node_modules/@base-ui/react/esm/menu/item/MenuItem.js
|
| 416 |
+
/**
|
| 417 |
+
* An individual interactive item in the menu.
|
| 418 |
+
* Renders a `<div>` element.
|
| 419 |
+
*
|
| 420 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 421 |
+
*/
|
| 422 |
+
var MenuItem = /* @__PURE__ */ import_react.forwardRef(function MenuItem(componentProps, forwardedRef) {
|
| 423 |
+
const { render, className, id: idProp, label, nativeButton = false, disabled = false, closeOnClick = true, style, ...elementProps } = componentProps;
|
| 424 |
+
const listItem = useCompositeListItem({ label });
|
| 425 |
+
const menuPositionerContext = useMenuPositionerContext(true);
|
| 426 |
+
const id = useBaseUiId(idProp);
|
| 427 |
+
const { store } = useMenuRootContext();
|
| 428 |
+
const highlighted = store.useState("isActive", listItem.index);
|
| 429 |
+
const itemProps = store.useState("itemProps");
|
| 430 |
+
const { getItemProps, itemRef } = useMenuItem({
|
| 431 |
+
closeOnClick,
|
| 432 |
+
disabled,
|
| 433 |
+
highlighted,
|
| 434 |
+
id,
|
| 435 |
+
store,
|
| 436 |
+
nativeButton,
|
| 437 |
+
nodeId: menuPositionerContext?.context.nodeId,
|
| 438 |
+
itemMetadata: REGULAR_ITEM
|
| 439 |
+
});
|
| 440 |
+
return useRenderElement("div", componentProps, {
|
| 441 |
+
state: {
|
| 442 |
+
disabled,
|
| 443 |
+
highlighted
|
| 444 |
+
},
|
| 445 |
+
props: [
|
| 446 |
+
itemProps,
|
| 447 |
+
elementProps,
|
| 448 |
+
getItemProps
|
| 449 |
+
],
|
| 450 |
+
ref: [
|
| 451 |
+
itemRef,
|
| 452 |
+
forwardedRef,
|
| 453 |
+
listItem.ref
|
| 454 |
+
]
|
| 455 |
+
});
|
| 456 |
+
});
|
| 457 |
+
MenuItem.displayName = "MenuItem";
|
| 458 |
+
//#endregion
|
| 459 |
+
//#region ../node_modules/@base-ui/react/esm/menu/link-item/MenuLinkItem.js
|
| 460 |
+
/**
|
| 461 |
+
* A link in the menu that can be used to navigate to a different page or section.
|
| 462 |
+
* Renders an `<a>` element.
|
| 463 |
+
*
|
| 464 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 465 |
+
*/
|
| 466 |
+
var MenuLinkItem = /* @__PURE__ */ import_react.forwardRef(function MenuLinkItem(componentProps, forwardedRef) {
|
| 467 |
+
const { render, className, id: idProp, label, closeOnClick = false, style, ...elementProps } = componentProps;
|
| 468 |
+
const linkRef = import_react.useRef(null);
|
| 469 |
+
const listItem = useCompositeListItem({ label });
|
| 470 |
+
const nodeId = useMenuPositionerContext(true)?.context.nodeId;
|
| 471 |
+
const id = useBaseUiId(idProp);
|
| 472 |
+
const { store } = useMenuRootContext();
|
| 473 |
+
const highlighted = store.useState("isActive", listItem.index);
|
| 474 |
+
const itemProps = store.useState("itemProps");
|
| 475 |
+
const typingRef = store.context.typingRef;
|
| 476 |
+
const { getButtonProps, buttonRef } = useButton({
|
| 477 |
+
native: false,
|
| 478 |
+
composite: true
|
| 479 |
+
});
|
| 480 |
+
const commonProps = useMenuItemCommonProps({
|
| 481 |
+
closeOnClick,
|
| 482 |
+
highlighted,
|
| 483 |
+
id,
|
| 484 |
+
nodeId,
|
| 485 |
+
store,
|
| 486 |
+
typingRef,
|
| 487 |
+
itemRef: linkRef
|
| 488 |
+
});
|
| 489 |
+
function getItemProps(externalProps) {
|
| 490 |
+
return mergeProps(commonProps, externalProps, getButtonProps);
|
| 491 |
+
}
|
| 492 |
+
return useRenderElement("a", componentProps, {
|
| 493 |
+
state: { highlighted },
|
| 494 |
+
props: [
|
| 495 |
+
itemProps,
|
| 496 |
+
elementProps,
|
| 497 |
+
getItemProps
|
| 498 |
+
],
|
| 499 |
+
ref: [
|
| 500 |
+
linkRef,
|
| 501 |
+
buttonRef,
|
| 502 |
+
forwardedRef,
|
| 503 |
+
listItem.ref
|
| 504 |
+
]
|
| 505 |
+
});
|
| 506 |
+
});
|
| 507 |
+
MenuLinkItem.displayName = "MenuLinkItem";
|
| 508 |
+
//#endregion
|
| 509 |
+
//#region ../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFocus.js
|
| 510 |
+
var isMacSafari = isMac && isSafari;
|
| 511 |
+
/**
|
| 512 |
+
* Opens the floating element while the reference element has focus, like CSS
|
| 513 |
+
* `:focus`.
|
| 514 |
+
* @see https://floating-ui.com/docs/useFocus
|
| 515 |
+
*/
|
| 516 |
+
function useFocus(context, props = {}) {
|
| 517 |
+
const { enabled = true, delay } = props;
|
| 518 |
+
const store = "rootStore" in context ? context.rootStore : context;
|
| 519 |
+
const { events, dataRef } = store.context;
|
| 520 |
+
const blockFocusRef = import_react.useRef(false);
|
| 521 |
+
const blockedReferenceRef = import_react.useRef(null);
|
| 522 |
+
const keyboardModalityRef = import_react.useRef(true);
|
| 523 |
+
const timeout = useTimeout();
|
| 524 |
+
import_react.useEffect(() => {
|
| 525 |
+
const domReference = store.select("domReferenceElement");
|
| 526 |
+
if (!enabled) return;
|
| 527 |
+
const win = getWindow(domReference);
|
| 528 |
+
function onBlur() {
|
| 529 |
+
const currentDomReference = store.select("domReferenceElement");
|
| 530 |
+
if (!store.select("open") && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) blockFocusRef.current = true;
|
| 531 |
+
}
|
| 532 |
+
function onKeyDown() {
|
| 533 |
+
keyboardModalityRef.current = true;
|
| 534 |
+
}
|
| 535 |
+
function onPointerDown() {
|
| 536 |
+
keyboardModalityRef.current = false;
|
| 537 |
+
}
|
| 538 |
+
return mergeCleanups(addEventListener(win, "blur", onBlur), isMacSafari && addEventListener(win, "keydown", onKeyDown, true), isMacSafari && addEventListener(win, "pointerdown", onPointerDown, true));
|
| 539 |
+
}, [store, enabled]);
|
| 540 |
+
import_react.useEffect(() => {
|
| 541 |
+
if (!enabled) return;
|
| 542 |
+
function onOpenChangeLocal(details) {
|
| 543 |
+
if (details.reason === "trigger-press" || details.reason === "escape-key") {
|
| 544 |
+
const referenceElement = store.select("domReferenceElement");
|
| 545 |
+
if (isElement(referenceElement)) {
|
| 546 |
+
blockedReferenceRef.current = referenceElement;
|
| 547 |
+
blockFocusRef.current = true;
|
| 548 |
+
}
|
| 549 |
+
}
|
| 550 |
+
}
|
| 551 |
+
events.on("openchange", onOpenChangeLocal);
|
| 552 |
+
return () => {
|
| 553 |
+
events.off("openchange", onOpenChangeLocal);
|
| 554 |
+
};
|
| 555 |
+
}, [
|
| 556 |
+
events,
|
| 557 |
+
enabled,
|
| 558 |
+
store
|
| 559 |
+
]);
|
| 560 |
+
const reference = import_react.useMemo(() => {
|
| 561 |
+
function resetBlockedFocus() {
|
| 562 |
+
blockFocusRef.current = false;
|
| 563 |
+
blockedReferenceRef.current = null;
|
| 564 |
+
}
|
| 565 |
+
return {
|
| 566 |
+
onMouseLeave() {
|
| 567 |
+
resetBlockedFocus();
|
| 568 |
+
},
|
| 569 |
+
onFocus(event) {
|
| 570 |
+
const focusTarget = event.currentTarget;
|
| 571 |
+
if (blockFocusRef.current) {
|
| 572 |
+
if (blockedReferenceRef.current === focusTarget) return;
|
| 573 |
+
resetBlockedFocus();
|
| 574 |
+
}
|
| 575 |
+
const target = getTarget(event.nativeEvent);
|
| 576 |
+
if (isElement(target)) {
|
| 577 |
+
if (isMacSafari && !event.relatedTarget) {
|
| 578 |
+
if (!keyboardModalityRef.current && !isTypeableElement(target)) return;
|
| 579 |
+
} else if (!matchesFocusVisible(target)) return;
|
| 580 |
+
}
|
| 581 |
+
const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements);
|
| 582 |
+
const { nativeEvent, currentTarget } = event;
|
| 583 |
+
const delayValue = typeof delay === "function" ? delay() : delay;
|
| 584 |
+
if (store.select("open") && movedFromOtherEnabledTrigger || delayValue === 0 || delayValue === void 0) {
|
| 585 |
+
store.setOpen(true, createChangeEventDetails(triggerFocus, nativeEvent, currentTarget));
|
| 586 |
+
return;
|
| 587 |
+
}
|
| 588 |
+
timeout.start(delayValue, () => {
|
| 589 |
+
if (blockFocusRef.current) return;
|
| 590 |
+
store.setOpen(true, createChangeEventDetails(triggerFocus, nativeEvent, currentTarget));
|
| 591 |
+
});
|
| 592 |
+
},
|
| 593 |
+
onBlur(event) {
|
| 594 |
+
resetBlockedFocus();
|
| 595 |
+
const relatedTarget = event.relatedTarget;
|
| 596 |
+
const nativeEvent = event.nativeEvent;
|
| 597 |
+
const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside";
|
| 598 |
+
timeout.start(0, () => {
|
| 599 |
+
const domReference = store.select("domReferenceElement");
|
| 600 |
+
const activeEl = activeElement(ownerDocument(domReference));
|
| 601 |
+
if (!relatedTarget && activeEl === domReference) return;
|
| 602 |
+
if (contains(dataRef.current.floatingContext?.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) return;
|
| 603 |
+
if (isTargetInsideEnabledTrigger(relatedTarget ?? activeEl, store.context.triggerElements)) return;
|
| 604 |
+
store.setOpen(false, createChangeEventDetails(triggerFocus, nativeEvent));
|
| 605 |
+
});
|
| 606 |
+
}
|
| 607 |
+
};
|
| 608 |
+
}, [
|
| 609 |
+
dataRef,
|
| 610 |
+
delay,
|
| 611 |
+
store,
|
| 612 |
+
timeout
|
| 613 |
+
]);
|
| 614 |
+
return import_react.useMemo(() => enabled ? {
|
| 615 |
+
reference,
|
| 616 |
+
trigger: reference
|
| 617 |
+
} : {}, [enabled, reference]);
|
| 618 |
+
}
|
| 619 |
+
//#endregion
|
| 620 |
+
//#region ../node_modules/@base-ui/react/esm/menu/popup/MenuPopup.js
|
| 621 |
+
var stateAttributesMapping$1 = {
|
| 622 |
+
...popupStateMapping,
|
| 623 |
+
...transitionStatusMapping
|
| 624 |
+
};
|
| 625 |
+
/**
|
| 626 |
+
* A container for the menu items.
|
| 627 |
+
* Renders a `<div>` element.
|
| 628 |
+
*
|
| 629 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 630 |
+
*/
|
| 631 |
+
var MenuPopup = /* @__PURE__ */ import_react.forwardRef(function MenuPopup(componentProps, forwardedRef) {
|
| 632 |
+
const { render, className, style, finalFocus, ...elementProps } = componentProps;
|
| 633 |
+
const { store } = useMenuRootContext();
|
| 634 |
+
const { side, align } = useMenuPositionerContext();
|
| 635 |
+
const insideToolbar = useToolbarRootContext(true) != null;
|
| 636 |
+
const open = store.useState("open");
|
| 637 |
+
const transitionStatus = store.useState("transitionStatus");
|
| 638 |
+
const popupProps = store.useState("popupProps");
|
| 639 |
+
const mounted = store.useState("mounted");
|
| 640 |
+
const instantType = store.useState("instantType");
|
| 641 |
+
const triggerElement = store.useState("activeTriggerElement");
|
| 642 |
+
const parent = store.useState("parent");
|
| 643 |
+
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
|
| 644 |
+
const rootId = store.useState("rootId");
|
| 645 |
+
const floatingContext = store.useState("floatingRootContext");
|
| 646 |
+
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
| 647 |
+
const closeDelay = store.useState("closeDelay");
|
| 648 |
+
const activeTriggerElement = store.useState("activeTriggerElement");
|
| 649 |
+
const hoverEnabled = store.useState("hoverEnabled");
|
| 650 |
+
const disabled = store.useState("disabled");
|
| 651 |
+
const isContextMenu = parent.type === "context-menu";
|
| 652 |
+
useOpenChangeComplete({
|
| 653 |
+
open,
|
| 654 |
+
ref: store.context.popupRef,
|
| 655 |
+
onComplete() {
|
| 656 |
+
if (open) store.context.onOpenChangeComplete?.(true);
|
| 657 |
+
}
|
| 658 |
+
});
|
| 659 |
+
import_react.useEffect(() => {
|
| 660 |
+
function handleClose(event) {
|
| 661 |
+
store.setOpen(false, createChangeEventDetails(event.reason, event.domEvent));
|
| 662 |
+
}
|
| 663 |
+
floatingTreeRoot.events.on("close", handleClose);
|
| 664 |
+
return () => {
|
| 665 |
+
floatingTreeRoot.events.off("close", handleClose);
|
| 666 |
+
};
|
| 667 |
+
}, [floatingTreeRoot.events, store]);
|
| 668 |
+
useHoverFloatingInteraction(floatingContext, {
|
| 669 |
+
enabled: hoverEnabled && !disabled && !isContextMenu && parent.type !== "menubar",
|
| 670 |
+
closeDelay
|
| 671 |
+
});
|
| 672 |
+
const setPopupElement = import_react.useCallback((element) => {
|
| 673 |
+
store.set("popupElement", element);
|
| 674 |
+
}, [store]);
|
| 675 |
+
const element = useRenderElement("div", componentProps, {
|
| 676 |
+
state: {
|
| 677 |
+
transitionStatus,
|
| 678 |
+
side,
|
| 679 |
+
align,
|
| 680 |
+
open,
|
| 681 |
+
nested: parent.type === "menu",
|
| 682 |
+
instant: instantType
|
| 683 |
+
},
|
| 684 |
+
ref: [
|
| 685 |
+
forwardedRef,
|
| 686 |
+
store.context.popupRef,
|
| 687 |
+
setPopupElement
|
| 688 |
+
],
|
| 689 |
+
stateAttributesMapping: stateAttributesMapping$1,
|
| 690 |
+
props: [
|
| 691 |
+
popupProps,
|
| 692 |
+
{ onKeyDown(event) {
|
| 693 |
+
if (insideToolbar && COMPOSITE_KEYS.has(event.key)) event.stopPropagation();
|
| 694 |
+
} },
|
| 695 |
+
getDisabledMountTransitionStyles(transitionStatus),
|
| 696 |
+
elementProps,
|
| 697 |
+
{ "data-rootownerid": rootId }
|
| 698 |
+
]
|
| 699 |
+
});
|
| 700 |
+
let returnFocus = parent.type === void 0 || isContextMenu;
|
| 701 |
+
if (triggerElement || parent.type === "menubar" && lastOpenChangeReason !== "outside-press") returnFocus = true;
|
| 702 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingFocusManager, {
|
| 703 |
+
context: floatingContext,
|
| 704 |
+
modal: isContextMenu,
|
| 705 |
+
disabled: !mounted,
|
| 706 |
+
returnFocus: finalFocus === void 0 ? returnFocus : finalFocus,
|
| 707 |
+
initialFocus: parent.type !== "menu",
|
| 708 |
+
restoreFocus: true,
|
| 709 |
+
externalTree: parent.type !== "menubar" ? floatingTreeRoot : void 0,
|
| 710 |
+
previousFocusableElement: activeTriggerElement,
|
| 711 |
+
nextFocusableElement: parent.type === void 0 ? store.context.triggerFocusTargetRef : void 0,
|
| 712 |
+
beforeContentFocusGuardRef: parent.type === void 0 ? store.context.beforeContentFocusGuardRef : void 0,
|
| 713 |
+
children: element
|
| 714 |
+
});
|
| 715 |
+
});
|
| 716 |
+
MenuPopup.displayName = "MenuPopup";
|
| 717 |
+
//#endregion
|
| 718 |
+
//#region ../node_modules/@base-ui/react/esm/menu/portal/MenuPortalContext.js
|
| 719 |
+
var MenuPortalContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 720 |
+
MenuPortalContext.displayName = "MenuPortalContext";
|
| 721 |
+
function useMenuPortalContext() {
|
| 722 |
+
const value = import_react.useContext(MenuPortalContext);
|
| 723 |
+
if (value === void 0) throw new Error("Base UI: <Menu.Portal> is missing.");
|
| 724 |
+
return value;
|
| 725 |
+
}
|
| 726 |
+
//#endregion
|
| 727 |
+
//#region ../node_modules/@base-ui/react/esm/menu/portal/MenuPortal.js
|
| 728 |
+
/**
|
| 729 |
+
* A portal element that moves the popup to a different part of the DOM.
|
| 730 |
+
* By default, the portal element is appended to `<body>`.
|
| 731 |
+
* Renders a `<div>` element.
|
| 732 |
+
*
|
| 733 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 734 |
+
*/
|
| 735 |
+
var MenuPortal = /* @__PURE__ */ import_react.forwardRef(function MenuPortal(props, forwardedRef) {
|
| 736 |
+
const { keepMounted = false, ...portalProps } = props;
|
| 737 |
+
const { store } = useMenuRootContext();
|
| 738 |
+
if (!(store.useState("mounted") || keepMounted)) return null;
|
| 739 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuPortalContext.Provider, {
|
| 740 |
+
value: keepMounted,
|
| 741 |
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingPortal, {
|
| 742 |
+
ref: forwardedRef,
|
| 743 |
+
...portalProps
|
| 744 |
+
})
|
| 745 |
+
});
|
| 746 |
+
});
|
| 747 |
+
MenuPortal.displayName = "MenuPortal";
|
| 748 |
+
//#endregion
|
| 749 |
+
//#region ../node_modules/@base-ui/react/esm/menu/positioner/MenuPositioner.js
|
| 750 |
+
/**
|
| 751 |
+
* Positions the menu popup against the trigger.
|
| 752 |
+
* Renders a `<div>` element.
|
| 753 |
+
*
|
| 754 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 755 |
+
*/
|
| 756 |
+
var MenuPositioner = /* @__PURE__ */ import_react.forwardRef(function MenuPositioner(componentProps, forwardedRef) {
|
| 757 |
+
const { anchor: anchorProp, positionMethod: positionMethodProp = "absolute", className, render, side, align: alignProp, sideOffset: sideOffsetProp = 0, alignOffset: alignOffsetProp = 0, collisionBoundary = "clipping-ancestors", collisionPadding = 5, arrowPadding = 5, sticky = false, disableAnchorTracking = false, collisionAvoidance: collisionAvoidanceProp = DROPDOWN_COLLISION_AVOIDANCE, style, ...elementProps } = componentProps;
|
| 758 |
+
const { store } = useMenuRootContext();
|
| 759 |
+
const keepMounted = useMenuPortalContext();
|
| 760 |
+
const contextMenuContext = useContextMenuRootContext(true);
|
| 761 |
+
const parent = store.useState("parent");
|
| 762 |
+
const floatingRootContext = store.useState("floatingRootContext");
|
| 763 |
+
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
| 764 |
+
const mounted = store.useState("mounted");
|
| 765 |
+
const open = store.useState("open");
|
| 766 |
+
const modal = store.useState("modal");
|
| 767 |
+
const openMethod = store.useState("openMethod");
|
| 768 |
+
const triggerElement = store.useState("activeTriggerElement");
|
| 769 |
+
const transitionStatus = store.useState("transitionStatus");
|
| 770 |
+
const positionerElement = store.useState("positionerElement");
|
| 771 |
+
const instantType = store.useState("instantType");
|
| 772 |
+
const hasViewport = store.useState("hasViewport");
|
| 773 |
+
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
|
| 774 |
+
const floatingNodeId = store.useState("floatingNodeId");
|
| 775 |
+
const floatingParentNodeId = store.useState("floatingParentNodeId");
|
| 776 |
+
const domReference = floatingRootContext.useState("domReferenceElement");
|
| 777 |
+
const previousTriggerRef = import_react.useRef(null);
|
| 778 |
+
const runOnceAnimationsFinish = useAnimationsFinished(positionerElement, false, false);
|
| 779 |
+
let anchor = anchorProp;
|
| 780 |
+
let sideOffset = sideOffsetProp;
|
| 781 |
+
let alignOffset = alignOffsetProp;
|
| 782 |
+
let align = alignProp;
|
| 783 |
+
let collisionAvoidance = collisionAvoidanceProp;
|
| 784 |
+
if (parent.type === "context-menu") {
|
| 785 |
+
anchor = anchorProp ?? parent.context?.anchor;
|
| 786 |
+
align = align ?? "start";
|
| 787 |
+
if (!side && align !== "center") {
|
| 788 |
+
alignOffset = componentProps.alignOffset ?? 2;
|
| 789 |
+
sideOffset = componentProps.sideOffset ?? -5;
|
| 790 |
+
}
|
| 791 |
+
}
|
| 792 |
+
let computedSide = side;
|
| 793 |
+
let computedAlign = align;
|
| 794 |
+
if (parent.type === "menu") {
|
| 795 |
+
computedSide = computedSide ?? "inline-end";
|
| 796 |
+
computedAlign = computedAlign ?? "start";
|
| 797 |
+
collisionAvoidance = componentProps.collisionAvoidance ?? POPUP_COLLISION_AVOIDANCE;
|
| 798 |
+
} else if (parent.type === "menubar") {
|
| 799 |
+
computedSide = computedSide ?? "bottom";
|
| 800 |
+
computedAlign = computedAlign ?? "start";
|
| 801 |
+
}
|
| 802 |
+
const contextMenu = parent.type === "context-menu";
|
| 803 |
+
const positioner = useAnchorPositioning({
|
| 804 |
+
anchor,
|
| 805 |
+
floatingRootContext,
|
| 806 |
+
positionMethod: contextMenuContext ? "fixed" : positionMethodProp,
|
| 807 |
+
mounted,
|
| 808 |
+
side: computedSide,
|
| 809 |
+
sideOffset,
|
| 810 |
+
align: computedAlign,
|
| 811 |
+
alignOffset,
|
| 812 |
+
arrowPadding: contextMenu ? 0 : arrowPadding,
|
| 813 |
+
collisionBoundary,
|
| 814 |
+
collisionPadding,
|
| 815 |
+
sticky,
|
| 816 |
+
nodeId: floatingNodeId,
|
| 817 |
+
keepMounted,
|
| 818 |
+
disableAnchorTracking,
|
| 819 |
+
collisionAvoidance,
|
| 820 |
+
shiftCrossAxis: contextMenu && !("side" in collisionAvoidance && collisionAvoidance.side === "flip"),
|
| 821 |
+
externalTree: floatingTreeRoot,
|
| 822 |
+
adaptiveOrigin: hasViewport ? adaptiveOrigin : void 0
|
| 823 |
+
});
|
| 824 |
+
import_react.useEffect(() => {
|
| 825 |
+
function onMenuOpenChange(details) {
|
| 826 |
+
if (details.open) {
|
| 827 |
+
if (details.parentNodeId === floatingNodeId) store.set("hoverEnabled", false);
|
| 828 |
+
if (details.nodeId !== floatingNodeId && details.parentNodeId === store.select("floatingParentNodeId")) store.setOpen(false, createChangeEventDetails(siblingOpen));
|
| 829 |
+
}
|
| 830 |
+
}
|
| 831 |
+
floatingTreeRoot.events.on("menuopenchange", onMenuOpenChange);
|
| 832 |
+
return () => {
|
| 833 |
+
floatingTreeRoot.events.off("menuopenchange", onMenuOpenChange);
|
| 834 |
+
};
|
| 835 |
+
}, [
|
| 836 |
+
store,
|
| 837 |
+
floatingTreeRoot.events,
|
| 838 |
+
floatingNodeId
|
| 839 |
+
]);
|
| 840 |
+
import_react.useEffect(() => {
|
| 841 |
+
if (store.select("floatingParentNodeId") == null) return;
|
| 842 |
+
function onParentClose(details) {
|
| 843 |
+
if (details.open || details.nodeId !== store.select("floatingParentNodeId")) return;
|
| 844 |
+
const reason = details.reason ?? "sibling-open";
|
| 845 |
+
store.setOpen(false, createChangeEventDetails(reason));
|
| 846 |
+
}
|
| 847 |
+
floatingTreeRoot.events.on("menuopenchange", onParentClose);
|
| 848 |
+
return () => {
|
| 849 |
+
floatingTreeRoot.events.off("menuopenchange", onParentClose);
|
| 850 |
+
};
|
| 851 |
+
}, [floatingTreeRoot.events, store]);
|
| 852 |
+
const closeTimeout = useTimeout();
|
| 853 |
+
import_react.useEffect(() => {
|
| 854 |
+
if (!open) closeTimeout.clear();
|
| 855 |
+
}, [open, closeTimeout]);
|
| 856 |
+
import_react.useEffect(() => {
|
| 857 |
+
function onItemHover(event) {
|
| 858 |
+
if (!open || event.nodeId !== store.select("floatingParentNodeId")) return;
|
| 859 |
+
if (event.target && triggerElement && triggerElement !== event.target) {
|
| 860 |
+
const delay = store.select("closeDelay");
|
| 861 |
+
if (delay > 0) {
|
| 862 |
+
if (!closeTimeout.isStarted()) closeTimeout.start(delay, () => {
|
| 863 |
+
store.setOpen(false, createChangeEventDetails(siblingOpen));
|
| 864 |
+
});
|
| 865 |
+
} else store.setOpen(false, createChangeEventDetails(siblingOpen));
|
| 866 |
+
} else closeTimeout.clear();
|
| 867 |
+
}
|
| 868 |
+
floatingTreeRoot.events.on("itemhover", onItemHover);
|
| 869 |
+
return () => {
|
| 870 |
+
floatingTreeRoot.events.off("itemhover", onItemHover);
|
| 871 |
+
};
|
| 872 |
+
}, [
|
| 873 |
+
floatingTreeRoot.events,
|
| 874 |
+
open,
|
| 875 |
+
triggerElement,
|
| 876 |
+
store,
|
| 877 |
+
closeTimeout
|
| 878 |
+
]);
|
| 879 |
+
import_react.useEffect(() => {
|
| 880 |
+
const eventDetails = {
|
| 881 |
+
open,
|
| 882 |
+
nodeId: floatingNodeId,
|
| 883 |
+
parentNodeId: floatingParentNodeId,
|
| 884 |
+
reason: store.select("lastOpenChangeReason")
|
| 885 |
+
};
|
| 886 |
+
floatingTreeRoot.events.emit("menuopenchange", eventDetails);
|
| 887 |
+
}, [
|
| 888 |
+
floatingTreeRoot.events,
|
| 889 |
+
open,
|
| 890 |
+
store,
|
| 891 |
+
floatingNodeId,
|
| 892 |
+
floatingParentNodeId
|
| 893 |
+
]);
|
| 894 |
+
useIsoLayoutEffect(() => {
|
| 895 |
+
const currentTrigger = domReference;
|
| 896 |
+
const previousTrigger = previousTriggerRef.current;
|
| 897 |
+
if (currentTrigger) previousTriggerRef.current = currentTrigger;
|
| 898 |
+
if (previousTrigger && currentTrigger && currentTrigger !== previousTrigger) {
|
| 899 |
+
store.set("instantType", void 0);
|
| 900 |
+
const abortController = new AbortController();
|
| 901 |
+
runOnceAnimationsFinish(() => {
|
| 902 |
+
store.set("instantType", "trigger-change");
|
| 903 |
+
}, abortController.signal);
|
| 904 |
+
return () => {
|
| 905 |
+
abortController.abort();
|
| 906 |
+
};
|
| 907 |
+
}
|
| 908 |
+
}, [
|
| 909 |
+
domReference,
|
| 910 |
+
runOnceAnimationsFinish,
|
| 911 |
+
store
|
| 912 |
+
]);
|
| 913 |
+
const state = {
|
| 914 |
+
open,
|
| 915 |
+
side: positioner.side,
|
| 916 |
+
align: positioner.align,
|
| 917 |
+
anchorHidden: positioner.anchorHidden,
|
| 918 |
+
nested: parent.type === "menu",
|
| 919 |
+
instant: instantType
|
| 920 |
+
};
|
| 921 |
+
const menubarModal = parent.type === "menubar" && parent.context.modal;
|
| 922 |
+
useAnchoredPopupScrollLock(open && (menubarModal || modal && lastOpenChangeReason !== "trigger-hover"), openMethod === "touch", positionerElement, triggerElement);
|
| 923 |
+
const element = usePositioner(componentProps, state, {
|
| 924 |
+
styles: positioner.positionerStyles,
|
| 925 |
+
transitionStatus,
|
| 926 |
+
props: elementProps,
|
| 927 |
+
refs: [forwardedRef, store.useStateSetter("positionerElement")],
|
| 928 |
+
hidden: !mounted,
|
| 929 |
+
inert: !open
|
| 930 |
+
});
|
| 931 |
+
const shouldRenderBackdrop = mounted && parent.type !== "menu" && (parent.type !== "menubar" && modal && lastOpenChangeReason !== "trigger-hover" || parent.type === "menubar" && parent.context.modal);
|
| 932 |
+
let backdropCutout = null;
|
| 933 |
+
if (parent.type === "menubar") backdropCutout = parent.context.contentElement;
|
| 934 |
+
else if (parent.type === void 0) backdropCutout = triggerElement;
|
| 935 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(MenuPositionerContext.Provider, {
|
| 936 |
+
value: positioner,
|
| 937 |
+
children: [shouldRenderBackdrop && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InternalBackdrop, {
|
| 938 |
+
ref: parent.type === "context-menu" || parent.type === "nested-context-menu" ? parent.context.internalBackdropRef : null,
|
| 939 |
+
inert: inertValue(!open),
|
| 940 |
+
cutout: backdropCutout
|
| 941 |
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingNode, {
|
| 942 |
+
id: floatingNodeId,
|
| 943 |
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompositeList, {
|
| 944 |
+
elementsRef: store.context.itemDomElements,
|
| 945 |
+
labelsRef: store.context.itemLabels,
|
| 946 |
+
children: element
|
| 947 |
+
})
|
| 948 |
+
})]
|
| 949 |
+
});
|
| 950 |
+
});
|
| 951 |
+
MenuPositioner.displayName = "MenuPositioner";
|
| 952 |
+
//#endregion
|
| 953 |
+
//#region ../node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroupContext.js
|
| 954 |
+
var MenuRadioGroupContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 955 |
+
MenuRadioGroupContext.displayName = "MenuRadioGroupContext";
|
| 956 |
+
function useMenuRadioGroupContext() {
|
| 957 |
+
const context = import_react.useContext(MenuRadioGroupContext);
|
| 958 |
+
if (context === void 0) throw new Error("Base UI: MenuRadioGroupContext is missing. MenuRadioGroup parts must be placed within <Menu.RadioGroup>.");
|
| 959 |
+
return context;
|
| 960 |
+
}
|
| 961 |
+
//#endregion
|
| 962 |
+
//#region ../node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroup.js
|
| 963 |
+
/**
|
| 964 |
+
* Groups related radio items.
|
| 965 |
+
* Renders a `<div>` element.
|
| 966 |
+
*
|
| 967 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 968 |
+
*/
|
| 969 |
+
var MenuRadioGroup = /* @__PURE__ */ import_react.memo(/* @__PURE__ */ import_react.forwardRef(function MenuRadioGroup(componentProps, forwardedRef) {
|
| 970 |
+
const { render, className, value: valueProp, defaultValue, onValueChange: onValueChangeProp, disabled = false, style, "aria-labelledby": ariaLabelledByProp, ...elementProps } = componentProps;
|
| 971 |
+
const [labelId, setLabelId] = import_react.useState(void 0);
|
| 972 |
+
const [value, setValueUnwrapped] = useControlled({
|
| 973 |
+
controlled: valueProp,
|
| 974 |
+
default: defaultValue,
|
| 975 |
+
name: "MenuRadioGroup"
|
| 976 |
+
});
|
| 977 |
+
const setValue = useStableCallback((newValue, eventDetails) => {
|
| 978 |
+
onValueChangeProp?.(newValue, eventDetails);
|
| 979 |
+
if (eventDetails.isCanceled) return;
|
| 980 |
+
setValueUnwrapped(newValue);
|
| 981 |
+
});
|
| 982 |
+
const element = useRenderElement("div", componentProps, {
|
| 983 |
+
state: { disabled },
|
| 984 |
+
ref: forwardedRef,
|
| 985 |
+
props: {
|
| 986 |
+
role: "group",
|
| 987 |
+
"aria-labelledby": ariaLabelledByProp ?? labelId,
|
| 988 |
+
"aria-disabled": disabled || void 0,
|
| 989 |
+
...elementProps
|
| 990 |
+
}
|
| 991 |
+
});
|
| 992 |
+
const context = import_react.useMemo(() => ({
|
| 993 |
+
value,
|
| 994 |
+
setValue,
|
| 995 |
+
disabled
|
| 996 |
+
}), [
|
| 997 |
+
value,
|
| 998 |
+
setValue,
|
| 999 |
+
disabled
|
| 1000 |
+
]);
|
| 1001 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuGroupContext.Provider, {
|
| 1002 |
+
value: setLabelId,
|
| 1003 |
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuRadioGroupContext.Provider, {
|
| 1004 |
+
value: context,
|
| 1005 |
+
children: element
|
| 1006 |
+
})
|
| 1007 |
+
});
|
| 1008 |
+
}));
|
| 1009 |
+
MenuRadioGroup.displayName = "MenuRadioGroup";
|
| 1010 |
+
//#endregion
|
| 1011 |
+
//#region ../node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItemContext.js
|
| 1012 |
+
var MenuRadioItemContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 1013 |
+
MenuRadioItemContext.displayName = "MenuRadioItemContext";
|
| 1014 |
+
function useMenuRadioItemContext() {
|
| 1015 |
+
const context = import_react.useContext(MenuRadioItemContext);
|
| 1016 |
+
if (context === void 0) throw new Error("Base UI: MenuRadioItemContext is missing. MenuRadioItem parts must be placed within <Menu.RadioItem>.");
|
| 1017 |
+
return context;
|
| 1018 |
+
}
|
| 1019 |
+
//#endregion
|
| 1020 |
+
//#region ../node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItem.js
|
| 1021 |
+
/**
|
| 1022 |
+
* A menu item that works like a radio button in a given group.
|
| 1023 |
+
* Renders a `<div>` element.
|
| 1024 |
+
*
|
| 1025 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 1026 |
+
*/
|
| 1027 |
+
var MenuRadioItem = /* @__PURE__ */ import_react.forwardRef(function MenuRadioItem(componentProps, forwardedRef) {
|
| 1028 |
+
const { render, className, id: idProp, label, nativeButton = false, disabled: disabledProp = false, closeOnClick = false, value, style, ...elementProps } = componentProps;
|
| 1029 |
+
const listItem = useCompositeListItem({ label });
|
| 1030 |
+
const menuPositionerContext = useMenuPositionerContext(true);
|
| 1031 |
+
const id = useBaseUiId(idProp);
|
| 1032 |
+
const { store } = useMenuRootContext();
|
| 1033 |
+
const highlighted = store.useState("isActive", listItem.index);
|
| 1034 |
+
const itemProps = store.useState("itemProps");
|
| 1035 |
+
const { value: selectedValue, setValue: setSelectedValue, disabled: groupDisabled } = useMenuRadioGroupContext();
|
| 1036 |
+
const disabled = groupDisabled || disabledProp;
|
| 1037 |
+
const checked = selectedValue === value;
|
| 1038 |
+
const { getItemProps, itemRef } = useMenuItem({
|
| 1039 |
+
closeOnClick,
|
| 1040 |
+
disabled,
|
| 1041 |
+
highlighted,
|
| 1042 |
+
id,
|
| 1043 |
+
store,
|
| 1044 |
+
nativeButton,
|
| 1045 |
+
nodeId: menuPositionerContext?.context.nodeId,
|
| 1046 |
+
itemMetadata: REGULAR_ITEM
|
| 1047 |
+
});
|
| 1048 |
+
const state = import_react.useMemo(() => ({
|
| 1049 |
+
disabled,
|
| 1050 |
+
highlighted,
|
| 1051 |
+
checked
|
| 1052 |
+
}), [
|
| 1053 |
+
disabled,
|
| 1054 |
+
highlighted,
|
| 1055 |
+
checked
|
| 1056 |
+
]);
|
| 1057 |
+
function handleClick(event) {
|
| 1058 |
+
setSelectedValue(value, createChangeEventDetails(itemPress, event.nativeEvent, void 0, { preventUnmountOnClose() {} }));
|
| 1059 |
+
}
|
| 1060 |
+
const element = useRenderElement("div", componentProps, {
|
| 1061 |
+
state,
|
| 1062 |
+
stateAttributesMapping: itemMapping,
|
| 1063 |
+
props: [
|
| 1064 |
+
itemProps,
|
| 1065 |
+
{
|
| 1066 |
+
role: "menuitemradio",
|
| 1067 |
+
"aria-checked": checked,
|
| 1068 |
+
onClick: handleClick
|
| 1069 |
+
},
|
| 1070 |
+
elementProps,
|
| 1071 |
+
getItemProps
|
| 1072 |
+
],
|
| 1073 |
+
ref: [
|
| 1074 |
+
itemRef,
|
| 1075 |
+
forwardedRef,
|
| 1076 |
+
listItem.ref
|
| 1077 |
+
]
|
| 1078 |
+
});
|
| 1079 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuRadioItemContext.Provider, {
|
| 1080 |
+
value: state,
|
| 1081 |
+
children: element
|
| 1082 |
+
});
|
| 1083 |
+
});
|
| 1084 |
+
MenuRadioItem.displayName = "MenuRadioItem";
|
| 1085 |
+
//#endregion
|
| 1086 |
+
//#region ../node_modules/@base-ui/react/esm/menu/radio-item-indicator/MenuRadioItemIndicator.js
|
| 1087 |
+
/**
|
| 1088 |
+
* Indicates whether the radio item is selected.
|
| 1089 |
+
* Renders a `<span>` element.
|
| 1090 |
+
*
|
| 1091 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 1092 |
+
*/
|
| 1093 |
+
var MenuRadioItemIndicator = /* @__PURE__ */ import_react.forwardRef(function MenuRadioItemIndicator(componentProps, forwardedRef) {
|
| 1094 |
+
const { render, className, style, keepMounted = false, ...elementProps } = componentProps;
|
| 1095 |
+
const item = useMenuRadioItemContext();
|
| 1096 |
+
const indicatorRef = import_react.useRef(null);
|
| 1097 |
+
const { transitionStatus, setMounted } = useTransitionStatus(item.checked);
|
| 1098 |
+
useOpenChangeComplete({
|
| 1099 |
+
open: item.checked,
|
| 1100 |
+
ref: indicatorRef,
|
| 1101 |
+
onComplete() {
|
| 1102 |
+
if (!item.checked) setMounted(false);
|
| 1103 |
+
}
|
| 1104 |
+
});
|
| 1105 |
+
return useRenderElement("span", componentProps, {
|
| 1106 |
+
state: {
|
| 1107 |
+
checked: item.checked,
|
| 1108 |
+
disabled: item.disabled,
|
| 1109 |
+
highlighted: item.highlighted,
|
| 1110 |
+
transitionStatus
|
| 1111 |
+
},
|
| 1112 |
+
stateAttributesMapping: itemMapping,
|
| 1113 |
+
ref: [forwardedRef, indicatorRef],
|
| 1114 |
+
props: {
|
| 1115 |
+
"aria-hidden": true,
|
| 1116 |
+
...elementProps
|
| 1117 |
+
},
|
| 1118 |
+
enabled: keepMounted || item.checked
|
| 1119 |
+
});
|
| 1120 |
+
});
|
| 1121 |
+
MenuRadioItemIndicator.displayName = "MenuRadioItemIndicator";
|
| 1122 |
+
//#endregion
|
| 1123 |
+
//#region ../node_modules/@base-ui/react/esm/menubar/MenubarContext.js
|
| 1124 |
+
var MenubarContext = /* @__PURE__ */ import_react.createContext(null);
|
| 1125 |
+
MenubarContext.displayName = "MenubarContext";
|
| 1126 |
+
function useMenubarContext(optional) {
|
| 1127 |
+
const context = import_react.useContext(MenubarContext);
|
| 1128 |
+
if (context === null && !optional) throw new Error("Base UI: MenubarContext is missing. Menubar parts must be placed within <Menubar>.");
|
| 1129 |
+
return context;
|
| 1130 |
+
}
|
| 1131 |
+
//#endregion
|
| 1132 |
+
//#region ../node_modules/@base-ui/react/esm/menu/store/MenuStore.js
|
| 1133 |
+
var selectors = {
|
| 1134 |
+
...popupStoreSelectors,
|
| 1135 |
+
disabled: createSelector((state) => state.parent.type === "menubar" ? state.parent.context.disabled || state.disabled : state.disabled),
|
| 1136 |
+
modal: createSelector((state) => (state.parent.type === void 0 || state.parent.type === "context-menu") && (state.modal ?? true)),
|
| 1137 |
+
openMethod: createSelector((state) => state.openMethod),
|
| 1138 |
+
allowMouseEnter: createSelector((state) => state.allowMouseEnter),
|
| 1139 |
+
stickIfOpen: createSelector((state) => state.stickIfOpen),
|
| 1140 |
+
parent: createSelector((state) => state.parent),
|
| 1141 |
+
rootId: createSelector((state) => {
|
| 1142 |
+
if (state.parent.type === "menu") return state.parent.store.select("rootId");
|
| 1143 |
+
return state.parent.type !== void 0 ? state.parent.context.rootId : state.rootId;
|
| 1144 |
+
}),
|
| 1145 |
+
activeIndex: createSelector((state) => state.activeIndex),
|
| 1146 |
+
isActive: createSelector((state, itemIndex) => state.activeIndex === itemIndex),
|
| 1147 |
+
hoverEnabled: createSelector((state) => state.hoverEnabled),
|
| 1148 |
+
instantType: createSelector((state) => state.instantType),
|
| 1149 |
+
lastOpenChangeReason: createSelector((state) => state.openChangeReason),
|
| 1150 |
+
floatingTreeRoot: createSelector((state) => {
|
| 1151 |
+
if (state.parent.type === "menu") return state.parent.store.select("floatingTreeRoot");
|
| 1152 |
+
return state.floatingTreeRoot;
|
| 1153 |
+
}),
|
| 1154 |
+
floatingNodeId: createSelector((state) => state.floatingNodeId),
|
| 1155 |
+
floatingParentNodeId: createSelector((state) => state.floatingParentNodeId),
|
| 1156 |
+
itemProps: createSelector((state) => state.itemProps),
|
| 1157 |
+
closeDelay: createSelector((state) => state.closeDelay),
|
| 1158 |
+
hasViewport: createSelector((state) => state.hasViewport),
|
| 1159 |
+
keyboardEventRelay: createSelector((state) => {
|
| 1160 |
+
if (state.keyboardEventRelay) return state.keyboardEventRelay;
|
| 1161 |
+
if (state.parent.type === "menu") return state.parent.store.select("keyboardEventRelay");
|
| 1162 |
+
})
|
| 1163 |
+
};
|
| 1164 |
+
var MenuStore = class MenuStore extends ReactStore {
|
| 1165 |
+
constructor(initialState) {
|
| 1166 |
+
super({
|
| 1167 |
+
...createInitialState(),
|
| 1168 |
+
...initialState
|
| 1169 |
+
}, {
|
| 1170 |
+
positionerRef: /* @__PURE__ */ import_react.createRef(),
|
| 1171 |
+
popupRef: /* @__PURE__ */ import_react.createRef(),
|
| 1172 |
+
typingRef: { current: false },
|
| 1173 |
+
itemDomElements: { current: [] },
|
| 1174 |
+
itemLabels: { current: [] },
|
| 1175 |
+
allowMouseUpTriggerRef: { current: false },
|
| 1176 |
+
triggerFocusTargetRef: /* @__PURE__ */ import_react.createRef(),
|
| 1177 |
+
beforeContentFocusGuardRef: /* @__PURE__ */ import_react.createRef(),
|
| 1178 |
+
onOpenChangeComplete: void 0,
|
| 1179 |
+
triggerElements: new PopupTriggerMap()
|
| 1180 |
+
}, selectors);
|
| 1181 |
+
this.unsubscribeParentListener = this.observe("parent", (parent) => {
|
| 1182 |
+
this.unsubscribeParentListener?.();
|
| 1183 |
+
if (parent.type === "menu") {
|
| 1184 |
+
let rootId = parent.store.select("rootId");
|
| 1185 |
+
let floatingTreeRoot = parent.store.select("floatingTreeRoot");
|
| 1186 |
+
let keyboardEventRelay = parent.store.select("keyboardEventRelay");
|
| 1187 |
+
this.unsubscribeParentListener = parent.store.subscribe(() => {
|
| 1188 |
+
const nextRootId = parent.store.select("rootId");
|
| 1189 |
+
const nextFloatingTreeRoot = parent.store.select("floatingTreeRoot");
|
| 1190 |
+
const nextKeyboardEventRelay = parent.store.select("keyboardEventRelay");
|
| 1191 |
+
if (rootId === nextRootId && floatingTreeRoot === nextFloatingTreeRoot && keyboardEventRelay === nextKeyboardEventRelay) return;
|
| 1192 |
+
rootId = nextRootId;
|
| 1193 |
+
floatingTreeRoot = nextFloatingTreeRoot;
|
| 1194 |
+
keyboardEventRelay = nextKeyboardEventRelay;
|
| 1195 |
+
this.notifyAll();
|
| 1196 |
+
});
|
| 1197 |
+
this.context.allowMouseUpTriggerRef = parent.store.context.allowMouseUpTriggerRef;
|
| 1198 |
+
return;
|
| 1199 |
+
}
|
| 1200 |
+
if (parent.type !== void 0) this.context.allowMouseUpTriggerRef = parent.context.allowMouseUpTriggerRef;
|
| 1201 |
+
this.unsubscribeParentListener = null;
|
| 1202 |
+
});
|
| 1203 |
+
}
|
| 1204 |
+
setOpen(open, eventDetails) {
|
| 1205 |
+
this.state.floatingRootContext.context.events.emit("setOpen", {
|
| 1206 |
+
open,
|
| 1207 |
+
eventDetails
|
| 1208 |
+
});
|
| 1209 |
+
}
|
| 1210 |
+
static useStore(externalStore, initialState) {
|
| 1211 |
+
const internalStore = useRefWithInit(() => {
|
| 1212 |
+
return new MenuStore(initialState);
|
| 1213 |
+
}).current;
|
| 1214 |
+
return externalStore ?? internalStore;
|
| 1215 |
+
}
|
| 1216 |
+
unsubscribeParentListener = null;
|
| 1217 |
+
};
|
| 1218 |
+
function createInitialState() {
|
| 1219 |
+
return {
|
| 1220 |
+
...createInitialPopupStoreState(),
|
| 1221 |
+
disabled: false,
|
| 1222 |
+
modal: true,
|
| 1223 |
+
openMethod: null,
|
| 1224 |
+
allowMouseEnter: false,
|
| 1225 |
+
stickIfOpen: true,
|
| 1226 |
+
parent: { type: void 0 },
|
| 1227 |
+
rootId: void 0,
|
| 1228 |
+
activeIndex: null,
|
| 1229 |
+
hoverEnabled: true,
|
| 1230 |
+
instantType: void 0,
|
| 1231 |
+
openChangeReason: null,
|
| 1232 |
+
floatingTreeRoot: new FloatingTreeStore(),
|
| 1233 |
+
floatingNodeId: void 0,
|
| 1234 |
+
floatingParentNodeId: null,
|
| 1235 |
+
itemProps: EMPTY_OBJECT,
|
| 1236 |
+
keyboardEventRelay: void 0,
|
| 1237 |
+
closeDelay: 0,
|
| 1238 |
+
hasViewport: false
|
| 1239 |
+
};
|
| 1240 |
+
}
|
| 1241 |
+
//#endregion
|
| 1242 |
+
//#region ../node_modules/@base-ui/react/esm/menu/submenu-root/MenuSubmenuRootContext.js
|
| 1243 |
+
var MenuSubmenuRootContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 1244 |
+
MenuSubmenuRootContext.displayName = "MenuSubmenuRootContext";
|
| 1245 |
+
function useMenuSubmenuRootContext() {
|
| 1246 |
+
return import_react.useContext(MenuSubmenuRootContext);
|
| 1247 |
+
}
|
| 1248 |
+
//#endregion
|
| 1249 |
+
//#region ../node_modules/@base-ui/react/esm/menu/root/MenuRoot.js
|
| 1250 |
+
/**
|
| 1251 |
+
* Groups all parts of the menu.
|
| 1252 |
+
* Doesn't render its own HTML element.
|
| 1253 |
+
*
|
| 1254 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 1255 |
+
*/
|
| 1256 |
+
var MenuRoot = fastComponent(function MenuRoot(props) {
|
| 1257 |
+
const { children, open: openProp, onOpenChange, onOpenChangeComplete, defaultOpen = false, disabled: disabledProp = false, modal: modalProp, loopFocus = true, orientation = "vertical", actionsRef, closeParentOnEsc = false, handle, triggerId: triggerIdProp, defaultTriggerId: defaultTriggerIdProp = null, highlightItemOnHover = true } = props;
|
| 1258 |
+
const contextMenuContext = useContextMenuRootContext(true);
|
| 1259 |
+
const parentMenuRootContext = useMenuRootContext(true);
|
| 1260 |
+
const menubarContext = useMenubarContext(true);
|
| 1261 |
+
const isSubmenu = useMenuSubmenuRootContext();
|
| 1262 |
+
const parentFromContext = import_react.useMemo(() => {
|
| 1263 |
+
if (isSubmenu && parentMenuRootContext) return {
|
| 1264 |
+
type: "menu",
|
| 1265 |
+
store: parentMenuRootContext.store
|
| 1266 |
+
};
|
| 1267 |
+
if (menubarContext) return {
|
| 1268 |
+
type: "menubar",
|
| 1269 |
+
context: menubarContext
|
| 1270 |
+
};
|
| 1271 |
+
if (contextMenuContext && !parentMenuRootContext) return {
|
| 1272 |
+
type: "context-menu",
|
| 1273 |
+
context: contextMenuContext
|
| 1274 |
+
};
|
| 1275 |
+
return { type: void 0 };
|
| 1276 |
+
}, [
|
| 1277 |
+
contextMenuContext,
|
| 1278 |
+
parentMenuRootContext,
|
| 1279 |
+
menubarContext,
|
| 1280 |
+
isSubmenu
|
| 1281 |
+
]);
|
| 1282 |
+
const store = MenuStore.useStore(handle?.store, {
|
| 1283 |
+
open: defaultOpen,
|
| 1284 |
+
openProp,
|
| 1285 |
+
activeTriggerId: defaultTriggerIdProp,
|
| 1286 |
+
triggerIdProp,
|
| 1287 |
+
parent: parentFromContext
|
| 1288 |
+
});
|
| 1289 |
+
useOnFirstRender(() => {
|
| 1290 |
+
if (openProp === void 0 && store.state.open === false && defaultOpen === true) store.update({
|
| 1291 |
+
open: true,
|
| 1292 |
+
activeTriggerId: defaultTriggerIdProp
|
| 1293 |
+
});
|
| 1294 |
+
});
|
| 1295 |
+
store.useControlledProp("openProp", openProp);
|
| 1296 |
+
store.useControlledProp("triggerIdProp", triggerIdProp);
|
| 1297 |
+
store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
|
| 1298 |
+
const rootId = useId();
|
| 1299 |
+
const floatingId = useId();
|
| 1300 |
+
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
| 1301 |
+
const floatingNodeIdFromContext = useFloatingNodeId(floatingTreeRoot);
|
| 1302 |
+
const floatingParentNodeIdFromContext = useFloatingParentNodeId();
|
| 1303 |
+
const open = store.useState("open");
|
| 1304 |
+
const activeTriggerElement = store.useState("activeTriggerElement");
|
| 1305 |
+
const positionerElement = store.useState("positionerElement");
|
| 1306 |
+
const hoverEnabled = store.useState("hoverEnabled");
|
| 1307 |
+
const disabled = store.useState("disabled");
|
| 1308 |
+
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
|
| 1309 |
+
const parent = store.useState("parent");
|
| 1310 |
+
const activeIndex = store.useState("activeIndex");
|
| 1311 |
+
const payload = store.useState("payload");
|
| 1312 |
+
const floatingParentNodeId = store.useState("floatingParentNodeId");
|
| 1313 |
+
const openEventRef = import_react.useRef(null);
|
| 1314 |
+
const allowOutsidePressDismissalRef = import_react.useRef(parent.type !== "context-menu");
|
| 1315 |
+
const allowOutsidePressDismissalTimeout = useTimeout();
|
| 1316 |
+
const allowTouchToCloseRef = import_react.useRef(true);
|
| 1317 |
+
const allowTouchToCloseTimeout = useTimeout();
|
| 1318 |
+
const nested = floatingParentNodeId != null;
|
| 1319 |
+
if (parent.type !== void 0 && modalProp !== void 0) console.warn("Base UI: The `modal` prop is not supported on nested menus. It will be ignored.");
|
| 1320 |
+
const { openMethod, triggerProps: interactionTypeProps } = useOpenInteractionType(open);
|
| 1321 |
+
store.useSyncedValues({
|
| 1322 |
+
disabled: disabledProp,
|
| 1323 |
+
modal: parent.type === void 0 ? modalProp : void 0,
|
| 1324 |
+
openMethod,
|
| 1325 |
+
rootId
|
| 1326 |
+
});
|
| 1327 |
+
useImplicitActiveTrigger(store);
|
| 1328 |
+
const { forceUnmount } = useOpenStateTransitions(open, store, () => {
|
| 1329 |
+
store.update({
|
| 1330 |
+
allowMouseEnter: false,
|
| 1331 |
+
stickIfOpen: true
|
| 1332 |
+
});
|
| 1333 |
+
});
|
| 1334 |
+
useIsoLayoutEffect(() => {
|
| 1335 |
+
if (contextMenuContext && !parentMenuRootContext) store.update({
|
| 1336 |
+
parent: {
|
| 1337 |
+
type: "context-menu",
|
| 1338 |
+
context: contextMenuContext
|
| 1339 |
+
},
|
| 1340 |
+
floatingNodeId: floatingNodeIdFromContext,
|
| 1341 |
+
floatingParentNodeId: floatingParentNodeIdFromContext
|
| 1342 |
+
});
|
| 1343 |
+
else if (parentMenuRootContext) store.update({
|
| 1344 |
+
floatingNodeId: floatingNodeIdFromContext,
|
| 1345 |
+
floatingParentNodeId: floatingParentNodeIdFromContext
|
| 1346 |
+
});
|
| 1347 |
+
}, [
|
| 1348 |
+
contextMenuContext,
|
| 1349 |
+
parentMenuRootContext,
|
| 1350 |
+
floatingNodeIdFromContext,
|
| 1351 |
+
floatingParentNodeIdFromContext,
|
| 1352 |
+
store
|
| 1353 |
+
]);
|
| 1354 |
+
import_react.useEffect(() => {
|
| 1355 |
+
if (!open) openEventRef.current = null;
|
| 1356 |
+
if (parent.type !== "context-menu") return;
|
| 1357 |
+
if (!open) {
|
| 1358 |
+
allowOutsidePressDismissalTimeout.clear();
|
| 1359 |
+
allowOutsidePressDismissalRef.current = false;
|
| 1360 |
+
return;
|
| 1361 |
+
}
|
| 1362 |
+
allowOutsidePressDismissalTimeout.start(500, () => {
|
| 1363 |
+
allowOutsidePressDismissalRef.current = true;
|
| 1364 |
+
});
|
| 1365 |
+
}, [
|
| 1366 |
+
allowOutsidePressDismissalTimeout,
|
| 1367 |
+
open,
|
| 1368 |
+
parent.type
|
| 1369 |
+
]);
|
| 1370 |
+
useIsoLayoutEffect(() => {
|
| 1371 |
+
if (!open && !hoverEnabled) store.set("hoverEnabled", true);
|
| 1372 |
+
}, [
|
| 1373 |
+
open,
|
| 1374 |
+
hoverEnabled,
|
| 1375 |
+
store
|
| 1376 |
+
]);
|
| 1377 |
+
const setOpen = useStableCallback((nextOpen, eventDetails) => {
|
| 1378 |
+
const reason = eventDetails.reason;
|
| 1379 |
+
if (open === nextOpen && eventDetails.trigger === activeTriggerElement && lastOpenChangeReason === reason) return;
|
| 1380 |
+
eventDetails.preventUnmountOnClose = () => {
|
| 1381 |
+
store.set("preventUnmountingOnClose", true);
|
| 1382 |
+
};
|
| 1383 |
+
if (!nextOpen && eventDetails.trigger == null) eventDetails.trigger = activeTriggerElement ?? void 0;
|
| 1384 |
+
onOpenChange?.(nextOpen, eventDetails);
|
| 1385 |
+
if (eventDetails.isCanceled) return;
|
| 1386 |
+
store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
|
| 1387 |
+
const nativeEvent = eventDetails.event;
|
| 1388 |
+
if (nextOpen === false && nativeEvent?.type === "click" && nativeEvent.pointerType === "touch" && !allowTouchToCloseRef.current) return;
|
| 1389 |
+
if (!nextOpen && activeIndex !== null) {
|
| 1390 |
+
const activeOption = store.context.itemDomElements.current[activeIndex];
|
| 1391 |
+
queueMicrotask(() => {
|
| 1392 |
+
activeOption?.setAttribute("tabindex", "-1");
|
| 1393 |
+
});
|
| 1394 |
+
}
|
| 1395 |
+
if (nextOpen && reason === "trigger-focus") {
|
| 1396 |
+
allowTouchToCloseRef.current = false;
|
| 1397 |
+
allowTouchToCloseTimeout.start(300, () => {
|
| 1398 |
+
allowTouchToCloseRef.current = true;
|
| 1399 |
+
});
|
| 1400 |
+
} else {
|
| 1401 |
+
allowTouchToCloseRef.current = true;
|
| 1402 |
+
allowTouchToCloseTimeout.clear();
|
| 1403 |
+
}
|
| 1404 |
+
const isKeyboardClick = (reason === "trigger-press" || reason === "item-press") && nativeEvent.detail === 0 && nativeEvent?.isTrusted;
|
| 1405 |
+
const isDismissClose = !nextOpen && (reason === "escape-key" || reason == null);
|
| 1406 |
+
const updatedState = {
|
| 1407 |
+
open: nextOpen,
|
| 1408 |
+
openChangeReason: reason
|
| 1409 |
+
};
|
| 1410 |
+
openEventRef.current = eventDetails.event ?? null;
|
| 1411 |
+
const newTriggerId = eventDetails.trigger?.id ?? null;
|
| 1412 |
+
if (newTriggerId || nextOpen) {
|
| 1413 |
+
updatedState.activeTriggerId = newTriggerId;
|
| 1414 |
+
updatedState.activeTriggerElement = eventDetails.trigger ?? null;
|
| 1415 |
+
}
|
| 1416 |
+
store.update(updatedState);
|
| 1417 |
+
if (parent.type === "menubar" && (reason === "trigger-focus" || reason === "focus-out" || reason === "trigger-hover" || reason === "list-navigation" || reason === "sibling-open")) store.set("instantType", "group");
|
| 1418 |
+
else if (isKeyboardClick || isDismissClose) store.set("instantType", isKeyboardClick ? "click" : "dismiss");
|
| 1419 |
+
else store.set("instantType", void 0);
|
| 1420 |
+
});
|
| 1421 |
+
const floatingRootContext = useSyncedFloatingRootContext({
|
| 1422 |
+
popupStore: store,
|
| 1423 |
+
floatingId,
|
| 1424 |
+
nested: floatingParentNodeIdFromContext != null,
|
| 1425 |
+
onOpenChange: setOpen
|
| 1426 |
+
});
|
| 1427 |
+
const floatingEvents = floatingRootContext.context.events;
|
| 1428 |
+
import_react.useEffect(() => {
|
| 1429 |
+
const handleSetOpenEvent = ({ open: nextOpen, eventDetails }) => setOpen(nextOpen, eventDetails);
|
| 1430 |
+
floatingEvents.on("setOpen", handleSetOpenEvent);
|
| 1431 |
+
return () => {
|
| 1432 |
+
floatingEvents?.off("setOpen", handleSetOpenEvent);
|
| 1433 |
+
};
|
| 1434 |
+
}, [floatingEvents, setOpen]);
|
| 1435 |
+
const handleImperativeClose = import_react.useCallback(() => {
|
| 1436 |
+
store.setOpen(false, createChangeEventDetails(imperativeAction));
|
| 1437 |
+
}, [store]);
|
| 1438 |
+
import_react.useImperativeHandle(actionsRef, () => ({
|
| 1439 |
+
unmount: forceUnmount,
|
| 1440 |
+
close: handleImperativeClose
|
| 1441 |
+
}), [forceUnmount, handleImperativeClose]);
|
| 1442 |
+
let ctx;
|
| 1443 |
+
if (parent.type === "context-menu") ctx = parent.context;
|
| 1444 |
+
import_react.useImperativeHandle(ctx?.positionerRef, () => positionerElement, [positionerElement]);
|
| 1445 |
+
import_react.useImperativeHandle(ctx?.actionsRef, () => ({ setOpen }), [setOpen]);
|
| 1446 |
+
const dismiss = useDismiss(floatingRootContext, {
|
| 1447 |
+
enabled: !disabled,
|
| 1448 |
+
bubbles: { escapeKey: closeParentOnEsc && parent.type === "menu" },
|
| 1449 |
+
outsidePress() {
|
| 1450 |
+
if (parent.type !== "context-menu" || openEventRef.current?.type === "contextmenu") return true;
|
| 1451 |
+
return allowOutsidePressDismissalRef.current;
|
| 1452 |
+
},
|
| 1453 |
+
externalTree: nested ? floatingTreeRoot : void 0
|
| 1454 |
+
});
|
| 1455 |
+
const direction = useDirection();
|
| 1456 |
+
const setActiveIndex = import_react.useCallback((index) => {
|
| 1457 |
+
if (store.select("activeIndex") === index) return;
|
| 1458 |
+
store.set("activeIndex", index);
|
| 1459 |
+
}, [store]);
|
| 1460 |
+
const listNavigation$1 = useListNavigation(floatingRootContext, {
|
| 1461 |
+
enabled: !disabled,
|
| 1462 |
+
listRef: store.context.itemDomElements,
|
| 1463 |
+
activeIndex,
|
| 1464 |
+
nested: parent.type !== void 0,
|
| 1465 |
+
loopFocus,
|
| 1466 |
+
orientation,
|
| 1467 |
+
parentOrientation: parent.type === "menubar" ? parent.context.orientation : void 0,
|
| 1468 |
+
rtl: direction === "rtl",
|
| 1469 |
+
disabledIndices: EMPTY_ARRAY,
|
| 1470 |
+
onNavigate: setActiveIndex,
|
| 1471 |
+
openOnArrowKeyDown: parent.type !== "context-menu",
|
| 1472 |
+
externalTree: nested ? floatingTreeRoot : void 0,
|
| 1473 |
+
focusItemOnHover: highlightItemOnHover
|
| 1474 |
+
});
|
| 1475 |
+
const onTyping = import_react.useCallback((nextTyping) => {
|
| 1476 |
+
store.context.typingRef.current = nextTyping;
|
| 1477 |
+
}, [store]);
|
| 1478 |
+
const typeahead = useTypeahead(floatingRootContext, {
|
| 1479 |
+
listRef: store.context.itemLabels,
|
| 1480 |
+
elementsRef: store.context.itemDomElements,
|
| 1481 |
+
activeIndex,
|
| 1482 |
+
resetMs: 500,
|
| 1483 |
+
onMatch: (index) => {
|
| 1484 |
+
if (open && index !== activeIndex) store.set("activeIndex", index);
|
| 1485 |
+
},
|
| 1486 |
+
onTyping
|
| 1487 |
+
});
|
| 1488 |
+
usePopupInteractionProps(store, {
|
| 1489 |
+
floatingRootContext,
|
| 1490 |
+
activeTriggerProps: import_react.useMemo(() => {
|
| 1491 |
+
const mergedProps = mergeProps(typeahead.reference, listNavigation$1.reference, dismiss.reference, { onMouseMove() {
|
| 1492 |
+
store.set("allowMouseEnter", true);
|
| 1493 |
+
} }, interactionTypeProps);
|
| 1494 |
+
mergedProps["aria-haspopup"] = "menu";
|
| 1495 |
+
mergedProps["aria-expanded"] = open;
|
| 1496 |
+
return mergedProps;
|
| 1497 |
+
}, [
|
| 1498 |
+
store,
|
| 1499 |
+
typeahead.reference,
|
| 1500 |
+
listNavigation$1.reference,
|
| 1501 |
+
dismiss.reference,
|
| 1502 |
+
interactionTypeProps,
|
| 1503 |
+
open
|
| 1504 |
+
]),
|
| 1505 |
+
inactiveTriggerProps: import_react.useMemo(() => {
|
| 1506 |
+
const mergedProps = mergeProps(listNavigation$1.trigger, dismiss.trigger, interactionTypeProps);
|
| 1507 |
+
mergedProps["aria-haspopup"] = "menu";
|
| 1508 |
+
mergedProps["aria-expanded"] = false;
|
| 1509 |
+
return mergedProps;
|
| 1510 |
+
}, [
|
| 1511 |
+
listNavigation$1.trigger,
|
| 1512 |
+
dismiss.trigger,
|
| 1513 |
+
interactionTypeProps
|
| 1514 |
+
]),
|
| 1515 |
+
popupProps: import_react.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, {
|
| 1516 |
+
id: floatingId,
|
| 1517 |
+
role: "menu",
|
| 1518 |
+
"aria-labelledby": activeTriggerElement?.id,
|
| 1519 |
+
onMouseMove() {
|
| 1520 |
+
store.set("allowMouseEnter", true);
|
| 1521 |
+
if (parent.type === "menu") store.set("hoverEnabled", false);
|
| 1522 |
+
},
|
| 1523 |
+
onClick() {
|
| 1524 |
+
if (store.select("hoverEnabled")) store.set("hoverEnabled", false);
|
| 1525 |
+
},
|
| 1526 |
+
onKeyDown(event) {
|
| 1527 |
+
const relay = store.select("keyboardEventRelay");
|
| 1528 |
+
if (relay && !event.isPropagationStopped()) relay(event);
|
| 1529 |
+
}
|
| 1530 |
+
}, typeahead.floating, listNavigation$1.floating, dismiss.floating), [
|
| 1531 |
+
activeTriggerElement,
|
| 1532 |
+
floatingId,
|
| 1533 |
+
parent.type,
|
| 1534 |
+
store,
|
| 1535 |
+
typeahead.floating,
|
| 1536 |
+
listNavigation$1.floating,
|
| 1537 |
+
dismiss.floating
|
| 1538 |
+
]),
|
| 1539 |
+
itemProps: listNavigation$1.item ?? EMPTY_OBJECT
|
| 1540 |
+
});
|
| 1541 |
+
const context = import_react.useMemo(() => ({
|
| 1542 |
+
store,
|
| 1543 |
+
parent: parentFromContext
|
| 1544 |
+
}), [store, parentFromContext]);
|
| 1545 |
+
const content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuRootContext.Provider, {
|
| 1546 |
+
value: context,
|
| 1547 |
+
children: typeof children === "function" ? children({ payload }) : children
|
| 1548 |
+
});
|
| 1549 |
+
if (parent.type === void 0 || parent.type === "context-menu") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingTree, {
|
| 1550 |
+
externalTree: floatingTreeRoot,
|
| 1551 |
+
children: content
|
| 1552 |
+
});
|
| 1553 |
+
return content;
|
| 1554 |
+
});
|
| 1555 |
+
MenuRoot.displayName = "MenuRoot";
|
| 1556 |
+
//#endregion
|
| 1557 |
+
//#region ../node_modules/@base-ui/react/esm/menu/submenu-root/MenuSubmenuRoot.js
|
| 1558 |
+
/**
|
| 1559 |
+
* Groups all parts of a submenu.
|
| 1560 |
+
* Doesn't render its own HTML element.
|
| 1561 |
+
*
|
| 1562 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 1563 |
+
*/
|
| 1564 |
+
function MenuSubmenuRoot(props) {
|
| 1565 |
+
const parentMenu = useMenuRootContext().store;
|
| 1566 |
+
const contextValue = import_react.useMemo(() => ({ parentMenu }), [parentMenu]);
|
| 1567 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuSubmenuRootContext.Provider, {
|
| 1568 |
+
value: contextValue,
|
| 1569 |
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuRoot, { ...props })
|
| 1570 |
+
});
|
| 1571 |
+
}
|
| 1572 |
+
//#endregion
|
| 1573 |
+
//#region ../node_modules/@base-ui/react/esm/internals/composite/item/useCompositeItem.js
|
| 1574 |
+
function useCompositeItem(params = {}) {
|
| 1575 |
+
const { highlightItemOnHover, highlightedIndex, onHighlightedIndexChange } = useCompositeRootContext();
|
| 1576 |
+
const { ref, index } = useCompositeListItem(params);
|
| 1577 |
+
const isHighlighted = highlightedIndex === index;
|
| 1578 |
+
const itemRef = import_react.useRef(null);
|
| 1579 |
+
const mergedRef = useMergedRefs(ref, itemRef);
|
| 1580 |
+
return {
|
| 1581 |
+
compositeProps: import_react.useMemo(() => ({
|
| 1582 |
+
tabIndex: isHighlighted ? 0 : -1,
|
| 1583 |
+
onFocus() {
|
| 1584 |
+
onHighlightedIndexChange(index);
|
| 1585 |
+
},
|
| 1586 |
+
onMouseMove() {
|
| 1587 |
+
const item = itemRef.current;
|
| 1588 |
+
if (!highlightItemOnHover || !item) return;
|
| 1589 |
+
const disabled = item.hasAttribute("disabled") || item.ariaDisabled === "true";
|
| 1590 |
+
if (!isHighlighted && !disabled) item.focus();
|
| 1591 |
+
}
|
| 1592 |
+
}), [
|
| 1593 |
+
isHighlighted,
|
| 1594 |
+
onHighlightedIndexChange,
|
| 1595 |
+
index,
|
| 1596 |
+
highlightItemOnHover
|
| 1597 |
+
]),
|
| 1598 |
+
compositeRef: mergedRef,
|
| 1599 |
+
index
|
| 1600 |
+
};
|
| 1601 |
+
}
|
| 1602 |
+
//#endregion
|
| 1603 |
+
//#region ../node_modules/@base-ui/react/esm/internals/composite/item/CompositeItem.js
|
| 1604 |
+
/**
|
| 1605 |
+
* @internal
|
| 1606 |
+
*/
|
| 1607 |
+
function CompositeItem(componentProps) {
|
| 1608 |
+
const { render, className, style, state = EMPTY_OBJECT, props = EMPTY_ARRAY, refs = EMPTY_ARRAY, metadata, stateAttributesMapping, tag = "div", ...elementProps } = componentProps;
|
| 1609 |
+
const { compositeProps, compositeRef } = useCompositeItem({ metadata });
|
| 1610 |
+
return useRenderElement(tag, componentProps, {
|
| 1611 |
+
state,
|
| 1612 |
+
ref: [...refs, compositeRef],
|
| 1613 |
+
props: [
|
| 1614 |
+
compositeProps,
|
| 1615 |
+
...props,
|
| 1616 |
+
elementProps
|
| 1617 |
+
],
|
| 1618 |
+
stateAttributesMapping
|
| 1619 |
+
});
|
| 1620 |
+
}
|
| 1621 |
+
//#endregion
|
| 1622 |
+
//#region ../node_modules/@base-ui/react/esm/menu/utils/findRootOwnerId.js
|
| 1623 |
+
function findRootOwnerId(node) {
|
| 1624 |
+
if (isHTMLElement(node) && node.hasAttribute("data-rootownerid")) return node.getAttribute("data-rootownerid") ?? void 0;
|
| 1625 |
+
if (isLastTraversableNode(node)) return;
|
| 1626 |
+
return findRootOwnerId(getParentNode(node));
|
| 1627 |
+
}
|
| 1628 |
+
//#endregion
|
| 1629 |
+
//#region ../node_modules/@base-ui/react/esm/utils/useMixedToggleClickHandler.js
|
| 1630 |
+
/**
|
| 1631 |
+
* Returns `click` and `mousedown` handlers that fix the behavior of triggers of popups that are toggled by different events.
|
| 1632 |
+
* For example, a button that opens a popup on mousedown and closes it on click.
|
| 1633 |
+
* This hook prevents the popup from closing immediately after the mouse button is released.
|
| 1634 |
+
*/
|
| 1635 |
+
function useMixedToggleClickHandler(params) {
|
| 1636 |
+
const { enabled = true, mouseDownAction, open } = params;
|
| 1637 |
+
const ignoreClickRef = import_react.useRef(false);
|
| 1638 |
+
return import_react.useMemo(() => {
|
| 1639 |
+
if (!enabled) return EMPTY_OBJECT;
|
| 1640 |
+
return {
|
| 1641 |
+
onMouseDown: (event) => {
|
| 1642 |
+
if (mouseDownAction === "open" && !open || mouseDownAction === "close" && open) {
|
| 1643 |
+
ignoreClickRef.current = true;
|
| 1644 |
+
ownerDocument(event.currentTarget).addEventListener("click", () => {
|
| 1645 |
+
ignoreClickRef.current = false;
|
| 1646 |
+
}, { once: true });
|
| 1647 |
+
}
|
| 1648 |
+
},
|
| 1649 |
+
onClick: (event) => {
|
| 1650 |
+
if (ignoreClickRef.current) {
|
| 1651 |
+
ignoreClickRef.current = false;
|
| 1652 |
+
event.preventBaseUIHandler();
|
| 1653 |
+
}
|
| 1654 |
+
}
|
| 1655 |
+
};
|
| 1656 |
+
}, [
|
| 1657 |
+
enabled,
|
| 1658 |
+
mouseDownAction,
|
| 1659 |
+
open
|
| 1660 |
+
]);
|
| 1661 |
+
}
|
| 1662 |
+
//#endregion
|
| 1663 |
+
//#region ../node_modules/@base-ui/react/esm/menu/trigger/MenuTrigger.js
|
| 1664 |
+
var BOUNDARY_OFFSET = 2;
|
| 1665 |
+
/**
|
| 1666 |
+
* A button that opens the menu.
|
| 1667 |
+
* Renders a `<button>` element.
|
| 1668 |
+
*
|
| 1669 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 1670 |
+
*/
|
| 1671 |
+
var MenuTrigger = fastComponentRef(function MenuTrigger(componentProps, forwardedRef) {
|
| 1672 |
+
const { render, className, style, disabled: disabledProp = false, nativeButton = true, id: idProp, openOnHover: openOnHoverProp, delay = 100, closeDelay = 0, handle, payload, ...elementProps } = componentProps;
|
| 1673 |
+
const rootContext = useMenuRootContext(true);
|
| 1674 |
+
const store = handle?.store ?? rootContext?.store;
|
| 1675 |
+
if (!store) throw new Error("Base UI: <Menu.Trigger> must be either used within a <Menu.Root> component or provided with a handle.");
|
| 1676 |
+
const thisTriggerId = useBaseUiId(idProp);
|
| 1677 |
+
const isTriggerActive = store.useState("isTriggerActive", thisTriggerId);
|
| 1678 |
+
const floatingRootContext = store.useState("floatingRootContext");
|
| 1679 |
+
const isOpenedByThisTrigger = store.useState("isOpenedByTrigger", thisTriggerId);
|
| 1680 |
+
const popupId = store.useState("triggerPopupId", thisTriggerId);
|
| 1681 |
+
const triggerElementRef = import_react.useRef(null);
|
| 1682 |
+
const parent = useMenuParent();
|
| 1683 |
+
const compositeRootContext = useCompositeRootContext(true);
|
| 1684 |
+
const floatingTreeRootFromContext = useFloatingTree();
|
| 1685 |
+
const floatingTreeRoot = import_react.useMemo(() => {
|
| 1686 |
+
return floatingTreeRootFromContext ?? new FloatingTreeStore();
|
| 1687 |
+
}, [floatingTreeRootFromContext]);
|
| 1688 |
+
const { registerTrigger, isMountedByThisTrigger } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {
|
| 1689 |
+
payload,
|
| 1690 |
+
closeDelay,
|
| 1691 |
+
parent,
|
| 1692 |
+
floatingTreeRoot,
|
| 1693 |
+
floatingNodeId: useFloatingNodeId(floatingTreeRoot),
|
| 1694 |
+
floatingParentNodeId: useFloatingParentNodeId(),
|
| 1695 |
+
keyboardEventRelay: compositeRootContext?.relayKeyboardEvent
|
| 1696 |
+
});
|
| 1697 |
+
const isInMenubar = parent.type === "menubar";
|
| 1698 |
+
const rootDisabled = store.useState("disabled");
|
| 1699 |
+
const disabled = disabledProp || rootDisabled || isInMenubar && parent.context.disabled;
|
| 1700 |
+
const { getButtonProps, buttonRef } = useButton({
|
| 1701 |
+
disabled,
|
| 1702 |
+
native: nativeButton
|
| 1703 |
+
});
|
| 1704 |
+
import_react.useEffect(() => {
|
| 1705 |
+
if (!isOpenedByThisTrigger && parent.type === void 0) store.context.allowMouseUpTriggerRef.current = false;
|
| 1706 |
+
}, [
|
| 1707 |
+
store,
|
| 1708 |
+
isOpenedByThisTrigger,
|
| 1709 |
+
parent.type
|
| 1710 |
+
]);
|
| 1711 |
+
const triggerRef = import_react.useRef(null);
|
| 1712 |
+
const allowMouseUpTriggerTimeout = useTimeout();
|
| 1713 |
+
const handleDocumentMouseUp = useStableCallback((mouseEvent) => {
|
| 1714 |
+
if (!triggerRef.current) return;
|
| 1715 |
+
allowMouseUpTriggerTimeout.clear();
|
| 1716 |
+
store.context.allowMouseUpTriggerRef.current = false;
|
| 1717 |
+
const mouseUpTarget = mouseEvent.target;
|
| 1718 |
+
if (contains(triggerRef.current, mouseUpTarget) || contains(store.select("positionerElement"), mouseUpTarget) || mouseUpTarget === triggerRef.current) return;
|
| 1719 |
+
if (mouseUpTarget != null && findRootOwnerId(mouseUpTarget) === store.select("rootId")) return;
|
| 1720 |
+
const bounds = getPseudoElementBounds(triggerRef.current);
|
| 1721 |
+
if (mouseEvent.clientX >= bounds.left - BOUNDARY_OFFSET && mouseEvent.clientX <= bounds.right + BOUNDARY_OFFSET && mouseEvent.clientY >= bounds.top - BOUNDARY_OFFSET && mouseEvent.clientY <= bounds.bottom + BOUNDARY_OFFSET) return;
|
| 1722 |
+
floatingTreeRoot.events.emit("close", {
|
| 1723 |
+
domEvent: mouseEvent,
|
| 1724 |
+
reason: cancelOpen
|
| 1725 |
+
});
|
| 1726 |
+
});
|
| 1727 |
+
import_react.useEffect(() => {
|
| 1728 |
+
if (isOpenedByThisTrigger && store.select("lastOpenChangeReason") === "trigger-hover") ownerDocument(triggerRef.current).addEventListener("mouseup", handleDocumentMouseUp, { once: true });
|
| 1729 |
+
}, [
|
| 1730 |
+
isOpenedByThisTrigger,
|
| 1731 |
+
handleDocumentMouseUp,
|
| 1732 |
+
store
|
| 1733 |
+
]);
|
| 1734 |
+
const parentMenubarHasSubmenuOpen = isInMenubar && parent.context.hasSubmenuOpen;
|
| 1735 |
+
const hoverProps = useHoverReferenceInteraction(floatingRootContext, {
|
| 1736 |
+
enabled: (openOnHoverProp ?? parentMenubarHasSubmenuOpen) && !disabled && parent.type !== "context-menu" && (!isInMenubar || parentMenubarHasSubmenuOpen && !isMountedByThisTrigger),
|
| 1737 |
+
handleClose: safePolygon({ blockPointerEvents: !isInMenubar }),
|
| 1738 |
+
mouseOnly: true,
|
| 1739 |
+
move: false,
|
| 1740 |
+
restMs: parent.type === void 0 ? delay : void 0,
|
| 1741 |
+
delay: { close: closeDelay },
|
| 1742 |
+
triggerElementRef,
|
| 1743 |
+
externalTree: floatingTreeRoot,
|
| 1744 |
+
isActiveTrigger: isTriggerActive,
|
| 1745 |
+
isClosing: () => store.select("transitionStatus") === "ending"
|
| 1746 |
+
});
|
| 1747 |
+
const stickIfOpen = useStickIfOpen(isOpenedByThisTrigger, store.select("lastOpenChangeReason"));
|
| 1748 |
+
const click = useClick(floatingRootContext, {
|
| 1749 |
+
enabled: !disabled && parent.type !== "context-menu",
|
| 1750 |
+
event: isOpenedByThisTrigger && isInMenubar ? "click" : "mousedown",
|
| 1751 |
+
toggle: true,
|
| 1752 |
+
ignoreMouse: false,
|
| 1753 |
+
stickIfOpen: parent.type === void 0 ? stickIfOpen : false
|
| 1754 |
+
});
|
| 1755 |
+
const focus = useFocus(floatingRootContext, { enabled: !disabled && parentMenubarHasSubmenuOpen });
|
| 1756 |
+
const mixedToggleHandlers = useMixedToggleClickHandler({
|
| 1757 |
+
open: isOpenedByThisTrigger,
|
| 1758 |
+
enabled: isInMenubar,
|
| 1759 |
+
mouseDownAction: "open"
|
| 1760 |
+
});
|
| 1761 |
+
const localInteractionProps = import_react.useMemo(() => mergeProps(focus.reference, click.reference), [focus.reference, click.reference]);
|
| 1762 |
+
const rootTriggerProps = store.useState("triggerProps", isMountedByThisTrigger);
|
| 1763 |
+
const { preFocusGuardRef, handlePreFocusGuardFocus, handleFocusTargetFocus } = useTriggerFocusGuards(store, triggerElementRef);
|
| 1764 |
+
const state = {
|
| 1765 |
+
disabled,
|
| 1766 |
+
open: isOpenedByThisTrigger
|
| 1767 |
+
};
|
| 1768 |
+
const ref = [
|
| 1769 |
+
triggerRef,
|
| 1770 |
+
forwardedRef,
|
| 1771 |
+
buttonRef,
|
| 1772 |
+
registerTrigger,
|
| 1773 |
+
triggerElementRef
|
| 1774 |
+
];
|
| 1775 |
+
const props = [
|
| 1776 |
+
localInteractionProps,
|
| 1777 |
+
hoverProps ?? EMPTY_OBJECT,
|
| 1778 |
+
rootTriggerProps,
|
| 1779 |
+
{
|
| 1780 |
+
"aria-haspopup": "menu",
|
| 1781 |
+
"aria-controls": popupId,
|
| 1782 |
+
id: thisTriggerId,
|
| 1783 |
+
onMouseDown: (event) => {
|
| 1784 |
+
if (store.select("open")) return;
|
| 1785 |
+
allowMouseUpTriggerTimeout.start(200, () => {
|
| 1786 |
+
store.context.allowMouseUpTriggerRef.current = true;
|
| 1787 |
+
});
|
| 1788 |
+
ownerDocument(event.currentTarget).addEventListener("mouseup", handleDocumentMouseUp, { once: true });
|
| 1789 |
+
}
|
| 1790 |
+
},
|
| 1791 |
+
isInMenubar ? { role: "menuitem" } : {},
|
| 1792 |
+
mixedToggleHandlers,
|
| 1793 |
+
elementProps,
|
| 1794 |
+
getButtonProps
|
| 1795 |
+
];
|
| 1796 |
+
const element = useRenderElement("button", componentProps, {
|
| 1797 |
+
enabled: !isInMenubar,
|
| 1798 |
+
stateAttributesMapping: pressableTriggerOpenStateMapping,
|
| 1799 |
+
state,
|
| 1800 |
+
ref,
|
| 1801 |
+
props
|
| 1802 |
+
});
|
| 1803 |
+
if (isInMenubar) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompositeItem, {
|
| 1804 |
+
tag: "button",
|
| 1805 |
+
render,
|
| 1806 |
+
className,
|
| 1807 |
+
style,
|
| 1808 |
+
state,
|
| 1809 |
+
refs: ref,
|
| 1810 |
+
props,
|
| 1811 |
+
stateAttributesMapping: pressableTriggerOpenStateMapping
|
| 1812 |
+
});
|
| 1813 |
+
if (isOpenedByThisTrigger) return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
|
| 1814 |
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusGuard, {
|
| 1815 |
+
ref: preFocusGuardRef,
|
| 1816 |
+
onFocus: handlePreFocusGuardFocus
|
| 1817 |
+
}, `${thisTriggerId}-pre-focus-guard`),
|
| 1818 |
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: element }, thisTriggerId),
|
| 1819 |
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusGuard, {
|
| 1820 |
+
ref: store.context.triggerFocusTargetRef,
|
| 1821 |
+
onFocus: handleFocusTargetFocus
|
| 1822 |
+
}, `${thisTriggerId}-post-focus-guard`)
|
| 1823 |
+
] });
|
| 1824 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: element }, thisTriggerId);
|
| 1825 |
+
});
|
| 1826 |
+
MenuTrigger.displayName = "MenuTrigger";
|
| 1827 |
+
/**
|
| 1828 |
+
* Determines whether to ignore clicks after a hover-open.
|
| 1829 |
+
*/
|
| 1830 |
+
function useStickIfOpen(open, openReason) {
|
| 1831 |
+
const stickIfOpenTimeout = useTimeout();
|
| 1832 |
+
const [stickIfOpen, setStickIfOpen] = import_react.useState(false);
|
| 1833 |
+
useIsoLayoutEffect(() => {
|
| 1834 |
+
if (open && openReason === "trigger-hover") {
|
| 1835 |
+
setStickIfOpen(true);
|
| 1836 |
+
stickIfOpenTimeout.start(500, () => {
|
| 1837 |
+
setStickIfOpen(false);
|
| 1838 |
+
});
|
| 1839 |
+
} else if (!open) {
|
| 1840 |
+
stickIfOpenTimeout.clear();
|
| 1841 |
+
setStickIfOpen(false);
|
| 1842 |
+
}
|
| 1843 |
+
}, [
|
| 1844 |
+
open,
|
| 1845 |
+
openReason,
|
| 1846 |
+
stickIfOpenTimeout
|
| 1847 |
+
]);
|
| 1848 |
+
return stickIfOpen;
|
| 1849 |
+
}
|
| 1850 |
+
function useMenuParent() {
|
| 1851 |
+
const contextMenuContext = useContextMenuRootContext(true);
|
| 1852 |
+
const parentContext = useMenuRootContext(true);
|
| 1853 |
+
const menubarContext = useMenubarContext(true);
|
| 1854 |
+
return import_react.useMemo(() => {
|
| 1855 |
+
if (menubarContext) return {
|
| 1856 |
+
type: "menubar",
|
| 1857 |
+
context: menubarContext
|
| 1858 |
+
};
|
| 1859 |
+
if (contextMenuContext && !parentContext) return {
|
| 1860 |
+
type: "context-menu",
|
| 1861 |
+
context: contextMenuContext
|
| 1862 |
+
};
|
| 1863 |
+
return { type: void 0 };
|
| 1864 |
+
}, [
|
| 1865 |
+
contextMenuContext,
|
| 1866 |
+
parentContext,
|
| 1867 |
+
menubarContext
|
| 1868 |
+
]);
|
| 1869 |
+
}
|
| 1870 |
+
//#endregion
|
| 1871 |
+
//#region ../node_modules/@base-ui/react/esm/menu/viewport/MenuViewportCssVars.js
|
| 1872 |
+
var MenuViewportCssVars = /* @__PURE__ */ function(MenuViewportCssVars) {
|
| 1873 |
+
/**
|
| 1874 |
+
* The width of the parent popup.
|
| 1875 |
+
* This variable is placed on the 'previous' container and stores the width of the popup when the previous content was rendered.
|
| 1876 |
+
* It can be used to freeze the dimensions of the popup when animating between different content.
|
| 1877 |
+
*/
|
| 1878 |
+
MenuViewportCssVars["popupWidth"] = "--popup-width";
|
| 1879 |
+
/**
|
| 1880 |
+
* The height of the parent popup.
|
| 1881 |
+
* This variable is placed on the 'previous' container and stores the height of the popup when the previous content was rendered.
|
| 1882 |
+
* It can be used to freeze the dimensions of the popup when animating between different content.
|
| 1883 |
+
*/
|
| 1884 |
+
MenuViewportCssVars["popupHeight"] = "--popup-height";
|
| 1885 |
+
return MenuViewportCssVars;
|
| 1886 |
+
}({});
|
| 1887 |
+
//#endregion
|
| 1888 |
+
//#region ../node_modules/@base-ui/react/esm/menu/viewport/MenuViewport.js
|
| 1889 |
+
var stateAttributesMapping = { activationDirection: (value) => value ? { "data-activation-direction": value } : null };
|
| 1890 |
+
/**
|
| 1891 |
+
* A viewport for displaying content transitions.
|
| 1892 |
+
* This component is only required if one popup can be opened by multiple triggers, its content
|
| 1893 |
+
* changes based on the trigger, and switching between them is animated.
|
| 1894 |
+
* Renders a `<div>` element.
|
| 1895 |
+
*
|
| 1896 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 1897 |
+
*/
|
| 1898 |
+
var MenuViewport = /* @__PURE__ */ import_react.forwardRef(function MenuViewport(componentProps, forwardedRef) {
|
| 1899 |
+
const { render, className, style, children, ...elementProps } = componentProps;
|
| 1900 |
+
const { store } = useMenuRootContext();
|
| 1901 |
+
const { side } = useMenuPositionerContext();
|
| 1902 |
+
const instantType = store.useState("instantType");
|
| 1903 |
+
const { children: childrenToRender, state: viewportState } = usePopupViewport({
|
| 1904 |
+
store,
|
| 1905 |
+
side,
|
| 1906 |
+
cssVars: MenuViewportCssVars,
|
| 1907 |
+
children
|
| 1908 |
+
});
|
| 1909 |
+
return useRenderElement("div", componentProps, {
|
| 1910 |
+
state: {
|
| 1911 |
+
activationDirection: viewportState.activationDirection,
|
| 1912 |
+
transitioning: viewportState.transitioning,
|
| 1913 |
+
instant: instantType
|
| 1914 |
+
},
|
| 1915 |
+
ref: forwardedRef,
|
| 1916 |
+
props: [elementProps, { children: childrenToRender }],
|
| 1917 |
+
stateAttributesMapping
|
| 1918 |
+
});
|
| 1919 |
+
});
|
| 1920 |
+
MenuViewport.displayName = "MenuViewport";
|
| 1921 |
+
//#endregion
|
| 1922 |
+
//#region ../node_modules/@base-ui/utils/esm/isElementDisabled.js
|
| 1923 |
+
function isElementDisabled(element) {
|
| 1924 |
+
return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
|
| 1925 |
+
}
|
| 1926 |
+
//#endregion
|
| 1927 |
+
//#region ../node_modules/@base-ui/react/esm/menu/submenu-trigger/MenuSubmenuTrigger.js
|
| 1928 |
+
/**
|
| 1929 |
+
* A menu item that opens a submenu.
|
| 1930 |
+
* Renders a `<div>` element.
|
| 1931 |
+
*
|
| 1932 |
+
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
| 1933 |
+
*/
|
| 1934 |
+
var MenuSubmenuTrigger = /* @__PURE__ */ import_react.forwardRef(function MenuSubmenuTrigger(componentProps, forwardedRef) {
|
| 1935 |
+
const { render, className, style, label, id: idProp, nativeButton = false, openOnHover = true, delay = 100, closeDelay = 0, disabled: disabledProp = false, ...elementProps } = componentProps;
|
| 1936 |
+
const listItem = useCompositeListItem();
|
| 1937 |
+
const menuPositionerContext = useMenuPositionerContext();
|
| 1938 |
+
const { store } = useMenuRootContext();
|
| 1939 |
+
const thisTriggerId = useBaseUiId(idProp);
|
| 1940 |
+
const open = store.useState("open");
|
| 1941 |
+
const floatingRootContext = store.useState("floatingRootContext");
|
| 1942 |
+
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
| 1943 |
+
const popupId = store.useState("triggerPopupId", thisTriggerId);
|
| 1944 |
+
const baseRegisterTrigger = useTriggerRegistration(thisTriggerId, store);
|
| 1945 |
+
const registerTrigger = import_react.useCallback((element) => {
|
| 1946 |
+
const cleanup = baseRegisterTrigger(element);
|
| 1947 |
+
if (element !== null && store.select("open") && store.select("activeTriggerId") == null) store.update({
|
| 1948 |
+
activeTriggerId: thisTriggerId,
|
| 1949 |
+
activeTriggerElement: element,
|
| 1950 |
+
closeDelay
|
| 1951 |
+
});
|
| 1952 |
+
return cleanup;
|
| 1953 |
+
}, [
|
| 1954 |
+
baseRegisterTrigger,
|
| 1955 |
+
closeDelay,
|
| 1956 |
+
store,
|
| 1957 |
+
thisTriggerId
|
| 1958 |
+
]);
|
| 1959 |
+
const triggerElementRef = import_react.useRef(null);
|
| 1960 |
+
const handleTriggerElementRef = import_react.useCallback((el) => {
|
| 1961 |
+
triggerElementRef.current = el;
|
| 1962 |
+
store.set("activeTriggerElement", el);
|
| 1963 |
+
}, [store]);
|
| 1964 |
+
useIsoLayoutEffect(() => {
|
| 1965 |
+
const element = triggerElementRef.current;
|
| 1966 |
+
if (element && isElementDisabled(element) && !disabledProp) warn(`A disabled element was detected on <Menu.SubmenuTrigger>. To properly disable the trigger, use the \`disabled\` prop on the component instead of setting it on the rendered element.${SafeReact.captureOwnerStack?.() || ""}`);
|
| 1967 |
+
});
|
| 1968 |
+
const submenuRootContext = useMenuSubmenuRootContext();
|
| 1969 |
+
if (!submenuRootContext?.parentMenu) throw new Error("Base UI: <Menu.SubmenuTrigger> must be placed in <Menu.SubmenuRoot>.");
|
| 1970 |
+
store.useSyncedValue("closeDelay", closeDelay);
|
| 1971 |
+
const parentMenuStore = submenuRootContext.parentMenu;
|
| 1972 |
+
const itemProps = parentMenuStore.useState("itemProps");
|
| 1973 |
+
const highlighted = parentMenuStore.useState("isActive", listItem.index);
|
| 1974 |
+
const itemMetadata = import_react.useMemo(() => ({
|
| 1975 |
+
type: "submenu-trigger",
|
| 1976 |
+
setActive() {
|
| 1977 |
+
parentMenuStore.set("activeIndex", listItem.index);
|
| 1978 |
+
}
|
| 1979 |
+
}), [parentMenuStore, listItem.index]);
|
| 1980 |
+
const rootDisabled = store.useState("disabled");
|
| 1981 |
+
const disabled = disabledProp || rootDisabled;
|
| 1982 |
+
const { getItemProps, itemRef } = useMenuItem({
|
| 1983 |
+
closeOnClick: false,
|
| 1984 |
+
disabled,
|
| 1985 |
+
highlighted,
|
| 1986 |
+
id: thisTriggerId,
|
| 1987 |
+
store,
|
| 1988 |
+
typingRef: parentMenuStore.context.typingRef,
|
| 1989 |
+
nativeButton,
|
| 1990 |
+
itemMetadata,
|
| 1991 |
+
nodeId: menuPositionerContext?.context.nodeId
|
| 1992 |
+
});
|
| 1993 |
+
const hoverEnabled = store.useState("hoverEnabled");
|
| 1994 |
+
const allowMouseEnter = parentMenuStore.useState("allowMouseEnter");
|
| 1995 |
+
const hoverProps = useHoverReferenceInteraction(floatingRootContext, {
|
| 1996 |
+
enabled: hoverEnabled && openOnHover && !disabled,
|
| 1997 |
+
handleClose: safePolygon({ blockPointerEvents: true }),
|
| 1998 |
+
mouseOnly: true,
|
| 1999 |
+
move: true,
|
| 2000 |
+
restMs: delay,
|
| 2001 |
+
delay: allowMouseEnter ? {
|
| 2002 |
+
open: delay,
|
| 2003 |
+
close: closeDelay
|
| 2004 |
+
} : 0,
|
| 2005 |
+
triggerElementRef,
|
| 2006 |
+
externalTree: floatingTreeRoot,
|
| 2007 |
+
isClosing: () => store.select("transitionStatus") === "ending"
|
| 2008 |
+
});
|
| 2009 |
+
const localInteractionProps = useClick(floatingRootContext, {
|
| 2010 |
+
enabled: !disabled,
|
| 2011 |
+
event: "mousedown",
|
| 2012 |
+
toggle: !openOnHover,
|
| 2013 |
+
ignoreMouse: openOnHover,
|
| 2014 |
+
stickIfOpen: false
|
| 2015 |
+
}).reference ?? EMPTY_OBJECT;
|
| 2016 |
+
const rootTriggerProps = store.useState("triggerProps", true);
|
| 2017 |
+
delete rootTriggerProps.id;
|
| 2018 |
+
return useRenderElement("div", componentProps, {
|
| 2019 |
+
state: {
|
| 2020 |
+
disabled,
|
| 2021 |
+
highlighted,
|
| 2022 |
+
open
|
| 2023 |
+
},
|
| 2024 |
+
stateAttributesMapping: triggerOpenStateMapping,
|
| 2025 |
+
props: [
|
| 2026 |
+
localInteractionProps,
|
| 2027 |
+
hoverProps,
|
| 2028 |
+
rootTriggerProps,
|
| 2029 |
+
itemProps,
|
| 2030 |
+
{
|
| 2031 |
+
"aria-controls": popupId,
|
| 2032 |
+
tabIndex: open || highlighted ? 0 : -1,
|
| 2033 |
+
onBlur() {
|
| 2034 |
+
if (highlighted) parentMenuStore.set("activeIndex", null);
|
| 2035 |
+
}
|
| 2036 |
+
},
|
| 2037 |
+
elementProps,
|
| 2038 |
+
getItemProps
|
| 2039 |
+
],
|
| 2040 |
+
ref: [
|
| 2041 |
+
forwardedRef,
|
| 2042 |
+
listItem.ref,
|
| 2043 |
+
itemRef,
|
| 2044 |
+
registerTrigger,
|
| 2045 |
+
handleTriggerElementRef
|
| 2046 |
+
]
|
| 2047 |
+
});
|
| 2048 |
+
});
|
| 2049 |
+
MenuSubmenuTrigger.displayName = "MenuSubmenuTrigger";
|
| 2050 |
+
//#endregion
|
| 2051 |
+
//#region ../node_modules/@base-ui/react/esm/menu/store/MenuHandle.js
|
| 2052 |
+
var MenuHandle = class {
|
| 2053 |
+
/**
|
| 2054 |
+
* Internal store holding the menu's state.
|
| 2055 |
+
* @internal
|
| 2056 |
+
*/
|
| 2057 |
+
constructor() {
|
| 2058 |
+
this.store = new MenuStore();
|
| 2059 |
+
}
|
| 2060 |
+
/**
|
| 2061 |
+
* Opens the menu and associates it with the trigger with the given id.
|
| 2062 |
+
* The trigger must be a Menu.Trigger component with this handle passed as a prop.
|
| 2063 |
+
*
|
| 2064 |
+
* @param triggerId ID of the trigger to associate with the menu.
|
| 2065 |
+
*/
|
| 2066 |
+
open(triggerId) {
|
| 2067 |
+
const triggerElement = triggerId ? this.store.context.triggerElements.getById(triggerId) : void 0;
|
| 2068 |
+
if (triggerId && !triggerElement) throw new Error(`Base UI: MenuHandle.open: No trigger found with id "${triggerId}".`);
|
| 2069 |
+
this.store.setOpen(true, createChangeEventDetails("imperative-action", void 0, triggerElement));
|
| 2070 |
+
}
|
| 2071 |
+
/**
|
| 2072 |
+
* Closes the menu.
|
| 2073 |
+
*/
|
| 2074 |
+
close() {
|
| 2075 |
+
this.store.setOpen(false, createChangeEventDetails("imperative-action", void 0, void 0));
|
| 2076 |
+
}
|
| 2077 |
+
/**
|
| 2078 |
+
* Indicates whether the menu is currently open.
|
| 2079 |
+
*/
|
| 2080 |
+
get isOpen() {
|
| 2081 |
+
return this.store.select("open");
|
| 2082 |
+
}
|
| 2083 |
+
};
|
| 2084 |
+
/**
|
| 2085 |
+
* Creates a new handle to connect a Menu.Root with detached Menu.Trigger components.
|
| 2086 |
+
*/
|
| 2087 |
+
function createMenuHandle() {
|
| 2088 |
+
return new MenuHandle();
|
| 2089 |
+
}
|
| 2090 |
+
//#endregion
|
| 2091 |
+
//#region ../node_modules/@base-ui/react/esm/menu/index.parts.js
|
| 2092 |
+
var index_parts_exports = /* @__PURE__ */ __exportAll({
|
| 2093 |
+
Arrow: () => MenuArrow,
|
| 2094 |
+
Backdrop: () => MenuBackdrop,
|
| 2095 |
+
CheckboxItem: () => MenuCheckboxItem,
|
| 2096 |
+
CheckboxItemIndicator: () => MenuCheckboxItemIndicator,
|
| 2097 |
+
Group: () => MenuGroup,
|
| 2098 |
+
GroupLabel: () => MenuGroupLabel,
|
| 2099 |
+
Handle: () => MenuHandle,
|
| 2100 |
+
Item: () => MenuItem,
|
| 2101 |
+
LinkItem: () => MenuLinkItem,
|
| 2102 |
+
Popup: () => MenuPopup,
|
| 2103 |
+
Portal: () => MenuPortal,
|
| 2104 |
+
Positioner: () => MenuPositioner,
|
| 2105 |
+
RadioGroup: () => MenuRadioGroup,
|
| 2106 |
+
RadioItem: () => MenuRadioItem,
|
| 2107 |
+
RadioItemIndicator: () => MenuRadioItemIndicator,
|
| 2108 |
+
Root: () => MenuRoot,
|
| 2109 |
+
Separator: () => Separator,
|
| 2110 |
+
SubmenuRoot: () => MenuSubmenuRoot,
|
| 2111 |
+
SubmenuTrigger: () => MenuSubmenuTrigger,
|
| 2112 |
+
Trigger: () => MenuTrigger,
|
| 2113 |
+
Viewport: () => MenuViewport,
|
| 2114 |
+
createHandle: () => createMenuHandle
|
| 2115 |
+
});
|
| 2116 |
+
//#endregion
|
| 2117 |
+
export { index_parts_exports as Menu };
|
| 2118 |
+
|
| 2119 |
+
//# sourceMappingURL=@base-ui_react_menu.js.map
|
client/node_modules/.vite/deps/@base-ui_react_menu.js.map
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
client/node_modules/.vite/deps/@base-ui_react_popover.js
ADDED
|
@@ -0,0 +1,809 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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jsx_runtime } from "./react_jsx-runtime.js";
|
| 4 |
+
import { E as isHTMLElement, f as useStableCallback, l as mergeProps, r as EMPTY_OBJECT, t as useRenderElement, u as useIsoLayoutEffect } from "./useRenderElement-3Cwvu1gO.js";
|
| 5 |
+
import { t as useButton } from "./useButton-CBy-cFDk.js";
|
| 6 |
+
import { _ as useBaseUiId, o as imperativeAction, p as triggerHover, r as closePress, t as createChangeEventDetails } from "./createBaseUIEventDetails-CJxlTiBH.js";
|
| 7 |
+
import { B as useFloatingNodeId, C as usePopupStore, F as useDismiss, G as CLICK_TRIGGER_IDENTIFIER, I as useClick, L as FloatingFocusManager, N as createSelector, O as ReactStore, R as FloatingNode, S as usePopupRootSync, V as useFloatingParentNodeId, W as FloatingPortal, X as FocusGuard, _ as FOCUSABLE_POPUP_PROPS, a as useAnchoredPopupScrollLock, at as useAnimationsFinished, b as useOpenStateTransitions, c as useAnchorPositioning, ct as Timeout, d as inertValue, et as popupStateMapping, f as getDisabledMountTransitionStyles, g as PopupTriggerMap, i as useOnFirstRender, it as useOpenChangeComplete, l as adaptiveOrigin, m as useToolbarRootContext, nt as triggerOpenStateMapping, o as usePositioner, ot as transitionStatusMapping, p as COMPOSITE_KEYS, q as POPUP_COLLISION_AVOIDANCE, r as useOpenMethodTriggerProps, s as InternalBackdrop, tt as pressableTriggerOpenStateMapping, v as setOpenTriggerState, w as useTriggerDataForwarding, x as usePopupInteractionProps, y as useImplicitActiveTrigger, z as FloatingTree } from "./usePreviousValue-rDCHxn0g.js";
|
| 8 |
+
import { a as useHoverFloatingInteraction, c as popupStoreSelectors, i as useHoverReferenceInteraction, n as useTriggerFocusGuards, o as createInitialPopupStoreState, r as safePolygon, s as createPopupFloatingRootContext, t as usePopupViewport } from "./usePopupViewport-DbUbXryh.js";
|
| 9 |
+
//#region ../node_modules/@base-ui/react/esm/popover/root/PopoverRootContext.js
|
| 10 |
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
| 11 |
+
var PopoverRootContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 12 |
+
PopoverRootContext.displayName = "PopoverRootContext";
|
| 13 |
+
function usePopoverRootContext(optional) {
|
| 14 |
+
const context = import_react.useContext(PopoverRootContext);
|
| 15 |
+
if (context === void 0 && !optional) throw new Error("Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.");
|
| 16 |
+
return context;
|
| 17 |
+
}
|
| 18 |
+
//#endregion
|
| 19 |
+
//#region ../node_modules/@base-ui/react/esm/popover/store/PopoverStore.js
|
| 20 |
+
var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1);
|
| 21 |
+
function createInitialState() {
|
| 22 |
+
return {
|
| 23 |
+
...createInitialPopupStoreState(),
|
| 24 |
+
disabled: false,
|
| 25 |
+
modal: false,
|
| 26 |
+
focusManagerModal: false,
|
| 27 |
+
instantType: void 0,
|
| 28 |
+
openMethod: null,
|
| 29 |
+
openChangeReason: null,
|
| 30 |
+
titleElementId: void 0,
|
| 31 |
+
descriptionElementId: void 0,
|
| 32 |
+
stickIfOpen: true,
|
| 33 |
+
nested: false,
|
| 34 |
+
openOnHover: false,
|
| 35 |
+
closeDelay: 0,
|
| 36 |
+
hasViewport: false
|
| 37 |
+
};
|
| 38 |
+
}
|
| 39 |
+
var selectors = {
|
| 40 |
+
...popupStoreSelectors,
|
| 41 |
+
disabled: createSelector((state) => state.disabled),
|
| 42 |
+
instantType: createSelector((state) => state.instantType),
|
| 43 |
+
openMethod: createSelector((state) => state.openMethod),
|
| 44 |
+
openChangeReason: createSelector((state) => state.openChangeReason),
|
| 45 |
+
modal: createSelector((state) => state.modal),
|
| 46 |
+
focusManagerModal: createSelector((state) => state.focusManagerModal),
|
| 47 |
+
stickIfOpen: createSelector((state) => state.stickIfOpen),
|
| 48 |
+
titleElementId: createSelector((state) => state.titleElementId),
|
| 49 |
+
descriptionElementId: createSelector((state) => state.descriptionElementId),
|
| 50 |
+
openOnHover: createSelector((state) => state.openOnHover),
|
| 51 |
+
closeDelay: createSelector((state) => state.closeDelay),
|
| 52 |
+
hasViewport: createSelector((state) => state.hasViewport)
|
| 53 |
+
};
|
| 54 |
+
var PopoverStore = class PopoverStore extends ReactStore {
|
| 55 |
+
constructor(initialState, floatingId, nested = false) {
|
| 56 |
+
const initial = {
|
| 57 |
+
...createInitialState(),
|
| 58 |
+
...initialState
|
| 59 |
+
};
|
| 60 |
+
const triggerElements = new PopupTriggerMap();
|
| 61 |
+
if (initial.open && initialState?.mounted === void 0) initial.mounted = true;
|
| 62 |
+
initial.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested);
|
| 63 |
+
super(initial, {
|
| 64 |
+
popupRef: /* @__PURE__ */ import_react.createRef(),
|
| 65 |
+
backdropRef: /* @__PURE__ */ import_react.createRef(),
|
| 66 |
+
internalBackdropRef: /* @__PURE__ */ import_react.createRef(),
|
| 67 |
+
onOpenChange: void 0,
|
| 68 |
+
onOpenChangeComplete: void 0,
|
| 69 |
+
triggerFocusTargetRef: /* @__PURE__ */ import_react.createRef(),
|
| 70 |
+
beforeContentFocusGuardRef: /* @__PURE__ */ import_react.createRef(),
|
| 71 |
+
stickIfOpenTimeout: new Timeout(),
|
| 72 |
+
triggerElements
|
| 73 |
+
}, selectors);
|
| 74 |
+
}
|
| 75 |
+
setOpen = (nextOpen, eventDetails) => {
|
| 76 |
+
const isHover = eventDetails.reason === triggerHover;
|
| 77 |
+
const isKeyboardClick = eventDetails.reason === "trigger-press" && eventDetails.event.detail === 0;
|
| 78 |
+
const isDismissClose = !nextOpen && (eventDetails.reason === "escape-key" || eventDetails.reason == null);
|
| 79 |
+
eventDetails.preventUnmountOnClose = () => {
|
| 80 |
+
this.set("preventUnmountingOnClose", true);
|
| 81 |
+
};
|
| 82 |
+
const activeTriggerId = this.select("activeTriggerId");
|
| 83 |
+
if (!nextOpen && eventDetails.reason === "close-press" && eventDetails.trigger == null && activeTriggerId != null) eventDetails.trigger = this.context.triggerElements.getById(activeTriggerId) ?? this.select("activeTriggerElement") ?? void 0;
|
| 84 |
+
this.context.onOpenChange?.(nextOpen, eventDetails);
|
| 85 |
+
if (eventDetails.isCanceled) return;
|
| 86 |
+
this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
|
| 87 |
+
const changeState = () => {
|
| 88 |
+
const updatedState = {
|
| 89 |
+
open: nextOpen,
|
| 90 |
+
openChangeReason: eventDetails.reason
|
| 91 |
+
};
|
| 92 |
+
setOpenTriggerState(updatedState, nextOpen, eventDetails.trigger);
|
| 93 |
+
this.update(updatedState);
|
| 94 |
+
};
|
| 95 |
+
if (isHover) {
|
| 96 |
+
this.set("stickIfOpen", true);
|
| 97 |
+
this.context.stickIfOpenTimeout.start(500, () => {
|
| 98 |
+
this.set("stickIfOpen", false);
|
| 99 |
+
});
|
| 100 |
+
import_react_dom.flushSync(changeState);
|
| 101 |
+
} else changeState();
|
| 102 |
+
if (isKeyboardClick || isDismissClose) this.set("instantType", isKeyboardClick ? "click" : "dismiss");
|
| 103 |
+
else if (eventDetails.reason === "focus-out") this.set("instantType", "focus");
|
| 104 |
+
else this.set("instantType", void 0);
|
| 105 |
+
};
|
| 106 |
+
static useStore(externalStore, initialState) {
|
| 107 |
+
const { store, internalStore } = usePopupStore(externalStore, (floatingId, nested) => new PopoverStore(initialState, floatingId, nested));
|
| 108 |
+
import_react.useEffect(() => internalStore?.disposeEffect(), [internalStore]);
|
| 109 |
+
return store;
|
| 110 |
+
}
|
| 111 |
+
disposeEffect = () => {
|
| 112 |
+
return this.context.stickIfOpenTimeout.disposeEffect();
|
| 113 |
+
};
|
| 114 |
+
};
|
| 115 |
+
//#endregion
|
| 116 |
+
//#region ../node_modules/@base-ui/react/esm/popover/root/PopoverRoot.js
|
| 117 |
+
var import_jsx_runtime = require_jsx_runtime();
|
| 118 |
+
function PopoverRootComponent({ props }) {
|
| 119 |
+
const { children, open: openProp, defaultOpen = false, onOpenChange, onOpenChangeComplete, modal = false, handle, triggerId: triggerIdProp, defaultTriggerId: defaultTriggerIdProp = null } = props;
|
| 120 |
+
const store = PopoverStore.useStore(handle?.store, {
|
| 121 |
+
modal,
|
| 122 |
+
open: defaultOpen,
|
| 123 |
+
openProp,
|
| 124 |
+
activeTriggerId: defaultTriggerIdProp,
|
| 125 |
+
triggerIdProp
|
| 126 |
+
});
|
| 127 |
+
useOnFirstRender(() => {
|
| 128 |
+
if (openProp === void 0 && store.state.open === false && defaultOpen === true) store.update({
|
| 129 |
+
open: true,
|
| 130 |
+
activeTriggerId: defaultTriggerIdProp
|
| 131 |
+
});
|
| 132 |
+
});
|
| 133 |
+
store.useControlledProp("openProp", openProp);
|
| 134 |
+
store.useControlledProp("triggerIdProp", triggerIdProp);
|
| 135 |
+
const open = store.useState("open");
|
| 136 |
+
const mounted = store.useState("mounted");
|
| 137 |
+
const payload = store.useState("payload");
|
| 138 |
+
const nested = useFloatingParentNodeId() != null;
|
| 139 |
+
store.useContextCallback("onOpenChange", onOpenChange);
|
| 140 |
+
store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
|
| 141 |
+
usePopupRootSync(store, open);
|
| 142 |
+
useImplicitActiveTrigger(store);
|
| 143 |
+
const { forceUnmount } = useOpenStateTransitions(open, store, () => {
|
| 144 |
+
store.update({
|
| 145 |
+
stickIfOpen: true,
|
| 146 |
+
openChangeReason: null
|
| 147 |
+
});
|
| 148 |
+
});
|
| 149 |
+
store.useSyncedValues({
|
| 150 |
+
modal,
|
| 151 |
+
nested
|
| 152 |
+
});
|
| 153 |
+
import_react.useEffect(() => {
|
| 154 |
+
if (!open) store.context.stickIfOpenTimeout.clear();
|
| 155 |
+
}, [store, open]);
|
| 156 |
+
const handleImperativeClose = import_react.useCallback(() => {
|
| 157 |
+
store.setOpen(false, createChangeEventDetails(imperativeAction));
|
| 158 |
+
}, [store]);
|
| 159 |
+
import_react.useImperativeHandle(props.actionsRef, () => ({
|
| 160 |
+
unmount: forceUnmount,
|
| 161 |
+
close: handleImperativeClose
|
| 162 |
+
}), [forceUnmount, handleImperativeClose]);
|
| 163 |
+
const shouldRenderInteractions = open || mounted;
|
| 164 |
+
const popoverContext = import_react.useMemo(() => ({ store }), [store]);
|
| 165 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(PopoverRootContext.Provider, {
|
| 166 |
+
value: popoverContext,
|
| 167 |
+
children: [shouldRenderInteractions && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverInteractions, {
|
| 168 |
+
store,
|
| 169 |
+
modal
|
| 170 |
+
}), typeof children === "function" ? children({ payload }) : children]
|
| 171 |
+
});
|
| 172 |
+
}
|
| 173 |
+
/**
|
| 174 |
+
* Groups all parts of the popover.
|
| 175 |
+
* Doesn't render its own HTML element.
|
| 176 |
+
*
|
| 177 |
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
| 178 |
+
*/
|
| 179 |
+
function PopoverRoot(props) {
|
| 180 |
+
if (usePopoverRootContext(true)) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverRootComponent, { props });
|
| 181 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingTree, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverRootComponent, { props }) });
|
| 182 |
+
}
|
| 183 |
+
function PopoverInteractions({ store, modal }) {
|
| 184 |
+
const dismiss = useDismiss(store.useState("floatingRootContext"), { outsidePressEvent: {
|
| 185 |
+
mouse: modal === "trap-focus" ? "sloppy" : "intentional",
|
| 186 |
+
touch: "sloppy"
|
| 187 |
+
} });
|
| 188 |
+
usePopupInteractionProps(store, {
|
| 189 |
+
activeTriggerProps: dismiss.reference ?? EMPTY_OBJECT,
|
| 190 |
+
inactiveTriggerProps: dismiss.trigger ?? EMPTY_OBJECT,
|
| 191 |
+
popupProps: import_react.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, dismiss.floating), [dismiss.floating])
|
| 192 |
+
});
|
| 193 |
+
return null;
|
| 194 |
+
}
|
| 195 |
+
//#endregion
|
| 196 |
+
//#region ../node_modules/@base-ui/react/esm/popover/trigger/PopoverTrigger.js
|
| 197 |
+
/**
|
| 198 |
+
* A button that opens the popover.
|
| 199 |
+
* Renders a `<button>` element.
|
| 200 |
+
*
|
| 201 |
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
| 202 |
+
*/
|
| 203 |
+
var PopoverTrigger = /* @__PURE__ */ import_react.forwardRef(function PopoverTrigger(componentProps, forwardedRef) {
|
| 204 |
+
const { render, className, style, disabled = false, nativeButton = true, handle, payload, openOnHover = false, delay = 300, closeDelay = 0, id: idProp, ...elementProps } = componentProps;
|
| 205 |
+
const rootContext = usePopoverRootContext(true);
|
| 206 |
+
const store = handle?.store ?? rootContext?.store;
|
| 207 |
+
if (!store) throw new Error("Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle.");
|
| 208 |
+
const thisTriggerId = useBaseUiId(idProp);
|
| 209 |
+
const isTriggerActive = store.useState("isTriggerActive", thisTriggerId);
|
| 210 |
+
const floatingContext = store.useState("floatingRootContext");
|
| 211 |
+
const isOpenedByThisTrigger = store.useState("isOpenedByTrigger", thisTriggerId);
|
| 212 |
+
const popupId = store.useState("triggerPopupId", thisTriggerId);
|
| 213 |
+
const triggerElementRef = import_react.useRef(null);
|
| 214 |
+
const { registerTrigger, isMountedByThisTrigger } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {
|
| 215 |
+
payload,
|
| 216 |
+
disabled,
|
| 217 |
+
openOnHover,
|
| 218 |
+
closeDelay
|
| 219 |
+
});
|
| 220 |
+
const openReason = store.useState("openChangeReason");
|
| 221 |
+
const stickIfOpen = store.useState("stickIfOpen");
|
| 222 |
+
const openMethod = store.useState("openMethod");
|
| 223 |
+
const focusManagerModal = store.useState("focusManagerModal");
|
| 224 |
+
const hoverProps = useHoverReferenceInteraction(floatingContext, {
|
| 225 |
+
enabled: floatingContext != null && openOnHover && (openMethod !== "touch" || openReason !== "trigger-press"),
|
| 226 |
+
mouseOnly: true,
|
| 227 |
+
move: false,
|
| 228 |
+
handleClose: safePolygon(),
|
| 229 |
+
restMs: delay,
|
| 230 |
+
delay: { close: closeDelay },
|
| 231 |
+
triggerElementRef,
|
| 232 |
+
isActiveTrigger: isTriggerActive,
|
| 233 |
+
isClosing: () => store.select("transitionStatus") === "ending"
|
| 234 |
+
});
|
| 235 |
+
const click = useClick(floatingContext, {
|
| 236 |
+
enabled: floatingContext != null,
|
| 237 |
+
stickIfOpen
|
| 238 |
+
});
|
| 239 |
+
const interactionTypeProps = useOpenMethodTriggerProps(() => store.select("open"), (interactionType) => {
|
| 240 |
+
store.set("openMethod", interactionType);
|
| 241 |
+
});
|
| 242 |
+
const rootTriggerProps = store.useState("triggerProps", isMountedByThisTrigger);
|
| 243 |
+
const { getButtonProps, buttonRef } = useButton({
|
| 244 |
+
disabled,
|
| 245 |
+
native: nativeButton
|
| 246 |
+
});
|
| 247 |
+
const stateAttributesMapping = { open(value) {
|
| 248 |
+
if (value && openReason === "trigger-press") return pressableTriggerOpenStateMapping.open(value);
|
| 249 |
+
return triggerOpenStateMapping.open(value);
|
| 250 |
+
} };
|
| 251 |
+
const { preFocusGuardRef, handlePreFocusGuardFocus, handleFocusTargetFocus } = useTriggerFocusGuards(store, triggerElementRef);
|
| 252 |
+
const element = useRenderElement("button", componentProps, {
|
| 253 |
+
state: {
|
| 254 |
+
disabled,
|
| 255 |
+
open: isOpenedByThisTrigger
|
| 256 |
+
},
|
| 257 |
+
ref: [
|
| 258 |
+
buttonRef,
|
| 259 |
+
forwardedRef,
|
| 260 |
+
registerTrigger,
|
| 261 |
+
triggerElementRef
|
| 262 |
+
],
|
| 263 |
+
props: [
|
| 264 |
+
click.reference,
|
| 265 |
+
hoverProps,
|
| 266 |
+
rootTriggerProps,
|
| 267 |
+
interactionTypeProps,
|
| 268 |
+
{
|
| 269 |
+
[CLICK_TRIGGER_IDENTIFIER]: "",
|
| 270 |
+
id: thisTriggerId,
|
| 271 |
+
"aria-haspopup": "dialog",
|
| 272 |
+
"aria-expanded": isOpenedByThisTrigger,
|
| 273 |
+
"aria-controls": popupId
|
| 274 |
+
},
|
| 275 |
+
elementProps,
|
| 276 |
+
getButtonProps
|
| 277 |
+
],
|
| 278 |
+
stateAttributesMapping
|
| 279 |
+
});
|
| 280 |
+
if (isMountedByThisTrigger && !focusManagerModal) return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
|
| 281 |
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusGuard, {
|
| 282 |
+
ref: preFocusGuardRef,
|
| 283 |
+
onFocus: handlePreFocusGuardFocus
|
| 284 |
+
}),
|
| 285 |
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: element }, thisTriggerId),
|
| 286 |
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusGuard, {
|
| 287 |
+
ref: store.context.triggerFocusTargetRef,
|
| 288 |
+
onFocus: handleFocusTargetFocus
|
| 289 |
+
})
|
| 290 |
+
] });
|
| 291 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: element }, thisTriggerId);
|
| 292 |
+
});
|
| 293 |
+
PopoverTrigger.displayName = "PopoverTrigger";
|
| 294 |
+
//#endregion
|
| 295 |
+
//#region ../node_modules/@base-ui/react/esm/popover/portal/PopoverPortalContext.js
|
| 296 |
+
var PopoverPortalContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 297 |
+
PopoverPortalContext.displayName = "PopoverPortalContext";
|
| 298 |
+
function usePopoverPortalContext() {
|
| 299 |
+
const value = import_react.useContext(PopoverPortalContext);
|
| 300 |
+
if (value === void 0) throw new Error("Base UI: <Popover.Portal> is missing.");
|
| 301 |
+
return value;
|
| 302 |
+
}
|
| 303 |
+
//#endregion
|
| 304 |
+
//#region ../node_modules/@base-ui/react/esm/popover/portal/PopoverPortal.js
|
| 305 |
+
/**
|
| 306 |
+
* A portal element that moves the popup to a different part of the DOM.
|
| 307 |
+
* By default, the portal element is appended to `<body>`.
|
| 308 |
+
* Renders a `<div>` element.
|
| 309 |
+
*
|
| 310 |
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
| 311 |
+
*/
|
| 312 |
+
var PopoverPortal = /* @__PURE__ */ import_react.forwardRef(function PopoverPortal(props, forwardedRef) {
|
| 313 |
+
const { keepMounted = false, ...portalProps } = props;
|
| 314 |
+
const { store } = usePopoverRootContext();
|
| 315 |
+
if (!(store.useState("mounted") || keepMounted)) return null;
|
| 316 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPortalContext.Provider, {
|
| 317 |
+
value: keepMounted,
|
| 318 |
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingPortal, {
|
| 319 |
+
ref: forwardedRef,
|
| 320 |
+
...portalProps
|
| 321 |
+
})
|
| 322 |
+
});
|
| 323 |
+
});
|
| 324 |
+
PopoverPortal.displayName = "PopoverPortal";
|
| 325 |
+
//#endregion
|
| 326 |
+
//#region ../node_modules/@base-ui/react/esm/popover/positioner/PopoverPositionerContext.js
|
| 327 |
+
var PopoverPositionerContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 328 |
+
PopoverPositionerContext.displayName = "PopoverPositionerContext";
|
| 329 |
+
function usePopoverPositionerContext() {
|
| 330 |
+
const context = import_react.useContext(PopoverPositionerContext);
|
| 331 |
+
if (!context) throw new Error("Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.");
|
| 332 |
+
return context;
|
| 333 |
+
}
|
| 334 |
+
//#endregion
|
| 335 |
+
//#region ../node_modules/@base-ui/react/esm/popover/positioner/PopoverPositioner.js
|
| 336 |
+
/**
|
| 337 |
+
* Positions the popover against the trigger.
|
| 338 |
+
* Renders a `<div>` element.
|
| 339 |
+
*
|
| 340 |
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
| 341 |
+
*/
|
| 342 |
+
var PopoverPositioner = /* @__PURE__ */ import_react.forwardRef(function PopoverPositioner(componentProps, forwardedRef) {
|
| 343 |
+
const { render, className, style, anchor, positionMethod = "absolute", side = "bottom", align = "center", sideOffset = 0, alignOffset = 0, collisionBoundary = "clipping-ancestors", collisionPadding = 5, arrowPadding = 5, sticky = false, disableAnchorTracking = false, collisionAvoidance = POPUP_COLLISION_AVOIDANCE, ...elementProps } = componentProps;
|
| 344 |
+
const { store } = usePopoverRootContext();
|
| 345 |
+
const keepMounted = usePopoverPortalContext();
|
| 346 |
+
const nodeId = useFloatingNodeId();
|
| 347 |
+
const floatingRootContext = store.useState("floatingRootContext");
|
| 348 |
+
const mounted = store.useState("mounted");
|
| 349 |
+
const open = store.useState("open");
|
| 350 |
+
const openReason = store.useState("openChangeReason");
|
| 351 |
+
const triggerElement = store.useState("activeTriggerElement");
|
| 352 |
+
const modal = store.useState("modal");
|
| 353 |
+
const openMethod = store.useState("openMethod");
|
| 354 |
+
const positionerElement = store.useState("positionerElement");
|
| 355 |
+
const instantType = store.useState("instantType");
|
| 356 |
+
const transitionStatus = store.useState("transitionStatus");
|
| 357 |
+
const hasViewport = store.useState("hasViewport");
|
| 358 |
+
const prevTriggerElementRef = import_react.useRef(null);
|
| 359 |
+
const runOnceAnimationsFinish = useAnimationsFinished(positionerElement, false, false);
|
| 360 |
+
const positioning = useAnchorPositioning({
|
| 361 |
+
anchor,
|
| 362 |
+
floatingRootContext,
|
| 363 |
+
positionMethod,
|
| 364 |
+
mounted,
|
| 365 |
+
side,
|
| 366 |
+
sideOffset,
|
| 367 |
+
align,
|
| 368 |
+
alignOffset,
|
| 369 |
+
arrowPadding,
|
| 370 |
+
collisionBoundary,
|
| 371 |
+
collisionPadding,
|
| 372 |
+
sticky,
|
| 373 |
+
disableAnchorTracking,
|
| 374 |
+
keepMounted,
|
| 375 |
+
nodeId,
|
| 376 |
+
collisionAvoidance,
|
| 377 |
+
adaptiveOrigin: hasViewport ? adaptiveOrigin : void 0
|
| 378 |
+
});
|
| 379 |
+
const domReference = floatingRootContext.useState("domReferenceElement");
|
| 380 |
+
useIsoLayoutEffect(() => {
|
| 381 |
+
const currentTriggerElement = domReference;
|
| 382 |
+
const prevTriggerElement = prevTriggerElementRef.current;
|
| 383 |
+
if (currentTriggerElement) prevTriggerElementRef.current = currentTriggerElement;
|
| 384 |
+
if (prevTriggerElement && currentTriggerElement && currentTriggerElement !== prevTriggerElement) {
|
| 385 |
+
store.set("instantType", void 0);
|
| 386 |
+
const ac = new AbortController();
|
| 387 |
+
runOnceAnimationsFinish(() => {
|
| 388 |
+
store.set("instantType", "trigger-change");
|
| 389 |
+
}, ac.signal);
|
| 390 |
+
return () => {
|
| 391 |
+
ac.abort();
|
| 392 |
+
};
|
| 393 |
+
}
|
| 394 |
+
}, [
|
| 395 |
+
domReference,
|
| 396 |
+
runOnceAnimationsFinish,
|
| 397 |
+
store
|
| 398 |
+
]);
|
| 399 |
+
useAnchoredPopupScrollLock(open && modal === true && openReason !== "trigger-hover", openMethod === "touch", positionerElement, triggerElement);
|
| 400 |
+
const setPositionerElement = import_react.useCallback((element) => {
|
| 401 |
+
store.set("positionerElement", element);
|
| 402 |
+
}, [store]);
|
| 403 |
+
const element = usePositioner(componentProps, {
|
| 404 |
+
open,
|
| 405 |
+
side: positioning.side,
|
| 406 |
+
align: positioning.align,
|
| 407 |
+
anchorHidden: positioning.anchorHidden,
|
| 408 |
+
instant: instantType
|
| 409 |
+
}, {
|
| 410 |
+
styles: positioning.positionerStyles,
|
| 411 |
+
transitionStatus,
|
| 412 |
+
props: elementProps,
|
| 413 |
+
refs: [forwardedRef, setPositionerElement],
|
| 414 |
+
hidden: !mounted,
|
| 415 |
+
inert: !open
|
| 416 |
+
});
|
| 417 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(PopoverPositionerContext.Provider, {
|
| 418 |
+
value: positioning,
|
| 419 |
+
children: [mounted && modal === true && openReason !== "trigger-hover" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InternalBackdrop, {
|
| 420 |
+
ref: store.context.internalBackdropRef,
|
| 421 |
+
inert: inertValue(!open),
|
| 422 |
+
cutout: triggerElement
|
| 423 |
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingNode, {
|
| 424 |
+
id: nodeId,
|
| 425 |
+
children: element
|
| 426 |
+
})]
|
| 427 |
+
});
|
| 428 |
+
});
|
| 429 |
+
PopoverPositioner.displayName = "PopoverPositioner";
|
| 430 |
+
//#endregion
|
| 431 |
+
//#region ../node_modules/@base-ui/react/esm/utils/closePart.js
|
| 432 |
+
var ClosePartContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 433 |
+
ClosePartContext.displayName = "ClosePartContext";
|
| 434 |
+
function useClosePartCount() {
|
| 435 |
+
const [closePartCount, setClosePartCount] = import_react.useState(0);
|
| 436 |
+
const register = useStableCallback(() => {
|
| 437 |
+
setClosePartCount((count) => count + 1);
|
| 438 |
+
return () => {
|
| 439 |
+
setClosePartCount((count) => Math.max(0, count - 1));
|
| 440 |
+
};
|
| 441 |
+
});
|
| 442 |
+
return {
|
| 443 |
+
context: import_react.useMemo(() => ({ register }), [register]),
|
| 444 |
+
hasClosePart: closePartCount > 0
|
| 445 |
+
};
|
| 446 |
+
}
|
| 447 |
+
function ClosePartProvider(props) {
|
| 448 |
+
const { value, children } = props;
|
| 449 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ClosePartContext.Provider, {
|
| 450 |
+
value,
|
| 451 |
+
children
|
| 452 |
+
});
|
| 453 |
+
}
|
| 454 |
+
function useClosePartRegistration() {
|
| 455 |
+
const context = import_react.useContext(ClosePartContext);
|
| 456 |
+
useIsoLayoutEffect(() => {
|
| 457 |
+
return context?.register();
|
| 458 |
+
}, [context]);
|
| 459 |
+
}
|
| 460 |
+
//#endregion
|
| 461 |
+
//#region ../node_modules/@base-ui/react/esm/popover/popup/PopoverPopup.js
|
| 462 |
+
var stateAttributesMapping$2 = {
|
| 463 |
+
...popupStateMapping,
|
| 464 |
+
...transitionStatusMapping
|
| 465 |
+
};
|
| 466 |
+
/**
|
| 467 |
+
* A container for the popover contents.
|
| 468 |
+
* Renders a `<div>` element.
|
| 469 |
+
*
|
| 470 |
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
| 471 |
+
*/
|
| 472 |
+
var PopoverPopup = /* @__PURE__ */ import_react.forwardRef(function PopoverPopup(componentProps, forwardedRef) {
|
| 473 |
+
const { render, className, style, initialFocus, finalFocus, ...elementProps } = componentProps;
|
| 474 |
+
const { store } = usePopoverRootContext();
|
| 475 |
+
const positioner = usePopoverPositionerContext();
|
| 476 |
+
const insideToolbar = useToolbarRootContext(true) != null;
|
| 477 |
+
const { context: closePartContext, hasClosePart } = useClosePartCount();
|
| 478 |
+
const open = store.useState("open");
|
| 479 |
+
const openMethod = store.useState("openMethod");
|
| 480 |
+
const instantType = store.useState("instantType");
|
| 481 |
+
const transitionStatus = store.useState("transitionStatus");
|
| 482 |
+
const popupProps = store.useState("popupProps");
|
| 483 |
+
const titleId = store.useState("titleElementId");
|
| 484 |
+
const descriptionId = store.useState("descriptionElementId");
|
| 485 |
+
const modal = store.useState("modal");
|
| 486 |
+
const mounted = store.useState("mounted");
|
| 487 |
+
const openReason = store.useState("openChangeReason");
|
| 488 |
+
const activeTriggerElement = store.useState("activeTriggerElement");
|
| 489 |
+
const floatingContext = store.useState("floatingRootContext");
|
| 490 |
+
const floatingId = floatingContext.useState("floatingId");
|
| 491 |
+
const disabled = store.useState("disabled");
|
| 492 |
+
const openOnHover = store.useState("openOnHover");
|
| 493 |
+
const closeDelay = store.useState("closeDelay");
|
| 494 |
+
const popupId = elementProps.id ?? floatingId;
|
| 495 |
+
useOpenChangeComplete({
|
| 496 |
+
open,
|
| 497 |
+
ref: store.context.popupRef,
|
| 498 |
+
onComplete() {
|
| 499 |
+
if (open) store.context.onOpenChangeComplete?.(true);
|
| 500 |
+
}
|
| 501 |
+
});
|
| 502 |
+
useHoverFloatingInteraction(floatingContext, {
|
| 503 |
+
enabled: openOnHover && !disabled,
|
| 504 |
+
closeDelay
|
| 505 |
+
});
|
| 506 |
+
function defaultInitialFocus(interactionType) {
|
| 507 |
+
if (interactionType === "touch") return store.context.popupRef.current;
|
| 508 |
+
return true;
|
| 509 |
+
}
|
| 510 |
+
const resolvedInitialFocus = initialFocus === void 0 ? defaultInitialFocus : initialFocus;
|
| 511 |
+
const focusManagerModal = modal !== false && hasClosePart;
|
| 512 |
+
store.useSyncedValue("focusManagerModal", focusManagerModal);
|
| 513 |
+
const setPopupElement = import_react.useCallback((element) => {
|
| 514 |
+
store.set("popupElement", element);
|
| 515 |
+
}, [store]);
|
| 516 |
+
const element = useRenderElement("div", componentProps, {
|
| 517 |
+
state: {
|
| 518 |
+
open,
|
| 519 |
+
side: positioner.side,
|
| 520 |
+
align: positioner.align,
|
| 521 |
+
instant: instantType,
|
| 522 |
+
transitionStatus
|
| 523 |
+
},
|
| 524 |
+
ref: [
|
| 525 |
+
forwardedRef,
|
| 526 |
+
store.context.popupRef,
|
| 527 |
+
setPopupElement
|
| 528 |
+
],
|
| 529 |
+
props: [
|
| 530 |
+
popupProps,
|
| 531 |
+
{
|
| 532 |
+
id: popupId,
|
| 533 |
+
role: "dialog",
|
| 534 |
+
...FOCUSABLE_POPUP_PROPS,
|
| 535 |
+
"aria-labelledby": titleId,
|
| 536 |
+
"aria-describedby": descriptionId,
|
| 537 |
+
onKeyDown(event) {
|
| 538 |
+
if (insideToolbar && COMPOSITE_KEYS.has(event.key)) event.stopPropagation();
|
| 539 |
+
}
|
| 540 |
+
},
|
| 541 |
+
getDisabledMountTransitionStyles(transitionStatus),
|
| 542 |
+
elementProps
|
| 543 |
+
],
|
| 544 |
+
stateAttributesMapping: stateAttributesMapping$2
|
| 545 |
+
});
|
| 546 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingFocusManager, {
|
| 547 |
+
context: floatingContext,
|
| 548 |
+
openInteractionType: openMethod,
|
| 549 |
+
modal: focusManagerModal,
|
| 550 |
+
disabled: !mounted || openReason === "trigger-hover",
|
| 551 |
+
initialFocus: resolvedInitialFocus,
|
| 552 |
+
returnFocus: finalFocus,
|
| 553 |
+
restoreFocus: "popup",
|
| 554 |
+
previousFocusableElement: isHTMLElement(activeTriggerElement) ? activeTriggerElement : void 0,
|
| 555 |
+
nextFocusableElement: store.context.triggerFocusTargetRef,
|
| 556 |
+
beforeContentFocusGuardRef: store.context.beforeContentFocusGuardRef,
|
| 557 |
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ClosePartProvider, {
|
| 558 |
+
value: closePartContext,
|
| 559 |
+
children: element
|
| 560 |
+
})
|
| 561 |
+
});
|
| 562 |
+
});
|
| 563 |
+
PopoverPopup.displayName = "PopoverPopup";
|
| 564 |
+
//#endregion
|
| 565 |
+
//#region ../node_modules/@base-ui/react/esm/popover/arrow/PopoverArrow.js
|
| 566 |
+
/**
|
| 567 |
+
* Displays an element positioned against the popover anchor.
|
| 568 |
+
* Renders a `<div>` element.
|
| 569 |
+
*
|
| 570 |
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
| 571 |
+
*/
|
| 572 |
+
var PopoverArrow = /* @__PURE__ */ import_react.forwardRef(function PopoverArrow(componentProps, forwardedRef) {
|
| 573 |
+
const { render, className, style, ...elementProps } = componentProps;
|
| 574 |
+
const { store } = usePopoverRootContext();
|
| 575 |
+
const open = store.useState("open");
|
| 576 |
+
const { arrowRef, side, align, arrowUncentered, arrowStyles } = usePopoverPositionerContext();
|
| 577 |
+
return useRenderElement("div", componentProps, {
|
| 578 |
+
state: {
|
| 579 |
+
open,
|
| 580 |
+
side,
|
| 581 |
+
align,
|
| 582 |
+
uncentered: arrowUncentered
|
| 583 |
+
},
|
| 584 |
+
ref: [forwardedRef, arrowRef],
|
| 585 |
+
props: [{
|
| 586 |
+
style: arrowStyles,
|
| 587 |
+
"aria-hidden": true
|
| 588 |
+
}, elementProps],
|
| 589 |
+
stateAttributesMapping: popupStateMapping
|
| 590 |
+
});
|
| 591 |
+
});
|
| 592 |
+
PopoverArrow.displayName = "PopoverArrow";
|
| 593 |
+
//#endregion
|
| 594 |
+
//#region ../node_modules/@base-ui/react/esm/popover/backdrop/PopoverBackdrop.js
|
| 595 |
+
var stateAttributesMapping$1 = {
|
| 596 |
+
...popupStateMapping,
|
| 597 |
+
...transitionStatusMapping
|
| 598 |
+
};
|
| 599 |
+
/**
|
| 600 |
+
* An overlay displayed beneath the popover.
|
| 601 |
+
* Renders a `<div>` element.
|
| 602 |
+
*
|
| 603 |
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
| 604 |
+
*/
|
| 605 |
+
var PopoverBackdrop = /* @__PURE__ */ import_react.forwardRef(function PopoverBackdrop(props, forwardedRef) {
|
| 606 |
+
const { render, className, style, ...elementProps } = props;
|
| 607 |
+
const { store } = usePopoverRootContext();
|
| 608 |
+
const open = store.useState("open");
|
| 609 |
+
const mounted = store.useState("mounted");
|
| 610 |
+
const transitionStatus = store.useState("transitionStatus");
|
| 611 |
+
const openReason = store.useState("openChangeReason");
|
| 612 |
+
return useRenderElement("div", props, {
|
| 613 |
+
state: {
|
| 614 |
+
open,
|
| 615 |
+
transitionStatus
|
| 616 |
+
},
|
| 617 |
+
ref: [store.context.backdropRef, forwardedRef],
|
| 618 |
+
props: [{
|
| 619 |
+
role: "presentation",
|
| 620 |
+
hidden: !mounted,
|
| 621 |
+
style: {
|
| 622 |
+
pointerEvents: openReason === "trigger-hover" ? "none" : void 0,
|
| 623 |
+
userSelect: "none",
|
| 624 |
+
WebkitUserSelect: "none"
|
| 625 |
+
}
|
| 626 |
+
}, elementProps],
|
| 627 |
+
stateAttributesMapping: stateAttributesMapping$1
|
| 628 |
+
});
|
| 629 |
+
});
|
| 630 |
+
PopoverBackdrop.displayName = "PopoverBackdrop";
|
| 631 |
+
//#endregion
|
| 632 |
+
//#region ../node_modules/@base-ui/react/esm/popover/title/PopoverTitle.js
|
| 633 |
+
/**
|
| 634 |
+
* A heading that labels the popover.
|
| 635 |
+
* Renders an `<h2>` element.
|
| 636 |
+
*
|
| 637 |
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
| 638 |
+
*/
|
| 639 |
+
var PopoverTitle = /* @__PURE__ */ import_react.forwardRef(function PopoverTitle(componentProps, forwardedRef) {
|
| 640 |
+
const { render, className, style, ...elementProps } = componentProps;
|
| 641 |
+
const { store } = usePopoverRootContext();
|
| 642 |
+
const id = useBaseUiId(elementProps.id);
|
| 643 |
+
store.useSyncedValueWithCleanup("titleElementId", id);
|
| 644 |
+
return useRenderElement("h2", componentProps, {
|
| 645 |
+
ref: forwardedRef,
|
| 646 |
+
props: [{ id }, elementProps]
|
| 647 |
+
});
|
| 648 |
+
});
|
| 649 |
+
PopoverTitle.displayName = "PopoverTitle";
|
| 650 |
+
//#endregion
|
| 651 |
+
//#region ../node_modules/@base-ui/react/esm/popover/description/PopoverDescription.js
|
| 652 |
+
/**
|
| 653 |
+
* A paragraph with additional information about the popover.
|
| 654 |
+
* Renders a `<p>` element.
|
| 655 |
+
*
|
| 656 |
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
| 657 |
+
*/
|
| 658 |
+
var PopoverDescription = /* @__PURE__ */ import_react.forwardRef(function PopoverDescription(componentProps, forwardedRef) {
|
| 659 |
+
const { render, className, style, ...elementProps } = componentProps;
|
| 660 |
+
const { store } = usePopoverRootContext();
|
| 661 |
+
const id = useBaseUiId(elementProps.id);
|
| 662 |
+
store.useSyncedValueWithCleanup("descriptionElementId", id);
|
| 663 |
+
return useRenderElement("p", componentProps, {
|
| 664 |
+
ref: forwardedRef,
|
| 665 |
+
props: [{ id }, elementProps]
|
| 666 |
+
});
|
| 667 |
+
});
|
| 668 |
+
PopoverDescription.displayName = "PopoverDescription";
|
| 669 |
+
//#endregion
|
| 670 |
+
//#region ../node_modules/@base-ui/react/esm/popover/close/PopoverClose.js
|
| 671 |
+
/**
|
| 672 |
+
* A button that closes the popover.
|
| 673 |
+
* Renders a `<button>` element.
|
| 674 |
+
*
|
| 675 |
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
| 676 |
+
*/
|
| 677 |
+
var PopoverClose = /* @__PURE__ */ import_react.forwardRef(function PopoverClose(componentProps, forwardedRef) {
|
| 678 |
+
const { render, className, style, disabled = false, nativeButton = true, ...elementProps } = componentProps;
|
| 679 |
+
const { buttonRef, getButtonProps } = useButton({
|
| 680 |
+
disabled,
|
| 681 |
+
focusableWhenDisabled: false,
|
| 682 |
+
native: nativeButton
|
| 683 |
+
});
|
| 684 |
+
const { store } = usePopoverRootContext();
|
| 685 |
+
useClosePartRegistration();
|
| 686 |
+
return useRenderElement("button", componentProps, {
|
| 687 |
+
ref: [forwardedRef, buttonRef],
|
| 688 |
+
props: [
|
| 689 |
+
{ onClick(event) {
|
| 690 |
+
store.setOpen(false, createChangeEventDetails(closePress, event.nativeEvent));
|
| 691 |
+
} },
|
| 692 |
+
elementProps,
|
| 693 |
+
getButtonProps
|
| 694 |
+
]
|
| 695 |
+
});
|
| 696 |
+
});
|
| 697 |
+
PopoverClose.displayName = "PopoverClose";
|
| 698 |
+
//#endregion
|
| 699 |
+
//#region ../node_modules/@base-ui/react/esm/popover/viewport/PopoverViewportCssVars.js
|
| 700 |
+
var PopoverViewportCssVars = /* @__PURE__ */ function(PopoverViewportCssVars) {
|
| 701 |
+
/**
|
| 702 |
+
* The width of the parent popup.
|
| 703 |
+
* This variable is placed on the 'previous' container and stores the width of the popup when the previous content was rendered.
|
| 704 |
+
* It can be used to freeze the dimensions of the popup when animating between different content.
|
| 705 |
+
*/
|
| 706 |
+
PopoverViewportCssVars["popupWidth"] = "--popup-width";
|
| 707 |
+
/**
|
| 708 |
+
* The height of the parent popup.
|
| 709 |
+
* This variable is placed on the 'previous' container and stores the height of the popup when the previous content was rendered.
|
| 710 |
+
* It can be used to freeze the dimensions of the popup when animating between different content.
|
| 711 |
+
*/
|
| 712 |
+
PopoverViewportCssVars["popupHeight"] = "--popup-height";
|
| 713 |
+
return PopoverViewportCssVars;
|
| 714 |
+
}({});
|
| 715 |
+
//#endregion
|
| 716 |
+
//#region ../node_modules/@base-ui/react/esm/popover/viewport/PopoverViewport.js
|
| 717 |
+
var stateAttributesMapping = { activationDirection: (value) => value ? { "data-activation-direction": value } : null };
|
| 718 |
+
/**
|
| 719 |
+
* A viewport for displaying content transitions.
|
| 720 |
+
* This component is only required if one popup can be opened by multiple triggers, its content
|
| 721 |
+
* changes based on the trigger, and switching between them is animated.
|
| 722 |
+
* Renders a `<div>` element.
|
| 723 |
+
*
|
| 724 |
+
* Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)
|
| 725 |
+
*/
|
| 726 |
+
var PopoverViewport = /* @__PURE__ */ import_react.forwardRef(function PopoverViewport(componentProps, forwardedRef) {
|
| 727 |
+
const { render, className, style, children, ...elementProps } = componentProps;
|
| 728 |
+
const { store } = usePopoverRootContext();
|
| 729 |
+
const { side } = usePopoverPositionerContext();
|
| 730 |
+
const instantType = store.useState("instantType");
|
| 731 |
+
const { children: childrenToRender, state: viewportState } = usePopupViewport({
|
| 732 |
+
store,
|
| 733 |
+
side,
|
| 734 |
+
cssVars: PopoverViewportCssVars,
|
| 735 |
+
children
|
| 736 |
+
});
|
| 737 |
+
return useRenderElement("div", componentProps, {
|
| 738 |
+
state: {
|
| 739 |
+
activationDirection: viewportState.activationDirection,
|
| 740 |
+
transitioning: viewportState.transitioning,
|
| 741 |
+
instant: instantType
|
| 742 |
+
},
|
| 743 |
+
ref: forwardedRef,
|
| 744 |
+
props: [elementProps, { children: childrenToRender }],
|
| 745 |
+
stateAttributesMapping
|
| 746 |
+
});
|
| 747 |
+
});
|
| 748 |
+
PopoverViewport.displayName = "PopoverViewport";
|
| 749 |
+
//#endregion
|
| 750 |
+
//#region ../node_modules/@base-ui/react/esm/popover/store/PopoverHandle.js
|
| 751 |
+
var PopoverHandle = class {
|
| 752 |
+
/**
|
| 753 |
+
* Internal store holding the popover's state.
|
| 754 |
+
* @internal
|
| 755 |
+
*/
|
| 756 |
+
constructor() {
|
| 757 |
+
this.store = new PopoverStore();
|
| 758 |
+
}
|
| 759 |
+
/**
|
| 760 |
+
* Opens the popover and associates it with the trigger with the given id.
|
| 761 |
+
* The trigger must be a Popover.Trigger component with this handle passed as a prop.
|
| 762 |
+
*
|
| 763 |
+
* @param triggerId ID of the trigger to associate with the popover.
|
| 764 |
+
*/
|
| 765 |
+
open(triggerId) {
|
| 766 |
+
const triggerElement = triggerId ? this.store.context.triggerElements.getById(triggerId) ?? void 0 : void 0;
|
| 767 |
+
if (triggerId && !triggerElement) throw new Error(`Base UI: PopoverHandle.open: No trigger found with id "${triggerId}".`);
|
| 768 |
+
this.store.setOpen(true, createChangeEventDetails(imperativeAction, void 0, triggerElement));
|
| 769 |
+
}
|
| 770 |
+
/**
|
| 771 |
+
* Closes the popover.
|
| 772 |
+
*/
|
| 773 |
+
close() {
|
| 774 |
+
this.store.setOpen(false, createChangeEventDetails(imperativeAction, void 0, void 0));
|
| 775 |
+
}
|
| 776 |
+
/**
|
| 777 |
+
* Indicates whether the popover is currently open.
|
| 778 |
+
*/
|
| 779 |
+
get isOpen() {
|
| 780 |
+
return this.store.select("open");
|
| 781 |
+
}
|
| 782 |
+
};
|
| 783 |
+
/**
|
| 784 |
+
* Creates a new handle to connect a Popover.Root with detached Popover.Trigger components.
|
| 785 |
+
*/
|
| 786 |
+
function createPopoverHandle() {
|
| 787 |
+
return new PopoverHandle();
|
| 788 |
+
}
|
| 789 |
+
//#endregion
|
| 790 |
+
//#region ../node_modules/@base-ui/react/esm/popover/index.parts.js
|
| 791 |
+
var index_parts_exports = /* @__PURE__ */ __exportAll({
|
| 792 |
+
Arrow: () => PopoverArrow,
|
| 793 |
+
Backdrop: () => PopoverBackdrop,
|
| 794 |
+
Close: () => PopoverClose,
|
| 795 |
+
Description: () => PopoverDescription,
|
| 796 |
+
Handle: () => PopoverHandle,
|
| 797 |
+
Popup: () => PopoverPopup,
|
| 798 |
+
Portal: () => PopoverPortal,
|
| 799 |
+
Positioner: () => PopoverPositioner,
|
| 800 |
+
Root: () => PopoverRoot,
|
| 801 |
+
Title: () => PopoverTitle,
|
| 802 |
+
Trigger: () => PopoverTrigger,
|
| 803 |
+
Viewport: () => PopoverViewport,
|
| 804 |
+
createHandle: () => createPopoverHandle
|
| 805 |
+
});
|
| 806 |
+
//#endregion
|
| 807 |
+
export { index_parts_exports as Popover };
|
| 808 |
+
|
| 809 |
+
//# sourceMappingURL=@base-ui_react_popover.js.map
|
client/node_modules/.vite/deps/@base-ui_react_popover.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"@base-ui_react_popover.js","names":["REASONS.triggerHover","REASONS.imperativeAction","stateAttributesMapping","baseMapping","stateAttributesMapping","baseMapping","REASONS.closePress","REASONS.imperativeAction"],"sources":["../../../../node_modules/@base-ui/react/esm/popover/root/PopoverRootContext.js","../../../../node_modules/@base-ui/react/esm/popover/store/PopoverStore.js","../../../../node_modules/@base-ui/react/esm/popover/root/PopoverRoot.js","../../../../node_modules/@base-ui/react/esm/popover/trigger/PopoverTrigger.js","../../../../node_modules/@base-ui/react/esm/popover/portal/PopoverPortalContext.js","../../../../node_modules/@base-ui/react/esm/popover/portal/PopoverPortal.js","../../../../node_modules/@base-ui/react/esm/popover/positioner/PopoverPositionerContext.js","../../../../node_modules/@base-ui/react/esm/popover/positioner/PopoverPositioner.js","../../../../node_modules/@base-ui/react/esm/utils/closePart.js","../../../../node_modules/@base-ui/react/esm/popover/popup/PopoverPopup.js","../../../../node_modules/@base-ui/react/esm/popover/arrow/PopoverArrow.js","../../../../node_modules/@base-ui/react/esm/popover/backdrop/PopoverBackdrop.js","../../../../node_modules/@base-ui/react/esm/popover/title/PopoverTitle.js","../../../../node_modules/@base-ui/react/esm/popover/description/PopoverDescription.js","../../../../node_modules/@base-ui/react/esm/popover/close/PopoverClose.js","../../../../node_modules/@base-ui/react/esm/popover/viewport/PopoverViewportCssVars.js","../../../../node_modules/@base-ui/react/esm/popover/viewport/PopoverViewport.js","../../../../node_modules/@base-ui/react/esm/popover/store/PopoverHandle.js","../../../../node_modules/@base-ui/react/esm/popover/index.parts.js"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const PopoverRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") PopoverRootContext.displayName = \"PopoverRootContext\";\nexport function usePopoverRootContext(optional) {\n const context = React.useContext(PopoverRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.' : _formatErrorMessage(47));\n }\n return context;\n}","/* eslint-disable react-hooks/rules-of-hooks */\n'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { ReactStore, createSelector } from '@base-ui/utils/store';\nimport { Timeout } from '@base-ui/utils/useTimeout';\nimport { REASONS } from \"../../internals/reasons.js\";\nimport { createPopupFloatingRootContext, createInitialPopupStoreState, popupStoreSelectors, PopupTriggerMap, setOpenTriggerState, usePopupStore } from \"../../utils/popups/index.js\";\nimport { PATIENT_CLICK_THRESHOLD } from \"../../internals/constants.js\";\nfunction createInitialState() {\n return {\n ...createInitialPopupStoreState(),\n disabled: false,\n modal: false,\n focusManagerModal: false,\n instantType: undefined,\n openMethod: null,\n openChangeReason: null,\n titleElementId: undefined,\n descriptionElementId: undefined,\n stickIfOpen: true,\n nested: false,\n openOnHover: false,\n closeDelay: 0,\n hasViewport: false\n };\n}\nconst selectors = {\n ...popupStoreSelectors,\n disabled: createSelector(state => state.disabled),\n instantType: createSelector(state => state.instantType),\n openMethod: createSelector(state => state.openMethod),\n openChangeReason: createSelector(state => state.openChangeReason),\n modal: createSelector(state => state.modal),\n focusManagerModal: createSelector(state => state.focusManagerModal),\n stickIfOpen: createSelector(state => state.stickIfOpen),\n titleElementId: createSelector(state => state.titleElementId),\n descriptionElementId: createSelector(state => state.descriptionElementId),\n openOnHover: createSelector(state => state.openOnHover),\n closeDelay: createSelector(state => state.closeDelay),\n hasViewport: createSelector(state => state.hasViewport)\n};\nexport class PopoverStore extends ReactStore {\n constructor(initialState, floatingId, nested = false) {\n const initial = {\n ...createInitialState(),\n ...initialState\n };\n const triggerElements = new PopupTriggerMap();\n if (initial.open && initialState?.mounted === undefined) {\n initial.mounted = true;\n }\n initial.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested);\n super(initial, {\n popupRef: /*#__PURE__*/React.createRef(),\n backdropRef: /*#__PURE__*/React.createRef(),\n internalBackdropRef: /*#__PURE__*/React.createRef(),\n onOpenChange: undefined,\n onOpenChangeComplete: undefined,\n triggerFocusTargetRef: /*#__PURE__*/React.createRef(),\n beforeContentFocusGuardRef: /*#__PURE__*/React.createRef(),\n stickIfOpenTimeout: new Timeout(),\n triggerElements\n }, selectors);\n }\n setOpen = (nextOpen, eventDetails) => {\n const isHover = eventDetails.reason === REASONS.triggerHover;\n const isKeyboardClick = eventDetails.reason === REASONS.triggerPress && eventDetails.event.detail === 0;\n const isDismissClose = !nextOpen && (eventDetails.reason === REASONS.escapeKey || eventDetails.reason == null);\n eventDetails.preventUnmountOnClose = () => {\n this.set('preventUnmountingOnClose', true);\n };\n const activeTriggerId = this.select('activeTriggerId');\n if (!nextOpen && eventDetails.reason === REASONS.closePress && eventDetails.trigger == null && activeTriggerId != null) {\n eventDetails.trigger = this.context.triggerElements.getById(activeTriggerId) ?? this.select('activeTriggerElement') ?? undefined;\n }\n this.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const changeState = () => {\n const updatedState = {\n open: nextOpen,\n openChangeReason: eventDetails.reason\n };\n setOpenTriggerState(updatedState, nextOpen, eventDetails.trigger);\n this.update(updatedState);\n };\n if (isHover) {\n // Only allow \"patient\" clicks to close the popover if it's open.\n // If they clicked within 500ms of the popover opening, keep it open.\n this.set('stickIfOpen', true);\n this.context.stickIfOpenTimeout.start(PATIENT_CLICK_THRESHOLD, () => {\n this.set('stickIfOpen', false);\n });\n ReactDOM.flushSync(changeState);\n } else {\n changeState();\n }\n if (isKeyboardClick || isDismissClose) {\n this.set('instantType', isKeyboardClick ? 'click' : 'dismiss');\n } else if (eventDetails.reason === REASONS.focusOut) {\n this.set('instantType', 'focus');\n } else {\n this.set('instantType', undefined);\n }\n };\n static useStore(externalStore, initialState) {\n const {\n store,\n internalStore\n } = usePopupStore(externalStore, (floatingId, nested) => new PopoverStore(initialState, floatingId, nested));\n React.useEffect(() => internalStore?.disposeEffect(), [internalStore]);\n return store;\n }\n disposeEffect = () => {\n return this.context.stickIfOpenTimeout.disposeEffect();\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { useDismiss, FloatingTree, useFloatingParentNodeId } from \"../../floating-ui-react/index.js\";\nimport { PopoverRootContext, usePopoverRootContext } from \"./PopoverRootContext.js\";\nimport { PopoverStore } from \"../store/PopoverStore.js\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../internals/reasons.js\";\nimport { FOCUSABLE_POPUP_PROPS, useImplicitActiveTrigger, useOpenStateTransitions, usePopupInteractionProps, usePopupRootSync } from \"../../utils/popups/index.js\";\nimport { mergeProps } from \"../../merge-props/index.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction PopoverRootComponent({\n props\n}) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n modal = false,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null\n } = props;\n const store = PopoverStore.useStore(handle?.store, {\n modal,\n open: defaultOpen,\n openProp,\n activeTriggerId: defaultTriggerIdProp,\n triggerIdProp\n });\n\n // Support initially open state when uncontrolled\n useOnFirstRender(() => {\n if (openProp === undefined && store.state.open === false && defaultOpen === true) {\n store.update({\n open: true,\n activeTriggerId: defaultTriggerIdProp\n });\n }\n });\n store.useControlledProp('openProp', openProp);\n store.useControlledProp('triggerIdProp', triggerIdProp);\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const payload = store.useState('payload');\n const nested = useFloatingParentNodeId() != null;\n store.useContextCallback('onOpenChange', onOpenChange);\n store.useContextCallback('onOpenChangeComplete', onOpenChangeComplete);\n usePopupRootSync(store, open);\n useImplicitActiveTrigger(store);\n const {\n forceUnmount\n } = useOpenStateTransitions(open, store, () => {\n store.update({\n stickIfOpen: true,\n openChangeReason: null\n });\n });\n store.useSyncedValues({\n modal,\n nested\n });\n React.useEffect(() => {\n if (!open) {\n store.context.stickIfOpenTimeout.clear();\n }\n }, [store, open]);\n const handleImperativeClose = React.useCallback(() => {\n store.setOpen(false, createChangeEventDetails(REASONS.imperativeAction));\n }, [store]);\n React.useImperativeHandle(props.actionsRef, () => ({\n unmount: forceUnmount,\n close: handleImperativeClose\n }), [forceUnmount, handleImperativeClose]);\n const shouldRenderInteractions = open || mounted;\n const popoverContext = React.useMemo(() => ({\n store\n }), [store]);\n return /*#__PURE__*/_jsxs(PopoverRootContext.Provider, {\n value: popoverContext,\n children: [shouldRenderInteractions && /*#__PURE__*/_jsx(PopoverInteractions, {\n store: store,\n modal: modal\n }), typeof children === 'function' ? children({\n payload\n }) : children]\n });\n}\n\n/**\n * Groups all parts of the popover.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nexport function PopoverRoot(props) {\n if (usePopoverRootContext(true)) {\n return /*#__PURE__*/_jsx(PopoverRootComponent, {\n props: props\n });\n }\n return /*#__PURE__*/_jsx(FloatingTree, {\n children: /*#__PURE__*/_jsx(PopoverRootComponent, {\n props: props\n })\n });\n}\nfunction PopoverInteractions({\n store,\n modal\n}) {\n const floatingRootContext = store.useState('floatingRootContext');\n const dismiss = useDismiss(floatingRootContext, {\n outsidePressEvent: {\n // Ensure `aria-hidden` on outside elements is removed immediately\n // on outside press when trapping focus.\n mouse: modal === 'trap-focus' ? 'sloppy' : 'intentional',\n touch: 'sloppy'\n }\n });\n const activeTriggerProps = dismiss.reference ?? EMPTY_OBJECT;\n const inactiveTriggerProps = dismiss.trigger ?? EMPTY_OBJECT;\n const popupProps = React.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, dismiss.floating), [dismiss.floating]);\n usePopupInteractionProps(store, {\n activeTriggerProps,\n inactiveTriggerProps,\n popupProps\n });\n return null;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { useButton } from \"../../internals/use-button/useButton.js\";\nimport { triggerOpenStateMapping, pressableTriggerOpenStateMapping } from \"../../utils/popupStateMapping.js\";\nimport { useRenderElement } from \"../../internals/useRenderElement.js\";\nimport { CLICK_TRIGGER_IDENTIFIER } from \"../../internals/constants.js\";\nimport { safePolygon, useClick, useHoverReferenceInteraction } from \"../../floating-ui-react/index.js\";\nimport { OPEN_DELAY } from \"../utils/constants.js\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.js\";\nimport { FocusGuard } from \"../../utils/FocusGuard.js\";\nimport { REASONS } from \"../../internals/reasons.js\";\nimport { useTriggerDataForwarding } from \"../../utils/popups/index.js\";\nimport { useTriggerFocusGuards } from \"../../utils/popups/useTriggerFocusGuards.js\";\nimport { useOpenMethodTriggerProps } from \"../../utils/useOpenInteractionType.js\";\n\n/**\n * A button that opens the popover.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const PopoverTrigger = /*#__PURE__*/React.forwardRef(function PopoverTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n disabled = false,\n nativeButton = true,\n handle,\n payload,\n openOnHover = false,\n delay = OPEN_DELAY,\n closeDelay = 0,\n id: idProp,\n ...elementProps\n } = componentProps;\n const rootContext = usePopoverRootContext(true);\n const store = handle?.store ?? rootContext?.store;\n if (!store) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle.' : _formatErrorMessage(74));\n }\n const thisTriggerId = useBaseUiId(idProp);\n const isTriggerActive = store.useState('isTriggerActive', thisTriggerId);\n const floatingContext = store.useState('floatingRootContext');\n const isOpenedByThisTrigger = store.useState('isOpenedByTrigger', thisTriggerId);\n const popupId = store.useState('triggerPopupId', thisTriggerId);\n const triggerElementRef = React.useRef(null);\n const {\n registerTrigger,\n isMountedByThisTrigger\n } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {\n payload,\n disabled,\n openOnHover,\n closeDelay\n });\n const openReason = store.useState('openChangeReason');\n const stickIfOpen = store.useState('stickIfOpen');\n const openMethod = store.useState('openMethod');\n const focusManagerModal = store.useState('focusManagerModal');\n const hoverProps = useHoverReferenceInteraction(floatingContext, {\n enabled: floatingContext != null && openOnHover && (openMethod !== 'touch' || openReason !== REASONS.triggerPress),\n mouseOnly: true,\n move: false,\n handleClose: safePolygon(),\n restMs: delay,\n delay: {\n close: closeDelay\n },\n triggerElementRef,\n isActiveTrigger: isTriggerActive,\n isClosing: () => store.select('transitionStatus') === 'ending'\n });\n const click = useClick(floatingContext, {\n enabled: floatingContext != null,\n stickIfOpen\n });\n const interactionTypeProps = useOpenMethodTriggerProps(() => store.select('open'), interactionType => {\n store.set('openMethod', interactionType);\n });\n const rootTriggerProps = store.useState('triggerProps', isMountedByThisTrigger);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const stateAttributesMapping = {\n open(value) {\n if (value && openReason === REASONS.triggerPress) {\n return pressableTriggerOpenStateMapping.open(value);\n }\n return triggerOpenStateMapping.open(value);\n }\n };\n const {\n preFocusGuardRef,\n handlePreFocusGuardFocus,\n handleFocusTargetFocus\n } = useTriggerFocusGuards(store, triggerElementRef);\n const state = {\n disabled,\n open: isOpenedByThisTrigger\n };\n const element = useRenderElement('button', componentProps, {\n state,\n ref: [buttonRef, forwardedRef, registerTrigger, triggerElementRef],\n props: [click.reference, hoverProps, rootTriggerProps, interactionTypeProps, {\n [CLICK_TRIGGER_IDENTIFIER]: '',\n id: thisTriggerId,\n 'aria-haspopup': 'dialog',\n 'aria-expanded': isOpenedByThisTrigger,\n 'aria-controls': popupId\n }, elementProps, getButtonProps],\n stateAttributesMapping\n });\n\n // A fragment with key is required to ensure that the `element` is mounted to the same DOM node\n // regardless of whether the focus guards are rendered or not.\n\n if (isMountedByThisTrigger && !focusManagerModal) {\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(FocusGuard, {\n ref: preFocusGuardRef,\n onFocus: handlePreFocusGuardFocus\n }), /*#__PURE__*/_jsx(React.Fragment, {\n children: element\n }, thisTriggerId), /*#__PURE__*/_jsx(FocusGuard, {\n ref: store.context.triggerFocusTargetRef,\n onFocus: handleFocusTargetFocus\n })]\n });\n }\n return /*#__PURE__*/_jsx(React.Fragment, {\n children: element\n }, thisTriggerId);\n});\nif (process.env.NODE_ENV !== \"production\") PopoverTrigger.displayName = \"PopoverTrigger\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const PopoverPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") PopoverPortalContext.displayName = \"PopoverPortalContext\";\nexport function usePopoverPortalContext() {\n const value = React.useContext(PopoverPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Popover.Portal> is missing.' : _formatErrorMessage(45));\n }\n return value;\n}","'use client';\n\nimport * as React from 'react';\nimport { FloatingPortal } from \"../../floating-ui-react/index.js\";\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { PopoverPortalContext } from \"./PopoverPortalContext.js\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const PopoverPortal = /*#__PURE__*/React.forwardRef(function PopoverPortal(props, forwardedRef) {\n const {\n keepMounted = false,\n ...portalProps\n } = props;\n const {\n store\n } = usePopoverRootContext();\n const mounted = store.useState('mounted');\n const shouldRender = mounted || keepMounted;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(PopoverPortalContext.Provider, {\n value: keepMounted,\n children: /*#__PURE__*/_jsx(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") PopoverPortal.displayName = \"PopoverPortal\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const PopoverPositionerContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") PopoverPositionerContext.displayName = \"PopoverPositionerContext\";\nexport function usePopoverPositionerContext() {\n const context = React.useContext(PopoverPositionerContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.' : _formatErrorMessage(46));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { FloatingNode, useFloatingNodeId } from \"../../floating-ui-react/index.js\";\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { PopoverPositionerContext } from \"./PopoverPositionerContext.js\";\nimport { useAnchorPositioning } from \"../../utils/useAnchorPositioning.js\";\nimport { usePopoverPortalContext } from \"../portal/PopoverPortalContext.js\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.js\";\nimport { REASONS } from \"../../internals/reasons.js\";\nimport { POPUP_COLLISION_AVOIDANCE } from \"../../internals/constants.js\";\nimport { useAnimationsFinished } from \"../../internals/useAnimationsFinished.js\";\nimport { adaptiveOrigin } from \"../../utils/adaptiveOriginMiddleware.js\";\nimport { usePositioner } from \"../../utils/usePositioner.js\";\nimport { useAnchoredPopupScrollLock } from \"../../utils/useAnchoredPopupScrollLock.js\";\n\n/**\n * Positions the popover against the trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const PopoverPositioner = /*#__PURE__*/React.forwardRef(function PopoverPositioner(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n anchor,\n positionMethod = 'absolute',\n side = 'bottom',\n align = 'center',\n sideOffset = 0,\n alignOffset = 0,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding = 5,\n arrowPadding = 5,\n sticky = false,\n disableAnchorTracking = false,\n collisionAvoidance = POPUP_COLLISION_AVOIDANCE,\n ...elementProps\n } = componentProps;\n const {\n store\n } = usePopoverRootContext();\n const keepMounted = usePopoverPortalContext();\n const nodeId = useFloatingNodeId();\n const floatingRootContext = store.useState('floatingRootContext');\n const mounted = store.useState('mounted');\n const open = store.useState('open');\n const openReason = store.useState('openChangeReason');\n const triggerElement = store.useState('activeTriggerElement');\n const modal = store.useState('modal');\n const openMethod = store.useState('openMethod');\n const positionerElement = store.useState('positionerElement');\n const instantType = store.useState('instantType');\n const transitionStatus = store.useState('transitionStatus');\n const hasViewport = store.useState('hasViewport');\n const prevTriggerElementRef = React.useRef(null);\n const runOnceAnimationsFinish = useAnimationsFinished(positionerElement, false, false);\n const positioning = useAnchorPositioning({\n anchor,\n floatingRootContext,\n positionMethod,\n mounted,\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n disableAnchorTracking,\n keepMounted,\n nodeId,\n collisionAvoidance,\n adaptiveOrigin: hasViewport ? adaptiveOrigin : undefined\n });\n const domReference = floatingRootContext.useState('domReferenceElement');\n\n // When the current trigger element changes, enable transitions on the\n // positioner temporarily\n useIsoLayoutEffect(() => {\n const currentTriggerElement = domReference;\n const prevTriggerElement = prevTriggerElementRef.current;\n if (currentTriggerElement) {\n prevTriggerElementRef.current = currentTriggerElement;\n }\n if (prevTriggerElement && currentTriggerElement && currentTriggerElement !== prevTriggerElement) {\n store.set('instantType', undefined);\n const ac = new AbortController();\n runOnceAnimationsFinish(() => {\n store.set('instantType', 'trigger-change');\n }, ac.signal);\n return () => {\n ac.abort();\n };\n }\n return undefined;\n }, [domReference, runOnceAnimationsFinish, store]);\n useAnchoredPopupScrollLock(open && modal === true && openReason !== REASONS.triggerHover, openMethod === 'touch', positionerElement, triggerElement);\n const setPositionerElement = React.useCallback(element => {\n store.set('positionerElement', element);\n }, [store]);\n const state = {\n open,\n side: positioning.side,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden,\n instant: instantType\n };\n const element = usePositioner(componentProps, state, {\n styles: positioning.positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, setPositionerElement],\n hidden: !mounted,\n inert: !open\n });\n return /*#__PURE__*/_jsxs(PopoverPositionerContext.Provider, {\n value: positioning,\n children: [mounted && modal === true && openReason !== REASONS.triggerHover && /*#__PURE__*/_jsx(InternalBackdrop, {\n ref: store.context.internalBackdropRef,\n inert: inertValue(!open),\n cutout: triggerElement\n }), /*#__PURE__*/_jsx(FloatingNode, {\n id: nodeId,\n children: element\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") PopoverPositioner.displayName = \"PopoverPositioner\";","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst ClosePartContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ClosePartContext.displayName = \"ClosePartContext\";\nexport function useClosePartCount() {\n const [closePartCount, setClosePartCount] = React.useState(0);\n const register = useStableCallback(() => {\n setClosePartCount(count => count + 1);\n return () => {\n setClosePartCount(count => Math.max(0, count - 1));\n };\n });\n const context = React.useMemo(() => ({\n register\n }), [register]);\n return {\n context,\n hasClosePart: closePartCount > 0\n };\n}\nexport function ClosePartProvider(props) {\n const {\n value,\n children\n } = props;\n return /*#__PURE__*/_jsx(ClosePartContext.Provider, {\n value: value,\n children: children\n });\n}\nexport function useClosePartRegistration() {\n const context = React.useContext(ClosePartContext);\n useIsoLayoutEffect(() => {\n return context?.register();\n }, [context]);\n}","'use client';\n\nimport * as React from 'react';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { FloatingFocusManager, useHoverFloatingInteraction } from \"../../floating-ui-react/index.js\";\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { usePopoverPositionerContext } from \"../positioner/PopoverPositionerContext.js\";\nimport { popupStateMapping as baseMapping } from \"../../utils/popupStateMapping.js\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.js\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.js\";\nimport { useRenderElement } from \"../../internals/useRenderElement.js\";\nimport { REASONS } from \"../../internals/reasons.js\";\nimport { COMPOSITE_KEYS } from \"../../internals/composite/composite.js\";\nimport { useToolbarRootContext } from \"../../toolbar/root/ToolbarRootContext.js\";\nimport { getDisabledMountTransitionStyles } from \"../../utils/getDisabledMountTransitionStyles.js\";\nimport { ClosePartProvider, useClosePartCount } from \"../../utils/closePart.js\";\nimport { FOCUSABLE_POPUP_PROPS } from \"../../utils/popups/index.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...baseMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A container for the popover contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nexport const PopoverPopup = /*#__PURE__*/React.forwardRef(function PopoverPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n initialFocus,\n finalFocus,\n ...elementProps\n } = componentProps;\n const {\n store\n } = usePopoverRootContext();\n const positioner = usePopoverPositionerContext();\n const insideToolbar = useToolbarRootContext(true) != null;\n const {\n context: closePartContext,\n hasClosePart\n } = useClosePartCount();\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const instantType = store.useState('instantType');\n const transitionStatus = store.useState('transitionStatus');\n const popupProps = store.useState('popupProps');\n const titleId = store.useState('titleElementId');\n const descriptionId = store.useState('descriptionElementId');\n const modal = store.useState('modal');\n const mounted = store.useState('mounted');\n const openReason = store.useState('openChangeReason');\n const activeTriggerElement = store.useState('activeTriggerElement');\n const floatingContext = store.useState('floatingRootContext');\n const floatingId = floatingContext.useState('floatingId');\n const disabled = store.useState('disabled');\n const openOnHover = store.useState('openOnHover');\n const closeDelay = store.useState('closeDelay');\n const popupId = elementProps.id ?? floatingId;\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n useHoverFloatingInteraction(floatingContext, {\n enabled: openOnHover && !disabled,\n closeDelay\n });\n\n // Default initial focus logic:\n // If opened by touch, focus the popup element to prevent the virtual keyboard from opening\n // (this is required for Android specifically as iOS handles this automatically).\n function defaultInitialFocus(interactionType) {\n if (interactionType === 'touch') {\n return store.context.popupRef.current;\n }\n return true;\n }\n const resolvedInitialFocus = initialFocus === undefined ? defaultInitialFocus : initialFocus;\n const focusManagerModal = modal !== false && hasClosePart;\n store.useSyncedValue('focusManagerModal', focusManagerModal);\n const setPopupElement = React.useCallback(element => {\n store.set('popupElement', element);\n }, [store]);\n const state = {\n open,\n side: positioner.side,\n align: positioner.align,\n instant: instantType,\n transitionStatus\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, store.context.popupRef, setPopupElement],\n props: [popupProps, {\n id: popupId,\n role: 'dialog',\n ...FOCUSABLE_POPUP_PROPS,\n 'aria-labelledby': titleId,\n 'aria-describedby': descriptionId,\n onKeyDown(event) {\n if (insideToolbar && COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n }\n }, getDisabledMountTransitionStyles(transitionStatus), elementProps],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingContext,\n openInteractionType: openMethod,\n modal: focusManagerModal,\n disabled: !mounted || openReason === REASONS.triggerHover,\n initialFocus: resolvedInitialFocus,\n returnFocus: finalFocus,\n restoreFocus: \"popup\",\n previousFocusableElement: isHTMLElement(activeTriggerElement) ? activeTriggerElement : undefined,\n nextFocusableElement: store.context.triggerFocusTargetRef,\n beforeContentFocusGuardRef: store.context.beforeContentFocusGuardRef,\n children: /*#__PURE__*/_jsx(ClosePartProvider, {\n value: closePartContext,\n children: element\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") PopoverPopup.displayName = \"PopoverPopup\";","'use client';\n\nimport * as React from 'react';\nimport { usePopoverPositionerContext } from \"../positioner/PopoverPositionerContext.js\";\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.js\";\nimport { useRenderElement } from \"../../internals/useRenderElement.js\";\n\n/**\n * Displays an element positioned against the popover anchor.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nexport const PopoverArrow = /*#__PURE__*/React.forwardRef(function PopoverArrow(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = usePopoverRootContext();\n const open = store.useState('open');\n const {\n arrowRef,\n side,\n align,\n arrowUncentered,\n arrowStyles\n } = usePopoverPositionerContext();\n const state = {\n open,\n side,\n align,\n uncentered: arrowUncentered\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, arrowRef],\n props: [{\n style: arrowStyles,\n 'aria-hidden': true\n }, elementProps],\n stateAttributesMapping: popupStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") PopoverArrow.displayName = \"PopoverArrow\";","'use client';\n\nimport * as React from 'react';\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { popupStateMapping as baseMapping } from \"../../utils/popupStateMapping.js\";\nimport { transitionStatusMapping } from \"../../internals/stateAttributesMapping.js\";\nimport { useRenderElement } from \"../../internals/useRenderElement.js\";\nimport { REASONS } from \"../../internals/reasons.js\";\nconst stateAttributesMapping = {\n ...baseMapping,\n ...transitionStatusMapping\n};\n\n/**\n * An overlay displayed beneath the popover.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nexport const PopoverBackdrop = /*#__PURE__*/React.forwardRef(function PopoverBackdrop(props, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = props;\n const {\n store\n } = usePopoverRootContext();\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const transitionStatus = store.useState('transitionStatus');\n const openReason = store.useState('openChangeReason');\n const state = {\n open,\n transitionStatus\n };\n const element = useRenderElement('div', props, {\n state,\n ref: [store.context.backdropRef, forwardedRef],\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n pointerEvents: openReason === REASONS.triggerHover ? 'none' : undefined,\n userSelect: 'none',\n WebkitUserSelect: 'none'\n }\n }, elementProps],\n stateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") PopoverBackdrop.displayName = \"PopoverBackdrop\";","'use client';\n\nimport * as React from 'react';\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { useRenderElement } from \"../../internals/useRenderElement.js\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.js\";\n\n/**\n * A heading that labels the popover.\n * Renders an `<h2>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nexport const PopoverTitle = /*#__PURE__*/React.forwardRef(function PopoverTitle(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = usePopoverRootContext();\n const id = useBaseUiId(elementProps.id);\n store.useSyncedValueWithCleanup('titleElementId', id);\n const element = useRenderElement('h2', componentProps, {\n ref: forwardedRef,\n props: [{\n id\n }, elementProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") PopoverTitle.displayName = \"PopoverTitle\";","'use client';\n\nimport * as React from 'react';\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.js\";\nimport { useRenderElement } from \"../../internals/useRenderElement.js\";\n\n/**\n * A paragraph with additional information about the popover.\n * Renders a `<p>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nexport const PopoverDescription = /*#__PURE__*/React.forwardRef(function PopoverDescription(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = usePopoverRootContext();\n const id = useBaseUiId(elementProps.id);\n store.useSyncedValueWithCleanup('descriptionElementId', id);\n const element = useRenderElement('p', componentProps, {\n ref: forwardedRef,\n props: [{\n id\n }, elementProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") PopoverDescription.displayName = \"PopoverDescription\";","'use client';\n\nimport * as React from 'react';\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { useRenderElement } from \"../../internals/useRenderElement.js\";\nimport { useButton } from \"../../internals/use-button/index.js\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../internals/reasons.js\";\nimport { useClosePartRegistration } from \"../../utils/closePart.js\";\n\n/**\n * A button that closes the popover.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nexport const PopoverClose = /*#__PURE__*/React.forwardRef(function PopoverClose(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n disabled = false,\n nativeButton = true,\n ...elementProps\n } = componentProps;\n const {\n buttonRef,\n getButtonProps\n } = useButton({\n disabled,\n focusableWhenDisabled: false,\n native: nativeButton\n });\n const {\n store\n } = usePopoverRootContext();\n useClosePartRegistration();\n const element = useRenderElement('button', componentProps, {\n ref: [forwardedRef, buttonRef],\n props: [{\n onClick(event) {\n store.setOpen(false, createChangeEventDetails(REASONS.closePress, event.nativeEvent));\n }\n }, elementProps, getButtonProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") PopoverClose.displayName = \"PopoverClose\";","export let PopoverViewportCssVars = /*#__PURE__*/function (PopoverViewportCssVars) {\n /**\n * The width of the parent popup.\n * This variable is placed on the 'previous' container and stores the width of the popup when the previous content was rendered.\n * It can be used to freeze the dimensions of the popup when animating between different content.\n */\n PopoverViewportCssVars[\"popupWidth\"] = \"--popup-width\";\n /**\n * The height of the parent popup.\n * This variable is placed on the 'previous' container and stores the height of the popup when the previous content was rendered.\n * It can be used to freeze the dimensions of the popup when animating between different content.\n */\n PopoverViewportCssVars[\"popupHeight\"] = \"--popup-height\";\n return PopoverViewportCssVars;\n}({});","'use client';\n\nimport * as React from 'react';\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { usePopoverPositionerContext } from \"../positioner/PopoverPositionerContext.js\";\nimport { useRenderElement } from \"../../internals/useRenderElement.js\";\nimport { PopoverViewportCssVars } from \"./PopoverViewportCssVars.js\";\nimport { usePopupViewport } from \"../../utils/usePopupViewport.js\";\nconst stateAttributesMapping = {\n activationDirection: value => value ? {\n 'data-activation-direction': value\n } : null\n};\n\n/**\n * A viewport for displaying content transitions.\n * This component is only required if one popup can be opened by multiple triggers, its content\n * changes based on the trigger, and switching between them is animated.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nexport const PopoverViewport = /*#__PURE__*/React.forwardRef(function PopoverViewport(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const {\n store\n } = usePopoverRootContext();\n const {\n side\n } = usePopoverPositionerContext();\n const instantType = store.useState('instantType');\n const {\n children: childrenToRender,\n state: viewportState\n } = usePopupViewport({\n store,\n side,\n cssVars: PopoverViewportCssVars,\n children\n });\n const state = {\n activationDirection: viewportState.activationDirection,\n transitioning: viewportState.transitioning,\n instant: instantType\n };\n return useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: [elementProps, {\n children: childrenToRender\n }],\n stateAttributesMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") PopoverViewport.displayName = \"PopoverViewport\";","import _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../internals/reasons.js\";\nimport { PopoverStore } from \"./PopoverStore.js\";\nexport class PopoverHandle {\n /**\n * Internal store holding the popover's state.\n * @internal\n */\n\n constructor() {\n this.store = new PopoverStore();\n }\n\n /**\n * Opens the popover and associates it with the trigger with the given id.\n * The trigger must be a Popover.Trigger component with this handle passed as a prop.\n *\n * @param triggerId ID of the trigger to associate with the popover.\n */\n open(triggerId) {\n const triggerElement = triggerId ? this.store.context.triggerElements.getById(triggerId) ?? undefined : undefined;\n if (triggerId && !triggerElement) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `Base UI: PopoverHandle.open: No trigger found with id \"${triggerId}\".` : _formatErrorMessage(80, triggerId));\n }\n this.store.setOpen(true, createChangeEventDetails(REASONS.imperativeAction, undefined, triggerElement));\n }\n\n /**\n * Closes the popover.\n */\n close() {\n this.store.setOpen(false, createChangeEventDetails(REASONS.imperativeAction, undefined, undefined));\n }\n\n /**\n * Indicates whether the popover is currently open.\n */\n get isOpen() {\n return this.store.select('open');\n }\n}\n\n/**\n * Creates a new handle to connect a Popover.Root with detached Popover.Trigger components.\n */\nexport function createPopoverHandle() {\n return new PopoverHandle();\n}","export { PopoverRoot as Root } from \"./root/PopoverRoot.js\";\nexport { PopoverTrigger as Trigger } from \"./trigger/PopoverTrigger.js\";\nexport { PopoverPortal as Portal } from \"./portal/PopoverPortal.js\";\nexport { PopoverPositioner as Positioner } from \"./positioner/PopoverPositioner.js\";\nexport { PopoverPopup as Popup } from \"./popup/PopoverPopup.js\";\nexport { PopoverArrow as Arrow } from \"./arrow/PopoverArrow.js\";\nexport { PopoverBackdrop as Backdrop } from \"./backdrop/PopoverBackdrop.js\";\nexport { PopoverTitle as Title } from \"./title/PopoverTitle.js\";\nexport { PopoverDescription as Description } from \"./description/PopoverDescription.js\";\nexport { PopoverClose as Close } from \"./close/PopoverClose.js\";\nexport { PopoverViewport as Viewport } from \"./viewport/PopoverViewport.js\";\nexport { createPopoverHandle as createHandle, PopoverHandle as Handle } from \"./store/PopoverHandle.js\";"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],"mappings":";;;;;;;;;;AAIA,IAAa,qBAAkC,6BAAM,cAAc,KAAA,CAAS;AACjC,mBAAmB,cAAc;AAC5E,SAAgB,sBAAsB,UAAU;CAC9C,MAAM,UAAA,aAAgB,WAAW,kBAAkB;CACnD,IAAI,YAAY,KAAA,KAAa,CAAC,UAC5B,MAAM,IAAI,MAA8C,6FAAuH;CAEjL,OAAO;AACT;;;;ACFA,SAAS,qBAAqB;CAC5B,OAAO;EACL,GAAG,6BAA6B;EAChC,UAAU;EACV,OAAO;EACP,mBAAmB;EACnB,aAAa,KAAA;EACb,YAAY;EACZ,kBAAkB;EAClB,gBAAgB,KAAA;EAChB,sBAAsB,KAAA;EACtB,aAAa;EACb,QAAQ;EACR,aAAa;EACb,YAAY;EACZ,aAAa;CACf;AACF;AACA,IAAM,YAAY;CAChB,GAAG;CACH,UAAU,gBAAe,UAAS,MAAM,QAAQ;CAChD,aAAa,gBAAe,UAAS,MAAM,WAAW;CACtD,YAAY,gBAAe,UAAS,MAAM,UAAU;CACpD,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";
|
| 3 |
+
import { C as getWindow, E as isHTMLElement, f as useStableCallback, l as mergeProps, n as EMPTY_ARRAY, p as useRefWithInit, r as EMPTY_OBJECT, s as useMergedRefs, t as useRenderElement, u as useIsoLayoutEffect } from "./useRenderElement-3Cwvu1gO.js";
|
| 4 |
+
import { t as useButton } from "./useButton-CBy-cFDk.js";
|
| 5 |
+
import { a as fieldValidityMapping, i as useFieldRootContext, n as useLabelableId, r as useLabelableContext, t as useRegisterFieldControl } from "./useRegisterFieldControl-CPlvTQh-.js";
|
| 6 |
+
import { t as useFormContext } from "./FormContext-D8skpAva.js";
|
| 7 |
+
import { _ as useBaseUiId, g as ownerDocument, h as windowResize, l as none, n as cancelOpen, s as itemPress, t as createChangeEventDetails } from "./createBaseUIEventDetails-CJxlTiBH.js";
|
| 8 |
+
import { $ as addEventListener, A as useStore, F as useDismiss, I as useClick, K as DROPDOWN_COLLISION_AVOIDANCE, L as FloatingFocusManager, Mt as getFloatingFocusElement, N as createSelector, Ot as isVirtualClick, P as platform, Tt as rectToClientRect, W as FloatingPortal, Wt as isWebKit, Z as useValueAsRef, _ as FOCUSABLE_POPUP_PROPS, a as useAnchoredPopupScrollLock, c as useAnchorPositioning, d as inertValue, et as popupStateMapping, f as getDisabledMountTransitionStyles, h as useFloatingRootContext, i as useOnFirstRender, it as useOpenChangeComplete, k as Store, lt as useTimeout, m as useToolbarRootContext, n as useOpenInteractionType, nt as triggerOpenStateMapping, o as usePositioner, ot as transitionStatusMapping, p as COMPOSITE_KEYS, rt as useTransitionStatus, s as InternalBackdrop, st as useAnimationFrame, t as usePreviousValue, tt as pressableTriggerOpenStateMapping, u as useDirection } from "./usePreviousValue-rDCHxn0g.js";
|
| 9 |
+
import { n as contains, r as getTarget } from "./shadowDom-kQ51Rhp9.js";
|
| 10 |
+
import { t as useControlled } from "./useControlled-B7gU8wdF.js";
|
| 11 |
+
import { a as useListNavigation, i as useTypeahead, n as getPseudoElementBounds, o as IndexGuessBehavior, r as CompositeList, s as useCompositeListItem, t as Separator } from "./Separator-CTGaP8Tv.js";
|
| 12 |
+
import { n as visuallyHidden, r as visuallyHiddenInput, t as useValueChanged } from "./useValueChanged-C6oHa1CC.js";
|
| 13 |
+
//#region ../node_modules/@base-ui/react/esm/utils/useRegisteredLabelId.js
|
| 14 |
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
| 15 |
+
var import_jsx_runtime = require_jsx_runtime();
|
| 16 |
+
function useRegisteredLabelId(idProp, setLabelId) {
|
| 17 |
+
const id = useBaseUiId(idProp);
|
| 18 |
+
useIsoLayoutEffect(() => {
|
| 19 |
+
setLabelId(id);
|
| 20 |
+
return () => {
|
| 21 |
+
setLabelId(void 0);
|
| 22 |
+
};
|
| 23 |
+
}, [id, setLabelId]);
|
| 24 |
+
return id;
|
| 25 |
+
}
|
| 26 |
+
//#endregion
|
| 27 |
+
//#region ../node_modules/@base-ui/react/esm/internals/labelable-provider/useLabel.js
|
| 28 |
+
function useLabel(params = {}) {
|
| 29 |
+
const { id: idProp, fallbackControlId, native = false, setLabelId: setLabelIdProp, focusControl: focusControlProp } = params;
|
| 30 |
+
const { controlId: contextControlId, setLabelId: setContextLabelId } = useLabelableContext();
|
| 31 |
+
const id = useRegisteredLabelId(idProp, useStableCallback((nextLabelId) => {
|
| 32 |
+
setContextLabelId(nextLabelId);
|
| 33 |
+
setLabelIdProp?.(nextLabelId);
|
| 34 |
+
}));
|
| 35 |
+
const resolvedControlId = contextControlId ?? fallbackControlId;
|
| 36 |
+
function focusControl(event) {
|
| 37 |
+
if (focusControlProp) {
|
| 38 |
+
focusControlProp(event, resolvedControlId);
|
| 39 |
+
return;
|
| 40 |
+
}
|
| 41 |
+
if (!resolvedControlId) return;
|
| 42 |
+
const controlElement = ownerDocument(event.currentTarget).getElementById(resolvedControlId);
|
| 43 |
+
if (isHTMLElement(controlElement)) focusElementWithVisible(controlElement);
|
| 44 |
+
}
|
| 45 |
+
function handleInteraction(event) {
|
| 46 |
+
if (getTarget(event.nativeEvent)?.closest("button,input,select,textarea")) return;
|
| 47 |
+
if (!event.defaultPrevented && event.detail > 1) event.preventDefault();
|
| 48 |
+
if (native) return;
|
| 49 |
+
focusControl(event);
|
| 50 |
+
}
|
| 51 |
+
return native ? {
|
| 52 |
+
id,
|
| 53 |
+
htmlFor: resolvedControlId ?? void 0,
|
| 54 |
+
onMouseDown: handleInteraction
|
| 55 |
+
} : {
|
| 56 |
+
id,
|
| 57 |
+
onClick: handleInteraction,
|
| 58 |
+
onPointerDown(event) {
|
| 59 |
+
event.preventDefault();
|
| 60 |
+
}
|
| 61 |
+
};
|
| 62 |
+
}
|
| 63 |
+
function focusElementWithVisible(element) {
|
| 64 |
+
element.focus({ focusVisible: true });
|
| 65 |
+
}
|
| 66 |
+
//#endregion
|
| 67 |
+
//#region ../node_modules/@base-ui/react/esm/select/root/SelectRootContext.js
|
| 68 |
+
var SelectRootContext = /* @__PURE__ */ import_react.createContext(null);
|
| 69 |
+
SelectRootContext.displayName = "SelectRootContext";
|
| 70 |
+
var SelectFloatingContext = /* @__PURE__ */ import_react.createContext(null);
|
| 71 |
+
SelectFloatingContext.displayName = "SelectFloatingContext";
|
| 72 |
+
function useSelectRootContext() {
|
| 73 |
+
const context = import_react.useContext(SelectRootContext);
|
| 74 |
+
if (context === null) throw new Error("Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.");
|
| 75 |
+
return context;
|
| 76 |
+
}
|
| 77 |
+
function useSelectFloatingContext() {
|
| 78 |
+
const context = import_react.useContext(SelectFloatingContext);
|
| 79 |
+
if (context === null) throw new Error("Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.");
|
| 80 |
+
return context;
|
| 81 |
+
}
|
| 82 |
+
//#endregion
|
| 83 |
+
//#region ../node_modules/@base-ui/react/esm/internals/itemEquality.js
|
| 84 |
+
var defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);
|
| 85 |
+
function compareItemEquality(itemValue, selectedValue, comparer) {
|
| 86 |
+
if (itemValue == null || selectedValue == null) return Object.is(itemValue, selectedValue);
|
| 87 |
+
return comparer(itemValue, selectedValue);
|
| 88 |
+
}
|
| 89 |
+
function selectedValueIncludes(selectedValues, itemValue, comparer) {
|
| 90 |
+
if (!selectedValues || selectedValues.length === 0) return false;
|
| 91 |
+
return selectedValues.some((selectedValue) => {
|
| 92 |
+
if (selectedValue === void 0) return false;
|
| 93 |
+
return compareItemEquality(itemValue, selectedValue, comparer);
|
| 94 |
+
});
|
| 95 |
+
}
|
| 96 |
+
function findItemIndex(itemValues, selectedValue, comparer) {
|
| 97 |
+
if (!itemValues || itemValues.length === 0) return -1;
|
| 98 |
+
return itemValues.findIndex((itemValue) => {
|
| 99 |
+
if (itemValue === void 0) return false;
|
| 100 |
+
return compareItemEquality(itemValue, selectedValue, comparer);
|
| 101 |
+
});
|
| 102 |
+
}
|
| 103 |
+
function removeItem(selectedValues, itemValue, comparer) {
|
| 104 |
+
return selectedValues.filter((selectedValue) => !compareItemEquality(itemValue, selectedValue, comparer));
|
| 105 |
+
}
|
| 106 |
+
//#endregion
|
| 107 |
+
//#region ../node_modules/@base-ui/react/esm/internals/serializeValue.js
|
| 108 |
+
function serializeValue(value) {
|
| 109 |
+
if (value == null) return "";
|
| 110 |
+
if (typeof value === "string") return value;
|
| 111 |
+
try {
|
| 112 |
+
return JSON.stringify(value);
|
| 113 |
+
} catch {
|
| 114 |
+
return String(value);
|
| 115 |
+
}
|
| 116 |
+
}
|
| 117 |
+
//#endregion
|
| 118 |
+
//#region ../node_modules/@base-ui/react/esm/internals/resolveValueLabel.js
|
| 119 |
+
function isGroupedItems(items) {
|
| 120 |
+
return items != null && items.length > 0 && typeof items[0] === "object" && items[0] != null && "items" in items[0];
|
| 121 |
+
}
|
| 122 |
+
/**
|
| 123 |
+
* Checks if the items array contains an item with a null value that has a non-null label.
|
| 124 |
+
*/
|
| 125 |
+
function hasNullItemLabel(items) {
|
| 126 |
+
if (!Array.isArray(items)) return items != null && "null" in items;
|
| 127 |
+
const arrayItems = items;
|
| 128 |
+
if (isGroupedItems(arrayItems)) {
|
| 129 |
+
for (const group of arrayItems) for (const item of group.items) if (item && item.value == null && item.label != null) return true;
|
| 130 |
+
return false;
|
| 131 |
+
}
|
| 132 |
+
for (const item of arrayItems) if (item && item.value == null && item.label != null) return true;
|
| 133 |
+
return false;
|
| 134 |
+
}
|
| 135 |
+
function stringifyAsLabel(item, itemToStringLabel) {
|
| 136 |
+
if (itemToStringLabel && item != null) return itemToStringLabel(item) ?? "";
|
| 137 |
+
if (item && typeof item === "object") {
|
| 138 |
+
if ("label" in item && item.label != null) return String(item.label);
|
| 139 |
+
if ("value" in item) return String(item.value);
|
| 140 |
+
}
|
| 141 |
+
return serializeValue(item);
|
| 142 |
+
}
|
| 143 |
+
function stringifyAsValue(item, itemToStringValue) {
|
| 144 |
+
if (itemToStringValue && item != null) return itemToStringValue(item) ?? "";
|
| 145 |
+
if (item && typeof item === "object" && "value" in item && "label" in item) return serializeValue(item.value);
|
| 146 |
+
return serializeValue(item);
|
| 147 |
+
}
|
| 148 |
+
function resolveSelectedLabel(value, items, itemToStringLabel) {
|
| 149 |
+
function fallback() {
|
| 150 |
+
return stringifyAsLabel(value, itemToStringLabel);
|
| 151 |
+
}
|
| 152 |
+
if (itemToStringLabel && value != null) return itemToStringLabel(value);
|
| 153 |
+
if (value && typeof value === "object" && "label" in value && value.label != null) return value.label;
|
| 154 |
+
if (items && !Array.isArray(items)) return items[value] ?? fallback();
|
| 155 |
+
if (Array.isArray(items)) {
|
| 156 |
+
const arrayItems = items;
|
| 157 |
+
const flatItems = isGroupedItems(arrayItems) ? arrayItems.flatMap((group) => group.items) : arrayItems;
|
| 158 |
+
if (value == null || typeof value !== "object") {
|
| 159 |
+
const match = flatItems.find((item) => item.value === value);
|
| 160 |
+
if (match && match.label != null) return match.label;
|
| 161 |
+
return fallback();
|
| 162 |
+
}
|
| 163 |
+
if ("value" in value) {
|
| 164 |
+
const match = flatItems.find((item) => item && item.value === value.value);
|
| 165 |
+
if (match && match.label != null) return match.label;
|
| 166 |
+
}
|
| 167 |
+
}
|
| 168 |
+
return fallback();
|
| 169 |
+
}
|
| 170 |
+
function resolveMultipleLabels(values, items, itemToStringLabel) {
|
| 171 |
+
return values.reduce((acc, value, index) => {
|
| 172 |
+
if (index > 0) acc.push(", ");
|
| 173 |
+
acc.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: resolveSelectedLabel(value, items, itemToStringLabel) }, index));
|
| 174 |
+
return acc;
|
| 175 |
+
}, []);
|
| 176 |
+
}
|
| 177 |
+
//#endregion
|
| 178 |
+
//#region ../node_modules/@base-ui/react/esm/select/store.js
|
| 179 |
+
var selectors = {
|
| 180 |
+
id: createSelector((state) => state.id),
|
| 181 |
+
labelId: createSelector((state) => state.labelId),
|
| 182 |
+
modal: createSelector((state) => state.modal),
|
| 183 |
+
multiple: createSelector((state) => state.multiple),
|
| 184 |
+
items: createSelector((state) => state.items),
|
| 185 |
+
itemToStringLabel: createSelector((state) => state.itemToStringLabel),
|
| 186 |
+
itemToStringValue: createSelector((state) => state.itemToStringValue),
|
| 187 |
+
isItemEqualToValue: createSelector((state) => state.isItemEqualToValue),
|
| 188 |
+
value: createSelector((state) => state.value),
|
| 189 |
+
hasSelectedValue: createSelector((state) => {
|
| 190 |
+
const { value, multiple, itemToStringValue } = state;
|
| 191 |
+
if (value == null) return false;
|
| 192 |
+
if (multiple && Array.isArray(value)) return value.length > 0;
|
| 193 |
+
return stringifyAsValue(value, itemToStringValue) !== "";
|
| 194 |
+
}),
|
| 195 |
+
hasNullItemLabel: createSelector((state, enabled) => {
|
| 196 |
+
return enabled ? hasNullItemLabel(state.items) : false;
|
| 197 |
+
}),
|
| 198 |
+
open: createSelector((state) => state.open),
|
| 199 |
+
mounted: createSelector((state) => state.mounted),
|
| 200 |
+
forceMount: createSelector((state) => state.forceMount),
|
| 201 |
+
transitionStatus: createSelector((state) => state.transitionStatus),
|
| 202 |
+
openMethod: createSelector((state) => state.openMethod),
|
| 203 |
+
activeIndex: createSelector((state) => state.activeIndex),
|
| 204 |
+
selectedIndex: createSelector((state) => state.selectedIndex),
|
| 205 |
+
isActive: createSelector((state, index) => state.activeIndex === index),
|
| 206 |
+
isSelected: createSelector((state, index, itemValue) => {
|
| 207 |
+
const comparer = state.isItemEqualToValue;
|
| 208 |
+
const storeValue = state.value;
|
| 209 |
+
if (state.multiple) return Array.isArray(storeValue) && storeValue.some((selectedItem) => compareItemEquality(itemValue, selectedItem, comparer));
|
| 210 |
+
if (state.selectedIndex === index && state.selectedIndex !== null) return true;
|
| 211 |
+
return compareItemEquality(itemValue, storeValue, comparer);
|
| 212 |
+
}),
|
| 213 |
+
isSelectedByFocus: createSelector((state, index) => {
|
| 214 |
+
return state.selectedIndex === index;
|
| 215 |
+
}),
|
| 216 |
+
popupProps: createSelector((state) => state.popupProps),
|
| 217 |
+
triggerProps: createSelector((state) => state.triggerProps),
|
| 218 |
+
triggerElement: createSelector((state) => state.triggerElement),
|
| 219 |
+
positionerElement: createSelector((state) => state.positionerElement),
|
| 220 |
+
listElement: createSelector((state) => state.listElement),
|
| 221 |
+
popupSide: createSelector((state) => state.popupSide),
|
| 222 |
+
scrollUpArrowVisible: createSelector((state) => state.scrollUpArrowVisible),
|
| 223 |
+
scrollDownArrowVisible: createSelector((state) => state.scrollDownArrowVisible),
|
| 224 |
+
hasScrollArrows: createSelector((state) => state.hasScrollArrows)
|
| 225 |
+
};
|
| 226 |
+
//#endregion
|
| 227 |
+
//#region ../node_modules/@base-ui/react/esm/internals/clamp.js
|
| 228 |
+
function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
|
| 229 |
+
return Math.max(min, Math.min(val, max));
|
| 230 |
+
}
|
| 231 |
+
function getMaxScrollOffset(scrollSize, clientSize) {
|
| 232 |
+
return Math.max(0, scrollSize - clientSize);
|
| 233 |
+
}
|
| 234 |
+
function normalizeScrollOffset(value, max) {
|
| 235 |
+
if (max <= 0) return 0;
|
| 236 |
+
const clamped = clamp(value, 0, max);
|
| 237 |
+
const startDistance = clamped;
|
| 238 |
+
const endDistance = max - clamped;
|
| 239 |
+
const withinStartTolerance = startDistance <= 1;
|
| 240 |
+
const withinEndTolerance = endDistance <= 1;
|
| 241 |
+
if (withinStartTolerance && withinEndTolerance) return startDistance <= endDistance ? 0 : max;
|
| 242 |
+
if (withinStartTolerance) return 0;
|
| 243 |
+
if (withinEndTolerance) return max;
|
| 244 |
+
return clamped;
|
| 245 |
+
}
|
| 246 |
+
//#endregion
|
| 247 |
+
//#region ../node_modules/@base-ui/react/esm/select/root/SelectRoot.js
|
| 248 |
+
/**
|
| 249 |
+
* Groups all parts of the select.
|
| 250 |
+
* Doesn't render its own HTML element.
|
| 251 |
+
*
|
| 252 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 253 |
+
*/
|
| 254 |
+
function SelectRoot(props) {
|
| 255 |
+
const { id, value: valueProp, defaultValue = null, onValueChange, open: openProp, defaultOpen = false, onOpenChange, name: nameProp, form, autoComplete, disabled: disabledProp = false, readOnly = false, required = false, modal = true, actionsRef, inputRef, onOpenChangeComplete, items, multiple = false, itemToStringLabel, itemToStringValue, isItemEqualToValue = defaultItemEquality, highlightItemOnHover = true, children } = props;
|
| 256 |
+
const { clearErrors } = useFormContext();
|
| 257 |
+
const { setDirty, setTouched, setFocused, shouldValidateOnChange, validityData, setFilled, name: fieldName, disabled: fieldDisabled, validation, validationMode } = useFieldRootContext();
|
| 258 |
+
const generatedId = useLabelableId({ id });
|
| 259 |
+
const disabled = fieldDisabled || disabledProp;
|
| 260 |
+
const name = fieldName ?? nameProp;
|
| 261 |
+
const [value, setValueUnwrapped] = useControlled({
|
| 262 |
+
controlled: valueProp,
|
| 263 |
+
default: multiple ? defaultValue ?? EMPTY_ARRAY : defaultValue,
|
| 264 |
+
name: "Select",
|
| 265 |
+
state: "value"
|
| 266 |
+
});
|
| 267 |
+
const [open, setOpenUnwrapped] = useControlled({
|
| 268 |
+
controlled: openProp,
|
| 269 |
+
default: defaultOpen,
|
| 270 |
+
name: "Select",
|
| 271 |
+
state: "open"
|
| 272 |
+
});
|
| 273 |
+
const listRef = import_react.useRef([]);
|
| 274 |
+
const labelsRef = import_react.useRef([]);
|
| 275 |
+
const popupRef = import_react.useRef(null);
|
| 276 |
+
const scrollHandlerRef = import_react.useRef(null);
|
| 277 |
+
const scrollArrowsMountedCountRef = import_react.useRef(0);
|
| 278 |
+
const valueRef = import_react.useRef(null);
|
| 279 |
+
const valuesRef = import_react.useRef([]);
|
| 280 |
+
const typingRef = import_react.useRef(false);
|
| 281 |
+
const keyboardActiveRef = import_react.useRef(false);
|
| 282 |
+
const firstItemTextRef = import_react.useRef(null);
|
| 283 |
+
const selectedItemTextRef = import_react.useRef(null);
|
| 284 |
+
const selectionRef = import_react.useRef({
|
| 285 |
+
allowSelectedMouseUp: false,
|
| 286 |
+
allowUnselectedMouseUp: false,
|
| 287 |
+
dragY: 0
|
| 288 |
+
});
|
| 289 |
+
const alignItemWithTriggerActiveRef = import_react.useRef(false);
|
| 290 |
+
const { mounted, setMounted, transitionStatus } = useTransitionStatus(open);
|
| 291 |
+
const { openMethod, triggerProps: interactionTypeProps } = useOpenInteractionType(open);
|
| 292 |
+
const store = useRefWithInit(() => new Store({
|
| 293 |
+
id: generatedId,
|
| 294 |
+
labelId: void 0,
|
| 295 |
+
modal,
|
| 296 |
+
multiple,
|
| 297 |
+
itemToStringLabel,
|
| 298 |
+
itemToStringValue,
|
| 299 |
+
isItemEqualToValue,
|
| 300 |
+
value,
|
| 301 |
+
open,
|
| 302 |
+
mounted,
|
| 303 |
+
transitionStatus,
|
| 304 |
+
items,
|
| 305 |
+
forceMount: false,
|
| 306 |
+
openMethod: null,
|
| 307 |
+
activeIndex: null,
|
| 308 |
+
selectedIndex: null,
|
| 309 |
+
popupProps: {},
|
| 310 |
+
triggerProps: {},
|
| 311 |
+
triggerElement: null,
|
| 312 |
+
positionerElement: null,
|
| 313 |
+
listElement: null,
|
| 314 |
+
popupSide: null,
|
| 315 |
+
scrollUpArrowVisible: false,
|
| 316 |
+
scrollDownArrowVisible: false,
|
| 317 |
+
hasScrollArrows: false
|
| 318 |
+
})).current;
|
| 319 |
+
const activeIndex = useStore(store, selectors.activeIndex);
|
| 320 |
+
const selectedIndex = useStore(store, selectors.selectedIndex);
|
| 321 |
+
const triggerElement = useStore(store, selectors.triggerElement);
|
| 322 |
+
const positionerElement = useStore(store, selectors.positionerElement);
|
| 323 |
+
const previousOpenMethod = usePreviousValue(openMethod);
|
| 324 |
+
const renderedOpenMethod = openMethod ?? previousOpenMethod;
|
| 325 |
+
const serializedValue = import_react.useMemo(() => {
|
| 326 |
+
if (multiple && Array.isArray(value) && value.length === 0) return "";
|
| 327 |
+
return stringifyAsValue(value, itemToStringValue);
|
| 328 |
+
}, [
|
| 329 |
+
multiple,
|
| 330 |
+
value,
|
| 331 |
+
itemToStringValue
|
| 332 |
+
]);
|
| 333 |
+
const fieldStringValue = import_react.useMemo(() => {
|
| 334 |
+
if (multiple && Array.isArray(value)) return value.map((currentValue) => stringifyAsValue(currentValue, itemToStringValue));
|
| 335 |
+
return stringifyAsValue(value, itemToStringValue);
|
| 336 |
+
}, [
|
| 337 |
+
multiple,
|
| 338 |
+
value,
|
| 339 |
+
itemToStringValue
|
| 340 |
+
]);
|
| 341 |
+
useRegisterFieldControl(useValueAsRef(store.state.triggerElement), generatedId, value, useStableCallback(() => fieldStringValue));
|
| 342 |
+
const initialValueRef = import_react.useRef(value);
|
| 343 |
+
const hasSelectedValue = multiple ? Array.isArray(value) && value.length > 0 : value != null;
|
| 344 |
+
useIsoLayoutEffect(() => {
|
| 345 |
+
if (value !== initialValueRef.current) store.set("forceMount", true);
|
| 346 |
+
}, [store, value]);
|
| 347 |
+
useIsoLayoutEffect(() => {
|
| 348 |
+
setFilled(hasSelectedValue);
|
| 349 |
+
}, [hasSelectedValue, setFilled]);
|
| 350 |
+
useIsoLayoutEffect(function syncSelectedIndex() {
|
| 351 |
+
const registry = valuesRef.current;
|
| 352 |
+
let nextIndex;
|
| 353 |
+
if (multiple) {
|
| 354 |
+
const currentValue = Array.isArray(value) ? value : [];
|
| 355 |
+
if (currentValue.length === 0) nextIndex = null;
|
| 356 |
+
else {
|
| 357 |
+
const lastValue = currentValue[currentValue.length - 1];
|
| 358 |
+
const lastIndex = findItemIndex(registry, lastValue, isItemEqualToValue);
|
| 359 |
+
nextIndex = lastIndex === -1 ? null : lastIndex;
|
| 360 |
+
}
|
| 361 |
+
} else {
|
| 362 |
+
const index = findItemIndex(registry, value, isItemEqualToValue);
|
| 363 |
+
nextIndex = index === -1 ? null : index;
|
| 364 |
+
}
|
| 365 |
+
if (nextIndex === null) selectedItemTextRef.current = null;
|
| 366 |
+
if (open) return;
|
| 367 |
+
store.set("selectedIndex", nextIndex);
|
| 368 |
+
}, [
|
| 369 |
+
hasSelectedValue,
|
| 370 |
+
multiple,
|
| 371 |
+
open,
|
| 372 |
+
value,
|
| 373 |
+
valuesRef,
|
| 374 |
+
isItemEqualToValue,
|
| 375 |
+
store,
|
| 376 |
+
selectedItemTextRef
|
| 377 |
+
]);
|
| 378 |
+
useValueChanged(value, () => {
|
| 379 |
+
clearErrors(name);
|
| 380 |
+
setDirty(value !== validityData.initialValue);
|
| 381 |
+
if (shouldValidateOnChange()) validation.commit(value);
|
| 382 |
+
else validation.commit(value, true);
|
| 383 |
+
});
|
| 384 |
+
const setOpen = useStableCallback((nextOpen, eventDetails) => {
|
| 385 |
+
onOpenChange?.(nextOpen, eventDetails);
|
| 386 |
+
if (eventDetails.isCanceled) return;
|
| 387 |
+
setOpenUnwrapped(nextOpen);
|
| 388 |
+
if (!nextOpen && (eventDetails.reason === "focus-out" || eventDetails.reason === "outside-press")) {
|
| 389 |
+
setTouched(true);
|
| 390 |
+
setFocused(false);
|
| 391 |
+
if (validationMode === "onBlur") validation.commit(value);
|
| 392 |
+
}
|
| 393 |
+
if (!nextOpen && store.state.activeIndex !== null) {
|
| 394 |
+
const activeOption = listRef.current[store.state.activeIndex];
|
| 395 |
+
queueMicrotask(() => {
|
| 396 |
+
activeOption?.setAttribute("tabindex", "-1");
|
| 397 |
+
});
|
| 398 |
+
}
|
| 399 |
+
});
|
| 400 |
+
const handleUnmount = useStableCallback(() => {
|
| 401 |
+
setMounted(false);
|
| 402 |
+
store.update({
|
| 403 |
+
activeIndex: null,
|
| 404 |
+
openMethod: null
|
| 405 |
+
});
|
| 406 |
+
onOpenChangeComplete?.(false);
|
| 407 |
+
});
|
| 408 |
+
useOpenChangeComplete({
|
| 409 |
+
enabled: !actionsRef,
|
| 410 |
+
open,
|
| 411 |
+
ref: popupRef,
|
| 412 |
+
onComplete() {
|
| 413 |
+
if (!open) handleUnmount();
|
| 414 |
+
}
|
| 415 |
+
});
|
| 416 |
+
import_react.useImperativeHandle(actionsRef, () => ({ unmount: handleUnmount }), [handleUnmount]);
|
| 417 |
+
const setValue = useStableCallback((nextValue, eventDetails) => {
|
| 418 |
+
onValueChange?.(nextValue, eventDetails);
|
| 419 |
+
if (eventDetails.isCanceled) return;
|
| 420 |
+
setValueUnwrapped(nextValue);
|
| 421 |
+
});
|
| 422 |
+
const handleScrollArrowVisibility = useStableCallback(() => {
|
| 423 |
+
const scroller = store.state.listElement || popupRef.current;
|
| 424 |
+
if (!scroller) return;
|
| 425 |
+
const maxScrollTop = getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);
|
| 426 |
+
const scrollTop = normalizeScrollOffset(scroller.scrollTop, maxScrollTop);
|
| 427 |
+
const shouldShowUp = scrollTop > 0;
|
| 428 |
+
const shouldShowDown = scrollTop < maxScrollTop;
|
| 429 |
+
if (store.state.scrollUpArrowVisible !== shouldShowUp) store.set("scrollUpArrowVisible", shouldShowUp);
|
| 430 |
+
if (store.state.scrollDownArrowVisible !== shouldShowDown) store.set("scrollDownArrowVisible", shouldShowDown);
|
| 431 |
+
});
|
| 432 |
+
const floatingContext = useFloatingRootContext({
|
| 433 |
+
open,
|
| 434 |
+
onOpenChange: setOpen,
|
| 435 |
+
elements: {
|
| 436 |
+
reference: triggerElement,
|
| 437 |
+
floating: positionerElement
|
| 438 |
+
}
|
| 439 |
+
});
|
| 440 |
+
const click = useClick(floatingContext, {
|
| 441 |
+
enabled: !readOnly && !disabled,
|
| 442 |
+
event: "mousedown"
|
| 443 |
+
});
|
| 444 |
+
const dismiss = useDismiss(floatingContext);
|
| 445 |
+
const listNavigation = useListNavigation(floatingContext, {
|
| 446 |
+
enabled: !readOnly && !disabled,
|
| 447 |
+
listRef,
|
| 448 |
+
activeIndex,
|
| 449 |
+
selectedIndex,
|
| 450 |
+
disabledIndices: EMPTY_ARRAY,
|
| 451 |
+
onNavigate(nextActiveIndex) {
|
| 452 |
+
if (nextActiveIndex === null && !open) return;
|
| 453 |
+
store.set("activeIndex", nextActiveIndex);
|
| 454 |
+
},
|
| 455 |
+
focusItemOnHover: highlightItemOnHover
|
| 456 |
+
});
|
| 457 |
+
const typeahead = useTypeahead(floatingContext, {
|
| 458 |
+
enabled: !readOnly && !disabled && (open || !multiple),
|
| 459 |
+
listRef: labelsRef,
|
| 460 |
+
activeIndex,
|
| 461 |
+
selectedIndex,
|
| 462 |
+
onMatch(index) {
|
| 463 |
+
if (open) store.set("activeIndex", index);
|
| 464 |
+
else setValue(valuesRef.current[index], createChangeEventDetails("none"));
|
| 465 |
+
},
|
| 466 |
+
onTyping(typing) {
|
| 467 |
+
typingRef.current = typing;
|
| 468 |
+
}
|
| 469 |
+
});
|
| 470 |
+
const mergedTriggerProps = import_react.useMemo(() => {
|
| 471 |
+
const triggerInteractionProps = mergeProps(typeahead.reference, listNavigation.reference, dismiss.reference, click.reference, interactionTypeProps);
|
| 472 |
+
if (generatedId) triggerInteractionProps.id = generatedId;
|
| 473 |
+
return triggerInteractionProps;
|
| 474 |
+
}, [
|
| 475 |
+
click.reference,
|
| 476 |
+
typeahead.reference,
|
| 477 |
+
listNavigation.reference,
|
| 478 |
+
dismiss.reference,
|
| 479 |
+
interactionTypeProps,
|
| 480 |
+
generatedId
|
| 481 |
+
]);
|
| 482 |
+
const popupProps = import_react.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, typeahead.floating, listNavigation.floating, dismiss.floating), [
|
| 483 |
+
typeahead.floating,
|
| 484 |
+
listNavigation.floating,
|
| 485 |
+
dismiss.floating
|
| 486 |
+
]);
|
| 487 |
+
const itemProps = listNavigation.item ?? EMPTY_OBJECT;
|
| 488 |
+
useOnFirstRender(() => {
|
| 489 |
+
store.update({
|
| 490 |
+
popupProps,
|
| 491 |
+
triggerProps: mergedTriggerProps
|
| 492 |
+
});
|
| 493 |
+
});
|
| 494 |
+
useIsoLayoutEffect(() => {
|
| 495 |
+
store.update({
|
| 496 |
+
id: generatedId,
|
| 497 |
+
modal,
|
| 498 |
+
multiple,
|
| 499 |
+
value,
|
| 500 |
+
open,
|
| 501 |
+
mounted,
|
| 502 |
+
transitionStatus,
|
| 503 |
+
popupProps,
|
| 504 |
+
triggerProps: mergedTriggerProps,
|
| 505 |
+
items,
|
| 506 |
+
itemToStringLabel,
|
| 507 |
+
itemToStringValue,
|
| 508 |
+
isItemEqualToValue,
|
| 509 |
+
openMethod: renderedOpenMethod
|
| 510 |
+
});
|
| 511 |
+
}, [
|
| 512 |
+
store,
|
| 513 |
+
generatedId,
|
| 514 |
+
modal,
|
| 515 |
+
multiple,
|
| 516 |
+
value,
|
| 517 |
+
open,
|
| 518 |
+
mounted,
|
| 519 |
+
transitionStatus,
|
| 520 |
+
popupProps,
|
| 521 |
+
mergedTriggerProps,
|
| 522 |
+
items,
|
| 523 |
+
itemToStringLabel,
|
| 524 |
+
itemToStringValue,
|
| 525 |
+
isItemEqualToValue,
|
| 526 |
+
renderedOpenMethod
|
| 527 |
+
]);
|
| 528 |
+
const contextValue = import_react.useMemo(() => ({
|
| 529 |
+
store,
|
| 530 |
+
name,
|
| 531 |
+
required,
|
| 532 |
+
disabled,
|
| 533 |
+
readOnly,
|
| 534 |
+
multiple,
|
| 535 |
+
highlightItemOnHover,
|
| 536 |
+
setValue,
|
| 537 |
+
setOpen,
|
| 538 |
+
listRef,
|
| 539 |
+
popupRef,
|
| 540 |
+
scrollHandlerRef,
|
| 541 |
+
handleScrollArrowVisibility,
|
| 542 |
+
scrollArrowsMountedCountRef,
|
| 543 |
+
itemProps,
|
| 544 |
+
events: floatingContext.context.events,
|
| 545 |
+
valueRef,
|
| 546 |
+
valuesRef,
|
| 547 |
+
labelsRef,
|
| 548 |
+
typingRef,
|
| 549 |
+
selectionRef,
|
| 550 |
+
firstItemTextRef,
|
| 551 |
+
selectedItemTextRef,
|
| 552 |
+
validation,
|
| 553 |
+
onOpenChangeComplete,
|
| 554 |
+
keyboardActiveRef,
|
| 555 |
+
alignItemWithTriggerActiveRef,
|
| 556 |
+
initialValueRef
|
| 557 |
+
}), [
|
| 558 |
+
store,
|
| 559 |
+
name,
|
| 560 |
+
required,
|
| 561 |
+
disabled,
|
| 562 |
+
readOnly,
|
| 563 |
+
multiple,
|
| 564 |
+
highlightItemOnHover,
|
| 565 |
+
setValue,
|
| 566 |
+
setOpen,
|
| 567 |
+
itemProps,
|
| 568 |
+
floatingContext.context.events,
|
| 569 |
+
validation,
|
| 570 |
+
onOpenChangeComplete,
|
| 571 |
+
handleScrollArrowVisibility
|
| 572 |
+
]);
|
| 573 |
+
const ref = useMergedRefs(inputRef, validation.inputRef);
|
| 574 |
+
const hasMultipleSelection = multiple && Array.isArray(value) && value.length > 0;
|
| 575 |
+
const hiddenInputName = multiple ? void 0 : name;
|
| 576 |
+
const hiddenInputs = import_react.useMemo(() => {
|
| 577 |
+
if (!multiple || !Array.isArray(value) || !name) return null;
|
| 578 |
+
return value.map((v) => {
|
| 579 |
+
const currentSerializedValue = stringifyAsValue(v, itemToStringValue);
|
| 580 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
|
| 581 |
+
type: "hidden",
|
| 582 |
+
form,
|
| 583 |
+
name,
|
| 584 |
+
value: currentSerializedValue
|
| 585 |
+
}, currentSerializedValue);
|
| 586 |
+
});
|
| 587 |
+
}, [
|
| 588 |
+
multiple,
|
| 589 |
+
value,
|
| 590 |
+
form,
|
| 591 |
+
name,
|
| 592 |
+
itemToStringValue
|
| 593 |
+
]);
|
| 594 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectRootContext.Provider, {
|
| 595 |
+
value: contextValue,
|
| 596 |
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SelectFloatingContext.Provider, {
|
| 597 |
+
value: floatingContext,
|
| 598 |
+
children: [
|
| 599 |
+
children,
|
| 600 |
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
|
| 601 |
+
...validation.getInputValidationProps({
|
| 602 |
+
onFocus() {
|
| 603 |
+
store.state.triggerElement?.focus({ focusVisible: true });
|
| 604 |
+
},
|
| 605 |
+
onChange(event) {
|
| 606 |
+
if (event.nativeEvent.defaultPrevented || disabled || readOnly) {
|
| 607 |
+
event.preventBaseUIHandler?.();
|
| 608 |
+
return;
|
| 609 |
+
}
|
| 610 |
+
const nextValue = event.currentTarget.value;
|
| 611 |
+
const details = createChangeEventDetails(none, event.nativeEvent);
|
| 612 |
+
function handleChange() {
|
| 613 |
+
if (multiple) return;
|
| 614 |
+
const matchingValue = valuesRef.current.find((v) => {
|
| 615 |
+
if (stringifyAsValue(v, itemToStringValue).toLowerCase() === nextValue.toLowerCase()) return true;
|
| 616 |
+
if (stringifyAsLabel(v, itemToStringLabel).toLowerCase() === nextValue.toLowerCase()) return true;
|
| 617 |
+
return false;
|
| 618 |
+
});
|
| 619 |
+
if (matchingValue != null) {
|
| 620 |
+
setDirty(matchingValue !== validityData.initialValue);
|
| 621 |
+
setValue(matchingValue, details);
|
| 622 |
+
if (shouldValidateOnChange()) validation.commit(matchingValue);
|
| 623 |
+
}
|
| 624 |
+
}
|
| 625 |
+
store.set("forceMount", true);
|
| 626 |
+
queueMicrotask(handleChange);
|
| 627 |
+
}
|
| 628 |
+
}),
|
| 629 |
+
id: generatedId && hiddenInputName == null ? `${generatedId}-hidden-input` : void 0,
|
| 630 |
+
form,
|
| 631 |
+
name: hiddenInputName,
|
| 632 |
+
autoComplete,
|
| 633 |
+
value: serializedValue,
|
| 634 |
+
disabled,
|
| 635 |
+
required: required && !hasMultipleSelection,
|
| 636 |
+
readOnly,
|
| 637 |
+
ref,
|
| 638 |
+
style: name ? visuallyHiddenInput : visuallyHidden,
|
| 639 |
+
tabIndex: -1,
|
| 640 |
+
"aria-hidden": true,
|
| 641 |
+
suppressHydrationWarning: true
|
| 642 |
+
}),
|
| 643 |
+
hiddenInputs
|
| 644 |
+
]
|
| 645 |
+
})
|
| 646 |
+
});
|
| 647 |
+
}
|
| 648 |
+
//#endregion
|
| 649 |
+
//#region ../node_modules/@base-ui/react/esm/utils/resolveAriaLabelledBy.js
|
| 650 |
+
function getDefaultLabelId(id) {
|
| 651 |
+
return id == null ? void 0 : `${id}-label`;
|
| 652 |
+
}
|
| 653 |
+
function resolveAriaLabelledBy(fieldLabelId, localLabelId) {
|
| 654 |
+
return fieldLabelId ?? localLabelId;
|
| 655 |
+
}
|
| 656 |
+
//#endregion
|
| 657 |
+
//#region ../node_modules/@base-ui/react/esm/select/label/SelectLabel.js
|
| 658 |
+
/**
|
| 659 |
+
* An accessible label that is automatically associated with the select trigger.
|
| 660 |
+
* Renders a `<div>` element.
|
| 661 |
+
*
|
| 662 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 663 |
+
*/
|
| 664 |
+
var SelectLabel = /* @__PURE__ */ import_react.forwardRef(function SelectLabel(componentProps, forwardedRef) {
|
| 665 |
+
const { render, className, style, ...elementProps } = componentProps;
|
| 666 |
+
const elementPropsWithoutId = elementProps;
|
| 667 |
+
delete elementPropsWithoutId.id;
|
| 668 |
+
const fieldRootContext = useFieldRootContext();
|
| 669 |
+
const { store } = useSelectRootContext();
|
| 670 |
+
const triggerElement = useStore(store, selectors.triggerElement);
|
| 671 |
+
const rootId = useStore(store, selectors.id);
|
| 672 |
+
const labelProps = useLabel({
|
| 673 |
+
id: getDefaultLabelId(rootId),
|
| 674 |
+
fallbackControlId: triggerElement?.id ?? rootId,
|
| 675 |
+
setLabelId(nextLabelId) {
|
| 676 |
+
store.set("labelId", nextLabelId);
|
| 677 |
+
}
|
| 678 |
+
});
|
| 679 |
+
return useRenderElement("div", componentProps, {
|
| 680 |
+
ref: forwardedRef,
|
| 681 |
+
state: fieldRootContext.state,
|
| 682 |
+
props: [labelProps, elementProps],
|
| 683 |
+
stateAttributesMapping: fieldValidityMapping
|
| 684 |
+
});
|
| 685 |
+
});
|
| 686 |
+
SelectLabel.displayName = "SelectLabel";
|
| 687 |
+
//#endregion
|
| 688 |
+
//#region ../node_modules/@base-ui/react/esm/select/trigger/SelectTrigger.js
|
| 689 |
+
var BOUNDARY_OFFSET = 2;
|
| 690 |
+
var SELECTED_DELAY = 400;
|
| 691 |
+
var stateAttributesMapping$4 = {
|
| 692 |
+
...pressableTriggerOpenStateMapping,
|
| 693 |
+
...fieldValidityMapping,
|
| 694 |
+
popupSide: (side) => side ? { "data-popup-side": side } : null,
|
| 695 |
+
value: () => null
|
| 696 |
+
};
|
| 697 |
+
/**
|
| 698 |
+
* A button that opens the select popup.
|
| 699 |
+
* Renders a `<button>` element.
|
| 700 |
+
*
|
| 701 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 702 |
+
*/
|
| 703 |
+
var SelectTrigger = /* @__PURE__ */ import_react.forwardRef(function SelectTrigger(componentProps, forwardedRef) {
|
| 704 |
+
const { render, className, id: idProp, disabled: disabledProp = false, nativeButton = true, style, ...elementProps } = componentProps;
|
| 705 |
+
const { setTouched, setFocused, validationMode, state: fieldState, disabled: fieldDisabled } = useFieldRootContext();
|
| 706 |
+
const { labelId: fieldLabelId } = useLabelableContext();
|
| 707 |
+
const { store, setOpen, selectionRef, validation, readOnly, required, alignItemWithTriggerActiveRef, disabled: selectDisabled, keyboardActiveRef } = useSelectRootContext();
|
| 708 |
+
const disabled = fieldDisabled || selectDisabled || disabledProp;
|
| 709 |
+
const open = useStore(store, selectors.open);
|
| 710 |
+
const mounted = useStore(store, selectors.mounted);
|
| 711 |
+
const value = useStore(store, selectors.value);
|
| 712 |
+
const triggerProps = useStore(store, selectors.triggerProps);
|
| 713 |
+
const positionerElement = useStore(store, selectors.positionerElement);
|
| 714 |
+
const listElement = useStore(store, selectors.listElement);
|
| 715 |
+
const popupSideValue = useStore(store, selectors.popupSide);
|
| 716 |
+
const rootId = useStore(store, selectors.id);
|
| 717 |
+
const selectLabelId = useStore(store, selectors.labelId);
|
| 718 |
+
const hasSelectedValue = useStore(store, selectors.hasSelectedValue);
|
| 719 |
+
const popupSide = mounted && positionerElement ? popupSideValue : null;
|
| 720 |
+
const id = idProp ?? rootId;
|
| 721 |
+
const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, selectLabelId);
|
| 722 |
+
useLabelableId({ id });
|
| 723 |
+
const positionerRef = useValueAsRef(positionerElement);
|
| 724 |
+
const triggerRef = import_react.useRef(null);
|
| 725 |
+
const { getButtonProps, buttonRef } = useButton({
|
| 726 |
+
disabled,
|
| 727 |
+
native: nativeButton
|
| 728 |
+
});
|
| 729 |
+
const mergedRef = useMergedRefs(forwardedRef, triggerRef, buttonRef, useStableCallback((element) => {
|
| 730 |
+
store.set("triggerElement", element);
|
| 731 |
+
}));
|
| 732 |
+
const timeoutFocus = useTimeout();
|
| 733 |
+
const timeoutMouseDown = useTimeout();
|
| 734 |
+
const selectedDelayTimeout = useTimeout();
|
| 735 |
+
import_react.useEffect(() => {
|
| 736 |
+
if (open) {
|
| 737 |
+
selectedDelayTimeout.start(SELECTED_DELAY, () => {
|
| 738 |
+
selectionRef.current.allowUnselectedMouseUp = true;
|
| 739 |
+
selectionRef.current.allowSelectedMouseUp = true;
|
| 740 |
+
});
|
| 741 |
+
return () => {
|
| 742 |
+
selectedDelayTimeout.clear();
|
| 743 |
+
};
|
| 744 |
+
}
|
| 745 |
+
selectionRef.current = {
|
| 746 |
+
allowSelectedMouseUp: false,
|
| 747 |
+
allowUnselectedMouseUp: false,
|
| 748 |
+
dragY: 0
|
| 749 |
+
};
|
| 750 |
+
timeoutMouseDown.clear();
|
| 751 |
+
}, [
|
| 752 |
+
open,
|
| 753 |
+
selectionRef,
|
| 754 |
+
timeoutMouseDown,
|
| 755 |
+
selectedDelayTimeout
|
| 756 |
+
]);
|
| 757 |
+
const props = mergeProps(triggerProps, {
|
| 758 |
+
id,
|
| 759 |
+
role: "combobox",
|
| 760 |
+
"aria-expanded": open ? "true" : "false",
|
| 761 |
+
"aria-haspopup": "listbox",
|
| 762 |
+
"aria-controls": open ? listElement?.id ?? getFloatingFocusElement(positionerElement)?.id : void 0,
|
| 763 |
+
"aria-labelledby": ariaLabelledBy,
|
| 764 |
+
"aria-readonly": readOnly || void 0,
|
| 765 |
+
"aria-required": required || void 0,
|
| 766 |
+
tabIndex: disabled ? -1 : 0,
|
| 767 |
+
ref: mergedRef,
|
| 768 |
+
onFocus(event) {
|
| 769 |
+
setFocused(true);
|
| 770 |
+
if (open && alignItemWithTriggerActiveRef.current) setOpen(false, createChangeEventDetails(none, event.nativeEvent));
|
| 771 |
+
timeoutFocus.start(0, () => {
|
| 772 |
+
store.set("forceMount", true);
|
| 773 |
+
});
|
| 774 |
+
},
|
| 775 |
+
onBlur(event) {
|
| 776 |
+
if (contains(positionerElement, event.relatedTarget)) return;
|
| 777 |
+
setTouched(true);
|
| 778 |
+
setFocused(false);
|
| 779 |
+
if (validationMode === "onBlur") validation.commit(value);
|
| 780 |
+
},
|
| 781 |
+
onPointerMove() {
|
| 782 |
+
keyboardActiveRef.current = false;
|
| 783 |
+
},
|
| 784 |
+
onKeyDown() {
|
| 785 |
+
keyboardActiveRef.current = true;
|
| 786 |
+
},
|
| 787 |
+
onMouseDown(event) {
|
| 788 |
+
if (open) return;
|
| 789 |
+
const doc = ownerDocument(event.currentTarget);
|
| 790 |
+
function handleMouseUp(mouseEvent) {
|
| 791 |
+
if (!triggerRef.current) return;
|
| 792 |
+
const mouseUpTarget = mouseEvent.target;
|
| 793 |
+
if (contains(triggerRef.current, mouseUpTarget) || contains(positionerRef.current, mouseUpTarget) || mouseUpTarget === triggerRef.current) return;
|
| 794 |
+
const bounds = getPseudoElementBounds(triggerRef.current);
|
| 795 |
+
if (mouseEvent.clientX >= bounds.left - BOUNDARY_OFFSET && mouseEvent.clientX <= bounds.right + BOUNDARY_OFFSET && mouseEvent.clientY >= bounds.top - BOUNDARY_OFFSET && mouseEvent.clientY <= bounds.bottom + BOUNDARY_OFFSET) return;
|
| 796 |
+
setOpen(false, createChangeEventDetails(cancelOpen, mouseEvent));
|
| 797 |
+
}
|
| 798 |
+
timeoutMouseDown.start(0, () => {
|
| 799 |
+
doc.addEventListener("mouseup", handleMouseUp, { once: true });
|
| 800 |
+
});
|
| 801 |
+
}
|
| 802 |
+
}, validation.getValidationProps, elementProps, getButtonProps);
|
| 803 |
+
props.role = "combobox";
|
| 804 |
+
const state = {
|
| 805 |
+
...fieldState,
|
| 806 |
+
open,
|
| 807 |
+
disabled,
|
| 808 |
+
value,
|
| 809 |
+
readOnly,
|
| 810 |
+
popupSide,
|
| 811 |
+
placeholder: !hasSelectedValue
|
| 812 |
+
};
|
| 813 |
+
return useRenderElement("button", componentProps, {
|
| 814 |
+
ref: [forwardedRef, triggerRef],
|
| 815 |
+
state,
|
| 816 |
+
stateAttributesMapping: stateAttributesMapping$4,
|
| 817 |
+
props
|
| 818 |
+
});
|
| 819 |
+
});
|
| 820 |
+
SelectTrigger.displayName = "SelectTrigger";
|
| 821 |
+
//#endregion
|
| 822 |
+
//#region ../node_modules/@base-ui/react/esm/select/value/SelectValue.js
|
| 823 |
+
var stateAttributesMapping$3 = { value: () => null };
|
| 824 |
+
/**
|
| 825 |
+
* A text label of the currently selected item.
|
| 826 |
+
* Renders a `<span>` element.
|
| 827 |
+
*
|
| 828 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 829 |
+
*/
|
| 830 |
+
var SelectValue = /* @__PURE__ */ import_react.forwardRef(function SelectValue(componentProps, forwardedRef) {
|
| 831 |
+
const { className, render, children: childrenProp, placeholder, style, ...elementProps } = componentProps;
|
| 832 |
+
const { store, valueRef } = useSelectRootContext();
|
| 833 |
+
const value = useStore(store, selectors.value);
|
| 834 |
+
const items = useStore(store, selectors.items);
|
| 835 |
+
const itemToStringLabel = useStore(store, selectors.itemToStringLabel);
|
| 836 |
+
const hasSelectedValue = useStore(store, selectors.hasSelectedValue);
|
| 837 |
+
const shouldCheckNullItemLabel = !hasSelectedValue && placeholder != null && childrenProp == null;
|
| 838 |
+
const hasNullLabel = useStore(store, selectors.hasNullItemLabel, shouldCheckNullItemLabel);
|
| 839 |
+
const state = {
|
| 840 |
+
value,
|
| 841 |
+
placeholder: !hasSelectedValue
|
| 842 |
+
};
|
| 843 |
+
let children = null;
|
| 844 |
+
if (typeof childrenProp === "function") children = childrenProp(value);
|
| 845 |
+
else if (childrenProp != null) children = childrenProp;
|
| 846 |
+
else if (!hasSelectedValue && placeholder != null && !hasNullLabel) children = placeholder;
|
| 847 |
+
else if (Array.isArray(value)) children = resolveMultipleLabels(value, items, itemToStringLabel);
|
| 848 |
+
else children = resolveSelectedLabel(value, items, itemToStringLabel);
|
| 849 |
+
return useRenderElement("span", componentProps, {
|
| 850 |
+
state,
|
| 851 |
+
ref: [forwardedRef, valueRef],
|
| 852 |
+
props: [{ children }, elementProps],
|
| 853 |
+
stateAttributesMapping: stateAttributesMapping$3
|
| 854 |
+
});
|
| 855 |
+
});
|
| 856 |
+
SelectValue.displayName = "SelectValue";
|
| 857 |
+
//#endregion
|
| 858 |
+
//#region ../node_modules/@base-ui/react/esm/select/icon/SelectIcon.js
|
| 859 |
+
/**
|
| 860 |
+
* An icon that indicates that the trigger button opens a select popup.
|
| 861 |
+
* Renders a `<span>` element.
|
| 862 |
+
*
|
| 863 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 864 |
+
*/
|
| 865 |
+
var SelectIcon = /* @__PURE__ */ import_react.forwardRef(function SelectIcon(componentProps, forwardedRef) {
|
| 866 |
+
const { render, className, style, ...elementProps } = componentProps;
|
| 867 |
+
const { store } = useSelectRootContext();
|
| 868 |
+
return useRenderElement("span", componentProps, {
|
| 869 |
+
state: { open: useStore(store, selectors.open) },
|
| 870 |
+
ref: forwardedRef,
|
| 871 |
+
props: [{
|
| 872 |
+
"aria-hidden": true,
|
| 873 |
+
children: "▼"
|
| 874 |
+
}, elementProps],
|
| 875 |
+
stateAttributesMapping: triggerOpenStateMapping
|
| 876 |
+
});
|
| 877 |
+
});
|
| 878 |
+
SelectIcon.displayName = "SelectIcon";
|
| 879 |
+
//#endregion
|
| 880 |
+
//#region ../node_modules/@base-ui/react/esm/select/portal/SelectPortalContext.js
|
| 881 |
+
var SelectPortalContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 882 |
+
SelectPortalContext.displayName = "SelectPortalContext";
|
| 883 |
+
//#endregion
|
| 884 |
+
//#region ../node_modules/@base-ui/react/esm/select/portal/SelectPortal.js
|
| 885 |
+
/**
|
| 886 |
+
* A portal element that moves the popup to a different part of the DOM.
|
| 887 |
+
* By default, the portal element is appended to `<body>`.
|
| 888 |
+
* Renders a `<div>` element.
|
| 889 |
+
*
|
| 890 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 891 |
+
*/
|
| 892 |
+
var SelectPortal = /* @__PURE__ */ import_react.forwardRef(function SelectPortal(portalProps, forwardedRef) {
|
| 893 |
+
const { store } = useSelectRootContext();
|
| 894 |
+
const mounted = useStore(store, selectors.mounted);
|
| 895 |
+
const forceMount = useStore(store, selectors.forceMount);
|
| 896 |
+
if (!(mounted || forceMount)) return null;
|
| 897 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectPortalContext.Provider, {
|
| 898 |
+
value: true,
|
| 899 |
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingPortal, {
|
| 900 |
+
ref: forwardedRef,
|
| 901 |
+
...portalProps
|
| 902 |
+
})
|
| 903 |
+
});
|
| 904 |
+
});
|
| 905 |
+
SelectPortal.displayName = "SelectPortal";
|
| 906 |
+
//#endregion
|
| 907 |
+
//#region ../node_modules/@base-ui/react/esm/select/backdrop/SelectBackdrop.js
|
| 908 |
+
var stateAttributesMapping$2 = {
|
| 909 |
+
...popupStateMapping,
|
| 910 |
+
...transitionStatusMapping
|
| 911 |
+
};
|
| 912 |
+
/**
|
| 913 |
+
* An overlay displayed beneath the menu popup.
|
| 914 |
+
* Renders a `<div>` element.
|
| 915 |
+
*
|
| 916 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 917 |
+
*/
|
| 918 |
+
var SelectBackdrop = /* @__PURE__ */ import_react.forwardRef(function SelectBackdrop(componentProps, forwardedRef) {
|
| 919 |
+
const { render, className, style, ...elementProps } = componentProps;
|
| 920 |
+
const { store } = useSelectRootContext();
|
| 921 |
+
const open = useStore(store, selectors.open);
|
| 922 |
+
const mounted = useStore(store, selectors.mounted);
|
| 923 |
+
return useRenderElement("div", componentProps, {
|
| 924 |
+
state: {
|
| 925 |
+
open,
|
| 926 |
+
transitionStatus: useStore(store, selectors.transitionStatus)
|
| 927 |
+
},
|
| 928 |
+
ref: forwardedRef,
|
| 929 |
+
props: [{
|
| 930 |
+
role: "presentation",
|
| 931 |
+
hidden: !mounted,
|
| 932 |
+
style: {
|
| 933 |
+
userSelect: "none",
|
| 934 |
+
WebkitUserSelect: "none"
|
| 935 |
+
}
|
| 936 |
+
}, elementProps],
|
| 937 |
+
stateAttributesMapping: stateAttributesMapping$2
|
| 938 |
+
});
|
| 939 |
+
});
|
| 940 |
+
SelectBackdrop.displayName = "SelectBackdrop";
|
| 941 |
+
//#endregion
|
| 942 |
+
//#region ../node_modules/@base-ui/react/esm/select/positioner/SelectPositionerContext.js
|
| 943 |
+
var SelectPositionerContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 944 |
+
SelectPositionerContext.displayName = "SelectPositionerContext";
|
| 945 |
+
function useSelectPositionerContext() {
|
| 946 |
+
const context = import_react.useContext(SelectPositionerContext);
|
| 947 |
+
if (!context) throw new Error("Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.");
|
| 948 |
+
return context;
|
| 949 |
+
}
|
| 950 |
+
//#endregion
|
| 951 |
+
//#region ../node_modules/@base-ui/react/esm/select/popup/utils.js
|
| 952 |
+
function clearStyles(element, originalStyles) {
|
| 953 |
+
if (element) Object.assign(element.style, originalStyles);
|
| 954 |
+
}
|
| 955 |
+
var LIST_FUNCTIONAL_STYLES = {
|
| 956 |
+
position: "relative",
|
| 957 |
+
maxHeight: "100%",
|
| 958 |
+
overflowX: "hidden",
|
| 959 |
+
overflowY: "auto"
|
| 960 |
+
};
|
| 961 |
+
//#endregion
|
| 962 |
+
//#region ../node_modules/@base-ui/react/esm/select/positioner/SelectPositioner.js
|
| 963 |
+
var FIXED = { position: "fixed" };
|
| 964 |
+
/**
|
| 965 |
+
* Positions the select popup.
|
| 966 |
+
* Renders a `<div>` element.
|
| 967 |
+
*
|
| 968 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 969 |
+
*/
|
| 970 |
+
var SelectPositioner = /* @__PURE__ */ import_react.forwardRef(function SelectPositioner(componentProps, forwardedRef) {
|
| 971 |
+
const { anchor, positionMethod = "absolute", className, render, side = "bottom", align = "center", sideOffset = 0, alignOffset = 0, collisionBoundary = "clipping-ancestors", collisionPadding, arrowPadding = 5, sticky = false, disableAnchorTracking, alignItemWithTrigger = true, collisionAvoidance = DROPDOWN_COLLISION_AVOIDANCE, style, ...elementProps } = componentProps;
|
| 972 |
+
const { store, listRef, labelsRef, alignItemWithTriggerActiveRef, selectedItemTextRef, valuesRef, initialValueRef, popupRef, setValue } = useSelectRootContext();
|
| 973 |
+
const floatingRootContext = useSelectFloatingContext();
|
| 974 |
+
const open = useStore(store, selectors.open);
|
| 975 |
+
const mounted = useStore(store, selectors.mounted);
|
| 976 |
+
const modal = useStore(store, selectors.modal);
|
| 977 |
+
const value = useStore(store, selectors.value);
|
| 978 |
+
const openMethod = useStore(store, selectors.openMethod);
|
| 979 |
+
const positionerElement = useStore(store, selectors.positionerElement);
|
| 980 |
+
const triggerElement = useStore(store, selectors.triggerElement);
|
| 981 |
+
const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);
|
| 982 |
+
const transitionStatus = useStore(store, selectors.transitionStatus);
|
| 983 |
+
const scrollUpArrowRef = import_react.useRef(null);
|
| 984 |
+
const scrollDownArrowRef = import_react.useRef(null);
|
| 985 |
+
const [controlledAlignItemWithTrigger, setControlledAlignItemWithTrigger] = import_react.useState(alignItemWithTrigger);
|
| 986 |
+
const alignItemWithTriggerActive = mounted && controlledAlignItemWithTrigger && openMethod !== "touch";
|
| 987 |
+
if (!mounted && controlledAlignItemWithTrigger !== alignItemWithTrigger) setControlledAlignItemWithTrigger(alignItemWithTrigger);
|
| 988 |
+
useIsoLayoutEffect(() => {
|
| 989 |
+
if (!mounted) {
|
| 990 |
+
if (selectors.scrollUpArrowVisible(store.state)) store.set("scrollUpArrowVisible", false);
|
| 991 |
+
if (selectors.scrollDownArrowVisible(store.state)) store.set("scrollDownArrowVisible", false);
|
| 992 |
+
}
|
| 993 |
+
}, [store, mounted]);
|
| 994 |
+
import_react.useImperativeHandle(alignItemWithTriggerActiveRef, () => alignItemWithTriggerActive);
|
| 995 |
+
useAnchoredPopupScrollLock((alignItemWithTriggerActive || modal) && open, openMethod === "touch", positionerElement, triggerElement);
|
| 996 |
+
const positioning = useAnchorPositioning({
|
| 997 |
+
anchor,
|
| 998 |
+
floatingRootContext,
|
| 999 |
+
positionMethod,
|
| 1000 |
+
mounted,
|
| 1001 |
+
side,
|
| 1002 |
+
sideOffset,
|
| 1003 |
+
align,
|
| 1004 |
+
alignOffset,
|
| 1005 |
+
arrowPadding,
|
| 1006 |
+
collisionBoundary,
|
| 1007 |
+
collisionPadding,
|
| 1008 |
+
sticky,
|
| 1009 |
+
disableAnchorTracking: disableAnchorTracking ?? alignItemWithTriggerActive,
|
| 1010 |
+
collisionAvoidance,
|
| 1011 |
+
keepMounted: true
|
| 1012 |
+
});
|
| 1013 |
+
const renderedSide = alignItemWithTriggerActive ? "none" : positioning.side;
|
| 1014 |
+
const positionerStyles = alignItemWithTriggerActive ? FIXED : positioning.positionerStyles;
|
| 1015 |
+
const state = {
|
| 1016 |
+
open,
|
| 1017 |
+
side: renderedSide,
|
| 1018 |
+
align: positioning.align,
|
| 1019 |
+
anchorHidden: positioning.anchorHidden
|
| 1020 |
+
};
|
| 1021 |
+
useIsoLayoutEffect(() => {
|
| 1022 |
+
store.set("popupSide", positioning.side);
|
| 1023 |
+
}, [store, positioning.side]);
|
| 1024 |
+
const element = usePositioner(componentProps, state, {
|
| 1025 |
+
styles: positionerStyles,
|
| 1026 |
+
transitionStatus,
|
| 1027 |
+
props: elementProps,
|
| 1028 |
+
refs: [forwardedRef, useStableCallback((element) => {
|
| 1029 |
+
store.set("positionerElement", element);
|
| 1030 |
+
})],
|
| 1031 |
+
hidden: !mounted,
|
| 1032 |
+
inert: !open
|
| 1033 |
+
});
|
| 1034 |
+
const prevMapSizeRef = import_react.useRef(0);
|
| 1035 |
+
const onMapChange = useStableCallback((map) => {
|
| 1036 |
+
if (map.size === 0 && prevMapSizeRef.current === 0) return;
|
| 1037 |
+
if (valuesRef.current.length === 0) return;
|
| 1038 |
+
const prevSize = prevMapSizeRef.current;
|
| 1039 |
+
prevMapSizeRef.current = map.size;
|
| 1040 |
+
if (map.size === prevSize) return;
|
| 1041 |
+
const eventDetails = createChangeEventDetails(none);
|
| 1042 |
+
if (prevSize !== 0 && !store.state.multiple && value !== null) {
|
| 1043 |
+
if (findItemIndex(valuesRef.current, value, isItemEqualToValue) === -1) {
|
| 1044 |
+
const initialSelectedValue = initialValueRef.current;
|
| 1045 |
+
const nextValue = initialSelectedValue != null && findItemIndex(valuesRef.current, initialSelectedValue, isItemEqualToValue) !== -1 ? initialSelectedValue : null;
|
| 1046 |
+
setValue(nextValue, eventDetails);
|
| 1047 |
+
if (nextValue === null) {
|
| 1048 |
+
store.set("selectedIndex", null);
|
| 1049 |
+
selectedItemTextRef.current = null;
|
| 1050 |
+
}
|
| 1051 |
+
}
|
| 1052 |
+
}
|
| 1053 |
+
if (prevSize !== 0 && store.state.multiple && Array.isArray(value)) {
|
| 1054 |
+
const hasVisibleItem = (selectedItemValue) => findItemIndex(valuesRef.current, selectedItemValue, isItemEqualToValue) !== -1;
|
| 1055 |
+
const nextValue = value.filter((selectedItemValue) => hasVisibleItem(selectedItemValue));
|
| 1056 |
+
if (nextValue.length !== value.length || nextValue.some((selectedItemValue) => !selectedValueIncludes(value, selectedItemValue, isItemEqualToValue))) {
|
| 1057 |
+
setValue(nextValue, eventDetails);
|
| 1058 |
+
if (nextValue.length === 0) {
|
| 1059 |
+
store.set("selectedIndex", null);
|
| 1060 |
+
selectedItemTextRef.current = null;
|
| 1061 |
+
}
|
| 1062 |
+
}
|
| 1063 |
+
}
|
| 1064 |
+
if (open && alignItemWithTriggerActive) {
|
| 1065 |
+
store.update({
|
| 1066 |
+
scrollUpArrowVisible: false,
|
| 1067 |
+
scrollDownArrowVisible: false
|
| 1068 |
+
});
|
| 1069 |
+
const stylesToClear = { height: "" };
|
| 1070 |
+
clearStyles(positionerElement, stylesToClear);
|
| 1071 |
+
clearStyles(popupRef.current, stylesToClear);
|
| 1072 |
+
}
|
| 1073 |
+
});
|
| 1074 |
+
const contextValue = import_react.useMemo(() => ({
|
| 1075 |
+
...positioning,
|
| 1076 |
+
side: renderedSide,
|
| 1077 |
+
alignItemWithTriggerActive,
|
| 1078 |
+
setControlledAlignItemWithTrigger,
|
| 1079 |
+
scrollUpArrowRef,
|
| 1080 |
+
scrollDownArrowRef
|
| 1081 |
+
}), [
|
| 1082 |
+
positioning,
|
| 1083 |
+
renderedSide,
|
| 1084 |
+
alignItemWithTriggerActive,
|
| 1085 |
+
setControlledAlignItemWithTrigger
|
| 1086 |
+
]);
|
| 1087 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompositeList, {
|
| 1088 |
+
elementsRef: listRef,
|
| 1089 |
+
labelsRef,
|
| 1090 |
+
onMapChange,
|
| 1091 |
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SelectPositionerContext.Provider, {
|
| 1092 |
+
value: contextValue,
|
| 1093 |
+
children: [mounted && modal && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InternalBackdrop, {
|
| 1094 |
+
inert: inertValue(!open),
|
| 1095 |
+
cutout: triggerElement
|
| 1096 |
+
}), element]
|
| 1097 |
+
})
|
| 1098 |
+
});
|
| 1099 |
+
});
|
| 1100 |
+
SelectPositioner.displayName = "SelectPositioner";
|
| 1101 |
+
//#endregion
|
| 1102 |
+
//#region ../node_modules/@base-ui/react/esm/utils/styles.js
|
| 1103 |
+
var DISABLE_SCROLLBAR_CLASS_NAME = "base-ui-disable-scrollbar";
|
| 1104 |
+
var styleDisableScrollbar = {
|
| 1105 |
+
className: DISABLE_SCROLLBAR_CLASS_NAME,
|
| 1106 |
+
getElement(nonce) {
|
| 1107 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
|
| 1108 |
+
nonce,
|
| 1109 |
+
href: DISABLE_SCROLLBAR_CLASS_NAME,
|
| 1110 |
+
precedence: "base-ui:low",
|
| 1111 |
+
children: `.${DISABLE_SCROLLBAR_CLASS_NAME}{scrollbar-width:none}.${DISABLE_SCROLLBAR_CLASS_NAME}::-webkit-scrollbar{display:none}`
|
| 1112 |
+
});
|
| 1113 |
+
}
|
| 1114 |
+
};
|
| 1115 |
+
styleDisableScrollbar.getElement.displayName = "styleDisableScrollbar.getElement";
|
| 1116 |
+
//#endregion
|
| 1117 |
+
//#region ../node_modules/@base-ui/react/esm/internals/csp-context/CSPContext.js
|
| 1118 |
+
/**
|
| 1119 |
+
* @internal
|
| 1120 |
+
*/
|
| 1121 |
+
var CSPContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 1122 |
+
CSPContext.displayName = "CSPContext";
|
| 1123 |
+
var DEFAULT_CSP_CONTEXT_VALUE = { disableStyleElements: false };
|
| 1124 |
+
/**
|
| 1125 |
+
* @internal
|
| 1126 |
+
*/
|
| 1127 |
+
function useCSPContext() {
|
| 1128 |
+
return import_react.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;
|
| 1129 |
+
}
|
| 1130 |
+
//#endregion
|
| 1131 |
+
//#region ../node_modules/@base-ui/react/esm/select/popup/SelectPopup.js
|
| 1132 |
+
var stateAttributesMapping$1 = {
|
| 1133 |
+
...popupStateMapping,
|
| 1134 |
+
...transitionStatusMapping
|
| 1135 |
+
};
|
| 1136 |
+
/**
|
| 1137 |
+
* A container for the select list.
|
| 1138 |
+
* Renders a `<div>` element.
|
| 1139 |
+
*
|
| 1140 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 1141 |
+
*/
|
| 1142 |
+
var SelectPopup = /* @__PURE__ */ import_react.forwardRef(function SelectPopup(componentProps, forwardedRef) {
|
| 1143 |
+
const { render, className, style, finalFocus, ...elementProps } = componentProps;
|
| 1144 |
+
const { store, popupRef, onOpenChangeComplete, setOpen, valueRef, firstItemTextRef, selectedItemTextRef, keyboardActiveRef, multiple, handleScrollArrowVisibility, scrollHandlerRef, listRef, highlightItemOnHover } = useSelectRootContext();
|
| 1145 |
+
const { side, align, alignItemWithTriggerActive, isPositioned, setControlledAlignItemWithTrigger, scrollDownArrowRef, scrollUpArrowRef } = useSelectPositionerContext();
|
| 1146 |
+
const insideToolbar = useToolbarRootContext(true) != null;
|
| 1147 |
+
const floatingRootContext = useSelectFloatingContext();
|
| 1148 |
+
const direction = useDirection();
|
| 1149 |
+
const { nonce, disableStyleElements } = useCSPContext();
|
| 1150 |
+
const id = useStore(store, selectors.id);
|
| 1151 |
+
const open = useStore(store, selectors.open);
|
| 1152 |
+
const mounted = useStore(store, selectors.mounted);
|
| 1153 |
+
const popupProps = useStore(store, selectors.popupProps);
|
| 1154 |
+
const transitionStatus = useStore(store, selectors.transitionStatus);
|
| 1155 |
+
const triggerElement = useStore(store, selectors.triggerElement);
|
| 1156 |
+
const positionerElement = useStore(store, selectors.positionerElement);
|
| 1157 |
+
const listElement = useStore(store, selectors.listElement);
|
| 1158 |
+
const reachedMaxHeightRef = import_react.useRef(false);
|
| 1159 |
+
const initialPlacedRef = import_react.useRef(false);
|
| 1160 |
+
const originalPositionerStylesRef = import_react.useRef({});
|
| 1161 |
+
const scrollArrowFrame = useAnimationFrame();
|
| 1162 |
+
const handleScroll = useStableCallback((scroller) => {
|
| 1163 |
+
if (!positionerElement || !popupRef.current || !initialPlacedRef.current) return;
|
| 1164 |
+
if (reachedMaxHeightRef.current || !alignItemWithTriggerActive) {
|
| 1165 |
+
handleScrollArrowVisibility();
|
| 1166 |
+
return;
|
| 1167 |
+
}
|
| 1168 |
+
const isTopPositioned = positionerElement.style.top === "0px";
|
| 1169 |
+
const isBottomPositioned = positionerElement.style.bottom === "0px";
|
| 1170 |
+
if (!isTopPositioned && !isBottomPositioned) {
|
| 1171 |
+
handleScrollArrowVisibility();
|
| 1172 |
+
return;
|
| 1173 |
+
}
|
| 1174 |
+
const scale = getScale(positionerElement);
|
| 1175 |
+
const currentHeight = normalizeSize(positionerElement.getBoundingClientRect().height, "y", scale);
|
| 1176 |
+
const doc = ownerDocument(positionerElement);
|
| 1177 |
+
const positionerStyles = getComputedStyle(positionerElement);
|
| 1178 |
+
const marginTop = parseFloat(positionerStyles.marginTop);
|
| 1179 |
+
const marginBottom = parseFloat(positionerStyles.marginBottom);
|
| 1180 |
+
const maxPopupHeight = getMaxPopupHeight(getComputedStyle(popupRef.current));
|
| 1181 |
+
const maxAvailableHeight = Math.min(doc.documentElement.clientHeight - marginTop - marginBottom, maxPopupHeight);
|
| 1182 |
+
const scrollTop = scroller.scrollTop;
|
| 1183 |
+
const maxScrollTop = getMaxScrollTop(scroller);
|
| 1184 |
+
let nextPositionerHeight = 0;
|
| 1185 |
+
let nextScrollTop = null;
|
| 1186 |
+
let setReachedMax = false;
|
| 1187 |
+
let scrollToMax = false;
|
| 1188 |
+
const setHeight = (height) => {
|
| 1189 |
+
positionerElement.style.height = `${height}px`;
|
| 1190 |
+
};
|
| 1191 |
+
const handleSmallDiff = (diff, targetScrollTop) => {
|
| 1192 |
+
const heightDelta = clamp(diff, 0, maxAvailableHeight - currentHeight);
|
| 1193 |
+
if (heightDelta > 0) setHeight(currentHeight + heightDelta);
|
| 1194 |
+
scroller.scrollTop = targetScrollTop;
|
| 1195 |
+
if (maxAvailableHeight - (currentHeight + heightDelta) <= 1) reachedMaxHeightRef.current = true;
|
| 1196 |
+
handleScrollArrowVisibility();
|
| 1197 |
+
};
|
| 1198 |
+
const diff = isTopPositioned ? maxScrollTop - scrollTop : scrollTop;
|
| 1199 |
+
const nextHeight = Math.min(currentHeight + diff, maxAvailableHeight);
|
| 1200 |
+
nextPositionerHeight = nextHeight;
|
| 1201 |
+
if (diff <= 1) {
|
| 1202 |
+
handleSmallDiff(diff, isTopPositioned ? maxScrollTop : 0);
|
| 1203 |
+
return;
|
| 1204 |
+
}
|
| 1205 |
+
if (maxAvailableHeight - nextHeight > 1) if (isTopPositioned) scrollToMax = true;
|
| 1206 |
+
else nextScrollTop = 0;
|
| 1207 |
+
else {
|
| 1208 |
+
setReachedMax = true;
|
| 1209 |
+
if (isBottomPositioned && scrollTop < maxScrollTop) nextScrollTop = scrollTop - (diff - (currentHeight + diff - maxAvailableHeight));
|
| 1210 |
+
}
|
| 1211 |
+
nextPositionerHeight = Math.ceil(nextPositionerHeight);
|
| 1212 |
+
if (nextPositionerHeight !== 0) setHeight(nextPositionerHeight);
|
| 1213 |
+
if (scrollToMax || nextScrollTop != null) {
|
| 1214 |
+
const nextMaxScrollTop = getMaxScrollTop(scroller);
|
| 1215 |
+
const target = scrollToMax ? nextMaxScrollTop : clamp(nextScrollTop, 0, nextMaxScrollTop);
|
| 1216 |
+
if (Math.abs(scroller.scrollTop - target) > 1) scroller.scrollTop = target;
|
| 1217 |
+
}
|
| 1218 |
+
if (setReachedMax || nextPositionerHeight >= maxAvailableHeight - 1) reachedMaxHeightRef.current = true;
|
| 1219 |
+
handleScrollArrowVisibility();
|
| 1220 |
+
});
|
| 1221 |
+
import_react.useImperativeHandle(scrollHandlerRef, () => handleScroll, [handleScroll]);
|
| 1222 |
+
useOpenChangeComplete({
|
| 1223 |
+
open,
|
| 1224 |
+
ref: popupRef,
|
| 1225 |
+
onComplete() {
|
| 1226 |
+
if (open) onOpenChangeComplete?.(true);
|
| 1227 |
+
}
|
| 1228 |
+
});
|
| 1229 |
+
const state = {
|
| 1230 |
+
open,
|
| 1231 |
+
transitionStatus,
|
| 1232 |
+
side,
|
| 1233 |
+
align
|
| 1234 |
+
};
|
| 1235 |
+
useIsoLayoutEffect(() => {
|
| 1236 |
+
if (!positionerElement || !popupRef.current || Object.keys(originalPositionerStylesRef.current).length) return;
|
| 1237 |
+
originalPositionerStylesRef.current = {
|
| 1238 |
+
top: positionerElement.style.top || "0",
|
| 1239 |
+
left: positionerElement.style.left || "0",
|
| 1240 |
+
right: positionerElement.style.right,
|
| 1241 |
+
height: positionerElement.style.height,
|
| 1242 |
+
bottom: positionerElement.style.bottom,
|
| 1243 |
+
minHeight: positionerElement.style.minHeight,
|
| 1244 |
+
maxHeight: positionerElement.style.maxHeight,
|
| 1245 |
+
marginTop: positionerElement.style.marginTop,
|
| 1246 |
+
marginBottom: positionerElement.style.marginBottom
|
| 1247 |
+
};
|
| 1248 |
+
}, [popupRef, positionerElement]);
|
| 1249 |
+
useIsoLayoutEffect(() => {
|
| 1250 |
+
if (open || alignItemWithTriggerActive) return;
|
| 1251 |
+
initialPlacedRef.current = false;
|
| 1252 |
+
reachedMaxHeightRef.current = false;
|
| 1253 |
+
clearStyles(positionerElement, originalPositionerStylesRef.current);
|
| 1254 |
+
}, [
|
| 1255 |
+
open,
|
| 1256 |
+
alignItemWithTriggerActive,
|
| 1257 |
+
positionerElement,
|
| 1258 |
+
popupRef
|
| 1259 |
+
]);
|
| 1260 |
+
useIsoLayoutEffect(() => {
|
| 1261 |
+
const popupElement = popupRef.current;
|
| 1262 |
+
if (!open || !triggerElement || !positionerElement || !popupElement || alignItemWithTriggerActive && !isPositioned || store.state.transitionStatus === "ending") return;
|
| 1263 |
+
if (!alignItemWithTriggerActive) {
|
| 1264 |
+
initialPlacedRef.current = true;
|
| 1265 |
+
scrollArrowFrame.request(handleScrollArrowVisibility);
|
| 1266 |
+
popupElement.style.removeProperty("--transform-origin");
|
| 1267 |
+
return;
|
| 1268 |
+
}
|
| 1269 |
+
const restoreTransformStyles = unsetTransformStyles(popupElement);
|
| 1270 |
+
popupElement.style.removeProperty("--transform-origin");
|
| 1271 |
+
try {
|
| 1272 |
+
let textElement = selectedItemTextRef.current;
|
| 1273 |
+
if (!textElement?.isConnected) textElement = !selectors.hasSelectedValue(store.state) && firstItemTextRef.current?.isConnected ? firstItemTextRef.current : null;
|
| 1274 |
+
const valueElement = valueRef.current;
|
| 1275 |
+
const positionerStyles = getComputedStyle(positionerElement);
|
| 1276 |
+
const popupStyles = getComputedStyle(popupElement);
|
| 1277 |
+
const doc = ownerDocument(triggerElement);
|
| 1278 |
+
const win = getWindow(positionerElement);
|
| 1279 |
+
const scale = getScale(triggerElement);
|
| 1280 |
+
const triggerRect = normalizeRect(triggerElement.getBoundingClientRect(), scale);
|
| 1281 |
+
const positionerRect = normalizeRect(positionerElement.getBoundingClientRect(), scale);
|
| 1282 |
+
const triggerHeight = triggerRect.height;
|
| 1283 |
+
const scroller = listElement || popupElement;
|
| 1284 |
+
const scrollHeight = scroller.scrollHeight;
|
| 1285 |
+
const borderBottom = parseFloat(popupStyles.borderBottomWidth);
|
| 1286 |
+
const marginTop = parseFloat(positionerStyles.marginTop) || 10;
|
| 1287 |
+
const marginBottom = parseFloat(positionerStyles.marginBottom) || 10;
|
| 1288 |
+
const minHeight = parseFloat(positionerStyles.minHeight) || 100;
|
| 1289 |
+
const maxPopupHeight = getMaxPopupHeight(popupStyles);
|
| 1290 |
+
const paddingLeft = 5;
|
| 1291 |
+
const paddingRight = 5;
|
| 1292 |
+
const triggerCollisionThreshold = 20;
|
| 1293 |
+
const viewportHeight = doc.documentElement.clientHeight - marginTop - marginBottom;
|
| 1294 |
+
const viewportWidth = doc.documentElement.clientWidth;
|
| 1295 |
+
const availableSpaceBeneathTrigger = viewportHeight - triggerRect.bottom + triggerHeight;
|
| 1296 |
+
let textRect;
|
| 1297 |
+
let alignedLeft = direction === "rtl" ? triggerRect.right - positionerRect.width : triggerRect.left;
|
| 1298 |
+
let offsetY = 0;
|
| 1299 |
+
if (textElement && valueElement) {
|
| 1300 |
+
const valueRect = normalizeRect(valueElement.getBoundingClientRect(), scale);
|
| 1301 |
+
textRect = normalizeRect(textElement.getBoundingClientRect(), scale);
|
| 1302 |
+
alignedLeft = positionerRect.left + (direction === "rtl" ? valueRect.right - textRect.right : valueRect.left - textRect.left);
|
| 1303 |
+
const valueCenterFromTriggerTop = valueRect.top - triggerRect.top + valueRect.height / 2;
|
| 1304 |
+
offsetY = textRect.top - positionerRect.top + textRect.height / 2 - valueCenterFromTriggerTop;
|
| 1305 |
+
}
|
| 1306 |
+
const idealHeight = availableSpaceBeneathTrigger + offsetY + marginBottom + borderBottom;
|
| 1307 |
+
let height = Math.min(viewportHeight, idealHeight);
|
| 1308 |
+
const maxHeight = viewportHeight - marginTop - marginBottom;
|
| 1309 |
+
const scrollTop = idealHeight - height;
|
| 1310 |
+
const maxRight = viewportWidth - paddingRight;
|
| 1311 |
+
positionerElement.style.left = `${clamp(alignedLeft, paddingLeft, maxRight - positionerRect.width)}px`;
|
| 1312 |
+
positionerElement.style.height = `${height}px`;
|
| 1313 |
+
positionerElement.style.maxHeight = "auto";
|
| 1314 |
+
positionerElement.style.marginTop = `${marginTop}px`;
|
| 1315 |
+
positionerElement.style.marginBottom = `${marginBottom}px`;
|
| 1316 |
+
popupElement.style.height = "100%";
|
| 1317 |
+
const maxScrollTop = getMaxScrollTop(scroller);
|
| 1318 |
+
const isTopPositioned = scrollTop >= maxScrollTop - 1;
|
| 1319 |
+
if (isTopPositioned) height = Math.min(viewportHeight, positionerRect.height) - (scrollTop - maxScrollTop);
|
| 1320 |
+
const fallbackToAlignPopupToTrigger = triggerRect.top < triggerCollisionThreshold || triggerRect.bottom > viewportHeight - triggerCollisionThreshold || Math.ceil(height) + 1 < Math.min(scrollHeight, minHeight);
|
| 1321 |
+
const isPinchZoomed = (win.visualViewport?.scale ?? 1) !== 1 && isWebKit;
|
| 1322 |
+
if (fallbackToAlignPopupToTrigger || isPinchZoomed) {
|
| 1323 |
+
initialPlacedRef.current = true;
|
| 1324 |
+
clearStyles(positionerElement, originalPositionerStylesRef.current);
|
| 1325 |
+
setControlledAlignItemWithTrigger(false);
|
| 1326 |
+
return;
|
| 1327 |
+
}
|
| 1328 |
+
const initialHeight = Math.max(minHeight, height);
|
| 1329 |
+
if (isTopPositioned) {
|
| 1330 |
+
const topOffset = Math.max(0, viewportHeight - idealHeight);
|
| 1331 |
+
positionerElement.style.top = positionerRect.height >= maxHeight ? "0" : `${topOffset}px`;
|
| 1332 |
+
positionerElement.style.height = `${height}px`;
|
| 1333 |
+
scroller.scrollTop = getMaxScrollTop(scroller);
|
| 1334 |
+
} else {
|
| 1335 |
+
positionerElement.style.bottom = "0";
|
| 1336 |
+
scroller.scrollTop = scrollTop;
|
| 1337 |
+
}
|
| 1338 |
+
if (textRect) {
|
| 1339 |
+
const popupTop = positionerRect.top;
|
| 1340 |
+
const popupHeight = positionerRect.height;
|
| 1341 |
+
const textCenterY = textRect.top + textRect.height / 2;
|
| 1342 |
+
const clampedY = clamp(popupHeight > 0 ? (textCenterY - popupTop) / popupHeight * 100 : 50, 0, 100);
|
| 1343 |
+
popupElement.style.setProperty("--transform-origin", `50% ${clampedY}%`);
|
| 1344 |
+
}
|
| 1345 |
+
if (initialHeight === viewportHeight || height >= maxPopupHeight) reachedMaxHeightRef.current = true;
|
| 1346 |
+
handleScrollArrowVisibility();
|
| 1347 |
+
if (highlightItemOnHover && store.state.selectedIndex === null && store.state.activeIndex === null && listRef.current[0] != null) store.set("activeIndex", 0);
|
| 1348 |
+
initialPlacedRef.current = true;
|
| 1349 |
+
} finally {
|
| 1350 |
+
restoreTransformStyles();
|
| 1351 |
+
}
|
| 1352 |
+
}, [
|
| 1353 |
+
store,
|
| 1354 |
+
open,
|
| 1355 |
+
positionerElement,
|
| 1356 |
+
triggerElement,
|
| 1357 |
+
valueRef,
|
| 1358 |
+
firstItemTextRef,
|
| 1359 |
+
selectedItemTextRef,
|
| 1360 |
+
popupRef,
|
| 1361 |
+
handleScrollArrowVisibility,
|
| 1362 |
+
alignItemWithTriggerActive,
|
| 1363 |
+
setControlledAlignItemWithTrigger,
|
| 1364 |
+
scrollArrowFrame,
|
| 1365 |
+
scrollDownArrowRef,
|
| 1366 |
+
scrollUpArrowRef,
|
| 1367 |
+
listElement,
|
| 1368 |
+
listRef,
|
| 1369 |
+
highlightItemOnHover,
|
| 1370 |
+
direction,
|
| 1371 |
+
isPositioned
|
| 1372 |
+
]);
|
| 1373 |
+
import_react.useEffect(() => {
|
| 1374 |
+
if (!alignItemWithTriggerActive || !positionerElement || !open) return;
|
| 1375 |
+
const win = getWindow(positionerElement);
|
| 1376 |
+
function handleResize(event) {
|
| 1377 |
+
setOpen(false, createChangeEventDetails(windowResize, event));
|
| 1378 |
+
}
|
| 1379 |
+
return addEventListener(win, "resize", handleResize);
|
| 1380 |
+
}, [
|
| 1381 |
+
setOpen,
|
| 1382 |
+
alignItemWithTriggerActive,
|
| 1383 |
+
positionerElement,
|
| 1384 |
+
open
|
| 1385 |
+
]);
|
| 1386 |
+
const defaultProps = {
|
| 1387 |
+
...listElement ? {
|
| 1388 |
+
role: "presentation",
|
| 1389 |
+
"aria-orientation": void 0
|
| 1390 |
+
} : {
|
| 1391 |
+
role: "listbox",
|
| 1392 |
+
"aria-multiselectable": multiple || void 0,
|
| 1393 |
+
id: `${id}-list`
|
| 1394 |
+
},
|
| 1395 |
+
onKeyDown(event) {
|
| 1396 |
+
keyboardActiveRef.current = true;
|
| 1397 |
+
if (insideToolbar && COMPOSITE_KEYS.has(event.key)) event.stopPropagation();
|
| 1398 |
+
},
|
| 1399 |
+
onMouseMove() {
|
| 1400 |
+
keyboardActiveRef.current = false;
|
| 1401 |
+
},
|
| 1402 |
+
onScroll(event) {
|
| 1403 |
+
if (listElement) return;
|
| 1404 |
+
handleScroll(event.currentTarget);
|
| 1405 |
+
},
|
| 1406 |
+
...alignItemWithTriggerActive && { style: listElement ? { height: "100%" } : LIST_FUNCTIONAL_STYLES }
|
| 1407 |
+
};
|
| 1408 |
+
const element = useRenderElement("div", componentProps, {
|
| 1409 |
+
ref: [forwardedRef, popupRef],
|
| 1410 |
+
state,
|
| 1411 |
+
stateAttributesMapping: stateAttributesMapping$1,
|
| 1412 |
+
props: [
|
| 1413 |
+
popupProps,
|
| 1414 |
+
defaultProps,
|
| 1415 |
+
getDisabledMountTransitionStyles(transitionStatus),
|
| 1416 |
+
{ className: !listElement && alignItemWithTriggerActive ? styleDisableScrollbar.className : void 0 },
|
| 1417 |
+
elementProps
|
| 1418 |
+
]
|
| 1419 |
+
});
|
| 1420 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [!disableStyleElements && styleDisableScrollbar.getElement(nonce), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingFocusManager, {
|
| 1421 |
+
context: floatingRootContext,
|
| 1422 |
+
modal: false,
|
| 1423 |
+
disabled: !mounted,
|
| 1424 |
+
returnFocus: finalFocus,
|
| 1425 |
+
restoreFocus: true,
|
| 1426 |
+
children: element
|
| 1427 |
+
})] });
|
| 1428 |
+
});
|
| 1429 |
+
SelectPopup.displayName = "SelectPopup";
|
| 1430 |
+
function getMaxPopupHeight(popupStyles) {
|
| 1431 |
+
const maxHeightStyle = popupStyles.maxHeight || "";
|
| 1432 |
+
return maxHeightStyle.endsWith("px") ? parseFloat(maxHeightStyle) || Infinity : Infinity;
|
| 1433 |
+
}
|
| 1434 |
+
function getMaxScrollTop(scroller) {
|
| 1435 |
+
return getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);
|
| 1436 |
+
}
|
| 1437 |
+
function getScale(element) {
|
| 1438 |
+
return platform.getScale(element);
|
| 1439 |
+
}
|
| 1440 |
+
function normalizeSize(size, axis, scale) {
|
| 1441 |
+
return size / scale[axis];
|
| 1442 |
+
}
|
| 1443 |
+
function normalizeRect(rect, scale) {
|
| 1444 |
+
return rectToClientRect({
|
| 1445 |
+
x: normalizeSize(rect.x, "x", scale),
|
| 1446 |
+
y: normalizeSize(rect.y, "y", scale),
|
| 1447 |
+
width: normalizeSize(rect.width, "x", scale),
|
| 1448 |
+
height: normalizeSize(rect.height, "y", scale)
|
| 1449 |
+
});
|
| 1450 |
+
}
|
| 1451 |
+
var TRANSFORM_STYLE_RESETS = [
|
| 1452 |
+
["transform", "none"],
|
| 1453 |
+
["scale", "1"],
|
| 1454 |
+
["translate", "0 0"]
|
| 1455 |
+
];
|
| 1456 |
+
function unsetTransformStyles(popupElement) {
|
| 1457 |
+
const { style } = popupElement;
|
| 1458 |
+
const originalStyles = {};
|
| 1459 |
+
for (const [property, value] of TRANSFORM_STYLE_RESETS) {
|
| 1460 |
+
originalStyles[property] = style.getPropertyValue(property);
|
| 1461 |
+
style.setProperty(property, value, "important");
|
| 1462 |
+
}
|
| 1463 |
+
return () => {
|
| 1464 |
+
for (const [property] of TRANSFORM_STYLE_RESETS) {
|
| 1465 |
+
const originalValue = originalStyles[property];
|
| 1466 |
+
if (originalValue) style.setProperty(property, originalValue);
|
| 1467 |
+
else style.removeProperty(property);
|
| 1468 |
+
}
|
| 1469 |
+
};
|
| 1470 |
+
}
|
| 1471 |
+
//#endregion
|
| 1472 |
+
//#region ../node_modules/@base-ui/react/esm/select/list/SelectList.js
|
| 1473 |
+
/**
|
| 1474 |
+
* A container for the select items.
|
| 1475 |
+
* Renders a `<div>` element.
|
| 1476 |
+
*
|
| 1477 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 1478 |
+
*/
|
| 1479 |
+
var SelectList = /* @__PURE__ */ import_react.forwardRef(function SelectList(componentProps, forwardedRef) {
|
| 1480 |
+
const { render, className, style, ...elementProps } = componentProps;
|
| 1481 |
+
const { store, scrollHandlerRef } = useSelectRootContext();
|
| 1482 |
+
const { alignItemWithTriggerActive } = useSelectPositionerContext();
|
| 1483 |
+
const hasScrollArrows = useStore(store, selectors.hasScrollArrows);
|
| 1484 |
+
const openMethod = useStore(store, selectors.openMethod);
|
| 1485 |
+
const multiple = useStore(store, selectors.multiple);
|
| 1486 |
+
const defaultProps = {
|
| 1487 |
+
id: `${useStore(store, selectors.id)}-list`,
|
| 1488 |
+
role: "listbox",
|
| 1489 |
+
"aria-multiselectable": multiple || void 0,
|
| 1490 |
+
onScroll(event) {
|
| 1491 |
+
scrollHandlerRef.current?.(event.currentTarget);
|
| 1492 |
+
},
|
| 1493 |
+
...alignItemWithTriggerActive && { style: LIST_FUNCTIONAL_STYLES },
|
| 1494 |
+
className: hasScrollArrows && openMethod !== "touch" ? styleDisableScrollbar.className : void 0
|
| 1495 |
+
};
|
| 1496 |
+
return useRenderElement("div", componentProps, {
|
| 1497 |
+
ref: [forwardedRef, useStableCallback((element) => {
|
| 1498 |
+
store.set("listElement", element);
|
| 1499 |
+
})],
|
| 1500 |
+
props: [defaultProps, elementProps]
|
| 1501 |
+
});
|
| 1502 |
+
});
|
| 1503 |
+
SelectList.displayName = "SelectList";
|
| 1504 |
+
//#endregion
|
| 1505 |
+
//#region ../node_modules/@base-ui/react/esm/select/item/SelectItemContext.js
|
| 1506 |
+
var SelectItemContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 1507 |
+
SelectItemContext.displayName = "SelectItemContext";
|
| 1508 |
+
function useSelectItemContext() {
|
| 1509 |
+
const context = import_react.useContext(SelectItemContext);
|
| 1510 |
+
if (!context) throw new Error("Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.");
|
| 1511 |
+
return context;
|
| 1512 |
+
}
|
| 1513 |
+
//#endregion
|
| 1514 |
+
//#region ../node_modules/@base-ui/react/esm/select/item/SelectItem.js
|
| 1515 |
+
/**
|
| 1516 |
+
* An individual option in the select popup.
|
| 1517 |
+
* Renders a `<div>` element.
|
| 1518 |
+
*
|
| 1519 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 1520 |
+
*/
|
| 1521 |
+
var SelectItem = /* @__PURE__ */ import_react.memo(/* @__PURE__ */ import_react.forwardRef(function SelectItem(componentProps, forwardedRef) {
|
| 1522 |
+
const { render, className, style, value: itemValue = null, label, disabled = false, nativeButton = false, ...elementProps } = componentProps;
|
| 1523 |
+
const textRef = import_react.useRef(null);
|
| 1524 |
+
const listItem = useCompositeListItem({
|
| 1525 |
+
label,
|
| 1526 |
+
textRef,
|
| 1527 |
+
indexGuessBehavior: IndexGuessBehavior.GuessFromOrder
|
| 1528 |
+
});
|
| 1529 |
+
const { store, itemProps, setOpen, setValue, selectionRef, typingRef, valuesRef, multiple, selectedItemTextRef } = useSelectRootContext();
|
| 1530 |
+
const highlighted = useStore(store, selectors.isActive, listItem.index);
|
| 1531 |
+
const selected = useStore(store, selectors.isSelected, listItem.index, itemValue);
|
| 1532 |
+
const selectedByFocus = useStore(store, selectors.isSelectedByFocus, listItem.index);
|
| 1533 |
+
const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);
|
| 1534 |
+
const index = listItem.index;
|
| 1535 |
+
const hasRegistered = index !== -1;
|
| 1536 |
+
const itemRef = import_react.useRef(null);
|
| 1537 |
+
useIsoLayoutEffect(() => {
|
| 1538 |
+
if (!hasRegistered) return;
|
| 1539 |
+
const values = valuesRef.current;
|
| 1540 |
+
values[index] = itemValue;
|
| 1541 |
+
return () => {
|
| 1542 |
+
delete values[index];
|
| 1543 |
+
};
|
| 1544 |
+
}, [
|
| 1545 |
+
hasRegistered,
|
| 1546 |
+
index,
|
| 1547 |
+
itemValue,
|
| 1548 |
+
valuesRef
|
| 1549 |
+
]);
|
| 1550 |
+
useIsoLayoutEffect(() => {
|
| 1551 |
+
if (!hasRegistered) return;
|
| 1552 |
+
const selectedValue = store.state.value;
|
| 1553 |
+
let selectedCandidate = selectedValue;
|
| 1554 |
+
if (multiple && Array.isArray(selectedValue) && selectedValue.length > 0) selectedCandidate = selectedValue[selectedValue.length - 1];
|
| 1555 |
+
if (selectedCandidate !== void 0 && compareItemEquality(itemValue, selectedCandidate, isItemEqualToValue)) {
|
| 1556 |
+
store.set("selectedIndex", index);
|
| 1557 |
+
if (textRef.current) selectedItemTextRef.current = textRef.current;
|
| 1558 |
+
}
|
| 1559 |
+
}, [
|
| 1560 |
+
hasRegistered,
|
| 1561 |
+
index,
|
| 1562 |
+
multiple,
|
| 1563 |
+
isItemEqualToValue,
|
| 1564 |
+
store,
|
| 1565 |
+
itemValue,
|
| 1566 |
+
selectedItemTextRef
|
| 1567 |
+
]);
|
| 1568 |
+
const lastKeyRef = import_react.useRef(null);
|
| 1569 |
+
const pointerTypeRef = import_react.useRef("mouse");
|
| 1570 |
+
const allowMouseSelectionRef = import_react.useRef(false);
|
| 1571 |
+
const { getButtonProps, buttonRef } = useButton({
|
| 1572 |
+
disabled,
|
| 1573 |
+
focusableWhenDisabled: true,
|
| 1574 |
+
native: nativeButton,
|
| 1575 |
+
composite: true
|
| 1576 |
+
});
|
| 1577 |
+
const state = {
|
| 1578 |
+
disabled,
|
| 1579 |
+
selected,
|
| 1580 |
+
highlighted
|
| 1581 |
+
};
|
| 1582 |
+
function commitSelection(event) {
|
| 1583 |
+
const selectedValue = store.state.value;
|
| 1584 |
+
if (multiple) {
|
| 1585 |
+
const currentValue = Array.isArray(selectedValue) ? selectedValue : [];
|
| 1586 |
+
setValue(selected ? removeItem(currentValue, itemValue, isItemEqualToValue) : [...currentValue, itemValue], createChangeEventDetails(itemPress, event));
|
| 1587 |
+
} else {
|
| 1588 |
+
setValue(itemValue, createChangeEventDetails(itemPress, event));
|
| 1589 |
+
setOpen(false, createChangeEventDetails(itemPress, event));
|
| 1590 |
+
}
|
| 1591 |
+
}
|
| 1592 |
+
function resetDragMovement() {
|
| 1593 |
+
selectionRef.current.dragY = 0;
|
| 1594 |
+
}
|
| 1595 |
+
const defaultProps = {
|
| 1596 |
+
role: "option",
|
| 1597 |
+
"aria-selected": selected,
|
| 1598 |
+
tabIndex: highlighted ? 0 : -1,
|
| 1599 |
+
onKeyDown(event) {
|
| 1600 |
+
lastKeyRef.current = event.key;
|
| 1601 |
+
store.set("activeIndex", index);
|
| 1602 |
+
if (event.key === " " && typingRef.current) event.preventDefault();
|
| 1603 |
+
},
|
| 1604 |
+
onClick(event) {
|
| 1605 |
+
const isMouseClick = event.type === "click" && pointerTypeRef.current !== "touch";
|
| 1606 |
+
const clickPointerType = event.nativeEvent.pointerType;
|
| 1607 |
+
const isVirtualMouseClick = isMouseClick && isVirtualClick(event.nativeEvent) && (clickPointerType !== void 0 || highlighted);
|
| 1608 |
+
const isInvalidMouseClick = isMouseClick && !isVirtualMouseClick && !allowMouseSelectionRef.current;
|
| 1609 |
+
allowMouseSelectionRef.current = false;
|
| 1610 |
+
if (event.type === "keydown" && lastKeyRef.current === null) return;
|
| 1611 |
+
if (disabled || event.type === "keydown" && lastKeyRef.current === " " && typingRef.current || isInvalidMouseClick) return;
|
| 1612 |
+
lastKeyRef.current = null;
|
| 1613 |
+
commitSelection(event.nativeEvent);
|
| 1614 |
+
},
|
| 1615 |
+
onPointerEnter(event) {
|
| 1616 |
+
pointerTypeRef.current = event.pointerType;
|
| 1617 |
+
},
|
| 1618 |
+
onPointerMove(event) {
|
| 1619 |
+
if (event.pointerType === "mouse" && event.buttons === 1) {
|
| 1620 |
+
const selection = selectionRef.current;
|
| 1621 |
+
selection.dragY += event.movementY;
|
| 1622 |
+
if (selection.dragY ** 2 >= 64) selection.allowUnselectedMouseUp = true;
|
| 1623 |
+
}
|
| 1624 |
+
},
|
| 1625 |
+
onPointerDown(event) {
|
| 1626 |
+
pointerTypeRef.current = event.pointerType;
|
| 1627 |
+
allowMouseSelectionRef.current = true;
|
| 1628 |
+
resetDragMovement();
|
| 1629 |
+
},
|
| 1630 |
+
onMouseUp() {
|
| 1631 |
+
resetDragMovement();
|
| 1632 |
+
if (disabled || pointerTypeRef.current === "touch") return;
|
| 1633 |
+
if (allowMouseSelectionRef.current) return;
|
| 1634 |
+
const disallowSelectedMouseUp = !selectionRef.current.allowSelectedMouseUp && selected;
|
| 1635 |
+
const disallowUnselectedMouseUp = !selectionRef.current.allowUnselectedMouseUp && !selected;
|
| 1636 |
+
if (disallowSelectedMouseUp || disallowUnselectedMouseUp) return;
|
| 1637 |
+
allowMouseSelectionRef.current = true;
|
| 1638 |
+
itemRef.current?.click();
|
| 1639 |
+
allowMouseSelectionRef.current = false;
|
| 1640 |
+
}
|
| 1641 |
+
};
|
| 1642 |
+
const element = useRenderElement("div", componentProps, {
|
| 1643 |
+
ref: [
|
| 1644 |
+
buttonRef,
|
| 1645 |
+
forwardedRef,
|
| 1646 |
+
listItem.ref,
|
| 1647 |
+
itemRef
|
| 1648 |
+
],
|
| 1649 |
+
state,
|
| 1650 |
+
props: [
|
| 1651 |
+
itemProps,
|
| 1652 |
+
defaultProps,
|
| 1653 |
+
elementProps,
|
| 1654 |
+
getButtonProps
|
| 1655 |
+
]
|
| 1656 |
+
});
|
| 1657 |
+
const contextValue = import_react.useMemo(() => ({
|
| 1658 |
+
selected,
|
| 1659 |
+
index,
|
| 1660 |
+
textRef,
|
| 1661 |
+
selectedByFocus,
|
| 1662 |
+
hasRegistered
|
| 1663 |
+
}), [
|
| 1664 |
+
selected,
|
| 1665 |
+
index,
|
| 1666 |
+
textRef,
|
| 1667 |
+
selectedByFocus,
|
| 1668 |
+
hasRegistered
|
| 1669 |
+
]);
|
| 1670 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItemContext.Provider, {
|
| 1671 |
+
value: contextValue,
|
| 1672 |
+
children: element
|
| 1673 |
+
});
|
| 1674 |
+
}));
|
| 1675 |
+
SelectItem.displayName = "SelectItem";
|
| 1676 |
+
//#endregion
|
| 1677 |
+
//#region ../node_modules/@base-ui/react/esm/select/item-indicator/SelectItemIndicator.js
|
| 1678 |
+
/**
|
| 1679 |
+
* Indicates whether the select item is selected.
|
| 1680 |
+
* Renders a `<span>` element.
|
| 1681 |
+
*
|
| 1682 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 1683 |
+
*/
|
| 1684 |
+
var SelectItemIndicator = /* @__PURE__ */ import_react.forwardRef(function SelectItemIndicator(componentProps, forwardedRef) {
|
| 1685 |
+
const keepMounted = componentProps.keepMounted ?? false;
|
| 1686 |
+
const { selected } = useSelectItemContext();
|
| 1687 |
+
if (!(keepMounted || selected)) return null;
|
| 1688 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Inner, {
|
| 1689 |
+
...componentProps,
|
| 1690 |
+
ref: forwardedRef
|
| 1691 |
+
});
|
| 1692 |
+
});
|
| 1693 |
+
SelectItemIndicator.displayName = "SelectItemIndicator";
|
| 1694 |
+
var Inner = /* @__PURE__ */ import_react.memo(/* @__PURE__ */ import_react.forwardRef((componentProps, forwardedRef) => {
|
| 1695 |
+
const { render, className, style, keepMounted, ...elementProps } = componentProps;
|
| 1696 |
+
const { selected } = useSelectItemContext();
|
| 1697 |
+
const indicatorRef = import_react.useRef(null);
|
| 1698 |
+
const { transitionStatus, setMounted } = useTransitionStatus(selected);
|
| 1699 |
+
const element = useRenderElement("span", componentProps, {
|
| 1700 |
+
ref: [forwardedRef, indicatorRef],
|
| 1701 |
+
state: {
|
| 1702 |
+
selected,
|
| 1703 |
+
transitionStatus
|
| 1704 |
+
},
|
| 1705 |
+
props: [{
|
| 1706 |
+
"aria-hidden": true,
|
| 1707 |
+
children: "✔️"
|
| 1708 |
+
}, elementProps],
|
| 1709 |
+
stateAttributesMapping: transitionStatusMapping
|
| 1710 |
+
});
|
| 1711 |
+
useOpenChangeComplete({
|
| 1712 |
+
open: selected,
|
| 1713 |
+
ref: indicatorRef,
|
| 1714 |
+
onComplete() {
|
| 1715 |
+
if (!selected) setMounted(false);
|
| 1716 |
+
}
|
| 1717 |
+
});
|
| 1718 |
+
return element;
|
| 1719 |
+
}));
|
| 1720 |
+
Inner.displayName = "Inner";
|
| 1721 |
+
//#endregion
|
| 1722 |
+
//#region ../node_modules/@base-ui/react/esm/select/item-text/SelectItemText.js
|
| 1723 |
+
/**
|
| 1724 |
+
* A text label of the select item.
|
| 1725 |
+
* Renders a `<div>` element.
|
| 1726 |
+
*
|
| 1727 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 1728 |
+
*/
|
| 1729 |
+
var SelectItemText = /* @__PURE__ */ import_react.memo(/* @__PURE__ */ import_react.forwardRef(function SelectItemText(componentProps, forwardedRef) {
|
| 1730 |
+
const { index, textRef, selectedByFocus, hasRegistered } = useSelectItemContext();
|
| 1731 |
+
const { firstItemTextRef, selectedItemTextRef } = useSelectRootContext();
|
| 1732 |
+
const { render, className, style, ...elementProps } = componentProps;
|
| 1733 |
+
return useRenderElement("div", componentProps, {
|
| 1734 |
+
ref: [
|
| 1735 |
+
import_react.useCallback((node) => {
|
| 1736 |
+
if (!node) return;
|
| 1737 |
+
if (hasRegistered && index === 0) firstItemTextRef.current = node;
|
| 1738 |
+
if (hasRegistered && selectedByFocus) selectedItemTextRef.current = node;
|
| 1739 |
+
}, [
|
| 1740 |
+
firstItemTextRef,
|
| 1741 |
+
selectedItemTextRef,
|
| 1742 |
+
index,
|
| 1743 |
+
selectedByFocus,
|
| 1744 |
+
hasRegistered
|
| 1745 |
+
]),
|
| 1746 |
+
forwardedRef,
|
| 1747 |
+
textRef
|
| 1748 |
+
],
|
| 1749 |
+
props: elementProps
|
| 1750 |
+
});
|
| 1751 |
+
}));
|
| 1752 |
+
SelectItemText.displayName = "SelectItemText";
|
| 1753 |
+
//#endregion
|
| 1754 |
+
//#region ../node_modules/@base-ui/react/esm/select/arrow/SelectArrow.js
|
| 1755 |
+
var stateAttributesMapping = {
|
| 1756 |
+
...popupStateMapping,
|
| 1757 |
+
...transitionStatusMapping
|
| 1758 |
+
};
|
| 1759 |
+
/**
|
| 1760 |
+
* Displays an element positioned against the select popup anchor.
|
| 1761 |
+
* Renders a `<div>` element.
|
| 1762 |
+
*
|
| 1763 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 1764 |
+
*/
|
| 1765 |
+
var SelectArrow = /* @__PURE__ */ import_react.forwardRef(function SelectArrow(componentProps, forwardedRef) {
|
| 1766 |
+
const { render, className, style, ...elementProps } = componentProps;
|
| 1767 |
+
const { store } = useSelectRootContext();
|
| 1768 |
+
const { side, align, arrowRef, arrowStyles, arrowUncentered, alignItemWithTriggerActive } = useSelectPositionerContext();
|
| 1769 |
+
const element = useRenderElement("div", componentProps, {
|
| 1770 |
+
state: {
|
| 1771 |
+
open: useStore(store, selectors.open, true),
|
| 1772 |
+
side,
|
| 1773 |
+
align,
|
| 1774 |
+
uncentered: arrowUncentered
|
| 1775 |
+
},
|
| 1776 |
+
ref: [arrowRef, forwardedRef],
|
| 1777 |
+
props: [{
|
| 1778 |
+
style: arrowStyles,
|
| 1779 |
+
"aria-hidden": true
|
| 1780 |
+
}, elementProps],
|
| 1781 |
+
stateAttributesMapping
|
| 1782 |
+
});
|
| 1783 |
+
if (alignItemWithTriggerActive) return null;
|
| 1784 |
+
return element;
|
| 1785 |
+
});
|
| 1786 |
+
SelectArrow.displayName = "SelectArrow";
|
| 1787 |
+
//#endregion
|
| 1788 |
+
//#region ../node_modules/@base-ui/react/esm/select/scroll-arrow/SelectScrollArrow.js
|
| 1789 |
+
/**
|
| 1790 |
+
* @internal
|
| 1791 |
+
*/
|
| 1792 |
+
var SelectScrollArrow = /* @__PURE__ */ import_react.forwardRef(function SelectScrollArrow(componentProps, forwardedRef) {
|
| 1793 |
+
const { render, className, style, direction, keepMounted = false, ...elementProps } = componentProps;
|
| 1794 |
+
const isUp = direction === "up";
|
| 1795 |
+
const { store, popupRef, listRef, handleScrollArrowVisibility, scrollArrowsMountedCountRef } = useSelectRootContext();
|
| 1796 |
+
const { side, scrollDownArrowRef, scrollUpArrowRef } = useSelectPositionerContext();
|
| 1797 |
+
const stateVisible = useStore(store, isUp ? selectors.scrollUpArrowVisible : selectors.scrollDownArrowVisible);
|
| 1798 |
+
const openMethod = useStore(store, selectors.openMethod);
|
| 1799 |
+
const visible = stateVisible && openMethod !== "touch";
|
| 1800 |
+
const timeout = useTimeout();
|
| 1801 |
+
const scrollArrowRef = isUp ? scrollUpArrowRef : scrollDownArrowRef;
|
| 1802 |
+
const { transitionStatus, setMounted } = useTransitionStatus(visible);
|
| 1803 |
+
useIsoLayoutEffect(() => {
|
| 1804 |
+
scrollArrowsMountedCountRef.current += 1;
|
| 1805 |
+
if (!store.state.hasScrollArrows) store.set("hasScrollArrows", true);
|
| 1806 |
+
return () => {
|
| 1807 |
+
scrollArrowsMountedCountRef.current = Math.max(0, scrollArrowsMountedCountRef.current - 1);
|
| 1808 |
+
if (scrollArrowsMountedCountRef.current === 0 && store.state.hasScrollArrows) store.set("hasScrollArrows", false);
|
| 1809 |
+
};
|
| 1810 |
+
}, [store, scrollArrowsMountedCountRef]);
|
| 1811 |
+
useOpenChangeComplete({
|
| 1812 |
+
open: visible,
|
| 1813 |
+
ref: scrollArrowRef,
|
| 1814 |
+
onComplete() {
|
| 1815 |
+
if (!visible) setMounted(false);
|
| 1816 |
+
}
|
| 1817 |
+
});
|
| 1818 |
+
const element = useRenderElement("div", componentProps, {
|
| 1819 |
+
ref: [forwardedRef, scrollArrowRef],
|
| 1820 |
+
state: {
|
| 1821 |
+
direction,
|
| 1822 |
+
visible,
|
| 1823 |
+
side,
|
| 1824 |
+
transitionStatus
|
| 1825 |
+
},
|
| 1826 |
+
props: [{
|
| 1827 |
+
"aria-hidden": true,
|
| 1828 |
+
children: isUp ? "▲" : "▼",
|
| 1829 |
+
style: { position: "absolute" },
|
| 1830 |
+
onMouseMove(event) {
|
| 1831 |
+
if (event.movementX === 0 && event.movementY === 0 || timeout.isStarted()) return;
|
| 1832 |
+
store.set("activeIndex", null);
|
| 1833 |
+
function scrollNextItem() {
|
| 1834 |
+
const scroller = store.state.listElement ?? popupRef.current;
|
| 1835 |
+
if (!scroller) return;
|
| 1836 |
+
store.set("activeIndex", null);
|
| 1837 |
+
handleScrollArrowVisibility();
|
| 1838 |
+
const maxScrollTop = getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);
|
| 1839 |
+
const scrollTop = normalizeScrollOffset(scroller.scrollTop, maxScrollTop);
|
| 1840 |
+
const isScrolledToEdge = scrollTop === (isUp ? 0 : maxScrollTop);
|
| 1841 |
+
const items = listRef.current;
|
| 1842 |
+
if (scrollTop !== scroller.scrollTop) scroller.scrollTop = scrollTop;
|
| 1843 |
+
if (items.length === 0) store.set(isUp ? "scrollUpArrowVisible" : "scrollDownArrowVisible", !isScrolledToEdge);
|
| 1844 |
+
if (isScrolledToEdge) {
|
| 1845 |
+
timeout.clear();
|
| 1846 |
+
return;
|
| 1847 |
+
}
|
| 1848 |
+
if (items.length > 0) {
|
| 1849 |
+
const scrollArrowHeight = scrollArrowRef.current?.offsetHeight || 0;
|
| 1850 |
+
scroller.scrollTop = getTargetScrollTop(items, isUp, scrollTop, scroller.clientHeight, scrollArrowHeight, maxScrollTop);
|
| 1851 |
+
}
|
| 1852 |
+
timeout.start(40, scrollNextItem);
|
| 1853 |
+
}
|
| 1854 |
+
timeout.start(40, scrollNextItem);
|
| 1855 |
+
},
|
| 1856 |
+
onMouseLeave() {
|
| 1857 |
+
timeout.clear();
|
| 1858 |
+
}
|
| 1859 |
+
}, elementProps]
|
| 1860 |
+
});
|
| 1861 |
+
if (!(visible || keepMounted)) return null;
|
| 1862 |
+
return element;
|
| 1863 |
+
});
|
| 1864 |
+
SelectScrollArrow.displayName = "SelectScrollArrow";
|
| 1865 |
+
function getTargetScrollTop(items, isUp, scrollTop, clientHeight, scrollArrowHeight, maxScrollTop) {
|
| 1866 |
+
if (isUp) {
|
| 1867 |
+
let firstVisibleIndex = 0;
|
| 1868 |
+
const visibleTop = scrollTop + scrollArrowHeight - 1;
|
| 1869 |
+
for (let i = 0; i < items.length; i += 1) {
|
| 1870 |
+
const item = items[i];
|
| 1871 |
+
if (item && item.offsetTop >= visibleTop) {
|
| 1872 |
+
firstVisibleIndex = i;
|
| 1873 |
+
break;
|
| 1874 |
+
}
|
| 1875 |
+
}
|
| 1876 |
+
const targetIndex = Math.max(0, firstVisibleIndex - 1);
|
| 1877 |
+
const targetItem = items[targetIndex];
|
| 1878 |
+
return targetIndex < firstVisibleIndex && targetItem ? normalizeScrollOffset(targetItem.offsetTop - scrollArrowHeight, maxScrollTop) : 0;
|
| 1879 |
+
}
|
| 1880 |
+
let lastVisibleIndex = items.length - 1;
|
| 1881 |
+
const visibleBottom = scrollTop + clientHeight - scrollArrowHeight + 1;
|
| 1882 |
+
for (let i = 0; i < items.length; i += 1) {
|
| 1883 |
+
const item = items[i];
|
| 1884 |
+
if (item && item.offsetTop + item.offsetHeight > visibleBottom) {
|
| 1885 |
+
lastVisibleIndex = Math.max(0, i - 1);
|
| 1886 |
+
break;
|
| 1887 |
+
}
|
| 1888 |
+
}
|
| 1889 |
+
const targetIndex = Math.min(items.length - 1, lastVisibleIndex + 1);
|
| 1890 |
+
const targetItem = items[targetIndex];
|
| 1891 |
+
return targetIndex > lastVisibleIndex && targetItem ? normalizeScrollOffset(targetItem.offsetTop + targetItem.offsetHeight - clientHeight + scrollArrowHeight, maxScrollTop) : maxScrollTop;
|
| 1892 |
+
}
|
| 1893 |
+
//#endregion
|
| 1894 |
+
//#region ../node_modules/@base-ui/react/esm/select/scroll-down-arrow/SelectScrollDownArrow.js
|
| 1895 |
+
/**
|
| 1896 |
+
* An element that scrolls the select popup down when hovered. Does not render when using touch input.
|
| 1897 |
+
* Renders a `<div>` element.
|
| 1898 |
+
*
|
| 1899 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 1900 |
+
*/
|
| 1901 |
+
var SelectScrollDownArrow = /* @__PURE__ */ import_react.forwardRef(function SelectScrollDownArrow(props, forwardedRef) {
|
| 1902 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollArrow, {
|
| 1903 |
+
...props,
|
| 1904 |
+
ref: forwardedRef,
|
| 1905 |
+
direction: "down"
|
| 1906 |
+
});
|
| 1907 |
+
});
|
| 1908 |
+
SelectScrollDownArrow.displayName = "SelectScrollDownArrow";
|
| 1909 |
+
//#endregion
|
| 1910 |
+
//#region ../node_modules/@base-ui/react/esm/select/scroll-up-arrow/SelectScrollUpArrow.js
|
| 1911 |
+
/**
|
| 1912 |
+
* An element that scrolls the select popup up when hovered. Does not render when using touch input.
|
| 1913 |
+
* Renders a `<div>` element.
|
| 1914 |
+
*
|
| 1915 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 1916 |
+
*/
|
| 1917 |
+
var SelectScrollUpArrow = /* @__PURE__ */ import_react.forwardRef(function SelectScrollUpArrow(props, forwardedRef) {
|
| 1918 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollArrow, {
|
| 1919 |
+
...props,
|
| 1920 |
+
ref: forwardedRef,
|
| 1921 |
+
direction: "up"
|
| 1922 |
+
});
|
| 1923 |
+
});
|
| 1924 |
+
SelectScrollUpArrow.displayName = "SelectScrollUpArrow";
|
| 1925 |
+
//#endregion
|
| 1926 |
+
//#region ../node_modules/@base-ui/react/esm/select/group/SelectGroupContext.js
|
| 1927 |
+
var SelectGroupContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 1928 |
+
SelectGroupContext.displayName = "SelectGroupContext";
|
| 1929 |
+
function useSelectGroupContext() {
|
| 1930 |
+
const context = import_react.useContext(SelectGroupContext);
|
| 1931 |
+
if (context === void 0) throw new Error("Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>.");
|
| 1932 |
+
return context;
|
| 1933 |
+
}
|
| 1934 |
+
//#endregion
|
| 1935 |
+
//#region ../node_modules/@base-ui/react/esm/select/group/SelectGroup.js
|
| 1936 |
+
/**
|
| 1937 |
+
* Groups related select items with the corresponding label.
|
| 1938 |
+
* Renders a `<div>` element.
|
| 1939 |
+
*
|
| 1940 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 1941 |
+
*/
|
| 1942 |
+
var SelectGroup = /* @__PURE__ */ import_react.forwardRef(function SelectGroup(componentProps, forwardedRef) {
|
| 1943 |
+
const { render, className, style, ...elementProps } = componentProps;
|
| 1944 |
+
const [labelId, setLabelId] = import_react.useState();
|
| 1945 |
+
const contextValue = import_react.useMemo(() => ({
|
| 1946 |
+
labelId,
|
| 1947 |
+
setLabelId
|
| 1948 |
+
}), [labelId, setLabelId]);
|
| 1949 |
+
const element = useRenderElement("div", componentProps, {
|
| 1950 |
+
ref: forwardedRef,
|
| 1951 |
+
props: [{
|
| 1952 |
+
role: "group",
|
| 1953 |
+
"aria-labelledby": labelId
|
| 1954 |
+
}, elementProps]
|
| 1955 |
+
});
|
| 1956 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectGroupContext.Provider, {
|
| 1957 |
+
value: contextValue,
|
| 1958 |
+
children: element
|
| 1959 |
+
});
|
| 1960 |
+
});
|
| 1961 |
+
SelectGroup.displayName = "SelectGroup";
|
| 1962 |
+
//#endregion
|
| 1963 |
+
//#region ../node_modules/@base-ui/react/esm/select/group-label/SelectGroupLabel.js
|
| 1964 |
+
/**
|
| 1965 |
+
* An accessible label that is automatically associated with its parent group.
|
| 1966 |
+
* Renders a `<div>` element.
|
| 1967 |
+
*
|
| 1968 |
+
* Documentation: [Base UI Select](https://base-ui.com/react/components/select)
|
| 1969 |
+
*/
|
| 1970 |
+
var SelectGroupLabel = /* @__PURE__ */ import_react.forwardRef(function SelectGroupLabel(componentProps, forwardedRef) {
|
| 1971 |
+
const { render, className, style, id: idProp, ...elementProps } = componentProps;
|
| 1972 |
+
const { setLabelId } = useSelectGroupContext();
|
| 1973 |
+
const id = useBaseUiId(idProp);
|
| 1974 |
+
useIsoLayoutEffect(() => {
|
| 1975 |
+
setLabelId(id);
|
| 1976 |
+
}, [id, setLabelId]);
|
| 1977 |
+
return useRenderElement("div", componentProps, {
|
| 1978 |
+
ref: forwardedRef,
|
| 1979 |
+
props: [{ id }, elementProps]
|
| 1980 |
+
});
|
| 1981 |
+
});
|
| 1982 |
+
SelectGroupLabel.displayName = "SelectGroupLabel";
|
| 1983 |
+
//#endregion
|
| 1984 |
+
//#region ../node_modules/@base-ui/react/esm/select/index.parts.js
|
| 1985 |
+
var index_parts_exports = /* @__PURE__ */ __exportAll({
|
| 1986 |
+
Arrow: () => SelectArrow,
|
| 1987 |
+
Backdrop: () => SelectBackdrop,
|
| 1988 |
+
Group: () => SelectGroup,
|
| 1989 |
+
GroupLabel: () => SelectGroupLabel,
|
| 1990 |
+
Icon: () => SelectIcon,
|
| 1991 |
+
Item: () => SelectItem,
|
| 1992 |
+
ItemIndicator: () => SelectItemIndicator,
|
| 1993 |
+
ItemText: () => SelectItemText,
|
| 1994 |
+
Label: () => SelectLabel,
|
| 1995 |
+
List: () => SelectList,
|
| 1996 |
+
Popup: () => SelectPopup,
|
| 1997 |
+
Portal: () => SelectPortal,
|
| 1998 |
+
Positioner: () => SelectPositioner,
|
| 1999 |
+
Root: () => SelectRoot,
|
| 2000 |
+
ScrollDownArrow: () => SelectScrollDownArrow,
|
| 2001 |
+
ScrollUpArrow: () => SelectScrollUpArrow,
|
| 2002 |
+
Separator: () => Separator,
|
| 2003 |
+
Trigger: () => SelectTrigger,
|
| 2004 |
+
Value: () => SelectValue
|
| 2005 |
+
});
|
| 2006 |
+
//#endregion
|
| 2007 |
+
export { index_parts_exports as Select };
|
| 2008 |
+
|
| 2009 |
+
//# sourceMappingURL=@base-ui_react_select.js.map
|
client/node_modules/.vite/deps/@base-ui_react_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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { i as __toESM, r as __exportAll, t as require_react } from "./react-DMmEJb6B.js";
|
| 2 |
+
import { t as require_jsx_runtime } from "./react_jsx-runtime.js";
|
| 3 |
+
import { C as getWindow, l as mergeProps, r as EMPTY_OBJECT, s as useMergedRefs, t as useRenderElement, u as useIsoLayoutEffect } from "./useRenderElement-3Cwvu1gO.js";
|
| 4 |
+
import { t as useButton } from "./useButton-CBy-cFDk.js";
|
| 5 |
+
import { a as fieldValidityMapping, i as useFieldRootContext, n as useLabelableId, r as useLabelableContext, t as useRegisterFieldControl } from "./useRegisterFieldControl-CPlvTQh-.js";
|
| 6 |
+
import { t as useFormContext } from "./FormContext-D8skpAva.js";
|
| 7 |
+
import { _ as useBaseUiId, l as none, t as createChangeEventDetails } from "./createBaseUIEventDetails-CJxlTiBH.js";
|
| 8 |
+
import { t as useControlled } from "./useControlled-B7gU8wdF.js";
|
| 9 |
+
import { n as visuallyHidden, r as visuallyHiddenInput, t as useValueChanged } from "./useValueChanged-C6oHa1CC.js";
|
| 10 |
+
//#region ../node_modules/@base-ui/react/esm/internals/labelable-provider/useAriaLabelledBy.js
|
| 11 |
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
| 12 |
+
/**
|
| 13 |
+
* @internal
|
| 14 |
+
*/
|
| 15 |
+
function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId) {
|
| 16 |
+
const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] = import_react.useState();
|
| 17 |
+
const generatedLabelId = useBaseUiId(labelSourceId ? `${labelSourceId}-label` : void 0);
|
| 18 |
+
const ariaLabelledBy = explicitAriaLabelledBy ?? labelId ?? fallbackAriaLabelledBy;
|
| 19 |
+
useIsoLayoutEffect(() => {
|
| 20 |
+
const nextAriaLabelledBy = explicitAriaLabelledBy || labelId || !enableFallback ? void 0 : getAriaLabelledBy(labelSourceRef.current, generatedLabelId);
|
| 21 |
+
if (fallbackAriaLabelledBy !== nextAriaLabelledBy) setFallbackAriaLabelledBy(nextAriaLabelledBy);
|
| 22 |
+
});
|
| 23 |
+
return ariaLabelledBy;
|
| 24 |
+
}
|
| 25 |
+
function getAriaLabelledBy(labelSource, generatedLabelId) {
|
| 26 |
+
const label = findAssociatedLabel(labelSource);
|
| 27 |
+
if (!label) return;
|
| 28 |
+
if (!label.id && generatedLabelId) label.id = generatedLabelId;
|
| 29 |
+
return label.id || void 0;
|
| 30 |
+
}
|
| 31 |
+
function findAssociatedLabel(labelSource) {
|
| 32 |
+
if (!labelSource) return;
|
| 33 |
+
const parent = labelSource.parentElement;
|
| 34 |
+
if (parent && parent.tagName === "LABEL") return parent;
|
| 35 |
+
const controlId = labelSource.id;
|
| 36 |
+
if (controlId) {
|
| 37 |
+
const nextSibling = labelSource.nextElementSibling;
|
| 38 |
+
if (nextSibling && nextSibling.htmlFor === controlId) return nextSibling;
|
| 39 |
+
}
|
| 40 |
+
const labels = labelSource.labels;
|
| 41 |
+
return labels && labels[0];
|
| 42 |
+
}
|
| 43 |
+
//#endregion
|
| 44 |
+
//#region ../node_modules/@base-ui/react/esm/switch/root/SwitchRootContext.js
|
| 45 |
+
var SwitchRootContext = /* @__PURE__ */ import_react.createContext(void 0);
|
| 46 |
+
SwitchRootContext.displayName = "SwitchRootContext";
|
| 47 |
+
function useSwitchRootContext() {
|
| 48 |
+
const context = import_react.useContext(SwitchRootContext);
|
| 49 |
+
if (context === void 0) throw new Error("Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.");
|
| 50 |
+
return context;
|
| 51 |
+
}
|
| 52 |
+
//#endregion
|
| 53 |
+
//#region ../node_modules/@base-ui/react/esm/switch/root/SwitchRootDataAttributes.js
|
| 54 |
+
var SwitchRootDataAttributes = /* @__PURE__ */ function(SwitchRootDataAttributes) {
|
| 55 |
+
/**
|
| 56 |
+
* Present when the switch is checked.
|
| 57 |
+
*/
|
| 58 |
+
SwitchRootDataAttributes["checked"] = "data-checked";
|
| 59 |
+
/**
|
| 60 |
+
* Present when the switch is not checked.
|
| 61 |
+
*/
|
| 62 |
+
SwitchRootDataAttributes["unchecked"] = "data-unchecked";
|
| 63 |
+
/**
|
| 64 |
+
* Present when the switch is disabled.
|
| 65 |
+
*/
|
| 66 |
+
SwitchRootDataAttributes["disabled"] = "data-disabled";
|
| 67 |
+
/**
|
| 68 |
+
* Present when the switch is readonly.
|
| 69 |
+
*/
|
| 70 |
+
SwitchRootDataAttributes["readonly"] = "data-readonly";
|
| 71 |
+
/**
|
| 72 |
+
* Present when the switch is required.
|
| 73 |
+
*/
|
| 74 |
+
SwitchRootDataAttributes["required"] = "data-required";
|
| 75 |
+
/**
|
| 76 |
+
* Present when the switch is in a valid state (when wrapped in Field.Root).
|
| 77 |
+
*/
|
| 78 |
+
SwitchRootDataAttributes["valid"] = "data-valid";
|
| 79 |
+
/**
|
| 80 |
+
* Present when the switch is in an invalid state (when wrapped in Field.Root).
|
| 81 |
+
*/
|
| 82 |
+
SwitchRootDataAttributes["invalid"] = "data-invalid";
|
| 83 |
+
/**
|
| 84 |
+
* Present when the switch has been touched (when wrapped in Field.Root).
|
| 85 |
+
*/
|
| 86 |
+
SwitchRootDataAttributes["touched"] = "data-touched";
|
| 87 |
+
/**
|
| 88 |
+
* Present when the switch's value has changed (when wrapped in Field.Root).
|
| 89 |
+
*/
|
| 90 |
+
SwitchRootDataAttributes["dirty"] = "data-dirty";
|
| 91 |
+
/**
|
| 92 |
+
* Present when the switch is active (when wrapped in Field.Root).
|
| 93 |
+
*/
|
| 94 |
+
SwitchRootDataAttributes["filled"] = "data-filled";
|
| 95 |
+
/**
|
| 96 |
+
* Present when the switch is focused (when wrapped in Field.Root).
|
| 97 |
+
*/
|
| 98 |
+
SwitchRootDataAttributes["focused"] = "data-focused";
|
| 99 |
+
return SwitchRootDataAttributes;
|
| 100 |
+
}({});
|
| 101 |
+
//#endregion
|
| 102 |
+
//#region ../node_modules/@base-ui/react/esm/switch/stateAttributesMapping.js
|
| 103 |
+
var stateAttributesMapping = {
|
| 104 |
+
...fieldValidityMapping,
|
| 105 |
+
checked(value) {
|
| 106 |
+
if (value) return { [SwitchRootDataAttributes.checked]: "" };
|
| 107 |
+
return { [SwitchRootDataAttributes.unchecked]: "" };
|
| 108 |
+
}
|
| 109 |
+
};
|
| 110 |
+
//#endregion
|
| 111 |
+
//#region ../node_modules/@base-ui/react/esm/switch/root/SwitchRoot.js
|
| 112 |
+
var import_jsx_runtime = require_jsx_runtime();
|
| 113 |
+
var SwitchRoot = /* @__PURE__ */ import_react.forwardRef(function SwitchRoot(componentProps, forwardedRef) {
|
| 114 |
+
const { checked: checkedProp, className, defaultChecked, "aria-labelledby": ariaLabelledByProp, form, id: idProp, inputRef: externalInputRef, name: nameProp, nativeButton = false, onCheckedChange, readOnly = false, required = false, disabled: disabledProp = false, render, uncheckedValue, value, style, ...elementProps } = componentProps;
|
| 115 |
+
const { clearErrors } = useFormContext();
|
| 116 |
+
const { state: fieldState, setTouched, setDirty, validityData, setFilled, setFocused, shouldValidateOnChange, validationMode, disabled: fieldDisabled, name: fieldName, validation } = useFieldRootContext();
|
| 117 |
+
const { labelId } = useLabelableContext();
|
| 118 |
+
const disabled = fieldDisabled || disabledProp;
|
| 119 |
+
const name = fieldName ?? nameProp;
|
| 120 |
+
const inputRef = import_react.useRef(null);
|
| 121 |
+
const handleInputRef = useMergedRefs(inputRef, externalInputRef, validation.inputRef);
|
| 122 |
+
const switchRef = import_react.useRef(null);
|
| 123 |
+
const id = useBaseUiId();
|
| 124 |
+
const controlId = useLabelableId({
|
| 125 |
+
id: idProp,
|
| 126 |
+
implicit: false,
|
| 127 |
+
controlRef: switchRef
|
| 128 |
+
});
|
| 129 |
+
const hiddenInputId = nativeButton ? void 0 : controlId;
|
| 130 |
+
const [checked, setCheckedState] = useControlled({
|
| 131 |
+
controlled: checkedProp,
|
| 132 |
+
default: Boolean(defaultChecked),
|
| 133 |
+
name: "Switch",
|
| 134 |
+
state: "checked"
|
| 135 |
+
});
|
| 136 |
+
useRegisterFieldControl(switchRef, id, checked);
|
| 137 |
+
useIsoLayoutEffect(() => {
|
| 138 |
+
if (inputRef.current) setFilled(inputRef.current.checked);
|
| 139 |
+
}, [inputRef, setFilled]);
|
| 140 |
+
useValueChanged(checked, () => {
|
| 141 |
+
clearErrors(name);
|
| 142 |
+
setDirty(checked !== validityData.initialValue);
|
| 143 |
+
setFilled(checked);
|
| 144 |
+
if (shouldValidateOnChange()) validation.commit(checked);
|
| 145 |
+
else validation.commit(checked, true);
|
| 146 |
+
});
|
| 147 |
+
const { getButtonProps, buttonRef } = useButton({
|
| 148 |
+
disabled,
|
| 149 |
+
native: nativeButton
|
| 150 |
+
});
|
| 151 |
+
const ariaLabelledBy = useAriaLabelledBy(ariaLabelledByProp, labelId, inputRef, !nativeButton, hiddenInputId);
|
| 152 |
+
const rootProps = {
|
| 153 |
+
id: nativeButton ? controlId : id,
|
| 154 |
+
role: "switch",
|
| 155 |
+
"aria-checked": checked,
|
| 156 |
+
"aria-readonly": readOnly || void 0,
|
| 157 |
+
"aria-required": required || void 0,
|
| 158 |
+
"aria-labelledby": ariaLabelledBy,
|
| 159 |
+
onFocus() {
|
| 160 |
+
if (!disabled) setFocused(true);
|
| 161 |
+
},
|
| 162 |
+
onBlur() {
|
| 163 |
+
const element = inputRef.current;
|
| 164 |
+
if (!element || disabled) return;
|
| 165 |
+
setTouched(true);
|
| 166 |
+
setFocused(false);
|
| 167 |
+
if (validationMode === "onBlur") validation.commit(element.checked);
|
| 168 |
+
},
|
| 169 |
+
onClick(event) {
|
| 170 |
+
if (readOnly || disabled) return;
|
| 171 |
+
event.preventDefault();
|
| 172 |
+
const input = inputRef.current;
|
| 173 |
+
if (!input) return;
|
| 174 |
+
input.dispatchEvent(new (getWindow(input)).PointerEvent("click", {
|
| 175 |
+
bubbles: true,
|
| 176 |
+
shiftKey: event.shiftKey,
|
| 177 |
+
ctrlKey: event.ctrlKey,
|
| 178 |
+
altKey: event.altKey,
|
| 179 |
+
metaKey: event.metaKey
|
| 180 |
+
}));
|
| 181 |
+
}
|
| 182 |
+
};
|
| 183 |
+
const inputProps = mergeProps({
|
| 184 |
+
checked,
|
| 185 |
+
disabled,
|
| 186 |
+
form,
|
| 187 |
+
id: hiddenInputId,
|
| 188 |
+
name,
|
| 189 |
+
required,
|
| 190 |
+
style: name ? visuallyHiddenInput : visuallyHidden,
|
| 191 |
+
tabIndex: -1,
|
| 192 |
+
type: "checkbox",
|
| 193 |
+
"aria-hidden": true,
|
| 194 |
+
ref: handleInputRef,
|
| 195 |
+
onChange(event) {
|
| 196 |
+
if (event.nativeEvent.defaultPrevented) return;
|
| 197 |
+
if (readOnly) {
|
| 198 |
+
event.preventDefault();
|
| 199 |
+
return;
|
| 200 |
+
}
|
| 201 |
+
const nextChecked = event.currentTarget.checked;
|
| 202 |
+
const eventDetails = createChangeEventDetails(none, event.nativeEvent);
|
| 203 |
+
onCheckedChange?.(nextChecked, eventDetails);
|
| 204 |
+
if (eventDetails.isCanceled) return;
|
| 205 |
+
setCheckedState(nextChecked);
|
| 206 |
+
},
|
| 207 |
+
onFocus() {
|
| 208 |
+
switchRef.current?.focus();
|
| 209 |
+
}
|
| 210 |
+
}, validation.getInputValidationProps, value !== void 0 ? { value } : EMPTY_OBJECT);
|
| 211 |
+
const state = import_react.useMemo(() => ({
|
| 212 |
+
...fieldState,
|
| 213 |
+
checked,
|
| 214 |
+
disabled,
|
| 215 |
+
readOnly,
|
| 216 |
+
required
|
| 217 |
+
}), [
|
| 218 |
+
fieldState,
|
| 219 |
+
checked,
|
| 220 |
+
disabled,
|
| 221 |
+
readOnly,
|
| 222 |
+
required
|
| 223 |
+
]);
|
| 224 |
+
const element = useRenderElement("span", componentProps, {
|
| 225 |
+
state,
|
| 226 |
+
ref: [
|
| 227 |
+
forwardedRef,
|
| 228 |
+
switchRef,
|
| 229 |
+
buttonRef
|
| 230 |
+
],
|
| 231 |
+
props: [
|
| 232 |
+
rootProps,
|
| 233 |
+
validation.getValidationProps,
|
| 234 |
+
elementProps,
|
| 235 |
+
getButtonProps
|
| 236 |
+
],
|
| 237 |
+
stateAttributesMapping
|
| 238 |
+
});
|
| 239 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SwitchRootContext.Provider, {
|
| 240 |
+
value: state,
|
| 241 |
+
children: [
|
| 242 |
+
element,
|
| 243 |
+
!checked && name && uncheckedValue !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
|
| 244 |
+
type: "hidden",
|
| 245 |
+
form,
|
| 246 |
+
name,
|
| 247 |
+
value: uncheckedValue
|
| 248 |
+
}),
|
| 249 |
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
|
| 250 |
+
...inputProps,
|
| 251 |
+
suppressHydrationWarning: true
|
| 252 |
+
})
|
| 253 |
+
]
|
| 254 |
+
});
|
| 255 |
+
});
|
| 256 |
+
SwitchRoot.displayName = "SwitchRoot";
|
| 257 |
+
//#endregion
|
| 258 |
+
//#region ../node_modules/@base-ui/react/esm/switch/thumb/SwitchThumb.js
|
| 259 |
+
/**
|
| 260 |
+
* The movable part of the switch that indicates whether the switch is on or off.
|
| 261 |
+
* Renders a `<span>`.
|
| 262 |
+
*
|
| 263 |
+
* Documentation: [Base UI Switch](https://base-ui.com/react/components/switch)
|
| 264 |
+
*/
|
| 265 |
+
var SwitchThumb = /* @__PURE__ */ import_react.forwardRef(function SwitchThumb(componentProps, forwardedRef) {
|
| 266 |
+
const { render, className, style, ...elementProps } = componentProps;
|
| 267 |
+
return useRenderElement("span", componentProps, {
|
| 268 |
+
state: useSwitchRootContext(),
|
| 269 |
+
ref: forwardedRef,
|
| 270 |
+
stateAttributesMapping,
|
| 271 |
+
props: elementProps
|
| 272 |
+
});
|
| 273 |
+
});
|
| 274 |
+
SwitchThumb.displayName = "SwitchThumb";
|
| 275 |
+
//#endregion
|
| 276 |
+
//#region ../node_modules/@base-ui/react/esm/switch/index.parts.js
|
| 277 |
+
var index_parts_exports = /* @__PURE__ */ __exportAll({
|
| 278 |
+
Root: () => SwitchRoot,
|
| 279 |
+
Thumb: () => SwitchThumb
|
| 280 |
+
});
|
| 281 |
+
//#endregion
|
| 282 |
+
export { index_parts_exports as Switch };
|
| 283 |
+
|
| 284 |
+
//# sourceMappingURL=@base-ui_react_switch.js.map
|
client/node_modules/.vite/deps/@base-ui_react_switch.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"@base-ui_react_switch.js","names":["ownerWindow","REASONS.none"],"sources":["../../../../node_modules/@base-ui/react/esm/internals/labelable-provider/useAriaLabelledBy.js","../../../../node_modules/@base-ui/react/esm/switch/root/SwitchRootContext.js","../../../../node_modules/@base-ui/react/esm/switch/root/SwitchRootDataAttributes.js","../../../../node_modules/@base-ui/react/esm/switch/stateAttributesMapping.js","../../../../node_modules/@base-ui/react/esm/switch/root/SwitchRoot.js","../../../../node_modules/@base-ui/react/esm/switch/thumb/SwitchThumb.js","../../../../node_modules/@base-ui/react/esm/switch/index.parts.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../useBaseUiId.js\";\n\n/**\n * @internal\n */\nexport function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId) {\n const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] = React.useState();\n const generatedLabelId = useBaseUiId(labelSourceId ? `${labelSourceId}-label` : undefined);\n const ariaLabelledBy = explicitAriaLabelledBy ?? labelId ?? fallbackAriaLabelledBy;\n\n // Fallback for <span> controls labelled by wrapping/sibling native <label>.\n // Run after every commit so DOM association changes (e.g. label mount/unmount)\n // are reflected even when props/state deps are unchanged.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useIsoLayoutEffect(() => {\n const nextAriaLabelledBy = explicitAriaLabelledBy || labelId || !enableFallback ? undefined : getAriaLabelledBy(labelSourceRef.current, generatedLabelId);\n if (fallbackAriaLabelledBy !== nextAriaLabelledBy) {\n setFallbackAriaLabelledBy(nextAriaLabelledBy);\n }\n });\n return ariaLabelledBy;\n}\nfunction getAriaLabelledBy(labelSource, generatedLabelId) {\n const label = findAssociatedLabel(labelSource);\n if (!label) {\n return undefined;\n }\n if (!label.id && generatedLabelId) {\n label.id = generatedLabelId;\n }\n return label.id || undefined;\n}\nfunction findAssociatedLabel(labelSource) {\n if (!labelSource) {\n return undefined;\n }\n\n // Fast path before the expensive `.labels` read.\n const parent = labelSource.parentElement;\n if (parent && parent.tagName === 'LABEL') {\n return parent;\n }\n const controlId = labelSource.id;\n if (controlId) {\n const nextSibling = labelSource.nextElementSibling;\n if (nextSibling && nextSibling.htmlFor === controlId) {\n return nextSibling;\n }\n }\n const labels = labelSource.labels;\n return labels && labels[0];\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SwitchRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SwitchRootContext.displayName = \"SwitchRootContext\";\nexport function useSwitchRootContext() {\n const context = React.useContext(SwitchRootContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.' : _formatErrorMessage(63));\n }\n return context;\n}","export let SwitchRootDataAttributes = /*#__PURE__*/function (SwitchRootDataAttributes) {\n /**\n * Present when the switch is checked.\n */\n SwitchRootDataAttributes[\"checked\"] = \"data-checked\";\n /**\n * Present when the switch is not checked.\n */\n SwitchRootDataAttributes[\"unchecked\"] = \"data-unchecked\";\n /**\n * Present when the switch is disabled.\n */\n SwitchRootDataAttributes[\"disabled\"] = \"data-disabled\";\n /**\n * Present when the switch is readonly.\n */\n SwitchRootDataAttributes[\"readonly\"] = \"data-readonly\";\n /**\n * Present when the switch is required.\n */\n SwitchRootDataAttributes[\"required\"] = \"data-required\";\n /**\n * Present when the switch is in a valid state (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"valid\"] = \"data-valid\";\n /**\n * Present when the switch is in an invalid state (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"invalid\"] = \"data-invalid\";\n /**\n * Present when the switch has been touched (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"touched\"] = \"data-touched\";\n /**\n * Present when the switch's value has changed (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"dirty\"] = \"data-dirty\";\n /**\n * Present when the switch is active (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"filled\"] = \"data-filled\";\n /**\n * Present when the switch is focused (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"focused\"] = \"data-focused\";\n return SwitchRootDataAttributes;\n}({});","import { fieldValidityMapping } from \"../internals/field-constants/constants.js\";\nimport { SwitchRootDataAttributes } from \"./root/SwitchRootDataAttributes.js\";\nexport const stateAttributesMapping = {\n ...fieldValidityMapping,\n checked(value) {\n if (value) {\n return {\n [SwitchRootDataAttributes.checked]: ''\n };\n }\n return {\n [SwitchRootDataAttributes.unchecked]: ''\n };\n }\n};","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { ownerWindow } from '@base-ui/utils/owner';\nimport { useRenderElement } from \"../../internals/useRenderElement.js\";\nimport { mergeProps } from \"../../merge-props/index.js\";\nimport { useBaseUiId } from \"../../internals/useBaseUiId.js\";\nimport { useButton } from \"../../internals/use-button/index.js\";\nimport { SwitchRootContext } from \"./SwitchRootContext.js\";\nimport { stateAttributesMapping } from \"../stateAttributesMapping.js\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.js\";\nimport { useRegisterFieldControl } from \"../../internals/field-register-control/useRegisterFieldControl.js\";\nimport { useFormContext } from \"../../internals/form-context/FormContext.js\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.js\";\nimport { useAriaLabelledBy } from \"../../internals/labelable-provider/useAriaLabelledBy.js\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.js\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../internals/reasons.js\";\nimport { useValueChanged } from \"../../internals/useValueChanged.js\";\n\n/**\n * Represents the switch itself.\n * Renders a `<span>` element and a hidden `<input>` beside.\n *\n * Documentation: [Base UI Switch](https://base-ui.com/react/components/switch)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const SwitchRoot = /*#__PURE__*/React.forwardRef(function SwitchRoot(componentProps, forwardedRef) {\n const {\n checked: checkedProp,\n className,\n defaultChecked,\n 'aria-labelledby': ariaLabelledByProp,\n form,\n id: idProp,\n inputRef: externalInputRef,\n name: nameProp,\n nativeButton = false,\n onCheckedChange,\n readOnly = false,\n required = false,\n disabled: disabledProp = false,\n render,\n uncheckedValue,\n value,\n style,\n ...elementProps\n } = componentProps;\n const {\n clearErrors\n } = useFormContext();\n const {\n state: fieldState,\n setTouched,\n setDirty,\n validityData,\n setFilled,\n setFocused,\n shouldValidateOnChange,\n validationMode,\n disabled: fieldDisabled,\n name: fieldName,\n validation\n } = useFieldRootContext();\n const {\n labelId\n } = useLabelableContext();\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const inputRef = React.useRef(null);\n const handleInputRef = useMergedRefs(inputRef, externalInputRef, validation.inputRef);\n const switchRef = React.useRef(null);\n const id = useBaseUiId();\n const controlId = useLabelableId({\n id: idProp,\n implicit: false,\n controlRef: switchRef\n });\n const hiddenInputId = nativeButton ? undefined : controlId;\n const [checked, setCheckedState] = useControlled({\n controlled: checkedProp,\n default: Boolean(defaultChecked),\n name: 'Switch',\n state: 'checked'\n });\n useRegisterFieldControl(switchRef, id, checked);\n useIsoLayoutEffect(() => {\n if (inputRef.current) {\n setFilled(inputRef.current.checked);\n }\n }, [inputRef, setFilled]);\n useValueChanged(checked, () => {\n clearErrors(name);\n setDirty(checked !== validityData.initialValue);\n setFilled(checked);\n if (shouldValidateOnChange()) {\n validation.commit(checked);\n } else {\n validation.commit(checked, true);\n }\n });\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const ariaLabelledBy = useAriaLabelledBy(ariaLabelledByProp, labelId, inputRef, !nativeButton, hiddenInputId);\n const rootProps = {\n id: nativeButton ? controlId : id,\n role: 'switch',\n 'aria-checked': checked,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n 'aria-labelledby': ariaLabelledBy,\n onFocus() {\n if (!disabled) {\n setFocused(true);\n }\n },\n onBlur() {\n const element = inputRef.current;\n if (!element || disabled) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(element.checked);\n }\n },\n onClick(event) {\n if (readOnly || disabled) {\n return;\n }\n event.preventDefault();\n const input = inputRef.current;\n if (!input) {\n return;\n }\n input.dispatchEvent(new (ownerWindow(input).PointerEvent)('click', {\n bubbles: true,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n altKey: event.altKey,\n metaKey: event.metaKey\n }));\n }\n };\n const inputProps = mergeProps({\n checked,\n disabled,\n form,\n id: hiddenInputId,\n name,\n required,\n style: name ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n type: 'checkbox',\n 'aria-hidden': true,\n ref: handleInputRef,\n onChange(event) {\n // Workaround for https://github.com/facebook/react/issues/9023\n if (event.nativeEvent.defaultPrevented) {\n return;\n }\n if (readOnly) {\n event.preventDefault();\n return;\n }\n const nextChecked = event.currentTarget.checked;\n const eventDetails = createChangeEventDetails(REASONS.none, event.nativeEvent);\n onCheckedChange?.(nextChecked, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setCheckedState(nextChecked);\n },\n onFocus() {\n switchRef.current?.focus();\n }\n }, validation.getInputValidationProps,\n // React <19 sets an empty value if `undefined` is passed explicitly\n // To avoid this, we only set the value if it's defined\n value !== undefined ? {\n value\n } : EMPTY_OBJECT);\n const state = React.useMemo(() => ({\n ...fieldState,\n checked,\n disabled,\n readOnly,\n required\n }), [fieldState, checked, disabled, readOnly, required]);\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [forwardedRef, switchRef, buttonRef],\n props: [rootProps, validation.getValidationProps, elementProps, getButtonProps],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsxs(SwitchRootContext.Provider, {\n value: state,\n children: [element, !checked && name && uncheckedValue !== undefined && /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: uncheckedValue\n }), /*#__PURE__*/_jsx(\"input\", {\n ...inputProps,\n suppressHydrationWarning: true\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SwitchRoot.displayName = \"SwitchRoot\";","'use client';\n\nimport * as React from 'react';\nimport { useSwitchRootContext } from \"../root/SwitchRootContext.js\";\nimport { useRenderElement } from \"../../internals/useRenderElement.js\";\nimport { stateAttributesMapping } from \"../stateAttributesMapping.js\";\n\n/**\n * The movable part of the switch that indicates whether the switch is on or off.\n * Renders a `<span>`.\n *\n * Documentation: [Base UI Switch](https://base-ui.com/react/components/switch)\n */\nexport const SwitchThumb = /*#__PURE__*/React.forwardRef(function SwitchThumb(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const state = useSwitchRootContext();\n return useRenderElement('span', componentProps, {\n state,\n ref: forwardedRef,\n stateAttributesMapping,\n props: elementProps\n });\n});\nif (process.env.NODE_ENV !== \"production\") SwitchThumb.displayName = \"SwitchThumb\";","export { SwitchRoot as Root } from \"./root/SwitchRoot.js\";\nexport { SwitchThumb as Thumb } from \"./thumb/SwitchThumb.js\";"],"x_google_ignoreList":[0,1,2,3,4,5,6],"mappings":";;;;;;;;;;;;;;AASA,SAAgB,kBAAkB,wBAAwB,SAAS,gBAAgB,iBAAiB,MAAM,eAAe;CACvH,MAAM,CAAC,wBAAwB,6BAAA,aAAmC,SAAS;CAC3E,MAAM,mBAAmB,YAAY,gBAAgB,GAAG,cAAc,UAAU,KAAA,CAAS;CACzF,MAAM,iBAAiB,0BAA0B,WAAW;CAM5D,yBAAyB;EACvB,MAAM,qBAAqB,0BAA0B,WAAW,CAAC,iBA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;EACjC,GAAG;EACH;EACA;EACA;EACA;CACF,IAAI;EAAC;EAAY;EAAS;EAAU;EAAU;CAAQ,CAAC;CACvD,MAAM,UAAU,iBAAiB,QAAQ,gBAAgB;EACvD;EACA,KAAK;GAAC;GAAc;GAAW;EAAS;EACxC,OAAO;GAAC;GAAW,WAAW;GAAoB;GAAc;EAAc;EAC9E;CACF,CAAC;CACD,OAAoB,iBAAA,GAAA,mBAAA,MAAM,kBAAkB,UAAU;EACpD,OAAO;EACP,UAAU;GAAC;GAAS,CAAC,WAAW,QAAQ,mBAAmB,KAAA,KAA0B,iBAAA,GAAA,mBAAA,KAAK,SAAS;IACjG,MAAM;IACA;IACA;IACN,OAAO;GACT,CAAC;GAAgB,iBAAA,GAAA,mBAAA,KAAK,SAAS;IAC7B,GAAG;IACH,0BAA0B;GAC5B,CAAC;EAAC;CACJ,CAAC;AACH,CAAC;AAC0C,WAAW,cAAc;;;;;;;;;AC9MpE,IAAa,cAA2B,6BAAM,WAAW,SAAS,YAAY,gBAAgB,cAAc;CAC1G,MAAM,EACJ,QACA,WACA,OACA,GAAG,iBACD;CAEJ,OAAO,iBAAiB,QAAQ,gBAAgB;EAC9C,OAFY,qBAER;EACJ,KAAK;EACL;EACA,OAAO;CACT,CAAC;AACH,CAAC;AAC0C,YAAY,cAAc"}
|
client/node_modules/.vite/deps/@dnd-kit_core.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import "./@dnd-kit_utilities.js";
|
| 2 |
+
import { A as useSensor, C as getScrollableAncestors, D as useDndMonitor, E as useDndContext, O as useDraggable, S as getFirstCollision, T as rectIntersection, _ as defaultDropAnimationConfiguration, a as KeyboardSensor, b as defaultScreenReaderInstructions, c as MouseSensor, d as TraversalOrder, f as applyModifiers, g as defaultCoordinates, h as defaultAnnouncements, i as KeyboardCode, j as useSensors, k as useDroppable, l as PointerSensor, m as closestCorners, n as DndContext, o as MeasuringFrequency, p as closestCenter, r as DragOverlay, s as MeasuringStrategy, t as AutoScrollActivator, u as TouchSensor, v as defaultDropAnimationSideEffects, w as pointerWithin, x as getClientRect, y as defaultKeyboardCoordinateGetter } from "./core.esm-C6hd_DVz.js";
|
| 3 |
+
export { AutoScrollActivator, DndContext, DragOverlay, KeyboardCode, KeyboardSensor, MeasuringFrequency, MeasuringStrategy, MouseSensor, PointerSensor, TouchSensor, TraversalOrder, applyModifiers, closestCenter, closestCorners, defaultAnnouncements, defaultCoordinates, defaultDropAnimationConfiguration as defaultDropAnimation, defaultDropAnimationSideEffects, defaultKeyboardCoordinateGetter, defaultScreenReaderInstructions, getClientRect, getFirstCollision, getScrollableAncestors, pointerWithin, rectIntersection, useDndContext, useDndMonitor, useDraggable, useDroppable, useSensor, useSensors };
|
client/node_modules/.vite/deps/@dnd-kit_sortable.js
ADDED
|
@@ -0,0 +1,510 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { i as __toESM, t as require_react } from "./react-DMmEJb6B.js";
|
| 2 |
+
import { CSS, isKeyboardEvent, subtract, useCombinedRefs, useIsomorphicLayoutEffect, useUniqueId } from "./@dnd-kit_utilities.js";
|
| 3 |
+
import { C as getScrollableAncestors, E as useDndContext, O as useDraggable, S as getFirstCollision, i as KeyboardCode, k as useDroppable, m as closestCorners, x as getClientRect } from "./core.esm-C6hd_DVz.js";
|
| 4 |
+
//#region ../node_modules/@dnd-kit/sortable/dist/sortable.esm.js
|
| 5 |
+
var import_react = /* @__PURE__ */ __toESM(require_react());
|
| 6 |
+
/**
|
| 7 |
+
* Move an array item to a different position. Returns a new array with the item moved to the new position.
|
| 8 |
+
*/
|
| 9 |
+
function arrayMove(array, from, to) {
|
| 10 |
+
const newArray = array.slice();
|
| 11 |
+
newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]);
|
| 12 |
+
return newArray;
|
| 13 |
+
}
|
| 14 |
+
/**
|
| 15 |
+
* Swap an array item to a different position. Returns a new array with the item swapped to the new position.
|
| 16 |
+
*/
|
| 17 |
+
function arraySwap(array, from, to) {
|
| 18 |
+
const newArray = array.slice();
|
| 19 |
+
newArray[from] = array[to];
|
| 20 |
+
newArray[to] = array[from];
|
| 21 |
+
return newArray;
|
| 22 |
+
}
|
| 23 |
+
function getSortedRects(items, rects) {
|
| 24 |
+
return items.reduce((accumulator, id, index) => {
|
| 25 |
+
const rect = rects.get(id);
|
| 26 |
+
if (rect) accumulator[index] = rect;
|
| 27 |
+
return accumulator;
|
| 28 |
+
}, Array(items.length));
|
| 29 |
+
}
|
| 30 |
+
function isValidIndex(index) {
|
| 31 |
+
return index !== null && index >= 0;
|
| 32 |
+
}
|
| 33 |
+
function itemsEqual(a, b) {
|
| 34 |
+
if (a === b) return true;
|
| 35 |
+
if (a.length !== b.length) return false;
|
| 36 |
+
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;
|
| 37 |
+
return true;
|
| 38 |
+
}
|
| 39 |
+
function normalizeDisabled(disabled) {
|
| 40 |
+
if (typeof disabled === "boolean") return {
|
| 41 |
+
draggable: disabled,
|
| 42 |
+
droppable: disabled
|
| 43 |
+
};
|
| 44 |
+
return disabled;
|
| 45 |
+
}
|
| 46 |
+
var defaultScale = {
|
| 47 |
+
scaleX: 1,
|
| 48 |
+
scaleY: 1
|
| 49 |
+
};
|
| 50 |
+
var horizontalListSortingStrategy = (_ref) => {
|
| 51 |
+
var _rects$activeIndex;
|
| 52 |
+
let { rects, activeNodeRect: fallbackActiveRect, activeIndex, overIndex, index } = _ref;
|
| 53 |
+
const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
|
| 54 |
+
if (!activeNodeRect) return null;
|
| 55 |
+
const itemGap = getItemGap(rects, index, activeIndex);
|
| 56 |
+
if (index === activeIndex) {
|
| 57 |
+
const newIndexRect = rects[overIndex];
|
| 58 |
+
if (!newIndexRect) return null;
|
| 59 |
+
return {
|
| 60 |
+
x: activeIndex < overIndex ? newIndexRect.left + newIndexRect.width - (activeNodeRect.left + activeNodeRect.width) : newIndexRect.left - activeNodeRect.left,
|
| 61 |
+
y: 0,
|
| 62 |
+
...defaultScale
|
| 63 |
+
};
|
| 64 |
+
}
|
| 65 |
+
if (index > activeIndex && index <= overIndex) return {
|
| 66 |
+
x: -activeNodeRect.width - itemGap,
|
| 67 |
+
y: 0,
|
| 68 |
+
...defaultScale
|
| 69 |
+
};
|
| 70 |
+
if (index < activeIndex && index >= overIndex) return {
|
| 71 |
+
x: activeNodeRect.width + itemGap,
|
| 72 |
+
y: 0,
|
| 73 |
+
...defaultScale
|
| 74 |
+
};
|
| 75 |
+
return {
|
| 76 |
+
x: 0,
|
| 77 |
+
y: 0,
|
| 78 |
+
...defaultScale
|
| 79 |
+
};
|
| 80 |
+
};
|
| 81 |
+
function getItemGap(rects, index, activeIndex) {
|
| 82 |
+
const currentRect = rects[index];
|
| 83 |
+
const previousRect = rects[index - 1];
|
| 84 |
+
const nextRect = rects[index + 1];
|
| 85 |
+
if (!currentRect || !previousRect && !nextRect) return 0;
|
| 86 |
+
if (activeIndex < index) return previousRect ? currentRect.left - (previousRect.left + previousRect.width) : nextRect.left - (currentRect.left + currentRect.width);
|
| 87 |
+
return nextRect ? nextRect.left - (currentRect.left + currentRect.width) : currentRect.left - (previousRect.left + previousRect.width);
|
| 88 |
+
}
|
| 89 |
+
var rectSortingStrategy = (_ref) => {
|
| 90 |
+
let { rects, activeIndex, overIndex, index } = _ref;
|
| 91 |
+
const newRects = arrayMove(rects, overIndex, activeIndex);
|
| 92 |
+
const oldRect = rects[index];
|
| 93 |
+
const newRect = newRects[index];
|
| 94 |
+
if (!newRect || !oldRect) return null;
|
| 95 |
+
return {
|
| 96 |
+
x: newRect.left - oldRect.left,
|
| 97 |
+
y: newRect.top - oldRect.top,
|
| 98 |
+
scaleX: newRect.width / oldRect.width,
|
| 99 |
+
scaleY: newRect.height / oldRect.height
|
| 100 |
+
};
|
| 101 |
+
};
|
| 102 |
+
var rectSwappingStrategy = (_ref) => {
|
| 103 |
+
let { activeIndex, index, rects, overIndex } = _ref;
|
| 104 |
+
let oldRect;
|
| 105 |
+
let newRect;
|
| 106 |
+
if (index === activeIndex) {
|
| 107 |
+
oldRect = rects[index];
|
| 108 |
+
newRect = rects[overIndex];
|
| 109 |
+
}
|
| 110 |
+
if (index === overIndex) {
|
| 111 |
+
oldRect = rects[index];
|
| 112 |
+
newRect = rects[activeIndex];
|
| 113 |
+
}
|
| 114 |
+
if (!newRect || !oldRect) return null;
|
| 115 |
+
return {
|
| 116 |
+
x: newRect.left - oldRect.left,
|
| 117 |
+
y: newRect.top - oldRect.top,
|
| 118 |
+
scaleX: newRect.width / oldRect.width,
|
| 119 |
+
scaleY: newRect.height / oldRect.height
|
| 120 |
+
};
|
| 121 |
+
};
|
| 122 |
+
var defaultScale$1 = {
|
| 123 |
+
scaleX: 1,
|
| 124 |
+
scaleY: 1
|
| 125 |
+
};
|
| 126 |
+
var verticalListSortingStrategy = (_ref) => {
|
| 127 |
+
var _rects$activeIndex;
|
| 128 |
+
let { activeIndex, activeNodeRect: fallbackActiveRect, index, rects, overIndex } = _ref;
|
| 129 |
+
const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
|
| 130 |
+
if (!activeNodeRect) return null;
|
| 131 |
+
if (index === activeIndex) {
|
| 132 |
+
const overIndexRect = rects[overIndex];
|
| 133 |
+
if (!overIndexRect) return null;
|
| 134 |
+
return {
|
| 135 |
+
x: 0,
|
| 136 |
+
y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top,
|
| 137 |
+
...defaultScale$1
|
| 138 |
+
};
|
| 139 |
+
}
|
| 140 |
+
const itemGap = getItemGap$1(rects, index, activeIndex);
|
| 141 |
+
if (index > activeIndex && index <= overIndex) return {
|
| 142 |
+
x: 0,
|
| 143 |
+
y: -activeNodeRect.height - itemGap,
|
| 144 |
+
...defaultScale$1
|
| 145 |
+
};
|
| 146 |
+
if (index < activeIndex && index >= overIndex) return {
|
| 147 |
+
x: 0,
|
| 148 |
+
y: activeNodeRect.height + itemGap,
|
| 149 |
+
...defaultScale$1
|
| 150 |
+
};
|
| 151 |
+
return {
|
| 152 |
+
x: 0,
|
| 153 |
+
y: 0,
|
| 154 |
+
...defaultScale$1
|
| 155 |
+
};
|
| 156 |
+
};
|
| 157 |
+
function getItemGap$1(clientRects, index, activeIndex) {
|
| 158 |
+
const currentRect = clientRects[index];
|
| 159 |
+
const previousRect = clientRects[index - 1];
|
| 160 |
+
const nextRect = clientRects[index + 1];
|
| 161 |
+
if (!currentRect) return 0;
|
| 162 |
+
if (activeIndex < index) return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0;
|
| 163 |
+
return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0;
|
| 164 |
+
}
|
| 165 |
+
var ID_PREFIX = "Sortable";
|
| 166 |
+
var Context = /* @__PURE__ */ import_react.createContext({
|
| 167 |
+
activeIndex: -1,
|
| 168 |
+
containerId: ID_PREFIX,
|
| 169 |
+
disableTransforms: false,
|
| 170 |
+
items: [],
|
| 171 |
+
overIndex: -1,
|
| 172 |
+
useDragOverlay: false,
|
| 173 |
+
sortedRects: [],
|
| 174 |
+
strategy: rectSortingStrategy,
|
| 175 |
+
disabled: {
|
| 176 |
+
draggable: false,
|
| 177 |
+
droppable: false
|
| 178 |
+
}
|
| 179 |
+
});
|
| 180 |
+
function SortableContext(_ref) {
|
| 181 |
+
let { children, id, items: userDefinedItems, strategy = rectSortingStrategy, disabled: disabledProp = false } = _ref;
|
| 182 |
+
const { active, dragOverlay, droppableRects, over, measureDroppableContainers } = useDndContext();
|
| 183 |
+
const containerId = useUniqueId(ID_PREFIX, id);
|
| 184 |
+
const useDragOverlay = Boolean(dragOverlay.rect !== null);
|
| 185 |
+
const items = (0, import_react.useMemo)(() => userDefinedItems.map((item) => typeof item === "object" && "id" in item ? item.id : item), [userDefinedItems]);
|
| 186 |
+
const isDragging = active != null;
|
| 187 |
+
const activeIndex = active ? items.indexOf(active.id) : -1;
|
| 188 |
+
const overIndex = over ? items.indexOf(over.id) : -1;
|
| 189 |
+
const previousItemsRef = (0, import_react.useRef)(items);
|
| 190 |
+
const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current);
|
| 191 |
+
const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;
|
| 192 |
+
const disabled = normalizeDisabled(disabledProp);
|
| 193 |
+
useIsomorphicLayoutEffect(() => {
|
| 194 |
+
if (itemsHaveChanged && isDragging) measureDroppableContainers(items);
|
| 195 |
+
}, [
|
| 196 |
+
itemsHaveChanged,
|
| 197 |
+
items,
|
| 198 |
+
isDragging,
|
| 199 |
+
measureDroppableContainers
|
| 200 |
+
]);
|
| 201 |
+
(0, import_react.useEffect)(() => {
|
| 202 |
+
previousItemsRef.current = items;
|
| 203 |
+
}, [items]);
|
| 204 |
+
const contextValue = (0, import_react.useMemo)(() => ({
|
| 205 |
+
activeIndex,
|
| 206 |
+
containerId,
|
| 207 |
+
disabled,
|
| 208 |
+
disableTransforms,
|
| 209 |
+
items,
|
| 210 |
+
overIndex,
|
| 211 |
+
useDragOverlay,
|
| 212 |
+
sortedRects: getSortedRects(items, droppableRects),
|
| 213 |
+
strategy
|
| 214 |
+
}), [
|
| 215 |
+
activeIndex,
|
| 216 |
+
containerId,
|
| 217 |
+
disabled.draggable,
|
| 218 |
+
disabled.droppable,
|
| 219 |
+
disableTransforms,
|
| 220 |
+
items,
|
| 221 |
+
overIndex,
|
| 222 |
+
droppableRects,
|
| 223 |
+
useDragOverlay,
|
| 224 |
+
strategy
|
| 225 |
+
]);
|
| 226 |
+
return import_react.createElement(Context.Provider, { value: contextValue }, children);
|
| 227 |
+
}
|
| 228 |
+
var defaultNewIndexGetter = (_ref) => {
|
| 229 |
+
let { id, items, activeIndex, overIndex } = _ref;
|
| 230 |
+
return arrayMove(items, activeIndex, overIndex).indexOf(id);
|
| 231 |
+
};
|
| 232 |
+
var defaultAnimateLayoutChanges = (_ref2) => {
|
| 233 |
+
let { containerId, isSorting, wasDragging, index, items, newIndex, previousItems, previousContainerId, transition } = _ref2;
|
| 234 |
+
if (!transition || !wasDragging) return false;
|
| 235 |
+
if (previousItems !== items && index === newIndex) return false;
|
| 236 |
+
if (isSorting) return true;
|
| 237 |
+
return newIndex !== index && containerId === previousContainerId;
|
| 238 |
+
};
|
| 239 |
+
var defaultTransition = {
|
| 240 |
+
duration: 200,
|
| 241 |
+
easing: "ease"
|
| 242 |
+
};
|
| 243 |
+
var transitionProperty = "transform";
|
| 244 |
+
var disabledTransition = /* @__PURE__ */ CSS.Transition.toString({
|
| 245 |
+
property: transitionProperty,
|
| 246 |
+
duration: 0,
|
| 247 |
+
easing: "linear"
|
| 248 |
+
});
|
| 249 |
+
var defaultAttributes = { roleDescription: "sortable" };
|
| 250 |
+
function useDerivedTransform(_ref) {
|
| 251 |
+
let { disabled, index, node, rect } = _ref;
|
| 252 |
+
const [derivedTransform, setDerivedtransform] = (0, import_react.useState)(null);
|
| 253 |
+
const previousIndex = (0, import_react.useRef)(index);
|
| 254 |
+
useIsomorphicLayoutEffect(() => {
|
| 255 |
+
if (!disabled && index !== previousIndex.current && node.current) {
|
| 256 |
+
const initial = rect.current;
|
| 257 |
+
if (initial) {
|
| 258 |
+
const current = getClientRect(node.current, { ignoreTransform: true });
|
| 259 |
+
const delta = {
|
| 260 |
+
x: initial.left - current.left,
|
| 261 |
+
y: initial.top - current.top,
|
| 262 |
+
scaleX: initial.width / current.width,
|
| 263 |
+
scaleY: initial.height / current.height
|
| 264 |
+
};
|
| 265 |
+
if (delta.x || delta.y) setDerivedtransform(delta);
|
| 266 |
+
}
|
| 267 |
+
}
|
| 268 |
+
if (index !== previousIndex.current) previousIndex.current = index;
|
| 269 |
+
}, [
|
| 270 |
+
disabled,
|
| 271 |
+
index,
|
| 272 |
+
node,
|
| 273 |
+
rect
|
| 274 |
+
]);
|
| 275 |
+
(0, import_react.useEffect)(() => {
|
| 276 |
+
if (derivedTransform) setDerivedtransform(null);
|
| 277 |
+
}, [derivedTransform]);
|
| 278 |
+
return derivedTransform;
|
| 279 |
+
}
|
| 280 |
+
function useSortable(_ref) {
|
| 281 |
+
let { animateLayoutChanges = defaultAnimateLayoutChanges, attributes: userDefinedAttributes, disabled: localDisabled, data: customData, getNewIndex = defaultNewIndexGetter, id, strategy: localStrategy, resizeObserverConfig, transition = defaultTransition } = _ref;
|
| 282 |
+
const { items, containerId, activeIndex, disabled: globalDisabled, disableTransforms, sortedRects, overIndex, useDragOverlay, strategy: globalStrategy } = (0, import_react.useContext)(Context);
|
| 283 |
+
const disabled = normalizeLocalDisabled(localDisabled, globalDisabled);
|
| 284 |
+
const index = items.indexOf(id);
|
| 285 |
+
const data = (0, import_react.useMemo)(() => ({
|
| 286 |
+
sortable: {
|
| 287 |
+
containerId,
|
| 288 |
+
index,
|
| 289 |
+
items
|
| 290 |
+
},
|
| 291 |
+
...customData
|
| 292 |
+
}), [
|
| 293 |
+
containerId,
|
| 294 |
+
customData,
|
| 295 |
+
index,
|
| 296 |
+
items
|
| 297 |
+
]);
|
| 298 |
+
const itemsAfterCurrentSortable = (0, import_react.useMemo)(() => items.slice(items.indexOf(id)), [items, id]);
|
| 299 |
+
const { rect, node, isOver, setNodeRef: setDroppableNodeRef } = useDroppable({
|
| 300 |
+
id,
|
| 301 |
+
data,
|
| 302 |
+
disabled: disabled.droppable,
|
| 303 |
+
resizeObserverConfig: {
|
| 304 |
+
updateMeasurementsFor: itemsAfterCurrentSortable,
|
| 305 |
+
...resizeObserverConfig
|
| 306 |
+
}
|
| 307 |
+
});
|
| 308 |
+
const { active, activatorEvent, activeNodeRect, attributes, setNodeRef: setDraggableNodeRef, listeners, isDragging, over, setActivatorNodeRef, transform } = useDraggable({
|
| 309 |
+
id,
|
| 310 |
+
data,
|
| 311 |
+
attributes: {
|
| 312 |
+
...defaultAttributes,
|
| 313 |
+
...userDefinedAttributes
|
| 314 |
+
},
|
| 315 |
+
disabled: disabled.draggable
|
| 316 |
+
});
|
| 317 |
+
const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef);
|
| 318 |
+
const isSorting = Boolean(active);
|
| 319 |
+
const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex);
|
| 320 |
+
const shouldDisplaceDragSource = !useDragOverlay && isDragging;
|
| 321 |
+
const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null;
|
| 322 |
+
const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : (localStrategy != null ? localStrategy : globalStrategy)({
|
| 323 |
+
rects: sortedRects,
|
| 324 |
+
activeNodeRect,
|
| 325 |
+
activeIndex,
|
| 326 |
+
overIndex,
|
| 327 |
+
index
|
| 328 |
+
}) : null;
|
| 329 |
+
const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({
|
| 330 |
+
id,
|
| 331 |
+
items,
|
| 332 |
+
activeIndex,
|
| 333 |
+
overIndex
|
| 334 |
+
}) : index;
|
| 335 |
+
const activeId = active == null ? void 0 : active.id;
|
| 336 |
+
const previous = (0, import_react.useRef)({
|
| 337 |
+
activeId,
|
| 338 |
+
items,
|
| 339 |
+
newIndex,
|
| 340 |
+
containerId
|
| 341 |
+
});
|
| 342 |
+
const itemsHaveChanged = items !== previous.current.items;
|
| 343 |
+
const shouldAnimateLayoutChanges = animateLayoutChanges({
|
| 344 |
+
active,
|
| 345 |
+
containerId,
|
| 346 |
+
isDragging,
|
| 347 |
+
isSorting,
|
| 348 |
+
id,
|
| 349 |
+
index,
|
| 350 |
+
items,
|
| 351 |
+
newIndex: previous.current.newIndex,
|
| 352 |
+
previousItems: previous.current.items,
|
| 353 |
+
previousContainerId: previous.current.containerId,
|
| 354 |
+
transition,
|
| 355 |
+
wasDragging: previous.current.activeId != null
|
| 356 |
+
});
|
| 357 |
+
const derivedTransform = useDerivedTransform({
|
| 358 |
+
disabled: !shouldAnimateLayoutChanges,
|
| 359 |
+
index,
|
| 360 |
+
node,
|
| 361 |
+
rect
|
| 362 |
+
});
|
| 363 |
+
(0, import_react.useEffect)(() => {
|
| 364 |
+
if (isSorting && previous.current.newIndex !== newIndex) previous.current.newIndex = newIndex;
|
| 365 |
+
if (containerId !== previous.current.containerId) previous.current.containerId = containerId;
|
| 366 |
+
if (items !== previous.current.items) previous.current.items = items;
|
| 367 |
+
}, [
|
| 368 |
+
isSorting,
|
| 369 |
+
newIndex,
|
| 370 |
+
containerId,
|
| 371 |
+
items
|
| 372 |
+
]);
|
| 373 |
+
(0, import_react.useEffect)(() => {
|
| 374 |
+
if (activeId === previous.current.activeId) return;
|
| 375 |
+
if (activeId != null && previous.current.activeId == null) {
|
| 376 |
+
previous.current.activeId = activeId;
|
| 377 |
+
return;
|
| 378 |
+
}
|
| 379 |
+
const timeoutId = setTimeout(() => {
|
| 380 |
+
previous.current.activeId = activeId;
|
| 381 |
+
}, 50);
|
| 382 |
+
return () => clearTimeout(timeoutId);
|
| 383 |
+
}, [activeId]);
|
| 384 |
+
return {
|
| 385 |
+
active,
|
| 386 |
+
activeIndex,
|
| 387 |
+
attributes,
|
| 388 |
+
data,
|
| 389 |
+
rect,
|
| 390 |
+
index,
|
| 391 |
+
newIndex,
|
| 392 |
+
items,
|
| 393 |
+
isOver,
|
| 394 |
+
isSorting,
|
| 395 |
+
isDragging,
|
| 396 |
+
listeners,
|
| 397 |
+
node,
|
| 398 |
+
overIndex,
|
| 399 |
+
over,
|
| 400 |
+
setNodeRef,
|
| 401 |
+
setActivatorNodeRef,
|
| 402 |
+
setDroppableNodeRef,
|
| 403 |
+
setDraggableNodeRef,
|
| 404 |
+
transform: derivedTransform != null ? derivedTransform : finalTransform,
|
| 405 |
+
transition: getTransition()
|
| 406 |
+
};
|
| 407 |
+
function getTransition() {
|
| 408 |
+
if (derivedTransform || itemsHaveChanged && previous.current.newIndex === index) return disabledTransition;
|
| 409 |
+
if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) return;
|
| 410 |
+
if (isSorting || shouldAnimateLayoutChanges) return CSS.Transition.toString({
|
| 411 |
+
...transition,
|
| 412 |
+
property: transitionProperty
|
| 413 |
+
});
|
| 414 |
+
}
|
| 415 |
+
}
|
| 416 |
+
function normalizeLocalDisabled(localDisabled, globalDisabled) {
|
| 417 |
+
var _localDisabled$dragga, _localDisabled$droppa;
|
| 418 |
+
if (typeof localDisabled === "boolean") return {
|
| 419 |
+
draggable: localDisabled,
|
| 420 |
+
droppable: false
|
| 421 |
+
};
|
| 422 |
+
return {
|
| 423 |
+
draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable,
|
| 424 |
+
droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable
|
| 425 |
+
};
|
| 426 |
+
}
|
| 427 |
+
function hasSortableData(entry) {
|
| 428 |
+
if (!entry) return false;
|
| 429 |
+
const data = entry.data.current;
|
| 430 |
+
if (data && "sortable" in data && typeof data.sortable === "object" && "containerId" in data.sortable && "items" in data.sortable && "index" in data.sortable) return true;
|
| 431 |
+
return false;
|
| 432 |
+
}
|
| 433 |
+
var directions = [
|
| 434 |
+
KeyboardCode.Down,
|
| 435 |
+
KeyboardCode.Right,
|
| 436 |
+
KeyboardCode.Up,
|
| 437 |
+
KeyboardCode.Left
|
| 438 |
+
];
|
| 439 |
+
var sortableKeyboardCoordinates = (event, _ref) => {
|
| 440 |
+
let { context: { active, collisionRect, droppableRects, droppableContainers, over, scrollableAncestors } } = _ref;
|
| 441 |
+
if (directions.includes(event.code)) {
|
| 442 |
+
event.preventDefault();
|
| 443 |
+
if (!active || !collisionRect) return;
|
| 444 |
+
const filteredContainers = [];
|
| 445 |
+
droppableContainers.getEnabled().forEach((entry) => {
|
| 446 |
+
if (!entry || entry != null && entry.disabled) return;
|
| 447 |
+
const rect = droppableRects.get(entry.id);
|
| 448 |
+
if (!rect) return;
|
| 449 |
+
switch (event.code) {
|
| 450 |
+
case KeyboardCode.Down:
|
| 451 |
+
if (collisionRect.top < rect.top) filteredContainers.push(entry);
|
| 452 |
+
break;
|
| 453 |
+
case KeyboardCode.Up:
|
| 454 |
+
if (collisionRect.top > rect.top) filteredContainers.push(entry);
|
| 455 |
+
break;
|
| 456 |
+
case KeyboardCode.Left:
|
| 457 |
+
if (collisionRect.left > rect.left) filteredContainers.push(entry);
|
| 458 |
+
break;
|
| 459 |
+
case KeyboardCode.Right:
|
| 460 |
+
if (collisionRect.left < rect.left) filteredContainers.push(entry);
|
| 461 |
+
break;
|
| 462 |
+
}
|
| 463 |
+
});
|
| 464 |
+
const collisions = closestCorners({
|
| 465 |
+
active,
|
| 466 |
+
collisionRect,
|
| 467 |
+
droppableRects,
|
| 468 |
+
droppableContainers: filteredContainers,
|
| 469 |
+
pointerCoordinates: null
|
| 470 |
+
});
|
| 471 |
+
let closestId = getFirstCollision(collisions, "id");
|
| 472 |
+
if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) closestId = collisions[1].id;
|
| 473 |
+
if (closestId != null) {
|
| 474 |
+
const activeDroppable = droppableContainers.get(active.id);
|
| 475 |
+
const newDroppable = droppableContainers.get(closestId);
|
| 476 |
+
const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null;
|
| 477 |
+
const newNode = newDroppable == null ? void 0 : newDroppable.node.current;
|
| 478 |
+
if (newNode && newRect && activeDroppable && newDroppable) {
|
| 479 |
+
const hasDifferentScrollAncestors = getScrollableAncestors(newNode).some((element, index) => scrollableAncestors[index] !== element);
|
| 480 |
+
const hasSameContainer = isSameContainer(activeDroppable, newDroppable);
|
| 481 |
+
const isAfterActive = isAfter(activeDroppable, newDroppable);
|
| 482 |
+
const offset = hasDifferentScrollAncestors || !hasSameContainer ? {
|
| 483 |
+
x: 0,
|
| 484 |
+
y: 0
|
| 485 |
+
} : {
|
| 486 |
+
x: isAfterActive ? collisionRect.width - newRect.width : 0,
|
| 487 |
+
y: isAfterActive ? collisionRect.height - newRect.height : 0
|
| 488 |
+
};
|
| 489 |
+
const rectCoordinates = {
|
| 490 |
+
x: newRect.left,
|
| 491 |
+
y: newRect.top
|
| 492 |
+
};
|
| 493 |
+
return offset.x && offset.y ? rectCoordinates : subtract(rectCoordinates, offset);
|
| 494 |
+
}
|
| 495 |
+
}
|
| 496 |
+
}
|
| 497 |
+
};
|
| 498 |
+
function isSameContainer(a, b) {
|
| 499 |
+
if (!hasSortableData(a) || !hasSortableData(b)) return false;
|
| 500 |
+
return a.data.current.sortable.containerId === b.data.current.sortable.containerId;
|
| 501 |
+
}
|
| 502 |
+
function isAfter(a, b) {
|
| 503 |
+
if (!hasSortableData(a) || !hasSortableData(b)) return false;
|
| 504 |
+
if (!isSameContainer(a, b)) return false;
|
| 505 |
+
return a.data.current.sortable.index < b.data.current.sortable.index;
|
| 506 |
+
}
|
| 507 |
+
//#endregion
|
| 508 |
+
export { SortableContext, arrayMove, arraySwap, defaultAnimateLayoutChanges, defaultNewIndexGetter, hasSortableData, horizontalListSortingStrategy, rectSortingStrategy, rectSwappingStrategy, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy };
|
| 509 |
+
|
| 510 |
+
//# sourceMappingURL=@dnd-kit_sortable.js.map
|
client/node_modules/.vite/deps/@dnd-kit_sortable.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"@dnd-kit_sortable.js","names":[],"sources":["../../../../node_modules/@dnd-kit/sortable/dist/sortable.esm.js"],"sourcesContent":["import React, { useMemo, useRef, useEffect, useState, useContext } from 'react';\nimport { useDndContext, getClientRect, useDroppable, useDraggable, closestCorners, getFirstCollision, getScrollableAncestors, KeyboardCode } from '@dnd-kit/core';\nimport { useUniqueId, useIsomorphicLayoutEffect, CSS, useCombinedRefs, isKeyboardEvent, subtract } from '@dnd-kit/utilities';\n\n/**\r\n * Move an array item to a different position. Returns a new array with the item moved to the new position.\r\n */\nfunction arrayMove(array, from, to) {\n const newArray = array.slice();\n newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]);\n return newArray;\n}\n\n/**\r\n * Swap an array item to a different position. Returns a new array with the item swapped to the new position.\r\n */\nfunction arraySwap(array, from, to) {\n const newArray = array.slice();\n newArray[from] = array[to];\n newArray[to] = array[from];\n return newArray;\n}\n\nfunction getSortedRects(items, rects) {\n return items.reduce((accumulator, id, index) => {\n const rect = rects.get(id);\n\n if (rect) {\n accumulator[index] = rect;\n }\n\n return accumulator;\n }, Array(items.length));\n}\n\nfunction isValidIndex(index) {\n return index !== null && index >= 0;\n}\n\nfunction itemsEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (a.length !== b.length) {\n return false;\n }\n\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction normalizeDisabled(disabled) {\n if (typeof disabled === 'boolean') {\n return {\n draggable: disabled,\n droppable: disabled\n };\n }\n\n return disabled;\n}\n\n// To-do: We should be calculating scale transformation\nconst defaultScale = {\n scaleX: 1,\n scaleY: 1\n};\nconst horizontalListSortingStrategy = _ref => {\n var _rects$activeIndex;\n\n let {\n rects,\n activeNodeRect: fallbackActiveRect,\n activeIndex,\n overIndex,\n index\n } = _ref;\n const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;\n\n if (!activeNodeRect) {\n return null;\n }\n\n const itemGap = getItemGap(rects, index, activeIndex);\n\n if (index === activeIndex) {\n const newIndexRect = rects[overIndex];\n\n if (!newIndexRect) {\n return null;\n }\n\n return {\n x: activeIndex < overIndex ? newIndexRect.left + newIndexRect.width - (activeNodeRect.left + activeNodeRect.width) : newIndexRect.left - activeNodeRect.left,\n y: 0,\n ...defaultScale\n };\n }\n\n if (index > activeIndex && index <= overIndex) {\n return {\n x: -activeNodeRect.width - itemGap,\n y: 0,\n ...defaultScale\n };\n }\n\n if (index < activeIndex && index >= overIndex) {\n return {\n x: activeNodeRect.width + itemGap,\n y: 0,\n ...defaultScale\n };\n }\n\n return {\n x: 0,\n y: 0,\n ...defaultScale\n };\n};\n\nfunction getItemGap(rects, index, activeIndex) {\n const currentRect = rects[index];\n const previousRect = rects[index - 1];\n const nextRect = rects[index + 1];\n\n if (!currentRect || !previousRect && !nextRect) {\n return 0;\n }\n\n if (activeIndex < index) {\n return previousRect ? currentRect.left - (previousRect.left + previousRect.width) : nextRect.left - (currentRect.left + currentRect.width);\n }\n\n return nextRect ? nextRect.left - (currentRect.left + currentRect.width) : currentRect.left - (previousRect.left + previousRect.width);\n}\n\nconst rectSortingStrategy = _ref => {\n let {\n rects,\n activeIndex,\n overIndex,\n index\n } = _ref;\n const newRects = arrayMove(rects, overIndex, activeIndex);\n const oldRect = rects[index];\n const newRect = newRects[index];\n\n if (!newRect || !oldRect) {\n return null;\n }\n\n return {\n x: newRect.left - oldRect.left,\n y: newRect.top - oldRect.top,\n scaleX: newRect.width / oldRect.width,\n scaleY: newRect.height / oldRect.height\n };\n};\n\nconst rectSwappingStrategy = _ref => {\n let {\n activeIndex,\n index,\n rects,\n overIndex\n } = _ref;\n let oldRect;\n let newRect;\n\n if (index === activeIndex) {\n oldRect = rects[index];\n newRect = rects[overIndex];\n }\n\n if (index === overIndex) {\n oldRect = rects[index];\n newRect = rects[activeIndex];\n }\n\n if (!newRect || !oldRect) {\n return null;\n }\n\n return {\n x: newRect.left - oldRect.left,\n y: newRect.top - oldRect.top,\n scaleX: newRect.width / oldRect.width,\n scaleY: newRect.height / oldRect.height\n };\n};\n\n// To-do: We should be calculating scale transformation\nconst defaultScale$1 = {\n scaleX: 1,\n scaleY: 1\n};\nconst verticalListSortingStrategy = _ref => {\n var _rects$activeIndex;\n\n let {\n activeIndex,\n activeNodeRect: fallbackActiveRect,\n index,\n rects,\n overIndex\n } = _ref;\n const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;\n\n if (!activeNodeRect) {\n return null;\n }\n\n if (index === activeIndex) {\n const overIndexRect = rects[overIndex];\n\n if (!overIndexRect) {\n return null;\n }\n\n return {\n x: 0,\n y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top,\n ...defaultScale$1\n };\n }\n\n const itemGap = getItemGap$1(rects, index, activeIndex);\n\n if (index > activeIndex && index <= overIndex) {\n return {\n x: 0,\n y: -activeNodeRect.height - itemGap,\n ...defaultScale$1\n };\n }\n\n if (index < activeIndex && index >= overIndex) {\n return {\n x: 0,\n y: activeNodeRect.height + itemGap,\n ...defaultScale$1\n };\n }\n\n return {\n x: 0,\n y: 0,\n ...defaultScale$1\n };\n};\n\nfunction getItemGap$1(clientRects, index, activeIndex) {\n const currentRect = clientRects[index];\n const previousRect = clientRects[index - 1];\n const nextRect = clientRects[index + 1];\n\n if (!currentRect) {\n return 0;\n }\n\n if (activeIndex < index) {\n return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0;\n }\n\n return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0;\n}\n\nconst ID_PREFIX = 'Sortable';\nconst Context = /*#__PURE__*/React.createContext({\n activeIndex: -1,\n containerId: ID_PREFIX,\n disableTransforms: false,\n items: [],\n overIndex: -1,\n useDragOverlay: false,\n sortedRects: [],\n strategy: rectSortingStrategy,\n disabled: {\n draggable: false,\n droppable: false\n }\n});\nfunction SortableContext(_ref) {\n let {\n children,\n id,\n items: userDefinedItems,\n strategy = rectSortingStrategy,\n disabled: disabledProp = false\n } = _ref;\n const {\n active,\n dragOverlay,\n droppableRects,\n over,\n measureDroppableContainers\n } = useDndContext();\n const containerId = useUniqueId(ID_PREFIX, id);\n const useDragOverlay = Boolean(dragOverlay.rect !== null);\n const items = useMemo(() => userDefinedItems.map(item => typeof item === 'object' && 'id' in item ? item.id : item), [userDefinedItems]);\n const isDragging = active != null;\n const activeIndex = active ? items.indexOf(active.id) : -1;\n const overIndex = over ? items.indexOf(over.id) : -1;\n const previousItemsRef = useRef(items);\n const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current);\n const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;\n const disabled = normalizeDisabled(disabledProp);\n useIsomorphicLayoutEffect(() => {\n if (itemsHaveChanged && isDragging) {\n measureDroppableContainers(items);\n }\n }, [itemsHaveChanged, items, isDragging, measureDroppableContainers]);\n useEffect(() => {\n previousItemsRef.current = items;\n }, [items]);\n const contextValue = useMemo(() => ({\n activeIndex,\n containerId,\n disabled,\n disableTransforms,\n items,\n overIndex,\n useDragOverlay,\n sortedRects: getSortedRects(items, droppableRects),\n strategy\n }), // eslint-disable-next-line react-hooks/exhaustive-deps\n [activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy]);\n return React.createElement(Context.Provider, {\n value: contextValue\n }, children);\n}\n\nconst defaultNewIndexGetter = _ref => {\n let {\n id,\n items,\n activeIndex,\n overIndex\n } = _ref;\n return arrayMove(items, activeIndex, overIndex).indexOf(id);\n};\nconst defaultAnimateLayoutChanges = _ref2 => {\n let {\n containerId,\n isSorting,\n wasDragging,\n index,\n items,\n newIndex,\n previousItems,\n previousContainerId,\n transition\n } = _ref2;\n\n if (!transition || !wasDragging) {\n return false;\n }\n\n if (previousItems !== items && index === newIndex) {\n return false;\n }\n\n if (isSorting) {\n return true;\n }\n\n return newIndex !== index && containerId === previousContainerId;\n};\nconst defaultTransition = {\n duration: 200,\n easing: 'ease'\n};\nconst transitionProperty = 'transform';\nconst disabledTransition = /*#__PURE__*/CSS.Transition.toString({\n property: transitionProperty,\n duration: 0,\n easing: 'linear'\n});\nconst defaultAttributes = {\n roleDescription: 'sortable'\n};\n\n/*\r\n * When the index of an item changes while sorting,\r\n * we need to temporarily disable the transforms\r\n */\n\nfunction useDerivedTransform(_ref) {\n let {\n disabled,\n index,\n node,\n rect\n } = _ref;\n const [derivedTransform, setDerivedtransform] = useState(null);\n const previousIndex = useRef(index);\n useIsomorphicLayoutEffect(() => {\n if (!disabled && index !== previousIndex.current && node.current) {\n const initial = rect.current;\n\n if (initial) {\n const current = getClientRect(node.current, {\n ignoreTransform: true\n });\n const delta = {\n x: initial.left - current.left,\n y: initial.top - current.top,\n scaleX: initial.width / current.width,\n scaleY: initial.height / current.height\n };\n\n if (delta.x || delta.y) {\n setDerivedtransform(delta);\n }\n }\n }\n\n if (index !== previousIndex.current) {\n previousIndex.current = index;\n }\n }, [disabled, index, node, rect]);\n useEffect(() => {\n if (derivedTransform) {\n setDerivedtransform(null);\n }\n }, [derivedTransform]);\n return derivedTransform;\n}\n\nfunction useSortable(_ref) {\n let {\n animateLayoutChanges = defaultAnimateLayoutChanges,\n attributes: userDefinedAttributes,\n disabled: localDisabled,\n data: customData,\n getNewIndex = defaultNewIndexGetter,\n id,\n strategy: localStrategy,\n resizeObserverConfig,\n transition = defaultTransition\n } = _ref;\n const {\n items,\n containerId,\n activeIndex,\n disabled: globalDisabled,\n disableTransforms,\n sortedRects,\n overIndex,\n useDragOverlay,\n strategy: globalStrategy\n } = useContext(Context);\n const disabled = normalizeLocalDisabled(localDisabled, globalDisabled);\n const index = items.indexOf(id);\n const data = useMemo(() => ({\n sortable: {\n containerId,\n index,\n items\n },\n ...customData\n }), [containerId, customData, index, items]);\n const itemsAfterCurrentSortable = useMemo(() => items.slice(items.indexOf(id)), [items, id]);\n const {\n rect,\n node,\n isOver,\n setNodeRef: setDroppableNodeRef\n } = useDroppable({\n id,\n data,\n disabled: disabled.droppable,\n resizeObserverConfig: {\n updateMeasurementsFor: itemsAfterCurrentSortable,\n ...resizeObserverConfig\n }\n });\n const {\n active,\n activatorEvent,\n activeNodeRect,\n attributes,\n setNodeRef: setDraggableNodeRef,\n listeners,\n isDragging,\n over,\n setActivatorNodeRef,\n transform\n } = useDraggable({\n id,\n data,\n attributes: { ...defaultAttributes,\n ...userDefinedAttributes\n },\n disabled: disabled.draggable\n });\n const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef);\n const isSorting = Boolean(active);\n const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex);\n const shouldDisplaceDragSource = !useDragOverlay && isDragging;\n const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null;\n const strategy = localStrategy != null ? localStrategy : globalStrategy;\n const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({\n rects: sortedRects,\n activeNodeRect,\n activeIndex,\n overIndex,\n index\n }) : null;\n const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({\n id,\n items,\n activeIndex,\n overIndex\n }) : index;\n const activeId = active == null ? void 0 : active.id;\n const previous = useRef({\n activeId,\n items,\n newIndex,\n containerId\n });\n const itemsHaveChanged = items !== previous.current.items;\n const shouldAnimateLayoutChanges = animateLayoutChanges({\n active,\n containerId,\n isDragging,\n isSorting,\n id,\n index,\n items,\n newIndex: previous.current.newIndex,\n previousItems: previous.current.items,\n previousContainerId: previous.current.containerId,\n transition,\n wasDragging: previous.current.activeId != null\n });\n const derivedTransform = useDerivedTransform({\n disabled: !shouldAnimateLayoutChanges,\n index,\n node,\n rect\n });\n useEffect(() => {\n if (isSorting && previous.current.newIndex !== newIndex) {\n previous.current.newIndex = newIndex;\n }\n\n if (containerId !== previous.current.containerId) {\n previous.current.containerId = containerId;\n }\n\n if (items !== previous.current.items) {\n previous.current.items = items;\n }\n }, [isSorting, newIndex, containerId, items]);\n useEffect(() => {\n if (activeId === previous.current.activeId) {\n return;\n }\n\n if (activeId != null && previous.current.activeId == null) {\n previous.current.activeId = activeId;\n return;\n }\n\n const timeoutId = setTimeout(() => {\n previous.current.activeId = activeId;\n }, 50);\n return () => clearTimeout(timeoutId);\n }, [activeId]);\n return {\n active,\n activeIndex,\n attributes,\n data,\n rect,\n index,\n newIndex,\n items,\n isOver,\n isSorting,\n isDragging,\n listeners,\n node,\n overIndex,\n over,\n setNodeRef,\n setActivatorNodeRef,\n setDroppableNodeRef,\n setDraggableNodeRef,\n transform: derivedTransform != null ? derivedTransform : finalTransform,\n transition: getTransition()\n };\n\n function getTransition() {\n if ( // Temporarily disable transitions for a single frame to set up derived transforms\n derivedTransform || // Or to prevent items jumping to back to their \"new\" position when items change\n itemsHaveChanged && previous.current.newIndex === index) {\n return disabledTransition;\n }\n\n if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) {\n return undefined;\n }\n\n if (isSorting || shouldAnimateLayoutChanges) {\n return CSS.Transition.toString({ ...transition,\n property: transitionProperty\n });\n }\n\n return undefined;\n }\n}\n\nfunction normalizeLocalDisabled(localDisabled, globalDisabled) {\n var _localDisabled$dragga, _localDisabled$droppa;\n\n if (typeof localDisabled === 'boolean') {\n return {\n draggable: localDisabled,\n // Backwards compatibility\n droppable: false\n };\n }\n\n return {\n draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable,\n droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable\n };\n}\n\nfunction hasSortableData(entry) {\n if (!entry) {\n return false;\n }\n\n const data = entry.data.current;\n\n if (data && 'sortable' in data && typeof data.sortable === 'object' && 'containerId' in data.sortable && 'items' in data.sortable && 'index' in data.sortable) {\n return true;\n }\n\n return false;\n}\n\nconst directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];\nconst sortableKeyboardCoordinates = (event, _ref) => {\n let {\n context: {\n active,\n collisionRect,\n droppableRects,\n droppableContainers,\n over,\n scrollableAncestors\n }\n } = _ref;\n\n if (directions.includes(event.code)) {\n event.preventDefault();\n\n if (!active || !collisionRect) {\n return;\n }\n\n const filteredContainers = [];\n droppableContainers.getEnabled().forEach(entry => {\n if (!entry || entry != null && entry.disabled) {\n return;\n }\n\n const rect = droppableRects.get(entry.id);\n\n if (!rect) {\n return;\n }\n\n switch (event.code) {\n case KeyboardCode.Down:\n if (collisionRect.top < rect.top) {\n filteredContainers.push(entry);\n }\n\n break;\n\n case KeyboardCode.Up:\n if (collisionRect.top > rect.top) {\n filteredContainers.push(entry);\n }\n\n break;\n\n case KeyboardCode.Left:\n if (collisionRect.left > rect.left) {\n filteredContainers.push(entry);\n }\n\n break;\n\n case KeyboardCode.Right:\n if (collisionRect.left < rect.left) {\n filteredContainers.push(entry);\n }\n\n break;\n }\n });\n const collisions = closestCorners({\n active,\n collisionRect: collisionRect,\n droppableRects,\n droppableContainers: filteredContainers,\n pointerCoordinates: null\n });\n let closestId = getFirstCollision(collisions, 'id');\n\n if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) {\n closestId = collisions[1].id;\n }\n\n if (closestId != null) {\n const activeDroppable = droppableContainers.get(active.id);\n const newDroppable = droppableContainers.get(closestId);\n const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null;\n const newNode = newDroppable == null ? void 0 : newDroppable.node.current;\n\n if (newNode && newRect && activeDroppable && newDroppable) {\n const newScrollAncestors = getScrollableAncestors(newNode);\n const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element);\n const hasSameContainer = isSameContainer(activeDroppable, newDroppable);\n const isAfterActive = isAfter(activeDroppable, newDroppable);\n const offset = hasDifferentScrollAncestors || !hasSameContainer ? {\n x: 0,\n y: 0\n } : {\n x: isAfterActive ? collisionRect.width - newRect.width : 0,\n y: isAfterActive ? collisionRect.height - newRect.height : 0\n };\n const rectCoordinates = {\n x: newRect.left,\n y: newRect.top\n };\n const newCoordinates = offset.x && offset.y ? rectCoordinates : subtract(rectCoordinates, offset);\n return newCoordinates;\n }\n }\n }\n\n return undefined;\n};\n\nfunction isSameContainer(a, b) {\n if (!hasSortableData(a) || !hasSortableData(b)) {\n return false;\n }\n\n return a.data.current.sortable.containerId === b.data.current.sortable.containerId;\n}\n\nfunction isAfter(a, b) {\n if (!hasSortableData(a) || !hasSortableData(b)) {\n return false;\n }\n\n if (!isSameContainer(a, b)) {\n return false;\n }\n\n return a.data.current.sortable.index < b.data.current.sortable.index;\n}\n\nexport { SortableContext, arrayMove, arraySwap, defaultAnimateLayoutChanges, defaultNewIndexGetter, hasSortableData, horizontalListSortingStrategy, rectSortingStrategy, rectSwappingStrategy, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy };\n//# sourceMappingURL=sortable.esm.js.map\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AAOA,SAAS,UAAU,OAAO,MAAM,IAAI;CAClC,MAAM,WAAW,MAAM,MAAM;CAC7B,SAAS,OAAO,KAAK,IAAI,SAAS,SAAS,KAAK,IAAI,GAAG,SAAS,OAAO,MAAM,CAAC,EAAE,EAAE;CAClF,OAAO;AACT;;;;AAKA,SAAS,UAAU,OAAO,MAAM,IAAI;CAClC,MAAM,WAAW,MAAM,MAAM;CAC7B,SAAS,QAAQ,MAAM;CACvB,SAAS,MAAM,MAAM;CACrB,OAAO;AACT;AAEA,SAAS,eAAe,OAAO,OAAO;CACpC,OAAO,MAAM,QAAQ,aAAa,IAAI,UAAU;EAC9C,MAAM,OAAO,MAAM,IAAI,EAAE;EAEzB,IAAI,MACF,YAAY,SAAS;EAGvB,OAAO;CACT,GAAG,MAAM,MAAM,MAAM,CAAC;AACxB;AAEA,SAAS,aAAa,OAAO;CAC3B,OAAO,UAAU,QAAQ,SAAS;AACpC;AAEA,SAAS,WAAW,GAAG,GAAG;CACxB,IAAI,MAAM,GACR,OAAO;CAGT,IAAI,EAAE,WAAW,EAAE,QACjB,OAAO;CAGT,KAAK,IAAI,IAAI,GAAG,IAAI,EAAE,QAAQ,KAC5B,IAAI,EAAE,OAAO,EAAE,IACb,OAAO;CAIX,OAAO;AACT;AAEA,SAAS,kBAAk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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { i as __toESM, t as require_react } from "./react-DMmEJb6B.js";
|
| 2 |
+
//#region ../node_modules/@dnd-kit/utilities/dist/utilities.esm.js
|
| 3 |
+
var import_react = /* @__PURE__ */ __toESM(require_react());
|
| 4 |
+
function useCombinedRefs() {
|
| 5 |
+
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) refs[_key] = arguments[_key];
|
| 6 |
+
return (0, import_react.useMemo)(() => (node) => {
|
| 7 |
+
refs.forEach((ref) => ref(node));
|
| 8 |
+
}, refs);
|
| 9 |
+
}
|
| 10 |
+
var canUseDOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
| 11 |
+
function isWindow(element) {
|
| 12 |
+
const elementString = Object.prototype.toString.call(element);
|
| 13 |
+
return elementString === "[object Window]" || elementString === "[object global]";
|
| 14 |
+
}
|
| 15 |
+
function isNode(node) {
|
| 16 |
+
return "nodeType" in node;
|
| 17 |
+
}
|
| 18 |
+
function getWindow(target) {
|
| 19 |
+
var _target$ownerDocument, _target$ownerDocument2;
|
| 20 |
+
if (!target) return window;
|
| 21 |
+
if (isWindow(target)) return target;
|
| 22 |
+
if (!isNode(target)) return window;
|
| 23 |
+
return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window;
|
| 24 |
+
}
|
| 25 |
+
function isDocument(node) {
|
| 26 |
+
const { Document } = getWindow(node);
|
| 27 |
+
return node instanceof Document;
|
| 28 |
+
}
|
| 29 |
+
function isHTMLElement(node) {
|
| 30 |
+
if (isWindow(node)) return false;
|
| 31 |
+
return node instanceof getWindow(node).HTMLElement;
|
| 32 |
+
}
|
| 33 |
+
function isSVGElement(node) {
|
| 34 |
+
return node instanceof getWindow(node).SVGElement;
|
| 35 |
+
}
|
| 36 |
+
function getOwnerDocument(target) {
|
| 37 |
+
if (!target) return document;
|
| 38 |
+
if (isWindow(target)) return target.document;
|
| 39 |
+
if (!isNode(target)) return document;
|
| 40 |
+
if (isDocument(target)) return target;
|
| 41 |
+
if (isHTMLElement(target) || isSVGElement(target)) return target.ownerDocument;
|
| 42 |
+
return document;
|
| 43 |
+
}
|
| 44 |
+
/**
|
| 45 |
+
* A hook that resolves to useEffect on the server and useLayoutEffect on the client
|
| 46 |
+
* @param callback {function} Callback function that is invoked when the dependencies of the hook change
|
| 47 |
+
*/
|
| 48 |
+
var useIsomorphicLayoutEffect = canUseDOM ? import_react.useLayoutEffect : import_react.useEffect;
|
| 49 |
+
function useEvent(handler) {
|
| 50 |
+
const handlerRef = (0, import_react.useRef)(handler);
|
| 51 |
+
useIsomorphicLayoutEffect(() => {
|
| 52 |
+
handlerRef.current = handler;
|
| 53 |
+
});
|
| 54 |
+
return (0, import_react.useCallback)(function() {
|
| 55 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
| 56 |
+
return handlerRef.current == null ? void 0 : handlerRef.current(...args);
|
| 57 |
+
}, []);
|
| 58 |
+
}
|
| 59 |
+
function useInterval() {
|
| 60 |
+
const intervalRef = (0, import_react.useRef)(null);
|
| 61 |
+
return [(0, import_react.useCallback)((listener, duration) => {
|
| 62 |
+
intervalRef.current = setInterval(listener, duration);
|
| 63 |
+
}, []), (0, import_react.useCallback)(() => {
|
| 64 |
+
if (intervalRef.current !== null) {
|
| 65 |
+
clearInterval(intervalRef.current);
|
| 66 |
+
intervalRef.current = null;
|
| 67 |
+
}
|
| 68 |
+
}, [])];
|
| 69 |
+
}
|
| 70 |
+
function useLatestValue(value, dependencies) {
|
| 71 |
+
if (dependencies === void 0) dependencies = [value];
|
| 72 |
+
const valueRef = (0, import_react.useRef)(value);
|
| 73 |
+
useIsomorphicLayoutEffect(() => {
|
| 74 |
+
if (valueRef.current !== value) valueRef.current = value;
|
| 75 |
+
}, dependencies);
|
| 76 |
+
return valueRef;
|
| 77 |
+
}
|
| 78 |
+
function useLazyMemo(callback, dependencies) {
|
| 79 |
+
const valueRef = (0, import_react.useRef)();
|
| 80 |
+
return (0, import_react.useMemo)(() => {
|
| 81 |
+
const newValue = callback(valueRef.current);
|
| 82 |
+
valueRef.current = newValue;
|
| 83 |
+
return newValue;
|
| 84 |
+
}, [...dependencies]);
|
| 85 |
+
}
|
| 86 |
+
function useNodeRef(onChange) {
|
| 87 |
+
const onChangeHandler = useEvent(onChange);
|
| 88 |
+
const node = (0, import_react.useRef)(null);
|
| 89 |
+
return [node, (0, import_react.useCallback)((element) => {
|
| 90 |
+
if (element !== node.current) onChangeHandler?.(element, node.current);
|
| 91 |
+
node.current = element;
|
| 92 |
+
}, [])];
|
| 93 |
+
}
|
| 94 |
+
function usePrevious(value) {
|
| 95 |
+
const ref = (0, import_react.useRef)();
|
| 96 |
+
(0, import_react.useEffect)(() => {
|
| 97 |
+
ref.current = value;
|
| 98 |
+
}, [value]);
|
| 99 |
+
return ref.current;
|
| 100 |
+
}
|
| 101 |
+
var ids = {};
|
| 102 |
+
function useUniqueId(prefix, value) {
|
| 103 |
+
return (0, import_react.useMemo)(() => {
|
| 104 |
+
if (value) return value;
|
| 105 |
+
const id = ids[prefix] == null ? 0 : ids[prefix] + 1;
|
| 106 |
+
ids[prefix] = id;
|
| 107 |
+
return prefix + "-" + id;
|
| 108 |
+
}, [prefix, value]);
|
| 109 |
+
}
|
| 110 |
+
function createAdjustmentFn(modifier) {
|
| 111 |
+
return function(object) {
|
| 112 |
+
for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) adjustments[_key - 1] = arguments[_key];
|
| 113 |
+
return adjustments.reduce((accumulator, adjustment) => {
|
| 114 |
+
const entries = Object.entries(adjustment);
|
| 115 |
+
for (const [key, valueAdjustment] of entries) {
|
| 116 |
+
const value = accumulator[key];
|
| 117 |
+
if (value != null) accumulator[key] = value + modifier * valueAdjustment;
|
| 118 |
+
}
|
| 119 |
+
return accumulator;
|
| 120 |
+
}, { ...object });
|
| 121 |
+
};
|
| 122 |
+
}
|
| 123 |
+
var add = /* @__PURE__ */ createAdjustmentFn(1);
|
| 124 |
+
var subtract = /* @__PURE__ */ createAdjustmentFn(-1);
|
| 125 |
+
function hasViewportRelativeCoordinates(event) {
|
| 126 |
+
return "clientX" in event && "clientY" in event;
|
| 127 |
+
}
|
| 128 |
+
function isKeyboardEvent(event) {
|
| 129 |
+
if (!event) return false;
|
| 130 |
+
const { KeyboardEvent } = getWindow(event.target);
|
| 131 |
+
return KeyboardEvent && event instanceof KeyboardEvent;
|
| 132 |
+
}
|
| 133 |
+
function isTouchEvent(event) {
|
| 134 |
+
if (!event) return false;
|
| 135 |
+
const { TouchEvent } = getWindow(event.target);
|
| 136 |
+
return TouchEvent && event instanceof TouchEvent;
|
| 137 |
+
}
|
| 138 |
+
/**
|
| 139 |
+
* Returns the normalized x and y coordinates for mouse and touch events.
|
| 140 |
+
*/
|
| 141 |
+
function getEventCoordinates(event) {
|
| 142 |
+
if (isTouchEvent(event)) {
|
| 143 |
+
if (event.touches && event.touches.length) {
|
| 144 |
+
const { clientX: x, clientY: y } = event.touches[0];
|
| 145 |
+
return {
|
| 146 |
+
x,
|
| 147 |
+
y
|
| 148 |
+
};
|
| 149 |
+
} else if (event.changedTouches && event.changedTouches.length) {
|
| 150 |
+
const { clientX: x, clientY: y } = event.changedTouches[0];
|
| 151 |
+
return {
|
| 152 |
+
x,
|
| 153 |
+
y
|
| 154 |
+
};
|
| 155 |
+
}
|
| 156 |
+
}
|
| 157 |
+
if (hasViewportRelativeCoordinates(event)) return {
|
| 158 |
+
x: event.clientX,
|
| 159 |
+
y: event.clientY
|
| 160 |
+
};
|
| 161 |
+
return null;
|
| 162 |
+
}
|
| 163 |
+
var CSS = /* @__PURE__ */ Object.freeze({
|
| 164 |
+
Translate: { toString(transform) {
|
| 165 |
+
if (!transform) return;
|
| 166 |
+
const { x, y } = transform;
|
| 167 |
+
return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)";
|
| 168 |
+
} },
|
| 169 |
+
Scale: { toString(transform) {
|
| 170 |
+
if (!transform) return;
|
| 171 |
+
const { scaleX, scaleY } = transform;
|
| 172 |
+
return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")";
|
| 173 |
+
} },
|
| 174 |
+
Transform: { toString(transform) {
|
| 175 |
+
if (!transform) return;
|
| 176 |
+
return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(" ");
|
| 177 |
+
} },
|
| 178 |
+
Transition: { toString(_ref) {
|
| 179 |
+
let { property, duration, easing } = _ref;
|
| 180 |
+
return property + " " + duration + "ms " + easing;
|
| 181 |
+
} }
|
| 182 |
+
});
|
| 183 |
+
var SELECTOR = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
|
| 184 |
+
function findFirstFocusableNode(element) {
|
| 185 |
+
if (element.matches(SELECTOR)) return element;
|
| 186 |
+
return element.querySelector(SELECTOR);
|
| 187 |
+
}
|
| 188 |
+
//#endregion
|
| 189 |
+
export { CSS, add, canUseDOM, findFirstFocusableNode, getEventCoordinates, getOwnerDocument, getWindow, hasViewportRelativeCoordinates, isDocument, isHTMLElement, isKeyboardEvent, isNode, isSVGElement, isTouchEvent, isWindow, subtract, useCombinedRefs, useEvent, useInterval, useIsomorphicLayoutEffect, useLatestValue, useLazyMemo, useNodeRef, usePrevious, useUniqueId };
|
| 190 |
+
|
| 191 |
+
//# sourceMappingURL=@dnd-kit_utilities.js.map
|
client/node_modules/.vite/deps/@dnd-kit_utilities.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"@dnd-kit_utilities.js","names":["useLayoutEffect","useEffect"],"sources":["../../../../node_modules/@dnd-kit/utilities/dist/utilities.esm.js"],"sourcesContent":["import { useMemo, useLayoutEffect, useEffect, useRef, useCallback } from 'react';\n\nfunction useCombinedRefs() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return useMemo(() => node => {\n refs.forEach(ref => ref(node));\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n refs);\n}\n\n// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js\nconst canUseDOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';\n\nfunction isWindow(element) {\n const elementString = Object.prototype.toString.call(element);\n return elementString === '[object Window]' || // In Electron context the Window object serializes to [object global]\n elementString === '[object global]';\n}\n\nfunction isNode(node) {\n return 'nodeType' in node;\n}\n\nfunction getWindow(target) {\n var _target$ownerDocument, _target$ownerDocument2;\n\n if (!target) {\n return window;\n }\n\n if (isWindow(target)) {\n return target;\n }\n\n if (!isNode(target)) {\n return window;\n }\n\n return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window;\n}\n\nfunction isDocument(node) {\n const {\n Document\n } = getWindow(node);\n return node instanceof Document;\n}\n\nfunction isHTMLElement(node) {\n if (isWindow(node)) {\n return false;\n }\n\n return node instanceof getWindow(node).HTMLElement;\n}\n\nfunction isSVGElement(node) {\n return node instanceof getWindow(node).SVGElement;\n}\n\nfunction getOwnerDocument(target) {\n if (!target) {\n return document;\n }\n\n if (isWindow(target)) {\n return target.document;\n }\n\n if (!isNode(target)) {\n return document;\n }\n\n if (isDocument(target)) {\n return target;\n }\n\n if (isHTMLElement(target) || isSVGElement(target)) {\n return target.ownerDocument;\n }\n\n return document;\n}\n\n/**\r\n * A hook that resolves to useEffect on the server and useLayoutEffect on the client\r\n * @param callback {function} Callback function that is invoked when the dependencies of the hook change\r\n */\n\nconst useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect;\n\nfunction useEvent(handler) {\n const handlerRef = useRef(handler);\n useIsomorphicLayoutEffect(() => {\n handlerRef.current = handler;\n });\n return useCallback(function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return handlerRef.current == null ? void 0 : handlerRef.current(...args);\n }, []);\n}\n\nfunction useInterval() {\n const intervalRef = useRef(null);\n const set = useCallback((listener, duration) => {\n intervalRef.current = setInterval(listener, duration);\n }, []);\n const clear = useCallback(() => {\n if (intervalRef.current !== null) {\n clearInterval(intervalRef.current);\n intervalRef.current = null;\n }\n }, []);\n return [set, clear];\n}\n\nfunction useLatestValue(value, dependencies) {\n if (dependencies === void 0) {\n dependencies = [value];\n }\n\n const valueRef = useRef(value);\n useIsomorphicLayoutEffect(() => {\n if (valueRef.current !== value) {\n valueRef.current = value;\n }\n }, dependencies);\n return valueRef;\n}\n\nfunction useLazyMemo(callback, dependencies) {\n const valueRef = useRef();\n return useMemo(() => {\n const newValue = callback(valueRef.current);\n valueRef.current = newValue;\n return newValue;\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n [...dependencies]);\n}\n\nfunction useNodeRef(onChange) {\n const onChangeHandler = useEvent(onChange);\n const node = useRef(null);\n const setNodeRef = useCallback(element => {\n if (element !== node.current) {\n onChangeHandler == null ? void 0 : onChangeHandler(element, node.current);\n }\n\n node.current = element;\n }, //eslint-disable-next-line\n []);\n return [node, setNodeRef];\n}\n\nfunction usePrevious(value) {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n }, [value]);\n return ref.current;\n}\n\nlet ids = {};\nfunction useUniqueId(prefix, value) {\n return useMemo(() => {\n if (value) {\n return value;\n }\n\n const id = ids[prefix] == null ? 0 : ids[prefix] + 1;\n ids[prefix] = id;\n return prefix + \"-\" + id;\n }, [prefix, value]);\n}\n\nfunction createAdjustmentFn(modifier) {\n return function (object) {\n for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n adjustments[_key - 1] = arguments[_key];\n }\n\n return adjustments.reduce((accumulator, adjustment) => {\n const entries = Object.entries(adjustment);\n\n for (const [key, valueAdjustment] of entries) {\n const value = accumulator[key];\n\n if (value != null) {\n accumulator[key] = value + modifier * valueAdjustment;\n }\n }\n\n return accumulator;\n }, { ...object\n });\n };\n}\n\nconst add = /*#__PURE__*/createAdjustmentFn(1);\nconst subtract = /*#__PURE__*/createAdjustmentFn(-1);\n\nfunction hasViewportRelativeCoordinates(event) {\n return 'clientX' in event && 'clientY' in event;\n}\n\nfunction isKeyboardEvent(event) {\n if (!event) {\n return false;\n }\n\n const {\n KeyboardEvent\n } = getWindow(event.target);\n return KeyboardEvent && event instanceof KeyboardEvent;\n}\n\nfunction isTouchEvent(event) {\n if (!event) {\n return false;\n }\n\n const {\n TouchEvent\n } = getWindow(event.target);\n return TouchEvent && event instanceof TouchEvent;\n}\n\n/**\r\n * Returns the normalized x and y coordinates for mouse and touch events.\r\n */\n\nfunction getEventCoordinates(event) {\n if (isTouchEvent(event)) {\n if (event.touches && event.touches.length) {\n const {\n clientX: x,\n clientY: y\n } = event.touches[0];\n return {\n x,\n y\n };\n } else if (event.changedTouches && event.changedTouches.length) {\n const {\n clientX: x,\n clientY: y\n } = event.changedTouches[0];\n return {\n x,\n y\n };\n }\n }\n\n if (hasViewportRelativeCoordinates(event)) {\n return {\n x: event.clientX,\n y: event.clientY\n };\n }\n\n return null;\n}\n\nconst CSS = /*#__PURE__*/Object.freeze({\n Translate: {\n toString(transform) {\n if (!transform) {\n return;\n }\n\n const {\n x,\n y\n } = transform;\n return \"translate3d(\" + (x ? Math.round(x) : 0) + \"px, \" + (y ? Math.round(y) : 0) + \"px, 0)\";\n }\n\n },\n Scale: {\n toString(transform) {\n if (!transform) {\n return;\n }\n\n const {\n scaleX,\n scaleY\n } = transform;\n return \"scaleX(\" + scaleX + \") scaleY(\" + scaleY + \")\";\n }\n\n },\n Transform: {\n toString(transform) {\n if (!transform) {\n return;\n }\n\n return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(' ');\n }\n\n },\n Transition: {\n toString(_ref) {\n let {\n property,\n duration,\n easing\n } = _ref;\n return property + \" \" + duration + \"ms \" + easing;\n }\n\n }\n});\n\nconst SELECTOR = 'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]';\nfunction findFirstFocusableNode(element) {\n if (element.matches(SELECTOR)) {\n return element;\n }\n\n return element.querySelector(SELECTOR);\n}\n\nexport { CSS, add, canUseDOM, findFirstFocusableNode, getEventCoordinates, getOwnerDocument, getWindow, hasViewportRelativeCoordinates, isDocument, isHTMLElement, isKeyboardEvent, isNode, isSVGElement, isTouchEvent, isWindow, subtract, useCombinedRefs, useEvent, useInterval, useIsomorphicLayoutEffect, useLatestValue, useLazyMemo, useNodeRef, usePrevious, useUniqueId };\n//# sourceMappingURL=utilities.esm.js.map\n"],"x_google_ignoreList":[0],"mappings":";;;AAEA,SAAS,kBAAkB;CACzB,KAAK,IAAI,OAAO,UAAU,QAAQ,OAAO,IAAI,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,MAAM,QAC/E,KAAK,QAAQ,UAAU;CAGzB,QAAA,GAAA,aAAA,gBAAqB,SAAQ;EAC3B,KAAK,SAAQ,QAAO,IAAI,IAAI,CAAC;CAC/B,GACA,IAAI;AACN;AAGA,IAAM,YAAY,OAAO,WAAW,eAAe,OAAO,OAAO,aAAa,eAAe,OAAO,OAAO,SAAS,kBAAkB;AAEtI,SAAS,SAAS,SAAS;CACzB,MAAM,gBAAgB,OAAO,UAAU,SAAS,KAAK,OAAO;CAC5D,OAAO,kBAAkB,qBACzB,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EACF,OAAO,IAAI,MAAM,kBAAkB,MAAM,eAAe,QAAQ;GAC9D,MAAM,EACJ,SAAS,GACT,SAAS,MACP,MAAM,eAAe;GACzB,OAAO;IACL;IACA;GACF;EACF;;CAGF,IAAI,+BAA+B,KAAK,GACtC,OAAO;EACL,GAAG,MAAM;EACT,GAAG,MAAM;CACX;CAGF,OAAO;AACT;AAEA,IAAM,MAAmB,uBAAO,OAAO;CACrC,WAAW,EACT,SAAS,WAAW;EAClB,IAAI,CAAC,WACH;EAGF,MAAM,EACJ,GACA,MACE;EACJ,OAAO,kBAAkB,IAAI,KAAK,MAAM,CAAC,IAAI,KAAK,UAAU,IAAI,KAAK,MAAM,CAAC,IAAI,KAAK;CACvF,EAEF;CACA,OAAO,EACL,SAAS,WAAW;EAClB,IAAI,CAAC,WACH;EAGF,MAAM,EACJ,QACA,WACE;EACJ,OAAO,YAAY,SAAS,cAAc,SAAS;CACrD,EAEF;CACA,WAAW,EACT,SAAS,WAAW;EAClB,IAAI,CAAC,WACH;EAGF,OAAO,CAAC,IAAI,UAAU,SAAS,SAAS,GAAG,IAAI,MAAM,SAAS,SAAS,CAAC,EAAE,KAAK,GAAG;CACpF,EAEF;CACA,YAAY,EACV,SAAS,MAAM;EACb,IAAI,EACF,UACA,UACA,WACE;EACJ,OAAO,WAAW,MAAM,WAAW,QAAQ;CAC7C,EAEF;AACF,CAAC;AAED,IAAM,WAAW;AACjB,SAAS,uBAAuB,SAAS;CACvC,IAAI,QAAQ,QAAQ,QAAQ,GAC1B,OAAO;CAGT,OAAO,QAAQ,cAAc,QAAQ;AACvC"}
|
client/node_modules/.vite/deps/@tanstack_react-query.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
client/node_modules/.vite/deps/@tanstack_react-query.js.map
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
client/node_modules/.vite/deps/FormContext-D8skpAva.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { i as __toESM, t as require_react } from "./react-DMmEJb6B.js";
|
| 2 |
+
import { i as NOOP } from "./useRenderElement-3Cwvu1gO.js";
|
| 3 |
+
//#region ../node_modules/@base-ui/react/esm/internals/form-context/FormContext.js
|
| 4 |
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
| 5 |
+
var FormContext = /* @__PURE__ */ import_react.createContext({
|
| 6 |
+
formRef: { current: { fields: /* @__PURE__ */ new Map() } },
|
| 7 |
+
errors: {},
|
| 8 |
+
clearErrors: NOOP,
|
| 9 |
+
validationMode: "onSubmit",
|
| 10 |
+
submitAttemptedRef: { current: false }
|
| 11 |
+
});
|
| 12 |
+
FormContext.displayName = "FormContext";
|
| 13 |
+
function useFormContext() {
|
| 14 |
+
return import_react.useContext(FormContext);
|
| 15 |
+
}
|
| 16 |
+
//#endregion
|
| 17 |
+
export { useFormContext as t };
|
| 18 |
+
|
| 19 |
+
//# sourceMappingURL=FormContext-D8skpAva.js.map
|