diff --git a/lightrag/api/lightrag_server.py b/lightrag/api/lightrag_server.py index a392e67a..751664f6 100644 --- a/lightrag/api/lightrag_server.py +++ b/lightrag/api/lightrag_server.py @@ -19,6 +19,7 @@ from lightrag import LightRAG, QueryParam from lightrag.types import GPTKeywordExtractionFormat from lightrag.api import __api_version__ from lightrag.utils import EmbeddingFunc +from lightrag.base import DocStatus, DocProcessingStatus from enum import Enum from pathlib import Path import shutil @@ -253,10 +254,8 @@ def display_splash_screen(args: argparse.Namespace) -> None: ASCIIColors.yellow(f"{protocol}://localhost:{args.port}/docs") ASCIIColors.white(" ├─ Alternative Documentation (local): ", end="") ASCIIColors.yellow(f"{protocol}://localhost:{args.port}/redoc") - ASCIIColors.white(" ├─ WebUI (local): ", end="") + ASCIIColors.white(" └─ WebUI (local): ", end="") ASCIIColors.yellow(f"{protocol}://localhost:{args.port}/webui") - ASCIIColors.white(" └─ Graph Viewer (local): ", end="") - ASCIIColors.yellow(f"{protocol}://localhost:{args.port}/graph-viewer") ASCIIColors.yellow("\n📝 Note:") ASCIIColors.white(""" Since the server is running on 0.0.0.0: @@ -693,6 +692,22 @@ class InsertResponse(BaseModel): message: str +class DocStatusResponse(BaseModel): + id: str + content_summary: str + content_length: int + status: DocStatus + created_at: str + updated_at: str + chunks_count: Optional[int] = None + error: Optional[str] = None + metadata: Optional[dict[str, Any]] = None + + +class DocsStatusesResponse(BaseModel): + statuses: Dict[DocStatus, List[DocStatusResponse]] = {} + + def QueryRequestToQueryParams(request: QueryRequest): param = QueryParam(mode=request.mode, stream=request.stream) if request.only_need_context is not None: @@ -1728,20 +1743,57 @@ def create_app(args): app.include_router(ollama_api.router, prefix="/api") @app.get("/documents", dependencies=[Depends(optional_api_key)]) - async def documents(): - """Get current system status""" - return doc_manager.indexed_files + async def documents() -> DocsStatusesResponse: + """ + Get documents statuses + Returns: + DocsStatusesResponse: A response object containing a dictionary where keys are DocStatus + and values are lists of DocStatusResponse objects representing documents in each status category. + """ + try: + statuses = ( + DocStatus.PENDING, + DocStatus.PROCESSING, + DocStatus.PROCESSED, + DocStatus.FAILED, + ) + + tasks = [rag.get_docs_by_status(status) for status in statuses] + results: List[Dict[str, DocProcessingStatus]] = await asyncio.gather(*tasks) + + response = DocsStatusesResponse() + + for idx, result in enumerate(results): + status = statuses[idx] + for doc_id, doc_status in result.items(): + if status not in response.statuses: + response.statuses[status] = [] + response.statuses[status].append( + DocStatusResponse( + id=doc_id, + content_summary=doc_status.content_summary, + content_length=doc_status.content_length, + status=doc_status.status, + created_at=doc_status.created_at, + updated_at=doc_status.updated_at, + chunks_count=doc_status.chunks_count, + error=doc_status.error, + metadata=doc_status.metadata, + ) + ) + return response + except Exception as e: + logging.error(f"Error GET /documents: {str(e)}") + logging.error(traceback.format_exc()) + raise HTTPException(status_code=500, detail=str(e)) @app.get("/health", dependencies=[Depends(optional_api_key)]) async def get_status(): """Get current system status""" - files = doc_manager.scan_directory() return { "status": "healthy", "working_directory": str(args.working_dir), "input_directory": str(args.input_dir), - "indexed_files": [str(f) for f in files], - "indexed_files_count": len(files), "configuration": { # LLM configuration binding/host address (if applicable)/model (if applicable) "llm_binding": args.llm_binding, @@ -1760,17 +1812,9 @@ def create_app(args): } # Webui mount webui/index.html - webui_dir = Path(__file__).parent / "webui" - app.mount( - "/graph-viewer", - StaticFiles(directory=webui_dir, html=True), - name="webui", - ) - - # Serve the static files - static_dir = Path(__file__).parent / "static" + static_dir = Path(__file__).parent / "webui" static_dir.mkdir(exist_ok=True) - app.mount("/webui", StaticFiles(directory=static_dir, html=True), name="static") + app.mount("/webui", StaticFiles(directory=static_dir, html=True), name="webui") return app diff --git a/lightrag/api/static/README.md b/lightrag/api/static/README.md deleted file mode 100644 index a8c6b1f3..00000000 --- a/lightrag/api/static/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# LightRag Webui -A simple webui to interact with the lightrag datalake diff --git a/lightrag/api/static/favicon.ico b/lightrag/api/static/favicon.ico deleted file mode 100644 index 928eef39..00000000 Binary files a/lightrag/api/static/favicon.ico and /dev/null differ diff --git a/lightrag/api/static/index.html b/lightrag/api/static/index.html deleted file mode 100644 index 75b26c5e..00000000 --- a/lightrag/api/static/index.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - LightRAG Interface - - - - - -
- -
- -
- - -
-
-
- - - -
- - - - - diff --git a/lightrag/api/static/js/api.js b/lightrag/api/static/js/api.js deleted file mode 100644 index b610eb10..00000000 --- a/lightrag/api/static/js/api.js +++ /dev/null @@ -1,408 +0,0 @@ -// State management -const state = { - apiKey: localStorage.getItem('apiKey') || '', - files: [], - indexedFiles: [], - currentPage: 'file-manager' -}; - -// Utility functions -const showToast = (message, duration = 3000) => { - const toast = document.getElementById('toast'); - toast.querySelector('div').textContent = message; - toast.classList.remove('hidden'); - setTimeout(() => toast.classList.add('hidden'), duration); -}; - -const fetchWithAuth = async (url, options = {}) => { - const headers = { - ...(options.headers || {}), - ...(state.apiKey ? { 'X-API-Key': state.apiKey } : {}) // Use X-API-Key instead of Bearer - }; - return fetch(url, { ...options, headers }); -}; - - -// Page renderers -const pages = { - 'file-manager': () => ` -
-

File Manager

- -
- - -
- -
-

Selected Files

-
-
- -
- - - -
- -
-

Indexed Files

-
-
- - -
- `, - - 'query': () => ` -
-

Query Database

- -
-
- - -
- -
- - -
- - - -
-
-
- `, - - 'knowledge-graph': () => ` -
-
- - - -

Under Construction

-

Knowledge graph visualization will be available in a future update.

-
-
- `, - - 'status': () => ` -
-

System Status

-
-
-

System Health

-
-
-
-

Configuration

-
-
-
-
- `, - - 'settings': () => ` -
-

Settings

- -
-
-
- - -
- - -
-
-
- ` -}; - -// Page handlers -const handlers = { - 'file-manager': () => { - const fileInput = document.getElementById('fileInput'); - const dropZone = fileInput.parentElement.parentElement; - const fileList = document.querySelector('#fileList div'); - const indexedFiles = document.querySelector('#indexedFiles div'); - const uploadBtn = document.getElementById('uploadBtn'); - - const updateFileList = () => { - fileList.innerHTML = state.files.map(file => ` -
- ${file.name} - -
- `).join(''); - }; - - const updateIndexedFiles = async () => { - const response = await fetchWithAuth('/health'); - const data = await response.json(); - indexedFiles.innerHTML = data.indexed_files.map(file => ` -
- ${file} -
- `).join(''); - }; - - dropZone.addEventListener('dragover', (e) => { - e.preventDefault(); - dropZone.classList.add('border-blue-500'); - }); - - dropZone.addEventListener('dragleave', () => { - dropZone.classList.remove('border-blue-500'); - }); - - dropZone.addEventListener('drop', (e) => { - e.preventDefault(); - dropZone.classList.remove('border-blue-500'); - const files = Array.from(e.dataTransfer.files); - state.files.push(...files); - updateFileList(); - }); - - fileInput.addEventListener('change', () => { - state.files.push(...Array.from(fileInput.files)); - updateFileList(); - }); - - uploadBtn.addEventListener('click', async () => { - if (state.files.length === 0) { - showToast('Please select files to upload'); - return; - } - let apiKey = localStorage.getItem('apiKey') || ''; - const progress = document.getElementById('uploadProgress'); - const progressBar = progress.querySelector('div'); - const statusText = document.getElementById('uploadStatus'); - progress.classList.remove('hidden'); - - for (let i = 0; i < state.files.length; i++) { - const formData = new FormData(); - formData.append('file', state.files[i]); - - try { - await fetch('/documents/upload', { - method: 'POST', - headers: apiKey ? { 'Authorization': `Bearer ${apiKey}` } : {}, - body: formData - }); - - const percentage = ((i + 1) / state.files.length) * 100; - progressBar.style.width = `${percentage}%`; - statusText.textContent = `${i + 1}/${state.files.length}`; - } catch (error) { - console.error('Upload error:', error); - } - } - progress.classList.add('hidden'); - }); - - rescanBtn.addEventListener('click', async () => { - const progress = document.getElementById('uploadProgress'); - const progressBar = progress.querySelector('div'); - const statusText = document.getElementById('uploadStatus'); - progress.classList.remove('hidden'); - - try { - // Start the scanning process - const scanResponse = await fetch('/documents/scan', { - method: 'POST', - }); - - if (!scanResponse.ok) { - throw new Error('Scan failed to start'); - } - - // Start polling for progress - const pollInterval = setInterval(async () => { - const progressResponse = await fetch('/documents/scan-progress'); - const progressData = await progressResponse.json(); - - // Update progress bar - progressBar.style.width = `${progressData.progress}%`; - - // Update status text - if (progressData.total_files > 0) { - statusText.textContent = `Processing ${progressData.current_file} (${progressData.indexed_count}/${progressData.total_files})`; - } - - // Check if scanning is complete - if (!progressData.is_scanning) { - clearInterval(pollInterval); - progress.classList.add('hidden'); - statusText.textContent = 'Scan complete!'; - } - }, 1000); // Poll every second - - } catch (error) { - console.error('Upload error:', error); - progress.classList.add('hidden'); - statusText.textContent = 'Error during scanning process'; - } - }); - - - updateIndexedFiles(); - }, - - 'query': () => { - const queryBtn = document.getElementById('queryBtn'); - const queryInput = document.getElementById('queryInput'); - const queryMode = document.getElementById('queryMode'); - const queryResult = document.getElementById('queryResult'); - - let apiKey = localStorage.getItem('apiKey') || ''; - - queryBtn.addEventListener('click', async () => { - const query = queryInput.value.trim(); - if (!query) { - showToast('Please enter a query'); - return; - } - - queryBtn.disabled = true; - queryBtn.innerHTML = ` - - - - - Processing... - `; - - try { - const response = await fetchWithAuth('/query', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ - query, - mode: queryMode.value, - stream: false, - only_need_context: false - }) - }); - - const data = await response.json(); - queryResult.innerHTML = marked.parse(data.response); - } catch (error) { - showToast('Error processing query'); - } finally { - queryBtn.disabled = false; - queryBtn.textContent = 'Send Query'; - } - }); - }, - - 'status': async () => { - const healthStatus = document.getElementById('healthStatus'); - const configStatus = document.getElementById('configStatus'); - - try { - const response = await fetchWithAuth('/health'); - const data = await response.json(); - - healthStatus.innerHTML = ` -
-
-
- ${data.status} -
-
-

Working Directory: ${data.working_directory}

-

Input Directory: ${data.input_directory}

-

Indexed Files: ${data.indexed_files_count}

-
-
- `; - - configStatus.innerHTML = Object.entries(data.configuration) - .map(([key, value]) => ` -
- ${key}: - ${value} -
- `).join(''); - } catch (error) { - showToast('Error fetching status'); - } - }, - - 'settings': () => { - const saveBtn = document.getElementById('saveSettings'); - const apiKeyInput = document.getElementById('apiKeyInput'); - - saveBtn.addEventListener('click', () => { - state.apiKey = apiKeyInput.value; - localStorage.setItem('apiKey', state.apiKey); - showToast('Settings saved successfully'); - }); - } -}; - -// Navigation handling -document.querySelectorAll('.nav-item').forEach(item => { - item.addEventListener('click', (e) => { - e.preventDefault(); - const page = item.dataset.page; - document.getElementById('content').innerHTML = pages[page](); - if (handlers[page]) handlers[page](); - state.currentPage = page; - }); -}); - -// Initialize with file manager -document.getElementById('content').innerHTML = pages['file-manager'](); -handlers['file-manager'](); - -// Global functions -window.removeFile = (fileName) => { - state.files = state.files.filter(file => file.name !== fileName); - document.querySelector('#fileList div').innerHTML = state.files.map(file => ` -
- ${file.name} - -
- `).join(''); -}; diff --git a/lightrag/api/static/js/graph.js b/lightrag/api/static/js/graph.js deleted file mode 100644 index 140a7781..00000000 --- a/lightrag/api/static/js/graph.js +++ /dev/null @@ -1,211 +0,0 @@ -// js/graph.js -function openGraphModal(label) { - const modal = document.getElementById("graph-modal"); - const graphTitle = document.getElementById("graph-title"); - - if (!modal || !graphTitle) { - console.error("Key element not found"); - return; - } - - graphTitle.textContent = `Knowledge Graph - ${label}`; - modal.style.display = "flex"; - - renderGraph(label); -} - -function closeGraphModal() { - const modal = document.getElementById("graph-modal"); - modal.style.display = "none"; - clearGraph(); -} - -function clearGraph() { - const svg = document.getElementById("graph-svg"); - svg.innerHTML = ""; -} - - -async function getGraph(label) { - try { - const response = await fetch(`/graphs?label=${label}`); - const rawData = await response.json(); - console.log({data: JSON.parse(JSON.stringify(rawData))}); - - const nodes = rawData.nodes - - nodes.forEach(node => { - node.id = Date.now().toString(36) + Math.random().toString(36).substring(2); // 使用 crypto.randomUUID() 生成唯一 UUID - }); - - // Strictly verify edge data - const edges = (rawData.edges || []).map(edge => { - const sourceNode = nodes.find(n => n.labels.includes(edge.source)); - const targetNode = nodes.find(n => n.labels.includes(edge.target) - ) - ; - if (!sourceNode || !targetNode) { - console.warn("NOT VALID EDGE:", edge); - return null; - } - return { - source: sourceNode, - target: targetNode, - type: edge.type || "" - }; - }).filter(edge => edge !== null); - - return {nodes, edges}; - } catch (error) { - console.error("Loading graph failed:", error); - return {nodes: [], edges: []}; - } -} - -async function renderGraph(label) { - const data = await getGraph(label); - - - if (!data.nodes || data.nodes.length === 0) { - d3.select("#graph-svg") - .html(`No valid nodes`); - return; - } - - - const svg = d3.select("#graph-svg"); - const width = svg.node().clientWidth; - const height = svg.node().clientHeight; - - svg.selectAll("*").remove(); - - // Create a force oriented diagram layout - const simulation = d3.forceSimulation(data.nodes) - .force("charge", d3.forceManyBody().strength(-300)) - .force("center", d3.forceCenter(width / 2, height / 2)); - - // Add a connection (if there are valid edges) - if (data.edges.length > 0) { - simulation.force("link", - d3.forceLink(data.edges) - .id(d => d.id) - .distance(100) - ); - } - - // Draw nodes - const nodes = svg.selectAll(".node") - .data(data.nodes) - .enter() - .append("circle") - .attr("class", "node") - .attr("r", 10) - .call(d3.drag() - .on("start", dragStarted) - .on("drag", dragged) - .on("end", dragEnded) - ); - - - svg.append("defs") - .append("marker") - .attr("id", "arrow-out") - .attr("viewBox", "0 0 10 10") - .attr("refX", 8) - .attr("refY", 5) - .attr("markerWidth", 6) - .attr("markerHeight", 6) - .attr("orient", "auto") - .append("path") - .attr("d", "M0,0 L10,5 L0,10 Z") - .attr("fill", "#999"); - - // Draw edges (with arrows) - const links = svg.selectAll(".link") - .data(data.edges) - .enter() - .append("line") - .attr("class", "link") - .attr("marker-end", "url(#arrow-out)"); // Always draw arrows on the target side - - // Edge style configuration - links - .attr("stroke", "#999") - .attr("stroke-width", 2) - .attr("stroke-opacity", 0.8); - - // Draw label (with background box) - const labels = svg.selectAll(".label") - .data(data.nodes) - .enter() - .append("text") - .attr("class", "label") - .text(d => d.labels[0] || "") - .attr("text-anchor", "start") - .attr("dy", "0.3em") - .attr("fill", "#333"); - - // Update Location - simulation.on("tick", () => { - links - .attr("x1", d => { - // Calculate the direction vector from the source node to the target node - const dx = d.target.x - d.source.x; - const dy = d.target.y - d.source.y; - const distance = Math.sqrt(dx * dx + dy * dy); - if (distance === 0) return d.source.x; // 避免除以零 Avoid dividing by zero - // Adjust the starting point coordinates (source node edge) based on radius 10 - return d.source.x + (dx / distance) * 10; - }) - .attr("y1", d => { - const dx = d.target.x - d.source.x; - const dy = d.target.y - d.source.y; - const distance = Math.sqrt(dx * dx + dy * dy); - if (distance === 0) return d.source.y; - return d.source.y + (dy / distance) * 10; - }) - .attr("x2", d => { - // Adjust the endpoint coordinates (target node edge) based on a radius of 10 - const dx = d.target.x - d.source.x; - const dy = d.target.y - d.source.y; - const distance = Math.sqrt(dx * dx + dy * dy); - if (distance === 0) return d.target.x; - return d.target.x - (dx / distance) * 10; - }) - .attr("y2", d => { - const dx = d.target.x - d.source.x; - const dy = d.target.y - d.source.y; - const distance = Math.sqrt(dx * dx + dy * dy); - if (distance === 0) return d.target.y; - return d.target.y - (dy / distance) * 10; - }); - - // Update the position of nodes and labels (keep unchanged) - nodes - .attr("cx", d => d.x) - .attr("cy", d => d.y); - - labels - .attr("x", d => d.x + 12) - .attr("y", d => d.y + 4); - }); - - // Drag and drop logic - function dragStarted(event, d) { - if (!event.active) simulation.alphaTarget(0.3).restart(); - d.fx = d.x; - d.fy = d.y; - } - - function dragged(event, d) { - d.fx = event.x; - d.fy = event.y; - simulation.alpha(0.3).restart(); - } - - function dragEnded(event, d) { - if (!event.active) simulation.alphaTarget(0); - d.fx = null; - d.fy = null; - } -} diff --git a/lightrag/api/webui/assets/index-BAeLPZpd.css b/lightrag/api/webui/assets/index-BAeLPZpd.css deleted file mode 100644 index eaee883a..00000000 --- a/lightrag/api/webui/assets/index-BAeLPZpd.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.0.6 | MIT License | https://tailwindcss.com */@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-serif:ui-serif,Georgia,Cambria,"Times New Roman",Times,serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(.971 .013 17.38);--color-red-100:oklch(.936 .032 17.717);--color-red-200:oklch(.885 .062 18.334);--color-red-300:oklch(.808 .114 19.571);--color-red-400:oklch(.704 .191 22.216);--color-red-500:oklch(.637 .237 25.331);--color-red-600:oklch(.577 .245 27.325);--color-red-700:oklch(.505 .213 27.518);--color-red-800:oklch(.444 .177 26.899);--color-red-900:oklch(.396 .141 25.723);--color-red-950:oklch(.258 .092 26.042);--color-orange-50:oklch(.98 .016 73.684);--color-orange-100:oklch(.954 .038 75.164);--color-orange-200:oklch(.901 .076 70.697);--color-orange-300:oklch(.837 .128 66.29);--color-orange-400:oklch(.75 .183 55.934);--color-orange-500:oklch(.705 .213 47.604);--color-orange-600:oklch(.646 .222 41.116);--color-orange-700:oklch(.553 .195 38.402);--color-orange-800:oklch(.47 .157 37.304);--color-orange-900:oklch(.408 .123 38.172);--color-orange-950:oklch(.266 .079 36.259);--color-amber-50:oklch(.987 .022 95.277);--color-amber-100:oklch(.962 .059 95.617);--color-amber-200:oklch(.924 .12 95.746);--color-amber-300:oklch(.879 .169 91.605);--color-amber-400:oklch(.828 .189 84.429);--color-amber-500:oklch(.769 .188 70.08);--color-amber-600:oklch(.666 .179 58.318);--color-amber-700:oklch(.555 .163 48.998);--color-amber-800:oklch(.473 .137 46.201);--color-amber-900:oklch(.414 .112 45.904);--color-amber-950:oklch(.279 .077 45.635);--color-yellow-50:oklch(.987 .026 102.212);--color-yellow-100:oklch(.973 .071 103.193);--color-yellow-200:oklch(.945 .129 101.54);--color-yellow-300:oklch(.905 .182 98.111);--color-yellow-400:oklch(.852 .199 91.936);--color-yellow-500:oklch(.795 .184 86.047);--color-yellow-600:oklch(.681 .162 75.834);--color-yellow-700:oklch(.554 .135 66.442);--color-yellow-800:oklch(.476 .114 61.907);--color-yellow-900:oklch(.421 .095 57.708);--color-yellow-950:oklch(.286 .066 53.813);--color-lime-50:oklch(.986 .031 120.757);--color-lime-100:oklch(.967 .067 122.328);--color-lime-200:oklch(.938 .127 124.321);--color-lime-300:oklch(.897 .196 126.665);--color-lime-400:oklch(.841 .238 128.85);--color-lime-500:oklch(.768 .233 130.85);--color-lime-600:oklch(.648 .2 131.684);--color-lime-700:oklch(.532 .157 131.589);--color-lime-800:oklch(.453 .124 130.933);--color-lime-900:oklch(.405 .101 131.063);--color-lime-950:oklch(.274 .072 132.109);--color-green-50:oklch(.982 .018 155.826);--color-green-100:oklch(.962 .044 156.743);--color-green-200:oklch(.925 .084 155.995);--color-green-300:oklch(.871 .15 154.449);--color-green-400:oklch(.792 .209 151.711);--color-green-500:oklch(.723 .219 149.579);--color-green-600:oklch(.627 .194 149.214);--color-green-700:oklch(.527 .154 150.069);--color-green-800:oklch(.448 .119 151.328);--color-green-900:oklch(.393 .095 152.535);--color-green-950:oklch(.266 .065 152.934);--color-emerald-50:oklch(.979 .021 166.113);--color-emerald-100:oklch(.95 .052 163.051);--color-emerald-200:oklch(.905 .093 164.15);--color-emerald-300:oklch(.845 .143 164.978);--color-emerald-400:oklch(.765 .177 163.223);--color-emerald-500:oklch(.696 .17 162.48);--color-emerald-600:oklch(.596 .145 163.225);--color-emerald-700:oklch(.508 .118 165.612);--color-emerald-800:oklch(.432 .095 166.913);--color-emerald-900:oklch(.378 .077 168.94);--color-emerald-950:oklch(.262 .051 172.552);--color-teal-50:oklch(.984 .014 180.72);--color-teal-100:oklch(.953 .051 180.801);--color-teal-200:oklch(.91 .096 180.426);--color-teal-300:oklch(.855 .138 181.071);--color-teal-400:oklch(.777 .152 181.912);--color-teal-500:oklch(.704 .14 182.503);--color-teal-600:oklch(.6 .118 184.704);--color-teal-700:oklch(.511 .096 186.391);--color-teal-800:oklch(.437 .078 188.216);--color-teal-900:oklch(.386 .063 188.416);--color-teal-950:oklch(.277 .046 192.524);--color-cyan-50:oklch(.984 .019 200.873);--color-cyan-100:oklch(.956 .045 203.388);--color-cyan-200:oklch(.917 .08 205.041);--color-cyan-300:oklch(.865 .127 207.078);--color-cyan-400:oklch(.789 .154 211.53);--color-cyan-500:oklch(.715 .143 215.221);--color-cyan-600:oklch(.609 .126 221.723);--color-cyan-700:oklch(.52 .105 223.128);--color-cyan-800:oklch(.45 .085 224.283);--color-cyan-900:oklch(.398 .07 227.392);--color-cyan-950:oklch(.302 .056 229.695);--color-sky-50:oklch(.977 .013 236.62);--color-sky-100:oklch(.951 .026 236.824);--color-sky-200:oklch(.901 .058 230.902);--color-sky-300:oklch(.828 .111 230.318);--color-sky-400:oklch(.746 .16 232.661);--color-sky-500:oklch(.685 .169 237.323);--color-sky-600:oklch(.588 .158 241.966);--color-sky-700:oklch(.5 .134 242.749);--color-sky-800:oklch(.443 .11 240.79);--color-sky-900:oklch(.391 .09 240.876);--color-sky-950:oklch(.293 .066 243.157);--color-blue-50:oklch(.97 .014 254.604);--color-blue-100:oklch(.932 .032 255.585);--color-blue-200:oklch(.882 .059 254.128);--color-blue-300:oklch(.809 .105 251.813);--color-blue-400:oklch(.707 .165 254.624);--color-blue-500:oklch(.623 .214 259.815);--color-blue-600:oklch(.546 .245 262.881);--color-blue-700:oklch(.488 .243 264.376);--color-blue-800:oklch(.424 .199 265.638);--color-blue-900:oklch(.379 .146 265.522);--color-blue-950:oklch(.282 .091 267.935);--color-indigo-50:oklch(.962 .018 272.314);--color-indigo-100:oklch(.93 .034 272.788);--color-indigo-200:oklch(.87 .065 274.039);--color-indigo-300:oklch(.785 .115 274.713);--color-indigo-400:oklch(.673 .182 276.935);--color-indigo-500:oklch(.585 .233 277.117);--color-indigo-600:oklch(.511 .262 276.966);--color-indigo-700:oklch(.457 .24 277.023);--color-indigo-800:oklch(.398 .195 277.366);--color-indigo-900:oklch(.359 .144 278.697);--color-indigo-950:oklch(.257 .09 281.288);--color-violet-50:oklch(.969 .016 293.756);--color-violet-100:oklch(.943 .029 294.588);--color-violet-200:oklch(.894 .057 293.283);--color-violet-300:oklch(.811 .111 293.571);--color-violet-400:oklch(.702 .183 293.541);--color-violet-500:oklch(.606 .25 292.717);--color-violet-600:oklch(.541 .281 293.009);--color-violet-700:oklch(.491 .27 292.581);--color-violet-800:oklch(.432 .232 292.759);--color-violet-900:oklch(.38 .189 293.745);--color-violet-950:oklch(.283 .141 291.089);--color-purple-50:oklch(.977 .014 308.299);--color-purple-100:oklch(.946 .033 307.174);--color-purple-200:oklch(.902 .063 306.703);--color-purple-300:oklch(.827 .119 306.383);--color-purple-400:oklch(.714 .203 305.504);--color-purple-500:oklch(.627 .265 303.9);--color-purple-600:oklch(.558 .288 302.321);--color-purple-700:oklch(.496 .265 301.924);--color-purple-800:oklch(.438 .218 303.724);--color-purple-900:oklch(.381 .176 304.987);--color-purple-950:oklch(.291 .149 302.717);--color-fuchsia-50:oklch(.977 .017 320.058);--color-fuchsia-100:oklch(.952 .037 318.852);--color-fuchsia-200:oklch(.903 .076 319.62);--color-fuchsia-300:oklch(.833 .145 321.434);--color-fuchsia-400:oklch(.74 .238 322.16);--color-fuchsia-500:oklch(.667 .295 322.15);--color-fuchsia-600:oklch(.591 .293 322.896);--color-fuchsia-700:oklch(.518 .253 323.949);--color-fuchsia-800:oklch(.452 .211 324.591);--color-fuchsia-900:oklch(.401 .17 325.612);--color-fuchsia-950:oklch(.293 .136 325.661);--color-pink-50:oklch(.971 .014 343.198);--color-pink-100:oklch(.948 .028 342.258);--color-pink-200:oklch(.899 .061 343.231);--color-pink-300:oklch(.823 .12 346.018);--color-pink-400:oklch(.718 .202 349.761);--color-pink-500:oklch(.656 .241 354.308);--color-pink-600:oklch(.592 .249 .584);--color-pink-700:oklch(.525 .223 3.958);--color-pink-800:oklch(.459 .187 3.815);--color-pink-900:oklch(.408 .153 2.432);--color-pink-950:oklch(.284 .109 3.907);--color-rose-50:oklch(.969 .015 12.422);--color-rose-100:oklch(.941 .03 12.58);--color-rose-200:oklch(.892 .058 10.001);--color-rose-300:oklch(.81 .117 11.638);--color-rose-400:oklch(.712 .194 13.428);--color-rose-500:oklch(.645 .246 16.439);--color-rose-600:oklch(.586 .253 17.585);--color-rose-700:oklch(.514 .222 16.935);--color-rose-800:oklch(.455 .188 13.697);--color-rose-900:oklch(.41 .159 10.272);--color-rose-950:oklch(.271 .105 12.094);--color-slate-50:oklch(.984 .003 247.858);--color-slate-100:oklch(.968 .007 247.896);--color-slate-200:oklch(.929 .013 255.508);--color-slate-300:oklch(.869 .022 252.894);--color-slate-400:oklch(.704 .04 256.788);--color-slate-500:oklch(.554 .046 257.417);--color-slate-600:oklch(.446 .043 257.281);--color-slate-700:oklch(.372 .044 257.287);--color-slate-800:oklch(.279 .041 260.031);--color-slate-900:oklch(.208 .042 265.755);--color-slate-950:oklch(.129 .042 264.695);--color-gray-50:oklch(.985 .002 247.839);--color-gray-100:oklch(.967 .003 264.542);--color-gray-200:oklch(.928 .006 264.531);--color-gray-300:oklch(.872 .01 258.338);--color-gray-400:oklch(.707 .022 261.325);--color-gray-500:oklch(.551 .027 264.364);--color-gray-600:oklch(.446 .03 256.802);--color-gray-700:oklch(.373 .034 259.733);--color-gray-800:oklch(.278 .033 256.848);--color-gray-900:oklch(.21 .034 264.665);--color-gray-950:oklch(.13 .028 261.692);--color-zinc-50:oklch(.985 0 0);--color-zinc-100:oklch(.967 .001 286.375);--color-zinc-200:oklch(.92 .004 286.32);--color-zinc-300:oklch(.871 .006 286.286);--color-zinc-400:oklch(.705 .015 286.067);--color-zinc-500:oklch(.552 .016 285.938);--color-zinc-600:oklch(.442 .017 285.786);--color-zinc-700:oklch(.37 .013 285.805);--color-zinc-800:oklch(.274 .006 286.033);--color-zinc-900:oklch(.21 .006 285.885);--color-zinc-950:oklch(.141 .005 285.823);--color-neutral-50:oklch(.985 0 0);--color-neutral-100:oklch(.97 0 0);--color-neutral-200:oklch(.922 0 0);--color-neutral-300:oklch(.87 0 0);--color-neutral-400:oklch(.708 0 0);--color-neutral-500:oklch(.556 0 0);--color-neutral-600:oklch(.439 0 0);--color-neutral-700:oklch(.371 0 0);--color-neutral-800:oklch(.269 0 0);--color-neutral-900:oklch(.205 0 0);--color-neutral-950:oklch(.145 0 0);--color-stone-50:oklch(.985 .001 106.423);--color-stone-100:oklch(.97 .001 106.424);--color-stone-200:oklch(.923 .003 48.717);--color-stone-300:oklch(.869 .005 56.366);--color-stone-400:oklch(.709 .01 56.259);--color-stone-500:oklch(.553 .013 58.071);--color-stone-600:oklch(.444 .011 73.639);--color-stone-700:oklch(.374 .01 67.558);--color-stone-800:oklch(.268 .007 34.298);--color-stone-900:oklch(.216 .006 56.043);--color-stone-950:oklch(.147 .004 49.25);--color-black:#000;--color-white:#fff;--spacing:.25rem;--breakpoint-sm:40rem;--breakpoint-md:48rem;--breakpoint-lg:64rem;--breakpoint-xl:80rem;--breakpoint-2xl:96rem;--container-3xs:16rem;--container-2xs:18rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--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: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--text-7xl:4.5rem;--text-7xl--line-height:1;--text-8xl:6rem;--text-8xl--line-height:1;--text-9xl:8rem;--text-9xl--line-height:1;--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--leading-loose:2;--radius-xs:.125rem;--radius-sm:calc(var(--radius) - 4px);--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--radius-xl:calc(var(--radius) + 4px);--radius-2xl:1rem;--radius-3xl:1.5rem;--radius-4xl:2rem;--shadow-2xs:0 1px #0000000d;--shadow-xs:0 1px 2px 0 #0000000d;--shadow-sm:0 1px 3px 0 #0000001a,0 1px 2px -1px #0000001a;--shadow-md:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;--shadow-lg:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;--shadow-xl:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a;--shadow-2xl:0 25px 50px -12px #00000040;--inset-shadow-2xs:inset 0 1px #0000000d;--inset-shadow-xs:inset 0 1px 1px #0000000d;--inset-shadow-sm:inset 0 2px 4px #0000000d;--drop-shadow-xs:0 1px 1px #0000000d;--drop-shadow-sm:0 1px 2px #00000026;--drop-shadow-md:0 3px 3px #0000001f;--drop-shadow-lg:0 4px 4px #00000026;--drop-shadow-xl:0 9px 7px #0000001a;--drop-shadow-2xl:0 25px 25px #00000026;--ease-in:cubic-bezier(.4,0,1,1);--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--animate-bounce:bounce 1s infinite;--blur-xs:4px;--blur-sm:8px;--blur-md:12px;--blur-lg:16px;--blur-xl:24px;--blur-2xl:40px;--blur-3xl:64px;--perspective-dramatic:100px;--perspective-near:300px;--perspective-normal:500px;--perspective-midrange:800px;--perspective-distant:1200px;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-font-feature-settings:var(--font-sans--font-feature-settings);--default-font-variation-settings:var(--font-sans--font-variation-settings);--default-mono-font-family:var(--font-mono);--default-mono-font-feature-settings:var(--font-mono--font-feature-settings);--default-mono-font-variation-settings:var(--font-mono--font-variation-settings);--color-background:var(--background);--color-foreground:var(--foreground);--color-card:var(--card);--color-card-foreground:var(--card-foreground);--color-popover:var(--popover);--color-popover-foreground:var(--popover-foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-secondary:var(--secondary);--color-secondary-foreground:var(--secondary-foreground);--color-muted:var(--muted);--color-muted-foreground:var(--muted-foreground);--color-accent:var(--accent);--color-accent-foreground:var(--accent-foreground);--color-destructive:var(--destructive);--color-destructive-foreground:var(--destructive-foreground);--color-border:var(--border);--color-input:var(--input);--color-ring:var(--ring);--color-chart-1:var(--chart-1);--color-chart-2:var(--chart-2);--color-chart-3:var(--chart-3);--color-chart-4:var(--chart-4);--color-chart-5:var(--chart-5);--color-sidebar-ring:var(--sidebar-ring);--color-sidebar-border:var(--sidebar-border);--color-sidebar-accent-foreground:var(--sidebar-accent-foreground);--color-sidebar-accent:var(--sidebar-accent);--color-sidebar-primary-foreground:var(--sidebar-primary-foreground);--color-sidebar-primary:var(--sidebar-primary);--color-sidebar-foreground:var(--sidebar-foreground);--color-sidebar:var(--sidebar-background);--animate-accordion-down:accordion-down .2s ease-out;--animate-accordion-up:accordion-up .2s ease-out}}@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%;-moz-tab-size:4;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}body{line-height:inherit}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;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;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}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance: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:color-mix(in oklab,var(--ring)50%,transparent)}body{background-color:var(--background);color:var(--foreground)}}@layer components;@layer utilities{.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.right-2{right:calc(var(--spacing)*2)}.right-4{right:calc(var(--spacing)*4)}.bottom-2{bottom:calc(var(--spacing)*2)}.bottom-4{bottom:calc(var(--spacing)*4)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.z-50{z-index:50}.\!container{width:100%!important}@media (width>=40rem){.\!container{max-width:40rem!important}}@media (width>=48rem){.\!container{max-width:48rem!important}}@media (width>=64rem){.\!container{max-width:64rem!important}}@media (width>=80rem){.\!container{max-width:80rem!important}}@media (width>=96rem){.\!container{max-width:96rem!important}}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.table{display:table}.\!size-full{width:100%!important;height:100%!important}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11{height:calc(var(--spacing)*11)}.h-\[1px\]{height:1px}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-8{max-height:calc(var(--spacing)*8)}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[300px\]{max-height:300px}.max-h-auto{max-height:auto}.max-h-full{max-height:100%}.w-0{width:calc(var(--spacing)*0)}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-6{width:calc(var(--spacing)*6)}.w-16{width:calc(var(--spacing)*16)}.w-24{width:calc(var(--spacing)*24)}.w-\[1px\]{width:1px}.w-auto{width:auto}.w-full{width:100%}.w-screen{width:100vw}.max-w-80{max-width:calc(var(--spacing)*80)}.max-w-lg{max-width:var(--container-lg)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[300px\]{min-width:300px}.flex-1{flex:1}.flex-auto{flex:auto}.flex-shrink,.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-20{--tw-translate-y:calc(var(--spacing)*-20);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-0{--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-125{--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.transform{transform:var(--tw-rotate-x)var(--tw-rotate-y)var(--tw-rotate-z)var(--tw-skew-x)var(--tw-skew-y)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.columns-2{columns:2}.columns-3{columns:3}.columns-4{columns:4}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-4{gap:calc(var(--spacing)*4)}: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-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)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.border,.border-1{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-destructive\/50{border-color:color-mix(in oklab,var(--destructive)50%,transparent)}.border-input{border-color:var(--input)}.border-primary{border-color:var(--primary)}.\!bg-background{background-color:var(--background)!important}.bg-background{background-color:var(--background)}.bg-background\/60{background-color:color-mix(in oklab,var(--background)60%,transparent)}.bg-background\/80{background-color:color-mix(in oklab,var(--background)80%,transparent)}.bg-background\/90{background-color:color-mix(in oklab,var(--background)90%,transparent)}.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}.bg-border{background-color:var(--border)}.bg-destructive{background-color:var(--destructive)}.bg-foreground\/10{background-color:color-mix(in oklab,var(--foreground)10%,transparent)}.bg-green-500{background-color:var(--color-green-500)}.bg-muted{background-color:var(--muted)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-primary\/5{background-color:color-mix(in oklab,var(--primary)5%,transparent)}.bg-red-500{background-color:var(--color-red-500)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.\!p-2{padding:calc(var(--spacing)*2)!important}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-8{padding-inline:calc(var(--spacing)*8)}.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-3{padding-block:calc(var(--spacing)*3)}.py-6{padding-block:calc(var(--spacing)*6)}.pl-1{padding-left:calc(var(--spacing)*1)}.text-center{text-align:center}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.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-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-current{color:currentColor}.text-destructive{color:var(--destructive)}.text-destructive-foreground{color:var(--destructive-foreground)}.text-foreground{color:var(--foreground)}.text-muted{color:var(--muted)}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-primary\/60{color:color-mix(in oklab,var(--primary)60%,transparent)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sky-300{color:var(--color-sky-300)}.text-teal-600{color:var(--color-teal-600)}.text-teal-600\/90{color:color-mix(in oklab,var(--color-teal-600)90%,transparent)}.text-yellow-400\/90{color:color-mix(in oklab,var(--color-yellow-400)90%,transparent)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(34\,197\,94\,0\.4\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#22c55e66);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(239\,68\,68\,0\.4\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#ef444466);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.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-lg{--tw-backdrop-blur:blur(var(--blur-lg));-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;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))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.animate-in{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.paused{animation-play-state:paused}.repeat-1{animation-iteration-count:1}.running{animation-play-state:running}.select-none{-webkit-user-select:none;user-select:none}.zoom-in{--tw-enter-scale:0}.zoom-in-95{--tw-enter-scale:.95}.zoom-out{--tw-exit-scale:0}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.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)}@media (hover:hover){.hover\:w-fit:hover{width:fit-content}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}.hover\:bg-primary\/20:hover{background-color:color-mix(in oklab,var(--primary)20%,transparent)}.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.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:focus{--tw-ring-color:var(--ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--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-visible\:ring-ring:focus-visible{--tw-ring-color:var(--ring)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[selected\=\'true\'\]\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:.5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:.5rem}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-out[data-state=closed]{--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial;animation-name:exit;animation-duration:.15s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:animate-in[data-state=open]{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y:-48%}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}@media (width>=40rem){.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (width>=48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.dark\:border-destructive:is(.dark *){border-color:var(--destructive)}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing)*1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--spacing)*0)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing)*5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing)*5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing)*12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing)*3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing)*5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing)*5)}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:top-4>svg{top:calc(var(--spacing)*4)}.\[\&\>svg\]\:left-4>svg{left:calc(var(--spacing)*4)}.\[\&\>svg\]\:text-destructive>svg{color:var(--destructive)}.\[\&\>svg\]\:text-foreground>svg{color:var(--foreground)}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y:-3px;translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:calc(var(--spacing)*7)}}:root{--background:#fff;--foreground:#09090b;--card:#fff;--card-foreground:#09090b;--popover:#fff;--popover-foreground:#09090b;--primary:#18181b;--primary-foreground:#fafafa;--secondary:#f4f4f5;--secondary-foreground:#18181b;--muted:#f4f4f5;--muted-foreground:#71717a;--accent:#f4f4f5;--accent-foreground:#18181b;--destructive:#ef4444;--destructive-foreground:#fafafa;--border:#e4e4e7;--input:#e4e4e7;--ring:#09090b;--chart-1:#e76e50;--chart-2:#2a9d90;--chart-3:#274754;--chart-4:#e8c468;--chart-5:#f4a462;--radius:.6rem;--sidebar-background:#fafafa;--sidebar-foreground:#3f3f46;--sidebar-primary:#18181b;--sidebar-primary-foreground:#fafafa;--sidebar-accent:#f4f4f5;--sidebar-accent-foreground:#18181b;--sidebar-border:#e5e7eb;--sidebar-ring:#3b82f6}.dark{--background:#09090b;--foreground:#fafafa;--card:#09090b;--card-foreground:#fafafa;--popover:#09090b;--popover-foreground:#fafafa;--primary:#fafafa;--primary-foreground:#18181b;--secondary:#27272a;--secondary-foreground:#fafafa;--muted:#27272a;--muted-foreground:#a1a1aa;--accent:#27272a;--accent-foreground:#fafafa;--destructive:#7f1d1d;--destructive-foreground:#fafafa;--border:#27272a;--input:#27272a;--ring:#d4d4d8;--chart-1:#2662d9;--chart-2:#2eb88a;--chart-3:#e88c30;--chart-4:#af57db;--chart-5:#e23670;--sidebar-background:#18181b;--sidebar-foreground:#f4f4f5;--sidebar-primary:#1d4ed8;--sidebar-primary-foreground:#fff;--sidebar-accent:#27272a;--sidebar-accent-foreground:#f4f4f5;--sidebar-border:#27272a;--sidebar-ring:#3b82f6}@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))}}@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))}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}@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 accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false;initial-value:rotateX(0)}@property --tw-rotate-y{syntax:"*";inherits:false;initial-value:rotateY(0)}@property --tw-rotate-z{syntax:"*";inherits:false;initial-value:rotateZ(0)}@property --tw-skew-x{syntax:"*";inherits:false;initial-value:skewX(0)}@property --tw-skew-y{syntax:"*";inherits:false;initial-value:skewY(0)}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-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-space-x-reverse{syntax:"*";inherits:false;initial-value:0}:root{--sigma-background-color:#fff;--sigma-controls-background-color:#fff;--sigma-controls-background-color-hover:rgba(0,0,0,.2);--sigma-controls-border-color:rgba(0,0,0,.2);--sigma-controls-color:#000;--sigma-controls-zindex:100;--sigma-controls-margin:5px;--sigma-controls-size:30px}div.react-sigma{height:100%;width:100%;position:relative;background:var(--sigma-background-color)}div.sigma-container{height:100%;width:100%}.react-sigma-controls{position:absolute;z-index:var(--sigma-controls-zindex);border:2px solid var(--sigma-controls-border-color);border-radius:4px;color:var(--sigma-controls-color);background-color:var(--sigma-controls-background-color)}.react-sigma-controls.bottom-right{bottom:var(--sigma-controls-margin);right:var(--sigma-controls-margin)}.react-sigma-controls.bottom-left{bottom:var(--sigma-controls-margin);left:var(--sigma-controls-margin)}.react-sigma-controls.top-right{top:var(--sigma-controls-margin);right:var(--sigma-controls-margin)}.react-sigma-controls.top-left{top:var(--sigma-controls-margin);left:var(--sigma-controls-margin)}.react-sigma-controls:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.react-sigma-controls:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.react-sigma-control{width:var(--sigma-controls-size);height:var(--sigma-controls-size);line-height:var(--sigma-controls-size);background-color:var(--sigma-controls-background-color);border-bottom:1px solid var(--sigma-controls-border-color)}.react-sigma-control:last-child{border-bottom:none}.react-sigma-control>*{box-sizing:border-box}.react-sigma-control>button{display:block;border:none;margin:0;padding:0;width:var(--sigma-controls-size);height:var(--sigma-controls-size);line-height:var(--sigma-controls-size);background-position:center;background-size:50%;background-repeat:no-repeat;background-color:var(--sigma-controls-background-color);clip:rect(0,0,0,0)}.react-sigma-control>button:hover{background-color:var(--sigma-controls-background-color-hover)}.react-sigma-search{background-color:var(--sigma-controls-background-color)}.react-sigma-search label{visibility:hidden}.react-sigma-search input{color:var(--sigma-controls-color);background-color:var(--sigma-controls-background-color);font-size:1em;width:100%;margin:0;border:none;padding:var(--sigma-controls-margin);box-sizing:border-box}:root{--sigma-grey-color:#ccc}.react-sigma .option.hoverable{cursor:pointer!important}.react-sigma .text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.react-sigma .react-select__clear-indicator{cursor:pointer!important}.react-sigma .text-muted{color:var(--sigma-grey-color)}.react-sigma .text-italic{font-style:italic}.react-sigma .text-center{text-align:center}.react-sigma .graph-search{min-width:250px}.react-sigma .graph-search .option{padding:2px 8px}.react-sigma .graph-search .dropdown-indicator{font-size:1.25em;padding:4px}.react-sigma .graph-search .option.selected{background-color:var(--sigma-grey-color)}.react-sigma .node .render{position:relative;display:inline-block;width:1em;height:1em;border-radius:1em;background-color:var(--sigma-grey-color);margin-right:8px}.react-sigma .node{display:flex;flex-direction:row;align-items:center}.react-sigma .node .render{flex-grow:0;flex-shrink:0;margin-right:0 .25em}.react-sigma .node .label{flex-grow:1;flex-shrink:1}.react-sigma .edge{display:flex;flex-direction:column;align-items:flex-start;flex-grow:0;flex-shrink:0;flex-wrap:nowrap}.react-sigma .edge .node{font-size:.7em}.react-sigma .edge .body{display:flex;flex-direction:row;flex-grow:1;flex-shrink:1;min-height:.6em}.react-sigma .edge .body .render{display:flex;flex-direction:column;margin:0 2px}.react-sigma .edge .body .render .dash,.react-sigma .edge .body .render .dotted{display:inline-block;width:0;margin:0 2px;border:2px solid #ccc;flex-grow:1;flex-shrink:1}.react-sigma .edge .body .render .dotted{border-style:dotted}.react-sigma .edge .body .render .arrow{width:0;height:0;border-left:.3em solid transparent;border-right:.3em solid transparent;border-top:.6em solid red;flex-shrink:0;flex-grow:0;border-left-width:.3em;border-right-width:.3em}.react-sigma .edge .body .label{flex-grow:1;flex-shrink:1;text-align:center} diff --git a/lightrag/api/webui/assets/index-BMB0OroL.js b/lightrag/api/webui/assets/index-BMB0OroL.js new file mode 100644 index 00000000..75b01c44 --- /dev/null +++ b/lightrag/api/webui/assets/index-BMB0OroL.js @@ -0,0 +1,1065 @@ +var gD=Object.defineProperty;var vD=(e,t,n)=>t in e?gD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Xr=(e,t,n)=>vD(e,typeof t!="symbol"?t+"":t,n);function yD(e,t){for(var n=0;na[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function dn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bD(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function a(){return this instanceof a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),n}var Mh={exports:{}},qs={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Vx;function xD(){if(Vx)return qs;Vx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,o,s){var c=null;if(s!==void 0&&(c=""+s),o.key!==void 0&&(c=""+o.key),"key"in o){s={};for(var u in o)u!=="key"&&(s[u]=o[u])}else s=o;return o=s.ref,{$$typeof:e,type:a,key:c,ref:o!==void 0?o:null,props:s}}return qs.Fragment=t,qs.jsx=n,qs.jsxs=n,qs}var qx;function wD(){return qx||(qx=1,Mh.exports=xD()),Mh.exports}var x=wD(),Ph={exports:{}},Ke={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Yx;function ED(){if(Yx)return Ke;Yx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function y(G){return G===null||typeof G!="object"?null:(G=g&&G[g]||G["@@iterator"],typeof G=="function"?G:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function _(G,H,O){this.props=G,this.context=H,this.refs=E,this.updater=O||b}_.prototype.isReactComponent={},_.prototype.setState=function(G,H){if(typeof G!="object"&&typeof G!="function"&&G!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,G,H,"setState")},_.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function N(){}N.prototype=_.prototype;function C(G,H,O){this.props=G,this.context=H,this.refs=E,this.updater=O||b}var A=C.prototype=new N;A.constructor=C,S(A,_.prototype),A.isPureReactComponent=!0;var k=Array.isArray,D={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function R(G,H,O,$,W,re){return O=re.ref,{$$typeof:e,type:G,key:H,ref:O!==void 0?O:null,props:re}}function U(G,H){return R(G.type,H,void 0,void 0,void 0,G.props)}function L(G){return typeof G=="object"&&G!==null&&G.$$typeof===e}function I(G){var H={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(O){return H[O]})}var q=/\/+/g;function Y(G,H){return typeof G=="object"&&G!==null&&G.key!=null?I(""+G.key):H.toString(36)}function B(){}function X(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(B,B):(G.status="pending",G.then(function(H){G.status==="pending"&&(G.status="fulfilled",G.value=H)},function(H){G.status==="pending"&&(G.status="rejected",G.reason=H)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function ne(G,H,O,$,W){var re=typeof G;(re==="undefined"||re==="boolean")&&(G=null);var de=!1;if(G===null)de=!0;else switch(re){case"bigint":case"string":case"number":de=!0;break;case"object":switch(G.$$typeof){case e:case t:de=!0;break;case m:return de=G._init,ne(de(G._payload),H,O,$,W)}}if(de)return W=W(G),de=$===""?"."+Y(G,0):$,k(W)?(O="",de!=null&&(O=de.replace(q,"$&/")+"/"),ne(W,H,O,"",function(Ce){return Ce})):W!=null&&(L(W)&&(W=U(W,O+(W.key==null||G&&G.key===W.key?"":(""+W.key).replace(q,"$&/")+"/")+de)),H.push(W)),1;de=0;var ie=$===""?".":$+":";if(k(G))for(var oe=0;oe>>1,G=F[K];if(0>>1;Ko($,j))Wo(re,$)?(F[K]=re,F[W]=j,K=W):(F[K]=$,F[O]=j,K=O);else if(Wo(re,j))F[K]=re,F[W]=j,K=W;else break e}}return z}function o(F,z){var j=F.sortIndex-z.sortIndex;return j!==0?j:F.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],h=[],m=1,g=null,y=3,b=!1,S=!1,E=!1,_=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(F){for(var z=n(h);z!==null;){if(z.callback===null)a(h);else if(z.startTime<=F)a(h),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(h)}}function k(F){if(E=!1,A(F),!S)if(n(f)!==null)S=!0,X();else{var z=n(h);z!==null&&ne(k,z.startTime-F)}}var D=!1,M=-1,R=5,U=-1;function L(){return!(e.unstable_now()-UF&&L());){var K=g.callback;if(typeof K=="function"){g.callback=null,y=g.priorityLevel;var G=K(g.expirationTime<=F);if(F=e.unstable_now(),typeof G=="function"){g.callback=G,A(F),z=!0;break t}g===n(f)&&a(f),A(F)}else a(f);g=n(f)}if(g!==null)z=!0;else{var H=n(h);H!==null&&ne(k,H.startTime-F),z=!1}}break e}finally{g=null,y=j,b=!1}z=void 0}}finally{z?q():D=!1}}}var q;if(typeof C=="function")q=function(){C(I)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,B=Y.port2;Y.port1.onmessage=I,q=function(){B.postMessage(null)}}else q=function(){_(I,0)};function X(){D||(D=!0,q())}function ne(F,z){M=_(function(){F(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_continueExecution=function(){S||b||(S=!0,X())},e.unstable_forceFrameRate=function(F){0>F||125K?(F.sortIndex=j,t(h,F),n(f)===null&&F===n(h)&&(E?(N(M),M=-1):E=!0,ne(k,j-K))):(F.sortIndex=G,t(f,F),S||b||(S=!0,X())),F},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(F){var z=y;return function(){var j=y;y=z;try{return F.apply(this,arguments)}finally{y=j}}}}(Uh)),Uh}var Kx;function CD(){return Kx||(Kx=1,Fh.exports=_D()),Fh.exports}var Bh={exports:{}},nn={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Zx;function TD(){if(Zx)return nn;Zx=1;var e=Yu();function t(f){var h="https://react.dev/errors/"+f;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Bh.exports=TD(),Bh.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Jx;function RD(){if(Jx)return Ys;Jx=1;var e=CD(),t=Yu(),n=Y1();function a(r){var i="https://react.dev/errors/"+r;if(1)":-1p||V[d]!==Q[p]){var fe=` +`+V[d].replace(" at new "," at ");return r.displayName&&fe.includes("")&&(fe=fe.replace("",r.displayName)),fe}while(1<=d&&0<=p);break}}}finally{X=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?B(l):""}function F(r){switch(r.tag){case 26:case 27:case 5:return B(r.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 15:return r=ne(r.type,!1),r;case 11:return r=ne(r.type.render,!1),r;case 1:return r=ne(r.type,!0),r;default:return""}}function z(r){try{var i="";do i+=F(r),r=r.return;while(r);return i}catch(l){return` +Error generating stack: `+l.message+` +`+l.stack}}function j(r){var i=r,l=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,i.flags&4098&&(l=i.return),r=i.return;while(r)}return i.tag===3?l:null}function K(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function G(r){if(j(r)!==r)throw Error(a(188))}function H(r){var i=r.alternate;if(!i){if(i=j(r),i===null)throw Error(a(188));return i!==r?null:r}for(var l=r,d=i;;){var p=l.return;if(p===null)break;var v=p.alternate;if(v===null){if(d=p.return,d!==null){l=d;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===l)return G(p),r;if(v===d)return G(p),i;v=v.sibling}throw Error(a(188))}if(l.return!==d.return)l=p,d=v;else{for(var T=!1,P=p.child;P;){if(P===l){T=!0,l=p,d=v;break}if(P===d){T=!0,d=p,l=v;break}P=P.sibling}if(!T){for(P=v.child;P;){if(P===l){T=!0,l=v,d=p;break}if(P===d){T=!0,d=v,l=p;break}P=P.sibling}if(!T)throw Error(a(189))}}if(l.alternate!==d)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?r:i}function O(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=O(r),i!==null)return i;r=r.sibling}return null}var $=Array.isArray,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},de=[],ie=-1;function oe(r){return{current:r}}function Ce(r){0>ie||(r.current=de[ie],de[ie]=null,ie--)}function he(r,i){ie++,de[ie]=r.current,r.current=i}var Se=oe(null),be=oe(null),Le=oe(null),Te=oe(null);function ye(r,i){switch(he(Le,i),he(be,r),he(Se,null),r=i.nodeType,r){case 9:case 11:i=(i=i.documentElement)&&(i=i.namespaceURI)?xx(i):0;break;default:if(r=r===8?i.parentNode:i,i=r.tagName,r=r.namespaceURI)r=xx(r),i=wx(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Ce(Se),he(Se,i)}function J(){Ce(Se),Ce(be),Ce(Le)}function le(r){r.memoizedState!==null&&he(Te,r);var i=Se.current,l=wx(i,r.type);i!==l&&(he(be,r),he(Se,l))}function _e(r){be.current===r&&(Ce(Se),Ce(be)),Te.current===r&&(Ce(Te),Bs._currentValue=re)}var pe=Object.prototype.hasOwnProperty,Ee=e.unstable_scheduleCallback,te=e.unstable_cancelCallback,Fe=e.unstable_shouldYield,Pe=e.unstable_requestPaint,me=e.unstable_now,Ae=e.unstable_getCurrentPriorityLevel,je=e.unstable_ImmediatePriority,He=e.unstable_UserBlockingPriority,it=e.unstable_NormalPriority,Ct=e.unstable_LowPriority,bt=e.unstable_IdlePriority,qt=e.log,fn=e.unstable_setDisableYieldValue,Gt=null,at=null;function Tn(r){if(at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(Gt,r,void 0,(r.current.flags&128)===128)}catch{}}function xt(r){if(typeof qt=="function"&&fn(r),at&&typeof at.setStrictMode=="function")try{at.setStrictMode(Gt,r)}catch{}}var Lt=Math.clz32?Math.clz32:Ol,Wa=Math.log,ji=Math.LN2;function Ol(r){return r>>>=0,r===0?32:31-(Wa(r)/ji|0)|0}var Li=128,ca=4194304;function Jt(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function zi(r,i){var l=r.pendingLanes;if(l===0)return 0;var d=0,p=r.suspendedLanes,v=r.pingedLanes,T=r.warmLanes;r=r.finishedLanes!==0;var P=l&134217727;return P!==0?(l=P&~p,l!==0?d=Jt(l):(v&=P,v!==0?d=Jt(v):r||(T=P&~T,T!==0&&(d=Jt(T))))):(P=l&~p,P!==0?d=Jt(P):v!==0?d=Jt(v):r||(T=l&~T,T!==0&&(d=Jt(T)))),d===0?0:i!==0&&i!==d&&!(i&p)&&(p=d&-d,T=i&-i,p>=T||p===32&&(T&4194176)!==0)?i:d}function qe(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function lt(r,i){switch(r){case 1:case 2:case 4:case 8:return i+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pt(){var r=Li;return Li<<=1,!(Li&4194176)&&(Li=128),r}function hn(){var r=ca;return ca<<=1,!(ca&62914560)&&(ca=4194304),r}function ln(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function pn(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Nr(r,i,l,d,p,v){var T=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var P=r.entanglements,V=r.expirationTimes,Q=r.hiddenUpdates;for(l=T&~l;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cA=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),wv={},Ev={};function uA(r){return pe.call(Ev,r)?!0:pe.call(wv,r)?!1:cA.test(r)?Ev[r]=!0:(wv[r]=!0,!1)}function jl(r,i,l){if(uA(i))if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+l)}}function Ll(r,i,l){if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+l)}}function jr(r,i,l,d){if(d===null)r.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(i,l,""+d)}}function Mn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Sv(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function dA(r){var i=Sv(r)?"checked":"value",l=Object.getOwnPropertyDescriptor(r.constructor.prototype,i),d=""+r[i];if(!r.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,v=l.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(T){d=""+T,v.call(this,T)}}),Object.defineProperty(r,i,{enumerable:l.enumerable}),{getValue:function(){return d},setValue:function(T){d=""+T},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function zl(r){r._valueTracker||(r._valueTracker=dA(r))}function _v(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return r&&(d=Sv(r)?r.checked?"true":"false":r.value),r=d,r!==l?(i.setValue(r),!0):!1}function Ml(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var fA=/[\n"\\]/g;function Pn(r){return r.replace(fA,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function jd(r,i,l,d,p,v,T,P){r.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?r.type=T:r.removeAttribute("type"),i!=null?T==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+Mn(i)):r.value!==""+Mn(i)&&(r.value=""+Mn(i)):T!=="submit"&&T!=="reset"||r.removeAttribute("value"),i!=null?Ld(r,T,Mn(i)):l!=null?Ld(r,T,Mn(l)):d!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?r.name=""+Mn(P):r.removeAttribute("name")}function Cv(r,i,l,d,p,v,T,P){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||i!=null))return;l=l!=null?""+Mn(l):"",i=i!=null?""+Mn(i):l,P||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=P?r.checked:!!d,r.defaultChecked=!!d,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(r.name=T)}function Ld(r,i,l){i==="number"&&Ml(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function Ui(r,i,l,d){if(r=r.options,i){i={};for(var p=0;p=is),Gv=" ",Fv=!1;function Uv(r,i){switch(r){case"keyup":return UA.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var $i=!1;function IA(r,i){switch(r){case"compositionend":return Bv(i);case"keypress":return i.which!==32?null:(Fv=!0,Gv);case"textInput":return r=i.data,r===Gv&&Fv?null:r;default:return null}}function HA(r,i){if($i)return r==="compositionend"||!Vd&&Uv(r,i)?(r=Ov(),Gl=Ud=da=null,$i=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1=i)return{node:l,offset:i-r};r=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Xv(l)}}function Zv(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Zv(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Qv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Ml(r.document);i instanceof r.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)r=i.contentWindow;else break;i=Ml(r.document)}return i}function Wd(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}function ZA(r,i){var l=Qv(i);i=r.focusedElem;var d=r.selectionRange;if(l!==i&&i&&i.ownerDocument&&Zv(i.ownerDocument.documentElement,i)){if(d!==null&&Wd(i)){if(r=d.start,l=d.end,l===void 0&&(l=r),"selectionStart"in i)i.selectionStart=r,i.selectionEnd=Math.min(l,i.value.length);else if(l=(r=i.ownerDocument||document)&&r.defaultView||window,l.getSelection){l=l.getSelection();var p=i.textContent.length,v=Math.min(d.start,p);d=d.end===void 0?v:Math.min(d.end,p),!l.extend&&v>d&&(p=d,d=v,v=p),p=Kv(i,v);var T=Kv(i,d);p&&T&&(l.rangeCount!==1||l.anchorNode!==p.node||l.anchorOffset!==p.offset||l.focusNode!==T.node||l.focusOffset!==T.offset)&&(r=r.createRange(),r.setStart(p.node,p.offset),l.removeAllRanges(),v>d?(l.addRange(r),l.extend(T.node,T.offset)):(r.setEnd(T.node,T.offset),l.addRange(r)))}}for(r=[],l=i;l=l.parentNode;)l.nodeType===1&&r.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i=document.documentMode,Vi=null,Xd=null,cs=null,Kd=!1;function Jv(r,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Kd||Vi==null||Vi!==Ml(d)||(d=Vi,"selectionStart"in d&&Wd(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),cs&&ls(cs,d)||(cs=d,d=Cc(Xd,"onSelect"),0>=T,p-=T,Lr=1<<32-Lt(i)+p|l<Ve?(It=Ue,Ue=null):It=Ue.sibling;var st=se(ee,Ue,ae[Ve],ge);if(st===null){Ue===null&&(Ue=It);break}r&&Ue&&st.alternate===null&&i(ee,Ue),Z=v(st,Z,Ve),Qe===null?Me=st:Qe.sibling=st,Qe=st,Ue=It}if(Ve===ae.length)return l(ee,Ue),ot&&ti(ee,Ve),Me;if(Ue===null){for(;VeVe?(It=Ue,Ue=null):It=Ue.sibling;var Na=se(ee,Ue,st.value,ge);if(Na===null){Ue===null&&(Ue=It);break}r&&Ue&&Na.alternate===null&&i(ee,Ue),Z=v(Na,Z,Ve),Qe===null?Me=Na:Qe.sibling=Na,Qe=Na,Ue=It}if(st.done)return l(ee,Ue),ot&&ti(ee,Ve),Me;if(Ue===null){for(;!st.done;Ve++,st=ae.next())st=xe(ee,st.value,ge),st!==null&&(Z=v(st,Z,Ve),Qe===null?Me=st:Qe.sibling=st,Qe=st);return ot&&ti(ee,Ve),Me}for(Ue=d(Ue);!st.done;Ve++,st=ae.next())st=ue(Ue,ee,Ve,st.value,ge),st!==null&&(r&&st.alternate!==null&&Ue.delete(st.key===null?Ve:st.key),Z=v(st,Z,Ve),Qe===null?Me=st:Qe.sibling=st,Qe=st);return r&&Ue.forEach(function(mD){return i(ee,mD)}),ot&&ti(ee,Ve),Me}function At(ee,Z,ae,ge){if(typeof ae=="object"&&ae!==null&&ae.type===f&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case c:e:{for(var Me=ae.key;Z!==null;){if(Z.key===Me){if(Me=ae.type,Me===f){if(Z.tag===7){l(ee,Z.sibling),ge=p(Z,ae.props.children),ge.return=ee,ee=ge;break e}}else if(Z.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===C&&gy(Me)===Z.type){l(ee,Z.sibling),ge=p(Z,ae.props),gs(ge,ae),ge.return=ee,ee=ge;break e}l(ee,Z);break}else i(ee,Z);Z=Z.sibling}ae.type===f?(ge=fi(ae.props.children,ee.mode,ge,ae.key),ge.return=ee,ee=ge):(ge=mc(ae.type,ae.key,ae.props,null,ee.mode,ge),gs(ge,ae),ge.return=ee,ee=ge)}return T(ee);case u:e:{for(Me=ae.key;Z!==null;){if(Z.key===Me)if(Z.tag===4&&Z.stateNode.containerInfo===ae.containerInfo&&Z.stateNode.implementation===ae.implementation){l(ee,Z.sibling),ge=p(Z,ae.children||[]),ge.return=ee,ee=ge;break e}else{l(ee,Z);break}else i(ee,Z);Z=Z.sibling}ge=Jf(ae,ee.mode,ge),ge.return=ee,ee=ge}return T(ee);case C:return Me=ae._init,ae=Me(ae._payload),At(ee,Z,ae,ge)}if($(ae))return Ge(ee,Z,ae,ge);if(M(ae)){if(Me=M(ae),typeof Me!="function")throw Error(a(150));return ae=Me.call(ae),We(ee,Z,ae,ge)}if(typeof ae.then=="function")return At(ee,Z,Kl(ae),ge);if(ae.$$typeof===b)return At(ee,Z,fc(ee,ae),ge);Zl(ee,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,Z!==null&&Z.tag===6?(l(ee,Z.sibling),ge=p(Z,ae),ge.return=ee,ee=ge):(l(ee,Z),ge=Qf(ae,ee.mode,ge),ge.return=ee,ee=ge),T(ee)):l(ee,Z)}return function(ee,Z,ae,ge){try{ms=0;var Me=At(ee,Z,ae,ge);return Zi=null,Me}catch(Ue){if(Ue===hs)throw Ue;var Qe=Vn(29,Ue,null,ee.mode);return Qe.lanes=ge,Qe.return=ee,Qe}finally{}}}var ri=vy(!0),yy=vy(!1),Qi=oe(null),Ql=oe(0);function by(r,i){r=qr,he(Ql,r),he(Qi,i),qr=r|i.baseLanes}function af(){he(Ql,qr),he(Qi,Qi.current)}function of(){qr=Ql.current,Ce(Qi),Ce(Ql)}var In=oe(null),mr=null;function ha(r){var i=r.alternate;he(zt,zt.current&1),he(In,r),mr===null&&(i===null||Qi.current!==null||i.memoizedState!==null)&&(mr=r)}function xy(r){if(r.tag===22){if(he(zt,zt.current),he(In,r),mr===null){var i=r.alternate;i!==null&&i.memoizedState!==null&&(mr=r)}}else pa()}function pa(){he(zt,zt.current),he(In,In.current)}function Mr(r){Ce(In),mr===r&&(mr=null),Ce(zt)}var zt=oe(0);function Jl(r){for(var i=r;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if(i.flags&128)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var n2=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(l,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(l){return l()})}},r2=e.unstable_scheduleCallback,a2=e.unstable_NormalPriority,Mt={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sf(){return{controller:new n2,data:new Map,refCount:0}}function vs(r){r.refCount--,r.refCount===0&&r2(a2,function(){r.controller.abort()})}var ys=null,lf=0,Ji=0,eo=null;function i2(r,i){if(ys===null){var l=ys=[];lf=0,Ji=ph(),eo={status:"pending",value:void 0,then:function(d){l.push(d)}}}return lf++,i.then(wy,wy),i}function wy(){if(--lf===0&&ys!==null){eo!==null&&(eo.status="fulfilled");var r=ys;ys=null,Ji=0,eo=null;for(var i=0;iv?v:8;var T=L.T,P={};L.T=P,Cf(r,!1,i,l);try{var V=p(),Q=L.S;if(Q!==null&&Q(P,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var fe=o2(V,d);ws(r,i,fe,Nn(r))}else ws(r,i,d,Nn(r))}catch(xe){ws(r,i,{then:function(){},status:"rejected",reason:xe},Nn())}finally{W.p=v,L.T=T}}function d2(){}function Sf(r,i,l,d){if(r.tag!==5)throw Error(a(476));var p=Qy(r).queue;Zy(r,p,i,re,l===null?d2:function(){return Jy(r),l(d)})}function Qy(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:re},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:l},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Jy(r){var i=Qy(r).next.queue;ws(r,i,{},Nn())}function _f(){return tn(Bs)}function eb(){return Ot().memoizedState}function tb(){return Ot().memoizedState}function f2(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var l=Nn();r=ba(l);var d=xa(i,r,l);d!==null&&(un(d,i,l),_s(d,i,l)),i={cache:sf()},r.payload=i;return}i=i.return}}function h2(r,i,l){var d=Nn();l={lane:d,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null},lc(r)?rb(i,l):(l=Jd(r,i,l,d),l!==null&&(un(l,r,d),ab(l,i,d)))}function nb(r,i,l){var d=Nn();ws(r,i,l,d)}function ws(r,i,l,d){var p={lane:d,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null};if(lc(r))rb(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var T=i.lastRenderedState,P=v(T,l);if(p.hasEagerState=!0,p.eagerState=P,Rn(P,T))return Vl(r,i,p,0),vt===null&&$l(),!1}catch{}finally{}if(l=Jd(r,i,p,d),l!==null)return un(l,r,d),ab(l,i,d),!0}return!1}function Cf(r,i,l,d){if(d={lane:2,revertLane:ph(),action:d,hasEagerState:!1,eagerState:null,next:null},lc(r)){if(i)throw Error(a(479))}else i=Jd(r,l,d,2),i!==null&&un(i,r,2)}function lc(r){var i=r.alternate;return r===Ze||i!==null&&i===Ze}function rb(r,i){to=tc=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function ab(r,i,l){if(l&4194176){var d=i.lanes;d&=r.pendingLanes,l|=d,i.lanes=l,Jn(r,l)}}var gr={readContext:tn,use:ac,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useLayoutEffect:Dt,useInsertionEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useSyncExternalStore:Dt,useId:Dt};gr.useCacheRefresh=Dt,gr.useMemoCache=Dt,gr.useHostTransitionStatus=Dt,gr.useFormState=Dt,gr.useActionState=Dt,gr.useOptimistic=Dt;var oi={readContext:tn,use:ac,useCallback:function(r,i){return yn().memoizedState=[r,i===void 0?null:i],r},useContext:tn,useEffect:Hy,useImperativeHandle:function(r,i,l){l=l!=null?l.concat([r]):null,oc(4194308,4,qy.bind(null,i,r),l)},useLayoutEffect:function(r,i){return oc(4194308,4,r,i)},useInsertionEffect:function(r,i){oc(4,2,r,i)},useMemo:function(r,i){var l=yn();i=i===void 0?null:i;var d=r();if(ii){xt(!0);try{r()}finally{xt(!1)}}return l.memoizedState=[d,i],d},useReducer:function(r,i,l){var d=yn();if(l!==void 0){var p=l(i);if(ii){xt(!0);try{l(i)}finally{xt(!1)}}}else p=i;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=h2.bind(null,Ze,r),[d.memoizedState,r]},useRef:function(r){var i=yn();return r={current:r},i.memoizedState=r},useState:function(r){r=yf(r);var i=r.queue,l=nb.bind(null,Ze,i);return i.dispatch=l,[r.memoizedState,l]},useDebugValue:wf,useDeferredValue:function(r,i){var l=yn();return Ef(l,r,i)},useTransition:function(){var r=yf(!1);return r=Zy.bind(null,Ze,r.queue,!0,!1),yn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,l){var d=Ze,p=yn();if(ot){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),vt===null)throw Error(a(349));rt&60||Ry(d,i,l)}p.memoizedState=l;var v={value:l,getSnapshot:i};return p.queue=v,Hy(Dy.bind(null,d,v,r),[r]),d.flags|=2048,ro(9,Ay.bind(null,d,v,l,i),{destroy:void 0},null),l},useId:function(){var r=yn(),i=vt.identifierPrefix;if(ot){var l=zr,d=Lr;l=(d&~(1<<32-Lt(d)-1)).toString(32)+l,i=":"+i+"R"+l,l=nc++,0 title"))),Xt(v,d,l),v[en]=r,Ft(v),d=v;break e;case"link":var T=Nx("link","href",p).get(d+(l.href||""));if(T){for(var P=0;P<\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof d.is=="string"?p.createElement("select",{is:d.is}):p.createElement("select"),d.multiple?r.multiple=!0:d.size&&(r.size=d.size);break;default:r=typeof d.is=="string"?p.createElement(l,{is:d.is}):p.createElement(l)}}r[en]=i,r[gn]=d;e:for(p=i.child;p!==null;){if(p.tag===5||p.tag===6)r.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===i)break e;for(;p.sibling===null;){if(p.return===null||p.return===i)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}i.stateNode=r;e:switch(Xt(r,l,d),l){case"button":case"input":case"select":case"textarea":r=!!d.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&$r(i)}}return Et(i),i.flags&=-16777217,null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&$r(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=Le.current,us(i)){if(r=i.stateNode,l=i.memoizedProps,d=null,p=cn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[en]=i,r=!!(r.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||bx(r.nodeValue,l)),r||ni(i)}else r=Rc(r).createTextNode(d),r[en]=i,i.stateNode=r}return Et(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=us(i),d!==null&&d.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[en]=i}else ds(),!(i.flags&128)&&(i.memoizedState=null),i.flags|=4;Et(i),p=!1}else tr!==null&&(sh(tr),tr=null),p=!0;if(!p)return i.flags&256?(Mr(i),i):(Mr(i),null)}if(Mr(i),i.flags&128)return i.lanes=l,i;if(l=d!==null,r=r!==null&&r.memoizedState!==null,l){d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool);var v=null;d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==p&&(d.flags|=2048)}return l!==r&&l&&(i.child.flags|=8192),gc(i,i.updateQueue),Et(i),null;case 4:return J(),r===null&&yh(i.stateNode.containerInfo),Et(i),null;case 10:return Ur(i.type),Et(i),null;case 19:if(Ce(zt),p=i.memoizedState,p===null)return Et(i),null;if(d=(i.flags&128)!==0,v=p.rendering,v===null)if(d)Ns(p,!1);else{if(Rt!==0||r!==null&&r.flags&128)for(r=i.child;r!==null;){if(v=Jl(r),v!==null){for(i.flags|=128,Ns(p,!1),r=v.updateQueue,i.updateQueue=r,gc(i,r),i.subtreeFlags=0,r=l,l=i.child;l!==null;)Yb(l,r),l=l.sibling;return he(zt,zt.current&1|2),i.child}r=r.sibling}p.tail!==null&&me()>vc&&(i.flags|=128,d=!0,Ns(p,!1),i.lanes=4194304)}else{if(!d)if(r=Jl(v),r!==null){if(i.flags|=128,d=!0,r=r.updateQueue,i.updateQueue=r,gc(i,r),Ns(p,!0),p.tail===null&&p.tailMode==="hidden"&&!v.alternate&&!ot)return Et(i),null}else 2*me()-p.renderingStartTime>vc&&l!==536870912&&(i.flags|=128,d=!0,Ns(p,!1),i.lanes=4194304);p.isBackwards?(v.sibling=i.child,i.child=v):(r=p.last,r!==null?r.sibling=v:i.child=v,p.last=v)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=me(),i.sibling=null,r=zt.current,he(zt,d?r&1|2:r&1),i):(Et(i),null);case 22:case 23:return Mr(i),of(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?l&536870912&&!(i.flags&128)&&(Et(i),i.subtreeFlags&6&&(i.flags|=8192)):Et(i),l=i.updateQueue,l!==null&&gc(i,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==l&&(i.flags|=2048),r!==null&&Ce(ai),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Ur(Mt),Et(i),null;case 25:return null}throw Error(a(156,i.tag))}function x2(r,i){switch(tf(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Ur(Mt),J(),r=i.flags,r&65536&&!(r&128)?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return _e(i),null;case 13:if(Mr(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));ds()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return Ce(zt),null;case 4:return J(),null;case 10:return Ur(i.type),null;case 22:case 23:return Mr(i),of(),r!==null&&Ce(ai),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Ur(Mt),null;case 25:return null;default:return null}}function Kb(r,i){switch(tf(i),i.tag){case 3:Ur(Mt),J();break;case 26:case 27:case 5:_e(i);break;case 4:J();break;case 13:Mr(i);break;case 19:Ce(zt);break;case 10:Ur(i.type);break;case 22:case 23:Mr(i),of(),r!==null&&Ce(ai);break;case 24:Ur(Mt)}}var w2={getCacheForType:function(r){var i=tn(Mt),l=i.data.get(r);return l===void 0&&(l=r(),i.data.set(r,l)),l}},E2=typeof WeakMap=="function"?WeakMap:Map,St=0,vt=null,Je=null,rt=0,yt=0,kn=null,Vr=!1,so=!1,eh=!1,qr=0,Rt=0,Ca=0,hi=0,th=0,qn=0,lo=0,Os=null,vr=null,nh=!1,rh=0,vc=1/0,yc=null,Ta=null,bc=!1,pi=null,js=0,ah=0,ih=null,Ls=0,oh=null;function Nn(){if(St&2&&rt!==0)return rt&-rt;if(L.T!==null){var r=Ji;return r!==0?r:ph()}return vv()}function Zb(){qn===0&&(qn=!(rt&536870912)||ot?pt():536870912);var r=In.current;return r!==null&&(r.flags|=32),qn}function un(r,i,l){(r===vt&&yt===2||r.cancelPendingCommit!==null)&&(co(r,0),Yr(r,rt,qn,!1)),pn(r,l),(!(St&2)||r!==vt)&&(r===vt&&(!(St&2)&&(hi|=l),Rt===4&&Yr(r,rt,qn,!1)),yr(r))}function Qb(r,i,l){if(St&6)throw Error(a(327));var d=!l&&(i&60)===0&&(i&r.expiredLanes)===0||qe(r,i),p=d?C2(r,i):uh(r,i,!0),v=d;do{if(p===0){so&&!d&&Yr(r,i,0,!1);break}else if(p===6)Yr(r,i,0,!Vr);else{if(l=r.current.alternate,v&&!S2(l)){p=uh(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var T=0;else T=r.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){i=T;e:{var P=r;p=Os;var V=P.current.memoizedState.isDehydrated;if(V&&(co(P,T).flags|=256),T=uh(P,T,!1),T!==2){if(eh&&!V){P.errorRecoveryDisabledLanes|=v,hi|=v,p=4;break e}v=vr,vr=p,v!==null&&sh(v)}p=T}if(v=!1,p!==2)continue}}if(p===1){co(r,0),Yr(r,i,0,!0);break}e:{switch(d=r,p){case 0:case 1:throw Error(a(345));case 4:if((i&4194176)===i){Yr(d,i,qn,!Vr);break e}break;case 2:vr=null;break;case 3:case 5:break;default:throw Error(a(329))}if(d.finishedWork=l,d.finishedLanes=i,(i&62914560)===i&&(v=rh+300-me(),10l?32:l,L.T=null,pi===null)var v=!1;else{l=ih,ih=null;var T=pi,P=js;if(pi=null,js=0,St&6)throw Error(a(331));var V=St;if(St|=4,Vb(T.current),Ib(T,T.current,P,l),St=V,zs(0,!1),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(Gt,T)}catch{}v=!0}return v}finally{W.p=p,L.T=d,sx(r,i)}}return!1}function lx(r,i,l){i=Fn(l,i),i=Af(r.stateNode,i,2),r=xa(r,i,2),r!==null&&(pn(r,2),yr(r))}function mt(r,i,l){if(r.tag===3)lx(r,r,l);else for(;i!==null;){if(i.tag===3){lx(i,r,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ta===null||!Ta.has(d))){r=Fn(l,r),l=db(2),d=xa(i,l,2),d!==null&&(fb(l,d,i,r),pn(d,2),yr(d));break}}i=i.return}}function dh(r,i,l){var d=r.pingCache;if(d===null){d=r.pingCache=new E2;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(l)||(eh=!0,p.add(l),r=A2.bind(null,r,i,l),i.then(r,r))}function A2(r,i,l){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,vt===r&&(rt&l)===l&&(Rt===4||Rt===3&&(rt&62914560)===rt&&300>me()-rh?!(St&2)&&co(r,0):th|=l,lo===rt&&(lo=0)),yr(r)}function cx(r,i){i===0&&(i=hn()),r=fa(r,i),r!==null&&(pn(r,i),yr(r))}function D2(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),cx(r,l)}function k2(r,i){var l=0;switch(r.tag){case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(l=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),cx(r,l)}function N2(r,i){return Ee(r,i)}var Ec=null,ho=null,fh=!1,Sc=!1,hh=!1,mi=0;function yr(r){r!==ho&&r.next===null&&(ho===null?Ec=ho=r:ho=ho.next=r),Sc=!0,fh||(fh=!0,j2(O2))}function zs(r,i){if(!hh&&Sc){hh=!0;do for(var l=!1,d=Ec;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var T=d.suspendedLanes,P=d.pingedLanes;v=(1<<31-Lt(42|r)+1)-1,v&=p&~(T&~P),v=v&201326677?v&201326677|1:v?v|2:0}v!==0&&(l=!0,fx(d,v))}else v=rt,v=zi(d,d===vt?v:0),!(v&3)||qe(d,v)||(l=!0,fx(d,v));d=d.next}while(l);hh=!1}}function O2(){Sc=fh=!1;var r=0;mi!==0&&(B2()&&(r=mi),mi=0);for(var i=me(),l=null,d=Ec;d!==null;){var p=d.next,v=ux(d,i);v===0?(d.next=null,l===null?Ec=p:l.next=p,p===null&&(ho=l)):(l=d,(r!==0||v&3)&&(Sc=!0)),d=p}zs(r)}function ux(r,i){for(var l=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0"u"?null:document;function Rx(r,i,l){var d=mo;if(d&&typeof i=="string"&&i){var p=Pn(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),Tx.has(p)||(Tx.add(p),r={rel:r,crossOrigin:l,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),Xt(i,"link",r),Ft(i),d.head.appendChild(i)))}}function X2(r){Wr.D(r),Rx("dns-prefetch",r,null)}function K2(r,i){Wr.C(r,i),Rx("preconnect",r,i)}function Z2(r,i,l){Wr.L(r,i,l);var d=mo;if(d&&r&&i){var p='link[rel="preload"][as="'+Pn(i)+'"]';i==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Pn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Pn(l.imageSizes)+'"]')):p+='[href="'+Pn(r)+'"]';var v=p;switch(i){case"style":v=go(r);break;case"script":v=vo(r)}Yn.has(v)||(r=I({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:r,as:i},l),Yn.set(v,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(Gs(v))||i==="script"&&d.querySelector(Fs(v))||(i=d.createElement("link"),Xt(i,"link",r),Ft(i),d.head.appendChild(i)))}}function Q2(r,i){Wr.m(r,i);var l=mo;if(l&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+Pn(d)+'"][href="'+Pn(r)+'"]',v=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=vo(r)}if(!Yn.has(v)&&(r=I({rel:"modulepreload",href:r},i),Yn.set(v,r),l.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Fs(v)))return}d=l.createElement("link"),Xt(d,"link",r),Ft(d),l.head.appendChild(d)}}}function J2(r,i,l){Wr.S(r,i,l);var d=mo;if(d&&r){var p=Gi(d).hoistableStyles,v=go(r);i=i||"default";var T=p.get(v);if(!T){var P={loading:0,preload:null};if(T=d.querySelector(Gs(v)))P.loading=5;else{r=I({rel:"stylesheet",href:r,"data-precedence":i},l),(l=Yn.get(v))&&Rh(r,l);var V=T=d.createElement("link");Ft(V),Xt(V,"link",r),V._p=new Promise(function(Q,fe){V.onload=Q,V.onerror=fe}),V.addEventListener("load",function(){P.loading|=1}),V.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Dc(T,i,d)}T={type:"stylesheet",instance:T,count:1,state:P},p.set(v,T)}}}function eD(r,i){Wr.X(r,i);var l=mo;if(l&&r){var d=Gi(l).hoistableScripts,p=vo(r),v=d.get(p);v||(v=l.querySelector(Fs(p)),v||(r=I({src:r,async:!0},i),(i=Yn.get(p))&&Ah(r,i),v=l.createElement("script"),Ft(v),Xt(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function tD(r,i){Wr.M(r,i);var l=mo;if(l&&r){var d=Gi(l).hoistableScripts,p=vo(r),v=d.get(p);v||(v=l.querySelector(Fs(p)),v||(r=I({src:r,async:!0,type:"module"},i),(i=Yn.get(p))&&Ah(r,i),v=l.createElement("script"),Ft(v),Xt(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function Ax(r,i,l,d){var p=(p=Le.current)?Ac(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=go(l.href),l=Gi(p).hoistableStyles,d=l.get(i),d||(d={type:"style",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=go(l.href);var v=Gi(p).hoistableStyles,T=v.get(r);if(T||(p=p.ownerDocument||p,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,T),(v=p.querySelector(Gs(r)))&&!v._p&&(T.instance=v,T.state.loading=5),Yn.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Yn.set(r,l),v||nD(p,r,l,T.state))),i&&d===null)throw Error(a(528,""));return T}if(i&&d!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=vo(l),l=Gi(p).hoistableScripts,d=l.get(i),d||(d={type:"script",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function go(r){return'href="'+Pn(r)+'"'}function Gs(r){return'link[rel="stylesheet"]['+r+"]"}function Dx(r){return I({},r,{"data-precedence":r.precedence,precedence:null})}function nD(r,i,l,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),Xt(i,"link",l),Ft(i),r.head.appendChild(i))}function vo(r){return'[src="'+Pn(r)+'"]'}function Fs(r){return"script[async]"+r}function kx(r,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+Pn(l.href)+'"]');if(d)return i.instance=d,Ft(d),d;var p=I({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),Ft(d),Xt(d,"style",p),Dc(d,l.precedence,r),i.instance=d;case"stylesheet":p=go(l.href);var v=r.querySelector(Gs(p));if(v)return i.state.loading|=4,i.instance=v,Ft(v),v;d=Dx(l),(p=Yn.get(p))&&Rh(d,p),v=(r.ownerDocument||r).createElement("link"),Ft(v);var T=v;return T._p=new Promise(function(P,V){T.onload=P,T.onerror=V}),Xt(v,"link",d),i.state.loading|=4,Dc(v,l.precedence,r),i.instance=v;case"script":return v=vo(l.src),(p=r.querySelector(Fs(v)))?(i.instance=p,Ft(p),p):(d=l,(p=Yn.get(v))&&(d=I({},l),Ah(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),Ft(p),Xt(p,"link",d),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&!(i.state.loading&4)&&(d=i.instance,i.state.loading|=4,Dc(d,l.precedence,r));return i.instance}function Dc(r,i,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,v=p,T=0;T title"):null)}function rD(r,i,l){if(l===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return r=i.disabled,typeof i.precedence=="string"&&r==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function jx(r){return!(r.type==="stylesheet"&&!(r.state.loading&3))}var Us=null;function aD(){}function iD(r,i,l){if(Us===null)throw Error(a(475));var d=Us;if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&!(i.state.loading&4)){if(i.instance===null){var p=go(l.href),v=r.querySelector(Gs(p));if(v){r=v._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(d.count++,d=Nc.bind(d),r.then(d,d)),i.state.loading|=4,i.instance=v,Ft(v);return}v=r.ownerDocument||r,l=Dx(l),(p=Yn.get(p))&&Rh(l,p),v=v.createElement("link"),Ft(v);var T=v;T._p=new Promise(function(P,V){T.onload=P,T.onerror=V}),Xt(v,"link",l),i.instance=v}d.stylesheets===null&&(d.stylesheets=new Map),d.stylesheets.set(i,r),(r=i.state.preload)&&!(i.state.loading&3)&&(d.count++,i=Nc.bind(d),r.addEventListener("load",i),r.addEventListener("error",i))}}function oD(){if(Us===null)throw Error(a(475));var r=Us;return r.stylesheets&&r.count===0&&Dh(r,r.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Gh.exports=RD(),Gh.exports}var DD=AD();const t0=e=>{let t;const n=new Set,a=(h,m)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const y=t;t=m??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,y))}},o=()=>t,u={setState:a,getState:o,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h))},f=t=e(a,o,u);return u},kD=e=>e?t0(e):t0,ND=e=>e;function OD(e,t=ND){const n=ve.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return ve.useDebugValue(n),n}const jD=e=>{const t=kD(e),n=a=>OD(t,a);return Object.assign(n,t),n},Qm=e=>jD;function W1(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var s;const c=f=>f===null?null:JSON.parse(f,void 0),u=(s=n.getItem(o))!=null?s:null;return u instanceof Promise?u.then(c):c(u)},setItem:(o,s)=>n.setItem(o,JSON.stringify(s,void 0)),removeItem:o=>n.removeItem(o)}}const em=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(a){return em(a)(n)},catch(a){return this}}}catch(n){return{then(a){return this},catch(a){return em(a)(n)}}}},LD=(e,t)=>(n,a,o)=>{let s={storage:W1(()=>localStorage),partialize:E=>E,version:0,merge:(E,_)=>({..._,...E}),...t},c=!1;const u=new Set,f=new Set;let h=s.storage;if(!h)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...E)},a,o);const m=()=>{const E=s.partialize({...a()});return h.setItem(s.name,{state:E,version:s.version})},g=o.setState;o.setState=(E,_)=>{g(E,_),m()};const y=e((...E)=>{n(...E),m()},a,o);o.getInitialState=()=>y;let b;const S=()=>{var E,_;if(!h)return;c=!1,u.forEach(C=>{var A;return C((A=a())!=null?A:y)});const N=((_=s.onRehydrateStorage)==null?void 0:_.call(s,(E=a())!=null?E:y))||void 0;return em(h.getItem.bind(h))(s.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==s.version){if(s.migrate){const A=s.migrate(C.state,C.version);return A instanceof Promise?A.then(k=>[!0,k]):[!0,A]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,C.state];return[!1,void 0]}).then(C=>{var A;const[k,D]=C;if(b=s.merge(D,(A=a())!=null?A:y),n(b,!0),k)return m()}).then(()=>{N==null||N(b,void 0),b=a(),c=!0,f.forEach(C=>C(b))}).catch(C=>{N==null||N(void 0,C)})};return o.persist={setOptions:E=>{s={...s,...E},E.storage&&(h=E.storage)},clearStorage:()=>{h==null||h.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>S(),hasHydrated:()=>c,onHydrate:E=>(u.add(E),()=>{u.delete(E)}),onFinishHydration:E=>(f.add(E),()=>{f.delete(E)})},s.skipHydration||S(),b||y},zD=LD;function X1(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t{const t=GD(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{const u=c.split(Jm);return u[0]===""&&u.length!==1&&u.shift(),Z1(u,t)||PD(c)},getConflictingClassGroupIds:(c,u)=>{const f=n[c]||[];return u&&a[c]?[...f,...a[c]]:f}}},Z1=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],a=t.nextPart.get(n),o=a?Z1(e.slice(1),a):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Jm);return(c=t.validators.find(({validator:u})=>u(s)))==null?void 0:c.classGroupId},n0=/^\[(.+)\]$/,PD=e=>{if(n0.test(e)){const t=n0.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},GD=e=>{const{theme:t,classGroups:n}=e,a={nextPart:new Map,validators:[]};for(const o in n)tm(n[o],a,o,t);return a},tm=(e,t,n,a)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:r0(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(FD(o)){tm(o(a),t,n,a);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,c])=>{tm(c,r0(t,s),n,a)})})},r0=(e,t)=>{let n=e;return t.split(Jm).forEach(a=>{n.nextPart.has(a)||n.nextPart.set(a,{nextPart:new Map,validators:[]}),n=n.nextPart.get(a)}),n},FD=e=>e.isThemeGetter,UD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,a=new Map;const o=(s,c)=>{n.set(s,c),t++,t>e&&(t=0,a=n,n=new Map)};return{get(s){let c=n.get(s);if(c!==void 0)return c;if((c=a.get(s))!==void 0)return o(s,c),c},set(s,c){n.has(s)?n.set(s,c):o(s,c)}}},nm="!",rm=":",BD=rm.length,ID=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=o=>{const s=[];let c=0,u=0,f=0,h;for(let S=0;Sf?h-f:void 0;return{modifiers:s,hasImportantModifier:y,baseClassName:g,maybePostfixModifierPosition:b}};if(t){const o=t+rm,s=a;a=c=>c.startsWith(o)?s(c.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:c,maybePostfixModifierPosition:void 0}}if(n){const o=a;a=s=>n({className:s,parseClassName:o})}return a},HD=e=>e.endsWith(nm)?e.substring(0,e.length-1):e.startsWith(nm)?e.substring(1):e,$D=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(a=>[a,!0]));return a=>{if(a.length<=1)return a;const o=[];let s=[];return a.forEach(c=>{c[0]==="["||t[c]?(o.push(...s.sort(),c),s=[]):s.push(c)}),o.push(...s.sort()),o}},VD=e=>({cache:UD(e.cacheSize),parseClassName:ID(e),sortModifiers:$D(e),...MD(e)}),qD=/\s+/,YD=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:s}=t,c=[],u=e.trim().split(qD);let f="";for(let h=u.length-1;h>=0;h-=1){const m=u[h],{isExternal:g,modifiers:y,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:E}=n(m);if(g){f=m+(f.length>0?" "+f:f);continue}let _=!!E,N=a(_?S.substring(0,E):S);if(!N){if(!_){f=m+(f.length>0?" "+f:f);continue}if(N=a(S),!N){f=m+(f.length>0?" "+f:f);continue}_=!1}const C=s(y).join(":"),A=b?C+nm:C,k=A+N;if(c.includes(k))continue;c.push(k);const D=o(N,_);for(let M=0;M0?" "+f:f)}return f};function WD(){let e=0,t,n,a="";for(;e{if(typeof e=="string")return e;let t,n="";for(let a=0;ag(m),e());return n=VD(h),a=n.cache.get,o=n.cache.set,s=u,u(f)}function u(f){const h=a(f);if(h)return h;const m=YD(f,n);return o(f,m),m}return function(){return s(WD.apply(null,arguments))}}const Ht=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},J1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,eE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,KD=/^\d+\/\d+$/,ZD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,JD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ek=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yo=e=>KD.test(e),et=e=>!!e&&!Number.isNaN(Number(e)),gi=e=>!!e&&Number.isInteger(Number(e)),a0=e=>e.endsWith("%")&&et(e.slice(0,-1)),Oa=e=>ZD.test(e),nk=()=>!0,rk=e=>QD.test(e)&&!JD.test(e),eg=()=>!1,ak=e=>ek.test(e),ik=e=>tk.test(e),ok=e=>!ke(e)&&!Ne(e),sk=e=>Fo(e,rE,eg),ke=e=>J1.test(e),vi=e=>Fo(e,aE,rk),Ih=e=>Fo(e,yk,et),lk=e=>Fo(e,tE,eg),ck=e=>Fo(e,nE,ik),uk=e=>Fo(e,eg,ak),Ne=e=>eE.test(e),Uc=e=>Uo(e,aE),dk=e=>Uo(e,bk),fk=e=>Uo(e,tE),hk=e=>Uo(e,rE),pk=e=>Uo(e,nE),mk=e=>Uo(e,xk,!0),Fo=(e,t,n)=>{const a=J1.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Uo=(e,t,n=!1)=>{const a=eE.exec(e);return a?a[1]?t(a[1]):n:!1},tE=e=>e==="position",gk=new Set(["image","url"]),nE=e=>gk.has(e),vk=new Set(["length","size","percentage"]),rE=e=>vk.has(e),aE=e=>e==="length",yk=e=>e==="number",bk=e=>e==="family-name",xk=e=>e==="shadow",wk=()=>{const e=Ht("color"),t=Ht("font"),n=Ht("text"),a=Ht("font-weight"),o=Ht("tracking"),s=Ht("leading"),c=Ht("breakpoint"),u=Ht("container"),f=Ht("spacing"),h=Ht("radius"),m=Ht("shadow"),g=Ht("inset-shadow"),y=Ht("drop-shadow"),b=Ht("blur"),S=Ht("perspective"),E=Ht("aspect"),_=Ht("ease"),N=Ht("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],M=()=>[yo,"px","full","auto",Ne,ke,f],R=()=>[gi,"none","subgrid",Ne,ke],U=()=>["auto",{span:["full",gi,Ne,ke]},Ne,ke],L=()=>[gi,"auto",Ne,ke],I=()=>["auto","min","max","fr",Ne,ke],q=()=>[Ne,ke,f],Y=()=>["start","end","center","between","around","evenly","stretch","baseline"],B=()=>["start","end","center","stretch"],X=()=>[Ne,ke,f],ne=()=>["px",...X()],F=()=>["px","auto",...X()],z=()=>[yo,"auto","px","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",Ne,ke,f],j=()=>[e,Ne,ke],K=()=>[a0,vi],G=()=>["","none","full",h,Ne,ke],H=()=>["",et,Uc,vi],O=()=>["solid","dashed","dotted","double"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>["","none",b,Ne,ke],re=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ne,ke],de=()=>["none",et,Ne,ke],ie=()=>["none",et,Ne,ke],oe=()=>[et,Ne,ke],Ce=()=>[yo,"full","px",Ne,ke,f];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Oa],breakpoint:[Oa],color:[nk],container:[Oa],"drop-shadow":[Oa],ease:["in","out","in-out"],font:[ok],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Oa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Oa],shadow:[Oa],spacing:[et],text:[Oa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yo,ke,Ne,E]}],container:["container"],columns:[{columns:[et,ke,Ne,u]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...A(),ke,Ne]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{start:M()}],end:[{end:M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[gi,"auto",Ne,ke]}],basis:[{basis:[yo,"full","auto",Ne,ke,u,f]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[et,yo,"auto","initial","none",ke]}],grow:[{grow:["",et,Ne,ke]}],shrink:[{shrink:["",et,Ne,ke]}],order:[{order:[gi,"first","last","none",Ne,ke]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:q()}],"gap-x":[{"gap-x":q()}],"gap-y":[{"gap-y":q()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...B(),"baseline"]}],"align-self":[{self:["auto",...B(),"baseline"]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:ne()}],px:[{px:ne()}],py:[{py:ne()}],ps:[{ps:ne()}],pe:[{pe:ne()}],pt:[{pt:ne()}],pr:[{pr:ne()}],pb:[{pb:ne()}],pl:[{pl:ne()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":X()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":X()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[u,"screen",...z()]}],"min-w":[{"min-w":[u,"screen","none",...z()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...z()]}],h:[{h:["screen",...z()]}],"min-h":[{"min-h":["screen","none",...z()]}],"max-h":[{"max-h":["screen",...z()]}],"font-size":[{text:["base",n,Uc,vi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Ne,Ih]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",a0,ke]}],"font-family":[{font:[dk,ke,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Ne,ke]}],"line-clamp":[{"line-clamp":[et,"none",Ne,Ih]}],leading:[{leading:[Ne,ke,s,f]}],"list-image":[{"list-image":["none",Ne,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ne,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:[et,"from-font","auto",Ne,vi]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[et,"auto",Ne,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:["px",...X()]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ne,ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ne,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),fk,lk]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",hk,sk]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gi,Ne,ke],radial:["",Ne,ke],conic:[gi,Ne,ke]},pk,ck]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":H()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...O(),"hidden","none"]}],"divide-style":[{divide:[...O(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...O(),"none","hidden"]}],"outline-offset":[{"outline-offset":[et,Ne,ke]}],"outline-w":[{outline:["",et,Uc,vi]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",m,mk,uk]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",Ne,ke,g]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[et,vi]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":j()}],opacity:[{opacity:[et,Ne,ke]}],"mix-blend":[{"mix-blend":[...$(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none",Ne,ke]}],blur:[{blur:W()}],brightness:[{brightness:[et,Ne,ke]}],contrast:[{contrast:[et,Ne,ke]}],"drop-shadow":[{"drop-shadow":["","none",y,Ne,ke]}],grayscale:[{grayscale:["",et,Ne,ke]}],"hue-rotate":[{"hue-rotate":[et,Ne,ke]}],invert:[{invert:["",et,Ne,ke]}],saturate:[{saturate:[et,Ne,ke]}],sepia:[{sepia:["",et,Ne,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ne,ke]}],"backdrop-blur":[{"backdrop-blur":W()}],"backdrop-brightness":[{"backdrop-brightness":[et,Ne,ke]}],"backdrop-contrast":[{"backdrop-contrast":[et,Ne,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",et,Ne,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[et,Ne,ke]}],"backdrop-invert":[{"backdrop-invert":["",et,Ne,ke]}],"backdrop-opacity":[{"backdrop-opacity":[et,Ne,ke]}],"backdrop-saturate":[{"backdrop-saturate":[et,Ne,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",et,Ne,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":X()}],"border-spacing-x":[{"border-spacing-x":X()}],"border-spacing-y":[{"border-spacing-y":X()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ne,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[et,"initial",Ne,ke]}],ease:[{ease:["linear","initial",_,Ne,ke]}],delay:[{delay:[et,Ne,ke]}],animate:[{animate:["none",N,Ne,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ne,ke]}],"perspective-origin":[{"perspective-origin":re()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[Ne,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:re()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ce()}],"translate-x":[{"translate-x":Ce()}],"translate-y":[{"translate-y":Ce()}],"translate-z":[{"translate-z":Ce()}],"translate-none":["translate-none"],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ne,ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":X()}],"scroll-mx":[{"scroll-mx":X()}],"scroll-my":[{"scroll-my":X()}],"scroll-ms":[{"scroll-ms":X()}],"scroll-me":[{"scroll-me":X()}],"scroll-mt":[{"scroll-mt":X()}],"scroll-mr":[{"scroll-mr":X()}],"scroll-mb":[{"scroll-mb":X()}],"scroll-ml":[{"scroll-ml":X()}],"scroll-p":[{"scroll-p":X()}],"scroll-px":[{"scroll-px":X()}],"scroll-py":[{"scroll-py":X()}],"scroll-ps":[{"scroll-ps":X()}],"scroll-pe":[{"scroll-pe":X()}],"scroll-pt":[{"scroll-pt":X()}],"scroll-pr":[{"scroll-pr":X()}],"scroll-pb":[{"scroll-pb":X()}],"scroll-pl":[{"scroll-pl":X()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ne,ke]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[et,Uc,vi,Ih]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}},Ek=XD(wk);function Oe(...e){return Ek(K1(e))}function Sk(){const e="0123456789abcdef";let t="#";for(let n=0;n<6;n++)t+=e.charAt(Math.floor(Math.random()*16));return t}function Sr(e){return e instanceof Error?e.message:`${e}`}const tg=e=>{const t=e;t.use={};for(const n of Object.keys(t.getState()))t.use[n]=()=>t(a=>a[n]);return t},iE="",_r="ghost",_k="#B2EBF2",Ck="#000",Tk="#E2E2E2",Rk="#EEEEEE",Ak="#F57F17",Dk="#969696",kk="#F57F17",i0="#B2EBF2",Hh=20,o0=4,Nk=20,Ok=15,s0="*",jk={"text/plain":[".txt",".md"],"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"]},l0={name:"LightRAG",github:"https://github.com/HKUDS/LightRAG"},Lk=Qm()(zD(e=>({theme:"system",showPropertyPanel:!0,showNodeSearchBar:!0,showNodeLabel:!0,enableNodeDrag:!0,showEdgeLabel:!1,enableHideUnselectedEdges:!0,enableEdgeEvents:!1,queryLabel:s0,enableHealthCheck:!0,apiKey:null,currentTab:"documents",retrievalHistory:[],querySettings:{mode:"global",response_type:"Multiple Paragraphs",top_k:10,max_token_for_text_unit:4e3,max_token_for_global_context:4e3,max_token_for_local_context:4e3,only_need_context:!1,only_need_prompt:!1,stream:!0,history_turns:3,hl_keywords:[],ll_keywords:[]},setTheme:t=>e({theme:t}),setQueryLabel:t=>e({queryLabel:t}),setEnableHealthCheck:t=>e({enableHealthCheck:t}),setApiKey:t=>e({apiKey:t}),setCurrentTab:t=>e({currentTab:t}),setRetrievalHistory:t=>e({retrievalHistory:t}),updateQuerySettings:t=>e(n=>({querySettings:{...n.querySettings,...t}}))}),{name:"settings-storage",storage:W1(()=>localStorage),version:6,migrate:(e,t)=>(t<2&&(e.showEdgeLabel=!1),t<3&&(e.queryLabel=s0),t<4&&(e.showPropertyPanel=!0,e.showNodeSearchBar=!0,e.showNodeLabel=!0,e.enableHealthCheck=!0,e.apiKey=null),t<5&&(e.currentTab="documents"),t<6&&(e.querySettings={mode:"global",response_type:"Multiple Paragraphs",top_k:10,max_token_for_text_unit:4e3,max_token_for_global_context:4e3,max_token_for_local_context:4e3,only_need_context:!1,only_need_prompt:!1,stream:!0,history_turns:3,hl_keywords:[],ll_keywords:[]},e.retrievalHistory=[]),e)})),Ye=tg(Lk),zk={theme:"system",setTheme:()=>null},oE=w.createContext(zk);function Mk({children:e,...t}){const[n,a]=w.useState(Ye.getState().theme);w.useEffect(()=>{const s=window.document.documentElement;if(s.classList.remove("light","dark"),n==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";s.classList.add(c),a(c);return}s.classList.add(n)},[n]);const o={theme:n,setTheme:s=>{Ye.getState().setTheme(s),a(s)}};return x.jsx(oE.Provider,{...t,value:o,children:e})}const c0=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,u0=K1,sE=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return u0(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,c=Object.keys(o).map(h=>{const m=n==null?void 0:n[h],g=s==null?void 0:s[h];if(m===null)return null;const y=c0(m)||c0(g);return o[h][y]}),u=n&&Object.entries(n).reduce((h,m)=>{let[g,y]=m;return y===void 0||(h[g]=y),h},{}),f=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,m)=>{let{class:g,className:y,...b}=m;return Object.entries(b).every(S=>{let[E,_]=S;return Array.isArray(_)?_.includes({...s,...u}[E]):{...s,...u}[E]===_})?[...h,g,y]:h},[]);return u0(e,c,f,n==null?void 0:n.class,n==null?void 0:n.className)},Pk=sE("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),lE=w.forwardRef(({className:e,variant:t,...n},a)=>x.jsx("div",{ref:a,role:"alert",className:Oe(Pk({variant:t}),e),...n}));lE.displayName="Alert";const cE=w.forwardRef(({className:e,...t},n)=>x.jsx("h5",{ref:n,className:Oe("mb-1 leading-none font-medium tracking-tight",e),...t}));cE.displayName="AlertTitle";const uE=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("text-sm [&_p]:leading-relaxed",e),...t}));uE.displayName="AlertDescription";function dE(e,t){return function(){return e.apply(t,arguments)}}const{toString:Gk}=Object.prototype,{getPrototypeOf:ng}=Object,Wu=(e=>t=>{const n=Gk.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),dr=e=>(e=e.toLowerCase(),t=>Wu(t)===e),Xu=e=>t=>typeof t===e,{isArray:Bo}=Array,ll=Xu("undefined");function Fk(e){return e!==null&&!ll(e)&&e.constructor!==null&&!ll(e.constructor)&&jn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const fE=dr("ArrayBuffer");function Uk(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&fE(e.buffer),t}const Bk=Xu("string"),jn=Xu("function"),hE=Xu("number"),Ku=e=>e!==null&&typeof e=="object",Ik=e=>e===!0||e===!1,cu=e=>{if(Wu(e)!=="object")return!1;const t=ng(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Hk=dr("Date"),$k=dr("File"),Vk=dr("Blob"),qk=dr("FileList"),Yk=e=>Ku(e)&&jn(e.pipe),Wk=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||jn(e.append)&&((t=Wu(e))==="formdata"||t==="object"&&jn(e.toString)&&e.toString()==="[object FormData]"))},Xk=dr("URLSearchParams"),[Kk,Zk,Qk,Jk]=["ReadableStream","Request","Response","Headers"].map(dr),eN=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function yl(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let a,o;if(typeof e!="object"&&(e=[e]),Bo(e))for(a=0,o=e.length;a0;)if(o=n[a],t===o.toLowerCase())return o;return null}const Si=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,mE=e=>!ll(e)&&e!==Si;function am(){const{caseless:e}=mE(this)&&this||{},t={},n=(a,o)=>{const s=e&&pE(t,o)||o;cu(t[s])&&cu(a)?t[s]=am(t[s],a):cu(a)?t[s]=am({},a):Bo(a)?t[s]=a.slice():t[s]=a};for(let a=0,o=arguments.length;a(yl(t,(o,s)=>{n&&jn(o)?e[s]=dE(o,n):e[s]=o},{allOwnKeys:a}),e),nN=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),rN=(e,t,n,a)=>{e.prototype=Object.create(t.prototype,a),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},aN=(e,t,n,a)=>{let o,s,c;const u={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)c=o[s],(!a||a(c,e,t))&&!u[c]&&(t[c]=e[c],u[c]=!0);e=n!==!1&&ng(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},iN=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const a=e.indexOf(t,n);return a!==-1&&a===n},oN=e=>{if(!e)return null;if(Bo(e))return e;let t=e.length;if(!hE(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},sN=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ng(Uint8Array)),lN=(e,t)=>{const a=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=a.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},cN=(e,t)=>{let n;const a=[];for(;(n=e.exec(t))!==null;)a.push(n);return a},uN=dr("HTMLFormElement"),dN=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,a,o){return a.toUpperCase()+o}),d0=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),fN=dr("RegExp"),gE=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),a={};yl(n,(o,s)=>{let c;(c=t(o,s,e))!==!1&&(a[s]=c||o)}),Object.defineProperties(e,a)},hN=e=>{gE(e,(t,n)=>{if(jn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const a=e[n];if(jn(a)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},pN=(e,t)=>{const n={},a=o=>{o.forEach(s=>{n[s]=!0})};return Bo(e)?a(e):a(String(e).split(t)),n},mN=()=>{},gN=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,$h="abcdefghijklmnopqrstuvwxyz",f0="0123456789",vE={DIGIT:f0,ALPHA:$h,ALPHA_DIGIT:$h+$h.toUpperCase()+f0},vN=(e=16,t=vE.ALPHA_DIGIT)=>{let n="";const{length:a}=t;for(;e--;)n+=t[Math.random()*a|0];return n};function yN(e){return!!(e&&jn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const bN=e=>{const t=new Array(10),n=(a,o)=>{if(Ku(a)){if(t.indexOf(a)>=0)return;if(!("toJSON"in a)){t[o]=a;const s=Bo(a)?[]:{};return yl(a,(c,u)=>{const f=n(c,o+1);!ll(f)&&(s[u]=f)}),t[o]=void 0,s}}return a};return n(e,0)},xN=dr("AsyncFunction"),wN=e=>e&&(Ku(e)||jn(e))&&jn(e.then)&&jn(e.catch),yE=((e,t)=>e?setImmediate:t?((n,a)=>(Si.addEventListener("message",({source:o,data:s})=>{o===Si&&s===n&&a.length&&a.shift()()},!1),o=>{a.push(o),Si.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",jn(Si.postMessage)),EN=typeof queueMicrotask<"u"?queueMicrotask.bind(Si):typeof process<"u"&&process.nextTick||yE,ce={isArray:Bo,isArrayBuffer:fE,isBuffer:Fk,isFormData:Wk,isArrayBufferView:Uk,isString:Bk,isNumber:hE,isBoolean:Ik,isObject:Ku,isPlainObject:cu,isReadableStream:Kk,isRequest:Zk,isResponse:Qk,isHeaders:Jk,isUndefined:ll,isDate:Hk,isFile:$k,isBlob:Vk,isRegExp:fN,isFunction:jn,isStream:Yk,isURLSearchParams:Xk,isTypedArray:sN,isFileList:qk,forEach:yl,merge:am,extend:tN,trim:eN,stripBOM:nN,inherits:rN,toFlatObject:aN,kindOf:Wu,kindOfTest:dr,endsWith:iN,toArray:oN,forEachEntry:lN,matchAll:cN,isHTMLForm:uN,hasOwnProperty:d0,hasOwnProp:d0,reduceDescriptors:gE,freezeMethods:hN,toObjectSet:pN,toCamelCase:dN,noop:mN,toFiniteNumber:gN,findKey:pE,global:Si,isContextDefined:mE,ALPHABET:vE,generateString:vN,isSpecCompliantForm:yN,toJSONObject:bN,isAsyncFn:xN,isThenable:wN,setImmediate:yE,asap:EN};function Xe(e,t,n,a,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),a&&(this.request=a),o&&(this.response=o,this.status=o.status?o.status:null)}ce.inherits(Xe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ce.toJSONObject(this.config),code:this.code,status:this.status}}});const bE=Xe.prototype,xE={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{xE[e]={value:e}});Object.defineProperties(Xe,xE);Object.defineProperty(bE,"isAxiosError",{value:!0});Xe.from=(e,t,n,a,o,s)=>{const c=Object.create(bE);return ce.toFlatObject(e,c,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),Xe.call(c,e.message,t,n,a,o),c.cause=e,c.name=e.name,s&&Object.assign(c,s),c};const SN=null;function im(e){return ce.isPlainObject(e)||ce.isArray(e)}function wE(e){return ce.endsWith(e,"[]")?e.slice(0,-2):e}function h0(e,t,n){return e?e.concat(t).map(function(o,s){return o=wE(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function _N(e){return ce.isArray(e)&&!e.some(im)}const CN=ce.toFlatObject(ce,{},null,function(t){return/^is[A-Z]/.test(t)});function Zu(e,t,n){if(!ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ce.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,_){return!ce.isUndefined(_[E])});const a=n.metaTokens,o=n.visitor||m,s=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(t);if(!ce.isFunction(o))throw new TypeError("visitor must be a function");function h(S){if(S===null)return"";if(ce.isDate(S))return S.toISOString();if(!f&&ce.isBlob(S))throw new Xe("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(S)||ce.isTypedArray(S)?f&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function m(S,E,_){let N=S;if(S&&!_&&typeof S=="object"){if(ce.endsWith(E,"{}"))E=a?E:E.slice(0,-2),S=JSON.stringify(S);else if(ce.isArray(S)&&_N(S)||(ce.isFileList(S)||ce.endsWith(E,"[]"))&&(N=ce.toArray(S)))return E=wE(E),N.forEach(function(A,k){!(ce.isUndefined(A)||A===null)&&t.append(c===!0?h0([E],k,s):c===null?E:E+"[]",h(A))}),!1}return im(S)?!0:(t.append(h0(_,E,s),h(S)),!1)}const g=[],y=Object.assign(CN,{defaultVisitor:m,convertValue:h,isVisitable:im});function b(S,E){if(!ce.isUndefined(S)){if(g.indexOf(S)!==-1)throw Error("Circular reference detected in "+E.join("."));g.push(S),ce.forEach(S,function(N,C){(!(ce.isUndefined(N)||N===null)&&o.call(t,N,ce.isString(C)?C.trim():C,E,y))===!0&&b(N,E?E.concat(C):[C])}),g.pop()}}if(!ce.isObject(e))throw new TypeError("data must be an object");return b(e),t}function p0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(a){return t[a]})}function rg(e,t){this._pairs=[],e&&Zu(e,this,t)}const EE=rg.prototype;EE.append=function(t,n){this._pairs.push([t,n])};EE.toString=function(t){const n=t?function(a){return t.call(this,a,p0)}:p0;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function TN(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function SE(e,t,n){if(!t)return e;const a=n&&n.encode||TN;ce.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(t,n):s=ce.isURLSearchParams(t)?t.toString():new rg(t,n).toString(a),s){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class m0{constructor(){this.handlers=[]}use(t,n,a){return this.handlers.push({fulfilled:t,rejected:n,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ce.forEach(this.handlers,function(a){a!==null&&t(a)})}}const _E={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},RN=typeof URLSearchParams<"u"?URLSearchParams:rg,AN=typeof FormData<"u"?FormData:null,DN=typeof Blob<"u"?Blob:null,kN={isBrowser:!0,classes:{URLSearchParams:RN,FormData:AN,Blob:DN},protocols:["http","https","file","blob","url","data"]},ag=typeof window<"u"&&typeof document<"u",om=typeof navigator=="object"&&navigator||void 0,NN=ag&&(!om||["ReactNative","NativeScript","NS"].indexOf(om.product)<0),ON=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",jN=ag&&window.location.href||"http://localhost",LN=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ag,hasStandardBrowserEnv:NN,hasStandardBrowserWebWorkerEnv:ON,navigator:om,origin:jN},Symbol.toStringTag,{value:"Module"})),rn={...LN,...kN};function zN(e,t){return Zu(e,new rn.classes.URLSearchParams,Object.assign({visitor:function(n,a,o,s){return rn.isNode&&ce.isBuffer(n)?(this.append(a,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function MN(e){return ce.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function PN(e){const t={},n=Object.keys(e);let a;const o=n.length;let s;for(a=0;a=n.length;return c=!c&&ce.isArray(o)?o.length:c,f?(ce.hasOwnProp(o,c)?o[c]=[o[c],a]:o[c]=a,!u):((!o[c]||!ce.isObject(o[c]))&&(o[c]=[]),t(n,a,o[c],s)&&ce.isArray(o[c])&&(o[c]=PN(o[c])),!u)}if(ce.isFormData(e)&&ce.isFunction(e.entries)){const n={};return ce.forEachEntry(e,(a,o)=>{t(MN(a),o,n,0)}),n}return null}function GN(e,t,n){if(ce.isString(e))try{return(t||JSON.parse)(e),ce.trim(e)}catch(a){if(a.name!=="SyntaxError")throw a}return(n||JSON.stringify)(e)}const bl={transitional:_E,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const a=n.getContentType()||"",o=a.indexOf("application/json")>-1,s=ce.isObject(t);if(s&&ce.isHTMLForm(t)&&(t=new FormData(t)),ce.isFormData(t))return o?JSON.stringify(CE(t)):t;if(ce.isArrayBuffer(t)||ce.isBuffer(t)||ce.isStream(t)||ce.isFile(t)||ce.isBlob(t)||ce.isReadableStream(t))return t;if(ce.isArrayBufferView(t))return t.buffer;if(ce.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(s){if(a.indexOf("application/x-www-form-urlencoded")>-1)return zN(t,this.formSerializer).toString();if((u=ce.isFileList(t))||a.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Zu(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),GN(t)):t}],transformResponse:[function(t){const n=this.transitional||bl.transitional,a=n&&n.forcedJSONParsing,o=this.responseType==="json";if(ce.isResponse(t)||ce.isReadableStream(t))return t;if(t&&ce.isString(t)&&(a&&!this.responseType||o)){const c=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(u){if(c)throw u.name==="SyntaxError"?Xe.from(u,Xe.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:rn.classes.FormData,Blob:rn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],e=>{bl.headers[e]={}});const FN=ce.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),UN=e=>{const t={};let n,a,o;return e&&e.split(` +`).forEach(function(c){o=c.indexOf(":"),n=c.substring(0,o).trim().toLowerCase(),a=c.substring(o+1).trim(),!(!n||t[n]&&FN[n])&&(n==="set-cookie"?t[n]?t[n].push(a):t[n]=[a]:t[n]=t[n]?t[n]+", "+a:a)}),t},g0=Symbol("internals");function Ws(e){return e&&String(e).trim().toLowerCase()}function uu(e){return e===!1||e==null?e:ce.isArray(e)?e.map(uu):String(e)}function BN(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=n.exec(e);)t[a[1]]=a[2];return t}const IN=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Vh(e,t,n,a,o){if(ce.isFunction(a))return a.call(this,t,n);if(o&&(t=n),!!ce.isString(t)){if(ce.isString(a))return t.indexOf(a)!==-1;if(ce.isRegExp(a))return a.test(t)}}function HN(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,a)=>n.toUpperCase()+a)}function $N(e,t){const n=ce.toCamelCase(" "+t);["get","set","has"].forEach(a=>{Object.defineProperty(e,a+n,{value:function(o,s,c){return this[a].call(this,t,o,s,c)},configurable:!0})})}let wn=class{constructor(t){t&&this.set(t)}set(t,n,a){const o=this;function s(u,f,h){const m=Ws(f);if(!m)throw new Error("header name must be a non-empty string");const g=ce.findKey(o,m);(!g||o[g]===void 0||h===!0||h===void 0&&o[g]!==!1)&&(o[g||f]=uu(u))}const c=(u,f)=>ce.forEach(u,(h,m)=>s(h,m,f));if(ce.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(ce.isString(t)&&(t=t.trim())&&!IN(t))c(UN(t),n);else if(ce.isHeaders(t))for(const[u,f]of t.entries())s(f,u,a);else t!=null&&s(n,t,a);return this}get(t,n){if(t=Ws(t),t){const a=ce.findKey(this,t);if(a){const o=this[a];if(!n)return o;if(n===!0)return BN(o);if(ce.isFunction(n))return n.call(this,o,a);if(ce.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Ws(t),t){const a=ce.findKey(this,t);return!!(a&&this[a]!==void 0&&(!n||Vh(this,this[a],a,n)))}return!1}delete(t,n){const a=this;let o=!1;function s(c){if(c=Ws(c),c){const u=ce.findKey(a,c);u&&(!n||Vh(a,a[u],u,n))&&(delete a[u],o=!0)}}return ce.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let a=n.length,o=!1;for(;a--;){const s=n[a];(!t||Vh(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,a={};return ce.forEach(this,(o,s)=>{const c=ce.findKey(a,s);if(c){n[c]=uu(o),delete n[s];return}const u=t?HN(s):String(s).trim();u!==s&&delete n[s],n[u]=uu(o),a[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ce.forEach(this,(a,o)=>{a!=null&&a!==!1&&(n[o]=t&&ce.isArray(a)?a.join(", "):a)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const a=new this(t);return n.forEach(o=>a.set(o)),a}static accessor(t){const a=(this[g0]=this[g0]={accessors:{}}).accessors,o=this.prototype;function s(c){const u=Ws(c);a[u]||($N(o,c),a[u]=!0)}return ce.isArray(t)?t.forEach(s):s(t),this}};wn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(wn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(a){this[n]=a}}});ce.freezeMethods(wn);function qh(e,t){const n=this||bl,a=t||n,o=wn.from(a.headers);let s=a.data;return ce.forEach(e,function(u){s=u.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function TE(e){return!!(e&&e.__CANCEL__)}function Io(e,t,n){Xe.call(this,e??"canceled",Xe.ERR_CANCELED,t,n),this.name="CanceledError"}ce.inherits(Io,Xe,{__CANCEL__:!0});function RE(e,t,n){const a=n.config.validateStatus;!n.status||!a||a(n.status)?e(n):t(new Xe("Request failed with status code "+n.status,[Xe.ERR_BAD_REQUEST,Xe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function VN(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function qN(e,t){e=e||10;const n=new Array(e),a=new Array(e);let o=0,s=0,c;return t=t!==void 0?t:1e3,function(f){const h=Date.now(),m=a[s];c||(c=h),n[o]=f,a[o]=h;let g=s,y=0;for(;g!==o;)y+=n[g++],g=g%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),h-c{n=m,o=null,s&&(clearTimeout(s),s=null),e.apply(null,h)};return[(...h)=>{const m=Date.now(),g=m-n;g>=a?c(h,m):(o=h,s||(s=setTimeout(()=>{s=null,c(o)},a-g)))},()=>o&&c(o)]}const Cu=(e,t,n=3)=>{let a=0;const o=qN(50,250);return YN(s=>{const c=s.loaded,u=s.lengthComputable?s.total:void 0,f=c-a,h=o(f),m=c<=u;a=c;const g={loaded:c,total:u,progress:u?c/u:void 0,bytes:f,rate:h||void 0,estimated:h&&u&&m?(u-c)/h:void 0,event:s,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},v0=(e,t)=>{const n=e!=null;return[a=>t[0]({lengthComputable:n,total:e,loaded:a}),t[1]]},y0=e=>(...t)=>ce.asap(()=>e(...t)),WN=rn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,rn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(rn.origin),rn.navigator&&/(msie|trident)/i.test(rn.navigator.userAgent)):()=>!0,XN=rn.hasStandardBrowserEnv?{write(e,t,n,a,o,s){const c=[e+"="+encodeURIComponent(t)];ce.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),ce.isString(a)&&c.push("path="+a),ce.isString(o)&&c.push("domain="+o),s===!0&&c.push("secure"),document.cookie=c.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function KN(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ZN(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function AE(e,t){return e&&!KN(t)?ZN(e,t):t}const b0=e=>e instanceof wn?{...e}:e;function Ci(e,t){t=t||{};const n={};function a(h,m,g,y){return ce.isPlainObject(h)&&ce.isPlainObject(m)?ce.merge.call({caseless:y},h,m):ce.isPlainObject(m)?ce.merge({},m):ce.isArray(m)?m.slice():m}function o(h,m,g,y){if(ce.isUndefined(m)){if(!ce.isUndefined(h))return a(void 0,h,g,y)}else return a(h,m,g,y)}function s(h,m){if(!ce.isUndefined(m))return a(void 0,m)}function c(h,m){if(ce.isUndefined(m)){if(!ce.isUndefined(h))return a(void 0,h)}else return a(void 0,m)}function u(h,m,g){if(g in t)return a(h,m);if(g in e)return a(void 0,h)}const f={url:s,method:s,data:s,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:u,headers:(h,m,g)=>o(b0(h),b0(m),g,!0)};return ce.forEach(Object.keys(Object.assign({},e,t)),function(m){const g=f[m]||o,y=g(e[m],t[m],m);ce.isUndefined(y)&&g!==u||(n[m]=y)}),n}const DE=e=>{const t=Ci({},e);let{data:n,withXSRFToken:a,xsrfHeaderName:o,xsrfCookieName:s,headers:c,auth:u}=t;t.headers=c=wn.from(c),t.url=SE(AE(t.baseURL,t.url),e.params,e.paramsSerializer),u&&c.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(ce.isFormData(n)){if(rn.hasStandardBrowserEnv||rn.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if((f=c.getContentType())!==!1){const[h,...m]=f?f.split(";").map(g=>g.trim()).filter(Boolean):[];c.setContentType([h||"multipart/form-data",...m].join("; "))}}if(rn.hasStandardBrowserEnv&&(a&&ce.isFunction(a)&&(a=a(t)),a||a!==!1&&WN(t.url))){const h=o&&s&&XN.read(s);h&&c.set(o,h)}return t},QN=typeof XMLHttpRequest<"u",JN=QN&&function(e){return new Promise(function(n,a){const o=DE(e);let s=o.data;const c=wn.from(o.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:h}=o,m,g,y,b,S;function E(){b&&b(),S&&S(),o.cancelToken&&o.cancelToken.unsubscribe(m),o.signal&&o.signal.removeEventListener("abort",m)}let _=new XMLHttpRequest;_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout;function N(){if(!_)return;const A=wn.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),D={data:!u||u==="text"||u==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:A,config:e,request:_};RE(function(R){n(R),E()},function(R){a(R),E()},D),_=null}"onloadend"in _?_.onloadend=N:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(N)},_.onabort=function(){_&&(a(new Xe("Request aborted",Xe.ECONNABORTED,e,_)),_=null)},_.onerror=function(){a(new Xe("Network Error",Xe.ERR_NETWORK,e,_)),_=null},_.ontimeout=function(){let k=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const D=o.transitional||_E;o.timeoutErrorMessage&&(k=o.timeoutErrorMessage),a(new Xe(k,D.clarifyTimeoutError?Xe.ETIMEDOUT:Xe.ECONNABORTED,e,_)),_=null},s===void 0&&c.setContentType(null),"setRequestHeader"in _&&ce.forEach(c.toJSON(),function(k,D){_.setRequestHeader(D,k)}),ce.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),u&&u!=="json"&&(_.responseType=o.responseType),h&&([y,S]=Cu(h,!0),_.addEventListener("progress",y)),f&&_.upload&&([g,b]=Cu(f),_.upload.addEventListener("progress",g),_.upload.addEventListener("loadend",b)),(o.cancelToken||o.signal)&&(m=A=>{_&&(a(!A||A.type?new Io(null,e,_):A),_.abort(),_=null)},o.cancelToken&&o.cancelToken.subscribe(m),o.signal&&(o.signal.aborted?m():o.signal.addEventListener("abort",m)));const C=VN(o.url);if(C&&rn.protocols.indexOf(C)===-1){a(new Xe("Unsupported protocol "+C+":",Xe.ERR_BAD_REQUEST,e));return}_.send(s||null)})},eO=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let a=new AbortController,o;const s=function(h){if(!o){o=!0,u();const m=h instanceof Error?h:this.reason;a.abort(m instanceof Xe?m:new Io(m instanceof Error?m.message:m))}};let c=t&&setTimeout(()=>{c=null,s(new Xe(`timeout ${t} of ms exceeded`,Xe.ETIMEDOUT))},t);const u=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(s):h.removeEventListener("abort",s)}),e=null)};e.forEach(h=>h.addEventListener("abort",s));const{signal:f}=a;return f.unsubscribe=()=>ce.asap(u),f}},tO=function*(e,t){let n=e.byteLength;if(n{const o=nO(e,t);let s=0,c,u=f=>{c||(c=!0,a&&a(f))};return new ReadableStream({async pull(f){try{const{done:h,value:m}=await o.next();if(h){u(),f.close();return}let g=m.byteLength;if(n){let y=s+=g;n(y)}f.enqueue(new Uint8Array(m))}catch(h){throw u(h),h}},cancel(f){return u(f),o.return()}},{highWaterMark:2})},Qu=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",kE=Qu&&typeof ReadableStream=="function",aO=Qu&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),NE=(e,...t)=>{try{return!!e(...t)}catch{return!1}},iO=kE&&NE(()=>{let e=!1;const t=new Request(rn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),w0=64*1024,sm=kE&&NE(()=>ce.isReadableStream(new Response("").body)),Tu={stream:sm&&(e=>e.body)};Qu&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Tu[t]&&(Tu[t]=ce.isFunction(e[t])?n=>n[t]():(n,a)=>{throw new Xe(`Response type '${t}' is not supported`,Xe.ERR_NOT_SUPPORT,a)})})})(new Response);const oO=async e=>{if(e==null)return 0;if(ce.isBlob(e))return e.size;if(ce.isSpecCompliantForm(e))return(await new Request(rn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(e)||ce.isArrayBuffer(e))return e.byteLength;if(ce.isURLSearchParams(e)&&(e=e+""),ce.isString(e))return(await aO(e)).byteLength},sO=async(e,t)=>{const n=ce.toFiniteNumber(e.getContentLength());return n??oO(t)},lO=Qu&&(async e=>{let{url:t,method:n,data:a,signal:o,cancelToken:s,timeout:c,onDownloadProgress:u,onUploadProgress:f,responseType:h,headers:m,withCredentials:g="same-origin",fetchOptions:y}=DE(e);h=h?(h+"").toLowerCase():"text";let b=eO([o,s&&s.toAbortSignal()],c),S;const E=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let _;try{if(f&&iO&&n!=="get"&&n!=="head"&&(_=await sO(m,a))!==0){let D=new Request(t,{method:"POST",body:a,duplex:"half"}),M;if(ce.isFormData(a)&&(M=D.headers.get("content-type"))&&m.setContentType(M),D.body){const[R,U]=v0(_,Cu(y0(f)));a=x0(D.body,w0,R,U)}}ce.isString(g)||(g=g?"include":"omit");const N="credentials"in Request.prototype;S=new Request(t,{...y,signal:b,method:n.toUpperCase(),headers:m.normalize().toJSON(),body:a,duplex:"half",credentials:N?g:void 0});let C=await fetch(S);const A=sm&&(h==="stream"||h==="response");if(sm&&(u||A&&E)){const D={};["status","statusText","headers"].forEach(L=>{D[L]=C[L]});const M=ce.toFiniteNumber(C.headers.get("content-length")),[R,U]=u&&v0(M,Cu(y0(u),!0))||[];C=new Response(x0(C.body,w0,R,()=>{U&&U(),E&&E()}),D)}h=h||"text";let k=await Tu[ce.findKey(Tu,h)||"text"](C,e);return!A&&E&&E(),await new Promise((D,M)=>{RE(D,M,{data:k,headers:wn.from(C.headers),status:C.status,statusText:C.statusText,config:e,request:S})})}catch(N){throw E&&E(),N&&N.name==="TypeError"&&/fetch/i.test(N.message)?Object.assign(new Xe("Network Error",Xe.ERR_NETWORK,e,S),{cause:N.cause||N}):Xe.from(N,N&&N.code,e,S)}}),lm={http:SN,xhr:JN,fetch:lO};ce.forEach(lm,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const E0=e=>`- ${e}`,cO=e=>ce.isFunction(e)||e===null||e===!1,OE={getAdapter:e=>{e=ce.isArray(e)?e:[e];const{length:t}=e;let n,a;const o={};for(let s=0;s`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let c=t?s.length>1?`since : +`+s.map(E0).join(` +`):" "+E0(s[0]):"as no adapter specified";throw new Xe("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return a},adapters:lm};function Yh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Io(null,e)}function S0(e){return Yh(e),e.headers=wn.from(e.headers),e.data=qh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),OE.getAdapter(e.adapter||bl.adapter)(e).then(function(a){return Yh(e),a.data=qh.call(e,e.transformResponse,a),a.headers=wn.from(a.headers),a},function(a){return TE(a)||(Yh(e),a&&a.response&&(a.response.data=qh.call(e,e.transformResponse,a.response),a.response.headers=wn.from(a.response.headers))),Promise.reject(a)})}const jE="1.7.9",Ju={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ju[e]=function(a){return typeof a===e||"a"+(t<1?"n ":" ")+e}});const _0={};Ju.transitional=function(t,n,a){function o(s,c){return"[Axios v"+jE+"] Transitional option '"+s+"'"+c+(a?". "+a:"")}return(s,c,u)=>{if(t===!1)throw new Xe(o(c," has been removed"+(n?" in "+n:"")),Xe.ERR_DEPRECATED);return n&&!_0[c]&&(_0[c]=!0,console.warn(o(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,c,u):!0}};Ju.spelling=function(t){return(n,a)=>(console.warn(`${a} is likely a misspelling of ${t}`),!0)};function uO(e,t,n){if(typeof e!="object")throw new Xe("options must be an object",Xe.ERR_BAD_OPTION_VALUE);const a=Object.keys(e);let o=a.length;for(;o-- >0;){const s=a[o],c=t[s];if(c){const u=e[s],f=u===void 0||c(u,s,e);if(f!==!0)throw new Xe("option "+s+" must be "+f,Xe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Xe("Unknown option "+s,Xe.ERR_BAD_OPTION)}}const du={assertOptions:uO,validators:Ju},br=du.validators;let _i=class{constructor(t){this.defaults=t,this.interceptors={request:new m0,response:new m0}}async request(t,n){try{return await this._request(t,n)}catch(a){if(a instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{a.stack?s&&!String(a.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(a.stack+=` +`+s):a.stack=s}catch{}}throw a}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ci(this.defaults,n);const{transitional:a,paramsSerializer:o,headers:s}=n;a!==void 0&&du.assertOptions(a,{silentJSONParsing:br.transitional(br.boolean),forcedJSONParsing:br.transitional(br.boolean),clarifyTimeoutError:br.transitional(br.boolean)},!1),o!=null&&(ce.isFunction(o)?n.paramsSerializer={serialize:o}:du.assertOptions(o,{encode:br.function,serialize:br.function},!0)),du.assertOptions(n,{baseUrl:br.spelling("baseURL"),withXsrfToken:br.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=s&&ce.merge(s.common,s[n.method]);s&&ce.forEach(["delete","get","head","post","put","patch","common"],S=>{delete s[S]}),n.headers=wn.concat(c,s);const u=[];let f=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(n)===!1||(f=f&&E.synchronous,u.unshift(E.fulfilled,E.rejected))});const h=[];this.interceptors.response.forEach(function(E){h.push(E.fulfilled,E.rejected)});let m,g=0,y;if(!f){const S=[S0.bind(this),void 0];for(S.unshift.apply(S,u),S.push.apply(S,h),y=S.length,m=Promise.resolve(n);g{if(!a._listeners)return;let s=a._listeners.length;for(;s-- >0;)a._listeners[s](o);a._listeners=null}),this.promise.then=o=>{let s;const c=new Promise(u=>{a.subscribe(u),s=u}).then(o);return c.cancel=function(){a.unsubscribe(s)},c},t(function(s,c,u){a.reason||(a.reason=new Io(s,c,u),n(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=a=>{t.abort(a)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new LE(function(o){t=o}),cancel:t}}};function fO(e){return function(n){return e.apply(null,n)}}function hO(e){return ce.isObject(e)&&e.isAxiosError===!0}const cm={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(cm).forEach(([e,t])=>{cm[t]=e});function zE(e){const t=new _i(e),n=dE(_i.prototype.request,t);return ce.extend(n,_i.prototype,t,{allOwnKeys:!0}),ce.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return zE(Ci(e,o))},n}const kt=zE(bl);kt.Axios=_i;kt.CanceledError=Io;kt.CancelToken=dO;kt.isCancel=TE;kt.VERSION=jE;kt.toFormData=Zu;kt.AxiosError=Xe;kt.Cancel=kt.CanceledError;kt.all=function(t){return Promise.all(t)};kt.spread=fO;kt.isAxiosError=hO;kt.mergeConfig=Ci;kt.AxiosHeaders=wn;kt.formToJSON=e=>CE(ce.isHTMLForm(e)?new FormData(e):e);kt.getAdapter=OE.getAdapter;kt.HttpStatusCode=cm;kt.default=kt;const{Axios:R6,AxiosError:A6,CanceledError:D6,isCancel:k6,CancelToken:N6,VERSION:O6,all:j6,Cancel:L6,isAxiosError:z6,spread:M6,toFormData:P6,AxiosHeaders:G6,HttpStatusCode:F6,formToJSON:U6,getAdapter:B6,mergeConfig:I6}=kt,ME="Invalid API Key",PE="API Key required",fr=kt.create({baseURL:iE,headers:{"Content-Type":"application/json"}});fr.interceptors.request.use(e=>{const t=Ye.getState().apiKey;return t&&(e.headers["X-API-Key"]=t),e});fr.interceptors.response.use(e=>e,e=>{var t;throw e.response?new Error(`${e.response.status} ${e.response.statusText} +${JSON.stringify(e.response.data)} +${(t=e.config)==null?void 0:t.url}`):e});const pO=async e=>(await fr.get(`/graphs?label=${e}`)).data,mO=async()=>(await fr.get("/graph/label/list")).data,gO=async()=>{try{return(await fr.get("/health")).data}catch(e){return{status:"error",message:Sr(e)}}},vO=async()=>(await fr.get("/documents")).data,yO=async()=>(await fr.post("/documents/scan")).data,bO=async e=>(await fr.post("/query",e)).data,xO=async(e,t,n)=>{try{let a="";if(await fr.post("/query/stream",e,{responseType:"text",headers:{Accept:"application/x-ndjson"},transformResponse:[o=>{a+=o;const s=a.split(` +`);a=s.pop()||"";for(const c of s)if(c.trim())try{const u=JSON.parse(c);u.response?t(u.response):u.error}catch(u){console.error("Error parsing stream chunk:",u)}return o}]}),a.trim())try{const o=JSON.parse(a);o.response?t(o.response):o.error}catch(o){console.error("Error parsing final chunk:",o)}}catch(a){const o=Sr(a);console.error("Stream request failed:",o)}},wO=async(e,t)=>{const n=new FormData;return n.append("file",e),(await fr.post("/documents/upload",n,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t!==void 0?o=>{const s=Math.round(o.loaded*100/o.total);t(s)}:void 0})).data},EO=async()=>(await fr.delete("/documents")).data,SO=Qm()(e=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,check:async()=>{const t=await gO();return t.status==="healthy"?(e({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:t}),!0):(e({health:!1,message:t.message,messageTitle:"Backend Health Check Error!",lastCheckTime:Date.now(),status:null}),!1)},clear:()=>{e({health:!0,message:null,messageTitle:null})},setErrorMessage:(t,n)=>{e({health:!1,message:t,messageTitle:n})}})),En=tg(SO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _O=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),GE=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var CO={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const TO=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:o="",children:s,iconNode:c,...u},f)=>w.createElement("svg",{ref:f,...CO,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:GE("lucide",o),...u},[...c.map(([h,m])=>w.createElement(h,m)),...Array.isArray(s)?s:[s]]));/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ht=(e,t)=>{const n=w.forwardRef(({className:a,...o},s)=>w.createElement(TO,{ref:s,iconNode:t,className:GE(`lucide-${_O(e)}`,a),...o}));return n.displayName=`${e}`,n};/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const RO=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ig=ht("Check",RO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const AO=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],og=ht("ChevronDown",AO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const DO=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],FE=ht("ChevronUp",DO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kO=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],NO=ht("ChevronsUpDown",kO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const OO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],jO=ht("CircleAlert",OO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const LO=[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]],UE=ht("Eraser",LO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zO=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],MO=ht("FileText",zO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const PO=[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]],GO=ht("Files",PO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const FO=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["rect",{width:"10",height:"8",x:"7",y:"8",rx:"1",key:"vys8me"}]],UO=ht("Fullscreen",FO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const BO=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],IO=ht("Github",BO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const HO=[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"19",cy:"5",r:"1",key:"w8mnmm"}],["circle",{cx:"5",cy:"5",r:"1",key:"lttvr7"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}],["circle",{cx:"19",cy:"19",r:"1",key:"shf9b7"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]],$O=ht("Grip",HO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const VO=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],BE=ht("LoaderCircle",VO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qO=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],YO=ht("Loader",qO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const WO=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],XO=ht("Maximize",WO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const KO=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],ZO=ht("Minimize",KO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const QO=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],JO=ht("Moon",QO);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ej=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],tj=ht("Pause",ej);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nj=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],rj=ht("Play",nj);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aj=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ij=ht("RefreshCw",aj);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oj=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],sj=ht("Search",oj);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lj=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],cj=ht("Send",lj);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uj=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],dj=ht("Settings",uj);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fj=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],hj=ht("Sun",fj);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pj=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],um=ht("Upload",pj);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],IE=ht("X",mj);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gj=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],vj=ht("Zap",gj);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yj=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],bj=ht("ZoomIn",yj);/** + * @license lucide-react v0.475.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xj=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],wj=ht("ZoomOut",xj),Ej=()=>{const e=En.use.health(),t=En.use.message(),n=En.use.messageTitle(),[a,o]=w.useState(!1);return w.useEffect(()=>{setTimeout(()=>{o(!0)},50)},[]),x.jsxs(lE,{className:Oe("bg-background/90 absolute top-12 left-1/2 flex w-auto max-w-lg -translate-x-1/2 transform items-center gap-4 shadow-md backdrop-blur-lg transition-all duration-500 ease-in-out",a?"translate-y-0 opacity-100":"-translate-y-20 opacity-0",!e&&"bg-red-700 text-white"),children:[!e&&x.jsx("div",{children:x.jsx(jO,{className:"size-4"})}),x.jsxs("div",{children:[x.jsx(cE,{className:"font-bold",children:n}),x.jsx(uE,{children:t})]})]})};function Sj(e,t){const n=w.createContext(t),a=s=>{const{children:c,...u}=s,f=w.useMemo(()=>u,Object.values(u));return x.jsx(n.Provider,{value:f,children:c})};a.displayName=e+"Provider";function o(s){const c=w.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[a,o]}function Kn(e,t=[]){let n=[];function a(s,c){const u=w.createContext(c),f=n.length;n=[...n,c];const h=g=>{var N;const{scope:y,children:b,...S}=g,E=((N=y==null?void 0:y[e])==null?void 0:N[f])||u,_=w.useMemo(()=>S,Object.values(S));return x.jsx(E.Provider,{value:_,children:b})};h.displayName=s+"Provider";function m(g,y){var E;const b=((E=y==null?void 0:y[e])==null?void 0:E[f])||u,S=w.useContext(b);if(S)return S;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[h,m]}const o=()=>{const s=n.map(c=>w.createContext(c));return function(u){const f=(u==null?void 0:u[e])||s;return w.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return o.scopeName=e,[a,_j(o,...t)]}function _j(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=a.reduce((u,{useScope:f,scopeName:h})=>{const g=f(s)[`__scope${h}`];return{...u,...g}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function C0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function HE(...e){return t=>{let n=!1;const a=e.map(o=>{const s=C0(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o{},Cj=SD.useId||(()=>{}),Tj=0;function on(e){const[t,n]=w.useState(Cj());return sn(()=>{n(a=>a??String(Tj++))},[e]),t?`radix-${t}`:""}function Zt(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function aa({prop:e,defaultProp:t,onChange:n=()=>{}}){const[a,o]=Rj({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:a,u=Zt(n),f=w.useCallback(h=>{if(s){const g=typeof h=="function"?h(e):h;g!==e&&u(g)}else o(h)},[s,e,o,u]);return[c,f]}function Rj({defaultProp:e,onChange:t}){const n=w.useState(e),[a]=n,o=w.useRef(a),s=Zt(t);return w.useEffect(()=>{o.current!==a&&(s(a),o.current=a)},[a,o,s]),n}var xl=Y1();const $E=dn(xl);var Ba=w.forwardRef((e,t)=>{const{children:n,...a}=e,o=w.Children.toArray(n),s=o.find(Aj);if(s){const c=s.props.children,u=o.map(f=>f===s?w.Children.count(c)>1?w.Children.only(null):w.isValidElement(c)?c.props.children:null:f);return x.jsx(dm,{...a,ref:t,children:w.isValidElement(c)?w.cloneElement(c,void 0,u):null})}return x.jsx(dm,{...a,ref:t,children:n})});Ba.displayName="Slot";var dm=w.forwardRef((e,t)=>{const{children:n,...a}=e;if(w.isValidElement(n)){const o=kj(n),s=Dj(a,n.props);return n.type!==w.Fragment&&(s.ref=t?HE(t,o):o),w.cloneElement(n,s)}return w.Children.count(n)>1?w.Children.only(null):null});dm.displayName="SlotClone";var sg=({children:e})=>x.jsx(x.Fragment,{children:e});function Aj(e){return w.isValidElement(e)&&e.type===sg}function Dj(e,t){const n={...t};for(const a in t){const o=e[a],s=t[a];/^on[A-Z]/.test(a)?o&&s?n[a]=(...u)=>{s(...u),o(...u)}:o&&(n[a]=o):a==="style"?n[a]={...o,...s}:a==="className"&&(n[a]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function kj(e){var a,o;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Nj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ie=Nj.reduce((e,t)=>{const n=w.forwardRef((a,o)=>{const{asChild:s,...c}=a,u=s?Ba:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(u,{...c,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Oj(e,t){e&&xl.flushSync(()=>e.dispatchEvent(t))}function jj(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e);w.useEffect(()=>{const a=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var Lj="DismissableLayer",fm="dismissableLayer.update",zj="dismissableLayer.pointerDownOutside",Mj="dismissableLayer.focusOutside",T0,VE=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wl=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:u,...f}=e,h=w.useContext(VE),[m,g]=w.useState(null),y=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=w.useState({}),S=nt(t,R=>g(R)),E=Array.from(h.layers),[_]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),N=E.indexOf(_),C=m?E.indexOf(m):-1,A=h.layersWithOutsidePointerEventsDisabled.size>0,k=C>=N,D=Fj(R=>{const U=R.target,L=[...h.branches].some(I=>I.contains(U));!k||L||(o==null||o(R),c==null||c(R),R.defaultPrevented||u==null||u())},y),M=Uj(R=>{const U=R.target;[...h.branches].some(I=>I.contains(U))||(s==null||s(R),c==null||c(R),R.defaultPrevented||u==null||u())},y);return jj(R=>{C===h.layers.size-1&&(a==null||a(R),!R.defaultPrevented&&u&&(R.preventDefault(),u()))},y),w.useEffect(()=>{if(m)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(T0=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),R0(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=T0)}},[m,y,n,h]),w.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),R0())},[m,h]),w.useEffect(()=>{const R=()=>b({});return document.addEventListener(fm,R),()=>document.removeEventListener(fm,R)},[]),x.jsx(Ie.div,{...f,ref:S,style:{pointerEvents:A?k?"auto":"none":void 0,...e.style},onFocusCapture:Be(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Be(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Be(e.onPointerDownCapture,D.onPointerDownCapture)})});wl.displayName=Lj;var Pj="DismissableLayerBranch",Gj=w.forwardRef((e,t)=>{const n=w.useContext(VE),a=w.useRef(null),o=nt(t,a);return w.useEffect(()=>{const s=a.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),x.jsx(Ie.div,{...e,ref:o})});Gj.displayName=Pj;function Fj(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),a=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const s=u=>{if(u.target&&!a.current){let f=function(){qE(zj,n,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=f,t.addEventListener("click",o.current,{once:!0})):f()}else t.removeEventListener("click",o.current);a.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function Uj(e,t=globalThis==null?void 0:globalThis.document){const n=Zt(e),a=w.useRef(!1);return w.useEffect(()=>{const o=s=>{s.target&&!a.current&&qE(Mj,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function R0(){const e=new CustomEvent(fm);document.dispatchEvent(e)}function qE(e,t,n,{discrete:a}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),a?Oj(o,s):o.dispatchEvent(s)}var Wh="focusScope.autoFocusOnMount",Xh="focusScope.autoFocusOnUnmount",A0={bubbles:!1,cancelable:!0},Bj="FocusScope",ed=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=e,[u,f]=w.useState(null),h=Zt(o),m=Zt(s),g=w.useRef(null),y=nt(t,E=>f(E)),b=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(a){let E=function(A){if(b.paused||!u)return;const k=A.target;u.contains(k)?g.current=k:Ma(g.current,{select:!0})},_=function(A){if(b.paused||!u)return;const k=A.relatedTarget;k!==null&&(u.contains(k)||Ma(g.current,{select:!0}))},N=function(A){if(document.activeElement===document.body)for(const D of A)D.removedNodes.length>0&&Ma(u)};document.addEventListener("focusin",E),document.addEventListener("focusout",_);const C=new MutationObserver(N);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",_),C.disconnect()}}},[a,u,b.paused]),w.useEffect(()=>{if(u){k0.add(b);const E=document.activeElement;if(!u.contains(E)){const N=new CustomEvent(Wh,A0);u.addEventListener(Wh,h),u.dispatchEvent(N),N.defaultPrevented||(Ij(Yj(YE(u)),{select:!0}),document.activeElement===E&&Ma(u))}return()=>{u.removeEventListener(Wh,h),setTimeout(()=>{const N=new CustomEvent(Xh,A0);u.addEventListener(Xh,m),u.dispatchEvent(N),N.defaultPrevented||Ma(E??document.body,{select:!0}),u.removeEventListener(Xh,m),k0.remove(b)},0)}}},[u,h,m,b]);const S=w.useCallback(E=>{if(!n&&!a||b.paused)return;const _=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,N=document.activeElement;if(_&&N){const C=E.currentTarget,[A,k]=Hj(C);A&&k?!E.shiftKey&&N===k?(E.preventDefault(),n&&Ma(A,{select:!0})):E.shiftKey&&N===A&&(E.preventDefault(),n&&Ma(k,{select:!0})):N===C&&E.preventDefault()}},[n,a,b.paused]);return x.jsx(Ie.div,{tabIndex:-1,...c,ref:y,onKeyDown:S})});ed.displayName=Bj;function Ij(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(Ma(a,{select:t}),document.activeElement!==n)return}function Hj(e){const t=YE(e),n=D0(t,e),a=D0(t.reverse(),e);return[n,a]}function YE(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const o=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||o?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function D0(e,t){for(const n of e)if(!$j(n,{upTo:t}))return n}function $j(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Vj(e){return e instanceof HTMLInputElement&&"select"in e}function Ma(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Vj(e)&&t&&e.select()}}var k0=qj();function qj(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=N0(e,t),e.unshift(t)},remove(t){var n;e=N0(e,t),(n=e[0])==null||n.resume()}}}function N0(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function Yj(e){return e.filter(t=>t.tagName!=="A")}var Wj="Portal",td=w.forwardRef((e,t)=>{var u;const{container:n,...a}=e,[o,s]=w.useState(!1);sn(()=>s(!0),[]);const c=n||o&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?$E.createPortal(x.jsx(Ie.div,{...a,ref:t}),c):null});td.displayName=Wj;function Xj(e,t){return w.useReducer((n,a)=>t[n][a]??n,e)}var zn=e=>{const{present:t,children:n}=e,a=Kj(t),o=typeof n=="function"?n({present:a.isPresent}):w.Children.only(n),s=nt(a.ref,Zj(o));return typeof n=="function"||a.isPresent?w.cloneElement(o,{ref:s}):null};zn.displayName="Presence";function Kj(e){const[t,n]=w.useState(),a=w.useRef({}),o=w.useRef(e),s=w.useRef("none"),c=e?"mounted":"unmounted",[u,f]=Xj(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const h=Bc(a.current);s.current=u==="mounted"?h:"none"},[u]),sn(()=>{const h=a.current,m=o.current;if(m!==e){const y=s.current,b=Bc(h);e?f("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(m&&y!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),sn(()=>{if(t){let h;const m=t.ownerDocument.defaultView??window,g=b=>{const E=Bc(a.current).includes(b.animationName);if(b.target===t&&E&&(f("ANIMATION_END"),!o.current)){const _=t.style.animationFillMode;t.style.animationFillMode="forwards",h=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=_)})}},y=b=>{b.target===t&&(s.current=Bc(a.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{m.clearTimeout(h),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:w.useCallback(h=>{h&&(a.current=getComputedStyle(h)),n(h)},[])}}function Bc(e){return(e==null?void 0:e.animationName)||"none"}function Zj(e){var a,o;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Kh=0;function lg(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??O0()),document.body.insertAdjacentElement("beforeend",e[1]??O0()),Kh++,()=>{Kh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Kh--}},[])}function O0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var wr=function(){return wr=Object.assign||function(t){for(var n,a=1,o=arguments.length;a"u")return pL;var t=mL(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},vL=ZE(),Ro="data-scroll-locked",yL=function(e,t,n,a){var o=e.left,s=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),` + .`.concat(Jj,` { + overflow: hidden `).concat(a,`; + padding-right: `).concat(u,"px ").concat(a,`; + } + body[`).concat(Ro,`] { + overflow: hidden `).concat(a,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(s,`px; + padding-right: `).concat(c,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(u,"px ").concat(a,`; + `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(a,";")].filter(Boolean).join(""),` + } + + .`).concat(fu,` { + right: `).concat(u,"px ").concat(a,`; + } + + .`).concat(hu,` { + margin-right: `).concat(u,"px ").concat(a,`; + } + + .`).concat(fu," .").concat(fu,` { + right: 0 `).concat(a,`; + } + + .`).concat(hu," .").concat(hu,` { + margin-right: 0 `).concat(a,`; + } + + body[`).concat(Ro,`] { + `).concat(eL,": ").concat(u,`px; + } +`)},L0=function(){var e=parseInt(document.body.getAttribute(Ro)||"0",10);return isFinite(e)?e:0},bL=function(){w.useEffect(function(){return document.body.setAttribute(Ro,(L0()+1).toString()),function(){var e=L0()-1;e<=0?document.body.removeAttribute(Ro):document.body.setAttribute(Ro,e.toString())}},[])},xL=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,o=a===void 0?"margin":a;bL();var s=w.useMemo(function(){return gL(o)},[o]);return w.createElement(vL,{styles:yL(s,!t,o,n?"":"!important")})},hm=!1;if(typeof window<"u")try{var Ic=Object.defineProperty({},"passive",{get:function(){return hm=!0,!0}});window.addEventListener("test",Ic,Ic),window.removeEventListener("test",Ic,Ic)}catch{hm=!1}var bo=hm?{passive:!1}:!1,wL=function(e){return e.tagName==="TEXTAREA"},QE=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!wL(e)&&n[t]==="visible")},EL=function(e){return QE(e,"overflowY")},SL=function(e){return QE(e,"overflowX")},z0=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var o=JE(e,a);if(o){var s=eS(e,a),c=s[1],u=s[2];if(c>u)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},_L=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},CL=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},JE=function(e,t){return e==="v"?EL(t):SL(t)},eS=function(e,t){return e==="v"?_L(t):CL(t)},TL=function(e,t){return e==="h"&&t==="rtl"?-1:1},RL=function(e,t,n,a,o){var s=TL(e,window.getComputedStyle(t).direction),c=s*a,u=n.target,f=t.contains(u),h=!1,m=c>0,g=0,y=0;do{var b=eS(e,u),S=b[0],E=b[1],_=b[2],N=E-_-s*S;(S||N)&&JE(e,u)&&(g+=N,y+=S),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(m&&Math.abs(g)<1||!m&&Math.abs(y)<1)&&(h=!0),h},Hc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},M0=function(e){return[e.deltaX,e.deltaY]},P0=function(e){return e&&"current"in e?e.current:e},AL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},DL=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},kL=0,xo=[];function NL(e){var t=w.useRef([]),n=w.useRef([0,0]),a=w.useRef(),o=w.useState(kL++)[0],s=w.useState(ZE)[0],c=w.useRef(e);w.useEffect(function(){c.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var E=Qj([e.lockRef.current],(e.shards||[]).map(P0),!0).filter(Boolean);return E.forEach(function(_){return _.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),E.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=w.useCallback(function(E,_){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!c.current.allowPinchZoom;var N=Hc(E),C=n.current,A="deltaX"in E?E.deltaX:C[0]-N[0],k="deltaY"in E?E.deltaY:C[1]-N[1],D,M=E.target,R=Math.abs(A)>Math.abs(k)?"h":"v";if("touches"in E&&R==="h"&&M.type==="range")return!1;var U=z0(R,M);if(!U)return!0;if(U?D=R:(D=R==="v"?"h":"v",U=z0(R,M)),!U)return!1;if(!a.current&&"changedTouches"in E&&(A||k)&&(a.current=D),!D)return!0;var L=a.current||D;return RL(L,_,E,L==="h"?A:k)},[]),f=w.useCallback(function(E){var _=E;if(!(!xo.length||xo[xo.length-1]!==s)){var N="deltaY"in _?M0(_):Hc(_),C=t.current.filter(function(D){return D.name===_.type&&(D.target===_.target||_.target===D.shadowParent)&&AL(D.delta,N)})[0];if(C&&C.should){_.cancelable&&_.preventDefault();return}if(!C){var A=(c.current.shards||[]).map(P0).filter(Boolean).filter(function(D){return D.contains(_.target)}),k=A.length>0?u(_,A[0]):!c.current.noIsolation;k&&_.cancelable&&_.preventDefault()}}},[]),h=w.useCallback(function(E,_,N,C){var A={name:E,delta:_,target:N,should:C,shadowParent:OL(N)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(k){return k!==A})},1)},[]),m=w.useCallback(function(E){n.current=Hc(E),a.current=void 0},[]),g=w.useCallback(function(E){h(E.type,M0(E),E.target,u(E,e.lockRef.current))},[]),y=w.useCallback(function(E){h(E.type,Hc(E),E.target,u(E,e.lockRef.current))},[]);w.useEffect(function(){return xo.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,bo),document.addEventListener("touchmove",f,bo),document.addEventListener("touchstart",m,bo),function(){xo=xo.filter(function(E){return E!==s}),document.removeEventListener("wheel",f,bo),document.removeEventListener("touchmove",f,bo),document.removeEventListener("touchstart",m,bo)}},[]);var b=e.removeScrollBar,S=e.inert;return w.createElement(w.Fragment,null,S?w.createElement(s,{styles:DL(o)}):null,b?w.createElement(xL,{gapMode:e.gapMode}):null)}function OL(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jL=sL(KE,NL);var rd=w.forwardRef(function(e,t){return w.createElement(nd,wr({},e,{ref:t,sideCar:jL}))});rd.classNames=nd.classNames;var LL=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wo=new WeakMap,$c=new WeakMap,Vc={},ep=0,tS=function(e){return e&&(e.host||tS(e.parentNode))},zL=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=tS(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ML=function(e,t,n,a){var o=zL(t,Array.isArray(e)?e:[e]);Vc[n]||(Vc[n]=new WeakMap);var s=Vc[n],c=[],u=new Set,f=new Set(o),h=function(g){!g||u.has(g)||(u.add(g),h(g.parentNode))};o.forEach(h);var m=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(y){if(u.has(y))m(y);else try{var b=y.getAttribute(a),S=b!==null&&b!=="false",E=(wo.get(y)||0)+1,_=(s.get(y)||0)+1;wo.set(y,E),s.set(y,_),c.push(y),E===1&&S&&$c.set(y,!0),_===1&&y.setAttribute(n,"true"),S||y.setAttribute(a,"true")}catch(N){console.error("aria-hidden: cannot operate on ",y,N)}})};return m(t),u.clear(),ep++,function(){c.forEach(function(g){var y=wo.get(g)-1,b=s.get(g)-1;wo.set(g,y),s.set(g,b),y||($c.has(g)||g.removeAttribute(a),$c.delete(g)),b||g.removeAttribute(n)}),ep--,ep||(wo=new WeakMap,wo=new WeakMap,$c=new WeakMap,Vc={})}},cg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),o=LL(e);return o?(a.push.apply(a,Array.from(o.querySelectorAll("[aria-live]"))),ML(a,o,n,"aria-hidden")):function(){return null}},ug="Dialog",[nS,rS]=Kn(ug),[PL,hr]=nS(ug),aS=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,u=w.useRef(null),f=w.useRef(null),[h=!1,m]=aa({prop:a,defaultProp:o,onChange:s});return x.jsx(PL,{scope:t,triggerRef:u,contentRef:f,contentId:on(),titleId:on(),descriptionId:on(),open:h,onOpenChange:m,onOpenToggle:w.useCallback(()=>m(g=>!g),[m]),modal:c,children:n})};aS.displayName=ug;var iS="DialogTrigger",oS=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(iS,n),s=nt(t,o.triggerRef);return x.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":hg(o.open),...a,ref:s,onClick:Be(e.onClick,o.onOpenToggle)})});oS.displayName=iS;var dg="DialogPortal",[GL,sS]=nS(dg,{forceMount:void 0}),lS=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:o}=e,s=hr(dg,t);return x.jsx(GL,{scope:t,forceMount:n,children:w.Children.map(a,c=>x.jsx(zn,{present:n||s.open,children:x.jsx(td,{asChild:!0,container:o,children:c})}))})};lS.displayName=dg;var Ru="DialogOverlay",cS=w.forwardRef((e,t)=>{const n=sS(Ru,e.__scopeDialog),{forceMount:a=n.forceMount,...o}=e,s=hr(Ru,e.__scopeDialog);return s.modal?x.jsx(zn,{present:a||s.open,children:x.jsx(FL,{...o,ref:t})}):null});cS.displayName=Ru;var FL=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(Ru,n);return x.jsx(rd,{as:Ba,allowPinchZoom:!0,shards:[o.contentRef],children:x.jsx(Ie.div,{"data-state":hg(o.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),Ti="DialogContent",uS=w.forwardRef((e,t)=>{const n=sS(Ti,e.__scopeDialog),{forceMount:a=n.forceMount,...o}=e,s=hr(Ti,e.__scopeDialog);return x.jsx(zn,{present:a||s.open,children:s.modal?x.jsx(UL,{...o,ref:t}):x.jsx(BL,{...o,ref:t})})});uS.displayName=Ti;var UL=w.forwardRef((e,t)=>{const n=hr(Ti,e.__scopeDialog),a=w.useRef(null),o=nt(t,n.contentRef,a);return w.useEffect(()=>{const s=a.current;if(s)return cg(s)},[]),x.jsx(dS,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(e.onCloseAutoFocus,s=>{var c;s.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Be(e.onPointerDownOutside,s=>{const c=s.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&s.preventDefault()}),onFocusOutside:Be(e.onFocusOutside,s=>s.preventDefault())})}),BL=w.forwardRef((e,t)=>{const n=hr(Ti,e.__scopeDialog),a=w.useRef(!1),o=w.useRef(!1);return x.jsx(dS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,s),s.defaultPrevented||(a.current||(u=n.triggerRef.current)==null||u.focus(),s.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:s=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,s),s.defaultPrevented||(a.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=s.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),dS=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=e,u=hr(Ti,n),f=w.useRef(null),h=nt(t,f);return lg(),x.jsxs(x.Fragment,{children:[x.jsx(ed,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:x.jsx(wl,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":hg(u.open),...c,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(HL,{titleId:u.titleId}),x.jsx(VL,{contentRef:f,descriptionId:u.descriptionId})]})]})}),fg="DialogTitle",fS=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(fg,n);return x.jsx(Ie.h2,{id:o.titleId,...a,ref:t})});fS.displayName=fg;var hS="DialogDescription",pS=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(hS,n);return x.jsx(Ie.p,{id:o.descriptionId,...a,ref:t})});pS.displayName=hS;var mS="DialogClose",gS=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=hr(mS,n);return x.jsx(Ie.button,{type:"button",...a,ref:t,onClick:Be(e.onClick,()=>o.onOpenChange(!1))})});gS.displayName=mS;function hg(e){return e?"open":"closed"}var vS="DialogTitleWarning",[IL,yS]=Sj(vS,{contentName:Ti,titleName:fg,docsSlug:"dialog"}),HL=({titleId:e})=>{const t=yS(vS),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},$L="DialogDescriptionWarning",VL=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${yS($L).contentName}}.`;return w.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},pg=aS,bS=oS,mg=lS,ad=cS,id=uS,gg=fS,vg=pS,yg=gS,xS="AlertDialog",[qL,H6]=Kn(xS,[rS]),sa=rS(),wS=e=>{const{__scopeAlertDialog:t,...n}=e,a=sa(t);return x.jsx(pg,{...a,...n,modal:!0})};wS.displayName=xS;var YL="AlertDialogTrigger",WL=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,o=sa(n);return x.jsx(bS,{...o,...a,ref:t})});WL.displayName=YL;var XL="AlertDialogPortal",ES=e=>{const{__scopeAlertDialog:t,...n}=e,a=sa(t);return x.jsx(mg,{...a,...n})};ES.displayName=XL;var KL="AlertDialogOverlay",SS=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,o=sa(n);return x.jsx(ad,{...o,...a,ref:t})});SS.displayName=KL;var Ao="AlertDialogContent",[ZL,QL]=qL(Ao),_S=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:a,...o}=e,s=sa(n),c=w.useRef(null),u=nt(t,c),f=w.useRef(null);return x.jsx(IL,{contentName:Ao,titleName:CS,docsSlug:"alert-dialog",children:x.jsx(ZL,{scope:n,cancelRef:f,children:x.jsxs(id,{role:"alertdialog",...s,...o,ref:u,onOpenAutoFocus:Be(o.onOpenAutoFocus,h=>{var m;h.preventDefault(),(m=f.current)==null||m.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[x.jsx(sg,{children:a}),x.jsx(ez,{contentRef:c})]})})})});_S.displayName=Ao;var CS="AlertDialogTitle",TS=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,o=sa(n);return x.jsx(gg,{...o,...a,ref:t})});TS.displayName=CS;var RS="AlertDialogDescription",AS=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,o=sa(n);return x.jsx(vg,{...o,...a,ref:t})});AS.displayName=RS;var JL="AlertDialogAction",DS=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,o=sa(n);return x.jsx(yg,{...o,...a,ref:t})});DS.displayName=JL;var kS="AlertDialogCancel",NS=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,{cancelRef:o}=QL(kS,n),s=sa(n),c=nt(t,o);return x.jsx(yg,{...s,...a,ref:c})});NS.displayName=kS;var ez=({contentRef:e})=>{const t=`\`${Ao}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${Ao}\` by passing a \`${RS}\` component as a child, which also benefits sighted users by adding visible context to the dialog. + +Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ao}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return w.useEffect(()=>{var a;document.getElementById((a=e.current)==null?void 0:a.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},tz=wS,nz=ES,OS=SS,jS=_S,LS=DS,zS=NS,MS=TS,PS=AS;const rz=["top","right","bottom","left"],Ia=Math.min,On=Math.max,Au=Math.round,qc=Math.floor,Cr=e=>({x:e,y:e}),az={left:"right",right:"left",bottom:"top",top:"bottom"},iz={start:"end",end:"start"};function pm(e,t,n){return On(e,Ia(t,n))}function ia(e,t){return typeof e=="function"?e(t):e}function oa(e){return e.split("-")[0]}function Ho(e){return e.split("-")[1]}function bg(e){return e==="x"?"y":"x"}function xg(e){return e==="y"?"height":"width"}function Ha(e){return["top","bottom"].includes(oa(e))?"y":"x"}function wg(e){return bg(Ha(e))}function oz(e,t,n){n===void 0&&(n=!1);const a=Ho(e),o=wg(e),s=xg(o);let c=o==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=Du(c)),[c,Du(c)]}function sz(e){const t=Du(e);return[mm(e),t,mm(t)]}function mm(e){return e.replace(/start|end/g,t=>iz[t])}function lz(e,t,n){const a=["left","right"],o=["right","left"],s=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:a:t?a:o;case"left":case"right":return t?s:c;default:return[]}}function cz(e,t,n,a){const o=Ho(e);let s=lz(oa(e),n==="start",a);return o&&(s=s.map(c=>c+"-"+o),t&&(s=s.concat(s.map(mm)))),s}function Du(e){return e.replace(/left|right|bottom|top/g,t=>az[t])}function uz(e){return{top:0,right:0,bottom:0,left:0,...e}}function GS(e){return typeof e!="number"?uz(e):{top:e,right:e,bottom:e,left:e}}function ku(e){const{x:t,y:n,width:a,height:o}=e;return{width:a,height:o,top:n,left:t,right:t+a,bottom:n+o,x:t,y:n}}function G0(e,t,n){let{reference:a,floating:o}=e;const s=Ha(t),c=wg(t),u=xg(c),f=oa(t),h=s==="y",m=a.x+a.width/2-o.width/2,g=a.y+a.height/2-o.height/2,y=a[u]/2-o[u]/2;let b;switch(f){case"top":b={x:m,y:a.y-o.height};break;case"bottom":b={x:m,y:a.y+a.height};break;case"right":b={x:a.x+a.width,y:g};break;case"left":b={x:a.x-o.width,y:g};break;default:b={x:a.x,y:a.y}}switch(Ho(t)){case"start":b[c]-=y*(n&&h?-1:1);break;case"end":b[c]+=y*(n&&h?-1:1);break}return b}const dz=async(e,t,n)=>{const{placement:a="bottom",strategy:o="absolute",middleware:s=[],platform:c}=n,u=s.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let h=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:g}=G0(h,a,f),y=a,b={},S=0;for(let E=0;E({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:o,rects:s,platform:c,elements:u,middlewareData:f}=t,{element:h,padding:m=0}=ia(e,t)||{};if(h==null)return{};const g=GS(m),y={x:n,y:a},b=wg(o),S=xg(b),E=await c.getDimensions(h),_=b==="y",N=_?"top":"left",C=_?"bottom":"right",A=_?"clientHeight":"clientWidth",k=s.reference[S]+s.reference[b]-y[b]-s.floating[S],D=y[b]-s.reference[b],M=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h));let R=M?M[A]:0;(!R||!await(c.isElement==null?void 0:c.isElement(M)))&&(R=u.floating[A]||s.floating[S]);const U=k/2-D/2,L=R/2-E[S]/2-1,I=Ia(g[N],L),q=Ia(g[C],L),Y=I,B=R-E[S]-q,X=R/2-E[S]/2+U,ne=pm(Y,X,B),F=!f.arrow&&Ho(o)!=null&&X!==ne&&s.reference[S]/2-(XX<=0)){var q,Y;const X=(((q=s.flip)==null?void 0:q.index)||0)+1,ne=R[X];if(ne)return{data:{index:X,overflows:I},reset:{placement:ne}};let F=(Y=I.filter(z=>z.overflows[0]<=0).sort((z,j)=>z.overflows[1]-j.overflows[1])[0])==null?void 0:Y.placement;if(!F)switch(b){case"bestFit":{var B;const z=(B=I.filter(j=>{if(M){const K=Ha(j.placement);return K===C||K==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(K=>K>0).reduce((K,G)=>K+G,0)]).sort((j,K)=>j[1]-K[1])[0])==null?void 0:B[0];z&&(F=z);break}case"initialPlacement":F=u;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function F0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function U0(e){return rz.some(t=>e[t]>=0)}const pz=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:a="referenceHidden",...o}=ia(e,t);switch(a){case"referenceHidden":{const s=await cl(t,{...o,elementContext:"reference"}),c=F0(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:U0(c)}}}case"escaped":{const s=await cl(t,{...o,altBoundary:!0}),c=F0(s,n.floating);return{data:{escapedOffsets:c,escaped:U0(c)}}}default:return{}}}}};async function mz(e,t){const{placement:n,platform:a,elements:o}=e,s=await(a.isRTL==null?void 0:a.isRTL(o.floating)),c=oa(n),u=Ho(n),f=Ha(n)==="y",h=["left","top"].includes(c)?-1:1,m=s&&f?-1:1,g=ia(t,e);let{mainAxis:y,crossAxis:b,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof S=="number"&&(b=u==="end"?S*-1:S),f?{x:b*m,y:y*h}:{x:y*h,y:b*m}}const gz=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:o,y:s,placement:c,middlewareData:u}=t,f=await mz(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(a=u.arrow)!=null&&a.alignmentOffset?{}:{x:o+f.x,y:s+f.y,data:{...f,placement:c}}}}},vz=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:o}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:u={fn:_=>{let{x:N,y:C}=_;return{x:N,y:C}}},...f}=ia(e,t),h={x:n,y:a},m=await cl(t,f),g=Ha(oa(o)),y=bg(g);let b=h[y],S=h[g];if(s){const _=y==="y"?"top":"left",N=y==="y"?"bottom":"right",C=b+m[_],A=b-m[N];b=pm(C,b,A)}if(c){const _=g==="y"?"top":"left",N=g==="y"?"bottom":"right",C=S+m[_],A=S-m[N];S=pm(C,S,A)}const E=u.fn({...t,[y]:b,[g]:S});return{...E,data:{x:E.x-n,y:E.y-a,enabled:{[y]:s,[g]:c}}}}}},yz=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:o,rects:s,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:h=!0}=ia(e,t),m={x:n,y:a},g=Ha(o),y=bg(g);let b=m[y],S=m[g];const E=ia(u,t),_=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(f){const A=y==="y"?"height":"width",k=s.reference[y]-s.floating[A]+_.mainAxis,D=s.reference[y]+s.reference[A]-_.mainAxis;bD&&(b=D)}if(h){var N,C;const A=y==="y"?"width":"height",k=["top","left"].includes(oa(o)),D=s.reference[g]-s.floating[A]+(k&&((N=c.offset)==null?void 0:N[g])||0)+(k?0:_.crossAxis),M=s.reference[g]+s.reference[A]+(k?0:((C=c.offset)==null?void 0:C[g])||0)-(k?_.crossAxis:0);SM&&(S=M)}return{[y]:b,[g]:S}}}},bz=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:o,rects:s,platform:c,elements:u}=t,{apply:f=()=>{},...h}=ia(e,t),m=await cl(t,h),g=oa(o),y=Ho(o),b=Ha(o)==="y",{width:S,height:E}=s.floating;let _,N;g==="top"||g==="bottom"?(_=g,N=y===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(N=g,_=y==="end"?"top":"bottom");const C=E-m.top-m.bottom,A=S-m.left-m.right,k=Ia(E-m[_],C),D=Ia(S-m[N],A),M=!t.middlewareData.shift;let R=k,U=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(U=A),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(R=C),M&&!y){const I=On(m.left,0),q=On(m.right,0),Y=On(m.top,0),B=On(m.bottom,0);b?U=S-2*(I!==0||q!==0?I+q:On(m.left,m.right)):R=E-2*(Y!==0||B!==0?Y+B:On(m.top,m.bottom))}await f({...t,availableWidth:U,availableHeight:R});const L=await c.getDimensions(u.floating);return S!==L.width||E!==L.height?{reset:{rects:!0}}:{}}}};function od(){return typeof window<"u"}function $o(e){return FS(e)?(e.nodeName||"").toLowerCase():"#document"}function Ln(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Rr(e){var t;return(t=(FS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function FS(e){return od()?e instanceof Node||e instanceof Ln(e).Node:!1}function cr(e){return od()?e instanceof Element||e instanceof Ln(e).Element:!1}function Tr(e){return od()?e instanceof HTMLElement||e instanceof Ln(e).HTMLElement:!1}function B0(e){return!od()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ln(e).ShadowRoot}function El(e){const{overflow:t,overflowX:n,overflowY:a,display:o}=ur(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(o)}function xz(e){return["table","td","th"].includes($o(e))}function sd(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Eg(e){const t=Sg(),n=cr(e)?ur(e):e;return["transform","translate","scale","rotate","perspective"].some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(a=>(n.willChange||"").includes(a))||["paint","layout","strict","content"].some(a=>(n.contain||"").includes(a))}function wz(e){let t=$a(e);for(;Tr(t)&&!Oo(t);){if(Eg(t))return t;if(sd(t))return null;t=$a(t)}return null}function Sg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Oo(e){return["html","body","#document"].includes($o(e))}function ur(e){return Ln(e).getComputedStyle(e)}function ld(e){return cr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $a(e){if($o(e)==="html")return e;const t=e.assignedSlot||e.parentNode||B0(e)&&e.host||Rr(e);return B0(t)?t.host:t}function US(e){const t=$a(e);return Oo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Tr(t)&&El(t)?t:US(t)}function ul(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=US(e),s=o===((a=e.ownerDocument)==null?void 0:a.body),c=Ln(o);if(s){const u=gm(c);return t.concat(c,c.visualViewport||[],El(o)?o:[],u&&n?ul(u):[])}return t.concat(o,ul(o,[],n))}function gm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function BS(e){const t=ur(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const o=Tr(e),s=o?e.offsetWidth:n,c=o?e.offsetHeight:a,u=Au(n)!==s||Au(a)!==c;return u&&(n=s,a=c),{width:n,height:a,$:u}}function _g(e){return cr(e)?e:e.contextElement}function Do(e){const t=_g(e);if(!Tr(t))return Cr(1);const n=t.getBoundingClientRect(),{width:a,height:o,$:s}=BS(t);let c=(s?Au(n.width):n.width)/a,u=(s?Au(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const Ez=Cr(0);function IS(e){const t=Ln(e);return!Sg()||!t.visualViewport?Ez:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sz(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ln(e)?!1:t}function Ri(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=_g(e);let c=Cr(1);t&&(a?cr(a)&&(c=Do(a)):c=Do(e));const u=Sz(s,n,a)?IS(s):Cr(0);let f=(o.left+u.x)/c.x,h=(o.top+u.y)/c.y,m=o.width/c.x,g=o.height/c.y;if(s){const y=Ln(s),b=a&&cr(a)?Ln(a):a;let S=y,E=gm(S);for(;E&&a&&b!==S;){const _=Do(E),N=E.getBoundingClientRect(),C=ur(E),A=N.left+(E.clientLeft+parseFloat(C.paddingLeft))*_.x,k=N.top+(E.clientTop+parseFloat(C.paddingTop))*_.y;f*=_.x,h*=_.y,m*=_.x,g*=_.y,f+=A,h+=k,S=Ln(E),E=gm(S)}}return ku({width:m,height:g,x:f,y:h})}function Cg(e,t){const n=ld(e).scrollLeft;return t?t.left+n:Ri(Rr(e)).left+n}function HS(e,t,n){n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=a.left+t.scrollLeft-(n?0:Cg(e,a)),s=a.top+t.scrollTop;return{x:o,y:s}}function _z(e){let{elements:t,rect:n,offsetParent:a,strategy:o}=e;const s=o==="fixed",c=Rr(a),u=t?sd(t.floating):!1;if(a===c||u&&s)return n;let f={scrollLeft:0,scrollTop:0},h=Cr(1);const m=Cr(0),g=Tr(a);if((g||!g&&!s)&&(($o(a)!=="body"||El(c))&&(f=ld(a)),Tr(a))){const b=Ri(a);h=Do(a),m.x=b.x+a.clientLeft,m.y=b.y+a.clientTop}const y=c&&!g&&!s?HS(c,f,!0):Cr(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+m.x+y.x,y:n.y*h.y-f.scrollTop*h.y+m.y+y.y}}function Cz(e){return Array.from(e.getClientRects())}function Tz(e){const t=Rr(e),n=ld(e),a=e.ownerDocument.body,o=On(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),s=On(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let c=-n.scrollLeft+Cg(e);const u=-n.scrollTop;return ur(a).direction==="rtl"&&(c+=On(t.clientWidth,a.clientWidth)-o),{width:o,height:s,x:c,y:u}}function Rz(e,t){const n=Ln(e),a=Rr(e),o=n.visualViewport;let s=a.clientWidth,c=a.clientHeight,u=0,f=0;if(o){s=o.width,c=o.height;const h=Sg();(!h||h&&t==="fixed")&&(u=o.offsetLeft,f=o.offsetTop)}return{width:s,height:c,x:u,y:f}}function Az(e,t){const n=Ri(e,!0,t==="fixed"),a=n.top+e.clientTop,o=n.left+e.clientLeft,s=Tr(e)?Do(e):Cr(1),c=e.clientWidth*s.x,u=e.clientHeight*s.y,f=o*s.x,h=a*s.y;return{width:c,height:u,x:f,y:h}}function I0(e,t,n){let a;if(t==="viewport")a=Rz(e,n);else if(t==="document")a=Tz(Rr(e));else if(cr(t))a=Az(t,n);else{const o=IS(e);a={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ku(a)}function $S(e,t){const n=$a(e);return n===t||!cr(n)||Oo(n)?!1:ur(n).position==="fixed"||$S(n,t)}function Dz(e,t){const n=t.get(e);if(n)return n;let a=ul(e,[],!1).filter(u=>cr(u)&&$o(u)!=="body"),o=null;const s=ur(e).position==="fixed";let c=s?$a(e):e;for(;cr(c)&&!Oo(c);){const u=ur(c),f=Eg(c);!f&&u.position==="fixed"&&(o=null),(s?!f&&!o:!f&&u.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||El(c)&&!f&&$S(e,c))?a=a.filter(m=>m!==c):o=u,c=$a(c)}return t.set(e,a),a}function kz(e){let{element:t,boundary:n,rootBoundary:a,strategy:o}=e;const c=[...n==="clippingAncestors"?sd(t)?[]:Dz(t,this._c):[].concat(n),a],u=c[0],f=c.reduce((h,m)=>{const g=I0(t,m,o);return h.top=On(g.top,h.top),h.right=Ia(g.right,h.right),h.bottom=Ia(g.bottom,h.bottom),h.left=On(g.left,h.left),h},I0(t,u,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Nz(e){const{width:t,height:n}=BS(e);return{width:t,height:n}}function Oz(e,t,n){const a=Tr(t),o=Rr(t),s=n==="fixed",c=Ri(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const f=Cr(0);if(a||!a&&!s)if(($o(t)!=="body"||El(o))&&(u=ld(t)),a){const y=Ri(t,!0,s,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}else o&&(f.x=Cg(o));const h=o&&!a&&!s?HS(o,u):Cr(0),m=c.left+u.scrollLeft-f.x-h.x,g=c.top+u.scrollTop-f.y-h.y;return{x:m,y:g,width:c.width,height:c.height}}function tp(e){return ur(e).position==="static"}function H0(e,t){if(!Tr(e)||ur(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Rr(e)===n&&(n=n.ownerDocument.body),n}function VS(e,t){const n=Ln(e);if(sd(e))return n;if(!Tr(e)){let o=$a(e);for(;o&&!Oo(o);){if(cr(o)&&!tp(o))return o;o=$a(o)}return n}let a=H0(e,t);for(;a&&xz(a)&&tp(a);)a=H0(a,t);return a&&Oo(a)&&tp(a)&&!Eg(a)?n:a||wz(e)||n}const jz=async function(e){const t=this.getOffsetParent||VS,n=this.getDimensions,a=await n(e.floating);return{reference:Oz(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Lz(e){return ur(e).direction==="rtl"}const zz={convertOffsetParentRelativeRectToViewportRelativeRect:_z,getDocumentElement:Rr,getClippingRect:kz,getOffsetParent:VS,getElementRects:jz,getClientRects:Cz,getDimensions:Nz,getScale:Do,isElement:cr,isRTL:Lz};function qS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Mz(e,t){let n=null,a;const o=Rr(e);function s(){var u;clearTimeout(a),(u=n)==null||u.disconnect(),n=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),s();const h=e.getBoundingClientRect(),{left:m,top:g,width:y,height:b}=h;if(u||t(),!y||!b)return;const S=qc(g),E=qc(o.clientWidth-(m+y)),_=qc(o.clientHeight-(g+b)),N=qc(m),A={rootMargin:-S+"px "+-E+"px "+-_+"px "+-N+"px",threshold:On(0,Ia(1,f))||1};let k=!0;function D(M){const R=M[0].intersectionRatio;if(R!==f){if(!k)return c();R?c(!1,R):a=setTimeout(()=>{c(!1,1e-7)},1e3)}R===1&&!qS(h,e.getBoundingClientRect())&&c(),k=!1}try{n=new IntersectionObserver(D,{...A,root:o.ownerDocument})}catch{n=new IntersectionObserver(D,A)}n.observe(e)}return c(!0),s}function Pz(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=a,h=_g(e),m=o||s?[...h?ul(h):[],...ul(t)]:[];m.forEach(N=>{o&&N.addEventListener("scroll",n,{passive:!0}),s&&N.addEventListener("resize",n)});const g=h&&u?Mz(h,n):null;let y=-1,b=null;c&&(b=new ResizeObserver(N=>{let[C]=N;C&&C.target===h&&b&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var A;(A=b)==null||A.observe(t)})),n()}),h&&!f&&b.observe(h),b.observe(t));let S,E=f?Ri(e):null;f&&_();function _(){const N=Ri(e);E&&!qS(E,N)&&n(),E=N,S=requestAnimationFrame(_)}return n(),()=>{var N;m.forEach(C=>{o&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),g==null||g(),(N=b)==null||N.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const Gz=gz,Fz=vz,Uz=hz,Bz=bz,Iz=pz,$0=fz,Hz=yz,$z=(e,t,n)=>{const a=new Map,o={platform:zz,...n},s={...o.platform,_c:a};return dz(e,t,{...o,platform:s})};var pu=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Nu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,a,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;a--!==0;)if(!Nu(e[a],t[a]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,o[a]))return!1;for(a=n;a--!==0;){const s=o[a];if(!(s==="_owner"&&e.$$typeof)&&!Nu(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function YS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function V0(e,t){const n=YS(e);return Math.round(t*n)/n}function np(e){const t=w.useRef(e);return pu(()=>{t.current=e}),t}function Vz(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:o,elements:{reference:s,floating:c}={},transform:u=!0,whileElementsMounted:f,open:h}=e,[m,g]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,b]=w.useState(a);Nu(y,a)||b(a);const[S,E]=w.useState(null),[_,N]=w.useState(null),C=w.useCallback(j=>{j!==M.current&&(M.current=j,E(j))},[]),A=w.useCallback(j=>{j!==R.current&&(R.current=j,N(j))},[]),k=s||S,D=c||_,M=w.useRef(null),R=w.useRef(null),U=w.useRef(m),L=f!=null,I=np(f),q=np(o),Y=np(h),B=w.useCallback(()=>{if(!M.current||!R.current)return;const j={placement:t,strategy:n,middleware:y};q.current&&(j.platform=q.current),$z(M.current,R.current,j).then(K=>{const G={...K,isPositioned:Y.current!==!1};X.current&&!Nu(U.current,G)&&(U.current=G,xl.flushSync(()=>{g(G)}))})},[y,t,n,q,Y]);pu(()=>{h===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,g(j=>({...j,isPositioned:!1})))},[h]);const X=w.useRef(!1);pu(()=>(X.current=!0,()=>{X.current=!1}),[]),pu(()=>{if(k&&(M.current=k),D&&(R.current=D),k&&D){if(I.current)return I.current(k,D,B);B()}},[k,D,B,I,L]);const ne=w.useMemo(()=>({reference:M,floating:R,setReference:C,setFloating:A}),[C,A]),F=w.useMemo(()=>({reference:k,floating:D}),[k,D]),z=w.useMemo(()=>{const j={position:n,left:0,top:0};if(!F.floating)return j;const K=V0(F.floating,m.x),G=V0(F.floating,m.y);return u?{...j,transform:"translate("+K+"px, "+G+"px)",...YS(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:G}},[n,u,F.floating,m.x,m.y]);return w.useMemo(()=>({...m,update:B,refs:ne,elements:F,floatingStyles:z}),[m,B,ne,F,z])}const qz=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:a,padding:o}=typeof e=="function"?e(n):e;return a&&t(a)?a.current!=null?$0({element:a.current,padding:o}).fn(n):{}:a?$0({element:a,padding:o}).fn(n):{}}}},Yz=(e,t)=>({...Gz(e),options:[e,t]}),Wz=(e,t)=>({...Fz(e),options:[e,t]}),Xz=(e,t)=>({...Hz(e),options:[e,t]}),Kz=(e,t)=>({...Uz(e),options:[e,t]}),Zz=(e,t)=>({...Bz(e),options:[e,t]}),Qz=(e,t)=>({...Iz(e),options:[e,t]}),Jz=(e,t)=>({...qz(e),options:[e,t]});var eM="Arrow",WS=w.forwardRef((e,t)=>{const{children:n,width:a=10,height:o=5,...s}=e;return x.jsx(Ie.svg,{...s,ref:t,width:a,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});WS.displayName=eM;var tM=WS;function XS(e){const[t,n]=w.useState(void 0);return sn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let c,u;if("borderBoxSize"in s){const f=s.borderBoxSize,h=Array.isArray(f)?f[0]:f;c=h.inlineSize,u=h.blockSize}else c=e.offsetWidth,u=e.offsetHeight;n({width:c,height:u})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else n(void 0)},[e]),t}var Tg="Popper",[KS,Vo]=Kn(Tg),[nM,ZS]=KS(Tg),QS=e=>{const{__scopePopper:t,children:n}=e,[a,o]=w.useState(null);return x.jsx(nM,{scope:t,anchor:a,onAnchorChange:o,children:n})};QS.displayName=Tg;var JS="PopperAnchor",e_=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...o}=e,s=ZS(JS,n),c=w.useRef(null),u=nt(t,c);return w.useEffect(()=>{s.onAnchorChange((a==null?void 0:a.current)||c.current)}),a?null:x.jsx(Ie.div,{...o,ref:u})});e_.displayName=JS;var Rg="PopperContent",[rM,aM]=KS(Rg),t_=w.forwardRef((e,t)=>{var ie,oe,Ce,he,Se,be;const{__scopePopper:n,side:a="bottom",sideOffset:o=0,align:s="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:h=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:S,...E}=e,_=ZS(Rg,n),[N,C]=w.useState(null),A=nt(t,Le=>C(Le)),[k,D]=w.useState(null),M=XS(k),R=(M==null?void 0:M.width)??0,U=(M==null?void 0:M.height)??0,L=a+(s!=="center"?"-"+s:""),I=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},q=Array.isArray(h)?h:[h],Y=q.length>0,B={padding:I,boundary:q.filter(oM),altBoundary:Y},{refs:X,floatingStyles:ne,placement:F,isPositioned:z,middlewareData:j}=Vz({strategy:"fixed",placement:L,whileElementsMounted:(...Le)=>Pz(...Le,{animationFrame:b==="always"}),elements:{reference:_.anchor},middleware:[Yz({mainAxis:o+U,alignmentAxis:c}),f&&Wz({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?Xz():void 0,...B}),f&&Kz({...B}),Zz({...B,apply:({elements:Le,rects:Te,availableWidth:ye,availableHeight:J})=>{const{width:le,height:_e}=Te.reference,pe=Le.floating.style;pe.setProperty("--radix-popper-available-width",`${ye}px`),pe.setProperty("--radix-popper-available-height",`${J}px`),pe.setProperty("--radix-popper-anchor-width",`${le}px`),pe.setProperty("--radix-popper-anchor-height",`${_e}px`)}}),k&&Jz({element:k,padding:u}),sM({arrowWidth:R,arrowHeight:U}),y&&Qz({strategy:"referenceHidden",...B})]}),[K,G]=a_(F),H=Zt(S);sn(()=>{z&&(H==null||H())},[z,H]);const O=(ie=j.arrow)==null?void 0:ie.x,$=(oe=j.arrow)==null?void 0:oe.y,W=((Ce=j.arrow)==null?void 0:Ce.centerOffset)!==0,[re,de]=w.useState();return sn(()=>{N&&de(window.getComputedStyle(N).zIndex)},[N]),x.jsx("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:z?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(he=j.transformOrigin)==null?void 0:he.x,(Se=j.transformOrigin)==null?void 0:Se.y].join(" "),...((be=j.hide)==null?void 0:be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(rM,{scope:n,placedSide:K,onArrowChange:D,arrowX:O,arrowY:$,shouldHideArrow:W,children:x.jsx(Ie.div,{"data-side":K,"data-align":G,...E,ref:A,style:{...E.style,animation:z?void 0:"none"}})})})});t_.displayName=Rg;var n_="PopperArrow",iM={top:"bottom",right:"left",bottom:"top",left:"right"},r_=w.forwardRef(function(t,n){const{__scopePopper:a,...o}=t,s=aM(n_,a),c=iM[s.placedSide];return x.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:x.jsx(tM,{...o,ref:n,style:{...o.style,display:"block"}})})});r_.displayName=n_;function oM(e){return e!==null}var sM=e=>({name:"transformOrigin",options:e,fn(t){var _,N,C;const{placement:n,rects:a,middlewareData:o}=t,c=((_=o.arrow)==null?void 0:_.centerOffset)!==0,u=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,m]=a_(n),g={start:"0%",center:"50%",end:"100%"}[m],y=(((N=o.arrow)==null?void 0:N.x)??0)+u/2,b=(((C=o.arrow)==null?void 0:C.y)??0)+f/2;let S="",E="";return h==="bottom"?(S=c?g:`${y}px`,E=`${-f}px`):h==="top"?(S=c?g:`${y}px`,E=`${a.floating.height+f}px`):h==="right"?(S=`${-f}px`,E=c?g:`${b}px`):h==="left"&&(S=`${a.floating.width+f}px`,E=c?g:`${b}px`),{data:{x:S,y:E}}}});function a_(e){const[t,n="center"]=e.split("-");return[t,n]}var Ag=QS,cd=e_,Dg=t_,kg=r_,lM="VisuallyHidden",Ng=w.forwardRef((e,t)=>x.jsx(Ie.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Ng.displayName=lM;var cM=Ng,[ud,$6]=Kn("Tooltip",[Vo]),dd=Vo(),i_="TooltipProvider",uM=700,vm="tooltip.open",[dM,Og]=ud(i_),o_=e=>{const{__scopeTooltip:t,delayDuration:n=uM,skipDelayDuration:a=300,disableHoverableContent:o=!1,children:s}=e,[c,u]=w.useState(!0),f=w.useRef(!1),h=w.useRef(0);return w.useEffect(()=>{const m=h.current;return()=>window.clearTimeout(m)},[]),x.jsx(dM,{scope:t,isOpenDelayed:c,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(h.current),u(!1)},[]),onClose:w.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>u(!0),a)},[a]),isPointerInTransitRef:f,onPointerInTransitChange:w.useCallback(m=>{f.current=m},[]),disableHoverableContent:o,children:s})};o_.displayName=i_;var fd="Tooltip",[fM,hd]=ud(fd),s_=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:c,delayDuration:u}=e,f=Og(fd,e.__scopeTooltip),h=dd(t),[m,g]=w.useState(null),y=on(),b=w.useRef(0),S=c??f.disableHoverableContent,E=u??f.delayDuration,_=w.useRef(!1),[N=!1,C]=aa({prop:a,defaultProp:o,onChange:R=>{R?(f.onOpen(),document.dispatchEvent(new CustomEvent(vm))):f.onClose(),s==null||s(R)}}),A=w.useMemo(()=>N?_.current?"delayed-open":"instant-open":"closed",[N]),k=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,_.current=!1,C(!0)},[C]),D=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C(!1)},[C]),M=w.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{_.current=!0,C(!0),b.current=0},E)},[E,C]);return w.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),x.jsx(Ag,{...h,children:x.jsx(fM,{scope:t,contentId:y,open:N,stateAttribute:A,trigger:m,onTriggerChange:g,onTriggerEnter:w.useCallback(()=>{f.isOpenDelayed?M():k()},[f.isOpenDelayed,M,k]),onTriggerLeave:w.useCallback(()=>{S?D():(window.clearTimeout(b.current),b.current=0)},[D,S]),onOpen:k,onClose:D,disableHoverableContent:S,children:n})})};s_.displayName=fd;var ym="TooltipTrigger",l_=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,o=hd(ym,n),s=Og(ym,n),c=dd(n),u=w.useRef(null),f=nt(t,u,o.onTriggerChange),h=w.useRef(!1),m=w.useRef(!1),g=w.useCallback(()=>h.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),x.jsx(cd,{asChild:!0,...c,children:x.jsx(Ie.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...a,ref:f,onPointerMove:Be(e.onPointerMove,y=>{y.pointerType!=="touch"&&!m.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:Be(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:Be(e.onPointerDown,()=>{h.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Be(e.onFocus,()=>{h.current||o.onOpen()}),onBlur:Be(e.onBlur,o.onClose),onClick:Be(e.onClick,o.onClose)})})});l_.displayName=ym;var hM="TooltipPortal",[V6,pM]=ud(hM,{forceMount:void 0}),jo="TooltipContent",c_=w.forwardRef((e,t)=>{const n=pM(jo,e.__scopeTooltip),{forceMount:a=n.forceMount,side:o="top",...s}=e,c=hd(jo,e.__scopeTooltip);return x.jsx(zn,{present:a||c.open,children:c.disableHoverableContent?x.jsx(u_,{side:o,...s,ref:t}):x.jsx(mM,{side:o,...s,ref:t})})}),mM=w.forwardRef((e,t)=>{const n=hd(jo,e.__scopeTooltip),a=Og(jo,e.__scopeTooltip),o=w.useRef(null),s=nt(t,o),[c,u]=w.useState(null),{trigger:f,onClose:h}=n,m=o.current,{onPointerInTransitChange:g}=a,y=w.useCallback(()=>{u(null),g(!1)},[g]),b=w.useCallback((S,E)=>{const _=S.currentTarget,N={x:S.clientX,y:S.clientY},C=bM(N,_.getBoundingClientRect()),A=xM(N,C),k=wM(E.getBoundingClientRect()),D=SM([...A,...k]);u(D),g(!0)},[g]);return w.useEffect(()=>()=>y(),[y]),w.useEffect(()=>{if(f&&m){const S=_=>b(_,m),E=_=>b(_,f);return f.addEventListener("pointerleave",S),m.addEventListener("pointerleave",E),()=>{f.removeEventListener("pointerleave",S),m.removeEventListener("pointerleave",E)}}},[f,m,b,y]),w.useEffect(()=>{if(c){const S=E=>{const _=E.target,N={x:E.clientX,y:E.clientY},C=(f==null?void 0:f.contains(_))||(m==null?void 0:m.contains(_)),A=!EM(N,c);C?y():A&&(y(),h())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[f,m,c,h,y]),x.jsx(u_,{...e,ref:s})}),[gM,vM]=ud(fd,{isInside:!1}),u_=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:c,...u}=e,f=hd(jo,n),h=dd(n),{onClose:m}=f;return w.useEffect(()=>(document.addEventListener(vm,m),()=>document.removeEventListener(vm,m)),[m]),w.useEffect(()=>{if(f.trigger){const g=y=>{const b=y.target;b!=null&&b.contains(f.trigger)&&m()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[f.trigger,m]),x.jsx(wl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:m,children:x.jsxs(Dg,{"data-state":f.stateAttribute,...h,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[x.jsx(sg,{children:a}),x.jsx(gM,{scope:n,isInside:!0,children:x.jsx(cM,{id:f.contentId,role:"tooltip",children:o||a})})]})})});c_.displayName=jo;var d_="TooltipArrow",yM=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,o=dd(n);return vM(d_,n).isInside?null:x.jsx(kg,{...o,...a,ref:t})});yM.displayName=d_;function bM(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,a,o,s)){case s:return"left";case o:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function xM(e,t,n=5){const a=[];switch(t){case"top":a.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":a.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":a.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":a.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return a}function wM(e){const{top:t,right:n,bottom:a,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:a},{x:o,y:a}]}function EM(e,t){const{x:n,y:a}=e;let o=!1;for(let s=0,c=t.length-1;sa!=m>a&&n<(h-u)*(a-f)/(m-f)+u&&(o=!o)}return o}function SM(e){const t=e.slice();return t.sort((n,a)=>n.xa.x?1:n.ya.y?1:0),_M(t)}function _M(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a=2;){const s=t[t.length-1],c=t[t.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const o=e[a];for(;n.length>=2;){const s=n[n.length-1],c=n[n.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var CM=o_,TM=s_,RM=l_,f_=c_;const h_=CM,p_=TM,m_=RM,AM=e=>typeof e!="string"?e:e.split("\\n").map((t,n)=>x.jsxs(w.Fragment,{children:[t,nx.jsx(f_,{ref:o,sideOffset:t,className:Oe("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 mx-1 max-w-sm overflow-hidden rounded-md border px-3 py-2 text-sm shadow-md",e),...a,children:typeof n=="string"?AM(n):n}));jg.displayName=f_.displayName;const Ou=sE("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-8"}},defaultVariants:{variant:"default",size:"default"}}),wt=w.forwardRef(({className:e,variant:t,tooltip:n,size:a,side:o="right",asChild:s=!1,...c},u)=>{const f=s?Ba:"button";return n?x.jsx(h_,{children:x.jsxs(p_,{children:[x.jsx(m_,{asChild:!0,children:x.jsx(f,{className:Oe(Ou({variant:t,size:a,className:e}),"cursor-pointer"),ref:u,...c})}),x.jsx(jg,{side:o,children:n})]})}):x.jsx(f,{className:Oe(Ou({variant:t,size:a,className:e}),"cursor-pointer"),ref:u,...c})});wt.displayName="Button";const DM=tz,kM=nz,g_=w.forwardRef(({className:e,...t},n)=>x.jsx(OS,{className:Oe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t,ref:n}));g_.displayName=OS.displayName;const v_=w.forwardRef(({className:e,...t},n)=>x.jsxs(kM,{children:[x.jsx(g_,{}),x.jsx(jS,{ref:n,className:Oe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...t})]}));v_.displayName=jS.displayName;const y_=({className:e,...t})=>x.jsx("div",{className:Oe("flex flex-col space-y-2 text-center sm:text-left",e),...t});y_.displayName="AlertDialogHeader";const b_=w.forwardRef(({className:e,...t},n)=>x.jsx(MS,{ref:n,className:Oe("text-lg font-semibold",e),...t}));b_.displayName=MS.displayName;const x_=w.forwardRef(({className:e,...t},n)=>x.jsx(PS,{ref:n,className:Oe("text-muted-foreground text-sm",e),...t}));x_.displayName=PS.displayName;const NM=w.forwardRef(({className:e,...t},n)=>x.jsx(LS,{ref:n,className:Oe(Ou(),e),...t}));NM.displayName=LS.displayName;const OM=w.forwardRef(({className:e,...t},n)=>x.jsx(zS,{ref:n,className:Oe(Ou({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));OM.displayName=zS.displayName;const Ai=w.forwardRef(({className:e,type:t,...n},a)=>x.jsx("input",{type:t,className:Oe("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...n}));Ai.displayName="Input";var jM=e=>{switch(e){case"success":return MM;case"info":return GM;case"warning":return PM;case"error":return FM;default:return null}},LM=Array(12).fill(0),zM=({visible:e,className:t})=>ve.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ve.createElement("div",{className:"sonner-spinner"},LM.map((n,a)=>ve.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),MM=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),PM=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),GM=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),FM=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),UM=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ve.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ve.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),BM=()=>{let[e,t]=ve.useState(document.hidden);return ve.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},bm=1,IM=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...a}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:bm++,s=this.toasts.find(u=>u.id===o),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),s?this.toasts=this.toasts.map(u=>u.id===o?(this.publish({...u,...e,id:o,title:n}),{...u,...e,id:o,dismissible:c,title:n}):u):this.addToast({title:n,...a,dismissible:c,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let a=e instanceof Promise?e:e(),o=n!==void 0,s,c=a.then(async f=>{if(s=["resolve",f],ve.isValidElement(f))o=!1,this.create({id:n,type:"default",message:f});else if($M(f)&&!f.ok){o=!1;let h=typeof t.error=="function"?await t.error(`HTTP error! status: ${f.status}`):t.error,m=typeof t.description=="function"?await t.description(`HTTP error! status: ${f.status}`):t.description;this.create({id:n,type:"error",message:h,description:m})}else if(t.success!==void 0){o=!1;let h=typeof t.success=="function"?await t.success(f):t.success,m=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"success",message:h,description:m})}}).catch(async f=>{if(s=["reject",f],t.error!==void 0){o=!1;let h=typeof t.error=="function"?await t.error(f):t.error,m=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"error",message:h,description:m})}}).finally(()=>{var f;o&&(this.dismiss(n),n=void 0),(f=t.finally)==null||f.call(t)}),u=()=>new Promise((f,h)=>c.then(()=>s[0]==="reject"?h(s[1]):f(s[1])).catch(h));return typeof n!="string"&&typeof n!="number"?{unwrap:u}:Object.assign(n,{unwrap:u})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||bm++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},xn=new IM,HM=(e,t)=>{let n=(t==null?void 0:t.id)||bm++;return xn.addToast({title:e,...t,id:n}),n},$M=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",VM=HM,qM=()=>xn.toasts,YM=()=>xn.getActiveToasts(),an=Object.assign(VM,{success:xn.success,info:xn.info,warning:xn.warning,error:xn.error,custom:xn.custom,message:xn.message,promise:xn.promise,dismiss:xn.dismiss,loading:xn.loading},{getHistory:qM,getToasts:YM});function WM(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t==="top"&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}WM(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} +`);function Yc(e){return e.label!==void 0}var XM=3,KM="32px",ZM="16px",q0=4e3,QM=356,JM=14,eP=20,tP=200;function ar(...e){return e.filter(Boolean).join(" ")}function nP(e){let[t,n]=e.split("-"),a=[];return t&&a.push(t),n&&a.push(n),a}var rP=e=>{var t,n,a,o,s,c,u,f,h,m,g;let{invert:y,toast:b,unstyled:S,interacting:E,setHeights:_,visibleToasts:N,heights:C,index:A,toasts:k,expanded:D,removeToast:M,defaultRichColors:R,closeButton:U,style:L,cancelButtonStyle:I,actionButtonStyle:q,className:Y="",descriptionClassName:B="",duration:X,position:ne,gap:F,loadingIcon:z,expandByDefault:j,classNames:K,icons:G,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:O}=e,[$,W]=ve.useState(null),[re,de]=ve.useState(null),[ie,oe]=ve.useState(!1),[Ce,he]=ve.useState(!1),[Se,be]=ve.useState(!1),[Le,Te]=ve.useState(!1),[ye,J]=ve.useState(!1),[le,_e]=ve.useState(0),[pe,Ee]=ve.useState(0),te=ve.useRef(b.duration||X||q0),Fe=ve.useRef(null),Pe=ve.useRef(null),me=A===0,Ae=A+1<=N,je=b.type,He=b.dismissible!==!1,it=b.className||"",Ct=b.descriptionClassName||"",bt=ve.useMemo(()=>C.findIndex(qe=>qe.toastId===b.id)||0,[C,b.id]),qt=ve.useMemo(()=>{var qe;return(qe=b.closeButton)!=null?qe:U},[b.closeButton,U]),fn=ve.useMemo(()=>b.duration||X||q0,[b.duration,X]),Gt=ve.useRef(0),at=ve.useRef(0),Tn=ve.useRef(0),xt=ve.useRef(null),[Lt,Wa]=ne.split("-"),ji=ve.useMemo(()=>C.reduce((qe,lt,pt)=>pt>=bt?qe:qe+lt.height,0),[C,bt]),Ol=BM(),Li=b.invert||y,ca=je==="loading";at.current=ve.useMemo(()=>bt*F+ji,[bt,ji]),ve.useEffect(()=>{te.current=fn},[fn]),ve.useEffect(()=>{oe(!0)},[]),ve.useEffect(()=>{let qe=Pe.current;if(qe){let lt=qe.getBoundingClientRect().height;return Ee(lt),_(pt=>[{toastId:b.id,height:lt,position:b.position},...pt]),()=>_(pt=>pt.filter(hn=>hn.toastId!==b.id))}},[_,b.id]),ve.useLayoutEffect(()=>{if(!ie)return;let qe=Pe.current,lt=qe.style.height;qe.style.height="auto";let pt=qe.getBoundingClientRect().height;qe.style.height=lt,Ee(pt),_(hn=>hn.find(ln=>ln.toastId===b.id)?hn.map(ln=>ln.toastId===b.id?{...ln,height:pt}:ln):[{toastId:b.id,height:pt,position:b.position},...hn])},[ie,b.title,b.description,_,b.id]);let Jt=ve.useCallback(()=>{he(!0),_e(at.current),_(qe=>qe.filter(lt=>lt.toastId!==b.id)),setTimeout(()=>{M(b)},tP)},[b,M,_,at]);ve.useEffect(()=>{if(b.promise&&je==="loading"||b.duration===1/0||b.type==="loading")return;let qe;return D||E||O&&Ol?(()=>{if(Tn.current{var lt;(lt=b.onAutoClose)==null||lt.call(b,b),Jt()},te.current)),()=>clearTimeout(qe)},[D,E,b,je,O,Ol,Jt]),ve.useEffect(()=>{b.delete&&Jt()},[Jt,b.delete]);function zi(){var qe,lt,pt;return G!=null&&G.loading?ve.createElement("div",{className:ar(K==null?void 0:K.loader,(qe=b==null?void 0:b.classNames)==null?void 0:qe.loader,"sonner-loader"),"data-visible":je==="loading"},G.loading):z?ve.createElement("div",{className:ar(K==null?void 0:K.loader,(lt=b==null?void 0:b.classNames)==null?void 0:lt.loader,"sonner-loader"),"data-visible":je==="loading"},z):ve.createElement(zM,{className:ar(K==null?void 0:K.loader,(pt=b==null?void 0:b.classNames)==null?void 0:pt.loader),visible:je==="loading"})}return ve.createElement("li",{tabIndex:0,ref:Pe,className:ar(Y,it,K==null?void 0:K.toast,(t=b==null?void 0:b.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[je],(n=b==null?void 0:b.classNames)==null?void 0:n[je]),"data-sonner-toast":"","data-rich-colors":(a=b.richColors)!=null?a:R,"data-styled":!(b.jsx||b.unstyled||S),"data-mounted":ie,"data-promise":!!b.promise,"data-swiped":ye,"data-removed":Ce,"data-visible":Ae,"data-y-position":Lt,"data-x-position":Wa,"data-index":A,"data-front":me,"data-swiping":Se,"data-dismissible":He,"data-type":je,"data-invert":Li,"data-swipe-out":Le,"data-swipe-direction":re,"data-expanded":!!(D||j&&ie),style:{"--index":A,"--toasts-before":A,"--z-index":k.length-A,"--offset":`${Ce?le:at.current}px`,"--initial-height":j?"auto":`${pe}px`,...L,...b.style},onDragEnd:()=>{be(!1),W(null),xt.current=null},onPointerDown:qe=>{ca||!He||(Fe.current=new Date,_e(at.current),qe.target.setPointerCapture(qe.pointerId),qe.target.tagName!=="BUTTON"&&(be(!0),xt.current={x:qe.clientX,y:qe.clientY}))},onPointerUp:()=>{var qe,lt,pt,hn;if(Le||!He)return;xt.current=null;let ln=Number(((qe=Pe.current)==null?void 0:qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),pn=Number(((lt=Pe.current)==null?void 0:lt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Nr=new Date().getTime()-((pt=Fe.current)==null?void 0:pt.getTime()),mn=$==="x"?ln:pn,Jn=Math.abs(mn)/Nr;if(Math.abs(mn)>=eP||Jn>.11){_e(at.current),(hn=b.onDismiss)==null||hn.call(b,b),de($==="x"?ln>0?"right":"left":pn>0?"down":"up"),Jt(),Te(!0),J(!1);return}be(!1),W(null)},onPointerMove:qe=>{var lt,pt,hn,ln;if(!xt.current||!He||((lt=window.getSelection())==null?void 0:lt.toString().length)>0)return;let pn=qe.clientY-xt.current.y,Nr=qe.clientX-xt.current.x,mn=(pt=e.swipeDirections)!=null?pt:nP(ne);!$&&(Math.abs(Nr)>1||Math.abs(pn)>1)&&W(Math.abs(Nr)>Math.abs(pn)?"x":"y");let Jn={x:0,y:0};$==="y"?(mn.includes("top")||mn.includes("bottom"))&&(mn.includes("top")&&pn<0||mn.includes("bottom")&&pn>0)&&(Jn.y=pn):$==="x"&&(mn.includes("left")||mn.includes("right"))&&(mn.includes("left")&&Nr<0||mn.includes("right")&&Nr>0)&&(Jn.x=Nr),(Math.abs(Jn.x)>0||Math.abs(Jn.y)>0)&&J(!0),(hn=Pe.current)==null||hn.style.setProperty("--swipe-amount-x",`${Jn.x}px`),(ln=Pe.current)==null||ln.style.setProperty("--swipe-amount-y",`${Jn.y}px`)}},qt&&!b.jsx?ve.createElement("button",{"aria-label":H,"data-disabled":ca,"data-close-button":!0,onClick:ca||!He?()=>{}:()=>{var qe;Jt(),(qe=b.onDismiss)==null||qe.call(b,b)},className:ar(K==null?void 0:K.closeButton,(o=b==null?void 0:b.classNames)==null?void 0:o.closeButton)},(s=G==null?void 0:G.close)!=null?s:UM):null,b.jsx||w.isValidElement(b.title)?b.jsx?b.jsx:typeof b.title=="function"?b.title():b.title:ve.createElement(ve.Fragment,null,je||b.icon||b.promise?ve.createElement("div",{"data-icon":"",className:ar(K==null?void 0:K.icon,(c=b==null?void 0:b.classNames)==null?void 0:c.icon)},b.promise||b.type==="loading"&&!b.icon?b.icon||zi():null,b.type!=="loading"?b.icon||(G==null?void 0:G[je])||jM(je):null):null,ve.createElement("div",{"data-content":"",className:ar(K==null?void 0:K.content,(u=b==null?void 0:b.classNames)==null?void 0:u.content)},ve.createElement("div",{"data-title":"",className:ar(K==null?void 0:K.title,(f=b==null?void 0:b.classNames)==null?void 0:f.title)},typeof b.title=="function"?b.title():b.title),b.description?ve.createElement("div",{"data-description":"",className:ar(B,Ct,K==null?void 0:K.description,(h=b==null?void 0:b.classNames)==null?void 0:h.description)},typeof b.description=="function"?b.description():b.description):null),w.isValidElement(b.cancel)?b.cancel:b.cancel&&Yc(b.cancel)?ve.createElement("button",{"data-button":!0,"data-cancel":!0,style:b.cancelButtonStyle||I,onClick:qe=>{var lt,pt;Yc(b.cancel)&&He&&((pt=(lt=b.cancel).onClick)==null||pt.call(lt,qe),Jt())},className:ar(K==null?void 0:K.cancelButton,(m=b==null?void 0:b.classNames)==null?void 0:m.cancelButton)},b.cancel.label):null,w.isValidElement(b.action)?b.action:b.action&&Yc(b.action)?ve.createElement("button",{"data-button":!0,"data-action":!0,style:b.actionButtonStyle||q,onClick:qe=>{var lt,pt;Yc(b.action)&&((pt=(lt=b.action).onClick)==null||pt.call(lt,qe),!qe.defaultPrevented&&Jt())},className:ar(K==null?void 0:K.actionButton,(g=b==null?void 0:b.classNames)==null?void 0:g.actionButton)},b.action.label):null))};function Y0(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function aP(e,t){let n={};return[e,t].forEach((a,o)=>{let s=o===1,c=s?"--mobile-offset":"--offset",u=s?ZM:KM;function f(h){["top","right","bottom","left"].forEach(m=>{n[`${c}-${m}`]=typeof h=="number"?`${h}px`:h})}typeof a=="number"||typeof a=="string"?f(a):typeof a=="object"?["top","right","bottom","left"].forEach(h=>{a[h]===void 0?n[`${c}-${h}`]=u:n[`${c}-${h}`]=typeof a[h]=="number"?`${a[h]}px`:a[h]}):f(u)}),n}var iP=w.forwardRef(function(e,t){let{invert:n,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:c,className:u,offset:f,mobileOffset:h,theme:m="light",richColors:g,duration:y,style:b,visibleToasts:S=XM,toastOptions:E,dir:_=Y0(),gap:N=JM,loadingIcon:C,icons:A,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:D}=e,[M,R]=ve.useState([]),U=ve.useMemo(()=>Array.from(new Set([a].concat(M.filter(O=>O.position).map(O=>O.position)))),[M,a]),[L,I]=ve.useState([]),[q,Y]=ve.useState(!1),[B,X]=ve.useState(!1),[ne,F]=ve.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=ve.useRef(null),j=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=ve.useRef(null),G=ve.useRef(!1),H=ve.useCallback(O=>{R($=>{var W;return(W=$.find(re=>re.id===O.id))!=null&&W.delete||xn.dismiss(O.id),$.filter(({id:re})=>re!==O.id)})},[]);return ve.useEffect(()=>xn.subscribe(O=>{if(O.dismiss){R($=>$.map(W=>W.id===O.id?{...W,delete:!0}:W));return}setTimeout(()=>{$E.flushSync(()=>{R($=>{let W=$.findIndex(re=>re.id===O.id);return W!==-1?[...$.slice(0,W),{...$[W],...O},...$.slice(W+1)]:[O,...$]})})})}),[]),ve.useEffect(()=>{if(m!=="system"){F(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;let O=window.matchMedia("(prefers-color-scheme: dark)");try{O.addEventListener("change",({matches:$})=>{F($?"dark":"light")})}catch{O.addListener(({matches:W})=>{try{F(W?"dark":"light")}catch(re){console.error(re)}})}},[m]),ve.useEffect(()=>{M.length<=1&&Y(!1)},[M]),ve.useEffect(()=>{let O=$=>{var W,re;o.every(de=>$[de]||$.code===de)&&(Y(!0),(W=z.current)==null||W.focus()),$.code==="Escape"&&(document.activeElement===z.current||(re=z.current)!=null&&re.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[o]),ve.useEffect(()=>{if(z.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,G.current=!1)}},[z.current]),ve.createElement("section",{ref:t,"aria-label":`${k} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((O,$)=>{var W;let[re,de]=O.split("-");return M.length?ve.createElement("ol",{key:O,dir:_==="auto"?Y0():_,tabIndex:-1,ref:z,className:u,"data-sonner-toaster":!0,"data-theme":ne,"data-y-position":re,"data-lifted":q&&M.length>1&&!s,"data-x-position":de,style:{"--front-toast-height":`${((W=L[0])==null?void 0:W.height)||0}px`,"--width":`${QM}px`,"--gap":`${N}px`,...b,...aP(f,h)},onBlur:ie=>{G.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(G.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||G.current||(G.current=!0,K.current=ie.relatedTarget)},onMouseEnter:()=>Y(!0),onMouseMove:()=>Y(!0),onMouseLeave:()=>{B||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||X(!0)},onPointerUp:()=>X(!1)},M.filter(ie=>!ie.position&&$===0||ie.position===O).map((ie,oe)=>{var Ce,he;return ve.createElement(rP,{key:ie.id,icons:A,index:oe,toast:ie,defaultRichColors:g,duration:(Ce=E==null?void 0:E.duration)!=null?Ce:y,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:n,visibleToasts:S,closeButton:(he=E==null?void 0:E.closeButton)!=null?he:c,interacting:B,position:O,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,removeToast:H,toasts:M.filter(Se=>Se.position==ie.position),heights:L.filter(Se=>Se.position==ie.position),setHeights:I,expandByDefault:s,gap:N,loadingIcon:C,expanded:q,pauseWhenPageIsHidden:D,swipeDirections:e.swipeDirections})})):null}))});const oP=()=>{const[e,t]=w.useState(!0),n=Ye.use.apiKey(),[a,o]=w.useState(""),s=En.use.message();w.useEffect(()=>{o(n||"")},[n,e]),w.useEffect(()=>{s&&(s.includes(ME)||s.includes(PE))&&t(!0)},[s,t]);const c=w.useCallback(async()=>{if(Ye.setState({apiKey:a||null}),await En.getState().check()){t(!1);return}an.error("API Key is invalid")},[a]),u=w.useCallback(f=>{o(f.target.value)},[o]);return x.jsx(DM,{open:e,onOpenChange:t,children:x.jsxs(v_,{children:[x.jsxs(y_,{children:[x.jsx(b_,{children:"API Key is required"}),x.jsx(x_,{children:"Please enter your API key"})]}),x.jsxs("form",{className:"flex gap-2",onSubmit:f=>f.preventDefault(),children:[x.jsx(Ai,{type:"password",value:a,onChange:u,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"}),x.jsx(wt,{onClick:c,variant:"outline",size:"sm",children:"Save"})]})]})})};var Lg="Popover",[w_,q6]=Kn(Lg,[Vo]),Sl=Vo(),[sP,Va]=w_(Lg),E_=e=>{const{__scopePopover:t,children:n,open:a,defaultOpen:o,onOpenChange:s,modal:c=!1}=e,u=Sl(t),f=w.useRef(null),[h,m]=w.useState(!1),[g=!1,y]=aa({prop:a,defaultProp:o,onChange:s});return x.jsx(Ag,{...u,children:x.jsx(sP,{scope:t,contentId:on(),triggerRef:f,open:g,onOpenChange:y,onOpenToggle:w.useCallback(()=>y(b=>!b),[y]),hasCustomAnchor:h,onCustomAnchorAdd:w.useCallback(()=>m(!0),[]),onCustomAnchorRemove:w.useCallback(()=>m(!1),[]),modal:c,children:n})})};E_.displayName=Lg;var S_="PopoverAnchor",lP=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=Va(S_,n),s=Sl(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:u}=o;return w.useEffect(()=>(c(),()=>u()),[c,u]),x.jsx(cd,{...s,...a,ref:t})});lP.displayName=S_;var __="PopoverTrigger",C_=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=Va(__,n),s=Sl(n),c=nt(t,o.triggerRef),u=x.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":k_(o.open),...a,ref:c,onClick:Be(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?u:x.jsx(cd,{asChild:!0,...s,children:u})});C_.displayName=__;var zg="PopoverPortal",[cP,uP]=w_(zg,{forceMount:void 0}),T_=e=>{const{__scopePopover:t,forceMount:n,children:a,container:o}=e,s=Va(zg,t);return x.jsx(cP,{scope:t,forceMount:n,children:x.jsx(zn,{present:n||s.open,children:x.jsx(td,{asChild:!0,container:o,children:a})})})};T_.displayName=zg;var Lo="PopoverContent",R_=w.forwardRef((e,t)=>{const n=uP(Lo,e.__scopePopover),{forceMount:a=n.forceMount,...o}=e,s=Va(Lo,e.__scopePopover);return x.jsx(zn,{present:a||s.open,children:s.modal?x.jsx(dP,{...o,ref:t}):x.jsx(fP,{...o,ref:t})})});R_.displayName=Lo;var dP=w.forwardRef((e,t)=>{const n=Va(Lo,e.__scopePopover),a=w.useRef(null),o=nt(t,a),s=w.useRef(!1);return w.useEffect(()=>{const c=a.current;if(c)return cg(c)},[]),x.jsx(rd,{as:Ba,allowPinchZoom:!0,children:x.jsx(A_,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),s.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Be(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,h=u.button===2||f;s.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Be(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),fP=w.forwardRef((e,t)=>{const n=Va(Lo,e.__scopePopover),a=w.useRef(!1),o=w.useRef(!1);return x.jsx(A_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,s),s.defaultPrevented||(a.current||(u=n.triggerRef.current)==null||u.focus(),s.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:s=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,s),s.defaultPrevented||(a.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=s.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),A_=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,...g}=e,y=Va(Lo,n),b=Sl(n);return lg(),x.jsx(ed,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:x.jsx(wl,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:m,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>y.onOpenChange(!1),children:x.jsx(Dg,{"data-state":k_(y.open),role:"dialog",id:y.contentId,...b,...g,ref:t,style:{...g.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),D_="PopoverClose",hP=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=Va(D_,n);return x.jsx(Ie.button,{type:"button",...a,ref:t,onClick:Be(e.onClick,()=>o.onOpenChange(!1))})});hP.displayName=D_;var pP="PopoverArrow",mP=w.forwardRef((e,t)=>{const{__scopePopover:n,...a}=e,o=Sl(n);return x.jsx(kg,{...o,...a,ref:t})});mP.displayName=pP;function k_(e){return e?"open":"closed"}var gP=E_,vP=C_,yP=T_,N_=R_;const pd=gP,md=vP,_l=w.forwardRef(({className:e,align:t="center",sideOffset:n=4,...a},o)=>x.jsx(yP,{children:x.jsx(N_,{ref:o,align:t,sideOffset:n,className:Oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-4 shadow-md outline-none",e),...a})}));_l.displayName=N_.displayName;const bP=({status:e})=>e?x.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"Storage Info"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"Working Directory:"}),x.jsx("span",{className:"truncate",children:e.working_directory}),x.jsx("span",{children:"Input Directory:"}),x.jsx("span",{className:"truncate",children:e.input_directory})]})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"LLM Binding:"}),x.jsx("span",{children:e.configuration.llm_binding}),x.jsx("span",{children:"LLM Binding Host:"}),x.jsx("span",{children:e.configuration.llm_binding_host}),x.jsx("span",{children:"LLM Model:"}),x.jsx("span",{children:e.configuration.llm_model}),x.jsx("span",{children:"Max Tokens:"}),x.jsx("span",{children:e.configuration.max_tokens})]})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"Embedding Binding:"}),x.jsx("span",{children:e.configuration.embedding_binding}),x.jsx("span",{children:"Embedding Binding Host:"}),x.jsx("span",{children:e.configuration.embedding_binding_host}),x.jsx("span",{children:"Embedding Model:"}),x.jsx("span",{children:e.configuration.embedding_model})]})]}),x.jsxs("div",{className:"space-y-1",children:[x.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),x.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[x.jsx("span",{children:"KV Storage:"}),x.jsx("span",{children:e.configuration.kv_storage}),x.jsx("span",{children:"Doc Status Storage:"}),x.jsx("span",{children:e.configuration.doc_status_storage}),x.jsx("span",{children:"Graph Storage:"}),x.jsx("span",{children:e.configuration.graph_storage}),x.jsx("span",{children:"Vector Storage:"}),x.jsx("span",{children:e.configuration.vector_storage})]})]})]}):x.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),xP=()=>{const e=En.use.health(),t=En.use.lastCheckTime(),n=En.use.status(),[a,o]=w.useState(!1);return w.useEffect(()=>{o(!0);const s=setTimeout(()=>o(!1),300);return()=>clearTimeout(s)},[t]),x.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:x.jsxs(pd,{children:[x.jsx(md,{asChild:!0,children:x.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[x.jsx("div",{className:Oe("h-3 w-3 rounded-full transition-all duration-300","shadow-[0_0_8px_rgba(0,0,0,0.2)]",e?"bg-green-500":"bg-red-500",a&&"scale-125",a&&e&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",a&&!e&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),x.jsx("span",{className:"text-muted-foreground text-xs",children:e?"Connected":"Disconnected"})]})}),x.jsx(_l,{className:"w-auto",side:"top",align:"end",children:x.jsx(bP,{status:n})})]})})},O_=()=>{const e=w.useContext(oE);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function wP(){const{theme:e,setTheme:t}=O_(),n=w.useCallback(()=>t("light"),[t]),a=w.useCallback(()=>t("dark"),[t]);return e==="dark"?x.jsx(wt,{onClick:n,variant:_r,tooltip:"Switch to light theme",size:"icon",side:"bottom",children:x.jsx(JO,{})}):x.jsx(wt,{onClick:a,variant:_r,tooltip:"Switch to dark theme",size:"icon",side:"bottom",children:x.jsx(hj,{})})}function j_(e){const t=e+"CollectionProvider",[n,a]=Kn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=b=>{const{scope:S,children:E}=b,_=ve.useRef(null),N=ve.useRef(new Map).current;return x.jsx(o,{scope:S,itemMap:N,collectionRef:_,children:E})};c.displayName=t;const u=e+"CollectionSlot",f=ve.forwardRef((b,S)=>{const{scope:E,children:_}=b,N=s(u,E),C=nt(S,N.collectionRef);return x.jsx(Ba,{ref:C,children:_})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=ve.forwardRef((b,S)=>{const{scope:E,children:_,...N}=b,C=ve.useRef(null),A=nt(S,C),k=s(h,E);return ve.useEffect(()=>(k.itemMap.set(C,{ref:C,...N}),()=>void k.itemMap.delete(C))),x.jsx(Ba,{[m]:"",ref:A,children:_})});g.displayName=h;function y(b){const S=s(e+"CollectionConsumer",b);return ve.useCallback(()=>{const _=S.collectionRef.current;if(!_)return[];const N=Array.from(_.querySelectorAll(`[${m}]`));return Array.from(S.itemMap.values()).sort((k,D)=>N.indexOf(k.ref.current)-N.indexOf(D.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:c,Slot:f,ItemSlot:g},y,a]}var EP=w.createContext(void 0);function gd(e){const t=w.useContext(EP);return e||t||"ltr"}var rp="rovingFocusGroup.onEntryFocus",SP={bubbles:!1,cancelable:!0},vd="RovingFocusGroup",[xm,L_,_P]=j_(vd),[CP,z_]=Kn(vd,[_P]),[TP,RP]=CP(vd),M_=w.forwardRef((e,t)=>x.jsx(xm.Provider,{scope:e.__scopeRovingFocusGroup,children:x.jsx(xm.Slot,{scope:e.__scopeRovingFocusGroup,children:x.jsx(AP,{...e,ref:t})})}));M_.displayName=vd;var AP=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:h,preventScrollOnEntryFocus:m=!1,...g}=e,y=w.useRef(null),b=nt(t,y),S=gd(s),[E=null,_]=aa({prop:c,defaultProp:u,onChange:f}),[N,C]=w.useState(!1),A=Zt(h),k=L_(n),D=w.useRef(!1),[M,R]=w.useState(0);return w.useEffect(()=>{const U=y.current;if(U)return U.addEventListener(rp,A),()=>U.removeEventListener(rp,A)},[A]),x.jsx(TP,{scope:n,orientation:a,dir:S,loop:o,currentTabStopId:E,onItemFocus:w.useCallback(U=>_(U),[_]),onItemShiftTab:w.useCallback(()=>C(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(U=>U+1),[]),onFocusableItemRemove:w.useCallback(()=>R(U=>U-1),[]),children:x.jsx(Ie.div,{tabIndex:N||M===0?-1:0,"data-orientation":a,...g,ref:b,style:{outline:"none",...e.style},onMouseDown:Be(e.onMouseDown,()=>{D.current=!0}),onFocus:Be(e.onFocus,U=>{const L=!D.current;if(U.target===U.currentTarget&&L&&!N){const I=new CustomEvent(rp,SP);if(U.currentTarget.dispatchEvent(I),!I.defaultPrevented){const q=k().filter(F=>F.focusable),Y=q.find(F=>F.active),B=q.find(F=>F.id===E),ne=[Y,B,...q].filter(Boolean).map(F=>F.ref.current);F_(ne,m)}}D.current=!1}),onBlur:Be(e.onBlur,()=>C(!1))})})}),P_="RovingFocusGroupItem",G_=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:o=!1,tabStopId:s,...c}=e,u=on(),f=s||u,h=RP(P_,n),m=h.currentTabStopId===f,g=L_(n),{onFocusableItemAdd:y,onFocusableItemRemove:b}=h;return w.useEffect(()=>{if(a)return y(),()=>b()},[a,y,b]),x.jsx(xm.ItemSlot,{scope:n,id:f,focusable:a,active:o,children:x.jsx(Ie.span,{tabIndex:m?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Be(e.onMouseDown,S=>{a?h.onItemFocus(f):S.preventDefault()}),onFocus:Be(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Be(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){h.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const E=NP(S,h.orientation,h.dir);if(E!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let N=g().filter(C=>C.focusable).map(C=>C.ref.current);if(E==="last")N.reverse();else if(E==="prev"||E==="next"){E==="prev"&&N.reverse();const C=N.indexOf(S.currentTarget);N=h.loop?OP(N,C+1):N.slice(C+1)}setTimeout(()=>F_(N))}})})})});G_.displayName=P_;var DP={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kP(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function NP(e,t,n){const a=kP(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return DP[a]}function F_(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function OP(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var jP=M_,LP=G_,Mg="Tabs",[zP,Y6]=Kn(Mg,[z_]),U_=z_(),[MP,Pg]=zP(Mg),B_=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:o,defaultValue:s,orientation:c="horizontal",dir:u,activationMode:f="automatic",...h}=e,m=gd(u),[g,y]=aa({prop:a,onChange:o,defaultProp:s});return x.jsx(MP,{scope:n,baseId:on(),value:g,onValueChange:y,orientation:c,dir:m,activationMode:f,children:x.jsx(Ie.div,{dir:m,"data-orientation":c,...h,ref:t})})});B_.displayName=Mg;var I_="TabsList",H_=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...o}=e,s=Pg(I_,n),c=U_(n);return x.jsx(jP,{asChild:!0,...c,orientation:s.orientation,dir:s.dir,loop:a,children:x.jsx(Ie.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});H_.displayName=I_;var $_="TabsTrigger",V_=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:o=!1,...s}=e,c=Pg($_,n),u=U_(n),f=W_(c.baseId,a),h=X_(c.baseId,a),m=a===c.value;return x.jsx(LP,{asChild:!0,...u,focusable:!o,active:m,children:x.jsx(Ie.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":h,"data-state":m?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:f,...s,ref:t,onMouseDown:Be(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?c.onValueChange(a):g.preventDefault()}),onKeyDown:Be(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&c.onValueChange(a)}),onFocus:Be(e.onFocus,()=>{const g=c.activationMode!=="manual";!m&&!o&&g&&c.onValueChange(a)})})})});V_.displayName=$_;var q_="TabsContent",Y_=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:o,children:s,...c}=e,u=Pg(q_,n),f=W_(u.baseId,a),h=X_(u.baseId,a),m=a===u.value,g=w.useRef(m);return w.useEffect(()=>{const y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),x.jsx(zn,{present:o||m,children:({present:y})=>x.jsx(Ie.div,{"data-state":m?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!y,id:h,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:y&&s})})});Y_.displayName=q_;function W_(e,t){return`${e}-trigger-${t}`}function X_(e,t){return`${e}-content-${t}`}var PP=B_,K_=H_,Z_=V_,Q_=Y_;const GP=PP,J_=w.forwardRef(({className:e,...t},n)=>x.jsx(K_,{ref:n,className:Oe("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));J_.displayName=K_.displayName;const eC=w.forwardRef(({className:e,...t},n)=>x.jsx(Z_,{ref:n,className:Oe("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-sm px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm",e),...t}));eC.displayName=Z_.displayName;const rl=w.forwardRef(({className:e,...t},n)=>x.jsx(Q_,{ref:n,className:Oe("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...t}));rl.displayName=Q_.displayName;function Wc({value:e,currentTab:t,children:n}){return x.jsx(eC,{value:e,className:Oe("cursor-pointer px-2 py-1 transition-all",t===e?"!bg-emerald-400 !text-zinc-50":"hover:bg-background/60"),children:n})}function FP(){const e=Ye.use.currentTab();return x.jsx("div",{className:"flex h-8 self-center",children:x.jsxs(J_,{className:"h-full gap-2",children:[x.jsx(Wc,{value:"documents",currentTab:e,children:"Documents"}),x.jsx(Wc,{value:"knowledge-graph",currentTab:e,children:"Knowledge Graph"}),x.jsx(Wc,{value:"retrieval",currentTab:e,children:"Retrieval"}),x.jsx(Wc,{value:"api",currentTab:e,children:"API"})]})})}function UP(){return x.jsxs("header",{className:"border-border/40 bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-50 flex h-10 w-full border-b px-4 backdrop-blur",children:[x.jsxs("a",{href:"/",className:"mr-6 flex items-center gap-2",children:[x.jsx(vj,{className:"size-4 text-emerald-400","aria-hidden":"true"}),x.jsx("span",{className:"font-bold md:inline-block",children:l0.name})]}),x.jsx("div",{className:"flex h-10 flex-1 justify-center",children:x.jsx(FP,{})}),x.jsxs("nav",{className:"flex items-center",children:[x.jsx(wt,{variant:"ghost",size:"icon",side:"bottom",tooltip:"Project Repository",children:x.jsx("a",{href:l0.github,target:"_blank",rel:"noopener noreferrer",children:x.jsx(IO,{className:"size-4","aria-hidden":"true"})})}),x.jsx(wP,{})]})]})}var Xc={exports:{}},W0;function BP(){if(W0)return Xc.exports;W0=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(D,M,R){return Function.prototype.apply.call(D,M,R)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(D){return Object.getOwnPropertyNames(D).concat(Object.getOwnPropertySymbols(D))}:n=function(D){return Object.getOwnPropertyNames(D)};function a(k){console&&console.warn&&console.warn(k)}var o=Number.isNaN||function(D){return D!==D};function s(){s.init.call(this)}Xc.exports=s,Xc.exports.once=N,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function u(k){if(typeof k!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof k)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(k){if(typeof k!="number"||k<0||o(k))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+k+".");c=k}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(D){if(typeof D!="number"||D<0||o(D))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+D+".");return this._maxListeners=D,this};function f(k){return k._maxListeners===void 0?s.defaultMaxListeners:k._maxListeners}s.prototype.getMaxListeners=function(){return f(this)},s.prototype.emit=function(D){for(var M=[],R=1;R0&&(I=M[0]),I instanceof Error)throw I;var q=new Error("Unhandled error."+(I?" ("+I.message+")":""));throw q.context=I,q}var Y=L[D];if(Y===void 0)return!1;if(typeof Y=="function")t(Y,this,M);else for(var B=Y.length,X=S(Y,B),R=0;R0&&I.length>U&&!I.warned){I.warned=!0;var q=new Error("Possible EventEmitter memory leak detected. "+I.length+" "+String(D)+" listeners added. Use emitter.setMaxListeners() to increase limit");q.name="MaxListenersExceededWarning",q.emitter=k,q.type=D,q.count=I.length,a(q)}return k}s.prototype.addListener=function(D,M){return h(this,D,M,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(D,M){return h(this,D,M,!0)};function m(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function g(k,D,M){var R={fired:!1,wrapFn:void 0,target:k,type:D,listener:M},U=m.bind(R);return U.listener=M,R.wrapFn=U,U}s.prototype.once=function(D,M){return u(M),this.on(D,g(this,D,M)),this},s.prototype.prependOnceListener=function(D,M){return u(M),this.prependListener(D,g(this,D,M)),this},s.prototype.removeListener=function(D,M){var R,U,L,I,q;if(u(M),U=this._events,U===void 0)return this;if(R=U[D],R===void 0)return this;if(R===M||R.listener===M)--this._eventsCount===0?this._events=Object.create(null):(delete U[D],U.removeListener&&this.emit("removeListener",D,R.listener||M));else if(typeof R!="function"){for(L=-1,I=R.length-1;I>=0;I--)if(R[I]===M||R[I].listener===M){q=R[I].listener,L=I;break}if(L<0)return this;L===0?R.shift():E(R,L),R.length===1&&(U[D]=R[0]),U.removeListener!==void 0&&this.emit("removeListener",D,q||M)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(D){var M,R,U;if(R=this._events,R===void 0)return this;if(R.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):R[D]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[D]),this;if(arguments.length===0){var L=Object.keys(R),I;for(U=0;U=0;U--)this.removeListener(D,M[U]);return this};function y(k,D,M){var R=k._events;if(R===void 0)return[];var U=R[D];return U===void 0?[]:typeof U=="function"?M?[U.listener||U]:[U]:M?_(U):S(U,U.length)}s.prototype.listeners=function(D){return y(this,D,!0)},s.prototype.rawListeners=function(D){return y(this,D,!1)},s.listenerCount=function(k,D){return typeof k.listenerCount=="function"?k.listenerCount(D):b.call(k,D)},s.prototype.listenerCount=b;function b(k){var D=this._events;if(D!==void 0){var M=D[k];if(typeof M=="function")return 1;if(M!==void 0)return M.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function S(k,D){for(var M=new Array(D),R=0;Re++}function ra(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let a=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(a=t.next(),a.done){t=null;continue}break}while(!0);return a}}}function qo(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class Gg extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class De extends Gg{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,De.prototype.constructor)}}class Re extends Gg{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Re.prototype.constructor)}}class $e extends Gg{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,$e.prototype.constructor)}}function rC(e,t){this.key=e,this.attributes=t,this.clear()}rC.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function aC(e,t){this.key=e,this.attributes=t,this.clear()}aC.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function iC(e,t){this.key=e,this.attributes=t,this.clear()}iC.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Yo(e,t,n,a,o){this.key=t,this.attributes=o,this.undirected=e,this.source=n,this.target=a}Yo.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,a=this.target.key;this.source[e][a]=this,!(this.undirected&&n===a)&&(this.target[t][n]=this)};Yo.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,a=this.target.key;this.undirected&&(e=t="undirected");const o=this.source[e],s=o[a];if(typeof s>"u"){o[a]=this,this.undirected&&n===a||(this.target[t][n]=this);return}s.previous=this,this.next=s,o[a]=this,this.target[t][n]=this};Yo.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",a="in";this.undirected&&(n=a="undirected"),delete this.source[n][t],delete this.target[a][e]};Yo.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",a="in";this.undirected&&(n=a="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[a][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[a][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const oC=0,sC=1,$P=2,lC=3;function la(e,t,n,a,o,s,c){let u,f,h,m;if(a=""+a,n===oC){if(u=e._nodes.get(a),!u)throw new Re(`Graph.${t}: could not find the "${a}" node in the graph.`);h=o,m=s}else if(n===lC){if(o=""+o,f=e._edges.get(o),!f)throw new Re(`Graph.${t}: could not find the "${o}" edge in the graph.`);const g=f.source.key,y=f.target.key;if(a===g)u=f.target;else if(a===y)u=f.source;else throw new Re(`Graph.${t}: the "${a}" node is not attached to the "${o}" edge (${g}, ${y}).`);h=s,m=c}else{if(f=e._edges.get(a),!f)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`);n===sC?u=f.source:u=f.target,h=o,m=s}return[u,h,m]}function VP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);return c.attributes[u]}}function qP(e,t,n){e.prototype[t]=function(a,o){const[s]=la(this,t,n,a,o);return s.attributes}}function YP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);return c.attributes.hasOwnProperty(u)}}function WP(e,t,n){e.prototype[t]=function(a,o,s,c){const[u,f,h]=la(this,t,n,a,o,s,c);return u.attributes[f]=h,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function XP(e,t,n){e.prototype[t]=function(a,o,s,c){const[u,f,h]=la(this,t,n,a,o,s,c);if(typeof h!="function")throw new De(`Graph.${t}: updater should be a function.`);const m=u.attributes,g=h(m[f]);return m[f]=g,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function KP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);return delete c.attributes[u],this.emit("nodeAttributesUpdated",{key:c.key,type:"remove",attributes:c.attributes,name:u}),this}}function ZP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);if(!Qt(u))throw new De(`Graph.${t}: provided attributes are not a plain object.`);return c.attributes=u,this.emit("nodeAttributesUpdated",{key:c.key,type:"replace",attributes:c.attributes}),this}}function QP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);if(!Qt(u))throw new De(`Graph.${t}: provided attributes are not a plain object.`);return Pt(c.attributes,u),this.emit("nodeAttributesUpdated",{key:c.key,type:"merge",attributes:c.attributes,data:u}),this}}function JP(e,t,n){e.prototype[t]=function(a,o,s){const[c,u]=la(this,t,n,a,o,s);if(typeof u!="function")throw new De(`Graph.${t}: provided updater is not a function.`);return c.attributes=u(c.attributes),this.emit("nodeAttributesUpdated",{key:c.key,type:"update",attributes:c.attributes}),this}}const e4=[{name:e=>`get${e}Attribute`,attacher:VP},{name:e=>`get${e}Attributes`,attacher:qP},{name:e=>`has${e}Attribute`,attacher:YP},{name:e=>`set${e}Attribute`,attacher:WP},{name:e=>`update${e}Attribute`,attacher:XP},{name:e=>`remove${e}Attribute`,attacher:KP},{name:e=>`replace${e}Attributes`,attacher:ZP},{name:e=>`merge${e}Attributes`,attacher:QP},{name:e=>`update${e}Attributes`,attacher:JP}];function t4(e){e4.forEach(function({name:t,attacher:n}){n(e,t("Node"),oC),n(e,t("Source"),sC),n(e,t("Target"),$P),n(e,t("Opposite"),lC)})}function n4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return s.attributes[o]}}function r4(e,t,n){e.prototype[t]=function(a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new $e(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+a,c=""+arguments[1];if(o=Xn(this,s,c,n),!o)throw new Re(`Graph.${t}: could not find an edge for the given path ("${s}" - "${c}").`)}else{if(n!=="mixed")throw new $e(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,o=this._edges.get(a),!o)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return o.attributes}}function a4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return s.attributes.hasOwnProperty(o)}}function i4(e,t,n){e.prototype[t]=function(a,o,s){let c;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new $e(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+a,f=""+o;if(o=arguments[2],s=arguments[3],c=Xn(this,u,f,n),!c)throw new Re(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new $e(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,c=this._edges.get(a),!c)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return c.attributes[o]=s,this.emit("edgeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:o}),this}}function o4(e,t,n){e.prototype[t]=function(a,o,s){let c;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new $e(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+a,f=""+o;if(o=arguments[2],s=arguments[3],c=Xn(this,u,f,n),!c)throw new Re(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new $e(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,c=this._edges.get(a),!c)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(typeof s!="function")throw new De(`Graph.${t}: updater should be a function.`);return c.attributes[o]=s(c.attributes[o]),this.emit("edgeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:o}),this}}function s4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}return delete s.attributes[o],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:o}),this}}function l4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(!Qt(o))throw new De(`Graph.${t}: provided attributes are not a plain object.`);return s.attributes=o,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function c4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(!Qt(o))throw new De(`Graph.${t}: provided attributes are not a plain object.`);return Pt(s.attributes,o),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:o}),this}}function u4(e,t,n){e.prototype[t]=function(a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new $e(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new $e(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,u=""+o;if(o=arguments[2],s=Xn(this,c,u,n),!s)throw new Re(`Graph.${t}: could not find an edge for the given path ("${c}" - "${u}").`)}else{if(n!=="mixed")throw new $e(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,s=this._edges.get(a),!s)throw new Re(`Graph.${t}: could not find the "${a}" edge in the graph.`)}if(typeof o!="function")throw new De(`Graph.${t}: provided updater is not a function.`);return s.attributes=o(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const d4=[{name:e=>`get${e}Attribute`,attacher:n4},{name:e=>`get${e}Attributes`,attacher:r4},{name:e=>`has${e}Attribute`,attacher:a4},{name:e=>`set${e}Attribute`,attacher:i4},{name:e=>`update${e}Attribute`,attacher:o4},{name:e=>`remove${e}Attribute`,attacher:s4},{name:e=>`replace${e}Attributes`,attacher:l4},{name:e=>`merge${e}Attributes`,attacher:c4},{name:e=>`update${e}Attributes`,attacher:u4}];function f4(e){d4.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const h4=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function p4(e,t,n,a){let o=!1;for(const s in t){if(s===a)continue;const c=t[s];if(o=n(c.key,c.attributes,c.source.key,c.target.key,c.source.attributes,c.target.attributes,c.undirected),e&&o)return c.key}}function m4(e,t,n,a){let o,s,c,u=!1;for(const f in t)if(f!==a){o=t[f];do{if(s=o.source,c=o.target,u=n(o.key,o.attributes,s.key,c.key,s.attributes,c.attributes,o.undirected),e&&u)return o.key;o=o.next}while(o!==void 0)}}function ap(e,t){const n=Object.keys(e),a=n.length;let o,s=0;return{[Symbol.iterator](){return this},next(){do if(o)o=o.next;else{if(s>=a)return{done:!0};const c=n[s++];if(c===t){o=void 0;continue}o=e[c]}while(!o);return{done:!1,value:{edge:o.key,attributes:o.attributes,source:o.source.key,target:o.target.key,sourceAttributes:o.source.attributes,targetAttributes:o.target.attributes,undirected:o.undirected}}}}}function g4(e,t,n,a){const o=t[n];if(!o)return;const s=o.source,c=o.target;if(a(o.key,o.attributes,s.key,c.key,s.attributes,c.attributes,o.undirected)&&e)return o.key}function v4(e,t,n,a){let o=t[n];if(!o)return;let s=!1;do{if(s=a(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&s)return o.key;o=o.next}while(o!==void 0)}function ip(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const o={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:o}}};let a=!1;return{[Symbol.iterator](){return this},next(){return a===!0?{done:!0}:(a=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function y4(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return Array.from(e._edges.keys());const n=t==="undirected"?e.undirectedSize:e.directedSize,a=new Array(n),o=t==="undirected",s=e._edges.values();let c=0,u,f;for(;u=s.next(),u.done!==!0;)f=u.value,f.undirected===o&&(a[c++]=f.key);return a}function cC(e,t,n,a){if(t.size===0)return;const o=n!=="mixed"&&n!==t.type,s=n==="undirected";let c,u,f=!1;const h=t._edges.values();for(;c=h.next(),c.done!==!0;){if(u=c.value,o&&u.undirected!==s)continue;const{key:m,attributes:g,source:y,target:b}=u;if(f=a(m,g,y.key,b.key,y.attributes,b.attributes,u.undirected),e&&f)return m}}function b4(e,t){if(e.size===0)return qo();const n=t!=="mixed"&&t!==e.type,a=t==="undirected",o=e._edges.values();return{[Symbol.iterator](){return this},next(){let s,c;for(;;){if(s=o.next(),s.done)return s;if(c=s.value,!(n&&c.undirected!==a))break}return{value:{edge:c.key,attributes:c.attributes,source:c.source.key,target:c.target.key,sourceAttributes:c.source.attributes,targetAttributes:c.target.attributes,undirected:c.undirected},done:!1}}}}function Fg(e,t,n,a,o,s){const c=t?m4:p4;let u;if(n!=="undirected"&&(a!=="out"&&(u=c(e,o.in,s),e&&u)||a!=="in"&&(u=c(e,o.out,s,a?void 0:o.key),e&&u))||n!=="directed"&&(u=c(e,o.undirected,s),e&&u))return u}function x4(e,t,n,a){const o=[];return Fg(!1,e,t,n,a,function(s){o.push(s)}),o}function w4(e,t,n){let a=qo();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(a=ra(a,ap(n.in))),t!=="in"&&typeof n.out<"u"&&(a=ra(a,ap(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(a=ra(a,ap(n.undirected))),a}function Ug(e,t,n,a,o,s,c){const u=n?v4:g4;let f;if(t!=="undirected"&&(typeof o.in<"u"&&a!=="out"&&(f=u(e,o.in,s,c),e&&f)||typeof o.out<"u"&&a!=="in"&&(a||o.key!==s)&&(f=u(e,o.out,s,c),e&&f))||t!=="directed"&&typeof o.undirected<"u"&&(f=u(e,o.undirected,s,c),e&&f))return f}function E4(e,t,n,a,o){const s=[];return Ug(!1,e,t,n,a,o,function(c){s.push(c)}),s}function S4(e,t,n,a){let o=qo();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&a in n.in&&(o=ra(o,ip(n.in,a))),typeof n.out<"u"&&t!=="in"&&a in n.out&&(t||n.key!==a)&&(o=ra(o,ip(n.out,a)))),e!=="directed"&&typeof n.undirected<"u"&&a in n.undirected&&(o=ra(o,ip(n.undirected,a))),o}function _4(e,t){const{name:n,type:a,direction:o}=t;e.prototype[n]=function(s,c){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return[];if(!arguments.length)return y4(this,a);if(arguments.length===1){s=""+s;const u=this._nodes.get(s);if(typeof u>"u")throw new Re(`Graph.${n}: could not find the "${s}" node in the graph.`);return x4(this.multi,a==="mixed"?this.type:a,o,u)}if(arguments.length===2){s=""+s,c=""+c;const u=this._nodes.get(s);if(!u)throw new Re(`Graph.${n}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(c))throw new Re(`Graph.${n}: could not find the "${c}" target node in the graph.`);return E4(a,this.multi,o,u,c)}throw new De(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function C4(e,t){const{name:n,type:a,direction:o}=t,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(h,m,g){if(!(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)){if(arguments.length===1)return g=h,cC(!1,this,a,g);if(arguments.length===2){h=""+h,g=m;const y=this._nodes.get(h);if(typeof y>"u")throw new Re(`Graph.${s}: could not find the "${h}" node in the graph.`);return Fg(!1,this.multi,a==="mixed"?this.type:a,o,y,g)}if(arguments.length===3){h=""+h,m=""+m;const y=this._nodes.get(h);if(!y)throw new Re(`Graph.${s}: could not find the "${h}" source node in the graph.`);if(!this._nodes.has(m))throw new Re(`Graph.${s}: could not find the "${m}" target node in the graph.`);return Ug(!1,a,this.multi,o,y,m,g)}throw new De(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const c="map"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){const h=Array.prototype.slice.call(arguments),m=h.pop();let g;if(h.length===0){let y=0;a!=="directed"&&(y+=this.undirectedSize),a!=="undirected"&&(y+=this.directedSize),g=new Array(y);let b=0;h.push((S,E,_,N,C,A,k)=>{g[b++]=m(S,E,_,N,C,A,k)})}else g=[],h.push((y,b,S,E,_,N,C)=>{g.push(m(y,b,S,E,_,N,C))});return this[s].apply(this,h),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){const h=Array.prototype.slice.call(arguments),m=h.pop(),g=[];return h.push((y,b,S,E,_,N,C)=>{m(y,b,S,E,_,N,C)&&g.push(y)}),this[s].apply(this,h),g};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(){let h=Array.prototype.slice.call(arguments);if(h.length<2||h.length>4)throw new De(`Graph.${f}: invalid number of arguments (expecting 2, 3 or 4 and got ${h.length}).`);if(typeof h[h.length-1]=="function"&&typeof h[h.length-2]!="function")throw new De(`Graph.${f}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let m,g;h.length===2?(m=h[0],g=h[1],h=[]):h.length===3?(m=h[1],g=h[2],h=[h[0]]):h.length===4&&(m=h[2],g=h[3],h=[h[0],h[1]]);let y=g;return h.push((b,S,E,_,N,C,A)=>{y=m(y,b,S,E,_,N,C,A)}),this[s].apply(this,h),y}}function T4(e,t){const{name:n,type:a,direction:o}=t,s="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(f,h,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return!1;if(arguments.length===1)return m=f,cC(!0,this,a,m);if(arguments.length===2){f=""+f,m=h;const g=this._nodes.get(f);if(typeof g>"u")throw new Re(`Graph.${s}: could not find the "${f}" node in the graph.`);return Fg(!0,this.multi,a==="mixed"?this.type:a,o,g,m)}if(arguments.length===3){f=""+f,h=""+h;const g=this._nodes.get(f);if(!g)throw new Re(`Graph.${s}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(h))throw new Re(`Graph.${s}: could not find the "${h}" target node in the graph.`);return Ug(!0,a,this.multi,o,g,h,m)}throw new De(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const c="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[c]=function(){const f=Array.prototype.slice.call(arguments),h=f.pop();return f.push((g,y,b,S,E,_,N)=>h(g,y,b,S,E,_,N)),!!this[s].apply(this,f)};const u="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[u]=function(){const f=Array.prototype.slice.call(arguments),h=f.pop();return f.push((g,y,b,S,E,_,N)=>!h(g,y,b,S,E,_,N)),!this[s].apply(this,f)}}function R4(e,t){const{name:n,type:a,direction:o}=t,s=n.slice(0,-1)+"Entries";e.prototype[s]=function(c,u){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return qo();if(!arguments.length)return b4(this,a);if(arguments.length===1){c=""+c;const f=this._nodes.get(c);if(!f)throw new Re(`Graph.${s}: could not find the "${c}" node in the graph.`);return w4(a,o,f)}if(arguments.length===2){c=""+c,u=""+u;const f=this._nodes.get(c);if(!f)throw new Re(`Graph.${s}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(u))throw new Re(`Graph.${s}: could not find the "${u}" target node in the graph.`);return S4(a,o,f,u)}throw new De(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function A4(e){h4.forEach(t=>{_4(e,t),C4(e,t),T4(e,t),R4(e,t)})}const D4=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function yd(){this.A=null,this.B=null}yd.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};yd.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Xs(e,t,n,a,o){for(const s in a){const c=a[s],u=c.source,f=c.target,h=u===n?f:u;if(t&&t.has(h.key))continue;const m=o(h.key,h.attributes);if(e&&m)return h.key}}function Bg(e,t,n,a,o){if(t!=="mixed"){if(t==="undirected")return Xs(e,null,a,a.undirected,o);if(typeof n=="string")return Xs(e,null,a,a[n],o)}const s=new yd;let c;if(t!=="undirected"){if(n!=="out"){if(c=Xs(e,null,a,a.in,o),e&&c)return c;s.wrap(a.in)}if(n!=="in"){if(c=Xs(e,s,a,a.out,o),e&&c)return c;s.wrap(a.out)}}if(t!=="directed"&&(c=Xs(e,s,a,a.undirected,o),e&&c))return c}function k4(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const a=[];return Bg(!1,e,t,n,function(o){a.push(o)}),a}function Ks(e,t,n){const a=Object.keys(n),o=a.length;let s=0;return{[Symbol.iterator](){return this},next(){let c=null;do{if(s>=o)return e&&e.wrap(n),{done:!0};const u=n[a[s++]],f=u.source,h=u.target;if(c=f===t?h:f,e&&e.has(c.key)){c=null;continue}}while(c===null);return{done:!1,value:{neighbor:c.key,attributes:c.attributes}}}}}function N4(e,t,n){if(e!=="mixed"){if(e==="undirected")return Ks(null,n,n.undirected);if(typeof t=="string")return Ks(null,n,n[t])}let a=qo();const o=new yd;return e!=="undirected"&&(t!=="out"&&(a=ra(a,Ks(o,n,n.in))),t!=="in"&&(a=ra(a,Ks(o,n,n.out)))),e!=="directed"&&(a=ra(a,Ks(o,n,n.undirected))),a}function O4(e,t){const{name:n,type:a,direction:o}=t;e.prototype[n]=function(s){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return[];s=""+s;const c=this._nodes.get(s);if(typeof c>"u")throw new Re(`Graph.${n}: could not find the "${s}" node in the graph.`);return k4(a==="mixed"?this.type:a,o,c)}}function j4(e,t){const{name:n,type:a,direction:o}=t,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(h,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;h=""+h;const g=this._nodes.get(h);if(typeof g>"u")throw new Re(`Graph.${s}: could not find the "${h}" node in the graph.`);Bg(!1,a==="mixed"?this.type:a,o,g,m)};const c="map"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(h,m){const g=[];return this[s](h,(y,b)=>{g.push(m(y,b))}),g};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(h,m){const g=[];return this[s](h,(y,b)=>{m(y,b)&&g.push(y)}),g};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(h,m,g){if(arguments.length<3)throw new De(`Graph.${f}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let y=g;return this[s](h,(b,S)=>{y=m(y,b,S)}),y}}function L4(e,t){const{name:n,type:a,direction:o}=t,s=n[0].toUpperCase()+n.slice(1,-1),c="find"+s;e.prototype[c]=function(h,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;h=""+h;const g=this._nodes.get(h);if(typeof g>"u")throw new Re(`Graph.${c}: could not find the "${h}" node in the graph.`);return Bg(!0,a==="mixed"?this.type:a,o,g,m)};const u="some"+s;e.prototype[u]=function(h,m){return!!this[c](h,m)};const f="every"+s;e.prototype[f]=function(h,m){return!this[c](h,(y,b)=>!m(y,b))}}function z4(e,t){const{name:n,type:a,direction:o}=t,s=n.slice(0,-1)+"Entries";e.prototype[s]=function(c){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return qo();c=""+c;const u=this._nodes.get(c);if(typeof u>"u")throw new Re(`Graph.${s}: could not find the "${c}" node in the graph.`);return N4(a==="mixed"?this.type:a,o,u)}}function M4(e){D4.forEach(t=>{O4(e,t),j4(e,t),L4(e,t),z4(e,t)})}function Kc(e,t,n,a,o){const s=a._nodes.values(),c=a.type;let u,f,h,m,g,y;for(;u=s.next(),u.done!==!0;){let b=!1;if(f=u.value,c!=="undirected"){m=f.out;for(h in m){g=m[h];do y=g.target,b=!0,o(f.key,y.key,f.attributes,y.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}if(c!=="directed"){m=f.undirected;for(h in m)if(!(t&&f.key>h)){g=m[h];do y=g.target,y.key!==h&&(y=g.source),b=!0,o(f.key,y.key,f.attributes,y.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}n&&!b&&o(f.key,null,f.attributes,null,null,null,null)}}function P4(e,t){const n={key:e};return nC(t.attributes)||(n.attributes=Pt({},t.attributes)),n}function G4(e,t,n){const a={key:t,source:n.source.key,target:n.target.key};return nC(n.attributes)||(a.attributes=Pt({},n.attributes)),e==="mixed"&&n.undirected&&(a.undirected=!0),a}function F4(e){if(!Qt(e))throw new De('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in e))throw new De("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!Qt(e.attributes)||e.attributes===null))throw new De("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function U4(e){if(!Qt(e))throw new De('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in e))throw new De("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new De("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!Qt(e.attributes)||e.attributes===null))throw new De("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new De("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const B4=HP(),I4=new Set(["directed","undirected","mixed"]),K0=new Set(["domain","_events","_eventsCount","_maxListeners"]),H4=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:"directed"},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:"directed"},{name:e=>`${e}UndirectedEdgeWithKey`,type:"undirected"}],$4={allowSelfLoops:!0,multi:!1,type:"mixed"};function V4(e,t,n){if(n&&!Qt(n))throw new De(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new $e(`Graph.addNode: the "${t}" node already exist in the graph.`);const a=new e.NodeDataClass(t,n);return e._nodes.set(t,a),e.emit("nodeAdded",{key:t,attributes:n}),a}function Z0(e,t,n){const a=new e.NodeDataClass(t,n);return e._nodes.set(t,a),e.emit("nodeAdded",{key:t,attributes:n}),a}function uC(e,t,n,a,o,s,c,u){if(!a&&e.type==="undirected")throw new $e(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(a&&e.type==="directed")throw new $e(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(u&&!Qt(u))throw new De(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`);if(s=""+s,c=""+c,u=u||{},!e.allowSelfLoops&&s===c)throw new $e(`Graph.${t}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const f=e._nodes.get(s),h=e._nodes.get(c);if(!f)throw new Re(`Graph.${t}: source node "${s}" not found.`);if(!h)throw new Re(`Graph.${t}: target node "${c}" not found.`);const m={key:null,undirected:a,source:s,target:c,attributes:u};if(n)o=e._edgeKeyGenerator();else if(o=""+o,e._edges.has(o))throw new $e(`Graph.${t}: the "${o}" edge already exists in the graph.`);if(!e.multi&&(a?typeof f.undirected[c]<"u":typeof f.out[c]<"u"))throw new $e(`Graph.${t}: an edge linking "${s}" to "${c}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const g=new Yo(a,o,f,h,u);e._edges.set(o,g);const y=s===c;return a?(f.undirectedDegree++,h.undirectedDegree++,y&&(f.undirectedLoops++,e._undirectedSelfLoopCount++)):(f.outDegree++,h.inDegree++,y&&(f.directedLoops++,e._directedSelfLoopCount++)),e.multi?g.attachMulti():g.attach(),a?e._undirectedSize++:e._directedSize++,m.key=o,e.emit("edgeAdded",m),o}function q4(e,t,n,a,o,s,c,u,f){if(!a&&e.type==="undirected")throw new $e(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(a&&e.type==="directed")throw new $e(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(u){if(f){if(typeof u!="function")throw new De(`Graph.${t}: invalid updater function. Expecting a function but got "${u}"`)}else if(!Qt(u))throw new De(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`)}s=""+s,c=""+c;let h;if(f&&(h=u,u=void 0),!e.allowSelfLoops&&s===c)throw new $e(`Graph.${t}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let m=e._nodes.get(s),g=e._nodes.get(c),y,b;if(!n&&(y=e._edges.get(o),y)){if((y.source.key!==s||y.target.key!==c)&&(!a||y.source.key!==c||y.target.key!==s))throw new $e(`Graph.${t}: inconsistency detected when attempting to merge the "${o}" edge with "${s}" source & "${c}" target vs. ("${y.source.key}", "${y.target.key}").`);b=y}if(!b&&!e.multi&&m&&(b=a?m.undirected[c]:m.out[c]),b){const C=[b.key,!1,!1,!1];if(f?!h:!u)return C;if(f){const A=b.attributes;b.attributes=h(A),e.emit("edgeAttributesUpdated",{type:"replace",key:b.key,attributes:b.attributes})}else Pt(b.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:b.key,attributes:b.attributes,data:u});return C}u=u||{},f&&h&&(u=h(u));const S={key:null,undirected:a,source:s,target:c,attributes:u};if(n)o=e._edgeKeyGenerator();else if(o=""+o,e._edges.has(o))throw new $e(`Graph.${t}: the "${o}" edge already exists in the graph.`);let E=!1,_=!1;m||(m=Z0(e,s,{}),E=!0,s===c&&(g=m,_=!0)),g||(g=Z0(e,c,{}),_=!0),y=new Yo(a,o,m,g,u),e._edges.set(o,y);const N=s===c;return a?(m.undirectedDegree++,g.undirectedDegree++,N&&(m.undirectedLoops++,e._undirectedSelfLoopCount++)):(m.outDegree++,g.inDegree++,N&&(m.directedLoops++,e._directedSelfLoopCount++)),e.multi?y.attachMulti():y.attach(),a?e._undirectedSize++:e._directedSize++,S.key=o,e.emit("edgeAdded",S),[o,!0,E,_]}function Eo(e,t){e._edges.delete(t.key);const{source:n,target:a,attributes:o}=t,s=t.undirected,c=n===a;s?(n.undirectedDegree--,a.undirectedDegree--,c&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,a.inDegree--,c&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),s?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:o,source:n.key,target:a.key,undirected:s})}class ft extends tC.EventEmitter{constructor(t){if(super(),t=Pt({},$4,t),typeof t.multi!="boolean")throw new De(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!I4.has(t.type))throw new De(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new De(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?rC:t.type==="directed"?aC:iC;Wn(this,"NodeDataClass",n);const a="geid_"+B4()+"_";let o=0;const s=()=>{let c;do c=a+o++;while(this._edges.has(c));return c};Wn(this,"_attributes",{}),Wn(this,"_nodes",new Map),Wn(this,"_edges",new Map),Wn(this,"_directedSize",0),Wn(this,"_undirectedSize",0),Wn(this,"_directedSelfLoopCount",0),Wn(this,"_undirectedSelfLoopCount",0),Wn(this,"_edgeKeyGenerator",s),Wn(this,"_options",t),K0.forEach(c=>Wn(this,c,this[c])),ir(this,"order",()=>this._nodes.size),ir(this,"size",()=>this._edges.size),ir(this,"directedSize",()=>this._directedSize),ir(this,"undirectedSize",()=>this._undirectedSize),ir(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),ir(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),ir(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),ir(this,"multi",this._options.multi),ir(this,"type",this._options.type),ir(this,"allowSelfLoops",this._options.allowSelfLoops),ir(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(t){return this._nodes.has(""+t)}hasDirectedEdge(t,n){if(this.type==="undirected")return!1;if(arguments.length===1){const a=""+t,o=this._edges.get(a);return!!o&&!o.undirected}else if(arguments.length===2){t=""+t,n=""+n;const a=this._nodes.get(t);return a?a.out.hasOwnProperty(n):!1}throw new De(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(t,n){if(this.type==="directed")return!1;if(arguments.length===1){const a=""+t,o=this._edges.get(a);return!!o&&o.undirected}else if(arguments.length===2){t=""+t,n=""+n;const a=this._nodes.get(t);return a?a.undirected.hasOwnProperty(n):!1}throw new De(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(t,n){if(arguments.length===1){const a=""+t;return this._edges.has(a)}else if(arguments.length===2){t=""+t,n=""+n;const a=this._nodes.get(t);return a?typeof a.out<"u"&&a.out.hasOwnProperty(n)||typeof a.undirected<"u"&&a.undirected.hasOwnProperty(n):!1}throw new De(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(t,n){if(this.type==="undirected")return;if(t=""+t,n=""+n,this.multi)throw new $e("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const a=this._nodes.get(t);if(!a)throw new Re(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Re(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const o=a.out&&a.out[n]||void 0;if(o)return o.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new $e("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const a=this._nodes.get(t);if(!a)throw new Re(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Re(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const o=a.undirected&&a.undirected[n]||void 0;if(o)return o.key}edge(t,n){if(this.multi)throw new $e("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Re(`Graph.edge: could not find the "${n}" target node in the graph.`);const o=a.out&&a.out[n]||a.undirected&&a.undirected[n]||void 0;if(o)return o.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in a.in||n in a.out}areOutNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in a.out}areInNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in a.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in a.undirected}areNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in a.in||n in a.out)||this.type!=="directed"&&n in a.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in a.in||this.type!=="directed"&&n in a.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const a=this._nodes.get(t);if(!a)throw new Re(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in a.out||this.type!=="directed"&&n in a.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.inDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.outDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.directedDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.undirectedDegree: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=n.undirectedDegree),this.type!=="undirected"&&(a+=n.inDegree),a}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=n.undirectedDegree),this.type!=="undirected"&&(a+=n.outDegree),a}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.degree: could not find the "${t}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=n.undirectedDegree),this.type!=="undirected"&&(a+=n.inDegree+n.outDegree),a}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.inDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.outDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.directedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let a=0,o=0;return this.type!=="directed"&&(a+=n.undirectedDegree,o+=n.undirectedLoops*2),this.type!=="undirected"&&(a+=n.inDegree,o+=n.directedLoops),a-o}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let a=0,o=0;return this.type!=="directed"&&(a+=n.undirectedDegree,o+=n.undirectedLoops*2),this.type!=="undirected"&&(a+=n.outDegree,o+=n.directedLoops),a-o}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let a=0,o=0;return this.type!=="directed"&&(a+=n.undirectedDegree,o+=n.undirectedLoops*2),this.type!=="undirected"&&(a+=n.inDegree+n.outDegree,o+=n.directedLoops*2),a-o}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`Graph.source: could not find the "${t}" edge in the graph.`);return n.source.key}target(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`Graph.target: could not find the "${t}" edge in the graph.`);return n.target.key}extremities(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`Graph.extremities: could not find the "${t}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(t,n){t=""+t,n=""+n;const a=this._edges.get(n);if(!a)throw new Re(`Graph.opposite: could not find the "${n}" edge in the graph.`);const o=a.source.key,s=a.target.key;if(t===o)return s;if(t===s)return o;throw new Re(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${o}, ${s}).`)}hasExtremity(t,n){t=""+t,n=""+n;const a=this._edges.get(t);if(!a)throw new Re(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return a.source.key===n||a.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`Graph.isUndirected: could not find the "${t}" edge in the graph.`);return n.undirected}isDirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`Graph.isDirected: could not find the "${t}" edge in the graph.`);return!n.undirected}isSelfLoop(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Re(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return V4(this,t,n).key}mergeNode(t,n){if(n&&!Qt(n))throw new De(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let a=this._nodes.get(t);return a?(n&&(Pt(a.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:a.attributes,data:n})),[t,!1]):(a=new this.NodeDataClass(t,n),this._nodes.set(t,a),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new De(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let a=this._nodes.get(t);if(a){if(n){const s=a.attributes;a.attributes=n(s),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:a.attributes})}return[t,!1]}const o=n?n({}):{};return a=new this.NodeDataClass(t,o),this._nodes.set(t,a),this.emit("nodeAdded",{key:t,attributes:o}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Re(`Graph.dropNode: could not find the "${t}" node in the graph.`);let a;if(this.type!=="undirected"){for(const o in n.out){a=n.out[o];do Eo(this,a),a=a.next;while(a)}for(const o in n.in){a=n.in[o];do Eo(this,a),a=a.next;while(a)}}if(this.type!=="directed")for(const o in n.undirected){a=n.undirected[o];do Eo(this,a),a=a.next;while(a)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const a=""+arguments[0],o=""+arguments[1];if(n=Xn(this,a,o,this.type),!n)throw new Re(`Graph.dropEdge: could not find the "${a}" -> "${o}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new Re(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return Eo(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new $e("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new $e("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");t=""+t,n=""+n;const a=Xn(this,t,n,"directed");if(!a)throw new Re(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Eo(this,a),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new $e("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new $e("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const a=Xn(this,t,n,"undirected");if(!a)throw new Re(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Eo(this,a),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const t=this._nodes.values();let n;for(;n=t.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(t){return this._attributes[t]}getAttributes(){return this._attributes}hasAttribute(t){return this._attributes.hasOwnProperty(t)}setAttribute(t,n){return this._attributes[t]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}updateAttribute(t,n){if(typeof n!="function")throw new De("Graph.updateAttribute: updater should be a function.");const a=this._attributes[t];return this._attributes[t]=n(a),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}removeAttribute(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this}replaceAttributes(t){if(!Qt(t))throw new De("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(t){if(!Qt(t))throw new De("Graph.mergeAttributes: provided attributes are not a plain object.");return Pt(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new De("Graph.updateAttributes: provided updater is not a function.");return this._attributes=t(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(t,n){if(typeof t!="function")throw new De("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!X0(n))throw new De("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const a=this._nodes.values();let o,s;for(;o=a.next(),o.done!==!0;)s=o.value,s.attributes=t(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new De("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!X0(n))throw new De("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const a=this._edges.values();let o,s,c,u;for(;o=a.next(),o.done!==!0;)s=o.value,c=s.source,u=s.target,s.attributes=t(s.key,s.attributes,c.key,u.key,c.attributes,u.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new De("Graph.forEachAdjacencyEntry: expecting a callback.");Kc(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new De("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Kc(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new De("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Kc(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new De("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Kc(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new De("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)o=a.value,t(o.key,o.attributes)}findNode(t){if(typeof t!="function")throw new De("Graph.findNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)if(o=a.value,t(o.key,o.attributes))return o.key}mapNodes(t){if(typeof t!="function")throw new De("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let a,o;const s=new Array(this.order);let c=0;for(;a=n.next(),a.done!==!0;)o=a.value,s[c++]=t(o.key,o.attributes);return s}someNode(t){if(typeof t!="function")throw new De("Graph.someNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)if(o=a.value,t(o.key,o.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new De("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let a,o;for(;a=n.next(),a.done!==!0;)if(o=a.value,!t(o.key,o.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new De("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let a,o;const s=[];for(;a=n.next(),a.done!==!0;)o=a.value,t(o.key,o.attributes)&&s.push(o.key);return s}reduceNodes(t,n){if(typeof t!="function")throw new De("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new De("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let a=n;const o=this._nodes.values();let s,c;for(;s=o.next(),s.done!==!0;)c=s.value,a=t(a,c.key,c.attributes);return a}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const a=n.value;return{value:{node:a.key,attributes:a.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((o,s)=>{t[n++]=P4(s,o)});const a=new Array(this._edges.size);return n=0,this._edges.forEach((o,s)=>{a[n++]=G4(this.type,s,o)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:a}}import(t,n=!1){if(t instanceof ft)return t.forEachNode((f,h)=>{n?this.mergeNode(f,h):this.addNode(f,h)}),t.forEachEdge((f,h,m,g,y,b,S)=>{n?S?this.mergeUndirectedEdgeWithKey(f,m,g,h):this.mergeDirectedEdgeWithKey(f,m,g,h):S?this.addUndirectedEdgeWithKey(f,m,g,h):this.addDirectedEdgeWithKey(f,m,g,h)}),this;if(!Qt(t))throw new De("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!Qt(t.attributes))throw new De("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let a,o,s,c,u;if(t.nodes){if(s=t.nodes,!Array.isArray(s))throw new De("Graph.import: invalid nodes. Expecting an array.");for(a=0,o=s.length;a{const s=Pt({},a.attributes);a=new n.NodeDataClass(o,s),n._nodes.set(o,a)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new $e(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${t.type}" because this would mean losing information about the current graph.`);if(typeof t.multi=="boolean"&&t.multi!==this.multi&&t.multi!==!0)throw new $e("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof t.allowSelfLoops=="boolean"&&t.allowSelfLoops!==this.allowSelfLoops&&t.allowSelfLoops!==!0)throw new $e("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const n=this.emptyCopy(t),a=this._edges.values();let o,s;for(;o=a.next(),o.done!==!0;)s=o.value,uC(n,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,Pt({},s.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((s,c)=>{t[c]=s.attributes});const n={},a={};this._edges.forEach((s,c)=>{const u=s.undirected?"--":"->";let f="",h=s.source.key,m=s.target.key,g;s.undirected&&h>m&&(g=h,h=m,m=g);const y=`(${h})${u}(${m})`;c.startsWith("geid_")?this.multi&&(typeof a[y]>"u"?a[y]=0:a[y]++,f+=`${a[y]}. `):f+=`[${c}]: `,f+=y,n[f]=s.attributes});const o={};for(const s in this)this.hasOwnProperty(s)&&!K0.has(s)&&typeof this[s]!="function"&&typeof s!="symbol"&&(o[s]=this[s]);return o.attributes=this._attributes,o.nodes=t,o.edges=n,Wn(o,"constructor",this.constructor),o}}typeof Symbol<"u"&&(ft.prototype[Symbol.for("nodejs.util.inspect.custom")]=ft.prototype.inspect);H4.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),a=t==="add"?uC:q4;e.generateKey?ft.prototype[n]=function(o,s,c){return a(this,n,!0,(e.type||this.type)==="undirected",null,o,s,c,t==="update")}:ft.prototype[n]=function(o,s,c,u){return a(this,n,!1,(e.type||this.type)==="undirected",o,s,c,u,t==="update")}})});t4(ft);f4(ft);A4(ft);M4(ft);class dl extends ft{constructor(t){const n=Pt({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new De("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new De('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class dC extends ft{constructor(t){const n=Pt({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new De("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new De('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class fC extends ft{constructor(t){const n=Pt({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new De("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class hC extends ft{constructor(t){const n=Pt({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new De("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new De('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class pC extends ft{constructor(t){const n=Pt({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new De("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new De('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function Wo(e){e.from=function(t,n){const a=Pt({},t.options,n),o=new e(a);return o.import(t),o}}Wo(ft);Wo(dl);Wo(dC);Wo(fC);Wo(hC);Wo(pC);ft.Graph=ft;ft.DirectedGraph=dl;ft.UndirectedGraph=dC;ft.MultiGraph=fC;ft.MultiDirectedGraph=hC;ft.MultiUndirectedGraph=pC;ft.InvalidArgumentsGraphError=De;ft.NotFoundGraphError=Re;ft.UsageGraphError=$e;function Y4(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ol(e){var t=Y4(e,"string");return typeof t=="symbol"?t:t+""}function $t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q0(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=Array(t);n>8&255,s=n>>16&255,c=n>>24&255;return[a,o,s,c]}var sp={};function xC(e){if(typeof sp[e]<"u")return sp[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,a=e&255,o=255,s=bC(t,n,a,o);return sp[e]=s,s}function J0(e,t,n,a){return n+(t<<8)+(e<<16)}function ew(e,t,n,a,o,s){var c=Math.floor(n/s*o),u=Math.floor(e.drawingBufferHeight/s-a/s*o),f=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(c,u,1,1,e.RGBA,e.UNSIGNED_BYTE,f);var h=Mo(f,4),m=h[0],g=h[1],y=h[2],b=h[3];return[m,g,y,b]}function we(e,t,n){return(t=ol(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function ze(e){for(var t=1;tk){var M="…";for(h=h+M,D=e.measureText(h).width;D>k&&h.length>1;)h=h.slice(0,-2)+M,D=e.measureText(h).width;if(h.length<4)return}var R;C>0?A>0?R=Math.acos(C/k):R=Math.asin(A/k):A>0?R=Math.acos(C/k)+Math.PI:R=Math.asin(C/k)+Math.PI/2,e.save(),e.translate(_,N),e.rotate(R),e.fillText(h,-D/2,t.size/2+s),e.restore()}}}function CC(e,t,n){if(t.label){var a=n.labelSize,o=n.labelFont,s=n.labelWeight,c=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=c,e.font="".concat(s," ").concat(a,"px ").concat(o),e.fillText(t.label,t.x+t.size+3,t.y+a/3)}}function uG(e,t,n){var a=n.labelSize,o=n.labelFont,s=n.labelWeight;e.font="".concat(s," ").concat(a,"px ").concat(o),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var c=2;if(typeof t.label=="string"){var u=e.measureText(t.label).width,f=Math.round(u+5),h=Math.round(a+2*c),m=Math.max(t.size,a/2)+c,g=Math.asin(h/2/m),y=Math.sqrt(Math.abs(Math.pow(m,2)-Math.pow(h/2,2)));e.beginPath(),e.moveTo(t.x+y,t.y+h/2),e.lineTo(t.x+m+f,t.y+h/2),e.lineTo(t.x+m+f,t.y-h/2),e.lineTo(t.x+y,t.y-h/2),e.arc(t.x,t.y,m,g,-g),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+c,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,CC(e,t,n)}var dG=` +precision highp float; + +varying vec4 v_color; +varying vec2 v_diffVector; +varying float v_radius; + +uniform float u_correctionRatio; + +const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); + +void main(void) { + float border = u_correctionRatio * 2.0; + float dist = length(v_diffVector) - v_radius + border; + + // No antialiasing for picking mode: + #ifdef PICKING_MODE + if (dist > border) + gl_FragColor = transparent; + else + gl_FragColor = v_color; + + #else + float t = 0.0; + if (dist > border) + t = 1.0; + else if (dist > 0.0) + t = dist / border; + + gl_FragColor = mix(v_color, transparent, t); + #endif +} +`,fG=dG,hG=` +attribute vec4 a_id; +attribute vec4 a_color; +attribute vec2 a_position; +attribute float a_size; +attribute float a_angle; + +uniform mat3 u_matrix; +uniform float u_sizeRatio; +uniform float u_correctionRatio; + +varying vec4 v_color; +varying vec2 v_diffVector; +varying float v_radius; +varying float v_border; + +const float bias = 255.0 / 254.0; + +void main() { + float size = a_size * u_correctionRatio / u_sizeRatio * 4.0; + vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle)); + vec2 position = a_position + diffVector; + gl_Position = vec4( + (u_matrix * vec3(position, 1)).xy, + 0, + 1 + ); + + v_diffVector = diffVector; + v_radius = size / 2.0; + + #ifdef PICKING_MODE + // For picking mode, we use the ID as the color: + v_color = a_id; + #else + // For normal mode, we use the color: + v_color = a_color; + #endif + + v_color.a *= bias; +} +`,pG=hG,TC=WebGLRenderingContext,iw=TC.UNSIGNED_BYTE,cp=TC.FLOAT,mG=["u_sizeRatio","u_correctionRatio","u_matrix"],Tl=function(e){function t(){return $t(this,t),Sn(this,t,arguments)}return _n(t,e),Vt(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:pG,FRAGMENT_SHADER_SOURCE:fG,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:mG,ATTRIBUTES:[{name:"a_position",size:2,type:cp},{name:"a_size",size:1,type:cp},{name:"a_color",size:4,type:iw,normalized:!0},{name:"a_id",size:4,type:iw,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:cp}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(a,o,s){var c=this.array,u=Ar(s.color);c[o++]=s.x,c[o++]=s.y,c[o++]=s.size,c[o++]=u,c[o++]=a}},{key:"setUniforms",value:function(a,o){var s=o.gl,c=o.uniformLocations,u=c.u_sizeRatio,f=c.u_correctionRatio,h=c.u_matrix;s.uniform1f(f,a.correctionRatio),s.uniform1f(u,a.sizeRatio),s.uniformMatrix3fv(h,!1,a.matrix)}}])}(Ig);we(Tl,"ANGLE_1",0);we(Tl,"ANGLE_2",2*Math.PI/3);we(Tl,"ANGLE_3",4*Math.PI/3);var gG=` +precision mediump float; + +varying vec4 v_color; + +void main(void) { + gl_FragColor = v_color; +} +`,vG=gG,yG=` +attribute vec2 a_position; +attribute vec2 a_normal; +attribute float a_radius; +attribute vec3 a_barycentric; + +#ifdef PICKING_MODE +attribute vec4 a_id; +#else +attribute vec4 a_color; +#endif + +uniform mat3 u_matrix; +uniform float u_sizeRatio; +uniform float u_correctionRatio; +uniform float u_minEdgeThickness; +uniform float u_lengthToThicknessRatio; +uniform float u_widenessToThicknessRatio; + +varying vec4 v_color; + +const float bias = 255.0 / 254.0; + +void main() { + float minThickness = u_minEdgeThickness; + + float normalLength = length(a_normal); + vec2 unitNormal = a_normal / normalLength; + + // These first computations are taken from edge.vert.glsl and + // edge.clamped.vert.glsl. Please read it to get better comments on what's + // happening: + float pixelsThickness = max(normalLength / u_sizeRatio, minThickness); + float webGLThickness = pixelsThickness * u_correctionRatio; + float webGLNodeRadius = a_radius * 2.0 * u_correctionRatio / u_sizeRatio; + float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0; + float webGLArrowHeadThickness = webGLThickness * u_widenessToThicknessRatio; + + float da = a_barycentric.x; + float db = a_barycentric.y; + float dc = a_barycentric.z; + + vec2 delta = vec2( + da * (webGLNodeRadius * unitNormal.y) + + db * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y + webGLArrowHeadThickness * unitNormal.x) + + dc * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y - webGLArrowHeadThickness * unitNormal.x), + + da * (-webGLNodeRadius * unitNormal.x) + + db * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x + webGLArrowHeadThickness * unitNormal.y) + + dc * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x - webGLArrowHeadThickness * unitNormal.y) + ); + + vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy; + + gl_Position = vec4(position, 0, 1); + + #ifdef PICKING_MODE + // For picking mode, we use the ID as the color: + v_color = a_id; + #else + // For normal mode, we use the color: + v_color = a_color; + #endif + + v_color.a *= bias; +} +`,bG=yG,RC=WebGLRenderingContext,ow=RC.UNSIGNED_BYTE,Qc=RC.FLOAT,xG=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],Rl={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function ju(e){var t=ze(ze({},Rl),e||{});return function(n){function a(){return $t(this,a),Sn(this,a,arguments)}return _n(a,n),Vt(a,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:bG,FRAGMENT_SHADER_SOURCE:vG,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:xG,ATTRIBUTES:[{name:"a_position",size:2,type:Qc},{name:"a_normal",size:2,type:Qc},{name:"a_radius",size:1,type:Qc},{name:"a_color",size:4,type:ow,normalized:!0},{name:"a_id",size:4,type:ow,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Qc}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(s,c,u,f,h){if(t.extremity==="source"){var m=[f,u];u=m[0],f=m[1]}var g=h.size||1,y=f.size||1,b=u.x,S=u.y,E=f.x,_=f.y,N=Ar(h.color),C=E-b,A=_-S,k=C*C+A*A,D=0,M=0;k&&(k=1/Math.sqrt(k),D=-A*k*g,M=C*k*g);var R=this.array;R[c++]=E,R[c++]=_,R[c++]=-D,R[c++]=-M,R[c++]=y,R[c++]=N,R[c++]=s}},{key:"setUniforms",value:function(s,c){var u=c.gl,f=c.uniformLocations,h=f.u_matrix,m=f.u_sizeRatio,g=f.u_correctionRatio,y=f.u_minEdgeThickness,b=f.u_lengthToThicknessRatio,S=f.u_widenessToThicknessRatio;u.uniformMatrix3fv(h,!1,s.matrix),u.uniform1f(m,s.sizeRatio),u.uniform1f(g,s.correctionRatio),u.uniform1f(y,s.minEdgeThickness),u.uniform1f(b,t.lengthToThicknessRatio),u.uniform1f(S,t.widenessToThicknessRatio)}}])}(Cl)}ju();var wG=` +precision mediump float; + +varying vec4 v_color; +varying vec2 v_normal; +varying float v_thickness; +varying float v_feather; + +const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); + +void main(void) { + // We only handle antialiasing for normal mode: + #ifdef PICKING_MODE + gl_FragColor = v_color; + #else + float dist = length(v_normal) * v_thickness; + + float t = smoothstep( + v_thickness - v_feather, + v_thickness, + dist + ); + + gl_FragColor = mix(v_color, transparent, t); + #endif +} +`,Hg=wG,EG=` +attribute vec4 a_id; +attribute vec4 a_color; +attribute vec2 a_normal; +attribute float a_normalCoef; +attribute vec2 a_positionStart; +attribute vec2 a_positionEnd; +attribute float a_positionCoef; +attribute float a_radius; +attribute float a_radiusCoef; + +uniform mat3 u_matrix; +uniform float u_zoomRatio; +uniform float u_sizeRatio; +uniform float u_pixelRatio; +uniform float u_correctionRatio; +uniform float u_minEdgeThickness; +uniform float u_lengthToThicknessRatio; +uniform float u_feather; + +varying vec4 v_color; +varying vec2 v_normal; +varying float v_thickness; +varying float v_feather; + +const float bias = 255.0 / 254.0; + +void main() { + float minThickness = u_minEdgeThickness; + + float radius = a_radius * a_radiusCoef; + vec2 normal = a_normal * a_normalCoef; + vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef; + + float normalLength = length(normal); + vec2 unitNormal = normal / normalLength; + + // These first computations are taken from edge.vert.glsl. Please read it to + // get better comments on what's happening: + float pixelsThickness = max(normalLength, minThickness * u_sizeRatio); + float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio; + + // Here, we move the point to leave space for the arrow head: + float direction = sign(radius); + float webGLNodeRadius = direction * radius * 2.0 * u_correctionRatio / u_sizeRatio; + float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0; + + vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (webGLNodeRadius + webGLArrowHeadLength); + + // Here is the proper position of the vertex + gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + compensationVector, 1)).xy, 0, 1); + + v_thickness = webGLThickness / u_zoomRatio; + + v_normal = unitNormal; + + v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0; + + #ifdef PICKING_MODE + // For picking mode, we use the ID as the color: + v_color = a_id; + #else + // For normal mode, we use the color: + v_color = a_color; + #endif + + v_color.a *= bias; +} +`,SG=EG,AC=WebGLRenderingContext,sw=AC.UNSIGNED_BYTE,yi=AC.FLOAT,_G=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],CG={lengthToThicknessRatio:Rl.lengthToThicknessRatio};function DC(e){var t=ze(ze({},CG),{});return function(n){function a(){return $t(this,a),Sn(this,a,arguments)}return _n(a,n),Vt(a,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:SG,FRAGMENT_SHADER_SOURCE:Hg,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:_G,ATTRIBUTES:[{name:"a_positionStart",size:2,type:yi},{name:"a_positionEnd",size:2,type:yi},{name:"a_normal",size:2,type:yi},{name:"a_color",size:4,type:sw,normalized:!0},{name:"a_id",size:4,type:sw,normalized:!0},{name:"a_radius",size:1,type:yi}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:yi},{name:"a_normalCoef",size:1,type:yi},{name:"a_radiusCoef",size:1,type:yi}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(s,c,u,f,h){var m=h.size||1,g=u.x,y=u.y,b=f.x,S=f.y,E=Ar(h.color),_=b-g,N=S-y,C=f.size||1,A=_*_+N*N,k=0,D=0;A&&(A=1/Math.sqrt(A),k=-N*A*m,D=_*A*m);var M=this.array;M[c++]=g,M[c++]=y,M[c++]=b,M[c++]=S,M[c++]=k,M[c++]=D,M[c++]=E,M[c++]=s,M[c++]=C}},{key:"setUniforms",value:function(s,c){var u=c.gl,f=c.uniformLocations,h=f.u_matrix,m=f.u_zoomRatio,g=f.u_feather,y=f.u_pixelRatio,b=f.u_correctionRatio,S=f.u_sizeRatio,E=f.u_minEdgeThickness,_=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(h,!1,s.matrix),u.uniform1f(m,s.zoomRatio),u.uniform1f(S,s.sizeRatio),u.uniform1f(b,s.correctionRatio),u.uniform1f(y,s.pixelRatio),u.uniform1f(g,s.antiAliasingFeather),u.uniform1f(E,s.minEdgeThickness),u.uniform1f(_,t.lengthToThicknessRatio)}}])}(Cl)}DC();function TG(e){return _C([DC(),ju(e)])}var RG=TG(),kC=RG,AG=` +attribute vec4 a_id; +attribute vec4 a_color; +attribute vec2 a_normal; +attribute float a_normalCoef; +attribute vec2 a_positionStart; +attribute vec2 a_positionEnd; +attribute float a_positionCoef; + +uniform mat3 u_matrix; +uniform float u_sizeRatio; +uniform float u_zoomRatio; +uniform float u_pixelRatio; +uniform float u_correctionRatio; +uniform float u_minEdgeThickness; +uniform float u_feather; + +varying vec4 v_color; +varying vec2 v_normal; +varying float v_thickness; +varying float v_feather; + +const float bias = 255.0 / 254.0; + +void main() { + float minThickness = u_minEdgeThickness; + + vec2 normal = a_normal * a_normalCoef; + vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef; + + float normalLength = length(normal); + vec2 unitNormal = normal / normalLength; + + // We require edges to be at least "minThickness" pixels thick *on screen* + // (so we need to compensate the size ratio): + float pixelsThickness = max(normalLength, minThickness * u_sizeRatio); + + // Then, we need to retrieve the normalized thickness of the edge in the WebGL + // referential (in a ([0, 1], [0, 1]) space), using our "magic" correction + // ratio: + float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio; + + // Here is the proper position of the vertex + gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness, 1)).xy, 0, 1); + + // For the fragment shader though, we need a thickness that takes the "magic" + // correction ratio into account (as in webGLThickness), but so that the + // antialiasing effect does not depend on the zoom level. So here's yet + // another thickness version: + v_thickness = webGLThickness / u_zoomRatio; + + v_normal = unitNormal; + + v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0; + + #ifdef PICKING_MODE + // For picking mode, we use the ID as the color: + v_color = a_id; + #else + // For normal mode, we use the color: + v_color = a_color; + #endif + + v_color.a *= bias; +} +`,DG=AG,NC=WebGLRenderingContext,lw=NC.UNSIGNED_BYTE,Zs=NC.FLOAT,kG=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],NG=function(e){function t(){return $t(this,t),Sn(this,t,arguments)}return _n(t,e),Vt(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:DG,FRAGMENT_SHADER_SOURCE:Hg,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:kG,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Zs},{name:"a_positionEnd",size:2,type:Zs},{name:"a_normal",size:2,type:Zs},{name:"a_color",size:4,type:lw,normalized:!0},{name:"a_id",size:4,type:lw,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Zs},{name:"a_normalCoef",size:1,type:Zs}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(a,o,s,c,u){var f=u.size||1,h=s.x,m=s.y,g=c.x,y=c.y,b=Ar(u.color),S=g-h,E=y-m,_=S*S+E*E,N=0,C=0;_&&(_=1/Math.sqrt(_),N=-E*_*f,C=S*_*f);var A=this.array;A[o++]=h,A[o++]=m,A[o++]=g,A[o++]=y,A[o++]=N,A[o++]=C,A[o++]=b,A[o++]=a}},{key:"setUniforms",value:function(a,o){var s=o.gl,c=o.uniformLocations,u=c.u_matrix,f=c.u_zoomRatio,h=c.u_feather,m=c.u_pixelRatio,g=c.u_correctionRatio,y=c.u_sizeRatio,b=c.u_minEdgeThickness;s.uniformMatrix3fv(u,!1,a.matrix),s.uniform1f(f,a.zoomRatio),s.uniform1f(y,a.sizeRatio),s.uniform1f(g,a.correctionRatio),s.uniform1f(m,a.pixelRatio),s.uniform1f(h,a.antiAliasingFeather),s.uniform1f(b,a.minEdgeThickness)}}])}(Cl),$g=function(e){function t(){var n;return $t(this,t),n=Sn(this,t),n.rawEmitter=n,n}return _n(t,e),Vt(t)}(tC.EventEmitter),up,cw;function Dr(){return cw||(cw=1,up=function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"}),up}var OG=Dr();const jG=dn(OG);var LG=function(t){return t},zG=function(t){return t*t},MG=function(t){return t*(2-t)},PG=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},GG=function(t){return t*t*t},FG=function(t){return--t*t*t+1},UG=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},OC={linear:LG,quadraticIn:zG,quadraticOut:MG,quadraticInOut:PG,cubicIn:GG,cubicOut:FG,cubicInOut:UG},jC={easing:"quadraticInOut",duration:150};function BG(e,t,n,a){var o=Object.assign({},jC,n),s=typeof o.easing=="function"?o.easing:OC[o.easing],c=Date.now(),u={};for(var f in t){var h=t[f];u[f]={};for(var m in h)u[f][m]=e.getNodeAttribute(f,m)}var g=null,y=function(){g=null;var S=(Date.now()-c)/o.duration;if(S>=1){for(var E in t){var _=t[E];for(var N in _)e.setNodeAttribute(E,N,_[N])}return}S=s(S);for(var C in t){var A=t[C],k=u[C];for(var D in A)e.setNodeAttribute(C,D,A[D]*S+k[D]*(1-S))}g=requestAnimationFrame(y)};return y(),function(){g&&cancelAnimationFrame(g)}}function or(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Jc(e,t,n){return e[0]=t,e[4]=typeof n=="number"?n:t,e}function uw(e,t){var n=Math.sin(t),a=Math.cos(t);return e[0]=a,e[1]=n,e[3]=-n,e[4]=a,e}function dw(e,t,n){return e[6]=t,e[7]=n,e}function ja(e,t){var n=e[0],a=e[1],o=e[2],s=e[3],c=e[4],u=e[5],f=e[6],h=e[7],m=e[8],g=t[0],y=t[1],b=t[2],S=t[3],E=t[4],_=t[5],N=t[6],C=t[7],A=t[8];return e[0]=g*n+y*s+b*f,e[1]=g*a+y*c+b*h,e[2]=g*o+y*u+b*m,e[3]=S*n+E*s+_*f,e[4]=S*a+E*c+_*h,e[5]=S*o+E*u+_*m,e[6]=N*n+C*s+A*f,e[7]=N*a+C*c+A*h,e[8]=N*o+C*u+A*m,e}function _m(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,a=e[0],o=e[1],s=e[3],c=e[4],u=e[6],f=e[7],h=t.x,m=t.y;return{x:h*a+m*s+u*n,y:h*o+m*c+f*n}}function IG(e,t){var n=e.height/e.width,a=t.height/t.width;return n<1&&a>1||n>1&&a<1?1:Math.min(Math.max(a,1/a),Math.max(1/n,n))}function Qs(e,t,n,a,o){var s=e.angle,c=e.ratio,u=e.x,f=e.y,h=t.width,m=t.height,g=or(),y=Math.min(h,m)-2*a,b=IG(t,n);return o?(ja(g,dw(or(),u,f)),ja(g,Jc(or(),c)),ja(g,uw(or(),s)),ja(g,Jc(or(),h/y/2/b,m/y/2/b))):(ja(g,Jc(or(),2*(y/h)*b,2*(y/m)*b)),ja(g,uw(or(),-s)),ja(g,Jc(or(),1/c)),ja(g,dw(or(),-u,-f))),g}function HG(e,t,n){var a=_m(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),o=a.x,s=a.y;return 1/Math.sqrt(Math.pow(o,2)+Math.pow(s,2))/n.width}function $G(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,a=1/0,o=-1/0;return e.forEachNode(function(s,c){var u=c.x,f=c.y;un&&(n=u),fo&&(o=f)}),{x:[t,n],y:[a,o]}}function VG(e){if(!jG(e))throw new Error("Sigma: invalid graph instance.");e.forEachNode(function(t,n){if(!Number.isFinite(n.x)||!Number.isFinite(n.y))throw new Error("Sigma: Coordinates of node ".concat(t," are invalid. A node must have a numeric 'x' and 'y' attribute."))})}function qG(e,t,n){var a=document.createElement(e);if(t)for(var o in t)a.style[o]=t[o];if(n)for(var s in n)a.setAttribute(s,n[s]);return a}function fw(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function hw(e,t,n){return n.sort(function(a,o){var s=t(a)||0,c=t(o)||0;return sc?1:0})}function pw(e){var t=Mo(e.x,2),n=t[0],a=t[1],o=Mo(e.y,2),s=o[0],c=o[1],u=Math.max(a-n,c-s),f=(a+n)/2,h=(c+s)/2;(u===0||Math.abs(u)===1/0||isNaN(u))&&(u=1),isNaN(f)&&(f=0),isNaN(h)&&(h=0);var m=function(y){return{x:.5+(y.x-f)/u,y:.5+(y.y-h)/u}};return m.applyTo=function(g){g.x=.5+(g.x-f)/u,g.y=.5+(g.y-h)/u},m.inverse=function(g){return{x:f+u*(g.x-.5),y:h+u*(g.y-.5)}},m.ratio=u,m}function Cm(e){"@babel/helpers - typeof";return Cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cm(e)}function mw(e,t){var n=t.size;if(n!==0){var a=e.length;e.length+=n;var o=0;t.forEach(function(s){e[a+o]=s,o++})}}function dp(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t1&&arguments[1]!==void 0?arguments[1]:{},c=arguments.length>2?arguments[2]:void 0;if(!c)return new Promise(function(b){return o.animate(a,s,b)});if(this.enabled){var u=ze(ze({},jC),s),f=this.validateState(a),h=typeof u.easing=="function"?u.easing:OC[u.easing],m=Date.now(),g=this.getState(),y=function(){var S=(Date.now()-m)/u.duration;if(S>=1){o.nextFrame=null,o.setState(f),o.animationCallback&&(o.animationCallback.call(null),o.animationCallback=void 0);return}var E=h(S),_={};typeof f.x=="number"&&(_.x=g.x+(f.x-g.x)*E),typeof f.y=="number"&&(_.y=g.y+(f.y-g.y)*E),o.enabledRotation&&typeof f.angle=="number"&&(_.angle=g.angle+(f.angle-g.angle)*E),typeof f.ratio=="number"&&(_.ratio=g.ratio+(f.ratio-g.ratio)*E),o.setState(_),o.nextFrame=requestAnimationFrame(y)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(y)):y(),this.animationCallback=c}}},{key:"animatedZoom",value:function(a){return a?typeof a=="number"?this.animate({ratio:this.ratio/a}):this.animate({ratio:this.ratio/(a.factor||eu)},a):this.animate({ratio:this.ratio/eu})}},{key:"animatedUnzoom",value:function(a){return a?typeof a=="number"?this.animate({ratio:this.ratio*a}):this.animate({ratio:this.ratio*(a.factor||eu)},a):this.animate({ratio:this.ratio*eu})}},{key:"animatedReset",value:function(a){return this.animate({x:.5,y:.5,ratio:1,angle:0},a)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(a){var o=new t;return o.setState(a)}}])}($g);function lr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Qr(e,t){var n=ze(ze({},lr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Js(e){var t="x"in e?e:ze(ze({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function KG(e,t){return ze(ze({},Qr(e,t)),{},{delta:LC(e)})}var ZG=2;function gu(e){for(var t=[],n=0,a=Math.min(e.length,ZG);n0;o.draggedEvents=0,g&&o.renderer.getSetting("hideEdgesOnMove")&&o.renderer.refresh()},0),this.emit("mouseup",Qr(a,this.container))}}},{key:"handleMove",value:function(a){var o=this;if(this.enabled){var s=Qr(a,this.container);if(this.emit("mousemovebody",s),(a.target===this.container||a.composedPath()[0]===this.container)&&this.emit("mousemove",s),!s.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){o.movingTimeout=null,o.isMoving=!1},this.settings.dragTimeout);var c=this.renderer.getCamera(),u=lr(a,this.container),f=u.x,h=u.y,m=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),g=this.renderer.viewportToFramedGraph({x:f,y:h}),y=m.x-g.x,b=m.y-g.y,S=c.getState(),E=S.x+y,_=S.y+b;c.setState({x:E,y:_}),this.lastMouseX=f,this.lastMouseY=h,a.preventDefault(),a.stopPropagation()}}}},{key:"handleLeave",value:function(a){this.emit("mouseleave",Qr(a,this.container))}},{key:"handleEnter",value:function(a){this.emit("mouseenter",Qr(a,this.container))}},{key:"handleWheel",value:function(a){var o=this,s=this.renderer.getCamera();if(!(!this.enabled||!s.enabledZooming)){var c=LC(a);if(c){var u=KG(a,this.container);if(this.emit("wheel",u),u.sigmaDefaultPrevented){a.preventDefault(),a.stopPropagation();return}var f=s.getState().ratio,h=c>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,m=s.getBoundedRatio(f*h),g=c>0?1:-1,y=Date.now();f!==m&&(a.preventDefault(),a.stopPropagation(),!(this.currentWheelDirection===g&&this.lastWheelTriggerTime&&y-this.lastWheelTriggerTimea.size?-1:n.sizea.key?1:-1}}])}(),bw=function(){function e(){$t(this,e),we(this,"width",0),we(this,"height",0),we(this,"cellSize",0),we(this,"columns",0),we(this,"rows",0),we(this,"cells",{})}return Vt(e,[{key:"resizeAndClear",value:function(n,a){this.width=n.width,this.height=n.height,this.cellSize=a,this.columns=Math.ceil(n.width/a),this.rows=Math.ceil(n.height/a),this.cells={}}},{key:"getIndex",value:function(n){var a=Math.floor(n.x/this.cellSize),o=Math.floor(n.y/this.cellSize);return o*this.columns+a}},{key:"add",value:function(n,a,o){var s=new yw(n,a),c=this.getIndex(o),u=this.cells[c];u||(u=[],this.cells[c]=u),u.push(s)}},{key:"organize",value:function(){for(var n in this.cells){var a=this.cells[n];a.sort(yw.compare)}}},{key:"getLabelsToDisplay",value:function(n,a){var o=this.cellSize*this.cellSize,s=o/n/n,c=s*a/o,u=Math.ceil(c),f=[];for(var h in this.cells)for(var m=this.cells[h],g=0;g2&&arguments[2]!==void 0?arguments[2]:{};if($t(this,t),o=Sn(this,t),we(o,"elements",{}),we(o,"canvasContexts",{}),we(o,"webGLContexts",{}),we(o,"pickingLayers",new Set),we(o,"textures",{}),we(o,"frameBuffers",{}),we(o,"activeListeners",{}),we(o,"labelGrid",new bw),we(o,"nodeDataCache",{}),we(o,"edgeDataCache",{}),we(o,"nodeProgramIndex",{}),we(o,"edgeProgramIndex",{}),we(o,"nodesWithForcedLabels",new Set),we(o,"edgesWithForcedLabels",new Set),we(o,"nodeExtent",{x:[0,1],y:[0,1]}),we(o,"nodeZExtent",[1/0,-1/0]),we(o,"edgeZExtent",[1/0,-1/0]),we(o,"matrix",or()),we(o,"invMatrix",or()),we(o,"correctionRatio",1),we(o,"customBBox",null),we(o,"normalizationFunction",pw({x:[0,1],y:[0,1]})),we(o,"graphToViewportRatio",1),we(o,"itemIDsIndex",{}),we(o,"nodeIndices",{}),we(o,"edgeIndices",{}),we(o,"width",0),we(o,"height",0),we(o,"pixelRatio",fw()),we(o,"pickingDownSizingRatio",2*o.pixelRatio),we(o,"displayedNodeLabels",new Set),we(o,"displayedEdgeLabels",new Set),we(o,"highlightedNodes",new Set),we(o,"hoveredNode",null),we(o,"hoveredEdge",null),we(o,"renderFrame",null),we(o,"renderHighlightedNodesFrame",null),we(o,"needToProcess",!1),we(o,"checkEdgesEventsFrame",null),we(o,"nodePrograms",{}),we(o,"nodeHoverPrograms",{}),we(o,"edgePrograms",{}),o.settings=XG(s),fp(o.settings),VG(n),!(a instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");o.graph=n,o.container=a,o.createWebGLContext("edges",{picking:s.enableEdgeEvents}),o.createCanvasContext("edgeLabels"),o.createWebGLContext("nodes",{picking:!0}),o.createCanvasContext("labels"),o.createCanvasContext("hovers"),o.createWebGLContext("hoverNodes"),o.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),o.resize();for(var c in o.settings.nodeProgramClasses)o.registerNodeProgram(c,o.settings.nodeProgramClasses[c],o.settings.nodeHoverProgramClasses[c]);for(var u in o.settings.edgeProgramClasses)o.registerEdgeProgram(u,o.settings.edgeProgramClasses[u]);return o.camera=new gw,o.bindCameraHandlers(),o.mouseCaptor=new e3(o.elements.mouse,o),o.mouseCaptor.setSettings(o.settings),o.touchCaptor=new r3(o.elements.mouse,o),o.touchCaptor.setSettings(o.settings),o.bindEventHandlers(),o.bindGraphHandlers(),o.handleSettingsUpdate(),o.refresh(),o}return _n(t,e),Vt(t,[{key:"registerNodeProgram",value:function(a,o,s){return this.nodePrograms[a]&&this.nodePrograms[a].kill(),this.nodeHoverPrograms[a]&&this.nodeHoverPrograms[a].kill(),this.nodePrograms[a]=new o(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[a]=new(s||o)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(a,o){return this.edgePrograms[a]&&this.edgePrograms[a].kill(),this.edgePrograms[a]=new o(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(a){if(this.nodePrograms[a]){var o=this.nodePrograms,s=o[a],c=hp(o,[a].map(ol));s.kill(),this.nodePrograms=c}if(this.nodeHoverPrograms[a]){var u=this.nodeHoverPrograms,f=u[a],h=hp(u,[a].map(ol));f.kill(),this.nodePrograms=h}return this}},{key:"unregisterEdgeProgram",value:function(a){if(this.edgePrograms[a]){var o=this.edgePrograms,s=o[a],c=hp(o,[a].map(ol));s.kill(),this.edgePrograms=c}return this}},{key:"resetWebGLTexture",value:function(a){var o=this.webGLContexts[a],s=this.frameBuffers[a],c=this.textures[a];c&&o.deleteTexture(c);var u=o.createTexture();return o.bindFramebuffer(o.FRAMEBUFFER,s),o.bindTexture(o.TEXTURE_2D,u),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,this.width,this.height,0,o.RGBA,o.UNSIGNED_BYTE,null),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,u,0),this.textures[a]=u,this}},{key:"bindCameraHandlers",value:function(){var a=this;return this.activeListeners.camera=function(){a.scheduleRender()},this.camera.on("updated",this.activeListeners.camera),this}},{key:"unbindCameraHandlers",value:function(){return this.camera.removeListener("updated",this.activeListeners.camera),this}},{key:"getNodeAtPosition",value:function(a){var o=a.x,s=a.y,c=ew(this.webGLContexts.nodes,this.frameBuffers.nodes,o,s,this.pixelRatio,this.pickingDownSizingRatio),u=J0.apply(void 0,vw(c)),f=this.itemIDsIndex[u];return f&&f.type==="node"?f.id:null}},{key:"bindEventHandlers",value:function(){var a=this;this.activeListeners.handleResize=function(){a.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(s){var c=Js(s),u={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}},f=a.getNodeAtPosition(c);if(f&&a.hoveredNode!==f&&!a.nodeDataCache[f].hidden){a.hoveredNode&&a.emit("leaveNode",ze(ze({},u),{},{node:a.hoveredNode})),a.hoveredNode=f,a.emit("enterNode",ze(ze({},u),{},{node:f})),a.scheduleHighlightedNodesRender();return}if(a.hoveredNode&&a.getNodeAtPosition(c)!==a.hoveredNode){var h=a.hoveredNode;a.hoveredNode=null,a.emit("leaveNode",ze(ze({},u),{},{node:h})),a.scheduleHighlightedNodesRender();return}if(a.settings.enableEdgeEvents){var m=a.hoveredNode?null:a.getEdgeAtPoint(u.event.x,u.event.y);m!==a.hoveredEdge&&(a.hoveredEdge&&a.emit("leaveEdge",ze(ze({},u),{},{edge:a.hoveredEdge})),m&&a.emit("enterEdge",ze(ze({},u),{},{edge:m})),a.hoveredEdge=m)}},this.activeListeners.handleMoveBody=function(s){var c=Js(s);a.emit("moveBody",{event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(s){var c=Js(s),u={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}};a.hoveredNode&&(a.emit("leaveNode",ze(ze({},u),{},{node:a.hoveredNode})),a.scheduleHighlightedNodesRender()),a.settings.enableEdgeEvents&&a.hoveredEdge&&(a.emit("leaveEdge",ze(ze({},u),{},{edge:a.hoveredEdge})),a.scheduleHighlightedNodesRender()),a.emit("leaveStage",ze({},u))},this.activeListeners.handleEnter=function(s){var c=Js(s),u={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}};a.emit("enterStage",ze({},u))};var o=function(c){return function(u){var f=Js(u),h={event:f,preventSigmaDefault:function(){f.preventSigmaDefault()}},m=a.getNodeAtPosition(f);if(m)return a.emit("".concat(c,"Node"),ze(ze({},h),{},{node:m}));if(a.settings.enableEdgeEvents){var g=a.getEdgeAtPoint(f.x,f.y);if(g)return a.emit("".concat(c,"Edge"),ze(ze({},h),{},{edge:g}))}return a.emit("".concat(c,"Stage"),h)}};return this.activeListeners.handleClick=o("click"),this.activeListeners.handleRightClick=o("rightClick"),this.activeListeners.handleDoubleClick=o("doubleClick"),this.activeListeners.handleWheel=o("wheel"),this.activeListeners.handleDown=o("down"),this.activeListeners.handleUp=o("up"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("mousemovebody",this.activeListeners.handleMoveBody),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this.mouseCaptor.on("mouseup",this.activeListeners.handleUp),this.mouseCaptor.on("mouseleave",this.activeListeners.handleLeave),this.mouseCaptor.on("mouseenter",this.activeListeners.handleEnter),this.touchCaptor.on("touchdown",this.activeListeners.handleDown),this.touchCaptor.on("touchdown",this.activeListeners.handleMove),this.touchCaptor.on("touchup",this.activeListeners.handleUp),this.touchCaptor.on("touchmove",this.activeListeners.handleMove),this.touchCaptor.on("tap",this.activeListeners.handleClick),this.touchCaptor.on("doubletap",this.activeListeners.handleDoubleClick),this.touchCaptor.on("touchmove",this.activeListeners.handleMoveBody),this}},{key:"bindGraphHandlers",value:function(){var a=this,o=this.graph,s=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(c){var u,f=(u=c.hints)===null||u===void 0?void 0:u.attributes;a.graph.forEachNode(function(m){return a.updateNode(m)});var h=!f||f.some(function(m){return s.has(m)});a.refresh({partialGraph:{nodes:o.nodes()},skipIndexation:!h,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(c){var u,f=(u=c.hints)===null||u===void 0?void 0:u.attributes;a.graph.forEachEdge(function(m){return a.updateEdge(m)});var h=f&&["zIndex","type"].some(function(m){return f==null?void 0:f.includes(m)});a.refresh({partialGraph:{edges:o.edges()},skipIndexation:!h,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(c){var u=c.key;a.addNode(u),a.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(c){var u=c.key;a.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(c){var u=c.key;a.removeNode(u),a.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(c){var u=c.key;a.addEdge(u),a.refresh({partialGraph:{edges:[u]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(c){var u=c.key;a.refresh({partialGraph:{edges:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(c){var u=c.key;a.removeEdge(u),a.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){a.clearEdgeState(),a.clearEdgeIndices(),a.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){a.clearEdgeState(),a.clearNodeState(),a.clearEdgeIndices(),a.clearNodeIndices(),a.refresh({schedule:!0})},o.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),o.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),o.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),o.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),o.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),o.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),o.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),o.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),o.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),o.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var a=this.graph;a.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),a.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),a.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),a.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),a.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),a.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),a.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),a.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),a.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),a.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(a,o){var s=ew(this.webGLContexts.edges,this.frameBuffers.edges,a,o,this.pixelRatio,this.pickingDownSizingRatio),c=J0.apply(void 0,vw(s)),u=this.itemIDsIndex[c];return u&&u.type==="edge"?u.id:null}},{key:"process",value:function(){var a=this;this.emit("beforeProcess");var o=this.graph,s=this.settings,c=this.getDimensions();if(this.nodeExtent=$G(this.graph),!this.settings.autoRescale){var u=c.width,f=c.height,h=this.nodeExtent,m=h.x,g=h.y;this.nodeExtent={x:[(m[0]+m[1])/2-u/2,(m[0]+m[1])/2+u/2],y:[(g[0]+g[1])/2-f/2,(g[0]+g[1])/2+f/2]}}this.normalizationFunction=pw(this.customBBox||this.nodeExtent);var y=new gw,b=Qs(y.getState(),c,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(c,s.labelGridCellSize);for(var S={},E={},_={},N={},C=1,A=o.nodes(),k=0,D=A.length;k1&&arguments[1]!==void 0?arguments[1]:{},s=o.tolerance,c=s===void 0?0:s,u=o.boundaries,f=ze({},a),h=u||this.nodeExtent,m=Mo(h.x,2),g=m[0],y=m[1],b=Mo(h.y,2),S=b[0],E=b[1],_=[this.graphToViewport({x:g,y:S},{cameraState:a}),this.graphToViewport({x:y,y:S},{cameraState:a}),this.graphToViewport({x:g,y:E},{cameraState:a}),this.graphToViewport({x:y,y:E},{cameraState:a})],N=1/0,C=-1/0,A=1/0,k=-1/0;_.forEach(function(X){var ne=X.x,F=X.y;N=Math.min(N,ne),C=Math.max(C,ne),A=Math.min(A,F),k=Math.max(k,F)});var D=C-N,M=k-A,R=this.getDimensions(),U=R.width,L=R.height,I=0,q=0;if(D>=U?Cc&&(I=N-c):C>U+c?I=C-(U+c):N<-c&&(I=N+c),M>=L?kc&&(q=A-c):k>L+c?q=k-(L+c):A<-c&&(q=A+c),I||q){var Y=this.viewportToFramedGraph({x:0,y:0},{cameraState:a}),B=this.viewportToFramedGraph({x:I,y:q},{cameraState:a});I=B.x-Y.x,q=B.y-Y.y,f.x+=I,f.y+=q}return f}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var a=this.camera.getState(),o=this.labelGrid.getLabelsToDisplay(a.ratio,this.settings.labelDensity);mw(o,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var s=this.canvasContexts.labels,c=0,u=o.length;cthis.width+c3||y<-50||y>this.height+u3)){this.displayedNodeLabels.add(f);var S=this.settings.defaultDrawNodeLabel,E=this.nodePrograms[h.type],_=(E==null?void 0:E.drawLabel)||S;_(s,ze(ze({key:f},h),{},{size:b,x:g,y}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var a=this.canvasContexts.edgeLabels;a.clearRect(0,0,this.width,this.height);var o=l3({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});mw(o,this.edgesWithForcedLabels);for(var s=new Set,c=0,u=o.length;cthis.nodeZExtent[1]&&(this.nodeZExtent[1]=s.zIndex))}},{key:"updateNode",value:function(a){this.addNode(a);var o=this.nodeDataCache[a];this.normalizationFunction.applyTo(o)}},{key:"removeNode",value:function(a){delete this.nodeDataCache[a],delete this.nodeProgramIndex[a],this.highlightedNodes.delete(a),this.hoveredNode===a&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(a)}},{key:"addEdge",value:function(a){var o=Object.assign({},this.graph.getEdgeAttributes(a));this.settings.edgeReducer&&(o=this.settings.edgeReducer(a,o));var s=f3(this.settings,a,o);this.edgeDataCache[a]=s,this.edgesWithForcedLabels.delete(a),s.forceLabel&&!s.hidden&&this.edgesWithForcedLabels.add(a),this.settings.zIndex&&(s.zIndexthis.edgeZExtent[1]&&(this.edgeZExtent[1]=s.zIndex))}},{key:"updateEdge",value:function(a){this.addEdge(a)}},{key:"removeEdge",value:function(a){delete this.edgeDataCache[a],delete this.edgeProgramIndex[a],this.hoveredEdge===a&&(this.hoveredEdge=null),this.edgesWithForcedLabels.delete(a)}},{key:"clearNodeIndices",value:function(){this.labelGrid=new bw,this.nodeExtent={x:[0,1],y:[0,1]},this.nodeDataCache={},this.edgeProgramIndex={},this.nodesWithForcedLabels=new Set,this.nodeZExtent=[1/0,-1/0]}},{key:"clearEdgeIndices",value:function(){this.edgeDataCache={},this.edgeProgramIndex={},this.edgesWithForcedLabels=new Set,this.edgeZExtent=[1/0,-1/0]}},{key:"clearIndices",value:function(){this.clearEdgeIndices(),this.clearNodeIndices()}},{key:"clearNodeState",value:function(){this.displayedNodeLabels=new Set,this.highlightedNodes=new Set,this.hoveredNode=null}},{key:"clearEdgeState",value:function(){this.displayedEdgeLabels=new Set,this.highlightedNodes=new Set,this.hoveredEdge=null}},{key:"clearState",value:function(){this.clearEdgeState(),this.clearNodeState()}},{key:"addNodeToProgram",value:function(a,o,s){var c=this.nodeDataCache[a],u=this.nodePrograms[c.type];if(!u)throw new Error('Sigma: could not find a suitable program for node type "'.concat(c.type,'"!'));u.process(o,s,c),this.nodeProgramIndex[a]=s}},{key:"addEdgeToProgram",value:function(a,o,s){var c=this.edgeDataCache[a],u=this.edgePrograms[c.type];if(!u)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(c.type,'"!'));var f=this.graph.extremities(a),h=this.nodeDataCache[f[0]],m=this.nodeDataCache[f[1]];u.process(o,s,h,m,c),this.edgeProgramIndex[a]=s}},{key:"getRenderParams",value:function(){return{matrix:this.matrix,invMatrix:this.invMatrix,width:this.width,height:this.height,pixelRatio:this.pixelRatio,zoomRatio:this.camera.ratio,cameraAngle:this.camera.angle,sizeRatio:1/this.scaleSize(),correctionRatio:this.correctionRatio,downSizingRatio:this.pickingDownSizingRatio,minEdgeThickness:this.settings.minEdgeThickness,antiAliasingFeather:this.settings.antiAliasingFeather}}},{key:"getStagePadding",value:function(){var a=this.settings,o=a.stagePadding,s=a.autoRescale;return s&&o||0}},{key:"createLayer",value:function(a,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[a])throw new Error('Sigma: a layer named "'.concat(a,'" already exists'));var c=qG(o,{position:"absolute"},{class:"sigma-".concat(a)});return s.style&&Object.assign(c.style,s.style),this.elements[a]=c,"beforeLayer"in s&&s.beforeLayer?this.elements[s.beforeLayer].before(c):"afterLayer"in s&&s.afterLayer?this.elements[s.afterLayer].after(c):this.container.appendChild(c),c}},{key:"createCanvas",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(a,"canvas",o)}},{key:"createCanvasContext",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=this.createCanvas(a,o),c={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[a]=s.getContext("2d",c),this}},{key:"createWebGLContext",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=(o==null?void 0:o.canvas)||this.createCanvas(a,o);o.hidden&&s.remove();var c=ze({preserveDrawingBuffer:!1,antialias:!1},o),u;u=s.getContext("webgl2",c),u||(u=s.getContext("webgl",c)),u||(u=s.getContext("experimental-webgl",c));var f=u;if(this.webGLContexts[a]=f,f.blendFunc(f.ONE,f.ONE_MINUS_SRC_ALPHA),o.picking){this.pickingLayers.add(a);var h=f.createFramebuffer();if(!h)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(a));this.frameBuffers[a]=h}return f}},{key:"killLayer",value:function(a){var o=this.elements[a];if(!o)throw new Error("Sigma: cannot kill layer ".concat(a,", which does not exist"));if(this.webGLContexts[a]){var s,c=this.webGLContexts[a];(s=c.getExtension("WEBGL_lose_context"))===null||s===void 0||s.loseContext(),delete this.webGLContexts[a]}else this.canvasContexts[a]&&delete this.canvasContexts[a];return o.remove(),delete this.elements[a],this}},{key:"getCamera",value:function(){return this.camera}},{key:"setCamera",value:function(a){this.unbindCameraHandlers(),this.camera=a,this.bindCameraHandlers()}},{key:"getContainer",value:function(){return this.container}},{key:"getGraph",value:function(){return this.graph}},{key:"setGraph",value:function(a){a!==this.graph&&(this.hoveredNode&&!a.hasNode(this.hoveredNode)&&(this.hoveredNode=null),this.hoveredEdge&&!a.hasEdge(this.hoveredEdge)&&(this.hoveredEdge=null),this.unbindGraphHandlers(),this.checkEdgesEventsFrame!==null&&(cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=a,this.bindGraphHandlers(),this.refresh())}},{key:"getMouseCaptor",value:function(){return this.mouseCaptor}},{key:"getTouchCaptor",value:function(){return this.touchCaptor}},{key:"getDimensions",value:function(){return{width:this.width,height:this.height}}},{key:"getGraphDimensions",value:function(){var a=this.customBBox||this.nodeExtent;return{width:a.x[1]-a.x[0]||1,height:a.y[1]-a.y[0]||1}}},{key:"getNodeDisplayData",value:function(a){var o=this.nodeDataCache[a];return o?Object.assign({},o):void 0}},{key:"getEdgeDisplayData",value:function(a){var o=this.edgeDataCache[a];return o?Object.assign({},o):void 0}},{key:"getNodeDisplayedLabels",value:function(){return new Set(this.displayedNodeLabels)}},{key:"getEdgeDisplayedLabels",value:function(){return new Set(this.displayedEdgeLabels)}},{key:"getSettings",value:function(){return ze({},this.settings)}},{key:"getSetting",value:function(a){return this.settings[a]}},{key:"setSetting",value:function(a,o){var s=ze({},this.settings);return this.settings[a]=o,fp(this.settings),this.handleSettingsUpdate(s),this.scheduleRefresh(),this}},{key:"updateSetting",value:function(a,o){return this.setSetting(a,o(this.settings[a])),this}},{key:"setSettings",value:function(a){var o=ze({},this.settings);return this.settings=ze(ze({},this.settings),a),fp(this.settings),this.handleSettingsUpdate(o),this.scheduleRefresh(),this}},{key:"resize",value:function(a){var o=this.width,s=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=fw(),this.width===0)if(this.settings.allowInvalidContainer)this.width=1;else throw new Error("Sigma: Container has no width. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(this.height===0)if(this.settings.allowInvalidContainer)this.height=1;else throw new Error("Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(!a&&o===this.width&&s===this.height)return this;for(var c in this.elements){var u=this.elements[c];u.style.width=this.width+"px",u.style.height=this.height+"px"}for(var f in this.canvasContexts)this.elements[f].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[f].setAttribute("height",this.height*this.pixelRatio+"px"),this.pixelRatio!==1&&this.canvasContexts[f].scale(this.pixelRatio,this.pixelRatio);for(var h in this.webGLContexts){this.elements[h].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[h].setAttribute("height",this.height*this.pixelRatio+"px");var m=this.webGLContexts[h];if(m.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(h)){var g=this.textures[h];g&&m.deleteTexture(g)}}return this.emit("resize"),this}},{key:"clear",value:function(){return this.emit("beforeClear"),this.webGLContexts.nodes.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.nodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.edges.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.edges.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.hoverNodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.canvasContexts.labels.clearRect(0,0,this.width,this.height),this.canvasContexts.hovers.clearRect(0,0,this.width,this.height),this.canvasContexts.edgeLabels.clearRect(0,0,this.width,this.height),this.emit("afterClear"),this}},{key:"refresh",value:function(a){var o=this,s=(a==null?void 0:a.skipIndexation)!==void 0?a==null?void 0:a.skipIndexation:!1,c=(a==null?void 0:a.schedule)!==void 0?a.schedule:!1,u=!a||!a.partialGraph;if(u)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(k){return o.addNode(k)}),this.graph.forEachEdge(function(k){return o.addEdge(k)});else{for(var f,h,m=((f=a.partialGraph)===null||f===void 0?void 0:f.nodes)||[],g=0,y=(m==null?void 0:m.length)||0;g1&&arguments[1]!==void 0?arguments[1]:{},s=!!o.cameraState||!!o.viewportDimensions||!!o.graphDimensions,c=o.matrix?o.matrix:s?Qs(o.cameraState||this.camera.getState(),o.viewportDimensions||this.getDimensions(),o.graphDimensions||this.getGraphDimensions(),o.padding||this.getStagePadding()):this.matrix,u=_m(c,a);return{x:(1+u.x)*this.width/2,y:(1-u.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=!!o.cameraState||!!o.viewportDimensions||!o.graphDimensions,c=o.matrix?o.matrix:s?Qs(o.cameraState||this.camera.getState(),o.viewportDimensions||this.getDimensions(),o.graphDimensions||this.getGraphDimensions(),o.padding||this.getStagePadding(),!0):this.invMatrix,u=_m(c,{x:a.x/this.width*2-1,y:1-a.y/this.height*2});return isNaN(u.x)&&(u.x=0),isNaN(u.y)&&(u.y=0),u}},{key:"viewportToGraph",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(a,o))}},{key:"graphToViewport",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(a),o)}},{key:"getGraphToViewportRatio",value:function(){var a={x:0,y:0},o={x:1,y:1},s=Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2)),c=this.graphToViewport(a),u=this.graphToViewport(o),f=Math.sqrt(Math.pow(c.x-u.x,2)+Math.pow(c.y-u.y,2));return f/s}},{key:"getBBox",value:function(){return this.nodeExtent}},{key:"getCustomBBox",value:function(){return this.customBBox}},{key:"setCustomBBox",value:function(a){return this.customBBox=a,this.scheduleRender(),this}},{key:"kill",value:function(){this.emit("kill"),this.removeAllListeners(),this.unbindCameraHandlers(),window.removeEventListener("resize",this.activeListeners.handleResize),this.mouseCaptor.kill(),this.touchCaptor.kill(),this.unbindGraphHandlers(),this.clearIndices(),this.clearState(),this.nodeDataCache={},this.edgeDataCache={},this.highlightedNodes.clear(),this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null),this.renderHighlightedNodesFrame&&(cancelAnimationFrame(this.renderHighlightedNodesFrame),this.renderHighlightedNodesFrame=null);for(var a=this.container;a.firstChild;)a.removeChild(a.firstChild);this.canvasContexts={},this.webGLContexts={},this.elements={};for(var o in this.nodePrograms)this.nodePrograms[o].kill();for(var s in this.nodeHoverPrograms)this.nodeHoverPrograms[s].kill();for(var c in this.edgePrograms)this.edgePrograms[c].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var u in this.elements)this.killLayer(u)}},{key:"scaleSize",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return a/this.settings.zoomToSizeRatioFunction(o)*(this.getSetting("itemSizesReference")==="positions"?o*this.graphToViewportRatio:1)}},{key:"getCanvases",value:function(){var a={};for(var o in this.elements)this.elements[o]instanceof HTMLCanvasElement&&(a[o]=this.elements[o]);return a}}])}($g);const MC=w.createContext(null),p3=MC.Provider;function qg(){const e=w.useContext(MC);if(e==null)throw new Error("No context provided: useSigmaContext() can only be used in a descendant of ");return e}function Zn(){return qg().sigma}function PC(){const{sigma:e}=qg();return w.useCallback(t=>{e&&Object.keys(t).forEach(n=>{e.setSetting(n,t[n])})},[e])}function bd(e){return new Set(Object.keys(e))}const xw=bd({clickNode:!0,rightClickNode:!0,downNode:!0,enterNode:!0,leaveNode:!0,doubleClickNode:!0,wheelNode:!0,clickEdge:!0,rightClickEdge:!0,downEdge:!0,enterEdge:!0,leaveEdge:!0,doubleClickEdge:!0,wheelEdge:!0,clickStage:!0,rightClickStage:!0,downStage:!0,doubleClickStage:!0,wheelStage:!0,beforeRender:!0,afterRender:!0,kill:!0,upStage:!0,upEdge:!0,upNode:!0,enterStage:!0,leaveStage:!0,resize:!0,afterClear:!0,afterProcess:!0,beforeClear:!0,beforeProcess:!0,moveBody:!0}),ww=bd({click:!0,rightClick:!0,doubleClick:!0,mouseup:!0,mousedown:!0,mousemove:!0,mousemovebody:!0,mouseleave:!0,mouseenter:!0,wheel:!0}),Ew=bd({touchup:!0,touchdown:!0,touchmove:!0,touchmovebody:!0,tap:!0,doubletap:!0}),Sw=bd({updated:!0});function GC(){const e=Zn(),t=PC(),[n,a]=w.useState({});return w.useEffect(()=>{if(!e||!n)return;const o=n,s=Object.keys(o);return s.forEach(c=>{const u=o[c];xw.has(c)&&e.on(c,u),ww.has(c)&&e.getMouseCaptor().on(c,u),Ew.has(c)&&e.getTouchCaptor().on(c,u),Sw.has(c)&&e.getCamera().on(c,u)}),()=>{e&&s.forEach(c=>{const u=o[c];xw.has(c)&&e.off(c,u),ww.has(c)&&e.getMouseCaptor().off(c,u),Ew.has(c)&&e.getTouchCaptor().off(c,u),Sw.has(c)&&e.getCamera().off(c,u)})}},[e,n,t]),a}function m3(){const e=Zn();return w.useCallback((t,n=!0)=>{e&&t&&(n&&e.getGraph().order>0&&e.getGraph().clear(),e.getGraph().import(t),e.refresh())},[e])}function Al(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!=Object.keys(t).length)return!1;for(const n in e)if(!Object.hasOwn(t,n)||!Al(e[n],t[n]))return!1;return!0}return!1}function FC(e){const t=Zn(),[n,a]=w.useState(e||{});w.useEffect(()=>{a(h=>Al(h,e||{})?h:e||{})},[e]);const o=w.useCallback(h=>{t.getCamera().animatedZoom(Object.assign(Object.assign({},n),h))},[t,n]),s=w.useCallback(h=>{t.getCamera().animatedUnzoom(Object.assign(Object.assign({},n),h))},[t,n]),c=w.useCallback(h=>{t.getCamera().animatedReset(Object.assign(Object.assign({},n),h))},[t,n]),u=w.useCallback((h,m)=>{t.getCamera().animate(h,Object.assign(Object.assign({},n),m))},[t,n]),f=w.useCallback((h,m)=>{const g=t.getNodeDisplayData(h);g?t.getCamera().animate(g,Object.assign(Object.assign({},n),m)):console.warn(`Node ${h} not found`)},[t,n]);return{zoomIn:o,zoomOut:s,reset:c,goto:u,gotoNode:f}}function g3(e){const t=qg(),[n,a]=w.useState(!1),[o,s]=w.useState(t.container),c=w.useCallback(()=>a(u=>!u),[]);return w.useEffect(()=>(document.addEventListener("fullscreenchange",c),()=>document.removeEventListener("fullscreenchange",c)),[c]),w.useEffect(()=>{s(t.container)},[e,t.container]),{toggle:w.useCallback(()=>{var u;u=o,document.fullscreenElement!==u?u.requestFullscreen():document.exitFullscreen&&document.exitFullscreen()},[o]),isFullScreen:n}}const v3=w.forwardRef(({graph:e,id:t,className:n,style:a,settings:o={},children:s},c)=>{const u=w.useRef(null),f=w.useRef(null),h={className:`react-sigma ${n||""}`,id:t,style:a},[m,g]=w.useState(null),[y,b]=w.useState(o);w.useEffect(()=>{b(_=>Al(_,o)?_:o)},[o]),w.useEffect(()=>{g(_=>{let N=null;if(f.current!==null){let C=new ft;e&&(C=typeof e=="function"?new e:e);let A=null;_&&(A=_.getCamera().getState(),_.kill()),N=new h3(C,f.current,y),A&&N.getCamera().setState(A)}return N})},[f,e,y]),w.useImperativeHandle(c,()=>m,[m]);const S=w.useMemo(()=>m&&u.current?{sigma:m,container:u.current}:null,[m,u]),E=S!==null?ve.createElement(p3,{value:S},s):null;return ve.createElement("div",Object.assign({},h,{ref:u}),ve.createElement("div",{className:"sigma-container",ref:f}),E)});var y3=` +precision mediump float; + +varying vec4 v_color; +varying float v_border; + +const float radius = 0.5; +const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); + +void main(void) { + vec2 m = gl_PointCoord - vec2(0.5, 0.5); + float dist = radius - length(m); + + // No antialiasing for picking mode: + #ifdef PICKING_MODE + if (dist > v_border) + gl_FragColor = v_color; + else + gl_FragColor = transparent; + + #else + float t = 0.0; + if (dist > v_border) + t = 1.0; + else if (dist > 0.0) + t = dist / v_border; + + gl_FragColor = mix(transparent, v_color, t); + #endif +} +`,b3=y3,x3=` +attribute vec4 a_id; +attribute vec4 a_color; +attribute vec2 a_position; +attribute float a_size; + +uniform float u_sizeRatio; +uniform float u_pixelRatio; +uniform mat3 u_matrix; + +varying vec4 v_color; +varying float v_border; + +const float bias = 255.0 / 254.0; + +void main() { + gl_Position = vec4( + (u_matrix * vec3(a_position, 1)).xy, + 0, + 1 + ); + + // Multiply the point size twice: + // - x SCALING_RATIO to correct the canvas scaling + // - x 2 to correct the formulae + gl_PointSize = a_size / u_sizeRatio * u_pixelRatio * 2.0; + + v_border = (0.5 / a_size) * u_sizeRatio; + + #ifdef PICKING_MODE + // For picking mode, we use the ID as the color: + v_color = a_id; + #else + // For normal mode, we use the color: + v_color = a_color; + #endif + + v_color.a *= bias; +} +`,w3=x3,UC=WebGLRenderingContext,_w=UC.UNSIGNED_BYTE,Cw=UC.FLOAT,E3=["u_sizeRatio","u_pixelRatio","u_matrix"],S3=function(e){function t(){return $t(this,t),Sn(this,t,arguments)}return _n(t,e),Vt(t,[{key:"getDefinition",value:function(){return{VERTICES:1,VERTEX_SHADER_SOURCE:w3,FRAGMENT_SHADER_SOURCE:b3,METHOD:WebGLRenderingContext.POINTS,UNIFORMS:E3,ATTRIBUTES:[{name:"a_position",size:2,type:Cw},{name:"a_size",size:1,type:Cw},{name:"a_color",size:4,type:_w,normalized:!0},{name:"a_id",size:4,type:_w,normalized:!0}]}}},{key:"processVisibleItem",value:function(a,o,s){var c=this.array;c[o++]=s.x,c[o++]=s.y,c[o++]=s.size,c[o++]=Ar(s.color),c[o++]=a}},{key:"setUniforms",value:function(a,o){var s=a.sizeRatio,c=a.pixelRatio,u=a.matrix,f=o.gl,h=o.uniformLocations,m=h.u_sizeRatio,g=h.u_pixelRatio,y=h.u_matrix;f.uniform1f(g,c),f.uniform1f(m,s),f.uniformMatrix3fv(y,!1,u)}}])}(Ig),_3=` +attribute vec4 a_id; +attribute vec4 a_color; +attribute vec2 a_normal; +attribute float a_normalCoef; +attribute vec2 a_positionStart; +attribute vec2 a_positionEnd; +attribute float a_positionCoef; +attribute float a_sourceRadius; +attribute float a_targetRadius; +attribute float a_sourceRadiusCoef; +attribute float a_targetRadiusCoef; + +uniform mat3 u_matrix; +uniform float u_zoomRatio; +uniform float u_sizeRatio; +uniform float u_pixelRatio; +uniform float u_correctionRatio; +uniform float u_minEdgeThickness; +uniform float u_lengthToThicknessRatio; +uniform float u_feather; + +varying vec4 v_color; +varying vec2 v_normal; +varying float v_thickness; +varying float v_feather; + +const float bias = 255.0 / 254.0; + +void main() { + float minThickness = u_minEdgeThickness; + + vec2 normal = a_normal * a_normalCoef; + vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef; + + float normalLength = length(normal); + vec2 unitNormal = normal / normalLength; + + // These first computations are taken from edge.vert.glsl. Please read it to + // get better comments on what's happening: + float pixelsThickness = max(normalLength, minThickness * u_sizeRatio); + float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio; + + // Here, we move the point to leave space for the arrow heads: + // Source arrow head + float sourceRadius = a_sourceRadius * a_sourceRadiusCoef; + float sourceDirection = sign(sourceRadius); + float webGLSourceRadius = sourceDirection * sourceRadius * 2.0 * u_correctionRatio / u_sizeRatio; + float webGLSourceArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0; + vec2 sourceCompensationVector = + vec2(-sourceDirection * unitNormal.y, sourceDirection * unitNormal.x) + * (webGLSourceRadius + webGLSourceArrowHeadLength); + + // Target arrow head + float targetRadius = a_targetRadius * a_targetRadiusCoef; + float targetDirection = sign(targetRadius); + float webGLTargetRadius = targetDirection * targetRadius * 2.0 * u_correctionRatio / u_sizeRatio; + float webGLTargetArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0; + vec2 targetCompensationVector = + vec2(-targetDirection * unitNormal.y, targetDirection * unitNormal.x) + * (webGLTargetRadius + webGLTargetArrowHeadLength); + + // Here is the proper position of the vertex + gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + sourceCompensationVector + targetCompensationVector, 1)).xy, 0, 1); + + v_thickness = webGLThickness / u_zoomRatio; + + v_normal = unitNormal; + + v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0; + + #ifdef PICKING_MODE + // For picking mode, we use the ID as the color: + v_color = a_id; + #else + // For normal mode, we use the color: + v_color = a_color; + #endif + + v_color.a *= bias; +} +`,C3=_3,BC=WebGLRenderingContext,Tw=BC.UNSIGNED_BYTE,Kr=BC.FLOAT,T3=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],R3={lengthToThicknessRatio:Rl.lengthToThicknessRatio};function IC(e){var t=ze(ze({},R3),{});return function(n){function a(){return $t(this,a),Sn(this,a,arguments)}return _n(a,n),Vt(a,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:C3,FRAGMENT_SHADER_SOURCE:Hg,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:T3,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Kr},{name:"a_positionEnd",size:2,type:Kr},{name:"a_normal",size:2,type:Kr},{name:"a_color",size:4,type:Tw,normalized:!0},{name:"a_id",size:4,type:Tw,normalized:!0},{name:"a_sourceRadius",size:1,type:Kr},{name:"a_targetRadius",size:1,type:Kr}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Kr},{name:"a_normalCoef",size:1,type:Kr},{name:"a_sourceRadiusCoef",size:1,type:Kr},{name:"a_targetRadiusCoef",size:1,type:Kr}],CONSTANT_DATA:[[0,1,-1,0],[0,-1,1,0],[1,1,0,1],[1,1,0,1],[0,-1,1,0],[1,-1,0,-1]]}}},{key:"processVisibleItem",value:function(s,c,u,f,h){var m=h.size||1,g=u.x,y=u.y,b=f.x,S=f.y,E=Ar(h.color),_=b-g,N=S-y,C=u.size||1,A=f.size||1,k=_*_+N*N,D=0,M=0;k&&(k=1/Math.sqrt(k),D=-N*k*m,M=_*k*m);var R=this.array;R[c++]=g,R[c++]=y,R[c++]=b,R[c++]=S,R[c++]=D,R[c++]=M,R[c++]=E,R[c++]=s,R[c++]=C,R[c++]=A}},{key:"setUniforms",value:function(s,c){var u=c.gl,f=c.uniformLocations,h=f.u_matrix,m=f.u_zoomRatio,g=f.u_feather,y=f.u_pixelRatio,b=f.u_correctionRatio,S=f.u_sizeRatio,E=f.u_minEdgeThickness,_=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(h,!1,s.matrix),u.uniform1f(m,s.zoomRatio),u.uniform1f(S,s.sizeRatio),u.uniform1f(b,s.correctionRatio),u.uniform1f(y,s.pixelRatio),u.uniform1f(g,s.antiAliasingFeather),u.uniform1f(E,s.minEdgeThickness),u.uniform1f(_,t.lengthToThicknessRatio)}}])}(Cl)}IC();function A3(e){return _C([IC(),ju(e),ju(ze(ze({},e),{},{extremity:"source"}))])}A3();function D3(e){if(Array.isArray(e))return e}function k3(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,o,s,c,u=[],f=!0,h=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(f=(a=s.call(n)).done)&&(u.push(a.value),u.length!==t);f=!0);}catch(m){h=!0,o=m}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(h)throw o}}return u}}function Tm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n v_radius) + gl_FragColor = transparent; + else { + gl_FragColor = v_color; + gl_FragColor.a *= bias; + } + #else + // Sizes: +`).concat(t.flatMap(function(o,s){var c=o.size;if("fill"in c)return[];c=c;var u="attribute"in c?"v_borderSize_".concat(s+1):rw(c.value),f=(c.mode||H3)==="pixels"?"u_correctionRatio":"v_radius";return[" float borderSize_".concat(s+1," = ").concat(f," * ").concat(u,";")]}).join(` +`),` + // Now, let's split the remaining space between "fill" borders: + float fillBorderSize = (v_radius - (`).concat(t.flatMap(function(o,s){var c=o.size;return"fill"in c?[]:["borderSize_".concat(s+1)]}).join(" + "),") ) / ").concat(n,`; +`).concat(t.flatMap(function(o,s){var c=o.size;return"fill"in c?[" float borderSize_".concat(s+1," = fillBorderSize;")]:[]}).join(` +`),` + + // Finally, normalize all border sizes, to start from the full size and to end with the smallest: + float adjustedBorderSize_0 = v_radius; +`).concat(t.map(function(o,s){return" float adjustedBorderSize_".concat(s+1," = adjustedBorderSize_").concat(s," - borderSize_").concat(s+1,";")}).join(` +`),` + + // Colors: + vec4 borderColor_0 = transparent; +`).concat(t.map(function(o,s){var c=o.color,u=[];return"attribute"in c?u.push(" vec4 borderColor_".concat(s+1," = v_borderColor_").concat(s+1,";")):"transparent"in c?u.push(" vec4 borderColor_".concat(s+1," = vec4(0.0, 0.0, 0.0, 0.0);")):u.push(" vec4 borderColor_".concat(s+1," = u_borderColor_").concat(s+1,";")),u.push(" borderColor_".concat(s+1,".a *= bias;")),u.push(" if (borderSize_".concat(s+1," <= 1.0 * u_correctionRatio) { borderColor_").concat(s+1," = borderColor_").concat(s,"; }")),u.join(` +`)}).join(` +`),` + if (dist > adjustedBorderSize_0) { + gl_FragColor = borderColor_0; + } else `).concat(t.map(function(o,s){return"if (dist > adjustedBorderSize_".concat(s,` - aaBorder) { + gl_FragColor = mix(borderColor_`).concat(s+1,", borderColor_").concat(s,", (dist - adjustedBorderSize_").concat(s,` + aaBorder) / aaBorder); + } else if (dist > adjustedBorderSize_`).concat(s+1,`) { + gl_FragColor = borderColor_`).concat(s+1,`; + } else `)}).join(""),` { /* Nothing to add here */ } + #endif +} +`);return a}function Y3(e){var t=e.borders,n=` +attribute vec2 a_position; +attribute float a_size; +attribute float a_angle; + +uniform mat3 u_matrix; +uniform float u_sizeRatio; +uniform float u_correctionRatio; + +varying vec2 v_diffVector; +varying float v_radius; + +#ifdef PICKING_MODE +attribute vec4 a_id; +varying vec4 v_color; +#else +`.concat(t.flatMap(function(a,o){var s=a.size;return"attribute"in s?["attribute float a_borderSize_".concat(o+1,";"),"varying float v_borderSize_".concat(o+1,";")]:[]}).join(` +`),` +`).concat(t.flatMap(function(a,o){var s=a.color;return"attribute"in s?["attribute vec4 a_borderColor_".concat(o+1,";"),"varying vec4 v_borderColor_".concat(o+1,";")]:[]}).join(` +`),` +#endif + +const float bias = 255.0 / 254.0; +const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); + +void main() { + float size = a_size * u_correctionRatio / u_sizeRatio * 4.0; + vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle)); + vec2 position = a_position + diffVector; + gl_Position = vec4( + (u_matrix * vec3(position, 1)).xy, + 0, + 1 + ); + + v_radius = size / 2.0; + v_diffVector = diffVector; + + #ifdef PICKING_MODE + v_color = a_id; + #else +`).concat(t.flatMap(function(a,o){var s=a.size;return"attribute"in s?[" v_borderSize_".concat(o+1," = a_borderSize_").concat(o+1,";")]:[]}).join(` +`),` +`).concat(t.flatMap(function(a,o){var s=a.color;return"attribute"in s?[" v_borderColor_".concat(o+1," = a_borderColor_").concat(o+1,";")]:[]}).join(` +`),` + #endif +} +`);return n}var qC=WebGLRenderingContext,Dw=qC.UNSIGNED_BYTE,tu=qC.FLOAT;function W3(e){var t,n=Aw(Aw({},$3),{}),a=n.borders,o=n.drawLabel,s=n.drawHover,c=["u_sizeRatio","u_correctionRatio","u_matrix"].concat(pp(a.flatMap(function(u,f){var h=u.color;return"value"in h?["u_borderColor_".concat(f+1)]:[]})));return t=function(u){F3(f,u);function f(){var h;j3(this,f);for(var m=arguments.length,g=new Array(m),y=0;ye.length)&&(t=e.length);for(var n=0,a=Array(t);n$){var W="…";for(E=E+W,O=s.measureText(E).width;O>$&&E.length>1;)E=E.slice(0,-2)+W,O=s.measureText(E).width;if(E.length<4)return}for(var re={},de=0,ie=E.length;de{const n=this.nodeIdMap[t];if(n!==void 0)return this.nodes[n]});Xr(this,"getEdge",(t,n=!0)=>{const a=n?this.edgeDynamicIdMap[t]:this.edgeIdMap[t];if(a!==void 0)return this.edges[a]});Xr(this,"buildDynamicMap",()=>{this.edgeDynamicIdMap={};for(let t=0;t({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,moveToSelectedNode:!1,rawGraph:null,sigmaGraph:null,setSelectedNode:(t,n)=>e({selectedNode:t,moveToSelectedNode:n}),setFocusedNode:t=>e({focusedNode:t}),setSelectedEdge:t=>e({selectedEdge:t}),setFocusedEdge:t=>e({focusedEdge:t}),clearSelection:()=>e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null}),reset:()=>e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,rawGraph:null,sigmaGraph:null,moveToSelectedNode:!1}),setRawGraph:t=>e({rawGraph:t}),setSigmaGraph:t=>e({sigmaGraph:t}),setMoveToSelectedNode:t=>e({moveToSelectedNode:t})})),ct=tg(m5),g5=({node:e,move:t})=>{const n=Zn(),{gotoNode:a}=FC();return w.useEffect(()=>{if(e)return n.getGraph().setNodeAttribute(e,"highlighted",!0),t&&(a(e),ct.getState().setMoveToSelectedNode(!1)),()=>{n.getGraph().setNodeAttribute(e,"highlighted",!1)}},[e,t,n,a]),null};function Xo(e,t){const n=Zn(),a=w.useRef(t);return Al(a.current,t)||(a.current=t),{positions:w.useCallback(()=>a.current?e(n.getGraph(),a.current):{},[n,a,e]),assign:w.useCallback(()=>{a.current&&e.assign(n.getGraph(),a.current)},[n,a,e])}}function Wg(e,t){const n=Zn(),[a,o]=w.useState(!1),[s,c]=w.useState(null),u=w.useRef(t);return Al(u.current,t)||(u.current=t),w.useEffect(()=>{o(!1);let f=null;return u.current&&(f=new e(n.getGraph(),u.current)),c(f),()=>{f!==null&&f.kill()}},[n,u,c,o,e]),{stop:w.useCallback(()=>{s&&(s.stop(),o(!1))},[s,o]),start:w.useCallback(()=>{s&&(s.start(),o(!0))},[s,o]),kill:w.useCallback(()=>{s&&s.kill(),o(!1)},[s,o]),isRunning:a}}var gp,Ow;function Dl(){if(Ow)return gp;Ow=1;function e(n){return!n||typeof n!="object"||typeof n=="function"||Array.isArray(n)||n instanceof Set||n instanceof Map||n instanceof RegExp||n instanceof Date}function t(n,a){n=n||{};var o={};for(var s in a){var c=n[s],u=a[s];if(!e(u)){o[s]=t(c,u);continue}c===void 0?o[s]=u:o[s]=c}return o}return gp=t,gp}var vp,jw;function v5(){if(jw)return vp;jw=1;function e(n){return function(a,o){return a+Math.floor(n()*(o-a+1))}}var t=e(Math.random);return t.createRandom=e,vp=t,vp}var yp,Lw;function y5(){if(Lw)return yp;Lw=1;var e=v5().createRandom;function t(a){var o=e(a);return function(s){for(var c=s.length,u=c-1,f=-1;++f0},o.prototype.addChild=function(R,U){this.children[R]=U,++this.countChildren},o.prototype.getChild=function(R){if(!this.children.hasOwnProperty(R)){var U=new o;this.children[R]=U,++this.countChildren}return this.children[R]},o.prototype.applyPositionToChildren=function(){if(this.hasChildren()){var R=this;for(var U in R.children){var L=R.children[U];L.x+=R.x,L.y+=R.y,L.applyPositionToChildren()}}};function s(R,U,L){for(var I in U.children){var q=U.children[I];q.hasChildren()?s(R,q,L):L[q.id]={x:q.x,y:q.y}}}function c(R,U){var L=R.r-U.r,I=U.x-R.x,q=U.y-R.y;return L<0||L*L0&&L*L>I*I+q*q}function f(R,U){for(var L=0;Lne?(q=(F+ne-Y)/(2*F),X=Math.sqrt(Math.max(0,ne/F-q*q)),L.x=R.x-q*I-X*B,L.y=R.y-q*B+X*I):(q=(F+Y-ne)/(2*F),X=Math.sqrt(Math.max(0,Y/F-q*q)),L.x=U.x+q*I-X*B,L.y=U.y+q*B+X*I)):(L.x=U.x+L.r,L.y=U.y)}function N(R,U){var L=R.r+U.r-1e-6,I=U.x-R.x,q=U.y-R.y;return L>0&&L*L>I*I+q*q}function C(R,U){var L=R.length;if(L===0)return 0;var I,q,Y,B,X,ne,F,z,j,K;if(I=R[0],I.x=0,I.y=0,L<=1)return I.r;if(q=R[1],I.x=-q.r,q.x=I.r,q.y=0,L<=2)return I.r+q.r;Y=R[2],_(q,I,Y),I=new o(null,null,null,null,I),q=new o(null,null,null,null,q),Y=new o(null,null,null,null,Y),I.next=Y.previous=q,q.next=I.previous=Y,Y.next=q.previous=I;e:for(ne=3;ne"u"?o:h};typeof o=="function"&&(c=o);var u=function(h){return c(h[a])},f=function(){return c(void 0)};return typeof a=="string"?(s.fromAttributes=u,s.fromGraph=function(h,m){return u(h.getNodeAttributes(m))},s.fromEntry=function(h,m){return u(m)}):typeof a=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},s.fromGraph=function(h,m){return c(a(m,h.getNodeAttributes(m)))},s.fromEntry=function(h,m){return c(a(h,m))}):(s.fromAttributes=f,s.fromGraph=f,s.fromEntry=f),s}function n(a,o){var s={},c=function(h){return typeof h>"u"?o:h};typeof o=="function"&&(c=o);var u=function(h){return c(h[a])},f=function(){return c(void 0)};return typeof a=="string"?(s.fromAttributes=u,s.fromGraph=function(h,m){return u(h.getEdgeAttributes(m))},s.fromEntry=function(h,m){return u(m)},s.fromPartialEntry=s.fromEntry,s.fromMinimalEntry=s.fromEntry):typeof a=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},s.fromGraph=function(h,m){var g=h.extremities(m);return c(a(m,h.getEdgeAttributes(m),g[0],g[1],h.getNodeAttributes(g[0]),h.getNodeAttributes(g[1]),h.isUndirected(m)))},s.fromEntry=function(h,m,g,y,b,S,E){return c(a(h,m,g,y,b,S,E))},s.fromPartialEntry=function(h,m,g,y){return c(a(h,m,g,y))},s.fromMinimalEntry=function(h,m){return c(a(h,m))}):(s.fromAttributes=f,s.fromGraph=f,s.fromEntry=f,s.fromMinimalEntry=f),s}return tl.createNodeValueGetter=t,tl.createEdgeValueGetter=n,tl.createEdgeWeightGetter=function(a){return n(a,e)},tl}var wp,Gw;function eT(){if(Gw)return wp;Gw=1;const{createNodeValueGetter:e,createEdgeValueGetter:t}=Xg();return wp=function(a,o,s){const{nodeXAttribute:c,nodeYAttribute:u}=s,{attraction:f,repulsion:h,gravity:m,inertia:g,maxMove:y}=s.settings;let{shouldSkipNode:b,shouldSkipEdge:S,isNodeFixed:E}=s;E=e(E),b=e(b,!1),S=t(S,!1);const _=a.filterNodes((A,k)=>!b.fromEntry(A,k)),N=_.length;for(let A=0;A{if(D===M||b.fromEntry(D,R)||b.fromEntry(M,U)||S.fromEntry(A,k,D,M,R,U,L))return;const I=o[D],q=o[M],Y=q.x-I.x,B=q.y-I.y,X=Math.sqrt(Y*Y+B*B)||1,ne=f*X*Y,F=f*X*B;I.dx+=ne,I.dy+=F,q.dx-=ne,q.dy-=F}),m)for(let A=0;Ay&&(D.dx*=y/M,D.dy*=y/M),E.fromGraph(a,k)?D.fixed=!0:(D.x+=D.dx,D.y+=D.dy,D.fixed=!1)}return{converged:C}},wp}var nu={},Fw;function tT(){return Fw||(Fw=1,nu.assignLayoutChanges=function(e,t,n){const{nodeXAttribute:a,nodeYAttribute:o}=n;e.updateEachNodeAttributes((s,c)=>{const u=t[s];return!u||u.fixed||(c[a]=u.x,c[o]=u.y),c},{attributes:["x","y"]})},nu.collectLayoutChanges=function(e){const t={};for(const n in e){const a=e[n];t[n]={x:a.x,y:a.y}}return t}),nu}var Ep,Uw;function nT(){return Uw||(Uw=1,Ep={nodeXAttribute:"x",nodeYAttribute:"y",isNodeFixed:"fixed",shouldSkipNode:null,shouldSkipEdge:null,settings:{attraction:5e-4,repulsion:.1,gravity:1e-4,inertia:.6,maxMove:200}}),Ep}var Sp,Bw;function R5(){if(Bw)return Sp;Bw=1;const e=Dr(),t=Dl(),n=eT(),a=tT(),o=nT();function s(u,f,h){if(!e(f))throw new Error("graphology-layout-force: the given graph is not a valid graphology instance.");typeof h=="number"?h={maxIterations:h}:h=h||{};const m=h.maxIterations;if(h=t(h,o),typeof m!="number"||m<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");const g={};let y=null,b;for(b=0;bthis.runFrame())},s.prototype.stop=function(){return this.running=!1,this.frameID!==null&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},s.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-force/worker.start: layout was killed.");this.running||(this.running=!0,this.runFrame())},s.prototype.kill=function(){this.stop(),delete this.nodeStates,this.killed=!0},_p=s,_p}var N5=k5();const O5=dn(N5);function j5(e={maxIterations:100}){return Xo(D5,e)}function L5(e={}){return Wg(O5,e)}var Cp,Hw;function z5(){if(Hw)return Cp;Hw=1;var e=0,t=1,n=2,a=3,o=4,s=5,c=6,u=7,f=8,h=9,m=0,g=1,y=2,b=0,S=1,E=2,_=3,N=4,C=5,A=6,k=7,D=8,M=3,R=10,U=3,L=9,I=10;return Cp=function(Y,B,X){var ne,F,z,j,K,G,H,O,$,W,re=B.length,de=X.length,ie=Y.adjustSizes,oe=Y.barnesHutTheta*Y.barnesHutTheta,Ce,he,Se,be,Le,Te,ye,J=[];for(z=0;zAe?(pe-=(me-Ae)/2,Ee=pe+me):(le-=(Ae-me)/2,_e=le+Ae),J[0+b]=-1,J[0+S]=(le+_e)/2,J[0+E]=(pe+Ee)/2,J[0+_]=Math.max(_e-le,Ee-pe),J[0+N]=-1,J[0+C]=-1,J[0+A]=0,J[0+k]=0,J[0+D]=0,ne=1,z=0;z=0){B[z+e]=0)if(Te=Math.pow(B[z+e]-J[F+k],2)+Math.pow(B[z+t]-J[F+D],2),W=J[F+_],4*W*W/Te0?(ye=he*B[z+c]*J[F+A]/Te,B[z+n]+=Se*ye,B[z+a]+=be*ye):Te<0&&(ye=-he*B[z+c]*J[F+A]/Math.sqrt(Te),B[z+n]+=Se*ye,B[z+a]+=be*ye):Te>0&&(ye=he*B[z+c]*J[F+A]/Te,B[z+n]+=Se*ye,B[z+a]+=be*ye),F=J[F+N],F<0)break;continue}else{F=J[F+C];continue}else{if(G=J[F+b],G>=0&&G!==z&&(Se=B[z+e]-B[G+e],be=B[z+t]-B[G+t],Te=Se*Se+be*be,ie===!0?Te>0?(ye=he*B[z+c]*B[G+c]/Te,B[z+n]+=Se*ye,B[z+a]+=be*ye):Te<0&&(ye=-he*B[z+c]*B[G+c]/Math.sqrt(Te),B[z+n]+=Se*ye,B[z+a]+=be*ye):Te>0&&(ye=he*B[z+c]*B[G+c]/Te,B[z+n]+=Se*ye,B[z+a]+=be*ye)),F=J[F+N],F<0)break;continue}else for(he=Y.scalingRatio,j=0;j0?(ye=he*B[j+c]*B[K+c]/Te/Te,B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye):Te<0&&(ye=100*he*B[j+c]*B[K+c],B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye)):(Te=Math.sqrt(Se*Se+be*be),Te>0&&(ye=he*B[j+c]*B[K+c]/Te/Te,B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye));for($=Y.gravity/Y.scalingRatio,he=Y.scalingRatio,z=0;z0&&(ye=he*B[z+c]*$):Te>0&&(ye=he*B[z+c]*$/Te),B[z+n]-=Se*ye,B[z+a]-=be*ye;for(he=1*(Y.outboundAttractionDistribution?Ce:1),H=0;H0&&(ye=-he*Le*Math.log(1+Te)/Te/B[j+c]):Te>0&&(ye=-he*Le*Math.log(1+Te)/Te):Y.outboundAttractionDistribution?Te>0&&(ye=-he*Le/B[j+c]):Te>0&&(ye=-he*Le)):(Te=Math.sqrt(Math.pow(Se,2)+Math.pow(be,2)),Y.linLogMode?Y.outboundAttractionDistribution?Te>0&&(ye=-he*Le*Math.log(1+Te)/Te/B[j+c]):Te>0&&(ye=-he*Le*Math.log(1+Te)/Te):Y.outboundAttractionDistribution?(Te=1,ye=-he*Le/B[j+c]):(Te=1,ye=-he*Le)),Te>0&&(B[j+n]+=Se*ye,B[j+a]+=be*ye,B[K+n]-=Se*ye,B[K+a]-=be*ye);var je,He,it,Ct,bt,qt;if(ie===!0)for(z=0;zI&&(B[z+n]=B[z+n]*I/je,B[z+a]=B[z+a]*I/je),He=B[z+c]*Math.sqrt((B[z+o]-B[z+n])*(B[z+o]-B[z+n])+(B[z+s]-B[z+a])*(B[z+s]-B[z+a])),it=Math.sqrt((B[z+o]+B[z+n])*(B[z+o]+B[z+n])+(B[z+s]+B[z+a])*(B[z+s]+B[z+a]))/2,Ct=.1*Math.log(1+it)/(1+Math.sqrt(He)),bt=B[z+e]+B[z+n]*(Ct/Y.slowDown),B[z+e]=bt,qt=B[z+t]+B[z+a]*(Ct/Y.slowDown),B[z+t]=qt);else for(z=0;z=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in n&&typeof n.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in n&&!(typeof n.gravity=="number"&&n.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in n&&!(typeof n.slowDown=="number"||n.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in n&&typeof n.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in n&&!(typeof n.barnesHutTheta=="number"&&n.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},Zr.graphToByteArrays=function(n,a){var o=n.order,s=n.size,c={},u,f=new Float32Array(o*e),h=new Float32Array(s*t);return u=0,n.forEachNode(function(m,g){c[m]=u,f[u]=g.x,f[u+1]=g.y,f[u+2]=0,f[u+3]=0,f[u+4]=0,f[u+5]=0,f[u+6]=1,f[u+7]=1,f[u+8]=g.size||1,f[u+9]=g.fixed?1:0,u+=e}),u=0,n.forEachEdge(function(m,g,y,b,S,E,_){var N=c[y],C=c[b],A=a(m,g,y,b,S,E,_);f[N+6]+=A,f[C+6]+=A,h[u]=N,h[u+1]=C,h[u+2]=A,u+=t}),{nodes:f,edges:h}},Zr.assignLayoutChanges=function(n,a,o){var s=0;n.updateEachNodeAttributes(function(c,u){return u.x=a[s],u.y=a[s+1],s+=e,o?o(c,u):u})},Zr.readGraphPositions=function(n,a){var o=0;n.forEachNode(function(s,c){a[o]=c.x,a[o+1]=c.y,o+=e})},Zr.collectLayoutChanges=function(n,a,o){for(var s=n.nodes(),c={},u=0,f=0,h=a.length;u2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(h)}}var u=s.bind(null,!1);return u.assign=s.bind(null,!0),u.inferSettings=c,Rp=u,Rp}var P5=M5();const G5=dn(P5);var Ap,Yw;function F5(){return Yw||(Yw=1,Ap=function(){var t,n,a={};(function(){var s=0,c=1,u=2,f=3,h=4,m=5,g=6,y=7,b=8,S=9,E=0,_=1,N=2,C=0,A=1,k=2,D=3,M=4,R=5,U=6,L=7,I=8,q=3,Y=10,B=3,X=9,ne=10;a.exports=function(z,j,K){var G,H,O,$,W,re,de,ie,oe,Ce,he=j.length,Se=K.length,be=z.adjustSizes,Le=z.barnesHutTheta*z.barnesHutTheta,Te,ye,J,le,_e,pe,Ee,te=[];for(O=0;Obt?(me-=(Ct-bt)/2,Ae=me+Ct):(Fe-=(bt-Ct)/2,Pe=Fe+bt),te[0+C]=-1,te[0+A]=(Fe+Pe)/2,te[0+k]=(me+Ae)/2,te[0+D]=Math.max(Pe-Fe,Ae-me),te[0+M]=-1,te[0+R]=-1,te[0+U]=0,te[0+L]=0,te[0+I]=0,G=1,O=0;O=0){j[O+s]=0)if(pe=Math.pow(j[O+s]-te[H+L],2)+Math.pow(j[O+c]-te[H+I],2),Ce=te[H+D],4*Ce*Ce/pe0?(Ee=ye*j[O+g]*te[H+U]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe<0&&(Ee=-ye*j[O+g]*te[H+U]/Math.sqrt(pe),j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe>0&&(Ee=ye*j[O+g]*te[H+U]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee),H=te[H+M],H<0)break;continue}else{H=te[H+R];continue}else{if(re=te[H+C],re>=0&&re!==O&&(J=j[O+s]-j[re+s],le=j[O+c]-j[re+c],pe=J*J+le*le,be===!0?pe>0?(Ee=ye*j[O+g]*j[re+g]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe<0&&(Ee=-ye*j[O+g]*j[re+g]/Math.sqrt(pe),j[O+u]+=J*Ee,j[O+f]+=le*Ee):pe>0&&(Ee=ye*j[O+g]*j[re+g]/pe,j[O+u]+=J*Ee,j[O+f]+=le*Ee)),H=te[H+M],H<0)break;continue}else for(ye=z.scalingRatio,$=0;$0?(Ee=ye*j[$+g]*j[W+g]/pe/pe,j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee):pe<0&&(Ee=100*ye*j[$+g]*j[W+g],j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee)):(pe=Math.sqrt(J*J+le*le),pe>0&&(Ee=ye*j[$+g]*j[W+g]/pe/pe,j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee));for(oe=z.gravity/z.scalingRatio,ye=z.scalingRatio,O=0;O0&&(Ee=ye*j[O+g]*oe):pe>0&&(Ee=ye*j[O+g]*oe/pe),j[O+u]-=J*Ee,j[O+f]-=le*Ee;for(ye=1*(z.outboundAttractionDistribution?Te:1),de=0;de0&&(Ee=-ye*_e*Math.log(1+pe)/pe/j[$+g]):pe>0&&(Ee=-ye*_e*Math.log(1+pe)/pe):z.outboundAttractionDistribution?pe>0&&(Ee=-ye*_e/j[$+g]):pe>0&&(Ee=-ye*_e)):(pe=Math.sqrt(Math.pow(J,2)+Math.pow(le,2)),z.linLogMode?z.outboundAttractionDistribution?pe>0&&(Ee=-ye*_e*Math.log(1+pe)/pe/j[$+g]):pe>0&&(Ee=-ye*_e*Math.log(1+pe)/pe):z.outboundAttractionDistribution?(pe=1,Ee=-ye*_e/j[$+g]):(pe=1,Ee=-ye*_e)),pe>0&&(j[$+u]+=J*Ee,j[$+f]+=le*Ee,j[W+u]-=J*Ee,j[W+f]-=le*Ee);var qt,fn,Gt,at,Tn,xt;if(be===!0)for(O=0;One&&(j[O+u]=j[O+u]*ne/qt,j[O+f]=j[O+f]*ne/qt),fn=j[O+g]*Math.sqrt((j[O+h]-j[O+u])*(j[O+h]-j[O+u])+(j[O+m]-j[O+f])*(j[O+m]-j[O+f])),Gt=Math.sqrt((j[O+h]+j[O+u])*(j[O+h]+j[O+u])+(j[O+m]+j[O+f])*(j[O+m]+j[O+f]))/2,at=.1*Math.log(1+Gt)/(1+Math.sqrt(fn)),Tn=j[O+s]+j[O+u]*(at/z.slowDown),j[O+s]=Tn,xt=j[O+c]+j[O+f]*(at/z.slowDown),j[O+c]=xt);else for(O=0;O1&&Se.has(Ee))&&(j>1&&Se.add(Ee),ye=f[Le+e],le=f[Le+t],pe=f[Le+n],te=ye-Te,Fe=le-J,Pe=Math.sqrt(te*te+Fe*Fe),me=Pe<_e*m+h+(pe*m+h),me&&(k=!1,Le=Le/a|0,Pe>0?(R[Le]+=te/Pe*(1+_e),U[Le]+=Fe/Pe*(1+_e)):(R[Le]+=B*s(),U[Le]+=X*s())));for(S=0,E=0;S1&&ye.has(me))&&(O>1&&ye.add(me),pe=y[le+o],te=y[le+s],Pe=y[le+c],Ae=pe-_e,je=te-Ee,He=Math.sqrt(Ae*Ae+je*je),it=He0?(q[le]+=Ae/He*(1+Fe),Y[le]+=je/He*(1+Fe)):(q[le]+=z*h(),Y[le]+=j*h())));for(C=0,A=0;C=0;)g=Nm(e,t,n,a,h+1,s+1,c),g>m&&(h===o?g*=n1:cF.test(e.charAt(h-1))?(g*=iF,b=e.slice(o,h-1).match(uF),b&&o>0&&(g*=Math.pow(Pp,b.length))):dF.test(e.charAt(h-1))?(g*=aF,S=e.slice(o,h-1).match(lT),S&&o>0&&(g*=Math.pow(Pp,S.length))):(g*=oF,o>0&&(g*=Math.pow(Pp,h-o))),e.charAt(h)!==t.charAt(s)&&(g*=sF)),(gg&&(g=y*Mp)),g>m&&(m=g),h=n.indexOf(f,h+1);return c[u]=m,m}function r1(e){return e.toLowerCase().replace(lT," ")}function fF(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Nm(e,t,r1(e),r1(t),0,0,{})}var Gp={exports:{}},Fp={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var a1;function hF(){if(a1)return Fp;a1=1;var e=Yu();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,o=e.useEffect,s=e.useLayoutEffect,c=e.useDebugValue;function u(g,y){var b=y(),S=a({inst:{value:b,getSnapshot:y}}),E=S[0].inst,_=S[1];return s(function(){E.value=b,E.getSnapshot=y,f(E)&&_({inst:E})},[g,b,y]),o(function(){return f(E)&&_({inst:E}),g(function(){f(E)&&_({inst:E})})},[g]),c(b),b}function f(g){var y=g.getSnapshot;g=g.value;try{var b=y();return!n(g,b)}catch{return!0}}function h(g,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return Fp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Fp}var i1;function pF(){return i1||(i1=1,Gp.exports=hF()),Gp.exports}var mF=pF(),nl='[cmdk-group=""]',Up='[cmdk-group-items=""]',gF='[cmdk-group-heading=""]',Kg='[cmdk-item=""]',o1=`${Kg}:not([aria-disabled="true"])`,Om="cmdk-item-select",xi="data-value",vF=(e,t,n)=>fF(e,t,n),cT=w.createContext(void 0),kl=()=>w.useContext(cT),uT=w.createContext(void 0),Zg=()=>w.useContext(uT),dT=w.createContext(void 0),fT=w.forwardRef((e,t)=>{let n=Co(()=>{var O,$;return{search:"",value:($=(O=e.value)!=null?O:e.defaultValue)!=null?$:"",filtered:{count:0,items:new Map,groups:new Set}}}),a=Co(()=>new Set),o=Co(()=>new Map),s=Co(()=>new Map),c=Co(()=>new Set),u=hT(e),{label:f,children:h,value:m,onValueChange:g,filter:y,shouldFilter:b,loop:S,disablePointerSelection:E=!1,vimBindings:_=!0,...N}=e,C=on(),A=on(),k=on(),D=w.useRef(null),M=AF();Di(()=>{if(m!==void 0){let O=m.trim();n.current.value=O,R.emit()}},[m]),Di(()=>{M(6,B)},[]);let R=w.useMemo(()=>({subscribe:O=>(c.current.add(O),()=>c.current.delete(O)),snapshot:()=>n.current,setState:(O,$,W)=>{var re,de,ie;if(!Object.is(n.current[O],$)){if(n.current[O]=$,O==="search")Y(),I(),M(1,q);else if(O==="value"&&(W||M(5,B),((re=u.current)==null?void 0:re.value)!==void 0)){let oe=$??"";(ie=(de=u.current).onValueChange)==null||ie.call(de,oe);return}R.emit()}},emit:()=>{c.current.forEach(O=>O())}}),[]),U=w.useMemo(()=>({value:(O,$,W)=>{var re;$!==((re=s.current.get(O))==null?void 0:re.value)&&(s.current.set(O,{value:$,keywords:W}),n.current.filtered.items.set(O,L($,W)),M(2,()=>{I(),R.emit()}))},item:(O,$)=>(a.current.add(O),$&&(o.current.has($)?o.current.get($).add(O):o.current.set($,new Set([O]))),M(3,()=>{Y(),I(),n.current.value||q(),R.emit()}),()=>{s.current.delete(O),a.current.delete(O),n.current.filtered.items.delete(O);let W=X();M(4,()=>{Y(),(W==null?void 0:W.getAttribute("id"))===O&&q(),R.emit()})}),group:O=>(o.current.has(O)||o.current.set(O,new Set),()=>{s.current.delete(O),o.current.delete(O)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:C,inputId:k,labelId:A,listInnerRef:D}),[]);function L(O,$){var W,re;let de=(re=(W=u.current)==null?void 0:W.filter)!=null?re:vF;return O?de(O,n.current.search,$):0}function I(){if(!n.current.search||u.current.shouldFilter===!1)return;let O=n.current.filtered.items,$=[];n.current.filtered.groups.forEach(re=>{let de=o.current.get(re),ie=0;de.forEach(oe=>{let Ce=O.get(oe);ie=Math.max(Ce,ie)}),$.push([re,ie])});let W=D.current;ne().sort((re,de)=>{var ie,oe;let Ce=re.getAttribute("id"),he=de.getAttribute("id");return((ie=O.get(he))!=null?ie:0)-((oe=O.get(Ce))!=null?oe:0)}).forEach(re=>{let de=re.closest(Up);de?de.appendChild(re.parentElement===de?re:re.closest(`${Up} > *`)):W.appendChild(re.parentElement===W?re:re.closest(`${Up} > *`))}),$.sort((re,de)=>de[1]-re[1]).forEach(re=>{var de;let ie=(de=D.current)==null?void 0:de.querySelector(`${nl}[${xi}="${encodeURIComponent(re[0])}"]`);ie==null||ie.parentElement.appendChild(ie)})}function q(){let O=ne().find(W=>W.getAttribute("aria-disabled")!=="true"),$=O==null?void 0:O.getAttribute(xi);R.setState("value",$||void 0)}function Y(){var O,$,W,re;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let de=0;for(let ie of a.current){let oe=($=(O=s.current.get(ie))==null?void 0:O.value)!=null?$:"",Ce=(re=(W=s.current.get(ie))==null?void 0:W.keywords)!=null?re:[],he=L(oe,Ce);n.current.filtered.items.set(ie,he),he>0&&de++}for(let[ie,oe]of o.current)for(let Ce of oe)if(n.current.filtered.items.get(Ce)>0){n.current.filtered.groups.add(ie);break}n.current.filtered.count=de}function B(){var O,$,W;let re=X();re&&(((O=re.parentElement)==null?void 0:O.firstChild)===re&&((W=($=re.closest(nl))==null?void 0:$.querySelector(gF))==null||W.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function X(){var O;return(O=D.current)==null?void 0:O.querySelector(`${Kg}[aria-selected="true"]`)}function ne(){var O;return Array.from(((O=D.current)==null?void 0:O.querySelectorAll(o1))||[])}function F(O){let $=ne()[O];$&&R.setState("value",$.getAttribute(xi))}function z(O){var $;let W=X(),re=ne(),de=re.findIndex(oe=>oe===W),ie=re[de+O];($=u.current)!=null&&$.loop&&(ie=de+O<0?re[re.length-1]:de+O===re.length?re[0]:re[de+O]),ie&&R.setState("value",ie.getAttribute(xi))}function j(O){let $=X(),W=$==null?void 0:$.closest(nl),re;for(;W&&!re;)W=O>0?TF(W,nl):RF(W,nl),re=W==null?void 0:W.querySelector(o1);re?R.setState("value",re.getAttribute(xi)):z(O)}let K=()=>F(ne().length-1),G=O=>{O.preventDefault(),O.metaKey?K():O.altKey?j(1):z(1)},H=O=>{O.preventDefault(),O.metaKey?F(0):O.altKey?j(-1):z(-1)};return w.createElement(Ie.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:O=>{var $;if(($=N.onKeyDown)==null||$.call(N,O),!O.defaultPrevented)switch(O.key){case"n":case"j":{_&&O.ctrlKey&&G(O);break}case"ArrowDown":{G(O);break}case"p":case"k":{_&&O.ctrlKey&&H(O);break}case"ArrowUp":{H(O);break}case"Home":{O.preventDefault(),F(0);break}case"End":{O.preventDefault(),K();break}case"Enter":if(!O.nativeEvent.isComposing&&O.keyCode!==229){O.preventDefault();let W=X();if(W){let re=new Event(Om);W.dispatchEvent(re)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:kF},f),xd(e,O=>w.createElement(uT.Provider,{value:R},w.createElement(cT.Provider,{value:U},O))))}),yF=w.forwardRef((e,t)=>{var n,a;let o=on(),s=w.useRef(null),c=w.useContext(dT),u=kl(),f=hT(e),h=(a=(n=f.current)==null?void 0:n.forceMount)!=null?a:c==null?void 0:c.forceMount;Di(()=>{if(!h)return u.item(o,c==null?void 0:c.id)},[h]);let m=pT(o,s,[e.value,e.children,s],e.keywords),g=Zg(),y=ki(M=>M.value&&M.value===m.current),b=ki(M=>h||u.filter()===!1?!0:M.search?M.filtered.items.get(o)>0:!0);w.useEffect(()=>{let M=s.current;if(!(!M||e.disabled))return M.addEventListener(Om,S),()=>M.removeEventListener(Om,S)},[b,e.onSelect,e.disabled]);function S(){var M,R;E(),(R=(M=f.current).onSelect)==null||R.call(M,m.current)}function E(){g.setState("value",m.current,!0)}if(!b)return null;let{disabled:_,value:N,onSelect:C,forceMount:A,keywords:k,...D}=e;return w.createElement(Ie.div,{ref:fl([s,t]),...D,id:o,"cmdk-item":"",role:"option","aria-disabled":!!_,"aria-selected":!!y,"data-disabled":!!_,"data-selected":!!y,onPointerMove:_||u.getDisablePointerSelection()?void 0:E,onClick:_?void 0:S},e.children)}),bF=w.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:o,...s}=e,c=on(),u=w.useRef(null),f=w.useRef(null),h=on(),m=kl(),g=ki(b=>o||m.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);Di(()=>m.group(c),[]),pT(c,u,[e.value,e.heading,f]);let y=w.useMemo(()=>({id:c,forceMount:o}),[o]);return w.createElement(Ie.div,{ref:fl([u,t]),...s,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&w.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),xd(e,b=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},w.createElement(dT.Provider,{value:y},b))))}),xF=w.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,o=w.useRef(null),s=ki(c=>!c.search);return!n&&!s?null:w.createElement(Ie.div,{ref:fl([o,t]),...a,"cmdk-separator":"",role:"separator"})}),wF=w.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,o=e.value!=null,s=Zg(),c=ki(m=>m.search),u=ki(m=>m.value),f=kl(),h=w.useMemo(()=>{var m;let g=(m=f.listInnerRef.current)==null?void 0:m.querySelector(`${Kg}[${xi}="${encodeURIComponent(u)}"]`);return g==null?void 0:g.getAttribute("id")},[]);return w.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),w.createElement(Ie.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":h,id:f.inputId,type:"text",value:o?e.value:c,onChange:m=>{o||s.setState("search",m.target.value),n==null||n(m.target.value)}})}),EF=w.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...o}=e,s=w.useRef(null),c=w.useRef(null),u=kl();return w.useEffect(()=>{if(c.current&&s.current){let f=c.current,h=s.current,m,g=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let y=f.offsetHeight;h.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(m),g.unobserve(f)}}},[]),w.createElement(Ie.div,{ref:fl([s,t]),...o,"cmdk-list":"",role:"listbox","aria-label":a,id:u.listId},xd(e,f=>w.createElement("div",{ref:fl([c,u.listInnerRef]),"cmdk-list-sizer":""},f)))}),SF=w.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:o,contentClassName:s,container:c,...u}=e;return w.createElement(pg,{open:n,onOpenChange:a},w.createElement(mg,{container:c},w.createElement(ad,{"cmdk-overlay":"",className:o}),w.createElement(id,{"aria-label":e.label,"cmdk-dialog":"",className:s},w.createElement(fT,{ref:t,...u}))))}),_F=w.forwardRef((e,t)=>ki(n=>n.filtered.count===0)?w.createElement(Ie.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),CF=w.forwardRef((e,t)=>{let{progress:n,children:a,label:o="Loading...",...s}=e;return w.createElement(Ie.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},xd(e,c=>w.createElement("div",{"aria-hidden":!0},c)))}),Cn=Object.assign(fT,{List:EF,Item:yF,Input:wF,Group:bF,Separator:xF,Dialog:SF,Empty:_F,Loading:CF});function TF(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function RF(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function hT(e){let t=w.useRef(e);return Di(()=>{t.current=e}),t}var Di=typeof window>"u"?w.useEffect:w.useLayoutEffect;function Co(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function fl(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function ki(e){let t=Zg(),n=()=>e(t.snapshot());return mF.useSyncExternalStore(t.subscribe,n,n)}function pT(e,t,n,a=[]){let o=w.useRef(),s=kl();return Di(()=>{var c;let u=(()=>{var h;for(let m of n){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(h=m.current.textContent)==null?void 0:h.trim():o.current}})(),f=a.map(h=>h.trim());s.value(e,u,f),(c=t.current)==null||c.setAttribute(xi,u),o.current=u}),o}var AF=()=>{let[e,t]=w.useState(),n=Co(()=>new Map);return Di(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,o)=>{n.current.set(a,o),t({})}};function DF(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function xd({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(DF(t),{ref:t.ref},n(t.props.children)):n(t)}var kF={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const mT=pg,gT=bS,NF=mg,vT=w.forwardRef(({className:e,...t},n)=>x.jsx(ad,{ref:n,className:Oe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t}));vT.displayName=ad.displayName;const Qg=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(NF,{children:[x.jsx(vT,{}),x.jsxs(id,{ref:a,className:Oe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...n,children:[t,x.jsxs(yg,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[x.jsx(IE,{className:"h-4 w-4"}),x.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Qg.displayName=id.displayName;const Jg=({className:e,...t})=>x.jsx("div",{className:Oe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Jg.displayName="DialogHeader";const ev=w.forwardRef(({className:e,...t},n)=>x.jsx(gg,{ref:n,className:Oe("text-lg leading-none font-semibold tracking-tight",e),...t}));ev.displayName=gg.displayName;const tv=w.forwardRef(({className:e,...t},n)=>x.jsx(vg,{ref:n,className:Oe("text-muted-foreground text-sm",e),...t}));tv.displayName=vg.displayName;const wd=w.forwardRef(({className:e,...t},n)=>x.jsx(Cn,{ref:n,className:Oe("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));wd.displayName=Cn.displayName;const nv=w.forwardRef(({className:e,...t},n)=>x.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[x.jsx(sj,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),x.jsx(Cn.Input,{ref:n,className:Oe("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));nv.displayName=Cn.Input.displayName;const Ed=w.forwardRef(({className:e,...t},n)=>x.jsx(Cn.List,{ref:n,className:Oe("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));Ed.displayName=Cn.List.displayName;const rv=w.forwardRef((e,t)=>x.jsx(Cn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));rv.displayName=Cn.Empty.displayName;const Ko=w.forwardRef(({className:e,...t},n)=>x.jsx(Cn.Group,{ref:n,className:Oe("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t}));Ko.displayName=Cn.Group.displayName;const OF=w.forwardRef(({className:e,...t},n)=>x.jsx(Cn.Separator,{ref:n,className:Oe("bg-border -mx-1 h-px",e),...t}));OF.displayName=Cn.Separator.displayName;const Zo=w.forwardRef(({className:e,...t},n)=>x.jsx(Cn.Item,{ref:n,className:Oe("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Zo.displayName=Cn.Item.displayName;const jF=({layout:e,autoRunFor:t})=>{const n=Zn(),{stop:a,start:o,isRunning:s}=e;return w.useEffect(()=>{if(!n)return;let c=null;return t!==void 0&&t>-1&&n.getGraph().order>0&&(o(),c=t>0?window.setTimeout(()=>{a()},t):null),()=>{a(),c&&clearTimeout(c)}},[t,o,a,n]),x.jsx(wt,{size:"icon",onClick:()=>s?a():o(),tooltip:s?"Stop the layout animation":"Start the layout animation",variant:_r,children:s?x.jsx(tj,{}):x.jsx(rj,{})})},LF=()=>{const e=Zn(),[t,n]=w.useState("Circular"),[a,o]=w.useState(!1),s=T5(),c=E5(),u=rF(),f=Q5({settings:{margin:1}}),h=j5({maxIterations:20}),m=iT({iterations:20}),g=J5(),y=L5(),b=H5(),S=w.useMemo(()=>({Circular:{layout:s},Circlepack:{layout:c},Random:{layout:u},Noverlaps:{layout:f,worker:g},"Force Directed":{layout:h,worker:y},"Force Atlas":{layout:m,worker:b}}),[c,s,h,m,f,u,y,g,b]),E=w.useCallback(_=>{console.debug(_);const{positions:N}=S[_].layout;BG(e.getGraph(),N(),{duration:500}),n(_)},[S,e]);return x.jsxs(x.Fragment,{children:[x.jsx("div",{children:S[t]&&"worker"in S[t]&&x.jsx(jF,{layout:S[t].worker})}),x.jsx("div",{children:x.jsxs(pd,{open:a,onOpenChange:o,children:[x.jsx(md,{asChild:!0,children:x.jsx(wt,{size:"icon",variant:_r,onClick:()=>o(_=>!_),tooltip:"Layout Graph",children:x.jsx($O,{})})}),x.jsx(_l,{side:"right",align:"center",className:"p-1",children:x.jsx(wd,{children:x.jsx(Ed,{children:x.jsx(Ko,{children:Object.keys(S).map(_=>x.jsx(Zo,{onSelect:()=>{E(_)},className:"cursor-pointer text-xs",children:_},_))})})})})]})})]})};var vu={exports:{}},zF=vu.exports,s1;function MF(){return s1||(s1=1,function(e){(function(t,n,a){function o(f){var h=this,m=u();h.next=function(){var g=2091639*h.s0+h.c*23283064365386963e-26;return h.s0=h.s1,h.s1=h.s2,h.s2=g-(h.c=g|0)},h.c=1,h.s0=m(" "),h.s1=m(" "),h.s2=m(" "),h.s0-=m(f),h.s0<0&&(h.s0+=1),h.s1-=m(f),h.s1<0&&(h.s1+=1),h.s2-=m(f),h.s2<0&&(h.s2+=1),m=null}function s(f,h){return h.c=f.c,h.s0=f.s0,h.s1=f.s1,h.s2=f.s2,h}function c(f,h){var m=new o(f),g=h&&h.state,y=m.next;return y.int32=function(){return m.next()*4294967296|0},y.double=function(){return y()+(y()*2097152|0)*11102230246251565e-32},y.quick=y,g&&(typeof g=="object"&&s(g,m),y.state=function(){return s(m,{})}),y}function u(){var f=4022871197,h=function(m){m=String(m);for(var g=0;g>>0,y-=f,y*=f,f=y>>>0,y-=f,f+=y*4294967296}return(f>>>0)*23283064365386963e-26};return h}n&&n.exports?n.exports=c:this.alea=c})(zF,e)}(vu)),vu.exports}var yu={exports:{}},PF=yu.exports,l1;function GF(){return l1||(l1=1,function(e){(function(t,n,a){function o(u){var f=this,h="";f.x=0,f.y=0,f.z=0,f.w=0,f.next=function(){var g=f.x^f.x<<11;return f.x=f.y,f.y=f.z,f.z=f.w,f.w^=f.w>>>19^g^g>>>8},u===(u|0)?f.x=u:h+=u;for(var m=0;m>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(typeof m=="object"&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xor128=c})(PF,e)}(yu)),yu.exports}var bu={exports:{}},FF=bu.exports,c1;function UF(){return c1||(c1=1,function(e){(function(t,n,a){function o(u){var f=this,h="";f.next=function(){var g=f.x^f.x>>>2;return f.x=f.y,f.y=f.z,f.z=f.w,f.w=f.v,(f.d=f.d+362437|0)+(f.v=f.v^f.v<<4^(g^g<<1))|0},f.x=0,f.y=0,f.z=0,f.w=0,f.v=0,u===(u|0)?f.x=u:h+=u;for(var m=0;m>>4),f.next()}function s(u,f){return f.x=u.x,f.y=u.y,f.z=u.z,f.w=u.w,f.v=u.v,f.d=u.d,f}function c(u,f){var h=new o(u),m=f&&f.state,g=function(){return(h.next()>>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(typeof m=="object"&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xorwow=c})(FF,e)}(bu)),bu.exports}var xu={exports:{}},BF=xu.exports,u1;function IF(){return u1||(u1=1,function(e){(function(t,n,a){function o(u){var f=this;f.next=function(){var m=f.x,g=f.i,y,b;return y=m[g],y^=y>>>7,b=y^y<<24,y=m[g+1&7],b^=y^y>>>10,y=m[g+3&7],b^=y^y>>>3,y=m[g+4&7],b^=y^y<<7,y=m[g+7&7],y=y^y<<13,b^=y^y<<9,m[g]=b,f.i=g+1&7,b};function h(m,g){var y,b=[];if(g===(g|0))b[0]=g;else for(g=""+g,y=0;y0;--y)m.next()}h(f,u)}function s(u,f){return f.x=u.x.slice(),f.i=u.i,f}function c(u,f){u==null&&(u=+new Date);var h=new o(u),m=f&&f.state,g=function(){return(h.next()>>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(m.x&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xorshift7=c})(BF,e)}(xu)),xu.exports}var wu={exports:{}},HF=wu.exports,d1;function $F(){return d1||(d1=1,function(e){(function(t,n,a){function o(u){var f=this;f.next=function(){var m=f.w,g=f.X,y=f.i,b,S;return f.w=m=m+1640531527|0,S=g[y+34&127],b=g[y=y+1&127],S^=S<<13,b^=b<<17,S^=S>>>15,b^=b>>>12,S=g[y]=S^b,f.i=y,S+(m^m>>>16)|0};function h(m,g){var y,b,S,E,_,N=[],C=128;for(g===(g|0)?(b=g,g=null):(g=g+"\0",b=0,C=Math.max(C,g.length)),S=0,E=-32;E>>15,b^=b<<4,b^=b>>>13,E>=0&&(_=_+1640531527|0,y=N[E&127]^=b+_,S=y==0?S+1:0);for(S>=128&&(N[(g&&g.length||0)&127]=-1),S=127,E=4*128;E>0;--E)b=N[S+34&127],y=N[S=S+1&127],b^=b<<13,y^=y<<17,b^=b>>>15,y^=y>>>12,N[S]=b^y;m.w=_,m.X=N,m.i=S}h(f,u)}function s(u,f){return f.i=u.i,f.w=u.w,f.X=u.X.slice(),f}function c(u,f){u==null&&(u=+new Date);var h=new o(u),m=f&&f.state,g=function(){return(h.next()>>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(m.X&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.xor4096=c})(HF,e)}(wu)),wu.exports}var Eu={exports:{}},VF=Eu.exports,f1;function qF(){return f1||(f1=1,function(e){(function(t,n,a){function o(u){var f=this,h="";f.next=function(){var g=f.b,y=f.c,b=f.d,S=f.a;return g=g<<25^g>>>7^y,y=y-b|0,b=b<<24^b>>>8^S,S=S-g|0,f.b=g=g<<20^g>>>12^y,f.c=y=y-b|0,f.d=b<<16^y>>>16^S,f.a=S-g|0},f.a=0,f.b=0,f.c=-1640531527,f.d=1367130551,u===Math.floor(u)?(f.a=u/4294967296|0,f.b=u|0):h+=u;for(var m=0;m>>0)/4294967296};return g.double=function(){do var y=h.next()>>>11,b=(h.next()>>>0)/4294967296,S=(y+b)/(1<<21);while(S===0);return S},g.int32=h.next,g.quick=g,m&&(typeof m=="object"&&s(m,h),g.state=function(){return s(h,{})}),g}n&&n.exports?n.exports=c:this.tychei=c})(VF,e)}(Eu)),Eu.exports}var Su={exports:{}};const YF={},WF=Object.freeze(Object.defineProperty({__proto__:null,default:YF},Symbol.toStringTag,{value:"Module"})),XF=bD(WF);var KF=Su.exports,h1;function ZF(){return h1||(h1=1,function(e){(function(t,n,a){var o=256,s=6,c=52,u="random",f=a.pow(o,s),h=a.pow(2,c),m=h*2,g=o-1,y;function b(k,D,M){var R=[];D=D==!0?{entropy:!0}:D||{};var U=N(_(D.entropy?[k,A(n)]:k??C(),3),R),L=new S(R),I=function(){for(var q=L.g(s),Y=f,B=0;q=m;)q/=2,Y/=2,B>>>=1;return(q+B)/Y};return I.int32=function(){return L.g(4)|0},I.quick=function(){return L.g(4)/4294967296},I.double=I,N(A(L.S),n),(D.pass||M||function(q,Y,B,X){return X&&(X.S&&E(X,L),q.state=function(){return E(L,{})}),B?(a[u]=q,Y):q})(I,U,"global"in D?D.global:this==a,D.state)}function S(k){var D,M=k.length,R=this,U=0,L=R.i=R.j=0,I=R.S=[];for(M||(k=[M++]);U{if(!e||!Array.isArray(e.nodes)||!Array.isArray(e.edges))return!1;for(const t of e.nodes)if(!t.id||!t.labels||!t.properties)return!1;for(const t of e.edges)if(!t.id||!t.source||!t.target)return!1;for(const t of e.edges){const n=e.getNode(t.source),a=e.getNode(t.target);if(n==null||a==null)return!1}return!0},nU=async e=>{let t=null;try{t=await pO(e)}catch(a){return En.getState().setErrorMessage(Sr(a),"Query Graphs Error!"),null}let n=null;if(t){const a={},o={};for(let f=0;f0){const f=Nk-o0;for(const h of t.nodes)h.size=Math.round(o0+f*Math.pow((h.degree-s)/u,.5))}n=new p5,n.nodes=t.nodes,n.edges=t.edges,n.nodeIdMap=a,n.edgeIdMap=o,tU(n)||(n=null,console.error("Invalid graph data")),console.log("Graph data loaded")}return n},rU=e=>{const t=new dl;for(const n of(e==null?void 0:e.nodes)??[])t.addNode(n.id,{label:n.labels.join(", "),color:n.color,x:n.x,y:n.y,size:n.size,borderColor:Rk,borderSize:.2});for(const n of(e==null?void 0:e.edges)??[])n.dynamicId=t.addDirectedEdge(n.source,n.target,{label:n.type||void 0});return t},m1={label:""},yT=()=>{const e=Ye.use.queryLabel(),t=ct.use.rawGraph(),n=ct.use.sigmaGraph(),a=w.useCallback(c=>(t==null?void 0:t.getNode(c))||null,[t]),o=w.useCallback((c,u=!0)=>(t==null?void 0:t.getEdge(c,u))||null,[t]);return w.useEffect(()=>{if(e){if(m1.label!==e){m1.label=e;const c=ct.getState();c.reset(),nU(e).then(u=>{c.setSigmaGraph(rU(u)),u==null||u.buildDynamicMap(),c.setRawGraph(u)})}}else{const c=ct.getState();c.reset(),c.setSigmaGraph(new dl)}},[e]),{lightrageGraph:w.useCallback(()=>{if(n)return n;const c=new dl;return ct.getState().setSigmaGraph(c),c},[n]),getNode:a,getEdge:o}},ru=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),aU=({disableHoverEffect:e})=>{const{lightrageGraph:t}=yT(),n=Zn(),a=GC(),o=PC(),s=m3(),{assign:c}=iT({iterations:20}),{theme:u}=O_(),f=Ye.use.enableHideUnselectedEdges(),h=ct.use.selectedNode(),m=ct.use.focusedNode(),g=ct.use.selectedEdge(),y=ct.use.focusedEdge();return w.useEffect(()=>{const b=t();s(b),b.__force_applied||(c(),Object.assign(b,{__force_applied:!0}));const{setFocusedNode:S,setSelectedNode:E,setFocusedEdge:_,setSelectedEdge:N,clearSelection:C}=ct.getState();a({enterNode:A=>{ru(A.event.original)||S(A.node)},leaveNode:A=>{ru(A.event.original)||S(null)},clickNode:A=>{E(A.node),N(null)},clickEdge:A=>{N(A.edge),E(null)},enterEdge:A=>{ru(A.event.original)||_(A.edge)},leaveEdge:A=>{ru(A.event.original)||_(null)},clickStage:()=>C()})},[c,s,a,t]),w.useEffect(()=>{const b=u==="dark",S=b?_k:void 0,E=b?Dk:void 0;o({nodeReducer:(_,N)=>{const C=n.getGraph(),A={...N,highlighted:N.highlighted||!1,labelColor:S};if(!e){A.highlighted=!1;const k=m||h,D=y||g;if(k)(_===k||C.neighbors(k).includes(_))&&(A.highlighted=!0,_===h&&(A.borderColor=Ak));else if(D)C.extremities(D).includes(_)&&(A.highlighted=!0,A.size=3);else return A;A.highlighted?b&&(A.labelColor=Ck):A.color=Tk}return A},edgeReducer:(_,N)=>{const C=n.getGraph(),A={...N,hidden:!1,labelColor:S,color:E};if(!e){const k=m||h;k?f?C.extremities(_).includes(k)||(A.hidden=!0):C.extremities(_).includes(k)&&(A.color=i0):(y||g)&&(_===g?A.color=kk:_===y?A.color=i0:f&&(A.hidden=!0))}return A}})},[h,m,g,y,o,n,e,u,f]),null},iU=()=>{const{zoomIn:e,zoomOut:t,reset:n}=FC({duration:200,factor:1.5}),a=w.useCallback(()=>e(),[e]),o=w.useCallback(()=>t(),[t]),s=w.useCallback(()=>n(),[n]);return x.jsxs(x.Fragment,{children:[x.jsx(wt,{variant:_r,onClick:a,tooltip:"Zoom In",size:"icon",children:x.jsx(bj,{})}),x.jsx(wt,{variant:_r,onClick:o,tooltip:"Zoom Out",size:"icon",children:x.jsx(wj,{})}),x.jsx(wt,{variant:_r,onClick:s,tooltip:"Reset Zoom",size:"icon",children:x.jsx(UO,{})})]})},oU=()=>{const{isFullScreen:e,toggle:t}=g3();return x.jsx(x.Fragment,{children:e?x.jsx(wt,{variant:_r,onClick:t,tooltip:"Windowed",size:"icon",children:x.jsx(ZO,{})}):x.jsx(wt,{variant:_r,onClick:t,tooltip:"Full Screen",size:"icon",children:x.jsx(XO,{})})})};function bT(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var av="Checkbox",[sU,W6]=Kn(av),[lU,cU]=sU(av),xT=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:a,checked:o,defaultChecked:s,required:c,disabled:u,value:f="on",onCheckedChange:h,form:m,...g}=e,[y,b]=w.useState(null),S=nt(t,k=>b(k)),E=w.useRef(!1),_=y?m||!!y.closest("form"):!0,[N=!1,C]=aa({prop:o,defaultProp:s,onChange:h}),A=w.useRef(N);return w.useEffect(()=>{const k=y==null?void 0:y.form;if(k){const D=()=>C(A.current);return k.addEventListener("reset",D),()=>k.removeEventListener("reset",D)}},[y,C]),x.jsxs(lU,{scope:n,state:N,disabled:u,children:[x.jsx(Ie.button,{type:"button",role:"checkbox","aria-checked":Fa(N)?"mixed":N,"aria-required":c,"data-state":ST(N),"data-disabled":u?"":void 0,disabled:u,value:f,...g,ref:S,onKeyDown:Be(e.onKeyDown,k=>{k.key==="Enter"&&k.preventDefault()}),onClick:Be(e.onClick,k=>{C(D=>Fa(D)?!0:!D),_&&(E.current=k.isPropagationStopped(),E.current||k.stopPropagation())})}),_&&x.jsx(uU,{control:y,bubbles:!E.current,name:a,value:f,checked:N,required:c,disabled:u,form:m,style:{transform:"translateX(-100%)"},defaultChecked:Fa(s)?!1:s})]})});xT.displayName=av;var wT="CheckboxIndicator",ET=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:a,...o}=e,s=cU(wT,n);return x.jsx(zn,{present:a||Fa(s.state)||s.state===!0,children:x.jsx(Ie.span,{"data-state":ST(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});ET.displayName=wT;var uU=e=>{const{control:t,checked:n,bubbles:a=!0,defaultChecked:o,...s}=e,c=w.useRef(null),u=bT(n),f=XS(t);w.useEffect(()=>{const m=c.current,g=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(g,"checked").set;if(u!==n&&b){const S=new Event("click",{bubbles:a});m.indeterminate=Fa(n),b.call(m,Fa(n)?!1:n),m.dispatchEvent(S)}},[u,n,a]);const h=w.useRef(Fa(n)?!1:n);return x.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??h.current,...s,tabIndex:-1,ref:c,style:{...e.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Fa(e){return e==="indeterminate"}function ST(e){return Fa(e)?"indeterminate":e?"checked":"unchecked"}var _T=xT,dU=ET;const sl=w.forwardRef(({className:e,...t},n)=>x.jsx(_T,{ref:n,className:Oe("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground h-4 w-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:x.jsx(dU,{className:Oe("flex items-center justify-center text-current"),children:x.jsx(ig,{className:"h-4 w-4"})})}));sl.displayName=_T.displayName;var fU="Separator",g1="horizontal",hU=["horizontal","vertical"],CT=w.forwardRef((e,t)=>{const{decorative:n,orientation:a=g1,...o}=e,s=pU(a)?a:g1,u=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return x.jsx(Ie.div,{"data-orientation":s,...u,...o,ref:t})});CT.displayName=fU;function pU(e){return hU.includes(e)}var TT=CT;const al=w.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...a},o)=>x.jsx(TT,{ref:o,decorative:n,orientation:t,className:Oe("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...a}));al.displayName=TT.displayName;const za=({checked:e,onCheckedChange:t,label:n})=>x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(sl,{checked:e,onCheckedChange:t}),x.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]});function mU(){const[e,t]=w.useState(!1),[n,a]=w.useState(""),o=Ye.use.showPropertyPanel(),s=Ye.use.showNodeSearchBar(),c=Ye.use.showNodeLabel(),u=Ye.use.enableEdgeEvents(),f=Ye.use.enableNodeDrag(),h=Ye.use.enableHideUnselectedEdges(),m=Ye.use.showEdgeLabel(),g=Ye.use.enableHealthCheck(),y=Ye.use.apiKey();w.useEffect(()=>{a(y||"")},[y,e]);const b=w.useCallback(()=>Ye.setState(R=>({enableNodeDrag:!R.enableNodeDrag})),[]),S=w.useCallback(()=>Ye.setState(R=>({enableEdgeEvents:!R.enableEdgeEvents})),[]),E=w.useCallback(()=>Ye.setState(R=>({enableHideUnselectedEdges:!R.enableHideUnselectedEdges})),[]),_=w.useCallback(()=>Ye.setState(R=>({showEdgeLabel:!R.showEdgeLabel})),[]),N=w.useCallback(()=>Ye.setState(R=>({showPropertyPanel:!R.showPropertyPanel})),[]),C=w.useCallback(()=>Ye.setState(R=>({showNodeSearchBar:!R.showNodeSearchBar})),[]),A=w.useCallback(()=>Ye.setState(R=>({showNodeLabel:!R.showNodeLabel})),[]),k=w.useCallback(()=>Ye.setState(R=>({enableHealthCheck:!R.enableHealthCheck})),[]),D=w.useCallback(async()=>{Ye.setState({apiKey:n||null}),await En.getState().check(),t(!1)},[n]),M=w.useCallback(R=>{a(R.target.value)},[a]);return x.jsxs(pd,{open:e,onOpenChange:t,children:[x.jsx(md,{asChild:!0,children:x.jsx(wt,{variant:_r,tooltip:"Settings",size:"icon",children:x.jsx(dj,{})})}),x.jsx(_l,{side:"right",align:"start",className:"mb-2 p-2",onCloseAutoFocus:R=>R.preventDefault(),children:x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx(za,{checked:o,onCheckedChange:N,label:"Show Property Panel"}),x.jsx(za,{checked:s,onCheckedChange:C,label:"Show Search Bar"}),x.jsx(al,{}),x.jsx(za,{checked:c,onCheckedChange:A,label:"Show Node Label"}),x.jsx(za,{checked:f,onCheckedChange:b,label:"Node Draggable"}),x.jsx(al,{}),x.jsx(za,{checked:m,onCheckedChange:_,label:"Show Edge Label"}),x.jsx(za,{checked:h,onCheckedChange:E,label:"Hide Unselected Edges"}),x.jsx(za,{checked:u,onCheckedChange:S,label:"Edge Events"}),x.jsx(al,{}),x.jsx(za,{checked:g,onCheckedChange:k,label:"Health Check"}),x.jsx(al,{}),x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx("label",{className:"text-sm font-medium",children:"API Key"}),x.jsxs("form",{className:"flex h-6 gap-2",onSubmit:R=>R.preventDefault(),children:[x.jsx("div",{className:"w-0 flex-1",children:x.jsx(Ai,{type:"password",value:n,onChange:M,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"})}),x.jsx(wt,{onClick:D,variant:"outline",size:"sm",className:"max-h-full shrink-0",children:"Save"})]})]})]})})]})}function _u(e,t,n,a){function o(s){return s instanceof n?s:new n(function(c){c(s)})}return new(n||(n=Promise))(function(s,c){function u(m){try{h(a.next(m))}catch(g){c(g)}}function f(m){try{h(a.throw(m))}catch(g){c(g)}}function h(m){m.done?s(m.value):o(m.value).then(u,f)}h((a=a.apply(e,[])).next())})}const gU="ENTRIES",RT="KEYS",AT="VALUES",Kt="";class Ip{constructor(t,n){const a=t._tree,o=Array.from(a.keys());this.set=t,this._type=n,this._path=o.length>0?[{node:a,keys:o}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=So(this._path);if(So(n)===Kt)return{done:!1,value:this.result()};const a=t.get(So(n));return this._path.push({node:a,keys:Array.from(a.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=So(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>So(t)).filter(t=>t!==Kt).join("")}value(){return So(this._path).node.get(Kt)}result(){switch(this._type){case AT:return this.value();case RT:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const So=e=>e[e.length-1],vU=(e,t,n)=>{const a=new Map;if(t===void 0)return a;const o=t.length+1,s=o+n,c=new Uint8Array(s*o).fill(n+1);for(let u=0;u{const f=s*c;e:for(const h of e.keys())if(h===Kt){const m=o[f-1];m<=n&&a.set(u,[e.get(h),m])}else{let m=s;for(let g=0;gn)continue e}DT(e.get(h),t,n,a,o,m,c,u+h)}};class Ga{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,a]=Pu(this._tree,t.slice(this._prefix.length));if(n===void 0){const[o,s]=iv(a);for(const c of o.keys())if(c!==Kt&&c.startsWith(s)){const u=new Map;return u.set(c.slice(s.length),o.get(c)),new Ga(u,t)}}return new Ga(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,yU(this._tree,t)}entries(){return new Ip(this,gU)}forEach(t){for(const[n,a]of this)t(n,a,this)}fuzzyGet(t,n){return vU(this._tree,t,n)}get(t){const n=jm(this._tree,t);return n!==void 0?n.get(Kt):void 0}has(t){const n=jm(this._tree,t);return n!==void 0&&n.has(Kt)}keys(){return new Ip(this,RT)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,Hp(this._tree,t).set(Kt,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const a=Hp(this._tree,t);return a.set(Kt,n(a.get(Kt))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const a=Hp(this._tree,t);let o=a.get(Kt);return o===void 0&&a.set(Kt,o=n()),o}values(){return new Ip(this,AT)}[Symbol.iterator](){return this.entries()}static from(t){const n=new Ga;for(const[a,o]of t)n.set(a,o);return n}static fromObject(t){return Ga.from(Object.entries(t))}}const Pu=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const a of e.keys())if(a!==Kt&&t.startsWith(a))return n.push([e,a]),Pu(e.get(a),t.slice(a.length),n);return n.push([e,t]),Pu(void 0,"",n)},jm=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==Kt&&t.startsWith(n))return jm(e.get(n),t.slice(n.length))},Hp=(e,t)=>{const n=t.length;e:for(let a=0;e&&a{const[n,a]=Pu(e,t);if(n!==void 0){if(n.delete(Kt),n.size===0)kT(a);else if(n.size===1){const[o,s]=n.entries().next().value;NT(a,o,s)}}},kT=e=>{if(e.length===0)return;const[t,n]=iv(e);if(t.delete(n),t.size===0)kT(e.slice(0,-1));else if(t.size===1){const[a,o]=t.entries().next().value;a!==Kt&&NT(e.slice(0,-1),a,o)}},NT=(e,t,n)=>{if(e.length===0)return;const[a,o]=iv(e);a.set(o+t,n),a.delete(o)},iv=e=>e[e.length-1],ov="or",OT="and",bU="and_not";class Ua{constructor(t){if((t==null?void 0:t.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const n=t.autoVacuum==null||t.autoVacuum===!0?qp:t.autoVacuum;this._options=Object.assign(Object.assign(Object.assign({},Vp),t),{autoVacuum:n,searchOptions:Object.assign(Object.assign({},v1),t.searchOptions||{}),autoSuggestOptions:Object.assign(Object.assign({},_U),t.autoSuggestOptions||{})}),this._index=new Ga,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=zm,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:a,processTerm:o,fields:s,idField:c}=this._options,u=n(t,c);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${c}"`);if(this._idToShortId.has(u))throw new Error(`MiniSearch: duplicate ID ${u}`);const f=this.addDocumentId(u);this.saveStoredFields(f,t);for(const h of s){const m=n(t,h);if(m==null)continue;const g=a(m.toString(),h),y=this._fieldIds[h],b=new Set(g).size;this.addFieldLength(f,y,this._documentCount-1,b);for(const S of g){const E=o(S,h);if(Array.isArray(E))for(const _ of E)this.addTerm(y,f,_);else E&&this.addTerm(y,f,E)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:a=10}=n,o={chunk:[],promise:Promise.resolve()},{chunk:s,promise:c}=t.reduce(({chunk:u,promise:f},h,m)=>(u.push(h),(m+1)%a===0?{chunk:[],promise:f.then(()=>new Promise(g=>setTimeout(g,0))).then(()=>this.addAll(u))}:{chunk:u,promise:f}),o);return c.then(()=>this.addAll(s))}remove(t){const{tokenize:n,processTerm:a,extractField:o,fields:s,idField:c}=this._options,u=o(t,c);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${c}"`);const f=this._idToShortId.get(u);if(f==null)throw new Error(`MiniSearch: cannot remove document with ID ${u}: it is not in the index`);for(const h of s){const m=o(t,h);if(m==null)continue;const g=n(m.toString(),h),y=this._fieldIds[h],b=new Set(g).size;this.removeFieldLength(f,y,this._documentCount,b);for(const S of g){const E=a(S,h);if(Array.isArray(E))for(const _ of E)this.removeTerm(y,f,_);else E&&this.removeTerm(y,f,E)}}this._storedFields.delete(f),this._documentIds.delete(f),this._idToShortId.delete(u),this._fieldLength.delete(f),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Ga,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((a,o)=>{this.removeFieldLength(n,o,this._documentCount,a)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:a,batchWait:o}=this._options.autoVacuum;this.conditionalVacuum({batchSize:a,batchWait:o},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const a of t)this.discard(a)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:a}=this._options,o=a(t,n);this.discard(o),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const a=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=zm,this.performVacuuming(t,a)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}performVacuuming(t,n){return _u(this,void 0,void 0,function*(){const a=this._dirtCount;if(this.vacuumConditionsMet(n)){const o=t.batchSize||Lm.batchSize,s=t.batchWait||Lm.batchWait;let c=1;for(const[u,f]of this._index){for(const[h,m]of f)for(const[g]of m)this._documentIds.has(g)||(m.size<=1?f.delete(h):m.delete(g));this._index.get(u).size===0&&this._index.delete(u),c%o===0&&(yield new Promise(h=>setTimeout(h,s))),c+=1}this._dirtCount-=a}yield null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null})}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:a}=t;return n=n||qp.minDirtCount,a=a||qp.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=a}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:a}=this._options,o=Object.assign(Object.assign({},a),n),s=this.executeQuery(t,n),c=[];for(const[u,{score:f,terms:h,match:m}]of s){const g=h.length||1,y={id:this._documentIds.get(u),score:f*g,terms:Object.keys(m),queryTerms:h,match:m};Object.assign(y,this._storedFields.get(u)),(o.filter==null||o.filter(y))&&c.push(y)}return t===Ua.wildcard&&o.boostDocument==null||c.sort(b1),c}autoSuggest(t,n={}){n=Object.assign(Object.assign({},this._options.autoSuggestOptions),n);const a=new Map;for(const{score:s,terms:c}of this.search(t,n)){const u=c.join(" "),f=a.get(u);f!=null?(f.score+=s,f.count+=1):a.set(u,{score:s,terms:c,count:1})}const o=[];for(const[s,{score:c,terms:u,count:f}]of a)o.push({suggestion:s,terms:u,score:c/f});return o.sort(b1),o}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static loadJSONAsync(t,n){return _u(this,void 0,void 0,function*(){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(t),n)})}static getDefault(t){if(Vp.hasOwnProperty(t))return $p(Vp,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:a,documentIds:o,fieldLength:s,storedFields:c,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=au(o),f._fieldLength=au(s),f._storedFields=au(c);for(const[h,m]of f._documentIds)f._idToShortId.set(m,h);for(const[h,m]of a){const g=new Map;for(const y of Object.keys(m)){let b=m[y];u===1&&(b=b.ds),g.set(parseInt(y,10),au(b))}f._index.set(h,g)}return f}static loadJSAsync(t,n){return _u(this,void 0,void 0,function*(){const{index:a,documentIds:o,fieldLength:s,storedFields:c,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=yield iu(o),f._fieldLength=yield iu(s),f._storedFields=yield iu(c);for(const[m,g]of f._documentIds)f._idToShortId.set(g,m);let h=0;for(const[m,g]of a){const y=new Map;for(const b of Object.keys(g)){let S=g[b];u===1&&(S=S.ds),y.set(parseInt(b,10),yield iu(S))}++h%1e3===0&&(yield jT(0)),f._index.set(m,y)}return f})}static instantiateMiniSearch(t,n){const{documentCount:a,nextId:o,fieldIds:s,averageFieldLength:c,dirtCount:u,serializationVersion:f}=t;if(f!==1&&f!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const h=new Ua(n);return h._documentCount=a,h._nextId=o,h._idToShortId=new Map,h._fieldIds=s,h._avgFieldLength=c,h._dirtCount=u||0,h._index=new Ga,h}executeQuery(t,n={}){if(t===Ua.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const y=Object.assign(Object.assign(Object.assign({},n),t),{queries:void 0}),b=t.queries.map(S=>this.executeQuery(S,y));return this.combineResults(b,y.combineWith)}const{tokenize:a,processTerm:o,searchOptions:s}=this._options,c=Object.assign(Object.assign({tokenize:a,processTerm:o},s),n),{tokenize:u,processTerm:f}=c,g=u(t).flatMap(y=>f(y)).filter(y=>!!y).map(SU(c)).map(y=>this.executeQuerySpec(y,c));return this.combineResults(g,c.combineWith)}executeQuerySpec(t,n){const a=Object.assign(Object.assign({},this._options.searchOptions),n),o=(a.fields||this._options.fields).reduce((E,_)=>Object.assign(Object.assign({},E),{[_]:$p(a.boost,_)||1}),{}),{boostDocument:s,weights:c,maxFuzzy:u,bm25:f}=a,{fuzzy:h,prefix:m}=Object.assign(Object.assign({},v1.weights),c),g=this._index.get(t.term),y=this.termResults(t.term,t.term,1,t.termBoost,g,o,s,f);let b,S;if(t.prefix&&(b=this._index.atPrefix(t.term)),t.fuzzy){const E=t.fuzzy===!0?.2:t.fuzzy,_=E<1?Math.min(u,Math.round(t.term.length*E)):E;_&&(S=this._index.fuzzyGet(t.term,_))}if(b)for(const[E,_]of b){const N=E.length-t.term.length;if(!N)continue;S==null||S.delete(E);const C=m*E.length/(E.length+.3*N);this.termResults(t.term,E,C,t.termBoost,_,o,s,f,y)}if(S)for(const E of S.keys()){const[_,N]=S.get(E);if(!N)continue;const C=h*E.length/(E.length+N);this.termResults(t.term,E,C,t.termBoost,_,o,s,f,y)}return y}executeWildcardQuery(t){const n=new Map,a=Object.assign(Object.assign({},this._options.searchOptions),t);for(const[o,s]of this._documentIds){const c=a.boostDocument?a.boostDocument(s,"",this._storedFields.get(o)):1;n.set(o,{score:c,terms:[],match:{}})}return n}combineResults(t,n=ov){if(t.length===0)return new Map;const a=n.toLowerCase(),o=xU[a];if(!o)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(o)||new Map}toJSON(){const t=[];for(const[n,a]of this._index){const o={};for(const[s,c]of a)o[s]=Object.fromEntries(c);t.push([n,o])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,a,o,s,c,u,f,h=new Map){if(s==null)return h;for(const m of Object.keys(c)){const g=c[m],y=this._fieldIds[m],b=s.get(y);if(b==null)continue;let S=b.size;const E=this._avgFieldLength[y];for(const _ of b.keys()){if(!this._documentIds.has(_)){this.removeTerm(y,_,n),S-=1;continue}const N=u?u(this._documentIds.get(_),n,this._storedFields.get(_)):1;if(!N)continue;const C=b.get(_),A=this._fieldLength.get(_)[y],k=EU(C,S,this._documentCount,A,E,f),D=a*o*g*N*k,M=h.get(_);if(M){M.score+=D,CU(M.terms,t);const R=$p(M.match,n);R?R.push(m):M.match[n]=[m]}else h.set(_,{score:D,terms:[t],match:{[n]:[m]}})}}return h}addTerm(t,n,a){const o=this._index.fetch(a,x1);let s=o.get(t);if(s==null)s=new Map,s.set(n,1),o.set(t,s);else{const c=s.get(n);s.set(n,(c||0)+1)}}removeTerm(t,n,a){if(!this._index.has(a)){this.warnDocumentChanged(n,t,a);return}const o=this._index.fetch(a,x1),s=o.get(t);s==null||s.get(n)==null?this.warnDocumentChanged(n,t,a):s.get(n)<=1?s.size<=1?o.delete(t):s.delete(n):s.set(n,s.get(n)-1),this._index.get(a).size===0&&this._index.delete(a)}warnDocumentChanged(t,n,a){for(const o of Object.keys(this._fieldIds))if(this._fieldIds[o]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${a}" was not present in field "${o}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;nObject.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,xU={[ov]:(e,t)=>{for(const n of t.keys()){const a=e.get(n);if(a==null)e.set(n,t.get(n));else{const{score:o,terms:s,match:c}=t.get(n);a.score=a.score+o,a.match=Object.assign(a.match,c),y1(a.terms,s)}}return e},[OT]:(e,t)=>{const n=new Map;for(const a of t.keys()){const o=e.get(a);if(o==null)continue;const{score:s,terms:c,match:u}=t.get(a);y1(o.terms,c),n.set(a,{score:o.score+s,terms:o.terms,match:Object.assign(o.match,u)})}return n},[bU]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},wU={k:1.2,b:.7,d:.5},EU=(e,t,n,a,o,s)=>{const{k:c,b:u,d:f}=s;return Math.log(1+(n-t+.5)/(t+.5))*(f+e*(c+1)/(e+c*(1-u+u*a/o)))},SU=e=>(t,n,a)=>{const o=typeof e.fuzzy=="function"?e.fuzzy(t,n,a):e.fuzzy||!1,s=typeof e.prefix=="function"?e.prefix(t,n,a):e.prefix===!0,c=typeof e.boostTerm=="function"?e.boostTerm(t,n,a):1;return{term:t,fuzzy:o,prefix:s,termBoost:c}},Vp={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(TU),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])=="function"&&console[e](t)},autoVacuum:!0},v1={combineWith:ov,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:wU},_U={combineWith:OT,prefix:(e,t,n)=>t===n.length-1},Lm={batchSize:1e3,batchWait:10},zm={minDirtFactor:.1,minDirtCount:20},qp=Object.assign(Object.assign({},Lm),zm),CU=(e,t)=>{e.includes(t)||e.push(t)},y1=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},b1=({score:e},{score:t})=>t-e,x1=()=>new Map,au=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},iu=e=>_u(void 0,void 0,void 0,function*(){const t=new Map;let n=0;for(const a of Object.keys(e))t.set(parseInt(a,10),e[a]),++n%1e3===0&&(yield jT(0));return t}),jT=e=>new Promise(t=>setTimeout(t,e)),TU=/[\n\r\p{Z}\p{P}]+/u,RU={index:new Ua({fields:[]})};w.createContext(RU);const Mm=({label:e,color:t,hidden:n,labels:a={}})=>ve.createElement("div",{className:"node"},ve.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),ve.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||a.no_label||"No label")),AU=({id:e,labels:t})=>{const n=Zn(),a=w.useMemo(()=>{const o=n.getGraph().getNodeAttributes(e),s=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},o),s?s(e,o):{})},[n,e]);return ve.createElement(Mm,Object.assign({},a,{labels:t}))},DU=({label:e,color:t,source:n,target:a,hidden:o,directed:s,labels:c={}})=>ve.createElement("div",{className:"edge"},ve.createElement(Mm,Object.assign({},n,{labels:c})),ve.createElement("div",{className:"body"},ve.createElement("div",{className:"render"},ve.createElement("span",{className:o?"dotted":"dash",style:{borderColor:t||"#000"}})," ",s&&ve.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),ve.createElement("span",{className:`label ${o?"text-muted":""} ${e?"":"fst-italic"}`},e||c.no_label||"No label")),ve.createElement(Mm,Object.assign({},a,{labels:c}))),kU=({id:e,labels:t})=>{const n=Zn(),a=w.useMemo(()=>{const o=n.getGraph().getEdgeAttributes(e),s=n.getSetting("nodeReducer"),c=n.getSetting("edgeReducer"),u=n.getGraph().getNodeAttributes(n.getGraph().source(e)),f=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},o),c?c(e,o):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),s?s(e,u):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},f),s?s(e,f):{})})},[n,e]);return ve.createElement(DU,Object.assign({},a,{labels:t}))};function sv(e,t){const[n,a]=w.useState(e);return w.useEffect(()=>{const o=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(o)}},[e,t]),n}function NU({fetcher:e,preload:t,filterFn:n,renderOption:a,getOptionValue:o,notFound:s,loadingSkeleton:c,label:u,placeholder:f="Select...",value:h,onChange:m,onFocus:g,disabled:y=!1,className:b,noResultsMessage:S}){const[E,_]=w.useState(!1),[N,C]=w.useState(!1),[A,k]=w.useState([]),[D,M]=w.useState(!1),[R,U]=w.useState(null),[L,I]=w.useState(h),[q,Y]=w.useState(null),[B,X]=w.useState(""),ne=sv(B,t?0:150),[F,z]=w.useState([]);w.useEffect(()=>{_(!0),I(h)},[h]),w.useEffect(()=>{E||(async()=>{try{M(!0),U(null);const H=h!==null?await e(h):[];z(H),k(H)}catch(H){U(H instanceof Error?H.message:"Failed to fetch options")}finally{M(!1)}})()},[E,e,h]),w.useEffect(()=>{const G=async()=>{try{M(!0),U(null);const H=await e(ne);z(H),k(H)}catch(H){U(H instanceof Error?H.message:"Failed to fetch options")}finally{M(!1)}};E&&t?t&&k(ne?F.filter(H=>n?n(H,ne):!0):F):G()},[e,ne,E,t,n]);const j=w.useCallback(G=>{G!==L&&(I(G),m(G)),C(!1)},[L,I,C,m]),K=w.useCallback(G=>{G!==q&&(Y(G),g(G))},[q,Y,g]);return x.jsx("div",{className:Oe(y&&"cursor-not-allowed opacity-50",b),onFocus:()=>{C(!0)},onBlur:()=>C(!1),children:x.jsxs(wd,{shouldFilter:!1,className:"bg-transparent",children:[x.jsxs("div",{children:[x.jsx(nv,{placeholder:f,value:B,className:"max-h-8",onValueChange:G=>{X(G),G&&!N&&C(!0)}}),D&&A.length>0&&x.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:x.jsx(BE,{className:"h-4 w-4 animate-spin"})})]}),x.jsxs(Ed,{hidden:!N||ne.length===0,children:[R&&x.jsx("div",{className:"text-destructive p-4 text-center",children:R}),D&&A.length===0&&(c||x.jsx(OU,{})),!D&&!R&&A.length===0&&(s||x.jsx(rv,{children:S??`No ${u.toLowerCase()} found.`})),x.jsx(Ko,{children:A.map((G,H)=>x.jsxs(x.Fragment,{children:[x.jsx(Zo,{value:o(G),onSelect:j,onMouseEnter:()=>K(o(G)),className:"truncate",children:a(G)},o(G)+`${H}`),H!==A.length-1&&x.jsx("div",{className:"bg-foreground/10 h-[1px]"},H)]}))})]})]})})}function OU(){return x.jsx(Ko,{children:x.jsx(Zo,{disabled:!0,children:x.jsxs("div",{className:"flex w-full items-center gap-2",children:[x.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),x.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[x.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),x.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function jU(e){return x.jsxs("div",{children:[e.type==="nodes"&&x.jsx(AU,{id:e.id}),e.type==="edges"&&x.jsx(kU,{id:e.id}),e.type==="message"&&x.jsx("div",{children:e.message})]})}const Yp="__message_item",ou={graph:null,searchEngine:null},LU=({onChange:e,onFocus:t,value:n})=>{const a=ct.use.sigmaGraph(),o=w.useMemo(()=>{if(ou.graph==a)return ou.searchEngine;if(!a||a.nodes().length==0)return;ou.graph=a;const c=new Ua({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=a.nodes().map(f=>({id:f,label:a.getNodeAttribute(f,"label")}));return c.addAll(u),ou.searchEngine=c,c},[a]),s=w.useCallback(async c=>{if(t&&t(null),!c||!o)return[];const u=o.search(c).map(f=>({id:f.id,type:"nodes"}));return u.length<=Hh?u:[...u.slice(0,Hh),{type:"message",id:Yp,message:`And ${u.length-Hh} others`}]},[o,t]);return x.jsx(NU,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:s,renderOption:jU,getOptionValue:c=>c.id,value:n&&n.type!=="message"?n.id:null,onChange:c=>{c!==Yp&&e(c?{id:c,type:"nodes"}:null)},onFocus:c=>{c!==Yp&&t&&t(c?{id:c,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},zU=({...e})=>x.jsx(LU,{...e});function MU({fetcher:e,preload:t,filterFn:n,renderOption:a,getOptionValue:o,getDisplayValue:s,notFound:c,loadingSkeleton:u,label:f,placeholder:h="Select...",value:m,onChange:g,disabled:y=!1,className:b,triggerClassName:S,searchInputClassName:E,noResultsMessage:_,triggerTooltip:N,clearable:C=!0}){const[A,k]=w.useState(!1),[D,M]=w.useState(!1),[R,U]=w.useState([]),[L,I]=w.useState(!1),[q,Y]=w.useState(null),[B,X]=w.useState(m),[ne,F]=w.useState(null),[z,j]=w.useState(""),K=sv(z,t?0:150),[G,H]=w.useState([]);w.useEffect(()=>{k(!0),X(m)},[m]),w.useEffect(()=>{if(m&&R.length>0){const $=R.find(W=>o(W)===m);$&&F($)}},[m,R,o]),w.useEffect(()=>{A||(async()=>{try{I(!0),Y(null);const W=await e(m);H(W),U(W)}catch(W){Y(W instanceof Error?W.message:"Failed to fetch options")}finally{I(!1)}})()},[A,e,m]),w.useEffect(()=>{const $=async()=>{try{I(!0),Y(null);const W=await e(K);H(W),U(W)}catch(W){Y(W instanceof Error?W.message:"Failed to fetch options")}finally{I(!1)}};A&&t?t&&U(K?G.filter(W=>n?n(W,K):!0):G):$()},[e,K,A,t,n]);const O=w.useCallback($=>{const W=C&&$===B?"":$;X(W),F(R.find(re=>o(re)===W)||null),g(W),M(!1)},[B,g,C,R,o]);return x.jsxs(pd,{open:D,onOpenChange:M,children:[x.jsx(md,{asChild:!0,children:x.jsxs(wt,{variant:"outline",role:"combobox","aria-expanded":D,className:Oe("justify-between",y&&"cursor-not-allowed opacity-50",S),disabled:y,tooltip:N,side:"bottom",children:[ne?s(ne):h,x.jsx(NO,{className:"opacity-50",size:10})]})}),x.jsx(_l,{className:Oe("p-0",b),onCloseAutoFocus:$=>$.preventDefault(),children:x.jsxs(wd,{shouldFilter:!1,children:[x.jsxs("div",{className:"relative w-full border-b",children:[x.jsx(nv,{placeholder:`Search ${f.toLowerCase()}...`,value:z,onValueChange:$=>{j($)},className:E}),L&&R.length>0&&x.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:x.jsx(BE,{className:"h-4 w-4 animate-spin"})})]}),x.jsxs(Ed,{children:[q&&x.jsx("div",{className:"text-destructive p-4 text-center",children:q}),L&&R.length===0&&(u||x.jsx(PU,{})),!L&&!q&&R.length===0&&(c||x.jsx(rv,{children:_??`No ${f.toLowerCase()} found.`})),x.jsx(Ko,{children:R.map($=>x.jsxs(Zo,{value:o($),onSelect:O,className:"truncate",children:[a($),x.jsx(ig,{className:Oe("ml-auto h-3 w-3",B===o($)?"opacity-100":"opacity-0")})]},o($)))})]})]})})]})}function PU(){return x.jsx(Ko,{children:x.jsx(Zo,{disabled:!0,children:x.jsxs("div",{className:"flex w-full items-center gap-2",children:[x.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),x.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[x.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),x.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const GU=()=>{const e=Ye.use.queryLabel(),[t,n]=w.useState({labels:[],searchEngine:null}),[a,o]=w.useState(!1),s=w.useCallback(async u=>{let f=t.labels,h=t.searchEngine;if(!a||!h){f=["*"].concat(await mO()),f.includes(Ye.getState().queryLabel)||Ye.getState().setQueryLabel(f[0]),h=new Ua({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}});const m=f.map((g,y)=>({id:y,value:g}));h.addAll(m),n({labels:f,searchEngine:h}),o(!0)}return u?h.search(u).map(m=>f[m.id]):f},[t,a,n,o]),c=w.useCallback(u=>{Ye.getState().setQueryLabel(u)},[]);return x.jsx(MU,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:s,renderOption:u=>x.jsx("div",{children:u}),getOptionValue:u=>u,getDisplayValue:u=>x.jsx("div",{children:u}),notFound:x.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:e!==null?e:"",onChange:c})},bn=({text:e,className:t,tooltipClassName:n,tooltip:a,side:o,onClick:s})=>a?x.jsx(h_,{delayDuration:200,children:x.jsxs(p_,{children:[x.jsx(m_,{asChild:!0,children:x.jsx("label",{className:Oe(t,s!==void 0?"cursor-pointer":void 0),onClick:s,children:e})}),x.jsx(jg,{side:o,className:n,children:a})]})}):x.jsx("label",{className:Oe(t,s!==void 0?"cursor-pointer":void 0),onClick:s,children:e}),FU=()=>{const{getNode:e,getEdge:t}=yT(),n=ct.use.selectedNode(),a=ct.use.focusedNode(),o=ct.use.selectedEdge(),s=ct.use.focusedEdge(),[c,u]=w.useState(null),[f,h]=w.useState(null);return w.useEffect(()=>{let m=null,g=null;a?(m="node",g=e(a)):n?(m="node",g=e(n)):s?(m="edge",g=t(s,!0)):o&&(m="edge",g=t(o,!0)),g?(m=="node"?u(UU(g)):u(BU(g)),h(m)):(u(null),h(null))},[a,n,s,o,u,h,e,t]),c?x.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:f=="node"?x.jsx(IU,{node:c}):x.jsx(HU,{edge:c})}):x.jsx(x.Fragment,{})},UU=e=>{const t=ct.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)for(const a of t.sigmaGraph.edges(e.id)){const o=t.rawGraph.getEdge(a,!0);if(o){const s=e.id===o.source,c=s?o.target:o.source,u=t.rawGraph.getNode(c);u&&n.push({type:s?"Target":"Source",id:c,label:u.labels.join(", ")})}}return{...e,relationships:n}},BU=e=>{var o,s;const t=ct.getState(),n=(o=t.rawGraph)==null?void 0:o.getNode(e.source),a=(s=t.rawGraph)==null?void 0:s.getNode(e.target);return{...e,sourceNode:n,targetNode:a}},Er=({name:e,value:t,onClick:n,tooltip:a})=>x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("label",{className:"text-primary/60 tracking-wide",children:e}),":",x.jsx(bn,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:a||t,side:"left",onClick:n})]}),IU=({node:e})=>x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),x.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[x.jsx(Er,{name:"Id",value:e.id}),x.jsx(Er,{name:"Labels",value:e.labels.join(", "),onClick:()=>{ct.getState().setSelectedNode(e.id,!0)}}),x.jsx(Er,{name:"Degree",value:e.degree})]}),x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),x.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>x.jsx(Er,{name:t,value:e.properties[t]},t))}),e.relationships.length>0&&x.jsxs(x.Fragment,{children:[x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),x.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:t,id:n,label:a})=>x.jsx(Er,{name:t,value:a,onClick:()=>{ct.getState().setSelectedNode(n,!0)}},n))})]})]}),HU=({edge:e})=>x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),x.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[x.jsx(Er,{name:"Id",value:e.id}),e.type&&x.jsx(Er,{name:"Type",value:e.type}),x.jsx(Er,{name:"Source",value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{ct.getState().setSelectedNode(e.source,!0)}}),x.jsx(Er,{name:"Target",value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{ct.getState().setSelectedNode(e.target,!0)}})]}),x.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),x.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>x.jsx(Er,{name:t,value:e.properties[t]},t))})]}),w1={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:kC,curvedArrow:h5,curvedNoArrow:f5},nodeProgramClasses:{default:X3,circel:Tl,point:S3},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},$U=()=>{const e=GC(),t=Zn(),[n,a]=w.useState(null);return w.useEffect(()=>{e({downNode:o=>{a(o.node),t.getGraph().setNodeAttribute(o.node,"highlighted",!0)},mousemovebody:o=>{if(!n)return;const s=t.viewportToGraph(o);t.getGraph().setNodeAttribute(n,"x",s.x),t.getGraph().setNodeAttribute(n,"y",s.y),o.preventSigmaDefault(),o.original.preventDefault(),o.original.stopPropagation()},mouseup:()=>{n&&(a(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:()=>{t.getCustomBBox()||t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},VU=()=>{const[e,t]=w.useState(w1),n=ct.use.selectedNode(),a=ct.use.focusedNode(),o=ct.use.moveToSelectedNode(),s=Ye.use.showPropertyPanel(),c=Ye.use.showNodeSearchBar(),u=Ye.use.showNodeLabel(),f=Ye.use.enableEdgeEvents(),h=Ye.use.enableNodeDrag(),m=Ye.use.showEdgeLabel();w.useEffect(()=>{t({...w1,enableEdgeEvents:f,renderEdgeLabels:m,renderLabels:u})},[u,f,m]);const g=w.useCallback(E=>{E===null?ct.getState().setFocusedNode(null):E.type==="nodes"&&ct.getState().setFocusedNode(E.id)},[]),y=w.useCallback(E=>{E===null?ct.getState().setSelectedNode(null):E.type==="nodes"&&ct.getState().setSelectedNode(E.id,!0)},[]),b=w.useMemo(()=>a??n,[a,n]),S=w.useMemo(()=>n?{type:"nodes",id:n}:null,[n]);return x.jsxs(v3,{settings:e,className:"!bg-background !size-full overflow-hidden",children:[x.jsx(aU,{}),h&&x.jsx($U,{}),x.jsx(g5,{node:b,move:o}),x.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[x.jsx(GU,{}),c&&x.jsx(zU,{value:S,onFocus:g,onChange:y})]}),x.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[x.jsx(mU,{}),x.jsx(iU,{}),x.jsx(LF,{}),x.jsx(oU,{})]}),s&&x.jsx("div",{className:"absolute top-2 right-2",children:x.jsx(FU,{})})]})},LT=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{className:"relative w-full overflow-auto",children:x.jsx("table",{ref:n,className:Oe("w-full caption-bottom text-sm",e),...t})}));LT.displayName="Table";const zT=w.forwardRef(({className:e,...t},n)=>x.jsx("thead",{ref:n,className:Oe("[&_tr]:border-b",e),...t}));zT.displayName="TableHeader";const MT=w.forwardRef(({className:e,...t},n)=>x.jsx("tbody",{ref:n,className:Oe("[&_tr:last-child]:border-0",e),...t}));MT.displayName="TableBody";const qU=w.forwardRef(({className:e,...t},n)=>x.jsx("tfoot",{ref:n,className:Oe("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));qU.displayName="TableFooter";const Pm=w.forwardRef(({className:e,...t},n)=>x.jsx("tr",{ref:n,className:Oe("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));Pm.displayName="TableRow";const Jr=w.forwardRef(({className:e,...t},n)=>x.jsx("th",{ref:n,className:Oe("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Jr.displayName="TableHead";const ea=w.forwardRef(({className:e,...t},n)=>x.jsx("td",{ref:n,className:Oe("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));ea.displayName="TableCell";const YU=w.forwardRef(({className:e,...t},n)=>x.jsx("caption",{ref:n,className:Oe("text-muted-foreground mt-4 text-sm",e),...t}));YU.displayName="TableCaption";const hl=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("bg-card text-card-foreground rounded-xl border shadow",e),...t}));hl.displayName="Card";const Gu=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("flex flex-col space-y-1.5 p-6",e),...t}));Gu.displayName="CardHeader";const pl=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("leading-none font-semibold tracking-tight",e),...t}));pl.displayName="CardTitle";const Sd=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("text-muted-foreground text-sm",e),...t}));Sd.displayName="CardDescription";const Fu=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("p-6 pt-0",e),...t}));Fu.displayName="CardContent";const WU=w.forwardRef(({className:e,...t},n)=>x.jsx("div",{ref:n,className:Oe("flex items-center p-6 pt-0",e),...t}));WU.displayName="CardFooter";function XU({title:e,description:t,icon:n=GO,action:a,className:o,...s}){return x.jsxs(hl,{className:Oe("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",o),...s,children:[x.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:x.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),x.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[x.jsx(pl,{children:e}),t?x.jsx(Sd,{children:t}):null]}),a||null]})}var Wp={exports:{}},Xp,E1;function KU(){if(E1)return Xp;E1=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Xp=e,Xp}var Kp,S1;function ZU(){if(S1)return Kp;S1=1;var e=KU();function t(){}function n(){}return n.resetWarningCache=t,Kp=function(){function a(c,u,f,h,m,g){if(g!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}a.isRequired=a;function o(){return a}var s={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:o,element:a,elementType:a,instanceOf:o,node:a,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Kp}var _1;function QU(){return _1||(_1=1,Wp.exports=ZU()()),Wp.exports}var JU=QU();const gt=dn(JU),eB=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function Po(e,t,n){const a=tB(e),{webkitRelativePath:o}=e,s=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof a.path!="string"&&C1(a,"path",s),C1(a,"relativePath",s),a}function tB(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const a=t.split(".").pop().toLowerCase(),o=eB.get(a);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function C1(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const nB=[".DS_Store","Thumbs.db"];function rB(e){return Oi(this,void 0,void 0,function*(){return Uu(e)&&aB(e.dataTransfer)?lB(e.dataTransfer,e.type):iB(e)?oB(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?sB(e):[]})}function aB(e){return Uu(e)}function iB(e){return Uu(e)&&Uu(e.target)}function Uu(e){return typeof e=="object"&&e!==null}function oB(e){return Gm(e.target.files).map(t=>Po(t))}function sB(e){return Oi(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Po(n))})}function lB(e,t){return Oi(this,void 0,void 0,function*(){if(e.items){const n=Gm(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const a=yield Promise.all(n.map(cB));return T1(PT(a))}return T1(Gm(e.files).map(n=>Po(n)))})}function T1(e){return e.filter(t=>nB.indexOf(t.name)===-1)}function Gm(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?PT(n):[n]],[])}function R1(e,t){return Oi(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const c=yield s.getFile();return c.handle=s,Po(c)}}const a=e.getAsFile();if(!a)throw new Error(`${e} is not a File`);return Po(a,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function uB(e){return Oi(this,void 0,void 0,function*(){return e.isDirectory?GT(e):dB(e)})}function GT(e){const t=e.createReader();return new Promise((n,a)=>{const o=[];function s(){t.readEntries(c=>Oi(this,void 0,void 0,function*(){if(c.length){const u=Promise.all(c.map(uB));o.push(u),s()}else try{const u=yield Promise.all(o);n(u)}catch(u){a(u)}}),c=>{a(c)})}s()})}function dB(e){return Oi(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(a=>{const o=Po(a,e.fullPath);t(o)},a=>{n(a)})})})}var su={},A1;function fB(){return A1||(A1=1,su.__esModule=!0,su.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var a=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(c){var u=c.trim().toLowerCase();return u.charAt(0)==="."?a.toLowerCase().endsWith(u):u.endsWith("/*")?s===u.replace(/\/.*$/,""):o===u})}return!0}),su}var hB=fB();const Zp=dn(hB);function D1(e){return gB(e)||mB(e)||UT(e)||pB()}function pB(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mB(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gB(e){if(Array.isArray(e))return Fm(e)}function k1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function N1(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,a=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),a=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:wB,message:"File type must be ".concat(a)}},O1=function(t){return{code:EB,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},j1=function(t){return{code:SB,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},TB={code:_B,message:"Too many files"};function BT(e,t){var n=e.type==="application/x-moz-file"||xB(e,t);return[n,n?null:CB(t)]}function IT(e,t,n){if(wi(e.size))if(wi(t)&&wi(n)){if(e.size>n)return[!1,O1(n)];if(e.sizen)return[!1,O1(n)]}return[!0,null]}function wi(e){return e!=null}function RB(e){var t=e.files,n=e.accept,a=e.minSize,o=e.maxSize,s=e.multiple,c=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&c>=1&&t.length>c?!1:t.every(function(f){var h=BT(f,n),m=ml(h,1),g=m[0],y=IT(f,a,o),b=ml(y,1),S=b[0],E=u?u(f):null;return g&&S&&!E})}function Bu(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function lu(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function L1(e){e.preventDefault()}function AB(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function DB(e){return e.indexOf("Edge/")!==-1}function kB(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return AB(e)||DB(e)}function xr(){for(var e=arguments.length,t=new Array(e),n=0;n1?o-1:0),c=1;ce.length)&&(t=e.length);for(var n=0,a=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function YB(e,t){if(e==null)return{};var n={},a=Object.keys(e),o,s;for(s=0;s=0)&&(n[o]=e[o]);return n}var _d=w.forwardRef(function(e,t){var n=e.children,a=Iu(e,MB),o=WB(a),s=o.open,c=Iu(o,PB);return w.useImperativeHandle(t,function(){return{open:s}},[s]),ve.createElement(w.Fragment,null,n(_t(_t({},c),{},{open:s})))});_d.displayName="Dropzone";var qT={disabled:!1,getFilesFromEvent:rB,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};_d.defaultProps=qT;_d.propTypes={children:gt.func,accept:gt.objectOf(gt.arrayOf(gt.string)),multiple:gt.bool,preventDropOnDocument:gt.bool,noClick:gt.bool,noKeyboard:gt.bool,noDrag:gt.bool,noDragEventsBubbling:gt.bool,minSize:gt.number,maxSize:gt.number,maxFiles:gt.number,disabled:gt.bool,getFilesFromEvent:gt.func,onFileDialogCancel:gt.func,onFileDialogOpen:gt.func,useFsAccessApi:gt.bool,autoFocus:gt.bool,onDragEnter:gt.func,onDragLeave:gt.func,onDragOver:gt.func,onDrop:gt.func,onDropAccepted:gt.func,onDropRejected:gt.func,onError:gt.func,validator:gt.func};var Im={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function WB(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_t(_t({},qT),e),n=t.accept,a=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,u=t.multiple,f=t.maxFiles,h=t.onDragEnter,m=t.onDragLeave,g=t.onDragOver,y=t.onDrop,b=t.onDropAccepted,S=t.onDropRejected,E=t.onFileDialogCancel,_=t.onFileDialogOpen,N=t.useFsAccessApi,C=t.autoFocus,A=t.preventDropOnDocument,k=t.noClick,D=t.noKeyboard,M=t.noDrag,R=t.noDragEventsBubbling,U=t.onError,L=t.validator,I=w.useMemo(function(){return jB(n)},[n]),q=w.useMemo(function(){return OB(n)},[n]),Y=w.useMemo(function(){return typeof _=="function"?_:M1},[_]),B=w.useMemo(function(){return typeof E=="function"?E:M1},[E]),X=w.useRef(null),ne=w.useRef(null),F=w.useReducer(XB,Im),z=Qp(F,2),j=z[0],K=z[1],G=j.isFocused,H=j.isFileDialogActive,O=w.useRef(typeof window<"u"&&window.isSecureContext&&N&&NB()),$=function(){!O.current&&H&&setTimeout(function(){if(ne.current){var Ae=ne.current.files;Ae.length||(K({type:"closeDialog"}),B())}},300)};w.useEffect(function(){return window.addEventListener("focus",$,!1),function(){window.removeEventListener("focus",$,!1)}},[ne,H,B,O]);var W=w.useRef([]),re=function(Ae){X.current&&X.current.contains(Ae.target)||(Ae.preventDefault(),W.current=[])};w.useEffect(function(){return A&&(document.addEventListener("dragover",L1,!1),document.addEventListener("drop",re,!1)),function(){A&&(document.removeEventListener("dragover",L1),document.removeEventListener("drop",re))}},[X,A]),w.useEffect(function(){return!a&&C&&X.current&&X.current.focus(),function(){}},[X,C,a]);var de=w.useCallback(function(me){U?U(me):console.error(me)},[U]),ie=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me),W.current=[].concat(UB(W.current),[me.target]),lu(me)&&Promise.resolve(o(me)).then(function(Ae){if(!(Bu(me)&&!R)){var je=Ae.length,He=je>0&&RB({files:Ae,accept:I,minSize:c,maxSize:s,multiple:u,maxFiles:f,validator:L}),it=je>0&&!He;K({isDragAccept:He,isDragReject:it,isDragActive:!0,type:"setDraggedFiles"}),h&&h(me)}}).catch(function(Ae){return de(Ae)})},[o,h,de,R,I,c,s,u,f,L]),oe=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me);var Ae=lu(me);if(Ae&&me.dataTransfer)try{me.dataTransfer.dropEffect="copy"}catch{}return Ae&&g&&g(me),!1},[g,R]),Ce=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me);var Ae=W.current.filter(function(He){return X.current&&X.current.contains(He)}),je=Ae.indexOf(me.target);je!==-1&&Ae.splice(je,1),W.current=Ae,!(Ae.length>0)&&(K({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),lu(me)&&m&&m(me))},[X,m,R]),he=w.useCallback(function(me,Ae){var je=[],He=[];me.forEach(function(it){var Ct=BT(it,I),bt=Qp(Ct,2),qt=bt[0],fn=bt[1],Gt=IT(it,c,s),at=Qp(Gt,2),Tn=at[0],xt=at[1],Lt=L?L(it):null;if(qt&&Tn&&!Lt)je.push(it);else{var Wa=[fn,xt];Lt&&(Wa=Wa.concat(Lt)),He.push({file:it,errors:Wa.filter(function(ji){return ji})})}}),(!u&&je.length>1||u&&f>=1&&je.length>f)&&(je.forEach(function(it){He.push({file:it,errors:[TB]})}),je.splice(0)),K({acceptedFiles:je,fileRejections:He,isDragReject:He.length>0,type:"setFiles"}),y&&y(je,He,Ae),He.length>0&&S&&S(He,Ae),je.length>0&&b&&b(je,Ae)},[K,u,I,c,s,f,y,b,S,L]),Se=w.useCallback(function(me){me.preventDefault(),me.persist(),Ee(me),W.current=[],lu(me)&&Promise.resolve(o(me)).then(function(Ae){Bu(me)&&!R||he(Ae,me)}).catch(function(Ae){return de(Ae)}),K({type:"reset"})},[o,he,de,R]),be=w.useCallback(function(){if(O.current){K({type:"openDialog"}),Y();var me={multiple:u,types:q};window.showOpenFilePicker(me).then(function(Ae){return o(Ae)}).then(function(Ae){he(Ae,null),K({type:"closeDialog"})}).catch(function(Ae){LB(Ae)?(B(Ae),K({type:"closeDialog"})):zB(Ae)?(O.current=!1,ne.current?(ne.current.value=null,ne.current.click()):de(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):de(Ae)});return}ne.current&&(K({type:"openDialog"}),Y(),ne.current.value=null,ne.current.click())},[K,Y,B,N,he,de,q,u]),Le=w.useCallback(function(me){!X.current||!X.current.isEqualNode(me.target)||(me.key===" "||me.key==="Enter"||me.keyCode===32||me.keyCode===13)&&(me.preventDefault(),be())},[X,be]),Te=w.useCallback(function(){K({type:"focus"})},[]),ye=w.useCallback(function(){K({type:"blur"})},[]),J=w.useCallback(function(){k||(kB()?setTimeout(be,0):be())},[k,be]),le=function(Ae){return a?null:Ae},_e=function(Ae){return D?null:le(Ae)},pe=function(Ae){return M?null:le(Ae)},Ee=function(Ae){R&&Ae.stopPropagation()},te=w.useMemo(function(){return function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ae=me.refKey,je=Ae===void 0?"ref":Ae,He=me.role,it=me.onKeyDown,Ct=me.onFocus,bt=me.onBlur,qt=me.onClick,fn=me.onDragEnter,Gt=me.onDragOver,at=me.onDragLeave,Tn=me.onDrop,xt=Iu(me,GB);return _t(_t(Bm({onKeyDown:_e(xr(it,Le)),onFocus:_e(xr(Ct,Te)),onBlur:_e(xr(bt,ye)),onClick:le(xr(qt,J)),onDragEnter:pe(xr(fn,ie)),onDragOver:pe(xr(Gt,oe)),onDragLeave:pe(xr(at,Ce)),onDrop:pe(xr(Tn,Se)),role:typeof He=="string"&&He!==""?He:"presentation"},je,X),!a&&!D?{tabIndex:0}:{}),xt)}},[X,Le,Te,ye,J,ie,oe,Ce,Se,D,M,a]),Fe=w.useCallback(function(me){me.stopPropagation()},[]),Pe=w.useMemo(function(){return function(){var me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ae=me.refKey,je=Ae===void 0?"ref":Ae,He=me.onChange,it=me.onClick,Ct=Iu(me,FB),bt=Bm({accept:I,multiple:u,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:le(xr(He,Se)),onClick:le(xr(it,Fe)),tabIndex:-1},je,ne);return _t(_t({},bt),Ct)}},[ne,n,u,Se,a]);return _t(_t({},j),{},{isFocused:G&&!a,getRootProps:te,getInputProps:Pe,rootRef:X,inputRef:ne,open:le(be)})}function XB(e,t){switch(t.type){case"focus":return _t(_t({},e),{},{isFocused:!0});case"blur":return _t(_t({},e),{},{isFocused:!1});case"openDialog":return _t(_t({},Im),{},{isFileDialogActive:!0});case"closeDialog":return _t(_t({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return _t(_t({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return _t(_t({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return _t({},Im);default:return e}}function M1(){}var lv="Progress",cv=100,[KB,X6]=Kn(lv),[ZB,QB]=KB(lv),YT=w.forwardRef((e,t)=>{const{__scopeProgress:n,value:a=null,max:o,getValueLabel:s=JB,...c}=e;(o||o===0)&&!P1(o)&&console.error(eI(`${o}`,"Progress"));const u=P1(o)?o:cv;a!==null&&!G1(a,u)&&console.error(tI(`${a}`,"Progress"));const f=G1(a,u)?a:null,h=Hu(f)?s(f,u):void 0;return x.jsx(ZB,{scope:n,value:f,max:u,children:x.jsx(Ie.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":Hu(f)?f:void 0,"aria-valuetext":h,role:"progressbar","data-state":KT(f,u),"data-value":f??void 0,"data-max":u,...c,ref:t})})});YT.displayName=lv;var WT="ProgressIndicator",XT=w.forwardRef((e,t)=>{const{__scopeProgress:n,...a}=e,o=QB(WT,n);return x.jsx(Ie.div,{"data-state":KT(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...a,ref:t})});XT.displayName=WT;function JB(e,t){return`${Math.round(e/t*100)}%`}function KT(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Hu(e){return typeof e=="number"}function P1(e){return Hu(e)&&!isNaN(e)&&e>0}function G1(e,t){return Hu(e)&&!isNaN(e)&&e<=t&&e>=0}function eI(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${cv}\`.`}function tI(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: + - a positive number + - less than the value passed to \`max\` (or ${cv} if no \`max\` prop is set) + - \`null\` or \`undefined\` if the progress is indeterminate. + +Defaulting to \`null\`.`}var ZT=YT,nI=XT;const QT=w.forwardRef(({className:e,value:t,...n},a)=>x.jsx(ZT,{ref:a,className:Oe("bg-secondary relative h-4 w-full overflow-hidden rounded-full",e),...n,children:x.jsx(nI,{className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));QT.displayName=ZT.displayName;function Hm(e,[t,n]){return Math.min(n,Math.max(t,e))}function rI(e,t){return w.useReducer((n,a)=>t[n][a]??n,e)}var uv="ScrollArea",[JT,K6]=Kn(uv),[aI,Qn]=JT(uv),eR=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:a="hover",dir:o,scrollHideDelay:s=600,...c}=e,[u,f]=w.useState(null),[h,m]=w.useState(null),[g,y]=w.useState(null),[b,S]=w.useState(null),[E,_]=w.useState(null),[N,C]=w.useState(0),[A,k]=w.useState(0),[D,M]=w.useState(!1),[R,U]=w.useState(!1),L=nt(t,q=>f(q)),I=gd(o);return x.jsx(aI,{scope:n,type:a,dir:I,scrollHideDelay:s,scrollArea:u,viewport:h,onViewportChange:m,content:g,onContentChange:y,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:D,onScrollbarXEnabledChange:M,scrollbarY:E,onScrollbarYChange:_,scrollbarYEnabled:R,onScrollbarYEnabledChange:U,onCornerWidthChange:C,onCornerHeightChange:k,children:x.jsx(Ie.div,{dir:I,...c,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":A+"px",...e.style}})})});eR.displayName=uv;var tR="ScrollAreaViewport",nR=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:a,nonce:o,...s}=e,c=Qn(tR,n),u=w.useRef(null),f=nt(t,u,c.onViewportChange);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),x.jsx(Ie.div,{"data-radix-scroll-area-viewport":"",...s,ref:f,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:x.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});nR.displayName=tR;var kr="ScrollAreaScrollbar",dv=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=Qn(kr,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=o,u=e.orientation==="horizontal";return w.useEffect(()=>(u?s(!0):c(!0),()=>{u?s(!1):c(!1)}),[u,s,c]),o.type==="hover"?x.jsx(iI,{...a,ref:t,forceMount:n}):o.type==="scroll"?x.jsx(oI,{...a,ref:t,forceMount:n}):o.type==="auto"?x.jsx(rR,{...a,ref:t,forceMount:n}):o.type==="always"?x.jsx(fv,{...a,ref:t}):null});dv.displayName=kr;var iI=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=Qn(kr,e.__scopeScrollArea),[s,c]=w.useState(!1);return w.useEffect(()=>{const u=o.scrollArea;let f=0;if(u){const h=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),o.scrollHideDelay)};return u.addEventListener("pointerenter",h),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",h),u.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),x.jsx(zn,{present:n||s,children:x.jsx(rR,{"data-state":s?"visible":"hidden",...a,ref:t})})}),oI=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=Qn(kr,e.__scopeScrollArea),s=e.orientation==="horizontal",c=Td(()=>f("SCROLL_END"),100),[u,f]=rI("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(u==="idle"){const h=window.setTimeout(()=>f("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(h)}},[u,o.scrollHideDelay,f]),w.useEffect(()=>{const h=o.viewport,m=s?"scrollLeft":"scrollTop";if(h){let g=h[m];const y=()=>{const b=h[m];g!==b&&(f("SCROLL"),c()),g=b};return h.addEventListener("scroll",y),()=>h.removeEventListener("scroll",y)}},[o.viewport,s,f,c]),x.jsx(zn,{present:n||u!=="hidden",children:x.jsx(fv,{"data-state":u==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:Be(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Be(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),rR=w.forwardRef((e,t)=>{const n=Qn(kr,e.__scopeScrollArea),{forceMount:a,...o}=e,[s,c]=w.useState(!1),u=e.orientation==="horizontal",f=Td(()=>{if(n.viewport){const h=n.viewport.offsetWidth{const{orientation:n="vertical",...a}=e,o=Qn(kr,e.__scopeScrollArea),s=w.useRef(null),c=w.useRef(0),[u,f]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=lR(u.viewport,u.content),m={...a,sizes:u,onSizesChange:f,hasThumb:h>0&&h<1,onThumbChange:y=>s.current=y,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:y=>c.current=y};function g(y,b){return fI(y,c.current,u,b)}return n==="horizontal"?x.jsx(sI,{...m,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const y=o.viewport.scrollLeft,b=F1(y,u,o.dir);s.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollLeft=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollLeft=g(y,o.dir))}}):n==="vertical"?x.jsx(lI,{...m,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const y=o.viewport.scrollTop,b=F1(y,u);s.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollTop=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollTop=g(y))}}):null}),sI=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...o}=e,s=Qn(kr,e.__scopeScrollArea),[c,u]=w.useState(),f=w.useRef(null),h=nt(t,f,s.onScrollbarXChange);return w.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),x.jsx(iR,{"data-orientation":"horizontal",...o,ref:h,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Cd(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,g)=>{if(s.viewport){const y=s.viewport.scrollLeft+m.deltaX;e.onWheelScroll(y),uR(y,g)&&m.preventDefault()}},onResize:()=>{f.current&&s.viewport&&c&&a({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Vu(c.paddingLeft),paddingEnd:Vu(c.paddingRight)}})}})}),lI=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:a,...o}=e,s=Qn(kr,e.__scopeScrollArea),[c,u]=w.useState(),f=w.useRef(null),h=nt(t,f,s.onScrollbarYChange);return w.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),x.jsx(iR,{"data-orientation":"vertical",...o,ref:h,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Cd(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,g)=>{if(s.viewport){const y=s.viewport.scrollTop+m.deltaY;e.onWheelScroll(y),uR(y,g)&&m.preventDefault()}},onResize:()=>{f.current&&s.viewport&&c&&a({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Vu(c.paddingTop),paddingEnd:Vu(c.paddingBottom)}})}})}),[cI,aR]=JT(kr),iR=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:a,hasThumb:o,onThumbChange:s,onThumbPointerUp:c,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:h,onWheelScroll:m,onResize:g,...y}=e,b=Qn(kr,n),[S,E]=w.useState(null),_=nt(t,L=>E(L)),N=w.useRef(null),C=w.useRef(""),A=b.viewport,k=a.content-a.viewport,D=Zt(m),M=Zt(f),R=Td(g,10);function U(L){if(N.current){const I=L.clientX-N.current.left,q=L.clientY-N.current.top;h({x:I,y:q})}}return w.useEffect(()=>{const L=I=>{const q=I.target;(S==null?void 0:S.contains(q))&&D(I,k)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[A,S,k,D]),w.useEffect(M,[a,M]),Go(S,R),Go(b.content,R),x.jsx(cI,{scope:n,scrollbar:S,hasThumb:o,onThumbChange:Zt(s),onThumbPointerUp:Zt(c),onThumbPositionChange:M,onThumbPointerDown:Zt(u),children:x.jsx(Ie.div,{...y,ref:_,style:{position:"absolute",...y.style},onPointerDown:Be(e.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),N.current=S.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),U(L))}),onPointerMove:Be(e.onPointerMove,U),onPointerUp:Be(e.onPointerUp,L=>{const I=L.target;I.hasPointerCapture(L.pointerId)&&I.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=C.current,b.viewport&&(b.viewport.style.scrollBehavior=""),N.current=null})})})}),$u="ScrollAreaThumb",oR=w.forwardRef((e,t)=>{const{forceMount:n,...a}=e,o=aR($u,e.__scopeScrollArea);return x.jsx(zn,{present:n||o.hasThumb,children:x.jsx(uI,{ref:t,...a})})}),uI=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:a,...o}=e,s=Qn($u,n),c=aR($u,n),{onThumbPositionChange:u}=c,f=nt(t,g=>c.onThumbChange(g)),h=w.useRef(void 0),m=Td(()=>{h.current&&(h.current(),h.current=void 0)},100);return w.useEffect(()=>{const g=s.viewport;if(g){const y=()=>{if(m(),!h.current){const b=hI(g,u);h.current=b,u()}};return u(),g.addEventListener("scroll",y),()=>g.removeEventListener("scroll",y)}},[s.viewport,m,u]),x.jsx(Ie.div,{"data-state":c.hasThumb?"visible":"hidden",...o,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:Be(e.onPointerDownCapture,g=>{const b=g.target.getBoundingClientRect(),S=g.clientX-b.left,E=g.clientY-b.top;c.onThumbPointerDown({x:S,y:E})}),onPointerUp:Be(e.onPointerUp,c.onThumbPointerUp)})});oR.displayName=$u;var hv="ScrollAreaCorner",sR=w.forwardRef((e,t)=>{const n=Qn(hv,e.__scopeScrollArea),a=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&a?x.jsx(dI,{...e,ref:t}):null});sR.displayName=hv;var dI=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...a}=e,o=Qn(hv,n),[s,c]=w.useState(0),[u,f]=w.useState(0),h=!!(s&&u);return Go(o.scrollbarX,()=>{var g;const m=((g=o.scrollbarX)==null?void 0:g.offsetHeight)||0;o.onCornerHeightChange(m),f(m)}),Go(o.scrollbarY,()=>{var g;const m=((g=o.scrollbarY)==null?void 0:g.offsetWidth)||0;o.onCornerWidthChange(m),c(m)}),h?x.jsx(Ie.div,{...a,ref:t,style:{width:s,height:u,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Vu(e){return e?parseInt(e,10):0}function lR(e,t){const n=e/t;return isNaN(n)?0:n}function Cd(e){const t=lR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-n)*t;return Math.max(a,18)}function fI(e,t,n,a="ltr"){const o=Cd(n),s=o/2,c=t||s,u=o-c,f=n.scrollbar.paddingStart+c,h=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,g=a==="ltr"?[0,m]:[m*-1,0];return cR([f,h],g)(e)}function F1(e,t,n="ltr"){const a=Cd(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,c=t.content-t.viewport,u=s-a,f=n==="ltr"?[0,c]:[c*-1,0],h=Hm(e,f);return cR([0,c],[0,u])(h)}function cR(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(n-e[0])}}function uR(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},a=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},c=n.left!==s.left,u=n.top!==s.top;(c||u)&&t(),n=s,a=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(a)};function Td(e,t){const n=Zt(e),a=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(a.current),[]),w.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(n,t)},[n,t])}function Go(e,t){const n=Zt(t);sn(()=>{let a=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(a),o.unobserve(e)}}},[e,n])}var dR=eR,pI=nR,mI=sR;const fR=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(dR,{ref:a,className:Oe("relative overflow-hidden",e),...n,children:[x.jsx(pI,{className:"h-full w-full rounded-[inherit]",children:t}),x.jsx(hR,{}),x.jsx(mI,{})]}));fR.displayName=dR.displayName;const hR=w.forwardRef(({className:e,orientation:t="vertical",...n},a)=>x.jsx(dv,{ref:a,orientation:t,className:Oe("flex touch-none transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:x.jsx(oR,{className:"bg-border relative flex-1 rounded-full"})}));hR.displayName=dv.displayName;function $m(e,t={}){const{decimals:n=0,sizeType:a="normal"}=t,o=["Bytes","KB","MB","GB","TB"],s=["Bytes","KiB","MiB","GiB","TiB"];if(e===0)return"0 Byte";const c=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,c)).toFixed(n)} ${a==="accurate"?s[c]??"Bytes":o[c]??"Bytes"}`}function gI(e){const{value:t,onValueChange:n,onUpload:a,progresses:o,accept:s=jk,maxSize:c=1024*1024*200,maxFileCount:u=1,multiple:f=!1,disabled:h=!1,description:m,className:g,...y}=e,[b,S]=aa({prop:t,onChange:n}),E=w.useCallback((C,A)=>{if(!f&&u===1&&C.length>1){an.error("Cannot upload more than 1 file at a time");return}if(((b==null?void 0:b.length)??0)+C.length>u){an.error(`Cannot upload more than ${u} files`);return}const k=C.map(M=>Object.assign(M,{preview:URL.createObjectURL(M)})),D=b?[...b,...k]:k;if(S(D),A.length>0&&A.forEach(({file:M})=>{an.error(`File ${M.name} was rejected`)}),a&&D.length>0&&D.length<=u){const M=D.length>0?`${D.length} files`:"file";an.promise(a(D),{loading:`Uploading ${M}...`,success:()=>(S([]),`${M} uploaded`),error:`Failed to upload ${M}`})}},[b,u,f,a,S]);function _(C){if(!b)return;const A=b.filter((k,D)=>D!==C);S(A),n==null||n(A)}w.useEffect(()=>()=>{b&&b.forEach(C=>{pR(C)&&URL.revokeObjectURL(C.preview)})},[]);const N=h||((b==null?void 0:b.length)??0)>=u;return x.jsxs("div",{className:"relative flex flex-col gap-6 overflow-hidden",children:[x.jsx(_d,{onDrop:E,accept:s,maxSize:c,maxFiles:u,multiple:u>1||f,disabled:N,children:({getRootProps:C,getInputProps:A,isDragActive:k})=>x.jsxs("div",{...C(),className:Oe("group border-muted-foreground/25 hover:bg-muted/25 relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition","ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",k&&"border-muted-foreground/50",N&&"pointer-events-none opacity-60",g),...y,children:[x.jsx("input",{...A()}),k?x.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[x.jsx("div",{className:"rounded-full border border-dashed p-3",children:x.jsx(um,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),x.jsx("p",{className:"text-muted-foreground font-medium",children:"Drop the files here"})]}):x.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[x.jsx("div",{className:"rounded-full border border-dashed p-3",children:x.jsx(um,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),x.jsxs("div",{className:"flex flex-col gap-px",children:[x.jsx("p",{className:"text-muted-foreground font-medium",children:"Drag and drop files here, or click to select files"}),m?x.jsx("p",{className:"text-muted-foreground/70 text-sm",children:m}):x.jsxs("p",{className:"text-muted-foreground/70 text-sm",children:["You can upload",u>1?` ${u===1/0?"multiple":u} + files (up to ${$m(c)} each)`:` a file with ${$m(c)}`,"Supported formats: TXT, MD, DOC, PDF, PPTX"]})]})]})]})}),b!=null&&b.length?x.jsx(fR,{className:"h-fit w-full px-3",children:x.jsx("div",{className:"flex max-h-48 flex-col gap-4",children:b==null?void 0:b.map((C,A)=>x.jsx(vI,{file:C,onRemove:()=>_(A),progress:o==null?void 0:o[C.name]},A))})}):null]})}function vI({file:e,progress:t,onRemove:n}){return x.jsxs("div",{className:"relative flex items-center gap-2.5",children:[x.jsxs("div",{className:"flex flex-1 gap-2.5",children:[pR(e)?x.jsx(yI,{file:e}):null,x.jsxs("div",{className:"flex w-full flex-col gap-2",children:[x.jsxs("div",{className:"flex flex-col gap-px",children:[x.jsx("p",{className:"text-foreground/80 line-clamp-1 text-sm font-medium",children:e.name}),x.jsx("p",{className:"text-muted-foreground text-xs",children:$m(e.size)})]}),t?x.jsx(QT,{value:t}):null]})]}),x.jsx("div",{className:"flex items-center gap-2",children:x.jsxs(wt,{type:"button",variant:"outline",size:"icon",className:"size-7",onClick:n,children:[x.jsx(IE,{className:"size-4","aria-hidden":"true"}),x.jsx("span",{className:"sr-only",children:"Remove file"})]})})]})}function pR(e){return"preview"in e&&typeof e.preview=="string"}function yI({file:e}){return e.type.startsWith("image/")?x.jsx("div",{className:"aspect-square shrink-0 rounded-md object-cover"}):x.jsx(MO,{className:"text-muted-foreground size-10","aria-hidden":"true"})}function bI(){const[e,t]=w.useState(!1),[n,a]=w.useState(!1),[o,s]=w.useState({}),c=w.useCallback(async u=>{a(!0);try{await Promise.all(u.map(async f=>{try{const h=await wO(f,m=>{console.debug(`Uploading ${f.name}: ${m}%`),s(g=>({...g,[f.name]:m}))});h.status==="success"?an.success(`Upload Success: +${f.name} uploaded successfully`):an.error(`Upload Failed: +${f.name} +${h.message}`)}catch(h){an.error(`Upload Failed: +${f.name} +${Sr(h)}`)}}))}catch(f){an.error(`Upload Failed +`+Sr(f))}finally{a(!1)}},[a,s]);return x.jsxs(mT,{open:e,onOpenChange:u=>{n&&!u||t(u)},children:[x.jsx(gT,{asChild:!0,children:x.jsxs(wt,{variant:"default",side:"bottom",tooltip:"Upload documents",size:"sm",children:[x.jsx(um,{})," Upload"]})}),x.jsxs(Qg,{className:"sm:max-w-xl",onCloseAutoFocus:u=>u.preventDefault(),children:[x.jsxs(Jg,{children:[x.jsx(ev,{children:"Upload documents"}),x.jsx(tv,{children:"Drag and drop your documents here or click to browse."})]}),x.jsx(gI,{maxFileCount:1/0,maxSize:200*1024*1024,description:"supported types: TXT, MD, DOC, PDF, PPTX",onUpload:c,progresses:o,disabled:n})]})]})}function xI(){const[e,t]=w.useState(!1),n=w.useCallback(async()=>{try{const a=await EO();a.status==="success"?(an.success("Documents cleared successfully"),t(!1)):an.error(`Clear Documents Failed: +${a.message}`)}catch(a){an.error(`Clear Documents Failed: +`+Sr(a))}},[t]);return x.jsxs(mT,{open:e,onOpenChange:t,children:[x.jsx(gT,{asChild:!0,children:x.jsxs(wt,{variant:"outline",side:"bottom",tooltip:"Clear documents",size:"sm",children:[x.jsx(UE,{})," Clear"]})}),x.jsxs(Qg,{className:"sm:max-w-xl",onCloseAutoFocus:a=>a.preventDefault(),children:[x.jsxs(Jg,{children:[x.jsx(ev,{children:"Clear documents"}),x.jsx(tv,{children:"Do you really want to clear all documents?"})]}),x.jsx(wt,{variant:"destructive",onClick:n,children:"YES"})]})]})}function wI(){const e=En.use.health(),[t,n]=w.useState(null),a=w.useCallback(async()=>{try{const s=await vO();s&&s.statuses?n(s):n(null)}catch(s){an.error(`Failed to load documents +`+Sr(s))}},[n]);w.useEffect(()=>{a()},[]);const o=w.useCallback(async()=>{try{const{status:s}=await yO();an.message(s)}catch(s){an.error(`Failed to load documents +`+Sr(s))}},[]);return w.useEffect(()=>{const s=setInterval(async()=>{if(e)try{await a()}catch(c){an.error(`Failed to get scan progress +`+Sr(c))}},5e3);return()=>clearInterval(s)},[e,a]),x.jsxs(hl,{className:"!size-full !rounded-none !border-none",children:[x.jsx(Gu,{children:x.jsx(pl,{className:"text-lg",children:"Document Management"})}),x.jsxs(Fu,{className:"space-y-4",children:[x.jsxs("div",{className:"flex gap-2",children:[x.jsxs(wt,{variant:"outline",onClick:o,side:"bottom",tooltip:"Scan documents",size:"sm",children:[x.jsx(ij,{})," Scan"]}),x.jsx("div",{className:"flex-1"}),x.jsx(xI,{}),x.jsx(bI,{})]}),x.jsxs(hl,{children:[x.jsxs(Gu,{children:[x.jsx(pl,{children:"Uploaded documents"}),x.jsx(Sd,{children:"view the uploaded documents here"})]}),x.jsxs(Fu,{children:[!t&&x.jsx(XU,{title:"No documents uploaded",description:"upload documents to see them here"}),t&&x.jsxs(LT,{children:[x.jsx(zT,{children:x.jsxs(Pm,{children:[x.jsx(Jr,{children:"ID"}),x.jsx(Jr,{children:"Summary"}),x.jsx(Jr,{children:"Status"}),x.jsx(Jr,{children:"Length"}),x.jsx(Jr,{children:"Chunks"}),x.jsx(Jr,{children:"Created"}),x.jsx(Jr,{children:"Updated"}),x.jsx(Jr,{children:"Metadata"})]})}),x.jsx(MT,{className:"text-sm",children:Object.entries(t.statuses).map(([s,c])=>c.map(u=>x.jsxs(Pm,{children:[x.jsx(ea,{className:"truncate font-mono",children:u.id}),x.jsx(ea,{className:"max-w-xs min-w-24 truncate",children:x.jsx(bn,{text:u.content_summary,tooltip:u.content_summary,tooltipClassName:"max-w-none overflow-visible block"})}),x.jsxs(ea,{children:[s==="processed"&&x.jsx("span",{className:"text-green-600",children:"Completed"}),s==="processing"&&x.jsx("span",{className:"text-blue-600",children:"Processing"}),s==="pending"&&x.jsx("span",{className:"text-yellow-600",children:"Pending"}),s==="failed"&&x.jsx("span",{className:"text-red-600",children:"Failed"}),u.error&&x.jsx("span",{className:"ml-2 text-red-500",title:u.error,children:"⚠️"})]}),x.jsx(ea,{children:u.content_length??"-"}),x.jsx(ea,{children:u.chunks_count??"-"}),x.jsx(ea,{className:"truncate",children:new Date(u.created_at).toLocaleString()}),x.jsx(ea,{className:"truncate",children:new Date(u.updated_at).toLocaleString()}),x.jsx(ea,{className:"max-w-xs truncate",children:u.metadata?JSON.stringify(u.metadata):"-"})]},u.id)))})]})]})]})]})]})}function mR(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o=u?o=o+U1("0",c-u):o=(o.substring(0,c)||"0")+"."+o.substring(c),n+o}function B1(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var a=(e.indexOf(".")!==-1||n)&&t,o=pv(e),s=o.beforeDecimal,c=o.afterDecimal,u=o.hasNegation,f=parseFloat("0."+(c||"0")),h=c.length<=t?"0."+c:f.toFixed(t),m=h.split("."),g=s;s&&Number(m[0])&&(g=s.split("").reverse().reduce(function(E,_,N){return E.length>N?(Number(E[0])+Number(_)).toString()+E.substring(1,E.length):_+E},m[0]));var y=yR(m[1]||"",t,n),b=u?"-":"",S=a?".":"";return""+b+g+S+y}function Ei(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var xR=EI(function(e,t){for(var n=0,a=0,o=e.length,s=t.length;e[n]===t[n]&&nn&&o-a>n;)a++;return{from:{start:n,end:o-a},to:{start:n,end:s-a}}}),AI=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function DI(e,t,n){return Math.min(Math.max(e,t),n)}function Jp(e){return Math.max(e.selectionStart,e.selectionEnd)}function kI(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function NI(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function OI(e){var t=e.currentValue,n=e.formattedValue,a=e.currentValueIndex,o=e.formattedValueIndex;return t[a]===n[o]}function jI(e,t,n,a,o,s,c){c===void 0&&(c=OI);var u=o.findIndex(function(k){return k}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,a=a+f.length);for(var h=n.length,m=e.length,g={},y=new Array(h),b=0;b0&&y[N]===-1;)N--;var A=N===-1||y[N]===-1?0:y[N]+1;return A>C?C:a-A=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=o&&!n[t];)t++;t>o&&(t=n.lastIndexOf(!0))}return t===-1&&(t=o),t}function LI(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,a=t.length;nR.length-c.length||Mq||g>e.length-c.length)&&(I=g),e=e.substring(0,I),e=GI(A?"-"+e:e,o),e=(e.match(FI(S))||[]).join("");var Y=e.indexOf(S);e=e.replace(new RegExp(vR(S),"g"),function(z,j){return j===Y?".":""});var B=pv(e,o),X=B.beforeDecimal,ne=B.afterDecimal,F=B.addNegation;return h.end-h.startH?!1:G>=re.start&&G{const[E,_]=w.useState(y??a),N=w.useCallback(()=>{_(D=>D===void 0?e??1:Math.min(D+(e??1),s))},[e,s]),C=w.useCallback(()=>{_(D=>D===void 0?-(e??1):Math.max(D-(e??1),o))},[e,o]);w.useEffect(()=>{y!==void 0&&_(y)},[y]);const A=D=>{const M=D.floatValue===void 0?void 0:D.floatValue;_(M),c&&c(M)},k=()=>{E!==void 0&&(Es&&(_(s),S.current.value=String(s)))};return x.jsxs("div",{className:"relative flex",children:[x.jsx(VI,{value:E,onValueChange:A,thousandSeparator:t,decimalScale:f,fixedDecimalScale:u,allowNegative:o<0,valueIsNumericString:!0,onBlur:k,max:s,min:o,suffix:m,prefix:g,customInput:D=>x.jsx(Ai,{...D,className:Oe("w-full",h)}),placeholder:n,className:"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",getInputRef:S,...b}),x.jsxs("div",{className:"absolute top-0 right-0 bottom-0 flex flex-col",children:[x.jsx(wt,{"aria-label":"Increase value",className:"border-input h-1/2 rounded-l-none rounded-br-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:N,disabled:E===s,children:x.jsx(FE,{size:15})}),x.jsx(wt,{"aria-label":"Decrease value",className:"border-input h-1/2 rounded-l-none rounded-tr-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:C,disabled:E===o,children:x.jsx(og,{size:15})})]})]})});To.displayName="NumberInput";var qI=[" ","Enter","ArrowUp","ArrowDown"],YI=[" ","Enter"],Nl="Select",[Ad,Dd,WI]=j_(Nl),[Qo,Z6]=Kn(Nl,[WI,Vo]),kd=Vo(),[XI,qa]=Qo(Nl),[KI,ZI]=Qo(Nl),ER=e=>{const{__scopeSelect:t,children:n,open:a,defaultOpen:o,onOpenChange:s,value:c,defaultValue:u,onValueChange:f,dir:h,name:m,autoComplete:g,disabled:y,required:b,form:S}=e,E=kd(t),[_,N]=w.useState(null),[C,A]=w.useState(null),[k,D]=w.useState(!1),M=gd(h),[R=!1,U]=aa({prop:a,defaultProp:o,onChange:s}),[L,I]=aa({prop:c,defaultProp:u,onChange:f}),q=w.useRef(null),Y=_?S||!!_.closest("form"):!0,[B,X]=w.useState(new Set),ne=Array.from(B).map(F=>F.props.value).join(";");return x.jsx(Ag,{...E,children:x.jsxs(XI,{required:b,scope:t,trigger:_,onTriggerChange:N,valueNode:C,onValueNodeChange:A,valueNodeHasChildren:k,onValueNodeHasChildrenChange:D,contentId:on(),value:L,onValueChange:I,open:R,onOpenChange:U,dir:M,triggerPointerDownPosRef:q,disabled:y,children:[x.jsx(Ad.Provider,{scope:t,children:x.jsx(KI,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(F=>{X(z=>new Set(z).add(F))},[]),onNativeOptionRemove:w.useCallback(F=>{X(z=>{const j=new Set(z);return j.delete(F),j})},[]),children:n})}),Y?x.jsxs(WR,{"aria-hidden":!0,required:b,tabIndex:-1,name:m,autoComplete:g,value:L,onChange:F=>I(F.target.value),disabled:y,form:S,children:[L===void 0?x.jsx("option",{value:""}):null,Array.from(B)]},ne):null]})})};ER.displayName=Nl;var SR="SelectTrigger",_R=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:a=!1,...o}=e,s=kd(n),c=qa(SR,n),u=c.disabled||a,f=nt(t,c.onTriggerChange),h=Dd(n),m=w.useRef("touch"),[g,y,b]=XR(E=>{const _=h().filter(A=>!A.disabled),N=_.find(A=>A.value===c.value),C=KR(_,E,N);C!==void 0&&c.onValueChange(C.value)}),S=E=>{u||(c.onOpenChange(!0),b()),E&&(c.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return x.jsx(cd,{asChild:!0,...s,children:x.jsx(Ie.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":YR(c.value)?"":void 0,...o,ref:f,onClick:Be(o.onClick,E=>{E.currentTarget.focus(),m.current!=="mouse"&&S(E)}),onPointerDown:Be(o.onPointerDown,E=>{m.current=E.pointerType;const _=E.target;_.hasPointerCapture(E.pointerId)&&_.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(S(E),E.preventDefault())}),onKeyDown:Be(o.onKeyDown,E=>{const _=g.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&y(E.key),!(_&&E.key===" ")&&qI.includes(E.key)&&(S(),E.preventDefault())})})})});_R.displayName=SR;var CR="SelectValue",TR=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:o,children:s,placeholder:c="",...u}=e,f=qa(CR,n),{onValueNodeHasChildrenChange:h}=f,m=s!==void 0,g=nt(t,f.onValueNodeChange);return sn(()=>{h(m)},[h,m]),x.jsx(Ie.span,{...u,ref:g,style:{pointerEvents:"none"},children:YR(f.value)?x.jsx(x.Fragment,{children:c}):s})});TR.displayName=CR;var QI="SelectIcon",RR=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:a,...o}=e;return x.jsx(Ie.span,{"aria-hidden":!0,...o,ref:t,children:a||"▼"})});RR.displayName=QI;var JI="SelectPortal",AR=e=>x.jsx(td,{asChild:!0,...e});AR.displayName=JI;var Ni="SelectContent",DR=w.forwardRef((e,t)=>{const n=qa(Ni,e.__scopeSelect),[a,o]=w.useState();if(sn(()=>{o(new DocumentFragment)},[]),!n.open){const s=a;return s?xl.createPortal(x.jsx(kR,{scope:e.__scopeSelect,children:x.jsx(Ad.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),s):null}return x.jsx(NR,{...e,ref:t})});DR.displayName=Ni;var sr=10,[kR,Ya]=Qo(Ni),e6="SelectContentImpl",NR=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:c,side:u,sideOffset:f,align:h,alignOffset:m,arrowPadding:g,collisionBoundary:y,collisionPadding:b,sticky:S,hideWhenDetached:E,avoidCollisions:_,...N}=e,C=qa(Ni,n),[A,k]=w.useState(null),[D,M]=w.useState(null),R=nt(t,ie=>k(ie)),[U,L]=w.useState(null),[I,q]=w.useState(null),Y=Dd(n),[B,X]=w.useState(!1),ne=w.useRef(!1);w.useEffect(()=>{if(A)return cg(A)},[A]),lg();const F=w.useCallback(ie=>{const[oe,...Ce]=Y().map(be=>be.ref.current),[he]=Ce.slice(-1),Se=document.activeElement;for(const be of ie)if(be===Se||(be==null||be.scrollIntoView({block:"nearest"}),be===oe&&D&&(D.scrollTop=0),be===he&&D&&(D.scrollTop=D.scrollHeight),be==null||be.focus(),document.activeElement!==Se))return},[Y,D]),z=w.useCallback(()=>F([U,A]),[F,U,A]);w.useEffect(()=>{B&&z()},[B,z]);const{onOpenChange:j,triggerPointerDownPosRef:K}=C;w.useEffect(()=>{if(A){let ie={x:0,y:0};const oe=he=>{var Se,be;ie={x:Math.abs(Math.round(he.pageX)-(((Se=K.current)==null?void 0:Se.x)??0)),y:Math.abs(Math.round(he.pageY)-(((be=K.current)==null?void 0:be.y)??0))}},Ce=he=>{ie.x<=10&&ie.y<=10?he.preventDefault():A.contains(he.target)||j(!1),document.removeEventListener("pointermove",oe),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[A,j,K]),w.useEffect(()=>{const ie=()=>j(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[j]);const[G,H]=XR(ie=>{const oe=Y().filter(Se=>!Se.disabled),Ce=oe.find(Se=>Se.ref.current===document.activeElement),he=KR(oe,ie,Ce);he&&setTimeout(()=>he.ref.current.focus())}),O=w.useCallback((ie,oe,Ce)=>{const he=!ne.current&&!Ce;(C.value!==void 0&&C.value===oe||he)&&(L(ie),he&&(ne.current=!0))},[C.value]),$=w.useCallback(()=>A==null?void 0:A.focus(),[A]),W=w.useCallback((ie,oe,Ce)=>{const he=!ne.current&&!Ce;(C.value!==void 0&&C.value===oe||he)&&q(ie)},[C.value]),re=a==="popper"?Vm:OR,de=re===Vm?{side:u,sideOffset:f,align:h,alignOffset:m,arrowPadding:g,collisionBoundary:y,collisionPadding:b,sticky:S,hideWhenDetached:E,avoidCollisions:_}:{};return x.jsx(kR,{scope:n,content:A,viewport:D,onViewportChange:M,itemRefCallback:O,selectedItem:U,onItemLeave:$,itemTextRefCallback:W,focusSelectedItem:z,selectedItemText:I,position:a,isPositioned:B,searchRef:G,children:x.jsx(rd,{as:Ba,allowPinchZoom:!0,children:x.jsx(ed,{asChild:!0,trapped:C.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:Be(o,ie=>{var oe;(oe=C.trigger)==null||oe.focus({preventScroll:!0}),ie.preventDefault()}),children:x.jsx(wl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:x.jsx(re,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:ie=>ie.preventDefault(),...N,...de,onPlaced:()=>X(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Be(N.onKeyDown,ie=>{const oe=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!oe&&ie.key.length===1&&H(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let he=Y().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Se=ie.target,be=he.indexOf(Se);he=he.slice(be+1)}setTimeout(()=>F(he)),ie.preventDefault()}})})})})})})});NR.displayName=e6;var t6="SelectItemAlignedPosition",OR=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:a,...o}=e,s=qa(Ni,n),c=Ya(Ni,n),[u,f]=w.useState(null),[h,m]=w.useState(null),g=nt(t,R=>m(R)),y=Dd(n),b=w.useRef(!1),S=w.useRef(!0),{viewport:E,selectedItem:_,selectedItemText:N,focusSelectedItem:C}=c,A=w.useCallback(()=>{if(s.trigger&&s.valueNode&&u&&h&&E&&_&&N){const R=s.trigger.getBoundingClientRect(),U=h.getBoundingClientRect(),L=s.valueNode.getBoundingClientRect(),I=N.getBoundingClientRect();if(s.dir!=="rtl"){const Se=I.left-U.left,be=L.left-Se,Le=R.left-be,Te=R.width+Le,ye=Math.max(Te,U.width),J=window.innerWidth-sr,le=Hm(be,[sr,Math.max(sr,J-ye)]);u.style.minWidth=Te+"px",u.style.left=le+"px"}else{const Se=U.right-I.right,be=window.innerWidth-L.right-Se,Le=window.innerWidth-R.right-be,Te=R.width+Le,ye=Math.max(Te,U.width),J=window.innerWidth-sr,le=Hm(be,[sr,Math.max(sr,J-ye)]);u.style.minWidth=Te+"px",u.style.right=le+"px"}const q=y(),Y=window.innerHeight-sr*2,B=E.scrollHeight,X=window.getComputedStyle(h),ne=parseInt(X.borderTopWidth,10),F=parseInt(X.paddingTop,10),z=parseInt(X.borderBottomWidth,10),j=parseInt(X.paddingBottom,10),K=ne+F+B+j+z,G=Math.min(_.offsetHeight*5,K),H=window.getComputedStyle(E),O=parseInt(H.paddingTop,10),$=parseInt(H.paddingBottom,10),W=R.top+R.height/2-sr,re=Y-W,de=_.offsetHeight/2,ie=_.offsetTop+de,oe=ne+F+ie,Ce=K-oe;if(oe<=W){const Se=q.length>0&&_===q[q.length-1].ref.current;u.style.bottom="0px";const be=h.clientHeight-E.offsetTop-E.offsetHeight,Le=Math.max(re,de+(Se?$:0)+be+z),Te=oe+Le;u.style.height=Te+"px"}else{const Se=q.length>0&&_===q[0].ref.current;u.style.top="0px";const Le=Math.max(W,ne+E.offsetTop+(Se?O:0)+de)+Ce;u.style.height=Le+"px",E.scrollTop=oe-W+E.offsetTop}u.style.margin=`${sr}px 0`,u.style.minHeight=G+"px",u.style.maxHeight=Y+"px",a==null||a(),requestAnimationFrame(()=>b.current=!0)}},[y,s.trigger,s.valueNode,u,h,E,_,N,s.dir,a]);sn(()=>A(),[A]);const[k,D]=w.useState();sn(()=>{h&&D(window.getComputedStyle(h).zIndex)},[h]);const M=w.useCallback(R=>{R&&S.current===!0&&(A(),C==null||C(),S.current=!1)},[A,C]);return x.jsx(r6,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:b,onScrollButtonChange:M,children:x.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:x.jsx(Ie.div,{...o,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});OR.displayName=t6;var n6="SelectPopperPosition",Vm=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:a="start",collisionPadding:o=sr,...s}=e,c=kd(n);return x.jsx(Dg,{...c,...s,ref:t,align:a,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Vm.displayName=n6;var[r6,mv]=Qo(Ni,{}),qm="SelectViewport",jR=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:a,...o}=e,s=Ya(qm,n),c=mv(qm,n),u=nt(t,s.onViewportChange),f=w.useRef(0);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),x.jsx(Ad.Slot,{scope:n,children:x.jsx(Ie.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Be(o.onScroll,h=>{const m=h.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:y}=c;if(y!=null&&y.current&&g){const b=Math.abs(f.current-m.scrollTop);if(b>0){const S=window.innerHeight-sr*2,E=parseFloat(g.style.minHeight),_=parseFloat(g.style.height),N=Math.max(E,_);if(N0?k:0,g.style.justifyContent="flex-end")}}}f.current=m.scrollTop})})})]})});jR.displayName=qm;var LR="SelectGroup",[a6,i6]=Qo(LR),zR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,o=on();return x.jsx(a6,{scope:n,id:o,children:x.jsx(Ie.div,{role:"group","aria-labelledby":o,...a,ref:t})})});zR.displayName=LR;var MR="SelectLabel",PR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,o=i6(MR,n);return x.jsx(Ie.div,{id:o.id,...a,ref:t})});PR.displayName=MR;var qu="SelectItem",[o6,GR]=Qo(qu),FR=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:a,disabled:o=!1,textValue:s,...c}=e,u=qa(qu,n),f=Ya(qu,n),h=u.value===a,[m,g]=w.useState(s??""),[y,b]=w.useState(!1),S=nt(t,C=>{var A;return(A=f.itemRefCallback)==null?void 0:A.call(f,C,a,o)}),E=on(),_=w.useRef("touch"),N=()=>{o||(u.onValueChange(a),u.onOpenChange(!1))};if(a==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return x.jsx(o6,{scope:n,value:a,disabled:o,textId:E,isSelected:h,onItemTextChange:w.useCallback(C=>{g(A=>A||((C==null?void 0:C.textContent)??"").trim())},[]),children:x.jsx(Ad.ItemSlot,{scope:n,value:a,disabled:o,textValue:m,children:x.jsx(Ie.div,{role:"option","aria-labelledby":E,"data-highlighted":y?"":void 0,"aria-selected":h&&y,"data-state":h?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...c,ref:S,onFocus:Be(c.onFocus,()=>b(!0)),onBlur:Be(c.onBlur,()=>b(!1)),onClick:Be(c.onClick,()=>{_.current!=="mouse"&&N()}),onPointerUp:Be(c.onPointerUp,()=>{_.current==="mouse"&&N()}),onPointerDown:Be(c.onPointerDown,C=>{_.current=C.pointerType}),onPointerMove:Be(c.onPointerMove,C=>{var A;_.current=C.pointerType,o?(A=f.onItemLeave)==null||A.call(f):_.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Be(c.onPointerLeave,C=>{var A;C.currentTarget===document.activeElement&&((A=f.onItemLeave)==null||A.call(f))}),onKeyDown:Be(c.onKeyDown,C=>{var k;((k=f.searchRef)==null?void 0:k.current)!==""&&C.key===" "||(YI.includes(C.key)&&N(),C.key===" "&&C.preventDefault())})})})})});FR.displayName=qu;var il="SelectItemText",UR=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:o,...s}=e,c=qa(il,n),u=Ya(il,n),f=GR(il,n),h=ZI(il,n),[m,g]=w.useState(null),y=nt(t,N=>g(N),f.onItemTextChange,N=>{var C;return(C=u.itemTextRefCallback)==null?void 0:C.call(u,N,f.value,f.disabled)}),b=m==null?void 0:m.textContent,S=w.useMemo(()=>x.jsx("option",{value:f.value,disabled:f.disabled,children:b},f.value),[f.disabled,f.value,b]),{onNativeOptionAdd:E,onNativeOptionRemove:_}=h;return sn(()=>(E(S),()=>_(S)),[E,_,S]),x.jsxs(x.Fragment,{children:[x.jsx(Ie.span,{id:f.textId,...s,ref:y}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?xl.createPortal(s.children,c.valueNode):null]})});UR.displayName=il;var BR="SelectItemIndicator",IR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return GR(BR,n).isSelected?x.jsx(Ie.span,{"aria-hidden":!0,...a,ref:t}):null});IR.displayName=BR;var Ym="SelectScrollUpButton",HR=w.forwardRef((e,t)=>{const n=Ya(Ym,e.__scopeSelect),a=mv(Ym,e.__scopeSelect),[o,s]=w.useState(!1),c=nt(t,a.onScrollButtonChange);return sn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=f.scrollTop>0;s(h)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),o?x.jsx(VR,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});HR.displayName=Ym;var Wm="SelectScrollDownButton",$R=w.forwardRef((e,t)=>{const n=Ya(Wm,e.__scopeSelect),a=mv(Wm,e.__scopeSelect),[o,s]=w.useState(!1),c=nt(t,a.onScrollButtonChange);return sn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=f.scrollHeight-f.clientHeight,m=Math.ceil(f.scrollTop)f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),o?x.jsx(VR,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});$R.displayName=Wm;var VR=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:a,...o}=e,s=Ya("SelectScrollButton",n),c=w.useRef(null),u=Dd(n),f=w.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return w.useEffect(()=>()=>f(),[f]),sn(()=>{var m;const h=u().find(g=>g.ref.current===document.activeElement);(m=h==null?void 0:h.ref.current)==null||m.scrollIntoView({block:"nearest"})},[u]),x.jsx(Ie.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Be(o.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(a,50))}),onPointerMove:Be(o.onPointerMove,()=>{var h;(h=s.onItemLeave)==null||h.call(s),c.current===null&&(c.current=window.setInterval(a,50))}),onPointerLeave:Be(o.onPointerLeave,()=>{f()})})}),s6="SelectSeparator",qR=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return x.jsx(Ie.div,{"aria-hidden":!0,...a,ref:t})});qR.displayName=s6;var Xm="SelectArrow",l6=w.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,o=kd(n),s=qa(Xm,n),c=Ya(Xm,n);return s.open&&c.position==="popper"?x.jsx(kg,{...o,...a,ref:t}):null});l6.displayName=Xm;function YR(e){return e===""||e===void 0}var WR=w.forwardRef((e,t)=>{const{value:n,...a}=e,o=w.useRef(null),s=nt(t,o),c=bT(n);return w.useEffect(()=>{const u=o.current,f=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==n&&m){const g=new Event("change",{bubbles:!0});m.call(u,n),u.dispatchEvent(g)}},[c,n]),x.jsx(Ng,{asChild:!0,children:x.jsx("select",{...a,ref:s,defaultValue:n})})});WR.displayName="BubbleSelect";function XR(e){const t=Zt(e),n=w.useRef(""),a=w.useRef(0),o=w.useCallback(c=>{const u=n.current+c;t(u),function f(h){n.current=h,window.clearTimeout(a.current),h!==""&&(a.current=window.setTimeout(()=>f(""),1e3))}(u)},[t]),s=w.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,o,s]}function KR(e,t,n){const o=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let c=c6(e,Math.max(s,0));o.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.textValue.toLowerCase().startsWith(o.toLowerCase()));return f!==n?f:void 0}function c6(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var u6=ER,ZR=_R,d6=TR,f6=RR,h6=AR,QR=DR,p6=jR,m6=zR,JR=PR,eA=FR,g6=UR,v6=IR,tA=HR,nA=$R,rA=qR;const $1=u6,V1=m6,q1=d6,Km=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(ZR,{ref:a,className:Oe("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,x.jsx(f6,{asChild:!0,children:x.jsx(og,{className:"h-4 w-4 opacity-50"})})]}));Km.displayName=ZR.displayName;const aA=w.forwardRef(({className:e,...t},n)=>x.jsx(tA,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(FE,{className:"h-4 w-4"})}));aA.displayName=tA.displayName;const iA=w.forwardRef(({className:e,...t},n)=>x.jsx(nA,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(og,{className:"h-4 w-4"})}));iA.displayName=nA.displayName;const Zm=w.forwardRef(({className:e,children:t,position:n="popper",...a},o)=>x.jsx(h6,{children:x.jsxs(QR,{ref:o,className:Oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...a,children:[x.jsx(aA,{}),x.jsx(p6,{className:Oe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),x.jsx(iA,{})]})}));Zm.displayName=QR.displayName;const y6=w.forwardRef(({className:e,...t},n)=>x.jsx(JR,{ref:n,className:Oe("py-1.5 pr-2 pl-8 text-sm font-semibold",e),...t}));y6.displayName=JR.displayName;const ta=w.forwardRef(({className:e,children:t,...n},a)=>x.jsxs(eA,{ref:a,className:Oe("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(v6,{children:x.jsx(ig,{className:"h-4 w-4"})})}),x.jsx(g6,{children:t})]}));ta.displayName=eA.displayName;const b6=w.forwardRef(({className:e,...t},n)=>x.jsx(rA,{ref:n,className:Oe("bg-muted -mx-1 my-1 h-px",e),...t}));b6.displayName=rA.displayName;function x6(){var n,a;const e=Ye(o=>o.querySettings),t=w.useCallback((o,s)=>{Ye.getState().updateQuerySettings({[o]:s})},[]);return x.jsxs(hl,{className:"flex shrink-0 flex-col",children:[x.jsxs(Gu,{className:"px-4 pt-4 pb-2",children:[x.jsx(pl,{children:"Parameters"}),x.jsx(Sd,{children:"Configure your query parameters"})]}),x.jsx(Fu,{className:"m-0 flex grow flex-col p-0 text-xs",children:x.jsx("div",{className:"relative size-full",children:x.jsxs("div",{className:"absolute inset-0 flex flex-col gap-2 overflow-auto px-2",children:[x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Query Mode",tooltip:"Select the retrieval strategy:\\n• Naive: Basic search without advanced techniques\\n• Local: Context-dependent information retrieval\\n• Global: Utilizes global knowledge base\\n• Hybrid: Combines local and global retrieval\\n• Mix: Integrates knowledge graph with vector retrieval",side:"left"}),x.jsxs($1,{value:e.mode,onValueChange:o=>t("mode",o),children:[x.jsx(Km,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:x.jsx(q1,{})}),x.jsx(Zm,{children:x.jsxs(V1,{children:[x.jsx(ta,{value:"naive",children:"Naive"}),x.jsx(ta,{value:"local",children:"Local"}),x.jsx(ta,{value:"global",children:"Global"}),x.jsx(ta,{value:"hybrid",children:"Hybrid"}),x.jsx(ta,{value:"mix",children:"Mix"})]})})]})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Response Format",tooltip:"Defines the response format. Examples:\\n• Multiple Paragraphs\\n• Single Paragraph\\n• Bullet Points",side:"left"}),x.jsxs($1,{value:e.response_type,onValueChange:o=>t("response_type",o),children:[x.jsx(Km,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:x.jsx(q1,{})}),x.jsx(Zm,{children:x.jsxs(V1,{children:[x.jsx(ta,{value:"Multiple Paragraphs",children:"Multiple Paragraphs"}),x.jsx(ta,{value:"Single Paragraph",children:"Single Paragraph"}),x.jsx(ta,{value:"Bullet Points",children:"Bullet Points"})]})})]})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Top K Results",tooltip:"Number of top items to retrieve. Represents entities in 'local' mode and relationships in 'global' mode",side:"left"}),x.jsx(To,{id:"top_k",stepper:1,value:e.top_k,onValueChange:o=>t("top_k",o),min:1,placeholder:"Number of results"})]}),x.jsxs(x.Fragment,{children:[x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Max Tokens for Text Unit",tooltip:"Maximum number of tokens allowed for each retrieved text chunk",side:"left"}),x.jsx(To,{id:"max_token_for_text_unit",stepper:500,value:e.max_token_for_text_unit,onValueChange:o=>t("max_token_for_text_unit",o),min:1,placeholder:"Max tokens for text unit"})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{text:"Max Tokens for Global Context",tooltip:"Maximum number of tokens allocated for relationship descriptions in global retrieval",side:"left"}),x.jsx(To,{id:"max_token_for_global_context",stepper:500,value:e.max_token_for_global_context,onValueChange:o=>t("max_token_for_global_context",o),min:1,placeholder:"Max tokens for global context"})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Max Tokens for Local Context",tooltip:"Maximum number of tokens allocated for entity descriptions in local retrieval",side:"left"}),x.jsx(To,{id:"max_token_for_local_context",stepper:500,value:e.max_token_for_local_context,onValueChange:o=>t("max_token_for_local_context",o),min:1,placeholder:"Max tokens for local context"})]})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"History Turns",tooltip:"Number of complete conversation turns (user-assistant pairs) to consider in the response context",side:"left"}),x.jsx(To,{className:"!border-input",id:"history_turns",stepper:1,type:"text",value:e.history_turns,onValueChange:o=>t("history_turns",o),min:0,placeholder:"Number of history turns"})]}),x.jsxs(x.Fragment,{children:[x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"High-Level Keywords",tooltip:"List of high-level keywords to prioritize in retrieval. Separate with commas",side:"left"}),x.jsx(Ai,{id:"hl_keywords",type:"text",value:(n=e.hl_keywords)==null?void 0:n.join(", "),onChange:o=>{const s=o.target.value.split(",").map(c=>c.trim()).filter(c=>c!=="");t("hl_keywords",s)},placeholder:"Enter keywords"})]}),x.jsxs(x.Fragment,{children:[x.jsx(bn,{className:"ml-1",text:"Low-Level Keywords",tooltip:"List of low-level keywords to refine retrieval focus. Separate with commas",side:"left"}),x.jsx(Ai,{id:"ll_keywords",type:"text",value:(a=e.ll_keywords)==null?void 0:a.join(", "),onChange:o=>{const s=o.target.value.split(",").map(c=>c.trim()).filter(c=>c!=="");t("ll_keywords",s)},placeholder:"Enter keywords"})]})]}),x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(bn,{className:"ml-1",text:"Only Need Context",tooltip:"If True, only returns the retrieved context without generating a response",side:"left"}),x.jsx("div",{className:"grow"}),x.jsx(sl,{className:"mr-1 cursor-pointer",id:"only_need_context",checked:e.only_need_context,onCheckedChange:o=>t("only_need_context",o)})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(bn,{className:"ml-1",text:"Only Need Prompt",tooltip:"If True, only returns the generated prompt without producing a response",side:"left"}),x.jsx("div",{className:"grow"}),x.jsx(sl,{className:"mr-1 cursor-pointer",id:"only_need_prompt",checked:e.only_need_prompt,onCheckedChange:o=>t("only_need_prompt",o)})]}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(bn,{className:"ml-1",text:"Stream Response",tooltip:"If True, enables streaming output for real-time responses",side:"left"}),x.jsx("div",{className:"grow"}),x.jsx(sl,{className:"mr-1 cursor-pointer",id:"stream",checked:e.stream,onCheckedChange:o=>t("stream",o)})]})]})]})})})]})}function w6(){const[e,t]=w.useState(()=>Ye.getState().retrievalHistory||[]),[n,a]=w.useState(""),[o,s]=w.useState(!1),c=w.useRef(null),u=w.useCallback(()=>{var g;(g=c.current)==null||g.scrollIntoView({behavior:"smooth"})},[]),f=w.useCallback(async g=>{if(g.preventDefault(),!n.trim()||o)return;const y={content:n,role:"user"},b={content:"",role:"assistant"},S=[...e];t([...S,y,b]),a(""),s(!0);const E=C=>{b.content+=C,t(A=>{const k=[...A],D=k[k.length-1];return D.role==="assistant"&&(D.content=b.content),k})},_=Ye.getState(),N={..._.querySettings,query:y.content,conversation_history:S};try{if(_.querySettings.stream)await xO(N,E);else{const C=await bO(N);E(C.response)}}catch(C){E(`Error: Failed to get response +${Sr(C)}`)}finally{s(!1),Ye.getState().setRetrievalHistory([...S,y,b])}},[n,o,e,t]),h=sv(e,100);w.useEffect(()=>u(),[h,u]);const m=w.useCallback(()=>{t([]),Ye.getState().setRetrievalHistory([])},[t]);return x.jsxs("div",{className:"flex size-full gap-2 px-2 pb-12",children:[x.jsxs("div",{className:"flex grow flex-col gap-4",children:[x.jsx("div",{className:"relative grow",children:x.jsx("div",{className:"bg-primary-foreground/60 absolute inset-0 flex flex-col overflow-auto rounded-lg border p-2",children:x.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[e.length===0?x.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center text-lg",children:"Start a retrieval by typing your query below"}):e.map((g,y)=>x.jsx("div",{className:`flex ${g.role==="user"?"justify-end":"justify-start"}`,children:x.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2 ${g.role==="user"?"bg-primary text-primary-foreground":"bg-muted"}`,children:[x.jsx("pre",{className:"break-words whitespace-pre-wrap",children:g.content}),g.content.length===0&&x.jsx(YO,{className:"animate-spin duration-2000"})]})},y)),x.jsx("div",{ref:c,className:"pb-1"})]})})}),x.jsxs("form",{onSubmit:f,className:"flex shrink-0 items-center gap-2",children:[x.jsxs(wt,{type:"button",variant:"outline",onClick:m,disabled:o,size:"sm",children:[x.jsx(UE,{}),"Clear"]}),x.jsx(Ai,{className:"flex-1",value:n,onChange:g=>a(g.target.value),placeholder:"Type your query...",disabled:o}),x.jsxs(wt,{type:"submit",variant:"default",disabled:o,size:"sm",children:[x.jsx(cj,{}),"Send"]})]})]}),x.jsx(x6,{})]})}function E6(){return x.jsx("iframe",{src:iE+"/docs",className:"size-full"})}function S6(){const e=En.use.message(),t=Ye.use.enableHealthCheck(),[n]=w.useState(()=>Ye.getState().currentTab),[a,o]=w.useState(!1);w.useEffect(()=>{if(!t)return;En.getState().check();const c=setInterval(async()=>{await En.getState().check()},Ok*1e3);return()=>clearInterval(c)},[t]);const s=w.useCallback(c=>Ye.getState().setCurrentTab(c),[]);return w.useEffect(()=>{if(e&&(e.includes(ME)||e.includes(PE))){o(!0);return}o(!1)},[e,o]),x.jsx(Mk,{children:x.jsxs("main",{className:"flex h-screen w-screen overflow-x-hidden",children:[x.jsxs(GP,{defaultValue:n,className:"!m-0 flex grow flex-col !p-0",onValueChange:s,children:[x.jsx(UP,{}),x.jsxs("div",{className:"relative grow",children:[x.jsx(rl,{value:"documents",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(wI,{})}),x.jsx(rl,{value:"knowledge-graph",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(VU,{})}),x.jsx(rl,{value:"retrieval",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(w6,{})}),x.jsx(rl,{value:"api",className:"absolute top-0 right-0 bottom-0 left-0",children:x.jsx(E6,{})})]})]}),t&&x.jsx(xP,{}),e!==null&&!a&&x.jsx(Ej,{}),a&&x.jsx(oP,{}),x.jsx(iP,{})]})})}DD.createRoot(document.getElementById("root")).render(x.jsx(w.StrictMode,{children:x.jsx(S6,{})})); diff --git a/lightrag/api/webui/assets/index-CF-pcoIl.js b/lightrag/api/webui/assets/index-CF-pcoIl.js deleted file mode 100644 index 3baf5f0c..00000000 --- a/lightrag/api/webui/assets/index-CF-pcoIl.js +++ /dev/null @@ -1,967 +0,0 @@ -var Xx=Object.defineProperty;var Zx=(r,n,i)=>n in r?Xx(r,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[n]=i;var hr=(r,n,i)=>Zx(r,typeof n!="symbol"?n+"":n,i);function Wx(r,n){for(var i=0;ia[s]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function i(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(s){if(s.ep)return;s.ep=!0;const l=i(s);fetch(s.href,l)}})();function on(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Kx(r){if(r.__esModule)return r;var n=r.default;if(typeof n=="function"){var i=function a(){return this instanceof a?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};i.prototype=n.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(r).forEach(function(a){var s=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(i,a,s.get?s:{enumerable:!0,get:function(){return r[a]}})}),i}var jf={exports:{}},Ho={};/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Vv;function Qx(){if(Vv)return Ho;Vv=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(a,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var f in s)f!=="key"&&(l[f]=s[f])}else l=s;return s=l.ref,{$$typeof:r,type:a,key:c,ref:s!==void 0?s:null,props:l}}return Ho.Fragment=n,Ho.jsx=i,Ho.jsxs=i,Ho}var Iv;function Jx(){return Iv||(Iv=1,jf.exports=Qx()),jf.exports}var A=Jx(),Uf={exports:{}},Ge={};/** - * @license React - * react.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Yv;function e_(){if(Yv)return Ge;Yv=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),v=Symbol.iterator;function y(G){return G===null||typeof G!="object"?null:(G=v&&G[v]||G["@@iterator"],typeof G=="function"?G:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,E={};function T(G,P,k){this.props=G,this.context=P,this.refs=E,this.updater=k||b}T.prototype.isReactComponent={},T.prototype.setState=function(G,P){if(typeof G!="object"&&typeof G!="function"&&G!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,G,P,"setState")},T.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function M(){}M.prototype=T.prototype;function N(G,P,k){this.props=G,this.context=P,this.refs=E,this.updater=k||b}var L=N.prototype=new M;L.constructor=N,x(L,T.prototype),L.isPureReactComponent=!0;var C=Array.isArray,R={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function _(G,P,k,V,Q,re){return k=re.ref,{$$typeof:r,type:G,key:P,ref:k!==void 0?k:null,props:re}}function $(G,P){return _(G.type,P,void 0,void 0,void 0,G.props)}function z(G){return typeof G=="object"&&G!==null&&G.$$typeof===r}function F(G){var P={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(k){return P[k]})}var Y=/\/+/g;function I(G,P){return typeof G=="object"&&G!==null&&G.key!=null?F(""+G.key):P.toString(36)}function j(){}function J(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(j,j):(G.status="pending",G.then(function(P){G.status==="pending"&&(G.status="fulfilled",G.value=P)},function(P){G.status==="pending"&&(G.status="rejected",G.reason=P)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function ae(G,P,k,V,Q){var re=typeof G;(re==="undefined"||re==="boolean")&&(G=null);var de=!1;if(G===null)de=!0;else switch(re){case"bigint":case"string":case"number":de=!0;break;case"object":switch(G.$$typeof){case r:case n:de=!0;break;case m:return de=G._init,ae(de(G._payload),P,k,V,Q)}}if(de)return Q=Q(G),de=V===""?"."+I(G,0):V,C(Q)?(k="",de!=null&&(k=de.replace(Y,"$&/")+"/"),ae(Q,P,k,"",function(xe){return xe})):Q!=null&&(z(Q)&&(Q=$(Q,k+(Q.key==null||G&&G.key===Q.key?"":(""+Q.key).replace(Y,"$&/")+"/")+de)),P.push(Q)),1;de=0;var ge=V===""?".":V+":";if(C(G))for(var le=0;le>>1,G=H[se];if(0>>1;ses(V,D))Qs(re,V)?(H[se]=re,H[Q]=D,se=Q):(H[se]=V,H[k]=D,se=k);else if(Qs(re,D))H[se]=re,H[Q]=D,se=Q;else break e}}return U}function s(H,U){var D=H.sortIndex-U.sortIndex;return D!==0?D:H.id-U.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;r.unstable_now=function(){return l.now()}}else{var c=Date,f=c.now();r.unstable_now=function(){return c.now()-f}}var d=[],g=[],m=1,v=null,y=3,b=!1,x=!1,E=!1,T=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function L(H){for(var U=i(g);U!==null;){if(U.callback===null)a(g);else if(U.startTime<=H)a(g),U.sortIndex=U.expirationTime,n(d,U);else break;U=i(g)}}function C(H){if(E=!1,L(H),!x)if(i(d)!==null)x=!0,J();else{var U=i(g);U!==null&&ae(C,U.startTime-H)}}var R=!1,B=-1,_=5,$=-1;function z(){return!(r.unstable_now()-$<_)}function F(){if(R){var H=r.unstable_now();$=H;var U=!0;try{e:{x=!1,E&&(E=!1,M(B),B=-1),b=!0;var D=y;try{t:{for(L(H),v=i(d);v!==null&&!(v.expirationTime>H&&z());){var se=v.callback;if(typeof se=="function"){v.callback=null,y=v.priorityLevel;var G=se(v.expirationTime<=H);if(H=r.unstable_now(),typeof G=="function"){v.callback=G,L(H),U=!0;break t}v===i(d)&&a(d),L(H)}else a(d);v=i(d)}if(v!==null)U=!0;else{var P=i(g);P!==null&&ae(C,P.startTime-H),U=!1}}break e}finally{v=null,y=D,b=!1}U=void 0}}finally{U?Y():R=!1}}}var Y;if(typeof N=="function")Y=function(){N(F)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,j=I.port2;I.port1.onmessage=F,Y=function(){j.postMessage(null)}}else Y=function(){T(F,0)};function J(){R||(R=!0,Y())}function ae(H,U){B=T(function(){H(r.unstable_now())},U)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(H){H.callback=null},r.unstable_continueExecution=function(){x||b||(x=!0,J())},r.unstable_forceFrameRate=function(H){0>H||125se?(H.sortIndex=D,n(g,H),i(d)===null&&H===i(g)&&(E?(M(B),B=-1):E=!0,ae(C,D-se))):(H.sortIndex=G,n(d,H),x||b||(x=!0,J())),H},r.unstable_shouldYield=z,r.unstable_wrapCallback=function(H){var U=y;return function(){var D=y;y=U;try{return H.apply(this,arguments)}finally{y=D}}}}(Hf)),Hf}var Wv;function r_(){return Wv||(Wv=1,Ff.exports=n_()),Ff.exports}var Pf={exports:{}},Ut={};/** - * @license React - * react-dom.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Kv;function i_(){if(Kv)return Ut;Kv=1;var r=du();function n(d){var g="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),Pf.exports=i_(),Pf.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Jv;function a_(){if(Jv)return Po;Jv=1;var r=r_(),n=du(),i=o0();function a(e){var t="https://react.dev/errors/"+e;if(1)":-1h||q[u]!==Z[h]){var oe=` -`+q[u].replace(" at new "," at ");return e.displayName&&oe.includes("")&&(oe=oe.replace("",e.displayName)),oe}while(1<=u&&0<=h);break}}}finally{J=!1,Error.prepareStackTrace=o}return(o=e?e.displayName||e.name:"")?j(o):""}function H(e){switch(e.tag){case 26:case 27:case 5:return j(e.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("SuspenseList");case 0:case 15:return e=ae(e.type,!1),e;case 11:return e=ae(e.type.render,!1),e;case 1:return e=ae(e.type,!0),e;default:return""}}function U(e){try{var t="";do t+=H(e),e=e.return;while(e);return t}catch(o){return` -Error generating stack: `+o.message+` -`+o.stack}}function D(e){var t=e,o=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(o=t.return),e=t.return;while(e)}return t.tag===3?o:null}function se(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function G(e){if(D(e)!==e)throw Error(a(188))}function P(e){var t=e.alternate;if(!t){if(t=D(e),t===null)throw Error(a(188));return t!==e?null:e}for(var o=e,u=t;;){var h=o.return;if(h===null)break;var p=h.alternate;if(p===null){if(u=h.return,u!==null){o=u;continue}break}if(h.child===p.child){for(p=h.child;p;){if(p===o)return G(h),e;if(p===u)return G(h),t;p=p.sibling}throw Error(a(188))}if(o.return!==u.return)o=h,u=p;else{for(var w=!1,O=h.child;O;){if(O===o){w=!0,o=h,u=p;break}if(O===u){w=!0,u=h,o=p;break}O=O.sibling}if(!w){for(O=p.child;O;){if(O===o){w=!0,o=p,u=h;break}if(O===u){w=!0,u=p,o=h;break}O=O.sibling}if(!w)throw Error(a(189))}}if(o.alternate!==u)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?e:t}function k(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=k(e),t!==null)return t;e=e.sibling}return null}var V=Array.isArray,Q=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},de=[],ge=-1;function le(e){return{current:e}}function xe(e){0>ge||(e.current=de[ge],de[ge]=null,ge--)}function pe(e,t){ge++,de[ge]=e.current,e.current=t}var Ae=le(null),Te=le(null),Le=le(null),ve=le(null);function he(e,t){switch(pe(Le,t),pe(Te,e),pe(Ae,null),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?wv(t):0;break;default:if(e=e===8?t.parentNode:t,t=e.tagName,e=e.namespaceURI)e=wv(e),t=Ev(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}xe(Ae),pe(Ae,t)}function K(){xe(Ae),xe(Te),xe(Le)}function Re(e){e.memoizedState!==null&&pe(ve,e);var t=Ae.current,o=Ev(t,e.type);t!==o&&(pe(Te,e),pe(Ae,o))}function Ve(e){Te.current===e&&(xe(Ae),xe(Te)),ve.current===e&&(xe(ve),Mo._currentValue=re)}var be=Object.prototype.hasOwnProperty,Se=r.unstable_scheduleCallback,ne=r.unstable_cancelCallback,et=r.unstable_shouldYield,ut=r.unstable_requestPaint,Ie=r.unstable_now,Et=r.unstable_getCurrentPriorityLevel,rt=r.unstable_ImmediatePriority,ct=r.unstable_UserBlockingPriority,Gt=r.unstable_NormalPriority,Ht=r.unstable_LowPriority,sn=r.unstable_IdlePriority,xn=r.log,ii=r.unstable_setDisableYieldValue,Mn=null,ft=null;function ji(e){if(ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(Mn,e,void 0,(e.current.flags&128)===128)}catch{}}function Zt(e){if(typeof xn=="function"&&ii(e),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(Mn,e)}catch{}}var Wt=Math.clz32?Math.clz32:G1,N1=Math.log,z1=Math.LN2;function G1(e){return e>>>=0,e===0?32:31-(N1(e)/z1|0)|0}var gs=128,ps=4194304;function ai(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ms(e,t){var o=e.pendingLanes;if(o===0)return 0;var u=0,h=e.suspendedLanes,p=e.pingedLanes,w=e.warmLanes;e=e.finishedLanes!==0;var O=o&134217727;return O!==0?(o=O&~h,o!==0?u=ai(o):(p&=O,p!==0?u=ai(p):e||(w=O&~w,w!==0&&(u=ai(w))))):(O=o&~h,O!==0?u=ai(O):p!==0?u=ai(p):e||(w=o&~w,w!==0&&(u=ai(w)))),u===0?0:t!==0&&t!==u&&!(t&h)&&(h=u&-u,w=t&-t,h>=w||h===32&&(w&4194176)!==0)?t:u}function Va(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function M1(e,t){switch(e){case 1:case 2:case 4:case 8:return t+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function dg(){var e=gs;return gs<<=1,!(gs&4194176)&&(gs=128),e}function hg(){var e=ps;return ps<<=1,!(ps&62914560)&&(ps=4194304),e}function ku(e){for(var t=[],o=0;31>o;o++)t.push(e);return t}function Ia(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function j1(e,t,o,u,h,p){var w=e.pendingLanes;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=o,e.entangledLanes&=o,e.errorRecoveryDisabledLanes&=o,e.shellSuspendCounter=0;var O=e.entanglements,q=e.expirationTimes,Z=e.hiddenUpdates;for(o=w&~o;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),H1=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Eg={},Sg={};function P1(e){return be.call(Sg,e)?!0:be.call(Eg,e)?!1:H1.test(e)?Sg[e]=!0:(Eg[e]=!0,!1)}function vs(e,t,o){if(P1(t))if(o===null)e.removeAttribute(t);else{switch(typeof o){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var u=t.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+o)}}function ys(e,t,o){if(o===null)e.removeAttribute(t);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+o)}}function Kn(e,t,o,u){if(u===null)e.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(o);return}e.setAttributeNS(t,o,""+u)}}function ln(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $1(e){var t=xg(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),u=""+e[t];if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,p=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return h.call(this)},set:function(w){u=""+w,p.call(this,w)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return u},setValue:function(w){u=""+w},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bs(e){e._valueTracker||(e._valueTracker=$1(e))}function _g(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var o=t.getValue(),u="";return e&&(u=xg(e)?e.checked?"true":"false":e.value),e=u,e!==o?(t.setValue(e),!0):!1}function ws(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var q1=/[\n"\\]/g;function un(e){return e.replace(q1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function zu(e,t,o,u,h,p,w,O){e.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.type=w:e.removeAttribute("type"),t!=null?w==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ln(t)):e.value!==""+ln(t)&&(e.value=""+ln(t)):w!=="submit"&&w!=="reset"||e.removeAttribute("value"),t!=null?Gu(e,w,ln(t)):o!=null?Gu(e,w,ln(o)):u!=null&&e.removeAttribute("value"),h==null&&p!=null&&(e.defaultChecked=!!p),h!=null&&(e.checked=h&&typeof h!="function"&&typeof h!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?e.name=""+ln(O):e.removeAttribute("name")}function Tg(e,t,o,u,h,p,w,O){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.type=p),t!=null||o!=null){if(!(p!=="submit"&&p!=="reset"||t!=null))return;o=o!=null?""+ln(o):"",t=t!=null?""+ln(t):o,O||t===e.value||(e.value=t),e.defaultValue=t}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,e.checked=O?e.checked:!!u,e.defaultChecked=!!u,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(e.name=w)}function Gu(e,t,o){t==="number"&&ws(e.ownerDocument)===e||e.defaultValue===""+o||(e.defaultValue=""+o)}function Pi(e,t,o,u){if(e=e.options,t){t={};for(var h=0;h=Ja),Ug=" ",Bg=!1;function Fg(e,t){switch(e){case"keyup":return yS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ii=!1;function wS(e,t){switch(e){case"compositionend":return Hg(t);case"keypress":return t.which!==32?null:(Bg=!0,Ug);case"textInput":return e=t.data,e===Ug&&Bg?null:e;default:return null}}function ES(e,t){if(Ii)return e==="compositionend"||!Iu&&Fg(e,t)?(e=Lg(),Ss=Hu=xr=null,Ii=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:o,offset:t-e};e=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Zg(o)}}function Kg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ws(e.document);t instanceof e.HTMLIFrameElement;){try{var o=typeof t.contentWindow.location.href=="string"}catch{o=!1}if(o)e=t.contentWindow;else break;t=ws(e.document)}return t}function Zu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function DS(e,t){var o=Qg(t);t=e.focusedElem;var u=e.selectionRange;if(o!==t&&t&&t.ownerDocument&&Kg(t.ownerDocument.documentElement,t)){if(u!==null&&Zu(t)){if(e=u.start,o=u.end,o===void 0&&(o=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(o,t.value.length);else if(o=(e=t.ownerDocument||document)&&e.defaultView||window,o.getSelection){o=o.getSelection();var h=t.textContent.length,p=Math.min(u.start,h);u=u.end===void 0?p:Math.min(u.end,h),!o.extend&&p>u&&(h=u,u=p,p=h),h=Wg(t,p);var w=Wg(t,u);h&&w&&(o.rangeCount!==1||o.anchorNode!==h.node||o.anchorOffset!==h.offset||o.focusNode!==w.node||o.focusOffset!==w.offset)&&(e=e.createRange(),e.setStart(h.node,h.offset),o.removeAllRanges(),p>u?(o.addRange(e),o.extend(w.node,w.offset)):(e.setEnd(w.node,w.offset),o.addRange(e)))}}for(e=[],o=t;o=o.parentNode;)o.nodeType===1&&e.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,Yi=null,Wu=null,ro=null,Ku=!1;function Jg(e,t,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Ku||Yi==null||Yi!==ws(u)||(u=Yi,"selectionStart"in u&&Zu(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),ro&&no(ro,u)||(ro=u,u=ul(Wu,"onSelect"),0>=w,h-=w,Qn=1<<32-Wt(t)+h|o<Ne?(Tt=Oe,Oe=null):Tt=Oe.sibling;var qe=te(W,Oe,ee[Ne],ue);if(qe===null){Oe===null&&(Oe=Tt);break}e&&Oe&&qe.alternate===null&&t(W,Oe),X=p(qe,X,Ne),je===null?Ce=qe:je.sibling=qe,je=qe,Oe=Tt}if(Ne===ee.length)return o(W,Oe),$e&&di(W,Ne),Ce;if(Oe===null){for(;NeNe?(Tt=Oe,Oe=null):Tt=Oe.sibling;var $r=te(W,Oe,qe.value,ue);if($r===null){Oe===null&&(Oe=Tt);break}e&&Oe&&$r.alternate===null&&t(W,Oe),X=p($r,X,Ne),je===null?Ce=$r:je.sibling=$r,je=$r,Oe=Tt}if(qe.done)return o(W,Oe),$e&&di(W,Ne),Ce;if(Oe===null){for(;!qe.done;Ne++,qe=ee.next())qe=ce(W,qe.value,ue),qe!==null&&(X=p(qe,X,Ne),je===null?Ce=qe:je.sibling=qe,je=qe);return $e&&di(W,Ne),Ce}for(Oe=u(Oe);!qe.done;Ne++,qe=ee.next())qe=ie(Oe,W,Ne,qe.value,ue),qe!==null&&(e&&qe.alternate!==null&&Oe.delete(qe.key===null?Ne:qe.key),X=p(qe,X,Ne),je===null?Ce=qe:je.sibling=qe,je=qe);return e&&Oe.forEach(function(Yx){return t(W,Yx)}),$e&&di(W,Ne),Ce}function lt(W,X,ee,ue){if(typeof ee=="object"&&ee!==null&&ee.type===d&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case c:e:{for(var Ce=ee.key;X!==null;){if(X.key===Ce){if(Ce=ee.type,Ce===d){if(X.tag===7){o(W,X.sibling),ue=h(X,ee.props.children),ue.return=W,W=ue;break e}}else if(X.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===N&&mp(Ce)===X.type){o(W,X.sibling),ue=h(X,ee.props),co(ue,ee),ue.return=W,W=ue;break e}o(W,X);break}else t(W,X);X=X.sibling}ee.type===d?(ue=xi(ee.props.children,W.mode,ue,ee.key),ue.return=W,W=ue):(ue=Js(ee.type,ee.key,ee.props,null,W.mode,ue),co(ue,ee),ue.return=W,W=ue)}return w(W);case f:e:{for(Ce=ee.key;X!==null;){if(X.key===Ce)if(X.tag===4&&X.stateNode.containerInfo===ee.containerInfo&&X.stateNode.implementation===ee.implementation){o(W,X.sibling),ue=h(X,ee.children||[]),ue.return=W,W=ue;break e}else{o(W,X);break}else t(W,X);X=X.sibling}ue=Jc(ee,W.mode,ue),ue.return=W,W=ue}return w(W);case N:return Ce=ee._init,ee=Ce(ee._payload),lt(W,X,ee,ue)}if(V(ee))return De(W,X,ee,ue);if(B(ee)){if(Ce=B(ee),typeof Ce!="function")throw Error(a(150));return ee=Ce.call(ee),ze(W,X,ee,ue)}if(typeof ee.then=="function")return lt(W,X,zs(ee),ue);if(ee.$$typeof===b)return lt(W,X,Ws(W,ee),ue);Gs(W,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,X!==null&&X.tag===6?(o(W,X.sibling),ue=h(X,ee),ue.return=W,W=ue):(o(W,X),ue=Qc(ee,W.mode,ue),ue.return=W,W=ue),w(W)):o(W,X)}return function(W,X,ee,ue){try{uo=0;var Ce=lt(W,X,ee,ue);return Ji=null,Ce}catch(Oe){if(Oe===so)throw Oe;var je=vn(29,Oe,null,W.mode);return je.lanes=ue,je.return=W,je}finally{}}}var gi=vp(!0),yp=vp(!1),ea=le(null),Ms=le(0);function bp(e,t){e=cr,pe(Ms,e),pe(ea,t),cr=e|t.baseLanes}function ac(){pe(Ms,cr),pe(ea,ea.current)}function oc(){cr=Ms.current,xe(ea),xe(Ms)}var gn=le(null),Un=null;function Tr(e){var t=e.alternate;pe(vt,vt.current&1),pe(gn,e),Un===null&&(t===null||ea.current!==null||t.memoizedState!==null)&&(Un=e)}function wp(e){if(e.tag===22){if(pe(vt,vt.current),pe(gn,e),Un===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Un=e)}}else Cr()}function Cr(){pe(vt,vt.current),pe(gn,gn.current)}function er(e){xe(gn),Un===e&&(Un=null),xe(vt)}var vt=le(0);function js(e){for(var t=e;t!==null;){if(t.tag===13){var o=t.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||o.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var zS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(o,u){e.push(u)}};this.abort=function(){t.aborted=!0,e.forEach(function(o){return o()})}},GS=r.unstable_scheduleCallback,MS=r.unstable_NormalPriority,yt={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sc(){return{controller:new zS,data:new Map,refCount:0}}function fo(e){e.refCount--,e.refCount===0&&GS(MS,function(){e.controller.abort()})}var ho=null,lc=0,ta=0,na=null;function jS(e,t){if(ho===null){var o=ho=[];lc=0,ta=pf(),na={status:"pending",value:void 0,then:function(u){o.push(u)}}}return lc++,t.then(Ep,Ep),t}function Ep(){if(--lc===0&&ho!==null){na!==null&&(na.status="fulfilled");var e=ho;ho=null,ta=0,na=null;for(var t=0;tp?p:8;var w=z.T,O={};z.T=O,Tc(e,!1,t,o);try{var q=h(),Z=z.S;if(Z!==null&&Z(O,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var oe=US(q,u);mo(e,t,oe,tn(e))}else mo(e,t,u,tn(e))}catch(ce){mo(e,t,{then:function(){},status:"rejected",reason:ce},tn())}finally{Q.p=p,z.T=w}}function $S(){}function xc(e,t,o,u){if(e.tag!==5)throw Error(a(476));var h=Qp(e).queue;Kp(e,h,t,re,o===null?$S:function(){return Jp(e),o(u)})}function Qp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:re},next:null};var o={};return t.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:o},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Jp(e){var t=Qp(e).next.queue;mo(e,t,{},tn())}function _c(){return jt(Mo)}function em(){return pt().memoizedState}function tm(){return pt().memoizedState}function qS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var o=tn();e=kr(o);var u=Lr(t,e,o);u!==null&&(Ft(u,t,o),bo(u,t,o)),t={cache:sc()},e.payload=t;return}t=t.return}}function VS(e,t,o){var u=tn();o={lane:u,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},Is(e)?rm(t,o):(o=ec(e,t,o,u),o!==null&&(Ft(o,e,u),im(o,t,u)))}function nm(e,t,o){var u=tn();mo(e,t,o,u)}function mo(e,t,o,u){var h={lane:u,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(Is(e))rm(t,h);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var w=t.lastRenderedState,O=p(w,o);if(h.hasEagerState=!0,h.eagerState=O,Kt(O,w))return Ds(e,t,h,0),tt===null&&Rs(),!1}catch{}finally{}if(o=ec(e,t,h,u),o!==null)return Ft(o,e,u),im(o,t,u),!0}return!1}function Tc(e,t,o,u){if(u={lane:2,revertLane:pf(),action:u,hasEagerState:!1,eagerState:null,next:null},Is(e)){if(t)throw Error(a(479))}else t=ec(e,o,u,2),t!==null&&Ft(t,e,2)}function Is(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function rm(e,t){ra=Bs=!0;var o=e.pending;o===null?t.next=t:(t.next=o.next,o.next=t),e.pending=t}function im(e,t,o){if(o&4194176){var u=t.lanes;u&=e.pendingLanes,o|=u,t.lanes=o,pg(e,o)}}var Bn={readContext:jt,use:Ps,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useLayoutEffect:dt,useInsertionEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useSyncExternalStore:dt,useId:dt};Bn.useCacheRefresh=dt,Bn.useMemoCache=dt,Bn.useHostTransitionStatus=dt,Bn.useFormState=dt,Bn.useActionState=dt,Bn.useOptimistic=dt;var vi={readContext:jt,use:Ps,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:jt,useEffect:$p,useImperativeHandle:function(e,t,o){o=o!=null?o.concat([e]):null,qs(4194308,4,Ip.bind(null,t,e),o)},useLayoutEffect:function(e,t){return qs(4194308,4,e,t)},useInsertionEffect:function(e,t){qs(4,2,e,t)},useMemo:function(e,t){var o=qt();t=t===void 0?null:t;var u=e();if(mi){Zt(!0);try{e()}finally{Zt(!1)}}return o.memoizedState=[u,t],u},useReducer:function(e,t,o){var u=qt();if(o!==void 0){var h=o(t);if(mi){Zt(!0);try{o(t)}finally{Zt(!1)}}}else h=t;return u.memoizedState=u.baseState=h,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:h},u.queue=e,e=e.dispatch=VS.bind(null,Me,e),[u.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:function(e){e=yc(e);var t=e.queue,o=nm.bind(null,Me,t);return t.dispatch=o,[e.memoizedState,o]},useDebugValue:Ec,useDeferredValue:function(e,t){var o=qt();return Sc(o,e,t)},useTransition:function(){var e=yc(!1);return e=Kp.bind(null,Me,e.queue,!0,!1),qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,o){var u=Me,h=qt();if($e){if(o===void 0)throw Error(a(407));o=o()}else{if(o=t(),tt===null)throw Error(a(349));He&60||Ap(u,t,o)}h.memoizedState=o;var p={value:o,getSnapshot:t};return h.queue=p,$p(Dp.bind(null,u,p,e),[e]),u.flags|=2048,aa(9,Rp.bind(null,u,p,o,t),{destroy:void 0},null),o},useId:function(){var e=qt(),t=tt.identifierPrefix;if($e){var o=Jn,u=Qn;o=(u&~(1<<32-Wt(u)-1)).toString(32)+o,t=":"+t+"R"+o,o=Fs++,0 title"))),kt(p,u,o),p[Mt]=e,St(p),u=p;break e;case"link":var w=kv("link","href",h).get(u+(o.href||""));if(w){for(var O=0;O<\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof u.is=="string"?h.createElement("select",{is:u.is}):h.createElement("select"),u.multiple?e.multiple=!0:u.size&&(e.size=u.size);break;default:e=typeof u.is=="string"?h.createElement(o,{is:u.is}):h.createElement(o)}}e[Mt]=t,e[Pt]=u;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)e.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=e;e:switch(kt(e,o,u),o){case"button":case"input":case"select":case"textarea":e=!!u.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&lr(t)}}return it(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==u&&lr(t);else{if(typeof u!="string"&&t.stateNode===null)throw Error(a(166));if(e=Le.current,io(t)){if(e=t.stateNode,o=t.memoizedProps,u=null,h=Bt,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}e[Mt]=t,e=!!(e.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||bv(e.nodeValue,o)),e||hi(t)}else e=fl(e).createTextNode(u),e[Mt]=t,t.stateNode=e}return it(t),null;case 13:if(u=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(h=io(t),u!==null&&u.dehydrated!==null){if(e===null){if(!h)throw Error(a(318));if(h=t.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[Mt]=t}else ao(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;it(t),h=!1}else Tn!==null&&(lf(Tn),Tn=null),h=!0;if(!h)return t.flags&256?(er(t),t):(er(t),null)}if(er(t),t.flags&128)return t.lanes=o,t;if(o=u!==null,e=e!==null&&e.memoizedState!==null,o){u=t.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool);var p=null;u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(p=u.memoizedState.cachePool.pool),p!==h&&(u.flags|=2048)}return o!==e&&o&&(t.child.flags|=8192),el(t,t.updateQueue),it(t),null;case 4:return K(),e===null&&bf(t.stateNode.containerInfo),it(t),null;case 10:return ir(t.type),it(t),null;case 19:if(xe(vt),h=t.memoizedState,h===null)return it(t),null;if(u=(t.flags&128)!==0,p=h.rendering,p===null)if(u)Co(h,!1);else{if(st!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(p=js(e),p!==null){for(t.flags|=128,Co(h,!1),e=p.updateQueue,t.updateQueue=e,el(t,e),t.subtreeFlags=0,e=o,o=t.child;o!==null;)Ym(o,e),o=o.sibling;return pe(vt,vt.current&1|2),t.child}e=e.sibling}h.tail!==null&&Ie()>tl&&(t.flags|=128,u=!0,Co(h,!1),t.lanes=4194304)}else{if(!u)if(e=js(p),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,el(t,e),Co(h,!0),h.tail===null&&h.tailMode==="hidden"&&!p.alternate&&!$e)return it(t),null}else 2*Ie()-h.renderingStartTime>tl&&o!==536870912&&(t.flags|=128,u=!0,Co(h,!1),t.lanes=4194304);h.isBackwards?(p.sibling=t.child,t.child=p):(e=h.last,e!==null?e.sibling=p:t.child=p,h.last=p)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=Ie(),t.sibling=null,e=vt.current,pe(vt,u?e&1|2:e&1),t):(it(t),null);case 22:case 23:return er(t),oc(),u=t.memoizedState!==null,e!==null?e.memoizedState!==null!==u&&(t.flags|=8192):u&&(t.flags|=8192),u?o&536870912&&!(t.flags&128)&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),o=t.updateQueue,o!==null&&el(t,o.retryQueue),o=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),u=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(u=t.memoizedState.cachePool.pool),u!==o&&(t.flags|=2048),e!==null&&xe(pi),null;case 24:return o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),ir(yt),it(t),null;case 25:return null}throw Error(a(156,t.tag))}function QS(e,t){switch(nc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ir(yt),K(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ve(t),null;case 13:if(er(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));ao()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xe(vt),null;case 4:return K(),null;case 10:return ir(t.type),null;case 22:case 23:return er(t),oc(),e!==null&&xe(pi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ir(yt),null;case 25:return null;default:return null}}function Wm(e,t){switch(nc(t),t.tag){case 3:ir(yt),K();break;case 26:case 27:case 5:Ve(t);break;case 4:K();break;case 13:er(t);break;case 19:xe(vt);break;case 10:ir(t.type);break;case 22:case 23:er(t),oc(),e!==null&&xe(pi);break;case 24:ir(yt)}}var JS={getCacheForType:function(e){var t=jt(yt),o=t.data.get(e);return o===void 0&&(o=e(),t.data.set(e,o)),o}},ex=typeof WeakMap=="function"?WeakMap:Map,at=0,tt=null,Ue=null,He=0,nt=0,en=null,ur=!1,ua=!1,ef=!1,cr=0,st=0,jr=0,_i=0,tf=0,yn=0,ca=0,Ao=null,Fn=null,nf=!1,rf=0,tl=1/0,nl=null,Ur=null,rl=!1,Ti=null,Ro=0,af=0,of=null,Do=0,sf=null;function tn(){if(at&2&&He!==0)return He&-He;if(z.T!==null){var e=ta;return e!==0?e:pf()}return vg()}function Km(){yn===0&&(yn=!(He&536870912)||$e?dg():536870912);var e=gn.current;return e!==null&&(e.flags|=32),yn}function Ft(e,t,o){(e===tt&&nt===2||e.cancelPendingCommit!==null)&&(fa(e,0),fr(e,He,yn,!1)),Ia(e,o),(!(at&2)||e!==tt)&&(e===tt&&(!(at&2)&&(_i|=o),st===4&&fr(e,He,yn,!1)),Hn(e))}function Qm(e,t,o){if(at&6)throw Error(a(327));var u=!o&&(t&60)===0&&(t&e.expiredLanes)===0||Va(e,t),h=u?rx(e,t):ff(e,t,!0),p=u;do{if(h===0){ua&&!u&&fr(e,t,0,!1);break}else if(h===6)fr(e,t,0,!ur);else{if(o=e.current.alternate,p&&!tx(o)){h=ff(e,t,!1),p=!1;continue}if(h===2){if(p=t,e.errorRecoveryDisabledLanes&p)var w=0;else w=e.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){t=w;e:{var O=e;h=Ao;var q=O.current.memoizedState.isDehydrated;if(q&&(fa(O,w).flags|=256),w=ff(O,w,!1),w!==2){if(ef&&!q){O.errorRecoveryDisabledLanes|=p,_i|=p,h=4;break e}p=Fn,Fn=h,p!==null&&lf(p)}h=w}if(p=!1,h!==2)continue}}if(h===1){fa(e,0),fr(e,t,0,!0);break}e:{switch(u=e,h){case 0:case 1:throw Error(a(345));case 4:if((t&4194176)===t){fr(u,t,yn,!ur);break e}break;case 2:Fn=null;break;case 3:case 5:break;default:throw Error(a(329))}if(u.finishedWork=o,u.finishedLanes=t,(t&62914560)===t&&(p=rf+300-Ie(),10o?32:o,z.T=null,Ti===null)var p=!1;else{o=of,of=null;var w=Ti,O=Ro;if(Ti=null,Ro=0,at&6)throw Error(a(331));var q=at;if(at|=4,Vm(w.current),Pm(w,w.current,O,o),at=q,Oo(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Mn,w)}catch{}p=!0}return p}finally{Q.p=h,z.T=u,sv(e,t)}}return!1}function lv(e,t,o){t=fn(o,t),t=Rc(e.stateNode,t,2),e=Lr(e,t,2),e!==null&&(Ia(e,2),Hn(e))}function Qe(e,t,o){if(e.tag===3)lv(e,e,o);else for(;t!==null;){if(t.tag===3){lv(t,e,o);break}else if(t.tag===1){var u=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Ur===null||!Ur.has(u))){e=fn(o,e),o=fm(2),u=Lr(t,o,2),u!==null&&(dm(o,u,t,e),Ia(u,2),Hn(u));break}}t=t.return}}function df(e,t,o){var u=e.pingCache;if(u===null){u=e.pingCache=new ex;var h=new Set;u.set(t,h)}else h=u.get(t),h===void 0&&(h=new Set,u.set(t,h));h.has(o)||(ef=!0,h.add(o),e=ox.bind(null,e,t,o),t.then(e,e))}function ox(e,t,o){var u=e.pingCache;u!==null&&u.delete(t),e.pingedLanes|=e.suspendedLanes&o,e.warmLanes&=~o,tt===e&&(He&o)===o&&(st===4||st===3&&(He&62914560)===He&&300>Ie()-rf?!(at&2)&&fa(e,0):tf|=o,ca===He&&(ca=0)),Hn(e)}function uv(e,t){t===0&&(t=hg()),e=_r(e,t),e!==null&&(Ia(e,t),Hn(e))}function sx(e){var t=e.memoizedState,o=0;t!==null&&(o=t.retryLane),uv(e,o)}function lx(e,t){var o=0;switch(e.tag){case 13:var u=e.stateNode,h=e.memoizedState;h!==null&&(o=h.retryLane);break;case 19:u=e.stateNode;break;case 22:u=e.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(t),uv(e,o)}function ux(e,t){return Se(e,t)}var ol=null,ga=null,hf=!1,sl=!1,gf=!1,Ci=0;function Hn(e){e!==ga&&e.next===null&&(ga===null?ol=ga=e:ga=ga.next=e),sl=!0,hf||(hf=!0,fx(cx))}function Oo(e,t){if(!gf&&sl){gf=!0;do for(var o=!1,u=ol;u!==null;){if(e!==0){var h=u.pendingLanes;if(h===0)var p=0;else{var w=u.suspendedLanes,O=u.pingedLanes;p=(1<<31-Wt(42|e)+1)-1,p&=h&~(w&~O),p=p&201326677?p&201326677|1:p?p|2:0}p!==0&&(o=!0,dv(u,p))}else p=He,p=ms(u,u===tt?p:0),!(p&3)||Va(u,p)||(o=!0,dv(u,p));u=u.next}while(o);gf=!1}}function cx(){sl=hf=!1;var e=0;Ci!==0&&(bx()&&(e=Ci),Ci=0);for(var t=Ie(),o=null,u=ol;u!==null;){var h=u.next,p=cv(u,t);p===0?(u.next=null,o===null?ol=h:o.next=h,h===null&&(ga=o)):(o=u,(e!==0||p&3)&&(sl=!0)),u=h}Oo(e)}function cv(e,t){for(var o=e.suspendedLanes,u=e.pingedLanes,h=e.expirationTimes,p=e.pendingLanes&-62914561;0"u"?null:document;function Av(e,t,o){var u=ma;if(u&&typeof t=="string"&&t){var h=un(t);h='link[rel="'+e+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),Cv.has(h)||(Cv.add(h),e={rel:e,crossOrigin:o,href:t},u.querySelector(h)===null&&(t=u.createElement("link"),kt(t,"link",e),St(t),u.head.appendChild(t)))}}function Ax(e){dr.D(e),Av("dns-prefetch",e,null)}function Rx(e,t){dr.C(e,t),Av("preconnect",e,t)}function Dx(e,t,o){dr.L(e,t,o);var u=ma;if(u&&e&&t){var h='link[rel="preload"][as="'+un(t)+'"]';t==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+un(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+un(o.imageSizes)+'"]')):h+='[href="'+un(e)+'"]';var p=h;switch(t){case"style":p=va(e);break;case"script":p=ya(e)}bn.has(p)||(e=F({rel:"preload",href:t==="image"&&o&&o.imageSrcSet?void 0:e,as:t},o),bn.set(p,e),u.querySelector(h)!==null||t==="style"&&u.querySelector(No(p))||t==="script"&&u.querySelector(zo(p))||(t=u.createElement("link"),kt(t,"link",e),St(t),u.head.appendChild(t)))}}function Ox(e,t){dr.m(e,t);var o=ma;if(o&&e){var u=t&&typeof t.as=="string"?t.as:"script",h='link[rel="modulepreload"][as="'+un(u)+'"][href="'+un(e)+'"]',p=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=ya(e)}if(!bn.has(p)&&(e=F({rel:"modulepreload",href:e},t),bn.set(p,e),o.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(zo(p)))return}u=o.createElement("link"),kt(u,"link",e),St(u),o.head.appendChild(u)}}}function kx(e,t,o){dr.S(e,t,o);var u=ma;if(u&&e){var h=Fi(u).hoistableStyles,p=va(e);t=t||"default";var w=h.get(p);if(!w){var O={loading:0,preload:null};if(w=u.querySelector(No(p)))O.loading=5;else{e=F({rel:"stylesheet",href:e,"data-precedence":t},o),(o=bn.get(p))&&Rf(e,o);var q=w=u.createElement("link");St(q),kt(q,"link",e),q._p=new Promise(function(Z,oe){q.onload=Z,q.onerror=oe}),q.addEventListener("load",function(){O.loading|=1}),q.addEventListener("error",function(){O.loading|=2}),O.loading|=4,hl(w,t,u)}w={type:"stylesheet",instance:w,count:1,state:O},h.set(p,w)}}}function Lx(e,t){dr.X(e,t);var o=ma;if(o&&e){var u=Fi(o).hoistableScripts,h=ya(e),p=u.get(h);p||(p=o.querySelector(zo(h)),p||(e=F({src:e,async:!0},t),(t=bn.get(h))&&Df(e,t),p=o.createElement("script"),St(p),kt(p,"link",e),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},u.set(h,p))}}function Nx(e,t){dr.M(e,t);var o=ma;if(o&&e){var u=Fi(o).hoistableScripts,h=ya(e),p=u.get(h);p||(p=o.querySelector(zo(h)),p||(e=F({src:e,async:!0,type:"module"},t),(t=bn.get(h))&&Df(e,t),p=o.createElement("script"),St(p),kt(p,"link",e),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},u.set(h,p))}}function Rv(e,t,o,u){var h=(h=Le.current)?dl(h):null;if(!h)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(t=va(o.href),o=Fi(h).hoistableStyles,u=o.get(t),u||(u={type:"style",instance:null,count:0,state:null},o.set(t,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){e=va(o.href);var p=Fi(h).hoistableStyles,w=p.get(e);if(w||(h=h.ownerDocument||h,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,w),(p=h.querySelector(No(e)))&&!p._p&&(w.instance=p,w.state.loading=5),bn.has(e)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},bn.set(e,o),p||zx(h,e,o,w.state))),t&&u===null)throw Error(a(528,""));return w}if(t&&u!==null)throw Error(a(529,""));return null;case"script":return t=o.async,o=o.src,typeof o=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ya(o),o=Fi(h).hoistableScripts,u=o.get(t),u||(u={type:"script",instance:null,count:0,state:null},o.set(t,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function va(e){return'href="'+un(e)+'"'}function No(e){return'link[rel="stylesheet"]['+e+"]"}function Dv(e){return F({},e,{"data-precedence":e.precedence,precedence:null})}function zx(e,t,o,u){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?u.loading=1:(t=e.createElement("link"),u.preload=t,t.addEventListener("load",function(){return u.loading|=1}),t.addEventListener("error",function(){return u.loading|=2}),kt(t,"link",o),St(t),e.head.appendChild(t))}function ya(e){return'[src="'+un(e)+'"]'}function zo(e){return"script[async]"+e}function Ov(e,t,o){if(t.count++,t.instance===null)switch(t.type){case"style":var u=e.querySelector('style[data-href~="'+un(o.href)+'"]');if(u)return t.instance=u,St(u),u;var h=F({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(e.ownerDocument||e).createElement("style"),St(u),kt(u,"style",h),hl(u,o.precedence,e),t.instance=u;case"stylesheet":h=va(o.href);var p=e.querySelector(No(h));if(p)return t.state.loading|=4,t.instance=p,St(p),p;u=Dv(o),(h=bn.get(h))&&Rf(u,h),p=(e.ownerDocument||e).createElement("link"),St(p);var w=p;return w._p=new Promise(function(O,q){w.onload=O,w.onerror=q}),kt(p,"link",u),t.state.loading|=4,hl(p,o.precedence,e),t.instance=p;case"script":return p=ya(o.src),(h=e.querySelector(zo(p)))?(t.instance=h,St(h),h):(u=o,(h=bn.get(p))&&(u=F({},o),Df(u,h)),e=e.ownerDocument||e,h=e.createElement("script"),St(h),kt(h,"link",u),e.head.appendChild(h),t.instance=h);case"void":return null;default:throw Error(a(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(u=t.instance,t.state.loading|=4,hl(u,o.precedence,e));return t.instance}function hl(e,t,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,p=h,w=0;w title"):null)}function Gx(e,t,o){if(o===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Nv(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var Go=null;function Mx(){}function jx(e,t,o){if(Go===null)throw Error(a(475));var u=Go;if(t.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var h=va(o.href),p=e.querySelector(No(h));if(p){e=p._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(u.count++,u=pl.bind(u),e.then(u,u)),t.state.loading|=4,t.instance=p,St(p);return}p=e.ownerDocument||e,o=Dv(o),(h=bn.get(h))&&Rf(o,h),p=p.createElement("link"),St(p);var w=p;w._p=new Promise(function(O,q){w.onload=O,w.onerror=q}),kt(p,"link",o),t.instance=p}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(u.count++,t=pl.bind(u),e.addEventListener("load",t),e.addEventListener("error",t))}}function Ux(){if(Go===null)throw Error(a(475));var e=Go;return e.stylesheets&&e.count===0&&Of(e,e.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),Bf.exports=a_(),Bf.exports}var s_=o_();const ty=r=>{let n;const i=new Set,a=(g,m)=>{const v=typeof g=="function"?g(n):g;if(!Object.is(v,n)){const y=n;n=m??(typeof v!="object"||v===null)?v:Object.assign({},n,v),i.forEach(b=>b(n,y))}},s=()=>n,f={setState:a,getState:s,getInitialState:()=>d,subscribe:g=>(i.add(g),()=>i.delete(g))},d=n=r(a,s,f);return f},l_=r=>r?ty(r):ty,u_=r=>r;function c_(r,n=u_){const i=bt.useSyncExternalStore(r.subscribe,()=>n(r.getState()),()=>n(r.getInitialState()));return bt.useDebugValue(i),i}const f_=r=>{const n=l_(r),i=a=>c_(n,a);return Object.assign(i,n),i},yh=r=>f_;function s0(r,n){let i;try{i=r()}catch{return}return{getItem:s=>{var l;const c=d=>d===null?null:JSON.parse(d,void 0),f=(l=i.getItem(s))!=null?l:null;return f instanceof Promise?f.then(c):c(f)},setItem:(s,l)=>i.setItem(s,JSON.stringify(l,void 0)),removeItem:s=>i.removeItem(s)}}const qd=r=>n=>{try{const i=r(n);return i instanceof Promise?i:{then(a){return qd(a)(i)},catch(a){return this}}}catch(i){return{then(a){return this},catch(a){return qd(a)(i)}}}},d_=(r,n)=>(i,a,s)=>{let l={storage:s0(()=>localStorage),partialize:E=>E,version:0,merge:(E,T)=>({...T,...E}),...n},c=!1;const f=new Set,d=new Set;let g=l.storage;if(!g)return r((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),i(...E)},a,s);const m=()=>{const E=l.partialize({...a()});return g.setItem(l.name,{state:E,version:l.version})},v=s.setState;s.setState=(E,T)=>{v(E,T),m()};const y=r((...E)=>{i(...E),m()},a,s);s.getInitialState=()=>y;let b;const x=()=>{var E,T;if(!g)return;c=!1,f.forEach(N=>{var L;return N((L=a())!=null?L:y)});const M=((T=l.onRehydrateStorage)==null?void 0:T.call(l,(E=a())!=null?E:y))||void 0;return qd(g.getItem.bind(g))(l.name).then(N=>{if(N)if(typeof N.version=="number"&&N.version!==l.version){if(l.migrate){const L=l.migrate(N.state,N.version);return L instanceof Promise?L.then(C=>[!0,C]):[!0,L]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,N.state];return[!1,void 0]}).then(N=>{var L;const[C,R]=N;if(b=l.merge(R,(L=a())!=null?L:y),i(b,!0),C)return m()}).then(()=>{M==null||M(b,void 0),b=a(),c=!0,d.forEach(N=>N(b))}).catch(N=>{M==null||M(void 0,N)})};return s.persist={setOptions:E=>{l={...l,...E},E.storage&&(g=E.storage)},clearStorage:()=>{g==null||g.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>x(),hasHydrated:()=>c,onHydrate:E=>(f.add(E),()=>{f.delete(E)}),onFinishHydration:E=>(d.add(E),()=>{d.delete(E)})},l.skipHydration||x(),b||y},h_=d_;function l0(r){var n,i,a="";if(typeof r=="string"||typeof r=="number")a+=r;else if(typeof r=="object")if(Array.isArray(r)){var s=r.length;for(n=0;n{const n=m_(r),{conflictingClassGroups:i,conflictingClassGroupModifiers:a}=r;return{getClassGroupId:c=>{const f=c.split(bh);return f[0]===""&&f.length!==1&&f.shift(),c0(f,n)||p_(c)},getConflictingClassGroupIds:(c,f)=>{const d=i[c]||[];return f&&a[c]?[...d,...a[c]]:d}}},c0=(r,n)=>{var c;if(r.length===0)return n.classGroupId;const i=r[0],a=n.nextPart.get(i),s=a?c0(r.slice(1),a):void 0;if(s)return s;if(n.validators.length===0)return;const l=r.join(bh);return(c=n.validators.find(({validator:f})=>f(l)))==null?void 0:c.classGroupId},ny=/^\[(.+)\]$/,p_=r=>{if(ny.test(r)){const n=ny.exec(r)[1],i=n==null?void 0:n.substring(0,n.indexOf(":"));if(i)return"arbitrary.."+i}},m_=r=>{const{theme:n,classGroups:i}=r,a={nextPart:new Map,validators:[]};for(const s in i)Vd(i[s],a,s,n);return a},Vd=(r,n,i,a)=>{r.forEach(s=>{if(typeof s=="string"){const l=s===""?n:ry(n,s);l.classGroupId=i;return}if(typeof s=="function"){if(v_(s)){Vd(s(a),n,i,a);return}n.validators.push({validator:s,classGroupId:i});return}Object.entries(s).forEach(([l,c])=>{Vd(c,ry(n,l),i,a)})})},ry=(r,n)=>{let i=r;return n.split(bh).forEach(a=>{i.nextPart.has(a)||i.nextPart.set(a,{nextPart:new Map,validators:[]}),i=i.nextPart.get(a)}),i},v_=r=>r.isThemeGetter,y_=r=>{if(r<1)return{get:()=>{},set:()=>{}};let n=0,i=new Map,a=new Map;const s=(l,c)=>{i.set(l,c),n++,n>r&&(n=0,a=i,i=new Map)};return{get(l){let c=i.get(l);if(c!==void 0)return c;if((c=a.get(l))!==void 0)return s(l,c),c},set(l,c){i.has(l)?i.set(l,c):s(l,c)}}},Id="!",Yd=":",b_=Yd.length,w_=r=>{const{prefix:n,experimentalParseClassName:i}=r;let a=s=>{const l=[];let c=0,f=0,d=0,g;for(let x=0;xd?g-d:void 0;return{modifiers:l,hasImportantModifier:y,baseClassName:v,maybePostfixModifierPosition:b}};if(n){const s=n+Yd,l=a;a=c=>c.startsWith(s)?l(c.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:c,maybePostfixModifierPosition:void 0}}if(i){const s=a;a=l=>i({className:l,parseClassName:s})}return a},E_=r=>r.endsWith(Id)?r.substring(0,r.length-1):r.startsWith(Id)?r.substring(1):r,S_=r=>{const n=Object.fromEntries(r.orderSensitiveModifiers.map(a=>[a,!0]));return a=>{if(a.length<=1)return a;const s=[];let l=[];return a.forEach(c=>{c[0]==="["||n[c]?(s.push(...l.sort(),c),l=[]):l.push(c)}),s.push(...l.sort()),s}},x_=r=>({cache:y_(r.cacheSize),parseClassName:w_(r),sortModifiers:S_(r),...g_(r)}),__=/\s+/,T_=(r,n)=>{const{parseClassName:i,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:l}=n,c=[],f=r.trim().split(__);let d="";for(let g=f.length-1;g>=0;g-=1){const m=f[g],{isExternal:v,modifiers:y,hasImportantModifier:b,baseClassName:x,maybePostfixModifierPosition:E}=i(m);if(v){d=m+(d.length>0?" "+d:d);continue}let T=!!E,M=a(T?x.substring(0,E):x);if(!M){if(!T){d=m+(d.length>0?" "+d:d);continue}if(M=a(x),!M){d=m+(d.length>0?" "+d:d);continue}T=!1}const N=l(y).join(":"),L=b?N+Id:N,C=L+M;if(c.includes(C))continue;c.push(C);const R=s(M,T);for(let B=0;B0?" "+d:d)}return d};function C_(){let r=0,n,i,a="";for(;r{if(typeof r=="string")return r;let n,i="";for(let a=0;av(m),r());return i=x_(g),a=i.cache.get,s=i.cache.set,l=f,f(d)}function f(d){const g=a(d);if(g)return g;const m=T_(d,i);return s(d,m),m}return function(){return l(C_.apply(null,arguments))}}const Ct=r=>{const n=i=>i[r]||[];return n.isThemeGetter=!0,n},d0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,h0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,R_=/^\d+\/\d+$/,D_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,O_=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,k_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,L_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,N_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ba=r=>R_.test(r),Be=r=>!!r&&!Number.isNaN(Number(r)),Ai=r=>!!r&&Number.isInteger(Number(r)),iy=r=>r.endsWith("%")&&Be(r.slice(0,-1)),qr=r=>D_.test(r),z_=()=>!0,G_=r=>O_.test(r)&&!k_.test(r),wh=()=>!1,M_=r=>L_.test(r),j_=r=>N_.test(r),U_=r=>!we(r)&&!Ee(r),B_=r=>Ga(r,m0,wh),we=r=>d0.test(r),Ri=r=>Ga(r,v0,G_),$f=r=>Ga(r,W_,Be),F_=r=>Ga(r,g0,wh),H_=r=>Ga(r,p0,j_),P_=r=>Ga(r,wh,M_),Ee=r=>h0.test(r),_l=r=>Ma(r,v0),$_=r=>Ma(r,K_),q_=r=>Ma(r,g0),V_=r=>Ma(r,m0),I_=r=>Ma(r,p0),Y_=r=>Ma(r,Q_,!0),Ga=(r,n,i)=>{const a=d0.exec(r);return a?a[1]?n(a[1]):i(a[2]):!1},Ma=(r,n,i=!1)=>{const a=h0.exec(r);return a?a[1]?n(a[1]):i:!1},g0=r=>r==="position",X_=new Set(["image","url"]),p0=r=>X_.has(r),Z_=new Set(["length","size","percentage"]),m0=r=>Z_.has(r),v0=r=>r==="length",W_=r=>r==="number",K_=r=>r==="family-name",Q_=r=>r==="shadow",J_=()=>{const r=Ct("color"),n=Ct("font"),i=Ct("text"),a=Ct("font-weight"),s=Ct("tracking"),l=Ct("leading"),c=Ct("breakpoint"),f=Ct("container"),d=Ct("spacing"),g=Ct("radius"),m=Ct("shadow"),v=Ct("inset-shadow"),y=Ct("drop-shadow"),b=Ct("blur"),x=Ct("perspective"),E=Ct("aspect"),T=Ct("ease"),M=Ct("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],C=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],B=()=>[ba,"px","full","auto",Ee,we,d],_=()=>[Ai,"none","subgrid",Ee,we],$=()=>["auto",{span:["full",Ai,Ee,we]},Ee,we],z=()=>[Ai,"auto",Ee,we],F=()=>["auto","min","max","fr",Ee,we],Y=()=>[Ee,we,d],I=()=>["start","end","center","between","around","evenly","stretch","baseline"],j=()=>["start","end","center","stretch"],J=()=>[Ee,we,d],ae=()=>["px",...J()],H=()=>["px","auto",...J()],U=()=>[ba,"auto","px","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",Ee,we,d],D=()=>[r,Ee,we],se=()=>[iy,Ri],G=()=>["","none","full",g,Ee,we],P=()=>["",Be,_l,Ri],k=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["","none",b,Ee,we],re=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ee,we],de=()=>["none",Be,Ee,we],ge=()=>["none",Be,Ee,we],le=()=>[Be,Ee,we],xe=()=>[ba,"full","px",Ee,we,d];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qr],breakpoint:[qr],color:[z_],container:[qr],"drop-shadow":[qr],ease:["in","out","in-out"],font:[U_],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qr],shadow:[qr],spacing:[Be],text:[qr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ba,we,Ee,E]}],container:["container"],columns:[{columns:[Be,we,Ee,f]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...L(),we,Ee]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{start:B()}],end:[{end:B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[Ai,"auto",Ee,we]}],basis:[{basis:[ba,"full","auto",Ee,we,f,d]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Be,ba,"auto","initial","none",we]}],grow:[{grow:["",Be,Ee,we]}],shrink:[{shrink:["",Be,Ee,we]}],order:[{order:[Ai,"first","last","none",Ee,we]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:Y()}],"gap-x":[{"gap-x":Y()}],"gap-y":[{"gap-y":Y()}],"justify-content":[{justify:[...I(),"normal"]}],"justify-items":[{"justify-items":[...j(),"normal"]}],"justify-self":[{"justify-self":["auto",...j()]}],"align-content":[{content:["normal",...I()]}],"align-items":[{items:[...j(),"baseline"]}],"align-self":[{self:["auto",...j(),"baseline"]}],"place-content":[{"place-content":I()}],"place-items":[{"place-items":[...j(),"baseline"]}],"place-self":[{"place-self":["auto",...j()]}],p:[{p:ae()}],px:[{px:ae()}],py:[{py:ae()}],ps:[{ps:ae()}],pe:[{pe:ae()}],pt:[{pt:ae()}],pr:[{pr:ae()}],pb:[{pb:ae()}],pl:[{pl:ae()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":J()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":J()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],w:[{w:[f,"screen",...U()]}],"min-w":[{"min-w":[f,"screen","none",...U()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...U()]}],h:[{h:["screen",...U()]}],"min-h":[{"min-h":["screen","none",...U()]}],"max-h":[{"max-h":["screen",...U()]}],"font-size":[{text:["base",i,_l,Ri]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Ee,$f]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",iy,we]}],"font-family":[{font:[$_,we,n]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ee,we]}],"line-clamp":[{"line-clamp":[Be,"none",Ee,$f]}],leading:[{leading:[Ee,we,l,d]}],"list-image":[{"list-image":["none",Ee,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:[Be,"from-font","auto",Ee,Ri]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[Be,"auto",Ee,we]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:["px",...J()]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),q_,F_]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",V_,B_]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ai,Ee,we],radial:["",Ee,we],conic:[Ai,Ee,we]},I_,H_]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:P()}],"border-w-x":[{"border-x":P()}],"border-w-y":[{"border-y":P()}],"border-w-s":[{"border-s":P()}],"border-w-e":[{"border-e":P()}],"border-w-t":[{"border-t":P()}],"border-w-r":[{"border-r":P()}],"border-w-b":[{"border-b":P()}],"border-w-l":[{"border-l":P()}],"divide-x":[{"divide-x":P()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":P()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...k(),"hidden","none"]}],"divide-style":[{divide:[...k(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...k(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Be,Ee,we]}],"outline-w":[{outline:["",Be,_l,Ri]}],"outline-color":[{outline:[r]}],shadow:[{shadow:["","none",m,Y_,P_]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",Ee,we,v]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[Be,Ri]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":P()}],"inset-ring-color":[{"inset-ring":D()}],opacity:[{opacity:[Be,Ee,we]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none",Ee,we]}],blur:[{blur:Q()}],brightness:[{brightness:[Be,Ee,we]}],contrast:[{contrast:[Be,Ee,we]}],"drop-shadow":[{"drop-shadow":["","none",y,Ee,we]}],grayscale:[{grayscale:["",Be,Ee,we]}],"hue-rotate":[{"hue-rotate":[Be,Ee,we]}],invert:[{invert:["",Be,Ee,we]}],saturate:[{saturate:[Be,Ee,we]}],sepia:[{sepia:["",Be,Ee,we]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,we]}],"backdrop-blur":[{"backdrop-blur":Q()}],"backdrop-brightness":[{"backdrop-brightness":[Be,Ee,we]}],"backdrop-contrast":[{"backdrop-contrast":[Be,Ee,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Be,Ee,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Be,Ee,we]}],"backdrop-invert":[{"backdrop-invert":["",Be,Ee,we]}],"backdrop-opacity":[{"backdrop-opacity":[Be,Ee,we]}],"backdrop-saturate":[{"backdrop-saturate":[Be,Ee,we]}],"backdrop-sepia":[{"backdrop-sepia":["",Be,Ee,we]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":J()}],"border-spacing-x":[{"border-spacing-x":J()}],"border-spacing-y":[{"border-spacing-y":J()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Be,"initial",Ee,we]}],ease:[{ease:["linear","initial",T,Ee,we]}],delay:[{delay:[Be,Ee,we]}],animate:[{animate:["none",M,Ee,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,Ee,we]}],"perspective-origin":[{"perspective-origin":re()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":["scale-3d"],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[Ee,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:re()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ee,we]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":J()}],"scroll-mx":[{"scroll-mx":J()}],"scroll-my":[{"scroll-my":J()}],"scroll-ms":[{"scroll-ms":J()}],"scroll-me":[{"scroll-me":J()}],"scroll-mt":[{"scroll-mt":J()}],"scroll-mr":[{"scroll-mr":J()}],"scroll-mb":[{"scroll-mb":J()}],"scroll-ml":[{"scroll-ml":J()}],"scroll-p":[{"scroll-p":J()}],"scroll-px":[{"scroll-px":J()}],"scroll-py":[{"scroll-py":J()}],"scroll-ps":[{"scroll-ps":J()}],"scroll-pe":[{"scroll-pe":J()}],"scroll-pt":[{"scroll-pt":J()}],"scroll-pr":[{"scroll-pr":J()}],"scroll-pb":[{"scroll-pb":J()}],"scroll-pl":[{"scroll-pl":J()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ee,we]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[Be,_l,Ri,$f]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}},eT=A_(J_);function Xe(...r){return eT(u0(r))}function tT(){const r="0123456789abcdef";let n="#";for(let i=0;i<6;i++)n+=r.charAt(Math.floor(Math.random()*16));return n}function y0(r){return r instanceof Error?r.message:`${r}`}const Eh=r=>{const n=r;n.use={};for(const i of Object.keys(n.getState()))n.use[i]=()=>n(a=>a[i]);return n},nT="",qn="ghost",rT="#B2EBF2",iT="#000",aT="#E2E2E2",oT="#EEEEEE",sT="#F57F17",lT="#969696",uT="#F57F17",ay="#B2EBF2",qf=20,oy=4,cT=20,fT=15,sy="*",dT=yh()(h_(r=>({theme:"system",showPropertyPanel:!0,showNodeSearchBar:!0,showNodeLabel:!0,enableNodeDrag:!0,showEdgeLabel:!1,enableHideUnselectedEdges:!0,enableEdgeEvents:!1,queryLabel:sy,enableHealthCheck:!0,apiKey:null,setTheme:n=>r({theme:n}),setQueryLabel:n=>r({queryLabel:n}),setEnableHealthCheck:n=>r({enableHealthCheck:n}),setApiKey:n=>r({apiKey:n})}),{name:"settings-storage",storage:s0(()=>localStorage),version:4,migrate:(r,n)=>{n<2&&(r.showEdgeLabel=!1),n<3&&(r.queryLabel=sy),n<4&&(r.showPropertyPanel=!0,r.showNodeSearchBar=!0,r.showNodeLabel=!0,r.enableHealthCheck=!0,r.apiKey=null)}})),Pe=Eh(dT),hT={theme:"system",setTheme:()=>null},b0=S.createContext(hT);function gT({children:r,...n}){const[i,a]=S.useState(Pe.getState().theme);S.useEffect(()=>{const l=window.document.documentElement;if(l.classList.remove("light","dark"),i==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";l.classList.add(c),a(c);return}l.classList.add(i)},[i]);const s={theme:i,setTheme:l=>{Pe.getState().setTheme(l),a(l)}};return A.jsx(b0.Provider,{...n,value:s,children:r})}const ly=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,uy=u0,w0=(r,n)=>i=>{var a;if((n==null?void 0:n.variants)==null)return uy(r,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:s,defaultVariants:l}=n,c=Object.keys(s).map(g=>{const m=i==null?void 0:i[g],v=l==null?void 0:l[g];if(m===null)return null;const y=ly(m)||ly(v);return s[g][y]}),f=i&&Object.entries(i).reduce((g,m)=>{let[v,y]=m;return y===void 0||(g[v]=y),g},{}),d=n==null||(a=n.compoundVariants)===null||a===void 0?void 0:a.reduce((g,m)=>{let{class:v,className:y,...b}=m;return Object.entries(b).every(x=>{let[E,T]=x;return Array.isArray(T)?T.includes({...l,...f}[E]):{...l,...f}[E]===T})?[...g,v,y]:g},[]);return uy(r,c,d,i==null?void 0:i.class,i==null?void 0:i.className)},pT=w0("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),E0=S.forwardRef(({className:r,variant:n,...i},a)=>A.jsx("div",{ref:a,role:"alert",className:Xe(pT({variant:n}),r),...i}));E0.displayName="Alert";const S0=S.forwardRef(({className:r,...n},i)=>A.jsx("h5",{ref:i,className:Xe("mb-1 leading-none font-medium tracking-tight",r),...n}));S0.displayName="AlertTitle";const x0=S.forwardRef(({className:r,...n},i)=>A.jsx("div",{ref:i,className:Xe("text-sm [&_p]:leading-relaxed",r),...n}));x0.displayName="AlertDescription";const mT=async r=>{const n=r.headers.get("content-type");if(n)if(n.includes("application/json")){const i=await r.json();return JSON.stringify(i,void 0,2)}else{if(n.startsWith("text/"))return await r.text();if(n.includes("application/xml")||n.includes("text/xml"))return await r.text();if(n.includes("application/octet-stream")){const i=await r.arrayBuffer();return new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}).decode(i)}else try{return await r.text()}catch(i){return console.warn("Failed to decode as text, may be binary:",i),`[Could not decode response body. Content-Type: ${n}]`}}else try{return await r.text()}catch(i){return console.warn("Failed to decode as text, may be binary:",i),"[Could not decode response body. No Content-Type header.]"}return""},Sh=async(r,n={})=>{const i=Pe.getState().apiKey,a={...n.headers||{},...i?{"X-API-Key":i}:{}},s=await fetch(nT+r,{...n,headers:a});if(!s.ok)throw new Error(`${s.status} ${s.statusText} -${await mT(s)} -${s.url}`);return s},vT=async r=>await(await Sh(`/graphs?label=${r}`)).json(),yT=async()=>await(await Sh("/graph/label/list")).json(),bT=async()=>{try{return await(await Sh("/health")).json()}catch(r){return{status:"error",message:y0(r)}}},wT=yh()(r=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,check:async()=>{const n=await bT();return n.status==="healthy"?(r({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:n}),!0):(r({health:!1,message:n.message,messageTitle:"Backend Health Check Error!",lastCheckTime:Date.now(),status:null}),!1)},clear:()=>{r({health:!0,message:null,messageTitle:null})},setErrorMessage:(n,i)=>{r({health:!1,message:n,messageTitle:i})}})),kn=Eh(wT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ET=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_0=(...r)=>r.filter((n,i,a)=>!!n&&n.trim()!==""&&a.indexOf(n)===i).join(" ").trim();/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var ST={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xT=S.forwardRef(({color:r="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:s="",children:l,iconNode:c,...f},d)=>S.createElement("svg",{ref:d,...ST,width:n,height:n,stroke:r,strokeWidth:a?Number(i)*24/Number(n):i,className:_0("lucide",s),...f},[...c.map(([g,m])=>S.createElement(g,m)),...Array.isArray(l)?l:[l]]));/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zt=(r,n)=>{const i=S.forwardRef(({className:a,...s},l)=>S.createElement(xT,{ref:l,iconNode:n,className:_0(`lucide-${ET(r)}`,a),...s}));return i.displayName=`${r}`,i};/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _T=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],T0=zt("Check",_T);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const TT=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],CT=zt("ChevronsUpDown",TT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const AT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],RT=zt("CircleAlert",AT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const DT=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["rect",{width:"10",height:"8",x:"7",y:"8",rx:"1",key:"vys8me"}]],OT=zt("Fullscreen",DT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const kT=[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"19",cy:"5",r:"1",key:"w8mnmm"}],["circle",{cx:"5",cy:"5",r:"1",key:"lttvr7"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}],["circle",{cx:"19",cy:"19",r:"1",key:"shf9b7"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]],LT=zt("Grip",kT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const NT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],C0=zt("LoaderCircle",NT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zT=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],GT=zt("Maximize",zT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const MT=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],jT=zt("Minimize",MT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const UT=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],BT=zt("Moon",UT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const FT=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],HT=zt("Pause",FT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const PT=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],$T=zt("Play",PT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qT=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],VT=zt("Search",qT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const IT=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],YT=zt("Settings",IT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const XT=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],ZT=zt("Sun",XT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const WT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],KT=zt("X",WT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const QT=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],JT=zt("ZoomIn",QT);/** - * @license lucide-react v0.475.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const eC=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],tC=zt("ZoomOut",eC),nC=()=>{const r=kn.use.health(),n=kn.use.message(),i=kn.use.messageTitle(),[a,s]=S.useState(!1);return S.useEffect(()=>{setTimeout(()=>{s(!0)},50)},[]),A.jsxs(E0,{variant:r?"default":"destructive",className:Xe("bg-background/90 absolute top-2 left-1/2 flex w-auto -translate-x-1/2 transform items-center gap-4 shadow-md backdrop-blur-lg transition-all duration-500 ease-in-out",a?"translate-y-0 opacity-100":"-translate-y-20 opacity-0"),children:[!r&&A.jsx("div",{children:A.jsx(RT,{className:"size-4"})}),A.jsxs("div",{children:[A.jsx(S0,{className:"font-bold",children:i}),A.jsx(x0,{children:n})]})]})};function ht(r,n,{checkForDefaultPrevented:i=!0}={}){return function(s){if(r==null||r(s),i===!1||!s.defaultPrevented)return n==null?void 0:n(s)}}function cy(r,n){if(typeof r=="function")return r(n);r!=null&&(r.current=n)}function A0(...r){return n=>{let i=!1;const a=r.map(s=>{const l=cy(s,n);return!i&&typeof l=="function"&&(i=!0),l});if(i)return()=>{for(let s=0;s{const{children:c,...f}=l,d=S.useMemo(()=>f,Object.values(f));return A.jsx(i.Provider,{value:d,children:c})};a.displayName=r+"Provider";function s(l){const c=S.useContext(i);if(c)return c;if(n!==void 0)return n;throw new Error(`\`${l}\` must be used within \`${r}\``)}return[a,s]}function rs(r,n=[]){let i=[];function a(l,c){const f=S.createContext(c),d=i.length;i=[...i,c];const g=v=>{var M;const{scope:y,children:b,...x}=v,E=((M=y==null?void 0:y[r])==null?void 0:M[d])||f,T=S.useMemo(()=>x,Object.values(x));return A.jsx(E.Provider,{value:T,children:b})};g.displayName=l+"Provider";function m(v,y){var E;const b=((E=y==null?void 0:y[r])==null?void 0:E[d])||f,x=S.useContext(b);if(x)return x;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${l}\``)}return[g,m]}const s=()=>{const l=i.map(c=>S.createContext(c));return function(f){const d=(f==null?void 0:f[r])||l;return S.useMemo(()=>({[`__scope${r}`]:{...f,[r]:d}}),[f,d])}};return s.scopeName=r,[a,iC(s,...n)]}function iC(...r){const n=r[0];if(r.length===1)return n;const i=()=>{const a=r.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(l){const c=a.reduce((f,{useScope:d,scopeName:g})=>{const v=d(l)[`__scope${g}`];return{...f,...v}},{});return S.useMemo(()=>({[`__scope${n.scopeName}`]:c}),[c])}};return i.scopeName=n.scopeName,i}var xh=o0();const aC=on(xh);var is=S.forwardRef((r,n)=>{const{children:i,...a}=r,s=S.Children.toArray(i),l=s.find(oC);if(l){const c=l.props.children,f=s.map(d=>d===l?S.Children.count(c)>1?S.Children.only(null):S.isValidElement(c)?c.props.children:null:d);return A.jsx(Xd,{...a,ref:n,children:S.isValidElement(c)?S.cloneElement(c,void 0,f):null})}return A.jsx(Xd,{...a,ref:n,children:i})});is.displayName="Slot";var Xd=S.forwardRef((r,n)=>{const{children:i,...a}=r;if(S.isValidElement(i)){const s=lC(i),l=sC(a,i.props);return i.type!==S.Fragment&&(l.ref=n?A0(n,s):s),S.cloneElement(i,l)}return S.Children.count(i)>1?S.Children.only(null):null});Xd.displayName="SlotClone";var R0=({children:r})=>A.jsx(A.Fragment,{children:r});function oC(r){return S.isValidElement(r)&&r.type===R0}function sC(r,n){const i={...n};for(const a in n){const s=r[a],l=n[a];/^on[A-Z]/.test(a)?s&&l?i[a]=(...f)=>{l(...f),s(...f)}:s&&(i[a]=s):a==="style"?i[a]={...s,...l}:a==="className"&&(i[a]=[s,l].filter(Boolean).join(" "))}return{...r,...i}}function lC(r){var a,s;let n=(a=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:a.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?r.ref:(n=(s=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:s.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?r.props.ref:r.props.ref||r.ref)}var uC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Je=uC.reduce((r,n)=>{const i=S.forwardRef((a,s)=>{const{asChild:l,...c}=a,f=l?is:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),A.jsx(f,{...c,ref:s})});return i.displayName=`Primitive.${n}`,{...r,[n]:i}},{});function cC(r,n){r&&xh.flushSync(()=>r.dispatchEvent(n))}function Qr(r){const n=S.useRef(r);return S.useEffect(()=>{n.current=r}),S.useMemo(()=>(...i)=>{var a;return(a=n.current)==null?void 0:a.call(n,...i)},[])}function fC(r,n=globalThis==null?void 0:globalThis.document){const i=Qr(r);S.useEffect(()=>{const a=s=>{s.key==="Escape"&&i(s)};return n.addEventListener("keydown",a,{capture:!0}),()=>n.removeEventListener("keydown",a,{capture:!0})},[i,n])}var dC="DismissableLayer",Zd="dismissableLayer.update",hC="dismissableLayer.pointerDownOutside",gC="dismissableLayer.focusOutside",fy,D0=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hu=S.forwardRef((r,n)=>{const{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,onDismiss:f,...d}=r,g=S.useContext(D0),[m,v]=S.useState(null),y=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=S.useState({}),x=Vt(n,_=>v(_)),E=Array.from(g.layers),[T]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),M=E.indexOf(T),N=m?E.indexOf(m):-1,L=g.layersWithOutsidePointerEventsDisabled.size>0,C=N>=M,R=vC(_=>{const $=_.target,z=[...g.branches].some(F=>F.contains($));!C||z||(s==null||s(_),c==null||c(_),_.defaultPrevented||f==null||f())},y),B=yC(_=>{const $=_.target;[...g.branches].some(F=>F.contains($))||(l==null||l(_),c==null||c(_),_.defaultPrevented||f==null||f())},y);return fC(_=>{N===g.layers.size-1&&(a==null||a(_),!_.defaultPrevented&&f&&(_.preventDefault(),f()))},y),S.useEffect(()=>{if(m)return i&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(fy=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(m)),g.layers.add(m),dy(),()=>{i&&g.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=fy)}},[m,y,i,g]),S.useEffect(()=>()=>{m&&(g.layers.delete(m),g.layersWithOutsidePointerEventsDisabled.delete(m),dy())},[m,g]),S.useEffect(()=>{const _=()=>b({});return document.addEventListener(Zd,_),()=>document.removeEventListener(Zd,_)},[]),A.jsx(Je.div,{...d,ref:x,style:{pointerEvents:L?C?"auto":"none":void 0,...r.style},onFocusCapture:ht(r.onFocusCapture,B.onFocusCapture),onBlurCapture:ht(r.onBlurCapture,B.onBlurCapture),onPointerDownCapture:ht(r.onPointerDownCapture,R.onPointerDownCapture)})});hu.displayName=dC;var pC="DismissableLayerBranch",mC=S.forwardRef((r,n)=>{const i=S.useContext(D0),a=S.useRef(null),s=Vt(n,a);return S.useEffect(()=>{const l=a.current;if(l)return i.branches.add(l),()=>{i.branches.delete(l)}},[i.branches]),A.jsx(Je.div,{...r,ref:s})});mC.displayName=pC;function vC(r,n=globalThis==null?void 0:globalThis.document){const i=Qr(r),a=S.useRef(!1),s=S.useRef(()=>{});return S.useEffect(()=>{const l=f=>{if(f.target&&!a.current){let d=function(){O0(hC,i,g,{discrete:!0})};const g={originalEvent:f};f.pointerType==="touch"?(n.removeEventListener("click",s.current),s.current=d,n.addEventListener("click",s.current,{once:!0})):d()}else n.removeEventListener("click",s.current);a.current=!1},c=window.setTimeout(()=>{n.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),n.removeEventListener("pointerdown",l),n.removeEventListener("click",s.current)}},[n,i]),{onPointerDownCapture:()=>a.current=!0}}function yC(r,n=globalThis==null?void 0:globalThis.document){const i=Qr(r),a=S.useRef(!1);return S.useEffect(()=>{const s=l=>{l.target&&!a.current&&O0(gC,i,{originalEvent:l},{discrete:!1})};return n.addEventListener("focusin",s),()=>n.removeEventListener("focusin",s)},[n,i]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function dy(){const r=new CustomEvent(Zd);document.dispatchEvent(r)}function O0(r,n,i,{discrete:a}){const s=i.originalEvent.target,l=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:i});n&&s.addEventListener(r,n,{once:!0}),a?cC(s,l):s.dispatchEvent(l)}var Vf=0;function k0(){S.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??hy()),document.body.insertAdjacentElement("beforeend",r[1]??hy()),Vf++,()=>{Vf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Vf--}},[])}function hy(){const r=document.createElement("span");return r.setAttribute("data-radix-focus-guard",""),r.tabIndex=0,r.style.outline="none",r.style.opacity="0",r.style.position="fixed",r.style.pointerEvents="none",r}var If="focusScope.autoFocusOnMount",Yf="focusScope.autoFocusOnUnmount",gy={bubbles:!1,cancelable:!0},bC="FocusScope",_h=S.forwardRef((r,n)=>{const{loop:i=!1,trapped:a=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...c}=r,[f,d]=S.useState(null),g=Qr(s),m=Qr(l),v=S.useRef(null),y=Vt(n,E=>d(E)),b=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(a){let E=function(L){if(b.paused||!f)return;const C=L.target;f.contains(C)?v.current=C:Xr(v.current,{select:!0})},T=function(L){if(b.paused||!f)return;const C=L.relatedTarget;C!==null&&(f.contains(C)||Xr(v.current,{select:!0}))},M=function(L){if(document.activeElement===document.body)for(const R of L)R.removedNodes.length>0&&Xr(f)};document.addEventListener("focusin",E),document.addEventListener("focusout",T);const N=new MutationObserver(M);return f&&N.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",T),N.disconnect()}}},[a,f,b.paused]),S.useEffect(()=>{if(f){my.add(b);const E=document.activeElement;if(!f.contains(E)){const M=new CustomEvent(If,gy);f.addEventListener(If,g),f.dispatchEvent(M),M.defaultPrevented||(wC(TC(L0(f)),{select:!0}),document.activeElement===E&&Xr(f))}return()=>{f.removeEventListener(If,g),setTimeout(()=>{const M=new CustomEvent(Yf,gy);f.addEventListener(Yf,m),f.dispatchEvent(M),M.defaultPrevented||Xr(E??document.body,{select:!0}),f.removeEventListener(Yf,m),my.remove(b)},0)}}},[f,g,m,b]);const x=S.useCallback(E=>{if(!i&&!a||b.paused)return;const T=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,M=document.activeElement;if(T&&M){const N=E.currentTarget,[L,C]=EC(N);L&&C?!E.shiftKey&&M===C?(E.preventDefault(),i&&Xr(L,{select:!0})):E.shiftKey&&M===L&&(E.preventDefault(),i&&Xr(C,{select:!0})):M===N&&E.preventDefault()}},[i,a,b.paused]);return A.jsx(Je.div,{tabIndex:-1,...c,ref:y,onKeyDown:x})});_h.displayName=bC;function wC(r,{select:n=!1}={}){const i=document.activeElement;for(const a of r)if(Xr(a,{select:n}),document.activeElement!==i)return}function EC(r){const n=L0(r),i=py(n,r),a=py(n.reverse(),r);return[i,a]}function L0(r){const n=[],i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const s=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||s?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)n.push(i.currentNode);return n}function py(r,n){for(const i of r)if(!SC(i,{upTo:n}))return i}function SC(r,{upTo:n}){if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(n!==void 0&&r===n)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}function xC(r){return r instanceof HTMLInputElement&&"select"in r}function Xr(r,{select:n=!1}={}){if(r&&r.focus){const i=document.activeElement;r.focus({preventScroll:!0}),r!==i&&xC(r)&&n&&r.select()}}var my=_C();function _C(){let r=[];return{add(n){const i=r[0];n!==i&&(i==null||i.pause()),r=vy(r,n),r.unshift(n)},remove(n){var i;r=vy(r,n),(i=r[0])==null||i.resume()}}}function vy(r,n){const i=[...r],a=i.indexOf(n);return a!==-1&&i.splice(a,1),i}function TC(r){return r.filter(n=>n.tagName!=="A")}var Li=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},CC=t_.useId||(()=>{}),AC=0;function Ln(r){const[n,i]=S.useState(CC());return Li(()=>{i(a=>a??String(AC++))},[r]),n?`radix-${n}`:""}const RC=["top","right","bottom","left"],Jr=Math.min,nn=Math.max,nu=Math.round,Tl=Math.floor,Vn=r=>({x:r,y:r}),DC={left:"right",right:"left",bottom:"top",top:"bottom"},OC={start:"end",end:"start"};function Wd(r,n,i){return nn(r,Jr(n,i))}function br(r,n){return typeof r=="function"?r(n):r}function wr(r){return r.split("-")[0]}function ja(r){return r.split("-")[1]}function Th(r){return r==="x"?"y":"x"}function Ch(r){return r==="y"?"height":"width"}function ei(r){return["top","bottom"].includes(wr(r))?"y":"x"}function Ah(r){return Th(ei(r))}function kC(r,n,i){i===void 0&&(i=!1);const a=ja(r),s=Ah(r),l=Ch(s);let c=s==="x"?a===(i?"end":"start")?"right":"left":a==="start"?"bottom":"top";return n.reference[l]>n.floating[l]&&(c=ru(c)),[c,ru(c)]}function LC(r){const n=ru(r);return[Kd(r),n,Kd(n)]}function Kd(r){return r.replace(/start|end/g,n=>OC[n])}function NC(r,n,i){const a=["left","right"],s=["right","left"],l=["top","bottom"],c=["bottom","top"];switch(r){case"top":case"bottom":return i?n?s:a:n?a:s;case"left":case"right":return n?l:c;default:return[]}}function zC(r,n,i,a){const s=ja(r);let l=NC(wr(r),i==="start",a);return s&&(l=l.map(c=>c+"-"+s),n&&(l=l.concat(l.map(Kd)))),l}function ru(r){return r.replace(/left|right|bottom|top/g,n=>DC[n])}function GC(r){return{top:0,right:0,bottom:0,left:0,...r}}function N0(r){return typeof r!="number"?GC(r):{top:r,right:r,bottom:r,left:r}}function iu(r){const{x:n,y:i,width:a,height:s}=r;return{width:a,height:s,top:i,left:n,right:n+a,bottom:i+s,x:n,y:i}}function yy(r,n,i){let{reference:a,floating:s}=r;const l=ei(n),c=Ah(n),f=Ch(c),d=wr(n),g=l==="y",m=a.x+a.width/2-s.width/2,v=a.y+a.height/2-s.height/2,y=a[f]/2-s[f]/2;let b;switch(d){case"top":b={x:m,y:a.y-s.height};break;case"bottom":b={x:m,y:a.y+a.height};break;case"right":b={x:a.x+a.width,y:v};break;case"left":b={x:a.x-s.width,y:v};break;default:b={x:a.x,y:a.y}}switch(ja(n)){case"start":b[c]-=y*(i&&g?-1:1);break;case"end":b[c]+=y*(i&&g?-1:1);break}return b}const MC=async(r,n,i)=>{const{placement:a="bottom",strategy:s="absolute",middleware:l=[],platform:c}=i,f=l.filter(Boolean),d=await(c.isRTL==null?void 0:c.isRTL(n));let g=await c.getElementRects({reference:r,floating:n,strategy:s}),{x:m,y:v}=yy(g,a,d),y=a,b={},x=0;for(let E=0;E({name:"arrow",options:r,async fn(n){const{x:i,y:a,placement:s,rects:l,platform:c,elements:f,middlewareData:d}=n,{element:g,padding:m=0}=br(r,n)||{};if(g==null)return{};const v=N0(m),y={x:i,y:a},b=Ah(s),x=Ch(b),E=await c.getDimensions(g),T=b==="y",M=T?"top":"left",N=T?"bottom":"right",L=T?"clientHeight":"clientWidth",C=l.reference[x]+l.reference[b]-y[b]-l.floating[x],R=y[b]-l.reference[b],B=await(c.getOffsetParent==null?void 0:c.getOffsetParent(g));let _=B?B[L]:0;(!_||!await(c.isElement==null?void 0:c.isElement(B)))&&(_=f.floating[L]||l.floating[x]);const $=C/2-R/2,z=_/2-E[x]/2-1,F=Jr(v[M],z),Y=Jr(v[N],z),I=F,j=_-E[x]-Y,J=_/2-E[x]/2+$,ae=Wd(I,J,j),H=!d.arrow&&ja(s)!=null&&J!==ae&&l.reference[x]/2-(JJ<=0)){var Y,I;const J=(((Y=l.flip)==null?void 0:Y.index)||0)+1,ae=_[J];if(ae)return{data:{index:J,overflows:F},reset:{placement:ae}};let H=(I=F.filter(U=>U.overflows[0]<=0).sort((U,D)=>U.overflows[1]-D.overflows[1])[0])==null?void 0:I.placement;if(!H)switch(b){case"bestFit":{var j;const U=(j=F.filter(D=>{if(B){const se=ei(D.placement);return se===N||se==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(se=>se>0).reduce((se,G)=>se+G,0)]).sort((D,se)=>D[1]-se[1])[0])==null?void 0:j[0];U&&(H=U);break}case"initialPlacement":H=f;break}if(s!==H)return{reset:{placement:H}}}return{}}}};function by(r,n){return{top:r.top-n.height,right:r.right-n.width,bottom:r.bottom-n.height,left:r.left-n.width}}function wy(r){return RC.some(n=>r[n]>=0)}const BC=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(n){const{rects:i}=n,{strategy:a="referenceHidden",...s}=br(r,n);switch(a){case"referenceHidden":{const l=await Jo(n,{...s,elementContext:"reference"}),c=by(l,i.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:wy(c)}}}case"escaped":{const l=await Jo(n,{...s,altBoundary:!0}),c=by(l,i.floating);return{data:{escapedOffsets:c,escaped:wy(c)}}}default:return{}}}}};async function FC(r,n){const{placement:i,platform:a,elements:s}=r,l=await(a.isRTL==null?void 0:a.isRTL(s.floating)),c=wr(i),f=ja(i),d=ei(i)==="y",g=["left","top"].includes(c)?-1:1,m=l&&d?-1:1,v=br(n,r);let{mainAxis:y,crossAxis:b,alignmentAxis:x}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof x=="number"&&(b=f==="end"?x*-1:x),d?{x:b*m,y:y*g}:{x:y*g,y:b*m}}const HC=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(n){var i,a;const{x:s,y:l,placement:c,middlewareData:f}=n,d=await FC(n,r);return c===((i=f.offset)==null?void 0:i.placement)&&(a=f.arrow)!=null&&a.alignmentOffset?{}:{x:s+d.x,y:l+d.y,data:{...d,placement:c}}}}},PC=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(n){const{x:i,y:a,placement:s}=n,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:T=>{let{x:M,y:N}=T;return{x:M,y:N}}},...d}=br(r,n),g={x:i,y:a},m=await Jo(n,d),v=ei(wr(s)),y=Th(v);let b=g[y],x=g[v];if(l){const T=y==="y"?"top":"left",M=y==="y"?"bottom":"right",N=b+m[T],L=b-m[M];b=Wd(N,b,L)}if(c){const T=v==="y"?"top":"left",M=v==="y"?"bottom":"right",N=x+m[T],L=x-m[M];x=Wd(N,x,L)}const E=f.fn({...n,[y]:b,[v]:x});return{...E,data:{x:E.x-i,y:E.y-a,enabled:{[y]:l,[v]:c}}}}}},$C=function(r){return r===void 0&&(r={}),{options:r,fn(n){const{x:i,y:a,placement:s,rects:l,middlewareData:c}=n,{offset:f=0,mainAxis:d=!0,crossAxis:g=!0}=br(r,n),m={x:i,y:a},v=ei(s),y=Th(v);let b=m[y],x=m[v];const E=br(f,n),T=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(d){const L=y==="y"?"height":"width",C=l.reference[y]-l.floating[L]+T.mainAxis,R=l.reference[y]+l.reference[L]-T.mainAxis;bR&&(b=R)}if(g){var M,N;const L=y==="y"?"width":"height",C=["top","left"].includes(wr(s)),R=l.reference[v]-l.floating[L]+(C&&((M=c.offset)==null?void 0:M[v])||0)+(C?0:T.crossAxis),B=l.reference[v]+l.reference[L]+(C?0:((N=c.offset)==null?void 0:N[v])||0)-(C?T.crossAxis:0);xB&&(x=B)}return{[y]:b,[v]:x}}}},qC=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(n){var i,a;const{placement:s,rects:l,platform:c,elements:f}=n,{apply:d=()=>{},...g}=br(r,n),m=await Jo(n,g),v=wr(s),y=ja(s),b=ei(s)==="y",{width:x,height:E}=l.floating;let T,M;v==="top"||v==="bottom"?(T=v,M=y===(await(c.isRTL==null?void 0:c.isRTL(f.floating))?"start":"end")?"left":"right"):(M=v,T=y==="end"?"top":"bottom");const N=E-m.top-m.bottom,L=x-m.left-m.right,C=Jr(E-m[T],N),R=Jr(x-m[M],L),B=!n.middlewareData.shift;let _=C,$=R;if((i=n.middlewareData.shift)!=null&&i.enabled.x&&($=L),(a=n.middlewareData.shift)!=null&&a.enabled.y&&(_=N),B&&!y){const F=nn(m.left,0),Y=nn(m.right,0),I=nn(m.top,0),j=nn(m.bottom,0);b?$=x-2*(F!==0||Y!==0?F+Y:nn(m.left,m.right)):_=E-2*(I!==0||j!==0?I+j:nn(m.top,m.bottom))}await d({...n,availableWidth:$,availableHeight:_});const z=await c.getDimensions(f.floating);return x!==z.width||E!==z.height?{reset:{rects:!0}}:{}}}};function gu(){return typeof window<"u"}function Ua(r){return z0(r)?(r.nodeName||"").toLowerCase():"#document"}function rn(r){var n;return(r==null||(n=r.ownerDocument)==null?void 0:n.defaultView)||window}function Yn(r){var n;return(n=(z0(r)?r.ownerDocument:r.document)||window.document)==null?void 0:n.documentElement}function z0(r){return gu()?r instanceof Node||r instanceof rn(r).Node:!1}function Nn(r){return gu()?r instanceof Element||r instanceof rn(r).Element:!1}function In(r){return gu()?r instanceof HTMLElement||r instanceof rn(r).HTMLElement:!1}function Ey(r){return!gu()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof rn(r).ShadowRoot}function as(r){const{overflow:n,overflowX:i,overflowY:a,display:s}=zn(r);return/auto|scroll|overlay|hidden|clip/.test(n+a+i)&&!["inline","contents"].includes(s)}function VC(r){return["table","td","th"].includes(Ua(r))}function pu(r){return[":popover-open",":modal"].some(n=>{try{return r.matches(n)}catch{return!1}})}function Rh(r){const n=Dh(),i=Nn(r)?zn(r):r;return["transform","translate","scale","rotate","perspective"].some(a=>i[a]?i[a]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!n&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!n&&(i.filter?i.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(a=>(i.willChange||"").includes(a))||["paint","layout","strict","content"].some(a=>(i.contain||"").includes(a))}function IC(r){let n=ti(r);for(;In(n)&&!Oa(n);){if(Rh(n))return n;if(pu(n))return null;n=ti(n)}return null}function Dh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Oa(r){return["html","body","#document"].includes(Ua(r))}function zn(r){return rn(r).getComputedStyle(r)}function mu(r){return Nn(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function ti(r){if(Ua(r)==="html")return r;const n=r.assignedSlot||r.parentNode||Ey(r)&&r.host||Yn(r);return Ey(n)?n.host:n}function G0(r){const n=ti(r);return Oa(n)?r.ownerDocument?r.ownerDocument.body:r.body:In(n)&&as(n)?n:G0(n)}function es(r,n,i){var a;n===void 0&&(n=[]),i===void 0&&(i=!0);const s=G0(r),l=s===((a=r.ownerDocument)==null?void 0:a.body),c=rn(s);if(l){const f=Qd(c);return n.concat(c,c.visualViewport||[],as(s)?s:[],f&&i?es(f):[])}return n.concat(s,es(s,[],i))}function Qd(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function M0(r){const n=zn(r);let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0;const s=In(r),l=s?r.offsetWidth:i,c=s?r.offsetHeight:a,f=nu(i)!==l||nu(a)!==c;return f&&(i=l,a=c),{width:i,height:a,$:f}}function Oh(r){return Nn(r)?r:r.contextElement}function Aa(r){const n=Oh(r);if(!In(n))return Vn(1);const i=n.getBoundingClientRect(),{width:a,height:s,$:l}=M0(n);let c=(l?nu(i.width):i.width)/a,f=(l?nu(i.height):i.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!f||!Number.isFinite(f))&&(f=1),{x:c,y:f}}const YC=Vn(0);function j0(r){const n=rn(r);return!Dh()||!n.visualViewport?YC:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function XC(r,n,i){return n===void 0&&(n=!1),!i||n&&i!==rn(r)?!1:n}function Ni(r,n,i,a){n===void 0&&(n=!1),i===void 0&&(i=!1);const s=r.getBoundingClientRect(),l=Oh(r);let c=Vn(1);n&&(a?Nn(a)&&(c=Aa(a)):c=Aa(r));const f=XC(l,i,a)?j0(l):Vn(0);let d=(s.left+f.x)/c.x,g=(s.top+f.y)/c.y,m=s.width/c.x,v=s.height/c.y;if(l){const y=rn(l),b=a&&Nn(a)?rn(a):a;let x=y,E=Qd(x);for(;E&&a&&b!==x;){const T=Aa(E),M=E.getBoundingClientRect(),N=zn(E),L=M.left+(E.clientLeft+parseFloat(N.paddingLeft))*T.x,C=M.top+(E.clientTop+parseFloat(N.paddingTop))*T.y;d*=T.x,g*=T.y,m*=T.x,v*=T.y,d+=L,g+=C,x=rn(E),E=Qd(x)}}return iu({width:m,height:v,x:d,y:g})}function kh(r,n){const i=mu(r).scrollLeft;return n?n.left+i:Ni(Yn(r)).left+i}function U0(r,n,i){i===void 0&&(i=!1);const a=r.getBoundingClientRect(),s=a.left+n.scrollLeft-(i?0:kh(r,a)),l=a.top+n.scrollTop;return{x:s,y:l}}function ZC(r){let{elements:n,rect:i,offsetParent:a,strategy:s}=r;const l=s==="fixed",c=Yn(a),f=n?pu(n.floating):!1;if(a===c||f&&l)return i;let d={scrollLeft:0,scrollTop:0},g=Vn(1);const m=Vn(0),v=In(a);if((v||!v&&!l)&&((Ua(a)!=="body"||as(c))&&(d=mu(a)),In(a))){const b=Ni(a);g=Aa(a),m.x=b.x+a.clientLeft,m.y=b.y+a.clientTop}const y=c&&!v&&!l?U0(c,d,!0):Vn(0);return{width:i.width*g.x,height:i.height*g.y,x:i.x*g.x-d.scrollLeft*g.x+m.x+y.x,y:i.y*g.y-d.scrollTop*g.y+m.y+y.y}}function WC(r){return Array.from(r.getClientRects())}function KC(r){const n=Yn(r),i=mu(r),a=r.ownerDocument.body,s=nn(n.scrollWidth,n.clientWidth,a.scrollWidth,a.clientWidth),l=nn(n.scrollHeight,n.clientHeight,a.scrollHeight,a.clientHeight);let c=-i.scrollLeft+kh(r);const f=-i.scrollTop;return zn(a).direction==="rtl"&&(c+=nn(n.clientWidth,a.clientWidth)-s),{width:s,height:l,x:c,y:f}}function QC(r,n){const i=rn(r),a=Yn(r),s=i.visualViewport;let l=a.clientWidth,c=a.clientHeight,f=0,d=0;if(s){l=s.width,c=s.height;const g=Dh();(!g||g&&n==="fixed")&&(f=s.offsetLeft,d=s.offsetTop)}return{width:l,height:c,x:f,y:d}}function JC(r,n){const i=Ni(r,!0,n==="fixed"),a=i.top+r.clientTop,s=i.left+r.clientLeft,l=In(r)?Aa(r):Vn(1),c=r.clientWidth*l.x,f=r.clientHeight*l.y,d=s*l.x,g=a*l.y;return{width:c,height:f,x:d,y:g}}function Sy(r,n,i){let a;if(n==="viewport")a=QC(r,i);else if(n==="document")a=KC(Yn(r));else if(Nn(n))a=JC(n,i);else{const s=j0(r);a={x:n.x-s.x,y:n.y-s.y,width:n.width,height:n.height}}return iu(a)}function B0(r,n){const i=ti(r);return i===n||!Nn(i)||Oa(i)?!1:zn(i).position==="fixed"||B0(i,n)}function e2(r,n){const i=n.get(r);if(i)return i;let a=es(r,[],!1).filter(f=>Nn(f)&&Ua(f)!=="body"),s=null;const l=zn(r).position==="fixed";let c=l?ti(r):r;for(;Nn(c)&&!Oa(c);){const f=zn(c),d=Rh(c);!d&&f.position==="fixed"&&(s=null),(l?!d&&!s:!d&&f.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||as(c)&&!d&&B0(r,c))?a=a.filter(m=>m!==c):s=f,c=ti(c)}return n.set(r,a),a}function t2(r){let{element:n,boundary:i,rootBoundary:a,strategy:s}=r;const c=[...i==="clippingAncestors"?pu(n)?[]:e2(n,this._c):[].concat(i),a],f=c[0],d=c.reduce((g,m)=>{const v=Sy(n,m,s);return g.top=nn(v.top,g.top),g.right=Jr(v.right,g.right),g.bottom=Jr(v.bottom,g.bottom),g.left=nn(v.left,g.left),g},Sy(n,f,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function n2(r){const{width:n,height:i}=M0(r);return{width:n,height:i}}function r2(r,n,i){const a=In(n),s=Yn(n),l=i==="fixed",c=Ni(r,!0,l,n);let f={scrollLeft:0,scrollTop:0};const d=Vn(0);if(a||!a&&!l)if((Ua(n)!=="body"||as(s))&&(f=mu(n)),a){const y=Ni(n,!0,l,n);d.x=y.x+n.clientLeft,d.y=y.y+n.clientTop}else s&&(d.x=kh(s));const g=s&&!a&&!l?U0(s,f):Vn(0),m=c.left+f.scrollLeft-d.x-g.x,v=c.top+f.scrollTop-d.y-g.y;return{x:m,y:v,width:c.width,height:c.height}}function Xf(r){return zn(r).position==="static"}function xy(r,n){if(!In(r)||zn(r).position==="fixed")return null;if(n)return n(r);let i=r.offsetParent;return Yn(r)===i&&(i=i.ownerDocument.body),i}function F0(r,n){const i=rn(r);if(pu(r))return i;if(!In(r)){let s=ti(r);for(;s&&!Oa(s);){if(Nn(s)&&!Xf(s))return s;s=ti(s)}return i}let a=xy(r,n);for(;a&&VC(a)&&Xf(a);)a=xy(a,n);return a&&Oa(a)&&Xf(a)&&!Rh(a)?i:a||IC(r)||i}const i2=async function(r){const n=this.getOffsetParent||F0,i=this.getDimensions,a=await i(r.floating);return{reference:r2(r.reference,await n(r.floating),r.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function a2(r){return zn(r).direction==="rtl"}const o2={convertOffsetParentRelativeRectToViewportRelativeRect:ZC,getDocumentElement:Yn,getClippingRect:t2,getOffsetParent:F0,getElementRects:i2,getClientRects:WC,getDimensions:n2,getScale:Aa,isElement:Nn,isRTL:a2};function H0(r,n){return r.x===n.x&&r.y===n.y&&r.width===n.width&&r.height===n.height}function s2(r,n){let i=null,a;const s=Yn(r);function l(){var f;clearTimeout(a),(f=i)==null||f.disconnect(),i=null}function c(f,d){f===void 0&&(f=!1),d===void 0&&(d=1),l();const g=r.getBoundingClientRect(),{left:m,top:v,width:y,height:b}=g;if(f||n(),!y||!b)return;const x=Tl(v),E=Tl(s.clientWidth-(m+y)),T=Tl(s.clientHeight-(v+b)),M=Tl(m),L={rootMargin:-x+"px "+-E+"px "+-T+"px "+-M+"px",threshold:nn(0,Jr(1,d))||1};let C=!0;function R(B){const _=B[0].intersectionRatio;if(_!==d){if(!C)return c();_?c(!1,_):a=setTimeout(()=>{c(!1,1e-7)},1e3)}_===1&&!H0(g,r.getBoundingClientRect())&&c(),C=!1}try{i=new IntersectionObserver(R,{...L,root:s.ownerDocument})}catch{i=new IntersectionObserver(R,L)}i.observe(r)}return c(!0),l}function l2(r,n,i,a){a===void 0&&(a={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:d=!1}=a,g=Oh(r),m=s||l?[...g?es(g):[],...es(n)]:[];m.forEach(M=>{s&&M.addEventListener("scroll",i,{passive:!0}),l&&M.addEventListener("resize",i)});const v=g&&f?s2(g,i):null;let y=-1,b=null;c&&(b=new ResizeObserver(M=>{let[N]=M;N&&N.target===g&&b&&(b.unobserve(n),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var L;(L=b)==null||L.observe(n)})),i()}),g&&!d&&b.observe(g),b.observe(n));let x,E=d?Ni(r):null;d&&T();function T(){const M=Ni(r);E&&!H0(E,M)&&i(),E=M,x=requestAnimationFrame(T)}return i(),()=>{var M;m.forEach(N=>{s&&N.removeEventListener("scroll",i),l&&N.removeEventListener("resize",i)}),v==null||v(),(M=b)==null||M.disconnect(),b=null,d&&cancelAnimationFrame(x)}}const u2=HC,c2=PC,f2=UC,d2=qC,h2=BC,_y=jC,g2=$C,p2=(r,n,i)=>{const a=new Map,s={platform:o2,...i},l={...s.platform,_c:a};return MC(r,n,{...s,platform:l})};var $l=typeof document<"u"?S.useLayoutEffect:S.useEffect;function au(r,n){if(r===n)return!0;if(typeof r!=typeof n)return!1;if(typeof r=="function"&&r.toString()===n.toString())return!0;let i,a,s;if(r&&n&&typeof r=="object"){if(Array.isArray(r)){if(i=r.length,i!==n.length)return!1;for(a=i;a--!==0;)if(!au(r[a],n[a]))return!1;return!0}if(s=Object.keys(r),i=s.length,i!==Object.keys(n).length)return!1;for(a=i;a--!==0;)if(!{}.hasOwnProperty.call(n,s[a]))return!1;for(a=i;a--!==0;){const l=s[a];if(!(l==="_owner"&&r.$$typeof)&&!au(r[l],n[l]))return!1}return!0}return r!==r&&n!==n}function P0(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function Ty(r,n){const i=P0(r);return Math.round(n*i)/i}function Zf(r){const n=S.useRef(r);return $l(()=>{n.current=r}),n}function m2(r){r===void 0&&(r={});const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:s,elements:{reference:l,floating:c}={},transform:f=!0,whileElementsMounted:d,open:g}=r,[m,v]=S.useState({x:0,y:0,strategy:i,placement:n,middlewareData:{},isPositioned:!1}),[y,b]=S.useState(a);au(y,a)||b(a);const[x,E]=S.useState(null),[T,M]=S.useState(null),N=S.useCallback(D=>{D!==B.current&&(B.current=D,E(D))},[]),L=S.useCallback(D=>{D!==_.current&&(_.current=D,M(D))},[]),C=l||x,R=c||T,B=S.useRef(null),_=S.useRef(null),$=S.useRef(m),z=d!=null,F=Zf(d),Y=Zf(s),I=Zf(g),j=S.useCallback(()=>{if(!B.current||!_.current)return;const D={placement:n,strategy:i,middleware:y};Y.current&&(D.platform=Y.current),p2(B.current,_.current,D).then(se=>{const G={...se,isPositioned:I.current!==!1};J.current&&!au($.current,G)&&($.current=G,xh.flushSync(()=>{v(G)}))})},[y,n,i,Y,I]);$l(()=>{g===!1&&$.current.isPositioned&&($.current.isPositioned=!1,v(D=>({...D,isPositioned:!1})))},[g]);const J=S.useRef(!1);$l(()=>(J.current=!0,()=>{J.current=!1}),[]),$l(()=>{if(C&&(B.current=C),R&&(_.current=R),C&&R){if(F.current)return F.current(C,R,j);j()}},[C,R,j,F,z]);const ae=S.useMemo(()=>({reference:B,floating:_,setReference:N,setFloating:L}),[N,L]),H=S.useMemo(()=>({reference:C,floating:R}),[C,R]),U=S.useMemo(()=>{const D={position:i,left:0,top:0};if(!H.floating)return D;const se=Ty(H.floating,m.x),G=Ty(H.floating,m.y);return f?{...D,transform:"translate("+se+"px, "+G+"px)",...P0(H.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:se,top:G}},[i,f,H.floating,m.x,m.y]);return S.useMemo(()=>({...m,update:j,refs:ae,elements:H,floatingStyles:U}),[m,j,ae,H,U])}const v2=r=>{function n(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:r,fn(i){const{element:a,padding:s}=typeof r=="function"?r(i):r;return a&&n(a)?a.current!=null?_y({element:a.current,padding:s}).fn(i):{}:a?_y({element:a,padding:s}).fn(i):{}}}},y2=(r,n)=>({...u2(r),options:[r,n]}),b2=(r,n)=>({...c2(r),options:[r,n]}),w2=(r,n)=>({...g2(r),options:[r,n]}),E2=(r,n)=>({...f2(r),options:[r,n]}),S2=(r,n)=>({...d2(r),options:[r,n]}),x2=(r,n)=>({...h2(r),options:[r,n]}),_2=(r,n)=>({...v2(r),options:[r,n]});var T2="Arrow",$0=S.forwardRef((r,n)=>{const{children:i,width:a=10,height:s=5,...l}=r;return A.jsx(Je.svg,{...l,ref:n,width:a,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?i:A.jsx("polygon",{points:"0,0 30,0 15,10"})})});$0.displayName=T2;var C2=$0;function q0(r){const[n,i]=S.useState(void 0);return Li(()=>{if(r){i({width:r.offsetWidth,height:r.offsetHeight});const a=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let c,f;if("borderBoxSize"in l){const d=l.borderBoxSize,g=Array.isArray(d)?d[0]:d;c=g.inlineSize,f=g.blockSize}else c=r.offsetWidth,f=r.offsetHeight;i({width:c,height:f})});return a.observe(r,{box:"border-box"}),()=>a.unobserve(r)}else i(void 0)},[r]),n}var Lh="Popper",[V0,vu]=rs(Lh),[A2,I0]=V0(Lh),Y0=r=>{const{__scopePopper:n,children:i}=r,[a,s]=S.useState(null);return A.jsx(A2,{scope:n,anchor:a,onAnchorChange:s,children:i})};Y0.displayName=Lh;var X0="PopperAnchor",Z0=S.forwardRef((r,n)=>{const{__scopePopper:i,virtualRef:a,...s}=r,l=I0(X0,i),c=S.useRef(null),f=Vt(n,c);return S.useEffect(()=>{l.onAnchorChange((a==null?void 0:a.current)||c.current)}),a?null:A.jsx(Je.div,{...s,ref:f})});Z0.displayName=X0;var Nh="PopperContent",[R2,D2]=V0(Nh),W0=S.forwardRef((r,n)=>{var ge,le,xe,pe,Ae,Te;const{__scopePopper:i,side:a="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:f=0,avoidCollisions:d=!0,collisionBoundary:g=[],collisionPadding:m=0,sticky:v="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:x,...E}=r,T=I0(Nh,i),[M,N]=S.useState(null),L=Vt(n,Le=>N(Le)),[C,R]=S.useState(null),B=q0(C),_=(B==null?void 0:B.width)??0,$=(B==null?void 0:B.height)??0,z=a+(l!=="center"?"-"+l:""),F=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},Y=Array.isArray(g)?g:[g],I=Y.length>0,j={padding:F,boundary:Y.filter(k2),altBoundary:I},{refs:J,floatingStyles:ae,placement:H,isPositioned:U,middlewareData:D}=m2({strategy:"fixed",placement:z,whileElementsMounted:(...Le)=>l2(...Le,{animationFrame:b==="always"}),elements:{reference:T.anchor},middleware:[y2({mainAxis:s+$,alignmentAxis:c}),d&&b2({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?w2():void 0,...j}),d&&E2({...j}),S2({...j,apply:({elements:Le,rects:ve,availableWidth:he,availableHeight:K})=>{const{width:Re,height:Ve}=ve.reference,be=Le.floating.style;be.setProperty("--radix-popper-available-width",`${he}px`),be.setProperty("--radix-popper-available-height",`${K}px`),be.setProperty("--radix-popper-anchor-width",`${Re}px`),be.setProperty("--radix-popper-anchor-height",`${Ve}px`)}}),C&&_2({element:C,padding:f}),L2({arrowWidth:_,arrowHeight:$}),y&&x2({strategy:"referenceHidden",...j})]}),[se,G]=J0(H),P=Qr(x);Li(()=>{U&&(P==null||P())},[U,P]);const k=(ge=D.arrow)==null?void 0:ge.x,V=(le=D.arrow)==null?void 0:le.y,Q=((xe=D.arrow)==null?void 0:xe.centerOffset)!==0,[re,de]=S.useState();return Li(()=>{M&&de(window.getComputedStyle(M).zIndex)},[M]),A.jsx("div",{ref:J.setFloating,"data-radix-popper-content-wrapper":"",style:{...ae,transform:U?ae.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(pe=D.transformOrigin)==null?void 0:pe.x,(Ae=D.transformOrigin)==null?void 0:Ae.y].join(" "),...((Te=D.hide)==null?void 0:Te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:A.jsx(R2,{scope:i,placedSide:se,onArrowChange:R,arrowX:k,arrowY:V,shouldHideArrow:Q,children:A.jsx(Je.div,{"data-side":se,"data-align":G,...E,ref:L,style:{...E.style,animation:U?void 0:"none"}})})})});W0.displayName=Nh;var K0="PopperArrow",O2={top:"bottom",right:"left",bottom:"top",left:"right"},Q0=S.forwardRef(function(n,i){const{__scopePopper:a,...s}=n,l=D2(K0,a),c=O2[l.placedSide];return A.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:A.jsx(C2,{...s,ref:i,style:{...s.style,display:"block"}})})});Q0.displayName=K0;function k2(r){return r!==null}var L2=r=>({name:"transformOrigin",options:r,fn(n){var T,M,N;const{placement:i,rects:a,middlewareData:s}=n,c=((T=s.arrow)==null?void 0:T.centerOffset)!==0,f=c?0:r.arrowWidth,d=c?0:r.arrowHeight,[g,m]=J0(i),v={start:"0%",center:"50%",end:"100%"}[m],y=(((M=s.arrow)==null?void 0:M.x)??0)+f/2,b=(((N=s.arrow)==null?void 0:N.y)??0)+d/2;let x="",E="";return g==="bottom"?(x=c?v:`${y}px`,E=`${-d}px`):g==="top"?(x=c?v:`${y}px`,E=`${a.floating.height+d}px`):g==="right"?(x=`${-d}px`,E=c?v:`${b}px`):g==="left"&&(x=`${a.floating.width+d}px`,E=c?v:`${b}px`),{data:{x,y:E}}}});function J0(r){const[n,i="center"]=r.split("-");return[n,i]}var ew=Y0,zh=Z0,tw=W0,nw=Q0,N2="Portal",Gh=S.forwardRef((r,n)=>{var f;const{container:i,...a}=r,[s,l]=S.useState(!1);Li(()=>l(!0),[]);const c=i||s&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return c?aC.createPortal(A.jsx(Je.div,{...a,ref:n}),c):null});Gh.displayName=N2;function z2(r,n){return S.useReducer((i,a)=>n[i][a]??i,r)}var ni=r=>{const{present:n,children:i}=r,a=G2(n),s=typeof i=="function"?i({present:a.isPresent}):S.Children.only(i),l=Vt(a.ref,M2(s));return typeof i=="function"||a.isPresent?S.cloneElement(s,{ref:l}):null};ni.displayName="Presence";function G2(r){const[n,i]=S.useState(),a=S.useRef({}),s=S.useRef(r),l=S.useRef("none"),c=r?"mounted":"unmounted",[f,d]=z2(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const g=Cl(a.current);l.current=f==="mounted"?g:"none"},[f]),Li(()=>{const g=a.current,m=s.current;if(m!==r){const y=l.current,b=Cl(g);r?d("MOUNT"):b==="none"||(g==null?void 0:g.display)==="none"?d("UNMOUNT"):d(m&&y!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=r}},[r,d]),Li(()=>{if(n){let g;const m=n.ownerDocument.defaultView??window,v=b=>{const E=Cl(a.current).includes(b.animationName);if(b.target===n&&E&&(d("ANIMATION_END"),!s.current)){const T=n.style.animationFillMode;n.style.animationFillMode="forwards",g=m.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=T)})}},y=b=>{b.target===n&&(l.current=Cl(a.current))};return n.addEventListener("animationstart",y),n.addEventListener("animationcancel",v),n.addEventListener("animationend",v),()=>{m.clearTimeout(g),n.removeEventListener("animationstart",y),n.removeEventListener("animationcancel",v),n.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[n,d]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:S.useCallback(g=>{g&&(a.current=getComputedStyle(g)),i(g)},[])}}function Cl(r){return(r==null?void 0:r.animationName)||"none"}function M2(r){var a,s;let n=(a=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:a.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?r.ref:(n=(s=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:s.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?r.props.ref:r.props.ref||r.ref)}function yu({prop:r,defaultProp:n,onChange:i=()=>{}}){const[a,s]=j2({defaultProp:n,onChange:i}),l=r!==void 0,c=l?r:a,f=Qr(i),d=S.useCallback(g=>{if(l){const v=typeof g=="function"?g(r):g;v!==r&&f(v)}else s(g)},[l,r,s,f]);return[c,d]}function j2({defaultProp:r,onChange:n}){const i=S.useState(r),[a]=i,s=S.useRef(a),l=Qr(n);return S.useEffect(()=>{s.current!==a&&(l(a),s.current=a)},[a,s,l]),i}var U2=function(r){if(typeof document>"u")return null;var n=Array.isArray(r)?r[0]:r;return n.ownerDocument.body},wa=new WeakMap,Al=new WeakMap,Rl={},Wf=0,rw=function(r){return r&&(r.host||rw(r.parentNode))},B2=function(r,n){return n.map(function(i){if(r.contains(i))return i;var a=rw(i);return a&&r.contains(a)?a:(console.error("aria-hidden",i,"in not contained inside",r,". Doing nothing"),null)}).filter(function(i){return!!i})},F2=function(r,n,i,a){var s=B2(n,Array.isArray(r)?r:[r]);Rl[i]||(Rl[i]=new WeakMap);var l=Rl[i],c=[],f=new Set,d=new Set(s),g=function(v){!v||f.has(v)||(f.add(v),g(v.parentNode))};s.forEach(g);var m=function(v){!v||d.has(v)||Array.prototype.forEach.call(v.children,function(y){if(f.has(y))m(y);else try{var b=y.getAttribute(a),x=b!==null&&b!=="false",E=(wa.get(y)||0)+1,T=(l.get(y)||0)+1;wa.set(y,E),l.set(y,T),c.push(y),E===1&&x&&Al.set(y,!0),T===1&&y.setAttribute(i,"true"),x||y.setAttribute(a,"true")}catch(M){console.error("aria-hidden: cannot operate on ",y,M)}})};return m(n),f.clear(),Wf++,function(){c.forEach(function(v){var y=wa.get(v)-1,b=l.get(v)-1;wa.set(v,y),l.set(v,b),y||(Al.has(v)||v.removeAttribute(a),Al.delete(v)),b||v.removeAttribute(i)}),Wf--,Wf||(wa=new WeakMap,wa=new WeakMap,Al=new WeakMap,Rl={})}},iw=function(r,n,i){i===void 0&&(i="data-aria-hidden");var a=Array.from(Array.isArray(r)?r:[r]),s=U2(r);return s?(a.push.apply(a,Array.from(s.querySelectorAll("[aria-live]"))),F2(a,s,i,"aria-hidden")):function(){return null}},Pn=function(){return Pn=Object.assign||function(n){for(var i,a=1,s=arguments.length;a"u")return rA;var n=iA(r),i=document.documentElement.clientWidth,a=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,a-i+n[2]-n[0])}},oA=lw(),Ra="data-scroll-locked",sA=function(r,n,i,a){var s=r.left,l=r.top,c=r.right,f=r.gap;return i===void 0&&(i="margin"),` - .`.concat(P2,` { - overflow: hidden `).concat(a,`; - padding-right: `).concat(f,"px ").concat(a,`; - } - body[`).concat(Ra,`] { - overflow: hidden `).concat(a,`; - overscroll-behavior: contain; - `).concat([n&&"position: relative ".concat(a,";"),i==="margin"&&` - padding-left: `.concat(s,`px; - padding-top: `).concat(l,`px; - padding-right: `).concat(c,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(f,"px ").concat(a,`; - `),i==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),` - } - - .`).concat(ql,` { - right: `).concat(f,"px ").concat(a,`; - } - - .`).concat(Vl,` { - margin-right: `).concat(f,"px ").concat(a,`; - } - - .`).concat(ql," .").concat(ql,` { - right: 0 `).concat(a,`; - } - - .`).concat(Vl," .").concat(Vl,` { - margin-right: 0 `).concat(a,`; - } - - body[`).concat(Ra,`] { - `).concat($2,": ").concat(f,`px; - } -`)},Ay=function(){var r=parseInt(document.body.getAttribute(Ra)||"0",10);return isFinite(r)?r:0},lA=function(){S.useEffect(function(){return document.body.setAttribute(Ra,(Ay()+1).toString()),function(){var r=Ay()-1;r<=0?document.body.removeAttribute(Ra):document.body.setAttribute(Ra,r.toString())}},[])},uA=function(r){var n=r.noRelative,i=r.noImportant,a=r.gapMode,s=a===void 0?"margin":a;lA();var l=S.useMemo(function(){return aA(s)},[s]);return S.createElement(oA,{styles:sA(l,!n,s,i?"":"!important")})},Jd=!1;if(typeof window<"u")try{var Dl=Object.defineProperty({},"passive",{get:function(){return Jd=!0,!0}});window.addEventListener("test",Dl,Dl),window.removeEventListener("test",Dl,Dl)}catch{Jd=!1}var Ea=Jd?{passive:!1}:!1,cA=function(r){return r.tagName==="TEXTAREA"},uw=function(r,n){if(!(r instanceof Element))return!1;var i=window.getComputedStyle(r);return i[n]!=="hidden"&&!(i.overflowY===i.overflowX&&!cA(r)&&i[n]==="visible")},fA=function(r){return uw(r,"overflowY")},dA=function(r){return uw(r,"overflowX")},Ry=function(r,n){var i=n.ownerDocument,a=n;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var s=cw(r,a);if(s){var l=fw(r,a),c=l[1],f=l[2];if(c>f)return!0}a=a.parentNode}while(a&&a!==i.body);return!1},hA=function(r){var n=r.scrollTop,i=r.scrollHeight,a=r.clientHeight;return[n,i,a]},gA=function(r){var n=r.scrollLeft,i=r.scrollWidth,a=r.clientWidth;return[n,i,a]},cw=function(r,n){return r==="v"?fA(n):dA(n)},fw=function(r,n){return r==="v"?hA(n):gA(n)},pA=function(r,n){return r==="h"&&n==="rtl"?-1:1},mA=function(r,n,i,a,s){var l=pA(r,window.getComputedStyle(n).direction),c=l*a,f=i.target,d=n.contains(f),g=!1,m=c>0,v=0,y=0;do{var b=fw(r,f),x=b[0],E=b[1],T=b[2],M=E-T-l*x;(x||M)&&cw(r,f)&&(v+=M,y+=x),f instanceof ShadowRoot?f=f.host:f=f.parentNode}while(!d&&f!==document.body||d&&(n.contains(f)||n===f));return(m&&Math.abs(v)<1||!m&&Math.abs(y)<1)&&(g=!0),g},Ol=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Dy=function(r){return[r.deltaX,r.deltaY]},Oy=function(r){return r&&"current"in r?r.current:r},vA=function(r,n){return r[0]===n[0]&&r[1]===n[1]},yA=function(r){return` - .block-interactivity-`.concat(r,` {pointer-events: none;} - .allow-interactivity-`).concat(r,` {pointer-events: all;} -`)},bA=0,Sa=[];function wA(r){var n=S.useRef([]),i=S.useRef([0,0]),a=S.useRef(),s=S.useState(bA++)[0],l=S.useState(lw)[0],c=S.useRef(r);S.useEffect(function(){c.current=r},[r]),S.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(s));var E=H2([r.lockRef.current],(r.shards||[]).map(Oy),!0).filter(Boolean);return E.forEach(function(T){return T.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),E.forEach(function(T){return T.classList.remove("allow-interactivity-".concat(s))})}}},[r.inert,r.lockRef.current,r.shards]);var f=S.useCallback(function(E,T){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!c.current.allowPinchZoom;var M=Ol(E),N=i.current,L="deltaX"in E?E.deltaX:N[0]-M[0],C="deltaY"in E?E.deltaY:N[1]-M[1],R,B=E.target,_=Math.abs(L)>Math.abs(C)?"h":"v";if("touches"in E&&_==="h"&&B.type==="range")return!1;var $=Ry(_,B);if(!$)return!0;if($?R=_:(R=_==="v"?"h":"v",$=Ry(_,B)),!$)return!1;if(!a.current&&"changedTouches"in E&&(L||C)&&(a.current=R),!R)return!0;var z=a.current||R;return mA(z,T,E,z==="h"?L:C)},[]),d=S.useCallback(function(E){var T=E;if(!(!Sa.length||Sa[Sa.length-1]!==l)){var M="deltaY"in T?Dy(T):Ol(T),N=n.current.filter(function(R){return R.name===T.type&&(R.target===T.target||T.target===R.shadowParent)&&vA(R.delta,M)})[0];if(N&&N.should){T.cancelable&&T.preventDefault();return}if(!N){var L=(c.current.shards||[]).map(Oy).filter(Boolean).filter(function(R){return R.contains(T.target)}),C=L.length>0?f(T,L[0]):!c.current.noIsolation;C&&T.cancelable&&T.preventDefault()}}},[]),g=S.useCallback(function(E,T,M,N){var L={name:E,delta:T,target:M,should:N,shadowParent:EA(M)};n.current.push(L),setTimeout(function(){n.current=n.current.filter(function(C){return C!==L})},1)},[]),m=S.useCallback(function(E){i.current=Ol(E),a.current=void 0},[]),v=S.useCallback(function(E){g(E.type,Dy(E),E.target,f(E,r.lockRef.current))},[]),y=S.useCallback(function(E){g(E.type,Ol(E),E.target,f(E,r.lockRef.current))},[]);S.useEffect(function(){return Sa.push(l),r.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:y}),document.addEventListener("wheel",d,Ea),document.addEventListener("touchmove",d,Ea),document.addEventListener("touchstart",m,Ea),function(){Sa=Sa.filter(function(E){return E!==l}),document.removeEventListener("wheel",d,Ea),document.removeEventListener("touchmove",d,Ea),document.removeEventListener("touchstart",m,Ea)}},[]);var b=r.removeScrollBar,x=r.inert;return S.createElement(S.Fragment,null,x?S.createElement(l,{styles:yA(s)}):null,b?S.createElement(uA,{gapMode:r.gapMode}):null)}function EA(r){for(var n=null;r!==null;)r instanceof ShadowRoot&&(n=r.host,r=r.host),r=r.parentNode;return n}const SA=W2(sw,wA);var Mh=S.forwardRef(function(r,n){return S.createElement(bu,Pn({},r,{ref:n,sideCar:SA}))});Mh.classNames=bu.classNames;var jh="Popover",[dw,Az]=rs(jh,[vu]),os=vu(),[xA,ri]=dw(jh),hw=r=>{const{__scopePopover:n,children:i,open:a,defaultOpen:s,onOpenChange:l,modal:c=!1}=r,f=os(n),d=S.useRef(null),[g,m]=S.useState(!1),[v=!1,y]=yu({prop:a,defaultProp:s,onChange:l});return A.jsx(ew,{...f,children:A.jsx(xA,{scope:n,contentId:Ln(),triggerRef:d,open:v,onOpenChange:y,onOpenToggle:S.useCallback(()=>y(b=>!b),[y]),hasCustomAnchor:g,onCustomAnchorAdd:S.useCallback(()=>m(!0),[]),onCustomAnchorRemove:S.useCallback(()=>m(!1),[]),modal:c,children:i})})};hw.displayName=jh;var gw="PopoverAnchor",_A=S.forwardRef((r,n)=>{const{__scopePopover:i,...a}=r,s=ri(gw,i),l=os(i),{onCustomAnchorAdd:c,onCustomAnchorRemove:f}=s;return S.useEffect(()=>(c(),()=>f()),[c,f]),A.jsx(zh,{...l,...a,ref:n})});_A.displayName=gw;var pw="PopoverTrigger",mw=S.forwardRef((r,n)=>{const{__scopePopover:i,...a}=r,s=ri(pw,i),l=os(i),c=Vt(n,s.triggerRef),f=A.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Ew(s.open),...a,ref:c,onClick:ht(r.onClick,s.onOpenToggle)});return s.hasCustomAnchor?f:A.jsx(zh,{asChild:!0,...l,children:f})});mw.displayName=pw;var Uh="PopoverPortal",[TA,CA]=dw(Uh,{forceMount:void 0}),vw=r=>{const{__scopePopover:n,forceMount:i,children:a,container:s}=r,l=ri(Uh,n);return A.jsx(TA,{scope:n,forceMount:i,children:A.jsx(ni,{present:i||l.open,children:A.jsx(Gh,{asChild:!0,container:s,children:a})})})};vw.displayName=Uh;var ka="PopoverContent",yw=S.forwardRef((r,n)=>{const i=CA(ka,r.__scopePopover),{forceMount:a=i.forceMount,...s}=r,l=ri(ka,r.__scopePopover);return A.jsx(ni,{present:a||l.open,children:l.modal?A.jsx(AA,{...s,ref:n}):A.jsx(RA,{...s,ref:n})})});yw.displayName=ka;var AA=S.forwardRef((r,n)=>{const i=ri(ka,r.__scopePopover),a=S.useRef(null),s=Vt(n,a),l=S.useRef(!1);return S.useEffect(()=>{const c=a.current;if(c)return iw(c)},[]),A.jsx(Mh,{as:is,allowPinchZoom:!0,children:A.jsx(bw,{...r,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ht(r.onCloseAutoFocus,c=>{var f;c.preventDefault(),l.current||(f=i.triggerRef.current)==null||f.focus()}),onPointerDownOutside:ht(r.onPointerDownOutside,c=>{const f=c.detail.originalEvent,d=f.button===0&&f.ctrlKey===!0,g=f.button===2||d;l.current=g},{checkForDefaultPrevented:!1}),onFocusOutside:ht(r.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),RA=S.forwardRef((r,n)=>{const i=ri(ka,r.__scopePopover),a=S.useRef(!1),s=S.useRef(!1);return A.jsx(bw,{...r,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,f;(c=r.onCloseAutoFocus)==null||c.call(r,l),l.defaultPrevented||(a.current||(f=i.triggerRef.current)==null||f.focus(),l.preventDefault()),a.current=!1,s.current=!1},onInteractOutside:l=>{var d,g;(d=r.onInteractOutside)==null||d.call(r,l),l.defaultPrevented||(a.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;((g=i.triggerRef.current)==null?void 0:g.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),bw=S.forwardRef((r,n)=>{const{__scopePopover:i,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:g,onInteractOutside:m,...v}=r,y=ri(ka,i),b=os(i);return k0(),A.jsx(_h,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:l,children:A.jsx(hu,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:m,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:g,onDismiss:()=>y.onOpenChange(!1),children:A.jsx(tw,{"data-state":Ew(y.open),role:"dialog",id:y.contentId,...b,...v,ref:n,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),ww="PopoverClose",DA=S.forwardRef((r,n)=>{const{__scopePopover:i,...a}=r,s=ri(ww,i);return A.jsx(Je.button,{type:"button",...a,ref:n,onClick:ht(r.onClick,()=>s.onOpenChange(!1))})});DA.displayName=ww;var OA="PopoverArrow",kA=S.forwardRef((r,n)=>{const{__scopePopover:i,...a}=r,s=os(i);return A.jsx(nw,{...s,...a,ref:n})});kA.displayName=OA;function Ew(r){return r?"open":"closed"}var LA=hw,NA=mw,zA=vw,Sw=yw;const wu=LA,Eu=NA,ss=S.forwardRef(({className:r,align:n="center",sideOffset:i=4,...a},s)=>A.jsx(zA,{children:A.jsx(Sw,{ref:s,align:n,sideOffset:i,className:Xe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-4 shadow-md outline-none",r),...a})}));ss.displayName=Sw.displayName;const GA=({status:r})=>r?A.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[A.jsxs("div",{className:"space-y-1",children:[A.jsx("h4",{className:"font-medium",children:"Storage Info"}),A.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[A.jsx("span",{children:"Working Directory:"}),A.jsx("span",{className:"truncate",children:r.working_directory}),A.jsx("span",{children:"Input Directory:"}),A.jsx("span",{className:"truncate",children:r.input_directory}),A.jsx("span",{children:"Indexed Files:"}),A.jsx("span",{children:r.indexed_files_count})]})]}),A.jsxs("div",{className:"space-y-1",children:[A.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),A.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[A.jsx("span",{children:"LLM Binding:"}),A.jsx("span",{children:r.configuration.llm_binding}),A.jsx("span",{children:"LLM Binding Host:"}),A.jsx("span",{children:r.configuration.llm_binding_host}),A.jsx("span",{children:"LLM Model:"}),A.jsx("span",{children:r.configuration.llm_model}),A.jsx("span",{children:"Max Tokens:"}),A.jsx("span",{children:r.configuration.max_tokens})]})]}),A.jsxs("div",{className:"space-y-1",children:[A.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),A.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[A.jsx("span",{children:"Embedding Binding:"}),A.jsx("span",{children:r.configuration.embedding_binding}),A.jsx("span",{children:"Embedding Binding Host:"}),A.jsx("span",{children:r.configuration.embedding_binding_host}),A.jsx("span",{children:"Embedding Model:"}),A.jsx("span",{children:r.configuration.embedding_model})]})]}),A.jsxs("div",{className:"space-y-1",children:[A.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),A.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[A.jsx("span",{children:"KV Storage:"}),A.jsx("span",{children:r.configuration.kv_storage}),A.jsx("span",{children:"Doc Status Storage:"}),A.jsx("span",{children:r.configuration.doc_status_storage}),A.jsx("span",{children:"Graph Storage:"}),A.jsx("span",{children:r.configuration.graph_storage}),A.jsx("span",{children:"Vector Storage:"}),A.jsx("span",{children:r.configuration.vector_storage})]})]})]}):A.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),MA=()=>{const r=kn.use.health(),n=kn.use.lastCheckTime(),i=kn.use.status(),[a,s]=S.useState(!1);return S.useEffect(()=>{s(!0);const l=setTimeout(()=>s(!1),300);return()=>clearTimeout(l)},[n]),A.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:A.jsxs(wu,{children:[A.jsx(Eu,{asChild:!0,children:A.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[A.jsx("div",{className:Xe("h-3 w-3 rounded-full transition-all duration-300","shadow-[0_0_8px_rgba(0,0,0,0.2)]",r?"bg-green-500":"bg-red-500",a&&"scale-125",a&&r&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",a&&!r&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),A.jsx("span",{className:"text-muted-foreground text-xs",children:r?"Connected":"Disconnected"})]})}),A.jsx(ss,{className:"w-auto",side:"top",align:"end",children:A.jsx(GA,{status:i})})]})})};var kl={exports:{}},ky;function jA(){if(ky)return kl.exports;ky=1;var r=typeof Reflect=="object"?Reflect:null,n=r&&typeof r.apply=="function"?r.apply:function(R,B,_){return Function.prototype.apply.call(R,B,_)},i;r&&typeof r.ownKeys=="function"?i=r.ownKeys:Object.getOwnPropertySymbols?i=function(R){return Object.getOwnPropertyNames(R).concat(Object.getOwnPropertySymbols(R))}:i=function(R){return Object.getOwnPropertyNames(R)};function a(C){console&&console.warn&&console.warn(C)}var s=Number.isNaN||function(R){return R!==R};function l(){l.init.call(this)}kl.exports=l,kl.exports.once=M,l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var c=10;function f(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(C){if(typeof C!="number"||C<0||s(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");c=C}}),l.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(R){if(typeof R!="number"||R<0||s(R))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+R+".");return this._maxListeners=R,this};function d(C){return C._maxListeners===void 0?l.defaultMaxListeners:C._maxListeners}l.prototype.getMaxListeners=function(){return d(this)},l.prototype.emit=function(R){for(var B=[],_=1;_0&&(F=B[0]),F instanceof Error)throw F;var Y=new Error("Unhandled error."+(F?" ("+F.message+")":""));throw Y.context=F,Y}var I=z[R];if(I===void 0)return!1;if(typeof I=="function")n(I,this,B);else for(var j=I.length,J=x(I,j),_=0;_0&&F.length>$&&!F.warned){F.warned=!0;var Y=new Error("Possible EventEmitter memory leak detected. "+F.length+" "+String(R)+" listeners added. Use emitter.setMaxListeners() to increase limit");Y.name="MaxListenersExceededWarning",Y.emitter=C,Y.type=R,Y.count=F.length,a(Y)}return C}l.prototype.addListener=function(R,B){return g(this,R,B,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(R,B){return g(this,R,B,!0)};function m(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function v(C,R,B){var _={fired:!1,wrapFn:void 0,target:C,type:R,listener:B},$=m.bind(_);return $.listener=B,_.wrapFn=$,$}l.prototype.once=function(R,B){return f(B),this.on(R,v(this,R,B)),this},l.prototype.prependOnceListener=function(R,B){return f(B),this.prependListener(R,v(this,R,B)),this},l.prototype.removeListener=function(R,B){var _,$,z,F,Y;if(f(B),$=this._events,$===void 0)return this;if(_=$[R],_===void 0)return this;if(_===B||_.listener===B)--this._eventsCount===0?this._events=Object.create(null):(delete $[R],$.removeListener&&this.emit("removeListener",R,_.listener||B));else if(typeof _!="function"){for(z=-1,F=_.length-1;F>=0;F--)if(_[F]===B||_[F].listener===B){Y=_[F].listener,z=F;break}if(z<0)return this;z===0?_.shift():E(_,z),_.length===1&&($[R]=_[0]),$.removeListener!==void 0&&this.emit("removeListener",R,Y||B)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(R){var B,_,$;if(_=this._events,_===void 0)return this;if(_.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):_[R]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete _[R]),this;if(arguments.length===0){var z=Object.keys(_),F;for($=0;$=0;$--)this.removeListener(R,B[$]);return this};function y(C,R,B){var _=C._events;if(_===void 0)return[];var $=_[R];return $===void 0?[]:typeof $=="function"?B?[$.listener||$]:[$]:B?T($):x($,$.length)}l.prototype.listeners=function(R){return y(this,R,!0)},l.prototype.rawListeners=function(R){return y(this,R,!1)},l.listenerCount=function(C,R){return typeof C.listenerCount=="function"?C.listenerCount(R):b.call(C,R)},l.prototype.listenerCount=b;function b(C){var R=this._events;if(R!==void 0){var B=R[C];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}l.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function x(C,R){for(var B=new Array(R),_=0;_r++}function yr(){const r=arguments;let n=null,i=-1;return{[Symbol.iterator](){return this},next(){let a=null;do{if(n===null){if(i++,i>=r.length)return{done:!0};n=r[i][Symbol.iterator]()}if(a=n.next(),a.done){n=null;continue}break}while(!0);return a}}}function Ba(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class Bh extends Error{constructor(n){super(),this.name="GraphError",this.message=n}}class ye extends Bh{constructor(n){super(n),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ye.prototype.constructor)}}class me extends Bh{constructor(n){super(n),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,me.prototype.constructor)}}class ke extends Bh{constructor(n){super(n),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ke.prototype.constructor)}}function Tw(r,n){this.key=r,this.attributes=n,this.clear()}Tw.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function Cw(r,n){this.key=r,this.attributes=n,this.clear()}Cw.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function Aw(r,n){this.key=r,this.attributes=n,this.clear()}Aw.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Fa(r,n,i,a,s){this.key=n,this.attributes=s,this.undirected=r,this.source=i,this.target=a}Fa.prototype.attach=function(){let r="out",n="in";this.undirected&&(r=n="undirected");const i=this.source.key,a=this.target.key;this.source[r][a]=this,!(this.undirected&&i===a)&&(this.target[n][i]=this)};Fa.prototype.attachMulti=function(){let r="out",n="in";const i=this.source.key,a=this.target.key;this.undirected&&(r=n="undirected");const s=this.source[r],l=s[a];if(typeof l>"u"){s[a]=this,this.undirected&&i===a||(this.target[n][i]=this);return}l.previous=this,this.next=l,s[a]=this,this.target[n][i]=this};Fa.prototype.detach=function(){const r=this.source.key,n=this.target.key;let i="out",a="in";this.undirected&&(i=a="undirected"),delete this.source[i][n],delete this.target[a][r]};Fa.prototype.detachMulti=function(){const r=this.source.key,n=this.target.key;let i="out",a="in";this.undirected&&(i=a="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[i][n],delete this.target[a][r]):(this.next.previous=void 0,this.source[i][n]=this.next,this.target[a][r]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const Rw=0,Dw=1,FA=2,Ow=3;function Er(r,n,i,a,s,l,c){let f,d,g,m;if(a=""+a,i===Rw){if(f=r._nodes.get(a),!f)throw new me(`Graph.${n}: could not find the "${a}" node in the graph.`);g=s,m=l}else if(i===Ow){if(s=""+s,d=r._edges.get(s),!d)throw new me(`Graph.${n}: could not find the "${s}" edge in the graph.`);const v=d.source.key,y=d.target.key;if(a===v)f=d.target;else if(a===y)f=d.source;else throw new me(`Graph.${n}: the "${a}" node is not attached to the "${s}" edge (${v}, ${y}).`);g=l,m=c}else{if(d=r._edges.get(a),!d)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`);i===Dw?f=d.source:f=d.target,g=s,m=l}return[f,g,m]}function HA(r,n,i){r.prototype[n]=function(a,s,l){const[c,f]=Er(this,n,i,a,s,l);return c.attributes[f]}}function PA(r,n,i){r.prototype[n]=function(a,s){const[l]=Er(this,n,i,a,s);return l.attributes}}function $A(r,n,i){r.prototype[n]=function(a,s,l){const[c,f]=Er(this,n,i,a,s,l);return c.attributes.hasOwnProperty(f)}}function qA(r,n,i){r.prototype[n]=function(a,s,l,c){const[f,d,g]=Er(this,n,i,a,s,l,c);return f.attributes[d]=g,this.emit("nodeAttributesUpdated",{key:f.key,type:"set",attributes:f.attributes,name:d}),this}}function VA(r,n,i){r.prototype[n]=function(a,s,l,c){const[f,d,g]=Er(this,n,i,a,s,l,c);if(typeof g!="function")throw new ye(`Graph.${n}: updater should be a function.`);const m=f.attributes,v=g(m[d]);return m[d]=v,this.emit("nodeAttributesUpdated",{key:f.key,type:"set",attributes:f.attributes,name:d}),this}}function IA(r,n,i){r.prototype[n]=function(a,s,l){const[c,f]=Er(this,n,i,a,s,l);return delete c.attributes[f],this.emit("nodeAttributesUpdated",{key:c.key,type:"remove",attributes:c.attributes,name:f}),this}}function YA(r,n,i){r.prototype[n]=function(a,s,l){const[c,f]=Er(this,n,i,a,s,l);if(!Nt(f))throw new ye(`Graph.${n}: provided attributes are not a plain object.`);return c.attributes=f,this.emit("nodeAttributesUpdated",{key:c.key,type:"replace",attributes:c.attributes}),this}}function XA(r,n,i){r.prototype[n]=function(a,s,l){const[c,f]=Er(this,n,i,a,s,l);if(!Nt(f))throw new ye(`Graph.${n}: provided attributes are not a plain object.`);return wt(c.attributes,f),this.emit("nodeAttributesUpdated",{key:c.key,type:"merge",attributes:c.attributes,data:f}),this}}function ZA(r,n,i){r.prototype[n]=function(a,s,l){const[c,f]=Er(this,n,i,a,s,l);if(typeof f!="function")throw new ye(`Graph.${n}: provided updater is not a function.`);return c.attributes=f(c.attributes),this.emit("nodeAttributesUpdated",{key:c.key,type:"update",attributes:c.attributes}),this}}const WA=[{name:r=>`get${r}Attribute`,attacher:HA},{name:r=>`get${r}Attributes`,attacher:PA},{name:r=>`has${r}Attribute`,attacher:$A},{name:r=>`set${r}Attribute`,attacher:qA},{name:r=>`update${r}Attribute`,attacher:VA},{name:r=>`remove${r}Attribute`,attacher:IA},{name:r=>`replace${r}Attributes`,attacher:YA},{name:r=>`merge${r}Attributes`,attacher:XA},{name:r=>`update${r}Attributes`,attacher:ZA}];function KA(r){WA.forEach(function({name:n,attacher:i}){i(r,n("Node"),Rw),i(r,n("Source"),Dw),i(r,n("Target"),FA),i(r,n("Opposite"),Ow)})}function QA(r,n,i){r.prototype[n]=function(a,s){let l;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,f=""+s;if(s=arguments[2],l=En(this,c,f,i),!l)throw new me(`Graph.${n}: could not find an edge for the given path ("${c}" - "${f}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,l=this._edges.get(a),!l)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}return l.attributes[s]}}function JA(r,n,i){r.prototype[n]=function(a){let s;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+a,c=""+arguments[1];if(s=En(this,l,c,i),!s)throw new me(`Graph.${n}: could not find an edge for the given path ("${l}" - "${c}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,s=this._edges.get(a),!s)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}return s.attributes}}function eR(r,n,i){r.prototype[n]=function(a,s){let l;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,f=""+s;if(s=arguments[2],l=En(this,c,f,i),!l)throw new me(`Graph.${n}: could not find an edge for the given path ("${c}" - "${f}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,l=this._edges.get(a),!l)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}return l.attributes.hasOwnProperty(s)}}function tR(r,n,i){r.prototype[n]=function(a,s,l){let c;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const f=""+a,d=""+s;if(s=arguments[2],l=arguments[3],c=En(this,f,d,i),!c)throw new me(`Graph.${n}: could not find an edge for the given path ("${f}" - "${d}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,c=this._edges.get(a),!c)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}return c.attributes[s]=l,this.emit("edgeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:s}),this}}function nR(r,n,i){r.prototype[n]=function(a,s,l){let c;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const f=""+a,d=""+s;if(s=arguments[2],l=arguments[3],c=En(this,f,d,i),!c)throw new me(`Graph.${n}: could not find an edge for the given path ("${f}" - "${d}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,c=this._edges.get(a),!c)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}if(typeof l!="function")throw new ye(`Graph.${n}: updater should be a function.`);return c.attributes[s]=l(c.attributes[s]),this.emit("edgeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:s}),this}}function rR(r,n,i){r.prototype[n]=function(a,s){let l;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,f=""+s;if(s=arguments[2],l=En(this,c,f,i),!l)throw new me(`Graph.${n}: could not find an edge for the given path ("${c}" - "${f}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,l=this._edges.get(a),!l)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}return delete l.attributes[s],this.emit("edgeAttributesUpdated",{key:l.key,type:"remove",attributes:l.attributes,name:s}),this}}function iR(r,n,i){r.prototype[n]=function(a,s){let l;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,f=""+s;if(s=arguments[2],l=En(this,c,f,i),!l)throw new me(`Graph.${n}: could not find an edge for the given path ("${c}" - "${f}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,l=this._edges.get(a),!l)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}if(!Nt(s))throw new ye(`Graph.${n}: provided attributes are not a plain object.`);return l.attributes=s,this.emit("edgeAttributesUpdated",{key:l.key,type:"replace",attributes:l.attributes}),this}}function aR(r,n,i){r.prototype[n]=function(a,s){let l;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,f=""+s;if(s=arguments[2],l=En(this,c,f,i),!l)throw new me(`Graph.${n}: could not find an edge for the given path ("${c}" - "${f}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,l=this._edges.get(a),!l)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}if(!Nt(s))throw new ye(`Graph.${n}: provided attributes are not a plain object.`);return wt(l.attributes,s),this.emit("edgeAttributesUpdated",{key:l.key,type:"merge",attributes:l.attributes,data:s}),this}}function oR(r,n,i){r.prototype[n]=function(a,s){let l;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,f=""+s;if(s=arguments[2],l=En(this,c,f,i),!l)throw new me(`Graph.${n}: could not find an edge for the given path ("${c}" - "${f}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,l=this._edges.get(a),!l)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}if(typeof s!="function")throw new ye(`Graph.${n}: provided updater is not a function.`);return l.attributes=s(l.attributes),this.emit("edgeAttributesUpdated",{key:l.key,type:"update",attributes:l.attributes}),this}}const sR=[{name:r=>`get${r}Attribute`,attacher:QA},{name:r=>`get${r}Attributes`,attacher:JA},{name:r=>`has${r}Attribute`,attacher:eR},{name:r=>`set${r}Attribute`,attacher:tR},{name:r=>`update${r}Attribute`,attacher:nR},{name:r=>`remove${r}Attribute`,attacher:rR},{name:r=>`replace${r}Attributes`,attacher:iR},{name:r=>`merge${r}Attributes`,attacher:aR},{name:r=>`update${r}Attributes`,attacher:oR}];function lR(r){sR.forEach(function({name:n,attacher:i}){i(r,n("Edge"),"mixed"),i(r,n("DirectedEdge"),"directed"),i(r,n("UndirectedEdge"),"undirected")})}const uR=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function cR(r,n,i,a){let s=!1;for(const l in n){if(l===a)continue;const c=n[l];if(s=i(c.key,c.attributes,c.source.key,c.target.key,c.source.attributes,c.target.attributes,c.undirected),r&&s)return c.key}}function fR(r,n,i,a){let s,l,c,f=!1;for(const d in n)if(d!==a){s=n[d];do{if(l=s.source,c=s.target,f=i(s.key,s.attributes,l.key,c.key,l.attributes,c.attributes,s.undirected),r&&f)return s.key;s=s.next}while(s!==void 0)}}function ed(r,n){const i=Object.keys(r),a=i.length;let s,l=0;return{[Symbol.iterator](){return this},next(){do if(s)s=s.next;else{if(l>=a)return{done:!0};const c=i[l++];if(c===n){s=void 0;continue}s=r[c]}while(!s);return{done:!1,value:{edge:s.key,attributes:s.attributes,source:s.source.key,target:s.target.key,sourceAttributes:s.source.attributes,targetAttributes:s.target.attributes,undirected:s.undirected}}}}}function dR(r,n,i,a){const s=n[i];if(!s)return;const l=s.source,c=s.target;if(a(s.key,s.attributes,l.key,c.key,l.attributes,c.attributes,s.undirected)&&r)return s.key}function hR(r,n,i,a){let s=n[i];if(!s)return;let l=!1;do{if(l=a(s.key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes,s.undirected),r&&l)return s.key;s=s.next}while(s!==void 0)}function td(r,n){let i=r[n];if(i.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!i)return{done:!0};const s={edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected};return i=i.next,{done:!1,value:s}}};let a=!1;return{[Symbol.iterator](){return this},next(){return a===!0?{done:!0}:(a=!0,{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}})}}}function gR(r,n){if(r.size===0)return[];if(n==="mixed"||n===r.type)return Array.from(r._edges.keys());const i=n==="undirected"?r.undirectedSize:r.directedSize,a=new Array(i),s=n==="undirected",l=r._edges.values();let c=0,f,d;for(;f=l.next(),f.done!==!0;)d=f.value,d.undirected===s&&(a[c++]=d.key);return a}function kw(r,n,i,a){if(n.size===0)return;const s=i!=="mixed"&&i!==n.type,l=i==="undirected";let c,f,d=!1;const g=n._edges.values();for(;c=g.next(),c.done!==!0;){if(f=c.value,s&&f.undirected!==l)continue;const{key:m,attributes:v,source:y,target:b}=f;if(d=a(m,v,y.key,b.key,y.attributes,b.attributes,f.undirected),r&&d)return m}}function pR(r,n){if(r.size===0)return Ba();const i=n!=="mixed"&&n!==r.type,a=n==="undirected",s=r._edges.values();return{[Symbol.iterator](){return this},next(){let l,c;for(;;){if(l=s.next(),l.done)return l;if(c=l.value,!(i&&c.undirected!==a))break}return{value:{edge:c.key,attributes:c.attributes,source:c.source.key,target:c.target.key,sourceAttributes:c.source.attributes,targetAttributes:c.target.attributes,undirected:c.undirected},done:!1}}}}function Fh(r,n,i,a,s,l){const c=n?fR:cR;let f;if(i!=="undirected"&&(a!=="out"&&(f=c(r,s.in,l),r&&f)||a!=="in"&&(f=c(r,s.out,l,a?void 0:s.key),r&&f))||i!=="directed"&&(f=c(r,s.undirected,l),r&&f))return f}function mR(r,n,i,a){const s=[];return Fh(!1,r,n,i,a,function(l){s.push(l)}),s}function vR(r,n,i){let a=Ba();return r!=="undirected"&&(n!=="out"&&typeof i.in<"u"&&(a=yr(a,ed(i.in))),n!=="in"&&typeof i.out<"u"&&(a=yr(a,ed(i.out,n?void 0:i.key)))),r!=="directed"&&typeof i.undirected<"u"&&(a=yr(a,ed(i.undirected))),a}function Hh(r,n,i,a,s,l,c){const f=i?hR:dR;let d;if(n!=="undirected"&&(typeof s.in<"u"&&a!=="out"&&(d=f(r,s.in,l,c),r&&d)||typeof s.out<"u"&&a!=="in"&&(a||s.key!==l)&&(d=f(r,s.out,l,c),r&&d))||n!=="directed"&&typeof s.undirected<"u"&&(d=f(r,s.undirected,l,c),r&&d))return d}function yR(r,n,i,a,s){const l=[];return Hh(!1,r,n,i,a,s,function(c){l.push(c)}),l}function bR(r,n,i,a){let s=Ba();return r!=="undirected"&&(typeof i.in<"u"&&n!=="out"&&a in i.in&&(s=yr(s,td(i.in,a))),typeof i.out<"u"&&n!=="in"&&a in i.out&&(n||i.key!==a)&&(s=yr(s,td(i.out,a)))),r!=="directed"&&typeof i.undirected<"u"&&a in i.undirected&&(s=yr(s,td(i.undirected,a))),s}function wR(r,n){const{name:i,type:a,direction:s}=n;r.prototype[i]=function(l,c){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return[];if(!arguments.length)return gR(this,a);if(arguments.length===1){l=""+l;const f=this._nodes.get(l);if(typeof f>"u")throw new me(`Graph.${i}: could not find the "${l}" node in the graph.`);return mR(this.multi,a==="mixed"?this.type:a,s,f)}if(arguments.length===2){l=""+l,c=""+c;const f=this._nodes.get(l);if(!f)throw new me(`Graph.${i}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(c))throw new me(`Graph.${i}: could not find the "${c}" target node in the graph.`);return yR(a,this.multi,s,f,c)}throw new ye(`Graph.${i}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function ER(r,n){const{name:i,type:a,direction:s}=n,l="forEach"+i[0].toUpperCase()+i.slice(1,-1);r.prototype[l]=function(g,m,v){if(!(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)){if(arguments.length===1)return v=g,kw(!1,this,a,v);if(arguments.length===2){g=""+g,v=m;const y=this._nodes.get(g);if(typeof y>"u")throw new me(`Graph.${l}: could not find the "${g}" node in the graph.`);return Fh(!1,this.multi,a==="mixed"?this.type:a,s,y,v)}if(arguments.length===3){g=""+g,m=""+m;const y=this._nodes.get(g);if(!y)throw new me(`Graph.${l}: could not find the "${g}" source node in the graph.`);if(!this._nodes.has(m))throw new me(`Graph.${l}: could not find the "${m}" target node in the graph.`);return Hh(!1,a,this.multi,s,y,m,v)}throw new ye(`Graph.${l}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const c="map"+i[0].toUpperCase()+i.slice(1);r.prototype[c]=function(){const g=Array.prototype.slice.call(arguments),m=g.pop();let v;if(g.length===0){let y=0;a!=="directed"&&(y+=this.undirectedSize),a!=="undirected"&&(y+=this.directedSize),v=new Array(y);let b=0;g.push((x,E,T,M,N,L,C)=>{v[b++]=m(x,E,T,M,N,L,C)})}else v=[],g.push((y,b,x,E,T,M,N)=>{v.push(m(y,b,x,E,T,M,N))});return this[l].apply(this,g),v};const f="filter"+i[0].toUpperCase()+i.slice(1);r.prototype[f]=function(){const g=Array.prototype.slice.call(arguments),m=g.pop(),v=[];return g.push((y,b,x,E,T,M,N)=>{m(y,b,x,E,T,M,N)&&v.push(y)}),this[l].apply(this,g),v};const d="reduce"+i[0].toUpperCase()+i.slice(1);r.prototype[d]=function(){let g=Array.prototype.slice.call(arguments);if(g.length<2||g.length>4)throw new ye(`Graph.${d}: invalid number of arguments (expecting 2, 3 or 4 and got ${g.length}).`);if(typeof g[g.length-1]=="function"&&typeof g[g.length-2]!="function")throw new ye(`Graph.${d}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let m,v;g.length===2?(m=g[0],v=g[1],g=[]):g.length===3?(m=g[1],v=g[2],g=[g[0]]):g.length===4&&(m=g[2],v=g[3],g=[g[0],g[1]]);let y=v;return g.push((b,x,E,T,M,N,L)=>{y=m(y,b,x,E,T,M,N,L)}),this[l].apply(this,g),y}}function SR(r,n){const{name:i,type:a,direction:s}=n,l="find"+i[0].toUpperCase()+i.slice(1,-1);r.prototype[l]=function(d,g,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return!1;if(arguments.length===1)return m=d,kw(!0,this,a,m);if(arguments.length===2){d=""+d,m=g;const v=this._nodes.get(d);if(typeof v>"u")throw new me(`Graph.${l}: could not find the "${d}" node in the graph.`);return Fh(!0,this.multi,a==="mixed"?this.type:a,s,v,m)}if(arguments.length===3){d=""+d,g=""+g;const v=this._nodes.get(d);if(!v)throw new me(`Graph.${l}: could not find the "${d}" source node in the graph.`);if(!this._nodes.has(g))throw new me(`Graph.${l}: could not find the "${g}" target node in the graph.`);return Hh(!0,a,this.multi,s,v,g,m)}throw new ye(`Graph.${l}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const c="some"+i[0].toUpperCase()+i.slice(1,-1);r.prototype[c]=function(){const d=Array.prototype.slice.call(arguments),g=d.pop();return d.push((v,y,b,x,E,T,M)=>g(v,y,b,x,E,T,M)),!!this[l].apply(this,d)};const f="every"+i[0].toUpperCase()+i.slice(1,-1);r.prototype[f]=function(){const d=Array.prototype.slice.call(arguments),g=d.pop();return d.push((v,y,b,x,E,T,M)=>!g(v,y,b,x,E,T,M)),!this[l].apply(this,d)}}function xR(r,n){const{name:i,type:a,direction:s}=n,l=i.slice(0,-1)+"Entries";r.prototype[l]=function(c,f){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return Ba();if(!arguments.length)return pR(this,a);if(arguments.length===1){c=""+c;const d=this._nodes.get(c);if(!d)throw new me(`Graph.${l}: could not find the "${c}" node in the graph.`);return vR(a,s,d)}if(arguments.length===2){c=""+c,f=""+f;const d=this._nodes.get(c);if(!d)throw new me(`Graph.${l}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(f))throw new me(`Graph.${l}: could not find the "${f}" target node in the graph.`);return bR(a,s,d,f)}throw new ye(`Graph.${l}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function _R(r){uR.forEach(n=>{wR(r,n),ER(r,n),SR(r,n),xR(r,n)})}const TR=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function Su(){this.A=null,this.B=null}Su.prototype.wrap=function(r){this.A===null?this.A=r:this.B===null&&(this.B=r)};Su.prototype.has=function(r){return this.A!==null&&r in this.A||this.B!==null&&r in this.B};function $o(r,n,i,a,s){for(const l in a){const c=a[l],f=c.source,d=c.target,g=f===i?d:f;if(n&&n.has(g.key))continue;const m=s(g.key,g.attributes);if(r&&m)return g.key}}function Ph(r,n,i,a,s){if(n!=="mixed"){if(n==="undirected")return $o(r,null,a,a.undirected,s);if(typeof i=="string")return $o(r,null,a,a[i],s)}const l=new Su;let c;if(n!=="undirected"){if(i!=="out"){if(c=$o(r,null,a,a.in,s),r&&c)return c;l.wrap(a.in)}if(i!=="in"){if(c=$o(r,l,a,a.out,s),r&&c)return c;l.wrap(a.out)}}if(n!=="directed"&&(c=$o(r,l,a,a.undirected,s),r&&c))return c}function CR(r,n,i){if(r!=="mixed"){if(r==="undirected")return Object.keys(i.undirected);if(typeof n=="string")return Object.keys(i[n])}const a=[];return Ph(!1,r,n,i,function(s){a.push(s)}),a}function qo(r,n,i){const a=Object.keys(i),s=a.length;let l=0;return{[Symbol.iterator](){return this},next(){let c=null;do{if(l>=s)return r&&r.wrap(i),{done:!0};const f=i[a[l++]],d=f.source,g=f.target;if(c=d===n?g:d,r&&r.has(c.key)){c=null;continue}}while(c===null);return{done:!1,value:{neighbor:c.key,attributes:c.attributes}}}}}function AR(r,n,i){if(r!=="mixed"){if(r==="undirected")return qo(null,i,i.undirected);if(typeof n=="string")return qo(null,i,i[n])}let a=Ba();const s=new Su;return r!=="undirected"&&(n!=="out"&&(a=yr(a,qo(s,i,i.in))),n!=="in"&&(a=yr(a,qo(s,i,i.out)))),r!=="directed"&&(a=yr(a,qo(s,i,i.undirected))),a}function RR(r,n){const{name:i,type:a,direction:s}=n;r.prototype[i]=function(l){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return[];l=""+l;const c=this._nodes.get(l);if(typeof c>"u")throw new me(`Graph.${i}: could not find the "${l}" node in the graph.`);return CR(a==="mixed"?this.type:a,s,c)}}function DR(r,n){const{name:i,type:a,direction:s}=n,l="forEach"+i[0].toUpperCase()+i.slice(1,-1);r.prototype[l]=function(g,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;g=""+g;const v=this._nodes.get(g);if(typeof v>"u")throw new me(`Graph.${l}: could not find the "${g}" node in the graph.`);Ph(!1,a==="mixed"?this.type:a,s,v,m)};const c="map"+i[0].toUpperCase()+i.slice(1);r.prototype[c]=function(g,m){const v=[];return this[l](g,(y,b)=>{v.push(m(y,b))}),v};const f="filter"+i[0].toUpperCase()+i.slice(1);r.prototype[f]=function(g,m){const v=[];return this[l](g,(y,b)=>{m(y,b)&&v.push(y)}),v};const d="reduce"+i[0].toUpperCase()+i.slice(1);r.prototype[d]=function(g,m,v){if(arguments.length<3)throw new ye(`Graph.${d}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let y=v;return this[l](g,(b,x)=>{y=m(y,b,x)}),y}}function OR(r,n){const{name:i,type:a,direction:s}=n,l=i[0].toUpperCase()+i.slice(1,-1),c="find"+l;r.prototype[c]=function(g,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;g=""+g;const v=this._nodes.get(g);if(typeof v>"u")throw new me(`Graph.${c}: could not find the "${g}" node in the graph.`);return Ph(!0,a==="mixed"?this.type:a,s,v,m)};const f="some"+l;r.prototype[f]=function(g,m){return!!this[c](g,m)};const d="every"+l;r.prototype[d]=function(g,m){return!this[c](g,(y,b)=>!m(y,b))}}function kR(r,n){const{name:i,type:a,direction:s}=n,l=i.slice(0,-1)+"Entries";r.prototype[l]=function(c){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return Ba();c=""+c;const f=this._nodes.get(c);if(typeof f>"u")throw new me(`Graph.${l}: could not find the "${c}" node in the graph.`);return AR(a==="mixed"?this.type:a,s,f)}}function LR(r){TR.forEach(n=>{RR(r,n),DR(r,n),OR(r,n),kR(r,n)})}function Ll(r,n,i,a,s){const l=a._nodes.values(),c=a.type;let f,d,g,m,v,y;for(;f=l.next(),f.done!==!0;){let b=!1;if(d=f.value,c!=="undirected"){m=d.out;for(g in m){v=m[g];do y=v.target,b=!0,s(d.key,y.key,d.attributes,y.attributes,v.key,v.attributes,v.undirected),v=v.next;while(v)}}if(c!=="directed"){m=d.undirected;for(g in m)if(!(n&&d.key>g)){v=m[g];do y=v.target,y.key!==g&&(y=v.source),b=!0,s(d.key,y.key,d.attributes,y.attributes,v.key,v.attributes,v.undirected),v=v.next;while(v)}}i&&!b&&s(d.key,null,d.attributes,null,null,null,null)}}function NR(r,n){const i={key:r};return _w(n.attributes)||(i.attributes=wt({},n.attributes)),i}function zR(r,n,i){const a={key:n,source:i.source.key,target:i.target.key};return _w(i.attributes)||(a.attributes=wt({},i.attributes)),r==="mixed"&&i.undirected&&(a.undirected=!0),a}function GR(r){if(!Nt(r))throw new ye('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in r))throw new ye("Graph.import: serialized node is missing its key.");if("attributes"in r&&(!Nt(r.attributes)||r.attributes===null))throw new ye("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function MR(r){if(!Nt(r))throw new ye('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in r))throw new ye("Graph.import: serialized edge is missing its source.");if(!("target"in r))throw new ye("Graph.import: serialized edge is missing its target.");if("attributes"in r&&(!Nt(r.attributes)||r.attributes===null))throw new ye("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in r&&typeof r.undirected!="boolean")throw new ye("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const jR=BA(),UR=new Set(["directed","undirected","mixed"]),Ny=new Set(["domain","_events","_eventsCount","_maxListeners"]),BR=[{name:r=>`${r}Edge`,generateKey:!0},{name:r=>`${r}DirectedEdge`,generateKey:!0,type:"directed"},{name:r=>`${r}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:r=>`${r}EdgeWithKey`},{name:r=>`${r}DirectedEdgeWithKey`,type:"directed"},{name:r=>`${r}UndirectedEdgeWithKey`,type:"undirected"}],FR={allowSelfLoops:!0,multi:!1,type:"mixed"};function HR(r,n,i){if(i&&!Nt(i))throw new ye(`Graph.addNode: invalid attributes. Expecting an object but got "${i}"`);if(n=""+n,i=i||{},r._nodes.has(n))throw new ke(`Graph.addNode: the "${n}" node already exist in the graph.`);const a=new r.NodeDataClass(n,i);return r._nodes.set(n,a),r.emit("nodeAdded",{key:n,attributes:i}),a}function zy(r,n,i){const a=new r.NodeDataClass(n,i);return r._nodes.set(n,a),r.emit("nodeAdded",{key:n,attributes:i}),a}function Lw(r,n,i,a,s,l,c,f){if(!a&&r.type==="undirected")throw new ke(`Graph.${n}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(a&&r.type==="directed")throw new ke(`Graph.${n}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(f&&!Nt(f))throw new ye(`Graph.${n}: invalid attributes. Expecting an object but got "${f}"`);if(l=""+l,c=""+c,f=f||{},!r.allowSelfLoops&&l===c)throw new ke(`Graph.${n}: source & target are the same ("${l}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const d=r._nodes.get(l),g=r._nodes.get(c);if(!d)throw new me(`Graph.${n}: source node "${l}" not found.`);if(!g)throw new me(`Graph.${n}: target node "${c}" not found.`);const m={key:null,undirected:a,source:l,target:c,attributes:f};if(i)s=r._edgeKeyGenerator();else if(s=""+s,r._edges.has(s))throw new ke(`Graph.${n}: the "${s}" edge already exists in the graph.`);if(!r.multi&&(a?typeof d.undirected[c]<"u":typeof d.out[c]<"u"))throw new ke(`Graph.${n}: an edge linking "${l}" to "${c}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const v=new Fa(a,s,d,g,f);r._edges.set(s,v);const y=l===c;return a?(d.undirectedDegree++,g.undirectedDegree++,y&&(d.undirectedLoops++,r._undirectedSelfLoopCount++)):(d.outDegree++,g.inDegree++,y&&(d.directedLoops++,r._directedSelfLoopCount++)),r.multi?v.attachMulti():v.attach(),a?r._undirectedSize++:r._directedSize++,m.key=s,r.emit("edgeAdded",m),s}function PR(r,n,i,a,s,l,c,f,d){if(!a&&r.type==="undirected")throw new ke(`Graph.${n}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(a&&r.type==="directed")throw new ke(`Graph.${n}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(f){if(d){if(typeof f!="function")throw new ye(`Graph.${n}: invalid updater function. Expecting a function but got "${f}"`)}else if(!Nt(f))throw new ye(`Graph.${n}: invalid attributes. Expecting an object but got "${f}"`)}l=""+l,c=""+c;let g;if(d&&(g=f,f=void 0),!r.allowSelfLoops&&l===c)throw new ke(`Graph.${n}: source & target are the same ("${l}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let m=r._nodes.get(l),v=r._nodes.get(c),y,b;if(!i&&(y=r._edges.get(s),y)){if((y.source.key!==l||y.target.key!==c)&&(!a||y.source.key!==c||y.target.key!==l))throw new ke(`Graph.${n}: inconsistency detected when attempting to merge the "${s}" edge with "${l}" source & "${c}" target vs. ("${y.source.key}", "${y.target.key}").`);b=y}if(!b&&!r.multi&&m&&(b=a?m.undirected[c]:m.out[c]),b){const N=[b.key,!1,!1,!1];if(d?!g:!f)return N;if(d){const L=b.attributes;b.attributes=g(L),r.emit("edgeAttributesUpdated",{type:"replace",key:b.key,attributes:b.attributes})}else wt(b.attributes,f),r.emit("edgeAttributesUpdated",{type:"merge",key:b.key,attributes:b.attributes,data:f});return N}f=f||{},d&&g&&(f=g(f));const x={key:null,undirected:a,source:l,target:c,attributes:f};if(i)s=r._edgeKeyGenerator();else if(s=""+s,r._edges.has(s))throw new ke(`Graph.${n}: the "${s}" edge already exists in the graph.`);let E=!1,T=!1;m||(m=zy(r,l,{}),E=!0,l===c&&(v=m,T=!0)),v||(v=zy(r,c,{}),T=!0),y=new Fa(a,s,m,v,f),r._edges.set(s,y);const M=l===c;return a?(m.undirectedDegree++,v.undirectedDegree++,M&&(m.undirectedLoops++,r._undirectedSelfLoopCount++)):(m.outDegree++,v.inDegree++,M&&(m.directedLoops++,r._directedSelfLoopCount++)),r.multi?y.attachMulti():y.attach(),a?r._undirectedSize++:r._directedSize++,x.key=s,r.emit("edgeAdded",x),[s,!0,E,T]}function xa(r,n){r._edges.delete(n.key);const{source:i,target:a,attributes:s}=n,l=n.undirected,c=i===a;l?(i.undirectedDegree--,a.undirectedDegree--,c&&(i.undirectedLoops--,r._undirectedSelfLoopCount--)):(i.outDegree--,a.inDegree--,c&&(i.directedLoops--,r._directedSelfLoopCount--)),r.multi?n.detachMulti():n.detach(),l?r._undirectedSize--:r._directedSize--,r.emit("edgeDropped",{key:n.key,attributes:s,source:i.key,target:a.key,undirected:l})}class Ke extends xw.EventEmitter{constructor(n){if(super(),n=wt({},FR,n),typeof n.multi!="boolean")throw new ye(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${n.multi}".`);if(!UR.has(n.type))throw new ye(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${n.type}".`);if(typeof n.allowSelfLoops!="boolean")throw new ye(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${n.allowSelfLoops}".`);const i=n.type==="mixed"?Tw:n.type==="directed"?Cw:Aw;wn(this,"NodeDataClass",i);const a="geid_"+jR()+"_";let s=0;const l=()=>{let c;do c=a+s++;while(this._edges.has(c));return c};wn(this,"_attributes",{}),wn(this,"_nodes",new Map),wn(this,"_edges",new Map),wn(this,"_directedSize",0),wn(this,"_undirectedSize",0),wn(this,"_directedSelfLoopCount",0),wn(this,"_undirectedSelfLoopCount",0),wn(this,"_edgeKeyGenerator",l),wn(this,"_options",n),Ny.forEach(c=>wn(this,c,this[c])),Rn(this,"order",()=>this._nodes.size),Rn(this,"size",()=>this._edges.size),Rn(this,"directedSize",()=>this._directedSize),Rn(this,"undirectedSize",()=>this._undirectedSize),Rn(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Rn(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Rn(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Rn(this,"multi",this._options.multi),Rn(this,"type",this._options.type),Rn(this,"allowSelfLoops",this._options.allowSelfLoops),Rn(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(n){return this._nodes.has(""+n)}hasDirectedEdge(n,i){if(this.type==="undirected")return!1;if(arguments.length===1){const a=""+n,s=this._edges.get(a);return!!s&&!s.undirected}else if(arguments.length===2){n=""+n,i=""+i;const a=this._nodes.get(n);return a?a.out.hasOwnProperty(i):!1}throw new ye(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(n,i){if(this.type==="directed")return!1;if(arguments.length===1){const a=""+n,s=this._edges.get(a);return!!s&&s.undirected}else if(arguments.length===2){n=""+n,i=""+i;const a=this._nodes.get(n);return a?a.undirected.hasOwnProperty(i):!1}throw new ye(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(n,i){if(arguments.length===1){const a=""+n;return this._edges.has(a)}else if(arguments.length===2){n=""+n,i=""+i;const a=this._nodes.get(n);return a?typeof a.out<"u"&&a.out.hasOwnProperty(i)||typeof a.undirected<"u"&&a.undirected.hasOwnProperty(i):!1}throw new ye(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(n,i){if(this.type==="undirected")return;if(n=""+n,i=""+i,this.multi)throw new ke("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const a=this._nodes.get(n);if(!a)throw new me(`Graph.directedEdge: could not find the "${n}" source node in the graph.`);if(!this._nodes.has(i))throw new me(`Graph.directedEdge: could not find the "${i}" target node in the graph.`);const s=a.out&&a.out[i]||void 0;if(s)return s.key}undirectedEdge(n,i){if(this.type==="directed")return;if(n=""+n,i=""+i,this.multi)throw new ke("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const a=this._nodes.get(n);if(!a)throw new me(`Graph.undirectedEdge: could not find the "${n}" source node in the graph.`);if(!this._nodes.has(i))throw new me(`Graph.undirectedEdge: could not find the "${i}" target node in the graph.`);const s=a.undirected&&a.undirected[i]||void 0;if(s)return s.key}edge(n,i){if(this.multi)throw new ke("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.edge: could not find the "${n}" source node in the graph.`);if(!this._nodes.has(i))throw new me(`Graph.edge: could not find the "${i}" target node in the graph.`);const s=a.out&&a.out[i]||a.undirected&&a.undirected[i]||void 0;if(s)return s.key}areDirectedNeighbors(n,i){n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.areDirectedNeighbors: could not find the "${n}" node in the graph.`);return this.type==="undirected"?!1:i in a.in||i in a.out}areOutNeighbors(n,i){n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.areOutNeighbors: could not find the "${n}" node in the graph.`);return this.type==="undirected"?!1:i in a.out}areInNeighbors(n,i){n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.areInNeighbors: could not find the "${n}" node in the graph.`);return this.type==="undirected"?!1:i in a.in}areUndirectedNeighbors(n,i){n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.areUndirectedNeighbors: could not find the "${n}" node in the graph.`);return this.type==="directed"?!1:i in a.undirected}areNeighbors(n,i){n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.areNeighbors: could not find the "${n}" node in the graph.`);return this.type!=="undirected"&&(i in a.in||i in a.out)||this.type!=="directed"&&i in a.undirected}areInboundNeighbors(n,i){n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.areInboundNeighbors: could not find the "${n}" node in the graph.`);return this.type!=="undirected"&&i in a.in||this.type!=="directed"&&i in a.undirected}areOutboundNeighbors(n,i){n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.areOutboundNeighbors: could not find the "${n}" node in the graph.`);return this.type!=="undirected"&&i in a.out||this.type!=="directed"&&i in a.undirected}inDegree(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.inDegree: could not find the "${n}" node in the graph.`);return this.type==="undirected"?0:i.inDegree}outDegree(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.outDegree: could not find the "${n}" node in the graph.`);return this.type==="undirected"?0:i.outDegree}directedDegree(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.directedDegree: could not find the "${n}" node in the graph.`);return this.type==="undirected"?0:i.inDegree+i.outDegree}undirectedDegree(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.undirectedDegree: could not find the "${n}" node in the graph.`);return this.type==="directed"?0:i.undirectedDegree}inboundDegree(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.inboundDegree: could not find the "${n}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=i.undirectedDegree),this.type!=="undirected"&&(a+=i.inDegree),a}outboundDegree(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.outboundDegree: could not find the "${n}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=i.undirectedDegree),this.type!=="undirected"&&(a+=i.outDegree),a}degree(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.degree: could not find the "${n}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=i.undirectedDegree),this.type!=="undirected"&&(a+=i.inDegree+i.outDegree),a}inDegreeWithoutSelfLoops(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.inDegreeWithoutSelfLoops: could not find the "${n}" node in the graph.`);return this.type==="undirected"?0:i.inDegree-i.directedLoops}outDegreeWithoutSelfLoops(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.outDegreeWithoutSelfLoops: could not find the "${n}" node in the graph.`);return this.type==="undirected"?0:i.outDegree-i.directedLoops}directedDegreeWithoutSelfLoops(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.directedDegreeWithoutSelfLoops: could not find the "${n}" node in the graph.`);return this.type==="undirected"?0:i.inDegree+i.outDegree-i.directedLoops*2}undirectedDegreeWithoutSelfLoops(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${n}" node in the graph.`);return this.type==="directed"?0:i.undirectedDegree-i.undirectedLoops*2}inboundDegreeWithoutSelfLoops(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${n}" node in the graph.`);let a=0,s=0;return this.type!=="directed"&&(a+=i.undirectedDegree,s+=i.undirectedLoops*2),this.type!=="undirected"&&(a+=i.inDegree,s+=i.directedLoops),a-s}outboundDegreeWithoutSelfLoops(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${n}" node in the graph.`);let a=0,s=0;return this.type!=="directed"&&(a+=i.undirectedDegree,s+=i.undirectedLoops*2),this.type!=="undirected"&&(a+=i.outDegree,s+=i.directedLoops),a-s}degreeWithoutSelfLoops(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.degreeWithoutSelfLoops: could not find the "${n}" node in the graph.`);let a=0,s=0;return this.type!=="directed"&&(a+=i.undirectedDegree,s+=i.undirectedLoops*2),this.type!=="undirected"&&(a+=i.inDegree+i.outDegree,s+=i.directedLoops*2),a-s}source(n){n=""+n;const i=this._edges.get(n);if(!i)throw new me(`Graph.source: could not find the "${n}" edge in the graph.`);return i.source.key}target(n){n=""+n;const i=this._edges.get(n);if(!i)throw new me(`Graph.target: could not find the "${n}" edge in the graph.`);return i.target.key}extremities(n){n=""+n;const i=this._edges.get(n);if(!i)throw new me(`Graph.extremities: could not find the "${n}" edge in the graph.`);return[i.source.key,i.target.key]}opposite(n,i){n=""+n,i=""+i;const a=this._edges.get(i);if(!a)throw new me(`Graph.opposite: could not find the "${i}" edge in the graph.`);const s=a.source.key,l=a.target.key;if(n===s)return l;if(n===l)return s;throw new me(`Graph.opposite: the "${n}" node is not attached to the "${i}" edge (${s}, ${l}).`)}hasExtremity(n,i){n=""+n,i=""+i;const a=this._edges.get(n);if(!a)throw new me(`Graph.hasExtremity: could not find the "${n}" edge in the graph.`);return a.source.key===i||a.target.key===i}isUndirected(n){n=""+n;const i=this._edges.get(n);if(!i)throw new me(`Graph.isUndirected: could not find the "${n}" edge in the graph.`);return i.undirected}isDirected(n){n=""+n;const i=this._edges.get(n);if(!i)throw new me(`Graph.isDirected: could not find the "${n}" edge in the graph.`);return!i.undirected}isSelfLoop(n){n=""+n;const i=this._edges.get(n);if(!i)throw new me(`Graph.isSelfLoop: could not find the "${n}" edge in the graph.`);return i.source===i.target}addNode(n,i){return HR(this,n,i).key}mergeNode(n,i){if(i&&!Nt(i))throw new ye(`Graph.mergeNode: invalid attributes. Expecting an object but got "${i}"`);n=""+n,i=i||{};let a=this._nodes.get(n);return a?(i&&(wt(a.attributes,i),this.emit("nodeAttributesUpdated",{type:"merge",key:n,attributes:a.attributes,data:i})),[n,!1]):(a=new this.NodeDataClass(n,i),this._nodes.set(n,a),this.emit("nodeAdded",{key:n,attributes:i}),[n,!0])}updateNode(n,i){if(i&&typeof i!="function")throw new ye(`Graph.updateNode: invalid updater function. Expecting a function but got "${i}"`);n=""+n;let a=this._nodes.get(n);if(a){if(i){const l=a.attributes;a.attributes=i(l),this.emit("nodeAttributesUpdated",{type:"replace",key:n,attributes:a.attributes})}return[n,!1]}const s=i?i({}):{};return a=new this.NodeDataClass(n,s),this._nodes.set(n,a),this.emit("nodeAdded",{key:n,attributes:s}),[n,!0]}dropNode(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.dropNode: could not find the "${n}" node in the graph.`);let a;if(this.type!=="undirected"){for(const s in i.out){a=i.out[s];do xa(this,a),a=a.next;while(a)}for(const s in i.in){a=i.in[s];do xa(this,a),a=a.next;while(a)}}if(this.type!=="directed")for(const s in i.undirected){a=i.undirected[s];do xa(this,a),a=a.next;while(a)}this._nodes.delete(n),this.emit("nodeDropped",{key:n,attributes:i.attributes})}dropEdge(n){let i;if(arguments.length>1){const a=""+arguments[0],s=""+arguments[1];if(i=En(this,a,s,this.type),!i)throw new me(`Graph.dropEdge: could not find the "${a}" -> "${s}" edge in the graph.`)}else if(n=""+n,i=this._edges.get(n),!i)throw new me(`Graph.dropEdge: could not find the "${n}" edge in the graph.`);return xa(this,i),this}dropDirectedEdge(n,i){if(arguments.length<2)throw new ke("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new ke("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");n=""+n,i=""+i;const a=En(this,n,i,"directed");if(!a)throw new me(`Graph.dropDirectedEdge: could not find a "${n}" -> "${i}" edge in the graph.`);return xa(this,a),this}dropUndirectedEdge(n,i){if(arguments.length<2)throw new ke("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new ke("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const a=En(this,n,i,"undirected");if(!a)throw new me(`Graph.dropUndirectedEdge: could not find a "${n}" -> "${i}" edge in the graph.`);return xa(this,a),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const n=this._nodes.values();let i;for(;i=n.next(),i.done!==!0;)i.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(n){return this._attributes[n]}getAttributes(){return this._attributes}hasAttribute(n){return this._attributes.hasOwnProperty(n)}setAttribute(n,i){return this._attributes[n]=i,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:n}),this}updateAttribute(n,i){if(typeof i!="function")throw new ye("Graph.updateAttribute: updater should be a function.");const a=this._attributes[n];return this._attributes[n]=i(a),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:n}),this}removeAttribute(n){return delete this._attributes[n],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:n}),this}replaceAttributes(n){if(!Nt(n))throw new ye("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=n,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(n){if(!Nt(n))throw new ye("Graph.mergeAttributes: provided attributes are not a plain object.");return wt(this._attributes,n),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:n}),this}updateAttributes(n){if(typeof n!="function")throw new ye("Graph.updateAttributes: provided updater is not a function.");return this._attributes=n(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(n,i){if(typeof n!="function")throw new ye("Graph.updateEachNodeAttributes: expecting an updater function.");if(i&&!Ly(i))throw new ye("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const a=this._nodes.values();let s,l;for(;s=a.next(),s.done!==!0;)l=s.value,l.attributes=n(l.key,l.attributes);this.emit("eachNodeAttributesUpdated",{hints:i||null})}updateEachEdgeAttributes(n,i){if(typeof n!="function")throw new ye("Graph.updateEachEdgeAttributes: expecting an updater function.");if(i&&!Ly(i))throw new ye("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const a=this._edges.values();let s,l,c,f;for(;s=a.next(),s.done!==!0;)l=s.value,c=l.source,f=l.target,l.attributes=n(l.key,l.attributes,c.key,f.key,c.attributes,f.attributes,l.undirected);this.emit("eachEdgeAttributesUpdated",{hints:i||null})}forEachAdjacencyEntry(n){if(typeof n!="function")throw new ye("Graph.forEachAdjacencyEntry: expecting a callback.");Ll(!1,!1,!1,this,n)}forEachAdjacencyEntryWithOrphans(n){if(typeof n!="function")throw new ye("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Ll(!1,!1,!0,this,n)}forEachAssymetricAdjacencyEntry(n){if(typeof n!="function")throw new ye("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Ll(!1,!0,!1,this,n)}forEachAssymetricAdjacencyEntryWithOrphans(n){if(typeof n!="function")throw new ye("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Ll(!1,!0,!0,this,n)}nodes(){return Array.from(this._nodes.keys())}forEachNode(n){if(typeof n!="function")throw new ye("Graph.forEachNode: expecting a callback.");const i=this._nodes.values();let a,s;for(;a=i.next(),a.done!==!0;)s=a.value,n(s.key,s.attributes)}findNode(n){if(typeof n!="function")throw new ye("Graph.findNode: expecting a callback.");const i=this._nodes.values();let a,s;for(;a=i.next(),a.done!==!0;)if(s=a.value,n(s.key,s.attributes))return s.key}mapNodes(n){if(typeof n!="function")throw new ye("Graph.mapNode: expecting a callback.");const i=this._nodes.values();let a,s;const l=new Array(this.order);let c=0;for(;a=i.next(),a.done!==!0;)s=a.value,l[c++]=n(s.key,s.attributes);return l}someNode(n){if(typeof n!="function")throw new ye("Graph.someNode: expecting a callback.");const i=this._nodes.values();let a,s;for(;a=i.next(),a.done!==!0;)if(s=a.value,n(s.key,s.attributes))return!0;return!1}everyNode(n){if(typeof n!="function")throw new ye("Graph.everyNode: expecting a callback.");const i=this._nodes.values();let a,s;for(;a=i.next(),a.done!==!0;)if(s=a.value,!n(s.key,s.attributes))return!1;return!0}filterNodes(n){if(typeof n!="function")throw new ye("Graph.filterNodes: expecting a callback.");const i=this._nodes.values();let a,s;const l=[];for(;a=i.next(),a.done!==!0;)s=a.value,n(s.key,s.attributes)&&l.push(s.key);return l}reduceNodes(n,i){if(typeof n!="function")throw new ye("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new ye("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let a=i;const s=this._nodes.values();let l,c;for(;l=s.next(),l.done!==!0;)c=l.value,a=n(a,c.key,c.attributes);return a}nodeEntries(){const n=this._nodes.values();return{[Symbol.iterator](){return this},next(){const i=n.next();if(i.done)return i;const a=i.value;return{value:{node:a.key,attributes:a.attributes},done:!1}}}}export(){const n=new Array(this._nodes.size);let i=0;this._nodes.forEach((s,l)=>{n[i++]=NR(l,s)});const a=new Array(this._edges.size);return i=0,this._edges.forEach((s,l)=>{a[i++]=zR(this.type,l,s)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:n,edges:a}}import(n,i=!1){if(n instanceof Ke)return n.forEachNode((d,g)=>{i?this.mergeNode(d,g):this.addNode(d,g)}),n.forEachEdge((d,g,m,v,y,b,x)=>{i?x?this.mergeUndirectedEdgeWithKey(d,m,v,g):this.mergeDirectedEdgeWithKey(d,m,v,g):x?this.addUndirectedEdgeWithKey(d,m,v,g):this.addDirectedEdgeWithKey(d,m,v,g)}),this;if(!Nt(n))throw new ye("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(n.attributes){if(!Nt(n.attributes))throw new ye("Graph.import: invalid attributes. Expecting a plain object.");i?this.mergeAttributes(n.attributes):this.replaceAttributes(n.attributes)}let a,s,l,c,f;if(n.nodes){if(l=n.nodes,!Array.isArray(l))throw new ye("Graph.import: invalid nodes. Expecting an array.");for(a=0,s=l.length;a{const l=wt({},a.attributes);a=new i.NodeDataClass(s,l),i._nodes.set(s,a)}),i}copy(n){if(n=n||{},typeof n.type=="string"&&n.type!==this.type&&n.type!=="mixed")throw new ke(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${n.type}" because this would mean losing information about the current graph.`);if(typeof n.multi=="boolean"&&n.multi!==this.multi&&n.multi!==!0)throw new ke("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof n.allowSelfLoops=="boolean"&&n.allowSelfLoops!==this.allowSelfLoops&&n.allowSelfLoops!==!0)throw new ke("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const i=this.emptyCopy(n),a=this._edges.values();let s,l;for(;s=a.next(),s.done!==!0;)l=s.value,Lw(i,"copy",!1,l.undirected,l.key,l.source.key,l.target.key,wt({},l.attributes));return i}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const n={};this._nodes.forEach((l,c)=>{n[c]=l.attributes});const i={},a={};this._edges.forEach((l,c)=>{const f=l.undirected?"--":"->";let d="",g=l.source.key,m=l.target.key,v;l.undirected&&g>m&&(v=g,g=m,m=v);const y=`(${g})${f}(${m})`;c.startsWith("geid_")?this.multi&&(typeof a[y]>"u"?a[y]=0:a[y]++,d+=`${a[y]}. `):d+=`[${c}]: `,d+=y,i[d]=l.attributes});const s={};for(const l in this)this.hasOwnProperty(l)&&!Ny.has(l)&&typeof this[l]!="function"&&typeof l!="symbol"&&(s[l]=this[l]);return s.attributes=this._attributes,s.nodes=n,s.edges=i,wn(s,"constructor",this.constructor),s}}typeof Symbol<"u"&&(Ke.prototype[Symbol.for("nodejs.util.inspect.custom")]=Ke.prototype.inspect);BR.forEach(r=>{["add","merge","update"].forEach(n=>{const i=r.name(n),a=n==="add"?Lw:PR;r.generateKey?Ke.prototype[i]=function(s,l,c){return a(this,i,!0,(r.type||this.type)==="undirected",null,s,l,c,n==="update")}:Ke.prototype[i]=function(s,l,c,f){return a(this,i,!1,(r.type||this.type)==="undirected",s,l,c,f,n==="update")}})});KA(Ke);lR(Ke);_R(Ke);LR(Ke);class ts extends Ke{constructor(n){const i=wt({type:"directed"},n);if("multi"in i&&i.multi!==!1)throw new ye("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(i.type!=="directed")throw new ye('DirectedGraph.from: inconsistent "'+i.type+'" type in given options!');super(i)}}class Nw extends Ke{constructor(n){const i=wt({type:"undirected"},n);if("multi"in i&&i.multi!==!1)throw new ye("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(i.type!=="undirected")throw new ye('UndirectedGraph.from: inconsistent "'+i.type+'" type in given options!');super(i)}}class zw extends Ke{constructor(n){const i=wt({multi:!0},n);if("multi"in i&&i.multi!==!0)throw new ye("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(i)}}class Gw extends Ke{constructor(n){const i=wt({type:"directed",multi:!0},n);if("multi"in i&&i.multi!==!0)throw new ye("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(i.type!=="directed")throw new ye('MultiDirectedGraph.from: inconsistent "'+i.type+'" type in given options!');super(i)}}class Mw extends Ke{constructor(n){const i=wt({type:"undirected",multi:!0},n);if("multi"in i&&i.multi!==!0)throw new ye("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(i.type!=="undirected")throw new ye('MultiUndirectedGraph.from: inconsistent "'+i.type+'" type in given options!');super(i)}}function Ha(r){r.from=function(n,i){const a=wt({},n.options,i),s=new r(a);return s.import(n),s}}Ha(Ke);Ha(ts);Ha(Nw);Ha(zw);Ha(Gw);Ha(Mw);Ke.Graph=Ke;Ke.DirectedGraph=ts;Ke.UndirectedGraph=Nw;Ke.MultiGraph=zw;Ke.MultiDirectedGraph=Gw;Ke.MultiUndirectedGraph=Mw;Ke.InvalidArgumentsGraphError=ye;Ke.NotFoundGraphError=me;Ke.UsageGraphError=ke;function $R(r,n){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var a=i.call(r,n);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function Qo(r){var n=$R(r,"string");return typeof n=="symbol"?n:n+""}function At(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function Gy(r,n){for(var i=0;ir.length)&&(n=r.length);for(var i=0,a=Array(n);i>8&255,l=i>>16&255,c=i>>24&255;return[a,s,l,c]}var rd={};function Pw(r){if(typeof rd[r]<"u")return rd[r];var n=(r&16711680)>>>16,i=(r&65280)>>>8,a=r&255,s=255,l=Hw(n,i,a,s);return rd[r]=l,l}function My(r,n,i,a){return i+(n<<8)+(r<<16)}function jy(r,n,i,a,s,l){var c=Math.floor(i/l*s),f=Math.floor(r.drawingBufferHeight/l-a/l*s),d=new Uint8Array(4);r.bindFramebuffer(r.FRAMEBUFFER,n),r.readPixels(c,f,1,1,r.RGBA,r.UNSIGNED_BYTE,d);var g=Na(d,4),m=g[0],v=g[1],y=g[2],b=g[3];return[m,v,y,b]}function fe(r,n,i){return(n=Qo(n))in r?Object.defineProperty(r,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[n]=i,r}function Uy(r,n){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);n&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),i.push.apply(i,a)}return i}function _e(r){for(var n=1;nC){var B="…";for(g=g+B,R=r.measureText(g).width;R>C&&g.length>1;)g=g.slice(0,-2)+B,R=r.measureText(g).width;if(g.length<4)return}var _;N>0?L>0?_=Math.acos(N/C):_=Math.asin(L/C):L>0?_=Math.acos(N/C)+Math.PI:_=Math.asin(N/C)+Math.PI/2,r.save(),r.translate(T,M),r.rotate(_),r.fillText(g,-R/2,n.size/2+l),r.restore()}}}function Yw(r,n,i){if(n.label){var a=i.labelSize,s=i.labelFont,l=i.labelWeight,c=i.labelColor.attribute?n[i.labelColor.attribute]||i.labelColor.color||"#000":i.labelColor.color;r.fillStyle=c,r.font="".concat(l," ").concat(a,"px ").concat(s),r.fillText(n.label,n.x+n.size+3,n.y+a/3)}}function oD(r,n,i){var a=i.labelSize,s=i.labelFont,l=i.labelWeight;r.font="".concat(l," ").concat(a,"px ").concat(s),r.fillStyle="#FFF",r.shadowOffsetX=0,r.shadowOffsetY=0,r.shadowBlur=8,r.shadowColor="#000";var c=2;if(typeof n.label=="string"){var f=r.measureText(n.label).width,d=Math.round(f+5),g=Math.round(a+2*c),m=Math.max(n.size,a/2)+c,v=Math.asin(g/2/m),y=Math.sqrt(Math.abs(Math.pow(m,2)-Math.pow(g/2,2)));r.beginPath(),r.moveTo(n.x+y,n.y+g/2),r.lineTo(n.x+m+d,n.y+g/2),r.lineTo(n.x+m+d,n.y-g/2),r.lineTo(n.x+y,n.y-g/2),r.arc(n.x,n.y,m,v,-v),r.closePath(),r.fill()}else r.beginPath(),r.arc(n.x,n.y,n.size+c,0,Math.PI*2),r.closePath(),r.fill();r.shadowOffsetX=0,r.shadowOffsetY=0,r.shadowBlur=0,Yw(r,n,i)}var sD=` -precision highp float; - -varying vec4 v_color; -varying vec2 v_diffVector; -varying float v_radius; - -uniform float u_correctionRatio; - -const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); - -void main(void) { - float border = u_correctionRatio * 2.0; - float dist = length(v_diffVector) - v_radius + border; - - // No antialiasing for picking mode: - #ifdef PICKING_MODE - if (dist > border) - gl_FragColor = transparent; - else - gl_FragColor = v_color; - - #else - float t = 0.0; - if (dist > border) - t = 1.0; - else if (dist > 0.0) - t = dist / border; - - gl_FragColor = mix(v_color, transparent, t); - #endif -} -`,lD=sD,uD=` -attribute vec4 a_id; -attribute vec4 a_color; -attribute vec2 a_position; -attribute float a_size; -attribute float a_angle; - -uniform mat3 u_matrix; -uniform float u_sizeRatio; -uniform float u_correctionRatio; - -varying vec4 v_color; -varying vec2 v_diffVector; -varying float v_radius; -varying float v_border; - -const float bias = 255.0 / 254.0; - -void main() { - float size = a_size * u_correctionRatio / u_sizeRatio * 4.0; - vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle)); - vec2 position = a_position + diffVector; - gl_Position = vec4( - (u_matrix * vec3(position, 1)).xy, - 0, - 1 - ); - - v_diffVector = diffVector; - v_radius = size / 2.0; - - #ifdef PICKING_MODE - // For picking mode, we use the ID as the color: - v_color = a_id; - #else - // For normal mode, we use the color: - v_color = a_color; - #endif - - v_color.a *= bias; -} -`,cD=uD,Xw=WebGLRenderingContext,Py=Xw.UNSIGNED_BYTE,ad=Xw.FLOAT,fD=["u_sizeRatio","u_correctionRatio","u_matrix"],us=function(r){function n(){return At(this,n),It(this,n,arguments)}return Yt(n,r),Rt(n,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:cD,FRAGMENT_SHADER_SOURCE:lD,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:fD,ATTRIBUTES:[{name:"a_position",size:2,type:ad},{name:"a_size",size:1,type:ad},{name:"a_color",size:4,type:Py,normalized:!0},{name:"a_id",size:4,type:Py,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:ad}],CONSTANT_DATA:[[n.ANGLE_1],[n.ANGLE_2],[n.ANGLE_3]]}}},{key:"processVisibleItem",value:function(a,s,l){var c=this.array,f=Xn(l.color);c[s++]=l.x,c[s++]=l.y,c[s++]=l.size,c[s++]=f,c[s++]=a}},{key:"setUniforms",value:function(a,s){var l=s.gl,c=s.uniformLocations,f=c.u_sizeRatio,d=c.u_correctionRatio,g=c.u_matrix;l.uniform1f(d,a.correctionRatio),l.uniform1f(f,a.sizeRatio),l.uniformMatrix3fv(g,!1,a.matrix)}}])}($h);fe(us,"ANGLE_1",0);fe(us,"ANGLE_2",2*Math.PI/3);fe(us,"ANGLE_3",4*Math.PI/3);var dD=` -precision mediump float; - -varying vec4 v_color; - -void main(void) { - gl_FragColor = v_color; -} -`,hD=dD,gD=` -attribute vec2 a_position; -attribute vec2 a_normal; -attribute float a_radius; -attribute vec3 a_barycentric; - -#ifdef PICKING_MODE -attribute vec4 a_id; -#else -attribute vec4 a_color; -#endif - -uniform mat3 u_matrix; -uniform float u_sizeRatio; -uniform float u_correctionRatio; -uniform float u_minEdgeThickness; -uniform float u_lengthToThicknessRatio; -uniform float u_widenessToThicknessRatio; - -varying vec4 v_color; - -const float bias = 255.0 / 254.0; - -void main() { - float minThickness = u_minEdgeThickness; - - float normalLength = length(a_normal); - vec2 unitNormal = a_normal / normalLength; - - // These first computations are taken from edge.vert.glsl and - // edge.clamped.vert.glsl. Please read it to get better comments on what's - // happening: - float pixelsThickness = max(normalLength / u_sizeRatio, minThickness); - float webGLThickness = pixelsThickness * u_correctionRatio; - float webGLNodeRadius = a_radius * 2.0 * u_correctionRatio / u_sizeRatio; - float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0; - float webGLArrowHeadThickness = webGLThickness * u_widenessToThicknessRatio; - - float da = a_barycentric.x; - float db = a_barycentric.y; - float dc = a_barycentric.z; - - vec2 delta = vec2( - da * (webGLNodeRadius * unitNormal.y) - + db * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y + webGLArrowHeadThickness * unitNormal.x) - + dc * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y - webGLArrowHeadThickness * unitNormal.x), - - da * (-webGLNodeRadius * unitNormal.x) - + db * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x + webGLArrowHeadThickness * unitNormal.y) - + dc * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x - webGLArrowHeadThickness * unitNormal.y) - ); - - vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy; - - gl_Position = vec4(position, 0, 1); - - #ifdef PICKING_MODE - // For picking mode, we use the ID as the color: - v_color = a_id; - #else - // For normal mode, we use the color: - v_color = a_color; - #endif - - v_color.a *= bias; -} -`,pD=gD,Zw=WebGLRenderingContext,$y=Zw.UNSIGNED_BYTE,zl=Zw.FLOAT,mD=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],cs={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function ou(r){var n=_e(_e({},cs),r||{});return function(i){function a(){return At(this,a),It(this,a,arguments)}return Yt(a,i),Rt(a,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:pD,FRAGMENT_SHADER_SOURCE:hD,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:mD,ATTRIBUTES:[{name:"a_position",size:2,type:zl},{name:"a_normal",size:2,type:zl},{name:"a_radius",size:1,type:zl},{name:"a_color",size:4,type:$y,normalized:!0},{name:"a_id",size:4,type:$y,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:zl}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(l,c,f,d,g){if(n.extremity==="source"){var m=[d,f];f=m[0],d=m[1]}var v=g.size||1,y=d.size||1,b=f.x,x=f.y,E=d.x,T=d.y,M=Xn(g.color),N=E-b,L=T-x,C=N*N+L*L,R=0,B=0;C&&(C=1/Math.sqrt(C),R=-L*C*v,B=N*C*v);var _=this.array;_[c++]=E,_[c++]=T,_[c++]=-R,_[c++]=-B,_[c++]=y,_[c++]=M,_[c++]=l}},{key:"setUniforms",value:function(l,c){var f=c.gl,d=c.uniformLocations,g=d.u_matrix,m=d.u_sizeRatio,v=d.u_correctionRatio,y=d.u_minEdgeThickness,b=d.u_lengthToThicknessRatio,x=d.u_widenessToThicknessRatio;f.uniformMatrix3fv(g,!1,l.matrix),f.uniform1f(m,l.sizeRatio),f.uniform1f(v,l.correctionRatio),f.uniform1f(y,l.minEdgeThickness),f.uniform1f(b,n.lengthToThicknessRatio),f.uniform1f(x,n.widenessToThicknessRatio)}}])}(ls)}ou();var vD=` -precision mediump float; - -varying vec4 v_color; -varying vec2 v_normal; -varying float v_thickness; -varying float v_feather; - -const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); - -void main(void) { - // We only handle antialiasing for normal mode: - #ifdef PICKING_MODE - gl_FragColor = v_color; - #else - float dist = length(v_normal) * v_thickness; - - float t = smoothstep( - v_thickness - v_feather, - v_thickness, - dist - ); - - gl_FragColor = mix(v_color, transparent, t); - #endif -} -`,qh=vD,yD=` -attribute vec4 a_id; -attribute vec4 a_color; -attribute vec2 a_normal; -attribute float a_normalCoef; -attribute vec2 a_positionStart; -attribute vec2 a_positionEnd; -attribute float a_positionCoef; -attribute float a_radius; -attribute float a_radiusCoef; - -uniform mat3 u_matrix; -uniform float u_zoomRatio; -uniform float u_sizeRatio; -uniform float u_pixelRatio; -uniform float u_correctionRatio; -uniform float u_minEdgeThickness; -uniform float u_lengthToThicknessRatio; -uniform float u_feather; - -varying vec4 v_color; -varying vec2 v_normal; -varying float v_thickness; -varying float v_feather; - -const float bias = 255.0 / 254.0; - -void main() { - float minThickness = u_minEdgeThickness; - - float radius = a_radius * a_radiusCoef; - vec2 normal = a_normal * a_normalCoef; - vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef; - - float normalLength = length(normal); - vec2 unitNormal = normal / normalLength; - - // These first computations are taken from edge.vert.glsl. Please read it to - // get better comments on what's happening: - float pixelsThickness = max(normalLength, minThickness * u_sizeRatio); - float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio; - - // Here, we move the point to leave space for the arrow head: - float direction = sign(radius); - float webGLNodeRadius = direction * radius * 2.0 * u_correctionRatio / u_sizeRatio; - float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0; - - vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (webGLNodeRadius + webGLArrowHeadLength); - - // Here is the proper position of the vertex - gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + compensationVector, 1)).xy, 0, 1); - - v_thickness = webGLThickness / u_zoomRatio; - - v_normal = unitNormal; - - v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0; - - #ifdef PICKING_MODE - // For picking mode, we use the ID as the color: - v_color = a_id; - #else - // For normal mode, we use the color: - v_color = a_color; - #endif - - v_color.a *= bias; -} -`,bD=yD,Ww=WebGLRenderingContext,qy=Ww.UNSIGNED_BYTE,Di=Ww.FLOAT,wD=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],ED={lengthToThicknessRatio:cs.lengthToThicknessRatio};function Kw(r){var n=_e(_e({},ED),{});return function(i){function a(){return At(this,a),It(this,a,arguments)}return Yt(a,i),Rt(a,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:bD,FRAGMENT_SHADER_SOURCE:qh,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:wD,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Di},{name:"a_positionEnd",size:2,type:Di},{name:"a_normal",size:2,type:Di},{name:"a_color",size:4,type:qy,normalized:!0},{name:"a_id",size:4,type:qy,normalized:!0},{name:"a_radius",size:1,type:Di}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Di},{name:"a_normalCoef",size:1,type:Di},{name:"a_radiusCoef",size:1,type:Di}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(l,c,f,d,g){var m=g.size||1,v=f.x,y=f.y,b=d.x,x=d.y,E=Xn(g.color),T=b-v,M=x-y,N=d.size||1,L=T*T+M*M,C=0,R=0;L&&(L=1/Math.sqrt(L),C=-M*L*m,R=T*L*m);var B=this.array;B[c++]=v,B[c++]=y,B[c++]=b,B[c++]=x,B[c++]=C,B[c++]=R,B[c++]=E,B[c++]=l,B[c++]=N}},{key:"setUniforms",value:function(l,c){var f=c.gl,d=c.uniformLocations,g=d.u_matrix,m=d.u_zoomRatio,v=d.u_feather,y=d.u_pixelRatio,b=d.u_correctionRatio,x=d.u_sizeRatio,E=d.u_minEdgeThickness,T=d.u_lengthToThicknessRatio;f.uniformMatrix3fv(g,!1,l.matrix),f.uniform1f(m,l.zoomRatio),f.uniform1f(x,l.sizeRatio),f.uniform1f(b,l.correctionRatio),f.uniform1f(y,l.pixelRatio),f.uniform1f(v,l.antiAliasingFeather),f.uniform1f(E,l.minEdgeThickness),f.uniform1f(T,n.lengthToThicknessRatio)}}])}(ls)}Kw();function SD(r){return Iw([Kw(),ou(r)])}var xD=SD(),Qw=xD,_D=` -attribute vec4 a_id; -attribute vec4 a_color; -attribute vec2 a_normal; -attribute float a_normalCoef; -attribute vec2 a_positionStart; -attribute vec2 a_positionEnd; -attribute float a_positionCoef; - -uniform mat3 u_matrix; -uniform float u_sizeRatio; -uniform float u_zoomRatio; -uniform float u_pixelRatio; -uniform float u_correctionRatio; -uniform float u_minEdgeThickness; -uniform float u_feather; - -varying vec4 v_color; -varying vec2 v_normal; -varying float v_thickness; -varying float v_feather; - -const float bias = 255.0 / 254.0; - -void main() { - float minThickness = u_minEdgeThickness; - - vec2 normal = a_normal * a_normalCoef; - vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef; - - float normalLength = length(normal); - vec2 unitNormal = normal / normalLength; - - // We require edges to be at least "minThickness" pixels thick *on screen* - // (so we need to compensate the size ratio): - float pixelsThickness = max(normalLength, minThickness * u_sizeRatio); - - // Then, we need to retrieve the normalized thickness of the edge in the WebGL - // referential (in a ([0, 1], [0, 1]) space), using our "magic" correction - // ratio: - float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio; - - // Here is the proper position of the vertex - gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness, 1)).xy, 0, 1); - - // For the fragment shader though, we need a thickness that takes the "magic" - // correction ratio into account (as in webGLThickness), but so that the - // antialiasing effect does not depend on the zoom level. So here's yet - // another thickness version: - v_thickness = webGLThickness / u_zoomRatio; - - v_normal = unitNormal; - - v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0; - - #ifdef PICKING_MODE - // For picking mode, we use the ID as the color: - v_color = a_id; - #else - // For normal mode, we use the color: - v_color = a_color; - #endif - - v_color.a *= bias; -} -`,TD=_D,Jw=WebGLRenderingContext,Vy=Jw.UNSIGNED_BYTE,Vo=Jw.FLOAT,CD=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],AD=function(r){function n(){return At(this,n),It(this,n,arguments)}return Yt(n,r),Rt(n,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:TD,FRAGMENT_SHADER_SOURCE:qh,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:CD,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Vo},{name:"a_positionEnd",size:2,type:Vo},{name:"a_normal",size:2,type:Vo},{name:"a_color",size:4,type:Vy,normalized:!0},{name:"a_id",size:4,type:Vy,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Vo},{name:"a_normalCoef",size:1,type:Vo}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(a,s,l,c,f){var d=f.size||1,g=l.x,m=l.y,v=c.x,y=c.y,b=Xn(f.color),x=v-g,E=y-m,T=x*x+E*E,M=0,N=0;T&&(T=1/Math.sqrt(T),M=-E*T*d,N=x*T*d);var L=this.array;L[s++]=g,L[s++]=m,L[s++]=v,L[s++]=y,L[s++]=M,L[s++]=N,L[s++]=b,L[s++]=a}},{key:"setUniforms",value:function(a,s){var l=s.gl,c=s.uniformLocations,f=c.u_matrix,d=c.u_zoomRatio,g=c.u_feather,m=c.u_pixelRatio,v=c.u_correctionRatio,y=c.u_sizeRatio,b=c.u_minEdgeThickness;l.uniformMatrix3fv(f,!1,a.matrix),l.uniform1f(d,a.zoomRatio),l.uniform1f(y,a.sizeRatio),l.uniform1f(v,a.correctionRatio),l.uniform1f(m,a.pixelRatio),l.uniform1f(g,a.antiAliasingFeather),l.uniform1f(b,a.minEdgeThickness)}}])}(ls),Vh=function(r){function n(){var i;return At(this,n),i=It(this,n),i.rawEmitter=i,i}return Yt(n,r),Rt(n)}(xw.EventEmitter),od,Iy;function Zn(){return Iy||(Iy=1,od=function(n){return n!==null&&typeof n=="object"&&typeof n.addUndirectedEdgeWithKey=="function"&&typeof n.dropNode=="function"&&typeof n.multi=="boolean"}),od}var RD=Zn();const DD=on(RD);var OD=function(n){return n},kD=function(n){return n*n},LD=function(n){return n*(2-n)},ND=function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)},zD=function(n){return n*n*n},GD=function(n){return--n*n*n+1},MD=function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)},eE={linear:OD,quadraticIn:kD,quadraticOut:LD,quadraticInOut:ND,cubicIn:zD,cubicOut:GD,cubicInOut:MD},tE={easing:"quadraticInOut",duration:150};function jD(r,n,i,a){var s=Object.assign({},tE,i),l=typeof s.easing=="function"?s.easing:eE[s.easing],c=Date.now(),f={};for(var d in n){var g=n[d];f[d]={};for(var m in g)f[d][m]=r.getNodeAttribute(d,m)}var v=null,y=function(){v=null;var x=(Date.now()-c)/s.duration;if(x>=1){for(var E in n){var T=n[E];for(var M in T)r.setNodeAttribute(E,M,T[M])}return}x=l(x);for(var N in n){var L=n[N],C=f[N];for(var R in L)r.setNodeAttribute(N,R,L[R]*x+C[R]*(1-x))}v=requestAnimationFrame(y)};return y(),function(){v&&cancelAnimationFrame(v)}}function Dn(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Gl(r,n,i){return r[0]=n,r[4]=typeof i=="number"?i:n,r}function Yy(r,n){var i=Math.sin(n),a=Math.cos(n);return r[0]=a,r[1]=i,r[3]=-i,r[4]=a,r}function Xy(r,n,i){return r[6]=n,r[7]=i,r}function Vr(r,n){var i=r[0],a=r[1],s=r[2],l=r[3],c=r[4],f=r[5],d=r[6],g=r[7],m=r[8],v=n[0],y=n[1],b=n[2],x=n[3],E=n[4],T=n[5],M=n[6],N=n[7],L=n[8];return r[0]=v*i+y*l+b*d,r[1]=v*a+y*c+b*g,r[2]=v*s+y*f+b*m,r[3]=x*i+E*l+T*d,r[4]=x*a+E*c+T*g,r[5]=x*s+E*f+T*m,r[6]=M*i+N*l+L*d,r[7]=M*a+N*c+L*g,r[8]=M*s+N*f+L*m,r}function rh(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,a=r[0],s=r[1],l=r[3],c=r[4],f=r[6],d=r[7],g=n.x,m=n.y;return{x:g*a+m*l+f*i,y:g*s+m*c+d*i}}function UD(r,n){var i=r.height/r.width,a=n.height/n.width;return i<1&&a>1||i>1&&a<1?1:Math.min(Math.max(a,1/a),Math.max(1/i,i))}function Io(r,n,i,a,s){var l=r.angle,c=r.ratio,f=r.x,d=r.y,g=n.width,m=n.height,v=Dn(),y=Math.min(g,m)-2*a,b=UD(n,i);return s?(Vr(v,Xy(Dn(),f,d)),Vr(v,Gl(Dn(),c)),Vr(v,Yy(Dn(),l)),Vr(v,Gl(Dn(),g/y/2/b,m/y/2/b))):(Vr(v,Gl(Dn(),2*(y/g)*b,2*(y/m)*b)),Vr(v,Yy(Dn(),-l)),Vr(v,Gl(Dn(),1/c)),Vr(v,Xy(Dn(),-f,-d))),v}function BD(r,n,i){var a=rh(r,{x:Math.cos(n.angle),y:Math.sin(n.angle)},0),s=a.x,l=a.y;return 1/Math.sqrt(Math.pow(s,2)+Math.pow(l,2))/i.width}function FD(r){if(!r.order)return{x:[0,1],y:[0,1]};var n=1/0,i=-1/0,a=1/0,s=-1/0;return r.forEachNode(function(l,c){var f=c.x,d=c.y;fi&&(i=f),ds&&(s=d)}),{x:[n,i],y:[a,s]}}function HD(r){if(!DD(r))throw new Error("Sigma: invalid graph instance.");r.forEachNode(function(n,i){if(!Number.isFinite(i.x)||!Number.isFinite(i.y))throw new Error("Sigma: Coordinates of node ".concat(n," are invalid. A node must have a numeric 'x' and 'y' attribute."))})}function PD(r,n,i){var a=document.createElement(r);if(n)for(var s in n)a.style[s]=n[s];if(i)for(var l in i)a.setAttribute(l,i[l]);return a}function Zy(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function Wy(r,n,i){return i.sort(function(a,s){var l=n(a)||0,c=n(s)||0;return lc?1:0})}function Ky(r){var n=Na(r.x,2),i=n[0],a=n[1],s=Na(r.y,2),l=s[0],c=s[1],f=Math.max(a-i,c-l),d=(a+i)/2,g=(c+l)/2;(f===0||Math.abs(f)===1/0||isNaN(f))&&(f=1),isNaN(d)&&(d=0),isNaN(g)&&(g=0);var m=function(y){return{x:.5+(y.x-d)/f,y:.5+(y.y-g)/f}};return m.applyTo=function(v){v.x=.5+(v.x-d)/f,v.y=.5+(v.y-g)/f},m.inverse=function(v){return{x:d+f*(v.x-.5),y:g+f*(v.y-.5)}},m.ratio=f,m}function ih(r){"@babel/helpers - typeof";return ih=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ih(r)}function Qy(r,n){var i=n.size;if(i!==0){var a=r.length;r.length+=i;var s=0;n.forEach(function(l){r[a+s]=l,s++})}}function sd(r){r=r||{};for(var n=0,i=arguments.length<=1?0:arguments.length-1;n1&&arguments[1]!==void 0?arguments[1]:{},c=arguments.length>2?arguments[2]:void 0;if(!c)return new Promise(function(b){return s.animate(a,l,b)});if(this.enabled){var f=_e(_e({},tE),l),d=this.validateState(a),g=typeof f.easing=="function"?f.easing:eE[f.easing],m=Date.now(),v=this.getState(),y=function(){var x=(Date.now()-m)/f.duration;if(x>=1){s.nextFrame=null,s.setState(d),s.animationCallback&&(s.animationCallback.call(null),s.animationCallback=void 0);return}var E=g(x),T={};typeof d.x=="number"&&(T.x=v.x+(d.x-v.x)*E),typeof d.y=="number"&&(T.y=v.y+(d.y-v.y)*E),s.enabledRotation&&typeof d.angle=="number"&&(T.angle=v.angle+(d.angle-v.angle)*E),typeof d.ratio=="number"&&(T.ratio=v.ratio+(d.ratio-v.ratio)*E),s.setState(T),s.nextFrame=requestAnimationFrame(y)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(y)):y(),this.animationCallback=c}}},{key:"animatedZoom",value:function(a){return a?typeof a=="number"?this.animate({ratio:this.ratio/a}):this.animate({ratio:this.ratio/(a.factor||Ml)},a):this.animate({ratio:this.ratio/Ml})}},{key:"animatedUnzoom",value:function(a){return a?typeof a=="number"?this.animate({ratio:this.ratio*a}):this.animate({ratio:this.ratio*(a.factor||Ml)},a):this.animate({ratio:this.ratio*Ml})}},{key:"animatedReset",value:function(a){return this.animate({x:.5,y:.5,ratio:1,angle:0},a)}},{key:"copy",value:function(){return n.from(this.getState())}}],[{key:"from",value:function(a){var s=new n;return s.setState(a)}}])}(Vh);function On(r,n){var i=n.getBoundingClientRect();return{x:r.clientX-i.left,y:r.clientY-i.top}}function mr(r,n){var i=_e(_e({},On(r,n)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){i.sigmaDefaultPrevented=!0},original:r});return i}function Yo(r){var n="x"in r?r:_e(_e({},r.touches[0]||r.previousTouches[0]),{},{original:r.original,sigmaDefaultPrevented:r.sigmaDefaultPrevented,preventSigmaDefault:function(){r.sigmaDefaultPrevented=!0,n.sigmaDefaultPrevented=!0}});return n}function ID(r,n){return _e(_e({},mr(r,n)),{},{delta:nE(r)})}var YD=2;function Yl(r){for(var n=[],i=0,a=Math.min(r.length,YD);i0;s.draggedEvents=0,v&&s.renderer.getSetting("hideEdgesOnMove")&&s.renderer.refresh()},0),this.emit("mouseup",mr(a,this.container))}}},{key:"handleMove",value:function(a){var s=this;if(this.enabled){var l=mr(a,this.container);if(this.emit("mousemovebody",l),(a.target===this.container||a.composedPath()[0]===this.container)&&this.emit("mousemove",l),!l.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){s.movingTimeout=null,s.isMoving=!1},this.settings.dragTimeout);var c=this.renderer.getCamera(),f=On(a,this.container),d=f.x,g=f.y,m=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),v=this.renderer.viewportToFramedGraph({x:d,y:g}),y=m.x-v.x,b=m.y-v.y,x=c.getState(),E=x.x+y,T=x.y+b;c.setState({x:E,y:T}),this.lastMouseX=d,this.lastMouseY=g,a.preventDefault(),a.stopPropagation()}}}},{key:"handleLeave",value:function(a){this.emit("mouseleave",mr(a,this.container))}},{key:"handleEnter",value:function(a){this.emit("mouseenter",mr(a,this.container))}},{key:"handleWheel",value:function(a){var s=this,l=this.renderer.getCamera();if(!(!this.enabled||!l.enabledZooming)){var c=nE(a);if(c){var f=ID(a,this.container);if(this.emit("wheel",f),f.sigmaDefaultPrevented){a.preventDefault(),a.stopPropagation();return}var d=l.getState().ratio,g=c>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,m=l.getBoundedRatio(d*g),v=c>0?1:-1,y=Date.now();d!==m&&(a.preventDefault(),a.stopPropagation(),!(this.currentWheelDirection===v&&this.lastWheelTriggerTime&&y-this.lastWheelTriggerTimea.size?-1:i.sizea.key?1:-1}}])}(),nb=function(){function r(){At(this,r),fe(this,"width",0),fe(this,"height",0),fe(this,"cellSize",0),fe(this,"columns",0),fe(this,"rows",0),fe(this,"cells",{})}return Rt(r,[{key:"resizeAndClear",value:function(i,a){this.width=i.width,this.height=i.height,this.cellSize=a,this.columns=Math.ceil(i.width/a),this.rows=Math.ceil(i.height/a),this.cells={}}},{key:"getIndex",value:function(i){var a=Math.floor(i.x/this.cellSize),s=Math.floor(i.y/this.cellSize);return s*this.columns+a}},{key:"add",value:function(i,a,s){var l=new tb(i,a),c=this.getIndex(s),f=this.cells[c];f||(f=[],this.cells[c]=f),f.push(l)}},{key:"organize",value:function(){for(var i in this.cells){var a=this.cells[i];a.sort(tb.compare)}}},{key:"getLabelsToDisplay",value:function(i,a){var s=this.cellSize*this.cellSize,l=s/i/i,c=l*a/s,f=Math.ceil(c),d=[];for(var g in this.cells)for(var m=this.cells[g],v=0;v2&&arguments[2]!==void 0?arguments[2]:{};if(At(this,n),s=It(this,n),fe(s,"elements",{}),fe(s,"canvasContexts",{}),fe(s,"webGLContexts",{}),fe(s,"pickingLayers",new Set),fe(s,"textures",{}),fe(s,"frameBuffers",{}),fe(s,"activeListeners",{}),fe(s,"labelGrid",new nb),fe(s,"nodeDataCache",{}),fe(s,"edgeDataCache",{}),fe(s,"nodeProgramIndex",{}),fe(s,"edgeProgramIndex",{}),fe(s,"nodesWithForcedLabels",new Set),fe(s,"edgesWithForcedLabels",new Set),fe(s,"nodeExtent",{x:[0,1],y:[0,1]}),fe(s,"nodeZExtent",[1/0,-1/0]),fe(s,"edgeZExtent",[1/0,-1/0]),fe(s,"matrix",Dn()),fe(s,"invMatrix",Dn()),fe(s,"correctionRatio",1),fe(s,"customBBox",null),fe(s,"normalizationFunction",Ky({x:[0,1],y:[0,1]})),fe(s,"graphToViewportRatio",1),fe(s,"itemIDsIndex",{}),fe(s,"nodeIndices",{}),fe(s,"edgeIndices",{}),fe(s,"width",0),fe(s,"height",0),fe(s,"pixelRatio",Zy()),fe(s,"pickingDownSizingRatio",2*s.pixelRatio),fe(s,"displayedNodeLabels",new Set),fe(s,"displayedEdgeLabels",new Set),fe(s,"highlightedNodes",new Set),fe(s,"hoveredNode",null),fe(s,"hoveredEdge",null),fe(s,"renderFrame",null),fe(s,"renderHighlightedNodesFrame",null),fe(s,"needToProcess",!1),fe(s,"checkEdgesEventsFrame",null),fe(s,"nodePrograms",{}),fe(s,"nodeHoverPrograms",{}),fe(s,"edgePrograms",{}),s.settings=VD(l),ld(s.settings),HD(i),!(a instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");s.graph=i,s.container=a,s.createWebGLContext("edges",{picking:l.enableEdgeEvents}),s.createCanvasContext("edgeLabels"),s.createWebGLContext("nodes",{picking:!0}),s.createCanvasContext("labels"),s.createCanvasContext("hovers"),s.createWebGLContext("hoverNodes"),s.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),s.resize();for(var c in s.settings.nodeProgramClasses)s.registerNodeProgram(c,s.settings.nodeProgramClasses[c],s.settings.nodeHoverProgramClasses[c]);for(var f in s.settings.edgeProgramClasses)s.registerEdgeProgram(f,s.settings.edgeProgramClasses[f]);return s.camera=new Jy,s.bindCameraHandlers(),s.mouseCaptor=new WD(s.elements.mouse,s),s.mouseCaptor.setSettings(s.settings),s.touchCaptor=new JD(s.elements.mouse,s),s.touchCaptor.setSettings(s.settings),s.bindEventHandlers(),s.bindGraphHandlers(),s.handleSettingsUpdate(),s.refresh(),s}return Yt(n,r),Rt(n,[{key:"registerNodeProgram",value:function(a,s,l){return this.nodePrograms[a]&&this.nodePrograms[a].kill(),this.nodeHoverPrograms[a]&&this.nodeHoverPrograms[a].kill(),this.nodePrograms[a]=new s(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[a]=new(l||s)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(a,s){return this.edgePrograms[a]&&this.edgePrograms[a].kill(),this.edgePrograms[a]=new s(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(a){if(this.nodePrograms[a]){var s=this.nodePrograms,l=s[a],c=ud(s,[a].map(Qo));l.kill(),this.nodePrograms=c}if(this.nodeHoverPrograms[a]){var f=this.nodeHoverPrograms,d=f[a],g=ud(f,[a].map(Qo));d.kill(),this.nodePrograms=g}return this}},{key:"unregisterEdgeProgram",value:function(a){if(this.edgePrograms[a]){var s=this.edgePrograms,l=s[a],c=ud(s,[a].map(Qo));l.kill(),this.edgePrograms=c}return this}},{key:"resetWebGLTexture",value:function(a){var s=this.webGLContexts[a],l=this.frameBuffers[a],c=this.textures[a];c&&s.deleteTexture(c);var f=s.createTexture();return s.bindFramebuffer(s.FRAMEBUFFER,l),s.bindTexture(s.TEXTURE_2D,f),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,this.width,this.height,0,s.RGBA,s.UNSIGNED_BYTE,null),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,f,0),this.textures[a]=f,this}},{key:"bindCameraHandlers",value:function(){var a=this;return this.activeListeners.camera=function(){a.scheduleRender()},this.camera.on("updated",this.activeListeners.camera),this}},{key:"unbindCameraHandlers",value:function(){return this.camera.removeListener("updated",this.activeListeners.camera),this}},{key:"getNodeAtPosition",value:function(a){var s=a.x,l=a.y,c=jy(this.webGLContexts.nodes,this.frameBuffers.nodes,s,l,this.pixelRatio,this.pickingDownSizingRatio),f=My.apply(void 0,eb(c)),d=this.itemIDsIndex[f];return d&&d.type==="node"?d.id:null}},{key:"bindEventHandlers",value:function(){var a=this;this.activeListeners.handleResize=function(){a.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(l){var c=Yo(l),f={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}},d=a.getNodeAtPosition(c);if(d&&a.hoveredNode!==d&&!a.nodeDataCache[d].hidden){a.hoveredNode&&a.emit("leaveNode",_e(_e({},f),{},{node:a.hoveredNode})),a.hoveredNode=d,a.emit("enterNode",_e(_e({},f),{},{node:d})),a.scheduleHighlightedNodesRender();return}if(a.hoveredNode&&a.getNodeAtPosition(c)!==a.hoveredNode){var g=a.hoveredNode;a.hoveredNode=null,a.emit("leaveNode",_e(_e({},f),{},{node:g})),a.scheduleHighlightedNodesRender();return}if(a.settings.enableEdgeEvents){var m=a.hoveredNode?null:a.getEdgeAtPoint(f.event.x,f.event.y);m!==a.hoveredEdge&&(a.hoveredEdge&&a.emit("leaveEdge",_e(_e({},f),{},{edge:a.hoveredEdge})),m&&a.emit("enterEdge",_e(_e({},f),{},{edge:m})),a.hoveredEdge=m)}},this.activeListeners.handleMoveBody=function(l){var c=Yo(l);a.emit("moveBody",{event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(l){var c=Yo(l),f={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}};a.hoveredNode&&(a.emit("leaveNode",_e(_e({},f),{},{node:a.hoveredNode})),a.scheduleHighlightedNodesRender()),a.settings.enableEdgeEvents&&a.hoveredEdge&&(a.emit("leaveEdge",_e(_e({},f),{},{edge:a.hoveredEdge})),a.scheduleHighlightedNodesRender()),a.emit("leaveStage",_e({},f))},this.activeListeners.handleEnter=function(l){var c=Yo(l),f={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}};a.emit("enterStage",_e({},f))};var s=function(c){return function(f){var d=Yo(f),g={event:d,preventSigmaDefault:function(){d.preventSigmaDefault()}},m=a.getNodeAtPosition(d);if(m)return a.emit("".concat(c,"Node"),_e(_e({},g),{},{node:m}));if(a.settings.enableEdgeEvents){var v=a.getEdgeAtPoint(d.x,d.y);if(v)return a.emit("".concat(c,"Edge"),_e(_e({},g),{},{edge:v}))}return a.emit("".concat(c,"Stage"),g)}};return this.activeListeners.handleClick=s("click"),this.activeListeners.handleRightClick=s("rightClick"),this.activeListeners.handleDoubleClick=s("doubleClick"),this.activeListeners.handleWheel=s("wheel"),this.activeListeners.handleDown=s("down"),this.activeListeners.handleUp=s("up"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("mousemovebody",this.activeListeners.handleMoveBody),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this.mouseCaptor.on("mouseup",this.activeListeners.handleUp),this.mouseCaptor.on("mouseleave",this.activeListeners.handleLeave),this.mouseCaptor.on("mouseenter",this.activeListeners.handleEnter),this.touchCaptor.on("touchdown",this.activeListeners.handleDown),this.touchCaptor.on("touchdown",this.activeListeners.handleMove),this.touchCaptor.on("touchup",this.activeListeners.handleUp),this.touchCaptor.on("touchmove",this.activeListeners.handleMove),this.touchCaptor.on("tap",this.activeListeners.handleClick),this.touchCaptor.on("doubletap",this.activeListeners.handleDoubleClick),this.touchCaptor.on("touchmove",this.activeListeners.handleMoveBody),this}},{key:"bindGraphHandlers",value:function(){var a=this,s=this.graph,l=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(c){var f,d=(f=c.hints)===null||f===void 0?void 0:f.attributes;a.graph.forEachNode(function(m){return a.updateNode(m)});var g=!d||d.some(function(m){return l.has(m)});a.refresh({partialGraph:{nodes:s.nodes()},skipIndexation:!g,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(c){var f,d=(f=c.hints)===null||f===void 0?void 0:f.attributes;a.graph.forEachEdge(function(m){return a.updateEdge(m)});var g=d&&["zIndex","type"].some(function(m){return d==null?void 0:d.includes(m)});a.refresh({partialGraph:{edges:s.edges()},skipIndexation:!g,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(c){var f=c.key;a.addNode(f),a.refresh({partialGraph:{nodes:[f]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(c){var f=c.key;a.refresh({partialGraph:{nodes:[f]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(c){var f=c.key;a.removeNode(f),a.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(c){var f=c.key;a.addEdge(f),a.refresh({partialGraph:{edges:[f]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(c){var f=c.key;a.refresh({partialGraph:{edges:[f]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(c){var f=c.key;a.removeEdge(f),a.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){a.clearEdgeState(),a.clearEdgeIndices(),a.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){a.clearEdgeState(),a.clearNodeState(),a.clearEdgeIndices(),a.clearNodeIndices(),a.refresh({schedule:!0})},s.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),s.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),s.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),s.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),s.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),s.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),s.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),s.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),s.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),s.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var a=this.graph;a.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),a.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),a.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),a.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),a.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),a.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),a.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),a.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),a.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),a.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(a,s){var l=jy(this.webGLContexts.edges,this.frameBuffers.edges,a,s,this.pixelRatio,this.pickingDownSizingRatio),c=My.apply(void 0,eb(l)),f=this.itemIDsIndex[c];return f&&f.type==="edge"?f.id:null}},{key:"process",value:function(){var a=this;this.emit("beforeProcess");var s=this.graph,l=this.settings,c=this.getDimensions();if(this.nodeExtent=FD(this.graph),!this.settings.autoRescale){var f=c.width,d=c.height,g=this.nodeExtent,m=g.x,v=g.y;this.nodeExtent={x:[(m[0]+m[1])/2-f/2,(m[0]+m[1])/2+f/2],y:[(v[0]+v[1])/2-d/2,(v[0]+v[1])/2+d/2]}}this.normalizationFunction=Ky(this.customBBox||this.nodeExtent);var y=new Jy,b=Io(y.getState(),c,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(c,l.labelGridCellSize);for(var x={},E={},T={},M={},N=1,L=s.nodes(),C=0,R=L.length;C1&&arguments[1]!==void 0?arguments[1]:{},l=s.tolerance,c=l===void 0?0:l,f=s.boundaries,d=_e({},a),g=f||this.nodeExtent,m=Na(g.x,2),v=m[0],y=m[1],b=Na(g.y,2),x=b[0],E=b[1],T=[this.graphToViewport({x:v,y:x},{cameraState:a}),this.graphToViewport({x:y,y:x},{cameraState:a}),this.graphToViewport({x:v,y:E},{cameraState:a}),this.graphToViewport({x:y,y:E},{cameraState:a})],M=1/0,N=-1/0,L=1/0,C=-1/0;T.forEach(function(J){var ae=J.x,H=J.y;M=Math.min(M,ae),N=Math.max(N,ae),L=Math.min(L,H),C=Math.max(C,H)});var R=N-M,B=C-L,_=this.getDimensions(),$=_.width,z=_.height,F=0,Y=0;if(R>=$?N<$-c?F=N-($-c):M>c&&(F=M-c):N>$+c?F=N-($+c):M<-c&&(F=M+c),B>=z?Cc&&(Y=L-c):C>z+c?Y=C-(z+c):L<-c&&(Y=L+c),F||Y){var I=this.viewportToFramedGraph({x:0,y:0},{cameraState:a}),j=this.viewportToFramedGraph({x:F,y:Y},{cameraState:a});F=j.x-I.x,Y=j.y-I.y,d.x+=F,d.y+=Y}return d}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var a=this.camera.getState(),s=this.labelGrid.getLabelsToDisplay(a.ratio,this.settings.labelDensity);Qy(s,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var l=this.canvasContexts.labels,c=0,f=s.length;cthis.width+aO||y<-50||y>this.height+oO)){this.displayedNodeLabels.add(d);var x=this.settings.defaultDrawNodeLabel,E=this.nodePrograms[g.type],T=(E==null?void 0:E.drawLabel)||x;T(l,_e(_e({key:d},g),{},{size:b,x:v,y}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var a=this.canvasContexts.edgeLabels;a.clearRect(0,0,this.width,this.height);var s=iO({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});Qy(s,this.edgesWithForcedLabels);for(var l=new Set,c=0,f=s.length;cthis.nodeZExtent[1]&&(this.nodeZExtent[1]=l.zIndex))}},{key:"updateNode",value:function(a){this.addNode(a);var s=this.nodeDataCache[a];this.normalizationFunction.applyTo(s)}},{key:"removeNode",value:function(a){delete this.nodeDataCache[a],delete this.nodeProgramIndex[a],this.highlightedNodes.delete(a),this.hoveredNode===a&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(a)}},{key:"addEdge",value:function(a){var s=Object.assign({},this.graph.getEdgeAttributes(a));this.settings.edgeReducer&&(s=this.settings.edgeReducer(a,s));var l=lO(this.settings,a,s);this.edgeDataCache[a]=l,this.edgesWithForcedLabels.delete(a),l.forceLabel&&!l.hidden&&this.edgesWithForcedLabels.add(a),this.settings.zIndex&&(l.zIndexthis.edgeZExtent[1]&&(this.edgeZExtent[1]=l.zIndex))}},{key:"updateEdge",value:function(a){this.addEdge(a)}},{key:"removeEdge",value:function(a){delete this.edgeDataCache[a],delete this.edgeProgramIndex[a],this.hoveredEdge===a&&(this.hoveredEdge=null),this.edgesWithForcedLabels.delete(a)}},{key:"clearNodeIndices",value:function(){this.labelGrid=new nb,this.nodeExtent={x:[0,1],y:[0,1]},this.nodeDataCache={},this.edgeProgramIndex={},this.nodesWithForcedLabels=new Set,this.nodeZExtent=[1/0,-1/0]}},{key:"clearEdgeIndices",value:function(){this.edgeDataCache={},this.edgeProgramIndex={},this.edgesWithForcedLabels=new Set,this.edgeZExtent=[1/0,-1/0]}},{key:"clearIndices",value:function(){this.clearEdgeIndices(),this.clearNodeIndices()}},{key:"clearNodeState",value:function(){this.displayedNodeLabels=new Set,this.highlightedNodes=new Set,this.hoveredNode=null}},{key:"clearEdgeState",value:function(){this.displayedEdgeLabels=new Set,this.highlightedNodes=new Set,this.hoveredEdge=null}},{key:"clearState",value:function(){this.clearEdgeState(),this.clearNodeState()}},{key:"addNodeToProgram",value:function(a,s,l){var c=this.nodeDataCache[a],f=this.nodePrograms[c.type];if(!f)throw new Error('Sigma: could not find a suitable program for node type "'.concat(c.type,'"!'));f.process(s,l,c),this.nodeProgramIndex[a]=l}},{key:"addEdgeToProgram",value:function(a,s,l){var c=this.edgeDataCache[a],f=this.edgePrograms[c.type];if(!f)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(c.type,'"!'));var d=this.graph.extremities(a),g=this.nodeDataCache[d[0]],m=this.nodeDataCache[d[1]];f.process(s,l,g,m,c),this.edgeProgramIndex[a]=l}},{key:"getRenderParams",value:function(){return{matrix:this.matrix,invMatrix:this.invMatrix,width:this.width,height:this.height,pixelRatio:this.pixelRatio,zoomRatio:this.camera.ratio,cameraAngle:this.camera.angle,sizeRatio:1/this.scaleSize(),correctionRatio:this.correctionRatio,downSizingRatio:this.pickingDownSizingRatio,minEdgeThickness:this.settings.minEdgeThickness,antiAliasingFeather:this.settings.antiAliasingFeather}}},{key:"getStagePadding",value:function(){var a=this.settings,s=a.stagePadding,l=a.autoRescale;return l&&s||0}},{key:"createLayer",value:function(a,s){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[a])throw new Error('Sigma: a layer named "'.concat(a,'" already exists'));var c=PD(s,{position:"absolute"},{class:"sigma-".concat(a)});return l.style&&Object.assign(c.style,l.style),this.elements[a]=c,"beforeLayer"in l&&l.beforeLayer?this.elements[l.beforeLayer].before(c):"afterLayer"in l&&l.afterLayer?this.elements[l.afterLayer].after(c):this.container.appendChild(c),c}},{key:"createCanvas",value:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(a,"canvas",s)}},{key:"createCanvasContext",value:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=this.createCanvas(a,s),c={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[a]=l.getContext("2d",c),this}},{key:"createWebGLContext",value:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=(s==null?void 0:s.canvas)||this.createCanvas(a,s);s.hidden&&l.remove();var c=_e({preserveDrawingBuffer:!1,antialias:!1},s),f;f=l.getContext("webgl2",c),f||(f=l.getContext("webgl",c)),f||(f=l.getContext("experimental-webgl",c));var d=f;if(this.webGLContexts[a]=d,d.blendFunc(d.ONE,d.ONE_MINUS_SRC_ALPHA),s.picking){this.pickingLayers.add(a);var g=d.createFramebuffer();if(!g)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(a));this.frameBuffers[a]=g}return d}},{key:"killLayer",value:function(a){var s=this.elements[a];if(!s)throw new Error("Sigma: cannot kill layer ".concat(a,", which does not exist"));if(this.webGLContexts[a]){var l,c=this.webGLContexts[a];(l=c.getExtension("WEBGL_lose_context"))===null||l===void 0||l.loseContext(),delete this.webGLContexts[a]}else this.canvasContexts[a]&&delete this.canvasContexts[a];return s.remove(),delete this.elements[a],this}},{key:"getCamera",value:function(){return this.camera}},{key:"setCamera",value:function(a){this.unbindCameraHandlers(),this.camera=a,this.bindCameraHandlers()}},{key:"getContainer",value:function(){return this.container}},{key:"getGraph",value:function(){return this.graph}},{key:"setGraph",value:function(a){a!==this.graph&&(this.hoveredNode&&!a.hasNode(this.hoveredNode)&&(this.hoveredNode=null),this.hoveredEdge&&!a.hasEdge(this.hoveredEdge)&&(this.hoveredEdge=null),this.unbindGraphHandlers(),this.checkEdgesEventsFrame!==null&&(cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=a,this.bindGraphHandlers(),this.refresh())}},{key:"getMouseCaptor",value:function(){return this.mouseCaptor}},{key:"getTouchCaptor",value:function(){return this.touchCaptor}},{key:"getDimensions",value:function(){return{width:this.width,height:this.height}}},{key:"getGraphDimensions",value:function(){var a=this.customBBox||this.nodeExtent;return{width:a.x[1]-a.x[0]||1,height:a.y[1]-a.y[0]||1}}},{key:"getNodeDisplayData",value:function(a){var s=this.nodeDataCache[a];return s?Object.assign({},s):void 0}},{key:"getEdgeDisplayData",value:function(a){var s=this.edgeDataCache[a];return s?Object.assign({},s):void 0}},{key:"getNodeDisplayedLabels",value:function(){return new Set(this.displayedNodeLabels)}},{key:"getEdgeDisplayedLabels",value:function(){return new Set(this.displayedEdgeLabels)}},{key:"getSettings",value:function(){return _e({},this.settings)}},{key:"getSetting",value:function(a){return this.settings[a]}},{key:"setSetting",value:function(a,s){var l=_e({},this.settings);return this.settings[a]=s,ld(this.settings),this.handleSettingsUpdate(l),this.scheduleRefresh(),this}},{key:"updateSetting",value:function(a,s){return this.setSetting(a,s(this.settings[a])),this}},{key:"setSettings",value:function(a){var s=_e({},this.settings);return this.settings=_e(_e({},this.settings),a),ld(this.settings),this.handleSettingsUpdate(s),this.scheduleRefresh(),this}},{key:"resize",value:function(a){var s=this.width,l=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=Zy(),this.width===0)if(this.settings.allowInvalidContainer)this.width=1;else throw new Error("Sigma: Container has no width. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(this.height===0)if(this.settings.allowInvalidContainer)this.height=1;else throw new Error("Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(!a&&s===this.width&&l===this.height)return this;for(var c in this.elements){var f=this.elements[c];f.style.width=this.width+"px",f.style.height=this.height+"px"}for(var d in this.canvasContexts)this.elements[d].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[d].setAttribute("height",this.height*this.pixelRatio+"px"),this.pixelRatio!==1&&this.canvasContexts[d].scale(this.pixelRatio,this.pixelRatio);for(var g in this.webGLContexts){this.elements[g].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[g].setAttribute("height",this.height*this.pixelRatio+"px");var m=this.webGLContexts[g];if(m.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(g)){var v=this.textures[g];v&&m.deleteTexture(v)}}return this.emit("resize"),this}},{key:"clear",value:function(){return this.emit("beforeClear"),this.webGLContexts.nodes.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.nodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.edges.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.edges.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.hoverNodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.canvasContexts.labels.clearRect(0,0,this.width,this.height),this.canvasContexts.hovers.clearRect(0,0,this.width,this.height),this.canvasContexts.edgeLabels.clearRect(0,0,this.width,this.height),this.emit("afterClear"),this}},{key:"refresh",value:function(a){var s=this,l=(a==null?void 0:a.skipIndexation)!==void 0?a==null?void 0:a.skipIndexation:!1,c=(a==null?void 0:a.schedule)!==void 0?a.schedule:!1,f=!a||!a.partialGraph;if(f)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(C){return s.addNode(C)}),this.graph.forEachEdge(function(C){return s.addEdge(C)});else{for(var d,g,m=((d=a.partialGraph)===null||d===void 0?void 0:d.nodes)||[],v=0,y=(m==null?void 0:m.length)||0;v1&&arguments[1]!==void 0?arguments[1]:{},l=!!s.cameraState||!!s.viewportDimensions||!!s.graphDimensions,c=s.matrix?s.matrix:l?Io(s.cameraState||this.camera.getState(),s.viewportDimensions||this.getDimensions(),s.graphDimensions||this.getGraphDimensions(),s.padding||this.getStagePadding()):this.matrix,f=rh(c,a);return{x:(1+f.x)*this.width/2,y:(1-f.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=!!s.cameraState||!!s.viewportDimensions||!s.graphDimensions,c=s.matrix?s.matrix:l?Io(s.cameraState||this.camera.getState(),s.viewportDimensions||this.getDimensions(),s.graphDimensions||this.getGraphDimensions(),s.padding||this.getStagePadding(),!0):this.invMatrix,f=rh(c,{x:a.x/this.width*2-1,y:1-a.y/this.height*2});return isNaN(f.x)&&(f.x=0),isNaN(f.y)&&(f.y=0),f}},{key:"viewportToGraph",value:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(a,s))}},{key:"graphToViewport",value:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(a),s)}},{key:"getGraphToViewportRatio",value:function(){var a={x:0,y:0},s={x:1,y:1},l=Math.sqrt(Math.pow(a.x-s.x,2)+Math.pow(a.y-s.y,2)),c=this.graphToViewport(a),f=this.graphToViewport(s),d=Math.sqrt(Math.pow(c.x-f.x,2)+Math.pow(c.y-f.y,2));return d/l}},{key:"getBBox",value:function(){return this.nodeExtent}},{key:"getCustomBBox",value:function(){return this.customBBox}},{key:"setCustomBBox",value:function(a){return this.customBBox=a,this.scheduleRender(),this}},{key:"kill",value:function(){this.emit("kill"),this.removeAllListeners(),this.unbindCameraHandlers(),window.removeEventListener("resize",this.activeListeners.handleResize),this.mouseCaptor.kill(),this.touchCaptor.kill(),this.unbindGraphHandlers(),this.clearIndices(),this.clearState(),this.nodeDataCache={},this.edgeDataCache={},this.highlightedNodes.clear(),this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null),this.renderHighlightedNodesFrame&&(cancelAnimationFrame(this.renderHighlightedNodesFrame),this.renderHighlightedNodesFrame=null);for(var a=this.container;a.firstChild;)a.removeChild(a.firstChild);this.canvasContexts={},this.webGLContexts={},this.elements={};for(var s in this.nodePrograms)this.nodePrograms[s].kill();for(var l in this.nodeHoverPrograms)this.nodeHoverPrograms[l].kill();for(var c in this.edgePrograms)this.edgePrograms[c].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var f in this.elements)this.killLayer(f)}},{key:"scaleSize",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return a/this.settings.zoomToSizeRatioFunction(s)*(this.getSetting("itemSizesReference")==="positions"?s*this.graphToViewportRatio:1)}},{key:"getCanvases",value:function(){var a={};for(var s in this.elements)this.elements[s]instanceof HTMLCanvasElement&&(a[s]=this.elements[s]);return a}}])}(Vh);const iE=S.createContext(null),cO=iE.Provider;function Yh(){const r=S.useContext(iE);if(r==null)throw new Error("No context provided: useSigmaContext() can only be used in a descendant of ");return r}function Sn(){return Yh().sigma}function aE(){const{sigma:r}=Yh();return S.useCallback(n=>{r&&Object.keys(n).forEach(i=>{r.setSetting(i,n[i])})},[r])}function xu(r){return new Set(Object.keys(r))}const rb=xu({clickNode:!0,rightClickNode:!0,downNode:!0,enterNode:!0,leaveNode:!0,doubleClickNode:!0,wheelNode:!0,clickEdge:!0,rightClickEdge:!0,downEdge:!0,enterEdge:!0,leaveEdge:!0,doubleClickEdge:!0,wheelEdge:!0,clickStage:!0,rightClickStage:!0,downStage:!0,doubleClickStage:!0,wheelStage:!0,beforeRender:!0,afterRender:!0,kill:!0,upStage:!0,upEdge:!0,upNode:!0,enterStage:!0,leaveStage:!0,resize:!0,afterClear:!0,afterProcess:!0,beforeClear:!0,beforeProcess:!0,moveBody:!0}),ib=xu({click:!0,rightClick:!0,doubleClick:!0,mouseup:!0,mousedown:!0,mousemove:!0,mousemovebody:!0,mouseleave:!0,mouseenter:!0,wheel:!0}),ab=xu({touchup:!0,touchdown:!0,touchmove:!0,touchmovebody:!0,tap:!0,doubletap:!0}),ob=xu({updated:!0});function oE(){const r=Sn(),n=aE(),[i,a]=S.useState({});return S.useEffect(()=>{if(!r||!i)return;const s=i,l=Object.keys(s);return l.forEach(c=>{const f=s[c];rb.has(c)&&r.on(c,f),ib.has(c)&&r.getMouseCaptor().on(c,f),ab.has(c)&&r.getTouchCaptor().on(c,f),ob.has(c)&&r.getCamera().on(c,f)}),()=>{r&&l.forEach(c=>{const f=s[c];rb.has(c)&&r.off(c,f),ib.has(c)&&r.getMouseCaptor().off(c,f),ab.has(c)&&r.getTouchCaptor().off(c,f),ob.has(c)&&r.getCamera().off(c,f)})}},[r,i,n]),a}function fO(){const r=Sn();return S.useCallback((n,i=!0)=>{r&&n&&(i&&r.getGraph().order>0&&r.getGraph().clear(),r.getGraph().import(n),r.refresh())},[r])}function fs(r,n){if(r===n)return!0;if(typeof r=="object"&&r!=null&&typeof n=="object"&&n!=null){if(Object.keys(r).length!=Object.keys(n).length)return!1;for(const i in r)if(!Object.hasOwn(n,i)||!fs(r[i],n[i]))return!1;return!0}return!1}function sE(r){const n=Sn(),[i,a]=S.useState(r||{});S.useEffect(()=>{a(g=>fs(g,r||{})?g:r||{})},[r]);const s=S.useCallback(g=>{n.getCamera().animatedZoom(Object.assign(Object.assign({},i),g))},[n,i]),l=S.useCallback(g=>{n.getCamera().animatedUnzoom(Object.assign(Object.assign({},i),g))},[n,i]),c=S.useCallback(g=>{n.getCamera().animatedReset(Object.assign(Object.assign({},i),g))},[n,i]),f=S.useCallback((g,m)=>{n.getCamera().animate(g,Object.assign(Object.assign({},i),m))},[n,i]),d=S.useCallback((g,m)=>{const v=n.getNodeDisplayData(g);v?n.getCamera().animate(v,Object.assign(Object.assign({},i),m)):console.warn(`Node ${g} not found`)},[n,i]);return{zoomIn:s,zoomOut:l,reset:c,goto:f,gotoNode:d}}function dO(r){const n=Yh(),[i,a]=S.useState(!1),[s,l]=S.useState(n.container),c=S.useCallback(()=>a(f=>!f),[]);return S.useEffect(()=>(document.addEventListener("fullscreenchange",c),()=>document.removeEventListener("fullscreenchange",c)),[c]),S.useEffect(()=>{l(n.container)},[r,n.container]),{toggle:S.useCallback(()=>{var f;f=s,document.fullscreenElement!==f?f.requestFullscreen():document.exitFullscreen&&document.exitFullscreen()},[s]),isFullScreen:i}}const hO=S.forwardRef(({graph:r,id:n,className:i,style:a,settings:s={},children:l},c)=>{const f=S.useRef(null),d=S.useRef(null),g={className:`react-sigma ${i||""}`,id:n,style:a},[m,v]=S.useState(null),[y,b]=S.useState(s);S.useEffect(()=>{b(T=>fs(T,s)?T:s)},[s]),S.useEffect(()=>{v(T=>{let M=null;if(d.current!==null){let N=new Ke;r&&(N=typeof r=="function"?new r:r);let L=null;T&&(L=T.getCamera().getState(),T.kill()),M=new uO(N,d.current,y),L&&M.getCamera().setState(L)}return M})},[d,r,y]),S.useImperativeHandle(c,()=>m,[m]);const x=S.useMemo(()=>m&&f.current?{sigma:m,container:f.current}:null,[m,f]),E=x!==null?bt.createElement(cO,{value:x},l):null;return bt.createElement("div",Object.assign({},g,{ref:f}),bt.createElement("div",{className:"sigma-container",ref:d}),E)});var gO=` -precision mediump float; - -varying vec4 v_color; -varying float v_border; - -const float radius = 0.5; -const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); - -void main(void) { - vec2 m = gl_PointCoord - vec2(0.5, 0.5); - float dist = radius - length(m); - - // No antialiasing for picking mode: - #ifdef PICKING_MODE - if (dist > v_border) - gl_FragColor = v_color; - else - gl_FragColor = transparent; - - #else - float t = 0.0; - if (dist > v_border) - t = 1.0; - else if (dist > 0.0) - t = dist / v_border; - - gl_FragColor = mix(transparent, v_color, t); - #endif -} -`,pO=gO,mO=` -attribute vec4 a_id; -attribute vec4 a_color; -attribute vec2 a_position; -attribute float a_size; - -uniform float u_sizeRatio; -uniform float u_pixelRatio; -uniform mat3 u_matrix; - -varying vec4 v_color; -varying float v_border; - -const float bias = 255.0 / 254.0; - -void main() { - gl_Position = vec4( - (u_matrix * vec3(a_position, 1)).xy, - 0, - 1 - ); - - // Multiply the point size twice: - // - x SCALING_RATIO to correct the canvas scaling - // - x 2 to correct the formulae - gl_PointSize = a_size / u_sizeRatio * u_pixelRatio * 2.0; - - v_border = (0.5 / a_size) * u_sizeRatio; - - #ifdef PICKING_MODE - // For picking mode, we use the ID as the color: - v_color = a_id; - #else - // For normal mode, we use the color: - v_color = a_color; - #endif - - v_color.a *= bias; -} -`,vO=mO,lE=WebGLRenderingContext,sb=lE.UNSIGNED_BYTE,lb=lE.FLOAT,yO=["u_sizeRatio","u_pixelRatio","u_matrix"],bO=function(r){function n(){return At(this,n),It(this,n,arguments)}return Yt(n,r),Rt(n,[{key:"getDefinition",value:function(){return{VERTICES:1,VERTEX_SHADER_SOURCE:vO,FRAGMENT_SHADER_SOURCE:pO,METHOD:WebGLRenderingContext.POINTS,UNIFORMS:yO,ATTRIBUTES:[{name:"a_position",size:2,type:lb},{name:"a_size",size:1,type:lb},{name:"a_color",size:4,type:sb,normalized:!0},{name:"a_id",size:4,type:sb,normalized:!0}]}}},{key:"processVisibleItem",value:function(a,s,l){var c=this.array;c[s++]=l.x,c[s++]=l.y,c[s++]=l.size,c[s++]=Xn(l.color),c[s++]=a}},{key:"setUniforms",value:function(a,s){var l=a.sizeRatio,c=a.pixelRatio,f=a.matrix,d=s.gl,g=s.uniformLocations,m=g.u_sizeRatio,v=g.u_pixelRatio,y=g.u_matrix;d.uniform1f(v,c),d.uniform1f(m,l),d.uniformMatrix3fv(y,!1,f)}}])}($h),wO=` -attribute vec4 a_id; -attribute vec4 a_color; -attribute vec2 a_normal; -attribute float a_normalCoef; -attribute vec2 a_positionStart; -attribute vec2 a_positionEnd; -attribute float a_positionCoef; -attribute float a_sourceRadius; -attribute float a_targetRadius; -attribute float a_sourceRadiusCoef; -attribute float a_targetRadiusCoef; - -uniform mat3 u_matrix; -uniform float u_zoomRatio; -uniform float u_sizeRatio; -uniform float u_pixelRatio; -uniform float u_correctionRatio; -uniform float u_minEdgeThickness; -uniform float u_lengthToThicknessRatio; -uniform float u_feather; - -varying vec4 v_color; -varying vec2 v_normal; -varying float v_thickness; -varying float v_feather; - -const float bias = 255.0 / 254.0; - -void main() { - float minThickness = u_minEdgeThickness; - - vec2 normal = a_normal * a_normalCoef; - vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef; - - float normalLength = length(normal); - vec2 unitNormal = normal / normalLength; - - // These first computations are taken from edge.vert.glsl. Please read it to - // get better comments on what's happening: - float pixelsThickness = max(normalLength, minThickness * u_sizeRatio); - float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio; - - // Here, we move the point to leave space for the arrow heads: - // Source arrow head - float sourceRadius = a_sourceRadius * a_sourceRadiusCoef; - float sourceDirection = sign(sourceRadius); - float webGLSourceRadius = sourceDirection * sourceRadius * 2.0 * u_correctionRatio / u_sizeRatio; - float webGLSourceArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0; - vec2 sourceCompensationVector = - vec2(-sourceDirection * unitNormal.y, sourceDirection * unitNormal.x) - * (webGLSourceRadius + webGLSourceArrowHeadLength); - - // Target arrow head - float targetRadius = a_targetRadius * a_targetRadiusCoef; - float targetDirection = sign(targetRadius); - float webGLTargetRadius = targetDirection * targetRadius * 2.0 * u_correctionRatio / u_sizeRatio; - float webGLTargetArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0; - vec2 targetCompensationVector = - vec2(-targetDirection * unitNormal.y, targetDirection * unitNormal.x) - * (webGLTargetRadius + webGLTargetArrowHeadLength); - - // Here is the proper position of the vertex - gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + sourceCompensationVector + targetCompensationVector, 1)).xy, 0, 1); - - v_thickness = webGLThickness / u_zoomRatio; - - v_normal = unitNormal; - - v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0; - - #ifdef PICKING_MODE - // For picking mode, we use the ID as the color: - v_color = a_id; - #else - // For normal mode, we use the color: - v_color = a_color; - #endif - - v_color.a *= bias; -} -`,EO=wO,uE=WebGLRenderingContext,ub=uE.UNSIGNED_BYTE,gr=uE.FLOAT,SO=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],xO={lengthToThicknessRatio:cs.lengthToThicknessRatio};function cE(r){var n=_e(_e({},xO),{});return function(i){function a(){return At(this,a),It(this,a,arguments)}return Yt(a,i),Rt(a,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:EO,FRAGMENT_SHADER_SOURCE:qh,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:SO,ATTRIBUTES:[{name:"a_positionStart",size:2,type:gr},{name:"a_positionEnd",size:2,type:gr},{name:"a_normal",size:2,type:gr},{name:"a_color",size:4,type:ub,normalized:!0},{name:"a_id",size:4,type:ub,normalized:!0},{name:"a_sourceRadius",size:1,type:gr},{name:"a_targetRadius",size:1,type:gr}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:gr},{name:"a_normalCoef",size:1,type:gr},{name:"a_sourceRadiusCoef",size:1,type:gr},{name:"a_targetRadiusCoef",size:1,type:gr}],CONSTANT_DATA:[[0,1,-1,0],[0,-1,1,0],[1,1,0,1],[1,1,0,1],[0,-1,1,0],[1,-1,0,-1]]}}},{key:"processVisibleItem",value:function(l,c,f,d,g){var m=g.size||1,v=f.x,y=f.y,b=d.x,x=d.y,E=Xn(g.color),T=b-v,M=x-y,N=f.size||1,L=d.size||1,C=T*T+M*M,R=0,B=0;C&&(C=1/Math.sqrt(C),R=-M*C*m,B=T*C*m);var _=this.array;_[c++]=v,_[c++]=y,_[c++]=b,_[c++]=x,_[c++]=R,_[c++]=B,_[c++]=E,_[c++]=l,_[c++]=N,_[c++]=L}},{key:"setUniforms",value:function(l,c){var f=c.gl,d=c.uniformLocations,g=d.u_matrix,m=d.u_zoomRatio,v=d.u_feather,y=d.u_pixelRatio,b=d.u_correctionRatio,x=d.u_sizeRatio,E=d.u_minEdgeThickness,T=d.u_lengthToThicknessRatio;f.uniformMatrix3fv(g,!1,l.matrix),f.uniform1f(m,l.zoomRatio),f.uniform1f(x,l.sizeRatio),f.uniform1f(b,l.correctionRatio),f.uniform1f(y,l.pixelRatio),f.uniform1f(v,l.antiAliasingFeather),f.uniform1f(E,l.minEdgeThickness),f.uniform1f(T,n.lengthToThicknessRatio)}}])}(ls)}cE();function _O(r){return Iw([cE(),ou(r),ou(_e(_e({},r),{},{extremity:"source"}))])}_O();function TO(r){if(Array.isArray(r))return r}function CO(r,n){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var a,s,l,c,f=[],d=!0,g=!1;try{if(l=(i=i.call(r)).next,n!==0)for(;!(d=(a=l.call(i)).done)&&(f.push(a.value),f.length!==n);d=!0);}catch(m){g=!0,s=m}finally{try{if(!d&&i.return!=null&&(c=i.return(),Object(c)!==c))return}finally{if(g)throw s}}return f}}function ah(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,a=Array(n);i v_radius) - gl_FragColor = transparent; - else { - gl_FragColor = v_color; - gl_FragColor.a *= bias; - } - #else - // Sizes: -`).concat(n.flatMap(function(s,l){var c=s.size;if("fill"in c)return[];c=c;var f="attribute"in c?"v_borderSize_".concat(l+1):Fy(c.value),d=(c.mode||BO)==="pixels"?"u_correctionRatio":"v_radius";return[" float borderSize_".concat(l+1," = ").concat(d," * ").concat(f,";")]}).join(` -`),` - // Now, let's split the remaining space between "fill" borders: - float fillBorderSize = (v_radius - (`).concat(n.flatMap(function(s,l){var c=s.size;return"fill"in c?[]:["borderSize_".concat(l+1)]}).join(" + "),") ) / ").concat(i,`; -`).concat(n.flatMap(function(s,l){var c=s.size;return"fill"in c?[" float borderSize_".concat(l+1," = fillBorderSize;")]:[]}).join(` -`),` - - // Finally, normalize all border sizes, to start from the full size and to end with the smallest: - float adjustedBorderSize_0 = v_radius; -`).concat(n.map(function(s,l){return" float adjustedBorderSize_".concat(l+1," = adjustedBorderSize_").concat(l," - borderSize_").concat(l+1,";")}).join(` -`),` - - // Colors: - vec4 borderColor_0 = transparent; -`).concat(n.map(function(s,l){var c=s.color,f=[];return"attribute"in c?f.push(" vec4 borderColor_".concat(l+1," = v_borderColor_").concat(l+1,";")):"transparent"in c?f.push(" vec4 borderColor_".concat(l+1," = vec4(0.0, 0.0, 0.0, 0.0);")):f.push(" vec4 borderColor_".concat(l+1," = u_borderColor_").concat(l+1,";")),f.push(" borderColor_".concat(l+1,".a *= bias;")),f.push(" if (borderSize_".concat(l+1," <= 1.0 * u_correctionRatio) { borderColor_").concat(l+1," = borderColor_").concat(l,"; }")),f.join(` -`)}).join(` -`),` - if (dist > adjustedBorderSize_0) { - gl_FragColor = borderColor_0; - } else `).concat(n.map(function(s,l){return"if (dist > adjustedBorderSize_".concat(l,` - aaBorder) { - gl_FragColor = mix(borderColor_`).concat(l+1,", borderColor_").concat(l,", (dist - adjustedBorderSize_").concat(l,` + aaBorder) / aaBorder); - } else if (dist > adjustedBorderSize_`).concat(l+1,`) { - gl_FragColor = borderColor_`).concat(l+1,`; - } else `)}).join(""),` { /* Nothing to add here */ } - #endif -} -`);return a}function $O(r){var n=r.borders,i=` -attribute vec2 a_position; -attribute float a_size; -attribute float a_angle; - -uniform mat3 u_matrix; -uniform float u_sizeRatio; -uniform float u_correctionRatio; - -varying vec2 v_diffVector; -varying float v_radius; - -#ifdef PICKING_MODE -attribute vec4 a_id; -varying vec4 v_color; -#else -`.concat(n.flatMap(function(a,s){var l=a.size;return"attribute"in l?["attribute float a_borderSize_".concat(s+1,";"),"varying float v_borderSize_".concat(s+1,";")]:[]}).join(` -`),` -`).concat(n.flatMap(function(a,s){var l=a.color;return"attribute"in l?["attribute vec4 a_borderColor_".concat(s+1,";"),"varying vec4 v_borderColor_".concat(s+1,";")]:[]}).join(` -`),` -#endif - -const float bias = 255.0 / 254.0; -const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); - -void main() { - float size = a_size * u_correctionRatio / u_sizeRatio * 4.0; - vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle)); - vec2 position = a_position + diffVector; - gl_Position = vec4( - (u_matrix * vec3(position, 1)).xy, - 0, - 1 - ); - - v_radius = size / 2.0; - v_diffVector = diffVector; - - #ifdef PICKING_MODE - v_color = a_id; - #else -`).concat(n.flatMap(function(a,s){var l=a.size;return"attribute"in l?[" v_borderSize_".concat(s+1," = a_borderSize_").concat(s+1,";")]:[]}).join(` -`),` -`).concat(n.flatMap(function(a,s){var l=a.color;return"attribute"in l?[" v_borderColor_".concat(s+1," = a_borderColor_").concat(s+1,";")]:[]}).join(` -`),` - #endif -} -`);return i}var gE=WebGLRenderingContext,db=gE.UNSIGNED_BYTE,jl=gE.FLOAT;function qO(r){var n,i=fb(fb({},FO),{}),a=i.borders,s=i.drawLabel,l=i.drawHover,c=["u_sizeRatio","u_correctionRatio","u_matrix"].concat(cd(a.flatMap(function(f,d){var g=f.color;return"value"in g?["u_borderColor_".concat(d+1)]:[]})));return n=function(f){GO(d,f);function d(){var g;DO(this,d);for(var m=arguments.length,v=new Array(m),y=0;yr.length)&&(n=r.length);for(var i=0,a=Array(n);iV){var Q="…";for(E=E+Q,k=l.measureText(E).width;k>V&&E.length>1;)E=E.slice(0,-2)+Q,k=l.measureText(E).width;if(E.length<4)return}for(var re={},de=0,ge=E.length;de{const i=this.nodeIdMap[n];if(i!==void 0)return this.nodes[i]});hr(this,"getEdge",(n,i=!0)=>{const a=i?this.edgeDynamicIdMap[n]:this.edgeIdMap[n];if(a!==void 0)return this.edges[a]});hr(this,"buildDynamicMap",()=>{this.edgeDynamicIdMap={};for(let n=0;n({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,moveToSelectedNode:!1,rawGraph:null,sigmaGraph:null,setSelectedNode:(n,i)=>r({selectedNode:n,moveToSelectedNode:i}),setFocusedNode:n=>r({focusedNode:n}),setSelectedEdge:n=>r({selectedEdge:n}),setFocusedEdge:n=>r({focusedEdge:n}),clearSelection:()=>r({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null}),reset:()=>r({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,rawGraph:null,sigmaGraph:null,moveToSelectedNode:!1}),setRawGraph:n=>r({rawGraph:n}),setSigmaGraph:n=>r({sigmaGraph:n}),setMoveToSelectedNode:n=>r({moveToSelectedNode:n})})),Ye=Eh(fk),dk=({node:r,move:n})=>{const i=Sn(),{gotoNode:a}=sE();return S.useEffect(()=>{if(r)return i.getGraph().setNodeAttribute(r,"highlighted",!0),n&&(a(r),Ye.getState().setMoveToSelectedNode(!1)),()=>{i.getGraph().setNodeAttribute(r,"highlighted",!1)}},[r,n,i,a]),null};function Pa(r,n){const i=Sn(),a=S.useRef(n);return fs(a.current,n)||(a.current=n),{positions:S.useCallback(()=>a.current?r(i.getGraph(),a.current):{},[i,a,r]),assign:S.useCallback(()=>{a.current&&r.assign(i.getGraph(),a.current)},[i,a,r])}}function Zh(r,n){const i=Sn(),[a,s]=S.useState(!1),[l,c]=S.useState(null),f=S.useRef(n);return fs(f.current,n)||(f.current=n),S.useEffect(()=>{s(!1);let d=null;return f.current&&(d=new r(i.getGraph(),f.current)),c(d),()=>{d!==null&&d.kill()}},[i,f,c,s,r]),{stop:S.useCallback(()=>{l&&(l.stop(),s(!1))},[l,s]),start:S.useCallback(()=>{l&&(l.start(),s(!0))},[l,s]),kill:S.useCallback(()=>{l&&l.kill(),s(!1)},[l,s]),isRunning:a}}var dd,pb;function ds(){if(pb)return dd;pb=1;function r(i){return!i||typeof i!="object"||typeof i=="function"||Array.isArray(i)||i instanceof Set||i instanceof Map||i instanceof RegExp||i instanceof Date}function n(i,a){i=i||{};var s={};for(var l in a){var c=i[l],f=a[l];if(!r(f)){s[l]=n(c,f);continue}c===void 0?s[l]=f:s[l]=c}return s}return dd=n,dd}var hd,mb;function hk(){if(mb)return hd;mb=1;function r(i){return function(a,s){return a+Math.floor(i()*(s-a+1))}}var n=r(Math.random);return n.createRandom=r,hd=n,hd}var gd,vb;function gk(){if(vb)return gd;vb=1;var r=hk().createRandom;function n(a){var s=r(a);return function(l){for(var c=l.length,f=c-1,d=-1;++d0},s.prototype.addChild=function(_,$){this.children[_]=$,++this.countChildren},s.prototype.getChild=function(_){if(!this.children.hasOwnProperty(_)){var $=new s;this.children[_]=$,++this.countChildren}return this.children[_]},s.prototype.applyPositionToChildren=function(){if(this.hasChildren()){var _=this;for(var $ in _.children){var z=_.children[$];z.x+=_.x,z.y+=_.y,z.applyPositionToChildren()}}};function l(_,$,z){for(var F in $.children){var Y=$.children[F];Y.hasChildren()?l(_,Y,z):z[Y.id]={x:Y.x,y:Y.y}}}function c(_,$){var z=_.r-$.r,F=$.x-_.x,Y=$.y-_.y;return z<0||z*z0&&z*z>F*F+Y*Y}function d(_,$){for(var z=0;z<$.length;++z)if(!f(_,$[z]))return!1;return!0}function g(_){return new s(null,_.x,_.y,_.r)}function m(_,$){var z=_.x,F=_.y,Y=_.r,I=$.x,j=$.y,J=$.r,ae=I-z,H=j-F,U=J-Y,D=Math.sqrt(ae*ae+H*H);return new s(null,(z+I+ae/D*U)/2,(F+j+H/D*U)/2,(D+Y+J)/2)}function v(_,$,z){var F=_.x,Y=_.y,I=_.r,j=$.x,J=$.y,ae=$.r,H=z.x,U=z.y,D=z.r,se=F-j,G=F-H,P=Y-J,k=Y-U,V=ae-I,Q=D-I,re=F*F+Y*Y-I*I,de=re-j*j-J*J+ae*ae,ge=re-H*H-U*U+D*D,le=G*P-se*k,xe=(P*ge-k*de)/(le*2)-F,pe=(k*V-P*Q)/le,Ae=(G*de-se*ge)/(le*2)-Y,Te=(se*Q-G*V)/le,Le=pe*pe+Te*Te-1,ve=2*(I+xe*pe+Ae*Te),he=xe*xe+Ae*Ae-I*I,K=-(Le?(ve+Math.sqrt(ve*ve-4*Le*he))/(2*Le):he/ve);return new s(null,F+xe+pe*K,Y+Ae+Te*K,K)}function y(_){switch(_.length){case 1:return g(_[0]);case 2:return m(_[0],_[1]);case 3:return v(_[0],_[1],_[2]);default:throw new Error("graphology-layout/circlepack: Invalid basis length "+_.length)}}function b(_,$){var z,F;if(d($,_))return[$];for(z=0;z<_.length;++z)if(c($,_[z])&&d(m(_[z],$),_))return[_[z],$];for(z=0;z<_.length-1;++z)for(F=z+1;F<_.length;++F)if(c(m(_[z],_[F]),$)&&c(m(_[z],$),_[F])&&c(m(_[F],$),_[z])&&d(v(_[z],_[F],$),_))return[_[z],_[F],$];throw new Error("graphology-layout/circlepack: extendBasis failure !")}function x(_){var $=_.wrappedCircle,z=_.next.wrappedCircle,F=$.r+z.r,Y=($.x*z.r+z.x*$.r)/F,I=($.y*z.r+z.y*$.r)/F;return Y*Y+I*I}function E(_,$){var z=0,F=_.slice(),Y=_.length,I=[],j,J;for($(F);zae?(Y=(H+ae-I)/(2*H),J=Math.sqrt(Math.max(0,ae/H-Y*Y)),z.x=_.x-Y*F-J*j,z.y=_.y-Y*j+J*F):(Y=(H+I-ae)/(2*H),J=Math.sqrt(Math.max(0,I/H-Y*Y)),z.x=$.x+Y*F-J*j,z.y=$.y+Y*j+J*F)):(z.x=$.x+z.r,z.y=$.y)}function M(_,$){var z=_.r+$.r-1e-6,F=$.x-_.x,Y=$.y-_.y;return z>0&&z*z>F*F+Y*Y}function N(_,$){var z=_.length;if(z===0)return 0;var F,Y,I,j,J,ae,H,U,D,se;if(F=_[0],F.x=0,F.y=0,z<=1)return F.r;if(Y=_[1],F.x=-Y.r,Y.x=F.r,Y.y=0,z<=2)return F.r+Y.r;I=_[2],T(Y,F,I),F=new s(null,null,null,null,F),Y=new s(null,null,null,null,Y),I=new s(null,null,null,null,I),F.next=I.previous=Y,Y.next=F.previous=I,I.next=Y.previous=F;e:for(ae=3;ae"u"?s:g};typeof s=="function"&&(c=s);var f=function(g){return c(g[a])},d=function(){return c(void 0)};return typeof a=="string"?(l.fromAttributes=f,l.fromGraph=function(g,m){return f(g.getNodeAttributes(m))},l.fromEntry=function(g,m){return f(m)}):typeof a=="function"?(l.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},l.fromGraph=function(g,m){return c(a(m,g.getNodeAttributes(m)))},l.fromEntry=function(g,m){return c(a(g,m))}):(l.fromAttributes=d,l.fromGraph=d,l.fromEntry=d),l}function i(a,s){var l={},c=function(g){return typeof g>"u"?s:g};typeof s=="function"&&(c=s);var f=function(g){return c(g[a])},d=function(){return c(void 0)};return typeof a=="string"?(l.fromAttributes=f,l.fromGraph=function(g,m){return f(g.getEdgeAttributes(m))},l.fromEntry=function(g,m){return f(m)},l.fromPartialEntry=l.fromEntry,l.fromMinimalEntry=l.fromEntry):typeof a=="function"?(l.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},l.fromGraph=function(g,m){var v=g.extremities(m);return c(a(m,g.getEdgeAttributes(m),v[0],v[1],g.getNodeAttributes(v[0]),g.getNodeAttributes(v[1]),g.isUndirected(m)))},l.fromEntry=function(g,m,v,y,b,x,E){return c(a(g,m,v,y,b,x,E))},l.fromPartialEntry=function(g,m,v,y){return c(a(g,m,v,y))},l.fromMinimalEntry=function(g,m){return c(a(g,m))}):(l.fromAttributes=d,l.fromGraph=d,l.fromEntry=d,l.fromMinimalEntry=d),l}return Zo.createNodeValueGetter=n,Zo.createEdgeValueGetter=i,Zo.createEdgeWeightGetter=function(a){return i(a,r)},Zo}var vd,Eb;function SE(){if(Eb)return vd;Eb=1;const{createNodeValueGetter:r,createEdgeValueGetter:n}=Wh();return vd=function(a,s,l){const{nodeXAttribute:c,nodeYAttribute:f}=l,{attraction:d,repulsion:g,gravity:m,inertia:v,maxMove:y}=l.settings;let{shouldSkipNode:b,shouldSkipEdge:x,isNodeFixed:E}=l;E=r(E),b=r(b,!1),x=n(x,!1);const T=a.filterNodes((L,C)=>!b.fromEntry(L,C)),M=T.length;for(let L=0;L{if(R===B||b.fromEntry(R,_)||b.fromEntry(B,$)||x.fromEntry(L,C,R,B,_,$,z))return;const F=s[R],Y=s[B],I=Y.x-F.x,j=Y.y-F.y,J=Math.sqrt(I*I+j*j)||1,ae=d*J*I,H=d*J*j;F.dx+=ae,F.dy+=H,Y.dx-=ae,Y.dy-=H}),m)for(let L=0;Ly&&(R.dx*=y/B,R.dy*=y/B),E.fromGraph(a,C)?R.fixed=!0:(R.x+=R.dx,R.y+=R.dy,R.fixed=!1)}return{converged:N}},vd}var Ul={},Sb;function xE(){return Sb||(Sb=1,Ul.assignLayoutChanges=function(r,n,i){const{nodeXAttribute:a,nodeYAttribute:s}=i;r.updateEachNodeAttributes((l,c)=>{const f=n[l];return!f||f.fixed||(c[a]=f.x,c[s]=f.y),c},{attributes:["x","y"]})},Ul.collectLayoutChanges=function(r){const n={};for(const i in r){const a=r[i];n[i]={x:a.x,y:a.y}}return n}),Ul}var yd,xb;function _E(){return xb||(xb=1,yd={nodeXAttribute:"x",nodeYAttribute:"y",isNodeFixed:"fixed",shouldSkipNode:null,shouldSkipEdge:null,settings:{attraction:5e-4,repulsion:.1,gravity:1e-4,inertia:.6,maxMove:200}}),yd}var bd,_b;function xk(){if(_b)return bd;_b=1;const r=Zn(),n=ds(),i=SE(),a=xE(),s=_E();function l(f,d,g){if(!r(d))throw new Error("graphology-layout-force: the given graph is not a valid graphology instance.");typeof g=="number"?g={maxIterations:g}:g=g||{};const m=g.maxIterations;if(g=n(g,s),typeof m!="number"||m<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");const v={};let y=null,b;for(b=0;bthis.runFrame())},l.prototype.stop=function(){return this.running=!1,this.frameID!==null&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},l.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-force/worker.start: layout was killed.");this.running||(this.running=!0,this.runFrame())},l.prototype.kill=function(){this.stop(),delete this.nodeStates,this.killed=!0},wd=l,wd}var Ak=Ck();const Rk=on(Ak);function Dk(r={maxIterations:100}){return Pa(Tk,r)}function Ok(r={}){return Zh(Rk,r)}var Ed,Cb;function kk(){if(Cb)return Ed;Cb=1;var r=0,n=1,i=2,a=3,s=4,l=5,c=6,f=7,d=8,g=9,m=0,v=1,y=2,b=0,x=1,E=2,T=3,M=4,N=5,L=6,C=7,R=8,B=3,_=10,$=3,z=9,F=10;return Ed=function(I,j,J){var ae,H,U,D,se,G,P,k,V,Q,re=j.length,de=J.length,ge=I.adjustSizes,le=I.barnesHutTheta*I.barnesHutTheta,xe,pe,Ae,Te,Le,ve,he,K=[];for(U=0;UEt?(be-=(Ie-Et)/2,Se=be+Ie):(Re-=(Et-Ie)/2,Ve=Re+Et),K[0+b]=-1,K[0+x]=(Re+Ve)/2,K[0+E]=(be+Se)/2,K[0+T]=Math.max(Ve-Re,Se-be),K[0+M]=-1,K[0+N]=-1,K[0+L]=0,K[0+C]=0,K[0+R]=0,ae=1,U=0;U=0){j[U+r]=0)if(ve=Math.pow(j[U+r]-K[H+C],2)+Math.pow(j[U+n]-K[H+R],2),Q=K[H+T],4*Q*Q/ve0?(he=pe*j[U+c]*K[H+L]/ve,j[U+i]+=Ae*he,j[U+a]+=Te*he):ve<0&&(he=-pe*j[U+c]*K[H+L]/Math.sqrt(ve),j[U+i]+=Ae*he,j[U+a]+=Te*he):ve>0&&(he=pe*j[U+c]*K[H+L]/ve,j[U+i]+=Ae*he,j[U+a]+=Te*he),H=K[H+M],H<0)break;continue}else{H=K[H+N];continue}else{if(G=K[H+b],G>=0&&G!==U&&(Ae=j[U+r]-j[G+r],Te=j[U+n]-j[G+n],ve=Ae*Ae+Te*Te,ge===!0?ve>0?(he=pe*j[U+c]*j[G+c]/ve,j[U+i]+=Ae*he,j[U+a]+=Te*he):ve<0&&(he=-pe*j[U+c]*j[G+c]/Math.sqrt(ve),j[U+i]+=Ae*he,j[U+a]+=Te*he):ve>0&&(he=pe*j[U+c]*j[G+c]/ve,j[U+i]+=Ae*he,j[U+a]+=Te*he)),H=K[H+M],H<0)break;continue}else for(pe=I.scalingRatio,D=0;D0?(he=pe*j[D+c]*j[se+c]/ve/ve,j[D+i]+=Ae*he,j[D+a]+=Te*he,j[se+i]-=Ae*he,j[se+a]-=Te*he):ve<0&&(he=100*pe*j[D+c]*j[se+c],j[D+i]+=Ae*he,j[D+a]+=Te*he,j[se+i]-=Ae*he,j[se+a]-=Te*he)):(ve=Math.sqrt(Ae*Ae+Te*Te),ve>0&&(he=pe*j[D+c]*j[se+c]/ve/ve,j[D+i]+=Ae*he,j[D+a]+=Te*he,j[se+i]-=Ae*he,j[se+a]-=Te*he));for(V=I.gravity/I.scalingRatio,pe=I.scalingRatio,U=0;U0&&(he=pe*j[U+c]*V):ve>0&&(he=pe*j[U+c]*V/ve),j[U+i]-=Ae*he,j[U+a]-=Te*he;for(pe=1*(I.outboundAttractionDistribution?xe:1),P=0;P0&&(he=-pe*Le*Math.log(1+ve)/ve/j[D+c]):ve>0&&(he=-pe*Le*Math.log(1+ve)/ve):I.outboundAttractionDistribution?ve>0&&(he=-pe*Le/j[D+c]):ve>0&&(he=-pe*Le)):(ve=Math.sqrt(Math.pow(Ae,2)+Math.pow(Te,2)),I.linLogMode?I.outboundAttractionDistribution?ve>0&&(he=-pe*Le*Math.log(1+ve)/ve/j[D+c]):ve>0&&(he=-pe*Le*Math.log(1+ve)/ve):I.outboundAttractionDistribution?(ve=1,he=-pe*Le/j[D+c]):(ve=1,he=-pe*Le)),ve>0&&(j[D+i]+=Ae*he,j[D+a]+=Te*he,j[se+i]-=Ae*he,j[se+a]-=Te*he);var rt,ct,Gt,Ht,sn,xn;if(ge===!0)for(U=0;UF&&(j[U+i]=j[U+i]*F/rt,j[U+a]=j[U+a]*F/rt),ct=j[U+c]*Math.sqrt((j[U+s]-j[U+i])*(j[U+s]-j[U+i])+(j[U+l]-j[U+a])*(j[U+l]-j[U+a])),Gt=Math.sqrt((j[U+s]+j[U+i])*(j[U+s]+j[U+i])+(j[U+l]+j[U+a])*(j[U+l]+j[U+a]))/2,Ht=.1*Math.log(1+Gt)/(1+Math.sqrt(ct)),sn=j[U+r]+j[U+i]*(Ht/I.slowDown),j[U+r]=sn,xn=j[U+n]+j[U+a]*(Ht/I.slowDown),j[U+n]=xn);else for(U=0;U=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in i&&typeof i.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in i&&!(typeof i.gravity=="number"&&i.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in i&&!(typeof i.slowDown=="number"||i.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in i&&typeof i.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in i&&!(typeof i.barnesHutTheta=="number"&&i.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},pr.graphToByteArrays=function(i,a){var s=i.order,l=i.size,c={},f,d=new Float32Array(s*r),g=new Float32Array(l*n);return f=0,i.forEachNode(function(m,v){c[m]=f,d[f]=v.x,d[f+1]=v.y,d[f+2]=0,d[f+3]=0,d[f+4]=0,d[f+5]=0,d[f+6]=1,d[f+7]=1,d[f+8]=v.size||1,d[f+9]=v.fixed?1:0,f+=r}),f=0,i.forEachEdge(function(m,v,y,b,x,E,T){var M=c[y],N=c[b],L=a(m,v,y,b,x,E,T);d[M+6]+=L,d[N+6]+=L,g[f]=M,g[f+1]=N,g[f+2]=L,f+=n}),{nodes:d,edges:g}},pr.assignLayoutChanges=function(i,a,s){var l=0;i.updateEachNodeAttributes(function(c,f){return f.x=a[l],f.y=a[l+1],l+=r,s?s(c,f):f})},pr.readGraphPositions=function(i,a){var s=0;i.forEachNode(function(l,c){a[s]=c.x,a[s+1]=c.y,s+=r})},pr.collectLayoutChanges=function(i,a,s){for(var l=i.nodes(),c={},f=0,d=0,g=a.length;f2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(g)}}var f=l.bind(null,!1);return f.assign=l.bind(null,!0),f.inferSettings=c,xd=f,xd}var Nk=Lk();const zk=on(Nk);var _d,Ob;function Gk(){return Ob||(Ob=1,_d=function(){var n,i,a={};(function(){var l=0,c=1,f=2,d=3,g=4,m=5,v=6,y=7,b=8,x=9,E=0,T=1,M=2,N=0,L=1,C=2,R=3,B=4,_=5,$=6,z=7,F=8,Y=3,I=10,j=3,J=9,ae=10;a.exports=function(U,D,se){var G,P,k,V,Q,re,de,ge,le,xe,pe=D.length,Ae=se.length,Te=U.adjustSizes,Le=U.barnesHutTheta*U.barnesHutTheta,ve,he,K,Re,Ve,be,Se,ne=[];for(k=0;ksn?(Ie-=(Ht-sn)/2,Et=Ie+Ht):(et-=(sn-Ht)/2,ut=et+sn),ne[0+N]=-1,ne[0+L]=(et+ut)/2,ne[0+C]=(Ie+Et)/2,ne[0+R]=Math.max(ut-et,Et-Ie),ne[0+B]=-1,ne[0+_]=-1,ne[0+$]=0,ne[0+z]=0,ne[0+F]=0,G=1,k=0;k=0){D[k+l]=0)if(be=Math.pow(D[k+l]-ne[P+z],2)+Math.pow(D[k+c]-ne[P+F],2),xe=ne[P+R],4*xe*xe/be0?(Se=he*D[k+v]*ne[P+$]/be,D[k+f]+=K*Se,D[k+d]+=Re*Se):be<0&&(Se=-he*D[k+v]*ne[P+$]/Math.sqrt(be),D[k+f]+=K*Se,D[k+d]+=Re*Se):be>0&&(Se=he*D[k+v]*ne[P+$]/be,D[k+f]+=K*Se,D[k+d]+=Re*Se),P=ne[P+B],P<0)break;continue}else{P=ne[P+_];continue}else{if(re=ne[P+N],re>=0&&re!==k&&(K=D[k+l]-D[re+l],Re=D[k+c]-D[re+c],be=K*K+Re*Re,Te===!0?be>0?(Se=he*D[k+v]*D[re+v]/be,D[k+f]+=K*Se,D[k+d]+=Re*Se):be<0&&(Se=-he*D[k+v]*D[re+v]/Math.sqrt(be),D[k+f]+=K*Se,D[k+d]+=Re*Se):be>0&&(Se=he*D[k+v]*D[re+v]/be,D[k+f]+=K*Se,D[k+d]+=Re*Se)),P=ne[P+B],P<0)break;continue}else for(he=U.scalingRatio,V=0;V0?(Se=he*D[V+v]*D[Q+v]/be/be,D[V+f]+=K*Se,D[V+d]+=Re*Se,D[Q+f]-=K*Se,D[Q+d]-=Re*Se):be<0&&(Se=100*he*D[V+v]*D[Q+v],D[V+f]+=K*Se,D[V+d]+=Re*Se,D[Q+f]-=K*Se,D[Q+d]-=Re*Se)):(be=Math.sqrt(K*K+Re*Re),be>0&&(Se=he*D[V+v]*D[Q+v]/be/be,D[V+f]+=K*Se,D[V+d]+=Re*Se,D[Q+f]-=K*Se,D[Q+d]-=Re*Se));for(le=U.gravity/U.scalingRatio,he=U.scalingRatio,k=0;k0&&(Se=he*D[k+v]*le):be>0&&(Se=he*D[k+v]*le/be),D[k+f]-=K*Se,D[k+d]-=Re*Se;for(he=1*(U.outboundAttractionDistribution?ve:1),de=0;de0&&(Se=-he*Ve*Math.log(1+be)/be/D[V+v]):be>0&&(Se=-he*Ve*Math.log(1+be)/be):U.outboundAttractionDistribution?be>0&&(Se=-he*Ve/D[V+v]):be>0&&(Se=-he*Ve)):(be=Math.sqrt(Math.pow(K,2)+Math.pow(Re,2)),U.linLogMode?U.outboundAttractionDistribution?be>0&&(Se=-he*Ve*Math.log(1+be)/be/D[V+v]):be>0&&(Se=-he*Ve*Math.log(1+be)/be):U.outboundAttractionDistribution?(be=1,Se=-he*Ve/D[V+v]):(be=1,Se=-he*Ve)),be>0&&(D[V+f]+=K*Se,D[V+d]+=Re*Se,D[Q+f]-=K*Se,D[Q+d]-=Re*Se);var xn,ii,Mn,ft,ji,Zt;if(Te===!0)for(k=0;kae&&(D[k+f]=D[k+f]*ae/xn,D[k+d]=D[k+d]*ae/xn),ii=D[k+v]*Math.sqrt((D[k+g]-D[k+f])*(D[k+g]-D[k+f])+(D[k+m]-D[k+d])*(D[k+m]-D[k+d])),Mn=Math.sqrt((D[k+g]+D[k+f])*(D[k+g]+D[k+f])+(D[k+m]+D[k+d])*(D[k+m]+D[k+d]))/2,ft=.1*Math.log(1+Mn)/(1+Math.sqrt(ii)),ji=D[k+l]+D[k+f]*(ft/U.slowDown),D[k+l]=ji,Zt=D[k+c]+D[k+d]*(ft/U.slowDown),D[k+c]=Zt);else for(k=0;k1&&Ae.has(Se))&&(D>1&&Ae.add(Se),he=d[Le+r],Re=d[Le+n],be=d[Le+i],ne=he-ve,et=Re-K,ut=Math.sqrt(ne*ne+et*et),Ie=ut0?(_[Le]+=ne/ut*(1+Ve),$[Le]+=et/ut*(1+Ve)):(_[Le]+=j*l(),$[Le]+=J*l())));for(x=0,E=0;x1&&he.has(Ie))&&(k>1&&he.add(Ie),be=y[Re+s],ne=y[Re+l],ut=y[Re+c],Et=be-Ve,rt=ne-Se,ct=Math.sqrt(Et*Et+rt*rt),Gt=ct0?(Y[Re]+=Et/ct*(1+et),I[Re]+=rt/ct*(1+et)):(Y[Re]+=U*g(),I[Re]+=D*g())));for(N=0,L=0;NA.jsx(Je.span,{...r,ref:n,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...r.style}}));OE.displayName=eL;var tL=OE,[_u,Rz]=rs("Tooltip",[vu]),Tu=vu(),kE="TooltipProvider",nL=700,ch="tooltip.open",[rL,Kh]=_u(kE),LE=r=>{const{__scopeTooltip:n,delayDuration:i=nL,skipDelayDuration:a=300,disableHoverableContent:s=!1,children:l}=r,[c,f]=S.useState(!0),d=S.useRef(!1),g=S.useRef(0);return S.useEffect(()=>{const m=g.current;return()=>window.clearTimeout(m)},[]),A.jsx(rL,{scope:n,isOpenDelayed:c,delayDuration:i,onOpen:S.useCallback(()=>{window.clearTimeout(g.current),f(!1)},[]),onClose:S.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>f(!0),a)},[a]),isPointerInTransitRef:d,onPointerInTransitChange:S.useCallback(m=>{d.current=m},[]),disableHoverableContent:s,children:l})};LE.displayName=kE;var Cu="Tooltip",[iL,Au]=_u(Cu),NE=r=>{const{__scopeTooltip:n,children:i,open:a,defaultOpen:s=!1,onOpenChange:l,disableHoverableContent:c,delayDuration:f}=r,d=Kh(Cu,r.__scopeTooltip),g=Tu(n),[m,v]=S.useState(null),y=Ln(),b=S.useRef(0),x=c??d.disableHoverableContent,E=f??d.delayDuration,T=S.useRef(!1),[M=!1,N]=yu({prop:a,defaultProp:s,onChange:_=>{_?(d.onOpen(),document.dispatchEvent(new CustomEvent(ch))):d.onClose(),l==null||l(_)}}),L=S.useMemo(()=>M?T.current?"delayed-open":"instant-open":"closed",[M]),C=S.useCallback(()=>{window.clearTimeout(b.current),b.current=0,T.current=!1,N(!0)},[N]),R=S.useCallback(()=>{window.clearTimeout(b.current),b.current=0,N(!1)},[N]),B=S.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{T.current=!0,N(!0),b.current=0},E)},[E,N]);return S.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),A.jsx(ew,{...g,children:A.jsx(iL,{scope:n,contentId:y,open:M,stateAttribute:L,trigger:m,onTriggerChange:v,onTriggerEnter:S.useCallback(()=>{d.isOpenDelayed?B():C()},[d.isOpenDelayed,B,C]),onTriggerLeave:S.useCallback(()=>{x?R():(window.clearTimeout(b.current),b.current=0)},[R,x]),onOpen:C,onClose:R,disableHoverableContent:x,children:i})})};NE.displayName=Cu;var fh="TooltipTrigger",zE=S.forwardRef((r,n)=>{const{__scopeTooltip:i,...a}=r,s=Au(fh,i),l=Kh(fh,i),c=Tu(i),f=S.useRef(null),d=Vt(n,f,s.onTriggerChange),g=S.useRef(!1),m=S.useRef(!1),v=S.useCallback(()=>g.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),A.jsx(zh,{asChild:!0,...c,children:A.jsx(Je.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...a,ref:d,onPointerMove:ht(r.onPointerMove,y=>{y.pointerType!=="touch"&&!m.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),m.current=!0)}),onPointerLeave:ht(r.onPointerLeave,()=>{s.onTriggerLeave(),m.current=!1}),onPointerDown:ht(r.onPointerDown,()=>{g.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:ht(r.onFocus,()=>{g.current||s.onOpen()}),onBlur:ht(r.onBlur,s.onClose),onClick:ht(r.onClick,s.onClose)})})});zE.displayName=fh;var aL="TooltipPortal",[Dz,oL]=_u(aL,{forceMount:void 0}),za="TooltipContent",GE=S.forwardRef((r,n)=>{const i=oL(za,r.__scopeTooltip),{forceMount:a=i.forceMount,side:s="top",...l}=r,c=Au(za,r.__scopeTooltip);return A.jsx(ni,{present:a||c.open,children:c.disableHoverableContent?A.jsx(ME,{side:s,...l,ref:n}):A.jsx(sL,{side:s,...l,ref:n})})}),sL=S.forwardRef((r,n)=>{const i=Au(za,r.__scopeTooltip),a=Kh(za,r.__scopeTooltip),s=S.useRef(null),l=Vt(n,s),[c,f]=S.useState(null),{trigger:d,onClose:g}=i,m=s.current,{onPointerInTransitChange:v}=a,y=S.useCallback(()=>{f(null),v(!1)},[v]),b=S.useCallback((x,E)=>{const T=x.currentTarget,M={x:x.clientX,y:x.clientY},N=fL(M,T.getBoundingClientRect()),L=dL(M,N),C=hL(E.getBoundingClientRect()),R=pL([...L,...C]);f(R),v(!0)},[v]);return S.useEffect(()=>()=>y(),[y]),S.useEffect(()=>{if(d&&m){const x=T=>b(T,m),E=T=>b(T,d);return d.addEventListener("pointerleave",x),m.addEventListener("pointerleave",E),()=>{d.removeEventListener("pointerleave",x),m.removeEventListener("pointerleave",E)}}},[d,m,b,y]),S.useEffect(()=>{if(c){const x=E=>{const T=E.target,M={x:E.clientX,y:E.clientY},N=(d==null?void 0:d.contains(T))||(m==null?void 0:m.contains(T)),L=!gL(M,c);N?y():L&&(y(),g())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[d,m,c,g,y]),A.jsx(ME,{...r,ref:l})}),[lL,uL]=_u(Cu,{isInside:!1}),ME=S.forwardRef((r,n)=>{const{__scopeTooltip:i,children:a,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:c,...f}=r,d=Au(za,i),g=Tu(i),{onClose:m}=d;return S.useEffect(()=>(document.addEventListener(ch,m),()=>document.removeEventListener(ch,m)),[m]),S.useEffect(()=>{if(d.trigger){const v=y=>{const b=y.target;b!=null&&b.contains(d.trigger)&&m()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[d.trigger,m]),A.jsx(hu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:v=>v.preventDefault(),onDismiss:m,children:A.jsxs(tw,{"data-state":d.stateAttribute,...g,...f,ref:n,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[A.jsx(R0,{children:a}),A.jsx(lL,{scope:i,isInside:!0,children:A.jsx(tL,{id:d.contentId,role:"tooltip",children:s||a})})]})})});GE.displayName=za;var jE="TooltipArrow",cL=S.forwardRef((r,n)=>{const{__scopeTooltip:i,...a}=r,s=Tu(i);return uL(jE,i).isInside?null:A.jsx(nw,{...s,...a,ref:n})});cL.displayName=jE;function fL(r,n){const i=Math.abs(n.top-r.y),a=Math.abs(n.bottom-r.y),s=Math.abs(n.right-r.x),l=Math.abs(n.left-r.x);switch(Math.min(i,a,s,l)){case l:return"left";case s:return"right";case i:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function dL(r,n,i=5){const a=[];switch(n){case"top":a.push({x:r.x-i,y:r.y+i},{x:r.x+i,y:r.y+i});break;case"bottom":a.push({x:r.x-i,y:r.y-i},{x:r.x+i,y:r.y-i});break;case"left":a.push({x:r.x+i,y:r.y-i},{x:r.x+i,y:r.y+i});break;case"right":a.push({x:r.x-i,y:r.y-i},{x:r.x-i,y:r.y+i});break}return a}function hL(r){const{top:n,right:i,bottom:a,left:s}=r;return[{x:s,y:n},{x:i,y:n},{x:i,y:a},{x:s,y:a}]}function gL(r,n){const{x:i,y:a}=r;let s=!1;for(let l=0,c=n.length-1;la!=m>a&&i<(g-f)*(a-d)/(m-d)+f&&(s=!s)}return s}function pL(r){const n=r.slice();return n.sort((i,a)=>i.xa.x?1:i.ya.y?1:0),mL(n)}function mL(r){if(r.length<=1)return r.slice();const n=[];for(let a=0;a=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))n.pop();else break}n.push(s)}n.pop();const i=[];for(let a=r.length-1;a>=0;a--){const s=r[a];for(;i.length>=2;){const l=i[i.length-1],c=i[i.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))i.pop();else break}i.push(s)}return i.pop(),n.length===1&&i.length===1&&n[0].x===i[0].x&&n[0].y===i[0].y?n:n.concat(i)}var vL=LE,yL=NE,bL=zE,UE=GE;const BE=vL,FE=yL,HE=bL,Qh=S.forwardRef(({className:r,sideOffset:n=4,...i},a)=>A.jsx(UE,{ref:a,sideOffset:n,className:Xe("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md border px-3 py-1.5 text-sm shadow-md",r),...i}));Qh.displayName=UE.displayName;const Bb=w0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-8"}},defaultVariants:{variant:"default",size:"default"}}),an=S.forwardRef(({className:r,variant:n,tooltip:i,size:a,side:s="right",asChild:l=!1,...c},f)=>{const d=l?is:"button";return i?A.jsx(BE,{children:A.jsxs(FE,{children:[A.jsx(HE,{asChild:!0,children:A.jsx(d,{className:Xe(Bb({variant:n,size:a,className:r}),"cursor-pointer"),ref:f,...c})}),A.jsx(Qh,{side:s,children:i})]})}):A.jsx(d,{className:Xe(Bb({variant:n,size:a,className:r}),"cursor-pointer"),ref:f,...c})});an.displayName="Button";var Fb=1,wL=.9,EL=.8,SL=.17,Ld=.1,Nd=.999,xL=.9999,_L=.99,TL=/[\\\/_+.#"@\[\(\{&]/,CL=/[\\\/_+.#"@\[\(\{&]/g,AL=/[\s-]/,PE=/[\s-]/g;function dh(r,n,i,a,s,l,c){if(l===n.length)return s===r.length?Fb:_L;var f=`${s},${l}`;if(c[f]!==void 0)return c[f];for(var d=a.charAt(l),g=i.indexOf(d,s),m=0,v,y,b,x;g>=0;)v=dh(r,n,i,a,g+1,l+1,c),v>m&&(g===s?v*=Fb:TL.test(r.charAt(g-1))?(v*=EL,b=r.slice(s,g-1).match(CL),b&&s>0&&(v*=Math.pow(Nd,b.length))):AL.test(r.charAt(g-1))?(v*=wL,x=r.slice(s,g-1).match(PE),x&&s>0&&(v*=Math.pow(Nd,x.length))):(v*=SL,s>0&&(v*=Math.pow(Nd,g-s))),r.charAt(g)!==n.charAt(l)&&(v*=xL)),(vv&&(v=y*Ld)),v>m&&(m=v),g=i.indexOf(d,g+1);return c[f]=m,m}function Hb(r){return r.toLowerCase().replace(PE," ")}function RL(r,n,i){return r=i&&i.length>0?`${r+" "+i.join(" ")}`:r,dh(r,n,Hb(r),Hb(n),0,0,{})}var Jh="Dialog",[$E,Oz]=rs(Jh),[DL,Gn]=$E(Jh),qE=r=>{const{__scopeDialog:n,children:i,open:a,defaultOpen:s,onOpenChange:l,modal:c=!0}=r,f=S.useRef(null),d=S.useRef(null),[g=!1,m]=yu({prop:a,defaultProp:s,onChange:l});return A.jsx(DL,{scope:n,triggerRef:f,contentRef:d,contentId:Ln(),titleId:Ln(),descriptionId:Ln(),open:g,onOpenChange:m,onOpenToggle:S.useCallback(()=>m(v=>!v),[m]),modal:c,children:i})};qE.displayName=Jh;var VE="DialogTrigger",OL=S.forwardRef((r,n)=>{const{__scopeDialog:i,...a}=r,s=Gn(VE,i),l=Vt(n,s.triggerRef);return A.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ng(s.open),...a,ref:l,onClick:ht(r.onClick,s.onOpenToggle)})});OL.displayName=VE;var eg="DialogPortal",[kL,IE]=$E(eg,{forceMount:void 0}),YE=r=>{const{__scopeDialog:n,forceMount:i,children:a,container:s}=r,l=Gn(eg,n);return A.jsx(kL,{scope:n,forceMount:i,children:S.Children.map(a,c=>A.jsx(ni,{present:i||l.open,children:A.jsx(Gh,{asChild:!0,container:s,children:c})}))})};YE.displayName=eg;var cu="DialogOverlay",XE=S.forwardRef((r,n)=>{const i=IE(cu,r.__scopeDialog),{forceMount:a=i.forceMount,...s}=r,l=Gn(cu,r.__scopeDialog);return l.modal?A.jsx(ni,{present:a||l.open,children:A.jsx(LL,{...s,ref:n})}):null});XE.displayName=cu;var LL=S.forwardRef((r,n)=>{const{__scopeDialog:i,...a}=r,s=Gn(cu,i);return A.jsx(Mh,{as:is,allowPinchZoom:!0,shards:[s.contentRef],children:A.jsx(Je.div,{"data-state":ng(s.open),...a,ref:n,style:{pointerEvents:"auto",...a.style}})})}),zi="DialogContent",ZE=S.forwardRef((r,n)=>{const i=IE(zi,r.__scopeDialog),{forceMount:a=i.forceMount,...s}=r,l=Gn(zi,r.__scopeDialog);return A.jsx(ni,{present:a||l.open,children:l.modal?A.jsx(NL,{...s,ref:n}):A.jsx(zL,{...s,ref:n})})});ZE.displayName=zi;var NL=S.forwardRef((r,n)=>{const i=Gn(zi,r.__scopeDialog),a=S.useRef(null),s=Vt(n,i.contentRef,a);return S.useEffect(()=>{const l=a.current;if(l)return iw(l)},[]),A.jsx(WE,{...r,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ht(r.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:ht(r.onPointerDownOutside,l=>{const c=l.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&l.preventDefault()}),onFocusOutside:ht(r.onFocusOutside,l=>l.preventDefault())})}),zL=S.forwardRef((r,n)=>{const i=Gn(zi,r.__scopeDialog),a=S.useRef(!1),s=S.useRef(!1);return A.jsx(WE,{...r,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,f;(c=r.onCloseAutoFocus)==null||c.call(r,l),l.defaultPrevented||(a.current||(f=i.triggerRef.current)==null||f.focus(),l.preventDefault()),a.current=!1,s.current=!1},onInteractOutside:l=>{var d,g;(d=r.onInteractOutside)==null||d.call(r,l),l.defaultPrevented||(a.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;((g=i.triggerRef.current)==null?void 0:g.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),WE=S.forwardRef((r,n)=>{const{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:l,...c}=r,f=Gn(zi,i),d=S.useRef(null),g=Vt(n,d);return k0(),A.jsxs(A.Fragment,{children:[A.jsx(_h,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:l,children:A.jsx(hu,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":ng(f.open),...c,ref:g,onDismiss:()=>f.onOpenChange(!1)})}),A.jsxs(A.Fragment,{children:[A.jsx(GL,{titleId:f.titleId}),A.jsx(jL,{contentRef:d,descriptionId:f.descriptionId})]})]})}),tg="DialogTitle",KE=S.forwardRef((r,n)=>{const{__scopeDialog:i,...a}=r,s=Gn(tg,i);return A.jsx(Je.h2,{id:s.titleId,...a,ref:n})});KE.displayName=tg;var QE="DialogDescription",JE=S.forwardRef((r,n)=>{const{__scopeDialog:i,...a}=r,s=Gn(QE,i);return A.jsx(Je.p,{id:s.descriptionId,...a,ref:n})});JE.displayName=QE;var e1="DialogClose",t1=S.forwardRef((r,n)=>{const{__scopeDialog:i,...a}=r,s=Gn(e1,i);return A.jsx(Je.button,{type:"button",...a,ref:n,onClick:ht(r.onClick,()=>s.onOpenChange(!1))})});t1.displayName=e1;function ng(r){return r?"open":"closed"}var n1="DialogTitleWarning",[kz,r1]=rC(n1,{contentName:zi,titleName:tg,docsSlug:"dialog"}),GL=({titleId:r})=>{const n=r1(n1),i=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return S.useEffect(()=>{r&&(document.getElementById(r)||console.error(i))},[i,r]),null},ML="DialogDescriptionWarning",jL=({contentRef:r,descriptionId:n})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r1(ML).contentName}}.`;return S.useEffect(()=>{var l;const s=(l=r.current)==null?void 0:l.getAttribute("aria-describedby");n&&s&&(document.getElementById(n)||console.warn(a))},[a,r,n]),null},UL=qE,i1=YE,rg=XE,ig=ZE,a1=KE,o1=JE,BL=t1,zd={exports:{}},Gd={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Pb;function FL(){if(Pb)return Gd;Pb=1;var r=du();function n(v,y){return v===y&&(v!==0||1/v===1/y)||v!==v&&y!==y}var i=typeof Object.is=="function"?Object.is:n,a=r.useState,s=r.useEffect,l=r.useLayoutEffect,c=r.useDebugValue;function f(v,y){var b=y(),x=a({inst:{value:b,getSnapshot:y}}),E=x[0].inst,T=x[1];return l(function(){E.value=b,E.getSnapshot=y,d(E)&&T({inst:E})},[v,b,y]),s(function(){return d(E)&&T({inst:E}),v(function(){d(E)&&T({inst:E})})},[v]),c(b),b}function d(v){var y=v.getSnapshot;v=v.value;try{var b=y();return!i(v,b)}catch{return!0}}function g(v,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:f;return Gd.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:m,Gd}var $b;function HL(){return $b||($b=1,zd.exports=FL()),zd.exports}var PL=HL(),Wo='[cmdk-group=""]',Md='[cmdk-group-items=""]',$L='[cmdk-group-heading=""]',ag='[cmdk-item=""]',qb=`${ag}:not([aria-disabled="true"])`,hh="cmdk-item-select",ki="data-value",qL=(r,n,i)=>RL(r,n,i),s1=S.createContext(void 0),hs=()=>S.useContext(s1),l1=S.createContext(void 0),og=()=>S.useContext(l1),u1=S.createContext(void 0),c1=S.forwardRef((r,n)=>{let i=Ca(()=>{var k,V;return{search:"",value:(V=(k=r.value)!=null?k:r.defaultValue)!=null?V:"",filtered:{count:0,items:new Map,groups:new Set}}}),a=Ca(()=>new Set),s=Ca(()=>new Map),l=Ca(()=>new Map),c=Ca(()=>new Set),f=f1(r),{label:d,children:g,value:m,onValueChange:v,filter:y,shouldFilter:b,loop:x,disablePointerSelection:E=!1,vimBindings:T=!0,...M}=r,N=Ln(),L=Ln(),C=Ln(),R=S.useRef(null),B=tN();Gi(()=>{if(m!==void 0){let k=m.trim();i.current.value=k,_.emit()}},[m]),Gi(()=>{B(6,j)},[]);let _=S.useMemo(()=>({subscribe:k=>(c.current.add(k),()=>c.current.delete(k)),snapshot:()=>i.current,setState:(k,V,Q)=>{var re,de,ge;if(!Object.is(i.current[k],V)){if(i.current[k]=V,k==="search")I(),F(),B(1,Y);else if(k==="value"&&(Q||B(5,j),((re=f.current)==null?void 0:re.value)!==void 0)){let le=V??"";(ge=(de=f.current).onValueChange)==null||ge.call(de,le);return}_.emit()}},emit:()=>{c.current.forEach(k=>k())}}),[]),$=S.useMemo(()=>({value:(k,V,Q)=>{var re;V!==((re=l.current.get(k))==null?void 0:re.value)&&(l.current.set(k,{value:V,keywords:Q}),i.current.filtered.items.set(k,z(V,Q)),B(2,()=>{F(),_.emit()}))},item:(k,V)=>(a.current.add(k),V&&(s.current.has(V)?s.current.get(V).add(k):s.current.set(V,new Set([k]))),B(3,()=>{I(),F(),i.current.value||Y(),_.emit()}),()=>{l.current.delete(k),a.current.delete(k),i.current.filtered.items.delete(k);let Q=J();B(4,()=>{I(),(Q==null?void 0:Q.getAttribute("id"))===k&&Y(),_.emit()})}),group:k=>(s.current.has(k)||s.current.set(k,new Set),()=>{l.current.delete(k),s.current.delete(k)}),filter:()=>f.current.shouldFilter,label:d||r["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:N,inputId:C,labelId:L,listInnerRef:R}),[]);function z(k,V){var Q,re;let de=(re=(Q=f.current)==null?void 0:Q.filter)!=null?re:qL;return k?de(k,i.current.search,V):0}function F(){if(!i.current.search||f.current.shouldFilter===!1)return;let k=i.current.filtered.items,V=[];i.current.filtered.groups.forEach(re=>{let de=s.current.get(re),ge=0;de.forEach(le=>{let xe=k.get(le);ge=Math.max(xe,ge)}),V.push([re,ge])});let Q=R.current;ae().sort((re,de)=>{var ge,le;let xe=re.getAttribute("id"),pe=de.getAttribute("id");return((ge=k.get(pe))!=null?ge:0)-((le=k.get(xe))!=null?le:0)}).forEach(re=>{let de=re.closest(Md);de?de.appendChild(re.parentElement===de?re:re.closest(`${Md} > *`)):Q.appendChild(re.parentElement===Q?re:re.closest(`${Md} > *`))}),V.sort((re,de)=>de[1]-re[1]).forEach(re=>{var de;let ge=(de=R.current)==null?void 0:de.querySelector(`${Wo}[${ki}="${encodeURIComponent(re[0])}"]`);ge==null||ge.parentElement.appendChild(ge)})}function Y(){let k=ae().find(Q=>Q.getAttribute("aria-disabled")!=="true"),V=k==null?void 0:k.getAttribute(ki);_.setState("value",V||void 0)}function I(){var k,V,Q,re;if(!i.current.search||f.current.shouldFilter===!1){i.current.filtered.count=a.current.size;return}i.current.filtered.groups=new Set;let de=0;for(let ge of a.current){let le=(V=(k=l.current.get(ge))==null?void 0:k.value)!=null?V:"",xe=(re=(Q=l.current.get(ge))==null?void 0:Q.keywords)!=null?re:[],pe=z(le,xe);i.current.filtered.items.set(ge,pe),pe>0&&de++}for(let[ge,le]of s.current)for(let xe of le)if(i.current.filtered.items.get(xe)>0){i.current.filtered.groups.add(ge);break}i.current.filtered.count=de}function j(){var k,V,Q;let re=J();re&&(((k=re.parentElement)==null?void 0:k.firstChild)===re&&((Q=(V=re.closest(Wo))==null?void 0:V.querySelector($L))==null||Q.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function J(){var k;return(k=R.current)==null?void 0:k.querySelector(`${ag}[aria-selected="true"]`)}function ae(){var k;return Array.from(((k=R.current)==null?void 0:k.querySelectorAll(qb))||[])}function H(k){let V=ae()[k];V&&_.setState("value",V.getAttribute(ki))}function U(k){var V;let Q=J(),re=ae(),de=re.findIndex(le=>le===Q),ge=re[de+k];(V=f.current)!=null&&V.loop&&(ge=de+k<0?re[re.length-1]:de+k===re.length?re[0]:re[de+k]),ge&&_.setState("value",ge.getAttribute(ki))}function D(k){let V=J(),Q=V==null?void 0:V.closest(Wo),re;for(;Q&&!re;)Q=k>0?JL(Q,Wo):eN(Q,Wo),re=Q==null?void 0:Q.querySelector(qb);re?_.setState("value",re.getAttribute(ki)):U(k)}let se=()=>H(ae().length-1),G=k=>{k.preventDefault(),k.metaKey?se():k.altKey?D(1):U(1)},P=k=>{k.preventDefault(),k.metaKey?H(0):k.altKey?D(-1):U(-1)};return S.createElement(Je.div,{ref:n,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:k=>{var V;if((V=M.onKeyDown)==null||V.call(M,k),!k.defaultPrevented)switch(k.key){case"n":case"j":{T&&k.ctrlKey&&G(k);break}case"ArrowDown":{G(k);break}case"p":case"k":{T&&k.ctrlKey&&P(k);break}case"ArrowUp":{P(k);break}case"Home":{k.preventDefault(),H(0);break}case"End":{k.preventDefault(),se();break}case"Enter":if(!k.nativeEvent.isComposing&&k.keyCode!==229){k.preventDefault();let Q=J();if(Q){let re=new Event(hh);Q.dispatchEvent(re)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:$.inputId,id:$.labelId,style:rN},d),Ru(r,k=>S.createElement(l1.Provider,{value:_},S.createElement(s1.Provider,{value:$},k))))}),VL=S.forwardRef((r,n)=>{var i,a;let s=Ln(),l=S.useRef(null),c=S.useContext(u1),f=hs(),d=f1(r),g=(a=(i=d.current)==null?void 0:i.forceMount)!=null?a:c==null?void 0:c.forceMount;Gi(()=>{if(!g)return f.item(s,c==null?void 0:c.id)},[g]);let m=d1(s,l,[r.value,r.children,l],r.keywords),v=og(),y=Mi(B=>B.value&&B.value===m.current),b=Mi(B=>g||f.filter()===!1?!0:B.search?B.filtered.items.get(s)>0:!0);S.useEffect(()=>{let B=l.current;if(!(!B||r.disabled))return B.addEventListener(hh,x),()=>B.removeEventListener(hh,x)},[b,r.onSelect,r.disabled]);function x(){var B,_;E(),(_=(B=d.current).onSelect)==null||_.call(B,m.current)}function E(){v.setState("value",m.current,!0)}if(!b)return null;let{disabled:T,value:M,onSelect:N,forceMount:L,keywords:C,...R}=r;return S.createElement(Je.div,{ref:ns([l,n]),...R,id:s,"cmdk-item":"",role:"option","aria-disabled":!!T,"aria-selected":!!y,"data-disabled":!!T,"data-selected":!!y,onPointerMove:T||f.getDisablePointerSelection()?void 0:E,onClick:T?void 0:x},r.children)}),IL=S.forwardRef((r,n)=>{let{heading:i,children:a,forceMount:s,...l}=r,c=Ln(),f=S.useRef(null),d=S.useRef(null),g=Ln(),m=hs(),v=Mi(b=>s||m.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);Gi(()=>m.group(c),[]),d1(c,f,[r.value,r.heading,d]);let y=S.useMemo(()=>({id:c,forceMount:s}),[s]);return S.createElement(Je.div,{ref:ns([f,n]),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},i&&S.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:g},i),Ru(r,b=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":i?g:void 0},S.createElement(u1.Provider,{value:y},b))))}),YL=S.forwardRef((r,n)=>{let{alwaysRender:i,...a}=r,s=S.useRef(null),l=Mi(c=>!c.search);return!i&&!l?null:S.createElement(Je.div,{ref:ns([s,n]),...a,"cmdk-separator":"",role:"separator"})}),XL=S.forwardRef((r,n)=>{let{onValueChange:i,...a}=r,s=r.value!=null,l=og(),c=Mi(m=>m.search),f=Mi(m=>m.value),d=hs(),g=S.useMemo(()=>{var m;let v=(m=d.listInnerRef.current)==null?void 0:m.querySelector(`${ag}[${ki}="${encodeURIComponent(f)}"]`);return v==null?void 0:v.getAttribute("id")},[]);return S.useEffect(()=>{r.value!=null&&l.setState("search",r.value)},[r.value]),S.createElement(Je.input,{ref:n,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":g,id:d.inputId,type:"text",value:s?r.value:c,onChange:m=>{s||l.setState("search",m.target.value),i==null||i(m.target.value)}})}),ZL=S.forwardRef((r,n)=>{let{children:i,label:a="Suggestions",...s}=r,l=S.useRef(null),c=S.useRef(null),f=hs();return S.useEffect(()=>{if(c.current&&l.current){let d=c.current,g=l.current,m,v=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let y=d.offsetHeight;g.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return v.observe(d),()=>{cancelAnimationFrame(m),v.unobserve(d)}}},[]),S.createElement(Je.div,{ref:ns([l,n]),...s,"cmdk-list":"",role:"listbox","aria-label":a,id:f.listId},Ru(r,d=>S.createElement("div",{ref:ns([c,f.listInnerRef]),"cmdk-list-sizer":""},d)))}),WL=S.forwardRef((r,n)=>{let{open:i,onOpenChange:a,overlayClassName:s,contentClassName:l,container:c,...f}=r;return S.createElement(UL,{open:i,onOpenChange:a},S.createElement(i1,{container:c},S.createElement(rg,{"cmdk-overlay":"",className:s}),S.createElement(ig,{"aria-label":r.label,"cmdk-dialog":"",className:l},S.createElement(c1,{ref:n,...f}))))}),KL=S.forwardRef((r,n)=>Mi(i=>i.filtered.count===0)?S.createElement(Je.div,{ref:n,...r,"cmdk-empty":"",role:"presentation"}):null),QL=S.forwardRef((r,n)=>{let{progress:i,children:a,label:s="Loading...",...l}=r;return S.createElement(Je.div,{ref:n,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Ru(r,c=>S.createElement("div",{"aria-hidden":!0},c)))}),Xt=Object.assign(c1,{List:ZL,Item:VL,Input:XL,Group:IL,Separator:YL,Dialog:WL,Empty:KL,Loading:QL});function JL(r,n){let i=r.nextElementSibling;for(;i;){if(i.matches(n))return i;i=i.nextElementSibling}}function eN(r,n){let i=r.previousElementSibling;for(;i;){if(i.matches(n))return i;i=i.previousElementSibling}}function f1(r){let n=S.useRef(r);return Gi(()=>{n.current=r}),n}var Gi=typeof window>"u"?S.useEffect:S.useLayoutEffect;function Ca(r){let n=S.useRef();return n.current===void 0&&(n.current=r()),n}function ns(r){return n=>{r.forEach(i=>{typeof i=="function"?i(n):i!=null&&(i.current=n)})}}function Mi(r){let n=og(),i=()=>r(n.snapshot());return PL.useSyncExternalStore(n.subscribe,i,i)}function d1(r,n,i,a=[]){let s=S.useRef(),l=hs();return Gi(()=>{var c;let f=(()=>{var g;for(let m of i){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(g=m.current.textContent)==null?void 0:g.trim():s.current}})(),d=a.map(g=>g.trim());l.value(r,f,d),(c=n.current)==null||c.setAttribute(ki,f),s.current=f}),s}var tN=()=>{let[r,n]=S.useState(),i=Ca(()=>new Map);return Gi(()=>{i.current.forEach(a=>a()),i.current=new Map},[r]),(a,s)=>{i.current.set(a,s),n({})}};function nN(r){let n=r.type;return typeof n=="function"?n(r.props):"render"in n?n.render(r.props):r}function Ru({asChild:r,children:n},i){return r&&S.isValidElement(n)?S.cloneElement(nN(n),{ref:n.ref},i(n.props.children)):i(n)}var rN={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const iN=i1,h1=S.forwardRef(({className:r,...n},i)=>A.jsx(rg,{ref:i,className:Xe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",r),...n}));h1.displayName=rg.displayName;const aN=S.forwardRef(({className:r,children:n,...i},a)=>A.jsxs(iN,{children:[A.jsx(h1,{}),A.jsxs(ig,{ref:a,className:Xe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",r),...i,children:[n,A.jsxs(BL,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[A.jsx(KT,{className:"h-4 w-4"}),A.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));aN.displayName=ig.displayName;const oN=S.forwardRef(({className:r,...n},i)=>A.jsx(a1,{ref:i,className:Xe("text-lg leading-none font-semibold tracking-tight",r),...n}));oN.displayName=a1.displayName;const sN=S.forwardRef(({className:r,...n},i)=>A.jsx(o1,{ref:i,className:Xe("text-muted-foreground text-sm",r),...n}));sN.displayName=o1.displayName;const Du=S.forwardRef(({className:r,...n},i)=>A.jsx(Xt,{ref:i,className:Xe("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",r),...n}));Du.displayName=Xt.displayName;const sg=S.forwardRef(({className:r,...n},i)=>A.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[A.jsx(VT,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),A.jsx(Xt.Input,{ref:i,className:Xe("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",r),...n})]}));sg.displayName=Xt.Input.displayName;const Ou=S.forwardRef(({className:r,...n},i)=>A.jsx(Xt.List,{ref:i,className:Xe("max-h-[300px] overflow-x-hidden overflow-y-auto",r),...n}));Ou.displayName=Xt.List.displayName;const lg=S.forwardRef((r,n)=>A.jsx(Xt.Empty,{ref:n,className:"py-6 text-center text-sm",...r}));lg.displayName=Xt.Empty.displayName;const $a=S.forwardRef(({className:r,...n},i)=>A.jsx(Xt.Group,{ref:i,className:Xe("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",r),...n}));$a.displayName=Xt.Group.displayName;const lN=S.forwardRef(({className:r,...n},i)=>A.jsx(Xt.Separator,{ref:i,className:Xe("bg-border -mx-1 h-px",r),...n}));lN.displayName=Xt.Separator.displayName;const qa=S.forwardRef(({className:r,...n},i)=>A.jsx(Xt.Item,{ref:i,className:Xe("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r),...n}));qa.displayName=Xt.Item.displayName;const uN=({layout:r,autoRunFor:n})=>{const i=Sn(),{stop:a,start:s,isRunning:l}=r;return S.useEffect(()=>{if(!i)return;let c=null;return n!==void 0&&n>-1&&i.getGraph().order>0&&(s(),c=n>0?window.setTimeout(()=>{a()},n):null),()=>{a(),c&&clearTimeout(c)}},[n,s,a,i]),A.jsx(an,{size:"icon",onClick:()=>l?a():s(),tooltip:l?"Stop the layout animation":"Start the layout animation",variant:qn,children:l?A.jsx(HT,{}):A.jsx($T,{})})},cN=()=>{const r=Sn(),[n,i]=S.useState("Circular"),[a,s]=S.useState(!1),l=Sk(),c=yk(),f=Jk(),d=Xk({settings:{margin:1}}),g=Dk({maxIterations:20}),m=AE({iterations:20}),v=Zk(),y=Ok(),b=Bk(),x=S.useMemo(()=>({Circular:{layout:l},Circlepack:{layout:c},Random:{layout:f},Noverlaps:{layout:d,worker:v},"Force Directed":{layout:g,worker:y},"Force Atlas":{layout:m,worker:b}}),[c,l,g,m,d,f,y,v,b]),E=S.useCallback(T=>{console.debug(T);const{positions:M}=x[T].layout;jD(r.getGraph(),M(),{duration:500}),i(T)},[x,r]);return A.jsxs(A.Fragment,{children:[A.jsx("div",{children:x[n]&&"worker"in x[n]&&A.jsx(uN,{layout:x[n].worker})}),A.jsx("div",{children:A.jsxs(wu,{open:a,onOpenChange:s,children:[A.jsx(Eu,{asChild:!0,children:A.jsx(an,{size:"icon",variant:qn,onClick:()=>s(T=>!T),tooltip:"Layout Graph",children:A.jsx(LT,{})})}),A.jsx(ss,{side:"right",align:"center",className:"p-1",children:A.jsx(Du,{children:A.jsx(Ou,{children:A.jsx($a,{children:Object.keys(x).map(T=>A.jsx(qa,{onSelect:()=>{E(T)},className:"cursor-pointer text-xs",children:T},T))})})})})]})})]})};var Xl={exports:{}},fN=Xl.exports,Vb;function dN(){return Vb||(Vb=1,function(r){(function(n,i,a){function s(d){var g=this,m=f();g.next=function(){var v=2091639*g.s0+g.c*23283064365386963e-26;return g.s0=g.s1,g.s1=g.s2,g.s2=v-(g.c=v|0)},g.c=1,g.s0=m(" "),g.s1=m(" "),g.s2=m(" "),g.s0-=m(d),g.s0<0&&(g.s0+=1),g.s1-=m(d),g.s1<0&&(g.s1+=1),g.s2-=m(d),g.s2<0&&(g.s2+=1),m=null}function l(d,g){return g.c=d.c,g.s0=d.s0,g.s1=d.s1,g.s2=d.s2,g}function c(d,g){var m=new s(d),v=g&&g.state,y=m.next;return y.int32=function(){return m.next()*4294967296|0},y.double=function(){return y()+(y()*2097152|0)*11102230246251565e-32},y.quick=y,v&&(typeof v=="object"&&l(v,m),y.state=function(){return l(m,{})}),y}function f(){var d=4022871197,g=function(m){m=String(m);for(var v=0;v>>0,y-=d,y*=d,d=y>>>0,y-=d,d+=y*4294967296}return(d>>>0)*23283064365386963e-26};return g}i&&i.exports?i.exports=c:this.alea=c})(fN,r)}(Xl)),Xl.exports}var Zl={exports:{}},hN=Zl.exports,Ib;function gN(){return Ib||(Ib=1,function(r){(function(n,i,a){function s(f){var d=this,g="";d.x=0,d.y=0,d.z=0,d.w=0,d.next=function(){var v=d.x^d.x<<11;return d.x=d.y,d.y=d.z,d.z=d.w,d.w^=d.w>>>19^v^v>>>8},f===(f|0)?d.x=f:g+=f;for(var m=0;m>>0)/4294967296};return v.double=function(){do var y=g.next()>>>11,b=(g.next()>>>0)/4294967296,x=(y+b)/(1<<21);while(x===0);return x},v.int32=g.next,v.quick=v,m&&(typeof m=="object"&&l(m,g),v.state=function(){return l(g,{})}),v}i&&i.exports?i.exports=c:this.xor128=c})(hN,r)}(Zl)),Zl.exports}var Wl={exports:{}},pN=Wl.exports,Yb;function mN(){return Yb||(Yb=1,function(r){(function(n,i,a){function s(f){var d=this,g="";d.next=function(){var v=d.x^d.x>>>2;return d.x=d.y,d.y=d.z,d.z=d.w,d.w=d.v,(d.d=d.d+362437|0)+(d.v=d.v^d.v<<4^(v^v<<1))|0},d.x=0,d.y=0,d.z=0,d.w=0,d.v=0,f===(f|0)?d.x=f:g+=f;for(var m=0;m>>4),d.next()}function l(f,d){return d.x=f.x,d.y=f.y,d.z=f.z,d.w=f.w,d.v=f.v,d.d=f.d,d}function c(f,d){var g=new s(f),m=d&&d.state,v=function(){return(g.next()>>>0)/4294967296};return v.double=function(){do var y=g.next()>>>11,b=(g.next()>>>0)/4294967296,x=(y+b)/(1<<21);while(x===0);return x},v.int32=g.next,v.quick=v,m&&(typeof m=="object"&&l(m,g),v.state=function(){return l(g,{})}),v}i&&i.exports?i.exports=c:this.xorwow=c})(pN,r)}(Wl)),Wl.exports}var Kl={exports:{}},vN=Kl.exports,Xb;function yN(){return Xb||(Xb=1,function(r){(function(n,i,a){function s(f){var d=this;d.next=function(){var m=d.x,v=d.i,y,b;return y=m[v],y^=y>>>7,b=y^y<<24,y=m[v+1&7],b^=y^y>>>10,y=m[v+3&7],b^=y^y>>>3,y=m[v+4&7],b^=y^y<<7,y=m[v+7&7],y=y^y<<13,b^=y^y<<9,m[v]=b,d.i=v+1&7,b};function g(m,v){var y,b=[];if(v===(v|0))b[0]=v;else for(v=""+v,y=0;y0;--y)m.next()}g(d,f)}function l(f,d){return d.x=f.x.slice(),d.i=f.i,d}function c(f,d){f==null&&(f=+new Date);var g=new s(f),m=d&&d.state,v=function(){return(g.next()>>>0)/4294967296};return v.double=function(){do var y=g.next()>>>11,b=(g.next()>>>0)/4294967296,x=(y+b)/(1<<21);while(x===0);return x},v.int32=g.next,v.quick=v,m&&(m.x&&l(m,g),v.state=function(){return l(g,{})}),v}i&&i.exports?i.exports=c:this.xorshift7=c})(vN,r)}(Kl)),Kl.exports}var Ql={exports:{}},bN=Ql.exports,Zb;function wN(){return Zb||(Zb=1,function(r){(function(n,i,a){function s(f){var d=this;d.next=function(){var m=d.w,v=d.X,y=d.i,b,x;return d.w=m=m+1640531527|0,x=v[y+34&127],b=v[y=y+1&127],x^=x<<13,b^=b<<17,x^=x>>>15,b^=b>>>12,x=v[y]=x^b,d.i=y,x+(m^m>>>16)|0};function g(m,v){var y,b,x,E,T,M=[],N=128;for(v===(v|0)?(b=v,v=null):(v=v+"\0",b=0,N=Math.max(N,v.length)),x=0,E=-32;E>>15,b^=b<<4,b^=b>>>13,E>=0&&(T=T+1640531527|0,y=M[E&127]^=b+T,x=y==0?x+1:0);for(x>=128&&(M[(v&&v.length||0)&127]=-1),x=127,E=4*128;E>0;--E)b=M[x+34&127],y=M[x=x+1&127],b^=b<<13,y^=y<<17,b^=b>>>15,y^=y>>>12,M[x]=b^y;m.w=T,m.X=M,m.i=x}g(d,f)}function l(f,d){return d.i=f.i,d.w=f.w,d.X=f.X.slice(),d}function c(f,d){f==null&&(f=+new Date);var g=new s(f),m=d&&d.state,v=function(){return(g.next()>>>0)/4294967296};return v.double=function(){do var y=g.next()>>>11,b=(g.next()>>>0)/4294967296,x=(y+b)/(1<<21);while(x===0);return x},v.int32=g.next,v.quick=v,m&&(m.X&&l(m,g),v.state=function(){return l(g,{})}),v}i&&i.exports?i.exports=c:this.xor4096=c})(bN,r)}(Ql)),Ql.exports}var Jl={exports:{}},EN=Jl.exports,Wb;function SN(){return Wb||(Wb=1,function(r){(function(n,i,a){function s(f){var d=this,g="";d.next=function(){var v=d.b,y=d.c,b=d.d,x=d.a;return v=v<<25^v>>>7^y,y=y-b|0,b=b<<24^b>>>8^x,x=x-v|0,d.b=v=v<<20^v>>>12^y,d.c=y=y-b|0,d.d=b<<16^y>>>16^x,d.a=x-v|0},d.a=0,d.b=0,d.c=-1640531527,d.d=1367130551,f===Math.floor(f)?(d.a=f/4294967296|0,d.b=f|0):g+=f;for(var m=0;m>>0)/4294967296};return v.double=function(){do var y=g.next()>>>11,b=(g.next()>>>0)/4294967296,x=(y+b)/(1<<21);while(x===0);return x},v.int32=g.next,v.quick=v,m&&(typeof m=="object"&&l(m,g),v.state=function(){return l(g,{})}),v}i&&i.exports?i.exports=c:this.tychei=c})(EN,r)}(Jl)),Jl.exports}var eu={exports:{}};const xN={},_N=Object.freeze(Object.defineProperty({__proto__:null,default:xN},Symbol.toStringTag,{value:"Module"})),TN=Kx(_N);var CN=eu.exports,Kb;function AN(){return Kb||(Kb=1,function(r){(function(n,i,a){var s=256,l=6,c=52,f="random",d=a.pow(s,l),g=a.pow(2,c),m=g*2,v=s-1,y;function b(C,R,B){var _=[];R=R==!0?{entropy:!0}:R||{};var $=M(T(R.entropy?[C,L(i)]:C??N(),3),_),z=new x(_),F=function(){for(var Y=z.g(l),I=d,j=0;Y=m;)Y/=2,I/=2,j>>>=1;return(Y+j)/I};return F.int32=function(){return z.g(4)|0},F.quick=function(){return z.g(4)/4294967296},F.double=F,M(L(z.S),i),(R.pass||B||function(Y,I,j,J){return J&&(J.S&&E(J,z),Y.state=function(){return E(z,{})}),j?(a[f]=Y,I):Y})(F,$,"global"in R?R.global:this==a,R.state)}function x(C){var R,B=C.length,_=this,$=0,z=_.i=_.j=0,F=_.S=[];for(B||(C=[B++]);${if(!r||!Array.isArray(r.nodes)||!Array.isArray(r.edges))return!1;for(const n of r.nodes)if(!n.id||!n.labels||!n.properties)return!1;for(const n of r.edges)if(!n.id||!n.source||!n.target||!n.type||!n.properties)return!1;for(const n of r.edges){const i=r.getNode(n.source),a=r.getNode(n.target);if(i==null||a==null)return!1}return!0},LN=async r=>{let n=null;try{n=await vT(r)}catch(a){return kn.getState().setErrorMessage(y0(a),"Query Graphs Error!"),null}let i=null;if(n){const a={},s={};for(let d=0;d0){const d=cT-oy;for(const g of n.nodes)g.size=Math.round(oy+d*Math.pow((g.degree-l)/f,.5))}i=new ck,i.nodes=n.nodes,i.edges=n.edges,i.nodeIdMap=a,i.edgeIdMap=s,kN(i)||(i=null,console.error("Invalid graph data")),console.log("Graph data loaded")}return i},NN=r=>{const n=new ts;for(const i of(r==null?void 0:r.nodes)??[])n.addNode(i.id,{label:i.labels.join(", "),color:i.color,x:i.x,y:i.y,size:i.size,borderColor:oT,borderSize:.2});for(const i of(r==null?void 0:r.edges)??[])i.dynamicId=n.addDirectedEdge(i.source,i.target,{label:i.type});return n},Jb={label:""},g1=()=>{const r=Pe.use.queryLabel(),n=Ye.use.rawGraph(),i=Ye.use.sigmaGraph(),a=S.useCallback(c=>(n==null?void 0:n.getNode(c))||null,[n]),s=S.useCallback((c,f=!0)=>(n==null?void 0:n.getEdge(c,f))||null,[n]);return S.useEffect(()=>{if(r){if(Jb.label!==r){Jb.label=r;const c=Ye.getState();c.reset(),LN(r).then(f=>{c.setSigmaGraph(NN(f)),f==null||f.buildDynamicMap(),c.setRawGraph(f)})}}else{const c=Ye.getState();c.reset(),c.setSigmaGraph(new ts)}},[r]),{lightrageGraph:S.useCallback(()=>{if(i)return i;const c=new ts;return Ye.getState().setSigmaGraph(c),c},[i]),getNode:a,getEdge:s}},p1=()=>{const r=S.useContext(b0);if(r===void 0)throw new Error("useTheme must be used within a ThemeProvider");return r},Bl=r=>!!(r.type.startsWith("mouse")&&r.buttons!==0),zN=({disableHoverEffect:r})=>{const{lightrageGraph:n}=g1(),i=Sn(),a=oE(),s=aE(),l=fO(),{assign:c}=AE({iterations:20}),{theme:f}=p1(),d=Pe.use.enableHideUnselectedEdges(),g=Ye.use.selectedNode(),m=Ye.use.focusedNode(),v=Ye.use.selectedEdge(),y=Ye.use.focusedEdge();return S.useEffect(()=>{const b=n();l(b),b.__force_applied||(c(),Object.assign(b,{__force_applied:!0}));const{setFocusedNode:x,setSelectedNode:E,setFocusedEdge:T,setSelectedEdge:M,clearSelection:N}=Ye.getState();a({enterNode:L=>{Bl(L.event.original)||x(L.node)},leaveNode:L=>{Bl(L.event.original)||x(null)},clickNode:L=>{E(L.node),M(null)},clickEdge:L=>{M(L.edge),E(null)},enterEdge:L=>{Bl(L.event.original)||T(L.edge)},leaveEdge:L=>{Bl(L.event.original)||T(null)},clickStage:()=>N()})},[c,l,a,n]),S.useEffect(()=>{const b=f==="dark",x=b?rT:void 0,E=b?lT:void 0;s({nodeReducer:(T,M)=>{const N=i.getGraph(),L={...M,highlighted:M.highlighted||!1,labelColor:x};if(!r){L.highlighted=!1;const C=m||g,R=y||v;if(C)(T===C||N.neighbors(C).includes(T))&&(L.highlighted=!0,T===g&&(L.borderColor=sT));else if(R)N.extremities(R).includes(T)&&(L.highlighted=!0,L.size=3);else return L;L.highlighted?b&&(L.labelColor=iT):L.color=aT}return L},edgeReducer:(T,M)=>{const N=i.getGraph(),L={...M,hidden:!1,labelColor:x,color:E};if(!r){const C=m||g;C?d?N.extremities(T).includes(C)||(L.hidden=!0):N.extremities(T).includes(C)&&(L.color=ay):(y||v)&&(T===v?L.color=uT:T===y?L.color=ay:d&&(L.hidden=!0))}return L}})},[g,m,v,y,s,i,r,f,d]),null};function GN(){const{theme:r,setTheme:n}=p1(),i=S.useCallback(()=>n("light"),[n]),a=S.useCallback(()=>n("dark"),[n]);return r==="dark"?A.jsx(an,{onClick:i,variant:qn,tooltip:"Switch to light theme",size:"icon",children:A.jsx(BT,{})}):A.jsx(an,{onClick:a,variant:qn,tooltip:"Switch to dark theme",size:"icon",children:A.jsx(ZT,{})})}const MN=()=>{const{zoomIn:r,zoomOut:n,reset:i}=sE({duration:200,factor:1.5}),a=S.useCallback(()=>r(),[r]),s=S.useCallback(()=>n(),[n]),l=S.useCallback(()=>i(),[i]);return A.jsxs(A.Fragment,{children:[A.jsx(an,{variant:qn,onClick:a,tooltip:"Zoom In",size:"icon",children:A.jsx(JT,{})}),A.jsx(an,{variant:qn,onClick:s,tooltip:"Zoom Out",size:"icon",children:A.jsx(tC,{})}),A.jsx(an,{variant:qn,onClick:l,tooltip:"Reset Zoom",size:"icon",children:A.jsx(OT,{})})]})},jN=()=>{const{isFullScreen:r,toggle:n}=dO();return A.jsx(A.Fragment,{children:r?A.jsx(an,{variant:qn,onClick:n,tooltip:"Windowed",size:"icon",children:A.jsx(jT,{})}):A.jsx(an,{variant:qn,onClick:n,tooltip:"Full Screen",size:"icon",children:A.jsx(GT,{})})})};function UN(r){const n=S.useRef({value:r,previous:r});return S.useMemo(()=>(n.current.value!==r&&(n.current.previous=n.current.value,n.current.value=r),n.current.previous),[r])}var ug="Checkbox",[BN,Lz]=rs(ug),[FN,HN]=BN(ug),m1=S.forwardRef((r,n)=>{const{__scopeCheckbox:i,name:a,checked:s,defaultChecked:l,required:c,disabled:f,value:d="on",onCheckedChange:g,form:m,...v}=r,[y,b]=S.useState(null),x=Vt(n,C=>b(C)),E=S.useRef(!1),T=y?m||!!y.closest("form"):!0,[M=!1,N]=yu({prop:s,defaultProp:l,onChange:g}),L=S.useRef(M);return S.useEffect(()=>{const C=y==null?void 0:y.form;if(C){const R=()=>N(L.current);return C.addEventListener("reset",R),()=>C.removeEventListener("reset",R)}},[y,N]),A.jsxs(FN,{scope:i,state:M,disabled:f,children:[A.jsx(Je.button,{type:"button",role:"checkbox","aria-checked":Wr(M)?"mixed":M,"aria-required":c,"data-state":b1(M),"data-disabled":f?"":void 0,disabled:f,value:d,...v,ref:x,onKeyDown:ht(r.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:ht(r.onClick,C=>{N(R=>Wr(R)?!0:!R),T&&(E.current=C.isPropagationStopped(),E.current||C.stopPropagation())})}),T&&A.jsx(PN,{control:y,bubbles:!E.current,name:a,value:d,checked:M,required:c,disabled:f,form:m,style:{transform:"translateX(-100%)"},defaultChecked:Wr(l)?!1:l})]})});m1.displayName=ug;var v1="CheckboxIndicator",y1=S.forwardRef((r,n)=>{const{__scopeCheckbox:i,forceMount:a,...s}=r,l=HN(v1,i);return A.jsx(ni,{present:a||Wr(l.state)||l.state===!0,children:A.jsx(Je.span,{"data-state":b1(l.state),"data-disabled":l.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...r.style}})})});y1.displayName=v1;var PN=r=>{const{control:n,checked:i,bubbles:a=!0,defaultChecked:s,...l}=r,c=S.useRef(null),f=UN(i),d=q0(n);S.useEffect(()=>{const m=c.current,v=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(v,"checked").set;if(f!==i&&b){const x=new Event("click",{bubbles:a});m.indeterminate=Wr(i),b.call(m,Wr(i)?!1:i),m.dispatchEvent(x)}},[f,i,a]);const g=S.useRef(Wr(i)?!1:i);return A.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s??g.current,...l,tabIndex:-1,ref:c,style:{...r.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Wr(r){return r==="indeterminate"}function b1(r){return Wr(r)?"indeterminate":r?"checked":"unchecked"}var w1=m1,$N=y1;const E1=S.forwardRef(({className:r,...n},i)=>A.jsx(w1,{ref:i,className:Xe("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground h-4 w-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",r),...n,children:A.jsx($N,{className:Xe("flex items-center justify-center text-current"),children:A.jsx(T0,{className:"h-4 w-4"})})}));E1.displayName=w1.displayName;var qN="Separator",e0="horizontal",VN=["horizontal","vertical"],S1=S.forwardRef((r,n)=>{const{decorative:i,orientation:a=e0,...s}=r,l=IN(a)?a:e0,f=i?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return A.jsx(Je.div,{"data-orientation":l,...f,...s,ref:n})});S1.displayName=qN;function IN(r){return VN.includes(r)}var x1=S1;const Ko=S.forwardRef(({className:r,orientation:n="horizontal",decorative:i=!0,...a},s)=>A.jsx(x1,{ref:s,decorative:i,orientation:n,className:Xe("bg-border shrink-0",n==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",r),...a}));Ko.displayName=x1.displayName;const _1=S.forwardRef(({className:r,type:n,...i},a)=>A.jsx("input",{type:n,className:Xe("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:a,...i}));_1.displayName="Input";const Yr=({checked:r,onCheckedChange:n,label:i})=>A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx(E1,{checked:r,onCheckedChange:n}),A.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:i})]});function YN(){const[r,n]=S.useState(!1),[i,a]=S.useState(""),s=Pe.use.showPropertyPanel(),l=Pe.use.showNodeSearchBar(),c=Pe.use.showNodeLabel(),f=Pe.use.enableEdgeEvents(),d=Pe.use.enableNodeDrag(),g=Pe.use.enableHideUnselectedEdges(),m=Pe.use.showEdgeLabel(),v=Pe.use.enableHealthCheck(),y=Pe.use.apiKey();S.useEffect(()=>{a(y||"")},[y,r]);const b=S.useCallback(()=>Pe.setState(_=>({enableNodeDrag:!_.enableNodeDrag})),[]),x=S.useCallback(()=>Pe.setState(_=>({enableEdgeEvents:!_.enableEdgeEvents})),[]),E=S.useCallback(()=>Pe.setState(_=>({enableHideUnselectedEdges:!_.enableHideUnselectedEdges})),[]),T=S.useCallback(()=>Pe.setState(_=>({showEdgeLabel:!_.showEdgeLabel})),[]),M=S.useCallback(()=>Pe.setState(_=>({showPropertyPanel:!_.showPropertyPanel})),[]),N=S.useCallback(()=>Pe.setState(_=>({showNodeSearchBar:!_.showNodeSearchBar})),[]),L=S.useCallback(()=>Pe.setState(_=>({showNodeLabel:!_.showNodeLabel})),[]),C=S.useCallback(()=>Pe.setState(_=>({enableHealthCheck:!_.enableHealthCheck})),[]),R=S.useCallback(async()=>{Pe.setState({apiKey:i||null}),await kn.getState().check(),n(!1)},[i]),B=S.useCallback(_=>{a(_.target.value)},[a]);return A.jsxs(wu,{open:r,onOpenChange:n,children:[A.jsx(Eu,{asChild:!0,children:A.jsx(an,{variant:qn,tooltip:"Settings",size:"icon",children:A.jsx(YT,{})})}),A.jsx(ss,{side:"right",align:"start",className:"mb-2 p-2",onCloseAutoFocus:_=>_.preventDefault(),children:A.jsxs("div",{className:"flex flex-col gap-2",children:[A.jsx(Yr,{checked:s,onCheckedChange:M,label:"Show Property Panel"}),A.jsx(Yr,{checked:l,onCheckedChange:N,label:"Show Search Bar"}),A.jsx(Ko,{}),A.jsx(Yr,{checked:c,onCheckedChange:L,label:"Show Node Label"}),A.jsx(Yr,{checked:d,onCheckedChange:b,label:"Node Draggable"}),A.jsx(Ko,{}),A.jsx(Yr,{checked:m,onCheckedChange:T,label:"Show Edge Label"}),A.jsx(Yr,{checked:g,onCheckedChange:E,label:"Hide Unselected Edges"}),A.jsx(Yr,{checked:f,onCheckedChange:x,label:"Edge Events"}),A.jsx(Ko,{}),A.jsx(Yr,{checked:v,onCheckedChange:C,label:"Health Check"}),A.jsx(Ko,{}),A.jsxs("div",{className:"flex flex-col gap-2",children:[A.jsx("label",{className:"text-sm font-medium",children:"API Key"}),A.jsxs("form",{className:"flex h-6 gap-2",onSubmit:_=>_.preventDefault(),children:[A.jsx("div",{className:"w-0 flex-1",children:A.jsx(_1,{type:"password",value:i,onChange:B,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"})}),A.jsx(an,{onClick:R,variant:"outline",size:"sm",className:"max-h-full shrink-0",children:"Save"})]})]})]})})]})}function tu(r,n,i,a){function s(l){return l instanceof i?l:new i(function(c){c(l)})}return new(i||(i=Promise))(function(l,c){function f(m){try{g(a.next(m))}catch(v){c(v)}}function d(m){try{g(a.throw(m))}catch(v){c(v)}}function g(m){m.done?l(m.value):s(m.value).then(f,d)}g((a=a.apply(r,[])).next())})}const XN="ENTRIES",T1="KEYS",C1="VALUES",Lt="";class Ud{constructor(n,i){const a=n._tree,s=Array.from(a.keys());this.set=n,this._type=i,this._path=s.length>0?[{node:a,keys:s}]:[]}next(){const n=this.dive();return this.backtrack(),n}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:n,keys:i}=_a(this._path);if(_a(i)===Lt)return{done:!1,value:this.result()};const a=n.get(_a(i));return this._path.push({node:a,keys:Array.from(a.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const n=_a(this._path).keys;n.pop(),!(n.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:n})=>_a(n)).filter(n=>n!==Lt).join("")}value(){return _a(this._path).node.get(Lt)}result(){switch(this._type){case C1:return this.value();case T1:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const _a=r=>r[r.length-1],ZN=(r,n,i)=>{const a=new Map;if(n===void 0)return a;const s=n.length+1,l=s+i,c=new Uint8Array(l*s).fill(i+1);for(let f=0;f{const d=l*c;e:for(const g of r.keys())if(g===Lt){const m=s[d-1];m<=i&&a.set(f,[r.get(g),m])}else{let m=l;for(let v=0;vi)continue e}A1(r.get(g),n,i,a,s,m,c,f+g)}};class Zr{constructor(n=new Map,i=""){this._size=void 0,this._tree=n,this._prefix=i}atPrefix(n){if(!n.startsWith(this._prefix))throw new Error("Mismatched prefix");const[i,a]=fu(this._tree,n.slice(this._prefix.length));if(i===void 0){const[s,l]=cg(a);for(const c of s.keys())if(c!==Lt&&c.startsWith(l)){const f=new Map;return f.set(c.slice(l.length),s.get(c)),new Zr(f,n)}}return new Zr(i,n)}clear(){this._size=void 0,this._tree.clear()}delete(n){return this._size=void 0,WN(this._tree,n)}entries(){return new Ud(this,XN)}forEach(n){for(const[i,a]of this)n(i,a,this)}fuzzyGet(n,i){return ZN(this._tree,n,i)}get(n){const i=gh(this._tree,n);return i!==void 0?i.get(Lt):void 0}has(n){const i=gh(this._tree,n);return i!==void 0&&i.has(Lt)}keys(){return new Ud(this,T1)}set(n,i){if(typeof n!="string")throw new Error("key must be a string");return this._size=void 0,Bd(this._tree,n).set(Lt,i),this}get size(){if(this._size)return this._size;this._size=0;const n=this.entries();for(;!n.next().done;)this._size+=1;return this._size}update(n,i){if(typeof n!="string")throw new Error("key must be a string");this._size=void 0;const a=Bd(this._tree,n);return a.set(Lt,i(a.get(Lt))),this}fetch(n,i){if(typeof n!="string")throw new Error("key must be a string");this._size=void 0;const a=Bd(this._tree,n);let s=a.get(Lt);return s===void 0&&a.set(Lt,s=i()),s}values(){return new Ud(this,C1)}[Symbol.iterator](){return this.entries()}static from(n){const i=new Zr;for(const[a,s]of n)i.set(a,s);return i}static fromObject(n){return Zr.from(Object.entries(n))}}const fu=(r,n,i=[])=>{if(n.length===0||r==null)return[r,i];for(const a of r.keys())if(a!==Lt&&n.startsWith(a))return i.push([r,a]),fu(r.get(a),n.slice(a.length),i);return i.push([r,n]),fu(void 0,"",i)},gh=(r,n)=>{if(n.length===0||r==null)return r;for(const i of r.keys())if(i!==Lt&&n.startsWith(i))return gh(r.get(i),n.slice(i.length))},Bd=(r,n)=>{const i=n.length;e:for(let a=0;r&&a{const[i,a]=fu(r,n);if(i!==void 0){if(i.delete(Lt),i.size===0)R1(a);else if(i.size===1){const[s,l]=i.entries().next().value;D1(a,s,l)}}},R1=r=>{if(r.length===0)return;const[n,i]=cg(r);if(n.delete(i),n.size===0)R1(r.slice(0,-1));else if(n.size===1){const[a,s]=n.entries().next().value;a!==Lt&&D1(r.slice(0,-1),a,s)}},D1=(r,n,i)=>{if(r.length===0)return;const[a,s]=cg(r);a.set(s+n,i),a.delete(s)},cg=r=>r[r.length-1],fg="or",O1="and",KN="and_not";class Kr{constructor(n){if((n==null?void 0:n.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const i=n.autoVacuum==null||n.autoVacuum===!0?Pd:n.autoVacuum;this._options=Object.assign(Object.assign(Object.assign({},Hd),n),{autoVacuum:i,searchOptions:Object.assign(Object.assign({},t0),n.searchOptions||{}),autoSuggestOptions:Object.assign(Object.assign({},nz),n.autoSuggestOptions||{})}),this._index=new Zr,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=mh,this.addFields(this._options.fields)}add(n){const{extractField:i,tokenize:a,processTerm:s,fields:l,idField:c}=this._options,f=i(n,c);if(f==null)throw new Error(`MiniSearch: document does not have ID field "${c}"`);if(this._idToShortId.has(f))throw new Error(`MiniSearch: duplicate ID ${f}`);const d=this.addDocumentId(f);this.saveStoredFields(d,n);for(const g of l){const m=i(n,g);if(m==null)continue;const v=a(m.toString(),g),y=this._fieldIds[g],b=new Set(v).size;this.addFieldLength(d,y,this._documentCount-1,b);for(const x of v){const E=s(x,g);if(Array.isArray(E))for(const T of E)this.addTerm(y,d,T);else E&&this.addTerm(y,d,E)}}}addAll(n){for(const i of n)this.add(i)}addAllAsync(n,i={}){const{chunkSize:a=10}=i,s={chunk:[],promise:Promise.resolve()},{chunk:l,promise:c}=n.reduce(({chunk:f,promise:d},g,m)=>(f.push(g),(m+1)%a===0?{chunk:[],promise:d.then(()=>new Promise(v=>setTimeout(v,0))).then(()=>this.addAll(f))}:{chunk:f,promise:d}),s);return c.then(()=>this.addAll(l))}remove(n){const{tokenize:i,processTerm:a,extractField:s,fields:l,idField:c}=this._options,f=s(n,c);if(f==null)throw new Error(`MiniSearch: document does not have ID field "${c}"`);const d=this._idToShortId.get(f);if(d==null)throw new Error(`MiniSearch: cannot remove document with ID ${f}: it is not in the index`);for(const g of l){const m=s(n,g);if(m==null)continue;const v=i(m.toString(),g),y=this._fieldIds[g],b=new Set(v).size;this.removeFieldLength(d,y,this._documentCount,b);for(const x of v){const E=a(x,g);if(Array.isArray(E))for(const T of E)this.removeTerm(y,d,T);else E&&this.removeTerm(y,d,E)}}this._storedFields.delete(d),this._documentIds.delete(d),this._idToShortId.delete(f),this._fieldLength.delete(d),this._documentCount-=1}removeAll(n){if(n)for(const i of n)this.remove(i);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Zr,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(n){const i=this._idToShortId.get(n);if(i==null)throw new Error(`MiniSearch: cannot discard document with ID ${n}: it is not in the index`);this._idToShortId.delete(n),this._documentIds.delete(i),this._storedFields.delete(i),(this._fieldLength.get(i)||[]).forEach((a,s)=>{this.removeFieldLength(i,s,this._documentCount,a)}),this._fieldLength.delete(i),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:n,minDirtCount:i,batchSize:a,batchWait:s}=this._options.autoVacuum;this.conditionalVacuum({batchSize:a,batchWait:s},{minDirtCount:i,minDirtFactor:n})}discardAll(n){const i=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const a of n)this.discard(a)}finally{this._options.autoVacuum=i}this.maybeAutoVacuum()}replace(n){const{idField:i,extractField:a}=this._options,s=a(n,i);this.discard(s),this.add(n)}vacuum(n={}){return this.conditionalVacuum(n)}conditionalVacuum(n,i){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&i,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const a=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=mh,this.performVacuuming(n,a)}),this._enqueuedVacuum)):this.vacuumConditionsMet(i)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(n),this._currentVacuum)}performVacuuming(n,i){return tu(this,void 0,void 0,function*(){const a=this._dirtCount;if(this.vacuumConditionsMet(i)){const s=n.batchSize||ph.batchSize,l=n.batchWait||ph.batchWait;let c=1;for(const[f,d]of this._index){for(const[g,m]of d)for(const[v]of m)this._documentIds.has(v)||(m.size<=1?d.delete(g):m.delete(v));this._index.get(f).size===0&&this._index.delete(f),c%s===0&&(yield new Promise(g=>setTimeout(g,l))),c+=1}this._dirtCount-=a}yield null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null})}vacuumConditionsMet(n){if(n==null)return!0;let{minDirtCount:i,minDirtFactor:a}=n;return i=i||Pd.minDirtCount,a=a||Pd.minDirtFactor,this.dirtCount>=i&&this.dirtFactor>=a}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(n){return this._idToShortId.has(n)}getStoredFields(n){const i=this._idToShortId.get(n);if(i!=null)return this._storedFields.get(i)}search(n,i={}){const{searchOptions:a}=this._options,s=Object.assign(Object.assign({},a),i),l=this.executeQuery(n,i),c=[];for(const[f,{score:d,terms:g,match:m}]of l){const v=g.length||1,y={id:this._documentIds.get(f),score:d*v,terms:Object.keys(m),queryTerms:g,match:m};Object.assign(y,this._storedFields.get(f)),(s.filter==null||s.filter(y))&&c.push(y)}return n===Kr.wildcard&&s.boostDocument==null||c.sort(r0),c}autoSuggest(n,i={}){i=Object.assign(Object.assign({},this._options.autoSuggestOptions),i);const a=new Map;for(const{score:l,terms:c}of this.search(n,i)){const f=c.join(" "),d=a.get(f);d!=null?(d.score+=l,d.count+=1):a.set(f,{score:l,terms:c,count:1})}const s=[];for(const[l,{score:c,terms:f,count:d}]of a)s.push({suggestion:l,terms:f,score:c/d});return s.sort(r0),s}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(n,i){if(i==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(n),i)}static loadJSONAsync(n,i){return tu(this,void 0,void 0,function*(){if(i==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(n),i)})}static getDefault(n){if(Hd.hasOwnProperty(n))return Fd(Hd,n);throw new Error(`MiniSearch: unknown option "${n}"`)}static loadJS(n,i){const{index:a,documentIds:s,fieldLength:l,storedFields:c,serializationVersion:f}=n,d=this.instantiateMiniSearch(n,i);d._documentIds=Fl(s),d._fieldLength=Fl(l),d._storedFields=Fl(c);for(const[g,m]of d._documentIds)d._idToShortId.set(m,g);for(const[g,m]of a){const v=new Map;for(const y of Object.keys(m)){let b=m[y];f===1&&(b=b.ds),v.set(parseInt(y,10),Fl(b))}d._index.set(g,v)}return d}static loadJSAsync(n,i){return tu(this,void 0,void 0,function*(){const{index:a,documentIds:s,fieldLength:l,storedFields:c,serializationVersion:f}=n,d=this.instantiateMiniSearch(n,i);d._documentIds=yield Hl(s),d._fieldLength=yield Hl(l),d._storedFields=yield Hl(c);for(const[m,v]of d._documentIds)d._idToShortId.set(v,m);let g=0;for(const[m,v]of a){const y=new Map;for(const b of Object.keys(v)){let x=v[b];f===1&&(x=x.ds),y.set(parseInt(b,10),yield Hl(x))}++g%1e3===0&&(yield k1(0)),d._index.set(m,y)}return d})}static instantiateMiniSearch(n,i){const{documentCount:a,nextId:s,fieldIds:l,averageFieldLength:c,dirtCount:f,serializationVersion:d}=n;if(d!==1&&d!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const g=new Kr(i);return g._documentCount=a,g._nextId=s,g._idToShortId=new Map,g._fieldIds=l,g._avgFieldLength=c,g._dirtCount=f||0,g._index=new Zr,g}executeQuery(n,i={}){if(n===Kr.wildcard)return this.executeWildcardQuery(i);if(typeof n!="string"){const y=Object.assign(Object.assign(Object.assign({},i),n),{queries:void 0}),b=n.queries.map(x=>this.executeQuery(x,y));return this.combineResults(b,y.combineWith)}const{tokenize:a,processTerm:s,searchOptions:l}=this._options,c=Object.assign(Object.assign({tokenize:a,processTerm:s},l),i),{tokenize:f,processTerm:d}=c,v=f(n).flatMap(y=>d(y)).filter(y=>!!y).map(tz(c)).map(y=>this.executeQuerySpec(y,c));return this.combineResults(v,c.combineWith)}executeQuerySpec(n,i){const a=Object.assign(Object.assign({},this._options.searchOptions),i),s=(a.fields||this._options.fields).reduce((E,T)=>Object.assign(Object.assign({},E),{[T]:Fd(a.boost,T)||1}),{}),{boostDocument:l,weights:c,maxFuzzy:f,bm25:d}=a,{fuzzy:g,prefix:m}=Object.assign(Object.assign({},t0.weights),c),v=this._index.get(n.term),y=this.termResults(n.term,n.term,1,n.termBoost,v,s,l,d);let b,x;if(n.prefix&&(b=this._index.atPrefix(n.term)),n.fuzzy){const E=n.fuzzy===!0?.2:n.fuzzy,T=E<1?Math.min(f,Math.round(n.term.length*E)):E;T&&(x=this._index.fuzzyGet(n.term,T))}if(b)for(const[E,T]of b){const M=E.length-n.term.length;if(!M)continue;x==null||x.delete(E);const N=m*E.length/(E.length+.3*M);this.termResults(n.term,E,N,n.termBoost,T,s,l,d,y)}if(x)for(const E of x.keys()){const[T,M]=x.get(E);if(!M)continue;const N=g*E.length/(E.length+M);this.termResults(n.term,E,N,n.termBoost,T,s,l,d,y)}return y}executeWildcardQuery(n){const i=new Map,a=Object.assign(Object.assign({},this._options.searchOptions),n);for(const[s,l]of this._documentIds){const c=a.boostDocument?a.boostDocument(l,"",this._storedFields.get(s)):1;i.set(s,{score:c,terms:[],match:{}})}return i}combineResults(n,i=fg){if(n.length===0)return new Map;const a=i.toLowerCase(),s=QN[a];if(!s)throw new Error(`Invalid combination operator: ${i}`);return n.reduce(s)||new Map}toJSON(){const n=[];for(const[i,a]of this._index){const s={};for(const[l,c]of a)s[l]=Object.fromEntries(c);n.push([i,s])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:n,serializationVersion:2}}termResults(n,i,a,s,l,c,f,d,g=new Map){if(l==null)return g;for(const m of Object.keys(c)){const v=c[m],y=this._fieldIds[m],b=l.get(y);if(b==null)continue;let x=b.size;const E=this._avgFieldLength[y];for(const T of b.keys()){if(!this._documentIds.has(T)){this.removeTerm(y,T,i),x-=1;continue}const M=f?f(this._documentIds.get(T),i,this._storedFields.get(T)):1;if(!M)continue;const N=b.get(T),L=this._fieldLength.get(T)[y],C=ez(N,x,this._documentCount,L,E,d),R=a*s*v*M*C,B=g.get(T);if(B){B.score+=R,rz(B.terms,n);const _=Fd(B.match,i);_?_.push(m):B.match[i]=[m]}else g.set(T,{score:R,terms:[n],match:{[i]:[m]}})}}return g}addTerm(n,i,a){const s=this._index.fetch(a,i0);let l=s.get(n);if(l==null)l=new Map,l.set(i,1),s.set(n,l);else{const c=l.get(i);l.set(i,(c||0)+1)}}removeTerm(n,i,a){if(!this._index.has(a)){this.warnDocumentChanged(i,n,a);return}const s=this._index.fetch(a,i0),l=s.get(n);l==null||l.get(i)==null?this.warnDocumentChanged(i,n,a):l.get(i)<=1?l.size<=1?s.delete(n):l.delete(i):l.set(i,l.get(i)-1),this._index.get(a).size===0&&this._index.delete(a)}warnDocumentChanged(n,i,a){for(const s of Object.keys(this._fieldIds))if(this._fieldIds[s]===i){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(n)} has changed before removal: term "${a}" was not present in field "${s}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(n){const i=this._nextId;return this._idToShortId.set(n,i),this._documentIds.set(i,n),this._documentCount+=1,this._nextId+=1,i}addFields(n){for(let i=0;iObject.prototype.hasOwnProperty.call(r,n)?r[n]:void 0,QN={[fg]:(r,n)=>{for(const i of n.keys()){const a=r.get(i);if(a==null)r.set(i,n.get(i));else{const{score:s,terms:l,match:c}=n.get(i);a.score=a.score+s,a.match=Object.assign(a.match,c),n0(a.terms,l)}}return r},[O1]:(r,n)=>{const i=new Map;for(const a of n.keys()){const s=r.get(a);if(s==null)continue;const{score:l,terms:c,match:f}=n.get(a);n0(s.terms,c),i.set(a,{score:s.score+l,terms:s.terms,match:Object.assign(s.match,f)})}return i},[KN]:(r,n)=>{for(const i of n.keys())r.delete(i);return r}},JN={k:1.2,b:.7,d:.5},ez=(r,n,i,a,s,l)=>{const{k:c,b:f,d}=l;return Math.log(1+(i-n+.5)/(n+.5))*(d+r*(c+1)/(r+c*(1-f+f*a/s)))},tz=r=>(n,i,a)=>{const s=typeof r.fuzzy=="function"?r.fuzzy(n,i,a):r.fuzzy||!1,l=typeof r.prefix=="function"?r.prefix(n,i,a):r.prefix===!0,c=typeof r.boostTerm=="function"?r.boostTerm(n,i,a):1;return{term:n,fuzzy:s,prefix:l,termBoost:c}},Hd={idField:"id",extractField:(r,n)=>r[n],tokenize:r=>r.split(iz),processTerm:r=>r.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(r,n)=>{typeof(console==null?void 0:console[r])=="function"&&console[r](n)},autoVacuum:!0},t0={combineWith:fg,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:JN},nz={combineWith:O1,prefix:(r,n,i)=>n===i.length-1},ph={batchSize:1e3,batchWait:10},mh={minDirtFactor:.1,minDirtCount:20},Pd=Object.assign(Object.assign({},ph),mh),rz=(r,n)=>{r.includes(n)||r.push(n)},n0=(r,n)=>{for(const i of n)r.includes(i)||r.push(i)},r0=({score:r},{score:n})=>n-r,i0=()=>new Map,Fl=r=>{const n=new Map;for(const i of Object.keys(r))n.set(parseInt(i,10),r[i]);return n},Hl=r=>tu(void 0,void 0,void 0,function*(){const n=new Map;let i=0;for(const a of Object.keys(r))n.set(parseInt(a,10),r[a]),++i%1e3===0&&(yield k1(0));return n}),k1=r=>new Promise(n=>setTimeout(n,r)),iz=/[\n\r\p{Z}\p{P}]+/u,az={index:new Kr({fields:[]})};S.createContext(az);const vh=({label:r,color:n,hidden:i,labels:a={}})=>bt.createElement("div",{className:"node"},bt.createElement("span",{className:"render "+(i?"circle":"disc"),style:{backgroundColor:n||"#000"}}),bt.createElement("span",{className:`label ${i?"text-muted":""} ${r?"":"text-italic"}`},r||a.no_label||"No label")),oz=({id:r,labels:n})=>{const i=Sn(),a=S.useMemo(()=>{const s=i.getGraph().getNodeAttributes(r),l=i.getSetting("nodeReducer");return Object.assign(Object.assign({color:i.getSetting("defaultNodeColor")},s),l?l(r,s):{})},[i,r]);return bt.createElement(vh,Object.assign({},a,{labels:n}))},sz=({label:r,color:n,source:i,target:a,hidden:s,directed:l,labels:c={}})=>bt.createElement("div",{className:"edge"},bt.createElement(vh,Object.assign({},i,{labels:c})),bt.createElement("div",{className:"body"},bt.createElement("div",{className:"render"},bt.createElement("span",{className:s?"dotted":"dash",style:{borderColor:n||"#000"}})," ",l&&bt.createElement("span",{className:"arrow",style:{borderTopColor:n||"#000"}})),bt.createElement("span",{className:`label ${s?"text-muted":""} ${r?"":"fst-italic"}`},r||c.no_label||"No label")),bt.createElement(vh,Object.assign({},a,{labels:c}))),lz=({id:r,labels:n})=>{const i=Sn(),a=S.useMemo(()=>{const s=i.getGraph().getEdgeAttributes(r),l=i.getSetting("nodeReducer"),c=i.getSetting("edgeReducer"),f=i.getGraph().getNodeAttributes(i.getGraph().source(r)),d=i.getGraph().getNodeAttributes(i.getGraph().target(r));return Object.assign(Object.assign(Object.assign({color:i.getSetting("defaultEdgeColor"),directed:i.getGraph().isDirected(r)},s),c?c(r,s):{}),{source:Object.assign(Object.assign({color:i.getSetting("defaultNodeColor")},f),l?l(r,f):{}),target:Object.assign(Object.assign({color:i.getSetting("defaultNodeColor")},d),l?l(r,d):{})})},[i,r]);return bt.createElement(sz,Object.assign({},a,{labels:n}))};function L1(r,n){const[i,a]=S.useState(r);return S.useEffect(()=>{const s=setTimeout(()=>{a(r)},n);return()=>{clearTimeout(s)}},[r,n]),i}function uz({fetcher:r,preload:n,filterFn:i,renderOption:a,getOptionValue:s,notFound:l,loadingSkeleton:c,label:f,placeholder:d="Select...",value:g,onChange:m,onFocus:v,disabled:y=!1,className:b,noResultsMessage:x}){const[E,T]=S.useState(!1),[M,N]=S.useState(!1),[L,C]=S.useState([]),[R,B]=S.useState(!1),[_,$]=S.useState(null),[z,F]=S.useState(g),[Y,I]=S.useState(null),[j,J]=S.useState(""),ae=L1(j,n?0:150),[H,U]=S.useState([]);S.useEffect(()=>{T(!0),F(g)},[g]),S.useEffect(()=>{E||(async()=>{try{B(!0),$(null);const P=g!==null?await r(g):[];U(P),C(P)}catch(P){$(P instanceof Error?P.message:"Failed to fetch options")}finally{B(!1)}})()},[E,r,g]),S.useEffect(()=>{const G=async()=>{try{B(!0),$(null);const P=await r(ae);U(P),C(P)}catch(P){$(P instanceof Error?P.message:"Failed to fetch options")}finally{B(!1)}};E&&n?n&&C(ae?H.filter(P=>i?i(P,ae):!0):H):G()},[r,ae,E,n,i]);const D=S.useCallback(G=>{G!==z&&(F(G),m(G)),N(!1)},[z,F,N,m]),se=S.useCallback(G=>{G!==Y&&(I(G),v(G))},[Y,I,v]);return A.jsx("div",{className:Xe(y&&"cursor-not-allowed opacity-50",b),onFocus:()=>{N(!0)},onBlur:()=>N(!1),children:A.jsxs(Du,{shouldFilter:!1,className:"bg-transparent",children:[A.jsxs("div",{children:[A.jsx(sg,{placeholder:d,value:j,className:"max-h-8",onValueChange:G=>{J(G),G&&!M&&N(!0)}}),R&&L.length>0&&A.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:A.jsx(C0,{className:"h-4 w-4 animate-spin"})})]}),A.jsxs(Ou,{className:"max-h-auto",hidden:!M||ae.length===0,children:[_&&A.jsx("div",{className:"text-destructive p-4 text-center",children:_}),R&&L.length===0&&(c||A.jsx(cz,{})),!R&&!_&&L.length===0&&(l||A.jsx(lg,{children:x??`No ${f.toLowerCase()} found.`})),A.jsx($a,{children:L.map((G,P)=>A.jsxs(A.Fragment,{children:[A.jsx(qa,{value:s(G),onSelect:D,onMouseEnter:()=>se(s(G)),className:"truncate",children:a(G)},s(G)+`${P}`),P!==L.length-1&&A.jsx("div",{className:"bg-foreground/10 h-[1px]"},P)]}))})]})]})})}function cz(){return A.jsx($a,{children:A.jsx(qa,{disabled:!0,children:A.jsxs("div",{className:"flex w-full items-center gap-2",children:[A.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),A.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[A.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),A.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function fz(r){return A.jsxs("div",{children:[r.type==="nodes"&&A.jsx(oz,{id:r.id}),r.type==="edges"&&A.jsx(lz,{id:r.id}),r.type==="message"&&A.jsx("div",{children:r.message})]})}const $d="__message_item",Pl={graph:null,searchEngine:null},dz=({onChange:r,onFocus:n,value:i})=>{const a=Ye.use.sigmaGraph(),s=S.useMemo(()=>{if(Pl.graph==a)return Pl.searchEngine;if(!a||a.nodes().length==0)return;Pl.graph=a;const c=new Kr({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),f=a.nodes().map(d=>({id:d,label:a.getNodeAttribute(d,"label")}));return c.addAll(f),Pl.searchEngine=c,c},[a]),l=S.useCallback(async c=>{if(n&&n(null),!c||!s)return[];const f=s.search(c).map(d=>({id:d.id,type:"nodes"}));return f.length<=qf?f:[...f.slice(0,qf),{type:"message",id:$d,message:`And ${f.length-qf} others`}]},[s,n]);return A.jsx(uz,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:l,renderOption:fz,getOptionValue:c=>c.id,value:i&&i.type!=="message"?i.id:null,onChange:c=>{c!==$d&&r(c?{id:c,type:"nodes"}:null)},onFocus:c=>{c!==$d&&n&&n(c?{id:c,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},hz=({...r})=>A.jsx(dz,{...r});function gz({fetcher:r,preload:n,filterFn:i,renderOption:a,getOptionValue:s,getDisplayValue:l,notFound:c,loadingSkeleton:f,label:d,placeholder:g="Select...",value:m,onChange:v,disabled:y=!1,className:b,triggerClassName:x,searchInputClassName:E,noResultsMessage:T,triggerTooltip:M,clearable:N=!0}){const[L,C]=S.useState(!1),[R,B]=S.useState(!1),[_,$]=S.useState([]),[z,F]=S.useState(!1),[Y,I]=S.useState(null),[j,J]=S.useState(m),[ae,H]=S.useState(null),[U,D]=S.useState(""),se=L1(U,n?0:150),[G,P]=S.useState([]);S.useEffect(()=>{C(!0),J(m)},[m]),S.useEffect(()=>{if(m&&_.length>0){const V=_.find(Q=>s(Q)===m);V&&H(V)}},[m,_,s]),S.useEffect(()=>{L||(async()=>{try{F(!0),I(null);const Q=await r(m);P(Q),$(Q)}catch(Q){I(Q instanceof Error?Q.message:"Failed to fetch options")}finally{F(!1)}})()},[L,r,m]),S.useEffect(()=>{const V=async()=>{try{F(!0),I(null);const Q=await r(se);P(Q),$(Q)}catch(Q){I(Q instanceof Error?Q.message:"Failed to fetch options")}finally{F(!1)}};L&&n?n&&$(se?G.filter(Q=>i?i(Q,se):!0):G):V()},[r,se,L,n,i]);const k=S.useCallback(V=>{const Q=N&&V===j?"":V;J(Q),H(_.find(re=>s(re)===Q)||null),v(Q),B(!1)},[j,v,N,_,s]);return A.jsxs(wu,{open:R,onOpenChange:B,children:[A.jsx(Eu,{asChild:!0,children:A.jsxs(an,{variant:"outline",role:"combobox","aria-expanded":R,className:Xe("justify-between",y&&"cursor-not-allowed opacity-50",x),disabled:y,tooltip:M,side:"bottom",children:[ae?l(ae):g,A.jsx(CT,{className:"opacity-50",size:10})]})}),A.jsx(ss,{className:Xe("p-0",b),onCloseAutoFocus:V=>V.preventDefault(),children:A.jsxs(Du,{shouldFilter:!1,children:[A.jsxs("div",{className:"relative w-full border-b",children:[A.jsx(sg,{placeholder:`Search ${d.toLowerCase()}...`,value:U,onValueChange:V=>{D(V)},className:E}),z&&_.length>0&&A.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:A.jsx(C0,{className:"h-4 w-4 animate-spin"})})]}),A.jsxs(Ou,{children:[Y&&A.jsx("div",{className:"text-destructive p-4 text-center",children:Y}),z&&_.length===0&&(f||A.jsx(pz,{})),!z&&!Y&&_.length===0&&(c||A.jsx(lg,{children:T??`No ${d.toLowerCase()} found.`})),A.jsx($a,{children:_.map(V=>A.jsxs(qa,{value:s(V),onSelect:k,className:"truncate",children:[a(V),A.jsx(T0,{className:Xe("ml-auto h-3 w-3",j===s(V)?"opacity-100":"opacity-0")})]},s(V)))})]})]})})]})}function pz(){return A.jsx($a,{children:A.jsx(qa,{disabled:!0,children:A.jsxs("div",{className:"flex w-full items-center gap-2",children:[A.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),A.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[A.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),A.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const mz=()=>{const r=Pe.use.queryLabel(),[n,i]=S.useState({labels:[],searchEngine:null}),[a,s]=S.useState(!1),l=S.useCallback(async f=>{let d=n.labels,g=n.searchEngine;if(!a||!g){d=["*"].concat(await yT()),d.includes(Pe.getState().queryLabel)||Pe.getState().setQueryLabel(d[0]),g=new Kr({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}});const m=d.map((v,y)=>({id:y,value:v}));g.addAll(m),i({labels:d,searchEngine:g}),s(!0)}return f?g.search(f).map(m=>d[m.id]):d},[n,a,i,s]),c=S.useCallback(f=>{Pe.getState().setQueryLabel(f)},[]);return A.jsx(gz,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:l,renderOption:f=>A.jsx("div",{children:f}),getOptionValue:f=>f,getDisplayValue:f=>A.jsx("div",{children:f}),notFound:A.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:r!==null?r:"",onChange:c})},vz=({text:r,className:n,tooltipClassName:i,tooltip:a,side:s,onClick:l})=>a?A.jsx(BE,{delayDuration:200,children:A.jsxs(FE,{children:[A.jsx(HE,{asChild:!0,children:A.jsx("label",{className:Xe(n,l!==void 0?"cursor-pointer":void 0),onClick:l,children:r})}),A.jsx(Qh,{side:s,className:i,children:a})]})}):A.jsx("label",{className:Xe(n,l!==void 0?"cursor-pointer":void 0),onClick:l,children:r}),yz=()=>{const{getNode:r,getEdge:n}=g1(),i=Ye.use.selectedNode(),a=Ye.use.focusedNode(),s=Ye.use.selectedEdge(),l=Ye.use.focusedEdge(),[c,f]=S.useState(null),[d,g]=S.useState(null);return S.useEffect(()=>{let m=null,v=null;a?(m="node",v=r(a)):i?(m="node",v=r(i)):l?(m="edge",v=n(l,!0)):s&&(m="edge",v=n(s,!0)),v?(m=="node"?f(bz(v)):f(wz(v)),g(m)):(f(null),g(null))},[a,i,l,s,f,g,r,n]),c?A.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:d=="node"?A.jsx(Ez,{node:c}):A.jsx(Sz,{edge:c})}):A.jsx(A.Fragment,{})},bz=r=>{const n=Ye.getState(),i=[];if(n.sigmaGraph&&n.rawGraph)for(const a of n.sigmaGraph.edges(r.id)){const s=n.rawGraph.getEdge(a,!0);if(s){const l=r.id===s.source,c=l?s.target:s.source,f=n.rawGraph.getNode(c);f&&i.push({type:l?"Target":"Source",id:c,label:f.labels.join(", ")})}}return{...r,relationships:i}},wz=r=>{var s,l;const n=Ye.getState(),i=(s=n.rawGraph)==null?void 0:s.getNode(r.source),a=(l=n.rawGraph)==null?void 0:l.getNode(r.target);return{...r,sourceNode:i,targetNode:a}},$n=({name:r,value:n,onClick:i,tooltip:a})=>A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx("label",{className:"text-primary/60 tracking-wide",children:r}),":",A.jsx(vz,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:n,tooltip:a||n,side:"left",onClick:i})]}),Ez=({node:r})=>A.jsxs("div",{className:"flex flex-col gap-2",children:[A.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),A.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[A.jsx($n,{name:"Id",value:r.id}),A.jsx($n,{name:"Labels",value:r.labels.join(", "),onClick:()=>{Ye.getState().setSelectedNode(r.id,!0)}}),A.jsx($n,{name:"Degree",value:r.degree})]}),A.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),A.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(r.properties).sort().map(n=>A.jsx($n,{name:n,value:r.properties[n]},n))}),r.relationships.length>0&&A.jsxs(A.Fragment,{children:[A.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),A.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:r.relationships.map(({type:n,id:i,label:a})=>A.jsx($n,{name:n,value:a,onClick:()=>{Ye.getState().setSelectedNode(i,!0)}},i))})]})]}),Sz=({edge:r})=>A.jsxs("div",{className:"flex flex-col gap-2",children:[A.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),A.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[A.jsx($n,{name:"Id",value:r.id}),A.jsx($n,{name:"Type",value:r.type}),A.jsx($n,{name:"Source",value:r.sourceNode?r.sourceNode.labels.join(", "):r.source,onClick:()=>{Ye.getState().setSelectedNode(r.source,!0)}}),A.jsx($n,{name:"Target",value:r.targetNode?r.targetNode.labels.join(", "):r.target,onClick:()=>{Ye.getState().setSelectedNode(r.target,!0)}})]}),A.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),A.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(r.properties).sort().map(n=>A.jsx($n,{name:n,value:r.properties[n]},n))})]}),a0={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:Qw,curvedArrow:uk,curvedNoArrow:lk},nodeProgramClasses:{default:VO,circel:us,point:bO},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},xz=()=>{const r=oE(),n=Sn(),[i,a]=S.useState(null);return S.useEffect(()=>{r({downNode:s=>{a(s.node),n.getGraph().setNodeAttribute(s.node,"highlighted",!0)},mousemovebody:s=>{if(!i)return;const l=n.viewportToGraph(s);n.getGraph().setNodeAttribute(i,"x",l.x),n.getGraph().setNodeAttribute(i,"y",l.y),s.preventSigmaDefault(),s.original.preventDefault(),s.original.stopPropagation()},mouseup:()=>{i&&(a(null),n.getGraph().removeNodeAttribute(i,"highlighted"))},mousedown:()=>{n.getCustomBBox()||n.setCustomBBox(n.getBBox())}})},[r,n,i]),null},_z=()=>{const[r,n]=S.useState(a0),i=Ye.use.selectedNode(),a=Ye.use.focusedNode(),s=Ye.use.moveToSelectedNode(),l=Pe.use.showPropertyPanel(),c=Pe.use.showNodeSearchBar(),f=Pe.use.showNodeLabel(),d=Pe.use.enableEdgeEvents(),g=Pe.use.enableNodeDrag(),m=Pe.use.showEdgeLabel();S.useEffect(()=>{n({...a0,enableEdgeEvents:d,renderEdgeLabels:m,renderLabels:f})},[f,d,m]);const v=S.useCallback(E=>{E===null?Ye.getState().setFocusedNode(null):E.type==="nodes"&&Ye.getState().setFocusedNode(E.id)},[]),y=S.useCallback(E=>{E===null?Ye.getState().setSelectedNode(null):E.type==="nodes"&&Ye.getState().setSelectedNode(E.id,!0)},[]),b=S.useMemo(()=>a??i,[a,i]),x=S.useMemo(()=>i?{type:"nodes",id:i}:null,[i]);return A.jsxs(hO,{settings:r,className:"!bg-background !size-full overflow-hidden",children:[A.jsx(zN,{}),g&&A.jsx(xz,{}),A.jsx(dk,{node:b,move:s}),A.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[A.jsx(mz,{}),c&&A.jsx(hz,{value:x,onFocus:v,onChange:y})]}),A.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[A.jsx(YN,{}),A.jsx(MN,{}),A.jsx(cN,{}),A.jsx(jN,{}),A.jsx(GN,{})]}),l&&A.jsx("div",{className:"absolute top-2 right-2",children:A.jsx(yz,{})})]})};function Tz(){const r=kn.use.message(),n=Pe.use.enableHealthCheck();return S.useEffect(()=>{if(!n)return;kn.getState().check();const i=setInterval(async()=>{await kn.getState().check()},fT*1e3);return()=>clearInterval(i)},[n]),A.jsxs(gT,{children:[A.jsx("div",{className:"h-screen w-screen",children:A.jsx(_z,{})}),n&&A.jsx(MA,{}),r!==null&&A.jsx(nC,{})]})}s_.createRoot(document.getElementById("root")).render(A.jsx(S.StrictMode,{children:A.jsx(Tz,{})})); diff --git a/lightrag/api/webui/assets/index-CLgSwrjG.css b/lightrag/api/webui/assets/index-CLgSwrjG.css new file mode 100644 index 00000000..0a63c408 --- /dev/null +++ b/lightrag/api/webui/assets/index-CLgSwrjG.css @@ -0,0 +1 @@ +/*! tailwindcss v4.0.6 | MIT License | https://tailwindcss.com */@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-serif:ui-serif,Georgia,Cambria,"Times New Roman",Times,serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(.971 .013 17.38);--color-red-100:oklch(.936 .032 17.717);--color-red-200:oklch(.885 .062 18.334);--color-red-300:oklch(.808 .114 19.571);--color-red-400:oklch(.704 .191 22.216);--color-red-500:oklch(.637 .237 25.331);--color-red-600:oklch(.577 .245 27.325);--color-red-700:oklch(.505 .213 27.518);--color-red-800:oklch(.444 .177 26.899);--color-red-900:oklch(.396 .141 25.723);--color-red-950:oklch(.258 .092 26.042);--color-orange-50:oklch(.98 .016 73.684);--color-orange-100:oklch(.954 .038 75.164);--color-orange-200:oklch(.901 .076 70.697);--color-orange-300:oklch(.837 .128 66.29);--color-orange-400:oklch(.75 .183 55.934);--color-orange-500:oklch(.705 .213 47.604);--color-orange-600:oklch(.646 .222 41.116);--color-orange-700:oklch(.553 .195 38.402);--color-orange-800:oklch(.47 .157 37.304);--color-orange-900:oklch(.408 .123 38.172);--color-orange-950:oklch(.266 .079 36.259);--color-amber-50:oklch(.987 .022 95.277);--color-amber-100:oklch(.962 .059 95.617);--color-amber-200:oklch(.924 .12 95.746);--color-amber-300:oklch(.879 .169 91.605);--color-amber-400:oklch(.828 .189 84.429);--color-amber-500:oklch(.769 .188 70.08);--color-amber-600:oklch(.666 .179 58.318);--color-amber-700:oklch(.555 .163 48.998);--color-amber-800:oklch(.473 .137 46.201);--color-amber-900:oklch(.414 .112 45.904);--color-amber-950:oklch(.279 .077 45.635);--color-yellow-50:oklch(.987 .026 102.212);--color-yellow-100:oklch(.973 .071 103.193);--color-yellow-200:oklch(.945 .129 101.54);--color-yellow-300:oklch(.905 .182 98.111);--color-yellow-400:oklch(.852 .199 91.936);--color-yellow-500:oklch(.795 .184 86.047);--color-yellow-600:oklch(.681 .162 75.834);--color-yellow-700:oklch(.554 .135 66.442);--color-yellow-800:oklch(.476 .114 61.907);--color-yellow-900:oklch(.421 .095 57.708);--color-yellow-950:oklch(.286 .066 53.813);--color-lime-50:oklch(.986 .031 120.757);--color-lime-100:oklch(.967 .067 122.328);--color-lime-200:oklch(.938 .127 124.321);--color-lime-300:oklch(.897 .196 126.665);--color-lime-400:oklch(.841 .238 128.85);--color-lime-500:oklch(.768 .233 130.85);--color-lime-600:oklch(.648 .2 131.684);--color-lime-700:oklch(.532 .157 131.589);--color-lime-800:oklch(.453 .124 130.933);--color-lime-900:oklch(.405 .101 131.063);--color-lime-950:oklch(.274 .072 132.109);--color-green-50:oklch(.982 .018 155.826);--color-green-100:oklch(.962 .044 156.743);--color-green-200:oklch(.925 .084 155.995);--color-green-300:oklch(.871 .15 154.449);--color-green-400:oklch(.792 .209 151.711);--color-green-500:oklch(.723 .219 149.579);--color-green-600:oklch(.627 .194 149.214);--color-green-700:oklch(.527 .154 150.069);--color-green-800:oklch(.448 .119 151.328);--color-green-900:oklch(.393 .095 152.535);--color-green-950:oklch(.266 .065 152.934);--color-emerald-50:oklch(.979 .021 166.113);--color-emerald-100:oklch(.95 .052 163.051);--color-emerald-200:oklch(.905 .093 164.15);--color-emerald-300:oklch(.845 .143 164.978);--color-emerald-400:oklch(.765 .177 163.223);--color-emerald-500:oklch(.696 .17 162.48);--color-emerald-600:oklch(.596 .145 163.225);--color-emerald-700:oklch(.508 .118 165.612);--color-emerald-800:oklch(.432 .095 166.913);--color-emerald-900:oklch(.378 .077 168.94);--color-emerald-950:oklch(.262 .051 172.552);--color-teal-50:oklch(.984 .014 180.72);--color-teal-100:oklch(.953 .051 180.801);--color-teal-200:oklch(.91 .096 180.426);--color-teal-300:oklch(.855 .138 181.071);--color-teal-400:oklch(.777 .152 181.912);--color-teal-500:oklch(.704 .14 182.503);--color-teal-600:oklch(.6 .118 184.704);--color-teal-700:oklch(.511 .096 186.391);--color-teal-800:oklch(.437 .078 188.216);--color-teal-900:oklch(.386 .063 188.416);--color-teal-950:oklch(.277 .046 192.524);--color-cyan-50:oklch(.984 .019 200.873);--color-cyan-100:oklch(.956 .045 203.388);--color-cyan-200:oklch(.917 .08 205.041);--color-cyan-300:oklch(.865 .127 207.078);--color-cyan-400:oklch(.789 .154 211.53);--color-cyan-500:oklch(.715 .143 215.221);--color-cyan-600:oklch(.609 .126 221.723);--color-cyan-700:oklch(.52 .105 223.128);--color-cyan-800:oklch(.45 .085 224.283);--color-cyan-900:oklch(.398 .07 227.392);--color-cyan-950:oklch(.302 .056 229.695);--color-sky-50:oklch(.977 .013 236.62);--color-sky-100:oklch(.951 .026 236.824);--color-sky-200:oklch(.901 .058 230.902);--color-sky-300:oklch(.828 .111 230.318);--color-sky-400:oklch(.746 .16 232.661);--color-sky-500:oklch(.685 .169 237.323);--color-sky-600:oklch(.588 .158 241.966);--color-sky-700:oklch(.5 .134 242.749);--color-sky-800:oklch(.443 .11 240.79);--color-sky-900:oklch(.391 .09 240.876);--color-sky-950:oklch(.293 .066 243.157);--color-blue-50:oklch(.97 .014 254.604);--color-blue-100:oklch(.932 .032 255.585);--color-blue-200:oklch(.882 .059 254.128);--color-blue-300:oklch(.809 .105 251.813);--color-blue-400:oklch(.707 .165 254.624);--color-blue-500:oklch(.623 .214 259.815);--color-blue-600:oklch(.546 .245 262.881);--color-blue-700:oklch(.488 .243 264.376);--color-blue-800:oklch(.424 .199 265.638);--color-blue-900:oklch(.379 .146 265.522);--color-blue-950:oklch(.282 .091 267.935);--color-indigo-50:oklch(.962 .018 272.314);--color-indigo-100:oklch(.93 .034 272.788);--color-indigo-200:oklch(.87 .065 274.039);--color-indigo-300:oklch(.785 .115 274.713);--color-indigo-400:oklch(.673 .182 276.935);--color-indigo-500:oklch(.585 .233 277.117);--color-indigo-600:oklch(.511 .262 276.966);--color-indigo-700:oklch(.457 .24 277.023);--color-indigo-800:oklch(.398 .195 277.366);--color-indigo-900:oklch(.359 .144 278.697);--color-indigo-950:oklch(.257 .09 281.288);--color-violet-50:oklch(.969 .016 293.756);--color-violet-100:oklch(.943 .029 294.588);--color-violet-200:oklch(.894 .057 293.283);--color-violet-300:oklch(.811 .111 293.571);--color-violet-400:oklch(.702 .183 293.541);--color-violet-500:oklch(.606 .25 292.717);--color-violet-600:oklch(.541 .281 293.009);--color-violet-700:oklch(.491 .27 292.581);--color-violet-800:oklch(.432 .232 292.759);--color-violet-900:oklch(.38 .189 293.745);--color-violet-950:oklch(.283 .141 291.089);--color-purple-50:oklch(.977 .014 308.299);--color-purple-100:oklch(.946 .033 307.174);--color-purple-200:oklch(.902 .063 306.703);--color-purple-300:oklch(.827 .119 306.383);--color-purple-400:oklch(.714 .203 305.504);--color-purple-500:oklch(.627 .265 303.9);--color-purple-600:oklch(.558 .288 302.321);--color-purple-700:oklch(.496 .265 301.924);--color-purple-800:oklch(.438 .218 303.724);--color-purple-900:oklch(.381 .176 304.987);--color-purple-950:oklch(.291 .149 302.717);--color-fuchsia-50:oklch(.977 .017 320.058);--color-fuchsia-100:oklch(.952 .037 318.852);--color-fuchsia-200:oklch(.903 .076 319.62);--color-fuchsia-300:oklch(.833 .145 321.434);--color-fuchsia-400:oklch(.74 .238 322.16);--color-fuchsia-500:oklch(.667 .295 322.15);--color-fuchsia-600:oklch(.591 .293 322.896);--color-fuchsia-700:oklch(.518 .253 323.949);--color-fuchsia-800:oklch(.452 .211 324.591);--color-fuchsia-900:oklch(.401 .17 325.612);--color-fuchsia-950:oklch(.293 .136 325.661);--color-pink-50:oklch(.971 .014 343.198);--color-pink-100:oklch(.948 .028 342.258);--color-pink-200:oklch(.899 .061 343.231);--color-pink-300:oklch(.823 .12 346.018);--color-pink-400:oklch(.718 .202 349.761);--color-pink-500:oklch(.656 .241 354.308);--color-pink-600:oklch(.592 .249 .584);--color-pink-700:oklch(.525 .223 3.958);--color-pink-800:oklch(.459 .187 3.815);--color-pink-900:oklch(.408 .153 2.432);--color-pink-950:oklch(.284 .109 3.907);--color-rose-50:oklch(.969 .015 12.422);--color-rose-100:oklch(.941 .03 12.58);--color-rose-200:oklch(.892 .058 10.001);--color-rose-300:oklch(.81 .117 11.638);--color-rose-400:oklch(.712 .194 13.428);--color-rose-500:oklch(.645 .246 16.439);--color-rose-600:oklch(.586 .253 17.585);--color-rose-700:oklch(.514 .222 16.935);--color-rose-800:oklch(.455 .188 13.697);--color-rose-900:oklch(.41 .159 10.272);--color-rose-950:oklch(.271 .105 12.094);--color-slate-50:oklch(.984 .003 247.858);--color-slate-100:oklch(.968 .007 247.896);--color-slate-200:oklch(.929 .013 255.508);--color-slate-300:oklch(.869 .022 252.894);--color-slate-400:oklch(.704 .04 256.788);--color-slate-500:oklch(.554 .046 257.417);--color-slate-600:oklch(.446 .043 257.281);--color-slate-700:oklch(.372 .044 257.287);--color-slate-800:oklch(.279 .041 260.031);--color-slate-900:oklch(.208 .042 265.755);--color-slate-950:oklch(.129 .042 264.695);--color-gray-50:oklch(.985 .002 247.839);--color-gray-100:oklch(.967 .003 264.542);--color-gray-200:oklch(.928 .006 264.531);--color-gray-300:oklch(.872 .01 258.338);--color-gray-400:oklch(.707 .022 261.325);--color-gray-500:oklch(.551 .027 264.364);--color-gray-600:oklch(.446 .03 256.802);--color-gray-700:oklch(.373 .034 259.733);--color-gray-800:oklch(.278 .033 256.848);--color-gray-900:oklch(.21 .034 264.665);--color-gray-950:oklch(.13 .028 261.692);--color-zinc-50:oklch(.985 0 0);--color-zinc-100:oklch(.967 .001 286.375);--color-zinc-200:oklch(.92 .004 286.32);--color-zinc-300:oklch(.871 .006 286.286);--color-zinc-400:oklch(.705 .015 286.067);--color-zinc-500:oklch(.552 .016 285.938);--color-zinc-600:oklch(.442 .017 285.786);--color-zinc-700:oklch(.37 .013 285.805);--color-zinc-800:oklch(.274 .006 286.033);--color-zinc-900:oklch(.21 .006 285.885);--color-zinc-950:oklch(.141 .005 285.823);--color-neutral-50:oklch(.985 0 0);--color-neutral-100:oklch(.97 0 0);--color-neutral-200:oklch(.922 0 0);--color-neutral-300:oklch(.87 0 0);--color-neutral-400:oklch(.708 0 0);--color-neutral-500:oklch(.556 0 0);--color-neutral-600:oklch(.439 0 0);--color-neutral-700:oklch(.371 0 0);--color-neutral-800:oklch(.269 0 0);--color-neutral-900:oklch(.205 0 0);--color-neutral-950:oklch(.145 0 0);--color-stone-50:oklch(.985 .001 106.423);--color-stone-100:oklch(.97 .001 106.424);--color-stone-200:oklch(.923 .003 48.717);--color-stone-300:oklch(.869 .005 56.366);--color-stone-400:oklch(.709 .01 56.259);--color-stone-500:oklch(.553 .013 58.071);--color-stone-600:oklch(.444 .011 73.639);--color-stone-700:oklch(.374 .01 67.558);--color-stone-800:oklch(.268 .007 34.298);--color-stone-900:oklch(.216 .006 56.043);--color-stone-950:oklch(.147 .004 49.25);--color-black:#000;--color-white:#fff;--spacing:.25rem;--breakpoint-sm:40rem;--breakpoint-md:48rem;--breakpoint-lg:64rem;--breakpoint-xl:80rem;--breakpoint-2xl:96rem;--container-3xs:16rem;--container-2xs:18rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--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: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--text-7xl:4.5rem;--text-7xl--line-height:1;--text-8xl:6rem;--text-8xl--line-height:1;--text-9xl:8rem;--text-9xl--line-height:1;--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--leading-loose:2;--radius-xs:.125rem;--radius-sm:calc(var(--radius) - 4px);--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--radius-xl:calc(var(--radius) + 4px);--radius-2xl:1rem;--radius-3xl:1.5rem;--radius-4xl:2rem;--shadow-2xs:0 1px #0000000d;--shadow-xs:0 1px 2px 0 #0000000d;--shadow-sm:0 1px 3px 0 #0000001a,0 1px 2px -1px #0000001a;--shadow-md:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;--shadow-lg:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;--shadow-xl:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a;--shadow-2xl:0 25px 50px -12px #00000040;--inset-shadow-2xs:inset 0 1px #0000000d;--inset-shadow-xs:inset 0 1px 1px #0000000d;--inset-shadow-sm:inset 0 2px 4px #0000000d;--drop-shadow-xs:0 1px 1px #0000000d;--drop-shadow-sm:0 1px 2px #00000026;--drop-shadow-md:0 3px 3px #0000001f;--drop-shadow-lg:0 4px 4px #00000026;--drop-shadow-xl:0 9px 7px #0000001a;--drop-shadow-2xl:0 25px 25px #00000026;--ease-in:cubic-bezier(.4,0,1,1);--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--animate-bounce:bounce 1s infinite;--blur-xs:4px;--blur-sm:8px;--blur-md:12px;--blur-lg:16px;--blur-xl:24px;--blur-2xl:40px;--blur-3xl:64px;--perspective-dramatic:100px;--perspective-near:300px;--perspective-normal:500px;--perspective-midrange:800px;--perspective-distant:1200px;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-font-feature-settings:var(--font-sans--font-feature-settings);--default-font-variation-settings:var(--font-sans--font-variation-settings);--default-mono-font-family:var(--font-mono);--default-mono-font-feature-settings:var(--font-mono--font-feature-settings);--default-mono-font-variation-settings:var(--font-mono--font-variation-settings);--color-background:var(--background);--color-foreground:var(--foreground);--color-card:var(--card);--color-card-foreground:var(--card-foreground);--color-popover:var(--popover);--color-popover-foreground:var(--popover-foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-secondary:var(--secondary);--color-secondary-foreground:var(--secondary-foreground);--color-muted:var(--muted);--color-muted-foreground:var(--muted-foreground);--color-accent:var(--accent);--color-accent-foreground:var(--accent-foreground);--color-destructive:var(--destructive);--color-destructive-foreground:var(--destructive-foreground);--color-border:var(--border);--color-input:var(--input);--color-ring:var(--ring);--color-chart-1:var(--chart-1);--color-chart-2:var(--chart-2);--color-chart-3:var(--chart-3);--color-chart-4:var(--chart-4);--color-chart-5:var(--chart-5);--color-sidebar-ring:var(--sidebar-ring);--color-sidebar-border:var(--sidebar-border);--color-sidebar-accent-foreground:var(--sidebar-accent-foreground);--color-sidebar-accent:var(--sidebar-accent);--color-sidebar-primary-foreground:var(--sidebar-primary-foreground);--color-sidebar-primary:var(--sidebar-primary);--color-sidebar-foreground:var(--sidebar-foreground);--color-sidebar:var(--sidebar-background);--animate-accordion-down:accordion-down .2s ease-out;--animate-accordion-up:accordion-up .2s ease-out}}@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%;-moz-tab-size:4;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}body{line-height:inherit}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;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;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}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance: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:color-mix(in oklab,var(--ring)50%,transparent)}body{background-color:var(--background);color:var(--foreground)}*{scrollbar-color:initial;scrollbar-width:initial}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.top-4{top:calc(var(--spacing)*4)}.top-12{top:calc(var(--spacing)*12)}.top-\[50\%\]{top:50%}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.right-4{right:calc(var(--spacing)*4)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-2{bottom:calc(var(--spacing)*2)}.bottom-4{bottom:calc(var(--spacing)*4)}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.z-50{z-index:50}.\!container{width:100%!important}@media (width>=40rem){.\!container{max-width:40rem!important}}@media (width>=48rem){.\!container{max-width:48rem!important}}@media (width>=64rem){.\!container{max-width:64rem!important}}@media (width>=80rem){.\!container{max-width:80rem!important}}@media (width>=96rem){.\!container{max-width:96rem!important}}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.\!m-0{margin:calc(var(--spacing)*0)!important}.m-0{margin:calc(var(--spacing)*0)}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-1{margin-inline:calc(var(--spacing)*1)}.my-1{margin-block:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-4{margin-right:calc(var(--spacing)*4)}.mr-6{margin-right:calc(var(--spacing)*6)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.scrollbar{scrollbar-width:auto;scrollbar-color:var(--scrollbar-thumb,initial)var(--scrollbar-track,initial)}.scrollbar::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.scrollbar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.scrollbar::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.scrollbar::-webkit-scrollbar{width:var(--scrollbar-width,16px);height:var(--scrollbar-height,16px);display:block}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.table{display:table}.aspect-square{aspect-ratio:1}.\!size-full{width:100%!important;height:100%!important}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.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-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.size-full{width:100%;height:100%}.h-1\/2{height:50%}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11{height:calc(var(--spacing)*11)}.h-52{height:calc(var(--spacing)*52)}.h-\[1px\]{height:1px}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-fit{height:fit-content}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-8{max-height:calc(var(--spacing)*8)}.max-h-48{max-height:calc(var(--spacing)*48)}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[300px\]{max-height:300px}.max-h-full{max-height:100%}.min-h-0{min-height:calc(var(--spacing)*0)}.w-0{width:calc(var(--spacing)*0)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-6{width:calc(var(--spacing)*6)}.w-16{width:calc(var(--spacing)*16)}.w-24{width:calc(var(--spacing)*24)}.w-\[1px\]{width:1px}.w-auto{width:auto}.w-full{width:100%}.w-screen{width:100vw}.max-w-80{max-width:calc(var(--spacing)*80)}.max-w-\[80\%\]{max-width:80%}.max-w-lg{max-width:var(--container-lg)}.max-w-none{max-width:none}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-24{min-width:calc(var(--spacing)*24)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[300px\]{min-width:300px}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.flex-auto{flex:auto}.flex-shrink,.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-20{--tw-translate-y:calc(var(--spacing)*-20);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-0{--tw-translate-y:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-125{--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.transform{transform:var(--tw-rotate-x)var(--tw-rotate-y)var(--tw-rotate-z)var(--tw-skew-x)var(--tw-skew-y)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.\[appearance\:textfield\]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.columns-2{columns:2}.columns-3{columns:3}.columns-4{columns:4}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.place-items-center{place-items:center}.items-center{align-items:center}.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-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-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-px{gap:1px}: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)))}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.\!rounded-none{border-radius:0!important}.rounded{border-radius:.25rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-tr-none{border-top-right-radius:0}.rounded-br-none{border-bottom-right-radius:0}.border,.border-1{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.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{border-left-style:var(--tw-border-style);border-left-width:1px}.\!border-none{--tw-border-style:none!important;border-style:none!important}.border-dashed{--tw-border-style:dashed;border-style:dashed}.\!border-input{border-color:var(--input)!important}.border-border\/40{border-color:color-mix(in oklab,var(--border)40%,transparent)}.border-destructive\/50{border-color:color-mix(in oklab,var(--destructive)50%,transparent)}.border-input{border-color:var(--input)}.border-muted-foreground\/25{border-color:color-mix(in oklab,var(--muted-foreground)25%,transparent)}.border-muted-foreground\/50{border-color:color-mix(in oklab,var(--muted-foreground)50%,transparent)}.border-primary{border-color:var(--primary)}.border-t-transparent{border-top-color:#0000}.border-l-transparent{border-left-color:#0000}.\!bg-background{background-color:var(--background)!important}.\!bg-emerald-400{background-color:var(--color-emerald-400)!important}.bg-background{background-color:var(--background)}.bg-background\/60{background-color:color-mix(in oklab,var(--background)60%,transparent)}.bg-background\/80{background-color:color-mix(in oklab,var(--background)80%,transparent)}.bg-background\/90{background-color:color-mix(in oklab,var(--background)90%,transparent)}.bg-background\/95{background-color:color-mix(in oklab,var(--background)95%,transparent)}.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive{background-color:var(--destructive)}.bg-foreground\/10{background-color:color-mix(in oklab,var(--foreground)10%,transparent)}.bg-green-500{background-color:var(--color-green-500)}.bg-muted{background-color:var(--muted)}.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-primary-foreground\/60{background-color:color-mix(in oklab,var(--primary-foreground)60%,transparent)}.bg-primary\/5{background-color:color-mix(in oklab,var(--primary)5%,transparent)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-700{background-color:var(--color-red-700)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.object-cover{object-fit:cover}.\!p-0{padding:calc(var(--spacing)*0)!important}.\!p-2{padding:calc(var(--spacing)*2)!important}.p-0{padding:calc(var(--spacing)*0)}.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-6{padding:calc(var(--spacing)*6)}.p-16{padding:calc(var(--spacing)*16)}.p-\[1px\]{padding:1px}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-8{padding-inline:calc(var(--spacing)*8)}.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-6{padding-block:calc(var(--spacing)*6)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-2{padding-right:calc(var(--spacing)*2)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-12{padding-bottom:calc(var(--spacing)*12)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-8{padding-left:calc(var(--spacing)*8)}.text-center{text-align:center}.text-left{text-align:left}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.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-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.\!text-zinc-50{color:var(--color-zinc-50)!important}.text-blue-600{color:var(--color-blue-600)}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentColor}.text-destructive{color:var(--destructive)}.text-destructive-foreground{color:var(--destructive-foreground)}.text-emerald-400{color:var(--color-emerald-400)}.text-foreground{color:var(--foreground)}.text-foreground\/80{color:color-mix(in oklab,var(--foreground)80%,transparent)}.text-green-600{color:var(--color-green-600)}.text-muted{color:var(--muted)}.text-muted-foreground{color:var(--muted-foreground)}.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-primary\/60{color:color-mix(in oklab,var(--primary)60%,transparent)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sky-300{color:var(--color-sky-300)}.text-teal-600{color:var(--color-teal-600)}.text-teal-600\/90{color:color-mix(in oklab,var(--color-teal-600)90%,transparent)}.text-white{color:var(--color-white)}.text-yellow-400\/90{color:color-mix(in oklab,var(--color-yellow-400)90%,transparent)}.text-yellow-600{color:var(--color-yellow-600)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(34\,197\,94\,0\.4\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#22c55e66);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(239\,68\,68\,0\.4\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#ef444466);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.\!filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)!important}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-lg{--tw-backdrop-blur:blur(var(--blur-lg));-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;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))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-2000{--tw-duration:2s;transition-duration:2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.animate-in{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.duration-2000{animation-duration:2s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.paused{animation-play-state:paused}.repeat-1{animation-iteration-count:1}.running{animation-play-state:running}.select-none{-webkit-user-select:none;user-select:none}.zoom-in{--tw-enter-scale:0}.zoom-in-95{--tw-enter-scale:.95}.zoom-out{--tw-exit-scale:0}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.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)}@media (hover:hover){.hover\:w-fit:hover{width:fit-content}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-background\/60:hover{background-color:color-mix(in oklab,var(--background)60%,transparent)}.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}.hover\:bg-muted\/25:hover{background-color:color-mix(in oklab,var(--muted)25%,transparent)}.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted)50%,transparent)}.hover\:bg-primary\/5:hover{background-color:color-mix(in oklab,var(--primary)5%,transparent)}.hover\:bg-primary\/20:hover{background-color:color-mix(in oklab,var(--primary)20%,transparent)}.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-0:focus{--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)}.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:focus{--tw-ring-color:var(--ring)}.focus\:ring-offset-0:focus{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-0:focus{outline-style:var(--tw-outline-style);outline-width:0}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:relative:focus-visible{position:relative}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--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-visible\:ring-ring:focus-visible{--tw-ring-color:var(--ring)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:right-0:active{right:calc(var(--spacing)*0)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[selected\=\'true\'\]\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-.5rem}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:.5rem}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-.5rem}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:.5rem}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--background)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--foreground)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-out[data-state=closed]{--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial;animation-name:exit;animation-duration:.15s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:animate-in[data-state=open]{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y:-48%}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}@supports ((-webkit-backdrop-filter:var(--tw)) or (backdrop-filter:var(--tw))){.supports-\[backdrop-filter\]\:bg-background\/60{background-color:color-mix(in oklab,var(--background)60%,transparent)}}@media (width>=40rem){.sm\:mt-0{margin-top:calc(var(--spacing)*0)}.sm\:max-w-xl{max-width:var(--container-xl)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:px-5{padding-inline:calc(var(--spacing)*5)}.sm\:text-left{text-align:left}}@media (width>=48rem){.md\:inline-block{display:inline-block}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.dark\:border-destructive:is(.dark *){border-color:var(--destructive)}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing)*1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--spacing)*0)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing)*5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing)*5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing)*12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing)*2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing)*3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing)*5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing)*5)}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_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}.\[\&\:\:-webkit-inner-spin-button\]\:appearance-none::-webkit-inner-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\:\:-webkit-outer-spin-button\]\:appearance-none::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:top-4>svg{top:calc(var(--spacing)*4)}.\[\&\>svg\]\:left-4>svg{left:calc(var(--spacing)*4)}.\[\&\>svg\]\:text-destructive>svg{color:var(--destructive)}.\[\&\>svg\]\:text-foreground>svg{color:var(--foreground)}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y:-3px;translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:calc(var(--spacing)*7)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}}:root{--background:#fff;--foreground:#09090b;--card:#fff;--card-foreground:#09090b;--popover:#fff;--popover-foreground:#09090b;--primary:#18181b;--primary-foreground:#fafafa;--secondary:#f4f4f5;--secondary-foreground:#18181b;--muted:#f4f4f5;--muted-foreground:#71717a;--accent:#f4f4f5;--accent-foreground:#18181b;--destructive:#ef4444;--destructive-foreground:#fafafa;--border:#e4e4e7;--input:#e4e4e7;--ring:#09090b;--chart-1:#e76e50;--chart-2:#2a9d90;--chart-3:#274754;--chart-4:#e8c468;--chart-5:#f4a462;--radius:.6rem;--sidebar-background:#fafafa;--sidebar-foreground:#3f3f46;--sidebar-primary:#18181b;--sidebar-primary-foreground:#fafafa;--sidebar-accent:#f4f4f5;--sidebar-accent-foreground:#18181b;--sidebar-border:#e5e7eb;--sidebar-ring:#3b82f6}.dark{--background:#09090b;--foreground:#fafafa;--card:#09090b;--card-foreground:#fafafa;--popover:#09090b;--popover-foreground:#fafafa;--primary:#fafafa;--primary-foreground:#18181b;--secondary:#27272a;--secondary-foreground:#fafafa;--muted:#27272a;--muted-foreground:#a1a1aa;--accent:#27272a;--accent-foreground:#fafafa;--destructive:#7f1d1d;--destructive-foreground:#fafafa;--border:#27272a;--input:#27272a;--ring:#d4d4d8;--chart-1:#2662d9;--chart-2:#2eb88a;--chart-3:#e88c30;--chart-4:#af57db;--chart-5:#e23670;--sidebar-background:#18181b;--sidebar-foreground:#f4f4f5;--sidebar-primary:#1d4ed8;--sidebar-primary-foreground:#fff;--sidebar-accent:#27272a;--sidebar-accent-foreground:#f4f4f5;--sidebar-border:#27272a;--sidebar-ring:#3b82f6}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}.dark ::-webkit-scrollbar-thumb{background-color:#e6e6e6}.dark ::-webkit-scrollbar-track{background-color:#000}@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))}}@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))}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}@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 accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false;initial-value:rotateX(0)}@property --tw-rotate-y{syntax:"*";inherits:false;initial-value:rotateY(0)}@property --tw-rotate-z{syntax:"*";inherits:false;initial-value:rotateZ(0)}@property --tw-skew-x{syntax:"*";inherits:false;initial-value:skewX(0)}@property --tw-skew-y{syntax:"*";inherits:false;initial-value:skewY(0)}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-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-space-x-reverse{syntax:"*";inherits:false;initial-value:0}:root{--sigma-background-color:#fff;--sigma-controls-background-color:#fff;--sigma-controls-background-color-hover:rgba(0,0,0,.2);--sigma-controls-border-color:rgba(0,0,0,.2);--sigma-controls-color:#000;--sigma-controls-zindex:100;--sigma-controls-margin:5px;--sigma-controls-size:30px}div.react-sigma{height:100%;width:100%;position:relative;background:var(--sigma-background-color)}div.sigma-container{height:100%;width:100%}.react-sigma-controls{position:absolute;z-index:var(--sigma-controls-zindex);border:2px solid var(--sigma-controls-border-color);border-radius:4px;color:var(--sigma-controls-color);background-color:var(--sigma-controls-background-color)}.react-sigma-controls.bottom-right{bottom:var(--sigma-controls-margin);right:var(--sigma-controls-margin)}.react-sigma-controls.bottom-left{bottom:var(--sigma-controls-margin);left:var(--sigma-controls-margin)}.react-sigma-controls.top-right{top:var(--sigma-controls-margin);right:var(--sigma-controls-margin)}.react-sigma-controls.top-left{top:var(--sigma-controls-margin);left:var(--sigma-controls-margin)}.react-sigma-controls:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.react-sigma-controls:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.react-sigma-control{width:var(--sigma-controls-size);height:var(--sigma-controls-size);line-height:var(--sigma-controls-size);background-color:var(--sigma-controls-background-color);border-bottom:1px solid var(--sigma-controls-border-color)}.react-sigma-control:last-child{border-bottom:none}.react-sigma-control>*{box-sizing:border-box}.react-sigma-control>button{display:block;border:none;margin:0;padding:0;width:var(--sigma-controls-size);height:var(--sigma-controls-size);line-height:var(--sigma-controls-size);background-position:center;background-size:50%;background-repeat:no-repeat;background-color:var(--sigma-controls-background-color);clip:rect(0,0,0,0)}.react-sigma-control>button:hover{background-color:var(--sigma-controls-background-color-hover)}.react-sigma-search{background-color:var(--sigma-controls-background-color)}.react-sigma-search label{visibility:hidden}.react-sigma-search input{color:var(--sigma-controls-color);background-color:var(--sigma-controls-background-color);font-size:1em;width:100%;margin:0;border:none;padding:var(--sigma-controls-margin);box-sizing:border-box}:root{--sigma-grey-color:#ccc}.react-sigma .option.hoverable{cursor:pointer!important}.react-sigma .text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.react-sigma .react-select__clear-indicator{cursor:pointer!important}.react-sigma .text-muted{color:var(--sigma-grey-color)}.react-sigma .text-italic{font-style:italic}.react-sigma .text-center{text-align:center}.react-sigma .graph-search{min-width:250px}.react-sigma .graph-search .option{padding:2px 8px}.react-sigma .graph-search .dropdown-indicator{font-size:1.25em;padding:4px}.react-sigma .graph-search .option.selected{background-color:var(--sigma-grey-color)}.react-sigma .node .render{position:relative;display:inline-block;width:1em;height:1em;border-radius:1em;background-color:var(--sigma-grey-color);margin-right:8px}.react-sigma .node{display:flex;flex-direction:row;align-items:center}.react-sigma .node .render{flex-grow:0;flex-shrink:0;margin-right:0 .25em}.react-sigma .node .label{flex-grow:1;flex-shrink:1}.react-sigma .edge{display:flex;flex-direction:column;align-items:flex-start;flex-grow:0;flex-shrink:0;flex-wrap:nowrap}.react-sigma .edge .node{font-size:.7em}.react-sigma .edge .body{display:flex;flex-direction:row;flex-grow:1;flex-shrink:1;min-height:.6em}.react-sigma .edge .body .render{display:flex;flex-direction:column;margin:0 2px}.react-sigma .edge .body .render .dash,.react-sigma .edge .body .render .dotted{display:inline-block;width:0;margin:0 2px;border:2px solid #ccc;flex-grow:1;flex-shrink:1}.react-sigma .edge .body .render .dotted{border-style:dotted}.react-sigma .edge .body .render .arrow{width:0;height:0;border-left:.3em solid transparent;border-right:.3em solid transparent;border-top:.6em solid red;flex-shrink:0;flex-grow:0;border-left-width:.3em;border-right-width:.3em}.react-sigma .edge .body .label{flex-grow:1;flex-shrink:1;text-align:center} diff --git a/lightrag/api/webui/index.html b/lightrag/api/webui/index.html index 3189a1b7..dc92bda5 100644 --- a/lightrag/api/webui/index.html +++ b/lightrag/api/webui/index.html @@ -4,9 +4,9 @@ - Lightrag Graph Viewer - - + Lightrag + +
diff --git a/lightrag/lightrag.py b/lightrag/lightrag.py index 9909b4b7..a7c5920e 100644 --- a/lightrag/lightrag.py +++ b/lightrag/lightrag.py @@ -1254,6 +1254,16 @@ class LightRAG: """ return await self.doc_status.get_status_counts() + async def get_docs_by_status( + self, status: DocStatus + ) -> dict[str, DocProcessingStatus]: + """Get documents by status + + Returns: + Dict with document id is keys and document status is values + """ + return await self.doc_status.get_docs_by_status(status) + async def adelete_by_doc_id(self, doc_id: str) -> None: """Delete a document and all its related data diff --git a/lightrag_webui/README.md b/lightrag_webui/README.md index 0a0ac346..ac27f880 100644 --- a/lightrag_webui/README.md +++ b/lightrag_webui/README.md @@ -21,7 +21,7 @@ LightRAG WebUI is a React-based web interface for interacting with the LightRAG Run the following command to build the project: ```bash - bun run build + bun run build --emptyOutDir ``` This command will bundle the project and output the built files to the `lightrag/api/webui` directory. diff --git a/lightrag_webui/bun.lock b/lightrag_webui/bun.lock index 8f26b118..570fa3a6 100644 --- a/lightrag_webui/bun.lock +++ b/lightrag_webui/bun.lock @@ -4,13 +4,19 @@ "": { "name": "lightrag-webui", "dependencies": { - "@faker-js/faker": "^9.4.0", + "@faker-js/faker": "^9.5.0", + "@radix-ui/react-alert-dialog": "^1.1.6", "@radix-ui/react-checkbox": "^1.1.4", "@radix-ui/react-dialog": "^1.1.6", "@radix-ui/react-popover": "^1.1.6", + "@radix-ui/react-progress": "^1.1.2", + "@radix-ui/react-scroll-area": "^1.2.3", + "@radix-ui/react-select": "^2.1.6", "@radix-ui/react-separator": "^1.1.2", "@radix-ui/react-slot": "^1.1.2", + "@radix-ui/react-tabs": "^1.1.3", "@radix-ui/react-tooltip": "^1.1.8", + "@radix-ui/react-use-controllable-state": "^1.1.0", "@react-sigma/core": "^5.0.2", "@react-sigma/graph-search": "^5.0.3", "@react-sigma/layout-circlepack": "^5.0.2", @@ -22,6 +28,7 @@ "@react-sigma/minimap": "^5.0.2", "@sigma/edge-curve": "^3.1.0", "@sigma/node-border": "^3.0.0", + "axios": "^1.7.9", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.0.4", @@ -31,9 +38,13 @@ "minisearch": "^7.1.1", "react": "^19.0.0", "react-dom": "^19.0.0", + "react-dropzone": "^14.3.5", + "react-number-format": "^5.4.3", "seedrandom": "^3.0.5", "sigma": "^3.0.1", + "sonner": "^1.7.4", "tailwind-merge": "^3.0.1", + "tailwind-scrollbar": "^4.0.0", "zustand": "^5.0.3", }, "devDependencies": { @@ -41,19 +52,19 @@ "@stylistic/eslint-plugin-js": "^3.1.0", "@tailwindcss/vite": "^4.0.6", "@types/bun": "^1.2.2", - "@types/node": "^22.13.1", + "@types/node": "^22.13.4", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@types/seedrandom": "^3.0.8", "@vitejs/plugin-react-swc": "^3.8.0", - "eslint": "^9.20.0", + "eslint": "^9.20.1", "eslint-config-prettier": "^10.0.1", "eslint-plugin-react": "^7.37.4", "eslint-plugin-react-hooks": "^5.1.0", "eslint-plugin-react-refresh": "^0.4.19", - "globals": "^15.14.0", + "globals": "^15.15.0", "graphology-types": "^0.24.8", - "prettier": "^3.5.0", + "prettier": "^3.5.1", "prettier-plugin-tailwindcss": "^0.6.11", "tailwindcss": "^4.0.6", "tailwindcss-animate": "^1.0.7", @@ -172,7 +183,7 @@ "@eslint/plugin-kit": ["@eslint/plugin-kit@0.2.5", "", { "dependencies": { "@eslint/core": "^0.10.0", "levn": "^0.4.1" } }, "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A=="], - "@faker-js/faker": ["@faker-js/faker@9.4.0", "", {}, "sha512-85+k0AxaZSTowL0gXp8zYWDIrWclTbRPg/pm/V0dSFZ6W6D4lhcG3uuZl4zLsEKfEvs69xDbLN2cHQudwp95JA=="], + "@faker-js/faker": ["@faker-js/faker@9.5.0", "", {}, "sha512-3qbjLv+fzuuCg3umxc9/7YjrEXNaKwHgmig949nfyaTx8eL4FAsvFbu+1JcFUj1YAXofhaDn6JdEUBTYuk0Ssw=="], "@floating-ui/core": ["@floating-ui/core@1.6.9", "", { "dependencies": { "@floating-ui/utils": "^0.2.9" } }, "sha512-uMXCuQ3BItDUbAMhIXw7UPXRfAlOAvZzdK9BWpE60MCn+Svt3aLn9jsPTi/WNGlRUu2uI0v5S7JiIUsbsvh3fw=="], @@ -206,18 +217,26 @@ "@nodelib/fs.walk": ["@nodelib/fs.walk@1.2.8", "", { "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg=="], + "@radix-ui/number": ["@radix-ui/number@1.1.0", "", {}, "sha512-V3gRzhVNU1ldS5XhAPTom1fOIo4ccrjjJgmE+LI2h/WaFpHmx0MQApT+KZHnx8abG6Avtfcz4WoEciMnpFT3HQ=="], + "@radix-ui/primitive": ["@radix-ui/primitive@1.1.1", "", {}, "sha512-SJ31y+Q/zAyShtXJc8x83i9TYdbAfHZ++tUZnvjJJqFjzsdUnKsxPL6IEtBlxKkU7yzer//GQtZSV4GbldL3YA=="], + "@radix-ui/react-alert-dialog": ["@radix-ui/react-alert-dialog@1.1.6", "", { "dependencies": { "@radix-ui/primitive": "1.1.1", "@radix-ui/react-compose-refs": "1.1.1", "@radix-ui/react-context": "1.1.1", "@radix-ui/react-dialog": "1.1.6", "@radix-ui/react-primitive": "2.0.2", "@radix-ui/react-slot": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-p4XnPqgej8sZAAReCAKgz1REYZEBLR8hU9Pg27wFnCWIMc8g1ccCs0FjBcy05V15VTu8pAePw/VDYeOm/uZ6yQ=="], + "@radix-ui/react-arrow": ["@radix-ui/react-arrow@1.1.2", "", { "dependencies": { "@radix-ui/react-primitive": "2.0.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-G+KcpzXHq24iH0uGG/pF8LyzpFJYGD4RfLjCIBfGdSLXvjLHST31RUiRVrupIBMvIppMgSzQ6l66iAxl03tdlg=="], "@radix-ui/react-checkbox": ["@radix-ui/react-checkbox@1.1.4", "", { "dependencies": { "@radix-ui/primitive": "1.1.1", "@radix-ui/react-compose-refs": "1.1.1", "@radix-ui/react-context": "1.1.1", "@radix-ui/react-presence": "1.1.2", "@radix-ui/react-primitive": "2.0.2", "@radix-ui/react-use-controllable-state": "1.1.0", "@radix-ui/react-use-previous": "1.1.0", "@radix-ui/react-use-size": "1.1.0" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-wP0CPAHq+P5I4INKe3hJrIa1WoNqqrejzW+zoU0rOvo1b9gDEJJFl2rYfO1PYJUQCc2H1WZxIJmyv9BS8i5fLw=="], + "@radix-ui/react-collection": ["@radix-ui/react-collection@1.1.2", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.1", "@radix-ui/react-context": "1.1.1", "@radix-ui/react-primitive": "2.0.2", "@radix-ui/react-slot": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-9z54IEKRxIa9VityapoEYMuByaG42iSy1ZXlY2KcuLSEtq8x4987/N6m15ppoMffgZX72gER2uHe1D9Y6Unlcw=="], + "@radix-ui/react-compose-refs": ["@radix-ui/react-compose-refs@1.1.1", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw=="], "@radix-ui/react-context": ["@radix-ui/react-context@1.1.1", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-UASk9zi+crv9WteK/NU4PLvOoL3OuE6BWVKNF6hPRBtYBDXQ2u5iu3O59zUlJiTVvkyuycnqrztsHVJwcK9K+Q=="], "@radix-ui/react-dialog": ["@radix-ui/react-dialog@1.1.6", "", { "dependencies": { "@radix-ui/primitive": "1.1.1", "@radix-ui/react-compose-refs": "1.1.1", "@radix-ui/react-context": "1.1.1", "@radix-ui/react-dismissable-layer": "1.1.5", "@radix-ui/react-focus-guards": "1.1.1", "@radix-ui/react-focus-scope": "1.1.2", "@radix-ui/react-id": "1.1.0", "@radix-ui/react-portal": "1.1.4", "@radix-ui/react-presence": "1.1.2", "@radix-ui/react-primitive": "2.0.2", "@radix-ui/react-slot": "1.1.2", "@radix-ui/react-use-controllable-state": "1.1.0", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.6.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-/IVhJV5AceX620DUJ4uYVMymzsipdKBzo3edo+omeskCKGm9FRHM0ebIdbPnlQVJqyuHbuBltQUOG2mOTq2IYw=="], + "@radix-ui/react-direction": ["@radix-ui/react-direction@1.1.0", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-BUuBvgThEiAXh2DWu93XsT+a3aWrGqolGlqqw5VU1kG7p/ZH2cuDlM1sRLNnY3QcBS69UIz2mcKhMxDsdewhjg=="], + "@radix-ui/react-dismissable-layer": ["@radix-ui/react-dismissable-layer@1.1.5", "", { "dependencies": { "@radix-ui/primitive": "1.1.1", "@radix-ui/react-compose-refs": "1.1.1", "@radix-ui/react-primitive": "2.0.2", "@radix-ui/react-use-callback-ref": "1.1.0", "@radix-ui/react-use-escape-keydown": "1.1.0" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-E4TywXY6UsXNRhFrECa5HAvE5/4BFcGyfTyK36gP+pAW1ed7UTK4vKwdr53gAJYwqbfCWC6ATvJa3J3R/9+Qrg=="], "@radix-ui/react-focus-guards": ["@radix-ui/react-focus-guards@1.1.1", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-pSIwfrT1a6sIoDASCSpFwOasEwKTZWDw/iBdtnqKO7v6FeOzYJ7U53cPzYFVR3geGGXgVHaH+CdngrrAzqUGxg=="], @@ -236,10 +255,20 @@ "@radix-ui/react-primitive": ["@radix-ui/react-primitive@2.0.2", "", { "dependencies": { "@radix-ui/react-slot": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-Ec/0d38EIuvDF+GZjcMU/Ze6MxntVJYO/fRlCPhCaVUyPY9WTalHJw54tp9sXeJo3tlShWpy41vQRgLRGOuz+w=="], + "@radix-ui/react-progress": ["@radix-ui/react-progress@1.1.2", "", { "dependencies": { "@radix-ui/react-context": "1.1.1", "@radix-ui/react-primitive": "2.0.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-u1IgJFQ4zNAUTjGdDL5dcl/U8ntOR6jsnhxKb5RKp5Ozwl88xKR9EqRZOe/Mk8tnx0x5tNUe2F+MzsyjqMg0MA=="], + + "@radix-ui/react-roving-focus": ["@radix-ui/react-roving-focus@1.1.2", "", { "dependencies": { "@radix-ui/primitive": "1.1.1", "@radix-ui/react-collection": "1.1.2", "@radix-ui/react-compose-refs": "1.1.1", "@radix-ui/react-context": "1.1.1", "@radix-ui/react-direction": "1.1.0", "@radix-ui/react-id": "1.1.0", "@radix-ui/react-primitive": "2.0.2", "@radix-ui/react-use-callback-ref": "1.1.0", "@radix-ui/react-use-controllable-state": "1.1.0" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-zgMQWkNO169GtGqRvYrzb0Zf8NhMHS2DuEB/TiEmVnpr5OqPU3i8lfbxaAmC2J/KYuIQxyoQQ6DxepyXp61/xw=="], + + "@radix-ui/react-scroll-area": ["@radix-ui/react-scroll-area@1.2.3", "", { "dependencies": { "@radix-ui/number": "1.1.0", "@radix-ui/primitive": "1.1.1", "@radix-ui/react-compose-refs": "1.1.1", "@radix-ui/react-context": "1.1.1", "@radix-ui/react-direction": "1.1.0", "@radix-ui/react-presence": "1.1.2", "@radix-ui/react-primitive": "2.0.2", "@radix-ui/react-use-callback-ref": "1.1.0", "@radix-ui/react-use-layout-effect": "1.1.0" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-l7+NNBfBYYJa9tNqVcP2AGvxdE3lmE6kFTBXdvHgUaZuy+4wGCL1Cl2AfaR7RKyimj7lZURGLwFO59k4eBnDJQ=="], + + "@radix-ui/react-select": ["@radix-ui/react-select@2.1.6", "", { "dependencies": { "@radix-ui/number": "1.1.0", "@radix-ui/primitive": "1.1.1", "@radix-ui/react-collection": "1.1.2", "@radix-ui/react-compose-refs": "1.1.1", "@radix-ui/react-context": "1.1.1", "@radix-ui/react-direction": "1.1.0", "@radix-ui/react-dismissable-layer": "1.1.5", "@radix-ui/react-focus-guards": "1.1.1", "@radix-ui/react-focus-scope": "1.1.2", "@radix-ui/react-id": "1.1.0", "@radix-ui/react-popper": "1.2.2", "@radix-ui/react-portal": "1.1.4", "@radix-ui/react-primitive": "2.0.2", "@radix-ui/react-slot": "1.1.2", "@radix-ui/react-use-callback-ref": "1.1.0", "@radix-ui/react-use-controllable-state": "1.1.0", "@radix-ui/react-use-layout-effect": "1.1.0", "@radix-ui/react-use-previous": "1.1.0", "@radix-ui/react-visually-hidden": "1.1.2", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.6.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-T6ajELxRvTuAMWH0YmRJ1qez+x4/7Nq7QIx7zJ0VK3qaEWdnWpNbEDnmWldG1zBDwqrLy5aLMUWcoGirVj5kMg=="], + "@radix-ui/react-separator": ["@radix-ui/react-separator@1.1.2", "", { "dependencies": { "@radix-ui/react-primitive": "2.0.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-oZfHcaAp2Y6KFBX6I5P1u7CQoy4lheCGiYj+pGFrHy8E/VNRb5E39TkTr3JrV520csPBTZjkuKFdEsjS5EUNKQ=="], "@radix-ui/react-slot": ["@radix-ui/react-slot@1.1.2", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-YAKxaiGsSQJ38VzKH86/BPRC4rh+b1Jpa+JneA5LRE7skmLPNAyeG8kPJj/oo4STLvlrs8vkf/iYyc3A5stYCQ=="], + "@radix-ui/react-tabs": ["@radix-ui/react-tabs@1.1.3", "", { "dependencies": { "@radix-ui/primitive": "1.1.1", "@radix-ui/react-context": "1.1.1", "@radix-ui/react-direction": "1.1.0", "@radix-ui/react-id": "1.1.0", "@radix-ui/react-presence": "1.1.2", "@radix-ui/react-primitive": "2.0.2", "@radix-ui/react-roving-focus": "1.1.2", "@radix-ui/react-use-controllable-state": "1.1.0" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-9mFyI30cuRDImbmFF6O2KUJdgEOsGh9Vmx9x/Dh9tOhL7BngmQPQfwW4aejKm5OHpfWIdmeV6ySyuxoOGjtNng=="], + "@radix-ui/react-tooltip": ["@radix-ui/react-tooltip@1.1.8", "", { "dependencies": { "@radix-ui/primitive": "1.1.1", "@radix-ui/react-compose-refs": "1.1.1", "@radix-ui/react-context": "1.1.1", "@radix-ui/react-dismissable-layer": "1.1.5", "@radix-ui/react-id": "1.1.0", "@radix-ui/react-popper": "1.2.2", "@radix-ui/react-portal": "1.1.4", "@radix-ui/react-presence": "1.1.2", "@radix-ui/react-primitive": "2.0.2", "@radix-ui/react-slot": "1.1.2", "@radix-ui/react-use-controllable-state": "1.1.0", "@radix-ui/react-visually-hidden": "1.1.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-YAA2cu48EkJZdAMHC0dqo9kialOcRStbtiY4nJPaht7Ptrhcvpo+eDChaM6BIs8kL6a8Z5l5poiqLnXcNduOkA=="], "@radix-ui/react-use-callback-ref": ["@radix-ui/react-use-callback-ref@1.1.0", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-CasTfvsy+frcFkbXtSJ2Zu9JHpN8TYKxkgJGWbjiZhFivxaeW7rMeZt7QELGVLaYVfFMsKHjb7Ak0nMEe+2Vfw=="], @@ -384,10 +413,12 @@ "@types/json-schema": ["@types/json-schema@7.0.15", "", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="], - "@types/node": ["@types/node@22.13.1", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew=="], + "@types/node": ["@types/node@22.13.4", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-ywP2X0DYtX3y08eFVx5fNIw7/uIv8hYUKgXoK8oayJlLnKcRfEYCxWMVE1XagUdVtCJlZT1AU4LXEABW+L1Peg=="], "@types/parse-json": ["@types/parse-json@4.0.2", "", {}, "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw=="], + "@types/prismjs": ["@types/prismjs@1.26.5", "", {}, "sha512-AUZTa7hQ2KY5L7AmtSiqxlhWxb4ina0yd8hNbl4TWuqnv/pFP0nDMb3YrfSBf4hJVGLh2YEIBfKaBW/9UEl6IQ=="], + "@types/react": ["@types/react@19.0.8", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-9P/o1IGdfmQxrujGbIMDyYaaCykhLKc0NGCtYcECNUr9UAaDe4gwvV9bR6tvd5Br1SG0j+PBpbKr2UYY8CwqSw=="], "@types/react-dom": ["@types/react-dom@19.0.3", "", { "peerDependencies": { "@types/react": "^19.0.0" } }, "sha512-0Knk+HJiMP/qOZgMyNFamlIjw9OFCsyC2ZbigmEEyXXixgre6IQpm/4V+r3qH4GC1JPvRJKInw+on2rV6YZLeA=="], @@ -446,8 +477,14 @@ "async-function": ["async-function@1.0.0", "", {}, "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA=="], + "asynckit": ["asynckit@0.4.0", "", {}, "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="], + + "attr-accept": ["attr-accept@2.2.5", "", {}, "sha512-0bDNnY/u6pPwHDMoF0FieU354oBi0a8rD9FcsLwzcGWbc8KS8KPIi7y+s13OlVY+gMWc/9xEMUgNE6Qm8ZllYQ=="], + "available-typed-arrays": ["available-typed-arrays@1.0.7", "", { "dependencies": { "possible-typed-array-names": "^1.0.0" } }, "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ=="], + "axios": ["axios@1.7.9", "", { "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } }, "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw=="], + "babel-plugin-macros": ["babel-plugin-macros@3.1.0", "", { "dependencies": { "@babel/runtime": "^7.12.5", "cosmiconfig": "^7.0.0", "resolve": "^1.19.0" } }, "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg=="], "balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], @@ -478,6 +515,8 @@ "color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="], + "combined-stream": ["combined-stream@1.0.8", "", { "dependencies": { "delayed-stream": "~1.0.0" } }, "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="], + "concat-map": ["concat-map@0.0.1", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="], "convert-source-map": ["convert-source-map@1.9.0", "", {}, "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A=="], @@ -502,6 +541,8 @@ "define-properties": ["define-properties@1.2.1", "", { "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } }, "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg=="], + "delayed-stream": ["delayed-stream@1.0.0", "", {}, "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="], + "detect-libc": ["detect-libc@1.0.3", "", { "bin": { "detect-libc": "./bin/detect-libc.js" } }, "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg=="], "detect-node-es": ["detect-node-es@1.1.0", "", {}, "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ=="], @@ -536,7 +577,7 @@ "escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="], - "eslint": ["eslint@9.20.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.19.0", "@eslint/core": "^0.11.0", "@eslint/eslintrc": "^3.2.0", "@eslint/js": "9.20.0", "@eslint/plugin-kit": "^0.2.5", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.1", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.2.0", "eslint-visitor-keys": "^4.2.0", "espree": "^10.3.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "peerDependencies": { "jiti": "*" }, "optionalPeers": ["jiti"], "bin": { "eslint": "bin/eslint.js" } }, "sha512-aL4F8167Hg4IvsW89ejnpTwx+B/UQRzJPGgbIOl+4XqffWsahVVsLEWoZvnrVuwpWmnRd7XeXmQI1zlKcFDteA=="], + "eslint": ["eslint@9.20.1", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.19.0", "@eslint/core": "^0.11.0", "@eslint/eslintrc": "^3.2.0", "@eslint/js": "9.20.0", "@eslint/plugin-kit": "^0.2.5", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.1", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.2.0", "eslint-visitor-keys": "^4.2.0", "espree": "^10.3.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "peerDependencies": { "jiti": "*" }, "optionalPeers": ["jiti"], "bin": { "eslint": "bin/eslint.js" } }, "sha512-m1mM33o6dBUjxl2qb6wv6nGNwCAsns1eKtaQ4l/NPHeTvhiUPbtdfMyktxN4B3fgHIgsYh1VT3V9txblpQHq+g=="], "eslint-config-prettier": ["eslint-config-prettier@10.0.1", "", { "peerDependencies": { "eslint": ">=7.0.0" }, "bin": { "eslint-config-prettier": "build/bin/cli.js" } }, "sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw=="], @@ -574,6 +615,8 @@ "file-entry-cache": ["file-entry-cache@8.0.0", "", { "dependencies": { "flat-cache": "^4.0.0" } }, "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ=="], + "file-selector": ["file-selector@2.1.2", "", { "dependencies": { "tslib": "^2.7.0" } }, "sha512-QgXo+mXTe8ljeqUFaX3QVHc5osSItJ/Km+xpocx0aSqWGMSCf6qYs/VnzZgS864Pjn5iceMRFigeAV7AfTlaig=="], + "fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="], "find-root": ["find-root@1.1.0", "", {}, "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng=="], @@ -584,8 +627,12 @@ "flatted": ["flatted@3.3.2", "", {}, "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA=="], + "follow-redirects": ["follow-redirects@1.15.9", "", {}, "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ=="], + "for-each": ["for-each@0.3.4", "", { "dependencies": { "is-callable": "^1.2.7" } }, "sha512-kKaIINnFpzW6ffJNDjjyjrk21BkDx38c0xa/klsT8VzLCaMEefv4ZTacrcVR4DmgTeBra++jMDAfS/tS799YDw=="], + "form-data": ["form-data@4.0.1", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "mime-types": "^2.1.12" } }, "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw=="], + "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], "function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="], @@ -604,7 +651,7 @@ "glob-parent": ["glob-parent@6.0.2", "", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="], - "globals": ["globals@15.14.0", "", {}, "sha512-OkToC372DtlQeje9/zHIo5CT8lRP/FUgEOKBEhU4e0abL7J7CD24fD9ohiLN5hagG/kWCYj4K5oaxxtj2Z0Dig=="], + "globals": ["globals@15.15.0", "", {}, "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg=="], "globalthis": ["globalthis@1.0.4", "", { "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" } }, "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ=="], @@ -778,6 +825,10 @@ "micromatch": ["micromatch@4.0.8", "", { "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" } }, "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="], + "mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="], + + "mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="], + "minimatch": ["minimatch@3.1.2", "", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw=="], "minisearch": ["minisearch@7.1.1", "", {}, "sha512-b3YZEYCEH4EdCAtYP7OlDyx7FdPwNzuNwLQ34SfJpM9dlbBZzeXndGavTrC+VCiRWomL21SWfMc6SCKO/U2ZNw=="], @@ -838,12 +889,16 @@ "prelude-ls": ["prelude-ls@1.2.1", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="], - "prettier": ["prettier@3.5.0", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA=="], + "prettier": ["prettier@3.5.1", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-hPpFQvHwL3Qv5AdRvBFMhnKo4tYxp0ReXiPn2bxkiohEX6mBeBwEpBSQTkD458RaaDKQMYSp4hX4UtfUTA5wDw=="], "prettier-plugin-tailwindcss": ["prettier-plugin-tailwindcss@0.6.11", "", { "peerDependencies": { "@ianvs/prettier-plugin-sort-imports": "*", "@prettier/plugin-pug": "*", "@shopify/prettier-plugin-liquid": "*", "@trivago/prettier-plugin-sort-imports": "*", "@zackad/prettier-plugin-twig": "*", "prettier": "^3.0", "prettier-plugin-astro": "*", "prettier-plugin-css-order": "*", "prettier-plugin-import-sort": "*", "prettier-plugin-jsdoc": "*", "prettier-plugin-marko": "*", "prettier-plugin-multiline-arrays": "*", "prettier-plugin-organize-attributes": "*", "prettier-plugin-organize-imports": "*", "prettier-plugin-sort-imports": "*", "prettier-plugin-style-order": "*", "prettier-plugin-svelte": "*" }, "optionalPeers": ["@ianvs/prettier-plugin-sort-imports", "@prettier/plugin-pug", "@shopify/prettier-plugin-liquid", "@trivago/prettier-plugin-sort-imports", "@zackad/prettier-plugin-twig", "prettier-plugin-astro", "prettier-plugin-css-order", "prettier-plugin-import-sort", "prettier-plugin-jsdoc", "prettier-plugin-marko", "prettier-plugin-multiline-arrays", "prettier-plugin-organize-attributes", "prettier-plugin-organize-imports", "prettier-plugin-sort-imports", "prettier-plugin-style-order", "prettier-plugin-svelte"] }, "sha512-YxaYSIvZPAqhrrEpRtonnrXdghZg1irNg4qrjboCXrpybLWVs55cW2N3juhspVJiO0JBvYJT8SYsJpc8OQSnsA=="], + "prism-react-renderer": ["prism-react-renderer@2.4.1", "", { "dependencies": { "@types/prismjs": "^1.26.0", "clsx": "^2.0.0" }, "peerDependencies": { "react": ">=16.0.0" } }, "sha512-ey8Ls/+Di31eqzUxC46h8MksNuGx/n0AAC8uKpwFau4RPDYLuE3EXTp8N8G2vX2N7UC/+IXeNUnlWBGGcAG+Ig=="], + "prop-types": ["prop-types@15.8.1", "", { "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", "react-is": "^16.13.1" } }, "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg=="], + "proxy-from-env": ["proxy-from-env@1.1.0", "", {}, "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="], + "punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="], "queue-microtask": ["queue-microtask@1.2.3", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="], @@ -852,8 +907,12 @@ "react-dom": ["react-dom@19.0.0", "", { "dependencies": { "scheduler": "^0.25.0" }, "peerDependencies": { "react": "^19.0.0" } }, "sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ=="], + "react-dropzone": ["react-dropzone@14.3.5", "", { "dependencies": { "attr-accept": "^2.2.4", "file-selector": "^2.1.0", "prop-types": "^15.8.1" }, "peerDependencies": { "react": ">= 16.8 || 18.0.0" } }, "sha512-9nDUaEEpqZLOz5v5SUcFA0CjM4vq8YbqO0WRls+EYT7+DvxUdzDPKNCPLqGfj3YL9MsniCLCD4RFA6M95V6KMQ=="], + "react-is": ["react-is@16.13.1", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="], + "react-number-format": ["react-number-format@5.4.3", "", { "peerDependencies": { "react": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-VCY5hFg/soBighAoGcdE+GagkJq0230qN6jcS5sp8wQX1qy1fYN/RX7/BXkrs0oyzzwqR8/+eSUrqXbGeywdUQ=="], + "react-remove-scroll": ["react-remove-scroll@2.6.3", "", { "dependencies": { "react-remove-scroll-bar": "^2.3.7", "react-style-singleton": "^2.2.3", "tslib": "^2.1.0", "use-callback-ref": "^1.3.3", "use-sidecar": "^1.1.3" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-pnAi91oOk8g8ABQKGF5/M9qxmmOPxaAnopyTHYfqYEwJhyFrbbBtHuSgtKEoH0jpcxx5o3hXqH1mNd9/Oi+8iQ=="], "react-remove-scroll-bar": ["react-remove-scroll-bar@2.3.8", "", { "dependencies": { "react-style-singleton": "^2.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "optionalPeers": ["@types/react"] }, "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q=="], @@ -912,6 +971,8 @@ "sigma": ["sigma@3.0.1", "", { "dependencies": { "events": "^3.3.0", "graphology-utils": "^2.5.2" } }, "sha512-z67BX1FhIpD+wLs2WJ7QS2aR49TcSr3YaVZ2zU8cAc5jMiUYlSbeDp4EI6euBDUpm3/lzO4pfytP/gW4BhXWuA=="], + "sonner": ["sonner@1.7.4", "", { "peerDependencies": { "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc", "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc" } }, "sha512-DIS8z4PfJRbIyfVFDVnK9rO3eYDtse4Omcm6bt0oEr5/jtLgysmjuBl1frJ9E/EQZrFmKx2A8m/s5s9CRXIzhw=="], + "source-map": ["source-map@0.5.7", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="], "source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="], @@ -936,6 +997,8 @@ "tailwind-merge": ["tailwind-merge@3.0.1", "", {}, "sha512-AvzE8FmSoXC7nC+oU5GlQJbip2UO7tmOhOfQyOmPhrStOGXHU08j8mZEHZ4BmCqY5dWTCo4ClWkNyRNx1wpT0g=="], + "tailwind-scrollbar": ["tailwind-scrollbar@4.0.0", "", { "dependencies": { "prism-react-renderer": "^2.4.1" }, "peerDependencies": { "tailwindcss": "4.x" } }, "sha512-elqx9m09VHY8gkrMiyimFO09JlS3AyLFXT0eaLaWPi7ImwHlbZj1ce/AxSis2LtR+ewBGEyUV7URNEMcjP1Z2w=="], + "tailwindcss": ["tailwindcss@4.0.6", "", {}, "sha512-mysewHYJKaXgNOW6pp5xon/emCsfAMnO8WMaGKZZ35fomnR/T5gYnRg2/yRTTrtXiEl1tiVkeRt0eMO6HxEZqw=="], "tailwindcss-animate": ["tailwindcss-animate@1.0.7", "", { "peerDependencies": { "tailwindcss": ">=3.0.0 || insiders" } }, "sha512-bl6mpH3T7I3UFxuvDEXLxy/VuFxBk5bbzplh7tXI68mwMokNYd1t9qPBHlnyTwfa4JGC4zP516I1hYYtQ/vspA=="], @@ -1006,12 +1069,16 @@ "@humanfs/node/@humanwhocodes/retry": ["@humanwhocodes/retry@0.3.1", "", {}, "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA=="], + "@types/ws/@types/node": ["@types/node@22.13.1", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew=="], + "@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="], "@typescript-eslint/typescript-estree/semver": ["semver@7.7.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA=="], "babel-plugin-macros/resolve": ["resolve@1.22.10", "", { "dependencies": { "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w=="], + "bun-types/@types/node": ["@types/node@22.13.1", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew=="], + "fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], "@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], diff --git a/lightrag_webui/eslint.config.js b/lightrag_webui/eslint.config.js index 9d6f8eb8..7f42e8b1 100644 --- a/lightrag_webui/eslint.config.js +++ b/lightrag_webui/eslint.config.js @@ -7,27 +7,30 @@ import tseslint from 'typescript-eslint' import prettier from 'eslint-config-prettier' import react from 'eslint-plugin-react' -export default tseslint.config({ ignores: ['dist'] }, prettier, { - extends: [js.configs.recommended, ...tseslint.configs.recommended], - files: ['**/*.{ts,tsx,js,jsx}'], - languageOptions: { - ecmaVersion: 2020, - globals: globals.browser - }, - settings: { react: { version: '19.0' } }, - plugins: { - 'react-hooks': reactHooks, - 'react-refresh': reactRefresh, - '@stylistic/js': stylisticJs, - react - }, - rules: { - ...reactHooks.configs.recommended.rules, - 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], - ...react.configs.recommended.rules, - ...react.configs['jsx-runtime'].rules, - '@stylistic/js/indent': ['error', 2], - '@stylistic/js/quotes': ['error', 'single'], - '@typescript-eslint/no-explicit-any': ['off'] +export default tseslint.config( + { ignores: ['dist'] }, + { + extends: [js.configs.recommended, ...tseslint.configs.recommended, prettier], + files: ['**/*.{ts,tsx,js,jsx}'], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser + }, + settings: { react: { version: '19.0' } }, + plugins: { + 'react-hooks': reactHooks, + 'react-refresh': reactRefresh, + '@stylistic/js': stylisticJs, + react + }, + rules: { + ...reactHooks.configs.recommended.rules, + 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], + ...react.configs.recommended.rules, + ...react.configs['jsx-runtime'].rules, + '@stylistic/js/indent': ['error', 2], + '@stylistic/js/quotes': ['error', 'single'], + '@typescript-eslint/no-explicit-any': ['off'] + } } -}) +) diff --git a/lightrag_webui/index.html b/lightrag_webui/index.html index aa36e984..0e019f05 100644 --- a/lightrag_webui/index.html +++ b/lightrag_webui/index.html @@ -4,7 +4,7 @@ - Lightrag Graph Viewer + Lightrag
diff --git a/lightrag_webui/package.json b/lightrag_webui/package.json index f9fa65f4..26991d9c 100644 --- a/lightrag_webui/package.json +++ b/lightrag_webui/package.json @@ -10,13 +10,19 @@ "preview": "bunx --bun vite preview" }, "dependencies": { - "@faker-js/faker": "^9.4.0", + "@faker-js/faker": "^9.5.0", + "@radix-ui/react-alert-dialog": "^1.1.6", "@radix-ui/react-checkbox": "^1.1.4", "@radix-ui/react-dialog": "^1.1.6", "@radix-ui/react-popover": "^1.1.6", + "@radix-ui/react-progress": "^1.1.2", + "@radix-ui/react-scroll-area": "^1.2.3", + "@radix-ui/react-select": "^2.1.6", "@radix-ui/react-separator": "^1.1.2", "@radix-ui/react-slot": "^1.1.2", + "@radix-ui/react-tabs": "^1.1.3", "@radix-ui/react-tooltip": "^1.1.8", + "@radix-ui/react-use-controllable-state": "^1.1.0", "@react-sigma/core": "^5.0.2", "@react-sigma/graph-search": "^5.0.3", "@react-sigma/layout-circlepack": "^5.0.2", @@ -28,6 +34,7 @@ "@react-sigma/minimap": "^5.0.2", "@sigma/edge-curve": "^3.1.0", "@sigma/node-border": "^3.0.0", + "axios": "^1.7.9", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.0.4", @@ -37,9 +44,13 @@ "minisearch": "^7.1.1", "react": "^19.0.0", "react-dom": "^19.0.0", + "react-dropzone": "^14.3.5", + "react-number-format": "^5.4.3", "seedrandom": "^3.0.5", "sigma": "^3.0.1", + "sonner": "^1.7.4", "tailwind-merge": "^3.0.1", + "tailwind-scrollbar": "^4.0.0", "zustand": "^5.0.3" }, "devDependencies": { @@ -47,19 +58,19 @@ "@stylistic/eslint-plugin-js": "^3.1.0", "@tailwindcss/vite": "^4.0.6", "@types/bun": "^1.2.2", - "@types/node": "^22.13.1", + "@types/node": "^22.13.4", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@types/seedrandom": "^3.0.8", "@vitejs/plugin-react-swc": "^3.8.0", - "eslint": "^9.20.0", + "eslint": "^9.20.1", "eslint-config-prettier": "^10.0.1", "eslint-plugin-react": "^7.37.4", "eslint-plugin-react-hooks": "^5.1.0", "eslint-plugin-react-refresh": "^0.4.19", - "globals": "^15.14.0", + "globals": "^15.15.0", "graphology-types": "^0.24.8", - "prettier": "^3.5.0", + "prettier": "^3.5.1", "prettier-plugin-tailwindcss": "^0.6.11", "tailwindcss": "^4.0.6", "tailwindcss-animate": "^1.0.7", diff --git a/lightrag_webui/src/App.tsx b/lightrag_webui/src/App.tsx index efdf4c9d..2c7e8001 100644 --- a/lightrag_webui/src/App.tsx +++ b/lightrag_webui/src/App.tsx @@ -1,17 +1,30 @@ -import ThemeProvider from '@/components/ThemeProvider' +import { useState, useCallback } from 'react' +import ThemeProvider from '@/components/graph/ThemeProvider' import MessageAlert from '@/components/MessageAlert' -import StatusIndicator from '@/components/StatusIndicator' -import GraphViewer from '@/GraphViewer' +import ApiKeyAlert from '@/components/ApiKeyAlert' +import StatusIndicator from '@/components/graph/StatusIndicator' import { healthCheckInterval } from '@/lib/constants' import { useBackendState } from '@/stores/state' import { useSettingsStore } from '@/stores/settings' import { useEffect } from 'react' +import { Toaster } from 'sonner' +import SiteHeader from '@/features/SiteHeader' +import { InvalidApiKeyError, RequireApiKeError } from '@/api/lightrag' + +import GraphViewer from '@/features/GraphViewer' +import DocumentManager from '@/features/DocumentManager' +import RetrievalTesting from '@/features/RetrievalTesting' +import ApiSite from '@/features/ApiSite' + +import { Tabs, TabsContent } from '@/components/ui/Tabs' function App() { const message = useBackendState.use.message() const enableHealthCheck = useSettingsStore.use.enableHealthCheck() + const [currentTab] = useState(() => useSettingsStore.getState().currentTab) + const [apiKeyInvalid, setApiKeyInvalid] = useState(false) - // health check + // Health check useEffect(() => { if (!enableHealthCheck) return @@ -24,13 +37,50 @@ function App() { return () => clearInterval(interval) }, [enableHealthCheck]) + const handleTabChange = useCallback( + (tab: string) => useSettingsStore.getState().setCurrentTab(tab as any), + [] + ) + + useEffect(() => { + if (message) { + if (message.includes(InvalidApiKeyError) || message.includes(RequireApiKeError)) { + setApiKeyInvalid(true) + return + } + } + setApiKeyInvalid(false) + }, [message, setApiKeyInvalid]) + return ( -
- -
- {enableHealthCheck && } - {message !== null && } +
+ + +
+ + + + + + + + + + + + +
+
+ {enableHealthCheck && } + {message !== null && !apiKeyInvalid && } + {apiKeyInvalid && } + +
) } diff --git a/lightrag_webui/src/api/lightrag.ts b/lightrag_webui/src/api/lightrag.ts index a4e47b2f..6308ef62 100644 --- a/lightrag_webui/src/api/lightrag.ts +++ b/lightrag_webui/src/api/lightrag.ts @@ -1,3 +1,4 @@ +import axios, { AxiosError } from 'axios' import { backendBaseUrl } from '@/lib/constants' import { errorMessage } from '@/lib/utils' import { useSettingsStore } from '@/stores/settings' @@ -26,8 +27,6 @@ export type LightragStatus = { status: 'healthy' working_directory: string input_directory: string - indexed_files: string[] - indexed_files_count: number configuration: { llm_binding: string llm_binding_host: string @@ -51,94 +50,133 @@ export type LightragDocumentsScanProgress = { progress: number } +/** + * Specifies the retrieval mode: + * - "naive": Performs a basic search without advanced techniques. + * - "local": Focuses on context-dependent information. + * - "global": Utilizes global knowledge. + * - "hybrid": Combines local and global retrieval methods. + * - "mix": Integrates knowledge graph and vector retrieval. + */ export type QueryMode = 'naive' | 'local' | 'global' | 'hybrid' | 'mix' +export type Message = { + role: 'user' | 'assistant' | 'system' + content: string +} + export type QueryRequest = { query: string + /** Specifies the retrieval mode. */ mode: QueryMode - stream?: boolean + /** If True, only returns the retrieved context without generating a response. */ only_need_context?: boolean + /** If True, only returns the generated prompt without producing a response. */ + only_need_prompt?: boolean + /** Defines the response format. Examples: 'Multiple Paragraphs', 'Single Paragraph', 'Bullet Points'. */ + response_type?: string + /** If True, enables streaming output for real-time responses. */ + stream?: boolean + /** Number of top items to retrieve. Represents entities in 'local' mode and relationships in 'global' mode. */ + top_k?: number + /** Maximum number of tokens allowed for each retrieved text chunk. */ + max_token_for_text_unit?: number + /** Maximum number of tokens allocated for relationship descriptions in global retrieval. */ + max_token_for_global_context?: number + /** Maximum number of tokens allocated for entity descriptions in local retrieval. */ + max_token_for_local_context?: number + /** List of high-level keywords to prioritize in retrieval. */ + hl_keywords?: string[] + /** List of low-level keywords to refine retrieval focus. */ + ll_keywords?: string[] + /** + * Stores past conversation history to maintain context. + * Format: [{"role": "user/assistant", "content": "message"}]. + */ + conversation_history?: Message[] + /** Number of complete conversation turns (user-assistant pairs) to consider in the response context. */ + history_turns?: number } export type QueryResponse = { response: string } +export type DocActionResponse = { + status: 'success' | 'partial_success' | 'failure' + message: string +} + +export type DocStatus = 'pending' | 'processing' | 'processed' | 'failed' + +export type DocStatusResponse = { + id: string + content_summary: string + content_length: number + status: DocStatus + created_at: string + updated_at: string + chunks_count?: number + error?: string + metadata?: Record +} + +export type DocsStatusesResponse = { + statuses: Record +} + export const InvalidApiKeyError = 'Invalid API Key' export const RequireApiKeError = 'API Key required' -// Helper functions -const getResponseContent = async (response: Response) => { - const contentType = response.headers.get('content-type') - if (contentType) { - if (contentType.includes('application/json')) { - const data = await response.json() - return JSON.stringify(data, undefined, 2) - } else if (contentType.startsWith('text/')) { - return await response.text() - } else if (contentType.includes('application/xml') || contentType.includes('text/xml')) { - return await response.text() - } else if (contentType.includes('application/octet-stream')) { - const buffer = await response.arrayBuffer() - const decoder = new TextDecoder('utf-8', { fatal: false, ignoreBOM: true }) - return decoder.decode(buffer) - } else { - try { - return await response.text() - } catch (error) { - console.warn('Failed to decode as text, may be binary:', error) - return `[Could not decode response body. Content-Type: ${contentType}]` - } - } - } else { - try { - return await response.text() - } catch (error) { - console.warn('Failed to decode as text, may be binary:', error) - return '[Could not decode response body. No Content-Type header.]' - } +// Axios instance +const axiosInstance = axios.create({ + baseURL: backendBaseUrl, + headers: { + 'Content-Type': 'application/json' } - return '' -} +}) -const fetchWithAuth = async (url: string, options: RequestInit = {}): Promise => { +// Interceptor:add api key +axiosInstance.interceptors.request.use((config) => { const apiKey = useSettingsStore.getState().apiKey - const headers = { - ...(options.headers || {}), - ...(apiKey ? { 'X-API-Key': apiKey } : {}) + if (apiKey) { + config.headers['X-API-Key'] = apiKey } + return config +}) - const response = await fetch(backendBaseUrl + url, { - ...options, - headers - }) - - if (!response.ok) { - throw new Error( - `${response.status} ${response.statusText}\n${await getResponseContent(response)}\n${response.url}` - ) +// Interceptor:hanle error +axiosInstance.interceptors.response.use( + (response) => response, + (error: AxiosError) => { + if (error.response) { + throw new Error( + `${error.response.status} ${error.response.statusText}\n${JSON.stringify( + error.response.data + )}\n${error.config?.url}` + ) + } + throw error } - - return response -} +) // API methods export const queryGraphs = async (label: string): Promise => { - const response = await fetchWithAuth(`/graphs?label=${label}`) - return await response.json() + const response = await axiosInstance.get(`/graphs?label=${label}`) + return response.data } export const getGraphLabels = async (): Promise => { - const response = await fetchWithAuth('/graph/label/list') - return await response.json() + const response = await axiosInstance.get('/graph/label/list') + return response.data } export const checkHealth = async (): Promise< LightragStatus | { status: 'error'; message: string } > => { try { - const response = await fetchWithAuth('/health') - return await response.json() + const response = await axiosInstance.get('/health') + return response.data } catch (e) { return { status: 'error', @@ -147,132 +185,132 @@ export const checkHealth = async (): Promise< } } -export const getDocuments = async (): Promise => { - const response = await fetchWithAuth('/documents') - return await response.json() +export const getDocuments = async (): Promise => { + const response = await axiosInstance.get('/documents') + return response.data +} + +export const scanNewDocuments = async (): Promise<{ status: string }> => { + const response = await axiosInstance.post('/documents/scan') + return response.data } export const getDocumentsScanProgress = async (): Promise => { - const response = await fetchWithAuth('/documents/scan-progress') - return await response.json() -} - -export const uploadDocument = async ( - file: File -): Promise<{ - status: string - message: string - total_documents: number -}> => { - const formData = new FormData() - formData.append('file', file) - - const response = await fetchWithAuth('/documents/upload', { - method: 'POST', - body: formData - }) - return await response.json() -} - -export const startDocumentScan = async (): Promise<{ status: string }> => { - const response = await fetchWithAuth('/documents/scan', { - method: 'POST' - }) - return await response.json() + const response = await axiosInstance.get('/documents/scan-progress') + return response.data } export const queryText = async (request: QueryRequest): Promise => { - const response = await fetchWithAuth('/query', { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(request) - }) - return await response.json() + const response = await axiosInstance.post('/query', request) + return response.data } -export const queryTextStream = async (request: QueryRequest, onChunk: (chunk: string) => void) => { - const response = await fetchWithAuth('/query/stream', { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(request) - }) +export const queryTextStream = async ( + request: QueryRequest, + onChunk: (chunk: string) => void, + onError?: (error: string) => void +) => { + try { + let buffer = '' + await axiosInstance.post('/query/stream', request, { + responseType: 'text', + headers: { + Accept: 'application/x-ndjson' + }, + transformResponse: [ + (data: string) => { + // Accumulate the data and process complete lines + buffer += data + const lines = buffer.split('\n') + // Keep the last potentially incomplete line in the buffer + buffer = lines.pop() || '' - const reader = response.body?.getReader() - if (!reader) throw new Error('No response body') - - const decoder = new TextDecoder() - while (true) { - const { done, value } = await reader.read() - if (done) break - - const chunk = decoder.decode(value) - const lines = chunk.split('\n') - for (const line of lines) { - if (line) { - try { - const data = JSON.parse(line) - if (data.response) { - onChunk(data.response) + for (const line of lines) { + if (line.trim()) { + try { + const parsed = JSON.parse(line) + if (parsed.response) { + onChunk(parsed.response) + } else if (parsed.error && onError) { + onError(parsed.error) + } + } catch (e) { + console.error('Error parsing stream chunk:', e) + if (onError) onError('Error parsing server response') + } + } } - } catch (e) { - console.error('Error parsing stream chunk:', e) + return data } + ] + }) + + // Process any remaining data in the buffer + if (buffer.trim()) { + try { + const parsed = JSON.parse(buffer) + if (parsed.response) { + onChunk(parsed.response) + } else if (parsed.error && onError) { + onError(parsed.error) + } + } catch (e) { + console.error('Error parsing final chunk:', e) + if (onError) onError('Error parsing server response') } } + } catch (error) { + const message = errorMessage(error) + console.error('Stream request failed:', message) + if (onError) onError(message) } } -// Text insertion API export const insertText = async ( text: string, description?: string -): Promise<{ - status: string - message: string - document_count: number -}> => { - const response = await fetchWithAuth('/documents/text', { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ text, description }) - }) - return await response.json() +): Promise => { + const response = await axiosInstance.post('/documents/text', { text, description }) + return response.data } -// Batch file upload API -export const uploadBatchDocuments = async ( - files: File[] -): Promise<{ - status: string - message: string - document_count: number -}> => { +export const uploadDocument = async ( + file: File, + onUploadProgress?: (percentCompleted: number) => void +): Promise => { const formData = new FormData() - files.forEach((file) => { - formData.append('files', file) - }) + formData.append('file', file) - const response = await fetchWithAuth('/documents/batch', { - method: 'POST', - body: formData + const response = await axiosInstance.post('/documents/upload', formData, { + headers: { + 'Content-Type': 'multipart/form-data' + }, + // prettier-ignore + onUploadProgress: + onUploadProgress !== undefined + ? (progressEvent) => { + const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total!) + onUploadProgress(percentCompleted) + } + : undefined }) - return await response.json() + return response.data } -// Clear all documents API -export const clearDocuments = async (): Promise<{ - status: string - message: string - document_count: number -}> => { - const response = await fetchWithAuth('/documents', { - method: 'DELETE' - }) - return await response.json() +export const batchUploadDocuments = async ( + files: File[], + onUploadProgress?: (fileName: string, percentCompleted: number) => void +): Promise => { + return await Promise.all( + files.map(async (file) => { + return await uploadDocument(file, (percentCompleted) => { + onUploadProgress?.(file.name, percentCompleted) + }) + }) + ) +} + +export const clearDocuments = async (): Promise => { + const response = await axiosInstance.delete('/documents') + return response.data } diff --git a/lightrag_webui/src/components/ApiKeyAlert.tsx b/lightrag_webui/src/components/ApiKeyAlert.tsx new file mode 100644 index 00000000..86c8e13f --- /dev/null +++ b/lightrag_webui/src/components/ApiKeyAlert.tsx @@ -0,0 +1,77 @@ +import { useState, useCallback, useEffect } from 'react' +import { + AlertDialog, + AlertDialogContent, + AlertDialogDescription, + AlertDialogHeader, + AlertDialogTitle +} from '@/components/ui/AlertDialog' +import Button from '@/components/ui/Button' +import Input from '@/components/ui/Input' +import { useSettingsStore } from '@/stores/settings' +import { useBackendState } from '@/stores/state' +import { InvalidApiKeyError, RequireApiKeError } from '@/api/lightrag' + +import { toast } from 'sonner' + +const ApiKeyAlert = () => { + const [opened, setOpened] = useState(true) + const apiKey = useSettingsStore.use.apiKey() + const [tempApiKey, setTempApiKey] = useState('') + const message = useBackendState.use.message() + + useEffect(() => { + setTempApiKey(apiKey || '') + }, [apiKey, opened]) + + useEffect(() => { + if (message) { + if (message.includes(InvalidApiKeyError) || message.includes(RequireApiKeError)) { + setOpened(true) + } + } + }, [message, setOpened]) + + const setApiKey = useCallback(async () => { + useSettingsStore.setState({ apiKey: tempApiKey || null }) + if (await useBackendState.getState().check()) { + setOpened(false) + return + } + toast.error('API Key is invalid') + }, [tempApiKey]) + + const handleTempApiKeyChange = useCallback( + (e: React.ChangeEvent) => { + setTempApiKey(e.target.value) + }, + [setTempApiKey] + ) + + return ( + + + + API Key is required + Please enter your API key + +
e.preventDefault()}> + + + +
+
+
+ ) +} + +export default ApiKeyAlert diff --git a/lightrag_webui/src/components/MessageAlert.tsx b/lightrag_webui/src/components/MessageAlert.tsx index 6a25baab..cd23bbd9 100644 --- a/lightrag_webui/src/components/MessageAlert.tsx +++ b/lightrag_webui/src/components/MessageAlert.tsx @@ -22,10 +22,11 @@ const MessageAlert = () => { return ( {!health && ( @@ -42,7 +43,7 @@ const MessageAlert = () => { + + e.preventDefault()}> + + Clear documents + Do you really want to clear all documents? + + + + + ) +} diff --git a/lightrag_webui/src/components/documents/UploadDocumentsDialog.tsx b/lightrag_webui/src/components/documents/UploadDocumentsDialog.tsx new file mode 100644 index 00000000..181b52f1 --- /dev/null +++ b/lightrag_webui/src/components/documents/UploadDocumentsDialog.tsx @@ -0,0 +1,91 @@ +import { useState, useCallback } from 'react' +import Button from '@/components/ui/Button' +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger +} from '@/components/ui/Dialog' +import FileUploader from '@/components/ui/FileUploader' +import { toast } from 'sonner' +import { errorMessage } from '@/lib/utils' +import { uploadDocument } from '@/api/lightrag' + +import { UploadIcon } from 'lucide-react' + +export default function UploadDocumentsDialog() { + const [open, setOpen] = useState(false) + const [isUploading, setIsUploading] = useState(false) + const [progresses, setProgresses] = useState>({}) + + const handleDocumentsUpload = useCallback( + async (filesToUpload: File[]) => { + setIsUploading(true) + + try { + await Promise.all( + filesToUpload.map(async (file) => { + try { + const result = await uploadDocument(file, (percentCompleted: number) => { + console.debug(`Uploading ${file.name}: ${percentCompleted}%`) + setProgresses((pre) => ({ + ...pre, + [file.name]: percentCompleted + })) + }) + if (result.status === 'success') { + toast.success(`Upload Success:\n${file.name} uploaded successfully`) + } else { + toast.error(`Upload Failed:\n${file.name}\n${result.message}`) + } + } catch (err) { + toast.error(`Upload Failed:\n${file.name}\n${errorMessage(err)}`) + } + }) + ) + } catch (err) { + toast.error('Upload Failed\n' + errorMessage(err)) + } finally { + setIsUploading(false) + // setOpen(false) + } + }, + [setIsUploading, setProgresses] + ) + + return ( + { + if (isUploading && !open) { + return + } + setOpen(open) + }} + > + + + + e.preventDefault()}> + + Upload documents + + Drag and drop your documents here or click to browse. + + + + + + ) +} diff --git a/lightrag_webui/src/components/FocusOnNode.tsx b/lightrag_webui/src/components/graph/FocusOnNode.tsx similarity index 100% rename from lightrag_webui/src/components/FocusOnNode.tsx rename to lightrag_webui/src/components/graph/FocusOnNode.tsx diff --git a/lightrag_webui/src/components/FullScreenControl.tsx b/lightrag_webui/src/components/graph/FullScreenControl.tsx similarity index 100% rename from lightrag_webui/src/components/FullScreenControl.tsx rename to lightrag_webui/src/components/graph/FullScreenControl.tsx diff --git a/lightrag_webui/src/components/GraphControl.tsx b/lightrag_webui/src/components/graph/GraphControl.tsx similarity index 100% rename from lightrag_webui/src/components/GraphControl.tsx rename to lightrag_webui/src/components/graph/GraphControl.tsx diff --git a/lightrag_webui/src/components/GraphLabels.tsx b/lightrag_webui/src/components/graph/GraphLabels.tsx similarity index 100% rename from lightrag_webui/src/components/GraphLabels.tsx rename to lightrag_webui/src/components/graph/GraphLabels.tsx diff --git a/lightrag_webui/src/components/GraphSearch.tsx b/lightrag_webui/src/components/graph/GraphSearch.tsx similarity index 100% rename from lightrag_webui/src/components/GraphSearch.tsx rename to lightrag_webui/src/components/graph/GraphSearch.tsx diff --git a/lightrag_webui/src/components/LayoutsControl.tsx b/lightrag_webui/src/components/graph/LayoutsControl.tsx similarity index 100% rename from lightrag_webui/src/components/LayoutsControl.tsx rename to lightrag_webui/src/components/graph/LayoutsControl.tsx diff --git a/lightrag_webui/src/components/PropertiesView.tsx b/lightrag_webui/src/components/graph/PropertiesView.tsx similarity index 100% rename from lightrag_webui/src/components/PropertiesView.tsx rename to lightrag_webui/src/components/graph/PropertiesView.tsx diff --git a/lightrag_webui/src/components/Settings.tsx b/lightrag_webui/src/components/graph/Settings.tsx similarity index 97% rename from lightrag_webui/src/components/Settings.tsx rename to lightrag_webui/src/components/graph/Settings.tsx index 45bc6731..3a6cc51c 100644 --- a/lightrag_webui/src/components/Settings.tsx +++ b/lightrag_webui/src/components/graph/Settings.tsx @@ -1,5 +1,5 @@ import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/Popover' -import { Checkbox } from '@/components/ui/Checkbox' +import Checkbox from '@/components/ui/Checkbox' import Button from '@/components/ui/Button' import Separator from '@/components/ui/Separator' import Input from '@/components/ui/Input' @@ -40,7 +40,7 @@ const LabeledCheckBox = ({ */ export default function Settings() { const [opened, setOpened] = useState(false) - const [tempApiKey, setTempApiKey] = useState('') // 用于临时存储输入的API Key + const [tempApiKey, setTempApiKey] = useState('') const showPropertyPanel = useSettingsStore.use.showPropertyPanel() const showNodeSearchBar = useSettingsStore.use.showNodeSearchBar() diff --git a/lightrag_webui/src/components/StatusCard.tsx b/lightrag_webui/src/components/graph/StatusCard.tsx similarity index 96% rename from lightrag_webui/src/components/StatusCard.tsx rename to lightrag_webui/src/components/graph/StatusCard.tsx index ea038c74..3084d103 100644 --- a/lightrag_webui/src/components/StatusCard.tsx +++ b/lightrag_webui/src/components/graph/StatusCard.tsx @@ -14,8 +14,6 @@ const StatusCard = ({ status }: { status: LightragStatus | null }) => { {status.working_directory} Input Directory: {status.input_directory} - Indexed Files: - {status.indexed_files_count} diff --git a/lightrag_webui/src/components/StatusIndicator.tsx b/lightrag_webui/src/components/graph/StatusIndicator.tsx similarity index 96% rename from lightrag_webui/src/components/StatusIndicator.tsx rename to lightrag_webui/src/components/graph/StatusIndicator.tsx index 25d0032c..3272d9fa 100644 --- a/lightrag_webui/src/components/StatusIndicator.tsx +++ b/lightrag_webui/src/components/graph/StatusIndicator.tsx @@ -2,7 +2,7 @@ import { cn } from '@/lib/utils' import { useBackendState } from '@/stores/state' import { useEffect, useState } from 'react' import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/Popover' -import StatusCard from '@/components/StatusCard' +import StatusCard from '@/components/graph/StatusCard' const StatusIndicator = () => { const health = useBackendState.use.health() diff --git a/lightrag_webui/src/components/ThemeProvider.tsx b/lightrag_webui/src/components/graph/ThemeProvider.tsx similarity index 100% rename from lightrag_webui/src/components/ThemeProvider.tsx rename to lightrag_webui/src/components/graph/ThemeProvider.tsx diff --git a/lightrag_webui/src/components/ThemeToggle.tsx b/lightrag_webui/src/components/graph/ThemeToggle.tsx similarity index 95% rename from lightrag_webui/src/components/ThemeToggle.tsx rename to lightrag_webui/src/components/graph/ThemeToggle.tsx index 6b66b2b3..8e92d862 100644 --- a/lightrag_webui/src/components/ThemeToggle.tsx +++ b/lightrag_webui/src/components/graph/ThemeToggle.tsx @@ -19,6 +19,7 @@ export default function ThemeToggle() { variant={controlButtonVariant} tooltip="Switch to light theme" size="icon" + side="bottom" > @@ -30,6 +31,7 @@ export default function ThemeToggle() { variant={controlButtonVariant} tooltip="Switch to dark theme" size="icon" + side="bottom" > diff --git a/lightrag_webui/src/components/ZoomControl.tsx b/lightrag_webui/src/components/graph/ZoomControl.tsx similarity index 100% rename from lightrag_webui/src/components/ZoomControl.tsx rename to lightrag_webui/src/components/graph/ZoomControl.tsx diff --git a/lightrag_webui/src/components/retrieval/QuerySettings.tsx b/lightrag_webui/src/components/retrieval/QuerySettings.tsx new file mode 100644 index 00000000..bef34857 --- /dev/null +++ b/lightrag_webui/src/components/retrieval/QuerySettings.tsx @@ -0,0 +1,279 @@ +import { useCallback } from 'react' +import { QueryMode, QueryRequest } from '@/api/lightrag' +import Text from '@/components/ui/Text' +import Input from '@/components/ui/Input' +import Checkbox from '@/components/ui/Checkbox' +import NumberInput from '@/components/ui/NumberInput' +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/Card' +import { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectTrigger, + SelectValue +} from '@/components/ui/Select' +import { useSettingsStore } from '@/stores/settings' + +export default function QuerySettings() { + const querySettings = useSettingsStore((state) => state.querySettings) + + const handleChange = useCallback((key: keyof QueryRequest, value: any) => { + useSettingsStore.getState().updateQuerySettings({ [key]: value }) + }, []) + + return ( + + + Parameters + Configure your query parameters + + +
+
+ {/* Query Mode */} + <> + + + + + {/* Response Format */} + <> + + + + + {/* Top K */} + <> + + handleChange('top_k', v)} + min={1} + placeholder="Number of results" + /> + + + {/* Max Tokens */} + <> + <> + + handleChange('max_token_for_text_unit', v)} + min={1} + placeholder="Max tokens for text unit" + /> + + + <> + + handleChange('max_token_for_global_context', v)} + min={1} + placeholder="Max tokens for global context" + /> + + + <> + + handleChange('max_token_for_local_context', v)} + min={1} + placeholder="Max tokens for local context" + /> + + + + {/* History Turns */} + <> + + handleChange('history_turns', v)} + min={0} + placeholder="Number of history turns" + /> + + + {/* Keywords */} + <> + <> + + { + const keywords = e.target.value + .split(',') + .map((k) => k.trim()) + .filter((k) => k !== '') + handleChange('hl_keywords', keywords) + }} + placeholder="Enter keywords" + /> + + + <> + + { + const keywords = e.target.value + .split(',') + .map((k) => k.trim()) + .filter((k) => k !== '') + handleChange('ll_keywords', keywords) + }} + placeholder="Enter keywords" + /> + + + + {/* Toggle Options */} + <> +
+ +
+ handleChange('only_need_context', checked)} + /> +
+ +
+ +
+ handleChange('only_need_prompt', checked)} + /> +
+ +
+ +
+ handleChange('stream', checked)} + /> +
+ +
+
+ + + ) +} diff --git a/lightrag_webui/src/components/ui/AlertDialog.tsx b/lightrag_webui/src/components/ui/AlertDialog.tsx new file mode 100644 index 00000000..36868fcb --- /dev/null +++ b/lightrag_webui/src/components/ui/AlertDialog.tsx @@ -0,0 +1,115 @@ +import * as React from 'react' +import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog' + +import { cn } from '@/lib/utils' +import { buttonVariants } from '@/components/ui/Button' + +const AlertDialog = AlertDialogPrimitive.Root + +const AlertDialogTrigger = AlertDialogPrimitive.Trigger + +const AlertDialogPortal = AlertDialogPrimitive.Portal + +const AlertDialogOverlay = React.forwardRef< + React.ComponentRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName + +const AlertDialogContent = React.forwardRef< + React.ComponentRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + + +)) +AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName + +const AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes) => ( +
+) +AlertDialogHeader.displayName = 'AlertDialogHeader' + +const AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes) => ( +
+) +AlertDialogFooter.displayName = 'AlertDialogFooter' + +const AlertDialogTitle = React.forwardRef< + React.ComponentRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName + +const AlertDialogDescription = React.forwardRef< + React.ComponentRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName + +const AlertDialogAction = React.forwardRef< + React.ComponentRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName + +const AlertDialogCancel = React.forwardRef< + React.ComponentRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName + +export { + AlertDialog, + AlertDialogPortal, + AlertDialogOverlay, + AlertDialogTrigger, + AlertDialogContent, + AlertDialogHeader, + AlertDialogFooter, + AlertDialogTitle, + AlertDialogDescription, + AlertDialogAction, + AlertDialogCancel +} diff --git a/lightrag_webui/src/components/ui/AsyncSearch.tsx b/lightrag_webui/src/components/ui/AsyncSearch.tsx index c417fd6b..a9b3a6ce 100644 --- a/lightrag_webui/src/components/ui/AsyncSearch.tsx +++ b/lightrag_webui/src/components/ui/AsyncSearch.tsx @@ -193,7 +193,7 @@ export function AsyncSearch({
)}
-