diff --git a/ormgraph_odoo/.gitattributes b/ormgraph_odoo/.gitattributes new file mode 100644 index 00000000000..0d5ec799e74 --- /dev/null +++ b/ormgraph_odoo/.gitattributes @@ -0,0 +1,13 @@ +# Ignore bundled frontend assets, documentation, and static files from GitHub Linguist stats +static/** -linguist-detectable +static/** linguist-vendored +docs/** -linguist-detectable +docs/** linguist-documentation +*.html -linguist-detectable +*.html linguist-vendored +*.css -linguist-detectable +*.css linguist-vendored +*.js -linguist-detectable +*.js linguist-vendored +*.json -linguist-detectable +*.json linguist-vendored diff --git a/ormgraph_odoo/.gitignore b/ormgraph_odoo/.gitignore new file mode 100644 index 00000000000..06a7f27b953 --- /dev/null +++ b/ormgraph_odoo/.gitignore @@ -0,0 +1,21 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# OS generated files +.DS_Store +.DS_Store? +ehthumbs.db +Thumbs.db + +# Editor directories and files +.idea/ +.vscode/ +*.swp +*.swo +*~ + +# Temporary files +*.log +*.tmp diff --git a/ormgraph_odoo/.prettierignore b/ormgraph_odoo/.prettierignore new file mode 100644 index 00000000000..111932a5303 --- /dev/null +++ b/ormgraph_odoo/.prettierignore @@ -0,0 +1,4 @@ +# Ignore compiled Next.js frontend build artifacts +static/src/ +static/description/index.html +README.md diff --git a/ormgraph_odoo/LICENSE b/ormgraph_odoo/LICENSE new file mode 100644 index 00000000000..5c89394d87f --- /dev/null +++ b/ormgraph_odoo/LICENSE @@ -0,0 +1,164 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, taken +together, effectively restrict modification of the portions of the +Library contained in the Combined Work and reverse engineering for +debugging such modifications, if you also do each of the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/ormgraph_odoo/README.md b/ormgraph_odoo/README.md new file mode 100644 index 00000000000..5837fbf6a3a --- /dev/null +++ b/ormgraph_odoo/README.md @@ -0,0 +1,146 @@ +# ORMGraph for Odoo + +> Live Architecture Explorer, Visual ERD Studio, and Relational Pathfinder for Odoo & Python ORMs. + +[![License: LGPL v3](https://img.shields.io/badge/License-LGPL_v3-purple.svg)](https://www.gnu.org/licenses/lgpl-3.0) +[![Python](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue)](https://www.python.org/) +[![Odoo Compatibility](https://img.shields.io/badge/Odoo-17%20%7C%2018%20%7C%2019-714B67)](https://www.odoo.com/) +[![Author](https://img.shields.io/badge/Author-Piyush%20Kumar-E4A900)](https://iampiyush.one) + +--- + +## Why I Built This + +If you’ve ever worked on a mid-to-large Odoo project, you know the frustration: +- A standard database quickly exceeds **400+ to 800+ models**. +- Relational fields (`Many2one`, `One2many`, `Many2many`, `_inherits`) are scattered across dozens of core and third-party modules. +- Dumping the whole database into a generic schema visualizer either crashes the browser tab or produces an unreadable web of lines. +- Figuring out how to write a computed field dependency or tracing how `account.move` links to a custom model usually means grepping through thousands of lines of Python code. + +**ORMGraph** was built to solve this. It gives developers a clean, zero-lag visual studio to inspect models module-by-module, trace relational paths, view table-level ERDs, and export high-resolution diagrams. + +--- + +## Visual Tour + +### 1. Studio Workspace (Zero-Lag Architecture) +Opens with a clean slate. You can search or pick any installed module from the sidebar without freezing your browser. + +![Studio Overview](docs/images/01_studio_overview.png) + +--- + +### 2. Module Architecture Graph +Select a module (like `sale`, `fleet`, or `account`) to immediately render its model topology, foreign connections, and inheritance hierarchies. + +![Module Architecture Graph](docs/images/02_module_graph.png) + +--- + +### 3. Interactive ERD Schema Cards +Explore table cards complete with field names, data types, and color-coded relational tags (`Many2one`, `One2many`, `Computed`, `Selection`). + +![Interactive ERD Cards](docs/images/03_erd_cards.png) + +--- + +### 4. BFS Relational Pathfinder +Pick any two models in your database to find the shortest relational route between them. It outputs the exact Python ORM dot-path (`partner_id.currency_id.symbol`) so you can copy and paste directly into your code. + +![Relational Pathfinder](docs/images/04_relational_pathfinder.png) + +--- + +### 5. Architecture Health & Circular Dependency Diagnostics +A dedicated diagnostic dashboard that flags circular relationships, identifies isolated models, and calculates degree centrality across your database. + +![Architecture Health & Diagnostics](docs/images/05_architecture_health_export.png) + +--- + +### 6. High-Resolution ERD Table Card Export +Export clean, presentation-ready PNG diagrams of your database tables or automatically partition large modules into clustered ZIP bundles. + +![ERD Table Diagram Export](docs/images/06_erd.png) + +--- + +### 7. High-Resolution Architecture Graph Export +Download full-vector Cytoscape graph diagrams with automatic watermarking, perfect for technical documentation and sprint planning. + +![Graph Architecture Export](docs/images/07_graph.png) + +--- + +## Key Features + +* **Module-by-Module Isolation**: Only loads the models for the module you select, keeping rendering snappy and readable. +* **Interactive ERD Table Cards**: Color-coded badges for relational, numeric, boolean, computed, and selection fields. +* **Multi-Hop Relational Pathfinder**: Computes the shortest foreign key path between any two models using Breadth-First Search (BFS). +* **Smart ZIP Exporter**: Automatically detects large modules (>20 models) and partitions them into Hub sub-clusters with a table of contents manifest. +* **Odoo Smart Button**: Adds a direct "Architecture Visualizer" button inside `Settings ➔ Technical ➔ Database Structure ➔ Models`. +* **Static AST Code Intelligence**: Can also run purely from the terminal via Python AST without requiring a live PostgreSQL database. + +--- + +## Installation & Setup + +### Option 1: Install as an Odoo Addon (Recommended) + +1. Copy the `ormgraph_odoo` folder into your Odoo addons directory: + ```bash + cp -r ormgraph_odoo /path/to/your/odoo/custom_addons/ + ``` + +2. Restart your Odoo server and enable developer mode: + - Navigate to **Apps ➔ Update Apps List** + - Search for **ORMGraph** + - Click **Install** + +3. Open **ORMGraph Studio** directly from the Odoo main apps menu, or click the **Architecture Visualizer** smart button on any model form in `Technical ➔ Models`. + +--- + +### Option 2: Standalone Python CLI + +You can also use ORMGraph as a standalone tool to analyze any Python project (Odoo, Django, or SQLAlchemy) statically via AST: + +```bash +# Clone the repository +git clone https://github.com/iam-piyush/ormgraph.git +cd ormgraph + +# Install locally +pip install -e . + +# Scan an Odoo codebase +ormgraph scan /path/to/odoo/custom_addons --output graph.json + +# Launch the interactive local studio +ormgraph studio /path/to/odoo/custom_addons +``` + +--- + +## Technical Stack + +- **Backend**: Python 3.10+, Odoo HTTP Controllers, AST Static Analyzer, NetworkX Graph Algorithms. +- **Frontend Studio**: Next.js 14, React 18, Cytoscape.js (Dagre, Cose, Concentric), Tailwind CSS, Framer Motion. +- **Export Engine**: HTML5 Canvas, JSZip, Blob API. + +--- + +## Author & Credits + +Created and maintained by **Piyush Kumar** — Full-Stack Software Engineer & Odoo Specialist. + +- **Portfolio**: [https://iampiyush.one](https://iampiyush.one) +- **GitHub**: [@iam-piyush](https://github.com/iam-piyush) +- **Twitter / X**: [@ipiyuush](https://x.com/ipiyuush) +- **LinkedIn**: [Piyush Kumar](https://linkedin.com/in/iam-piyush) + +--- + +## License + +This project is licensed under the **GNU Lesser General Public License v3.0 (LGPL-3.0)** — see the [LICENSE](LICENSE) file for details. diff --git a/ormgraph_odoo/README.rst b/ormgraph_odoo/README.rst new file mode 100644 index 00000000000..ebcd33ad516 --- /dev/null +++ b/ormgraph_odoo/README.rst @@ -0,0 +1,53 @@ +================================================ +ORMGraph — ORM Architecture & ERD Studio for Odoo +================================================ + +.. + Author: Piyush Kumar (iam-piyush) + License: LGPL-3 + +ORMGraph is an interactive architecture intelligence, Entity Relationship Diagram (ERD) visualizer, and relational dependency pathfinder studio for Odoo. + +**Table of contents** + +.. contents:: + :local: + +Key Capabilities +================ + +* **Module-First Architecture Canvas**: Explore models and foreign relations module-by-module without freezing the browser. +* **Interactive ERD Table Cards**: Visual schema cards with color-coded field badges for Many2one, One2many, Many2many, and computed fields. +* **BFS Multi-Hop Pathfinder**: Calculates shortest relational routes between any two models and generates ORM dot-notation (e.g. ``partner_id.currency_id``). +* **Smart Multi-Cluster ZIP Exporter**: Auto-detects large models (> 20 models), clusters them into Hub sub-graphs, and exports high-resolution diagrams in a ZIP archive. +* **1-Click Model Stat Button**: Direct "Architecture Visualizer" smart button integrated on any model form inside ``Settings ➔ Technical ➔ Database Structure ➔ Models``. +* **Architecture Health**: Detect circular dependencies and explore strongly connected components. + +Installation +============ + +1. Place the ``ormgraph_odoo`` folder inside your Odoo addons path. +2. Update the apps list via **Apps ➔ Update Apps List**. +3. Search for **ORMGraph** and click **Install**. + +Usage +===== + +1. Open **ORMGraph** from the main Odoo Apps Drawer or click the smart button in any model's form view. +2. Select any module from the left sidebar to generate its live relational jaal. +3. Switch between **Graph View**, **ERD Cards**, **Pathfinder**, and **Architecture Health**. +4. Click **Export PNG** or **ZIP Bundle** to download diagrams. + +Credits +======= + +Authors +~~~~~~~ + +* Piyush Kumar (`iam-piyush `_) +* Website: `iampiyush.one `_ + +Maintainers +~~~~~~~~~~~ + +This module is maintained by Piyush Kumar. diff --git a/ormgraph_odoo/__init__.py b/ormgraph_odoo/__init__.py new file mode 100644 index 00000000000..ede95b15f78 --- /dev/null +++ b/ormgraph_odoo/__init__.py @@ -0,0 +1,10 @@ +# -------------------------------------------------------------------------- +# ORMGraph for Odoo — Live Architecture & ERD Studio +# Author: Piyush Kumar (iam-piyush) +# Website: https://iampiyush.one +# Description: Interactive ORM architecture intelligence, visual ERDs, and +# relational dependency pathfinding for Odoo models. +# License: LGPL-3 (https://www.gnu.org/licenses/lgpl-3.0.html) +# -------------------------------------------------------------------------- + +from . import controllers, models # noqa: F401 diff --git a/ormgraph_odoo/__manifest__.py b/ormgraph_odoo/__manifest__.py new file mode 100644 index 00000000000..22165eca359 --- /dev/null +++ b/ormgraph_odoo/__manifest__.py @@ -0,0 +1,34 @@ +{ + "name": "ORMGraph — ORM Architecture & ERD Studio", + "version": "19.0.1.0.0", + "category": "Technical / Developer Tools", + "summary": "Interactive ERD visualizer, model relationship explorer, and dependency pathfinder for Odoo models.", + "description": """ +ORMGraph — Live Architecture & ERD Explorer for Odoo +=================================================== + +Visualize, explore, and debug your entire Odoo data model in real time! + +Key Features: +------------- +* **Interactive ERD Diagram**: Rich table cards with colored field badges (Many2one, One2many, Many2many, Char, Boolean, etc.). +* **Structural Graph View**: Cytoscape-powered high-performance graph with multiple layout algorithms (Flow, Hierarchy, Organic). +* **Pathfinder**: Find direct and multi-hop relationship paths between any two models. +* **1-Click Smart Button**: Open any model's architecture directly from Technical -> Models form view. +* **Architecture Health & Cycles**: Detect circular dependencies and explore strongly connected components. +* **High-Res PNG Export**: 3x ultra-clear diagram export with custom framing and padding. +* **Smart Auto-Cluster ZIP Bundle**: Automatically partitions large graphs (>20 models) into Hub sub-graphs and bundles high-res diagrams into a ZIP archive. +* **Zero Config**: Works instantly with all installed custom and base Odoo modules. + """, + "author": "Piyush Kumar (iam-piyush), Odoo Community Association (OCA)", + "website": "https://github.com/OCA/server-tools", + "license": "LGPL-3", + "depends": ["base", "web"], + "data": [ + "views/ir_model_views.xml", + "views/menu_views.xml", + ], + "installable": True, + "application": True, + "auto_install": False, +} diff --git a/ormgraph_odoo/controllers/__init__.py b/ormgraph_odoo/controllers/__init__.py new file mode 100644 index 00000000000..70b916df79d --- /dev/null +++ b/ormgraph_odoo/controllers/__init__.py @@ -0,0 +1,10 @@ +# -------------------------------------------------------------------------- +# ORMGraph for Odoo — Live Architecture & ERD Studio +# Author: Piyush Kumar (iam-piyush) +# Website: https://iampiyush.one +# Description: Interactive ORM architecture intelligence, visual ERDs, and +# relational dependency pathfinding for Odoo models. +# License: LGPL-3 (https://www.gnu.org/licenses/lgpl-3.0.html) +# -------------------------------------------------------------------------- + +from . import main # noqa: F401 diff --git a/ormgraph_odoo/controllers/main.py b/ormgraph_odoo/controllers/main.py new file mode 100644 index 00000000000..c3f6236588f --- /dev/null +++ b/ormgraph_odoo/controllers/main.py @@ -0,0 +1,293 @@ +# -------------------------------------------------------------------------- +# ORMGraph for Odoo — Live Architecture & ERD Studio +# Author: Piyush Kumar (iam-piyush) +# Website: https://iampiyush.one +# Description: Interactive ORM architecture intelligence, visual ERDs, and +# relational dependency pathfinding for Odoo models. +# License: LGPL-3 (https://www.gnu.org/licenses/lgpl-3.0.html) +# -------------------------------------------------------------------------- + +import json +import logging +from collections import deque +from pathlib import Path + +from odoo import http +from odoo.http import Response, request + +_logger = logging.getLogger(__name__) + + +class ORMGraphController(http.Controller): + @http.route( + ["/ormgraph/studio", "/ormgraph/studio/"], + type="http", + auth="user", + methods=["GET"], + ) + def studio_view(self, **kwargs): + static_dir = Path(__file__).parent.parent / "static" / "src" + index_file = static_dir / "index.html" + + if not index_file.exists(): + return Response( + "ORMGraph Studio assets not found. Please verify static/src installation.", + status=404, + ) + + content = index_file.read_text(encoding="utf-8") + return Response(content, content_type="text/html;charset=utf-8") + + @http.route(["/_next/"], type="http", auth="public", methods=["GET"], cors="*") + def serve_next_static(self, path, **kwargs): + file_path = Path(__file__).parent.parent / "static" / "src" / "_next" / path + if not file_path.exists() or not file_path.is_file(): + return Response("Not found", status=404) + + content = file_path.read_bytes() + content_type = "application/octet-stream" + if path.endswith(".js"): + content_type = "application/javascript;charset=utf-8" + elif path.endswith(".css"): + content_type = "text/css;charset=utf-8" + elif path.endswith(".json") or path.endswith(".map"): + content_type = "application/json;charset=utf-8" + elif path.endswith(".svg"): + content_type = "image/svg+xml" + elif path.endswith(".png"): + content_type = "image/png" + elif path.endswith(".ico"): + content_type = "image/x-icon" + + return Response( + content, + content_type=content_type, + headers=[("Cache-Control", "public, max-age=31536000, immutable")], + ) + + @http.route( + ["/api/graph", "/ormgraph/api/graph"], type="http", auth="user", methods=["GET"], cors="*" + ) + def get_live_graph_http(self, **kwargs): + data = self._build_graph_payload() + return Response(json.dumps(data), content_type="application/json;charset=utf-8") + + @http.route( + ["/api/graph/json", "/ormgraph/api/graph/json"], + type="jsonrpc", + auth="user", + methods=["POST"], + ) + def get_live_graph_json(self, **kwargs): + return self._build_graph_payload() + + @http.route( + ["/api/path", "/ormgraph/api/path"], type="http", auth="user", methods=["GET"], cors="*" + ) + def get_model_path(self, source=None, target=None, all=False, **kwargs): + if not source or not target: + return Response( + json.dumps({"error": "Both source and target models are required"}), + status=400, + content_type="application/json", + ) + + graph_data = self._build_graph_payload() + path = self._bfs_shortest_path(graph_data, source, target) + + if not path: + return Response( + json.dumps( + { + "path": None, + "paths": [], + "message": f"No path found between {source} and {target}", + } + ), + content_type="application/json", + ) + + return Response( + json.dumps({"path": path, "paths": [path] if path else []}), + content_type="application/json", + ) + + @http.route( + ["/api/metrics", "/ormgraph/api/metrics"], + type="http", + auth="user", + methods=["GET"], + cors="*", + ) + def get_metrics(self, **kwargs): + graph_data = self._build_graph_payload() + models = graph_data.get("models", []) + rels = graph_data.get("relationships", []) + + degree_map = {} + for r in rels: + s, t = r["source"], r["target"] + degree_map[s] = degree_map.get(s, 0) + 1 + degree_map[t] = degree_map.get(t, 0) + 1 + + sorted_connected = sorted(degree_map.items(), key=lambda x: x[1], reverse=True)[:10] + + metrics = { + "total_models": len(models), + "total_fields": sum(len(m.get("fields", [])) for m in models), + "total_relationships": len(rels), + "framework": "odoo", + "most_connected": [{"model": k, "degree": v} for k, v in sorted_connected], + } + return Response(json.dumps(metrics), content_type="application/json") + + def _build_graph_payload(self) -> dict: + env = request.env + models_data = [] + relationships_data = [] + inheritance_edges = [] + + module_map = {} + try: + domain = [("model", "=", "ir.model")] + imd_records = env["ir.model.data"].sudo().search(domain) + for imd in imd_records: + module_map[imd.name.replace("model_", "").replace("_", ".")] = imd.module + except Exception as e: + _logger.debug("Could not fetch ir.model.data module mapping: %s", e) + + for model_name, model_cls in env.items(): + if not isinstance(model_name, str) or model_name.startswith("_"): + continue + + fields_list = [] + incoming = [] + outgoing = [] + + for fname, field in model_cls._fields.items(): + ftype = getattr(field, "type", "unknown") + comodel = getattr(field, "comodel_name", None) + + fields_list.append( + { + "name": fname, + "type": ftype, + "field_type": ftype, + "comodel": comodel, + "comodel_name": comodel, + "required": getattr(field, "required", False), + "readonly": getattr(field, "readonly", False), + "computed": bool(getattr(field, "compute", False)), + "stored": getattr(field, "store", True), + } + ) + + if comodel and comodel in env: + rel_id = f"{model_name}::{fname}::{comodel}" + relationships_data.append( + { + "id": rel_id, + "source": model_name, + "target": comodel, + "field": fname, + "type": ftype, + } + ) + outgoing.append({"to": comodel, "field": fname, "type": ftype}) + + inherits_parents = getattr(model_cls, "_inherit", []) + if isinstance(inherits_parents, str): + inherits_parents = [inherits_parents] + elif not isinstance(inherits_parents, (list, tuple)): + inherits_parents = [] + + for parent in inherits_parents: + if parent and parent != model_name and parent in env: + inheritance_edges.append( + { + "id": f"inh::{model_name}::{parent}", + "child": model_name, + "parent": parent, + "type": "classical", + } + ) + + delegations = getattr(model_cls, "_inherits", {}) + if isinstance(delegations, dict): + for parent_model, field_via in delegations.items(): + if parent_model in env: + inheritance_edges.append( + { + "id": f"inh_del::{model_name}::{parent_model}", + "child": model_name, + "parent": parent_model, + "type": "delegation", + "via_field": field_via, + } + ) + + module_name = ( + module_map.get(model_name) + or getattr(model_cls, "_original_module", None) + or "custom" + ) + + models_data.append( + { + "id": model_name, + "name": getattr(model_cls, "_description", None) or model_name, + "framework": "odoo", + "table": getattr(model_cls, "_table", None), + "table_name": getattr(model_cls, "_table", None), + "module": module_name, + "abstract": getattr(model_cls, "_abstract", False), + "transient": getattr(model_cls, "_transient", False), + "fields": fields_list, + "incoming": incoming, + "outgoing": outgoing, + } + ) + + return { + "framework": "odoo", + "root_path": "Live Odoo Registry", + "models": models_data, + "relationships": relationships_data, + "inheritance_edges": inheritance_edges, + "stats": { + "models": len(models_data), + "relationships": len(relationships_data), + "inheritance_edges": len(inheritance_edges), + }, + } + + def _bfs_shortest_path(self, graph_data: dict, start: str, target: str) -> dict | None: + adj = {} + for r in graph_data.get("relationships", []): + s, t, f, tp = r["source"], r["target"], r["field"], r["type"] + adj.setdefault(s, []).append((t, f, tp)) + + queue = deque([(start, [start], [])]) + visited = {start} + + while queue: + current, path_nodes, path_edges = queue.popleft() + if current == target: + return { + "nodes": path_nodes, + "edges": path_edges, + "length": len(path_edges), + } + + for neighbor, field_name, rel_type in adj.get(current, []): + if neighbor not in visited: + visited.add(neighbor) + edge_info = { + "source": current, + "target": neighbor, + "field": field_name, + "type": rel_type, + } + queue.append((neighbor, [*path_nodes, neighbor], [*path_edges, edge_info])) + + return None diff --git a/ormgraph_odoo/docs/images/01_studio_overview.png b/ormgraph_odoo/docs/images/01_studio_overview.png new file mode 100644 index 00000000000..99fd98b8031 Binary files /dev/null and b/ormgraph_odoo/docs/images/01_studio_overview.png differ diff --git a/ormgraph_odoo/docs/images/02_module_graph.png b/ormgraph_odoo/docs/images/02_module_graph.png new file mode 100644 index 00000000000..0da4e7c960a Binary files /dev/null and b/ormgraph_odoo/docs/images/02_module_graph.png differ diff --git a/ormgraph_odoo/docs/images/03_erd_cards.png b/ormgraph_odoo/docs/images/03_erd_cards.png new file mode 100644 index 00000000000..cf4cfcaa71f Binary files /dev/null and b/ormgraph_odoo/docs/images/03_erd_cards.png differ diff --git a/ormgraph_odoo/docs/images/04_relational_pathfinder.png b/ormgraph_odoo/docs/images/04_relational_pathfinder.png new file mode 100644 index 00000000000..b7624fcb431 Binary files /dev/null and b/ormgraph_odoo/docs/images/04_relational_pathfinder.png differ diff --git a/ormgraph_odoo/docs/images/05_architecture_health_export.png b/ormgraph_odoo/docs/images/05_architecture_health_export.png new file mode 100644 index 00000000000..59227de65af Binary files /dev/null and b/ormgraph_odoo/docs/images/05_architecture_health_export.png differ diff --git a/ormgraph_odoo/docs/images/06_erd.png b/ormgraph_odoo/docs/images/06_erd.png new file mode 100644 index 00000000000..213522ff53d Binary files /dev/null and b/ormgraph_odoo/docs/images/06_erd.png differ diff --git a/ormgraph_odoo/docs/images/07_graph.png b/ormgraph_odoo/docs/images/07_graph.png new file mode 100644 index 00000000000..58d19a9f5e7 Binary files /dev/null and b/ormgraph_odoo/docs/images/07_graph.png differ diff --git a/ormgraph_odoo/models/__init__.py b/ormgraph_odoo/models/__init__.py new file mode 100644 index 00000000000..40eae471d1d --- /dev/null +++ b/ormgraph_odoo/models/__init__.py @@ -0,0 +1,10 @@ +# -------------------------------------------------------------------------- +# ORMGraph for Odoo — Live Architecture & ERD Studio +# Author: Piyush Kumar (iam-piyush) +# Website: https://iampiyush.one +# Description: Interactive ORM architecture intelligence, visual ERDs, and +# relational dependency pathfinding for Odoo models. +# License: LGPL-3 (https://www.gnu.org/licenses/lgpl-3.0.html) +# -------------------------------------------------------------------------- + +from . import ir_model diff --git a/ormgraph_odoo/models/ir_model.py b/ormgraph_odoo/models/ir_model.py new file mode 100644 index 00000000000..8e20de2b3ef --- /dev/null +++ b/ormgraph_odoo/models/ir_model.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------- +# ORMGraph for Odoo — Live Architecture & ERD Studio +# Author: Piyush Kumar (iam-piyush) +# Website: https://iampiyush.one +# Description: Interactive ORM architecture intelligence, visual ERDs, and +# relational dependency pathfinding for Odoo models. +# License: LGPL-3 (https://www.gnu.org/licenses/lgpl-3.0.html) +# -------------------------------------------------------------------------- + +from odoo import models + + +class IrModel(models.Model): + _inherit = "ir.model" + + def action_view_ormgraph(self): + self.ensure_one() + return { + "type": "ir.actions.act_url", + "url": f"/ormgraph/studio?focus={self.model}", + "target": "new", + } diff --git a/ormgraph_odoo/pyproject.toml b/ormgraph_odoo/pyproject.toml new file mode 100644 index 00000000000..d856fb004f2 --- /dev/null +++ b/ormgraph_odoo/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.build_backend" diff --git a/ormgraph_odoo/static/description/github.png b/ormgraph_odoo/static/description/github.png new file mode 100644 index 00000000000..68cd1325211 Binary files /dev/null and b/ormgraph_odoo/static/description/github.png differ diff --git a/ormgraph_odoo/static/description/icon.png b/ormgraph_odoo/static/description/icon.png new file mode 100644 index 00000000000..0fb407fff8c Binary files /dev/null and b/ormgraph_odoo/static/description/icon.png differ diff --git a/ormgraph_odoo/static/description/index.html b/ormgraph_odoo/static/description/index.html new file mode 100644 index 00000000000..ecd5d4bc7cc --- /dev/null +++ b/ormgraph_odoo/static/description/index.html @@ -0,0 +1,226 @@ + + + + + ORMGraph for Odoo — Architecture & ERD Studio + + + +
+ + +
+
+
+

+ ORMGraph for Odoo +

+
+ +
+ + Odoo 17 · 18 · 19 + + + Community & Enterprise + +
+
+ +

+ An interactive architecture intelligence and Entity Relationship Diagram (ERD) studio for Odoo. Designed to explore complex model topologies, trace relational field highways, and export publication-ready diagrams with zero browser freeze. +

+ + + +
+ + +
+
+

+ Key Capabilities +

+
+ +
+ + +
+
+ CANVAS // 01 +
+
+ 0-Load Architecture +
+

+ Select any installed module from the sidebar to instantly render its models, Many2one/One2many links, and 1st-degree foreign dependencies. +

+
+ + +
+
+ ERD STUDIO // 02 +
+
+ Interactive ERD Cards +
+

+ Visual database schema table cards with color-coded badges for relational, numeric, computed, and selection fields with drag & zoom. +

+
+ + +
+
+ RELATIONAL PATHS // 03 +
+
+ BFS Multi-Hop Pathfinder +
+

+ Calculates the shortest relational route between any two database models and generates 1-click ORM dot-notation code (e.g. partner_id.currency_id). +

+
+ + +
+
+ ZIP EXPORT // 04 +
+
+ Smart Multi-Cluster Exporter +
+

+ Auto-detects large graphs (> 20 models) and partitions them into Hub sub-graphs, bundling crisp watermarked PNGs into a downloadable ZIP archive. +

+
+ + +
+
+ INTEGRATION // 05 +
+
+ 1-Click Model Stat Button +
+

+ Direct "Architecture Visualizer" smart button integrated inside Settings ➔ Technical ➔ Database Structure ➔ Models for immediate model inspection. +

+
+ + +
+
+ DIAGNOSTICS // 06 +
+
+ Architecture Health & Schema +
+

+ Explore full database schemas, circular dependencies, isolated orphan models, degree centrality, and model inheritance hierarchies in one dashboard. +

+
+
+
+ + +
+
+

+ Quick Start Guide +

+
+ +
+
+
+ STEP 01 +
+
+ Open Studio +
+

+ Launch from the Odoo Main Apps Drawer or click the Smart Button in any Technical Model Form. +

+
+ +
+
+ STEP 02 +
+
+ Select a Module +
+

+ Pick any installed module (e.g. sale, fleet, account) from the left sidebar to generate its live jaal. +

+
+ +
+
+ STEP 03 +
+
+ Explore & Export +
+

+ Switch to ERD Cards, trace Pathfinder highways, and download high-res PNG or multi-cluster ZIP bundles. +

+
+
+
+ + +
+
+
+
+ DEVELOPER & ARCHITECT +
+

+ PIYUSH KUMAR +

+
+ +
+ + FULL-STACK SOFTWARE ENGINEER +
+
+ +

+ Crafted by Piyush Kumar, Full-Stack Software Engineer & Odoo Specialist based in Gurugram, India. Building high-performance developer tooling, backend systems, and AI-powered software solutions. +

+ + + +
+ + +
+ ORMGRAPH FOR ODOO • BY PIYUSH KUMAR • LGPL-3 LICENSE +
+ +
+ + + diff --git a/ormgraph_odoo/static/description/linkedin.png b/ormgraph_odoo/static/description/linkedin.png new file mode 100644 index 00000000000..cb36466a253 Binary files /dev/null and b/ormgraph_odoo/static/description/linkedin.png differ diff --git a/ormgraph_odoo/static/description/portfolio.png b/ormgraph_odoo/static/description/portfolio.png new file mode 100644 index 00000000000..d8a0abd4805 Binary files /dev/null and b/ormgraph_odoo/static/description/portfolio.png differ diff --git a/ormgraph_odoo/static/description/x.png b/ormgraph_odoo/static/description/x.png new file mode 100644 index 00000000000..84d34858822 Binary files /dev/null and b/ormgraph_odoo/static/description/x.png differ diff --git a/ormgraph_odoo/static/src/404.html b/ormgraph_odoo/static/src/404.html new file mode 100644 index 00000000000..2108d880286 --- /dev/null +++ b/ormgraph_odoo/static/src/404.html @@ -0,0 +1 @@ +404: This page could not be found.ORMGraph for Odoo — by Piyush

404

This page could not be found.

\ No newline at end of file diff --git a/ormgraph_odoo/static/src/404/index.html b/ormgraph_odoo/static/src/404/index.html new file mode 100644 index 00000000000..2108d880286 --- /dev/null +++ b/ormgraph_odoo/static/src/404/index.html @@ -0,0 +1 @@ +404: This page could not be found.ORMGraph for Odoo — by Piyush

404

This page could not be found.

\ No newline at end of file diff --git a/ormgraph_odoo/static/src/_next/static/chunks/117-220a1390941f43d8.js b/ormgraph_odoo/static/src/_next/static/chunks/117-220a1390941f43d8.js new file mode 100644 index 00000000000..9ddf3bfdae1 --- /dev/null +++ b/ormgraph_odoo/static/src/_next/static/chunks/117-220a1390941f43d8.js @@ -0,0 +1,2 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[117],{65157:function(e,t){"use strict";function n(){return""}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDeploymentIdQueryOrEmptyString",{enumerable:!0,get:function(){return n}})},91572:function(){"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{configurable:!0,get:function(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(e,t){return t=this.concat.apply([],this),e>1&&t.some(Array.isArray)?t.flat(e-1):t},Array.prototype.flatMap=function(e,t){return this.map(e,t).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(e){if("function"!=typeof e)return this.then(e,e);var t=this.constructor||Promise;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){throw n})})}),Object.fromEntries||(Object.fromEntries=function(e){return Array.from(e).reduce(function(e,t){return e[t[0]]=t[1],e},{})}),Array.prototype.at||(Array.prototype.at=function(e){var t=Math.trunc(e)||0;if(t<0&&(t+=this.length),!(t<0||t>=this.length))return this[t]}),Object.hasOwn||(Object.hasOwn=function(e,t){if(null==e)throw TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(e),t)}),"canParse"in URL||(URL.canParse=function(e,t){try{return new URL(e,t),!0}catch(e){return!1}})},1634:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addBasePath",{enumerable:!0,get:function(){return u}});let r=n(68498),o=n(33068);function u(e,t){return(0,o.normalizePathTrailingSlash)((0,r.addPathPrefix)(e,""))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},75266:function(e,t){"use strict";function n(e){var t,n;t=self.__next_s,n=()=>{e()},t&&t.length?t.reduce((e,t)=>{let[n,r]=t;return e.then(()=>new Promise((e,t)=>{let o=document.createElement("script");if(r)for(let e in r)"children"!==e&&o.setAttribute(e,r[e]);n?(o.src=n,o.onload=()=>e(),o.onerror=t):r&&(o.innerHTML=r.children,setTimeout(e)),document.head.appendChild(o)}))},Promise.resolve()).catch(e=>{console.error(e)}).then(()=>{n()}):n()}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"appBootstrap",{enumerable:!0,get:function(){return n}}),window.next={version:"14.2.35",appDir:!0},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},83079:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"callServer",{enumerable:!0,get:function(){return o}});let r=n(12846);async function o(e,t){let n=(0,r.getServerActionDispatcher)();if(!n)throw Error("Invariant: missing action dispatcher.");return new Promise((r,o)=>{n({actionId:e,actionArgs:t,resolve:r,reject:o})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},92304:function(e,t,n){"use strict";let r,o;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hydrate",{enumerable:!0,get:function(){return x}});let u=n(47043),l=n(53099),a=n(57437);n(91572);let i=u._(n(34040)),c=l._(n(2265)),s=n(6671),f=n(48701),d=u._(n(61404)),p=n(83079),h=n(89721),y=n(2103);n(70647);let _=window.console.error;window.console.error=function(){for(var e=arguments.length,t=Array(e),n=0;n{if((0,h.isNextRouterError)(e.error)){e.preventDefault();return}});let v=document,b=new TextEncoder,g=!1,m=!1,R=null;function P(e){if(0===e[0])r=[];else if(1===e[0]){if(!r)throw Error("Unexpected server data: missing bootstrap script.");o?o.enqueue(b.encode(e[1])):r.push(e[1])}else 2===e[0]&&(R=e[1])}let j=function(){o&&!m&&(o.close(),m=!0,r=void 0),g=!0};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",j,!1):j();let O=self.__next_f=self.__next_f||[];O.forEach(P),O.push=P;let E=new ReadableStream({start(e){r&&(r.forEach(t=>{e.enqueue(b.encode(t))}),g&&!m&&(e.close(),m=!0,r=void 0)),o=e}}),S=(0,s.createFromReadableStream)(E,{callServer:p.callServer});function w(){return(0,c.use)(S)}let M=c.default.StrictMode;function T(e){let{children:t}=e;return t}function x(){let e=(0,y.createMutableActionQueue)(),t=(0,a.jsx)(M,{children:(0,a.jsx)(f.HeadManagerContext.Provider,{value:{appDir:!0},children:(0,a.jsx)(y.ActionQueueContext.Provider,{value:e,children:(0,a.jsx)(T,{children:(0,a.jsx)(w,{})})})})}),n=window.__next_root_layout_missing_tags,r=!!(null==n?void 0:n.length),o={onRecoverableError:d.default};"__next_error__"===document.documentElement.id||r?i.default.createRoot(v,o).render(t):c.default.startTransition(()=>i.default.hydrateRoot(v,t,{...o,formState:R}))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},54278:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(19506),(0,n(75266).appBootstrap)(()=>{let{hydrate:e}=n(92304);n(12846),n(4707),e()}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},19506:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(65157);{let e=n.u;n.u=function(){for(var t=arguments.length,n=Array(t),r=0;r(l(function(){var e;let t=document.getElementsByName(u)[0];if(null==t?void 0:null==(e=t.shadowRoot)?void 0:e.childNodes[0])return t.shadowRoot.childNodes[0];{let e=document.createElement(u);e.style.cssText="position:absolute";let t=document.createElement("div");return t.ariaLive="assertive",t.id="__next-route-announcer__",t.role="alert",t.style.cssText="position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal",e.attachShadow({mode:"open"}).appendChild(t),document.body.appendChild(e),t}}()),()=>{let e=document.getElementsByTagName(u)[0];(null==e?void 0:e.isConnected)&&document.body.removeChild(e)}),[]);let[a,i]=(0,r.useState)(""),c=(0,r.useRef)();return(0,r.useEffect)(()=>{let e="";if(document.title)e=document.title;else{let t=document.querySelector("h1");t&&(e=t.innerText||t.textContent||"")}void 0!==c.current&&c.current!==e&&i(e),c.current=e},[t]),n?(0,o.createPortal)(a,n):null}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6866:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ACTION:function(){return r},FLIGHT_PARAMETERS:function(){return i},NEXT_DID_POSTPONE_HEADER:function(){return s},NEXT_ROUTER_PREFETCH_HEADER:function(){return u},NEXT_ROUTER_STATE_TREE:function(){return o},NEXT_RSC_UNION_QUERY:function(){return c},NEXT_URL:function(){return l},RSC_CONTENT_TYPE_HEADER:function(){return a},RSC_HEADER:function(){return n}});let n="RSC",r="Next-Action",o="Next-Router-State-Tree",u="Next-Router-Prefetch",l="Next-Url",a="text/x-component",i=[[n],[o],[u]],c="_rsc",s="x-nextjs-postponed";("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},12846:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createEmptyCacheNode:function(){return C},default:function(){return I},getServerActionDispatcher:function(){return S},urlToUrlWithoutFlightMarker:function(){return M}});let r=n(53099),o=n(57437),u=r._(n(2265)),l=n(61956),a=n(24673),i=n(33456),c=n(79060),s=n(47744),f=n(61060),d=n(82952),p=n(86146),h=n(1634),y=n(6495),_=n(4123),v=n(39320),b=n(38137),g=n(6866),m=n(35076),R=n(11283),P=n(84541),j="undefined"==typeof window,O=j?null:new Map,E=null;function S(){return E}let w={};function M(e){let t=new URL(e,location.origin);if(t.searchParams.delete(g.NEXT_RSC_UNION_QUERY),t.pathname.endsWith(".txt")){let{pathname:e}=t,n=e.endsWith("/index.txt")?10:4;t.pathname=e.slice(0,-n)}return t}function T(e){return e.origin!==window.location.origin}function x(e){let{appRouterState:t,sync:n}=e;return(0,u.useInsertionEffect)(()=>{let{tree:e,pushRef:r,canonicalUrl:o}=t,u={...r.preserveCustomHistoryState?window.history.state:{},__NA:!0,__PRIVATE_NEXTJS_INTERNALS_TREE:e};r.pendingPush&&(0,i.createHrefFromUrl)(new URL(window.location.href))!==o?(r.pendingPush=!1,window.history.pushState(u,"",o)):window.history.replaceState(u,"",o),n(t)},[t,n]),null}function C(){return{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null}}function A(e){null==e&&(e={});let t=window.history.state,n=null==t?void 0:t.__NA;n&&(e.__NA=n);let r=null==t?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE;return r&&(e.__PRIVATE_NEXTJS_INTERNALS_TREE=r),e}function N(e){let{headCacheNode:t}=e,n=null!==t?t.head:null,r=null!==t?t.prefetchHead:null,o=null!==r?r:n;return(0,u.useDeferredValue)(n,o)}function D(e){let t,{buildId:n,initialHead:r,initialTree:i,urlParts:f,initialSeedData:g,couldBeIntercepted:S,assetPrefix:M,missingSlots:C}=e,D=(0,u.useMemo)(()=>(0,d.createInitialRouterState)({buildId:n,initialSeedData:g,urlParts:f,initialTree:i,initialParallelRoutes:O,location:j?null:window.location,initialHead:r,couldBeIntercepted:S}),[n,g,f,i,r,S]),[I,U,k]=(0,s.useReducerWithReduxDevtools)(D);(0,u.useEffect)(()=>{O=null},[]);let{canonicalUrl:F}=(0,s.useUnwrapState)(I),{searchParams:L,pathname:H}=(0,u.useMemo)(()=>{let e=new URL(F,"undefined"==typeof window?"http://n":window.location.href);return{searchParams:e.searchParams,pathname:(0,R.hasBasePath)(e.pathname)?(0,m.removeBasePath)(e.pathname):e.pathname}},[F]),$=(0,u.useCallback)(e=>{let{previousTree:t,serverResponse:n}=e;(0,u.startTransition)(()=>{U({type:a.ACTION_SERVER_PATCH,previousTree:t,serverResponse:n})})},[U]),G=(0,u.useCallback)((e,t,n)=>{let r=new URL((0,h.addBasePath)(e),location.href);return U({type:a.ACTION_NAVIGATE,url:r,isExternalUrl:T(r),locationSearch:location.search,shouldScroll:null==n||n,navigateType:t})},[U]);E=(0,u.useCallback)(e=>{(0,u.startTransition)(()=>{U({...e,type:a.ACTION_SERVER_ACTION})})},[U]);let z=(0,u.useMemo)(()=>({back:()=>window.history.back(),forward:()=>window.history.forward(),prefetch:(e,t)=>{let n;if(!(0,p.isBot)(window.navigator.userAgent)){try{n=new URL((0,h.addBasePath)(e),window.location.href)}catch(t){throw Error("Cannot prefetch '"+e+"' because it cannot be converted to a URL.")}T(n)||(0,u.startTransition)(()=>{var e;U({type:a.ACTION_PREFETCH,url:n,kind:null!=(e=null==t?void 0:t.kind)?e:a.PrefetchKind.FULL})})}},replace:(e,t)=>{void 0===t&&(t={}),(0,u.startTransition)(()=>{var n;G(e,"replace",null==(n=t.scroll)||n)})},push:(e,t)=>{void 0===t&&(t={}),(0,u.startTransition)(()=>{var n;G(e,"push",null==(n=t.scroll)||n)})},refresh:()=>{(0,u.startTransition)(()=>{U({type:a.ACTION_REFRESH,origin:window.location.origin})})},fastRefresh:()=>{throw Error("fastRefresh can only be used in development mode. Please use refresh instead.")}}),[U,G]);(0,u.useEffect)(()=>{window.next&&(window.next.router=z)},[z]),(0,u.useEffect)(()=>{function e(e){var t;e.persisted&&(null==(t=window.history.state)?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE)&&(w.pendingMpaPath=void 0,U({type:a.ACTION_RESTORE,url:new URL(window.location.href),tree:window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE}))}return window.addEventListener("pageshow",e),()=>{window.removeEventListener("pageshow",e)}},[U]);let{pushRef:B}=(0,s.useUnwrapState)(I);if(B.mpaNavigation){if(w.pendingMpaPath!==F){let e=window.location;B.pendingPush?e.assign(F):e.replace(F),w.pendingMpaPath=F}(0,u.use)(b.unresolvedThenable)}(0,u.useEffect)(()=>{let e=window.history.pushState.bind(window.history),t=window.history.replaceState.bind(window.history),n=e=>{var t;let n=window.location.href,r=null==(t=window.history.state)?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE;(0,u.startTransition)(()=>{U({type:a.ACTION_RESTORE,url:new URL(null!=e?e:n,n),tree:r})})};window.history.pushState=function(t,r,o){return(null==t?void 0:t.__NA)||(null==t?void 0:t._N)||(t=A(t),o&&n(o)),e(t,r,o)},window.history.replaceState=function(e,r,o){return(null==e?void 0:e.__NA)||(null==e?void 0:e._N)||(e=A(e),o&&n(o)),t(e,r,o)};let r=e=>{let{state:t}=e;if(t){if(!t.__NA){window.location.reload();return}(0,u.startTransition)(()=>{U({type:a.ACTION_RESTORE,url:new URL(window.location.href),tree:t.__PRIVATE_NEXTJS_INTERNALS_TREE})})}};return window.addEventListener("popstate",r),()=>{window.history.pushState=e,window.history.replaceState=t,window.removeEventListener("popstate",r)}},[U]);let{cache:W,tree:K,nextUrl:V,focusAndScrollRef:Y}=(0,s.useUnwrapState)(I),X=(0,u.useMemo)(()=>(0,v.findHeadInCache)(W,K[1]),[W,K]),q=(0,u.useMemo)(()=>(function e(t,n){for(let r of(void 0===n&&(n={}),Object.values(t[1]))){let t=r[0],o=Array.isArray(t),u=o?t[1]:t;!u||u.startsWith(P.PAGE_SEGMENT_KEY)||(o&&("c"===t[2]||"oc"===t[2])?n[t[0]]=t[1].split("/"):o&&(n[t[0]]=t[1]),n=e(r,n))}return n})(K),[K]);if(null!==X){let[e,n]=X;t=(0,o.jsx)(N,{headCacheNode:e},n)}else t=null;let J=(0,o.jsxs)(_.RedirectBoundary,{children:[t,W.rsc,(0,o.jsx)(y.AppRouterAnnouncer,{tree:K})]});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(x,{appRouterState:(0,s.useUnwrapState)(I),sync:k}),(0,o.jsx)(c.PathParamsContext.Provider,{value:q,children:(0,o.jsx)(c.PathnameContext.Provider,{value:H,children:(0,o.jsx)(c.SearchParamsContext.Provider,{value:L,children:(0,o.jsx)(l.GlobalLayoutRouterContext.Provider,{value:{buildId:n,changeByServerResponse:$,tree:K,focusAndScrollRef:Y,nextUrl:V},children:(0,o.jsx)(l.AppRouterContext.Provider,{value:z,children:(0,o.jsx)(l.LayoutRouterContext.Provider,{value:{childNodes:W.parallelRoutes,tree:K,url:F,loading:W.loading},children:J})})})})})})]})}function I(e){let{globalErrorComponent:t,...n}=e;return(0,o.jsx)(f.ErrorBoundary,{errorComponent:t,children:(0,o.jsx)(D,{...n})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},96149:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"bailoutToClientRendering",{enumerable:!0,get:function(){return u}});let r=n(18993),o=n(51845);function u(e){let t=o.staticGenerationAsyncStorage.getStore();if((null==t||!t.forceStatic)&&(null==t?void 0:t.isStaticGeneration))throw new r.BailoutToCSRError(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},19107:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ClientPageRoot",{enumerable:!0,get:function(){return u}});let r=n(57437),o=n(54535);function u(e){let{Component:t,props:n}=e;return n.searchParams=(0,o.createDynamicallyTrackedSearchParams)(n.searchParams||{}),(0,r.jsx)(t,{...n})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},61060:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ErrorBoundary:function(){return h},ErrorBoundaryHandler:function(){return f},GlobalError:function(){return d},default:function(){return p}});let r=n(47043),o=n(57437),u=r._(n(2265)),l=n(35475),a=n(89721),i=n(51845),c={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},text:{fontSize:"14px",fontWeight:400,lineHeight:"28px",margin:"0 8px"}};function s(e){let{error:t}=e,n=i.staticGenerationAsyncStorage.getStore();if((null==n?void 0:n.isRevalidate)||(null==n?void 0:n.isStaticGeneration))throw console.error(t),t;return null}class f extends u.default.Component{static getDerivedStateFromError(e){if((0,a.isNextRouterError)(e))throw e;return{error:e}}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.error?{error:null,previousPathname:e.pathname}:{error:t.error,previousPathname:e.pathname}}render(){return this.state.error?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s,{error:this.state.error}),this.props.errorStyles,this.props.errorScripts,(0,o.jsx)(this.props.errorComponent,{error:this.state.error,reset:this.reset})]}):this.props.children}constructor(e){super(e),this.reset=()=>{this.setState({error:null})},this.state={error:null,previousPathname:this.props.pathname}}}function d(e){let{error:t}=e,n=null==t?void 0:t.digest;return(0,o.jsxs)("html",{id:"__next_error__",children:[(0,o.jsx)("head",{}),(0,o.jsxs)("body",{children:[(0,o.jsx)(s,{error:t}),(0,o.jsx)("div",{style:c.error,children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{style:c.text,children:"Application error: a "+(n?"server":"client")+"-side exception has occurred (see the "+(n?"server logs":"browser console")+" for more information)."}),n?(0,o.jsx)("p",{style:c.text,children:"Digest: "+n}):null]})})]})]})}let p=d;function h(e){let{errorComponent:t,errorStyles:n,errorScripts:r,children:u}=e,a=(0,l.usePathname)();return t?(0,o.jsx)(f,{pathname:a,errorComponent:t,errorStyles:n,errorScripts:r,children:u}):(0,o.jsx)(o.Fragment,{children:u})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},46177:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DynamicServerError:function(){return r},isDynamicServerError:function(){return o}});let n="DYNAMIC_SERVER_USAGE";class r extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=n}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},89721:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNextRouterError",{enumerable:!0,get:function(){return u}});let r=n(98200),o=n(88968);function u(e){return e&&e.digest&&((0,o.isRedirectError)(e)||(0,r.isNotFoundError)(e))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4707:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return E}});let r=n(47043),o=n(53099),u=n(57437),l=o._(n(2265)),a=r._(n(54887)),i=n(61956),c=n(44848),s=n(38137),f=n(61060),d=n(76015),p=n(7092),h=n(4123),y=n(80),_=n(73171),v=n(78505),b=n(28077),g=["bottom","height","left","right","top","width","x","y"];function m(e,t){let n=e.getBoundingClientRect();return n.top>=0&&n.top<=t}class R extends l.default.Component{componentDidMount(){this.handlePotentialScroll()}componentDidUpdate(){this.props.focusAndScrollRef.apply&&this.handlePotentialScroll()}render(){return this.props.children}constructor(...e){super(...e),this.handlePotentialScroll=()=>{let{focusAndScrollRef:e,segmentPath:t}=this.props;if(e.apply){var n;if(0!==e.segmentPaths.length&&!e.segmentPaths.some(e=>t.every((t,n)=>(0,d.matchSegment)(t,e[n]))))return;let r=null,o=e.hashFragment;if(o&&(r="top"===o?document.body:null!=(n=document.getElementById(o))?n:document.getElementsByName(o)[0]),r||(r="undefined"==typeof window?null:a.default.findDOMNode(this)),!(r instanceof Element))return;for(;!(r instanceof HTMLElement)||function(e){if(["sticky","fixed"].includes(getComputedStyle(e).position))return!0;let t=e.getBoundingClientRect();return g.every(e=>0===t[e])}(r);){if(null===r.nextElementSibling)return;r=r.nextElementSibling}e.apply=!1,e.hashFragment=null,e.segmentPaths=[],(0,p.handleSmoothScroll)(()=>{if(o){r.scrollIntoView();return}let e=document.documentElement,t=e.clientHeight;!m(r,t)&&(e.scrollTop=0,m(r,t)||r.scrollIntoView())},{dontForceLayout:!0,onlyHashChange:e.onlyHashChange}),e.onlyHashChange=!1,r.focus()}}}}function P(e){let{segmentPath:t,children:n}=e,r=(0,l.useContext)(i.GlobalLayoutRouterContext);if(!r)throw Error("invariant global layout router not mounted");return(0,u.jsx)(R,{segmentPath:t,focusAndScrollRef:r.focusAndScrollRef,children:n})}function j(e){let{parallelRouterKey:t,url:n,childNodes:r,segmentPath:o,tree:a,cacheKey:f}=e,p=(0,l.useContext)(i.GlobalLayoutRouterContext);if(!p)throw Error("invariant global layout router not mounted");let{buildId:h,changeByServerResponse:y,tree:_}=p,v=r.get(f);if(void 0===v){let e={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null};v=e,r.set(f,e)}let g=null!==v.prefetchRsc?v.prefetchRsc:v.rsc,m=(0,l.useDeferredValue)(v.rsc,g),R="object"==typeof m&&null!==m&&"function"==typeof m.then?(0,l.use)(m):m;if(!R){let e=v.lazyData;if(null===e){let t=function e(t,n){if(t){let[r,o]=t,u=2===t.length;if((0,d.matchSegment)(n[0],r)&&n[1].hasOwnProperty(o)){if(u){let t=e(void 0,n[1][o]);return[n[0],{...n[1],[o]:[t[0],t[1],t[2],"refetch"]}]}return[n[0],{...n[1],[o]:e(t.slice(2),n[1][o])}]}}return n}(["",...o],_),r=(0,b.hasInterceptionRouteInCurrentTree)(_);v.lazyData=e=(0,c.fetchServerResponse)(new URL(n,location.origin),t,r?p.nextUrl:null,h),v.lazyDataResolved=!1}let t=(0,l.use)(e);v.lazyDataResolved||(setTimeout(()=>{(0,l.startTransition)(()=>{y({previousTree:_,serverResponse:t})})}),v.lazyDataResolved=!0),(0,l.use)(s.unresolvedThenable)}return(0,u.jsx)(i.LayoutRouterContext.Provider,{value:{tree:a[1][t],childNodes:v.parallelRoutes,url:n,loading:v.loading},children:R})}function O(e){let{children:t,hasLoading:n,loading:r,loadingStyles:o,loadingScripts:a}=e;return n?(0,u.jsx)(l.Suspense,{fallback:(0,u.jsxs)(u.Fragment,{children:[o,a,r]}),children:t}):(0,u.jsx)(u.Fragment,{children:t})}function E(e){let{parallelRouterKey:t,segmentPath:n,error:r,errorStyles:o,errorScripts:a,templateStyles:c,templateScripts:s,template:d,notFound:p,notFoundStyles:b}=e,g=(0,l.useContext)(i.LayoutRouterContext);if(!g)throw Error("invariant expected layout router to be mounted");let{childNodes:m,tree:R,url:E,loading:S}=g,w=m.get(t);w||(w=new Map,m.set(t,w));let M=R[1][t][0],T=(0,_.getSegmentValue)(M),x=[M];return(0,u.jsx)(u.Fragment,{children:x.map(e=>{let l=(0,_.getSegmentValue)(e),g=(0,v.createRouterCacheKey)(e);return(0,u.jsxs)(i.TemplateContext.Provider,{value:(0,u.jsx)(P,{segmentPath:n,children:(0,u.jsx)(f.ErrorBoundary,{errorComponent:r,errorStyles:o,errorScripts:a,children:(0,u.jsx)(O,{hasLoading:!!S,loading:null==S?void 0:S[0],loadingStyles:null==S?void 0:S[1],loadingScripts:null==S?void 0:S[2],children:(0,u.jsx)(y.NotFoundBoundary,{notFound:p,notFoundStyles:b,children:(0,u.jsx)(h.RedirectBoundary,{children:(0,u.jsx)(j,{parallelRouterKey:t,url:E,tree:R,childNodes:w,segmentPath:n,cacheKey:g,isActive:T===l})})})})})}),children:[c,s,d]},(0,v.createRouterCacheKey)(e,!0))})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},76015:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{canSegmentBeOverridden:function(){return u},matchSegment:function(){return o}});let r=n(87417),o=(e,t)=>"string"==typeof e?"string"==typeof t&&e===t:"string"!=typeof t&&e[0]===t[0]&&e[1]===t[1],u=(e,t)=>{var n;return!Array.isArray(e)&&!!Array.isArray(t)&&(null==(n=(0,r.getSegmentParam)(e))?void 0:n.param)===t[0]};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},35475:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return i.ReadonlyURLSearchParams},RedirectType:function(){return i.RedirectType},ServerInsertedHTMLContext:function(){return c.ServerInsertedHTMLContext},notFound:function(){return i.notFound},permanentRedirect:function(){return i.permanentRedirect},redirect:function(){return i.redirect},useParams:function(){return p},usePathname:function(){return f},useRouter:function(){return d},useSearchParams:function(){return s},useSelectedLayoutSegment:function(){return y},useSelectedLayoutSegments:function(){return h},useServerInsertedHTML:function(){return c.useServerInsertedHTML}});let r=n(2265),o=n(61956),u=n(79060),l=n(73171),a=n(84541),i=n(52646),c=n(55501);function s(){let e=(0,r.useContext)(u.SearchParamsContext),t=(0,r.useMemo)(()=>e?new i.ReadonlyURLSearchParams(e):null,[e]);if("undefined"==typeof window){let{bailoutToClientRendering:e}=n(96149);e("useSearchParams()")}return t}function f(){return(0,r.useContext)(u.PathnameContext)}function d(){let e=(0,r.useContext)(o.AppRouterContext);if(null===e)throw Error("invariant expected app router to be mounted");return e}function p(){return(0,r.useContext)(u.PathParamsContext)}function h(e){void 0===e&&(e="children");let t=(0,r.useContext)(o.LayoutRouterContext);return t?function e(t,n,r,o){let u;if(void 0===r&&(r=!0),void 0===o&&(o=[]),r)u=t[1][n];else{var i;let e=t[1];u=null!=(i=e.children)?i:Object.values(e)[0]}if(!u)return o;let c=u[0],s=(0,l.getSegmentValue)(c);return!s||s.startsWith(a.PAGE_SEGMENT_KEY)?o:(o.push(s),e(u,n,!1,o))}(t.tree,e):null}function y(e){void 0===e&&(e="children");let t=h(e);if(!t||0===t.length)return null;let n="children"===e?t[0]:t[t.length-1];return n===a.DEFAULT_SEGMENT_KEY?null:n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},52646:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return l},RedirectType:function(){return r.RedirectType},notFound:function(){return o.notFound},permanentRedirect:function(){return r.permanentRedirect},redirect:function(){return r.redirect}});let r=n(88968),o=n(98200);class u extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class l extends URLSearchParams{append(){throw new u}delete(){throw new u}set(){throw new u}sort(){throw new u}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},80:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NotFoundBoundary",{enumerable:!0,get:function(){return s}});let r=n(53099),o=n(57437),u=r._(n(2265)),l=n(35475),a=n(98200);n(31765);let i=n(61956);class c extends u.default.Component{componentDidCatch(){}static getDerivedStateFromError(e){if((0,a.isNotFoundError)(e))return{notFoundTriggered:!0};throw e}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.notFoundTriggered?{notFoundTriggered:!1,previousPathname:e.pathname}:{notFoundTriggered:t.notFoundTriggered,previousPathname:e.pathname}}render(){return this.state.notFoundTriggered?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("meta",{name:"robots",content:"noindex"}),!1,this.props.notFoundStyles,this.props.notFound]}):this.props.children}constructor(e){super(e),this.state={notFoundTriggered:!!e.asNotFound,previousPathname:e.pathname}}}function s(e){let{notFound:t,notFoundStyles:n,asNotFound:r,children:a}=e,s=(0,l.usePathname)(),f=(0,u.useContext)(i.MissingSlotContext);return t?(0,o.jsx)(c,{pathname:s,notFound:t,notFoundStyles:n,asNotFound:r,missingSlots:f,children:a}):(0,o.jsx)(o.Fragment,{children:a})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},98200:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{isNotFoundError:function(){return o},notFound:function(){return r}});let n="NEXT_NOT_FOUND";function r(){let e=Error(n);throw e.digest=n,e}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},29744:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PromiseQueue",{enumerable:!0,get:function(){return c}});let r=n(2522),o=n(90675);var u=o._("_maxConcurrency"),l=o._("_runningCount"),a=o._("_queue"),i=o._("_processNext");class c{enqueue(e){let t,n;let o=new Promise((e,r)=>{t=e,n=r}),u=async()=>{try{r._(this,l)[l]++;let n=await e();t(n)}catch(e){n(e)}finally{r._(this,l)[l]--,r._(this,i)[i]()}};return r._(this,a)[a].push({promiseFn:o,task:u}),r._(this,i)[i](),o}bump(e){let t=r._(this,a)[a].findIndex(t=>t.promiseFn===e);if(t>-1){let e=r._(this,a)[a].splice(t,1)[0];r._(this,a)[a].unshift(e),r._(this,i)[i](!0)}}constructor(e=5){Object.defineProperty(this,i,{value:s}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:void 0}),r._(this,u)[u]=e,r._(this,l)[l]=0,r._(this,a)[a]=[]}}function s(e){if(void 0===e&&(e=!1),(r._(this,l)[l]0){var t;null==(t=r._(this,a)[a].shift())||t.task()}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4123:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RedirectBoundary:function(){return s},RedirectErrorBoundary:function(){return c}});let r=n(53099),o=n(57437),u=r._(n(2265)),l=n(35475),a=n(88968);function i(e){let{redirect:t,reset:n,redirectType:r}=e,o=(0,l.useRouter)();return(0,u.useEffect)(()=>{u.default.startTransition(()=>{r===a.RedirectType.push?o.push(t,{}):o.replace(t,{}),n()})},[t,r,n,o]),null}class c extends u.default.Component{static getDerivedStateFromError(e){if((0,a.isRedirectError)(e))return{redirect:(0,a.getURLFromRedirectError)(e),redirectType:(0,a.getRedirectTypeFromError)(e)};throw e}render(){let{redirect:e,redirectType:t}=this.state;return null!==e&&null!==t?(0,o.jsx)(i,{redirect:e,redirectType:t,reset:()=>this.setState({redirect:null})}):this.props.children}constructor(e){super(e),this.state={redirect:null,redirectType:null}}}function s(e){let{children:t}=e,n=(0,l.useRouter)();return(0,o.jsx)(c,{router:n,children:t})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5001:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RedirectStatusCode",{enumerable:!0,get:function(){return n}}),(r=n||(n={}))[r.SeeOther=303]="SeeOther",r[r.TemporaryRedirect=307]="TemporaryRedirect",r[r.PermanentRedirect=308]="PermanentRedirect",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},88968:function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RedirectType:function(){return r},getRedirectError:function(){return c},getRedirectStatusCodeFromError:function(){return y},getRedirectTypeFromError:function(){return h},getURLFromRedirectError:function(){return p},isRedirectError:function(){return d},permanentRedirect:function(){return f},redirect:function(){return s}});let u=n(20544),l=n(90295),a=n(5001),i="NEXT_REDIRECT";function c(e,t,n){void 0===n&&(n=a.RedirectStatusCode.TemporaryRedirect);let r=Error(i);r.digest=i+";"+t+";"+e+";"+n+";";let o=u.requestAsyncStorage.getStore();return o&&(r.mutableCookies=o.mutableCookies),r}function s(e,t){void 0===t&&(t="replace");let n=l.actionAsyncStorage.getStore();throw c(e,t,(null==n?void 0:n.isAction)?a.RedirectStatusCode.SeeOther:a.RedirectStatusCode.TemporaryRedirect)}function f(e,t){void 0===t&&(t="replace");let n=l.actionAsyncStorage.getStore();throw c(e,t,(null==n?void 0:n.isAction)?a.RedirectStatusCode.SeeOther:a.RedirectStatusCode.PermanentRedirect)}function d(e){if("object"!=typeof e||null===e||!("digest"in e)||"string"!=typeof e.digest)return!1;let[t,n,r,o]=e.digest.split(";",4),u=Number(o);return t===i&&("replace"===n||"push"===n)&&"string"==typeof r&&!isNaN(u)&&u in a.RedirectStatusCode}function p(e){return d(e)?e.digest.split(";",3)[2]:null}function h(e){if(!d(e))throw Error("Not a redirect error");return e.digest.split(";",2)[1]}function y(e){if(!d(e))throw Error("Not a redirect error");return Number(e.digest.split(";",4)[3])}(o=r||(r={})).push="push",o.replace="replace",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},36423:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let r=n(53099),o=n(57437),u=r._(n(2265)),l=n(61956);function a(){let e=(0,u.useContext)(l.TemplateContext);return(0,o.jsx)(o.Fragment,{children:e})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},20544:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getExpectedRequestStore:function(){return o},requestAsyncStorage:function(){return r.requestAsyncStorage}});let r=n(25575);function o(e){let t=r.requestAsyncStorage.getStore();if(t)return t;throw Error("`"+e+"` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},22356:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"applyFlightData",{enumerable:!0,get:function(){return u}});let r=n(27420),o=n(92576);function u(e,t,n,u){let[l,a,i]=n.slice(-3);if(null===a)return!1;if(3===n.length){let n=a[2],o=a[3];t.loading=o,t.rsc=n,t.prefetchRsc=null,(0,r.fillLazyItemsTillLeafWithHead)(t,e,l,a,i,u)}else t.rsc=e.rsc,t.prefetchRsc=e.prefetchRsc,t.parallelRoutes=new Map(e.parallelRoutes),t.loading=e.loading,(0,o.fillCacheWithNewSubTreeData)(t,e,n,u);return!0}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81935:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"applyRouterStatePatchToTree",{enumerable:!0,get:function(){return function e(t,n,r,a){let i;let[c,s,f,d,p]=n;if(1===t.length){let e=l(n,r,t);return(0,u.addRefreshMarkerToActiveParallelSegments)(e,a),e}let[h,y]=t;if(!(0,o.matchSegment)(h,c))return null;if(2===t.length)i=l(s[y],r,t);else if(null===(i=e(t.slice(2),s[y],r,a)))return null;let _=[t[0],{...s,[y]:i},f,d];return p&&(_[4]=!0),(0,u.addRefreshMarkerToActiveParallelSegments)(_,a),_}}});let r=n(84541),o=n(76015),u=n(50232);function l(e,t,n){let[u,a]=e,[i,c]=t;if(i===r.DEFAULT_SEGMENT_KEY&&u!==r.DEFAULT_SEGMENT_KEY)return e;if((0,o.matchSegment)(u,i)){let t={};for(let e in a)void 0!==c[e]?t[e]=l(a[e],c[e],n):t[e]=a[e];for(let e in c)t[e]||(t[e]=c[e]);let r=[u,t];return e[2]&&(r[2]=e[2]),e[3]&&(r[3]=e[3]),e[4]&&(r[4]=e[4]),r}return t}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},65556:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"clearCacheNodeDataForSegmentPath",{enumerable:!0,get:function(){return function e(t,n,o){let u=o.length<=2,[l,a]=o,i=(0,r.createRouterCacheKey)(a),c=n.parallelRoutes.get(l),s=t.parallelRoutes.get(l);s&&s!==c||(s=new Map(c),t.parallelRoutes.set(l,s));let f=null==c?void 0:c.get(i),d=s.get(i);if(u){d&&d.lazyData&&d!==f||s.set(i,{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null});return}if(!d||!f){d||s.set(i,{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null});return}return d===f&&(d={lazyData:d.lazyData,rsc:d.rsc,prefetchRsc:d.prefetchRsc,head:d.head,prefetchHead:d.prefetchHead,parallelRoutes:new Map(d.parallelRoutes),lazyDataResolved:d.lazyDataResolved,loading:d.loading},s.set(i,d)),e(d,f,o.slice(2))}}});let r=n(78505);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5410:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{computeChangedPath:function(){return s},extractPathFromFlightRouterState:function(){return c}});let r=n(91182),o=n(84541),u=n(76015),l=e=>"/"===e[0]?e.slice(1):e,a=e=>"string"==typeof e?"children"===e?"":e:e[1];function i(e){return e.reduce((e,t)=>""===(t=l(t))||(0,o.isGroupSegment)(t)?e:e+"/"+t,"")||"/"}function c(e){var t;let n=Array.isArray(e[0])?e[0][1]:e[0];if(n===o.DEFAULT_SEGMENT_KEY||r.INTERCEPTION_ROUTE_MARKERS.some(e=>n.startsWith(e)))return;if(n.startsWith(o.PAGE_SEGMENT_KEY))return"";let u=[a(n)],l=null!=(t=e[1])?t:{},s=l.children?c(l.children):void 0;if(void 0!==s)u.push(s);else for(let[e,t]of Object.entries(l)){if("children"===e)continue;let n=c(t);void 0!==n&&u.push(n)}return i(u)}function s(e,t){let n=function e(t,n){let[o,l]=t,[i,s]=n,f=a(o),d=a(i);if(r.INTERCEPTION_ROUTE_MARKERS.some(e=>f.startsWith(e)||d.startsWith(e)))return"";if(!(0,u.matchSegment)(o,i)){var p;return null!=(p=c(n))?p:""}for(let t in l)if(s[t]){let n=e(l[t],s[t]);if(null!==n)return a(i)+"/"+n}return null}(e,t);return null==n||"/"===n?n:i(n.split("/"))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},33456:function(e,t){"use strict";function n(e,t){return void 0===t&&(t=!0),e.pathname+e.search+(t?e.hash:"")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createHrefFromUrl",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},82952:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createInitialRouterState",{enumerable:!0,get:function(){return c}});let r=n(33456),o=n(27420),u=n(5410),l=n(60305),a=n(24673),i=n(50232);function c(e){var t;let{buildId:n,initialTree:c,initialSeedData:s,urlParts:f,initialParallelRoutes:d,location:p,initialHead:h,couldBeIntercepted:y}=e,_=f.join("/"),v=!p,b={lazyData:null,rsc:s[2],prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:v?new Map:d,lazyDataResolved:!1,loading:s[3]},g=p?(0,r.createHrefFromUrl)(p):_;(0,i.addRefreshMarkerToActiveParallelSegments)(c,g);let m=new Map;(null===d||0===d.size)&&(0,o.fillLazyItemsTillLeafWithHead)(b,void 0,c,s,h);let R={buildId:n,tree:c,cache:b,prefetchCache:m,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:{apply:!1,onlyHashChange:!1,hashFragment:null,segmentPaths:[]},canonicalUrl:g,nextUrl:null!=(t=(0,u.extractPathFromFlightRouterState)(c)||(null==p?void 0:p.pathname))?t:null};if(p){let e=new URL(""+p.pathname+p.search,p.origin),t=[["",c,null,null]];(0,l.createPrefetchCacheEntryForInitialLoad)({url:e,kind:a.PrefetchKind.AUTO,data:[t,void 0,!1,y],tree:R.tree,prefetchCache:R.prefetchCache,nextUrl:R.nextUrl})}return R}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},78505:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRouterCacheKey",{enumerable:!0,get:function(){return o}});let r=n(84541);function o(e,t){return(void 0===t&&(t=!1),Array.isArray(e))?e[0]+"|"+e[1]+"|"+e[2]:t&&e.startsWith(r.PAGE_SEGMENT_KEY)?r.PAGE_SEGMENT_KEY:e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},44848:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fetchServerResponse",{enumerable:!0,get:function(){return f}});let r=n(6866),o=n(12846),u=n(83079),l=n(24673),a=n(37207),i=n(91311),{createFromFetch:c}=n(6671);function s(e){return[(0,o.urlToUrlWithoutFlightMarker)(e).toString(),void 0,!1,!1]}async function f(e,t,n,f,d){let p={[r.RSC_HEADER]:"1",[r.NEXT_ROUTER_STATE_TREE]:(0,i.prepareFlightRouterStateForRequest)(t)};d===l.PrefetchKind.AUTO&&(p[r.NEXT_ROUTER_PREFETCH_HEADER]="1"),n&&(p[r.NEXT_URL]=n);let h=(0,a.hexHash)([p[r.NEXT_ROUTER_PREFETCH_HEADER]||"0",p[r.NEXT_ROUTER_STATE_TREE],p[r.NEXT_URL]].join(","));try{var y;let t=new URL(e);t.pathname.endsWith("/")?t.pathname+="index.txt":t.pathname+=".txt",t.searchParams.set(r.NEXT_RSC_UNION_QUERY,h);let n=await fetch(t,{credentials:"same-origin",headers:p}),l=(0,o.urlToUrlWithoutFlightMarker)(n.url),a=n.redirected?l:void 0,i=n.headers.get("content-type")||"",d=!!n.headers.get(r.NEXT_DID_POSTPONE_HEADER),_=!!(null==(y=n.headers.get("vary"))?void 0:y.includes(r.NEXT_URL)),v=i===r.RSC_CONTENT_TYPE_HEADER;if(v||(v=i.startsWith("text/plain")),!v||!n.ok)return e.hash&&(l.hash=e.hash),s(l.toString());let[b,g]=await c(Promise.resolve(n),{callServer:u.callServer});if(f!==b)return s(n.url);return[g,a,d,_]}catch(t){return console.error("Failed to fetch RSC payload for "+e+". Falling back to browser navigation.",t),[e.toString(),void 0,!1,!1]}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},92576:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fillCacheWithNewSubTreeData",{enumerable:!0,get:function(){return function e(t,n,l,a){let i=l.length<=5,[c,s]=l,f=(0,u.createRouterCacheKey)(s),d=n.parallelRoutes.get(c);if(!d)return;let p=t.parallelRoutes.get(c);p&&p!==d||(p=new Map(d),t.parallelRoutes.set(c,p));let h=d.get(f),y=p.get(f);if(i){if(!y||!y.lazyData||y===h){let e=l[3];y={lazyData:null,rsc:e[2],prefetchRsc:null,head:null,prefetchHead:null,loading:e[3],parallelRoutes:h?new Map(h.parallelRoutes):new Map,lazyDataResolved:!1},h&&(0,r.invalidateCacheByRouterState)(y,h,l[2]),(0,o.fillLazyItemsTillLeafWithHead)(y,h,l[2],e,l[4],a),p.set(f,y)}return}y&&h&&(y===h&&(y={lazyData:y.lazyData,rsc:y.rsc,prefetchRsc:y.prefetchRsc,head:y.head,prefetchHead:y.prefetchHead,parallelRoutes:new Map(y.parallelRoutes),lazyDataResolved:!1,loading:y.loading},p.set(f,y)),e(y,h,l.slice(2),a))}}});let r=n(94377),o=n(27420),u=n(78505);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},27420:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fillLazyItemsTillLeafWithHead",{enumerable:!0,get:function(){return function e(t,n,u,l,a,i){if(0===Object.keys(u[1]).length){t.head=a;return}for(let c in u[1]){let s;let f=u[1][c],d=f[0],p=(0,r.createRouterCacheKey)(d),h=null!==l&&void 0!==l[1][c]?l[1][c]:null;if(n){let r=n.parallelRoutes.get(c);if(r){let n;let u=(null==i?void 0:i.kind)==="auto"&&i.status===o.PrefetchCacheEntryStatus.reusable,l=new Map(r),s=l.get(p);n=null!==h?{lazyData:null,rsc:h[2],prefetchRsc:null,head:null,prefetchHead:null,loading:h[3],parallelRoutes:new Map(null==s?void 0:s.parallelRoutes),lazyDataResolved:!1}:u&&s?{lazyData:s.lazyData,rsc:s.rsc,prefetchRsc:s.prefetchRsc,head:s.head,prefetchHead:s.prefetchHead,parallelRoutes:new Map(s.parallelRoutes),lazyDataResolved:s.lazyDataResolved,loading:s.loading}:{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map(null==s?void 0:s.parallelRoutes),lazyDataResolved:!1,loading:null},l.set(p,n),e(n,s,f,h||null,a,i),t.parallelRoutes.set(c,l);continue}}if(null!==h){let e=h[2],t=h[3];s={lazyData:null,rsc:e,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:t}}else s={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null};let y=t.parallelRoutes.get(c);y?y.set(p,s):t.parallelRoutes.set(c,new Map([[p,s]])),e(s,void 0,f,h,a,i)}}}});let r=n(78505),o=n(24673);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},44510:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleMutable",{enumerable:!0,get:function(){return u}});let r=n(5410);function o(e){return void 0!==e}function u(e,t){var n,u,l;let a=null==(u=t.shouldScroll)||u,i=e.nextUrl;if(o(t.patchedTree)){let n=(0,r.computeChangedPath)(e.tree,t.patchedTree);n?i=n:i||(i=e.canonicalUrl)}return{buildId:e.buildId,canonicalUrl:o(t.canonicalUrl)?t.canonicalUrl===e.canonicalUrl?e.canonicalUrl:t.canonicalUrl:e.canonicalUrl,pushRef:{pendingPush:o(t.pendingPush)?t.pendingPush:e.pushRef.pendingPush,mpaNavigation:o(t.mpaNavigation)?t.mpaNavigation:e.pushRef.mpaNavigation,preserveCustomHistoryState:o(t.preserveCustomHistoryState)?t.preserveCustomHistoryState:e.pushRef.preserveCustomHistoryState},focusAndScrollRef:{apply:!!a&&(!!o(null==t?void 0:t.scrollableSegments)||e.focusAndScrollRef.apply),onlyHashChange:!!t.hashFragment&&e.canonicalUrl.split("#",1)[0]===(null==(n=t.canonicalUrl)?void 0:n.split("#",1)[0]),hashFragment:a?t.hashFragment&&""!==t.hashFragment?decodeURIComponent(t.hashFragment.slice(1)):e.focusAndScrollRef.hashFragment:null,segmentPaths:a?null!=(l=null==t?void 0:t.scrollableSegments)?l:e.focusAndScrollRef.segmentPaths:[]},cache:t.cache?t.cache:e.cache,prefetchCache:t.prefetchCache?t.prefetchCache:e.prefetchCache,tree:o(t.patchedTree)?t.patchedTree:e.tree,nextUrl:i}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77831:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSegmentMismatch",{enumerable:!0,get:function(){return o}});let r=n(95967);function o(e,t,n){return(0,r.handleExternalUrl)(e,{},e.canonicalUrl,!0)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77058:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheBelowFlightSegmentPath",{enumerable:!0,get:function(){return function e(t,n,o){let u=o.length<=2,[l,a]=o,i=(0,r.createRouterCacheKey)(a),c=n.parallelRoutes.get(l);if(!c)return;let s=t.parallelRoutes.get(l);if(s&&s!==c||(s=new Map(c),t.parallelRoutes.set(l,s)),u){s.delete(i);return}let f=c.get(i),d=s.get(i);d&&f&&(d===f&&(d={lazyData:d.lazyData,rsc:d.rsc,prefetchRsc:d.prefetchRsc,head:d.head,prefetchHead:d.prefetchHead,parallelRoutes:new Map(d.parallelRoutes),lazyDataResolved:d.lazyDataResolved},s.set(i,d)),e(d,f,o.slice(2)))}}});let r=n(78505);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},94377:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheByRouterState",{enumerable:!0,get:function(){return o}});let r=n(78505);function o(e,t,n){for(let o in n[1]){let u=n[1][o][0],l=(0,r.createRouterCacheKey)(u),a=t.parallelRoutes.get(o);if(a){let t=new Map(a);t.delete(l),e.parallelRoutes.set(o,t)}}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},63237:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNavigatingToNewRootLayout",{enumerable:!0,get:function(){return function e(t,n){let r=t[0],o=n[0];if(Array.isArray(r)&&Array.isArray(o)){if(r[0]!==o[0]||r[2]!==o[2])return!0}else if(r!==o)return!0;if(t[4])return!n[4];if(n[4])return!0;let u=Object.values(t[1])[0],l=Object.values(n[1])[0];return!u||!l||e(u,l)}}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},56118:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{abortTask:function(){return c},listenForDynamicRequest:function(){return a},updateCacheNodeOnNavigation:function(){return function e(t,n,a,c,s){let f=n[1],d=a[1],p=c[1],h=t.parallelRoutes,y=new Map(h),_={},v=null;for(let t in d){let n;let a=d[t],c=f[t],b=h.get(t),g=p[t],m=a[0],R=(0,u.createRouterCacheKey)(m),P=void 0!==c?c[0]:void 0,j=void 0!==b?b.get(R):void 0;if(null!==(n=m===r.PAGE_SEGMENT_KEY?l(a,void 0!==g?g:null,s):m===r.DEFAULT_SEGMENT_KEY?void 0!==c?{route:c,node:null,children:null}:l(a,void 0!==g?g:null,s):void 0!==P&&(0,o.matchSegment)(m,P)&&void 0!==j&&void 0!==c?null!=g?e(j,c,a,g,s):function(e){let t=i(e,null,null);return{route:e,node:t,children:null}}(a):l(a,void 0!==g?g:null,s))){null===v&&(v=new Map),v.set(t,n);let e=n.node;if(null!==e){let n=new Map(b);n.set(R,e),y.set(t,n)}_[t]=n.route}else _[t]=a}if(null===v)return null;let b={lazyData:null,rsc:t.rsc,prefetchRsc:t.prefetchRsc,head:t.head,prefetchHead:t.prefetchHead,loading:t.loading,parallelRoutes:y,lazyDataResolved:!1};return{route:function(e,t){let n=[e[0],t];return 2 in e&&(n[2]=e[2]),3 in e&&(n[3]=e[3]),4 in e&&(n[4]=e[4]),n}(a,_),node:b,children:v}}},updateCacheNodeOnPopstateRestoration:function(){return function e(t,n){let r=n[1],o=t.parallelRoutes,l=new Map(o);for(let t in r){let n=r[t],a=n[0],i=(0,u.createRouterCacheKey)(a),c=o.get(t);if(void 0!==c){let r=c.get(i);if(void 0!==r){let o=e(r,n),u=new Map(c);u.set(i,o),l.set(t,u)}}}let a=t.rsc,i=d(a)&&"pending"===a.status;return{lazyData:null,rsc:a,head:t.head,prefetchHead:i?t.prefetchHead:null,prefetchRsc:i?t.prefetchRsc:null,loading:i?t.loading:null,parallelRoutes:l,lazyDataResolved:!1}}}});let r=n(84541),o=n(76015),u=n(78505);function l(e,t,n){let r=i(e,t,n);return{route:e,node:r,children:null}}function a(e,t){t.then(t=>{for(let n of t[0]){let t=n.slice(0,-3),r=n[n.length-3],l=n[n.length-2],a=n[n.length-1];"string"!=typeof t&&function(e,t,n,r,l){let a=e;for(let e=0;e{c(e,t)})}function i(e,t,n){let r=e[1],o=null!==t?t[1]:null,l=new Map;for(let e in r){let t=r[e],a=null!==o?o[e]:null,c=t[0],s=(0,u.createRouterCacheKey)(c),f=i(t,void 0===a?null:a,n),d=new Map;d.set(s,f),l.set(e,d)}let a=0===l.size,c=null!==t?t[2]:null,s=null!==t?t[3]:null;return{lazyData:null,parallelRoutes:l,prefetchRsc:void 0!==c?c:null,prefetchHead:a?n:null,loading:void 0!==s?s:null,rsc:p(),head:a?p():null,lazyDataResolved:!1}}function c(e,t){let n=e.node;if(null===n)return;let r=e.children;if(null===r)s(e.route,n,t);else for(let e of r.values())c(e,t);e.node=null}function s(e,t,n){let r=e[1],o=t.parallelRoutes;for(let e in r){let t=r[e],l=o.get(e);if(void 0===l)continue;let a=t[0],i=(0,u.createRouterCacheKey)(a),c=l.get(i);void 0!==c&&s(t,c,n)}let l=t.rsc;d(l)&&(null===n?l.resolve(null):l.reject(n));let a=t.head;d(a)&&a.resolve(null)}let f=Symbol();function d(e){return e&&e.tag===f}function p(){let e,t;let n=new Promise((n,r)=>{e=n,t=r});return n.status="pending",n.resolve=t=>{"pending"===n.status&&(n.status="fulfilled",n.value=t,e(t))},n.reject=e=>{"pending"===n.status&&(n.status="rejected",n.reason=e,t(e))},n.tag=f,n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},60305:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createPrefetchCacheEntryForInitialLoad:function(){return c},getOrCreatePrefetchCacheEntry:function(){return i},prunePrefetchCache:function(){return f}});let r=n(33456),o=n(44848),u=n(24673),l=n(24819);function a(e,t){let n=(0,r.createHrefFromUrl)(e,!1);return t?t+"%"+n:n}function i(e){let t,{url:n,nextUrl:r,tree:o,buildId:l,prefetchCache:i,kind:c}=e,f=a(n,r),d=i.get(f);if(d)t=d;else{let e=a(n),r=i.get(e);r&&(t=r)}return t?(t.status=h(t),t.kind!==u.PrefetchKind.FULL&&c===u.PrefetchKind.FULL)?s({tree:o,url:n,buildId:l,nextUrl:r,prefetchCache:i,kind:null!=c?c:u.PrefetchKind.TEMPORARY}):(c&&t.kind===u.PrefetchKind.TEMPORARY&&(t.kind=c),t):s({tree:o,url:n,buildId:l,nextUrl:r,prefetchCache:i,kind:c||u.PrefetchKind.TEMPORARY})}function c(e){let{nextUrl:t,tree:n,prefetchCache:r,url:o,kind:l,data:i}=e,[,,,c]=i,s=c?a(o,t):a(o),f={treeAtTimeOfPrefetch:n,data:Promise.resolve(i),kind:l,prefetchTime:Date.now(),lastUsedTime:Date.now(),key:s,status:u.PrefetchCacheEntryStatus.fresh};return r.set(s,f),f}function s(e){let{url:t,kind:n,tree:r,nextUrl:i,buildId:c,prefetchCache:s}=e,f=a(t),d=l.prefetchQueue.enqueue(()=>(0,o.fetchServerResponse)(t,r,i,c,n).then(e=>{let[,,,n]=e;return n&&function(e){let{url:t,nextUrl:n,prefetchCache:r}=e,o=a(t),u=r.get(o);if(!u)return;let l=a(t,n);r.set(l,u),r.delete(o)}({url:t,nextUrl:i,prefetchCache:s}),e})),p={treeAtTimeOfPrefetch:r,data:d,kind:n,prefetchTime:Date.now(),lastUsedTime:null,key:f,status:u.PrefetchCacheEntryStatus.fresh};return s.set(f,p),p}function f(e){for(let[t,n]of e)h(n)===u.PrefetchCacheEntryStatus.expired&&e.delete(t)}let d=1e3*Number("30"),p=1e3*Number("300");function h(e){let{kind:t,prefetchTime:n,lastUsedTime:r}=e;return Date.now()<(null!=r?r:n)+d?r?u.PrefetchCacheEntryStatus.reusable:u.PrefetchCacheEntryStatus.fresh:"auto"===t&&Date.now(){let[n,f]=t,h=!1;if(E.lastUsedTime||(E.lastUsedTime=Date.now(),h=!0),"string"==typeof n)return _(e,R,n,O);if(document.getElementById("__next-page-redirect"))return _(e,R,j,O);let b=e.tree,g=e.cache,w=[];for(let t of n){let n=t.slice(0,-4),r=t.slice(-3)[0],c=["",...n],f=(0,u.applyRouterStatePatchToTree)(c,b,r,j);if(null===f&&(f=(0,u.applyRouterStatePatchToTree)(c,S,r,j)),null!==f){if((0,a.isNavigatingToNewRootLayout)(b,f))return _(e,R,j,O);let u=(0,d.createEmptyCacheNode)(),m=!1;for(let e of(E.status!==i.PrefetchCacheEntryStatus.stale||h?m=(0,s.applyFlightData)(g,u,t,E):(m=function(e,t,n,r){let o=!1;for(let u of(e.rsc=t.rsc,e.prefetchRsc=t.prefetchRsc,e.loading=t.loading,e.parallelRoutes=new Map(t.parallelRoutes),v(r).map(e=>[...n,...e])))(0,y.clearCacheNodeDataForSegmentPath)(e,t,u),o=!0;return o}(u,g,n,r),E.lastUsedTime=Date.now()),(0,l.shouldHardNavigate)(c,b)?(u.rsc=g.rsc,u.prefetchRsc=g.prefetchRsc,(0,o.invalidateCacheBelowFlightSegmentPath)(u,g,n),R.cache=u):m&&(R.cache=u,g=u),b=f,v(r))){let t=[...n,...e];t[t.length-1]!==p.DEFAULT_SEGMENT_KEY&&w.push(t)}}}return R.patchedTree=b,R.canonicalUrl=f?(0,r.createHrefFromUrl)(f):j,R.pendingPush=O,R.scrollableSegments=w,R.hashFragment=P,R.shouldScroll=m,(0,c.handleMutable)(e,R)},()=>e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},24819:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{prefetchQueue:function(){return l},prefetchReducer:function(){return a}});let r=n(6866),o=n(29744),u=n(60305),l=new o.PromiseQueue(5);function a(e,t){(0,u.prunePrefetchCache)(e.prefetchCache);let{url:n}=t;return n.searchParams.delete(r.NEXT_RSC_UNION_QUERY),(0,u.getOrCreatePrefetchCacheEntry)({url:n,nextUrl:e.nextUrl,prefetchCache:e.prefetchCache,kind:t.kind,tree:e.tree,buildId:e.buildId}),e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},99601:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"refreshReducer",{enumerable:!0,get:function(){return h}});let r=n(44848),o=n(33456),u=n(81935),l=n(63237),a=n(95967),i=n(44510),c=n(27420),s=n(12846),f=n(77831),d=n(28077),p=n(50232);function h(e,t){let{origin:n}=t,h={},y=e.canonicalUrl,_=e.tree;h.preserveCustomHistoryState=!1;let v=(0,s.createEmptyCacheNode)(),b=(0,d.hasInterceptionRouteInCurrentTree)(e.tree);return v.lazyData=(0,r.fetchServerResponse)(new URL(y,n),[_[0],_[1],_[2],"refetch"],b?e.nextUrl:null,e.buildId),v.lazyData.then(async n=>{let[r,s]=n;if("string"==typeof r)return(0,a.handleExternalUrl)(e,h,r,e.pushRef.pendingPush);for(let n of(v.lazyData=null,r)){if(3!==n.length)return console.log("REFRESH FAILED"),e;let[r]=n,i=(0,u.applyRouterStatePatchToTree)([""],_,r,e.canonicalUrl);if(null===i)return(0,f.handleSegmentMismatch)(e,t,r);if((0,l.isNavigatingToNewRootLayout)(_,i))return(0,a.handleExternalUrl)(e,h,y,e.pushRef.pendingPush);let d=s?(0,o.createHrefFromUrl)(s):void 0;s&&(h.canonicalUrl=d);let[g,m]=n.slice(-2);if(null!==g){let e=g[2];v.rsc=e,v.prefetchRsc=null,(0,c.fillLazyItemsTillLeafWithHead)(v,void 0,r,g,m),h.prefetchCache=new Map}await (0,p.refreshInactiveParallelSegments)({state:e,updatedTree:i,updatedCache:v,includeNextUrl:b,canonicalUrl:h.canonicalUrl||e.canonicalUrl}),h.cache=v,h.patchedTree=i,h.canonicalUrl=y,_=i}return(0,i.handleMutable)(e,h)},()=>e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77784:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"restoreReducer",{enumerable:!0,get:function(){return u}});let r=n(33456),o=n(5410);function u(e,t){var n;let{url:u,tree:l}=t,a=(0,r.createHrefFromUrl)(u),i=l||e.tree,c=e.cache;return{buildId:e.buildId,canonicalUrl:a,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:e.focusAndScrollRef,cache:c,prefetchCache:e.prefetchCache,tree:i,nextUrl:null!=(n=(0,o.extractPathFromFlightRouterState)(i))?n:u.pathname}}n(56118),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},13722:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverActionReducer",{enumerable:!0,get:function(){return m}});let r=n(83079),o=n(6866),u=n(1634),l=n(33456),a=n(95967),i=n(81935),c=n(63237),s=n(44510),f=n(27420),d=n(12846),p=n(28077),h=n(77831),y=n(50232),_=n(91311),{createFromFetch:v,encodeReply:b}=n(6671);async function g(e,t,n){let l,{actionId:a,actionArgs:i}=n,c=await b(i),s=await fetch("",{method:"POST",headers:{Accept:o.RSC_CONTENT_TYPE_HEADER,[o.ACTION]:a,[o.NEXT_ROUTER_STATE_TREE]:(0,_.prepareFlightRouterStateForRequest)(e.tree),...t?{[o.NEXT_URL]:t}:{}},body:c}),f=s.headers.get("x-action-redirect");try{let e=JSON.parse(s.headers.get("x-action-revalidated")||"[[],0,0]");l={paths:e[0]||[],tag:!!e[1],cookie:e[2]}}catch(e){l={paths:[],tag:!1,cookie:!1}}let d=f?new URL((0,u.addBasePath)(f),new URL(e.canonicalUrl,window.location.href)):void 0;if(s.headers.get("content-type")===o.RSC_CONTENT_TYPE_HEADER){let e=await v(Promise.resolve(s),{callServer:r.callServer});if(f){let[,t]=null!=e?e:[];return{actionFlightData:t,redirectLocation:d,revalidatedParts:l}}let[t,[,n]]=null!=e?e:[];return{actionResult:t,actionFlightData:n,redirectLocation:d,revalidatedParts:l}}return{redirectLocation:d,revalidatedParts:l}}function m(e,t){let{resolve:n,reject:r}=t,o={},u=e.canonicalUrl,_=e.tree;o.preserveCustomHistoryState=!1;let v=e.nextUrl&&(0,p.hasInterceptionRouteInCurrentTree)(e.tree)?e.nextUrl:null;return o.inFlightServerAction=g(e,v,t),o.inFlightServerAction.then(async r=>{let{actionResult:p,actionFlightData:b,redirectLocation:g}=r;if(g&&(e.pushRef.pendingPush=!0,o.pendingPush=!0),!b)return(n(p),g)?(0,a.handleExternalUrl)(e,o,g.href,e.pushRef.pendingPush):e;if("string"==typeof b)return(0,a.handleExternalUrl)(e,o,b,e.pushRef.pendingPush);if(o.inFlightServerAction=null,g){let e=(0,l.createHrefFromUrl)(g,!1);o.canonicalUrl=e}for(let n of b){if(3!==n.length)return console.log("SERVER ACTION APPLY FAILED"),e;let[r]=n,s=(0,i.applyRouterStatePatchToTree)([""],_,r,g?(0,l.createHrefFromUrl)(g):e.canonicalUrl);if(null===s)return(0,h.handleSegmentMismatch)(e,t,r);if((0,c.isNavigatingToNewRootLayout)(_,s))return(0,a.handleExternalUrl)(e,o,u,e.pushRef.pendingPush);let[p,b]=n.slice(-2),m=null!==p?p[2]:null;if(null!==m){let t=(0,d.createEmptyCacheNode)();t.rsc=m,t.prefetchRsc=null,(0,f.fillLazyItemsTillLeafWithHead)(t,void 0,r,p,b),await (0,y.refreshInactiveParallelSegments)({state:e,updatedTree:s,updatedCache:t,includeNextUrl:!!v,canonicalUrl:o.canonicalUrl||e.canonicalUrl}),o.cache=t,o.prefetchCache=new Map}o.patchedTree=s,_=s}return n(p),(0,s.handleMutable)(e,o)},t=>(r(t),e))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},68448:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverPatchReducer",{enumerable:!0,get:function(){return f}});let r=n(33456),o=n(81935),u=n(63237),l=n(95967),a=n(22356),i=n(44510),c=n(12846),s=n(77831);function f(e,t){let{serverResponse:n}=t,[f,d]=n,p={};if(p.preserveCustomHistoryState=!1,"string"==typeof f)return(0,l.handleExternalUrl)(e,p,f,e.pushRef.pendingPush);let h=e.tree,y=e.cache;for(let n of f){let i=n.slice(0,-4),[f]=n.slice(-3,-2),_=(0,o.applyRouterStatePatchToTree)(["",...i],h,f,e.canonicalUrl);if(null===_)return(0,s.handleSegmentMismatch)(e,t,f);if((0,u.isNavigatingToNewRootLayout)(h,_))return(0,l.handleExternalUrl)(e,p,e.canonicalUrl,e.pushRef.pendingPush);let v=d?(0,r.createHrefFromUrl)(d):void 0;v&&(p.canonicalUrl=v);let b=(0,c.createEmptyCacheNode)();(0,a.applyFlightData)(y,b,n),p.patchedTree=_,p.cache=b,y=b,h=_}return(0,i.handleMutable)(e,p)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},50232:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{addRefreshMarkerToActiveParallelSegments:function(){return function e(t,n){let[r,o,,l]=t;for(let a in r.includes(u.PAGE_SEGMENT_KEY)&&"refresh"!==l&&(t[2]=n,t[3]="refresh"),o)e(o[a],n)}},refreshInactiveParallelSegments:function(){return l}});let r=n(22356),o=n(44848),u=n(84541);async function l(e){let t=new Set;await a({...e,rootTree:e.updatedTree,fetchedSegments:t})}async function a(e){let{state:t,updatedTree:n,updatedCache:u,includeNextUrl:l,fetchedSegments:i,rootTree:c=n,canonicalUrl:s}=e,[,f,d,p]=n,h=[];if(d&&d!==s&&"refresh"===p&&!i.has(d)){i.add(d);let e=(0,o.fetchServerResponse)(new URL(d,location.origin),[c[0],c[1],c[2],"refetch"],l?t.nextUrl:null,t.buildId).then(e=>{let t=e[0];if("string"!=typeof t)for(let e of t)(0,r.applyFlightData)(u,u,e)});h.push(e)}for(let e in f){let n=a({state:t,updatedTree:f[e],updatedCache:u,includeNextUrl:l,fetchedSegments:i,rootTree:c,canonicalUrl:s});h.push(n)}await Promise.all(h)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},24673:function(e,t){"use strict";var n,r,o,u;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ACTION_FAST_REFRESH:function(){return f},ACTION_NAVIGATE:function(){return a},ACTION_PREFETCH:function(){return s},ACTION_REFRESH:function(){return l},ACTION_RESTORE:function(){return i},ACTION_SERVER_ACTION:function(){return d},ACTION_SERVER_PATCH:function(){return c},PrefetchCacheEntryStatus:function(){return r},PrefetchKind:function(){return n},isThenable:function(){return p}});let l="refresh",a="navigate",i="restore",c="server-patch",s="prefetch",f="fast-refresh",d="server-action";function p(e){return e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}(o=n||(n={})).AUTO="auto",o.FULL="full",o.TEMPORARY="temporary",(u=r||(r={})).fresh="fresh",u.reusable="reusable",u.expired="expired",u.stale="stale",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},91450:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"reducer",{enumerable:!0,get:function(){return f}});let r=n(24673),o=n(95967),u=n(68448),l=n(77784),a=n(99601),i=n(24819),c=n(44529),s=n(13722),f="undefined"==typeof window?function(e,t){return e}:function(e,t){switch(t.type){case r.ACTION_NAVIGATE:return(0,o.navigateReducer)(e,t);case r.ACTION_SERVER_PATCH:return(0,u.serverPatchReducer)(e,t);case r.ACTION_RESTORE:return(0,l.restoreReducer)(e,t);case r.ACTION_REFRESH:return(0,a.refreshReducer)(e,t);case r.ACTION_FAST_REFRESH:return(0,c.fastRefreshReducer)(e,t);case r.ACTION_PREFETCH:return(0,i.prefetchReducer)(e,t);case r.ACTION_SERVER_ACTION:return(0,s.serverActionReducer)(e,t);default:throw Error("Unknown action")}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},53728:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"shouldHardNavigate",{enumerable:!0,get:function(){return function e(t,n){let[o,u]=n,[l,a]=t;return(0,r.matchSegment)(l,o)?!(t.length<=2)&&e(t.slice(2),u[a]):!!Array.isArray(l)}}});let r=n(76015);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},54535:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createDynamicallyTrackedSearchParams:function(){return a},createUntrackedSearchParams:function(){return l}});let r=n(51845),o=n(86999),u=n(30650);function l(e){let t=r.staticGenerationAsyncStorage.getStore();return t&&t.forceStatic?{}:e}function a(e){let t=r.staticGenerationAsyncStorage.getStore();return t?t.forceStatic?{}:t.isStaticGeneration||t.dynamicShouldError?new Proxy({},{get:(e,n,r)=>("string"==typeof n&&(0,o.trackDynamicDataAccessed)(t,"searchParams."+n),u.ReflectAdapter.get(e,n,r)),has:(e,n)=>("string"==typeof n&&(0,o.trackDynamicDataAccessed)(t,"searchParams."+n),Reflect.has(e,n)),ownKeys:e=>((0,o.trackDynamicDataAccessed)(t,"searchParams"),Reflect.ownKeys(e))}):e:e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},51845:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"staticGenerationAsyncStorage",{enumerable:!0,get:function(){return r.staticGenerationAsyncStorage}});let r=n(20030);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},36864:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{StaticGenBailoutError:function(){return r},isStaticGenBailoutError:function(){return o}});let n="NEXT_STATIC_GEN_BAILOUT";class r extends Error{constructor(...e){super(...e),this.code=n}}function o(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},38137:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unresolvedThenable",{enumerable:!0,get:function(){return n}});let n={then:()=>{}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},47744:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{useReducerWithReduxDevtools:function(){return i},useUnwrapState:function(){return a}});let r=n(53099)._(n(2265)),o=n(24673),u=n(2103);function l(e){if(e instanceof Map){let t={};for(let[n,r]of e.entries()){if("function"==typeof r){t[n]="fn()";continue}if("object"==typeof r&&null!==r){if(r.$$typeof){t[n]=r.$$typeof.toString();continue}if(r._bundlerConfig){t[n]="FlightData";continue}}t[n]=l(r)}return t}if("object"==typeof e&&null!==e){let t={};for(let n in e){let r=e[n];if("function"==typeof r){t[n]="fn()";continue}if("object"==typeof r&&null!==r){if(r.$$typeof){t[n]=r.$$typeof.toString();continue}if(r.hasOwnProperty("_bundlerConfig")){t[n]="FlightData";continue}}t[n]=l(r)}return t}return Array.isArray(e)?e.map(l):e}function a(e){return(0,o.isThenable)(e)?(0,r.use)(e):e}let i="undefined"!=typeof window?function(e){let[t,n]=r.default.useState(e),o=(0,r.useContext)(u.ActionQueueContext);if(!o)throw Error("Invariant: Missing ActionQueueContext");let a=(0,r.useRef)(),i=(0,r.useRef)();return(0,r.useEffect)(()=>{if(!a.current&&!1!==i.current){if(void 0===i.current&&void 0===window.__REDUX_DEVTOOLS_EXTENSION__){i.current=!1;return}return a.current=window.__REDUX_DEVTOOLS_EXTENSION__.connect({instanceId:8e3,name:"next-router"}),a.current&&(a.current.init(l(e)),o&&(o.devToolsInstance=a.current)),()=>{a.current=void 0}}},[e,o]),[t,(0,r.useCallback)(t=>{o.state||(o.state=e),o.dispatch(t,n)},[o,e]),(0,r.useCallback)(e=>{a.current&&a.current.send({type:"RENDER_SYNC"},l(e))},[])]}:function(e){return[e,()=>{},()=>{}]};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},91311:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"prepareFlightRouterStateForRequest",{enumerable:!0,get:function(){return o}});let r=n(84541);function o(e,t){return t?encodeURIComponent(JSON.stringify(e)):encodeURIComponent(JSON.stringify(function e(t){let[n,o,,u,l]=t,a="string"==typeof n&&n.startsWith(r.PAGE_SEGMENT_KEY+"?")?r.PAGE_SEGMENT_KEY:n,i={};for(let[t,n]of Object.entries(o))i[t]=e(n);let c=[a,i,null,u&&"refresh"!==u?u:null];return void 0!==l&&(c[4]=l),c}(e)))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},11283:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hasBasePath",{enumerable:!0,get:function(){return o}});let r=n(10580);function o(e){return(0,r.pathHasPrefix)(e,"")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},33068:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathTrailingSlash",{enumerable:!0,get:function(){return u}});let r=n(26674),o=n(63381),u=e=>{if(!e.startsWith("/"))return e;let{pathname:t,query:n,hash:u}=(0,o.parsePath)(e);return/\.[^/]+\/?$/.test(t)?""+(0,r.removeTrailingSlash)(t)+n+u:t.endsWith("/")?""+t+n+u:t+"/"+n+u};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},61404:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=n(18993);function o(e){let t="function"==typeof reportError?reportError:e=>{window.console.error(e)};(0,r.isBailoutToCSRError)(e)||t(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},35076:function(e,t,n){"use strict";function r(e){return e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeBasePath",{enumerable:!0,get:function(){return r}}),n(11283),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},12010:function(e,t){"use strict";function n(e,t){var n=e.length;for(e.push(t);0>>1,o=e[r];if(0>>1;ru(i,n))cu(s,i)?(e[r]=s,e[c]=n,r=c):(e[r]=i,e[a]=n,r=a);else if(cu(s,n))e[r]=s,e[c]=n,r=c;else break}}return t}function u(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var l,a=performance;t.unstable_now=function(){return a.now()}}else{var i=Date,c=i.now();t.unstable_now=function(){return i.now()-c}}var s=[],f=[],d=1,p=null,h=3,y=!1,_=!1,v=!1,b="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,m="undefined"!=typeof setImmediate?setImmediate:null;function R(e){for(var t=r(f);null!==t;){if(null===t.callback)o(f);else if(t.startTime<=e)o(f),t.sortIndex=t.expirationTime,n(s,t);else break;t=r(f)}}function P(e){if(v=!1,R(e),!_){if(null!==r(s))_=!0,C();else{var t=r(f);null!==t&&A(P,t.startTime-e)}}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var j=!1,O=-1,E=5,S=-1;function w(){return!(t.unstable_now()-Se&&w());){var a=p.callback;if("function"==typeof a){p.callback=null,h=p.priorityLevel;var i=a(p.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof i){p.callback=i,R(e),n=!0;break t}p===r(s)&&o(s),R(e)}else o(s);p=r(s)}if(null!==p)n=!0;else{var c=r(f);null!==c&&A(P,c.startTime-e),n=!1}}break e}finally{p=null,h=u,y=!1}n=void 0}}finally{n?l():j=!1}}}if("function"==typeof m)l=function(){m(M)};else if("undefined"!=typeof MessageChannel){var T=new MessageChannel,x=T.port2;T.port1.onmessage=M,l=function(){x.postMessage(null)}}else l=function(){b(M,0)};function C(){j||(j=!0,l())}function A(e,n){O=b(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){_||y||(_=!0,C())},t.unstable_forceFrameRate=function(e){0>e||125l?(e.sortIndex=u,n(f,e),null===r(s)&&e===r(f)&&(v?(g(O),O=-1):v=!0,A(P,u-l))):(e.sortIndex=a,n(s,e),_||y||(_=!0,C())),e},t.unstable_shouldYield=w,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},71767:function(e,t,n){"use strict";e.exports=n(12010)},60934:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getPathname:function(){return r},isFullStringUrl:function(){return o},parseUrl:function(){return u}});let n="http://n";function r(e){return new URL(e,n).pathname}function o(e){return/https?:\/\//.test(e)}function u(e){let t;try{t=new URL(e,n)}catch{}return t}},86999:function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{Postpone:function(){return d},createPostponedAbortSignal:function(){return b},createPrerenderState:function(){return c},formatDynamicAPIAccesses:function(){return _},markCurrentScopeAsDynamic:function(){return s},trackDynamicDataAccessed:function(){return f},trackDynamicFetch:function(){return p},usedDynamicAPIs:function(){return y}});let o=(r=n(2265))&&r.__esModule?r:{default:r},u=n(46177),l=n(36864),a=n(60934),i="function"==typeof o.default.unstable_postpone;function c(e){return{isDebugSkeleton:e,dynamicAccesses:[]}}function s(e,t){let n=(0,a.getPathname)(e.urlPathname);if(!e.isUnstableCacheCallback){if(e.dynamicShouldError)throw new l.StaticGenBailoutError(`Route ${n} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(e.prerenderState)h(e.prerenderState,t,n);else if(e.revalidate=0,e.isStaticGeneration){let r=new u.DynamicServerError(`Route ${n} couldn't be rendered statically because it used ${t}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);throw e.dynamicUsageDescription=t,e.dynamicUsageStack=r.stack,r}}}function f(e,t){let n=(0,a.getPathname)(e.urlPathname);if(e.isUnstableCacheCallback)throw Error(`Route ${n} used "${t}" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "${t}" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`);if(e.dynamicShouldError)throw new l.StaticGenBailoutError(`Route ${n} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(e.prerenderState)h(e.prerenderState,t,n);else if(e.revalidate=0,e.isStaticGeneration){let r=new u.DynamicServerError(`Route ${n} couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);throw e.dynamicUsageDescription=t,e.dynamicUsageStack=r.stack,r}}function d({reason:e,prerenderState:t,pathname:n}){h(t,e,n)}function p(e,t){e.prerenderState&&h(e.prerenderState,t,e.urlPathname)}function h(e,t,n){v();let r=`Route ${n} needs to bail out of prerendering at this point because it used ${t}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`;e.dynamicAccesses.push({stack:e.isDebugSkeleton?Error().stack:void 0,expression:t}),o.default.unstable_postpone(r)}function y(e){return e.dynamicAccesses.length>0}function _(e){return e.dynamicAccesses.filter(e=>"string"==typeof e.stack&&e.stack.length>0).map(({expression:e,stack:t})=>(t=t.split("\n").slice(4).filter(e=>!(e.includes("node_modules/next/")||e.includes(" ()")||e.includes(" (node:"))).join("\n"),`Dynamic API Usage Debug - ${e}: +${t}`))}function v(){if(!i)throw Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js")}function b(e){v();let t=new AbortController;try{o.default.unstable_postpone(e)}catch(e){t.abort(e)}return t.signal}},87417:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentParam",{enumerable:!0,get:function(){return o}});let r=n(91182);function o(e){let t=r.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t));return(t&&(e=e.slice(t.length)),e.startsWith("[[...")&&e.endsWith("]]"))?{type:"optional-catchall",param:e.slice(5,-2)}:e.startsWith("[...")&&e.endsWith("]")?{type:t?"catchall-intercepted":"catchall",param:e.slice(4,-1)}:e.startsWith("[")&&e.endsWith("]")?{type:t?"dynamic-intercepted":"dynamic",param:e.slice(1,-1)}:null}},70647:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HMR_ACTIONS_SENT_TO_BROWSER",{enumerable:!0,get:function(){return n}}),(r=n||(n={})).ADDED_PAGE="addedPage",r.REMOVED_PAGE="removedPage",r.RELOAD_PAGE="reloadPage",r.SERVER_COMPONENT_CHANGES="serverComponentChanges",r.MIDDLEWARE_CHANGES="middlewareChanges",r.CLIENT_CHANGES="clientChanges",r.SERVER_ONLY_CHANGES="serverOnlyChanges",r.SYNC="sync",r.BUILT="built",r.BUILDING="building",r.DEV_PAGES_MANIFEST_UPDATE="devPagesManifestUpdate",r.TURBOPACK_MESSAGE="turbopack-message",r.SERVER_ERROR="serverError",r.TURBOPACK_CONNECTED="turbopack-connected"},91182:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{INTERCEPTION_ROUTE_MARKERS:function(){return o},extractInterceptionRouteInformation:function(){return l},isInterceptionRouteAppPath:function(){return u}});let r=n(20926),o=["(..)(..)","(.)","(..)","(...)"];function u(e){return void 0!==e.split("/").find(e=>o.find(t=>e.startsWith(t)))}function l(e){let t,n,u;for(let r of e.split("/"))if(n=o.find(e=>r.startsWith(e))){[t,u]=e.split(n,2);break}if(!t||!n||!u)throw Error(`Invalid interception route: ${e}. Must be in the format //(..|...|..)(..)/`);switch(t=(0,r.normalizeAppPath)(t),n){case"(.)":u="/"===t?`/${u}`:t+"/"+u;break;case"(..)":if("/"===t)throw Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`);u=t.split("/").slice(0,-1).concat(u).join("/");break;case"(...)":u="/"+u;break;case"(..)(..)":let l=t.split("/");if(l.length<=2)throw Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`);u=l.slice(0,-2).concat(u).join("/");break;default:throw Error("Invariant: unexpected marker")}return{interceptingRoute:t,interceptedRoute:u}}},30650:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ReflectAdapter",{enumerable:!0,get:function(){return n}});class n{static get(e,t,n){let r=Reflect.get(e,t,n);return"function"==typeof r?r.bind(e):r}static set(e,t,n,r){return Reflect.set(e,t,n,r)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}},61956:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{AppRouterContext:function(){return o},GlobalLayoutRouterContext:function(){return l},LayoutRouterContext:function(){return u},MissingSlotContext:function(){return i},TemplateContext:function(){return a}});let r=n(47043)._(n(2265)),o=r.default.createContext(null),u=r.default.createContext(null),l=r.default.createContext(null),a=r.default.createContext(null),i=r.default.createContext(new Set)},37207:function(e,t){"use strict";function n(e){let t=5381;for(let n=0;n>>0}function r(e){return n(e).toString(36).slice(0,5)}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{djb2Hash:function(){return n},hexHash:function(){return r}})},48701:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HeadManagerContext",{enumerable:!0,get:function(){return r}});let r=n(47043)._(n(2265)).default.createContext({})},79060:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{PathParamsContext:function(){return l},PathnameContext:function(){return u},SearchParamsContext:function(){return o}});let r=n(2265),o=(0,r.createContext)(null),u=(0,r.createContext)(null),l=(0,r.createContext)(null)},18993:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{BailoutToCSRError:function(){return r},isBailoutToCSRError:function(){return o}});let n="BAILOUT_TO_CLIENT_SIDE_RENDERING";class r extends Error{constructor(e){super("Bail out to client-side rendering: "+e),this.reason=e,this.digest=n}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}},78162:function(e,t){"use strict";function n(e){return e.startsWith("/")?e:"/"+e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureLeadingSlash",{enumerable:!0,get:function(){return n}})},2103:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ActionQueueContext:function(){return a},createMutableActionQueue:function(){return s}});let r=n(53099),o=n(24673),u=n(91450),l=r._(n(2265)),a=l.default.createContext(null);function i(e,t){null!==e.pending&&(e.pending=e.pending.next,null!==e.pending?c({actionQueue:e,action:e.pending,setState:t}):e.needsRefresh&&(e.needsRefresh=!1,e.dispatch({type:o.ACTION_REFRESH,origin:window.location.origin},t)))}async function c(e){let{actionQueue:t,action:n,setState:r}=e,u=t.state;if(!u)throw Error("Invariant: Router state not initialized");t.pending=n;let l=n.payload,a=t.action(u,l);function c(e){n.discarded||(t.state=e,t.devToolsInstance&&t.devToolsInstance.send(l,e),i(t,r),n.resolve(e))}(0,o.isThenable)(a)?a.then(c,e=>{i(t,r),n.reject(e)}):c(a)}function s(){let e={state:null,dispatch:(t,n)=>(function(e,t,n){let r={resolve:n,reject:()=>{}};if(t.type!==o.ACTION_RESTORE){let e=new Promise((e,t)=>{r={resolve:e,reject:t}});(0,l.startTransition)(()=>{n(e)})}let u={payload:t,next:null,resolve:r.resolve,reject:r.reject};null===e.pending?(e.last=u,c({actionQueue:e,action:u,setState:n})):t.type===o.ACTION_NAVIGATE||t.type===o.ACTION_RESTORE?(e.pending.discarded=!0,e.last=u,e.pending.payload.type===o.ACTION_SERVER_ACTION&&(e.needsRefresh=!0),c({actionQueue:e,action:u,setState:n})):(null!==e.last&&(e.last.next=u),e.last=u)})(e,t,n),action:async(e,t)=>{if(null===e)throw Error("Invariant: Router state not initialized");return(0,u.reducer)(e,t)},pending:null,last:null};return e}},68498:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathPrefix",{enumerable:!0,get:function(){return o}});let r=n(63381);function o(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:n,query:o,hash:u}=(0,r.parsePath)(e);return""+t+n+o+u}},20926:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{normalizeAppPath:function(){return u},normalizeRscURL:function(){return l}});let r=n(78162),o=n(84541);function u(e){return(0,r.ensureLeadingSlash)(e.split("/").reduce((e,t,n,r)=>!t||(0,o.isGroupSegment)(t)||"@"===t[0]||("page"===t||"route"===t)&&n===r.length-1?e:e+"/"+t,""))}function l(e){return e.replace(/\.rsc($|\?)/,"$1")}},7092:function(e,t){"use strict";function n(e,t){if(void 0===t&&(t={}),t.onlyHashChange){e();return}let n=document.documentElement,r=n.style.scrollBehavior;n.style.scrollBehavior="auto",t.dontForceLayout||n.getClientRects(),e(),n.style.scrollBehavior=r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSmoothScroll",{enumerable:!0,get:function(){return n}})},86146:function(e,t){"use strict";function n(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isBot",{enumerable:!0,get:function(){return n}})},63381:function(e,t){"use strict";function n(e){let t=e.indexOf("#"),n=e.indexOf("?"),r=n>-1&&(t<0||n-1?{pathname:e.substring(0,r?n:t),query:r?e.substring(n,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return n}})},10580:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"pathHasPrefix",{enumerable:!0,get:function(){return o}});let r=n(63381);function o(e,t){if("string"!=typeof e)return!1;let{pathname:n}=(0,r.parsePath)(e);return n===t||n.startsWith(t+"/")}},26674:function(e,t){"use strict";function n(e){return e.replace(/\/$/,"")||"/"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return n}})},84541:function(e,t){"use strict";function n(e){return"("===e[0]&&e.endsWith(")")}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DEFAULT_SEGMENT_KEY:function(){return o},PAGE_SEGMENT_KEY:function(){return r},isGroupSegment:function(){return n}});let r="__PAGE__",o="__DEFAULT__"},55501:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ServerInsertedHTMLContext:function(){return o},useServerInsertedHTML:function(){return u}});let r=n(53099)._(n(2265)),o=r.default.createContext(null);function u(e){let t=(0,r.useContext)(o);t&&t(e)}},31765:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},47149:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"actionAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(54832).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},54832:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createAsyncLocalStorage",{enumerable:!0,get:function(){return u}});let n=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class r{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}}let o=globalThis.AsyncLocalStorage;function u(){return o?new o:new r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},25575:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"requestAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(54832).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},20030:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"staticGenerationAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(54832).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},34040:function(e,t,n){"use strict";var r=n(54887);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},54887:function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(84417)},97950:function(e,t,n){"use strict";var r=n(54887),o={stream:!0},u=Object.prototype.hasOwnProperty,l=new Map;function a(e){var t=n(e);return"function"!=typeof t.then||"fulfilled"===t.status?null:(t.then(function(e){t.status="fulfilled",t.value=e},function(e){t.status="rejected",t.reason=e}),t)}function i(){}var c=new Map,s=n.u;n.u=function(e){var t=c.get(e);return void 0!==t?t:s(e)};var f=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,d=Symbol.for("react.element"),p=Symbol.for("react.lazy"),h=Symbol.iterator,y=Array.isArray,_=Object.getPrototypeOf,v=Object.prototype,b=new WeakMap;function g(e,t,n,r){this.status=e,this.value=t,this.reason=n,this._response=r}function m(e){switch(e.status){case"resolved_model":w(e);break;case"resolved_module":M(e)}switch(e.status){case"fulfilled":return e.value;case"pending":case"blocked":case"cyclic":throw e;default:throw e.reason}}function R(e,t){for(var n=0;nh?(_=h,h=3,p++):(_=0,h=3);continue;case 2:44===(m=d[p++])?h=4:v=v<<4|(96d.length&&(m=-1)}var R=d.byteOffset+p;if(-11?e-1:0),n=1;n=t.nodeCount())return[];var r,l,h,c,f,d,p=(r=e||s,l=new i,h=0,c=0,n.forEach(t.nodes(),function(t){l.setNode(t,{v:t,in:0,out:0})}),n.forEach(t.edges(),function(t){var e=l.edge(t.v,t.w)||0,n=r(t);l.setEdge(t.v,t.w,e+n),c=Math.max(c,l.node(t.v).out+=n),h=Math.max(h,l.node(t.w).in+=n)}),f=n.range(c+h+3).map(function(){return new o}),d=h+1,n.forEach(l.nodes(),function(t){u(f,d,l.node(t))}),{graph:l,buckets:f,zeroIdx:d}),m=function(t,e,r){for(var n,i=[],o=e[e.length-1],s=e[0];t.nodeCount();){for(;n=s.dequeue();)a(t,e,r,n);for(;n=o.dequeue();)a(t,e,r,n);if(t.nodeCount()){for(var u=e.length-2;u>0;--u)if(n=e[u].dequeue()){i=i.concat(a(t,e,r,n,!0));break}}}return i}(p.graph,p.buckets,p.zeroIdx);return n.flatten(n.map(m,function(e){return t.outEdges(e.v,e.w)}),!0)};var s=n.constant(1);function a(t,e,r,i,o){var s=o?[]:void 0;return n.forEach(t.inEdges(i.v),function(n){var i=t.edge(n),a=t.node(n.v);o&&s.push({v:n.v,w:n.w}),a.out-=i,u(e,r,a)}),n.forEach(t.outEdges(i.v),function(n){var i=t.edge(n),o=n.w,s=t.node(o);s.in-=i,u(e,r,s)}),t.removeNode(i.v),s}function u(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}},76811:function(t,e,r){"use strict";var n=r(57137),i=r(45547),o=r(10828),s=r(57112),a=r(47332).normalizeRanks,u=r(79004),l=r(47332).removeEmptyRanks,h=r(54783),c=r(14970),f=r(91335),d=r(98898),p=r(94836),m=r(47332),v=r(87591).Graph;t.exports=function(t,e){var r=e&&e.debugTiming?m.time:m.notime;r("layout",function(){var e=r(" buildLayoutGraph",function(){var e,r;return e=new v({multigraph:!0,compound:!0}),r=S(t.graph()),e.setGraph(n.merge({},y,A(r,g),n.pick(r,b))),n.forEach(t.nodes(),function(r){var i=S(t.node(r));e.setNode(r,n.defaults(A(i,x),w)),e.setParent(r,t.parent(r))}),n.forEach(t.edges(),function(r){var i=S(t.edge(r));e.setEdge(r,n.merge({},k,A(i,_),n.pick(i,E)))}),e});r(" runLayout",function(){r(" makeSpaceForEdgeLabels",function(){var t;t=e.graph(),t.ranksep/=2,n.forEach(e.edges(),function(r){var n=e.edge(r);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)})}),r(" removeSelfEdges",function(){n.forEach(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}),r(" acyclic",function(){i.run(e)}),r(" nestingGraph.run",function(){h.run(e)}),r(" rank",function(){s(m.asNonCompoundGraph(e))}),r(" injectEdgeLabelProxies",function(){n.forEach(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),i={rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t};m.addDummyNode(e,"edge-proxy",i,"_ep")}})}),r(" removeEmptyRanks",function(){l(e)}),r(" nestingGraph.cleanup",function(){h.cleanup(e)}),r(" normalizeRanks",function(){a(e)}),r(" assignRankMinMax",function(){var t;t=0,n.forEach(e.nodes(),function(r){var i=e.node(r);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=n.max(t,i.maxRank))}),e.graph().maxRank=t}),r(" removeEdgeLabelProxies",function(){n.forEach(e.nodes(),function(t){var r=e.node(t);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}),r(" normalize.run",function(){o.run(e)}),r(" parentDummyChains",function(){u(e)}),r(" addBorderSegments",function(){c(e)}),r(" order",function(){d(e)}),r(" insertSelfEdges",function(){var t;t=m.buildLayerMatrix(e),n.forEach(t,function(t){var r=0;n.forEach(t,function(t,i){var o=e.node(t);o.order=i+r,n.forEach(o.selfEdges,function(t){m.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:i+ ++r,e:t.e,label:t.label},"_se")}),delete o.selfEdges})})}),r(" adjustCoordinateSystem",function(){f.adjust(e)}),r(" position",function(){p(e)}),r(" positionSelfEdges",function(){n.forEach(e.nodes(),function(t){var r=e.node(t);if("selfedge"===r.dummy){var n=e.node(r.e.v),i=n.x+n.width/2,o=n.y,s=r.x-i,a=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*s/3,y:o-a},{x:i+5*s/6,y:o-a},{x:i+s,y:o},{x:i+5*s/6,y:o+a},{x:i+2*s/3,y:o+a}],r.label.x=r.x,r.label.y=r.y}})}),r(" removeBorderNodes",function(){n.forEach(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),i=e.node(r.borderTop),o=e.node(r.borderBottom),s=e.node(n.last(r.borderLeft)),a=e.node(n.last(r.borderRight));r.width=Math.abs(a.x-s.x),r.height=Math.abs(o.y-i.y),r.x=s.x+r.width/2,r.y=i.y+r.height/2}}),n.forEach(e.nodes(),function(t){"border"===e.node(t).dummy&&e.removeNode(t)})}),r(" normalize.undo",function(){o.undo(e)}),r(" fixupEdgeLabelCoords",function(){n.forEach(e.edges(),function(t){var r=e.edge(t);if(n.has(r,"x"))switch(("l"===r.labelpos||"r"===r.labelpos)&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}),r(" undoCoordinateSystem",function(){f.undo(e)}),r(" translateGraph",function(){(function(t){var e=Number.POSITIVE_INFINITY,r=0,i=Number.POSITIVE_INFINITY,o=0,s=t.graph(),a=s.marginx||0,u=s.marginy||0;function l(t){var n=t.x,s=t.y,a=t.width,u=t.height;e=Math.min(e,n-a/2),r=Math.max(r,n+a/2),i=Math.min(i,s-u/2),o=Math.max(o,s+u/2)}n.forEach(t.nodes(),function(e){l(t.node(e))}),n.forEach(t.edges(),function(e){var r=t.edge(e);n.has(r,"x")&&l(r)}),e-=a,i-=u,n.forEach(t.nodes(),function(r){var n=t.node(r);n.x-=e,n.y-=i}),n.forEach(t.edges(),function(r){var o=t.edge(r);n.forEach(o.points,function(t){t.x-=e,t.y-=i}),n.has(o,"x")&&(o.x-=e),n.has(o,"y")&&(o.y-=i)}),s.width=r-e+a,s.height=o-i+u})(e)}),r(" assignNodeIntersects",function(){n.forEach(e.edges(),function(t){var r,n,i=e.edge(t),o=e.node(t.v),s=e.node(t.w);i.points?(r=i.points[0],n=i.points[i.points.length-1]):(i.points=[],r=s,n=o),i.points.unshift(m.intersectRect(o,r)),i.points.push(m.intersectRect(s,n))})}),r(" reversePoints",function(){n.forEach(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}),r(" acyclic.undo",function(){i.undo(e)})}),r(" updateInputGraph",function(){n.forEach(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),n.forEach(t.edges(),function(r){var i=t.edge(r),o=e.edge(r);i.points=o.points,n.has(o,"x")&&(i.x=o.x,i.y=o.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height})})};var g=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},_=["minlen","weight","width","height","labeloffset"],k={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},E=["labelpos"];function A(t,e){return n.mapValues(n.pick(t,e),Number)}function S(t){var e={};return n.forEach(t,function(t,r){e[r.toLowerCase()]=t}),e}},57137:function(t,e,r){var n;try{n={cloneDeep:r(59128),constant:r(92353),defaults:r(32495),each:r(74477),filter:r(4155),find:r(84173),flatten:r(7310),forEach:r(95905),forIn:r(90515),has:r(17693),isUndefined:r(84432),last:r(86185),map:r(89238),mapValues:r(41443),max:r(95645),merge:r(23006),min:r(99008),minBy:r(37891),now:r(11121),pick:r(53852),range:r(99676),reduce:r(20723),sortBy:r(34935),uniqueId:r(7633),values:r(19713),zipObject:r(77423)}}catch(t){}n||(n=window._),t.exports=n},54783:function(t,e,r){var n=r(57137),i=r(47332);t.exports={run:function(t){var e,r=i.addDummyNode(t,"root",{},"_root"),o=(e={},n.forEach(t.children(),function(r){!function r(i,o){var s=t.children(i);s&&s.length&&n.forEach(s,function(t){r(t,o+1)}),e[i]=o}(r,1)}),e),s=n.max(n.values(o))-1,a=2*s+1;t.graph().nestingRoot=r,n.forEach(t.edges(),function(e){t.edge(e).minlen*=a});var u=n.reduce(t.edges(),function(e,r){return e+t.edge(r).weight},0)+1;n.forEach(t.children(),function(e){(function t(e,r,o,s,a,u,l){var h=e.children(l);if(!h.length){l!==r&&e.setEdge(r,l,{weight:0,minlen:o});return}var c=i.addBorderNode(e,"_bt"),f=i.addBorderNode(e,"_bb"),d=e.node(l);e.setParent(c,l),d.borderTop=c,e.setParent(f,l),d.borderBottom=f,n.forEach(h,function(n){t(e,r,o,s,a,u,n);var i=e.node(n),h=i.borderTop?i.borderTop:n,d=i.borderBottom?i.borderBottom:n,p=i.borderTop?s:2*s,m=h!==d?1:a-u[l]+1;e.setEdge(c,h,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(d,f,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(l)||e.setEdge(r,c,{weight:0,minlen:a+u[l]})})(t,r,a,u,s,o,e)}),t.graph().nodeRankFactor=a},cleanup:function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,n.forEach(t.edges(),function(e){t.edge(e).nestingEdge&&t.removeEdge(e)})}}},10828:function(t,e,r){"use strict";var n=r(57137),i=r(47332);t.exports={run:function(t){t.graph().dummyChains=[],n.forEach(t.edges(),function(e){(function(t,e){var r,n,o,s=e.v,a=t.node(s).rank,u=e.w,l=t.node(u).rank,h=e.name,c=t.edge(e),f=c.labelRank;if(l!==a+1){for(t.removeEdge(e),o=0,++a;a0;)e%2&&(r+=u[e+1]),e=e-1>>1,u[e]+=t.weight;l+=t.weight*r})),l}(t,e[i-1],e[i]);return r}},98898:function(t,e,r){"use strict";var n=r(57137),i=r(3663),o=r(77067),s=r(35606),a=r(72160),u=r(58710),l=r(87591).Graph,h=r(47332);function c(t,e,r){return n.map(e,function(e){return a(t,e,r)})}function f(t,e){n.forEach(e,function(e){n.forEach(e,function(e,r){t.node(e).order=r})})}t.exports=function(t){var e=h.maxRank(t),r=c(t,n.range(1,e+1),"inEdges"),a=c(t,n.range(e-1,-1,-1),"outEdges"),d=i(t);f(t,d);for(var p,m=Number.POSITIVE_INFINITY,v=0,g=0;g<4;++v,++g){(function(t,e){var r=new l;n.forEach(t,function(t){var i=t.graph().root,o=s(t,i,r,e);n.forEach(o.vs,function(e,r){t.node(e).order=r}),u(t,r,o.vs)})})(v%2?r:a,v%4>=2),d=h.buildLayerMatrix(t);var y=o(t,d);y=t.barycenter)&&function(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}(r)),n.forEach(r.out,function(e){return function(r){r.in.push(e),0==--r.indegree&&t.push(r)}}(r))}return n.map(n.filter(e,function(t){return!t.merged}),function(t){return n.pick(t,["vs","i","barycenter","weight"])})}(n.filter(r,function(t){return!t.indegree}))}},35606:function(t,e,r){var n=r(57137),i=r(85787),o=r(23022),s=r(82036);t.exports=function t(e,r,a,u){var l=e.children(r),h=e.node(r),c=h?h.borderLeft:void 0,f=h?h.borderRight:void 0,d={};c&&(l=n.filter(l,function(t){return t!==c&&t!==f}));var p=i(e,l);n.forEach(p,function(r){if(e.children(r.v).length){var i=t(e,r.v,a,u);d[r.v]=i,n.has(i,"barycenter")&&(n.isUndefined(r.barycenter)?(r.barycenter=i.barycenter,r.weight=i.weight):(r.barycenter=(r.barycenter*r.weight+i.barycenter*i.weight)/(r.weight+i.weight),r.weight+=i.weight))}});var m=o(p,a);n.forEach(m,function(t){t.vs=n.flatten(t.vs.map(function(t){return d[t]?d[t].vs:t}),!0)});var v=s(m,u);if(c&&(v.vs=n.flatten([c,v.vs,f],!0),e.predecessors(c).length)){var g=e.node(e.predecessors(c)[0]),y=e.node(e.predecessors(f)[0]);n.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+g.order+y.order)/(v.weight+2),v.weight+=2}return v}},82036:function(t,e,r){var n=r(57137),i=r(47332);function o(t,e,r){for(var i;e.length&&(i=n.last(e)).i<=r;)e.pop(),t.push(i.vs),r++;return r}t.exports=function(t,e){var r,s=i.partition(t,function(t){return n.has(t,"barycenter")}),a=s.lhs,u=n.sortBy(s.rhs,function(t){return-t.i}),l=[],h=0,c=0,f=0;a.sort((r=!!e,function(t,e){return t.barycentere.barycenter?1:r?e.i-t.i:t.i-e.i})),f=o(l,u,f),n.forEach(a,function(t){f+=t.vs.length,l.push(t.vs),h+=t.barycenter*t.weight,c+=t.weight,f=o(l,u,f)});var d={vs:n.flatten(l,!0)};return c&&(d.barycenter=h/c,d.weight=c),d}},79004:function(t,e,r){var n=r(57137);t.exports=function(t){var e,r,i=(e={},r=0,n.forEach(t.children(),function i(o){var s=r;n.forEach(t.children(o),i),e[o]={low:s,lim:r++}}),e);n.forEach(t.graph().dummyChains,function(e){for(var r=t.node(e),n=r.edgeObj,o=function(t,e,r,n){var i,o,s=[],a=[],u=Math.min(e[r].low,e[n].low),l=Math.max(e[r].lim,e[n].lim);i=r;do s.push(i=t.parent(i));while(i&&(e[i].low>u||l>e[i].lim));for(o=i,i=n;(i=t.parent(i))!==o;)a.push(i);return{path:s.concat(a.reverse()),lca:o}}(t,i,n.v,n.w),s=o.path,a=o.lca,u=0,l=s[0],h=!0;e!==n.w;){if(r=t.node(e),h){for(;(l=s[u])!==a&&t.node(l).maxRanka)&&u(r,e,l)})})}return n.reduce(e,function(e,r){var o,s=-1,a=0;return n.forEach(r,function(n,u){if("border"===t.node(n).dummy){var l=t.predecessors(n);l.length&&(o=t.node(l[0]).order,i(r,a,u,s,o),a=u,s=o)}i(r,a,r.length,o,e.length)}),r}),r}function u(t,e,r){if(e>r){var n=e;e=r,r=n}var i=t[e];i||(t[e]=i={}),i[r]=!0}function l(t,e,r){if(e>r){var i=e;e=r,r=i}return n.has(t[e],r)}function h(t,e,r,i){var o={},s={},a={};return n.forEach(e,function(t){n.forEach(t,function(t,e){o[t]=t,s[t]=t,a[t]=e})}),n.forEach(e,function(t){var e=-1;n.forEach(t,function(t){var u=i(t);if(u.length)for(var h=((u=n.sortBy(u,function(t){return a[t]})).length-1)/2,c=Math.floor(h),f=Math.ceil(h);c<=f;++c){var d=u[c];s[t]===t&&eu.lim&&(l=u,h=!0);var c=n.filter(e.edges(),function(e){return h===g(t,t.node(e.v),l)&&h!==g(t,t.node(e.w),l)});return n.minBy(c,function(t){return o(e,t)})}function v(t,e,r,i){var o,s,u=r.v,l=r.w;t.removeEdge(u,l),t.setEdge(i.v,i.w,{}),d(t),c(t,e),o=n.find(t.nodes(),function(t){return!e.node(t).parent}),s=(s=a(t,o)).slice(1),n.forEach(s,function(r){var n=t.node(r).parent,i=e.edge(r,n),o=!1;i||(i=e.edge(n,r),o=!0),e.node(r).rank=e.node(n).rank+(o?i.minlen:-i.minlen)})}function g(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}t.exports=h,h.initLowLimValues=d,h.initCutValues=c,h.calcCutValue=f,h.leaveEdge=p,h.enterEdge=m,h.exchangeEdges=v},59305:function(t,e,r){"use strict";var n=r(57137);t.exports={longestPath:function(t){var e={};n.forEach(t.sources(),function r(i){var o=t.node(i);if(n.has(e,i))return o.rank;e[i]=!0;var s=n.min(n.map(t.outEdges(i),function(e){return r(e.w)-t.edge(e).minlen}));return(s===Number.POSITIVE_INFINITY||null==s)&&(s=0),o.rank=s})},slack:function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}}},47332:function(t,e,r){"use strict";var n=r(57137),i=r(87591).Graph;function o(t,e,r,i){var o;do o=n.uniqueId(i);while(t.hasNode(o));return r.dummy=e,t.setNode(o,r),o}function s(t){return n.max(n.map(t.nodes(),function(e){var r=t.node(e).rank;if(!n.isUndefined(r))return r}))}t.exports={addDummyNode:o,simplify:function(t){var e=new i().setGraph(t.graph());return n.forEach(t.nodes(),function(r){e.setNode(r,t.node(r))}),n.forEach(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e},asNonCompoundGraph:function(t){var e=new i({multigraph:t.isMultigraph()}).setGraph(t.graph());return n.forEach(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),n.forEach(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e},successorWeights:function(t){var e=n.map(t.nodes(),function(e){var r={};return n.forEach(t.outEdges(e),function(e){r[e.w]=(r[e.w]||0)+t.edge(e).weight}),r});return n.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=n.map(t.nodes(),function(e){var r={};return n.forEach(t.inEdges(e),function(e){r[e.v]=(r[e.v]||0)+t.edge(e).weight}),r});return n.zipObject(t.nodes(),e)},intersectRect:function(t,e){var r,n,i=t.x,o=t.y,s=e.x-i,a=e.y-o,u=t.width/2,l=t.height/2;if(!s&&!a)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*u>Math.abs(s)*l?(a<0&&(l=-l),r=l*s/a,n=l):(s<0&&(u=-u),r=u,n=u*a/s),{x:i+r,y:o+n}},buildLayerMatrix:function(t){var e=n.map(n.range(s(t)+1),function(){return[]});return n.forEach(t.nodes(),function(r){var i=t.node(r),o=i.rank;n.isUndefined(o)||(e[o][i.order]=r)}),e},normalizeRanks:function(t){var e=n.min(n.map(t.nodes(),function(e){return t.node(e).rank}));n.forEach(t.nodes(),function(r){var i=t.node(r);n.has(i,"rank")&&(i.rank-=e)})},removeEmptyRanks:function(t){var e=n.min(n.map(t.nodes(),function(e){return t.node(e).rank})),r=[];n.forEach(t.nodes(),function(n){var i=t.node(n).rank-e;r[i]||(r[i]=[]),r[i].push(n)});var i=0,o=t.graph().nodeRankFactor;n.forEach(r,function(e,r){n.isUndefined(e)&&r%o!=0?--i:i&&n.forEach(e,function(e){t.node(e).rank+=i})})},addBorderNode:function(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),o(t,"border",i,e)},maxRank:s,partition:function(t,e){var r={lhs:[],rhs:[]};return n.forEach(t,function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r},time:function(t,e){var r=n.now();try{return e()}finally{console.log(t+" time: "+(n.now()-r)+"ms")}},notime:function(t,e){return e()}}},58323:function(t){t.exports="0.8.5"},29299:function(t,e,r){var n=r(41301);t.exports={Graph:n.Graph,json:r(67683),alg:r(71944),version:n.version}},81904:function(t,e,r){var n=r(98562);t.exports=function(t){var e,r={},i=[];return n.each(t.nodes(),function(o){e=[],function i(o){n.has(r,o)||(r[o]=!0,e.push(o),n.each(t.successors(o),i),n.each(t.predecessors(o),i))}(o),e.length&&i.push(e)}),i}},33766:function(t,e,r){var n=r(98562);t.exports=function(t,e,r){n.isArray(e)||(e=[e]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),o=[],s={};return n.each(e,function(e){if(!t.hasNode(e))throw Error("Graph does not have node: "+e);(function t(e,r,i,o,s,a){!n.has(o,r)&&(o[r]=!0,i||a.push(r),n.each(s(r),function(r){t(e,r,i,o,s,a)}),i&&a.push(r))})(t,e,"post"===r,s,i,o)}),o}},17906:function(t,e,r){var n=r(26800),i=r(98562);t.exports=function(t,e,r){return i.transform(t.nodes(),function(i,o){i[o]=n(t,o,e,r)},{})}},26800:function(t,e,r){var n=r(98562),i=r(2585);t.exports=function(t,e,r,n){return function(t,e,r,n){var o,s,a={},u=new i,l=function(t){var e=t.v!==o?t.v:t.w,n=a[e],i=r(t),l=s.distance+i;if(i<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+i);l0&&(s=a[o=u.removeMin()]).distance!==Number.POSITIVE_INFINITY;)n(o).forEach(l);return a}(t,String(e),r||o,n||function(e){return t.outEdges(e)})};var o=n.constant(1)},34229:function(t,e,r){var n=r(98562),i=r(86730);t.exports=function(t){return n.filter(i(t),function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})}},25265:function(t,e,r){var n=r(98562);t.exports=function(t,e,r){var n,o,s,a;return n=e||i,o=r||function(e){return t.outEdges(e)},s={},(a=t.nodes()).forEach(function(t){s[t]={},s[t][t]={distance:0},a.forEach(function(e){t!==e&&(s[t][e]={distance:Number.POSITIVE_INFINITY})}),o(t).forEach(function(e){var r=e.v===t?e.w:e.v,i=n(e);s[t][r]={distance:i,predecessor:t}})}),a.forEach(function(t){var e=s[t];a.forEach(function(r){var n=s[r];a.forEach(function(r){var i=n[t],o=e[r],s=n[r],a=i.distance+o.distance;a0;){if(r=u.removeMin(),n.has(a,r))s.setEdge(r,a[r]);else if(h)throw Error("Input graph is not connected: "+t);else h=!0;t.nodeEdges(r).forEach(l)}return s}},86730:function(t,e,r){var n=r(98562);t.exports=function(t){var e=0,r=[],i={},o=[];return t.nodes().forEach(function(s){n.has(i,s)||function s(a){var u=i[a]={onStack:!0,lowlink:e,index:e++};if(r.push(a),t.successors(a).forEach(function(t){n.has(i,t)?i[t].onStack&&(u.lowlink=Math.min(u.lowlink,i[t].index)):(s(t),u.lowlink=Math.min(u.lowlink,i[t].lowlink))}),u.lowlink===u.index){var l,h=[];do i[l=r.pop()].onStack=!1,h.push(l);while(a!==l);o.push(h)}}(s)}),o}},20361:function(t,e,r){var n=r(98562);function i(t){var e={},r={},i=[];if(n.each(t.sinks(),function s(a){if(n.has(r,a))throw new o;n.has(e,a)||(r[a]=!0,e[a]=!0,n.each(t.predecessors(a),s),delete r[a],i.push(a))}),n.size(e)!==t.nodeCount())throw new o;return i}function o(){}t.exports=i,i.CycleException=o,o.prototype=Error()},2585:function(t,e,r){var n=r(98562);function i(){this._arr=[],this._keyIndices={}}t.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map(function(t){return t.key})},i.prototype.has=function(t){return n.has(this._keyIndices,t)},i.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},i.prototype.min=function(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(t,e){var r=this._keyIndices;if(t=String(t),!n.has(r,t)){var i=this._arr,o=i.length;return r[t]=o,i.push({key:t,priority:e}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},i.prototype.decrease=function(t,e){var r=this._keyIndices[t];if(e>this._arr[r].priority)throw Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[r].priority+" New: "+e);this._arr[r].priority=e,this._decrease(r)},i.prototype._heapify=function(t){var e=this._arr,r=2*t,n=r+1,i=t;r>1].prioritys){var a=o;o=s,s=a}return o+"\x01"+s+"\x01"+(n.isUndefined(i)?"\0":i)}function u(t,e){return a(t,e.v,e.w,e.name)}t.exports=i,i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(t){return this._label=t,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(t){return n.isFunction(t)||(t=n.constant(t)),this._defaultNodeLabelFn=t,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return n.keys(this._nodes)},i.prototype.sources=function(){var t=this;return n.filter(this.nodes(),function(e){return n.isEmpty(t._in[e])})},i.prototype.sinks=function(){var t=this;return n.filter(this.nodes(),function(e){return n.isEmpty(t._out[e])})},i.prototype.setNodes=function(t,e){var r=arguments,i=this;return n.each(t,function(t){r.length>1?i.setNode(t,e):i.setNode(t)}),this},i.prototype.setNode=function(t,e){return n.has(this._nodes,t)?arguments.length>1&&(this._nodes[t]=e):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount),this},i.prototype.node=function(t){return this._nodes[t]},i.prototype.hasNode=function(t){return n.has(this._nodes,t)},i.prototype.removeNode=function(t){var e=this;if(n.has(this._nodes,t)){var r=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],n.each(this.children(t),function(t){e.setParent(t)}),delete this._children[t]),n.each(n.keys(this._in[t]),r),delete this._in[t],delete this._preds[t],n.each(n.keys(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},i.prototype.setParent=function(t,e){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(n.isUndefined(e))e="\0";else{e+="";for(var r=e;!n.isUndefined(r);r=this.parent(r))if(r===t)throw Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},i.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},i.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},i.prototype.children=function(t){if(n.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return n.keys(e)}else if("\0"===t)return this.nodes();else if(this.hasNode(t))return[]},i.prototype.predecessors=function(t){var e=this._preds[t];if(e)return n.keys(e)},i.prototype.successors=function(t){var e=this._sucs[t];if(e)return n.keys(e)},i.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return n.union(e,this.successors(t))},i.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},i.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;n.each(this._nodes,function(r,n){t(n)&&e.setNode(n,r)}),n.each(this._edgeObjs,function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,r.edge(t))});var i={};return this._isCompound&&n.each(e.nodes(),function(t){e.setParent(t,function t(n){var o=r.parent(n);return void 0===o||e.hasNode(o)?(i[n]=o,o):o in i?i[o]:t(o)}(t))}),e},i.prototype.setDefaultEdgeLabel=function(t){return n.isFunction(t)||(t=n.constant(t)),this._defaultEdgeLabelFn=t,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return n.values(this._edgeObjs)},i.prototype.setPath=function(t,e){var r=this,i=arguments;return n.reduce(t,function(t,n){return i.length>1?r.setEdge(t,n,e):r.setEdge(t,n),n}),this},i.prototype.setEdge=function(){var t,e,r,i,s=!1,u=arguments[0];"object"==typeof u&&null!==u&&"v"in u?(t=u.v,e=u.w,r=u.name,2==arguments.length&&(i=arguments[1],s=!0)):(t=u,e=arguments[1],r=arguments[3],arguments.length>2&&(i=arguments[2],s=!0)),t=""+t,e=""+e,n.isUndefined(r)||(r=""+r);var l=a(this._isDirected,t,e,r);if(n.has(this._edgeLabels,l))return s&&(this._edgeLabels[l]=i),this;if(!n.isUndefined(r)&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=s?i:this._defaultEdgeLabelFn(t,e,r);var h=function(t,e,r,n){var i=""+e,o=""+r;if(!t&&i>o){var s=i;i=o,o=s}var a={v:i,w:o};return n&&(a.name=n),a}(this._isDirected,t,e,r);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[l]=h,o(this._preds[e],t),o(this._sucs[t],e),this._in[e][l]=h,this._out[t][l]=h,this._edgeCount++,this},i.prototype.edge=function(t,e,r){var n=1==arguments.length?u(this._isDirected,arguments[0]):a(this._isDirected,t,e,r);return this._edgeLabels[n]},i.prototype.hasEdge=function(t,e,r){var i=1==arguments.length?u(this._isDirected,arguments[0]):a(this._isDirected,t,e,r);return n.has(this._edgeLabels,i)},i.prototype.removeEdge=function(t,e,r){var n=1==arguments.length?u(this._isDirected,arguments[0]):a(this._isDirected,t,e,r),i=this._edgeObjs[n];return i&&(t=i.v,e=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],s(this._preds[e],t),s(this._sucs[t],e),delete this._in[e][n],delete this._out[t][n],this._edgeCount--),this},i.prototype.inEdges=function(t,e){var r=this._in[t];if(r){var i=n.values(r);return e?n.filter(i,function(t){return t.v===e}):i}},i.prototype.outEdges=function(t,e){var r=this._out[t];if(r){var i=n.values(r);return e?n.filter(i,function(t){return t.w===e}):i}},i.prototype.nodeEdges=function(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))}},41301:function(t,e,r){t.exports={Graph:r(55533),version:r(97285)}},67683:function(t,e,r){var n=r(98562),i=r(55533);t.exports={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:n.map(t.nodes(),function(e){var r=t.node(e),i=t.parent(e),o={v:e};return n.isUndefined(r)||(o.value=r),n.isUndefined(i)||(o.parent=i),o}),edges:n.map(t.edges(),function(e){var r=t.edge(e),i={v:e.v,w:e.w};return n.isUndefined(e.name)||(i.name=e.name),n.isUndefined(r)||(i.value=r),i})};return n.isUndefined(t.graph())||(e.value=n.clone(t.graph())),e},read:function(t){var e=new i(t.options).setGraph(t.value);return n.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),n.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}}},98562:function(t,e,r){var n;try{n={clone:r(70972),constant:r(92353),each:r(74477),filter:r(4155),has:r(17693),isArray:r(25614),isEmpty:r(70764),isFunction:r(86757),isUndefined:r(84432),keys:r(43228),map:r(89238),reduce:r(20723),size:r(29656),transform:r(18014),union:r(91022),values:r(19713)}}catch(t){}n||(n=window._),t.exports=n},97285:function(t){t.exports="2.1.8"},57635:function(t,e,r){var n,i=r(96434).Buffer,o=r(40257);n=function(){return(function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){if(o)return o(s,!0);var u=Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};e[s][0].call(l.exports,function(t){return i(e[s][1][t]||t)},l,l.exports,t,e,r,n)}return r[s].exports}for(var o=void 0,s=0;s>2,a=(3&e)<<4|r>>4,u=1>6:64,l=2>4,r=(15&s)<<4|(a=o.indexOf(t.charAt(l++)))>>2,n=(3&a)<<6|(u=o.indexOf(t.charAt(l++))),f[h++]=e,64!==a&&(f[h++]=r),64!==u&&(f[h++]=n);return f}},{"./support":30,"./utils":32}],2:[function(t,e,r){"use strict";var n=t("./external"),i=t("./stream/DataWorker"),o=t("./stream/Crc32Probe"),s=t("./stream/DataLengthProbe");function a(t,e,r,n,i){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=n,this.compressedContent=i}a.prototype={getContentWorker:function(){var t=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),e=this;return t.on("end",function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),t},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,r){return t.pipe(new o).pipe(new s("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new s("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,r){"use strict";var n=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,r){"use strict";var n=t("./utils"),i=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,r,n){var o=0+r;t^=-1;for(var s=0;s>>8^i[255&(t^e[s])];return -1^t}(0|e,t,t.length,0):function(t,e,r,n){var o=0+r;t^=-1;for(var s=0;s>>8^i[255&(t^e.charCodeAt(s))];return -1^t}(0|e,t,t.length,0):0}},{"./utils":32}],5:[function(t,e,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,e,r){"use strict";var n=null;n="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:n}},{lie:37}],7:[function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t("pako"),o=t("./utils"),s=t("./stream/GenericWorker"),a=n?"uint8array":"array";function u(t,e){s.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",o.inherits(u,s),u.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(a,t.data),!1)},u.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new u("Deflate",t)},r.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,r){"use strict";function n(t,e){var r,n="";for(r=0;r>>=8;return n}function i(t,e,r,i,s,h){var c,f,d,p,m=t.file,v=t.compression,g=h!==a.utf8encode,y=o.transformTo("string",h(m.name)),b=o.transformTo("string",a.utf8encode(m.name)),x=m.comment,w=o.transformTo("string",h(x)),_=o.transformTo("string",a.utf8encode(x)),k=b.length!==m.name.length,E=_.length!==x.length,A="",S="",T="",C=m.dir,P=m.date,j={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(j.crc32=t.crc32,j.compressedSize=t.compressedSize,j.uncompressedSize=t.uncompressedSize);var O=0;e&&(O|=8),!g&&(k||E)&&(O|=2048);var I=0,R=0;C&&(I|=16),"UNIX"===s?(R=798,I|=(f=c=m.unixPermissions,c||(f=C?16893:33204),(65535&f)<<16)):(R=20,I|=63&(m.dosPermissions||0)),d=(P.getUTCHours()<<6|P.getUTCMinutes())<<5|P.getUTCSeconds()/2,p=(P.getUTCFullYear()-1980<<4|P.getUTCMonth()+1)<<5|P.getUTCDate(),k&&(S=n(1,1)+n(u(y),4)+b,A+="up"+n(S.length,2)+S),E&&(T=n(1,1)+n(u(w),4)+_,A+="uc"+n(T.length,2)+T);var M="";return M+="\n\0"+n(O,2)+v.magic+n(d,2)+n(p,2)+n(j.crc32,4)+n(j.compressedSize,4)+n(j.uncompressedSize,4)+n(y.length,2)+n(A.length,2),{fileRecord:l.LOCAL_FILE_HEADER+M+y+A,dirRecord:l.CENTRAL_FILE_HEADER+n(R,2)+M+n(w.length,2)+"\0\0\0\0"+n(I,4)+n(i,4)+y+A+w}}var o=t("../utils"),s=t("../stream/GenericWorker"),a=t("../utf8"),u=t("../crc32"),l=t("../signature");function h(t,e,r,n){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(h,s),h.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,s.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-n-1))/r:100}}))},h.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=i(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=i(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:l.DATA_DESCRIPTOR+n(t.crc32,4)+n(t.compressedSize,4)+n(t.uncompressedSize,4),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var t,e,r,i,s=this.bytesWritten,a=0;a=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=i},{"../utils":32}],19:[function(t,e,r){"use strict";var n=t("./Uint8ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,r){"use strict";var n=t("./DataReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},i.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},i.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./DataReader":18}],21:[function(t,e,r){"use strict";var n=t("./ArrayReader");function i(t){n.call(this,t)}t("../utils").inherits(i,n),i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../support"),o=t("./ArrayReader"),s=t("./StringReader"),a=t("./NodeBufferReader"),u=t("./Uint8ArrayReader");e.exports=function(t){var e=n.getTypeOf(t);return n.checkSupport(e),"string"!==e||i.uint8array?"nodebuffer"===e?new a(t):i.uint8array?new u(n.transformTo("uint8array",t)):new o(n.transformTo("array",t)):new s(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,r){"use strict";r.LOCAL_FILE_HEADER="PK\x03\x04",r.CENTRAL_FILE_HEADER="PK\x01\x02",r.CENTRAL_DIRECTORY_END="PK\x05\x06",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06",r.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,e,r){"use strict";var n=t("./GenericWorker"),i=t("../utils");function o(t){n.call(this,"ConvertWorker to "+t),this.destType=t}i.inherits(o,n),o.prototype.processChunk=function(t){this.push({data:i.transformTo(this.destType,t.data),meta:t.meta})},e.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,r){"use strict";var n=t("./GenericWorker"),i=t("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(o,n),o.prototype.processChunk=function(t){this.streamInfo.crc32=i(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./GenericWorker");function o(t){i.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(o,i),o.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}i.prototype.processChunk.call(this,t)},e.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./GenericWorker");function o(t){i.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then(function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}n.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,r){"use strict";function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r "+t:t}},e.exports=n},{}],29:[function(t,e,r){"use strict";var n=t("../utils"),o=t("./ConvertWorker"),s=t("./GenericWorker"),a=t("../base64"),u=t("../support"),l=t("../external"),h=null;if(u.nodestream)try{h=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function c(t,e,r){var i=e;switch(e){case"blob":case"arraybuffer":i="uint8array";break;case"base64":i="string"}try{this._internalType=i,this._outputType=e,this._mimeType=r,n.checkSupport(i),this._worker=t.pipe(new o(i)),t.lock()}catch(t){this._worker=new s("error"),this._worker.error(t)}}c.prototype={accumulate:function(t){var e;return e=this,new l.Promise(function(r,o){var s=[],u=e._internalType,l=e._outputType,h=e._mimeType;e.on("data",function(e,r){s.push(e),t&&t(r)}).on("error",function(t){s=[],o(t)}).on("end",function(){try{var t=function(t,e,r){switch(t){case"blob":return n.newBlob(n.transformTo("arraybuffer",e),r);case"base64":return a.encode(e);default:return n.transformTo(t,e)}}(l,function(t,e){var r,n=0,o=null,s=0;for(r=0;r>>6:(r<65536?e[s++]=224|r>>>12:(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63),e[s++]=128|r>>>6&63),e[s++]=128|63&r);return e}(t)},r.utf8decode=function(t){return i.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,r,i,o,s=t.length,u=Array(2*s);for(e=r=0;e>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)}(t=n.transformTo(i.uint8array?"uint8array":"array",t))},n.inherits(l,s),l.prototype.processChunk=function(t){var e=n.transformTo(i.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=e;(e=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),e.set(o,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var s=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0?e:0===r?e:r+a[t[r]]>e?r:e}(e),u=e;s!==e.length&&(i.uint8array?(u=e.subarray(0,s),this.leftOver=e.subarray(s,e.length)):(u=e.slice(0,s),this.leftOver=e.slice(s,e.length))),this.push({data:r.utf8decode(u),meta:t.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=l,n.inherits(h,s),h.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,r){"use strict";var n=t("./support"),i=t("./base64"),o=t("./nodejsUtils"),s=t("./external");function a(t){return t}function u(t,e){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,r,n,i=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(r<65536?e[s++]=224|r>>>12:(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63),e[s++]=128|r>>>6&63),e[s++]=128|63&r);return e},r.buf2binstring=function(t){return u(t,t.length)},r.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r>10&1023,l[n++]=56320|1023&i)}return u(l,n)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0?e:0===r?e:r+s[t[r]]>e?r:e}},{"./common":41}],43:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){for(var i=65535&t|0,o=t>>>16&65535|0,s=0;0!==r;){for(r-=s=2e3>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var o=i+r;t^=-1;for(var s=i;s>>8^n[255&(t^e[s])];return -1^t}},{}],46:[function(t,e,r){"use strict";var n,i=t("../utils/common"),o=t("./trees"),s=t("./adler32"),a=t("./crc32"),u=t("./messages");function l(t,e){return t.msg=u[e],e}function h(t){return(t<<1)-(4t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function d(t,e){o._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,f(t.strm)}function p(t,e){t.pending_buf[t.pending++]=e}function m(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function v(t,e){var r,n,i=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match,u=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,l=t.window,h=t.w_mask,c=t.prev,f=t.strstart+258,d=l[o+s-1],p=l[o+s];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do if(l[(r=e)+s]===p&&l[r+s-1]===d&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do;while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&ou&&0!=--i);return s<=t.lookahead?s:t.lookahead}function g(t){var e,r,n,o,u,l,h,c,f,d,p=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=p+(p-262)){for(i.arraySet(t.window,t.window,p,p,0),t.match_start-=p,t.strstart-=p,t.block_start-=p,e=r=t.hash_size;n=t.head[--e],t.head[e]=p<=n?n-p:0,--r;);for(e=r=p;n=t.prev[--e],t.prev[e]=p<=n?n-p:0,--r;);o+=p}if(0===t.strm.avail_in)break;if(l=t.strm,h=t.window,c=t.strstart+t.lookahead,d=void 0,(f=o)<(d=l.avail_in)&&(d=f),r=0===d?0:(l.avail_in-=d,i.arraySet(h,l.input,l.next_in,d,c),1===l.state.wrap?l.adler=s(l.adler,h,d,c):2===l.state.wrap&&(l.adler=a(l.adler,h,d,c)),l.next_in+=d,l.total_in+=d,d),t.lookahead+=r,t.lookahead+t.insert>=3)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3){if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3&&t.match_length<=t.prev_length){for(i=t.strstart+t.lookahead-3,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=i&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(g(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,d(t,!1),0===t.strm.avail_out)||t.strstart-t.block_start>=t.w_size-262&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(d(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(d(t,!1),t.strm.avail_out),1)}),new x(4,4,8,4,y),new x(4,5,16,8,y),new x(4,6,32,32,y),new x(4,4,16,16,b),new x(8,16,32,32,b),new x(8,16,128,128,b),new x(8,32,128,256,b),new x(32,128,258,1024,b),new x(32,258,258,4096,b)],r.deflateInit=function(t,e){return E(t,e,8,15,8,0)},r.deflateInit2=E,r.deflateReset=k,r.deflateResetKeep=_,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?-2:(t.state.gzhead=e,0):-2},r.deflate=function(t,e){var r,i,s,u;if(!t||!t.state||5>8&255),p(i,i.gzhead.time>>16&255),p(i,i.gzhead.time>>24&255),p(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),p(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(p(i,255&i.gzhead.extra.length),p(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=a(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(p(i,0),p(i,0),p(i,0),p(i,0),p(i,0),p(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),p(i,3),i.status=113);else{var v=8+(i.w_bits-8<<4)<<8;v|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(v|=32),v+=31-v%31,i.status=113,m(i,v),0!==i.strstart&&(m(i,t.adler>>>16),m(i,65535&t.adler)),t.adler=1}}if(69===i.status){if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(t.adler=a(t.adler,i.pending_buf,i.pending-s,s)),f(t),s=i.pending,i.pending!==i.pending_buf_size));)p(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(t.adler=a(t.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73}if(73===i.status){if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(t.adler=a(t.adler,i.pending_buf,i.pending-s,s)),f(t),s=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexs&&(t.adler=a(t.adler,i.pending_buf,i.pending-s,s)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91}if(91===i.status){if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(t.adler=a(t.adler,i.pending_buf,i.pending-s,s)),f(t),s=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexs&&(t.adler=a(t.adler,i.pending_buf,i.pending-s,s)),0===u&&(i.status=103)}else i.status=103}if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&f(t),i.pending+2<=i.pending_buf_size&&(p(i,255&t.adler),p(i,t.adler>>8&255),t.adler=0,i.status=113)):i.status=113),0!==i.pending){if(f(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&h(e)<=h(r)&&4!==e)return l(t,-5);if(666===i.status&&0!==t.avail_in)return l(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var y=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(g(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(d(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(d(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var r,n,i,s,a=t.window;;){if(t.lookahead<=258){if(g(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=o._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(d(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(d(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(d(t,!1),0===t.strm.avail_out)?1:2}(i,e):n[i.level].func(i,e);if(3!==y&&4!==y||(i.status=666),1===y||3===y)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===y&&(1===e?o._tr_align(i):5!==e&&(o._tr_stored_block(i,0,0,!1),3===e&&(c(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),f(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(p(i,255&t.adler),p(i,t.adler>>8&255),p(i,t.adler>>16&255),p(i,t.adler>>24&255),p(i,255&t.total_in),p(i,t.total_in>>8&255),p(i,t.total_in>>16&255),p(i,t.total_in>>24&255)):(m(i,t.adler>>>16),m(i,65535&t.adler)),f(t),0=r.w_size&&(0===a&&(c(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new i.Buf8(r.w_size),i.arraySet(f,e,d-r.w_size,r.w_size,0),e=f,d=r.w_size),u=t.avail_in,l=t.next_in,h=t.input,t.avail_in=d,t.next_in=0,t.input=e,g(r);r.lookahead>=3;){for(n=r.strstart,o=r.lookahead-2;r.ins_h=(r.ins_h<>>=x=b>>>24,p-=x,0==(x=b>>>16&255))S[o++]=65535&b;else{if(!(16&x)){if(0==(64&x)){b=m[(65535&b)+(d&(1<>>=x,p-=x),p<15&&(d+=A[n++]<>>=x=b>>>24,p-=x,!(16&(x=b>>>16&255))){if(0==(64&x)){b=v[(65535&b)+(d&(1<>>=x,p-=x,(x=o-s)<_){if(h<(x=_-x)&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(E=f,(k=0)===c){if(k+=l-x,x>3,d&=(1<<(p-=w<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function l(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):-2}function c(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,h(t)):-2}function f(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=s.wsize?(n.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i<(o=s.wsize-s.wnext)&&(o=i),n.arraySet(s.window,e,r-i,o,s.wnext),(i-=o)?(n.arraySet(s.window,e,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=o(r.check,z,2,0),x=b=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&b)<<8)+(b>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&b)){t.msg="unknown compression method",r.mode=30;break}if(x-=4,I=8+(15&(b>>>=4)),0===r.wbits)r.wbits=I;else if(I>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(z[0]=255&b,z[1]=b>>>8&255,r.check=o(r.check,z,2,0)),x=b=0,r.mode=3;case 3:for(;x<32;){if(0===d)break t;d--,b+=l[c++]<>>8&255,z[2]=b>>>16&255,z[3]=b>>>24&255,r.check=o(r.check,z,4,0)),x=b=0,r.mode=4;case 4:for(;x<16;){if(0===d)break t;d--,b+=l[c++]<>8),512&r.flags&&(z[0]=255&b,z[1]=b>>>8&255,r.check=o(r.check,z,2,0)),x=b=0,r.mode=5;case 5:if(1024&r.flags){for(;x<16;){if(0===d)break t;d--,b+=l[c++]<>>8&255,r.check=o(r.check,z,2,0)),x=b=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(d<(k=r.length)&&(k=d),k&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=Array(r.head.extra_len)),n.arraySet(r.head.extra,l,c,k,I)),512&r.flags&&(r.check=o(r.check,l,k,c)),d-=k,c+=k,r.length-=k),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===d)break t;for(k=0;I=l[c+k++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I)),I&&k>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;x<32;){if(0===d)break t;d--,b+=l[c++]<>>=7&x,x-=7&x,r.mode=27;break}for(;x<3;){if(0===d)break t;d--,b+=l[c++]<>>=1)){case 0:r.mode=14;break;case 1:if(function(t){if(v){var e;for(p=new n.Buf32(512),m=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(1,t.lens,0,288,p,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(2,t.lens,0,32,m,0,t.work,{bits:5}),v=!1}t.lencode=p,t.lenbits=9,t.distcode=m,t.distbits=5}(r),r.mode=20,6!==e)break;b>>>=2,x-=2;break t;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}b>>>=2,x-=2;break;case 14:for(b>>>=7&x,x-=7&x;x<32;){if(0===d)break t;d--,b+=l[c++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&b,x=b=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(k=r.length){if(d>>=5,x-=5,r.ndist=1+(31&b),b>>>=5,x-=5,r.ncode=4+(15&b),b>>>=4,x-=4,286>>=3,x-=3}for(;r.have<19;)r.lens[L[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,M={bits:r.lenbits},R=a(0,r.lens,0,19,r.lencode,0,r.work,M),r.lenbits=M.bits,R){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,C=65535&D,!((S=D>>>24)<=x);){if(0===d)break t;d--,b+=l[c++]<>>=S,x-=S,r.lens[r.have++]=C;else{if(16===C){for(B=S+2;x>>=S,x-=S,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}I=r.lens[r.have-1],k=3+(3&b),b>>>=2,x-=2}else if(17===C){for(B=S+3;x>>=S)),b>>>=3,x-=3}else{for(B=S+7;x>>=S)),b>>>=7,x-=7}if(r.have+k>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;k--;)r.lens[r.have++]=I}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,M={bits:r.lenbits},R=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,M),r.lenbits=M.bits,R){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,M={bits:r.distbits},R=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,M),r.distbits=M.bits,R){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(6<=d&&258<=y){t.next_out=f,t.avail_out=y,t.next_in=c,t.avail_in=d,r.hold=b,r.bits=x,s(t,_),f=t.next_out,h=t.output,y=t.avail_out,c=t.next_in,l=t.input,d=t.avail_in,b=r.hold,x=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;T=(D=r.lencode[b&(1<>>16&255,C=65535&D,!((S=D>>>24)<=x);){if(0===d)break t;d--,b+=l[c++]<>P)])>>>16&255,C=65535&D,!(P+(S=D>>>24)<=x);){if(0===d)break t;d--,b+=l[c++]<>>=P,x-=P,r.back+=P}if(b>>>=S,x-=S,r.back+=S,r.length=C,0===T){r.mode=26;break}if(32&T){r.back=-1,r.mode=12;break}if(64&T){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&T,r.mode=22;case 22:if(r.extra){for(B=r.extra;x>>=r.extra,x-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;T=(D=r.distcode[b&(1<>>16&255,C=65535&D,!((S=D>>>24)<=x);){if(0===d)break t;d--,b+=l[c++]<>P)])>>>16&255,C=65535&D,!(P+(S=D>>>24)<=x);){if(0===d)break t;d--,b+=l[c++]<>>=P,x-=P,r.back+=P}if(b>>>=S,x-=S,r.back+=S,64&T){t.msg="invalid distance code",r.mode=30;break}r.offset=C,r.extra=15&T,r.mode=24;case 24:if(r.extra){for(B=r.extra;x>>=r.extra,x-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===y)break t;if(k=_-y,r.offset>k){if((k=r.offset-k)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}E=k>r.wnext?(k-=r.wnext,r.wsize-k):r.wnext-k,k>r.length&&(k=r.length),A=r.window}else A=h,E=f-r.offset,k=r.length;for(yy?(x=z[L+c[E]],R[M+c[E]]):(x=96,0),d=1<>P)+(p-=d)]=b<<24|x<<16|w|0,0!==p;);for(d=1<>=1;if(0!==d?(I&=d-1,I+=d):I=0,E++,0==--B[k]){if(k===S)break;k=e[r+c[E]]}if(T>>7)]}function w(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function _(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<>>=1,r<<=1,0<--e;);return r>>>1}function A(t,e,r){var n,i,o=Array(16),s=0;for(n=1;n<=15;n++)o[n]=s=s+r[n-1]<<1;for(i=0;i<=e;i++){var a=t[2*i+1];0!==a&&(t[2*i]=E(o[a]++,a))}}function S(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function T(t){8>1;1<=r;r--)P(t,o,r);for(i=u;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],P(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,P(t,o,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,s,a,u=e.dyn_tree,l=e.max_code,h=e.stat_desc.static_tree,c=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)p<(o=u[2*u[2*(n=t.heap[r])+1]+1]+1)&&(o=p,m++),u[2*n+1]=o,l>=7;n<30;n++)for(g[n]=i<<7,t=0;t<1<>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),O(t,t.l_desc),O(t,t.d_desc),s=function(t){var e;for(I(t,t.dyn_ltree,t.l_desc.max_code),I(t,t.dyn_dtree,t.d_desc.max_code),O(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*u[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?B(t,e,r,n):4===t.strategy||o===i?(_(t,2+(n?1:0),3),j(t,l,h)):(_(t,4+(n?1:0),3),function(t,e,r,n){var i;for(_(t,e-257,5),_(t,r-1,5),_(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(f[r]+256+1)]++,t.dyn_dtree[2*x(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){_(t,2,3),k(t,256,l),16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":41}],53:[function(t,e,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,n){(function(t){!function(t,e){"use strict";if(!t.setImmediate){var r,n,i,s,a=1,u={},l=!1,h=t.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(t);c=c&&c.setTimeout?c:t,r="[object process]"===({}).toString.call(t.process)?function(t){o.nextTick(function(){d(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((i=new MessageChannel).port1.onmessage=function(t){d(t.data)},function(t){i.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(n=h.documentElement,function(t){var e=h.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e)}):function(t){setTimeout(d,0,t)}:(s="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",p,!1):t.attachEvent("onmessage",p),function(e){t.postMessage(s+e,"*")}),c.setImmediate=function(t){"function"!=typeof t&&(t=Function(""+t));for(var e=Array(arguments.length-1),n=0;n-1}},56883:function(t){t.exports=function(t,e,r){for(var n=-1,i=null==t?0:t.length;++n0&&o(h)?r>1?t(h,r-1,o,s,a):n(a,h):s||(a[a.length]=h)}return a}},63321:function(t,e,r){var n=r(33023)();t.exports=n},98060:function(t,e,r){var n=r(63321),i=r(43228);t.exports=function(t,e){return t&&n(t,e,i)}},92167:function(t,e,r){var n=r(67906),i=r(70235);t.exports=function(t,e){e=n(e,t);for(var r=0,o=e.length;null!=t&&re}},78449:function(t){var e=Object.prototype.hasOwnProperty;t.exports=function(t,r){return null!=t&&e.call(t,r)}},93012:function(t){t.exports=function(t,e){return null!=t&&e in Object(t)}},47909:function(t,e,r){var n=r(8235),i=r(31953),o=r(35281);t.exports=function(t,e,r){return e==e?o(t,e,r):n(t,i,r)}},90370:function(t,e,r){var n=r(54506),i=r(10303);t.exports=function(t){return i(t)&&"[object Arguments]"==n(t)}},56318:function(t,e,r){var n=r(6791),i=r(10303);t.exports=function t(e,r,o,s,a){return e===r||(null!=e&&null!=r&&(i(e)||i(r))?n(e,r,o,s,t,a):e!=e&&r!=r)}},6791:function(t,e,r){var n=r(85885),i=r(97638),o=r(88030),s=r(64974),a=r(81690),u=r(25614),l=r(98051),h=r(9792),c="[object Arguments]",f="[object Array]",d="[object Object]",p=Object.prototype.hasOwnProperty;t.exports=function(t,e,r,m,v,g){var y=u(t),b=u(e),x=y?f:a(t),w=b?f:a(e);x=x==c?d:x,w=w==c?d:w;var _=x==d,k=w==d,E=x==w;if(E&&l(t)){if(!l(e))return!1;y=!0,_=!1}if(E&&!_)return g||(g=new n),y||h(t)?i(t,e,r,m,v,g):o(t,e,x,r,m,v,g);if(!(1&r)){var A=_&&p.call(t,"__wrapped__"),S=k&&p.call(e,"__wrapped__");if(A||S){var T=A?t.value():t,C=S?e.value():e;return g||(g=new n),v(T,C,r,m,g)}}return!!E&&(g||(g=new n),s(t,e,r,m,v,g))}},32012:function(t,e,r){var n=r(81690),i=r(10303);t.exports=function(t){return i(t)&&"[object Map]"==n(t)}},62538:function(t,e,r){var n=r(85885),i=r(56318);t.exports=function(t,e,r,o){var s=r.length,a=s,u=!o;if(null==t)return!a;for(t=Object(t);s--;){var l=r[s];if(u&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s=200){var m=e?null:a(t);if(m)return u(m);f=!1,h=s,p=new n}else p=e?[]:d;e:for(;++le||s&&a&&l&&!u&&!h||i&&a&&l||!r&&l||!o)return 1;if(!i&&!s&&!h&&t=u)return l;return l*("desc"==r[i]?-1:1)}}return t.index-e.index}},56075:function(t){t.exports=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(s=t.length>3&&"function"==typeof s?(o--,s):void 0,a&&i(r[0],r[1],a)&&(s=o<3?void 0:s,o=1),e=Object(e);++n-1?a[u?e[l]:l]:void 0}}},35464:function(t,e,r){var n=r(19608),i=r(49639),o=r(175);t.exports=function(t){return function(e,r,s){return s&&"number"!=typeof s&&i(e,r,s)&&(r=s=void 0),e=o(e),void 0===r?(r=e,e=0):r=o(r),s=void 0===s?eh))return!1;var f=u.get(t),d=u.get(e);if(f&&d)return f==e&&d==t;var p=-1,m=!0,v=2&r?new n:void 0;for(u.set(t,e),u.set(e,t);++p-1&&t%1==0&&t-1}},13368:function(t,e,r){var n=r(24457);t.exports=function(t,e){var r=this.__data__,i=n(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}},38764:function(t,e,r){var n=r(9855),i=r(99078),o=r(88675);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},78615:function(t,e,r){var n=r(1507);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},83391:function(t,e,r){var n=r(1507);t.exports=function(t){return n(this,t).get(t)}},53483:function(t,e,r){var n=r(1507);t.exports=function(t){return n(this,t).has(t)}},74724:function(t,e,r){var n=r(1507);t.exports=function(t,e){var r=n(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}},22523:function(t){t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}},47073:function(t){t.exports=function(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in Object(r))}}},23787:function(t,e,r){var n=r(50967);t.exports=function(t){var e=n(t,function(t){return 500===r.size&&r.clear(),t}),r=e.cache;return e}},20453:function(t,e,r){var n=r(39866)(Object,"create");t.exports=n},77184:function(t,e,r){var n=r(45070)(Object.keys,Object);t.exports=n},92147:function(t){t.exports=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}},39931:function(t,e,r){t=r.nmd(t);var n=r(17071),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,s=o&&o.exports===i&&n.process,a=function(){try{var t=o&&o.require&&o.require("util").types;if(t)return t;return s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=a},80910:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},45070:function(t){t.exports=function(t,e){return function(r){return t(e(r))}}},49478:function(t,e,r){var n=r(60493),i=Math.max;t.exports=function(t,e,r){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,s=-1,a=i(o.length-e,0),u=Array(a);++s0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}},84092:function(t,e,r){var n=r(99078);t.exports=function(){this.__data__=new n,this.size=0}},31663:function(t){t.exports=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},69135:function(t){t.exports=function(t){return this.__data__.get(t)}},39552:function(t){t.exports=function(t){return this.__data__.has(t)}},63960:function(t,e,r){var n=r(99078),i=r(88675),o=r(76219);t.exports=function(t,e){var r=this.__data__;if(r instanceof n){var s=r.__data__;if(!i||s.length<199)return s.push([t,e]),this.size=++r.size,this;r=this.__data__=new o(s)}return r.set(t,e),this.size=r.size,this}},35281:function(t){t.exports=function(t,e,r){for(var n=r-1,i=t.length;++n2?e[2]:void 0;for(l&&o(e[0],e[1],l)&&(n=1);++r-1&&t%1==0&&t<=9007199254740991}},38839:function(t,e,r){var n=r(32012),i=r(23305),o=r(39931),s=o&&o.isMap,a=s?i(s):n;t.exports=a},28302:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},10303:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},90231:function(t,e,r){var n=r(54506),i=r(62602),o=r(10303),s=Object.prototype,a=Function.prototype.toString,u=s.hasOwnProperty,l=a.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=n(t))return!1;var e=i(t);if(null===e)return!0;var r=u.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&a.call(r)==l}},87615:function(t,e,r){var n=r(34188),i=r(23305),o=r(39931),s=o&&o.isSet,a=s?i(s):n;t.exports=a},42715:function(t,e,r){var n=r(54506),i=r(25614),o=r(10303);t.exports=function(t){return"string"==typeof t||!i(t)&&o(t)&&"[object String]"==n(t)}},78371:function(t,e,r){var n=r(54506),i=r(10303);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==n(t)}},9792:function(t,e,r){var n=r(59332),i=r(23305),o=r(39931),s=o&&o.isTypedArray,a=s?i(s):n;t.exports=a},84432:function(t){t.exports=function(t){return void 0===t}},43228:function(t,e,r){var n=r(28579),i=r(4578),o=r(5629);t.exports=function(t){return o(t)?n(t):i(t)}},18587:function(t,e,r){var n=r(28579),i=r(22476),o=r(5629);t.exports=function(t){return o(t)?n(t,!0):i(t)}},86185:function(t){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},89238:function(t,e,r){var n=r(73819),i=r(88157),o=r(24240),s=r(25614);t.exports=function(t,e){return(s(t)?n:o)(t,i(e,3))}},41443:function(t,e,r){var n=r(83023),i=r(98060),o=r(88157);t.exports=function(t,e){var r={};return e=o(e,3),i(t,function(t,i,o){n(r,i,e(t,i,o))}),r}},95645:function(t,e,r){var n=r(67646),i=r(58905),o=r(79586);t.exports=function(t){return t&&t.length?n(t,o,i):void 0}},50967:function(t,e,r){var n=r(76219);function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(i.Cache||n),r}i.Cache=n,t.exports=i},23006:function(t,e,r){var n=r(92197),i=r(48022)(function(t,e,r){n(t,e,r)});t.exports=i},99008:function(t,e,r){var n=r(67646),i=r(20121),o=r(79586);t.exports=function(t){return t&&t.length?n(t,o,i):void 0}},37891:function(t,e,r){var n=r(67646),i=r(88157),o=r(20121);t.exports=function(t,e){return t&&t.length?n(t,i(e,2),o):void 0}},93810:function(t){t.exports=function(){}},11121:function(t,e,r){var n=r(74288);t.exports=function(){return n.Date.now()}},53852:function(t,e,r){var n=r(21760),i=r(53526)(function(t,e){return null==t?{}:n(t,e)});t.exports=i},22350:function(t,e,r){var n=r(18155),i=r(73584),o=r(67352),s=r(70235);t.exports=function(t){return o(t)?n(s(t)):i(t)}},99676:function(t,e,r){var n=r(35464)();t.exports=n},20723:function(t,e,r){var n=r(76378),i=r(67676),o=r(88157),s=r(76805),a=r(25614);t.exports=function(t,e,r){var u=a(t)?n:s,l=arguments.length<3;return u(t,o(e,4),r,l,i)}},29656:function(t,e,r){var n=r(4578),i=r(81690),o=r(5629),s=r(42715),a=r(28226);t.exports=function(t){if(null==t)return 0;if(o(t))return s(t)?a(t):t.length;var e=i(t);return"[object Map]"==e||"[object Set]"==e?t.size:n(t).length}},34935:function(t,e,r){var n=r(72569),i=r(84046),o=r(44843),s=r(49639),a=o(function(t,e){if(null==t)return[];var r=e.length;return r>1&&s(t,e[0],e[1])?e=[]:r>2&&s(e[0],e[1],e[2])&&(e=[e[0]]),i(t,n(e,1),[])});t.exports=a},55716:function(t){t.exports=function(){return[]}},7406:function(t){t.exports=function(){return!1}},175:function(t,e,r){var n=r(6660),i=1/0;t.exports=function(t){return t?(t=n(t))===i||t===-i?(t<0?-1:1)*17976931348623157e292:t==t?t:0:0===t?t:0}},85759:function(t,e,r){var n=r(175);t.exports=function(t){var e=n(t),r=e%1;return e==e?r?e-r:e:0}},6660:function(t,e,r){var n=r(55041),i=r(28302),o=r(78371),s=0/0,a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,l=/^0o[0-7]+$/i,h=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return s;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var r=u.test(t);return r||l.test(t)?h(t.slice(2),r?2:8):a.test(t)?s:+t}},8838:function(t,e,r){var n=r(33485),i=r(18587);t.exports=function(t){return n(t,i(t))}},3641:function(t,e,r){var n=r(65020);t.exports=function(t){return null==t?"":n(t)}},18014:function(t,e,r){var n=r(2421),i=r(32318),o=r(98060),s=r(88157),a=r(62602),u=r(25614),l=r(98051),h=r(86757),c=r(28302),f=r(9792);t.exports=function(t,e,r){var d=u(t),p=d||l(t)||f(t);if(e=s(e,4),null==r){var m=t&&t.constructor;r=p?d?new m:[]:c(t)&&h(m)?i(a(t)):{}}return(p?n:o)(t,function(t,n,i){return e(r,t,n,i)}),r}},91022:function(t,e,r){var n=r(72569),i=r(44843),o=r(13826),s=r(35873),a=i(function(t){return o(n(t,1,s,!0))});t.exports=a},7633:function(t,e,r){var n=r(3641),i=0;t.exports=function(t){var e=++i;return n(t)+e}},19713:function(t,e,r){var n=r(86190),i=r(43228);t.exports=function(t){return null==t?[]:n(t,i(t))}},77423:function(t,e,r){var n=r(83295),i=r(19915);t.exports=function(t,e){return i(t||[],e||[],n)}},40257:function(t,e,r){"use strict";var n,i;t.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(i=r.g.process)?void 0:i.env)?r.g.process:r(44227)},96434:function(t){!function(){var e={675:function(t,e){"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return(r+n)*3/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],l=new i((s+a)*3/4-a),h=0,c=a>0?s-4:s;for(r=0;r>16&255,l[h++]=e>>8&255,l[h++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,l[h++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,l[h++]=e>>8&255,l[h++]=255&e),l},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,a=n-i;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}(t,s,s+16383>a?a:s+16383));return 1===i?o.push(r[(e=t[n-1])>>2]+r[e<<4&63]+"=="):2===i&&o.push(r[(e=(t[n-2]<<8)+t[n-1])>>10]+r[e>>4&63]+r[e<<2&63]+"="),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},72:function(t,e,r){"use strict";var n=r(675),i=r(783),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(t){if(t>2147483647)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!a.isEncoding(e))throw TypeError("Unknown encoding: "+e);var r=0|d(t,e),n=s(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(P(t,ArrayBuffer)||t&&P(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(P(t,SharedArrayBuffer)||t&&P(t.buffer,SharedArrayBuffer)))return function(t,e,r){var n;if(e<0||t.byteLength=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function d(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||P(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return A(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return T(t).length;default:if(i)return n?-1:A(t).length;e=(""+e).toLowerCase(),i=!0}}function p(t,e,r){var i,o,s=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(o=r=+r)!=o&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return -1;r=t.length-1}else if(r<0){if(!i)return -1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,i);if("number"==typeof e)return(e&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,i);throw TypeError("val must be string, number or Buffer")}function g(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;s=2,a/=2,u/=2,r/=2}function l(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var c=!0,f=0;f239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(h=l);break;case 2:(192&(o=t[i+1]))==128&&(u=(31&l)<<6|63&o)>127&&(h=u);break;case 3:o=t[i+1],s=t[i+2],(192&o)==128&&(192&s)==128&&(u=(15&l)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],(192&o)==128&&(192&s)==128&&(192&a)==128&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(h=u)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;nr)throw RangeError("Trying to access beyond buffer length")}function x(t,e,r,n,i,o){if(!a.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw RangeError("Index out of range")}function w(t,e,r,n,i,o){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function _(t,e,r,n,o){return e=+e,r>>>=0,o||w(t,e,r,4,34028234663852886e22,-34028234663852886e22),i.write(t,e,r,n,23,4),r+4}function k(t,e,r,n,o){return e=+e,r>>>=0,o||w(t,e,r,8,17976931348623157e292,-17976931348623157e292),i.write(t,e,r,n,52,8),r+8}e.Buffer=a,e.SlowBuffer=function(t){return+t!=t&&(t=0),a.alloc(+t)},e.INSPECT_MAX_BYTES=50,e.kMaxLength=2147483647,a.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return(l(t),t<=0)?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)},a.allocUnsafe=function(t){return h(t)},a.allocUnsafeSlow=function(t){return h(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(P(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),P(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);ir&&(t+=" ... "),""},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(t,e,r,n,i){if(P(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,u=Math.min(o,s),l=this.slice(n,i),h=t.slice(e,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,s,a,u,l,h,c,f,d,p,m,v=this.length-e;if((void 0===r||r>v)&&(r=v),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var g=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s>8,i.push(r%256),i.push(n);return i}(t,this.length-p),this,p,m);default:if(g)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),g=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||b(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||b(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return t>>>=0,e||b(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||b(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||b(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||b(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||b(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||b(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||b(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return(t>>>=0,e||b(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||b(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||b(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||b(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||b(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||b(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||b(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||b(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||b(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;x(this,t,e,r,i,0)}var o=1,s=0;for(this[e]=255&t;++s>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;x(this,t,e,r,i,0)}var o=r-1,s=1;for(this[e+o]=255&t;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return _(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return _(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return k(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return k(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){var i,o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&r<57344){if(!i){if(r>56319||s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function S(t){for(var e=[],r=0;r=e.length)&&!(i>=t.length);++i)e[i+r]=t[i];return i}function P(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var j=function(){for(var t="0123456789abcdef",e=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},783:function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,h=-7,c=r?i-1:0,f=r?-1:1,d=t[e+c];for(c+=f,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=f,h-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=l}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,l=8*o-i-1,h=(1<>1,f=23===i?5960464477539062e-23:0,d=n?0:o-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(isNaN(e=Math.abs(e))||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+c>=1?e+=f/u:e+=f*Math.pow(2,1-c),e*u>=2&&(s++,u/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,l-=8);t[r+d-p]|=128*m}}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var o=r[t]={exports:{}},s=!0;try{e[t](o,o.exports,n),s=!1}finally{s&&delete r[t]}return o.exports}n.ab="//";var i=n(72);t.exports=i}()},44227:function(t){!function(){var e={229:function(t){var e,r,n,i=t.exports={};function o(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u=[],l=!1,h=-1;function c(){l&&n&&(l=!1,n.length?u=n.concat(u):h=-1,u.length&&f())}function f(){if(!l){var t=a(c);l=!0;for(var e=u.length;e;){for(n=u,u=[];++h1)for(var r=1;r{let{width:t,height:e,top:n,left:i}=a.current;if(r||!s.current||!t||!e)return;s.current.dataset.motionPopId=o;let u=document.createElement("style");return h&&(u.nonce=h),document.head.appendChild(u),u.sheet&&u.sheet.insertRule('\n [data-motion-pop-id="'.concat(o,'"] {\n position: absolute !important;\n width: ').concat(t,"px !important;\n height: ").concat(e,"px !important;\n top: ").concat(n,"px !important;\n left: ").concat(i,"px !important;\n }\n ")),()=>{document.head.removeChild(u)}},[r]),(0,n.jsx)(l,{isPresent:r,childRef:s,sizeRef:a,children:i.cloneElement(e,{ref:s})})}let c=t=>{let{children:e,initial:r,isPresent:o,onExitComplete:u,custom:l,presenceAffectsLayout:c,mode:d}=t,p=(0,s.h)(f),m=(0,i.useId)(),v=(0,i.useCallback)(t=>{for(let e of(p.set(t,!0),p.values()))if(!e)return;u&&u()},[p,u]),g=(0,i.useMemo)(()=>({id:m,initial:r,isPresent:o,custom:l,onExitComplete:v,register:t=>(p.set(t,!1),()=>p.delete(t))}),c?[Math.random(),v]:[o,v]);return(0,i.useMemo)(()=>{p.forEach((t,e)=>p.set(e,!1))},[o]),i.useEffect(()=>{o||p.size||!u||u()},[o]),"popLayout"===d&&(e=(0,n.jsx)(h,{isPresent:o,children:e})),(0,n.jsx)(a.O.Provider,{value:g,children:e})};function f(){return new Map}var d=r(49637);let p=t=>t.key||"";function m(t){let e=[];return i.Children.forEach(t,t=>{(0,i.isValidElement)(t)&&e.push(t)}),e}var v=r(11534);let g=t=>{let{children:e,custom:r,initial:a=!0,onExitComplete:u,presenceAffectsLayout:l=!0,mode:h="sync",propagate:f=!1}=t,[g,y]=(0,d.oO)(f),b=(0,i.useMemo)(()=>m(e),[e]),x=f&&!g?[]:b.map(p),w=(0,i.useRef)(!0),_=(0,i.useRef)(b),k=(0,s.h)(()=>new Map),[E,A]=(0,i.useState)(b),[S,T]=(0,i.useState)(b);(0,v.L)(()=>{w.current=!1,_.current=b;for(let t=0;t{let e=p(t),i=(!f||!!g)&&(b===S||x.includes(e));return(0,n.jsx)(c,{isPresent:i,initial:(!w.current||!!a)&&void 0,custom:i?void 0:r,presenceAffectsLayout:l,mode:h,onExitComplete:i?void 0:()=>{if(!k.has(e))return;k.set(e,!0);let t=!0;k.forEach(e=>{e||(t=!1)}),t&&(null==P||P(),T(_.current),f&&(null==y||y()),u&&u())},children:t},e)})})}},49637:function(t,e,r){"use strict";r.d(e,{oO:function(){return o}});var n=r(2265),i=r(64252);function o(t=!0){let e=(0,n.useContext)(i.O);if(null===e)return[!0,null];let{isPresent:r,onExitComplete:o,register:s}=e,a=(0,n.useId)();(0,n.useEffect)(()=>{t&&s(a)},[t]);let u=(0,n.useCallback)(()=>t&&o&&o(a),[a,o,t]);return!r&&o?[!1,u]:[!0]}},58881:function(t,e,r){"use strict";r.d(e,{p:function(){return n}});let n=(0,r(2265).createContext)({})},45750:function(t,e,r){"use strict";r.d(e,{_:function(){return n}});let n=(0,r(2265).createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"})},64252:function(t,e,r){"use strict";r.d(e,{O:function(){return n}});let n=(0,r(2265).createContext)(null)},40521:function(t,e,r){"use strict";let n;function i(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}r.d(e,{E:function(){return ov}});let o=t=>Array.isArray(t);function s(t,e){if(!Array.isArray(e))return!1;let r=e.length;if(r!==t.length)return!1;for(let n=0;n{e[0][r]=t.get(),e[1][r]=t.getVelocity()}),e}function l(t,e,r,n){if("function"==typeof e){let[i,o]=u(n);e=e(void 0!==r?r:t.custom,i,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){let[i,o]=u(n);e=e(void 0!==r?r:t.custom,i,o)}return e}function h(t,e,r){let n=t.getProps();return l(n,e,void 0!==r?r:n.custom,t)}let c=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],f=["initial",...c];function d(t){let e;return()=>(void 0===e&&(e=t()),e)}let p=d(()=>void 0!==window.ScrollTimeline);class m{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let r=0;rp()&&r.attachTimeline?r.attachTimeline(t):"function"==typeof e?e(r):void 0);return()=>{r.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;ee[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class v extends m{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}function g(t,e){return t?t[e]||t.default||t:void 0}function y(t){let e=0,r=t.next(e);for(;!r.done&&e<2e4;)e+=50,r=t.next(e);return e>=2e4?1/0:e}function b(t){return"function"==typeof t}function x(t,e){t.timeline=e,t.onfinish=null}let w=t=>Array.isArray(t)&&"number"==typeof t[0],_={linearEasing:void 0},k=function(t,e){let r=d(t);return()=>{var t;return null!==(t=_[e])&&void 0!==t?t:r()}}(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),E=(t,e,r)=>{let n=e-t;return 0===n?1:(r-t)/n},A=(t,e,r=10)=>{let n="",i=Math.max(Math.round(e/r),2);for(let e=0;e`cubic-bezier(${t}, ${e}, ${r}, ${n})`,T={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:S([0,.65,.55,1]),circOut:S([.55,0,1,.45]),backIn:S([.31,.01,.66,-.59]),backOut:S([.33,1.53,.69,.99])},C={x:!1,y:!1};function P(t,e){let r=function(t,e,r){if(t instanceof Element)return[t];if("string"==typeof t){let e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t)}(t),n=new AbortController;return[r,{passive:!0,...e,signal:n.signal},()=>n.abort()]}function j(t){return e=>{"touch"===e.pointerType||C.x||C.y||t(e)}}let O=(t,e)=>!!e&&(t===e||O(t,e.parentElement)),I=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,R=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),M=new WeakSet;function B(t){return e=>{"Enter"===e.key&&t(e)}}function D(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}let z=(t,e)=>{let r=t.currentTarget;if(!r)return;let n=B(()=>{if(M.has(r))return;D(r,"down");let t=B(()=>{D(r,"up")});r.addEventListener("keyup",t,e),r.addEventListener("blur",()=>D(r,"cancel"),e)});r.addEventListener("keydown",n,e),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),e)};function L(t){return I(t)&&!(C.x||C.y)}let F=t=>1e3*t,N=t=>t/1e3,U=t=>t,V=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Z=new Set(V),W=new Set(["width","height","top","left","right","bottom",...V]),G=t=>!!(t&&"object"==typeof t&&t.mix&&t.toValue),$=t=>o(t)?t[t.length-1]||0:t,H={skipAnimations:!1,useManualTiming:!1},Y=["read","resolveKeyframes","update","preRender","render","postRender"];function q(t,e){let r=!1,n=!0,i={delta:0,timestamp:0,isProcessing:!1},o=()=>r=!0,s=Y.reduce((t,e)=>(t[e]=function(t){let e=new Set,r=new Set,n=!1,i=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(u.schedule(e),t()),e(s)}let u={schedule:(t,i=!1,s=!1)=>{let a=s&&n?e:r;return i&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{r.delete(t),o.delete(t)},process:t=>{if(s=t,n){i=!0;return}n=!0,[e,r]=[r,e],e.forEach(a),e.clear(),n=!1,i&&(i=!1,u.process(t))}};return u}(o),t),{}),{read:a,resolveKeyframes:u,update:l,preRender:h,render:c,postRender:f}=s,d=()=>{let o=H.useManualTiming?i.timestamp:performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(o-i.timestamp,40),1),i.timestamp=o,i.isProcessing=!0,a.process(i),u.process(i),l.process(i),h.process(i),c.process(i),f.process(i),i.isProcessing=!1,r&&e&&(n=!1,t(d))},p=()=>{r=!0,n=!0,i.isProcessing||t(d)};return{schedule:Y.reduce((t,e)=>{let n=s[e];return t[e]=(t,e=!1,i=!1)=>(r||p(),n.schedule(t,e,i)),t},{}),cancel:t=>{for(let e=0;e(void 0===n&&te.set(J.isProcessing||H.useManualTiming?J.timestamp:performance.now()),n),set:t=>{n=t,queueMicrotask(tt)}};function tr(t,e){-1===t.indexOf(e)&&t.push(e)}function tn(t,e){let r=t.indexOf(e);r>-1&&t.splice(r,1)}class ti{constructor(){this.subscriptions=[]}add(t){return tr(this.subscriptions,t),()=>tn(this.subscriptions,t)}notify(t,e,r){let n=this.subscriptions.length;if(n){if(1===n)this.subscriptions[0](t,e,r);else for(let i=0;i!isNaN(parseFloat(t)),ts={current:void 0};class ta{constructor(t,e={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{let r=te.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=te.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=to(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new ti);let r=this.events[t].add(e);return"change"===t?()=>{r(),X.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,r){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return ts.current&&ts.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var t;let e=te.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,30);return t=parseFloat(this.current)-parseFloat(this.prevFrameValue),r?1e3/r*t:0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function tu(t,e){return new ta(t,e)}let tl=t=>!!(t&&t.getVelocity);function th(t,e){let r=t.getValue("willChange");if(tl(r)&&r.add)return r.add(e)}let tc=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),tf="data-"+tc("framerAppearId"),td={current:!1},tp=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t;function tm(t,e,r,n){if(t===e&&r===n)return U;let i=e=>(function(t,e,r,n,i){let o,s;let a=0;do(o=tp(s=e+(r-e)/2,n,i)-t)>0?r=s:e=s;while(Math.abs(o)>1e-7&&++a<12);return s})(e,0,1,t,r);return t=>0===t||1===t?t:tp(i(t),e,n)}let tv=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,tg=t=>e=>1-t(1-e),ty=tm(.33,1.53,.69,.99),tb=tg(ty),tx=tv(tb),tw=t=>(t*=2)<1?.5*tb(t):.5*(2-Math.pow(2,-10*(t-1))),t_=t=>1-Math.sin(Math.acos(t)),tk=tg(t_),tE=tv(t_),tA=t=>/^0[^.\s]+$/u.test(t),tS=(t,e,r)=>r>e?e:r"number"==typeof t,parse:parseFloat,transform:t=>t},tC={...tT,transform:t=>tS(0,1,t)},tP={...tT,default:1},tj=t=>Math.round(1e5*t)/1e5,tO=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,tI=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tR=(t,e)=>r=>!!("string"==typeof r&&tI.test(r)&&r.startsWith(t)||e&&null!=r&&Object.prototype.hasOwnProperty.call(r,e)),tM=(t,e,r)=>n=>{if("string"!=typeof n)return n;let[i,o,s,a]=n.match(tO);return{[t]:parseFloat(i),[e]:parseFloat(o),[r]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},tB=t=>tS(0,255,t),tD={...tT,transform:t=>Math.round(tB(t))},tz={test:tR("rgb","red"),parse:tM("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+tD.transform(t)+", "+tD.transform(e)+", "+tD.transform(r)+", "+tj(tC.transform(n))+")"},tL={test:tR("#"),parse:function(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:tz.transform},tF=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),tN=tF("deg"),tU=tF("%"),tV=tF("px"),tZ=tF("vh"),tW=tF("vw"),tG={...tU,parse:t=>tU.parse(t)/100,transform:t=>tU.transform(100*t)},t$={test:tR("hsl","hue"),parse:tM("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+tU.transform(tj(e))+", "+tU.transform(tj(r))+", "+tj(tC.transform(n))+")"},tH={test:t=>tz.test(t)||tL.test(t)||t$.test(t),parse:t=>tz.test(t)?tz.parse(t):t$.test(t)?t$.parse(t):tL.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?tz.transform(t):t$.transform(t)},tY=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,tq="number",tX="color",tK=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function tJ(t){let e=t.toString(),r=[],n={color:[],number:[],var:[]},i=[],o=0,s=e.replace(tK,t=>(tH.test(t)?(n.color.push(o),i.push(tX),r.push(tH.parse(t))):t.startsWith("var(")?(n.var.push(o),i.push("var"),r.push(t)):(n.number.push(o),i.push(tq),r.push(parseFloat(t))),++o,"${}")).split("${}");return{values:r,split:s,indexes:n,types:i}}function tQ(t){return tJ(t).values}function t0(t){let{split:e,types:r}=tJ(t),n=e.length;return t=>{let i="";for(let o=0;o"number"==typeof t?0:t,t2={test:function(t){var e,r;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(tO))||void 0===e?void 0:e.length)||0)+((null===(r=t.match(tY))||void 0===r?void 0:r.length)||0)>0},parse:tQ,createTransformer:t0,getAnimatableNone:function(t){let e=tQ(t);return t0(t)(e.map(t1))}},t5=new Set(["brightness","contrast","saturate","opacity"]);function t3(t){let[e,r]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;let[n]=r.match(tO)||[];if(!n)return t;let i=r.replace(n,""),o=t5.has(e)?1:0;return n!==r&&(o*=100),e+"("+o+i+")"}let t6=/\b([a-z-]*)\(.*?\)/gu,t8={...t2,getAnimatableNone:t=>{let e=t.match(t6);return e?e.map(t3).join(" "):t}},t4={...tT,transform:Math.round},t7={borderWidth:tV,borderTopWidth:tV,borderRightWidth:tV,borderBottomWidth:tV,borderLeftWidth:tV,borderRadius:tV,radius:tV,borderTopLeftRadius:tV,borderTopRightRadius:tV,borderBottomRightRadius:tV,borderBottomLeftRadius:tV,width:tV,maxWidth:tV,height:tV,maxHeight:tV,top:tV,right:tV,bottom:tV,left:tV,padding:tV,paddingTop:tV,paddingRight:tV,paddingBottom:tV,paddingLeft:tV,margin:tV,marginTop:tV,marginRight:tV,marginBottom:tV,marginLeft:tV,backgroundPositionX:tV,backgroundPositionY:tV,rotate:tN,rotateX:tN,rotateY:tN,rotateZ:tN,scale:tP,scaleX:tP,scaleY:tP,scaleZ:tP,skew:tN,skewX:tN,skewY:tN,distance:tV,translateX:tV,translateY:tV,translateZ:tV,x:tV,y:tV,z:tV,perspective:tV,transformPerspective:tV,opacity:tC,originX:tG,originY:tG,originZ:tV,zIndex:t4,size:tV,fillOpacity:tC,strokeOpacity:tC,numOctaves:t4},t9={...t7,color:tH,backgroundColor:tH,outlineColor:tH,fill:tH,stroke:tH,borderColor:tH,borderTopColor:tH,borderRightColor:tH,borderBottomColor:tH,borderLeftColor:tH,filter:t8,WebkitFilter:t8},et=t=>t9[t];function ee(t,e){let r=et(t);return r!==t8&&(r=t2),r.getAnimatableNone?r.getAnimatableNone(e):void 0}let er=new Set(["auto","none","0"]),en=t=>t===tT||t===tV,ei=(t,e)=>parseFloat(t.split(", ")[e]),eo=(t,e)=>(r,{transform:n})=>{if("none"===n||!n)return 0;let i=n.match(/^matrix3d\((.+)\)$/u);if(i)return ei(i[1],e);{let e=n.match(/^matrix\((.+)\)$/u);return e?ei(e[1],t):0}},es=new Set(["x","y","z"]),ea=V.filter(t=>!es.has(t)),eu={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:eo(4,13),y:eo(5,14)};eu.translateX=eu.x,eu.translateY=eu.y;let el=new Set,eh=!1,ec=!1;function ef(){if(ec){let t=Array.from(el).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),r=new Map;e.forEach(t=>{let e=function(t){let e=[];return ea.forEach(r=>{let n=t.getValue(r);void 0!==n&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e}(t);e.length&&(r.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();let e=r.get(t);e&&e.forEach(([e,r])=>{var n;null===(n=t.getValue(e))||void 0===n||n.set(r)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}ec=!1,eh=!1,el.forEach(t=>t.complete()),el.clear()}function ed(){el.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ec=!0)})}class ep{constructor(t,e,r,n,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=r,this.motionValue=n,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(el.add(this),eh||(eh=!0,X.read(ed),X.resolveKeyframes(ef))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:e,element:r,motionValue:n}=this;for(let i=0;i/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ev=t=>e=>"string"==typeof e&&e.startsWith(t),eg=ev("--"),ey=ev("var(--"),eb=t=>!!ey(t)&&ex.test(t.split("/*")[0].trim()),ex=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ew=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,e_=t=>e=>e.test(t),ek=[tT,tV,tU,tN,tW,tZ,{test:t=>"auto"===t,parse:t=>t}],eE=t=>ek.find(e_(t));class eA extends ep{constructor(t,e,r,n,i){super(t,e,r,n,i,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:e,name:r}=this;if(!e||!e.current)return;super.readKeyframes();for(let r=0;r{e.getValue(t).set(r)}),this.resolveNoneKeyframes()}}let eS=(t,e)=>"zIndex"!==e&&!!("number"==typeof t||Array.isArray(t)||"string"==typeof t&&(t2.test(t)||"0"===t)&&!t.startsWith("url(")),eT=t=>null!==t;function eC(t,{repeat:e,repeatType:r="loop"},n){let i=t.filter(eT),o=e&&"loop"!==r&&e%2==1?0:i.length-1;return o&&void 0!==n?n:i[o]}class eP{constructor({autoplay:t=!0,delay:e=0,type:r="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:o="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=te.now(),this.options={autoplay:t,delay:e,type:r,repeat:n,repeatDelay:i,repeatType:o,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(ed(),ef()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=te.now(),this.hasAttemptedResolve=!0;let{name:r,type:n,velocity:i,delay:o,onComplete:s,onUpdate:a,isGenerator:u}=this.options;if(!u&&!function(t,e,r,n){let i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;let o=t[t.length-1],s=eS(i,e),a=eS(o,e);return U(s===a,`You are trying to animate ${e} from "${i}" to "${o}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${o} via the \`style\` property.`),!!s&&!!a&&(function(t){let e=t[0];if(1===t.length)return!0;for(let r=0;r{this.resolveFinishedPromise=t})}}let ej=(t,e,r)=>t+(e-t)*r;function eO(t,e,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?t+(e-t)*6*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function eI(t,e){return r=>r>0?e:t}let eR=(t,e,r)=>{let n=t*t,i=r*(e*e-n)+n;return i<0?0:Math.sqrt(i)},eM=[tL,tz,t$],eB=t=>eM.find(e=>e.test(t));function eD(t){let e=eB(t);if(U(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let r=e.parse(t);return e===t$&&(r=function({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,r/=100;let i=0,o=0,s=0;if(e/=100){let n=r<.5?r*(1+e):r+e-r*e,a=2*r-n;i=eO(a,n,t+1/3),o=eO(a,n,t),s=eO(a,n,t-1/3)}else i=o=s=r;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*s),alpha:n}}(r)),r}let ez=(t,e)=>{let r=eD(t),n=eD(e);if(!r||!n)return eI(t,e);let i={...r};return t=>(i.red=eR(r.red,n.red,t),i.green=eR(r.green,n.green,t),i.blue=eR(r.blue,n.blue,t),i.alpha=ej(r.alpha,n.alpha,t),tz.transform(i))},eL=(t,e)=>r=>e(t(r)),eF=(...t)=>t.reduce(eL),eN=new Set(["none","hidden"]);function eU(t,e){return r=>ej(t,e,r)}function eV(t){return"number"==typeof t?eU:"string"==typeof t?eb(t)?eI:tH.test(t)?ez:eG:Array.isArray(t)?eZ:"object"==typeof t?tH.test(t)?ez:eW:eI}function eZ(t,e){let r=[...t],n=r.length,i=t.map((t,r)=>eV(t)(t,e[r]));return t=>{for(let e=0;e{for(let e in n)r[e]=n[e](t);return r}}let eG=(t,e)=>{let r=t2.createTransformer(e),n=tJ(t),i=tJ(e);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?eN.has(t)&&!i.values.length||eN.has(e)&&!n.values.length?eN.has(t)?r=>r<=0?t:e:r=>r>=1?e:t:eF(eZ(function(t,e){var r;let n=[],i={color:0,var:0,number:0};for(let o=0;ovoid 0!==t[e])}function eQ(t=eY.visualDuration,e=eY.bounce){let r;let n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t,{restSpeed:i,restDelta:o}=n,s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],u={done:!1,value:s},{stiffness:l,damping:h,mass:c,duration:f,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:eY.velocity,stiffness:eY.stiffness,damping:eY.damping,mass:eY.mass,isResolvedFromDuration:!1,...t};if(!eJ(t,eK)&&eJ(t,eX)){if(t.visualDuration){let r=2*Math.PI/(1.2*t.visualDuration),n=r*r,i=2*tS(.05,1,1-(t.bounce||0))*Math.sqrt(n);e={...e,mass:eY.mass,stiffness:n,damping:i}}else{let r=function({duration:t=eY.duration,bounce:e=eY.bounce,velocity:r=eY.velocity,mass:n=eY.mass}){let i,o;U(t<=F(eY.maxDuration),"Spring duration must be 10 seconds or less");let s=1-e;s=tS(eY.minDamping,eY.maxDamping,s),t=tS(eY.minDuration,eY.maxDuration,N(t)),s<1?(i=e=>{let n=e*s,i=n*t;return .001-(n-r)/eq(e,s)*Math.exp(-i)},o=e=>{let n=e*s*t,o=Math.pow(s,2)*Math.pow(e,2)*t,a=eq(Math.pow(e,2),s);return(n*r+r-o)*Math.exp(-n)*(-i(e)+.001>0?-1:1)/a}):(i=e=>-.001+Math.exp(-e*t)*((e-r)*t+1),o=e=>t*t*(r-e)*Math.exp(-e*t));let a=function(t,e,r){let n=r;for(let r=1;r<12;r++)n-=t(n)/e(n);return n}(i,o,5/t);if(t=F(t),isNaN(a))return{stiffness:eY.stiffness,damping:eY.damping,duration:t};{let e=Math.pow(a,2)*n;return{stiffness:e,damping:2*s*Math.sqrt(n*e),duration:t}}}(t);(e={...e,...r,mass:eY.mass}).isResolvedFromDuration=!0}}return e}({...n,velocity:-N(n.velocity||0)}),m=d||0,v=h/(2*Math.sqrt(l*c)),g=a-s,b=N(Math.sqrt(l/c)),x=5>Math.abs(g);if(i||(i=x?eY.restSpeed.granular:eY.restSpeed.default),o||(o=x?eY.restDelta.granular:eY.restDelta.default),v<1){let t=eq(b,v);r=e=>a-Math.exp(-v*b*e)*((m+v*b*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}else if(1===v)r=t=>a-Math.exp(-b*t)*(g+(m+b*g)*t);else{let t=b*Math.sqrt(v*v-1);r=e=>{let r=Math.exp(-v*b*e),n=Math.min(t*e,300);return a-r*((m+v*b*g)*Math.sinh(n)+t*g*Math.cosh(n))/t}}let w={calculatedDuration:p&&f||null,next:t=>{let e=r(t);if(p)u.done=t>=f;else{let n=0;v<1&&(n=0===t?F(m):eH(r,t,e));let s=Math.abs(n)<=i,l=Math.abs(a-e)<=o;u.done=s&&l}return u.value=u.done?a:e,u},toString:()=>{let t=Math.min(y(w),2e4),e=A(e=>w.next(t*e).value,t,30);return t+"ms "+e}};return w}function e0({keyframes:t,velocity:e=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:u,restDelta:l=.5,restSpeed:h}){let c,f;let d=t[0],p={done:!1,value:d},m=t=>void 0!==a&&tu,v=t=>void 0===a?u:void 0===u?a:Math.abs(a-t)-g*Math.exp(-t/n),w=t=>b+x(t),_=t=>{let e=x(t),r=w(t);p.done=Math.abs(e)<=l,p.value=p.done?b:r},k=t=>{m(p.value)&&(c=t,f=eQ({keyframes:[p.value,v(p.value)],velocity:eH(w,t,p.value),damping:i,stiffness:o,restDelta:l,restSpeed:h}))};return k(0),{calculatedDuration:null,next:t=>{let e=!1;return(f||void 0!==c||(e=!0,_(t),k(t)),void 0!==c&&t>=c)?f.next(t-c):(e||_(t),p)}}}let e1=tm(.42,0,1,1),e2=tm(0,0,.58,1),e5=tm(.42,0,.58,1),e3=t=>Array.isArray(t)&&"number"!=typeof t[0],e6={linear:U,easeIn:e1,easeInOut:e5,easeOut:e2,circIn:t_,circInOut:tE,circOut:tk,backIn:tb,backInOut:tx,backOut:ty,anticipate:tw},e8=t=>{if(w(t)){U(4===t.length,"Cubic bezier arrays must contain four numerical values.");let[e,r,n,i]=t;return tm(e,r,n,i)}return"string"==typeof t?(U(void 0!==e6[t],`Invalid easing type '${t}'`),e6[t]):t};function e4({duration:t=300,keyframes:e,times:r,ease:n="easeInOut"}){let i=e3(n)?n.map(e8):e8(n),o={done:!1,value:e[0]},s=function(t,e,{clamp:r=!0,ease:n,mixer:i}={}){let o=t.length;if(U(o===e.length,"Both input and output ranges must be the same length"),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];let s=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());let a=function(t,e,r){let n=[],i=r||e$,o=t.length-1;for(let r=0;r{if(s&&r1)for(;nl(tS(t[0],t[o-1],e)):l}((r&&r.length===e.length?r:function(t){let e=[0];return function(t,e){let r=t[t.length-1];for(let n=1;n<=e;n++){let i=E(0,e,n);t.push(ej(r,1,i))}}(e,t.length-1),e}(e)).map(e=>e*t),e,{ease:Array.isArray(i)?i:e.map(()=>i||e5).splice(0,e.length-1)});return{calculatedDuration:t,next:e=>(o.value=s(e),o.done=e>=t,o)}}let e7=t=>{let e=({timestamp:e})=>t(e);return{start:()=>X.update(e,!0),stop:()=>K(e),now:()=>J.isProcessing?J.timestamp:te.now()}},e9={decay:e0,inertia:e0,tween:e4,keyframes:e4,spring:eQ},rt=t=>t/100;class re extends eP{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();let{onStop:t}=this.options;t&&t()};let{name:e,motionValue:r,element:n,keyframes:i}=this.options,o=(null==n?void 0:n.KeyframeResolver)||ep;this.resolver=new o(i,(t,e)=>this.onKeyframesResolved(t,e),e,r,n),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){let e,r;let{type:n="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:s,velocity:a=0}=this.options,u=b(n)?n:e9[n]||e4;u!==e4&&"number"!=typeof t[0]&&(e=eF(rt,e$(t[0],t[1])),t=[0,100]);let l=u({...this.options,keyframes:t});"mirror"===s&&(r=u({...this.options,keyframes:[...t].reverse(),velocity:-a})),null===l.calculatedDuration&&(l.calculatedDuration=y(l));let{calculatedDuration:h}=l,c=h+o;return{generator:l,mirroredGenerator:r,mapPercentToKeyframes:e,calculatedDuration:h,resolvedDuration:c,totalDuration:c*(i+1)-o}}onPostResolved(){let{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){let{resolved:r}=this;if(!r){let{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}let{finalKeyframe:n,generator:i,mirroredGenerator:o,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:u,totalDuration:l,resolvedDuration:h}=r;if(null===this.startTime)return i.next(0);let{delay:c,repeat:f,repeatType:d,repeatDelay:p,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-l/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;let v=this.currentTime-c*(this.speed>=0?1:-1),g=this.speed>=0?v<0:v>l;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=l);let y=this.currentTime,b=i;if(f){let t=Math.min(this.currentTime,l)/h,e=Math.floor(t),r=t%1;!r&&t>=1&&(r=1),1===r&&e--,(e=Math.min(e,f+1))%2&&("reverse"===d?(r=1-r,p&&(r-=p/h)):"mirror"===d&&(b=o)),y=tS(0,1,r)*h}let x=g?{done:!1,value:a[0]}:b.next(y);s&&(x.value=s(x.value));let{done:w}=x;g||null===u||(w=this.speed>=0?this.currentTime>=l:this.currentTime<=0);let _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return _&&void 0!==n&&(x.value=eC(a,this.options,n)),m&&m(x.value),_&&this.finish(),x}get duration(){let{resolved:t}=this;return t?N(t.calculatedDuration):0}get time(){return N(this.currentTime)}set time(t){t=F(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){let e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=N(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=e7,onPlay:e,startTime:r}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();let n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=n):this.startTime=null!=r?r:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";let{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}let rr=new Set(["opacity","clipPath","filter","transform"]),rn=d(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ri={anticipate:tw,backInOut:tx,circInOut:tE};class ro extends eP{constructor(t){super(t);let{name:e,motionValue:r,element:n,keyframes:i}=this.options;this.resolver=new eA(i,(t,e)=>this.onKeyframesResolved(t,e),e,r,n),this.resolver.scheduleResolve()}initPlayback(t,e){var r;let{duration:n=300,times:i,ease:o,type:s,motionValue:a,name:u,startTime:l}=this.options;if(!a.owner||!a.owner.current)return!1;if("string"==typeof o&&k()&&o in ri&&(o=ri[o]),b((r=this.options).type)||"spring"===r.type||!function t(e){return!!("function"==typeof e&&k()||!e||"string"==typeof e&&(e in T||k())||w(e)||Array.isArray(e)&&e.every(t))}(r.ease)){let{onComplete:e,onUpdate:r,motionValue:a,element:u,...l}=this.options,h=function(t,e){let r=new re({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0}),n={done:!1,value:t[0]},i=[],o=0;for(;!n.done&&o<2e4;)i.push((n=r.sample(o)).value),o+=10;return{times:void 0,keyframes:i,duration:o-10,ease:"linear"}}(t,l);1===(t=h.keyframes).length&&(t[1]=t[0]),n=h.duration,i=h.times,o=h.ease,s="keyframes"}let h=function(t,e,r,{delay:n=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:a="easeInOut",times:u}={}){let l={[e]:r};u&&(l.offset=u);let h=function t(e,r){if(e)return"function"==typeof e&&k()?A(e,r):w(e)?S(e):Array.isArray(e)?e.map(e=>t(e,r)||T.easeOut):T[e]}(a,i);return Array.isArray(h)&&(l.easing=h),t.animate(l,{delay:n,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===s?"alternate":"normal"})}(a.owner.current,u,t,{...this.options,duration:n,times:i,ease:o});return h.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(x(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{let{onComplete:r}=this.options;a.set(eC(t,this.options,e)),r&&r(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:n,times:i,type:s,ease:o,keyframes:t}}get duration(){let{resolved:t}=this;if(!t)return 0;let{duration:e}=t;return N(e)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:e}=t;return N(e.currentTime||0)}set time(t){let{resolved:e}=this;if(!e)return;let{animation:r}=e;r.currentTime=F(t)}get speed(){let{resolved:t}=this;if(!t)return 1;let{animation:e}=t;return e.playbackRate}set speed(t){let{resolved:e}=this;if(!e)return;let{animation:r}=e;r.playbackRate=t}get state(){let{resolved:t}=this;if(!t)return"idle";let{animation:e}=t;return e.playState}get startTime(){let{resolved:t}=this;if(!t)return null;let{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){let{resolved:e}=this;if(!e)return U;let{animation:r}=e;x(r,t)}else this.pendingTimeline=t;return U}play(){if(this.isStopped)return;let{resolved:t}=this;if(!t)return;let{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){let{resolved:t}=this;if(!t)return;let{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:t}=this;if(!t)return;let{animation:e,keyframes:r,duration:n,type:i,ease:o,times:s}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){let{motionValue:t,onUpdate:e,onComplete:a,element:u,...l}=this.options,h=new re({...l,keyframes:r,duration:n,type:i,ease:o,times:s,isGenerator:!0}),c=F(this.time);t.setWithVelocity(h.sample(c-10).value,h.sample(c).value,10)}let{onStop:a}=this.options;a&&a(),this.cancel()}complete(){let{resolved:t}=this;t&&t.animation.finish()}cancel(){let{resolved:t}=this;t&&t.animation.cancel()}static supports(t){let{motionValue:e,name:r,repeatDelay:n,repeatType:i,damping:o,type:s}=t;if(!e||!e.owner||!(e.owner.current instanceof HTMLElement))return!1;let{onUpdate:a,transformTemplate:u}=e.owner.getProps();return rn()&&r&&rr.has(r)&&!a&&!u&&!n&&"mirror"!==i&&0!==o&&"inertia"!==s}}let rs={type:"spring",stiffness:500,damping:25,restSpeed:10},ra=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),ru={type:"keyframes",duration:.8},rl={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},rh=(t,{keyframes:e})=>e.length>2?ru:Z.has(t)?t.startsWith("scale")?ra(e[1]):rs:rl,rc=(t,e,r,n={},i,o)=>s=>{let a=g(n,t)||{},u=a.delay||n.delay||0,{elapsed:l=0}=n;l-=F(u);let h={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};!function({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:u,elapsed:l,...h}){return!!Object.keys(h).length}(a)&&(h={...h,...rh(t,h)}),h.duration&&(h.duration=F(h.duration)),h.repeatDelay&&(h.repeatDelay=F(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let c=!1;if(!1!==h.type&&(0!==h.duration||h.repeatDelay)||(h.duration=0,0!==h.delay||(c=!0)),(td.current||H.skipAnimations)&&(c=!0,h.duration=0,h.delay=0),c&&!o&&void 0!==e.get()){let t=eC(h.keyframes,a);if(void 0!==t)return X.update(()=>{h.onUpdate(t),h.onComplete()}),new v([])}return!o&&ro.supports(h)?new ro(h):new re(h)};function rf(t,e,{delay:r=0,transitionOverride:n,type:i}={}){var o;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...u}=e;n&&(s=n);let l=[],c=i&&t.animationState&&t.animationState.getState()[i];for(let e in u){let n=t.getValue(e,null!==(o=t.latestValues[e])&&void 0!==o?o:null),i=u[e];if(void 0===i||c&&function({protectedKeys:t,needsAnimating:e},r){let n=t.hasOwnProperty(r)&&!0!==e[r];return e[r]=!1,n}(c,e))continue;let a={delay:r,...g(s||{},e)},h=!1;if(window.MotionHandoffAnimation){let r=t.props[tf];if(r){let t=window.MotionHandoffAnimation(r,e,X);null!==t&&(a.startTime=t,h=!0)}}th(t,e),n.start(rc(e,n,i,t.shouldReduceMotion&&W.has(e)?{type:!1}:a,t,h));let f=n.animation;f&&l.push(f)}return a&&Promise.all(l).then(()=>{X.update(()=>{a&&function(t,e){let{transitionEnd:r={},transition:n={},...i}=h(t,e)||{};for(let e in i={...i,...r}){let r=$(i[e]);t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,tu(r))}}(t,a)})}),l}function rd(t,e,r={}){var n;let i=h(t,e,"exit"===r.type?null===(n=t.presenceContext)||void 0===n?void 0:n.custom:void 0),{transition:o=t.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(o=r.transitionOverride);let s=i?()=>Promise.all(rf(t,i,r)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(n=0)=>{let{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=o;return function(t,e,r=0,n=0,i=1,o){let s=[],a=(t.variantChildren.size-1)*n,u=1===i?(t=0)=>t*n:(t=0)=>a-t*n;return Array.from(t.variantChildren).sort(rp).forEach((t,n)=>{t.notify("AnimationStart",e),s.push(rd(t,e,{...o,delay:r+u(n)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(s)}(t,e,i+n,s,a,r)}:()=>Promise.resolve(),{when:u}=o;if(!u)return Promise.all([s(),a(r.delay)]);{let[t,e]="beforeChildren"===u?[s,a]:[a,s];return t().then(()=>e())}}function rp(t,e){return t.sortNodePosition(e)}let rm=f.length,rv=[...c].reverse(),rg=c.length;function ry(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function rb(){return{animate:ry(!0),whileInView:ry(),whileHover:ry(),whileTap:ry(),whileDrag:ry(),whileFocus:ry(),exit:ry()}}class rx{constructor(t){this.isMounted=!1,this.node=t}update(){}}class rw extends rx{constructor(t){super(t),t.animationState||(t.animationState=function(t){let e=e=>Promise.all(e.map(({animation:e,options:r})=>(function(t,e,r={}){let n;if(t.notify("AnimationStart",e),Array.isArray(e))n=Promise.all(e.map(e=>rd(t,e,r)));else if("string"==typeof e)n=rd(t,e,r);else{let i="function"==typeof e?h(t,e,r.custom):e;n=Promise.all(rf(t,i,r))}return n.then(()=>{t.notify("AnimationComplete",e)})})(t,e,r))),r=rb(),n=!0,u=e=>(r,n)=>{var i;let o=h(t,n,"exit"===e?null===(i=t.presenceContext)||void 0===i?void 0:i.custom:void 0);if(o){let{transition:t,transitionEnd:e,...n}=o;r={...r,...n,...e}}return r};function l(l){let{props:h}=t,c=function t(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(r.initial=e.props.initial),r}let r={};for(let t=0;tv&&x,A=!1,S=Array.isArray(b)?b:[b],T=S.reduce(u(f),{});!1===w&&(T={});let{prevResolvedValues:C={}}=y,P={...C,...T},j=e=>{E=!0,p.has(e)&&(A=!0,p.delete(e)),y.needsAnimating[e]=!0;let r=t.getValue(e);r&&(r.liveStyle=!1)};for(let t in P){let e=T[t],r=C[t];if(!m.hasOwnProperty(t))(o(e)&&o(r)?s(e,r):e===r)?void 0!==e&&p.has(t)?j(t):y.protectedKeys[t]=!0:null!=e?j(t):p.add(t)}y.prevProp=b,y.prevResolvedValues=T,y.isActive&&(m={...m,...T}),n&&t.blockInitialAnimation&&(E=!1);let O=!(_&&k)||A;E&&O&&d.push(...S.map(t=>({animation:t,options:{type:f}})))}if(p.size){let e={};p.forEach(r=>{let n=t.getBaseTarget(r),i=t.getValue(r);i&&(i.liveStyle=!0),e[r]=null!=n?n:null}),d.push({animation:e})}let y=!!d.length;return n&&(!1===h.initial||h.initial===h.animate)&&!t.manuallyAnimateOnMount&&(y=!1),n=!1,y?e(d):Promise.resolve()}return{animateChanges:l,setActive:function(e,n){var i;if(r[e].isActive===n)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach(t=>{var r;return null===(r=t.animationState)||void 0===r?void 0:r.setActive(e,n)}),r[e].isActive=n;let o=l(e);for(let t in r)r[t].protectedKeys={};return o},setAnimateFunction:function(r){e=r(t)},getState:()=>r,reset:()=>{r=rb(),n=!0}}}(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();i(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}let r_=0;class rk extends rx{constructor(){super(...arguments),this.id=r_++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;let n=this.node.animationState.setActive("exit",!t);e&&!t&&n.then(()=>e(this.id))}mount(){let{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}function rE(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}function rA(t){return{point:{x:t.pageX,y:t.pageY}}}let rS=t=>e=>I(e)&&t(e,rA(e));function rT(t,e,r,n){return rE(t,e,rS(r),n)}let rC=(t,e)=>Math.abs(t-e);class rP{constructor(t,e,{transformPagePoint:r,contextWindow:n,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{var t,e;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let r=rI(this.lastMoveEventInfo,this.history),n=null!==this.startEvent,i=(t=r.offset,e={x:0,y:0},Math.sqrt(rC(t.x,e.x)**2+rC(t.y,e.y)**2)>=3);if(!n&&!i)return;let{point:o}=r,{timestamp:s}=J;this.history.push({...o,timestamp:s});let{onStart:a,onMove:u}=this.handlers;n||(a&&a(this.lastMoveEvent,r),this.startEvent=this.lastMoveEvent),u&&u(this.lastMoveEvent,r)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=rj(e,this.transformPagePoint),X.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();let{onEnd:r,onSessionEnd:n,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let o=rI("pointercancel"===t.type?this.lastMoveEventInfo:rj(e,this.transformPagePoint),this.history);this.startEvent&&r&&r(t,o),n&&n(t,o)},!I(t))return;this.dragSnapToOrigin=i,this.handlers=e,this.transformPagePoint=r,this.contextWindow=n||window;let o=rj(rA(t),this.transformPagePoint),{point:s}=o,{timestamp:a}=J;this.history=[{...s,timestamp:a}];let{onSessionStart:u}=e;u&&u(t,rI(o,this.history)),this.removeListeners=eF(rT(this.contextWindow,"pointermove",this.handlePointerMove),rT(this.contextWindow,"pointerup",this.handlePointerUp),rT(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),K(this.updatePoint)}}function rj(t,e){return e?{point:e(t.point)}:t}function rO(t,e){return{x:t.x-e.x,y:t.y-e.y}}function rI({point:t},e){return{point:t,delta:rO(t,rR(e)),offset:rO(t,e[0]),velocity:function(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null,i=rR(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>F(.1)));)r--;if(!n)return{x:0,y:0};let o=N(i.timestamp-n.timestamp);if(0===o)return{x:0,y:0};let s={x:(i.x-n.x)/o,y:(i.y-n.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}(e,0)}}function rR(t){return t[t.length-1]}function rM(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function rB(t){return t.max-t.min}function rD(t,e,r,n=.5){t.origin=n,t.originPoint=ej(e.min,e.max,t.origin),t.scale=rB(r)/rB(e),t.translate=ej(r.min,r.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function rz(t,e,r,n){rD(t.x,e.x,r.x,n?n.originX:void 0),rD(t.y,e.y,r.y,n?n.originY:void 0)}function rL(t,e,r){t.min=r.min+e.min,t.max=t.min+rB(e)}function rF(t,e,r){t.min=e.min-r.min,t.max=t.min+rB(e)}function rN(t,e,r){rF(t.x,e.x,r.x),rF(t.y,e.y,r.y)}function rU(t,e,r){return{min:void 0!==e?t.min+e:void 0,max:void 0!==r?t.max+r-(t.max-t.min):void 0}}function rV(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.min({translate:0,scale:1,origin:0,originPoint:0}),r$=()=>({x:rG(),y:rG()}),rH=()=>({min:0,max:0}),rY=()=>({x:rH(),y:rH()});function rq(t){return[t("x"),t("y")]}function rX({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function rK(t){return void 0===t||1===t}function rJ({scale:t,scaleX:e,scaleY:r}){return!rK(t)||!rK(e)||!rK(r)}function rQ(t){return rJ(t)||r0(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function r0(t){var e,r;return(e=t.x)&&"0%"!==e||(r=t.y)&&"0%"!==r}function r1(t,e,r,n,i){return void 0!==i&&(t=n+i*(t-n)),n+r*(t-n)+e}function r2(t,e=0,r=1,n,i){t.min=r1(t.min,e,r,n,i),t.max=r1(t.max,e,r,n,i)}function r5(t,{x:e,y:r}){r2(t.x,e.translate,e.scale,e.originPoint),r2(t.y,r.translate,r.scale,r.originPoint)}function r3(t,e){t.min=t.min+e,t.max=t.max+e}function r6(t,e,r,n,i=.5){let o=ej(t.min,t.max,i);r2(t,e,r,o,n)}function r8(t,e){r6(t.x,e.x,e.scaleX,e.scale,e.originX),r6(t.y,e.y,e.scaleY,e.scale,e.originY)}function r4(t,e){return rX(function(t,e){if(!e)return t;let r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}(t.getBoundingClientRect(),e))}let r7=({current:t})=>t?t.ownerDocument.defaultView:null,r9=new WeakMap;class nt{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=rY(),this.visualElement=t}start(t,{snapToCursor:e=!1}={}){let{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;let{dragSnapToOrigin:n}=this.getProps();this.panSession=new rP(t,{onSessionStart:t=>{let{dragSnapToOrigin:r}=this.getProps();r?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(rA(t).point)},onStart:(t,e)=>{let{drag:r,dragPropagation:n,onDragStart:i}=this.getProps();if(r&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===r||"y"===r?C[r]?null:(C[r]=!0,()=>{C[r]=!1}):C.x||C.y?null:(C.x=C.y=!0,()=>{C.x=C.y=!1}),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rq(t=>{let e=this.getAxisMotionValue(t).get()||0;if(tU.test(e)){let{projection:r}=this.visualElement;if(r&&r.layout){let n=r.layout.layoutBox[t];if(n){let t=rB(n);e=parseFloat(e)/100*t}}}this.originPoint[t]=e}),i&&X.postRender(()=>i(t,e)),th(this.visualElement,"transform");let{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{let{dragPropagation:r,dragDirectionLock:n,onDirectionLock:i,onDrag:o}=this.getProps();if(!r&&!this.openDragLock)return;let{offset:s}=e;if(n&&null===this.currentDirection){this.currentDirection=function(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}(s),null!==this.currentDirection&&i&&i(this.currentDirection);return}this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>rq(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:n,contextWindow:r7(this.visualElement)})}stop(t,e){let r=this.isDragging;if(this.cancel(),!r)return;let{velocity:n}=e;this.startAnimation(n);let{onDragEnd:i}=this.getProps();i&&X.postRender(()=>i(t,e))}cancel(){this.isDragging=!1;let{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,r){let{drag:n}=this.getProps();if(!r||!ne(t,n,this.currentDirection))return;let i=this.getAxisMotionValue(t),o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:r},n){return void 0!==e&&tr&&(t=n?ej(r,t,n.max):Math.min(t,r)),t}(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;let{dragConstraints:e,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,i=this.constraints;e&&rM(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=function(t,{top:e,left:r,bottom:n,right:i}){return{x:rU(t.x,r,i),y:rU(t.y,e,n)}}(n.layoutBox,e):this.constraints=!1,this.elastic=function(t=.35){return!1===t?t=0:!0===t&&(t=.35),{x:rZ(t,"left","right"),y:rZ(t,"top","bottom")}}(r),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&rq(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){let r={};return void 0!==e.min&&(r.min=e.min-t.min),void 0!==e.max&&(r.max=e.max-t.min),r}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){var t;let{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!rM(e))return!1;let n=e.current;U(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:i}=this.visualElement;if(!i||!i.layout)return!1;let o=function(t,e,r){let n=r4(t,r),{scroll:i}=e;return i&&(r3(n.x,i.offset.x),r3(n.y,i.offset.y)),n}(n,i.root,this.visualElement.getTransformPagePoint()),s={x:rV((t=i.layout.layoutBox).x,o.x),y:rV(t.y,o.y)};if(r){let t=r(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(s));this.hasMutatedConstraints=!!t,t&&(s=rX(t))}return s}startAnimation(t){let{drag:e,dragMomentum:r,dragElastic:n,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{};return Promise.all(rq(s=>{if(!ne(s,e,this.currentDirection))return;let u=a&&a[s]||{};o&&(u={min:0,max:0});let l={type:"inertia",velocity:r?t[s]:0,bounceStiffness:n?200:1e6,bounceDamping:n?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...i,...u};return this.startAxisValueAnimation(s,l)})).then(s)}startAxisValueAnimation(t,e){let r=this.getAxisMotionValue(t);return th(this.visualElement,t),r.start(rc(t,r,0,e,this.visualElement,!1))}stopAnimation(){rq(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){rq(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){let e=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps();return r[e]||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){rq(e=>{let{drag:r}=this.getProps();if(!ne(e,r,this.currentDirection))return;let{projection:n}=this.visualElement,i=this.getAxisMotionValue(e);if(n&&n.layout){let{min:r,max:o}=n.layout.layoutBox[e];i.set(t[e]-ej(r,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:e}=this.getProps(),{projection:r}=this.visualElement;if(!rM(e)||!r||!this.constraints)return;this.stopAnimation();let n={x:0,y:0};rq(t=>{let e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){let r=e.get();n[t]=function(t,e){let r=.5,n=rB(t),i=rB(e);return i>n?r=E(e.min,e.max-n,t.min):n>i&&(r=E(t.min,t.max-i,e.min)),tS(0,1,r)}({min:r,max:r},this.constraints[t])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),rq(e=>{if(!ne(e,t,null))return;let r=this.getAxisMotionValue(e),{min:i,max:o}=this.constraints[e];r.set(ej(i,o,n[e]))})}addListeners(){if(!this.visualElement.current)return;r9.set(this.visualElement,this);let t=rT(this.visualElement.current,"pointerdown",t=>{let{drag:e,dragListener:r=!0}=this.getProps();e&&r&&this.start(t)}),e=()=>{let{dragConstraints:t}=this.getProps();rM(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,n=r.addEventListener("measure",e);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),X.read(e);let i=rE(window,"resize",()=>this.scalePositionWithinConstraints()),o=r.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(rq(e=>{let r=this.getAxisMotionValue(e);r&&(this.originPoint[e]+=t[e].translate,r.set(r.get()+t[e].translate))}),this.visualElement.render())});return()=>{i(),t(),n(),o&&o()}}getProps(){let t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:r=!1,dragPropagation:n=!1,dragConstraints:i=!1,dragElastic:o=.35,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:r,dragPropagation:n,dragConstraints:i,dragElastic:o,dragMomentum:s}}}function ne(t,e,r){return(!0===e||e===t)&&(null===r||r===t)}class nr extends rx{constructor(t){super(t),this.removeGroupControls=U,this.removeListeners=U,this.controls=new nt(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||U}unmount(){this.removeGroupControls(),this.removeListeners()}}let nn=t=>(e,r)=>{t&&X.postRender(()=>t(e,r))};class ni extends rx{constructor(){super(...arguments),this.removePointerDownListener=U}onPointerDown(t){this.session=new rP(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:r7(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:e,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:nn(t),onStart:nn(e),onMove:r,onEnd:(t,e)=>{delete this.session,n&&X.postRender(()=>n(t,e))}}}mount(){this.removePointerDownListener=rT(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}var no,ns,na,nu=r(57437),nl=r(2265),nh=r(49637),nc=r(58881);let nf=(0,nl.createContext)({}),nd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function np(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}let nm={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!tV.test(t))return t;t=parseFloat(t)}let r=np(t,e.target.x),n=np(t,e.target.y);return`${r}% ${n}%`}},nv={},{schedule:ng,cancel:ny}=q(queueMicrotask,!1);class nb extends nl.Component{componentDidMount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:r,layoutId:n}=this.props,{projection:i}=t;Object.assign(nv,nw),i&&(e.group&&e.group.add(i),r&&r.register&&n&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),nd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:e,visualElement:r,drag:n,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,n||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent===i||(i?o.promote():o.relegate()||X.postRender(()=>{let t=o.getStack();t&&t.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ng.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:r}=this.props,{projection:n}=t;n&&(n.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(n),r&&r.deregister&&r.deregister(n))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}}function nx(t){let[e,r]=(0,nh.oO)(),n=(0,nl.useContext)(nc.p);return(0,nu.jsx)(nb,{...t,layoutGroup:n,switchLayoutGroup:(0,nl.useContext)(nf),isPresent:e,safeToRemove:r})}let nw={borderRadius:{...nm,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:nm,borderTopRightRadius:nm,borderBottomLeftRadius:nm,borderBottomRightRadius:nm,boxShadow:{correct:(t,{treeScale:e,projectionDelta:r})=>{let n=t2.parse(t);if(n.length>5)return t;let i=t2.createTransformer(t),o="number"!=typeof n[0]?1:0,s=r.x.scale*e.x,a=r.y.scale*e.y;n[0+o]/=s,n[1+o]/=a;let u=ej(s,a,.5);return"number"==typeof n[2+o]&&(n[2+o]/=u),"number"==typeof n[3+o]&&(n[3+o]/=u),i(n)}}},n_=(t,e)=>t.depth-e.depth;class nk{constructor(){this.children=[],this.isDirty=!1}add(t){tr(this.children,t),this.isDirty=!0}remove(t){tn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(n_),this.isDirty=!1,this.children.forEach(t)}}function nE(t){let e=tl(t)?t.get():t;return G(e)?e.toValue():e}let nA=["TopLeft","TopRight","BottomLeft","BottomRight"],nS=nA.length,nT=t=>"string"==typeof t?parseFloat(t):t,nC=t=>"number"==typeof t||tV.test(t);function nP(t,e){return void 0!==t[e]?t[e]:t.borderRadius}let nj=nI(0,.5,tk),nO=nI(.5,.95,U);function nI(t,e,r){return n=>ne?1:r(E(t,e,n))}function nR(t,e){t.min=e.min,t.max=e.max}function nM(t,e){nR(t.x,e.x),nR(t.y,e.y)}function nB(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function nD(t,e,r,n,i){return t-=e,t=n+1/r*(t-n),void 0!==i&&(t=n+1/i*(t-n)),t}function nz(t,e,[r,n,i],o,s){!function(t,e=0,r=1,n=.5,i,o=t,s=t){if(tU.test(e)&&(e=parseFloat(e),e=ej(s.min,s.max,e/100)-s.min),"number"!=typeof e)return;let a=ej(o.min,o.max,n);t===o&&(a-=e),t.min=nD(t.min,e,r,a,i),t.max=nD(t.max,e,r,a,i)}(t,e[r],e[n],e[i],e.scale,o,s)}let nL=["x","scaleX","originX"],nF=["y","scaleY","originY"];function nN(t,e,r,n){nz(t.x,e,nL,r?r.x:void 0,n?n.x:void 0),nz(t.y,e,nF,r?r.y:void 0,n?n.y:void 0)}function nU(t){return 0===t.translate&&1===t.scale}function nV(t){return nU(t.x)&&nU(t.y)}function nZ(t,e){return t.min===e.min&&t.max===e.max}function nW(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function nG(t,e){return nW(t.x,e.x)&&nW(t.y,e.y)}function n$(t){return rB(t.x)/rB(t.y)}function nH(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class nY{constructor(){this.members=[]}add(t){tr(this.members,t),t.scheduleRender()}remove(t){if(tn(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){let e;let r=this.members.findIndex(e=>t===e);if(0===r)return!1;for(let t=r;t>=0;t--){let r=this.members[t];if(!1!==r.isPresent){e=r;break}}return!!e&&(this.promote(e),!0)}promote(t,e){let r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,e&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:n}=t.options;!1===n&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:e,resumingFrom:r}=t;e.onExitComplete&&e.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let nq={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},nX="undefined"!=typeof window&&void 0!==window.MotionDebug,nK=["","X","Y","Z"],nJ={visibility:"hidden"},nQ=0;function n0(t,e,r,n){let{latestValues:i}=e;i[t]&&(r[t]=i[t],e.setStaticValue(t,0),n&&(n[t]=0))}function n1({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(t={},r=null==e?void 0:e()){this.id=nQ++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,nX&&(nq.totalNodes=nq.resolvedTargetDeltas=nq.recalculatedProjection=0),this.nodes.forEach(n3),this.nodes.forEach(ie),this.nodes.forEach(ir),this.nodes.forEach(n6),nX&&window.MotionDebug.record(nq)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,r&&r(),r=function(t,e){let r=te.now(),n=({timestamp:e})=>{let i=e-r;i>=250&&(K(n),t(i-250))};return X.read(n,!0),()=>K(n)}(n,0),nd.hasAnimatedSinceResize&&(nd.hasAnimatedSinceResize=!1,this.nodes.forEach(it))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&o&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:r,layout:n})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let i=this.options.transition||o.getDefaultTransition()||il,{onLayoutAnimationStart:s,onLayoutAnimationComplete:a}=o.getProps(),u=!this.targetLayout||!nG(this.targetLayout,n)||r,l=!e&&r;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||l||e&&(u||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,l);let e={...g(i,"layout"),onPlay:s,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||it(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,K(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ii),this.animationId++)}getTransformTemplate(){let{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function t(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:r}=e.options;if(!r)return;let n=r.props[tf];if(window.MotionHasOptimisedAnimation(n,"transform")){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",X,!(t||r))}let{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&t(i)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t.999999999999&&(e.x=1),e.y<1.0000000000001&&e.y>.999999999999&&(e.y=1)}}(this.layoutCorrected,this.treeScale,this.path,r),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=rY());let{target:u}=e;if(!u){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(nB(this.prevProjectionDelta.x,this.projectionDelta.x),nB(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),rz(this.projectionDelta,this.layoutCorrected,u,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&nH(this.projectionDelta.x,this.prevProjectionDelta.x)&&nH(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",u)),nX&&nq.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null===(e=this.options.visualElement)||void 0===e||e.scheduleRender(),t){let t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=r$(),this.projectionDelta=r$(),this.projectionDeltaWithTransform=r$()}setAnimationOrigin(t,e=!1){let r;let n=this.snapshot,i=n?n.latestValues:{},o={...this.latestValues},s=r$();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;let a=rY(),u=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),h=!l||l.members.length<=1,c=!!(u&&!h&&!0===this.options.crossfade&&!this.path.some(iu));this.animationProgress=0,this.mixTargetDelta=e=>{let n=e/1e3;if(is(s.x,t.x,n),is(s.y,t.y,n),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var l,f,d,p;rN(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),d=this.relativeTarget,p=this.relativeTargetOrigin,ia(d.x,p.x,a.x,n),ia(d.y,p.y,a.y,n),r&&(l=this.relativeTarget,f=r,nZ(l.x,f.x)&&nZ(l.y,f.y))&&(this.isProjectionDirty=!1),r||(r=rY()),nM(r,this.relativeTarget)}u&&(this.animationValues=o,function(t,e,r,n,i,o){i?(t.opacity=ej(0,void 0!==r.opacity?r.opacity:1,nj(n)),t.opacityExit=ej(void 0!==e.opacity?e.opacity:1,0,nO(n))):o&&(t.opacity=ej(void 0!==e.opacity?e.opacity:1,void 0!==r.opacity?r.opacity:1,n));for(let i=0;i{nd.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,r){let n=tl(0)?0:tu(0);return n.start(rc("",n,1e3,r)),n.animation}(0,0,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let t=this.getLead(),{targetWithTransforms:e,target:r,layout:n,latestValues:i}=t;if(e&&r&&n){if(this!==t&&this.layout&&n&&ip(this.options.animationType,this.layout.layoutBox,n.layoutBox)){r=this.target||rY();let e=rB(this.layout.layoutBox.x);r.x.min=t.target.x.min,r.x.max=r.x.min+e;let n=rB(this.layout.layoutBox.y);r.y.min=t.target.y.min,r.y.max=r.y.min+n}nM(e,r),r8(e,i),rz(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new nY),this.sharedNodes.get(t).add(e);let r=e.options.initialPromotionConfig;e.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.shouldPreserveFollowOpacity(e):void 0})}isLead(){let t=this.getStack();return!t||t.lead===this}getLead(){var t;let{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;let{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){let{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:r}={}){let n=this.getStack();n&&n.promote(this,r),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){let t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){let{visualElement:t}=this.options;if(!t)return;let e=!1,{latestValues:r}=t;if((r.z||r.rotate||r.rotateX||r.rotateY||r.rotateZ||r.skewX||r.skewY)&&(e=!0),!e)return;let n={};r.z&&n0("z",t,n,this.animationValues);for(let e=0;e{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(n4),this.root.sharedNodes.clear()}}}function n2(t){t.updateLayout()}function n5(t){var e;let r=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&r&&t.hasListeners("didUpdate")){let{layoutBox:e,measuredBox:n}=t.layout,{animationType:i}=t.options,o=r.source!==t.layout.source;"size"===i?rq(t=>{let n=o?r.measuredBox[t]:r.layoutBox[t],i=rB(n);n.min=e[t].min,n.max=n.min+i}):ip(i,r.layoutBox,e)&&rq(n=>{let i=o?r.measuredBox[n]:r.layoutBox[n],s=rB(e[n]);i.max=i.min+s,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[n].max=t.relativeTarget[n].min+s)});let s=r$();rz(s,e,r.layoutBox);let a=r$();o?rz(a,t.applyTransform(n,!0),r.measuredBox):rz(a,e,r.layoutBox);let u=!nV(s),l=!1;if(!t.resumeFrom){let n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){let{snapshot:i,layout:o}=n;if(i&&o){let s=rY();rN(s,r.layoutBox,i.layoutBox);let a=rY();rN(a,e,o.layoutBox),nG(s,a)||(l=!0),n.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=s,t.relativeParent=n)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:r,delta:a,layoutDelta:s,hasLayoutChanged:u,hasRelativeTargetChanged:l})}else if(t.isLead()){let{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function n3(t){nX&&nq.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function n6(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function n8(t){t.clearSnapshot()}function n4(t){t.clearMeasurements()}function n7(t){t.isLayoutDirty=!1}function n9(t){let{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function it(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ie(t){t.resolveTargetDelta()}function ir(t){t.calcProjection()}function ii(t){t.resetSkewAndRotation()}function io(t){t.removeLeadSnapshot()}function is(t,e,r){t.translate=ej(e.translate,0,r),t.scale=ej(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function ia(t,e,r,n){t.min=ej(e.min,r.min,n),t.max=ej(e.max,r.max,n)}function iu(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}let il={duration:.45,ease:[.4,0,.1,1]},ih=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ic=ih("applewebkit/")&&!ih("chrome/")?Math.round:U;function id(t){t.min=ic(t.min),t.max=ic(t.max)}function ip(t,e,r){return"position"===t||"preserve-aspect"===t&&!(.2>=Math.abs(n$(e)-n$(r)))}function im(t){var e;return t!==t.root&&(null===(e=t.scroll)||void 0===e?void 0:e.wasRoot)}let iv=n1({attachResizeListener:(t,e)=>rE(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ig={current:void 0},iy=n1({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ig.current){let t=new iv({});t.mount(window),t.setOptions({layoutScroll:!0}),ig.current=t}return ig.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>"fixed"===window.getComputedStyle(t).position});function ib(t,e,r){let{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover","Start"===r);let i=n["onHover"+r];i&&X.postRender(()=>i(e,rA(e)))}class ix extends rx{mount(){let{current:t}=this.node;t&&(this.unmount=function(t,e,r={}){let[n,i,o]=P(t,r),s=j(t=>{let{target:r}=t,n=e(t);if("function"!=typeof n||!r)return;let o=j(t=>{n(t),r.removeEventListener("pointerleave",o)});r.addEventListener("pointerleave",o,i)});return n.forEach(t=>{t.addEventListener("pointerenter",s,i)}),o}(t,t=>(ib(this.node,t,"Start"),t=>ib(this.node,t,"End"))))}unmount(){}}class iw extends rx{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=eF(rE(this.node.current,"focus",()=>this.onFocus()),rE(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function i_(t,e,r){let{props:n}=t;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap","Start"===r);let i=n["onTap"+("End"===r?"":r)];i&&X.postRender(()=>i(e,rA(e)))}class ik extends rx{mount(){let{current:t}=this.node;t&&(this.unmount=function(t,e,r={}){let[n,i,o]=P(t,r),s=t=>{let n=t.currentTarget;if(!L(t)||M.has(n))return;M.add(n);let o=e(t),s=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",u),L(t)&&M.has(n)&&(M.delete(n),"function"==typeof o&&o(t,{success:e}))},a=t=>{s(t,r.useGlobalTarget||O(n,t.target))},u=t=>{s(t,!1)};window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",u,i)};return n.forEach(t=>{R.has(t.tagName)||-1!==t.tabIndex||null!==t.getAttribute("tabindex")||(t.tabIndex=0),(r.useGlobalTarget?window:t).addEventListener("pointerdown",s,i),t.addEventListener("focus",t=>z(t,i),i)}),o}(t,t=>(i_(this.node,t,"Start"),(t,{success:e})=>i_(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}let iE=new WeakMap,iA=new WeakMap,iS=t=>{let e=iE.get(t.target);e&&e(t)},iT=t=>{t.forEach(iS)},iC={some:0,all:1};class iP extends rx{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:e,margin:r,amount:n="some",once:i}=t,o={root:e?e.current:void 0,rootMargin:r,threshold:"number"==typeof n?n:iC[n]};return function(t,e,r){let n=function({root:t,...e}){let r=t||document;iA.has(r)||iA.set(r,{});let n=iA.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(iT,{root:t,...e})),n[i]}(e);return iE.set(t,r),n.observe(t),()=>{iE.delete(t),n.unobserve(t)}}(this.node.current,o,t=>{let{isIntersecting:e}=t;if(this.isInView===e||(this.isInView=e,i&&!e&&this.hasEnteredView))return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);let{onViewportEnter:r,onViewportLeave:n}=this.node.getProps(),o=e?r:n;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;let{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return r=>t[r]!==e[r]}(t,e))&&this.startObserver()}unmount(){}}let ij=(0,nl.createContext)({strict:!1});var iO=r(45750);let iI=(0,nl.createContext)({});function iR(t){return i(t.animate)||f.some(e=>a(t[e]))}function iM(t){return!!(iR(t)||t.variants)}function iB(t){return Array.isArray(t)?t.join(" "):t}var iD=r(44563);let iz={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},iL={};for(let t in iz)iL[t]={isEnabled:e=>iz[t].some(t=>!!e[t])};let iF=Symbol.for("motionComponentSymbol");var iN=r(64252),iU=r(11534);let iV=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function iZ(t){if("string"!=typeof t||t.includes("-"));else if(iV.indexOf(t)>-1||/[A-Z]/u.test(t))return!0;return!1}var iW=r(53576);let iG=t=>(e,r)=>{let n=(0,nl.useContext)(iI),o=(0,nl.useContext)(iN.O),s=()=>(function({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:r},n,o,s){let a={latestValues:function(t,e,r,n){let o={},s=n(t,{});for(let t in s)o[t]=nE(s[t]);let{initial:a,animate:u}=t,h=iR(t),c=iM(t);e&&c&&!h&&!1!==t.inherit&&(void 0===a&&(a=e.initial),void 0===u&&(u=e.animate));let f=!!r&&!1===r.initial,d=(f=f||!1===a)?u:a;if(d&&"boolean"!=typeof d&&!i(d)){let e=Array.isArray(d)?d:[d];for(let r=0;rr({props:n,current:t,...a}),a.onUpdate=t=>r(t)),a})(t,e,n,o);return r?s():(0,iW.h)(s)},i$=(t,e)=>e&&"number"==typeof t?e.transform(t):t,iH={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},iY=V.length;function iq(t,e,r){let{style:n,vars:i,transformOrigin:o}=t,s=!1,a=!1;for(let t in e){let r=e[t];if(Z.has(t)){s=!0;continue}if(eg(t)){i[t]=r;continue}{let e=i$(r,t7[t]);t.startsWith("origin")?(a=!0,o[t]=e):n[t]=e}}if(!e.transform&&(s||r?n.transform=function(t,e,r){let n="",i=!0;for(let o=0;o({style:{},transform:{},transformOrigin:{},vars:{}}),i1=()=>({...i0(),attrs:{}}),i2=t=>"string"==typeof t&&"svg"===t.toLowerCase();function i5(t,{style:e,vars:r},n,i){for(let o in Object.assign(t.style,e,i&&i.getProjectionStyles(n)),r)t.style.setProperty(o,r[o])}let i3=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function i6(t,e,r,n){for(let r in i5(t,e,void 0,n),e.attrs)t.setAttribute(i3.has(r)?r:tc(r),e.attrs[r])}function i8(t,{layout:e,layoutId:r}){return Z.has(t)||t.startsWith("origin")||(e||void 0!==r)&&(!!nv[t]||"opacity"===t)}function i4(t,e,r){var n;let{style:i}=t,o={};for(let s in i)(tl(i[s])||e.style&&tl(e.style[s])||i8(s,t)||(null===(n=null==r?void 0:r.getValue(s))||void 0===n?void 0:n.liveStyle)!==void 0)&&(o[s]=i[s]);return o}function i7(t,e,r){let n=i4(t,e,r);for(let r in t)(tl(t[r])||tl(e[r]))&&(n[-1!==V.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]);return n}let i9=["x","y","width","height","cx","cy","r"],ot={useVisualState:iG({scrapeMotionValuesFromProps:i7,createRenderState:i1,onUpdate:({props:t,prevProps:e,current:r,renderState:n,latestValues:i})=>{if(!r)return;let o=!!t.drag;if(!o){for(let t in i)if(Z.has(t)){o=!0;break}}if(!o)return;let s=!e;if(e)for(let r=0;r{!function(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}(r,n),X.render(()=>{iQ(n,i,i2(r.tagName),t.transformTemplate),i6(r,n)})})}})},oe={useVisualState:iG({scrapeMotionValuesFromProps:i4,createRenderState:i0})};function or(t,e,r){for(let n in e)tl(e[n])||i8(n,r)||(t[n]=e[n])}let on=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function oi(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||on.has(t)}let oo=t=>!oi(t);try{(no=require("@emotion/is-prop-valid").default)&&(oo=t=>t.startsWith("on")?!oi(t):no(t))}catch(t){}let os={current:null},oa={current:!1},ou=[...ek,tH,t2],ol=t=>ou.find(e_(t)),oh=new WeakMap,oc=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class of{scrapeMotionValuesFromProps(t,e,r){return{}}constructor({parent:t,props:e,presenceContext:r,reducedMotionConfig:n,blockInitialAnimation:i,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ep,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let t=te.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),oa.current||function(){if(oa.current=!0,iD.j){if(window.matchMedia){let t=window.matchMedia("(prefers-reduced-motion)"),e=()=>os.current=t.matches;t.addListener(e),e()}else os.current=!1}}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||os.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){for(let t in oh.delete(this.current),this.projection&&this.projection.unmount(),K(this.notifyUpdate),K(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this),this.events)this.events[t].clear();for(let t in this.features){let e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){let r;this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let n=Z.has(t),i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&X.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),o=e.on("renderRequest",this.scheduleRender);window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),o(),r&&r(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in iL){let e=iL[t];if(!e)continue;let{isEnabled:r,Feature:n}=e;if(!this.features[t]&&n&&r(this.props)&&(this.features[t]=new n(this)),this.features[t]){let e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):rY()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){let r=this.values.get(t);e!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);let e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return void 0===r&&void 0!==e&&(r=tu(null===e?void 0:e,{owner:this}),this.addValue(t,r)),r}readValue(t,e){var r;let n=void 0===this.latestValues[t]&&this.current?null!==(r=this.getBaseTargetFromProps(this.props,t))&&void 0!==r?r:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(em(n)||tA(n))?n=parseFloat(n):!ol(n)&&t2.test(e)&&(n=ee(t,e)),this.setBaseTarget(t,tl(n)?n.get():n)),tl(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;let r;let{initial:n}=this.props;if("string"==typeof n||"object"==typeof n){let i=l(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);i&&(r=i[t])}if(n&&void 0!==r)return r;let i=this.getBaseTargetFromProps(this.props,t);return void 0===i||tl(i)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new ti),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class od extends of{constructor(){super(...arguments),this.KeyframeResolver=eA}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:r}){delete e[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;tl(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class op extends od{constructor(){super(...arguments),this.type="html",this.renderInstance=i5}readValueFromInstance(t,e){if(Z.has(e)){let t=et(e);return t&&t.default||0}{let r=window.getComputedStyle(t),n=(eg(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(t,{transformPagePoint:e}){return r4(t,e)}build(t,e,r){iq(t,e,r.transformTemplate)}scrapeMotionValuesFromProps(t,e,r){return i4(t,e,r)}}class om extends od{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=rY}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Z.has(e)){let t=et(e);return t&&t.default||0}return e=i3.has(e)?e:tc(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,r){return i7(t,e,r)}build(t,e,r){iQ(t,e,this.isSVGTag,r.transformTemplate)}renderInstance(t,e,r,n){i6(t,e,r,n)}mount(t){this.isSVGTag=i2(t.tagName),super.mount(t)}}let ov=function(t){if("undefined"==typeof Proxy)return t;let e=new Map;return new Proxy((...e)=>t(...e),{get:(r,n)=>"create"===n?t:(e.has(n)||e.set(n,t(n)),e.get(n))})}((ns={animation:{Feature:rw},exit:{Feature:rk},inView:{Feature:iP},tap:{Feature:ik},focus:{Feature:iw},hover:{Feature:ix},pan:{Feature:ni},drag:{Feature:nr,ProjectionNode:iy,MeasureLayout:nx},layout:{ProjectionNode:iy,MeasureLayout:nx}},na=(t,e)=>iZ(t)?new om(e):new op(e,{allowProjection:t!==nl.Fragment}),function(t,{forwardMotionProps:e}={forwardMotionProps:!1}){return function(t){var e,r;let{preloadedFeatures:n,createVisualElement:i,useRender:o,useVisualState:s,Component:u}=t;function l(t,e){var r;let n;let l={...(0,nl.useContext)(iO._),...t,layoutId:function(t){let{layoutId:e}=t,r=(0,nl.useContext)(nc.p).id;return r&&void 0!==e?r+"-"+e:e}(t)},{isStatic:h}=l,c=function(t){let{initial:e,animate:r}=function(t,e){if(iR(t)){let{initial:e,animate:r}=t;return{initial:!1===e||a(e)?e:void 0,animate:a(r)?r:void 0}}return!1!==t.inherit?e:{}}(t,(0,nl.useContext)(iI));return(0,nl.useMemo)(()=>({initial:e,animate:r}),[iB(e),iB(r)])}(t),f=s(t,h);if(!h&&iD.j){(0,nl.useContext)(ij).strict;let t=function(t){let{drag:e,layout:r}=iL;if(!e&&!r)return{};let n={...e,...r};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==r?void 0:r.isEnabled(t))?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}(l);n=t.MeasureLayout,c.visualElement=function(t,e,r,n,i){var o,s;let{visualElement:a}=(0,nl.useContext)(iI),u=(0,nl.useContext)(ij),l=(0,nl.useContext)(iN.O),h=(0,nl.useContext)(iO._).reducedMotion,c=(0,nl.useRef)(null);n=n||u.renderer,!c.current&&n&&(c.current=n(t,{visualState:e,parent:a,props:r,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:h}));let f=c.current,d=(0,nl.useContext)(nf);f&&!f.projection&&i&&("html"===f.type||"svg"===f.type)&&function(t,e,r,n){let{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:u,layoutRoot:l}=e;t.projection=new r(t.latestValues,e["data-framer-portal-id"]?void 0:function t(e){if(e)return!1!==e.options.allowProjection?e.projection:t(e.parent)}(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&rM(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:n,layoutScroll:u,layoutRoot:l})}(c.current,r,i,d);let p=(0,nl.useRef)(!1);(0,nl.useInsertionEffect)(()=>{f&&p.current&&f.update(r,l)});let m=r[tf],v=(0,nl.useRef)(!!m&&!(null===(o=window.MotionHandoffIsComplete)||void 0===o?void 0:o.call(window,m))&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,m)));return(0,iU.L)(()=>{f&&(p.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),ng.render(f.render),v.current&&f.animationState&&f.animationState.animateChanges())}),(0,nl.useEffect)(()=>{f&&(!v.current&&f.animationState&&f.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var t;null===(t=window.MotionHandoffMarkAsComplete)||void 0===t||t.call(window,m)}),v.current=!1))}),f}(u,f,l,i,t.ProjectionNode)}return(0,nu.jsxs)(iI.Provider,{value:c,children:[n&&c.visualElement?(0,nu.jsx)(n,{visualElement:c.visualElement,...l}):null,o(u,t,(r=c.visualElement,(0,nl.useCallback)(t=>{t&&f.onMount&&f.onMount(t),r&&(t?r.mount(t):r.unmount()),e&&("function"==typeof e?e(t):rM(e)&&(e.current=t))},[r])),f,h,c.visualElement)]})}n&&function(t){for(let e in t)iL[e]={...iL[e],...t[e]}}(n),l.displayName="motion.".concat("string"==typeof u?u:"create(".concat(null!==(r=null!==(e=u.displayName)&&void 0!==e?e:u.name)&&void 0!==r?r:"",")"));let h=(0,nl.forwardRef)(l);return h[iF]=u,h}({...iZ(t)?ot:oe,preloadedFeatures:ns,useRender:function(t=!1){return(e,r,n,{latestValues:i},o)=>{let s=(iZ(e)?function(t,e,r,n){let i=(0,nl.useMemo)(()=>{let r=i1();return iQ(r,e,i2(n),t.transformTemplate),{...r.attrs,style:{...r.style}}},[e]);if(t.style){let e={};or(e,t.style,t),i.style={...e,...i.style}}return i}:function(t,e){let r={},n=function(t,e){let r=t.style||{},n={};return or(n,r,t),Object.assign(n,function({transformTemplate:t},e){return(0,nl.useMemo)(()=>{let r=i0();return iq(r,e,t),Object.assign({},r.vars,r.style)},[e])}(t,e)),n}(t,e);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=!0===t.drag?"none":`pan-${"x"===t.drag?"y":"x"}`),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=n,r})(r,i,o,e),a=function(t,e,r){let n={};for(let i in t)("values"!==i||"object"!=typeof t.values)&&(oo(i)||!0===r&&oi(i)||!e&&!oi(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}(r,"string"==typeof e,t),u=e!==nl.Fragment?{...a,...s,ref:n}:{},{children:l}=r,h=(0,nl.useMemo)(()=>tl(l)?l.get():l,[l]);return(0,nl.createElement)(e,{...u,children:h})}}(e),createVisualElement:na,Component:t})}))},44563:function(t,e,r){"use strict";r.d(e,{j:function(){return n}});let n="undefined"!=typeof window},53576:function(t,e,r){"use strict";r.d(e,{h:function(){return i}});var n=r(2265);function i(t){let e=(0,n.useRef)(null);return null===e.current&&(e.current=t()),e.current}},11534:function(t,e,r){"use strict";r.d(e,{L:function(){return i}});var n=r(2265);let i=r(44563).j?n.useLayoutEffect:n.useEffect},96471:function(t,e,r){"use strict";r.d(e,{Z:function(){return u}});var n=r(2265);let i=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),o=function(){for(var t=arguments.length,e=Array(t),r=0;r!!t&&""!==t.trim()&&r.indexOf(t)===e).join(" ").trim()};var s={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"};let a=(0,n.forwardRef)((t,e)=>{let{color:r="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:u,className:l="",children:h,iconNode:c,...f}=t;return(0,n.createElement)("svg",{ref:e,...s,width:i,height:i,stroke:r,strokeWidth:u?24*Number(a)/Number(i):a,className:o("lucide",l),...f},[...c.map(t=>{let[e,r]=t;return(0,n.createElement)(e,r)}),...Array.isArray(h)?h:[h]])}),u=(t,e)=>{let r=(0,n.forwardRef)((r,s)=>{let{className:u,...l}=r;return(0,n.createElement)(a,{ref:s,iconNode:e,className:o("lucide-".concat(i(t)),u),...l})});return r.displayName="".concat(t),r}},90702:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]])},50701:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]])},5485:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},91230:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},93920:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]])},59559:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},3289:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},76848:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},47969:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},25361:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("CircleAlert",[["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"}]])},78084:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},87294:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},80659:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},83194:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]])},97150:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},45736:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},19596:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Github",[["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"}]])},38704:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},9521:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]])},34368:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]])},53459:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},42190:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]])},70572:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},29292:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]])},31520:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]])},62360:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},35296:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]])},23818:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},66904:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},10595:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Sun",[["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"}]])},93835:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]])},44986:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},60895:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("ZoomIn",[["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"}]])},49902:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(96471).Z)("ZoomOut",[["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"}]])}}]); \ No newline at end of file diff --git a/ormgraph_odoo/static/src/_next/static/chunks/90542734-2a04d1ea1918765a.js b/ormgraph_odoo/static/src/_next/static/chunks/90542734-2a04d1ea1918765a.js new file mode 100644 index 00000000000..a4d45956adb --- /dev/null +++ b/ormgraph_odoo/static/src/_next/static/chunks/90542734-2a04d1ea1918765a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[264],{59516:function(e,t,n){function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function s(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}(e,t)||h(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){if(e){if("string"==typeof e)return r(e,t);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}n.d(t,{Z:function(){return cm}});var f,p,g,v,y,b,x,w="undefined"==typeof window?null:window,E=w?w.navigator:null;w&&w.document;var T=d(""),C=d({}),k=d(function(){}),P="undefined"==typeof HTMLElement?"undefined":d(HTMLElement),S=function(e){return e&&e.instanceString&&D(e.instanceString)?e.instanceString():null},B=function(e){return null!=e&&d(e)==T},D=function(e){return null!=e&&d(e)===k},_=function(e){return!N(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},A=function(e){return null!=e&&d(e)===C&&!_(e)&&e.constructor===Object},M=function(e){return null!=e&&d(e)===d(1)&&!isNaN(e)},R=function(e){return M(e)&&Math.floor(e)===e},I=function(e){if("undefined"!==P)return null!=e&&e instanceof HTMLElement},N=function(e){return L(e)||O(e)},L=function(e){return"collection"===S(e)&&e._private.single},O=function(e){return"collection"===S(e)&&!e._private.single},z=function(e){return"core"===S(e)},V=function(e){return"stylesheet"===S(e)},F=function(e){return null==e||!!(""===e||e.match(/^\s+$/))},X=function(e){return null!=e&&d(e)===C&&D(e.then)},j=function(e,t){t||(t=function(){if(1==arguments.length)return arguments[0];if(0==arguments.length)return"undefined";for(var e=[],t=0;tt?1:0},ee=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var n,r,i,a,o,s,l,u,c=RegExp("^"+$+"$").exec(e);if(c){if((r=parseInt(c[1]))<0?r=(360- -1*r%360)%360:r>360&&(r%=360),r/=360,(i=parseFloat(c[2]))<0||i>100||(i/=100,(a=parseFloat(c[3]))<0||a>100)||(a/=100,void 0!==(o=c[4])&&((o=parseFloat(o))<0||o>1)))return;if(0===i)s=l=u=Math.round(255*a);else{var d=a<.5?a*(1+i):a+i-a*i,h=2*a-d;s=Math.round(255*t(h,d,r+1/3)),l=Math.round(255*t(h,d,r)),u=Math.round(255*t(h,d,r-1/3))}n=[s,l,u,o]}return n},er=function(e){var t,n=RegExp("^"+K+"$").exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var a=n[i];if("%"===a[a.length-1]&&(r[i]=!0),a=parseFloat(a),r[i]&&(a=a/100*255),a<0||a>255)return;t.push(Math.floor(a))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t},ei=function(e){return(_(e)?e:null)||ea[e.toLowerCase()]||et(e)||er(e)||en(e)},ea={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},eo=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i=o||t<0||v&&n>=c}function w(){var e,n,r,a=t();if(x(a))return E(a);h=setTimeout(w,(e=a-f,n=a-p,r=o-e,v?i(r,c-n):r))}function E(e){return(h=void 0,y&&l)?b(e):(l=u=void 0,d)}function T(){var e,n=t(),r=x(n);if(l=arguments,u=this,f=n,r){if(void 0===h)return p=e=f,h=setTimeout(w,o),g?b(e):d;if(v)return clearTimeout(h),h=setTimeout(w,o),b(f)}return void 0===h&&(h=setTimeout(w,o)),d}return o=n(o)||0,e(s)&&(g=!!s.leading,c=(v="maxWait"in s)?r(n(s.maxWait)||0,o):c,y="trailing"in s?!!s.trailing:y),T.cancel=function(){void 0!==h&&clearTimeout(h),p=0,l=f=u=h=void 0},T.flush=function(){return void 0===h?d:E(t())},T}}()),ev=w?w.performance:null,ey=ev&&ev.now?function(){return ev.now()}:function(){return Date.now()},em=function(){if(w){if(w.requestAnimationFrame)return function(e){w.requestAnimationFrame(e)};if(w.mozRequestAnimationFrame)return function(e){w.mozRequestAnimationFrame(e)};if(w.webkitRequestAnimationFrame)return function(e){w.webkitRequestAnimationFrame(e)};if(w.msRequestAnimationFrame)return function(e){w.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(ey())},1e3/60)}}(),eb=function(e){return em(e)},ex=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9261,r=n;!(t=e.next()).done;)r=65599*r+t.value|0;return r},ew=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9261;return 65599*t+e|0},eE=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5381;return(t<<5)+t+e|0},eT=function(e){return 2097152*e[0]+e[1]},eC=function(e,t){return[ew(e[0],t[0]),eE(e[1],t[1])]},ek=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return ex({next:function(){return r=0;r--)e[r]===t&&e.splice(r,1)},eU=function(e){e.splice(0,e.length)},eG=function(e,t){for(var n=0;n2)||void 0===arguments[2]||arguments[2];if(void 0===e||void 0===t||!z(e)){eO("An element must have a core reference and parameters set");return}var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"!==r&&"edges"!==r){eO("An element must be of type `nodes` or `edges`; you specified `"+r+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new eJ,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var a=t.renderedPosition,o=e.pan(),s=e.zoom();i.position={x:(a.x-o.x)/s,y:(a.y-o.y)/s}}var l=[];_(t.classes)?l=t.classes:B(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;ut?1:0},u=function(e,t,i,a,o){var s;if(null==i&&(i=0),null==o&&(o=n),i<0)throw Error("lo must be non-negative");for(null==a&&(a=e.length);io(t,e[s=r((i+a)/2)])?a=s:i=s+1;return[].splice.apply(e,[i,i-i].concat(t)),t},o=function(e,t,r){return null==r&&(r=n),e.push(t),p(e,0,e.length-1,r)},a=function(e,t){var r,i;return null==t&&(t=n),r=e.pop(),e.length?(i=e[0],e[0]=r,g(e,0,t)):i=r,i},l=function(e,t,r){var i;return null==r&&(r=n),i=e[0],e[0]=t,g(e,0,r),i},s=function(e,t,r){var i;return null==r&&(r=n),e.length&&0>r(e[0],t)&&(t=(i=[e[0],t])[0],e[0]=i[1],g(e,0,r)),t},i=function(e,t){var i,a,o,s,l,u;for(null==t&&(t=n),s=(function(){u=[];for(var t=0,n=r(e.length/2);0<=n?tn;0<=n?t++:t--)u.push(t);return u}).apply(this).reverse(),l=[],a=0,o=s.length;ar(o=p[d],s)&&(u(l,o,0,null,r),l.pop(),s=l[l.length-1]);return l}for(i(e,r),v=[],h=0,g=c(t,e.length);0<=g?hg;0<=g?++h:--h)v.push(a(e,r));return v},p=function(e,t,r,i){var a,o,s;for(null==i&&(i=n),a=e[r];r>t;){if(0>i(a,o=e[s=r-1>>1])){e[r]=o,r=s;continue}break}return e[r]=a},g=function(e,t,r){var i,a,o,s,l;for(null==r&&(r=n),a=e.length,l=t,o=e[t],i=2*t+1;ir(e[i],e[s]))&&(i=s),e[t]=e[i],i=2*(t=i)+1;return e[t]=o,p(e,l,t,r)},t=function(){function e(e){this.cmp=null!=e?e:n,this.nodes=[]}return e.push=o,e.pop=a,e.replace=l,e.pushpop=s,e.heapify=i,e.updateItem=f,e.nlargest=d,e.nsmallest=h,e.prototype.push=function(e){return o(this.nodes,e,this.cmp)},e.prototype.pop=function(){return a(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return -1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return l(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return s(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return i(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return f(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return(t=new e).nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),v=function(){return t},e.exports=v()}).call(e3)}(e5)),oI=e5.exports)),e9=eq({root:null,weight:function(e){return 1},directed:!1}),e6=eq({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),e8=eq({weight:function(e){return 1},directed:!1}),e7=eq({weight:function(e){return 1},directed:!1,root:null}),te=Math.sqrt(2),tt=function(e,t,n){0===n.length&&eO("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],a=r[2],o=t[i],s=t[a],l=n.length-1;l>=0;l--){var u=n[l],c=u[1],d=u[2];(t[c]===o&&t[d]===s||t[c]===s&&t[d]===o)&&n.splice(l,1)}for(var h=0;hr;)t=tt(Math.floor(Math.random()*t.length),e,t),n--;return t},tr=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},ti=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},ta=function(e){return{x:e[0],y:e[1]}},to=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,a=t;a1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>3)||void 0===arguments[3]||arguments[3],i=!(arguments.length>4)||void 0===arguments[4]||arguments[4],a=!(arguments.length>5)||void 0===arguments[5]||arguments[5];r?e=e.slice(t,n):(n0&&e.splice(0,t));for(var o=0,s=e.length-1;s>=0;s--){var l=e[s];a?!isFinite(l)&&(e[s]=-1/0,o++):e.splice(s,1)}i&&e.sort(function(e,t){return e-t});var u=e.length,c=Math.floor(u/2);return u%2!=0?e[c+1+o]:(e[c-1+o]+e[c+o])/2},tc=function(e,t){return 0===t?e:tc(t,e%t)},td=function(e){for(var t=e[0],n=0;n0&&(t=tc(t,e[n]))}return t},th=function(e,t){return Math.atan2(t,e)-Math.PI/2},tf=Math.log2||function(e){return Math.log(e)/Math.log(2)},tp=function(e){return e>0?1:e<0?-1:0},tg=function(e,t){return Math.sqrt(tv(e,t))},tv=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},ty=function(e){for(var t=e.length,n=0,r=0;r=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},tT=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},tC=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},tk=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},tP=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},tS=function(e){var t,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===a.length)t=n=r=i=a[0];else if(2===a.length)t=r=a[0],i=n=a[1];else if(4===a.length){var o=l(a,4);t=o[0],n=o[1],r=o[2],i=o[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},tB=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},tD=function(e,t){return!(e.x1>t.x2)&&!(t.x1>e.x2)&&!(e.x2t.y2)&&!(t.y1>e.y2)},t_=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},tA=function(e,t){return t_(e,t.x,t.y)},tM=function(e,t){return t_(e,t.x1,t.y1)&&t_(e,t.x2,t.y2)},tR=null!==(oL=Math.hypot)&&void 0!==oL?oL:function(e,t){return Math.sqrt(e*e+t*t)},tI=function(e,t,n,r,i,a,o){var s,l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",c="auto"===u?t3(i,a):u,d=i/2,h=a/2,f=(c=Math.min(c,d,h))!==d,p=c!==h;if(f){var g=n-d+c-o,v=r-h-o,y=n+d-c+o;if((s=tZ(e,t,n,r,g,v,y,v,!1)).length>0)return s}if(p){var b=n+d+o,x=r-h+c-o,w=r+h-c+o;if((s=tZ(e,t,n,r,b,x,b,w,!1)).length>0)return s}if(f){var E=n-d+c-o,T=r+h+o,C=n+d-c+o;if((s=tZ(e,t,n,r,E,T,C,T,!1)).length>0)return s}if(p){var k=n-d-o,P=r-h+c-o,S=r+h-c+o;if((s=tZ(e,t,n,r,k,P,k,S,!1)).length>0)return s}var B=n-d+c,D=r-h+c;if((l=tH(e,t,n,r,B,D,c+o)).length>0&&l[0]<=B&&l[1]<=D)return[l[0],l[1]];var _=n+d-c,A=r-h+c;if((l=tH(e,t,n,r,_,A,c+o)).length>0&&l[0]>=_&&l[1]<=A)return[l[0],l[1]];var M=n+d-c,R=r+h-c;if((l=tH(e,t,n,r,M,R,c+o)).length>0&&l[0]>=M&&l[1]>=R)return[l[0],l[1]];var I=n-d+c,N=r+h-c;return(l=tH(e,t,n,r,I,N,c+o)).length>0&&l[0]<=I&&l[1]>=N?[l[0],l[1]]:[]},tN=function(e,t,n,r,i,a,o){var s=Math.min(n,i),l=Math.max(n,i),u=Math.min(r,a),c=Math.max(r,a);return s-o<=e&&e<=l+o&&u-o<=t&&t<=c+o},tL=function(e,t,n,r,i,a,o,s,l){var u={x1:Math.min(n,o,i)-l,x2:Math.max(n,o,i)+l,y1:Math.min(r,s,a)-l,y2:Math.max(r,s,a)+l};return!(eu.x2)&&!(tu.y2)},tO=function(e,t,n,r){var i=t*t-4*e*(n-=r);if(i<0)return[];var a=Math.sqrt(i),o=2*e;return[(-t+a)/o,(-t-a)/o]},tz=function(e,t,n,r,i){var a,o,s,l,u,c,d,h;if(0===e&&(e=1e-5),t/=e,n/=e,r/=e,a=(o=(3*n-t*t)/9)*o*o+(s=(-(27*r)+t*(9*n-t*t*2))/54)*s,i[1]=0,d=t/3,a>0){u=(u=s+Math.sqrt(a))<0?-Math.pow(-u,1/3):Math.pow(u,1/3),c=(c=s-Math.sqrt(a))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-d+u+c,d+=(u+c)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-c+u)/2,i[3]=d,i[5]=-d;return}if(i[5]=i[3]=0,0===a){h=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=-d+2*h,i[4]=i[2]=-(h+d);return}l=Math.acos(s/Math.sqrt(l=(o=-o)*o*o)),h=2*Math.sqrt(o),i[0]=-d+h*Math.cos(l/3),i[2]=-d+h*Math.cos((l+2*Math.PI)/3),i[4]=-d+h*Math.cos((l+4*Math.PI)/3)},tV=function(e,t,n,r,i,a,o,s){var l,u=[];tz(1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,1*n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,u);for(var c=[],d=0;d<6;d+=2)1e-7>Math.abs(u[d+1])&&u[d]>=0&&u[d]<=1&&c.push(u[d]);c.push(1),c.push(0);for(var h=-1,f=0;f=0?ll?(e-i)*(e-i)+(t-a)*(t-a):u-d},tX=function(e,t,n){for(var r,i,a,o,s=0,l=0;l=e)||!(e>=a))&&(!(r<=e)||!(e<=a)))continue;(e-r)/(a-r)*(o-i)+i>t&&s++}return s%2!=0},tj=function(e,t,n,r,i,a,o,s,l){var u,c=Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var d=Math.cos(-u),h=Math.sin(-u),f=0;f0?tq(tW(c,-l)):c)},tY=function(e,t,n,r,i,a,o,s){for(var l=Array(2*n.length),u=0;u=0&&p<=1&&v.push(p),g>=0&&g<=1&&v.push(g),0===v.length)return[];var y=v[0]*s[0]+e,b=v[0]*s[1]+t;return v.length>1?v[0]==v[1]?[y,b]:[y,b,v[1]*s[0]+e,v[1]*s[1]+t]:[y,b]},tK=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},tZ=function(e,t,n,r,i,a,o,s,l){var u=e-i,c=n-e,d=o-i,h=t-a,f=r-t,p=s-a,g=d*h-p*u,v=c*h-f*u,y=p*c-d*f;if(0!==y){var b=g/y,x=v/y;return -.001<=b&&b<=1.001&&-.001<=x&&x<=1.001?[e+b*c,t+b*f]:l?[e+b*c,t+b*f]:[]}return 0!==g&&0!==v?[]:tK(e,n,o)===o?[o,s]:tK(e,n,i)===i?[i,a]:tK(i,o,n)===n?[n,r]:[]},t$=function(e,t,n,r,i){var a=[],o=r/2,s=i/2;a.push({x:t+o*e[0],y:n+s*e[1]});for(var l=1;l0?tq(tW(g,-s)):g}else u=n;for(var b=0;b2){for(var f=[c[0],c[1]],p=Math.pow(f[0]-e,2)+Math.pow(f[1]-t,2),g=1;gu&&(u=t)},get:function(e){return l[e]}},d=0;d0?b.edgesTo(y)[0]:y.edgesTo(b)[0]);u[y=y.id()]>u[g]+x&&(u[y]=u[g]+x,0>d.nodes.indexOf(y)?d.push(y):d.updateItem(y),l[y]=0,n[y]=[]),u[y]==u[g]+x&&(l[y]=l[y]+l[g],n[y].push(g))}else for(var w=0;w0;){for(var k=t.pop(),P=0;P0&&o.push(n[s]);0!==o.length&&i.push(r.collection(o))}return i},ng=function(e,t){for(var n=0;n5&&void 0!==arguments[5]?arguments[5]:nm,o=r,s=0;s=2?nC(e,t,n,0,nw,nE):nC(e,t,n,0,nx)},squaredEuclidean:function(e,t,n){return nC(e,t,n,0,nw)},manhattan:function(e,t,n){return nC(e,t,n,0,nx)},max:function(e,t,n){return nC(e,t,n,-1/0,nT)}};function nP(e,t,n,r,i,a){var o;return(o=D(e)?e:nk[e]||nk.euclidean,0===t&&D(e))?o(i,a):o(t,n,r,i,a)}nk["squared-euclidean"]=nk.squaredEuclidean,nk.squaredeuclidean=nk.squaredEuclidean;var nS=eq({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),nB=function(e){return nS(e)},nD=function(e,t,n,r,i){var a="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)};return nP(e,r.length,a,function(e){return r[e](t)},n,t)},n_=function(e,t,n){for(var r=n.length,i=Array(r),a=Array(r),o=Array(t),s=null,l=0;ln)return!1;return!0},nI=function(e,t,n){for(var r=0;ri&&(i=t[l][u],a=u);o[a].push(e[l])}for(var c=0;c=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p=t[s],g=t[r[s]];o="dendrogram"===i.mode?{left:p,right:g,key:p.key}:{value:p.value.concat(g.value),key:p.key},e[p.index]=o,e.splice(g.index,1),t[p.key]=o;for(var v=0;vn[g.key][y.key]&&(a=n[g.key][y.key])):"max"===i.linkage?(a=n[p.key][y.key],n[p.key][y.key]0&&r.push(i);return r},nJ=function(e,t,n){for(var r=[],i=0;io&&(a=l,o=t[i*e+l])}a>0&&r.push(a)}for(var u=0;ul&&(s=u,l=c)}n[i]=a[s]}return nJ(e,t,n)},n1=function(e){for(var t,n,r,i,a,o,s,l,u,c=this.cy(),d=this.nodes(),h=nZ(e),f={},p=0;p=D?(_=D,D=M,A=R):M>_&&(_=M);for(var I=0;I0?1:0;P[u%h.minIterations*r+F]=X,V+=X}if(V>0&&(u>=h.minIterations-1||u==h.maxIterations-1)){for(var j=0,Y=0;Y1)}});var u=Object.keys(t).filter(function(e){return t[e].cutVertex}).map(function(t){return e.getElementById(t)});return{cut:e.spawn(u),components:i}},n3=function(){var e=this,t={},n=0,r=[],i=[],a=e.spawn(e),o=function(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach(function(e){var n=e.target().id();n===s||(n in t||o(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))}),t[s].index===t[s].low){for(var l=e.spawn();;){var u=i.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),d=l.merge(c);r.push(d),a=a.difference(d)}};return e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||o(n)}}),{cut:a,components:r}},n4={};[e2,{dijkstra:function(e){if(!A(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=e9(e),r=n.root,i=n.weight,a=n.directed,o=this,s=B(r)?this.filter(r)[0]:r[0],l={},u={},c={},d=this.byGroup(),h=d.nodes,f=d.edges;f.unmergeBy(function(e){return e.isLoop()});for(var p=function(e){return l[e.id()]},g=new e4(function(e,t){return p(e)-p(t)}),v=0;v0;){var b=g.pop(),x=p(b);if(c[b.id()]=x,x!==1/0)for(var w=b.neighborhood().intersect(h),E=0;E0)for(n.unshift(t);u[i];){var a=u[i];n.unshift(a.edge),n.unshift(a.node),i=(r=a.node).id()}return o.spawn(n)}}}},{kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,a=Array(i),o=function(e){for(var t=0;t0;){if(n=(t=g.pop()).id(),v.delete(n),w++,n===d){for(var E=[],T=o,C=d,k=b[C];E.unshift(T),null!=k&&E.unshift(k),null!=(T=y[C]);)k=b[C=T.id()];return{found:!0,distance:h[n],path:this.spawn(E),steps:w}}p[n]=!0;for(var P=t._private.edges,S=0;Sk&&(h[C]=k,g[C]=T,v[C]=b),!i){var P=T*l+E;!i&&h[P]>k&&(h[P]=k,g[P]=E,v[P]=b)}}}for(var S=0;S1&&void 0!==arguments[1]?arguments[1]:a,r=y(e),i=[],s=r;;){if(null==s)return t.spawn();var l=v(s),u=l.edge,c=l.pred;if(i.unshift(s[0]),s.same(n)&&i.length>0)break;null!=u&&i.unshift(u),s=c}return o.spawn(i)},hasNegativeWeightCycle:f,negativeWeightCycles:p}}},{kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy(function(e){return e.isLoop()});var i=n.length,a=r.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/te);if(i<2){eO("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],u=0;u1||o>1)&&(l=!0),u[r]=[],e.outgoers().forEach(function(e){e.isEdge()&&u[r].push(e.id())})}else c[r]=[void 0,e.target().id()]}):this.forEach(function(e){var r=e.id();e.isNode()?(e.degree(!0)%2&&(t?n?l=!0:n=r:t=r),u[r]=[],e.connectedEdges().forEach(function(e){return u[r].push(e.id())})):c[r]=[e.source().id(),e.target().id()]});var d={found:!1,trail:void 0};if(l)return d;if(n&&t){if(s){if(r&&n!=r)return d;r=n}else{if(r&&n!=r&&t!=r)return d;r||(r=n)}}else r||(r=this[0].id());var h=function(e){for(var t,n,r,i=e,a=[e];u[i].length;)n=c[t=u[i].shift()][0],i!=(r=c[t][1])?(u[r]=u[r].filter(function(e){return e!=t}),i=r):s||i==n||(u[n]=u[n].filter(function(e){return e!=t}),i=n),a.unshift(t),a.unshift(i);return a},f=[],p=[];for(p=h(r);1!=p.length;)0==u[p[0]].length?(f.unshift(this.getElementById(p.shift())),f.unshift(this.getElementById(p.shift()))):p=h(p.shift()).concat(p);for(var g in f.unshift(this.getElementById(p.shift())),u)if(u[g].length)return d;return d.found=!0,d.trail=this.spawn(f,!0),d}},{hopcroftTarjanBiconnected:n5,htbc:n5,htb:n5,hopcroftTarjanBiconnectedComponents:n5},{tarjanStronglyConnected:n3,tsc:n3,tscc:n3,tarjanStronglyConnectedComponents:n3}].forEach(function(e){ee(n4,e)});var n9=function(e){if(!(this instanceof n9))return new n9(e);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof e&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};n9.prototype={fulfill:function(e){return n6(this,1,"fulfillValue",e)},reject:function(e){return n6(this,2,"rejectReason",e)},then:function(e,t){var n=new n9;return this.onFulfilled.push(re(e,n,"fulfill")),this.onRejected.push(re(t,n,"reject")),n8(this),n.proxy}};var n6=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,n8(e)),e},n8=function(e){1===e.state?n7(e,"onFulfilled",e.fulfillValue):2===e.state&&n7(e,"onRejected",e.rejectReason)},n7=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e-1}}(),i=function(){if(sm)return sy;sm=1;var e=ru();return sy=function(t,n){var r=this.__data__,i=e(r,t);return i<0?(++this.size,r.push([t,n])):r[i][1]=n,this}}();function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&t%1==0&&t0}},clearQueue:function(){return function(){var e=void 0!==this.length?this:[this];if(!(this._private.cy||this).styleEnabled())return this;for(var t=0;t0&&this.spawn(n).updateStyle().emit("class"),this},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){_(e)||(e=e.match(/\S+/g)||[]);for(var n=void 0===t,r=[],i=0,a=this.length;i0&&this.spawn(r).updateStyle().emit("class"),this},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};rw.className=rw.classNames=rw.classes;var rE={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:H,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};rE.variable="(?:[\\w-.]|(?:\\\\"+rE.metaChar+"))+",rE.className="(?:[\\w-]|(?:\\\\"+rE.metaChar+"))+",rE.value=rE.string+"|"+rE.number,rE.id=rE.variable,function(){var e,t,n;for(n=0,e=rE.comparatorOp.split("|");n=0||"="===t||(rE.comparatorOp+="|\\!"+t)}();var rT=function(){return{checks:[]}},rC={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},rk=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(e,t){return -1*J(e.selector,t.selector)}),rP=function(){for(var e,t={},n=0;n=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),u=!0),(o||l||u)&&(i=o||s?""+e:"",a=""+n),u&&(e=i=i.toLowerCase(),n=a=a.toLowerCase()),t){case"*=":r=i.indexOf(a)>=0;break;case"$=":r=i.indexOf(a,i.length-a.length)>=0;break;case"^=":r=0===i.indexOf(a);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e0&&l.edgeCount>0)return eV("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(l.edgeCount>1)return eV("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===l.edgeCount&&eV("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return B(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(r,a){var o=r.type,s=r.value;switch(o){case rC.GROUP:var l=e(s);return l.substring(0,l.length-1);case rC.DATA_COMPARE:return"["+r.field+n(e(r.operator))+t(s)+"]";case rC.DATA_BOOL:var u=r.operator,c=r.field;return"["+e(u)+c+"]";case rC.DATA_EXIST:return"["+r.field+"]";case rC.META_COMPARE:var d=r.operator;return"[["+r.field+n(e(d))+t(s)+"]]";case rC.STATE:return s;case rC.ID:return"#"+s;case rC.CLASS:return"."+s;case rC.PARENT:case rC.CHILD:return i(r.parent,a)+n(">")+i(r.child,a);case rC.ANCESTOR:case rC.DESCENDANT:return i(r.ancestor,a)+" "+i(r.descendant,a);case rC.COMPOUND_SPLIT:var h=i(r.left,a),f=i(r.subject,a),p=i(r.right,a);return h+(h.length>0?" ":"")+f+p;case rC.TRUE:return""}},i=function(e,t){return e.checks.reduce(function(n,i,a){return n+(t===e&&0===a?"$":"")+r(i,t)},"")},a="",o=0;o1&&o0;){var u=i.shift();t(u),a.add(u.id()),o&&r(i,a,u)}return e}function rq(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i1)||void 0===arguments[1]||arguments[1];return rY(this,e,t,rq)},rj.forEachUp=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return rY(this,e,t,rW)},rj.forEachUpAndDown=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return rY(this,e,t,rU)},rj.ancestors=rj.parents,(ld=lh={data:rb.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:rb.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:rb.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:rb.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:rb.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:rb.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=ld.data,ld.removeAttr=ld.removeData;var rG={};function rH(e){return function(t){if(void 0===t&&(t=!0),0!==this.length&&!(!this.isNode()||this.removed())){for(var n=0,r=this[0],i=r._private.edges,a=0;at}),minIndegree:rK("indegree",function(e,t){return et}),minOutdegree:rK("outdegree",function(e,t){return et})}),ee(rG,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r0;c&&(u=u[0]);var d=c?u.position():{x:0,y:0};void 0!==t?l.position(e,t+d[e]):void 0!==i&&l.position({x:i.x+d.x,y:i.y+d.y})}else{var h=n.position(),f=o?n.parent():null,p=f&&f.length>0;p&&(f=f[0]);var g=p?f.position():{x:0,y:0};return(i={x:h.x-g.x,y:h.y-g.y},void 0===e)?i:i[e]}}else if(!a)return;return this}}).modelPosition=lf.point=lf.position,lf.modelPositions=lf.points=lf.positions,lf.renderedPoint=lf.renderedPosition,lf.relativePoint=lf.relativePosition;var rQ=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},rJ=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},r0=function(e){switch(e){case"left":case"right-inside":return"right";case"right":case"left-inside":return"left";default:return"center"}};lg=lv={},lv.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),a=t.x1*r+i.x,o=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}},lv.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()&&this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}}),this},lv.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes()||!e&&t.batching())return this;for(var n=0;n0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var u=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(u=100*u/i.height.val);var c=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(c=100*c/i.height.val);var d=y(i.width.val-a.w,s,l),h=d.biasDiff,f=d.biasComplementDiff,p=y(i.height.val-a.h,u,c),g=p.biasDiff,v=p.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"===n.units)switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}else if("px"===n.units)return n.pfValue;else return 0}(a.w,a.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(a.w,i.width.val),o.x=(-h+a.x1+a.x2+f)/2,t.autoHeight=Math.max(a.h,i.height.val),o.y=(-g+a.y1+a.y2+v)/2}function y(e,t,n){var r=0,i=0,a=t+n;return e>0&&a>0&&(r=t/a*e,i=n/a*e),{biasDiff:r,biasComplementDiff:i}}}(r),t.batching()||(i.compoundBoundsClean=!0))}return this};var r1=function(e){return e===1/0||e===-1/0?0:e},r2=function(e,t,n,r,i){r-t!=0&&i-n!=0&&null!=t&&null!=n&&null!=r&&null!=i&&(e.x1=te.x2?r:e.x2,e.y1=ne.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},r5=function(e,t){return null==t?e:r2(e,t.x1,t.y1,t.x2,t.y2)},r3=function(e,t,n){return eH(e,t,n)},r4=function(e,t,n){if(!t.cy().headless()){var r,i,a=t._private,o=a.rstyle,s=o.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=o.srcX,i=o.srcY):"target"===n?(r=o.tgtX,i=o.tgtY):(r=o.midX,i=o.midY);var l=a.arrowBounds=a.arrowBounds||{},u=l[n]=l[n]||{};u.x1=r-s,u.y1=i-s,u.x2=r+s,u.y2=i+s,u.w=u.x2-u.x1,u.h=u.y2-u.y1,tP(u,1),r2(e,u.x1,u.y1,u.x2,u.y2)}}},r9=function(e,t,n){if(!t.cy().headless()){a=n?n+"-":"";var r=t._private,i=r.rstyle;if(t.pstyle(a+"label").strValue){var a,o,s,l,u,c=t.pstyle("text-halign"),d=t.pstyle("text-valign"),h=r3(i,"labelWidth",n),f=r3(i,"labelHeight",n),p=r3(i,"labelX",n),g=r3(i,"labelY",n),v=t.pstyle(a+"text-margin-x").pfValue,y=t.pstyle(a+"text-margin-y").pfValue,b=t.isEdge(),x=t.pstyle(a+"text-rotation"),w=t.pstyle("text-outline-width").pfValue,E=t.pstyle("text-border-width").pfValue/2,T=t.pstyle("text-background-padding").pfValue,C=h/2,k=f/2;if(b)o=p-C,s=p+C,l=g-k,u=g+k;else{switch(rQ(c.value)){case"left":o=p-h,s=p;break;case"center":o=p-C,s=p+C;break;case"right":o=p,s=p+h}switch(rJ(d.value)){case"top":l=g-f,u=g;break;case"center":l=g-k,u=g+k;break;case"bottom":l=g,u=g+f}}var P=v-Math.max(w,E)-T-2,S=v+Math.max(w,E)+T+2,B=y-Math.max(w,E)-T-2,D=y+Math.max(w,E)+T+2;o+=P,s+=S,l+=B,u+=D;var _=n||"main",A=r.labelBounds,M=A[_]=A[_]||{};M.x1=o,M.y1=l,M.x2=s,M.y2=u,M.w=s-o,M.h=u-l,M.leftPad=P,M.rightPad=S,M.topPad=B,M.botPad=D;var R=b&&"autorotate"===x.strValue,I=null!=x.pfValue&&0!==x.pfValue;if(R||I){var N=R?r3(r.rstyle,"labelAngle",n):x.pfValue,L=Math.cos(N),O=Math.sin(N),z=(o+s)/2,V=(l+u)/2;if(!b){switch(rQ(c.value)){case"left":z=s;break;case"right":z=o}switch(rJ(d.value)){case"top":V=u;break;case"bottom":V=l}}var F=function(e,t){return{x:(e-=z)*L-(t-=V)*O+z,y:e*O+t*L+V}},X=F(o,l),j=F(o,u),Y=F(s,l),q=F(s,u);o=Math.min(X.x,j.x,Y.x,q.x),s=Math.max(X.x,j.x,Y.x,q.x),l=Math.min(X.y,j.y,Y.y,q.y),u=Math.max(X.y,j.y,Y.y,q.y)}var W=_+"Rot",U=A[W]=A[W]||{};U.x1=o,U.y1=l,U.x2=s,U.y2=u,U.w=s-o,U.h=u-l,r2(e,o,l,s,u),r2(r.labelBounds.all,o,l,s,u)}return e}},r6=function(e,t){if(!t.cy().headless()){var n=t.pstyle("outline-opacity").value,r=t.pstyle("outline-width").value+t.pstyle("outline-offset").value;r8(e,t,n,r,"outside",r/2)}},r8=function(e,t,n,r,i,a){if(0!==n&&!(r<=0)&&"inside"!==i){var o=t.cy().renderer(),s=o.nodeShapes[o.getNodeShape(t)];if(s){var l=t.position(),u=l.x,c=l.y,d=t.width(),h=t.height();s.hasMiterBounds?("center"===i&&(r/=2),r5(e,s.miterBounds(u,c,d,h,r))):null!=a&&a>0&&tS(e,[a,a,a,a])}}},r7=function(e,t){if(!t.cy().headless()){var n=t.pstyle("border-opacity").value,r=t.pstyle("border-width").pfValue,i=t.pstyle("border-position").value;r8(e,t,n,r,i)}},ie=function(e,t){var n=e._private.cy,r=n.styleEnabled(),i=n.headless(),a=tE(),o=e._private,s=e.isNode(),l=e.isEdge(),u=o.rstyle,c=s&&r?e.pstyle("bounds-expansion").pfValue:[0],d=function(e){return"none"!==e.pstyle("display").value},h=!r||d(e)&&(!l||d(e.source())&&d(e.target()));if(h){var f=0;r&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(f=e.pstyle("overlay-padding").value);var p=0;r&&t.includeUnderlays&&0!==e.pstyle("underlay-opacity").value&&(p=e.pstyle("underlay-padding").value);var g=Math.max(f,p),v=0;if(r&&(v=e.pstyle("width").pfValue/2),s&&t.includeNodes){var y=e.position();k=y.x,P=y.y;var b=e.outerWidth()/2,x=e.outerHeight()/2;w=k-b,E=k+b,r2(a,w,T=P-x,E,C=P+x),r&&r6(a,e),r&&t.includeOutlines&&!i&&r6(a,e),r&&r7(a,e)}else if(l&&t.includeEdges){if(r&&!i){var w,E,T,C,k,P,S,B=e.pstyle("curve-style").strValue;if(w=Math.min(u.srcX,u.midX,u.tgtX),E=Math.max(u.srcX,u.midX,u.tgtX),T=Math.min(u.srcY,u.midY,u.tgtY),C=Math.max(u.srcY,u.midY,u.tgtY),w-=v,E+=v,r2(a,w,T-=v,E,C+=v),"haystack"===B){var D=u.haystackPts;if(D&&2===D.length){if(w=D[0].x,T=D[0].y,E=D[1].x,C=D[1].y,w>E){var _=w;w=E,E=_}if(T>C){var A=T;T=C,C=A}r2(a,w-v,T-v,E+v,C+v)}}else if("bezier"===B||"unbundled-bezier"===B||G(B,"segments")||G(B,"taxi")){switch(B){case"bezier":case"unbundled-bezier":S=u.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":S=u.linePts}if(null!=S)for(var M=0;ME){var L=w;w=E,E=L}if(T>C){var O=T;T=C,C=O}w-=v,E+=v,r2(a,w,T-=v,E,C+=v)}}if(r&&t.includeEdges&&l&&(r4(a,e,"mid-source"),r4(a,e,"mid-target"),r4(a,e,"source"),r4(a,e,"target")),r&&"yes"===e.pstyle("ghost").value){var z=e.pstyle("ghost-offset-x").pfValue,V=e.pstyle("ghost-offset-y").pfValue;r2(a,a.x1+z,a.y1+V,a.x2+z,a.y2+V)}var F=o.bodyBounds=o.bodyBounds||{};tB(F,a),tS(F,c),tP(F,1),r&&(w=a.x1,E=a.x2,T=a.y1,C=a.y2,r2(a,w-g,T-g,E+g,C+g));var X=o.overlayBounds=o.overlayBounds||{};tB(X,a),tS(X,c),tP(X,1);var j=o.labelBounds=o.labelBounds||{};null!=j.all?tT(j.all):j.all=tE(),r&&t.includeLabels&&(t.includeMainLabels&&r9(a,e,null),l&&(t.includeSourceLabels&&r9(a,e,"source"),t.includeTargetLabels&&r9(a,e,"target")))}return a.x1=r1(a.x1),a.y1=r1(a.y1),a.x2=r1(a.x2),a.y2=r1(a.y2),a.w=r1(a.x2-a.x1),a.h=r1(a.y2-a.y1),a.w>0&&a.h>0&&h&&(tS(a,c),tP(a,1)),a},it=function(e){var t=0,n=function(e){return(e?1:0)<0&&void 0!==arguments[0]?arguments[0]:iw,t=arguments.length>1?arguments[1]:void 0,n=0;n=0;s--)o(s);return this},iT.removeAllListeners=function(){return this.removeListener("*")},iT.emit=iT.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,_(t)||(t=[t]),iP(this,function(e,a){null!=n&&(i=(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}]).length);for(var o=0;o1&&!r){var i=this.length-1,a=this[i],o=a._private.data.id;this[i]=void 0,this[e]=a,n.set(o,{ele:a,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&B(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],r=0;rr&&(r=o,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=0;i=0&&i1)||void 0===arguments[1]||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,r.style().apply(n));var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];if(n)return t.style().getRenderedStyle(n,e)},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=n.style();if(A(e))r.applyBypass(this,e,!1),this.emitAndNotify("style");else if(B(e)){if(void 0===t){var i=this[0];return i?r.getStylePropertyValue(i,e):void 0}r.applyBypass(this,e,t,!1),this.emitAndNotify("style")}else if(void 0===e){var a=this[0];return a?r.getRawStyle(a):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=t.style();if(void 0===e)for(var r=0;r0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),iH.neighbourhood=iH.neighborhood,iH.closedNeighbourhood=iH.closedNeighborhood,iH.openNeighbourhood=iH.openNeighborhood,ee(iH,{source:rX(function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t},"source"),target:rX(function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t},"target"),sources:iQ({attr:"source"}),targets:iQ({attr:"target"})}),ee(iH,{edgesWith:rX(iJ(),"edgesWith"),edgesTo:rX(iJ({thisIsSrc:!0}),"edgesTo")}),ee(iH,{connectedEdges:rX(function(e){for(var t=[],n=0;n0);return a},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),iH.componentsOf=iH.components;var i1=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0===e){eO("A collection must have a reference to the core");return}var i=new e$,a=!1;if(t){if(t.length>0&&A(t[0])&&!L(t[0])){a=!0;for(var o=[],s=new eJ,l=0,u=t.length;l0)||void 0===arguments[0]||arguments[0],t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=this.cy(),r=n._private,i=[],a=[],o=0,s=this.length;o0){for(var R,I,N=R.length===this.length?this:new i1(n,R),L=0;L0)||void 0===arguments[0]||arguments[0],t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=[],r={},i=this._private.cy,a=0,o=this.length;a0&&(e?x.emitAndNotify("remove"):t&&x.emit("remove"));for(var w=0;w1e-4&&Math.abs(g.v)>1e-4;);return f?function(e){return y[e*(y.length-1)|0]}:b}}(),i3=function(e,t,n,r){var i=function(e,t,n,r){var i="undefined"!=typeof Float32Array;if(4!=arguments.length)return!1;for(var a=0;a<4;++a)if("number"!=typeof arguments[a]||isNaN(arguments[a])||!isFinite(arguments[a]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var o=i?new Float32Array(11):Array(11);function s(e,t,n){return(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e}function l(e,t,n){return 3*(1-3*n+3*t)*e*e+2*(3*n-6*t)*e+3*t}var u=!1,c=function(i){return(u||(u=!0,(e!==t||n!==r)&&function(){for(var t=0;t<11;++t)o[t]=s(.1*t,e,n)}()),e===t&&n===r)?i:0===i?0:1===i?1:s(function(t){for(var r=0,i=1;10!==i&&o[i]<=t;++i)r+=.1;var a=r+(t-o[--i])/(o[i+1]-o[i])*.1,u=l(a,e,n);return u>=.001?function(t,r){for(var i=0;i<4;++i){var a=l(r,e,n);if(0===a)break;var o=s(r,e,n)-t;r-=o/a}return r}(t,a):0===u?a:function(t,r,i){var a,o,l=0;do(a=s(o=r+(i-r)/2,e,n)-t)>0?i=o:r=o;while(Math.abs(a)>1e-7&&++l<10);return o}(t,r,r+.1)}(i),t,r)};c.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var d="generateBezier("+[e,t,n,r]+")";return c.toString=function(){return d},c}(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},i4={linear:function(e,t,n){return e+(t-e)*n},ease:i3(.25,.1,.25,1),"ease-in":i3(.42,0,1,1),"ease-out":i3(0,0,.58,1),"ease-in-out":i3(.42,0,.58,1),"ease-in-sine":i3(.47,0,.745,.715),"ease-out-sine":i3(.39,.575,.565,1),"ease-in-out-sine":i3(.445,.05,.55,.95),"ease-in-quad":i3(.55,.085,.68,.53),"ease-out-quad":i3(.25,.46,.45,.94),"ease-in-out-quad":i3(.455,.03,.515,.955),"ease-in-cubic":i3(.55,.055,.675,.19),"ease-out-cubic":i3(.215,.61,.355,1),"ease-in-out-cubic":i3(.645,.045,.355,1),"ease-in-quart":i3(.895,.03,.685,.22),"ease-out-quart":i3(.165,.84,.44,1),"ease-in-out-quart":i3(.77,0,.175,1),"ease-in-quint":i3(.755,.05,.855,.06),"ease-out-quint":i3(.23,1,.32,1),"ease-in-out-quint":i3(.86,0,.07,1),"ease-in-expo":i3(.95,.05,.795,.035),"ease-out-expo":i3(.19,1,.22,1),"ease-in-out-expo":i3(1,0,0,1),"ease-in-circ":i3(.6,.04,.98,.335),"ease-out-circ":i3(.075,.82,.165,1),"ease-in-out-circ":i3(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return i4.linear;var r=i5(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":i3};function i9(e,t,n,r,i){if(1===r||t===n)return n;var a=i(t,n,r);return null==e||((e.roundValue||e.color)&&(a=Math.round(a)),void 0!==e.min&&(a=Math.max(a,e.min)),void 0!==e.max&&(a=Math.min(a,e.max))),a}function i6(e,t){return null==e.pfValue&&null==e.value?e:null!=e.pfValue&&(null==t||"%"!==t.type.units)?e.pfValue:e.value}function i8(e,t,n,r,i){var a=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var o=i6(e,i),s=i6(t,i);if(M(o)&&M(s))return i9(a,o,s,n,r);if(_(o)&&_(s)){for(var l=[],u=0;u=0;t--)(0,e[t])();e.splice(0,e.length)},c=a.length-1;c>=0;c--){var d=a[c],h=d._private;if(h.stopped){a.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,u(h.frames);continue}(h.playing||h.applying)&&(h.playing&&h.applying&&(h.applying=!1),h.started||function(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}(0,d,e),function(e,t,n,r){var i,a,o,s,l=!r,u=e._private,c=t._private,d=c.easing,h=c.startTime,f=(r?e:e.cy()).style();c.easingImpl||(null==d?c.easingImpl=i4.linear:(i=B(d)?f.parse("transition-timing-function",d).value:d,B(i)?(a=i,o=[]):(a=i[1],o=i.slice(2).map(function(e){return+e})),o.length>0?("spring"===a&&o.push(c.duration),c.easingImpl=i4[a].apply(null,o)):c.easingImpl=i4[a]));var p=c.easingImpl;if(s=0===c.duration?1:(n-h)/c.duration,c.applying&&(s=c.progress),s<0?s=0:s>1&&(s=1),null==c.delay){var g=c.startPosition,v=c.position;if(v&&l&&!e.locked()){var y={};i7(g.x,v.x)&&(y.x=i8(g.x,v.x,s,p)),i7(g.y,v.y)&&(y.y=i8(g.y,v.y,s,p)),e.position(y)}var b=c.startPan,x=c.pan,w=u.pan,E=null!=x&&r;E&&(i7(b.x,x.x)&&(w.x=i8(b.x,x.x,s,p)),i7(b.y,x.y)&&(w.y=i8(b.y,x.y,s,p)),e.emit("pan"));var T=c.startZoom,C=c.zoom,k=null!=C&&r;k&&(i7(T,C)&&(u.zoom=tw(u.minZoom,i8(T,C,s,p),u.maxZoom)),e.emit("zoom")),(E||k)&&e.emit("viewport");var P=c.style;if(P&&P.length>0&&l){for(var S=0;S0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var at={animate:rb.animate(),animation:rb.animation(),animated:rb.animated(),clearQueue:rb.clearQueue(),delay:rb.delay(),delayAnimation:rb.delayAnimation(),stop:rb.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender(function(t,n){ae(n,e)},t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&eb(function(n){ae(n,e),t()})}()}}},an={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&L(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},ar=function(e){return B(e)?new rz(e):e},ai={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new iE(an,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,ar(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,ar(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,ar(t),n),this},once:function(e,t,n){return this.emitter().one(e,ar(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};rb.eventAliasesOn(ai);var aa={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};aa.jpeg=aa.jpg;var ao={layout:function(e){if(null==e){eO("Layout options must be specified to make a layout");return}if(null==e.name){eO("A `name` must be specified to make a layout");return}var t,n=e.name,r=this.extension("layout",n);if(null==r){eO("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}return t=B(e.eles)?this.$(e.eles):null!=e.eles?e.eles:this.$(),new r(ee({},e,{cy:this,eles:t}))}};ao.createLayout=ao.makeLayout=ao.layout;var as=eq({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),al={renderTo:function(e,t,n,r){return this._private.renderer.renderTo(e,t,n,r),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this.extension("renderer",e.name);if(null==t){eO("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}void 0!==e.wheelSensitivity&&eV("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var n=as(e);n.cy=this,this._private.renderer=new t(n),this.notify("init")},destroyRenderer:function(){this.notify("destroy");var e=this.container();if(e)for(e._cyreg=null;e.childNodes.length>0;)e.removeChild(e.childNodes[0]);this._private.renderer=null,this.mutableElements().forEach(function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};al.invalidateDimensions=al.resize;var au={collection:function(e,t){return B(e)?this.$(e):N(e)?e.collection():_(e)?(t||(t={}),new i1(this,e,t.unique,t.removed)):new i1(this)},nodes:function(e){var t=this.$(function(e){return e.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(e){return e.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};au.elements=au.filter=au.$;var ac={};ac.apply=function(e){for(var t=this._private.cy.collection(),n=0;n0;if(d||c&&h){var f=void 0;d&&h?f=l.properties:d?f=l.properties:h&&(f=l.mappedProperties);for(var p=0;p1&&(v=1),o.color){var E=r.valueMin[0],T=r.valueMax[0],C=r.valueMin[1],k=r.valueMax[1],P=r.valueMin[2],S=r.valueMax[2],B=null==r.valueMin[3]?1:r.valueMin[3],D=[Math.round(E+(T-E)*v),Math.round(C+(k-C)*v),Math.round(P+(S-P)*v),Math.round(B+((null==r.valueMax[3]?1:r.valueMax[3])-B)*v)];g={bypass:r.bypass,name:r.name,value:D,strValue:"rgb("+D[0]+", "+D[1]+", "+D[2]+")"}}else{if(!o.number)return!1;var _=r.valueMin+(r.valueMax-r.valueMin)*v;g=this.parse(r.name,_,r.bypass,d)}if(!g)return p(),!1;g.mapping=r,r=g;break;case a.data:for(var A=r.field.split("."),R=c.data,I=0;I0&&a>0){for(var s={},l=!1,u=0;u0?e.delayAnimation(o).play().promise().then(t):t()}).then(function(){return e.animation({style:s,duration:a,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1})}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},ac.checkTrigger=function(e,t,n,r,i,a){var o=this.properties[t],s=i(o);!e.removed()&&null!=s&&s(n,r,e)&&a(o)},ac.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,function(e){return e.triggersZOrder},function(){i._private.cy.notify("zorder",e)})},ac.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBounds},function(t){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache()})},ac.checkConnectedEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBoundsOfConnectedEdges},function(t){e.connectedEdges().forEach(function(e){e.dirtyBoundingBoxCache()})})},ac.checkParallelEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBoundsOfParallelEdges},function(t){e.parallelEdges().forEach(function(e){e.dirtyBoundingBoxCache()})})},ac.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r),this.checkConnectedEdgesBoundsTrigger(e,t,n,r),this.checkParallelEdgesBoundsTrigger(e,t,n,r)};var ad={};ad.applyBypass=function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var a=0;at.length?i.substr(t.length):""}function o(){n=n.length>r.length?n.substr(r.length):""}for(i=i.replace(/[/][*](\s|.)+?[*][/]/g,"");!i.match(/^\s*$/);){var s=i.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!s){eV("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+i);break}t=s[0];var l=s[1];if("core"!==l&&new rz(l).invalid){eV("Skipping parsing of block: Invalid selector found in string stylesheet: "+l),a();continue}var u=s[2],c=!1;n=u;for(var d=[];!n.match(/^\s*$/);){var h=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!h){eV("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+u),c=!0;break}r=h[0];var f=h[1],p=h[2];if(!this.properties[f]){eV("Skipping property: Invalid property name in: "+r),o();continue}if(!this.parse(f,p)){eV("Skipping property: Invalid property definition in: "+r),o();continue}d.push({name:f,val:p}),o()}if(c){a();break}this.selector(l);for(var g=0;g=7&&"d"===t[0]&&(g=new RegExp(o.data.regex).exec(t))){if(n)return!1;var u=o.data;return{name:e,value:g,strValue:""+t,mapped:u,field:g[1],bypass:n}}else if(t.length>=10&&"m"===t[0]&&(v=new RegExp(o.mapData.regex).exec(t))){if(n||l.multiple)return!1;var c=o.mapData;if(!(l.color||l.number))return!1;var d=this.parse(e,v[4]);if(!d||d.mapped)return!1;var h=this.parse(e,v[5]);if(!h||h.mapped)return!1;if(d.pfValue===h.pfValue||d.strValue===h.strValue)return eV("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+d.strValue+"`"),this.parse(e,d.strValue);if(l.color){var f=d.value,p=h.value;if(f[0]===p[0]&&f[1]===p[1]&&f[2]===p[2]&&(f[3]===p[3]||(null==f[3]||1===f[3])&&(null==p[3]||1===p[3])))return!1}return{name:e,value:v,strValue:""+t,mapped:c,field:v[1],fieldMin:parseFloat(v[2]),fieldMax:parseFloat(v[3]),valueMin:d.value,valueMax:h.value,bypass:n}}if(l.multiple&&"multiple"!==r){if(y=s?t.split(/\s+/):_(t)?t:[t],l.evenMultiple&&y.length%2!=0)return null;for(var g,v,y,b=[],x=[],w=[],E="",T=!1,C=0;C0?" ":"")+k.strValue}return l.validate&&!l.validate(b,x)?null:l.singleEnum&&T?1===b.length&&B(b[0])?{name:e,value:b[0],strValue:b[0],bypass:n}:null:{name:e,value:b,pfValue:w,strValue:E,bypass:n,units:x}}var P=function(){for(var r=0;rl.max||l.strictMax&&t===l.max))return null;var N={name:e,value:t,strValue:""+t+(S||""),units:S,bypass:n};return l.unitless||"px"!==S&&"em"!==S?N.pfValue=t:N.pfValue="px"!==S&&S?this.getEmSizeInPixels()*t:t,("ms"===S||"s"===S)&&(N.pfValue="ms"===S?t:1e3*t),("deg"===S||"rad"===S)&&(N.pfValue="rad"===S?t:Math.PI*t/180),"%"===S&&(N.pfValue=t/100),N}if(l.propList){var L=[],O=""+t;if("none"===O);else{for(var z=O.split(/\s*,\s*|\s+/),V=0;V0&&l>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0){i=(i=(i=Math.min((s-2*t)/r.w,(l-2*t)/r.h))>this._private.maxZoom?this._private.maxZoom:i)=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,a=r.zoom,o=!1;if(r.zoomingEnabled||(o=!0),M(e)?n=e:A(e)&&(n=e.level,null!=e.position?t=tr(e.position,a,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(o=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)t.maxZoom||!t.zoomingEnabled?a=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!a||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;M(l.x)&&(t.pan.x=l.x,o=!1),M(l.y)&&(t.pan.y=l.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(B(e)){var n=e;e=this.mutableElements().filter(n)}else N(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),a=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(a-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled&&this.viewport({pan:{x:0,y:0},zoom:1}),this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=this.window().getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};ax.centre=ax.center,ax.autolockNodes=ax.autolock,ax.autoungrabifyNodes=ax.autoungrabify;var aw={data:rb.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:rb.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:rb.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:rb.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};aw.attr=aw.data,aw.removeAttr=aw.removeData;var aE=function(e){var t=this,n=(e=ee({},e)).container;n&&!I(n)&&I(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{}).cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var a=void 0!==w&&void 0!==n&&!e.headless,o=e;o.layout=ee({name:a?"grid":"null"},o.layout),o.renderer=ee({name:a?"canvas":"null"},o.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:o,elements:new i1(this),listeners:[],aniEles:new i1(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,o.zoomingEnabled),userZoomingEnabled:s(!0,o.userZoomingEnabled),panningEnabled:s(!0,o.panningEnabled),userPanningEnabled:s(!0,o.userPanningEnabled),boxSelectionEnabled:s(!0,o.boxSelectionEnabled),autolock:s(!1,o.autolock,o.autolockNodes),autoungrabify:s(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:s(!1,o.autounselectify),styleEnabled:void 0===o.styleEnabled?a:o.styleEnabled,zoom:M(o.zoom)?o.zoom:1,pan:{x:A(o.pan)&&M(o.pan.x)?o.pan.x:0,y:A(o.pan)&&M(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom}),l.styleEnabled&&t.setStyle([]);var u=ee({},o,o.renderer);t.initRenderer(u);var c=function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(A(e)||_(e))&&t.add(e),t.one("layoutready",function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",r),t.emit("done")});var a=ee({},t._private.options.layout);a.eles=t.elements(),t.layout(a).run()};!function(e,t){if(e.some(X))return rn.all(e).then(t);t(e)}([o.style,o.elements],function(e){var n=e[0],a=e[1];l.styleEnabled&&t.style().append(n),c(a,function(){t.startAnimationLoop(),l.ready=!0,D(o.ready)&&t.on("ready",o.ready);for(var e=0;e0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),r=0;r0,s=!!t.boundingBox,l=tE(s?t.boundingBox:structuredClone(n.extent()));if(N(t.roots))e=t.roots;else if(_(t.roots)){for(var u=[],c=0;c0;){var S=C.shift(),D=function(e,n){for(var i=aP(e),a=e.incomers().filter(function(e){return e.isNode()&&r.has(e)}),o=-1,s=e.id(),l=0;l0&&g[0].length<=3?a/2:0),u=2*Math.PI/g[r].length*i;return 0===r&&1===g[0].length&&(o=1),{x:U.x+o*Math.cos(u),y:U.y+o*Math.sin(u)}}var c=g[r].length,d=Math.max(1===c?0:s?(l.w-2*t.padding-G.w)/((t.grid?K:c)-1):(l.w-2*t.padding-G.w)/((t.grid?K:c)+1),A);return{x:U.x+(i+1-(c+1)/2)*d,y:U.y+(r+1-(F+1)/2)*H}},$={downward:0,leftward:90,upward:180,rightward:-90};return -1===Object.keys($).indexOf(t.direction)&&eO("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys($).join(", "))),r.nodes().layoutPositions(this,t,function(e){return function(e,t,n){if(0===n)return e;var r,i,a,o=(t.x1+t.x2)/2,s=(t.y1+t.y2)/2,l=t.w/t.h,u=(r=e.x,i=e.y,{x:Math.cos(a=n*Math.PI/180)*(r-o)-Math.sin(a)*(i-s)+o,y:Math.sin(a)*(r-o)+Math.cos(a)*(i-s)+s}),c={x:(u.x-o)*l+o,y:(u.y-s)*(1/l)+s};return{x:c.x,y:c.y}}(Z(e),l,$[t.direction])}),this};var aD={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function a_(e){this.options=ee({},aD,e)}a_.prototype.run=function(){var e,t=this.options,n=t.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,a=r.nodes().not(":parent");t.sort&&(a=a.sort(t.sort));for(var o=tE(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=(void 0===t.sweep?2*Math.PI-2*Math.PI/a.length:t.sweep)/Math.max(1,a.length-1),u=0,c=0;c1&&t.avoidOverlap){var h=Math.cos(l)-1,f=Math.sin(l)-0;e=Math.max(Math.sqrt((u*=1.75)*u/(h*h+f*f)),e)}return r.nodes().layoutPositions(this,t,function(n,r){var a=t.startAngle+r*l*(i?1:-1),o=e*Math.cos(a),u=e*Math.sin(a);return{x:s.x+o,y:s.y+u}}),this};var aA={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function aM(e){this.options=ee({},aA,e)}aM.prototype.run=function(){for(var e=this.options,t=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,n=e.cy,r=e.eles,i=r.nodes().not(":parent"),a=tE(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:a.x1+a.w/2,y:a.y1+a.h/2},s=[],l=0,u=0;u0&&Math.abs(v[0].value-b.value)>=p&&(v=[],g.push(v)),v.push(b)}var x=l+e.minNodeSpacing;if(!e.avoidOverlap){var w=g.length>0&&g[0].length>1,E=(Math.min(a.w,a.h)/2-x)/(g.length+w?1:0);x=Math.min(x,E)}for(var T=0,C=0;C1&&e.avoidOverlap){var B=Math.cos(S)-1,D=Math.sin(S)-0;T=Math.max(Math.sqrt(x*x/(B*B+D*D)),T)}k.r=T,T+=x}if(e.equidistant){for(var _=0,A=0,M=0;M=e.numIter)&&(aX(r,e),r.temperature=r.temperature*e.coolingFactor,!(r.temperature=e.animationThreshold&&a(),eb(c)):(aJ(r,e),s())};c()}else{for(;u;)u=o(l),l++;aJ(r,e),s()}return this},aI.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},aI.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var aN=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a=tE(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},s=n.eles.components(),l={},u=0;u0){o.graphSet.push(C);for(var u=0;ur.count?0:r.graph},aO=function(e,t,n,r){var i=r.graphSet[n];if(-10)var s=r.nodeOverlap*o,l=Math.sqrt(i*i+a*a),u=s*i/l,c=s*a/l;else var d=aU(e,i,a),h=aU(t,-1*i,-1*a),f=h.x-d.x,p=h.y-d.y,g=f*f+p*p,l=Math.sqrt(g),s=(e.nodeRepulsion+t.nodeRepulsion)/g,u=s*f/l,c=s*p/l;e.isLocked||(e.offsetX-=u,e.offsetY-=c),t.isLocked||(t.offsetX+=u,t.offsetY+=c)}},aW=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else var a=t.maxY-e.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0},aU=function(e,t,n){var r=e.positionX,i=e.positionY,a=e.height||1,o=e.width||1,s=n/t,l=a/o,u={};return 0===t&&0n?(u.x=r,u.y=i+a/2):0t&&-1*l<=s&&s<=l?(u.x=r-o/2,u.y=i-o*n/2/t):0=l)?(u.x=r+a*t/2/n,u.y=i+a/2):0>n&&(s<=-1*l||s>=l)&&(u.x=r-a*t/2/n,u.y=i-a/2),u},aG=function(e,t){for(var n=0;n1){var p=t.gravity*d/f,g=t.gravity*h/f;c.offsetX+=p,c.offsetY+=g}}}}},aK=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var a=n[r++],o=e.idToIndex[a],s=e.layoutNodes[o],l=s.children;if(0n)var i={x:n*e/r,y:n*t/r};else var i={x:e,y:t};return i},aQ=function(e,t){var n=e.parentId;if(null!=n){var r=t.layoutNodes[t.idToIndex[n]],i=!1;if((null==r.maxX||e.maxX+r.padRight>r.maxX)&&(r.maxX=e.maxX+r.padRight,i=!0),(null==r.minX||e.minX-r.padLeftr.maxY)&&(r.maxY=e.maxY+r.padBottom,i=!0),(null==r.minY||e.minY-r.padTopg&&(h+=p+t.componentSpacing,d=0,f=0,p=0)}}},a0={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function a1(e){this.options=ee({},a0,e)}a1.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=n.nodes().not(":parent");e.sort&&(r=r.sort(e.sort));var i=tE(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(0===i.h||0===i.w)n.nodes().layoutPositions(this,e,function(e){return{x:i.x1,y:i.y1}});else{var a=r.size(),o=Math.sqrt(a*i.h/i.w),s=Math.round(o),l=Math.round(i.w/i.h*o),u=function(e){if(null==e)return Math.min(s,l);Math.min(s,l)==s?s=e:l=e},c=function(e){if(null==e)return Math.max(s,l);Math.max(s,l)==s?s=e:l=e},d=e.rows,h=null!=e.cols?e.cols:e.columns;if(null!=d&&null!=h)s=d,l=h;else if(null!=d&&null==h)l=Math.ceil(a/(s=d));else if(null==d&&null!=h)s=Math.ceil(a/(l=h));else if(l*s>a){var f=u(),p=c();(f-1)*p>=a?u(f-1):(p-1)*f>=a&&c(p-1)}else for(;l*s=a?c(v+1):u(g+1)}var y=i.w/l,b=i.h/s;if(e.condense&&(y=0,b=0),e.avoidOverlap)for(var x=0;x=l&&(A=0,_++)},R={},I=0;I=0;x--){var w=l[x];w.isNode()?y(w)||b(w):function(n){var r,i=n._private,a=i.rscratch,l=n.pstyle("width").pfValue,c=n.pstyle("arrow-scale").value,f=l/2+h,p=f*f,g=2*f,b=i.source,x=i.target;if("segments"===a.edgeType||"straight"===a.edgeType||"haystack"===a.edgeType){for(var w=a.allpts,E=0;E+3(r=tF(e,t,w[E],w[E+1],w[E+2],w[E+3])))return v(n,r),!0}else if("bezier"===a.edgeType||"multibezier"===a.edgeType||"self"===a.edgeType||"compound"===a.edgeType){for(var w=a.allpts,E=0;E+5(r=tV(e,t,w[E],w[E+1],w[E+2],w[E+3],w[E+4],w[E+5])))return v(n,r),!0}for(var b=b||i.source,x=x||i.target,T=o.getArrowWidth(l,c),C=[{name:"source",x:a.arrowStartX,y:a.arrowStartY,angle:a.srcArrowAngle},{name:"target",x:a.arrowEndX,y:a.arrowEndY,angle:a.tgtArrowAngle},{name:"mid-source",x:a.midX,y:a.midY,angle:a.midsrcArrowAngle},{name:"mid-target",x:a.midX,y:a.midY,angle:a.midtgtArrowAngle}],E=0;E0&&(y(b),y(x))}(w)||b(w)||b(w,"source")||b(w,"target")}return u},on.getAllInBox=function(e,t,n,r){var i=this.getCachedZSortedEles().interactive,a=2/this.cy.zoom(),o=[],s=Math.min(e,n),u=Math.max(e,n),c=Math.min(t,r),d=Math.max(t,r);e=s,n=u;var h=tE({x1:e,y1:t=c,x2:n,y2:r=d}),f=[{x:h.x1,y:h.y1},{x:h.x2,y:h.y1},{x:h.x2,y:h.y2},{x:h.x1,y:h.y2}],p=[[f[0],f[1]],[f[1],f[2]],[f[2],f[3]],[f[3],f[0]]];function g(e,t){var n=e._private;e.boundingBox();var r=n.labelBounds.main;if(!r)return null;var i=eH(n.rscratch,"labelX",t),o=eH(n.rscratch,"labelY",t),s=eH(n.rscratch,"labelAngle",t),l=e.pstyle("text-margin-x").pfValue,u=e.pstyle("text-margin-y").pfValue,c=r.x1-a-l,d=r.x2+a-l,h=r.y1-a-u,f=r.y2+a-u;if(!s)return[{x:c,y:h},{x:d,y:h},{x:d,y:f},{x:c,y:f}];var p=Math.cos(s),g=Math.sin(s),v=function(e,t){return{x:(e-=i)*p-(t-=o)*g+i,y:e*g+t*p+o}};return[v(c,h),v(d,h),v(d,f),v(c,f)]}for(var v=0;v(t.y-e.y)*(n.x-e.x)}return i(e,n,r)!==i(t,n,r)&&i(e,t,n)!==i(e,t,r)}(V,F,j[0],j[1])){o.push(y),I=!0;break}}if(I)break}}}}}return o};var or={};or.calculateArrowAngles=function(e){var t=e._private.rscratch,n="haystack"===t.edgeType,r="bezier"===t.edgeType,i="multibezier"===t.edgeType,a="segments"===t.edgeType,o="compound"===t.edgeType,s="self"===t.edgeType;if(n?(y=t.haystackPts[0],b=t.haystackPts[1],x=t.haystackPts[2],w=t.haystackPts[3]):(y=t.arrowStartX,b=t.arrowStartY,x=t.arrowEndX,w=t.arrowEndY),d=t.midX,h=t.midY,a)g=y-t.segpts[0],v=b-t.segpts[1];else if(i||o||s||r){var l=t.allpts,u=tm(l[0],l[2],l[4],.1),c=tm(l[1],l[3],l[5],.1);g=y-u,v=b-c}else g=y-d,v=b-h;t.srcArrowAngle=th(g,v);var d=t.midX,h=t.midY;if(n&&(d=(y+x)/2,h=(b+w)/2),g=x-y,v=w-b,a){var l=t.allpts;if(l.length/2%2==0){var f=l.length/2,p=f-2;g=l[f]-l[p],v=l[f+1]-l[p+1]}else if(t.isRound)g=t.midVector[1],v=-t.midVector[0];else{var f=l.length/2-1,p=f-2;g=l[f]-l[p],v=l[f+1]-l[p+1]}}else if(i||o||s){var g,v,y,b,x,w,d,h,E,T,C,k,l=t.allpts;if(t.ctrlpts.length/2%2==0){var P=l.length/2-1,S=P+2,B=S+2;E=tm(l[P],l[S],l[B],0),T=tm(l[P+1],l[S+1],l[B+1],0),C=tm(l[P],l[S],l[B],1e-4),k=tm(l[P+1],l[S+1],l[B+1],1e-4)}else{var S=l.length/2-1,P=S-2,B=S+2;E=tm(l[P],l[S],l[B],.4999),T=tm(l[P+1],l[S+1],l[B+1],.4999),C=tm(l[P],l[S],l[B],.5),k=tm(l[P+1],l[S+1],l[B+1],.5)}g=C-E,v=k-T}if(t.midtgtArrowAngle=th(g,v),t.midDispX=g,t.midDispY=v,g*=-1,v*=-1,a){var l=t.allpts;if(l.length/2%2==0);else if(!t.isRound){var f=l.length/2-1,D=f+2;g=-(l[D]-l[f]),v=-(l[D+1]-l[f+1])}}if(t.midsrcArrowAngle=th(g,v),a)g=x-t.segpts[t.segpts.length-2],v=w-t.segpts[t.segpts.length-1];else if(i||o||s||r){var l=t.allpts,_=l.length,u=tm(l[_-6],l[_-4],l[_-2],.9),c=tm(l[_-5],l[_-3],l[_-1],.9);g=x-u,v=w-c}else g=x-d,v=w-h;t.tgtArrowAngle=th(g,v)},or.getArrowWidth=or.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+", "+t];return r||(r=Math.max(Math.pow(13.37*e,.9),29)*t,n[e+", "+t]=r),r};var oi,oa,oo,os,ol,ou,oc,od,oh,of,op,og,ov,oy,om,ob,ox,ow,oE,oT,oC,ok,oP,oS,oB,oD,o_,oA,oM,oR,oI,oN,oL,oO,oz,oV,oF,oX,oj,oY,oq,oW,oU,oG,oH,oK,oZ,o$,oQ,oJ,o0,o1,o2,o5,o3,o4,o9,o6,o8,o7,se,st,sn,sr,si,sa,so,ss,sl,su,sc,sd,sh,sf,sp,sg,sv,sy,sm,sb,sx,sw,sE,sT,sC,sk,sP,sS,sB,sD,s_,sA,sM,sR,sI,sN,sL,sO,sz,sV,sF,sX,sj,sY,sq,sW,sU,sG,sH,sK,sZ,s$,sQ,sJ,s0,s1,s2,s5,s3,s4,s9,s6,s8,s7,le,lt,ln,lr,li,la,lo,ls,ll,lu,lc,ld,lh,lf,lp,lg,lv,ly,lm,lb,lx,lw,lE,lT,lC,lk,lP,lS,lB,lD,l_,lA,lM,lR={},lI={},lN=function(e,t,n){n.x=t.x-e.x,n.y=t.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},lL=function(e,t){t.x=-1*e.x,t.y=-1*e.y,t.nx=-1*e.nx,t.ny=-1*e.ny,t.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},lO=function(e,t,n,r,i){if(e!==y?lN(t,e,lR):lL(lI,lR),lN(t,n,lI),lT=lR.nx*lI.ny-lR.ny*lI.nx,lC=lR.nx*lI.nx- -(lR.ny*lI.ny),1e-6>Math.abs(lS=Math.asin(Math.max(-1,Math.min(1,lT))))){lw=t.x,lE=t.y,lD=lA=0;return}lk=1,lP=!1,lC<0?lS<0?lS=Math.PI+lS:(lS=Math.PI-lS,lk=-1,lP=!0):lS>0&&(lk=-1,lP=!0),lA=void 0!==t.radius?t.radius:r,lB=lS/2,lM=Math.min(lR.len/2,lI.len/2),lD=i?(l_=Math.abs(Math.cos(lB)*lA/Math.sin(lB)))>lM?Math.abs((l_=lM)*Math.sin(lB)/Math.cos(lB)):lA:Math.abs((l_=Math.min(lM,lA))*Math.sin(lB)/Math.cos(lB)),g=t.x+lI.nx*l_,v=t.y+lI.ny*l_,lw=g-lI.ny*lD*lk,lE=v+lI.nx*lD*lk,f=t.x+lR.nx*l_,p=t.y+lR.ny*l_,y=t};function lz(e,t){0===t.radius?e.lineTo(t.cx,t.cy):e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function lV(e,t,n,r){var i=!(arguments.length>4)||void 0===arguments[4]||arguments[4];return 0===r||0===t.radius?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(lO(e,t,n,r,i),{cx:lw,cy:lE,radius:lD,startX:f,startY:p,stopX:g,stopY:v,startAngle:lR.ang+Math.PI/2*lk,endAngle:lI.ang-Math.PI/2*lk,counterClockwise:lP})}var lF=Math.sqrt(.02),lX={};function lj(e){var t=[];if(null!=e){for(var n=0;n0?Math.max(e-t,0):Math.min(e+t,0)},P=k(T,g?(d+f)/2:0),S=k(C,g?(h+p)/2:0),B=!1;"auto"===y?v=Math.abs(P)>Math.abs(S)?a:i:y===u||y===l?(v=i,B=!0):(y===o||y===s)&&(v=a,B=!0);var D=v===i,_=D?S:P,A=D?C:T,M=tp(A),R=!1;!(B&&(x||w<0))&&(y===l&&A<0||y===u&&A>0||y===o&&A>0||y===s&&A<0)&&(M*=-1,_=M*Math.abs(_),R=!0);var I=function(e){return Math.abs(e)=Math.abs(_)},N=I(n=x?(w<0?1+w:w)*_:(w<0?_:0)+w*M),L=I(Math.abs(_)-Math.abs(n));if((N||L)&&!R){if(D){var O=Math.abs(T)<=f/2;if(Math.abs(A)<=h/2){var z=(c.x1+c.x2)/2,V=c.y1,F=c.y2;r.segpts=[z,V,z,F]}else if(O){var X=(c.y1+c.y2)/2,j=c.x1,Y=c.x2;r.segpts=[j,X,Y,X]}else r.segpts=[c.x1,c.y2]}else{var q=Math.abs(C)<=p/2;if(Math.abs(A)<=d/2){var W=(c.y1+c.y2)/2,U=c.x1,G=c.x2;r.segpts=[U,W,G,W]}else if(q){var H=(c.x1+c.x2)/2,K=c.y1,Z=c.y2;r.segpts=[H,K,H,Z]}else r.segpts=[c.x2,c.y1]}}else if(D){var $=c.y1+n+(g?h/2*M:0),Q=c.x1,J=c.x2;r.segpts=[Q,$,J,$]}else{var ee=c.x1+n+(g?d/2*M:0),et=c.y1,en=c.y2;r.segpts=[ee,et,ee,en]}if(r.isRound){var er=e.pstyle("taxi-radius").value,ei="arc-radius"===e.pstyle("radius-type").value[0];r.radii=Array(r.segpts.length/2).fill(er),r.isArcRadius=Array(r.segpts.length/2).fill(ei)}},lX.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,a=t.srcW,o=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,c=t.tgtShape,d=t.srcCornerRadius,h=t.tgtCornerRadius,f=t.srcRs,p=t.tgtRs,g=!M(n.startX)||!M(n.startY),v=!M(n.arrowStartX)||!M(n.arrowStartY),y=!M(n.endX)||!M(n.endY),b=!M(n.arrowEndX)||!M(n.arrowEndY),x=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth*3,w=tg({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),E=wf.poolIndex()){var p=h;h=f,f=p}var g=u.srcPos=h.position(),v=u.tgtPos=f.position(),y=u.srcW=h.outerWidth(),b=u.srcH=h.outerHeight(),x=u.tgtW=f.outerWidth(),E=u.tgtH=f.outerHeight(),T=u.srcShape=n.nodeShapes[t.getNodeShape(h)],C=u.tgtShape=n.nodeShapes[t.getNodeShape(f)],k=u.srcCornerRadius="auto"===h.pstyle("corner-radius").value?"auto":h.pstyle("corner-radius").pfValue,P=u.tgtCornerRadius="auto"===f.pstyle("corner-radius").value?"auto":f.pstyle("corner-radius").pfValue,S=u.tgtRs=f._private.rscratch,B=u.srcRs=h._private.rscratch;u.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var D=0;D=lF||(q=Math.sqrt(Math.max(Y*Y,.01)+Math.max(j*j,.01)));var W=u.vector={x:Y,y:j},U=u.vectorNorm={x:W.x/q,y:W.y/q},H={x:-U.y,y:U.x};u.nodesOverlap=!M(q)||C.checkPoint(L[0],L[1],0,x,E,v.x,v.y,P,S)||T.checkPoint(z[0],z[1],0,y,b,g.x,g.y,k,B),u.vectorNormInverse=H,e={nodesOverlap:u.nodesOverlap,dirCounts:u.dirCounts,calculatedIntersection:!0,hasBezier:u.hasBezier,hasUnbundled:u.hasUnbundled,eles:u.eles,srcPos:v,srcRs:S,tgtPos:g,tgtRs:B,srcW:x,srcH:E,tgtW:y,tgtH:b,srcIntn:V,tgtIntn:O,srcShape:C,tgtShape:T,posPts:{x1:X.x2,y1:X.y2,x2:X.x1,y2:X.y1},intersectionPts:{x1:F.x2,y1:F.y2,x2:F.x1,y2:F.y1},vector:{x:-W.x,y:-W.y},vectorNorm:{x:-U.x,y:-U.y},vectorNormInverse:{x:-H.x,y:-H.y}}}var K=N?e:u;A.nodesOverlap=K.nodesOverlap,A.srcIntn=K.srcIntn,A.tgtIntn=K.tgtIntn,A.isRound=R.startsWith("round"),r&&(h.isParent()||h.isChild()||f.isParent()||f.isChild())&&(h.parents().anySame(f)||f.parents().anySame(h)||h.same(f)&&h.isParent())?t.findCompoundLoopPoints(_,K,D,I):h===f?t.findLoopPoints(_,K,D,I):R.endsWith("segments")?t.findSegmentsPoints(_,K):R.endsWith("taxi")?t.findTaxiPoints(_,K):"straight"!==R&&(I||u.eles.length%2!=1||D!==Math.floor(u.eles.length/2))?t.findBezierPoints(_,K,D,I,N):t.findStraightEdgePoints(_),t.findEndpoints(_),t.tryToCorrectInvalidPoints(_,K),t.checkForInvalidEdgeWarning(_),t.storeAllpts(_),t.storeEdgeProjections(_),t.calculateArrowAngles(_),t.recalculateEdgeLabelProjections(_),t.calculateLabelAngles(_)}}();this.findHaystackPoints(s)}},lX.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if(this.recalculateRenderedStyle(e),"segments"===t.edgeType)return lj(t.segpts)},lX.getControlPoints=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);var n=t.edgeType;if("bezier"===n||"multibezier"===n||"self"===n||"compound"===n)return lj(t.ctrlpts)},lX.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var lY={};lY.manualEndptToPx=function(e,t){var n=e.position(),r=e.outerWidth(),i=e.outerHeight(),a=e._private.rscratch;if(2===t.value.length){var o=[t.pfValue[0],t.pfValue[1]];return"%"===t.units[0]&&(o[0]=o[0]*r),"%"===t.units[1]&&(o[1]=o[1]*i),o[0]+=n.x,o[1]+=n.y,o}var s=t.pfValue[0];s=-Math.PI/2+s;var l=2*Math.max(r,i),u=[n.x+Math.cos(s)*l,n.y+Math.sin(s)*l];return this.nodeShapes[this.getNodeShape(e)].intersectLine(n.x,n.y,r,i,u[0],u[1],0,"auto"===e.pstyle("corner-radius").value?"auto":e.pstyle("corner-radius").pfValue,a)},lY.findEndpoints=function(e){var t,n,r,i,a,o,s,l,u,c=e.source()[0],d=e.target()[0],h=c.position(),f=d.position(),p=e.pstyle("target-arrow-shape").value,g=e.pstyle("source-arrow-shape").value,v=e.pstyle("target-distance-from-node").pfValue,y=e.pstyle("source-distance-from-node").pfValue,b=c._private.rscratch,x=d._private.rscratch,w=e.pstyle("curve-style").value,E=e._private.rscratch,T=E.edgeType,C=G(w,"taxi"),k="self"===T||"compound"===T,P="bezier"===T||"multibezier"===T||k,S="bezier"!==T,B="straight"===T||"segments"===T,D="segments"===T,_=k||C,A=e.pstyle("source-endpoint"),R=_?"outside-to-node":A.value,I="auto"===c.pstyle("corner-radius").value?"auto":c.pstyle("corner-radius").pfValue,N=e.pstyle("target-endpoint"),L=_?"outside-to-node":N.value,O="auto"===d.pstyle("corner-radius").value?"auto":d.pstyle("corner-radius").pfValue;E.srcManEndpt=A,E.tgtManEndpt=N;var z=null!==(t=(null==N||null===(n=N.pfValue)||void 0===n?void 0:n.length)===2?N.pfValue:null)&&void 0!==t?t:[0,0],V=null!==(r=(null==A||null===(i=A.pfValue)||void 0===i?void 0:i.length)===2?A.pfValue:null)&&void 0!==r?r:[0,0];if(P){var F=[E.ctrlpts[0],E.ctrlpts[1]];o=S?[E.ctrlpts[E.ctrlpts.length-2],E.ctrlpts[E.ctrlpts.length-1]]:F,s=F}else if(B){var X=D?E.segpts.slice(0,2):[f.x+z[0],f.y+z[1]];o=D?E.segpts.slice(E.segpts.length-2):[h.x+V[0],h.y+V[1]],s=X}if("inside-to-node"===L)a=[f.x,f.y];else if(N.units)a=this.manualEndptToPx(d,N);else if("outside-to-line"===L)a=E.tgtIntn;else if("outside-to-node"===L||"outside-to-node-or-label"===L?l=o:("outside-to-line"===L||"outside-to-line-or-label"===L)&&(l=[h.x,h.y]),a=this.nodeShapes[this.getNodeShape(d)].intersectLine(f.x,f.y,d.outerWidth(),d.outerHeight(),l[0],l[1],0,O,x),"outside-to-node-or-label"===L||"outside-to-line-or-label"===L){var j=d._private.rscratch,Y=j.labelWidth,q=j.labelHeight,W=j.labelX,U=j.labelY,H=Y/2,K=q/2,Z=d.pstyle("text-valign").value;"top"===(Z=rJ(Z))?U-=K:"bottom"===Z&&(U+=K);var $=d.pstyle("text-halign").value;"left"===($=rQ($))?W-=H:"right"===$&&(W+=H);var Q=tQ(l[0],l[1],[W-H,U-K,W+H,U-K,W+H,U+K,W-H,U+K],f.x,f.y);if(Q.length>0){var J=tv(h,ta(a)),ee=tv(h,ta(Q)),et=J;ee2&&tv(h,{x:Q[2],y:Q[3]})0){var ep=tv(f,ta(a)),eg=tv(f,ta(ef)),ev=ep;eg2&&tv(f,{x:ef[2],y:ef[3]})=l||b){c={cp:g,segment:y};break}}if(c)break}var x=c.cp,w=c.segment,E=(l-h)/w.length,T=w.t1-w.t0,C=i?w.t0+T*E:w.t1-T*E;C=tw(0,C,1),t=tb(x.p0,x.p1,x.p2,C),u=lH(x.p0,x.p1,x.p2,C);break;case"straight":case"segments":case"haystack":for(var k,P,S,B,D=0,_=r.allpts.length,A=0;A+3<_&&(i?(k={x:r.allpts[A],y:r.allpts[A+1]},P={x:r.allpts[A+2],y:r.allpts[A+3]}):(k={x:r.allpts[_-2-A],y:r.allpts[_-1-A]},P={x:r.allpts[_-4-A],y:r.allpts[_-3-A]}),S=tg(k,P),B=D,!((D+=S)>=l));A+=2);var M=(l-B)/S;t=tx(k,P,M=tw(0,M,1)),u=lG(k,P)}o("labelX",n,t.x),o("labelY",n,t.y),o("labelAutoAngle",n,u)}};l("source"),l("target"),this.applyLabelDimensions(e)}},lW.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},lW.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=eP(r,e._private.labelDimsKey);if(eH(n.rscratch,"prefixedLabelDimsKey",t)!==i){eK(n.rscratch,"prefixedLabelDimsKey",t,i);var a=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,s=e.pstyle("font-size").pfValue,l=e.pstyle("text-wrap").strValue,u=eH(n.rscratch,"labelWrapCachedLines",t)||[],c="wrap"!==l?1:Math.max(u.length,1),d=a.width,h=a.height+(c-1)*(o-1)*s;eK(n.rstyle,"labelWidth",t,d),eK(n.rscratch,"labelWidth",t,d),eK(n.rstyle,"labelHeight",t,h),eK(n.rscratch,"labelHeight",t,h),eK(n.rscratch,"labelLineHeight",t,s*o),eK(n.rscratch,"labelActualDescent",t,a.labelActualDescent)}},lW.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,a=e.pstyle("text-transform").value,s=function(e,r){return r?(eK(n.rscratch,e,t,r),r):eH(n.rscratch,e,t)};if(!i)return"";"none"==a||("uppercase"==a?i=i.toUpperCase():"lowercase"==a&&(i=i.toLowerCase()));var l=e.pstyle("text-wrap").value;if("wrap"===l){var u=s("labelKey");if(null!=u&&s("labelWrapKey")===u)return s("labelWrapCachedText");for(var c=i.split("\n"),d=e.pstyle("text-max-width").pfValue,h="anywhere"===e.pstyle("text-overflow-wrap").value,f=[],p=/[\s\u200b]+|$/g,g=0;gd){var b,x=v.matchAll(p),w="",E=0,T=o(x);try{for(T.s();!(b=T.n()).done;){var C=b.value,k=C[0],P=v.substring(E,C.index);E=C.index+k.length;var S=0===w.length?P:w+P+k;this.calculateLabelDimensions(e,S).width<=d?w+=P+k:(w&&f.push(w),w=P+k)}}catch(e){T.e(e)}finally{T.f()}w.match(/^[\s\u200b]+$/)||f.push(w)}else f.push(v)}s("labelWrapCachedLines",f),i=s("labelWrapCachedText",f.join("\n")),s("labelWrapKey",u)}else if("ellipsis"===l){var B=e.pstyle("text-max-width").pfValue,D="",_=!1;if(this.calculateLabelDimensions(e,i).widthB);A++)D+=i[A],A===i.length-1&&(_=!0);return _||(D+="…"),D}return i},lW.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;return"auto"!==t?t:e.isNode()?r0(n):"center"},lW.calculateLabelDimensions=function(e,t){var n=this.cy.window().document,r=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue,a=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,s=e.pstyle("text-metrics").strValue||"font",l=this.labelCalcCanvas,u=this.labelCalcCanvasContext;if(!l){l=this.labelCalcCanvas=n.createElement("canvas"),u=this.labelCalcCanvasContext=l.getContext("2d");var c=l.style;c.position="absolute",c.left="-9999px",c.top="-9999px",c.zIndex="-1",c.visibility="hidden",c.pointerEvents="none"}u.font="".concat(r," ").concat(o," ").concat(i,"px ").concat(a);for(var d=0,h=0,f=t.split("\n"),p=f.length,g=0,v=0,y=0;ye.width()||28>e.height()))return lZ||(eV("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),lZ=!0),"rectangle";if(e.isParent())return"rectangle"===t||"roundrectangle"===t||"round-rectangle"===t||"cutrectangle"===t||"cut-rectangle"===t||"barrel"===t?t:"rectangle";if("polygon"===t){var n=e.pstyle("shape-polygon-points").value;return this.nodeShapes.makePolygon(n).name}return t};var l$={};l$.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),n=this,r=function(e){var n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(t.merge(e),n)for(var r=0;r=k.desktopTapThreshold2}var v=D(e);E&&(k.hoverData.tapholdCancelled=!0),t=!0,B(u,["mousemove","vmousemove","tapdrag"],e,{x:a[0],y:a[1]});var y=function(t){return{originalEvent:e,type:t,position:{x:a[0],y:a[1]}}},b=function(){k.data.bgActivePosistion=void 0,k.hoverData.selecting||n.emit(y("boxstart")),l[4]=1,k.hoverData.selecting=!0,k.redrawHint("select",!0),k.redraw()};if(3===k.hoverData.which){if(E){var x=y("cxtdrag");d?d.emit(x):n.emit(x),k.hoverData.cxtDragged=!0,(!k.hoverData.cxtOver||u!==k.hoverData.cxtOver)&&(k.hoverData.cxtOver&&k.hoverData.cxtOver.emit(y("cxtdragout")),k.hoverData.cxtOver=u,u&&u.emit(y("cxtdragover")))}}else if(k.hoverData.dragging){if(t=!0,n.panningEnabled()&&n.userPanningEnabled()){if(k.hoverData.justStartedPan){var w=k.hoverData.mdownPos;T={x:(a[0]-w[0])*r,y:(a[1]-w[1])*r},k.hoverData.justStartedPan=!1}else T={x:h[0]*r,y:h[1]*r};n.panBy(T),n.emit(y("dragpan")),k.hoverData.dragged=!0}a=k.projectIntoViewport(e.clientX,e.clientY)}else if(1==l[4]&&(null==d||d.pannable()))E&&(!k.hoverData.dragging&&n.boxSelectionEnabled()&&(v||!n.panningEnabled()||!n.userPanningEnabled())?b():!k.hoverData.selecting&&n.panningEnabled()&&n.userPanningEnabled()&&_(d,k.hoverData.downs)&&(k.hoverData.dragging=!0,k.hoverData.justStartedPan=!0,l[4]=0,k.data.bgActivePosistion=ta(o),k.redrawHint("select",!0),k.redraw()),d&&d.pannable()&&d.active()&&d.unactivate());else{if(d&&d.pannable()&&d.active()&&d.unactivate(),d&&d.grabbed()||u==c||(c&&B(c,["mouseout","tapdragout"],e,{x:a[0],y:a[1]}),u&&B(u,["mouseover","tapdragover"],e,{x:a[0],y:a[1]}),k.hoverData.last=u),d){if(E){if(n.boxSelectionEnabled()&&v)d&&d.grabbed()&&(V(f),d.emit(y("freeon")),f.emit(y("free")),k.dragData.didDrag&&(d.emit(y("dragfreeon")),f.emit(y("dragfree")))),b();else if(d&&d.grabbed()&&k.nodeIsDraggable(d)){var E,T,C,P=!k.dragData.didDrag;P&&k.redrawHint("eles",!0),k.dragData.didDrag=!0,k.hoverData.draggingEles||z(f,{inDragLayer:!0});var S={x:0,y:0};if(M(h[0])&&M(h[1])&&(S.x+=h[0],S.y+=h[1],P)){var A=k.hoverData.dragDelta;A&&M(A[0])&&M(A[1])&&(S.x+=A[0],S.y+=A[1])}k.hoverData.draggingEles=!0,f.silentShift(S).emit(y("position")).emit(y("drag")),k.redrawHint("drag",!0),k.redraw()}}else 0===(C=k.hoverData.dragDelta=k.hoverData.dragDelta||[]).length?(C.push(h[0]),C.push(h[1])):(C[0]+=h[0],C[1]+=h[1])}t=!0}if(l[2]=a[0],l[3]=a[1],t)return e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),!1}},!1),k.registerBinding(P,"mouseup",function(r){if((1!==k.hoverData.which||1===r.which||!k.hoverData.capture)&&k.hoverData.capture){k.hoverData.capture=!1;var i=k.cy,a=k.projectIntoViewport(r.clientX,r.clientY),o=k.selection,s=k.findNearestElement(a[0],a[1],!0,!1),l=k.dragData.possibleDragElements,u=k.hoverData.down,c=D(r);k.data.bgActivePosistion&&(k.redrawHint("select",!0),k.redraw()),k.hoverData.tapholdCancelled=!0,k.data.bgActivePosistion=void 0,u&&u.unactivate();var d=function(e){return{originalEvent:r,type:e,position:{x:a[0],y:a[1]}}};if(3===k.hoverData.which){var h=d("cxttapend");if(u?u.emit(h):i.emit(h),!k.hoverData.cxtDragged){var f=d("cxttap");u?u.emit(f):i.emit(f)}k.hoverData.cxtDragged=!1,k.hoverData.which=null}else if(1===k.hoverData.which){if(B(s,["mouseup","tapend","vmouseup"],r,{x:a[0],y:a[1]}),k.dragData.didDrag||k.hoverData.dragged||k.hoverData.selecting||k.hoverData.isOverThresholdDrag||(B(u,["click","tap","vclick"],r,{x:a[0],y:a[1]}),t=!1,r.timeStamp-n<=i.multiClickDebounceTime()?(e&&clearTimeout(e),t=!0,n=null,B(u,["dblclick","dbltap","vdblclick"],r,{x:a[0],y:a[1]})):(e=setTimeout(function(){t||B(u,["oneclick","onetap","voneclick"],r,{x:a[0],y:a[1]})},i.multiClickDebounceTime()),n=r.timeStamp)),null!=u||k.dragData.didDrag||k.hoverData.selecting||k.hoverData.dragged||D(r)||(i.$(S).unselect(["tapunselect"]),l.length>0&&k.redrawHint("eles",!0),k.dragData.possibleDragElements=l=i.collection()),s!=u||k.dragData.didDrag||k.hoverData.selecting||null==s||!s._private.selectable||(k.hoverData.dragging||("additive"===i.selectionType()||c?s.selected()?s.unselect(["tapunselect"]):s.select(["tapselect"]):c||(i.$(S).unmerge(s).unselect(["tapunselect"]),s.select(["tapselect"]))),k.redrawHint("eles",!0)),k.hoverData.selecting){var p=i.collection(k.getAllInBox(o[0],o[1],o[2],o[3]));k.redrawHint("select",!0),p.length>0&&k.redrawHint("eles",!0),i.emit(d("boxend")),"additive"!==i.selectionType()&&(c||i.$(S).unmerge(p).unselect()),p.emit(d("box")).stdFilter(function(e){return e.selectable()&&!e.selected()}).select().emit(d("boxselect")),k.redraw()}if(k.hoverData.dragging&&(k.hoverData.dragging=!1,k.redrawHint("select",!0),k.redrawHint("eles",!0),k.redraw()),!o[4]){k.redrawHint("drag",!0),k.redrawHint("eles",!0);var g=u&&u.grabbed();V(l),g&&(u.emit(d("freeon")),l.emit(d("free")),k.dragData.didDrag&&(u.emit(d("dragfreeon")),l.emit(d("dragfree"))))}}o[4]=0,k.hoverData.down=null,k.hoverData.cxtStarted=!1,k.hoverData.draggingEles=!1,k.hoverData.selecting=!1,k.hoverData.isOverThresholdDrag=!1,k.dragData.didDrag=!1,k.hoverData.dragged=!1,k.hoverData.dragDelta=[],k.hoverData.mdownPos=null,k.hoverData.mdownGPos=null,k.hoverData.which=null}},!1);var H=[],K=1e5,Z=function(e){for(var t=Math.abs(e[0]),n=1;n=4?(r=!1,H[0]>=5&&(u=Z(H)?H[0]:td(H))>1&&(r=!0,K=u)):(H.push(Math.abs(n)),t=!0):r&&(K=Math.min(Math.abs(n),K)),!k.scrollingPage)){var i=k.cy,a=i.zoom(),o=i.pan(),s=k.projectIntoViewport(e.clientX,e.clientY),l=[s[0]*a+o.x,s[1]*a+o.y];if(k.hoverData.draggingEles||k.hoverData.dragging||k.hoverData.cxtStarted||0!==k.selection[4]){e.preventDefault();return}if(i.panningEnabled()&&i.userPanningEnabled()&&i.zoomingEnabled()&&i.userZoomingEnabled()){e.preventDefault(),k.data.wheelZooming=!0,clearTimeout(k.data.wheelTimeout),k.data.wheelTimeout=setTimeout(function(){k.data.wheelZooming=!1,k.redrawHint("eles",!0),k.redraw()},150),t&&Math.abs(n)>5&&(n=5*tp(n)),c=-(n/250),r&&(c/=K,c*=3),c*=k.wheelSensitivity,1===e.deltaMode&&(c*=33);var u,c,d=i.zoom()*Math.pow(10,c);"gesturechange"===e.type&&(d=k.gestureStartZoom*e.scale),i.zoom({level:d,renderedPosition:{x:l[0],y:l[1]}}),i.emit({type:"gesturechange"===e.type?"pinchzoom":"scrollzoom",originalEvent:e,position:{x:s[0],y:s[1]}})}}};k.registerBinding(k.container,"wheel",$,!0),k.registerBinding(P,"scroll",function(e){k.scrollingPage=!0,clearTimeout(k.scrollingPageTimeout),k.scrollingPageTimeout=setTimeout(function(){k.scrollingPage=!1},250)},!0),k.registerBinding(k.container,"gesturestart",function(e){k.gestureStartZoom=k.cy.zoom(),k.hasTouchStarted||e.preventDefault()},!0),k.registerBinding(k.container,"gesturechange",function(e){k.hasTouchStarted||$(e)},!0),k.registerBinding(k.container,"mouseout",function(e){var t=k.projectIntoViewport(e.clientX,e.clientY);k.cy.emit({originalEvent:e,type:"mouseout",position:{x:t[0],y:t[1]}})},!1),k.registerBinding(k.container,"mouseover",function(e){var t=k.projectIntoViewport(e.clientX,e.clientY);k.cy.emit({originalEvent:e,type:"mouseover",position:{x:t[0],y:t[1]}})},!1);var Q=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},J=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(k.registerBinding(k.container,"touchstart",y=function(e){if(k.hasTouchStarted=!0,U(e)){X(),k.touchData.capture=!0,k.data.bgActivePosistion=void 0;var t=k.cy,n=k.touchData.now,r=k.touchData.earlier;if(e.touches[0]){var y=k.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);n[0]=y[0],n[1]=y[1]}if(e.touches[1]){var y=k.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);n[2]=y[0],n[3]=y[1]}if(e.touches[2]){var y=k.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);n[4]=y[0],n[5]=y[1]}var b=function(t){return{originalEvent:e,type:t,position:{x:n[0],y:n[1]}}};if(e.touches[1]){k.touchData.singleTouchMoved=!0,V(k.dragData.touchDragEles);var x=k.findContainerClientCoords();h=x[0],f=x[1],p=x[2],g=x[3],i=e.touches[0].clientX-h,a=e.touches[0].clientY-f,o=e.touches[1].clientX-h,s=e.touches[1].clientY-f,v=0<=i&&i<=p&&0<=o&&o<=p&&0<=a&&a<=g&&0<=s&&s<=g;var w=t.pan(),E=t.zoom();if(l=Q(i,a,o,s),u=J(i,a,o,s),d=[((c=[(i+o)/2,(a+s)/2])[0]-w.x)/E,(c[1]-w.y)/E],u<4e4&&!e.touches[2]){var T=k.findNearestElement(n[0],n[1],!0,!0),C=k.findNearestElement(n[2],n[3],!0,!0);T&&T.isNode()?(T.activate().emit(b("cxttapstart")),k.touchData.start=T):C&&C.isNode()?(C.activate().emit(b("cxttapstart")),k.touchData.start=C):t.emit(b("cxttapstart")),k.touchData.start&&(k.touchData.start._private.grabbed=!1),k.touchData.cxt=!0,k.touchData.cxtDragged=!1,k.data.bgActivePosistion=void 0,k.redraw();return}}if(e.touches[2])t.boxSelectionEnabled()&&e.preventDefault();else if(e.touches[1]);else if(e.touches[0]){var P=k.findNearestElements(n[0],n[1],!0,!0),S=P[0];if(null!=S&&(S.activate(),k.touchData.start=S,k.touchData.starts=P,k.nodeIsGrabbable(S))){var D=k.dragData.touchDragEles=t.collection(),_=null;k.redrawHint("eles",!0),k.redrawHint("drag",!0),S.selected()?z(_=t.$(function(e){return e.selected()&&k.nodeIsGrabbable(e)}),{addToList:D}):z(S,{addToList:D}),I(S),S.emit(b("grabon")),_?_.forEach(function(e){e.emit(b("grab"))}):S.emit(b("grab"))}B(S,["touchstart","tapstart","vmousedown"],e,{x:n[0],y:n[1]}),null==S&&(k.data.bgActivePosistion={x:y[0],y:y[1]},k.redrawHint("select",!0),k.redraw()),k.touchData.singleTouchMoved=!1,k.touchData.singleTouchStartTime=+new Date,clearTimeout(k.touchData.tapholdTimeout),k.touchData.tapholdTimeout=setTimeout(function(){!1!==k.touchData.singleTouchMoved||k.pinching||k.touchData.selecting||B(k.touchData.start,["taphold"],e,{x:n[0],y:n[1]})},k.tapholdDuration)}if(e.touches.length>=1){for(var A=k.touchData.startPosition=[null,null,null,null,null,null],M=0;M=k.touchTapThreshold2}if(t&&k.touchData.cxt){e.preventDefault();var S=e.touches[0].clientX-h,D=e.touches[0].clientY-f,A=e.touches[1].clientX-h,R=e.touches[1].clientY-f,I=J(S,D,A,R);if(I/u>=2.25||I>=22500){k.touchData.cxt=!1,k.data.bgActivePosistion=void 0,k.redrawHint("select",!0);var N=b("cxttapend");k.touchData.start?(k.touchData.start.unactivate().emit(N),k.touchData.start=null):r.emit(N)}}if(t&&k.touchData.cxt){var N=b("cxtdrag");k.data.bgActivePosistion=void 0,k.redrawHint("select",!0),k.touchData.start?k.touchData.start.emit(N):r.emit(N),k.touchData.start&&(k.touchData.start._private.grabbed=!1),k.touchData.cxtDragged=!0;var L=k.findNearestElement(c[0],c[1],!0,!0);(!k.touchData.cxtOver||L!==k.touchData.cxtOver)&&(k.touchData.cxtOver&&k.touchData.cxtOver.emit(b("cxtdragout")),k.touchData.cxtOver=L,L&&L.emit(b("cxtdragover")))}else if(t&&e.touches[2]&&r.boxSelectionEnabled())e.preventDefault(),k.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,k.touchData.selecting||r.emit(b("boxstart")),k.touchData.selecting=!0,k.touchData.didSelect=!0,n[4]=1,n&&0!==n.length&&void 0!==n[0]?(n[2]=(c[0]+c[2]+c[4])/3,n[3]=(c[1]+c[3]+c[5])/3):(n[0]=(c[0]+c[2]+c[4])/3,n[1]=(c[1]+c[3]+c[5])/3,n[2]=(c[0]+c[2]+c[4])/3+1,n[3]=(c[1]+c[3]+c[5])/3+1),k.redrawHint("select",!0),k.redraw();else if(t&&e.touches[1]&&!k.touchData.didSelect&&r.zoomingEnabled()&&r.panningEnabled()&&r.userZoomingEnabled()&&r.userPanningEnabled()){e.preventDefault(),k.data.bgActivePosistion=void 0,k.redrawHint("select",!0);var O=k.dragData.touchDragEles;if(O){k.redrawHint("drag",!0);for(var F=0;F0&&!k.hoverData.draggingEles&&!k.swipePanning&&null!=k.data.bgActivePosistion&&(k.data.bgActivePosistion=void 0,k.redrawHint("select",!0),k.redraw())}},!1),k.registerBinding(P,"touchcancel",x=function(e){var t=k.touchData.start;k.touchData.capture=!1,t&&t.unactivate()}),k.registerBinding(P,"touchend",w=function(e){var t,n=k.touchData.start;if(k.touchData.capture){0===e.touches.length&&(k.touchData.capture=!1),e.preventDefault();var r=k.selection;k.swipePanning=!1,k.hoverData.draggingEles=!1;var i=k.cy,a=i.zoom(),o=k.touchData.now,s=k.touchData.earlier;if(e.touches[0]){var l=k.projectIntoViewport(e.touches[0].clientX,e.touches[0].clientY);o[0]=l[0],o[1]=l[1]}if(e.touches[1]){var l=k.projectIntoViewport(e.touches[1].clientX,e.touches[1].clientY);o[2]=l[0],o[3]=l[1]}if(e.touches[2]){var l=k.projectIntoViewport(e.touches[2].clientX,e.touches[2].clientY);o[4]=l[0],o[5]=l[1]}var u=function(t){return{originalEvent:e,type:t,position:{x:o[0],y:o[1]}}};if(n&&n.unactivate(),k.touchData.cxt){if(t=u("cxttapend"),n?n.emit(t):i.emit(t),!k.touchData.cxtDragged){var c=u("cxttap");n?n.emit(c):i.emit(c)}k.touchData.start&&(k.touchData.start._private.grabbed=!1),k.touchData.cxt=!1,k.touchData.start=null,k.redraw();return}if(!e.touches[2]&&i.boxSelectionEnabled()&&k.touchData.selecting){k.touchData.selecting=!1;var d=i.collection(k.getAllInBox(r[0],r[1],r[2],r[3]));r[0]=void 0,r[1]=void 0,r[2]=void 0,r[3]=void 0,r[4]=0,k.redrawHint("select",!0),i.emit(u("boxend")),d.emit(u("box")).stdFilter(function(e){return e.selectable()&&!e.selected()}).select().emit(u("boxselect")),d.nonempty()&&k.redrawHint("eles",!0),k.redraw()}if(null!=n&&n.unactivate(),e.touches[2])k.data.bgActivePosistion=void 0,k.redrawHint("select",!0);else if(e.touches[1]);else if(e.touches[0]);else if(!e.touches[0]){k.data.bgActivePosistion=void 0,k.redrawHint("select",!0);var h=k.dragData.touchDragEles;if(null!=n){var f=n._private.grabbed;V(h),k.redrawHint("drag",!0),k.redrawHint("eles",!0),f&&(n.emit(u("freeon")),h.emit(u("free")),k.dragData.didDrag&&(n.emit(u("dragfreeon")),h.emit(u("dragfree")))),B(n,["touchend","tapend","vmouseup","tapdragout"],e,{x:o[0],y:o[1]}),n.unactivate(),k.touchData.start=null}else B(k.findNearestElement(o[0],o[1],!0,!0),["touchend","tapend","vmouseup","tapdragout"],e,{x:o[0],y:o[1]});var p=k.touchData.startPosition[0]-o[0],g=k.touchData.startPosition[1]-o[1];k.touchData.singleTouchMoved||(n||i.$(":selected").unselect(["tapunselect"]),B(n,["tap","vclick"],e,{x:o[0],y:o[1]}),E=!1,e.timeStamp-C<=i.multiClickDebounceTime()?(T&&clearTimeout(T),E=!0,C=null,B(n,["dbltap","vdblclick"],e,{x:o[0],y:o[1]})):(T=setTimeout(function(){E||B(n,["onetap","voneclick"],e,{x:o[0],y:o[1]})},i.multiClickDebounceTime()),C=e.timeStamp)),null!=n&&!k.dragData.didDrag&&n._private.selectable&&(p*p+g*g)*a*afunction(e){for(var t=0,n=0;nMath.abs(c))return n(e,i(l,.5));var d=a(r(o,e),u)/c;return n(e,i(l,d))}(v.p1,v.p2,y.p1,y.p2);p.push(b)}return p}(t$(this.points,e,t,n,r),i),s=tE(),o.forEach(function(e){return tk(s,e.x,e.y)}),s}}},l4.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,r,i,a){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,a,o,s){return tU(i,a,e,t,n/2+o,r/2+o)},checkPoint:function(e,t,n,r,i,a,o,s){return tG(e,t,r,i,a,o,n)}}},l4.generateRoundPolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,getOrCreateCorners:function(e,n,r,i,a,o,s){if(void 0!==o[s]&&o[s+"-cx"]===e&&o[s+"-cy"]===n&&o[s+"-w"]===r&&o[s+"-h"]===i&&o[s+"-corner-radius"]===a)return o[s];o[s]=Array(t.length/2),o[s+"-cx"]=e,o[s+"-cy"]=n,o[s+"-w"]=r,o[s+"-h"]=i,o[s+"-corner-radius"]=a;var l=r/2,u=i/2;a="auto"===a?t4(r,i):a;for(var c=Array(t.length/2),d=0;d0)return f[0]}return null}(e,t,p);if(null!=g){var v=tm(p[5],p[3],p[1],g);if(p.isTop&&v<=t||p.isBottom&&t<=v)return!0}}return!1}}},l4.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:t1(4,0),draw:function(e,t,n,r,i,a){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i,this.points,a)},intersectLine:function(e,t,n,r,i,a,o,s){var l=e-(n/2+o),u=t-(r/2+o),c=e+(n/2+o),d=tZ(i,a,e,t,l,u,c,u,!1);return d.length>0?d:tI(i,a,e,t,n,r,o,s)},checkPoint:function(e,t,n,r,i,a,o,s){var l=2*(s="auto"===s?t3(r,i):s);if(tj(e,t,this.points,a,o,r,i-l,[0,-1],n)||tj(e,t,this.points,a,o,r-l,i,[0,-1],n))return!0;var u=r/2+2*n,c=i/2+2*n;return!!(tX(e,t,[a-u,o-c,a-u,o,a+u,o,a+u,o-c])||tG(e,t,l,l,a+r/2-s,o+i/2-s,n)||tG(e,t,l,l,a-r/2+s,o+i/2-s,n))}}},l4.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",t1(3,0)),this.generateRoundPolygon("round-triangle",t1(3,0)),this.generatePolygon("rectangle",t1(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",t1(5,0)),this.generateRoundPolygon("round-pentagon",t1(5,0)),this.generatePolygon("hexagon",t1(6,0)),this.generateRoundPolygon("round-hexagon",t1(6,0)),this.generatePolygon("heptagon",t1(7,0)),this.generateRoundPolygon("round-heptagon",t1(7,0)),this.generatePolygon("octagon",t1(8,0)),this.generateRoundPolygon("round-octagon",t1(8,0));var r=Array(20),i=t5(5,0),a=t5(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;st.className.indexOf(o)&&(t.className=(t.className||"")+" "+o),!s){var l=r.createElement("style");l.id=a,l.textContent="."+o+" { position: relative; }",i.insertBefore(l,i.children[0])}"static"===n.getComputedStyle(t).getPropertyValue("position")&&eV("A Cytoscape container has style position:static and so can not use UI extensions properly")}this.selection=[void 0,void 0,void 0,void 0,0],this.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],this.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},this.dragData={possibleDragElements:[]},this.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},this.redraws=0,this.showFps=e.showFps,this.debug=e.debug,this.webgl=e.webgl,this.hideEdgesOnViewport=e.hideEdgesOnViewport,this.textureOnViewport=e.textureOnViewport,this.wheelSensitivity=e.wheelSensitivity,this.motionBlurEnabled=e.motionBlur,this.forcedPixelRatio=M(e.pixelRatio)?e.pixelRatio:null,this.motionBlur=e.motionBlur,this.motionBlurOpacity=e.motionBlurOpacity,this.motionBlurTransparency=1-this.motionBlurOpacity,this.motionBlurPxRatio=1,this.mbPxRBlurry=1,this.minMbLowQualFrames=4,this.fullQualityMb=!1,this.clearedForMotionBlur=[],this.desktopTapThreshold=e.desktopTapThreshold,this.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,this.touchTapThreshold=e.touchTapThreshold,this.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,this.tapholdDuration=500,this.bindings=[],this.beforeRenderCallbacks=[],this.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},this.registerNodeShapes(),this.registerArrowShapes(),this.registerCalculationListeners()},l7.notify=function(e,t){var n=this.cy;if(!this.destroyed){if("init"===e){this.load();return}if("destroy"===e){this.destroy();return}("add"===e||"remove"===e||"move"===e&&n.hasCompoundNodes()||"load"===e||"zorder"===e||"mount"===e)&&this.invalidateCachedZSortedEles(),"viewport"===e&&this.redrawHint("select",!0),"gc"===e&&this.redrawHint("gc",!0),("load"===e||"resize"===e||"mount"===e)&&(this.invalidateContainerClientCoordsCache(),this.matchCanvasSize(this.container)),this.redrawHint("eles",!0),this.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},l7.destroy=function(){this.destroyed=!0,this.cy.stopAnimationLoop();for(var e=0;e=e.deqFastCost*g)break}else if(i){if(f>=e.deqCost*l||f>=e.deqAvgCost*s)break}else if(p>=e.deqNoDrawCost*ue)break;var v=e.deq(t,d,c);if(v.length>0)for(var y=0;y0&&(e.onDeqd(t,u),!i&&e.shouldRedraw(t,u,d,c)&&r())},i(t))}}},un=a(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eI;i(this,e),this.idsByKey=new e$,this.keyForId=new e$,this.cachesByLvl=new e$,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n},[{key:"getIdsFor",value:function(e){null==e&&eO("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new eJ,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new e$,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach(function(n){return t.deleteCache(e,n)})}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),ur={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},ui=eq({getKey:null,doesEleInvalidateKey:eI,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:eR,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ua=function(e,t){this.renderer=e,this.onDequeues=[];var n=ui(t);ee(this,n),this.lookup=new un(n.getKey,n.doesEleInvalidateKey),this.setupDequeueing()},uo=ua.prototype;uo.reasons=ur,uo.getTextureQueue=function(e){return this.eleImgCaches=this.eleImgCaches||{},this.eleImgCaches[e]=this.eleImgCaches[e]||[]},uo.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},uo.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new e4(function(e,t){return t.reqs-e.reqs})},uo.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},uo.getElement=function(e,t,n,r,i){var a,o,s,l=this,u=this.renderer,c=u.cy.zoom(),d=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()||!l.allowEdgeTxrCaching&&e.isEdge()||!l.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(tf(c*n))),r<-4)r=-4;else if(c>=7.99||r>3)return null;var h=Math.pow(2,r),f=t.h*h,p=t.w*h,g=u.eleTextBiggerThanMin(e,h);if(!this.isVisible(e,g))return null;var v=d.get(e,r);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;if(a=f<=25?25:f<=50?50:50*Math.ceil(f/50),f>1024||p>1024)return null;var y=l.getTextureQueue(a),b=y[y.length-2],x=function(){return l.recycleTexture(a,p)||l.addTexture(a,p)};b||(b=y[y.length-1]),b||(b=x()),b.width-b.usedWidthr;D--)S=l.getElement(e,t,n,D,ur.downscale);B()}else{if(!E&&!T&&!C)for(var _=r-1;_>=-4;_--){var A=d.get(e,_);if(A){s=A;break}}if(w(s))return l.queueElement(e,r),s;b.context.translate(b.usedWidth,0),b.context.scale(h,h),this.drawElement(b.context,e,t,g,!1),b.context.scale(1/h,1/h),b.context.translate(-b.usedWidth,0)}return v={x:b.usedWidth,texture:b,level:r,scale:h,width:p,height:f,scaledLabelShown:g},b.usedWidth+=Math.ceil(p+8),b.eleCaches.push(v),d.set(e,r,v),l.checkTextureFullness(b),v},uo.invalidateElements=function(e){for(var t=0;t=.2*e.width&&this.retireTexture(e)},uo.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?eW(t,e):e.fullnessChecks++},uo.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;eW(n,e),e.retired=!0;for(var i=e.eleCaches,a=0;a=t)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,eU(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),eW(r,a),n.push(a),a}},uo.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),a=r[i];if(a)a.level=Math.max(a.level,t),a.eles.merge(e),a.reqs++,n.updateItem(a);else{var o={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(o),r[i]=o}},uo.dequeue=function(e){for(var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=[],i=this.lookup,a=0;a<1;a++)if(t.size()>0){var o=t.pop(),s=o.key,l=o.eles[0],u=i.hasCache(l,o.level);if(n[s]=null,u)continue;r.push(o);var c=this.getBoundingBox(l);this.getElement(l,c,e,o.level,ur.dequeue)}else break;return r},uo.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=eM,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},uo.onDequeue=function(e){this.onDequeues.push(e)},uo.offDequeue=function(e){eW(this.onDequeues,e)},uo.setupDequeueing=ut({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=3.99||n>2)return null}a.validateLayersElesOrdering(n,e);var l=a.layersByLevel,u=Math.pow(2,n),c=l[n]=l[n]||[];if(a.levelIsComplete(n,e))return c;!function(){var t=function(t){if(a.validateLayersElesOrdering(t,e),a.levelIsComplete(t,e))return i=l[t],!0},r=function(e){if(!i)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};r(1),r(-1);for(var o=c.length-1;o>=0;o--){var s=c[o];s.invalid&&eW(c,s)}}();var d=function(){if(!r){r=tE();for(var t=0;t=f||!tM(h.bb,v.boundingBox()))&&!(h=function(e){var t=(e=e||{}).after;d();var i=Math.ceil(r.w*u),o=Math.ceil(r.h*u);if(i>32767||o>32767||i*o>16e6)return null;var s=a.makeLayer(r,n);if(null!=t){var l=c.indexOf(t)+1;c.splice(l,0,s)}else(void 0===e.insert||e.insert)&&c.unshift(s);return s}({insert:!0,after:h})))return null;i||p?a.queueLayer(h,v):a.drawEleInLayer(h,v,n,t),h.eles.push(v),b[n]=h}return i||(p?null:c)},ul.getEleLevelForLayerLevel=function(e,t){return e},ul.drawEleInLayer=function(e,t,n,r){var i=this.renderer,a=e.context,o=t.boundingBox();0!==o.w&&0!==o.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(a,!1),i.drawCachedElement(a,t,null,null,n,!0),i.setImgSmoothing(a,!0))},ul.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i0||a.invalid)return!1;r+=a.eles.length}return r===t.length},ul.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r0){e=!0;break}}return e},ul.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=ey(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,function(e,n,r){t.invalidateLayer(e)}))},ul.invalidateLayer=function(e){if(this.lastInvalidationTime=ey(),!e.invalid){var t=e.level,n=e.eles;eW(this.layersByLevel[t],e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var r=0;r3)||void 0===arguments[3]||arguments[3],a=!(arguments.length>4)||void 0===arguments[4]||arguments[4],o=!(arguments.length>5)||void 0===arguments[5]||arguments[5],s=this,l=t._private.rscratch;if(!(o&&!t.visible()||l.badLine||null==l.allpts||isNaN(l.allpts[0]))){n&&(r=n,e.translate(-r.x1,-r.y1));var u=o?t.pstyle("opacity").value:1,c=o?t.pstyle("line-opacity").value:1,d=t.pstyle("curve-style").value,h=t.pstyle("line-style").value,f=t.pstyle("width").pfValue,p=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,v=t.pstyle("line-outline-color").value,y=u*c,b=u*c,x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;"straight-triangle"===d?(s.eleStrokeStyle(e,t,n),s.drawEdgeTrianglePath(t,e,l.allpts)):(e.lineWidth=f,e.lineCap=p,s.eleStrokeStyle(e,t,n),s.drawEdgePath(t,e,l.allpts,h),e.lineCap="butt")},w=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b;s.drawArrowheads(e,t,n)};if(e.lineJoin="round","yes"===t.pstyle("ghost").value){var E=t.pstyle("ghost-offset-x").pfValue,T=t.pstyle("ghost-offset-y").pfValue,C=y*t.pstyle("ghost-opacity").value;e.translate(E,T),x(C),w(C),e.translate(-E,-T)}else!function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;if(e.lineWidth=f+g,e.lineCap=p,g>0)s.colorStrokeStyle(e,v[0],v[1],v[2],n);else{e.lineCap="butt";return}"straight-triangle"===d?s.drawEdgeTrianglePath(t,e,l.allpts):(s.drawEdgePath(t,e,l.allpts,h),e.lineCap="butt")}();a&&s.drawEdgeUnderlay(e,t),x(),w(),a&&s.drawEdgeOverlay(e,t),s.drawElementText(e,t,null,i),n&&e.translate(r.x1,r.y1)}};var uC=function(e){if(!["overlay","underlay"].includes(e))throw Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this.usePaths(),a=n._private.rscratch,o=n.pstyle("".concat(e,"-padding")).pfValue,s=n.pstyle("".concat(e,"-color")).value;t.lineWidth=2*o,"self"!==a.edgeType||i?t.lineCap="round":t.lineCap="butt",this.colorStrokeStyle(t,s[0],s[1],s[2],r),this.drawEdgePath(n,t,a.allpts,"solid")}}}};uT.drawEdgeOverlay=uC("overlay"),uT.drawEdgeUnderlay=uC("underlay"),uT.drawEdgePath=function(e,t,n,r){var i=e._private.rscratch,a=t,s=!1,l=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(l){var d=n.join("$");i.pathCacheKey&&i.pathCacheKey===d?(p=t=i.pathCache,s=!0):(p=t=new Path2D,i.pathCacheKey=d,i.pathCache=p)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=c;break;case"solid":a.setLineDash([])}if(!s&&!i.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+35&&void 0!==arguments[5]?arguments[5]:5,o=Math.min(a,r/2,i/2);e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath()}uP.eleTextBiggerThanMin=function(e,t){return t||(t=Math.pow(2,Math.ceil(tf(e.cy().zoom()*this.getPixelRatio())))),!(e.pstyle("font-size").pfValue*t5)||void 0===arguments[5]||arguments[5];if(null==r){if(o&&!this.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=this.getLabelJustification(t),u="glyph"===t.pstyle("text-metrics").strValue;e.textAlign=l,e.textBaseline=u?"alphabetic":"bottom"}else{var c=t.element()._private.rscratch.badLine,d=t.pstyle("label"),h=t.pstyle("source-label"),f=t.pstyle("target-label");if(c||(!d||!d.value)&&(!h||!h.value)&&(!f||!f.value))return;e.textAlign="center",e.textBaseline="bottom"}var p=!n;n&&(a=n,e.translate(-a.x1,-a.y1)),null==i?(this.drawText(e,t,null,p,o),t.isEdge()&&(this.drawText(e,t,"source",p,o),this.drawText(e,t,"target",p,o))):this.drawText(e,t,i,p,o),n&&e.translate(a.x1,a.y1)},uP.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n2)||void 0===arguments[2]||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",a=t.pstyle("font-family").strValue,o=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,u=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+o+" "+i+" "+a,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],l)},uP.getTextAngle=function(e,t){var n,r=e._private.rscratch,i=t?t+"-":"",a=e.pstyle(i+"text-rotation");if("autorotate"===a.strValue){var o=eH(r,"labelAngle",t);n=e.isEdge()?o:0}else n="none"===a.strValue?0:a.pfValue;return n},uP.drawText=function(e,t,n){var r=!(arguments.length>3)||void 0===arguments[3]||arguments[3],i=!(arguments.length>4)||void 0===arguments[4]||arguments[4],a=t._private.rscratch,o=i?t.effectiveOpacity():1;if(!i||0!==o&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var s=eH(a,"labelX",n),l=eH(a,"labelY",n),u=this.getLabelText(t,n);if(null!=u&&""!==u&&!isNaN(s)&&!isNaN(l)){this.setupTextStyle(e,t,i);var c,d,h,f=n?n+"-":"",p=eH(a,"labelWidth",n),g=eH(a,"labelHeight",n),v=eH(a,"labelActualDescent",n),y=t.pstyle(f+"text-margin-x").pfValue,b=t.pstyle(f+"text-margin-y").pfValue,x=t.isEdge(),w=t.pstyle("text-halign").value,E=t.pstyle("text-valign").value;x&&(w="center",E="center"),s+=y,l+=b,0!==(h=r?this.getTextAngle(t,n):0)&&(c=s,d=l,e.translate(c,d),e.rotate(h),s=0,l=0);var T=rQ(w),C=rJ(E);switch(C){case"top":break;case"center":l+=g/2;break;case"bottom":l+=g}var k=t.pstyle("text-background-opacity").value,P=t.pstyle("text-border-opacity").value,S=t.pstyle("text-border-width").pfValue,B=t.pstyle("text-background-padding").pfValue,D=t.pstyle("text-background-shape").strValue,_="round-rectangle"===D||"roundrectangle"===D;if(k>0||S>0&&P>0){var A,M,R=e.fillStyle,I=e.strokeStyle,N=e.lineWidth,L=t.pstyle("text-background-color").value,O=t.pstyle("text-border-color").value,z=t.pstyle("text-border-style").value,V=k>0,F=S>0&&P>0,X=s-B;switch(T){case"left":X-=p;break;case"center":X-=p/2}var j=l-g-B,Y=p+2*B,q=g+2*B;if(V&&(e.fillStyle="rgba(".concat(L[0],",").concat(L[1],",").concat(L[2],",").concat(k*o,")")),F&&(e.strokeStyle="rgba(".concat(O[0],",").concat(O[1],",").concat(O[2],",").concat(P*o,")"),e.lineWidth=S,e.setLineDash))switch(z){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=S/4,e.setLineDash([]);break;default:e.setLineDash([])}if(_?(e.beginPath(),uS(e,X,j,Y,q,2)):"circle"===D?(e.beginPath(),A=X,M=Math.min(Y,q),e.beginPath(),e.arc(A+Y/2,j+q/2,M/2,0,2*Math.PI),e.closePath()):(e.beginPath(),e.rect(X,j,Y,q)),V&&e.fill(),F&&e.stroke(),F&&"double"===z){var W=S/2;e.beginPath(),_?uS(e,X+W,j+W,Y-2*W,q-2*W,2):e.rect(X+W,j+W,Y-2*W,q-2*W),e.stroke()}e.fillStyle=R,e.strokeStyle=I,e.lineWidth=N,e.setLineDash&&e.setLineDash([])}var U=2*t.pstyle("text-outline-width").pfValue;if(U>0&&(e.lineWidth=U),l-=v,"wrap"===t.pstyle("text-wrap").value){var G=eH(a,"labelWrapCachedLines",n),H=eH(a,"labelLineHeight",n),K=p/2,Z=this.getLabelJustification(t);switch("auto"===Z||("left"===T?"left"===Z?s+=-p:"center"===Z&&(s+=-K):"center"===T?"left"===Z?s+=-K:"right"===Z&&(s+=K):"right"===T&&("center"===Z?s+=K:"right"===Z&&(s+=p))),C){case"top":case"center":case"bottom":l-=(G.length-1)*H}for(var $=0;$0&&e.strokeText(G[$],s,l),e.fillText(G[$],s,l),l+=H}else U>0&&e.strokeText(u,s,l),e.fillText(u,s,l);0!==h&&(e.rotate(-h),e.translate(-c,-d))}}};var uB={};uB.drawNode=function(e,t,n){var r,i,a,o,s=!(arguments.length>3)||void 0===arguments[3]||arguments[3],l=!(arguments.length>4)||void 0===arguments[4]||arguments[4],u=!(arguments.length>5)||void 0===arguments[5]||arguments[5],c=this,d=t._private,h=d.rscratch,f=t.position();if(M(f.x)&&M(f.y)&&(!u||t.visible())){var p=u?t.effectiveOpacity():1,g=c.usePaths(),v=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(o=n,e.translate(-o.x1,-o.y1));for(var b=t.pstyle("background-image").value,x=Array(b.length),w=Array(b.length),E=0,T=0;T0&&void 0!==arguments[0]?arguments[0]:B;c.eleFillStyle(e,t,n)},W=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O;c.colorStrokeStyle(e,D[0],D[1],D[2],t)},U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:X;c.colorStrokeStyle(e,V[0],V[1],V[2],t)},G=function(e,t,n,r){var i,a=c.nodePathCache=c.nodePathCache||[],o=eS("polygon"===n?n+","+r.join(","):n,""+t,""+e,""+Y),s=a[o],l=!1;return null!=s?(i=s,l=!0,h.pathCache=i):(i=new Path2D,a[o]=h.pathCache=i),{path:i,cacheHit:l}},H=t.pstyle("shape").strValue,K=t.pstyle("shape-polygon-points").pfValue;if(g){e.translate(f.x,f.y);var Z=G(r,i,H,K);a=Z.path,v=Z.cacheHit}var $=function(){if(!v){var n=f;g&&(n={x:0,y:0}),c.nodeShapes[c.getNodeShape(t)].draw(a||e,n.x,n.y,r,i,Y,h)}g?e.fill(a):e.fill()},Q=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,r=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=d.backgrounding,a=0,o=0;o0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;c.hasPie(t)&&(c.drawPie(e,t,a),n&&!g&&c.nodeShapes[c.getNodeShape(t)].draw(e,f.x,f.y,r,i,Y,h))},ee=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;c.hasStripe(t)&&(e.save(),g?e.clip(h.pathCache):(c.nodeShapes[c.getNodeShape(t)].draw(e,f.x,f.y,r,i,Y,h),e.clip()),c.drawStripe(e,t,a),e.restore(),n&&!g&&c.nodeShapes[c.getNodeShape(t)].draw(e,f.x,f.y,r,i,Y,h))},et=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,n=P>0?0:255;0!==P&&(c.colorFillStyle(e,n,n,n,(P>0?P:-P)*t),g?e.fill(a):e.fill())},en=function(){if(S>0){if(e.lineWidth=S,e.lineCap=R,e.lineJoin=A,e.setLineDash)switch(_){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(N),e.lineDashOffset=L;break;case"solid":case"double":e.setLineDash([])}if("center"!==I){if(e.save(),e.lineWidth*=2,"inside"===I)g?e.clip(a):e.clip();else{var t=new Path2D;t.rect(-r/2-S,-i/2-S,r+2*S,i+2*S),t.addPath(a),e.clip(t,"evenodd")}g?e.stroke(a):e.stroke(),e.restore()}else g?e.stroke(a):e.stroke();if("double"===_){e.lineWidth=S/3;var n=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",g?e.stroke(a):e.stroke(),e.globalCompositeOperation=n}e.setLineDash&&e.setLineDash([])}},er=function(){if(z>0){if(e.lineWidth=z,e.lineCap="butt",e.setLineDash)switch(F){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var n=f;g&&(n={x:0,y:0});var a=c.getNodeShape(t),o=S;"inside"===I&&(o=0),"outside"===I&&(o*=2);var s=(r+o+(z+j))/r,l=(i+o+(z+j))/i,u=r*s,d=i*l,h=c.nodeShapes[a].points;if(g&&(k=G(u,d,a,h).path),"ellipse"===a)c.drawEllipsePath(k||e,n.x,n.y,u,d);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(a)){var p=0,v=0,y=0;"round-diamond"===a?p=(o+j+z)*1.4:"round-heptagon"===a?(p=(o+j+z)*1.075,y=-(o/2+j+z)/35):"round-hexagon"===a?p=(o+j+z)*1.12:"round-pentagon"===a?(p=(o+j+z)*1.13,y=-(o/2+j+z)/15):"round-tag"===a?(p=(o+j+z)*1.12,v=(o/2+z+j)*.07):"round-triangle"===a&&(p=Math.PI/2*(o+j+z),y=-(o+j/2+z)/Math.PI),0===p||(s=(r+p)/r,u=r*s,["round-hexagon","round-tag"].includes(a)||(l=(i+p)/i,d=i*l)),Y="auto"===Y?t4(u,d):Y;for(var b=u/2,x=d/2,w=Y+(o+z+j)/2,E=Array(h.length/2),T=Array(h.length/2),C=0;C0){if(r=r||n.position(),null==i||null==a){var d=n.padding();i=n.width()+2*d,a=n.height()+2*d}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[u].draw(t,r.x,r.y,i+2*o,a+2*o,c),t.fill()}}}};uB.drawNodeOverlay=uD("overlay"),uB.drawNodeUnderlay=uD("underlay"),uB.hasPie=function(e){return(e=e[0])._private.hasPie},uB.hasStripe=function(e){return(e=e[0])._private.hasStripe},uB.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i,a=t.cy().style(),o=t.pstyle("pie-size"),s=t.pstyle("pie-hole"),l=t.pstyle("pie-start-angle").pfValue,u=r.x,c=r.y,d=Math.min(t.width(),t.height())/2,h=0;if(this.usePaths()&&(u=0,c=0),"%"===o.units?d*=o.pfValue:void 0!==o.pfValue&&(d=o.pfValue/2),"%"===s.units?i=d*s.pfValue:void 0!==s.pfValue&&(i=s.pfValue/2),!(i>=d))for(var f=1;f<=a.pieBackgroundN;f++){var p=t.pstyle("pie-"+f+"-background-size").value,g=t.pstyle("pie-"+f+"-background-color").value,v=t.pstyle("pie-"+f+"-background-opacity").value*n,y=p/100;y+h>1&&(y=1-h);var b=1.5*Math.PI+2*Math.PI*h,x=2*Math.PI*y,w=(b+=l)+x;0===p||h>=1||h+y>1||(0===i?(e.beginPath(),e.moveTo(u,c),e.arc(u,c,d,b,w)):(e.beginPath(),e.arc(u,c,d,b,w),e.arc(u,c,i,w,b,!0)),e.closePath(),this.colorFillStyle(e,g[0],g[1],g[2],v),e.fill(),h+=y)}},uB.drawStripe=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),a=r.x,o=r.y,s=t.width(),l=t.height(),u=0,c=this.usePaths();e.save();var d=t.pstyle("stripe-direction").value,h=t.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":e.rotate(-Math.PI/2)}var f=s,p=l;"%"===h.units?(f*=h.pfValue,p*=h.pfValue):void 0!==h.pfValue&&(f=h.pfValue,p=h.pfValue),c&&(a=0,o=0),o-=f/2,a-=p/2;for(var g=1;g<=i.stripeBackgroundN;g++){var v=t.pstyle("stripe-"+g+"-background-size").value,y=t.pstyle("stripe-"+g+"-background-color").value,b=t.pstyle("stripe-"+g+"-background-opacity").value*n,x=v/100;x+u>1&&(x=1-u),0===v||u>=1||u+x>1||(e.beginPath(),e.rect(a,o+p*u,f,p*x),e.closePath(),this.colorFillStyle(e,y[0],y[1],y[2],b),e.fill(),u+=x)}e.restore()};var u_={};function uA(e,t,n){var r=e.createShader(t);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw Error(e.getShaderInfoLog(r));return r}function uM(e,t,n){void 0===n&&(n=t);var r=e.makeOffscreenCanvas(t,n),i=r.context=r.getContext("2d");return r.clear=function(){return i.clearRect(0,0,r.width,r.height)},r.clear(),r}function uR(e){var t=e.pixelRatio,n=e.cy.zoom(),r=e.cy.pan();return{zoom:n*t,pan:{x:r.x*t,y:r.y*t}}}function uI(e,t){return!!t.picking||"solid"===e.pstyle("background-fill").value&&"none"===e.pstyle("background-image").strValue&&(0===e.pstyle("border-width").value||0===e.pstyle("border-opacity").value||"solid"===e.pstyle("border-style").value)}function uN(e,t,n){var r=e[0]/255,i=e[1]/255,a=e[2]/255,o=n||[,,,,];return o[0]=r*t,o[1]=i*t,o[2]=a*t,o[3]=t,o}function uL(e,t){var n=t||[,,,,];return n[0]=(e>>0&255)/255,n[1]=(e>>8&255)/255,n[2]=(e>>16&255)/255,n[3]=(e>>24&255)/255,n}function uO(e,t){switch(t){case"float":return[1,e.FLOAT,4];case"vec2":return[2,e.FLOAT,4];case"vec3":return[3,e.FLOAT,4];case"vec4":return[4,e.FLOAT,4];case"int":return[1,e.INT,4];case"ivec2":return[2,e.INT,4]}}function uz(e,t,n){switch(t){case e.FLOAT:return new Float32Array(n);case e.INT:return new Int32Array(n)}}function uV(e,t,n,r){var i=l(uO(e,n),3),a=i[0],o=i[1],s=i[2],u=uz(e,o,t*a),c=a*s,d=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,d),e.bufferData(e.ARRAY_BUFFER,t*c,e.DYNAMIC_DRAW),e.enableVertexAttribArray(r),o===e.FLOAT?e.vertexAttribPointer(r,a,o,!1,c,0):o===e.INT&&e.vertexAttribIPointer(r,a,o,c,0),e.vertexAttribDivisor(r,1),e.bindBuffer(e.ARRAY_BUFFER,null);for(var h=Array(t),f=0;ft.minMbLowQualFrames&&(t.motionBlurPxRatio=t.mbPxRBlurry)),t.clearingMotionBlur&&(t.motionBlurPxRatio=1),t.textureDrawLastFrame&&!d&&(c[t.NODE]=!0,c[t.SELECT_BOX]=!0);var b=n.style(),x=n.zoom(),w=void 0!==o?o:x,E=n.pan(),T={x:E.x,y:E.y},C={zoom:x,pan:{x:E.x,y:E.y}},k=t.prevViewport;void 0===k||C.zoom!==k.zoom||C.pan.x!==k.pan.x||C.pan.y!==k.pan.y||g&&!p||(t.motionBlurPxRatio=1),s&&(T=s),w*=l,T.x*=l,T.y*=l;var P=t.getCachedZSortedEles();function S(e,n,r,i,a){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",t.colorFillStyle(e,255,255,255,t.motionBlurTransparency),e.fillRect(n,r,i,a),e.globalCompositeOperation=o}function B(e,n){var a,l,c,d;t.clearingMotionBlur||e!==u.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]&&e!==u.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]?(a=T,l=w,c=t.canvasWidth,d=t.canvasHeight):(a={x:E.x*f,y:E.y*f},l=x*f,c=t.canvasWidth*f,d=t.canvasHeight*f),e.setTransform(1,0,0,1,0,0),"motionBlur"===n?S(e,0,0,c,d):!r&&(void 0===n||n)&&e.clearRect(0,0,c,d),i||(e.translate(a.x,a.y),e.scale(l,l)),s&&e.translate(s.x,s.y),o&&e.scale(o,o)}if(d||(t.textureDrawLastFrame=!1),d){if(t.textureDrawLastFrame=!0,!t.textureCache){t.textureCache={},t.textureCache.bb=n.mutableElements().boundingBox(),t.textureCache.texture=t.data.bufferCanvases[t.TEXTURE_BUFFER];var D=t.data.bufferContexts[t.TEXTURE_BUFFER];D.setTransform(1,0,0,1,0,0),D.clearRect(0,0,t.canvasWidth*t.textureMult,t.canvasHeight*t.textureMult),t.render({forcedContext:D,drawOnlyNodeLayer:!0,forcedPxRatio:l*t.textureMult});var C=t.textureCache.viewport={zoom:n.zoom(),pan:n.pan(),width:t.canvasWidth,height:t.canvasHeight};C.mpan={x:(0-C.pan.x)/C.zoom,y:(0-C.pan.y)/C.zoom}}c[t.DRAG]=!1,c[t.NODE]=!1;var _=u.contexts[t.NODE],A=t.textureCache.texture,C=t.textureCache.viewport;_.setTransform(1,0,0,1,0,0),h?S(_,0,0,C.width,C.height):_.clearRect(0,0,C.width,C.height);var M=b.core("outside-texture-bg-color").value,R=b.core("outside-texture-bg-opacity").value;t.colorFillStyle(_,M[0],M[1],M[2],R),_.fillRect(0,0,C.width,C.height);var x=n.zoom();B(_,!1),_.clearRect(C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l),_.drawImage(A,C.mpan.x,C.mpan.y,C.width/C.zoom/l,C.height/C.zoom/l)}else t.textureOnViewport&&!r&&(t.textureCache=null);var I=n.extent(),N=t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming||t.hoverData.draggingEles||t.cy.animated(),L=t.hideEdgesOnViewport&&N,O=[];if(O[t.NODE]=!c[t.NODE]&&h&&!t.clearedForMotionBlur[t.NODE]||t.clearingMotionBlur,O[t.NODE]&&(t.clearedForMotionBlur[t.NODE]=!0),O[t.DRAG]=!c[t.DRAG]&&h&&!t.clearedForMotionBlur[t.DRAG]||t.clearingMotionBlur,O[t.DRAG]&&(t.clearedForMotionBlur[t.DRAG]=!0),c[t.NODE]||i||a||O[t.NODE]){var z=h&&!O[t.NODE]&&1!==f,_=r||(z?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]:u.contexts[t.NODE]);B(_,h&&!z?"motionBlur":void 0),L?t.drawCachedNodes(_,P.nondrag,l,I):t.drawLayeredElements(_,P.nondrag,l,I),t.debug&&t.drawDebugPoints(_,P.nondrag),i||h||(c[t.NODE]=!1)}if(!a&&(c[t.DRAG]||i||O[t.DRAG])){var z=h&&!O[t.DRAG]&&1!==f,_=r||(z?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]:u.contexts[t.DRAG]);B(_,h&&!z?"motionBlur":void 0),L?t.drawCachedNodes(_,P.drag,l,I):t.drawCachedElements(_,P.drag,l,I),t.debug&&t.drawDebugPoints(_,P.drag),i||h||(c[t.DRAG]=!1)}if(this.drawSelectionRectangle(e,B),h&&1!==f){var V=u.contexts[t.NODE],F=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE],X=u.contexts[t.DRAG],j=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG],Y=function(e,n,r){e.setTransform(1,0,0,1,0,0),r||!y?e.clearRect(0,0,t.canvasWidth,t.canvasHeight):S(e,0,0,t.canvasWidth,t.canvasHeight),e.drawImage(n,0,0,t.canvasWidth*f,t.canvasHeight*f,0,0,t.canvasWidth,t.canvasHeight)};(c[t.NODE]||O[t.NODE])&&(Y(V,F,O[t.NODE]),c[t.NODE]=!1),(c[t.DRAG]||O[t.DRAG])&&(Y(X,j,O[t.DRAG]),c[t.DRAG]=!1)}t.prevViewport=C,t.clearingMotionBlur&&(t.clearingMotionBlur=!1,t.motionBlurCleared=!0,t.motionBlur=!0),h&&(t.motionBlurTimeout=setTimeout(function(){t.motionBlurTimeout=null,t.clearedForMotionBlur[t.NODE]=!1,t.clearedForMotionBlur[t.DRAG]=!1,t.motionBlur=!1,t.clearingMotionBlur=!d,t.mbFrames=0,c[t.NODE]=!0,c[t.DRAG]=!0,t.redraw()},100)),r||n.emit("render")},u_.drawSelectionRectangle=function(e,t){var n=this.cy,r=this.data,i=n.style(),a=e.drawOnlyNodeLayer,o=e.drawAllLayers,s=r.canvasNeedsRedraw,l=e.forcedContext;if(this.showFps||!a&&s[this.SELECT_BOX]&&!o){var u=l||r.contexts[this.SELECT_BOX];if(t(u),1==this.selection[4]&&(this.hoverData.selecting||this.touchData.selecting)){var c=this.cy.zoom(),d=i.core("selection-box-border-width").value/c;u.lineWidth=d,u.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",u.fillRect(this.selection[0],this.selection[1],this.selection[2]-this.selection[0],this.selection[3]-this.selection[1]),d>0&&(u.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",u.strokeRect(this.selection[0],this.selection[1],this.selection[2]-this.selection[0],this.selection[3]-this.selection[1]))}if(r.bgActivePosistion&&!this.hoverData.selecting){var c=this.cy.zoom(),h=r.bgActivePosistion;u.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",u.beginPath(),u.arc(h.x,h.y,i.core("active-bg-size").pfValue/c,0,2*Math.PI),u.fill()}var f=this.lastRedrawTime;if(this.showFps&&f){var p=Math.round(1e3/(f=Math.round(f))),g="1 frame = "+f+" ms = "+p+" fps";u.setTransform(1,0,0,1,0,0),u.fillStyle="rgba(255, 0, 0, 0.75)",u.strokeStyle="rgba(255, 0, 0, 0.75)",u.font="30px Arial",x||(x=u.measureText(g).actualBoundingBoxAscent),u.fillText(g,0,x),u.strokeRect(0,x+10,250,20),u.fillRect(0,x+10,250*Math.min(p/60,1),20)}o||(s[this.SELECT_BOX]=!1)}};var uF="undefined"!=typeof Float32Array?Float32Array:Array;function uX(){var e=new uF(9);return uF!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function uj(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function uY(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],d=t[8],h=n[0],f=n[1];return e[0]=r,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=h*r+f*o+u,e[7]=h*i+f*s+c,e[8]=h*a+f*l+d,e}function uq(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],d=t[8],h=Math.sin(n),f=Math.cos(n);return e[0]=f*r+h*o,e[1]=f*i+h*s,e[2]=f*a+h*l,e[3]=f*o-h*r,e[4]=f*s-h*i,e[5]=f*l-h*a,e[6]=u,e[7]=c,e[8]=d,e}function uW(e,t,n){var r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var uU=a(function e(t,n,r,a){i(this,e),this.debugID=Math.floor(1e4*Math.random()),this.r=t,this.texSize=n,this.texRows=r,this.texHeight=Math.floor(n/r),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=a(t,n,n),this.scratch=a(t,n,this.texHeight,"scratch")},[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(e){var t=e.w,n=e.h,r=this.texHeight,i=this.texSize,a=r/n,o=t*a,s=n*a;return o>i&&(a=i/t,o=t*a,s=n*a),{scale:a,texW:o,texH:s}}},{key:"draw",value:function(e,t,n){var r,i,a,o,s,l,u,c=this;if(this.locked)throw Error("can't draw, atlas is locked");var d=this.texSize,h=this.texRows,f=this.texHeight,p=this.getScale(t),g=p.scale,v=p.texW,y=p.texH,b=function(e,r){if(n&&r){var i=r.context,a=e.x,o=f*e.row;i.save(),i.translate(a,o),i.scale(g,g),n(i,t),i.restore()}},x=[null,null],w=function(){b(c.freePointer,c.canvas),x[0]={x:c.freePointer.x,y:c.freePointer.row*f,w:v,h:y},x[1]={x:c.freePointer.x+v,y:c.freePointer.row*f,w:0,h:y},c.freePointer.x+=v,c.freePointer.x==d&&(c.freePointer.x=0,c.freePointer.row++)},E=function(){c.freePointer.x=0,c.freePointer.row++};if(this.freePointer.x+v<=d)w();else{if(this.freePointer.row>=h-1)return!1;this.freePointer.x===d?(E(),w()):this.enableWrapping?(r=c.scratch,i=c.canvas,r.clear(),b({x:0,row:0},r),o=v-(a=d-c.freePointer.x),s=c.freePointer.x,l=c.freePointer.row*f,i.context.drawImage(r,0,0,a,f,s,l,a,f),x[0]={x:s,y:l,w:a,h:y},u=(c.freePointer.row+1)*f,i&&i.context.drawImage(r,a,0,o,f,0,u,o,f),x[1]={x:0,y:u,w:o,h:y},c.freePointer.x=o,c.freePointer.row++):(E(),w())}return this.keyToLocation.set(e,x),this.needsBuffer=!0,x}},{key:"getOffsets",value:function(e){return this.keyToLocation.get(e)}},{key:"isEmpty",value:function(){return 0===this.freePointer.x&&0===this.freePointer.row}},{key:"canFit",value:function(e){if(this.locked)return!1;var t=this.texSize,n=this.texRows,r=this.getScale(e).texW;return!(this.freePointer.x+r>t)||this.freePointer.row1&&void 0!==arguments[1]?arguments[1]:{},i=r.forceRedraw,a=void 0!==i&&i,s=r.filterEle,l=void 0===s?function(){return!0}:s,u=r.filterType,c=void 0===u?function(){return!0}:u,d=!1,h=!1,f=o(e);try{for(f.s();!(t=f.n()).done;){var p=t.value;if(l(p)){var g,v=o(this.renderTypes.values());try{for(v.s();!(g=v.n()).done;)!function(){var e=g.value,t=e.type;if(c(t)){var r=n.collections.get(e.collection),i=e.getKey(p),o=Array.isArray(i)?i:[i];if(a)o.forEach(function(e){return r.markKeyForGC(e)}),h=!0;else{var s=e.getID?e.getID(p):p.id(),l=n._key(t,s),u=n.typeAndIdToKey.get(l);void 0!==u&&!function(e,t){if(e.length!==t.length)return!1;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.type,r=this.atlasManager;return n?r.invalidate(e,{filterType:function(e){return e===n},forceRedraw:!0}):r.invalidate(e)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(e){var t=this.gl,n="#version 300 es\n precision highp float;\n\n uniform mat3 uPanZoomMatrix;\n uniform int uAtlasSize;\n \n // instanced\n in vec2 aPosition; // a vertex from the unit square\n \n in mat3 aTransform; // used to transform verticies, eg into a bounding box\n in int aVertType; // the type of thing we are rendering\n\n // the z-index that is output when using picking mode\n in vec4 aIndex;\n \n // For textures\n in int aAtlasId; // which shader unit/atlas to use\n in vec4 aTex; // x/y/w/h of texture in atlas\n\n // for edges\n in vec4 aPointAPointB;\n in vec4 aPointCPointD;\n in vec2 aLineWidth; // also used for node border width\n\n // simple shapes\n in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]\n in vec4 aColor; // also used for edges\n in vec4 aBorderColor; // aLineWidth is used for border width\n\n // output values passed to the fragment shader\n out vec2 vTexCoord;\n out vec4 vColor;\n out vec2 vPosition;\n // flat values are not interpolated\n flat out int vAtlasId; \n flat out int vVertType;\n flat out vec2 vTopRight;\n flat out vec2 vBotLeft;\n flat out vec4 vCornerRadius;\n flat out vec4 vBorderColor;\n flat out vec2 vBorderWidth;\n flat out vec4 vIndex;\n \n void main(void) {\n int vid = gl_VertexID;\n vec2 position = aPosition; // TODO make this a vec3, simplifies some code below\n\n if(aVertType == ".concat(0,") {\n float texX = aTex.x; // texture coordinates\n float texY = aTex.y;\n float texW = aTex.z;\n float texH = aTex.w;\n\n if(vid == 1 || vid == 2 || vid == 4) {\n texX += texW;\n }\n if(vid == 2 || vid == 4 || vid == 5) {\n texY += texH;\n }\n\n float d = float(uAtlasSize);\n vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n }\n else if(aVertType == ").concat(4," || aVertType == ").concat(7," \n || aVertType == ").concat(5," || aVertType == ").concat(6,") { // simple shapes\n\n // the bounding box is needed by the fragment shader\n vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat\n vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat\n vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated\n\n // calculations are done in the fragment shader, just pass these along\n vColor = aColor;\n vCornerRadius = aCornerRadius;\n vBorderColor = aBorderColor;\n vBorderWidth = aLineWidth;\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n }\n else if(aVertType == ").concat(1,") {\n vec2 source = aPointAPointB.xy;\n vec2 target = aPointAPointB.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n // stretch the unit square into a long skinny rectangle\n vec2 xBasis = target - source;\n vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));\n vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;\n\n gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);\n vColor = aColor;\n } \n else if(aVertType == ").concat(2,") {\n vec2 pointA = aPointAPointB.xy;\n vec2 pointB = aPointAPointB.zw;\n vec2 pointC = aPointCPointD.xy;\n vec2 pointD = aPointCPointD.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n vec2 p0, p1, p2, pos;\n if(position.x == 0.0) { // The left side of the unit square\n p0 = pointA;\n p1 = pointB;\n p2 = pointC;\n pos = position;\n } else { // The right side of the unit square, use same approach but flip the geometry upside down\n p0 = pointD;\n p1 = pointC;\n p2 = pointB;\n pos = vec2(0.0, -position.y);\n }\n\n vec2 p01 = p1 - p0;\n vec2 p12 = p2 - p1;\n vec2 p21 = p1 - p2;\n\n // Find the normal vector.\n vec2 tangent = normalize(normalize(p12) + normalize(p01));\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n // Find the vector perpendicular to p0 -> p1.\n vec2 p01Norm = normalize(vec2(-p01.y, p01.x));\n\n // Determine the bend direction.\n float sigma = sign(dot(p01 + p21, normal));\n float width = aLineWidth[0];\n\n if(sign(pos.y) == -sigma) {\n // This is an intersecting vertex. Adjust the position so that there's no overlap.\n vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n } else {\n // This is a non-intersecting vertex. Treat it like a mitre join.\n vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n }\n\n vColor = aColor;\n } \n else if(aVertType == ").concat(3," && vid < 3) {\n // massage the first triangle into an edge arrow\n if(vid == 0)\n position = vec2(-0.15, -0.3);\n if(vid == 1)\n position = vec2( 0.0, 0.0);\n if(vid == 2)\n position = vec2( 0.15, -0.3);\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n vColor = aColor;\n }\n else {\n gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space\n }\n\n vAtlasId = aAtlasId;\n vVertType = aVertType;\n vIndex = aIndex;\n }\n "),r=this.batchManager.getIndexArray(),i=function(e,t,n){var r=uA(e,e.VERTEX_SHADER,t),i=uA(e,e.FRAGMENT_SHADER,n),a=e.createProgram();if(e.attachShader(a,r),e.attachShader(a,i),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))throw Error("Could not initialize shaders");return a}(t,n,"#version 300 es\n precision highp float;\n\n // declare texture unit for each texture atlas in the batch\n ".concat(r.map(function(e){return"uniform sampler2D uTexture".concat(e,";")}).join("\n "),"\n\n uniform vec4 uBGColor;\n uniform float uZoom;\n\n in vec2 vTexCoord;\n in vec4 vColor;\n in vec2 vPosition; // model coordinates\n\n flat in int vAtlasId;\n flat in vec4 vIndex;\n flat in int vVertType;\n flat in vec2 vTopRight;\n flat in vec2 vBotLeft;\n flat in vec4 vCornerRadius;\n flat in vec4 vBorderColor;\n flat in vec2 vBorderWidth;\n\n out vec4 outColor;\n\n ").concat("\n float circleSD(vec2 p, float r) {\n return distance(vec2(0), p) - r; // signed distance\n }\n","\n ").concat("\n float rectangleSD(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);\n }\n","\n ").concat("\n float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {\n cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;\n cr.x = (p.y > 0.0) ? cr.x : cr.y;\n vec2 q = abs(p) - b + cr.x;\n return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;\n }\n","\n ").concat("\n float ellipseSD(vec2 p, vec2 ab) {\n p = abs( p ); // symmetry\n\n // find root with Newton solver\n vec2 q = ab*(p-ab);\n float w = (q.x1.0) ? d : -d;\n }\n","\n\n vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha\n return vec4( \n top.rgb + (bot.rgb * (1.0 - top.a)),\n top.a + (bot.a * (1.0 - top.a)) \n );\n }\n\n vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance\n // scale to the zoom level so that borders don't look blurry when zoomed in\n // note 1.5 is an aribitrary value chosen because it looks good\n return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); \n }\n\n void main(void) {\n if(vVertType == ").concat(0,") {\n // look up the texel from the texture unit\n ").concat(r.map(function(e){return"if(vAtlasId == ".concat(e,") outColor = texture(uTexture").concat(e,", vTexCoord);")}).join("\n else "),"\n } \n else if(vVertType == ").concat(3,") {\n // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';\n outColor = blend(vColor, uBGColor);\n outColor.a = 1.0; // make opaque, masks out line under arrow\n }\n else if(vVertType == ").concat(4," && vBorderWidth == vec2(0.0)) { // simple rectangle with no border\n outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done\n }\n else if(vVertType == ").concat(4," || vVertType == ").concat(7," \n || vVertType == ").concat(5," || vVertType == ").concat(6,") { // use SDF\n\n float outerBorder = vBorderWidth[0];\n float innerBorder = vBorderWidth[1];\n float borderPadding = outerBorder * 2.0;\n float w = vTopRight.x - vBotLeft.x - borderPadding;\n float h = vTopRight.y - vBotLeft.y - borderPadding;\n vec2 b = vec2(w/2.0, h/2.0); // half width, half height\n vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center\n\n float d; // signed distance\n if(vVertType == ").concat(4,") {\n d = rectangleSD(p, b);\n } else if(vVertType == ").concat(7," && w == h) {\n d = circleSD(p, b.x); // faster than ellipse\n } else if(vVertType == ").concat(7,") {\n d = ellipseSD(p, b);\n } else {\n d = roundRectangleSD(p, b, vCornerRadius.wzyx);\n }\n\n // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling\n // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box\n if(d > 0.0) {\n if(d > outerBorder) {\n discard;\n } else {\n outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);\n }\n } else {\n if(d > innerBorder) {\n vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;\n vec4 innerBorderColor = blend(vBorderColor, vColor);\n outColor = distInterp(innerBorderColor, outerColor, d);\n } \n else {\n vec4 outerColor;\n if(innerBorder == 0.0 && outerBorder == 0.0) {\n outerColor = vec4(0);\n } else if(innerBorder == 0.0) {\n outerColor = vBorderColor;\n } else {\n outerColor = blend(vBorderColor, vColor);\n }\n outColor = distInterp(vColor, outerColor, d - innerBorder);\n }\n }\n }\n else {\n outColor = vColor;\n }\n\n ").concat(e.picking?"if(outColor.a == 0.0) discard;\n else outColor = vIndex;":"","\n }\n "));i.aPosition=t.getAttribLocation(i,"aPosition"),i.aIndex=t.getAttribLocation(i,"aIndex"),i.aVertType=t.getAttribLocation(i,"aVertType"),i.aTransform=t.getAttribLocation(i,"aTransform"),i.aAtlasId=t.getAttribLocation(i,"aAtlasId"),i.aTex=t.getAttribLocation(i,"aTex"),i.aPointAPointB=t.getAttribLocation(i,"aPointAPointB"),i.aPointCPointD=t.getAttribLocation(i,"aPointCPointD"),i.aLineWidth=t.getAttribLocation(i,"aLineWidth"),i.aColor=t.getAttribLocation(i,"aColor"),i.aCornerRadius=t.getAttribLocation(i,"aCornerRadius"),i.aBorderColor=t.getAttribLocation(i,"aBorderColor"),i.uPanZoomMatrix=t.getUniformLocation(i,"uPanZoomMatrix"),i.uAtlasSize=t.getUniformLocation(i,"uAtlasSize"),i.uBGColor=t.getUniformLocation(i,"uBGColor"),i.uZoom=t.getUniformLocation(i,"uZoom"),i.uTextures=[];for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:uZ.SCREEN;this.panZoomMatrix=e,this.renderTarget=t,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(e,t){return!!e.visible()&&(!t||!t.isVisible||t.isVisible(e))}},{key:"drawTexture",value:function(e,t,n){var r=this.atlasManager,i=this.batchManager,a=r.getRenderTypeOpts(n);if(!(!this._isVisible(e,a)||e.isEdge()&&!this._isValidEdge(e))){if(this.renderTarget.picking&&a.getTexPickingMode){var s=a.getTexPickingMode(e);if(s===u$.IGNORE)return;if(s==u$.USE_BB){this.drawPickingRectangle(e,t,n);return}}var u,c=o(r.getAtlasInfo(e,n));try{for(c.s();!(u=c.n()).done;){var d=u.value,h=d.atlas,f=d.tex1,p=d.tex2;i.canAddToCurrentBatch(h)||this.endBatch();for(var g=i.getAtlasIndexForBatch(h),v=0,y=[[f,!0],[p,!1]];v=this.maxInstances&&this.endBatch()}}}}catch(e){c.e(e)}finally{c.f()}}}},{key:"setTransformMatrix",value:function(e,t,n,r){var i=!(arguments.length>4)||void 0===arguments[4]||arguments[4],a=0;if(n.shapeProps&&n.shapeProps.padding&&(a=e.pstyle(n.shapeProps.padding).pfValue),r){var o=r.bb,s=r.tex1,l=r.tex2,u=s.w/(s.w+l.w);i||(u=1-u);var c=this._getAdjustedBB(o,a,i,u);this._applyTransformMatrix(t,c,n,e)}else{var d=n.getBoundingBox(e),h=this._getAdjustedBB(d,a,!0,1);this._applyTransformMatrix(t,h,n,e)}}},{key:"_applyTransformMatrix",value:function(e,t,n,r){uj(e);var i,a,o=n.getRotation?n.getRotation(r):0;if(0!==o){var s=n.getRotationPoint(r);uY(e,e,[s.x,s.y]),uq(e,e,o);var l=n.getRotationOffset(r);i=l.x+(t.xOffset||0),a=l.y+(t.yOffset||0)}else i=t.x1,a=t.y1;uY(e,e,[i,a]),uW(e,e,[t.w,t.h])}},{key:"_getAdjustedBB",value:function(e,t,n,r){var i=e.x1,a=e.y1,o=e.w,s=e.h,l=e.yOffset;t&&(i-=t,a-=t,o+=2*t,s+=2*t);var u=0,c=o*r;return n&&r<1?o=c:!n&&r<1&&(i+=u=o-c,o=c),{x1:i,y1:a,w:o,h:s,xOffset:u,yOffset:l}}},{key:"drawPickingRectangle",value:function(e,t,n){var r=this.atlasManager.getRenderTypeOpts(n),i=this.instanceCount;this.vertTypeBuffer.getView(i)[0]=4,uL(t,this.indexBuffer.getView(i)),uN([0,0,0],1,this.colorBuffer.getView(i));var a=this.transformBuffer.getMatrixView(i);this.setTransformMatrix(e,a,r),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(e,t,n){var r=this.simpleShapeOptions.get(n);if(this._isVisible(e,r)){var i=r.shapeProps,a=this._getVertTypeForShape(e,i.shape);if(void 0===a||r.isSimple&&!r.isSimple(e,this.renderTarget)){this.drawTexture(e,t,n);return}var o=this.instanceCount;if(this.vertTypeBuffer.getView(o)[0]=a,5===a||6===a){var s=r.getBoundingBox(e),l=this._getCornerRadius(e,i.radius,s),u=this.cornerRadiusBuffer.getView(o);u[0]=l,u[1]=l,u[2]=l,u[3]=l,6===a&&(u[0]=0,u[2]=0)}uL(t,this.indexBuffer.getView(o));var c=this.renderTarget.picking?1:"node-body"===n?e.effectiveOpacity():1,d=this.renderTarget.picking?1:e.pstyle(i.opacity).value*c;uN(e.pstyle(i.color).value,d,this.colorBuffer.getView(o));var h=this.lineWidthBuffer.getView(o);if(h[0]=0,h[1]=0,i.border){var f=e.pstyle("border-width").value;if(f>0){uN(e.pstyle("border-color").value,c*e.pstyle("border-opacity").value,this.borderColorBuffer.getView(o));var p=e.pstyle("border-position").value;if("inside"===p)h[0]=0,h[1]=-f;else if("outside"===p)h[0]=f,h[1]=0;else{var g=f/2;h[0]=g,h[1]=-g}}}var v=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(e,v,r),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(e,t){switch(e.pstyle(t).value){case"rectangle":return 4;case"ellipse":return 7;case"roundrectangle":case"round-rectangle":return 5;case"bottom-round-rectangle":return 6;default:return}}},{key:"_getCornerRadius",value:function(e,t,n){var r=n.w,i=n.h;return"auto"===e.pstyle(t).value?t3(r,i):Math.min(e.pstyle(t).pfValue,i/2,r/2)}},{key:"drawEdgeArrow",value:function(e,t,n){if(e.visible()){var r,i,a,o=e._private.rscratch;if("source"===n?(r=o.arrowStartX,i=o.arrowStartY,a=o.srcArrowAngle):(r=o.arrowEndX,i=o.arrowEndY,a=o.tgtArrowAngle),!(isNaN(r)||null==r||isNaN(i)||null==i||isNaN(a))&&null!=a&&"none"!==e.pstyle(n+"-arrow-shape").value){var s=e.pstyle(n+"-arrow-color").value,l=e.pstyle("opacity").value,u=e.pstyle("line-opacity").value,c=e.pstyle("width").pfValue,d=e.pstyle("arrow-scale").value,h=this.r.getArrowWidth(c,d),f=this.instanceCount,p=this.transformBuffer.getMatrixView(f);uj(p),uY(p,p,[r,i]),uW(p,p,[h,h]),uq(p,p,a),this.vertTypeBuffer.getView(f)[0]=3,uL(t,this.indexBuffer.getView(f)),uN(s,l*u,this.colorBuffer.getView(f)),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}},{key:"drawEdgeLine",value:function(e,t){if(e.visible()){var n=this._getEdgePoints(e);if(n){var r=e.pstyle("opacity").value,i=e.pstyle("line-opacity").value,a=e.pstyle("width").pfValue,o=e.pstyle("line-color").value,s=r*i;if(n.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),4==n.length){var l=this.instanceCount;this.vertTypeBuffer.getView(l)[0]=1,uL(t,this.indexBuffer.getView(l)),uN(o,s,this.colorBuffer.getView(l)),this.lineWidthBuffer.getView(l)[0]=a;var u=this.pointAPointBBuffer.getView(l);u[0]=n[0],u[1]=n[1],u[2]=n[2],u[3]=n[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var c=0;c=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(e){var t=e._private.rscratch;return!(t.badLine||null==t.allpts||isNaN(t.allpts[0]))}},{key:"_getEdgePoints",value:function(e){var t=e._private.rscratch;if(this._isValidEdge(e)){var n=t.allpts;if(4==n.length)return n;var r=this._getNumSegments(e);return this._getCurveSegmentPoints(n,r)}}},{key:"_getNumSegments",value:function(e){return Math.min(15,this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(e,t){if(4==e.length)return e;for(var n=Array((t+1)*2),r=0;r<=t;r++)if(0==r)n[0]=e[0],n[1]=e[1];else if(r==t)n[2*r]=e[e.length-2],n[2*r+1]=e[e.length-1];else{var i=r/t;this._setCurvePoint(e,i,n,2*r)}return n}},{key:"_setCurvePoint",value:function(e,t,n,r){if(e.length<=2)n[r]=e[0],n[r+1]=e[1];else{for(var i=Array(e.length-2),a=0;a0}},p=function(e){return"yes"===e.pstyle("text-events").strValue?u$.USE_BB:u$.IGNORE},g=function(e){var t=e.position(),n=t.x,r=t.y,i=e.outerWidth(),a=e.outerHeight();return{w:i,h:a,x1:n-i/2,y1:r-a/2}};u.drawing.addAtlasCollection("node",{texRows:e.webglTexRowsNodes}),u.drawing.addAtlasCollection("label",{texRows:e.webglTexRows}),u.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:t.getStyleKey,getBoundingBox:t.getElementBox,drawElement:t.drawElement}),u.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:g,isSimple:uI,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),u.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:g,isVisible:f("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),u.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:g,isVisible:f("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),u.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:p,getKey:u1(t.getLabelKey,null),getBoundingBox:u2(t.getLabelBox,null),drawClipped:!0,drawElement:t.drawLabel,getRotation:d(null),getRotationPoint:t.getLabelRotationPoint,getRotationOffset:t.getLabelRotationOffset,isVisible:h("label")}),u.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:p,getKey:u1(t.getSourceLabelKey,"source"),getBoundingBox:u2(t.getSourceLabelBox,"source"),drawClipped:!0,drawElement:t.drawSourceLabel,getRotation:d("source"),getRotationPoint:t.getSourceLabelRotationPoint,getRotationOffset:t.getSourceLabelRotationOffset,isVisible:h("source-label")}),u.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:p,getKey:u1(t.getTargetLabelKey,"target"),getBoundingBox:u2(t.getTargetLabelBox,"target"),drawClipped:!0,drawElement:t.drawTargetLabel,getRotation:d("target"),getRotationPoint:t.getTargetLabelRotationPoint,getRotationOffset:t.getTargetLabelRotationOffset,isVisible:h("target-label")});var v=eg(function(){console.log("garbage collect flag set"),u.data.gc=!0},1e4);u.onUpdateEleCalcs(function(e,t){var n=!1;t&&t.length>0&&(n|=u.drawing.invalidate(t)),n&&v()}),r=u.render,u.render=function(e){e=e||{};var t,n,i=u.cy;u.webgl&&(i.zoom()>7.99?((t=u.data.contexts[u.WEBGL]).clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),r.call(u,e)):((n=function(e){e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,u.canvasWidth,u.canvasHeight),e.restore()})(u.data.contexts[u.NODE]),n(u.data.contexts[u.DRAG]),u4(u,e,uZ.SCREEN)))},i=u.matchCanvasSize,u.matchCanvasSize=function(e){i.call(u,e),u.pickingFrameBuffer.setFramebufferAttachmentSizes(u.canvasWidth,u.canvasHeight),u.pickingFrameBuffer.needsDraw=!0},u.findNearestElements=function(e,t,n,r){return function(e,t,n){var r,i,a,s=function(e,t,n,r,i){var a,o,s=uR(e),u=s.pan,c=s.zoom,d=l((b=t*c+u.x,x=n*c+u.y,[b,x=Math.round(e.canvasHeight-x)]),2),h=d[0],f=d[1];a=h-3,o=f-3;var p=e.data.contexts[e.WEBGL];p.bindFramebuffer(p.FRAMEBUFFER,e.pickingFrameBuffer),e.pickingFrameBuffer.needsDraw&&(p.viewport(0,0,p.canvas.width,p.canvas.height),u4(e,null,uZ.PICKING),e.pickingFrameBuffer.needsDraw=!1);var g=new Uint8Array(144);p.readPixels(a,o,6,6,p.RGBA,p.UNSIGNED_BYTE,g),p.bindFramebuffer(p.FRAMEBUFFER,null);for(var v=new Set,y=0;y<36;y++){var b,x,w,E=(w=g.slice(4*y,4*y+4))[0]+(w[1]<<8)+(w[2]<<16)+(w[3]<<24)-1;E>=0&&v.add(E)}return v}(e,t,n),u=e.getCachedZSortedEles(),c=o(s);try{for(c.s();!(a=c.n()).done;){var d=u[a.value];if(!r&&d.isNode()&&(r=d),!i&&d.isEdge()&&(i=d),r&&i)break}}catch(e){c.e(e)}finally{c.f()}return[r,i].filter(Boolean)}(u,e,t)},a=u.invalidateCachedZSortedEles,u.invalidateCachedZSortedEles=function(){a.call(u),u.pickingFrameBuffer.needsDraw=!0},s=u.notify,u.notify=function(e,t){s.call(u,e,t),"viewport"===e||"bounds"===e?u.pickingFrameBuffer.needsDraw=!0:"background"===e&&u.drawing.invalidate(t,{type:"node-body"})}};var u1=function(e,t){return function(n){var r=e(n),i=u0(n,t);return i.length>1?i.map(function(e,t){return"".concat(r,"_").concat(t)}):r}},u2=function(e,t){return function(n,r){var i=e(n);if("string"==typeof r){var a=r.indexOf("_");if(a>0){var o=Number(r.substring(a+1)),s=u0(n,t),l=i.h/s.length,u=l*o,c=i.y1+u;return{x1:i.x1,w:i.w,y1:c,h:l,yOffset:u}}}return i}};function u5(e,t){var n=e.canvasWidth,r=e.canvasHeight,i=uR(e),a=i.pan,o=i.zoom;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,n,r),t.translate(a.x,a.y),t.scale(o,o)}function u3(e,t,n){var r=e.drawing;t+=1,n.isNode()?(r.drawNode(n,t,"node-underlay"),r.drawNode(n,t,"node-body"),r.drawTexture(n,t,"label"),r.drawNode(n,t,"node-overlay")):(r.drawEdgeLine(n,t),r.drawEdgeArrow(n,t,"source"),r.drawEdgeArrow(n,t,"target"),r.drawTexture(n,t,"label"),r.drawTexture(n,t,"edge-source-label"),r.drawTexture(n,t,"edge-target-label"))}function u4(e,t,n){e.webglDebug&&(G=performance.now());var r=e.drawing,i=0;if(n.screen&&e.data.canvasNeedsRedraw[e.SELECT_BOX]&&function(e,t){e.drawSelectionRectangle(t,function(t){return u5(e,t)})}(e,t),e.data.canvasNeedsRedraw[e.NODE]||n.picking){var a,s,l,u,c,d,h,f,p,g,v,y,b,x,w,E,T,C,k,P,S,B,D,_,A,M,R,I,N,L,O,z=e.data.contexts[e.WEBGL];n.screen?(z.clearColor(0,0,0,0),z.enable(z.BLEND),z.blendFunc(z.ONE,z.ONE_MINUS_SRC_ALPHA)):z.disable(z.BLEND),z.clear(z.COLOR_BUFFER_BIT|z.DEPTH_BUFFER_BIT),z.viewport(0,0,z.canvas.width,z.canvas.height);var V=(a=e.canvasWidth,s=e.canvasHeight,u=(l=uR(e)).pan,c=l.zoom,uY(d=uX(),d,[u.x,u.y]),uW(d,d,[c,c]),(f=h=uX())[0]=2/a,f[1]=0,f[2]=0,f[3]=0,f[4]=-2/s,f[5]=0,f[6]=-1,f[7]=1,f[8]=1,g=p=uX(),v=h[0],y=h[1],b=h[2],x=h[3],w=h[4],E=h[5],T=h[6],C=h[7],k=h[8],P=d[0],S=d[1],B=d[2],D=d[3],_=d[4],A=d[5],M=d[6],R=d[7],I=d[8],g[0]=P*v+S*x+B*T,g[1]=P*y+S*w+B*C,g[2]=P*b+S*E+B*k,g[3]=D*v+_*x+A*T,g[4]=D*y+_*w+A*C,g[5]=D*b+_*E+A*k,g[6]=M*v+R*x+I*T,g[7]=M*y+R*w+I*C,g[8]=M*b+R*E+I*k,p),F=e.getCachedZSortedEles();if(i=F.length,r.startFrame(V,n),n.screen){for(var X=0;X0&&a>0){h.clearRect(0,0,i,a),h.globalCompositeOperation="source-over";var f=this.getCachedZSortedEles();if(e.full)h.translate(-n.x1*l,-n.y1*l),h.scale(l,l),this.drawElements(h,f),h.scale(1/l,1/l),h.translate(n.x1*l,n.y1*l);else{var p=t.pan(),g={x:p.x*l,y:p.y*l};l*=t.zoom(),h.translate(g.x,g.y),h.scale(l,l),this.drawElements(h,f),h.scale(1/l,1/l),h.translate(-g.x,-g.y)}e.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=e.bg,h.rect(0,0,i,a),h.fill())}return d},ct.png=function(e){return cr(e,this.bufferCanvasImage(e),"image/png")},ct.jpg=function(e){return cr(e,this.bufferCanvasImage(e),"image/jpeg")};var ci={};ci.nodeShapeImpl=function(e,t,n,r,i,a,o,s){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,a);case"polygon":return this.drawPolygonPath(t,n,r,i,a,o);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,a,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,a,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,a,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,a,s);case"barrel":return this.drawBarrelPath(t,n,r,i,a)}};var ca=co.prototype;function co(e){var t=this,n=t.cy.window().document;e.webgl&&(ca.CANVAS_LAYERS=t.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),t.data={canvases:Array(ca.CANVAS_LAYERS),contexts:Array(ca.CANVAS_LAYERS),canvasNeedsRedraw:Array(ca.CANVAS_LAYERS),bufferCanvases:Array(ca.BUFFER_COUNT),bufferContexts:Array(ca.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=n.createElement("div");var a=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=i,a.position="relative",a.zIndex="0",a.overflow="hidden";var o=e.cy.container();o.appendChild(t.data.canvasContainer),o.style[r]=i;var s={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};E&&E.userAgent.match(/msie|trident|edge/i)&&(s["-ms-touch-action"]="none",s["touch-action"]="none");for(var l=0;l{if(!h.current)return;let e=[];t.forEach(t=>{e.push({data:{id:t.id,label:t.name||t.id.split(".").pop()||t.id,full_id:t.id,isAbstract:t.abstract?"yes":"no",isExternal:t.external?"yes":"no",raw:t}})});let r=new Set(t.map(e=>e.id));a.forEach(t=>{r.has(t.source)&&r.has(t.target)&&e.push({data:{id:t.id,source:t.source,target:t.target,label:t.field,edgeType:"rel"}})}),o.forEach(t=>{r.has(t.child)&&r.has(t.parent)&&e.push({data:{id:t.id||"inh_".concat(t.child,"_").concat(t.parent),source:t.child,target:t.parent,label:"inherits",edgeType:"inh"}})});let l=[{selector:"node",style:{label:"data(label)","font-family":"JetBrains Mono, Fira Code, ui-monospace, monospace","font-size":"13px","font-weight":600,color:m.nodeText,"text-valign":"center","text-halign":"center","background-color":m.nodeBg,"border-width":1.5,"border-color":m.nodeBorder,width:"label",height:"label",padding:"13px 22px",shape:"round-rectangle","overlay-opacity":0,cursor:"pointer"}},{selector:'node[isAbstract = "yes"]',style:{"border-color":"#E46E78","border-style":"dashed",color:u?"#fbcfe8":"#be185d"}},{selector:'node[isExternal = "yes"]',style:{"border-color":"#5B899E","border-style":"dotted","background-color":u?"#141219":"#f4f1f5",color:u?"#8F8F8F":"#5B899E"}},{selector:"node:selected",style:{"border-width":2,"border-color":m.nodeSelBorder,"background-color":m.nodeSelBg,color:m.nodeSelText}},{selector:"edge",style:{width:1.2,"line-color":m.edgeLine,"target-arrow-color":m.edgeLine,"target-arrow-shape":"triangle","curve-style":"bezier",opacity:.85,"arrow-scale":.8}},{selector:'edge[edgeType = "rel"]',style:{label:"data(label)","font-family":"JetBrains Mono, Fira Code, monospace","font-size":"11px","font-weight":500,color:m.edgeText,"text-rotation":"autorotate","text-background-opacity":1,"text-background-color":m.canvasBg,"text-background-padding":"4px 8px","text-background-shape":"roundrectangle"}},{selector:'edge[edgeType = "inh"]',style:{"line-style":"dashed","line-color":m.inhEdge,"target-arrow-color":m.inhEdge,"target-arrow-shape":"triangle-backcurve",opacity:.65}},{selector:".dimmed",style:{opacity:.05}},{selector:".lit",style:{opacity:1,"line-color":m.accent,"target-arrow-color":m.accent,width:2,color:m.accent,"font-weight":600,"text-background-opacity":1,"text-background-color":m.canvasBg}},{selector:"edge:selected",style:{opacity:1,"line-color":m.accent,"target-arrow-color":m.accent,width:2,color:m.accent,"font-weight":600,"text-background-opacity":1,"text-background-color":m.canvasBg}}],i=(0,N.Z)({container:h.current,elements:e,style:l,layout:M(s)});return p.current=i,null==x||x(i),i.on("mouseover","node",e=>{let t=e.target.closedNeighborhood();i.elements().not(t).addClass("dimmed"),t.edges().addClass("lit")}),i.on("mouseout","node",()=>{i.elements().removeClass("dimmed").removeClass("lit")}),i.on("mouseover","edge",e=>{e.target.addClass("lit")}),i.on("mouseout","edge",e=>{e.target.removeClass("lit")}),i.on("tap","node",e=>{let t=e.target.data("raw");t&&n(t)}),i.on("tap",e=>{e.target===i&&i.elements().unselect()}),()=>i.destroy()},[t,a,o,s,u]),(0,l.useEffect)(()=>{if(!p.current||!i)return;let e=p.current.$("#".concat(i.replace(/\./g,"\\.")));e.length&&(p.current.elements().unselect(),e.select(),p.current.animate({center:{eles:e},zoom:1.3},{duration:280}))},[i]),(0,l.useEffect)(()=>{p.current&&c>0&&p.current.fit(void 0,50)},[c]),(0,l.useEffect)(()=>{p.current&&0!==d&&p.current.layout(M(s)).run()},[d,s]),(0,r.jsx)("div",{ref:h,className:"w-full h-full",style:{cursor:"grab"}})}var T=a(60895),R=a(49902),z=a(62360),_=a(53459),L=a(3289),B=a(47969),D=a(34368),A=a(34161),F=a.n(A),O=a(57635),Z=a.n(O);async function P(e){let{models:t,relationships:a,title:r,isDark:l=!0}=e;if(0===t.length)return null;let o=new(F()).graphlib.Graph;o.setGraph({rankdir:"LR",nodesep:80,ranksep:200}),o.setDefaultEdgeLabel(()=>({}));let s={};t.forEach(e=>{let t=Math.min((Array.isArray(e.fields)?e.fields:Object.values(e.fields||{})).length,16);o.setNode(e.id,{width:260,height:48+22*t+16})});let n=new Set(t.map(e=>e.id)),i=a.filter(e=>n.has(e.source)&&n.has(e.target));i.forEach(e=>{o.setEdge(e.source,e.target)}),F().layout(o),t.forEach(e=>{let t=o.node(e.id);t&&(s[e.id]={x:t.x-t.width/2,y:t.y-t.height/2,width:t.width,height:t.height})});let c=Object.values(s);if(!c.length)return null;let d=Math.min(...c.map(e=>e.x))-100,x=Math.max(...c.map(e=>e.x+e.width))+100,u=Math.min(...c.map(e=>e.y))-100,h=Math.max(...c.map(e=>e.y+e.height))+100,p=x-d+320,m=h-u+320,g=2;(2*p>8192||m*g>8192||p*g*(m*g)>5e7)&&(g=Math.max(.75,Math.min(Math.min(8192/p,8192/m),Math.sqrt(5e7/(p*m)))));let f=document.createElement("canvas");f.width=Math.round(p*g),f.height=Math.round(m*g);let b=f.getContext("2d");if(!b)return null;b.scale(g,g),b.fillStyle=l?"#0e0d12":"#fcfbfe",b.fillRect(0,0,f.width,f.height),b.save(),b.translate(160-d,160-u),i.forEach(e=>{let t=s[e.source],a=s[e.target];if(!t||!a)return;let r=t.x+t.width,o=t.y+Math.min(t.height,120)/2,n=a.x,i=a.y+Math.min(a.height,120)/2,c=Math.max(.45*Math.abs(n-r),60);b.beginPath(),b.moveTo(r,o),b.bezierCurveTo(r+c,o,n-c,i,n,i),b.strokeStyle=l?"rgba(0, 160, 157, 0.45)":"rgba(1, 126, 132, 0.40)",b.lineWidth=1.6,b.stroke()}),t.forEach(e=>{let t=s[e.id];t&&(b.fillStyle=l?"#16131c":"#ffffff",b.strokeStyle=l?"#2d2535":"rgba(113, 75, 103, 0.18)",b.lineWidth=1.2,b.beginPath(),b.roundRect(t.x,t.y,t.width,t.height,10),b.fill(),b.stroke(),b.fillStyle=l?"rgba(1, 126, 132, 0.20)":"rgba(1, 126, 132, 0.08)",b.beginPath(),b.roundRect(t.x,t.y,t.width,42,[10,10,0,0]),b.fill(),b.beginPath(),b.moveTo(t.x,t.y+42),b.lineTo(t.x+t.width,t.y+42),b.strokeStyle=l?"#2d2535":"rgba(1, 126, 132, 0.18)",b.stroke(),b.fillStyle=l?"#f5f3f7":"#1f1824",b.font='600 12.5px "Inter", -apple-system, sans-serif',b.fillText(e.name||e.id,t.x+14,t.y+26),(Array.isArray(e.fields)?e.fields:Object.values(e.fields||{})).slice(0,16).forEach((e,a)=>{let r=t.y+48+22*a,o=U(e.type||e.field_type);b.fillStyle=o.bg,b.fillRect(t.x+14,r+3,7,7),b.fillStyle=l?"#f5f3f7":"#1f1824",b.font='500 11.5px "JetBrains Mono", monospace',b.fillText(e.name,t.x+28,r+11),b.fillStyle="#8F8F8F",b.font='italic 10px "JetBrains Mono", monospace',b.textAlign="right",b.fillText(e.type||e.field_type||"",t.x+t.width-14,r+11),b.textAlign="left"}))}),b.restore();let y=Math.min(g,2),v=Math.round(95*y),j=Math.round(85*y);return b.textAlign="right",b.textBaseline="bottom",b.font="700 ".concat(Math.round(28*y),'px "Inter", -apple-system, sans-serif'),b.fillStyle=l?"#00A09D":"#017E84",b.fillText("ORMGraph \xb7 ".concat(r),f.width-v,f.height-j-Math.round(30*y)),b.font="500 ".concat(Math.round(18*y),'px "JetBrains Mono", monospace'),b.fillStyle=l?"rgba(245, 243, 247, 0.75)":"rgba(31, 24, 36, 0.75)",b.fillText("iampiyush.one • github.com/iam-piyush",f.width-v,f.height-j),new Promise(e=>{f.toBlob(t=>e(t),"image/png")})}async function I(e){var t;let{models:a,relationships:r,filename:l="ormgraph_erd.png",isDark:o=!0}=e,s=(null===(t=a[0])||void 0===t?void 0:t.module)?"ERD \xb7 ".concat(a[0].module):"ERD Studio",n=await P({models:a,relationships:r,title:s,isDark:o});if(n){let e=URL.createObjectURL(n),t=document.createElement("a");t.href=e,t.download=l,document.body.appendChild(t),t.click(),t.remove(),setTimeout(()=>URL.revokeObjectURL(e),1e3)}}async function W(e){let{moduleName:t,models:a,relationships:r,isDark:l=!0,onProgress:o}=e,s=new(Z()),n=s.folder("".concat(t,"_erd_clusters"));null==o||o(5,"Large Architecture Detected (".concat(a.length," models) → Partitioning ERD into clusters…"));let i=new Set(a.map(e=>e.id)),c=new Map(a.map(e=>[e.id,e])),d={};a.forEach(e=>{d[e.id]=0});let x=r.filter(e=>i.has(e.source)&&i.has(e.target));x.forEach(e=>{d[e.source]=(d[e.source]||0)+1,d[e.target]=(d[e.target]||0)+1});let u=[...a].sort((e,t)=>(d[t.id]||0)-(d[e.id]||0)),h=[],p=u.slice(0,Math.min(8,a.length)),m=new Set(p.map(e=>e.id));h.push({name:"00_overview_core_erd_tables",label:"".concat(t," \xb7 Core ERD Overview"),models:p,relationships:x.filter(e=>m.has(e.source)&&m.has(e.target))});let g=new Set;u.filter(e=>(d[e.id]||0)>=2).slice(0,8).forEach((e,a)=>{if(g.has(e.id))return;g.add(e.id);let r=new Set([e.id]);x.forEach(t=>{t.source===e.id&&r.add(t.target),t.target===e.id&&r.add(t.source)});let l=Array.from(r).map(e=>c.get(e)).filter(Boolean),o=x.filter(e=>r.has(e.source)&&r.has(e.target)),s=e.id.replace(/\./g,"_");h.push({name:"0".concat(a+1,"_hub_").concat(s,"_erd"),label:"".concat(t," \xb7 ").concat(e.id," ERD Hub"),models:l,relationships:o})});let f=new Set(h.flatMap(e=>e.models.map(e=>e.id))),b=a.filter(e=>!f.has(e.id));if(b.length>0){let e=new Set(b.map(e=>e.id));h.push({name:"09_secondary_models_erd",label:"".concat(t," \xb7 Secondary ERD Tables"),models:b,relationships:x.filter(t=>e.has(t.source)&&e.has(t.target))})}for(let e=0;e({filename:"".concat(e.name,".png"),label:e.label,model_count:e.models.length,models:e.models.map(e=>e.id)})),creator:{website:"https://iampiyush.one",github:"https://github.com/iam-piyush"}};null==n||n.file("manifest.json",JSON.stringify(y,null,2)),null==n||n.file("README.md","# ".concat(t," ERD Architecture Clusters\n\n")+"This module contains **".concat(a.length," models**.\n")+"Rendered as **".concat(h.length," isolated ERD database schema table diagrams**.\n\n")+"### Generated by ORMGraph for Odoo\n- Website: [iampiyush.one](https://iampiyush.one)\n- GitHub: [github.com/iam-piyush](https://github.com/iam-piyush)\n"),null==o||o(95,"Compressing ERD ZIP bundle…");let v=await s.generateAsync({type:"blob"}),j=URL.createObjectURL(v),w=document.createElement("a");w.href=j,w.download="".concat(t,"_erd_clusters.zip"),document.body.appendChild(w),w.click(),w.remove(),setTimeout(()=>URL.revokeObjectURL(j),1e3),null==o||o(100,"Download Ready!")}async function G(e){let{graphData:t,isDark:a=!0,onProgress:r}=e,l=new(Z()),o=l.folder("ormgraph_erd_architecture"),s=null==o?void 0:o.folder("erd_modules"),n={};t.models.forEach(e=>{let t=e.module||"custom";n[t]||(n[t]=[]),n[t].push(e)});let i=Object.keys(n).sort(),c=i.length;if(0===c)return;null==r||r(5,"Initializing ERD Database Schema Bundle…");for(let e=0;ee.id)),u=t.relationships.filter(e=>x.has(e.source)&&x.has(e.target)),h=await P({models:o,relationships:u,title:"ERD \xb7 ".concat(l),isDark:a});h&&(null==s||s.file("".concat(l,"_erd.png"),h))}let d={project:"Odoo ORM Database Schema ERD Export",generated_at:new Date().toISOString(),creator:{github:"https://github.com/iam-piyush",website:"https://iampiyush.one"},stats:{total_models:t.models.length,total_modules:c,total_relationships:t.relationships.length},modules:i.map(e=>({name:e,model_count:n[e].length,models:n[e].map(e=>e.id)}))};null==o||o.file("manifest.json",JSON.stringify(d,null,2)),null==o||o.file("README.md","# ORMGraph ERD Architecture Export for Odoo\n\n"+"Exported **".concat(c," modules** as interactive ERD database table schema diagrams.\n\n")+"### Creator:\n- Website: [iampiyush.one](https://iampiyush.one)\n- GitHub: [github.com/iam-piyush](https://github.com/iam-piyush)\n"),null==r||r(95,"Compressing ERD ZIP bundle…");let x=await l.generateAsync({type:"blob"}),u=URL.createObjectURL(x),h=document.createElement("a");h.href=u,h.download="ormgraph_erd_bundle_".concat(new Date().toISOString().slice(0,10),".zip"),document.body.appendChild(h),h.click(),h.remove(),setTimeout(()=>URL.revokeObjectURL(u),1e3),null==r||r(100,"Complete!")}function U(e){let t=(e||"").toLowerCase();return t.startsWith("many2one")||t.startsWith("foreign_key")||t.startsWith("one2one")?{bg:"#E4A900",text:"#fffbeb",label:"many2one"}:t.startsWith("one2many")||t.startsWith("many2many")?{bg:"#017E84",text:"#e6fffa",label:"many2many"}:t.includes("char")||t.includes("text")||t.includes("html")||t.includes("slug")?{bg:"#5B899E",text:"#f0f7fa",label:"char"}:t.includes("int")||t.includes("float")||t.includes("decimal")||t.includes("monetary")||t.includes("number")?{bg:"#21B799",text:"#e6fffa",label:"number"}:t.includes("bool")?{bg:"#714B67",text:"#fbf7fa",label:"boolean"}:t.includes("date")||t.includes("time")?{bg:"#E46E78",text:"#fff1f2",label:"datetime"}:t.includes("binary")||t.includes("image")||t.includes("file")?{bg:"#8F8F8F",text:"#f8f8f8",label:"binary"}:{bg:"#8F8F8F",text:"#f8f8f8",label:"field"}}function H(e){let{models:t,relationships:a,onSelectModel:n,selectedModelId:i,isDark:c=!0}=e,d=(0,l.useRef)(null),[x,p]=(0,l.useState)({}),[m,g]=(0,l.useState)("LR"),[y,v]=(0,l.useState)(""),[j,w]=(0,l.useState)({}),[k,N]=(0,l.useState)(.85),[S,E]=(0,l.useState)({x:120,y:80}),[M,C]=(0,l.useState)(!1),[A,O]=(0,l.useState)({x:0,y:0}),[Z,P]=(0,l.useState)(null),[I,G]=(0,l.useState)({x:0,y:0}),[H,J]=(0,l.useState)(!1),[Y,X]=(0,l.useState)(0),[q,K]=(0,l.useState)(null),[$,V]=(0,l.useState)(null),Q=(0,l.useCallback)(e=>{let r=new(F()).graphlib.Graph;r.setGraph({rankdir:e,nodesep:90,ranksep:220,marginx:100,marginy:100}),r.setDefaultEdgeLabel(()=>({}));let l=new Set(t.map(e=>e.id));t.forEach(e=>{let t=j[e.id],a=Array.isArray(e.fields)?e.fields:Object.values(e.fields||{}),l=52+23*(t?0:Math.min(a.length,16))+(a.length>16&&!t?24:12);r.setNode(e.id,{width:280,height:l})}),a.forEach(e=>{l.has(e.source)&&l.has(e.target)&&r.setEdge(e.source,e.target)}),F().layout(r);let o={};r.nodes().forEach(e=>{let t=r.node(e);t&&(o[e]={x:t.x-t.width/2,y:t.y-t.height/2,width:t.width,height:t.height})}),p(o)},[t,a,j]);(0,l.useEffect)(()=>{Q(m)},[Q,m]);let ee=(0,l.useCallback)(()=>{let e=Object.values(x);if(!e.length||!d.current)return;let t=Math.min(...e.map(e=>e.x)),a=Math.max(...e.map(e=>e.x+e.width)),r=Math.min(...e.map(e=>e.y)),l=Math.max(...e.map(e=>e.y+e.height)),o=d.current.getBoundingClientRect();if(!o.width||!o.height)return;let s=Math.min(Math.max(.9*Math.min((o.width-40)/(a-t+180),(o.height-40)/(l-r+180)),.2),1.05);N(s),E({x:o.width/2-(t+a)/2*s,y:o.height/2-(r+l)/2*s})},[x]);(0,l.useEffect)(()=>{if(Object.keys(x).length>0){let e=setTimeout(()=>{ee()},50);return()=>clearTimeout(e)}},[x,ee]);let et=(e,t)=>{e.stopPropagation();let a=x[t];a&&(P(t),G({x:(e.clientX-S.x)/k-a.x,y:(e.clientY-S.y)/k-a.y}))},ea=(0,l.useMemo)(()=>{if(!y.trim())return t;let e=y.toLowerCase();return t.filter(t=>t.id.toLowerCase().includes(e)||(t.name||"").toLowerCase().includes(e))},[t,y]),er=(0,l.useMemo)(()=>new Set(ea.map(e=>e.id)),[ea]),el=async()=>{if(!d.current)return;let e=Object.values(x);if(!e.length)return;if(J(!0),X(15),t.length>20){try{var r;await W({moduleName:(null===(r=t[0])||void 0===r?void 0:r.module)||"erd_architecture",models:t,relationships:a,isDark:c,onProgress:e=>X(e)})}catch(e){console.error("ERD ZIP export failed:",e)}finally{J(!1)}return}await new Promise(e=>setTimeout(e,60));let l=Math.min(...e.map(e=>e.x))-100,o=Math.max(...e.map(e=>e.x+e.width))+100,s=Math.min(...e.map(e=>e.y))-100,n=Math.max(...e.map(e=>e.y+e.height))+100,i=o-l+360,u=n-s+360,h=2;(2*i>8192||u*h>8192||i*h*(u*h)>5e7)&&(h=Math.max(.75,Math.min(Math.min(8192/i,8192/u),Math.sqrt(5e7/(i*u))))),X(45),await new Promise(e=>setTimeout(e,60));let p=document.createElement("canvas");p.width=Math.round(i*h),p.height=Math.round(u*h);let m=p.getContext("2d");if(!m){J(!1);return}m.scale(h,h),m.fillStyle=c?"#0e0d12":"#fcfbfe",m.fillRect(0,0,p.width,p.height),m.save(),m.scale(h,h),m.translate(180-l,180-s),a.forEach(e=>{let t=x[e.source],a=x[e.target];if(!t||!a)return;let r=t.x+t.width,l=t.y+Math.min(t.height,120)/2,o=a.x,s=a.y+Math.min(a.height,120)/2,n=Math.max(.45*Math.abs(o-r),60);m.beginPath(),m.moveTo(r,l),m.bezierCurveTo(r+n,l,o-n,s,o,s),m.strokeStyle=c?"rgba(0, 160, 157, 0.45)":"rgba(1, 126, 132, 0.40)",m.lineWidth=1.6,m.stroke()}),X(75),await new Promise(e=>setTimeout(e,60)),t.forEach(e=>{let t=x[e.id];t&&(m.fillStyle=c?"#16131c":"#ffffff",m.strokeStyle=c?"#2d2535":"rgba(113, 75, 103, 0.18)",m.lineWidth=1.2,m.beginPath(),m.roundRect(t.x,t.y,t.width,t.height,10),m.fill(),m.stroke(),m.fillStyle=c?"rgba(113, 75, 103, 0.25)":"rgba(113, 75, 103, 0.08)",m.beginPath(),m.roundRect(t.x,t.y,t.width,42,[10,10,0,0]),m.fill(),m.beginPath(),m.moveTo(t.x,t.y+42),m.lineTo(t.x+t.width,t.y+42),m.strokeStyle=c?"#2d2535":"rgba(113, 75, 103, 0.14)",m.stroke(),m.fillStyle=c?"#f5f3f7":"#1f1824",m.font='600 13px "Inter", -apple-system, sans-serif',m.fillText(e.name||e.id,t.x+14,t.y+26),(Array.isArray(e.fields)?e.fields:Object.values(e.fields||{})).slice(0,16).forEach((e,a)=>{let r=t.y+48+22*a,l=U(e.type||e.field_type);m.fillStyle=l.bg,m.fillRect(t.x+14,r+3,7,7),m.fillStyle=c?"#f5f3f7":"#1f1824",m.font='500 11.5px "JetBrains Mono", monospace',m.fillText(e.name,t.x+28,r+11),m.fillStyle="#8F8F8F",m.font='italic 10px "JetBrains Mono", monospace',m.textAlign="right",m.fillText(e.type||e.field_type||"",t.x+t.width-14,r+11),m.textAlign="left"}))}),m.restore(),X(90);let g=Math.min(h,2),f=Math.round(95*g),b=Math.round(85*g);m.textAlign="right",m.textBaseline="bottom",m.font="700 ".concat(Math.round(32*g),'px "Inter", -apple-system, BlinkMacSystemFont, sans-serif'),m.fillStyle=c?"#9E6D91":"#714B67",m.fillText("ORMGraph for Odoo",p.width-f,p.height-b-Math.round(34*g)),m.font="500 ".concat(Math.round(22*g),'px "JetBrains Mono", monospace'),m.fillStyle=c?"rgba(245, 243, 247, 0.75)":"rgba(31, 24, 36, 0.75)",m.fillText("iampiyush.one • github.com/iam-piyush",p.width-f,p.height-b),X(100),p.toBlob(e=>{if(e&&e.size>0){let t=URL.createObjectURL(e),a=document.createElement("a");a.href=t,a.download="ormgraph_erd_export.png",document.body.appendChild(a),a.click(),a.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}J(!1)},"image/png")};return(0,r.jsxs)("div",{ref:d,onMouseDown:e=>{e.target.closest(".erd-card")||(C(!0),O({x:e.clientX-S.x,y:e.clientY-S.y}))},onMouseMove:e=>{if(M)E({x:e.clientX-A.x,y:e.clientY-A.y});else if(Z&&x[Z]){let t=x[Z];p(a=>({...a,[Z]:{...t,x:(e.clientX-S.x)/k-I.x,y:(e.clientY-S.y)/k-I.y}}))}},onMouseUp:()=>{C(!1),P(null)},onWheel:e=>{e.preventDefault();let t=Math.min(Math.max(k*(e.deltaY>0?.92:1.08),.2),2.5);if(d.current){let a=d.current.getBoundingClientRect(),r=e.clientX-a.left,l=e.clientY-a.top;E(e=>({x:r-(r-e.x)*(t/k),y:l-(l-e.y)*(t/k)})),N(t)}},className:"relative w-full h-full overflow-hidden select-none",style:{background:"var(--bg)",cursor:M?"grabbing":"grab"},children:[(0,r.jsx)("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:"radial-gradient(circle, ".concat(c?"rgba(255,255,255,0.065)":"rgba(0,0,0,0.08)"," 1px, transparent 1px)"),backgroundSize:"24px 24px"}}),(0,r.jsxs)("div",{className:"absolute top-4 left-5 z-20 flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(f.Z,{size:13,className:"absolute left-3 top-2.5",style:{color:"var(--text-3)"}}),(0,r.jsx)("input",{type:"text",placeholder:"Filter ERD tables…",value:y,onChange:e=>v(e.target.value),className:"pl-8 pr-8 py-1.5 rounded-lg text-xs font-mono outline-none",style:{background:"var(--bg-1)",border:"1px solid var(--border)",color:"var(--text-1)",width:210,boxShadow:"0 4px 12px rgba(0,0,0,0.2)"}}),y&&(0,r.jsx)("button",{onClick:()=>v(""),className:"absolute right-2.5 top-2.5 text-xs text-stone-400",children:(0,r.jsx)(b.Z,{size:13})})]}),(0,r.jsxs)("div",{className:"flex items-center p-0.5 rounded-lg text-xs font-mono font-medium",style:{background:"var(--bg-1)",border:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,0.2)"},children:[(0,r.jsx)("button",{onClick:()=>g("LR"),className:"px-2.5 py-1 rounded-md transition-colors",style:{background:"LR"===m?"var(--accent-soft)":"transparent",color:"LR"===m?"var(--accent)":"var(--text-3)",fontWeight:"LR"===m?600:400},children:"Horizontal"}),(0,r.jsx)("button",{onClick:()=>g("TB"),className:"px-2.5 py-1 rounded-md transition-colors",style:{background:"TB"===m?"var(--accent-soft)":"transparent",color:"TB"===m?"var(--accent)":"var(--text-3)",fontWeight:"TB"===m?600:400},children:"Vertical"})]})]}),(0,r.jsxs)("div",{className:"absolute top-4 right-5 z-20 flex items-center gap-1.5 p-1 rounded-lg",style:{background:"var(--bg-1)",border:"1px solid var(--border)",boxShadow:"0 8px 24px rgba(0,0,0,0.25)"},children:[(0,r.jsx)("button",{onClick:()=>N(e=>Math.min(1.15*e,2.5)),title:"Zoom In",className:"p-1.5 rounded-md hover:bg-neutral-800 transition-colors",style:{color:"var(--text-2)"},children:(0,r.jsx)(T.Z,{size:15})}),(0,r.jsx)("button",{onClick:()=>N(e=>Math.max(.85*e,.2)),title:"Zoom Out",className:"p-1.5 rounded-md hover:bg-neutral-800 transition-colors",style:{color:"var(--text-2)"},children:(0,r.jsx)(R.Z,{size:15})}),(0,r.jsx)("button",{onClick:ee,title:"Fit to Screen",className:"p-1.5 rounded-md hover:bg-neutral-800 transition-colors",style:{color:"var(--text-2)"},children:(0,r.jsx)(u.Z,{size:15})}),(0,r.jsx)("button",{onClick:()=>{N(1),E({x:100,y:80})},title:"Reset Zoom",className:"p-1.5 rounded-md hover:bg-neutral-800 transition-colors",style:{color:"var(--text-2)"},children:(0,r.jsx)(z.Z,{size:15})}),(0,r.jsx)("div",{style:{width:1,height:16,background:"var(--border)",margin:"0 3px"}}),(0,r.jsxs)("button",{onClick:el,disabled:H,title:"Export ERD Diagram as High-Resolution PNG with Watermark",className:"flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-semibold disabled:opacity-50",style:{background:"var(--accent)",color:"#fff",cursor:H?"default":"pointer"},children:[H?(0,r.jsx)(_.Z,{size:13,className:"animate-spin"}):(0,r.jsx)(h.Z,{size:13}),(0,r.jsx)("span",{children:H?"Exporting…":"Export PNG"})]})]}),(0,r.jsx)(s.M,{children:H&&(0,r.jsx)(o.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 z-50 flex flex-col items-center justify-center",style:{background:"rgba(14, 13, 18, 0.85)",backdropFilter:"blur(8px)"},children:(0,r.jsxs)("div",{className:"p-6 rounded-2xl max-w-xs w-full text-center space-y-4",style:{background:"var(--bg-1)",border:"1px solid var(--border)",boxShadow:"var(--card-shadow)"},children:[(0,r.jsx)("div",{className:"w-10 h-10 mx-auto rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--accent)",borderTopColor:"transparent"}}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("p",{className:"font-semibold text-sm",style:{color:"var(--text-1)"},children:"Rendering ERD Diagram…"}),(0,r.jsxs)("p",{className:"font-mono text-xs",style:{color:"var(--accent)"},children:[Y,"%"]})]}),(0,r.jsx)("div",{className:"w-full h-1.5 rounded-full overflow-hidden",style:{background:"var(--bg-3)"},children:(0,r.jsx)(o.E.div,{className:"h-full rounded-full",style:{background:"var(--accent)"},animate:{width:"".concat(Y,"%")},transition:{ease:"easeOut",duration:.15}})})]})})}),(0,r.jsxs)("div",{style:{transform:"translate(".concat(S.x,"px, ").concat(S.y,"px) scale(").concat(k,")"),transformOrigin:"0 0",position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none"},children:[(0,r.jsxs)("svg",{className:"absolute inset-0 overflow-visible",style:{width:"100%",height:"100%",pointerEvents:"none"},children:[(0,r.jsx)("defs",{children:(0,r.jsx)("marker",{id:"erd-arrow",viewBox:"0 0 10 10",refX:"7",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:(0,r.jsx)("path",{d:"M 0 1.5 L 8 5 L 0 8.5 z",fill:c?"#00A09D":"#017E84"})})}),a.map(e=>{let t=x[e.source],a=x[e.target];if(!t||!a||!er.has(e.source)&&!er.has(e.target))return null;let l=q===e.source||q===e.target||$===e.id||i===e.source||i===e.target,o=t.xV(e.id),onMouseLeave:()=>V(null)})]},e.id)})]}),(0,r.jsx)("div",{className:"erd-cards-layer absolute inset-0 pointer-events-auto",children:t.map(e=>{let t=x[e.id];if(!t)return null;let a=er.has(e.id),l=i===e.id,o=q===e.id,s=!!j[e.id],d=Array.isArray(e.fields)?e.fields:Object.values(e.fields||{});return(0,r.jsxs)("div",{className:"erd-card absolute rounded-xl transition-shadow",style:{left:t.x,top:t.y,width:t.width,opacity:a?1:.15,background:c?"var(--bg-1)":"#ffffff",border:"1.5px solid ".concat(l?"var(--accent)":o?"var(--border-hover)":"var(--border)"),boxShadow:l?"0 0 0 3px var(--accent-soft), 0 16px 36px rgba(0,0,0,0.45)":"0 8px 24px rgba(0,0,0,0.25)",zIndex:l?15:o?12:5},onMouseEnter:()=>K(e.id),onMouseLeave:()=>K(null),onClick:()=>n(e),children:[(0,r.jsxs)("div",{onMouseDown:t=>et(t,e.id),className:"flex items-center justify-between px-3.5 py-2.5 rounded-t-xl cursor-move select-none",style:{background:c?"rgba(255,255,255,0.03)":"#f8fafc",borderBottom:"1px solid var(--border)"},children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1 pr-2",children:[(0,r.jsx)("div",{className:"flex items-center gap-1.5 truncate",children:(0,r.jsx)("span",{className:"font-semibold text-xs truncate",style:{color:"var(--text-1)"},children:e.name||e.id})}),(0,r.jsxs)("div",{className:"font-mono text-[10.5px] truncate",style:{color:"var(--text-3)"},children:["(",e.id,")"]})]}),(0,r.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),w(t=>({...t,[e.id]:!t[e.id]}))},className:"p-1 rounded text-stone-400 hover:text-white",title:s?"Expand fields":"Collapse fields",children:s?(0,r.jsx)(L.Z,{size:14}):(0,r.jsx)(B.Z,{size:14})})]}),!s&&(0,r.jsxs)("div",{className:"p-2 space-y-0.5 max-h-72 overflow-y-auto font-mono text-[11px]",children:[0===d.length?(0,r.jsx)("div",{className:"py-2 text-center text-[10px]",style:{color:"var(--text-3)"},children:"No fields defined"}):d.slice(0,20).map(e=>{let t=U(e.type||e.field_type),a=!!(e.comodel||e.comodel_name);return(0,r.jsxs)("div",{className:"flex items-center justify-between px-2 py-1 rounded hover:bg-neutral-800/40 transition-colors",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-sm shrink-0",style:{background:t.bg},title:e.type||e.field_type}),(0,r.jsx)("span",{className:"truncate font-medium",style:{color:a?"var(--accent)":"var(--text-1)"},children:e.name})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[(0,r.jsx)("span",{className:"italic text-[10px]",style:{color:"var(--text-3)"},children:e.type||e.field_type}),a&&(0,r.jsx)(D.Z,{size:10,style:{color:"var(--accent)"}})]})]},e.name)}),d.length>20&&(0,r.jsxs)("div",{className:"pt-1 text-center text-[10px]",style:{color:"var(--text-3)"},children:["+",d.length-20," more fields…"]})]})]},e.id)})})]})]})}var J=a(93835),Y=a(91230);async function X(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{filename:a="ormgraph_export.png",isDark:r=!0,elements:l,padding:o=180,onProgress:s}=t;null==s||s(15);let n=r?"#0e0d12":"#fcfbfe";l&&e.elements().not(l).style({display:"none"});let i=e.elements().boundingBox(),c=Math.max(i.w,400),d=Math.max(i.h,400),x=c+2*o,u=d+2*o,h=2.5;(2.5*x>8192||u*h>8192||x*h*(u*h)>5e7)&&(h=Math.max(.8,Math.min(Math.min(8192/x,8192/u),Math.sqrt(5e7/(x*u))))),null==s||s(40);let p=e.png({output:"base64uri",scale:h,full:!0,bg:n});if(l&&e.elements().style({display:"element"}),!p||"data:,"===p)throw Error("Canvas render buffer exceeded. Please try selecting a smaller module.");return null==s||s(65),new Promise((e,t)=>{let l=new Image;l.onload=()=>{try{let i=document.createElement("canvas"),c=o*h;i.width=l.width+2*c,i.height=l.height+2*c;let d=i.getContext("2d");if(!d){t(Error("Could not obtain canvas 2D context"));return}d.fillStyle=n,d.fillRect(0,0,i.width,i.height),d.drawImage(l,c,c),null==s||s(85);let x=95*Math.min(h,2),u=85*Math.min(h,2);d.textAlign="right",d.textBaseline="bottom",d.font="700 ".concat(Math.round(30*Math.min(h,2)),'px "Inter", -apple-system, BlinkMacSystemFont, sans-serif'),d.fillStyle=r?"#9E6D91":"#714B67",d.fillText("ORMGraph for Odoo",i.width-x,i.height-u-Math.round(32*Math.min(h,2))),d.font="500 ".concat(Math.round(20*Math.min(h,2)),'px "JetBrains Mono", Menlo, Monaco, monospace'),d.fillStyle=r?"rgba(245, 243, 247, 0.70)":"rgba(31, 24, 36, 0.70)",d.fillText("iampiyush.one • github.com/iam-piyush",i.width-x,i.height-u),null==s||s(100),i.toBlob(r=>{if(!r||0===r.size){t(Error("PNG export produced an empty file."));return}let l=URL.createObjectURL(r),o=document.createElement("a");o.href=l,o.download=a,document.body.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(l),1e3),e()},"image/png")}catch(e){t(e)}},l.onerror=()=>t(Error("Failed to load raw image for compositing")),l.src=p})}function q(e){var t,a,l,n;let{model:i,onClose:c,onFocus:d,cy:x,isDark:u=!0}=e;return(0,r.jsx)(s.M,{children:i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.18},onClick:c,className:"fixed inset-0 z-30",style:{background:"rgba(0,0,0,0.4)"}},"backdrop"),(0,r.jsxs)(o.E.aside,{initial:{x:"100%",opacity:0},animate:{x:0,opacity:1},exit:{x:"100%",opacity:0},transition:{type:"spring",damping:30,stiffness:280},className:"fixed top-0 right-0 bottom-0 z-40 flex flex-col",style:{width:440,background:u?"var(--bg-1)":"#fff",borderLeft:"1px solid var(--border)"},children:[(0,r.jsxs)("div",{className:"flex items-start justify-between p-6 pb-4",style:{borderBottom:"1px solid var(--border)"},children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1 pr-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[(0,r.jsx)("span",{style:{fontSize:10,fontFamily:"monospace",fontWeight:700,letterSpacing:"0.1em",textTransform:"uppercase",padding:"2px 7px",borderRadius:4,background:"var(--accent-soft)",color:"var(--accent)",border:"1px solid var(--accent-border)"},children:i.framework}),i.abstract&&(0,r.jsx)("span",{style:{fontSize:10,fontFamily:"monospace",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.1em",padding:"2px 7px",borderRadius:4,background:"rgba(168,85,247,0.1)",color:"#a855f7",border:"1px solid rgba(168,85,247,0.2)"},children:"abstract"}),i.external&&(0,r.jsx)("span",{style:{fontSize:10,fontFamily:"monospace",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.1em",padding:"2px 7px",borderRadius:4,background:"var(--bg-3)",color:"var(--text-3)",border:"1px solid var(--border)"},children:"external"})]}),(0,r.jsx)("h2",{style:{fontFamily:"monospace",fontWeight:600,fontSize:15,color:"var(--text-1)",margin:0},children:i.id})]}),(0,r.jsx)("button",{onClick:c,style:{padding:6,borderRadius:6,color:"var(--text-3)",background:"transparent",border:"none",cursor:"pointer"},onMouseEnter:e=>e.currentTarget.style.color="var(--text-1)",onMouseLeave:e=>e.currentTarget.style.color="var(--text-3)",children:(0,r.jsx)(b.Z,{size:18})})]}),(0,r.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,r.jsxs)("div",{className:"px-5 py-4 grid grid-cols-2 gap-2",style:{borderBottom:"1px solid var(--border)"},children:[[{label:"Table",value:i.table||i.table_name||"—"},{label:"Module",value:i.module||"—"}].map(e=>{let{label:t,value:a}=e;return(0,r.jsxs)("div",{className:"p-2.5 rounded-lg",style:{background:"var(--bg-2)"},children:[(0,r.jsx)("div",{style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.08em",color:"var(--text-3)",marginBottom:3},children:t}),(0,r.jsx)("div",{style:{fontFamily:"monospace",fontSize:12,color:"var(--text-2)"},className:"truncate",children:a})]},t)}),i.source&&(0,r.jsxs)("div",{className:"col-span-2 p-2.5 rounded-lg",style:{background:"var(--bg-2)"},children:[(0,r.jsx)("div",{style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.08em",color:"var(--text-3)",marginBottom:3},children:"Source"}),(0,r.jsx)("div",{style:{fontFamily:"monospace",fontSize:11,color:"var(--text-3)",wordBreak:"break-all",lineHeight:1.5},children:i.source})]})]}),(0,r.jsxs)("div",{className:"px-5 py-3 flex gap-2",style:{borderBottom:"1px solid var(--border)"},children:[(0,r.jsxs)("button",{onClick:()=>d(i.id),style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"7px 12px",borderRadius:8,fontSize:12,fontWeight:600,background:"var(--accent-soft)",color:"var(--accent)",border:"1px solid var(--accent-border)",cursor:"pointer"},onMouseEnter:e=>e.currentTarget.style.background="rgba(91,141,255,0.18)",onMouseLeave:e=>e.currentTarget.style.background="var(--accent-soft)",children:[(0,r.jsx)(J.Z,{size:13}),"Isolate Subgraph"]}),x&&(0,r.jsxs)("button",{onClick:()=>{if(!x||!i)return;let e=i.id.replace(/\./g,"\\."),t=x.$("#".concat(e));if(!t.length)return;let a=t.closedNeighborhood();X(x,{filename:"".concat(i.id.replace(/\./g,"_"),"_subgraph.png"),isDark:u,elements:a,padding:180,scale:3})},title:"Export this model's subgraph as high-quality PNG",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"7px 12px",borderRadius:8,fontSize:12,fontWeight:600,background:"var(--bg-3)",color:"var(--text-2)",border:"1px solid var(--border-hover)",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.background="var(--bg-4)",e.currentTarget.style.color="var(--text-1)"},onMouseLeave:e=>{e.currentTarget.style.background="var(--bg-3)",e.currentTarget.style.color="var(--text-2)"},children:[(0,r.jsx)(h.Z,{size:13}),"Export PNG"]})]}),i.fields&&i.fields.length>0&&(0,r.jsxs)("div",{className:"px-5 py-4",style:{borderBottom:"1px solid var(--border)"},children:[(0,r.jsxs)("div",{style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.1em",fontWeight:600,color:"var(--text-3)",marginBottom:10},children:["Fields (",i.fields.length,")"]}),(0,r.jsx)("div",{children:i.fields.map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between py-1.5 px-2 rounded-md",style:{transition:"background 0.1s"},onMouseEnter:e=>e.currentTarget.style.background="var(--bg-2)",onMouseLeave:e=>e.currentTarget.style.background="transparent",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[function(e,t){let a=(null!=e?e:"").toLowerCase();return t||a.startsWith("many2one")||a.startsWith("one2many")||a.startsWith("many2many")||a.startsWith("one2one")||"foreign_key"===a?(0,r.jsx)(D.Z,{size:12,style:{color:"var(--accent)"},className:"shrink-0"}):null}(e.type||e.field_type||"",e.comodel||e.comodel_name),(0,r.jsx)("span",{style:{fontFamily:"monospace",fontSize:13,color:"var(--text-1)"},className:"truncate",children:e.name}),e.computed&&(0,r.jsx)("span",{style:{fontSize:10,padding:"1px 5px",borderRadius:3,background:"rgba(245,158,11,0.1)",color:"#f59e0b",fontWeight:600},children:"calc"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[(0,r.jsx)("span",{style:{fontFamily:"monospace",fontSize:12,color:"var(--text-3)"},children:e.type||e.field_type}),(e.comodel||e.comodel_name)&&(0,r.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"monospace",fontSize:12,color:"var(--accent)"},children:[(0,r.jsx)(Y.Z,{size:11,className:"shrink-0"}),e.comodel||e.comodel_name]})]})]},e.name))})]}),((null!==(l=null===(t=i.outgoing)||void 0===t?void 0:t.length)&&void 0!==l?l:0)>0||(null!==(n=null===(a=i.incoming)||void 0===a?void 0:a.length)&&void 0!==n?n:0)>0)&&(0,r.jsxs)("div",{className:"px-5 py-4 space-y-4",children:[i.outgoing&&i.outgoing.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{style:{fontSize:11,textTransform:"uppercase",letterSpacing:"0.1em",fontWeight:600,color:"var(--text-3)",marginBottom:8},children:["References (",i.outgoing.length,")"]}),i.outgoing.map((e,t)=>(0,r.jsxs)("button",{onClick:()=>d(e.to),className:"w-full flex items-center justify-between py-1.5 px-2 rounded-md text-left",style:{background:"transparent",border:"none",cursor:"pointer",transition:"background 0.1s"},onMouseEnter:e=>e.currentTarget.style.background="var(--bg-2)",onMouseLeave:e=>e.currentTarget.style.background="transparent",children:[(0,r.jsx)("span",{style:{fontFamily:"monospace",fontSize:13,color:"var(--text-2)"},children:e.field}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(Y.Z,{size:12,style:{color:"var(--text-3)"},className:"shrink-0"}),(0,r.jsx)("span",{style:{fontFamily:"monospace",fontSize:13,color:"var(--accent)"},children:e.to})]})]},t))]}),i.incoming&&i.incoming.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{style:{fontSize:11,textTransform:"uppercase",letterSpacing:"0.1em",fontWeight:600,color:"var(--text-3)",marginBottom:8},children:["Referenced by (",i.incoming.length,")"]}),i.incoming.map((e,t)=>(0,r.jsxs)("button",{onClick:()=>d(e.from),className:"w-full flex items-center justify-between py-1.5 px-2 rounded-md text-left",style:{background:"transparent",border:"none",cursor:"pointer",transition:"background 0.1s"},onMouseEnter:e=>e.currentTarget.style.background="var(--bg-2)",onMouseLeave:e=>e.currentTarget.style.background="transparent",children:[(0,r.jsx)("span",{style:{fontFamily:"monospace",fontSize:13,color:"var(--accent)"},children:e.from}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(Y.Z,{size:12,style:{color:"var(--text-3)"},className:"shrink-0"}),(0,r.jsx)("span",{style:{fontFamily:"monospace",fontSize:13,color:"var(--text-2)"},children:e.field})]})]},t))]})]})]})]},"drawer")]})})}var K=a(87294),$=a(50701),V=a(66904),Q=a(25361),ee=a(59559),et=a(80659),ea=a(83194);function er(e){let{value:t,onChange:a,options:n=[],groups:i,placeholder:c="Select option…",searchPlaceholder:d="Search…",disabled:x=!1,minWidth:u,width:h,className:p="",enableSearch:m=!0,align:g="left",icon:y}=e,[v,j]=(0,l.useState)(!1),[w,k]=(0,l.useState)(""),N=(0,l.useRef)(null),S=(0,l.useRef)(null);(0,l.useEffect)(()=>{function e(e){N.current&&!N.current.contains(e.target)&&j(!1)}return v&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[v]),(0,l.useEffect)(()=>{v&&m?setTimeout(()=>{var e;null===(e=S.current)||void 0===e||e.focus()},50):k("")},[v,m]);let E=(0,l.useMemo)(()=>{if(i&&i.length>0){let e=[];return i.forEach(t=>{t.options.forEach(a=>{e.push({...a,group:t.label})})}),e}return n},[i,n]),M=(0,l.useMemo)(()=>E.find(e=>e.value===t),[E,t]),C=(0,l.useMemo)(()=>{let e=w.trim().toLowerCase();return i&&i.length>0?i.map(t=>({...t,options:t.options.filter(t=>t.label.toLowerCase().includes(e)||t.value.toLowerCase().includes(e))})).filter(e=>e.options.length>0):[{label:"",options:E.filter(t=>t.label.toLowerCase().includes(e)||t.value.toLowerCase().includes(e))}]},[i,E,w]),T=(0,l.useMemo)(()=>C.reduce((e,t)=>e+t.options.length,0),[C]),R=m&&(E.length>6||!!w);return(0,r.jsxs)("div",{ref:N,className:"relative inline-block ".concat(p),style:{minWidth:null!=u?u:h?void 0:130,width:null!=h?h:"auto"},children:[(0,r.jsxs)("button",{type:"button",disabled:x,onClick:()=>!x&&j(!v),className:"w-full flex items-center justify-between gap-2 px-3.5 py-2 rounded-lg text-[13px] font-mono text-left transition-all",style:{background:"var(--bg-2)",border:"1px solid ".concat(v?"var(--accent)":"var(--border)"),color:M?"var(--text-1)":"var(--text-3)",opacity:x?.45:1,cursor:x?"not-allowed":"pointer"},children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0 truncate",children:[y,(0,r.jsx)("span",{className:"truncate font-medium",children:M?M.label:c})]}),(0,r.jsx)(L.Z,{size:14,style:{color:v?"var(--accent)":"var(--text-3)",transform:v?"rotate(180deg)":"none",transition:"transform 0.18s ease, color 0.18s ease",flexShrink:0}})]}),(0,r.jsx)(s.M,{children:v&&(0,r.jsxs)(o.E.div,{initial:{opacity:0,y:-4,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.98},transition:{duration:.14,ease:"easeOut"},className:"absolute top-full mt-1.5 z-50 rounded-lg overflow-hidden shadow-2xl ".concat("right"===g?"right-0":"left-0"),style:{minWidth:"100%",width:"number"==typeof h&&h>240?h:Math.max(240,"number"==typeof u?u:240),background:"var(--bg-1)",border:"1px solid var(--border-hover)",boxShadow:"0 12px 36px rgba(0,0,0,0.5)"},children:[R&&(0,r.jsx)("div",{className:"p-2.5 border-b",style:{borderColor:"var(--border)"},children:(0,r.jsxs)("div",{className:"relative flex items-center",children:[(0,r.jsx)(f.Z,{size:13,className:"absolute left-3",style:{color:"var(--text-3)"}}),(0,r.jsx)("input",{ref:S,type:"text",placeholder:d,value:w,onChange:e=>k(e.target.value),className:"w-full pl-8 pr-8 py-2 rounded-md text-[12.5px] font-mono outline-none",style:{background:"var(--bg-2)",border:"1px solid var(--border)",color:"var(--text-1)"},onFocus:e=>e.currentTarget.style.borderColor="var(--accent)",onBlur:e=>e.currentTarget.style.borderColor="var(--border)"}),w&&(0,r.jsx)("button",{type:"button",onClick:()=>k(""),className:"absolute right-2.5",style:{color:"var(--text-3)"},children:(0,r.jsx)(b.Z,{size:13})})]})}),(0,r.jsx)("div",{className:"max-h-64 overflow-y-auto p-1.5 text-xs font-mono divide-y-0",children:0===T?(0,r.jsx)("div",{className:"px-3 py-3.5 text-center text-xs",style:{color:"var(--text-3)"},children:"No matches found"}):C.map((e,l)=>(0,r.jsxs)("div",{className:"mb-1.5 last:mb-0",children:[e.label&&(0,r.jsx)("div",{className:"px-2.5 py-1 text-[11px] uppercase tracking-wider font-semibold",style:{color:"var(--text-3)",background:"transparent"},children:e.label}),e.options.map(e=>{let l=e.value===t;return(0,r.jsxs)("button",{type:"button",disabled:e.disabled,onClick:()=>{a(e.value),j(!1)},className:"w-full flex items-center justify-between px-3 py-2 rounded-md text-left transition-colors",style:{background:l?"var(--accent-soft)":"transparent",color:l?"var(--accent)":"var(--text-2)",fontSize:"12.5px",fontWeight:l?600:400,cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.4:1},onMouseEnter:t=>{l||e.disabled||(t.currentTarget.style.background="var(--bg-2)",t.currentTarget.style.color="var(--text-1)")},onMouseLeave:t=>{l||e.disabled||(t.currentTarget.style.background="transparent",t.currentTarget.style.color="var(--text-2)")},children:[(0,r.jsx)("span",{className:"truncate",children:e.label}),l&&(0,r.jsx)(ee.Z,{size:13,className:"shrink-0 ml-2",style:{color:"var(--accent)"}})]},e.value)})]},e.label||l))})]})})]})}function el(e){var t;let{graphData:a,onSelectModel:n}=e,[i,d]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),[h,p]=(0,l.useState)(!1),[m,g]=(0,l.useState)(null),[f,b]=(0,l.useState)(null),[y,v]=(0,l.useState)(null),[j,w]=(0,l.useState)(0),k=(0,l.useMemo)(()=>[...a.models].sort((e,t)=>e.id.localeCompare(t.id)),[a]),N=(0,l.useMemo)(()=>{if(!i)return[];let e=new Set;return(a.relationships||[]).forEach(t=>{t.source===i&&e.add(t.target),t.target===i&&e.add(t.source)}),(a.inheritance_edges||[]).forEach(t=>{t.child===i&&e.add(t.parent),t.parent===i&&e.add(t.child)}),a.models.filter(t=>e.has(t.id)&&t.id!==i).sort((e,t)=>e.id.localeCompare(t.id))},[i,a]),S=(0,l.useMemo)(()=>k.map(e=>({value:e.id,label:"".concat(e.id," (").concat(e.module||"base",")")})),[k]),E=(0,l.useMemo)(()=>{if(!i)return[];let e=[];N.length>0&&e.push({label:"Directly Connected to ".concat(i," (").concat(N.length,")"),options:N.map(e=>({value:e.id,label:"".concat(e.id," (").concat(e.module||"base",")")}))});let t=k.filter(e=>e.id!==i&&!N.find(t=>t.id===e.id));return t.length>0&&e.push({label:"All Other Models (".concat(t.length,")"),options:t.map(e=>({value:e.id,label:"".concat(e.id," (").concat(e.module||"base",")")}))}),e},[i,N,k]),M=(0,l.useCallback)(async(e,t)=>{if(e&&t){p(!0),b(null),g(null),w(0);try{let a=await fetch("/api/path?source=".concat(encodeURIComponent(e),"&target=").concat(encodeURIComponent(t),"&all=true"));if(!a.ok)throw Error("Path finding query failed");let r=await a.json();(r.paths||(r.path?[r]:[])).length?g(r):b('No relationship pathway found connecting "'.concat(e,'" ➔ "').concat(t,'". They may belong to isolated sub-graphs.'))}catch(e){b(e.message||"Path computation failed")}finally{p(!1)}}},[]),C=(0,l.useMemo)(()=>m?(m.paths||(m.path?[m]:[])).filter(Boolean):[],[m]),T=C[j]||C[0],R=(e,t,a)=>{let r=t.map(e=>{var t;return e.field_name||(null===(t=e.label)||void 0===t?void 0:t.split(" ")[0])||e.field||"rel"}).join(".");navigator.clipboard.writeText("records.mapped('".concat(r,"')")),v(a),setTimeout(()=>v(null),1800)};return(0,r.jsxs)("div",{className:"w-full h-full flex overflow-hidden",style:{background:"var(--bg)"},children:[(0,r.jsx)("aside",{className:"w-[410px] shrink-0 h-full flex flex-col overflow-y-auto",style:{borderRight:"1px solid var(--border)",background:"var(--bg-1)"},children:(0,r.jsxs)("div",{className:"p-6 space-y-6 flex-1",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,r.jsx)("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--accent-soft)",border:"1px solid var(--accent-border)"},children:(0,r.jsx)(K.Z,{size:16,style:{color:"var(--accent)"}})}),(0,r.jsx)("h2",{className:"text-[15px] font-bold tracking-tight",style:{color:"var(--text-1)"},children:"Architecture Pathfinder"})]}),(0,r.jsx)("p",{className:"text-xs",style:{color:"var(--text-3)",lineHeight:1.5},children:"Find the shortest foreign key highways, m2m join tables, and inheritance paths between any two models."})]}),(0,r.jsxs)("div",{className:"p-4 rounded-xl space-y-4",style:{background:"var(--bg-2)",border:"1px solid var(--border)",boxShadow:"var(--card-shadow)"},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-[10px] font-mono uppercase tracking-widest font-semibold mb-1.5",style:{color:"var(--text-3)"},children:"Source Model (Start)"}),(0,r.jsx)(er,{options:S,value:i,onChange:e=>{d(e),u(""),g(null),b(null)},width:"100%",placeholder:"Choose source model…",searchPlaceholder:"Filter source models…"})]}),(0,r.jsx)("div",{className:"flex items-center justify-center",children:(0,r.jsxs)("button",{onClick:()=>{d(x),u(i),x&&i&&M(x,i)},disabled:!i&&!x,title:"Swap Start and Target Models",className:"flex items-center gap-1.5 px-3 py-1 rounded-full text-[10.5px] font-mono transition-all disabled:opacity-30",style:{background:"var(--bg-3)",border:"1px solid var(--border)",color:"var(--text-2)",cursor:i||x?"pointer":"default"},onMouseEnter:e=>{(i||x)&&(e.currentTarget.style.borderColor="var(--accent)")},onMouseLeave:e=>{e.currentTarget.style.borderColor="var(--border)"},children:[(0,r.jsx)($.Z,{size:11,style:{color:"var(--accent)"}}),(0,r.jsx)("span",{children:"Swap Traversal"})]})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,r.jsx)("label",{className:"text-[10px] font-mono uppercase tracking-widest font-semibold",style:{color:"var(--text-3)"},children:"Target Model (Destination)"}),i&&N.length>0&&(0,r.jsxs)("span",{className:"text-[10px] font-mono px-1.5 py-0.2 rounded",style:{background:"var(--secondary-soft)",color:"var(--secondary)"},children:[N.length," direct links"]})]}),(0,r.jsx)(er,{groups:E,value:x,onChange:e=>{u(e),g(null),b(null)},disabled:!i,width:"100%",placeholder:i?N.length>0?"Select destination…":"Search all models…":"Choose source first…",searchPlaceholder:"Filter target models…"})]}),(0,r.jsxs)("button",{onClick:()=>M(i,x),disabled:!i||!x||h,className:"w-full flex items-center justify-center gap-2 py-2.5 rounded-lg text-xs font-semibold font-mono transition-all disabled:opacity-40",style:{background:"var(--accent-primary)",color:"#fff",border:"1px solid var(--accent-border)",cursor:i&&x&&!h?"pointer":"default"},onMouseEnter:e=>{e.currentTarget.disabled||(e.currentTarget.style.opacity="0.9")},onMouseLeave:e=>{e.currentTarget.style.opacity="1"},children:[h?(0,r.jsx)(_.Z,{size:14,className:"animate-spin"}):(0,r.jsx)(c.Z,{size:14}),(0,r.jsx)("span",{children:h?"Discovering Routes…":"Find Relationship Routes"})]})]}),(0,r.jsxs)("div",{className:"p-3.5 rounded-xl space-y-2 mt-auto",style:{background:"var(--bg-2)",border:"1px solid var(--border)"},children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 font-semibold text-[11px]",style:{color:"var(--accent)"},children:[(0,r.jsx)(V.Z,{size:13}),(0,r.jsx)("span",{children:"Smart Relational Pathing"})]}),(0,r.jsx)("p",{className:"text-[11px]",style:{color:"var(--text-3)",lineHeight:1.5},children:"Uses BFS graph traversal to discover the shortest ForeignKey and relational connections between any two models across the entire database."})]})]})}),(0,r.jsxs)("main",{className:"flex-1 h-full overflow-y-auto p-8 relative flex flex-col",children:[(0,r.jsx)(s.M,{children:f&&(0,r.jsxs)(o.E.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0},className:"max-w-2xl mx-auto mb-6 w-full p-4 rounded-xl flex items-start gap-3 text-xs",style:{background:"rgba(228, 110, 120, 0.10)",border:"1px solid rgba(228, 110, 120, 0.30)",color:"#E46E78"},children:[(0,r.jsx)(Q.Z,{size:16,className:"shrink-0 mt-0.5"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"font-semibold mb-0.5",children:"No Relationship Highway Found"}),(0,r.jsx)("p",{style:{opacity:.9},children:f})]})]})}),C.length>0?(0,r.jsxs)("div",{className:"max-w-4xl w-full mx-auto space-y-6 pb-12",children:[(0,r.jsxs)("div",{className:"p-5 rounded-2xl flex items-center justify-between",style:{background:"var(--bg-1)",border:"1px solid var(--border)",boxShadow:"var(--card-shadow)"},children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,r.jsx)("span",{className:"text-xs font-mono font-semibold",style:{color:"var(--secondary)"},children:"✓ HIGHWAY FOUND"}),(0,r.jsx)("span",{className:"text-xs",style:{color:"var(--text-3)"},children:"\xb7"}),(0,r.jsxs)("span",{className:"text-xs font-mono font-bold",style:{color:"var(--text-1)"},children:[i," ➔ ",x]})]}),(0,r.jsxs)("p",{className:"text-xs",style:{color:"var(--text-3)"},children:["Found ",C.length," possible path(s). Shortest route takes ",T.length||(null===(t=T.nodes)||void 0===t?void 0:t.length)-1||1," hop(s)."]})]}),C.length>1&&(0,r.jsx)("div",{className:"flex items-center gap-1.5 p-1 rounded-lg",style:{background:"var(--bg-2)",border:"1px solid var(--border)"},children:C.map((e,t)=>{var a;return(0,r.jsxs)("button",{onClick:()=>w(t),className:"px-3 py-1.5 rounded-md text-xs font-mono font-semibold transition-all",style:{background:j===t?"var(--accent-primary)":"transparent",color:j===t?"#fff":"var(--text-3)",cursor:"pointer"},children:["Route ",t+1," (",e.length||(null===(a=e.nodes)||void 0===a?void 0:a.length)-1," hops)"]},t)})})]}),(0,r.jsxs)(o.E.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"p-7 rounded-2xl space-y-6",style:{background:"var(--bg-1)",border:"1px solid var(--border)",boxShadow:"var(--card-shadow)"},children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b pb-4",style:{borderColor:"var(--border)"},children:[(0,r.jsx)("span",{className:"text-xs font-mono uppercase tracking-wider font-semibold",style:{color:"var(--text-2)"},children:"Interactive Traversal Chain"}),(0,r.jsxs)("button",{onClick:()=>R(T.nodes||T.path||[],T.edges||[],j),className:"flex items-center gap-1.5 text-xs font-mono px-3 py-1.5 rounded-lg transition-colors",style:{background:"var(--bg-2)",border:"1px solid var(--border)",color:y===j?"var(--secondary)":"var(--text-2)",cursor:"pointer"},children:[y===j?(0,r.jsx)(ee.Z,{size:13}):(0,r.jsx)(et.Z,{size:13}),(0,r.jsx)("span",{children:y===j?"Copied Python ORM lookup!":"Copy ORM Dot-Path"})]})]}),(0,r.jsx)("div",{className:"space-y-4 relative",children:(T.nodes||T.path||[]).map((e,t)=>{var l;let o=null===(l=T.edges)||void 0===l?void 0:l[t],s=a.models.find(t=>t.id===e),i=0===t,c=t===(T.nodes||T.path||[]).length-1;return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{onClick:()=>s&&n(s),className:"p-4 rounded-xl flex items-center justify-between transition-all group",style:{background:"var(--bg-2)",border:"1.5px solid ".concat(i?"var(--accent)":c?"var(--secondary)":"var(--border)"),cursor:s?"pointer":"default"},children:[(0,r.jsxs)("div",{className:"flex items-center gap-3.5 min-w-0",children:[(0,r.jsx)("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center font-mono font-bold text-xs shrink-0",style:{background:i?"var(--accent-soft)":c?"var(--secondary-soft)":"var(--bg-3)",color:i?"var(--accent)":c?"var(--secondary)":"var(--text-2)",border:"1px solid ".concat(i?"var(--accent-border)":c?"rgba(0, 160, 157, 0.3)":"var(--border)")},children:t+1}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"font-mono text-sm font-bold truncate",style:{color:"var(--text-1)"},children:e}),i&&(0,r.jsx)("span",{className:"text-[10px] font-mono font-bold px-2 py-0.5 rounded-full",style:{background:"var(--accent-soft)",color:"var(--accent)"},children:"START"}),c&&(0,r.jsx)("span",{className:"text-[10px] font-mono font-bold px-2 py-0.5 rounded-full",style:{background:"var(--secondary-soft)",color:"var(--secondary)"},children:"TARGET"})]}),(0,r.jsxs)("span",{className:"text-xs block truncate mt-0.5",style:{color:"var(--text-3)"},children:["Module: ",(0,r.jsx)("span",{style:{color:"var(--text-2)"},children:(null==s?void 0:s.module)||"base"})," \xb7 Table: ",(0,r.jsx)("span",{style:{color:"var(--text-2)"},children:(null==s?void 0:s.table_name)||e.replace(/\./g,"_")})]})]})]}),s&&(0,r.jsxs)("span",{className:"text-xs font-mono opacity-0 group-hover:opacity-100 transition-opacity flex items-center gap-1",style:{color:"var(--accent)"},children:["Inspect Schema ",(0,r.jsx)(Y.Z,{size:13})]})]}),o&&(0,r.jsxs)("div",{className:"pl-6 flex items-center gap-3 py-1",children:[(0,r.jsx)("div",{className:"w-0.5 h-7 bg-gradient-to-b from-[var(--accent)] to-[var(--secondary)] ml-1"}),(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-mono",style:{background:"var(--bg-3)",border:"1px solid var(--border)",color:"var(--text-2)"},children:[(0,r.jsx)(ea.Z,{size:13,style:{color:"var(--gold)"}}),(0,r.jsx)("span",{children:"Linked via field:"}),(0,r.jsx)("span",{className:"font-bold font-mono px-1.5 py-0.5 rounded",style:{background:"rgba(228, 169, 0, 0.15)",color:"var(--gold)"},children:o.field_name||o.label||"relation"}),o.relationship_type&&(0,r.jsx)("span",{className:"text-[10px] uppercase font-mono px-1 rounded",style:{background:"var(--bg-4)",color:"var(--text-3)"},children:o.relationship_type})]})]})]},t)})})]},j)]}):(0,r.jsx)("div",{className:"w-full flex-1 flex flex-col items-center justify-center text-center p-6 relative",children:(0,r.jsxs)("div",{className:"max-w-xl w-full p-8 rounded-2xl space-y-6 relative z-10",style:{background:"var(--bg-1)",border:"1px solid var(--border)",boxShadow:"var(--card-shadow)"},children:[(0,r.jsx)("div",{className:"w-16 h-16 mx-auto rounded-2xl flex items-center justify-center",style:{background:"var(--accent-soft)",border:"1px solid var(--accent-border)"},children:(0,r.jsx)(c.Z,{size:30,style:{color:"var(--accent)"}})}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("h3",{className:"text-lg font-bold",style:{color:"var(--text-1)"},children:"Discover Relational Pathways"}),(0,r.jsx)("p",{className:"text-xs",style:{color:"var(--text-3)",lineHeight:1.6},children:"Select an Origin and Destination model from the left panel to calculate the shortest relational highway and copy ORM mapped dot-paths."})]}),(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-3 pt-2 text-left",children:[(0,r.jsxs)("div",{className:"p-3.5 rounded-xl",style:{background:"var(--bg-2)",border:"1px solid var(--border)"},children:[(0,r.jsx)("span",{className:"text-[10.5px] font-mono font-bold block mb-1",style:{color:"var(--accent)"},children:"STEP 1"}),(0,r.jsx)("p",{className:"text-xs font-semibold",style:{color:"var(--text-1)"},children:"Choose Source"}),(0,r.jsx)("p",{className:"text-[11px] mt-0.5",style:{color:"var(--text-3)"},children:"Select starting model"})]}),(0,r.jsxs)("div",{className:"p-3.5 rounded-xl",style:{background:"var(--bg-2)",border:"1px solid var(--border)"},children:[(0,r.jsx)("span",{className:"text-[10.5px] font-mono font-bold block mb-1",style:{color:"var(--accent)"},children:"STEP 2"}),(0,r.jsx)("p",{className:"text-xs font-semibold",style:{color:"var(--text-1)"},children:"Pick Target"}),(0,r.jsx)("p",{className:"text-[11px] mt-0.5",style:{color:"var(--text-3)"},children:"Select destination model"})]}),(0,r.jsxs)("div",{className:"p-3.5 rounded-xl",style:{background:"var(--bg-2)",border:"1px solid var(--border)"},children:[(0,r.jsx)("span",{className:"text-[10.5px] font-mono font-bold block mb-1",style:{color:"var(--secondary)"},children:"STEP 3"}),(0,r.jsx)("p",{className:"text-xs font-semibold",style:{color:"var(--text-1)"},children:"Copy ORM Path"}),(0,r.jsx)("p",{className:"text-[11px] mt-0.5",style:{color:"var(--text-3)"},children:"1-click dot traversal"})]})]})]})})]})]})}var eo=a(76848);function es(e){let{fields:t}=e;return(0,r.jsx)("div",{style:{maxWidth:760,borderRadius:8,border:"1px solid var(--border)",background:"var(--bg-2)",overflow:"hidden",boxShadow:"var(--card-shadow)"},children:(0,r.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",textAlign:"left",tableLayout:"fixed"},children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{style:{background:"var(--bg-3)",borderBottom:"1px solid var(--border)"},children:[(0,r.jsx)("th",{style:{width:32,padding:"8px 6px",textAlign:"center",fontSize:9,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--text-3)"}}),(0,r.jsx)("th",{style:{width:"38%",padding:"8px 14px",fontSize:9,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--text-3)",borderLeft:"1px solid var(--border)"},children:"Field"}),(0,r.jsx)("th",{style:{width:"22%",padding:"8px 14px",fontSize:9,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--text-3)",borderLeft:"1px solid var(--border)"},children:"Type"}),(0,r.jsx)("th",{style:{padding:"8px 14px",fontSize:9,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--text-3)",borderLeft:"1px solid var(--border)"},children:"Relation / Target"})]})}),(0,r.jsx)("tbody",{children:t.map((e,a)=>{let l=e.type||e.field_type||"",o=e.comodel||e.comodel_name,s=a===t.length-1,n=function(e,t){let a=(null!=e?e:"").toLowerCase();return t||a.startsWith("many2one")||a.startsWith("one2many")||a.startsWith("many2many")||a.startsWith("one2one")||"foreign_key"===a?(0,r.jsx)(D.Z,{size:11,style:{color:"var(--accent)",flexShrink:0}}):null}(l,o);return(0,r.jsxs)("tr",{style:{borderBottom:s?"none":"1px solid var(--border)",background:a%2==0?"transparent":"rgba(255,255,255,0.015)",transition:"background 0.1s"},onMouseEnter:e=>e.currentTarget.style.background="var(--bg-3)",onMouseLeave:e=>e.currentTarget.style.background=a%2==0?"transparent":"rgba(255,255,255,0.015)",children:[(0,r.jsx)("td",{style:{padding:"7px 6px",textAlign:"center",verticalAlign:"middle"},children:n}),(0,r.jsx)("td",{style:{padding:"7px 14px",verticalAlign:"middle",borderLeft:"1px solid var(--border)"},children:(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,r.jsx)("span",{style:{fontFamily:"monospace",fontSize:12,fontWeight:500,color:"var(--text-1)"},children:e.name}),e.computed&&(0,r.jsx)("span",{style:{fontSize:9,padding:"1px 4px",borderRadius:3,fontWeight:600,background:"rgba(245,158,11,0.12)",color:"#f59e0b",border:"1px solid rgba(245,158,11,0.2)"},children:"calc"})]})}),(0,r.jsx)("td",{style:{padding:"7px 14px",verticalAlign:"middle",borderLeft:"1px solid var(--border)"},children:(0,r.jsx)("span",{style:{fontFamily:"monospace",fontSize:11,color:"var(--text-2)"},children:l||"—"})}),(0,r.jsx)("td",{style:{padding:"7px 14px",verticalAlign:"middle",borderLeft:"1px solid var(--border)"},children:o?(0,r.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"monospace",fontSize:11,color:"var(--accent)",fontWeight:500},children:[(0,r.jsx)(Y.Z,{size:10,className:"shrink-0"}),o]}):e.related?(0,r.jsx)("span",{style:{fontFamily:"monospace",fontSize:11,color:"var(--text-3)"},children:e.related}):(0,r.jsx)("span",{style:{color:"var(--text-3)",fontSize:11},children:"—"})})]},e.name)})})]})})}function en(e){let{models:t,onSelectModel:a}=e,[n,i]=(0,l.useState)(""),[c,d]=(0,l.useState)(""),[x,u]=(0,l.useState)(null),h=Array.from(new Set(t.map(e=>e.module).filter(Boolean))).sort(),p=t.filter(e=>{let t=n.toLowerCase(),a=e.id.toLowerCase().includes(t)||e.table&&e.table.toLowerCase().includes(t),r=!c||e.module===c;return a&&r}).sort((e,t)=>e.id.localeCompare(t.id));return(0,r.jsxs)("div",{className:"h-full flex flex-col",style:{background:"var(--bg)"},children:[(0,r.jsxs)("div",{className:"px-6 py-3.5 flex items-center gap-3 shrink-0",style:{borderBottom:"1px solid var(--border)",background:"var(--bg-1)"},children:[(0,r.jsx)("input",{type:"text",placeholder:"Filter models…",value:n,onChange:e=>i(e.target.value),className:"rounded-lg px-3 py-1.5 text-xs font-mono outline-none",style:{background:"var(--bg-2)",border:"1px solid var(--border)",color:"var(--text-1)",width:260}}),(0,r.jsx)(er,{options:[{value:"",label:"All modules"},...h.map(e=>({value:e,label:e}))],value:c,onChange:d,width:170,placeholder:"All modules",searchPlaceholder:"Search modules…"}),(0,r.jsxs)("span",{className:"text-xs ml-auto",style:{color:"var(--text-3)"},children:[p.length," models"]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,r.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",tableLayout:"fixed"},children:[(0,r.jsx)("thead",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg)"},children:(0,r.jsxs)("tr",{style:{borderBottom:"1px solid var(--border)"},children:[(0,r.jsx)("th",{style:{width:44,padding:"10px 16px",textAlign:"center"}}),(0,r.jsx)("th",{style:{width:"35%",textAlign:"left",padding:"10px 16px",fontSize:10,fontWeight:700,letterSpacing:"0.1em",textTransform:"uppercase",color:"var(--text-3)"},children:"Model"}),(0,r.jsx)("th",{style:{width:"20%",textAlign:"left",padding:"10px 16px",fontSize:10,fontWeight:700,letterSpacing:"0.1em",textTransform:"uppercase",color:"var(--text-3)"},children:"Module"}),(0,r.jsx)("th",{style:{width:"20%",textAlign:"left",padding:"10px 16px",fontSize:10,fontWeight:700,letterSpacing:"0.1em",textTransform:"uppercase",color:"var(--text-3)"},children:"Table"}),(0,r.jsx)("th",{style:{width:"12%",textAlign:"left",padding:"10px 16px",fontSize:10,fontWeight:700,letterSpacing:"0.1em",textTransform:"uppercase",color:"var(--text-3)"},children:"Fields"}),(0,r.jsx)("th",{style:{width:90,textAlign:"right",padding:"10px 16px"}})]})}),(0,r.jsx)("tbody",{children:p.map((e,t)=>{var n,i,c,d;let h=x===e.id;return(0,r.jsxs)(l.Fragment,{children:[(0,r.jsxs)(o.E.tr,{initial:{opacity:0},animate:{opacity:1},transition:{delay:Math.min(.008*t,.25)},onClick:()=>u(h?null:e.id),className:"group",style:{cursor:"pointer",borderBottom:"1px solid var(--border)",background:h?"var(--bg-1)":"transparent",transition:"background 0.12s"},onMouseEnter:e=>{h||(e.currentTarget.style.background="var(--bg-1)")},onMouseLeave:e=>{h||(e.currentTarget.style.background="transparent")},children:[(0,r.jsx)("td",{style:{padding:"12px 16px",textAlign:"center",verticalAlign:"middle"},children:(0,r.jsx)(o.E.div,{animate:{rotate:h?90:0},transition:{type:"spring",damping:22,stiffness:300},style:{display:"inline-flex"},children:(0,r.jsx)(eo.Z,{size:13,style:{color:h?"var(--accent)":"var(--text-3)"}})})}),(0,r.jsx)("td",{style:{padding:"12px 16px",verticalAlign:"middle"},children:(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,r.jsx)("span",{style:{fontFamily:"monospace",fontSize:13,fontWeight:500,color:"var(--text-1)"},children:e.id}),e.abstract&&(0,r.jsx)("span",{style:{fontSize:9,padding:"1px 5px",borderRadius:3,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",background:"rgba(168,85,247,0.10)",color:"#a855f7"},children:"abstract"})]})}),(0,r.jsx)("td",{style:{padding:"12px 16px",fontFamily:"monospace",fontSize:12,color:"var(--text-3)",verticalAlign:"middle"},children:e.module||"—"}),(0,r.jsx)("td",{style:{padding:"12px 16px",fontFamily:"monospace",fontSize:12,color:"var(--text-3)",verticalAlign:"middle"},children:e.table||e.table_name||"—"}),(0,r.jsx)("td",{style:{padding:"12px 16px",verticalAlign:"middle"},children:(0,r.jsx)("span",{style:{fontFamily:"monospace",fontSize:12,color:(null!==(c=null===(n=e.fields)||void 0===n?void 0:n.length)&&void 0!==c?c:0)>0?"var(--text-2)":"var(--text-3)"},children:null!==(d=null===(i=e.fields)||void 0===i?void 0:i.length)&&void 0!==d?d:0})}),(0,r.jsx)("td",{style:{padding:"12px 16px",textAlign:"right",verticalAlign:"middle"},children:(0,r.jsx)("button",{onClick:t=>{t.stopPropagation(),a(e)},style:{opacity:0,fontSize:11,padding:"3px 10px",borderRadius:6,background:"var(--accent-soft)",color:"var(--accent)",border:"1px solid var(--accent-border)",transition:"opacity 0.15s"},className:"group-hover:!opacity-100",children:"Inspect"})})]}),(0,r.jsx)(s.M,{initial:!1,children:h&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:6,style:{padding:"16px 24px 20px 56px",background:"var(--bg-1)",borderBottom:"1px solid var(--border)"},children:(0,r.jsx)(o.E.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{type:"spring",damping:28,stiffness:260},style:{overflow:"hidden"},children:e.fields&&e.fields.length>0?(0,r.jsx)(es,{fields:e.fields}):(0,r.jsx)("div",{style:{padding:"8px 12px",fontSize:12,color:"var(--text-3)",fontStyle:"italic"},children:"No fields defined"})})})},"".concat(e.id,"-fields"))})]},e.id)})})]})})]})}function ei(e){let{label:t,value:a,sub:l,accent:o}=e;return(0,r.jsxs)("div",{className:"p-5 rounded-xl",style:{background:"var(--bg-1)",border:"1px solid var(--border)"},children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-2",style:{color:"var(--text-3)"},children:t}),(0,r.jsx)("div",{className:"text-3xl font-bold font-mono mb-1",style:{color:o||"var(--text-1)"},children:a}),l&&(0,r.jsx)("div",{className:"text-[11px]",style:{color:"var(--text-3)"},children:l})]})}function ec(e){var t,a,s;let{graphData:n}=e,[i,c]=(0,l.useState)(null);(0,l.useEffect)(()=>{fetch("/api/stats").then(e=>e.json()).then(c).catch(()=>{})},[]);let d=n.models||[],x=n.relationships||[],u=n.inheritance_edges||[];n.dependency_edges;let h={};x.forEach(e=>{h[e.source]=(h[e.source]||0)+1,h[e.target]=(h[e.target]||0)+1});let p=Object.entries(h).sort((e,t)=>t[1]-e[1]).slice(0,8),m=(null===(t=p[0])||void 0===t?void 0:t[1])||1,g={};d.forEach(e=>{let t=e.module||"root";g[t]=(g[t]||0)+1});let f=Object.entries(g).sort((e,t)=>t[1]-e[1]),b=(null===(a=f[0])||void 0===a?void 0:a[1])||1;return(0,r.jsx)("div",{className:"h-full overflow-y-auto",style:{background:"var(--bg)"},children:(0,r.jsxs)("div",{className:"max-w-4xl mx-auto p-8 space-y-8",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"font-semibold",style:{color:"var(--text-1)",fontSize:15},children:"Architecture Health"}),(0,r.jsx)("p",{className:"mt-1 text-xs",style:{color:"var(--text-3)"},children:"Static analysis metrics across your ORM project."})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,r.jsx)(ei,{label:"Models",value:d.length,sub:"".concat(d.filter(e=>e.external).length," external")}),(0,r.jsx)(ei,{label:"Relationships",value:x.length,sub:"FK + M2M edges",accent:"var(--accent)"}),(0,r.jsx)(ei,{label:"Inheritance",value:u.length,sub:"class extensions",accent:"#a855f7"}),(0,r.jsx)(ei,{label:"Cycles",value:null!==(s=null==i?void 0:i.cycles)&&void 0!==s?s:"—",sub:(null==i?void 0:i.cycles)===0?"Clean graph ✓":"Circular refs detected",accent:(null==i?void 0:i.cycles)===0?"var(--green)":"var(--red)"})]}),p.length>0&&(0,r.jsxs)("div",{className:"rounded-xl p-5 space-y-4",style:{background:"var(--bg-1)",border:"1px solid var(--border)"},children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-widest font-semibold",style:{color:"var(--text-3)"},children:"Most Connected Models"}),(0,r.jsx)("div",{className:"space-y-2.5",children:p.map((e,t)=>{let[a,l]=e;return(0,r.jsxs)(o.E.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:.04*t},className:"flex items-center gap-3",children:[(0,r.jsx)("span",{className:"font-mono text-xs w-48 shrink-0 truncate",style:{color:"var(--text-2)"},children:a}),(0,r.jsx)("div",{className:"flex-1 rounded-full overflow-hidden",style:{height:4,background:"var(--bg-3)"},children:(0,r.jsx)(o.E.div,{initial:{width:0},animate:{width:"".concat(l/m*100,"%")},transition:{delay:.04*t+.1,duration:.5,ease:"easeOut"},className:"h-full rounded-full",style:{background:"var(--accent)"}})}),(0,r.jsx)("span",{className:"font-mono text-xs w-8 text-right",style:{color:"var(--text-3)"},children:l})]},a)})})]}),f.length>0&&(0,r.jsxs)("div",{className:"rounded-xl p-5 space-y-4",style:{background:"var(--bg-1)",border:"1px solid var(--border)"},children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-widest font-semibold",style:{color:"var(--text-3)"},children:"Models per Module"}),(0,r.jsx)("div",{className:"space-y-2.5",children:f.map((e,t)=>{let[a,l]=e;return(0,r.jsxs)(o.E.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:.03*t},className:"flex items-center gap-3",children:[(0,r.jsx)("span",{className:"font-mono text-xs w-48 shrink-0 truncate",style:{color:"var(--text-2)"},children:a}),(0,r.jsx)("div",{className:"flex-1 rounded-full overflow-hidden",style:{height:4,background:"var(--bg-3)"},children:(0,r.jsx)(o.E.div,{initial:{width:0},animate:{width:"".concat(l/b*100,"%")},transition:{delay:.03*t+.1,duration:.5,ease:"easeOut"},className:"h-full rounded-full",style:{background:"var(--green)"}})}),(0,r.jsx)("span",{className:"font-mono text-xs w-8 text-right",style:{color:"var(--text-3)"},children:l})]},a)})})]})]})})}try{N.Z.use(E())}catch(e){}async function ed(e){let{moduleName:t,models:a,relationships:r,isDark:l=!0,onProgress:o}=e,s=new(Z()),n=s.folder("".concat(t,"_architecture_clusters"));null==o||o(5,"Large Architecture Detected (".concat(a.length," models) → Partitioning into clusters…"));let i=new Set(a.map(e=>e.id)),c=new Map(a.map(e=>[e.id,e])),d={};a.forEach(e=>{d[e.id]=0});let x=r.filter(e=>i.has(e.source)&&i.has(e.target));x.forEach(e=>{d[e.source]=(d[e.source]||0)+1,d[e.target]=(d[e.target]||0)+1});let u=[...a].sort((e,t)=>(d[t.id]||0)-(d[e.id]||0)),h=[],p=u.slice(0,Math.min(10,a.length)),m=new Set(p.map(e=>e.id));h.push({name:"00_overview_core_models",label:"".concat(t," \xb7 Core Overview"),models:p,relationships:x.filter(e=>m.has(e.source)&&m.has(e.target))});let g=new Set;u.filter(e=>(d[e.id]||0)>=2).slice(0,8).forEach((e,a)=>{if(g.has(e.id))return;g.add(e.id);let r=new Set([e.id]);x.forEach(t=>{t.source===e.id&&r.add(t.target),t.target===e.id&&r.add(t.source)});let l=Array.from(r).map(e=>c.get(e)).filter(Boolean),o=x.filter(e=>r.has(e.source)&&r.has(e.target)),s=e.id.replace(/\./g,"_");h.push({name:"0".concat(a+1,"_hub_").concat(s),label:"".concat(t," \xb7 ").concat(e.id," Hub"),models:l,relationships:o})});let f=new Set(h.flatMap(e=>e.models.map(e=>e.id))),b=a.filter(e=>!f.has(e.id));if(b.length>0){let e=new Set(b.map(e=>e.id));h.push({name:"09_peripheral_models",label:"".concat(t," \xb7 Secondary Models"),models:b,relationships:x.filter(t=>e.has(t.source)&&e.has(t.target))})}let y=document.createElement("div");y.style.width="1400px",y.style.height="900px",y.style.position="fixed",y.style.left="-9999px",y.style.top="-9999px",document.body.appendChild(y);let v=l?"#0e0d12":"#fcfbfe",j=l?"#16131c":"#ffffff",w=l?"#2d2535":"rgba(113, 75, 103, 0.18)",k=l?"#f5f3f7":"#1f1824",S=l?"#9E6D91":"#714B67";try{for(let e=0;e{r.push({data:{id:e.id,label:e.name||e.id.split(".").pop()||e.id,isAbstract:e.abstract?"yes":"no"}})}),t.relationships.forEach(e=>{r.push({data:{id:e.id,source:e.source,target:e.target,label:e.field}})});let s=(0,N.Z)({container:y,elements:r,style:[{selector:"node",style:{label:"data(label)","font-family":"Inter, sans-serif","font-size":"13px","font-weight":600,color:k,"text-valign":"center","text-halign":"center","background-color":j,"border-width":1.5,"border-color":w,width:"label",height:"label",padding:"14px 24px",shape:"round-rectangle"}},{selector:"edge",style:{width:1.5,"line-color":l?"#2e2837":"#dcd4df","target-arrow-color":l?"#00A09D":"#017E84","target-arrow-shape":"triangle","curve-style":"bezier",label:"data(label)","font-family":"JetBrains Mono, monospace","font-size":"10.5px",color:"#8F8F8F","text-rotation":"autorotate","text-background-opacity":1,"text-background-color":v,"text-background-padding":"3px 6px"}}],layout:{name:"dagre",rankDir:"LR",nodeSep:60,rankSep:120}}),i=s.png({output:"base64uri",scale:2.2,full:!0,bg:v});s.destroy(),i&&"data:,"!==i&&await new Promise(e=>{let a=new Image;a.onload=()=>{let r=document.createElement("canvas");r.width=a.width+280,r.height=a.height+280;let o=r.getContext("2d");o?(o.fillStyle=v,o.fillRect(0,0,r.width,r.height),o.drawImage(a,140,140),o.textAlign="right",o.textBaseline="bottom",o.font='700 28px "Inter", -apple-system, sans-serif',o.fillStyle=S,o.fillText("ORMGraph \xb7 ".concat(t.label),r.width-75,r.height-65),o.font='500 18px "JetBrains Mono", monospace',o.fillStyle=l?"rgba(245, 243, 247, 0.70)":"rgba(31, 24, 36, 0.70)",o.fillText("iampiyush.one • github.com/iam-piyush",r.width-75,r.height-30),r.toBlob(a=>{a&&(null==n||n.file("".concat(t.name,".png"),a)),e()},"image/png")):e()},a.onerror=()=>e(),a.src=i})}let e={module:t,total_models:a.length,total_clusters:h.length,clusters:h.map(e=>({filename:"".concat(e.name,".png"),label:e.label,model_count:e.models.length,models:e.models.map(e=>e.id)})),creator:{website:"https://iampiyush.one",github:"https://github.com/iam-piyush"}};null==n||n.file("manifest.json",JSON.stringify(e,null,2)),null==n||n.file("README.md","# ".concat(t," Architecture Clusters\n\n")+"This module contains **".concat(a.length," models**.\n")+"To ensure readability and crisp resolution, it has been partitioned into **".concat(h.length," isolated sub-graph diagrams**.\n\n")+"### Generated by ORMGraph for Odoo\n- Website: [iampiyush.one](https://iampiyush.one)\n- GitHub: [github.com/iam-piyush](https://github.com/iam-piyush)\n"),null==o||o(95,"Compressing ZIP bundle…");let r=await s.generateAsync({type:"blob"}),i=URL.createObjectURL(r),c=document.createElement("a");c.href=i,c.download="".concat(t,"_architecture_clusters.zip"),document.body.appendChild(c),c.click(),c.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3),null==o||o(100,"Download Ready!")}finally{document.body.removeChild(y)}}async function ex(e){let{graphData:t,isDark:a=!0,onProgress:r}=e,l=new(Z()),o=l.folder("ormgraph_architecture"),s=null==o?void 0:o.folder("modules"),n={};t.models.forEach(e=>{let t=e.module||"custom";n[t]||(n[t]=[]),n[t].push(e)});let i=Object.keys(n).sort(),c=i.length;if(0===c)return;null==r||r(5,"Initializing Architecture Bundle…");let d=document.createElement("div");d.style.width="1400px",d.style.height="900px",d.style.position="fixed",d.style.left="-9999px",d.style.top="-9999px",document.body.appendChild(d);let x=a?"#0e0d12":"#fcfbfe",u=a?"#16131c":"#ffffff",h=a?"#2d2535":"rgba(113, 75, 103, 0.18)",p=a?"#f5f3f7":"#1f1824",m=a?"#9E6D91":"#714B67";try{for(let e=0;ee.id)),b=t.relationships.filter(e=>f.has(e.source)&&f.has(e.target)),y=[];o.forEach(e=>{y.push({data:{id:e.id,label:e.name||e.id.split(".").pop()||e.id,isAbstract:e.abstract?"yes":"no"}})}),b.forEach(e=>{y.push({data:{id:e.id,source:e.source,target:e.target,label:e.field}})});let v=(0,N.Z)({container:d,elements:y,style:[{selector:"node",style:{label:"data(label)","font-family":"Inter, sans-serif","font-size":"13px","font-weight":600,color:p,"text-valign":"center","text-halign":"center","background-color":u,"border-width":1.5,"border-color":h,width:"label",height:"label",padding:"14px 24px",shape:"round-rectangle"}},{selector:"edge",style:{width:1.5,"line-color":a?"#2e2837":"#dcd4df","target-arrow-color":a?"#00A09D":"#017E84","target-arrow-shape":"triangle","curve-style":"bezier",label:"data(label)","font-family":"JetBrains Mono, monospace","font-size":"10.5px",color:"#8F8F8F","text-rotation":"autorotate","text-background-opacity":1,"text-background-color":x,"text-background-padding":"3px 6px"}}],layout:{name:"dagre",rankDir:"LR",nodeSep:60,rankSep:120}}),j=v.png({output:"base64uri",scale:2,full:!0,bg:x});v.destroy(),j&&"data:,"!==j&&await new Promise(e=>{let t=new Image;t.onload=()=>{let r=document.createElement("canvas");r.width=t.width+280,r.height=t.height+280;let o=r.getContext("2d");o?(o.fillStyle=x,o.fillRect(0,0,r.width,r.height),o.drawImage(t,140,140),o.textAlign="right",o.textBaseline="bottom",o.font='700 28px "Inter", -apple-system, sans-serif',o.fillStyle=m,o.fillText("ORMGraph \xb7 ".concat(l),r.width-75,r.height-65),o.font='500 18px "JetBrains Mono", monospace',o.fillStyle=a?"rgba(245, 243, 247, 0.70)":"rgba(31, 24, 36, 0.70)",o.fillText("iampiyush.one • github.com/iam-piyush",r.width-75,r.height-30),r.toBlob(t=>{t&&(null==s||s.file("".concat(l,".png"),t)),e()},"image/png")):e()},t.onerror=()=>e(),t.src=j})}let e={project:"Odoo ORM Architecture Export",generated_at:new Date().toISOString(),creator:{github:"https://github.com/iam-piyush",website:"https://iampiyush.one"},stats:{total_models:t.models.length,total_modules:c,total_relationships:t.relationships.length},modules:i.map(e=>({name:e,model_count:n[e].length,models:n[e].map(e=>e.id)}))};null==o||o.file("manifest.json",JSON.stringify(e,null,2)),null==o||o.file("README.md","# ORMGraph Architecture Export for Odoo\n\n"+"Exported **".concat(c," modules** and **").concat(t.models.length," models**.\n\n")+"### Creator:\n- Website: [iampiyush.one](https://iampiyush.one)\n- GitHub: [github.com/iam-piyush](https://github.com/iam-piyush)\n"),null==r||r(95,"Compressing ZIP bundle…");let g=await l.generateAsync({type:"blob"}),f=URL.createObjectURL(g),b=document.createElement("a");b.href=f,b.download="ormgraph_architecture_bundle_".concat(new Date().toISOString().slice(0,10),".zip"),document.body.appendChild(b),b.click(),b.remove(),setTimeout(()=>URL.revokeObjectURL(f),1e3),null==r||r(100,"Complete!")}finally{document.body.removeChild(d)}}let eu=[{id:"graph",label:"Graph",Icon:n.Z},{id:"erd",label:"ERD Cards",Icon:i.Z},{id:"path",label:"Pathfinder",Icon:c.Z},{id:"schema",label:"Schema",Icon:d.Z},{id:"metrics",label:"Health",Icon:x.Z}],eh=[{value:"dagre-lr",label:"Flow LR"},{value:"dagre-tb",label:"Hierarchy TB"},{value:"cose",label:"Organic"},{value:"concentric",label:"Concentric"}];function ep(e){let{label:t,checked:a,onChange:l}=e;return(0,r.jsxs)("label",{className:"flex items-center gap-3 select-none",style:{color:a?"var(--text-1)":"var(--text-3)",cursor:"pointer"},children:[(0,r.jsx)("div",{onClick:()=>l(!a),style:{width:34,height:20,borderRadius:999,background:a?"var(--accent)":"var(--bg-3)",border:"1px solid ".concat(a?"var(--accent)":"var(--border-hover)"),position:"relative",flexShrink:0,transition:"background 0.2s ease, border-color 0.2s ease"},children:(0,r.jsx)(o.E.div,{animate:{x:a?16:3},transition:{type:"spring",damping:22,stiffness:300},style:{position:"absolute",top:2,width:14,height:14,borderRadius:"50%",background:"#fff"}})}),(0,r.jsx)("span",{className:"text-[13px] font-medium",children:t})]})}function em(e){let{onClick:t,title:a,children:l}=e;return(0,r.jsx)("button",{onClick:t,title:a,style:{padding:"7px 8px",borderRadius:8,background:"var(--bg-2)",border:"1px solid var(--border)",color:"var(--text-3)",display:"flex",alignItems:"center",justifyContent:"center",transition:"color 0.15s, background 0.15s",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.color="var(--text-1)",e.currentTarget.style.background="var(--bg-3)"},onMouseLeave:e=>{e.currentTarget.style.color="var(--text-3)",e.currentTarget.style.background="var(--bg-2)"},children:l})}function eg(){var e,t;let[a,c]=(0,l.useState)(null),[d,x]=(0,l.useState)(!0),[N,S]=(0,l.useState)(null),[E,M]=(0,l.useState)("graph"),[T,R]=(0,l.useState)("dagre-lr"),[z,_]=(0,l.useState)(0),[L,B]=(0,l.useState)(0),[D,A]=(0,l.useState)(null),[F,O]=(0,l.useState)(!1),[Z,P]=(0,l.useState)(0),[U,J]=(0,l.useState)(""),[Y,K]=(0,l.useState)(""),[$,V]=(0,l.useState)(""),[Q,ee]=(0,l.useState)(!0),[et,ea]=(0,l.useState)(!1),[eo,es]=(0,l.useState)(null),[ei,eg]=(0,l.useState)(null),[ef,eb]=(0,l.useState)(!1),[ey,ev]=(0,l.useState)(0),[ej,ew]=(0,l.useState)("Rendering Diagram…"),[ek,eN]=(0,l.useState)(!0),eS=(0,l.useRef)(null);(0,l.useEffect)(()=>{document.documentElement.setAttribute("data-theme",ek?"dark":"light")},[ek]),(0,l.useEffect)(()=>{fetch("/api/graph").then(e=>{if(!e.ok)throw Error("API unreachable");return e.json()}).then(e=>{c(e),x(!1);{let t=new URLSearchParams(window.location.search),a=t.get("focus"),r=t.get("module");if(a){eg(a);let t=e.models.find(e=>e.id===a);t&&(es(t),t.module&&(A(t.module),V(t.module)));return}if(r){A(r),V(r);return}}e.models&&e.models.length<=15&&(A("all"),V(""))}).catch(e=>{S(e.message),x(!1)})},[]);let eE=(0,l.useMemo)(()=>a?Array.from(new Set(a.models.map(e=>e.module).filter(Boolean))).sort():[],[a]),eM=(0,l.useMemo)(()=>{if(!a)return{};let e={};return a.models.forEach(t=>{let a=t.module||"custom";e[a]=(e[a]||0)+1}),e},[a]),eC=(0,l.useMemo)(()=>{if(!a||!D&&!ei)return[];let e=a.models;if(ei){var t;let r=new Set([ei]);return a.relationships.forEach(e=>{e.source===ei&&r.add(e.target),e.target===ei&&r.add(e.source)}),(null!==(t=a.inheritance_edges)&&void 0!==t?t:[]).forEach(e=>{e.child===ei&&r.add(e.parent),e.parent===ei&&r.add(e.child)}),e.filter(e=>r.has(e.id))}let r=e.filter(e=>{if($&&"all"!==$&&e.module!==$)return!1;if(Y){var t;let a=Y.toLowerCase();if(!e.id.toLowerCase().includes(a)&&!(null!==(t=e.name)&&void 0!==t?t:"").toLowerCase().includes(a))return!1}return!0});if(!et&&$&&"all"!==$){let t=new Set(r.map(e=>e.id)),l=new Set;return a.relationships.forEach(e=>{t.has(e.source)&&!t.has(e.target)&&l.add(e.target),t.has(e.target)&&!t.has(e.source)&&l.add(e.source)}),[...r,...e.filter(e=>l.has(e.id)).map(e=>({...e,external:!0}))]}return r},[a,D,ei,et,$,Y]),eT=(0,l.useMemo)(()=>{var e;return Q&&a&&null!==(e=a.inheritance_edges)&&void 0!==e?e:[]},[Q,a]),eR=(0,l.useCallback)(e=>{A(e),V("all"===e?"":e),eg(null),M("graph"),setTimeout(()=>_(e=>e+1),60)},[]),ez=(0,l.useCallback)(e=>{e!==E&&(M(e),setTimeout(()=>_(e=>e+1),50))},[E]),e_=(0,l.useCallback)(e=>es(e),[]),eL=(0,l.useCallback)(e=>{eg(e),_(e=>e+1);let t=null==a?void 0:a.models.find(t=>t.id===e);t&&es(t)},[a]),eB=(0,l.useCallback)(async()=>{if(a){eb(!0),ev(10);try{if("erd"===E)eC.length>20?(ew("Large ERD Architecture (".concat(eC.length," models) → Generating Multi-Cluster ERD ZIP…")),await W({moduleName:D||"odoo_erd",models:eC,relationships:a.relationships,isDark:ek,onProgress:(e,t)=>{ev(e),ew(t)}})):(ew("Rendering ERD Table Cards PNG…"),await I({models:eC,relationships:a.relationships,filename:"ormgraph_erd_".concat(D||"export",".png"),isDark:ek}));else if(eC.length>20)ew("Large Graph Detected (".concat(eC.length," models) → Generating Multi-Cluster ZIP…")),await ed({moduleName:D||"odoo_architecture",models:eC,relationships:a.relationships,isDark:ek,onProgress:(e,t)=>{ev(e),ew(t)}});else{let e=eS.current;if(!e)return;ew("Rendering High-Resolution PNG…"),await X(e,{filename:"ormgraph_".concat(D||"export",".png"),isDark:ek,padding:200,onProgress:e=>ev(e)})}}catch(e){console.error("Export failed:",e)}finally{eb(!1)}}},[a,eC,ek,D,E]),eD=(0,l.useCallback)(async()=>{if(a){eb(!0),ev(5),ew("erd"===E?"Initializing ERD Table Schema Bundle…":"Initializing Architecture Bundle…");try{"erd"===E?await G({graphData:a,isDark:ek,onProgress:(e,t)=>{ev(e),ew(t)}}):await ex({graphData:a,isDark:ek,onProgress:(e,t)=>{ev(e),ew(t)}})}catch(e){console.error("ZIP export failed:",e)}finally{eb(!1)}}},[a,ek,E]);return d?(0,r.jsx)("div",{className:"h-screen w-screen flex items-center justify-center",style:{background:"var(--bg)"},children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,r.jsx)("div",{className:"w-6 h-6 rounded-full border-[1.5px] border-t-transparent animate-spin",style:{borderColor:"var(--accent)",borderTopColor:"transparent"}}),(0,r.jsx)("span",{className:"text-xs font-mono",style:{color:"var(--text-3)"},children:"Connecting to Odoo registry…"})]})}):N||!a?(0,r.jsx)("div",{className:"h-screen w-screen flex items-center justify-center",style:{background:"var(--bg)"},children:(0,r.jsxs)("div",{className:"max-w-sm text-center space-y-4",children:[(0,r.jsx)("p",{className:"font-semibold text-sm",style:{color:"var(--text-1)"},children:"Could not connect to registry"}),(0,r.jsx)("p",{className:"text-xs",style:{color:"var(--text-3)"},children:N})]})}):(0,r.jsxs)("div",{className:"h-screen w-screen flex flex-col",style:{background:"var(--bg)"},children:[(0,r.jsxs)("header",{className:"h-14 flex items-center justify-between px-6 shrink-0 z-20",style:{borderBottom:"1px solid var(--border)",background:"var(--bg-1)"},children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-white shadow-sm",style:{background:"linear-gradient(135deg, #714B67 0%, #4D2F45 100%)",border:"1px solid rgba(255,255,255,0.15)"},children:(0,r.jsx)(n.Z,{size:15})}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("span",{className:"font-bold tracking-tight text-[15px]",style:{color:"var(--text-1)"},children:["ORMGraph ",(0,r.jsx)("span",{className:"font-normal text-xs",style:{color:"var(--text-3)"},children:"for Odoo"})]}),(0,r.jsx)("span",{style:{fontSize:10,fontFamily:"Inter, sans-serif",fontWeight:600,letterSpacing:"0.03em",padding:"2px 7px",borderRadius:6,background:"var(--accent-soft)",color:"var(--accent)",border:"1px solid var(--accent-border)"},children:"by Piyush"})]})]}),(0,r.jsx)("div",{style:{width:1,height:16,background:"var(--border-hover)"}}),(0,r.jsxs)("span",{className:"text-xs",style:{color:"var(--text-3)"},children:[(0,r.jsx)("span",{style:{color:"var(--text-1)",fontWeight:600},children:a.models.length})," models \xa0\xb7\xa0"," ",(0,r.jsx)("span",{style:{color:"var(--text-1)",fontWeight:600},children:eE.length})," modules \xa0\xb7\xa0"," ",(0,r.jsx)("span",{style:{color:"var(--text-1)",fontWeight:600},children:a.relationships.length})," relations"]})]}),(0,r.jsx)("nav",{className:"flex items-center gap-1",children:eu.map(e=>{let{id:t,label:a,Icon:l}=e;return(0,r.jsxs)("button",{title:a,onClick:()=>ez(t),className:"flex items-center gap-2 px-3.5 py-2 rounded-lg text-xs font-semibold relative transition-all",style:{color:E===t?"var(--text-1)":"var(--text-2)",background:"none",border:"none",cursor:"pointer"},onMouseEnter:e=>{E!==t&&(e.currentTarget.style.color="var(--text-1)")},onMouseLeave:e=>{E!==t&&(e.currentTarget.style.color="var(--text-3)")},children:[(0,r.jsx)(l,{size:15}),a,E===t&&(0,r.jsx)(o.E.div,{layoutId:"tabPill",className:"absolute inset-0 rounded-lg",style:{background:"var(--bg-3)",zIndex:-1},transition:{type:"spring",damping:28,stiffness:320}})]},t)})}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[("graph"===E||"erd"===E)&&D&&(0,r.jsxs)(r.Fragment,{children:["graph"===E&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er,{options:eh,value:T,onChange:e=>{R(e),setTimeout(()=>B(e=>e+1),60)},enableSearch:!1,width:140,align:"right"}),(0,r.jsx)(em,{onClick:()=>_(e=>e+1),title:"Fit graph to view",children:(0,r.jsx)(u.Z,{size:15})})]}),(0,r.jsx)(em,{onClick:eB,title:"Export current module ".concat("erd"===E?"ERD":"graph"," as high-resolution PNG"),children:(0,r.jsx)(h.Z,{size:15})}),(0,r.jsx)(em,{onClick:eD,title:"Export all modules ".concat("erd"===E?"ERD diagrams":"graphs"," as ZIP bundle"),children:(0,r.jsx)(p.Z,{size:15})})]}),(0,r.jsx)(em,{onClick:()=>eN(e=>!e),title:ek?"Switch to light mode":"Switch to dark mode",children:ek?(0,r.jsx)(m.Z,{size:15}):(0,r.jsx)(g.Z,{size:15})})]})]}),(0,r.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,r.jsx)(s.M,{initial:!1,children:("graph"===E||"erd"===E)&&(0,r.jsxs)(o.E.aside,{initial:{width:0,opacity:0},animate:{width:280,opacity:1},exit:{width:0,opacity:0},transition:{type:"spring",damping:30,stiffness:280},className:"shrink-0 flex flex-col overflow-hidden",style:{borderRight:"1px solid var(--border)",background:"var(--bg-1)"},children:[D||ei?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"p-3.5 pb-2.5 space-y-2.5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("button",{onClick:()=>{A(null),V(""),eg(null)},className:"flex items-center gap-1.5 text-[11px] font-mono transition-colors",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer",padding:0},children:[(0,r.jsx)(v.Z,{size:12}),(0,r.jsx)("span",{children:"All Modules"})]}),(0,r.jsxs)("span",{className:"text-[11px] font-mono",style:{color:"var(--text-3)"},children:[eC.length," models"]})]}),(0,r.jsx)(er,{options:[{value:"all",label:"All modules (".concat(a.models.length,")")},...eE.map(e=>({value:e,label:"".concat(e," (").concat(eM[e]||0,")")}))],value:D||"all",onChange:e=>eR(e),width:"100%",placeholder:"Select module",searchPlaceholder:"Filter modules…"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(f.Z,{size:13,className:"absolute left-3 top-2.5",style:{color:"var(--text-3)",pointerEvents:"none"}}),(0,r.jsx)("input",{type:"text",placeholder:"Search in ".concat(D,"…"),value:Y,onChange:e=>K(e.target.value),className:"w-full pl-8 pr-7 py-2 rounded-lg text-xs font-mono outline-none",style:{background:"var(--bg-2)",border:"1px solid var(--border)",color:"var(--text-1)"}}),Y&&(0,r.jsx)("button",{onClick:()=>K(""),className:"absolute right-2.5 top-2.5 text-stone-400",children:(0,r.jsx)(b.Z,{size:13})})]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto",style:{borderTop:"1px solid var(--border)"},children:0===eC.length?(0,r.jsx)("div",{className:"p-5 text-center text-xs",style:{color:"var(--text-3)"},children:"No models match search"}):eC.map(e=>{let t=(null==eo?void 0:eo.id)===e.id;return(0,r.jsx)("button",{onClick:()=>e_(e),className:"w-full text-left px-3.5 py-2.5",style:{display:"block",borderTop:"none",borderRight:"none",borderBottom:"1px solid var(--border)",borderLeft:"2.5px solid ".concat(t?"var(--accent)":"transparent"),background:t?"var(--bg-3)":"transparent",transition:"background 0.12s",cursor:"pointer"},onMouseEnter:e=>{t||(e.currentTarget.style.background="var(--bg-2)")},onMouseLeave:e=>{t||(e.currentTarget.style.background=t?"var(--bg-3)":"transparent")},children:(0,r.jsx)("span",{className:"font-mono text-[12.5px] block truncate",style:{color:t?"var(--text-1)":"var(--text-2)",fontWeight:t?600:400},children:e.id})},e.id)})}),(0,r.jsxs)("div",{className:"px-4 py-3.5 space-y-3",style:{borderTop:"1px solid var(--border)"},children:[(0,r.jsx)(ep,{label:"Show inheritance",checked:Q,onChange:ee}),(0,r.jsx)(ep,{label:"Hide external",checked:et,onChange:ea})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"p-3.5 pb-2",children:[(0,r.jsx)("div",{className:"flex items-center justify-between pb-2",children:(0,r.jsxs)("span",{className:"text-[11px] font-mono font-semibold uppercase tracking-wider",style:{color:"var(--text-3)"},children:["Select Module (",eE.length,")"]})}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(f.Z,{size:14,className:"absolute left-3 top-3",style:{color:"var(--text-3)",pointerEvents:"none"}}),(0,r.jsx)("input",{type:"text",placeholder:"Search modules…",value:Y,onChange:e=>K(e.target.value),className:"w-full pl-9 pr-8 py-2 rounded-lg text-xs font-mono outline-none",style:{background:"var(--bg-2)",border:"1px solid var(--border)",color:"var(--text-1)"}}),Y&&(0,r.jsx)("button",{onClick:()=>K(""),className:"absolute right-2.5 top-2.5 text-stone-400",children:(0,r.jsx)(b.Z,{size:13})})]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto",style:{borderTop:"1px solid var(--border)"},children:eE.filter(e=>!Y||e.toLowerCase().includes(Y.toLowerCase())).map(e=>{let t=eM[e]||0;return(0,r.jsxs)("button",{onClick:()=>eR(e),className:"w-full text-left px-4 py-3 flex items-center justify-between transition-colors",style:{borderBottom:"1px solid var(--border)",background:"transparent",cursor:"pointer"},onMouseEnter:e=>e.currentTarget.style.background="var(--bg-2)",onMouseLeave:e=>e.currentTarget.style.background="transparent",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0 pr-2",children:[(0,r.jsx)(y.Z,{size:14,style:{color:"var(--accent)",flexShrink:0}}),(0,r.jsx)("span",{className:"font-mono text-[12.5px] font-medium truncate",style:{color:"var(--text-1)"},children:e})]}),(0,r.jsx)("span",{className:"text-[10.5px] font-mono px-2 py-0.5 rounded-full shrink-0",style:{background:"var(--bg-3)",color:"var(--text-3)"},children:t})]},e)})})]}),(0,r.jsxs)("div",{className:"px-4 py-3 flex items-center justify-between text-xs shrink-0",style:{borderTop:"1px solid var(--border)",background:"var(--bg-2)"},children:[(0,r.jsxs)("a",{href:"https://github.com/iam-piyush",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 font-mono text-[11.5px] transition-colors",style:{color:"var(--text-3)",textDecoration:"none"},onMouseEnter:e=>e.currentTarget.style.color="var(--text-1)",onMouseLeave:e=>e.currentTarget.style.color="var(--text-3)",children:[(0,r.jsx)(j.Z,{size:13}),(0,r.jsx)("span",{children:"iam-piyush"})]}),(0,r.jsx)("span",{style:{color:"var(--border)"},children:"•"}),(0,r.jsxs)("a",{href:"https://iampiyush.one",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 font-mono text-[11.5px] transition-colors",style:{color:"var(--accent)",textDecoration:"none"},onMouseEnter:e=>e.currentTarget.style.opacity="0.8",onMouseLeave:e=>e.currentTarget.style.opacity="1",children:[(0,r.jsx)(w.Z,{size:13}),(0,r.jsx)("span",{children:"iampiyush.one"})]})]})]},"sidebar")}),(0,r.jsxs)("main",{className:"flex-1 relative overflow-hidden",children:[(0,r.jsx)(s.M,{children:F&&(0,r.jsx)(o.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 z-30 flex flex-col items-center justify-center",style:{background:"rgba(8, 8, 8, 0.82)",backdropFilter:"blur(10px)"},children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-4 max-w-sm w-full px-6 text-center",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--accent)",borderTopColor:"transparent"}}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("p",{className:"font-semibold text-sm",style:{color:"var(--text-1)"},children:["Generating ",U," Architecture…"]}),(0,r.jsxs)("p",{className:"font-mono text-xs",style:{color:"var(--accent)"},children:[Z,"%"]})]}),(0,r.jsx)("div",{className:"w-full h-1.5 rounded-full overflow-hidden",style:{background:"var(--bg-3)"},children:(0,r.jsx)(o.E.div,{className:"h-full rounded-full",style:{background:"var(--accent)"},animate:{width:"".concat(Z,"%")},transition:{ease:"easeOut",duration:.18}})})]})})}),(0,r.jsx)(s.M,{children:ef&&(0,r.jsx)(o.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 z-40 flex flex-col items-center justify-center",style:{background:"rgba(14, 13, 18, 0.85)",backdropFilter:"blur(10px)"},children:(0,r.jsxs)("div",{className:"p-6 rounded-2xl max-w-xs w-full text-center space-y-4",style:{background:"var(--bg-1)",border:"1px solid var(--border)",boxShadow:"var(--card-shadow)"},children:[(0,r.jsx)("div",{className:"w-10 h-10 mx-auto rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--accent)",borderTopColor:"transparent"}}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("p",{className:"font-semibold text-sm",style:{color:"var(--text-1)"},children:ej}),(0,r.jsxs)("p",{className:"font-mono text-xs",style:{color:"var(--accent)"},children:[ey,"%"]})]}),(0,r.jsx)("div",{className:"w-full h-1.5 rounded-full overflow-hidden",style:{background:"var(--bg-3)"},children:(0,r.jsx)(o.E.div,{className:"h-full rounded-full",style:{background:"var(--accent)"},animate:{width:"".concat(ey,"%")},transition:{ease:"easeOut",duration:.15}})})]})})}),(0,r.jsxs)(s.M,{mode:"wait",children:["graph"===E&&(D||ei?(0,r.jsx)(o.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.14},className:"w-full h-full",children:(0,r.jsxs)("div",{className:"graph-canvas-wrapper",children:[(0,r.jsx)(s.M,{children:ei&&(0,r.jsxs)(o.E.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"absolute top-5 left-1/2 -translate-x-1/2 z-10 flex items-center gap-3 px-4 py-2 rounded-full text-xs",style:{background:"rgba(15,15,15,0.88)",backdropFilter:"blur(14px)",border:"1px solid var(--border-hover)"},children:[(0,r.jsx)(k.Z,{size:6,style:{color:"var(--accent)",fill:"var(--accent)"}}),(0,r.jsx)("span",{style:{color:"var(--text-2)"},children:"Subgraph:"}),(0,r.jsx)("span",{className:"font-mono",style:{color:"var(--text-1)"},children:ei}),(0,r.jsx)("button",{onClick:()=>{eg(null),setTimeout(()=>_(e=>e+1),50)},style:{marginLeft:4,fontSize:10,padding:"2px 8px",borderRadius:999,background:"var(--bg-3)",color:"var(--text-2)",border:"1px solid var(--border-hover)",cursor:"pointer"},onMouseEnter:e=>e.currentTarget.style.color="var(--text-1)",onMouseLeave:e=>e.currentTarget.style.color="var(--text-2)",children:"Reset"})]})}),(0,r.jsx)(C,{models:eC,relationships:a.relationships,inheritanceEdges:eT,layoutName:T,onSelectModel:e_,selectedModelId:null!==(e=null==eo?void 0:eo.id)&&void 0!==e?e:null,fitTrigger:z,relayoutTrigger:L,isDark:ek,onCyReady:e=>{eS.current=e}})]})},"graph-canvas"):(0,r.jsxs)(o.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.14},className:"w-full h-full flex flex-col items-center justify-center p-8 relative",children:[(0,r.jsx)("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:"radial-gradient(circle, ".concat(ek?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.07)"," 1px, transparent 1px)"),backgroundSize:"24px 24px"}}),(0,r.jsxs)("div",{className:"max-w-md w-full p-8 rounded-2xl text-center space-y-6 relative z-10",style:{background:"var(--bg-1)",border:"1px solid var(--border)",boxShadow:"0 24px 48px rgba(0,0,0,0.3)"},children:[(0,r.jsx)("div",{className:"w-16 h-16 mx-auto rounded-2xl flex items-center justify-center shadow-lg",style:{background:"linear-gradient(135deg, #714B67 0%, #4D2F45 100%)",border:"1px solid rgba(255, 255, 255, 0.15)",boxShadow:"0 8px 24px rgba(113, 75, 103, 0.35)"},children:(0,r.jsx)(n.Z,{size:28,className:"text-white"})}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("h2",{className:"text-lg font-bold",style:{color:"var(--text-1)"},children:"Select an Odoo Module"}),(0,r.jsx)("p",{className:"text-xs",style:{color:"var(--text-3)",lineHeight:1.6},children:"Choose any module from the left sidebar to generate its live architecture graph and interactive ERD cards without overloading your browser."})]}),(0,r.jsx)("div",{className:"pt-2",children:(0,r.jsx)("button",{onClick:eD,className:"group relative w-full p-4 rounded-xl text-left transition-all overflow-hidden",style:{background:"linear-gradient(135deg, rgba(113, 75, 103, 0.18) 0%, rgba(1, 126, 132, 0.14) 100%)",border:"1px solid rgba(113, 75, 103, 0.30)",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.borderColor="var(--accent)",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 8px 24px rgba(113, 75, 103, 0.28)"},onMouseLeave:e=>{e.currentTarget.style.borderColor="rgba(113, 75, 103, 0.30)",e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 4px 16px rgba(0, 0, 0, 0.12)"},children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center shrink-0 shadow-sm",style:{background:"var(--accent-primary)",color:"#ffffff"},children:(0,r.jsx)(p.Z,{size:18})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("span",{className:"text-xs font-bold",style:{color:"var(--text-1)"},children:["Export All ",eE.length," Modules"]}),(0,r.jsx)("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded font-semibold",style:{background:"var(--accent-soft)",color:"var(--accent)"},children:"ZIP Bundle"})]}),(0,r.jsx)("p",{className:"text-[11px] mt-0.5",style:{color:"var(--text-3)"},children:"High-res diagrams partitioned into isolated sub-graphs"})]})]}),(0,r.jsx)(h.Z,{size:15,style:{color:"var(--accent)"},className:"group-hover:translate-x-0.5 transition-transform shrink-0"})]})})})]})]},"graph-empty")),"erd"===E&&(D||ei?(0,r.jsx)(o.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.14},className:"w-full h-full",children:(0,r.jsx)(H,{models:eC,relationships:a.relationships,onSelectModel:e_,selectedModelId:null!==(t=null==eo?void 0:eo.id)&&void 0!==t?t:null,isDark:ek})},"erd-canvas"):(0,r.jsxs)(o.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.14},className:"w-full h-full flex flex-col items-center justify-center p-8 relative",children:[(0,r.jsx)("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:"radial-gradient(circle, ".concat(ek?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.07)"," 1px, transparent 1px)"),backgroundSize:"24px 24px"}}),(0,r.jsxs)("div",{className:"max-w-md w-full p-8 rounded-2xl text-center space-y-6 relative z-10",style:{background:"var(--bg-1)",border:"1px solid var(--border)",boxShadow:"0 24px 48px rgba(0,0,0,0.3)"},children:[(0,r.jsx)("div",{className:"w-16 h-16 mx-auto rounded-2xl flex items-center justify-center shadow-lg",style:{background:"linear-gradient(135deg, #017E84 0%, #004D50 100%)",border:"1px solid rgba(255, 255, 255, 0.15)",boxShadow:"0 8px 24px rgba(1, 126, 132, 0.35)"},children:(0,r.jsx)(i.Z,{size:28,className:"text-white"})}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("h2",{className:"text-lg font-bold",style:{color:"var(--text-1)"},children:"Select an Odoo Module for ERD"}),(0,r.jsx)("p",{className:"text-xs",style:{color:"var(--text-3)",lineHeight:1.6},children:"Choose any module from the left sidebar to generate its interactive database table schema cards, relational fields, and computed types."})]}),(0,r.jsx)("div",{className:"pt-2",children:(0,r.jsx)("button",{onClick:eD,className:"group relative w-full p-4 rounded-xl text-left transition-all overflow-hidden",style:{background:"linear-gradient(135deg, rgba(1, 126, 132, 0.18) 0%, rgba(113, 75, 103, 0.14) 100%)",border:"1px solid rgba(1, 126, 132, 0.30)",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.borderColor="var(--accent)",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 8px 24px rgba(1, 126, 132, 0.28)"},onMouseLeave:e=>{e.currentTarget.style.borderColor="rgba(1, 126, 132, 0.30)",e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 4px 16px rgba(0, 0, 0, 0.12)"},children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center shrink-0 shadow-sm",style:{background:"#017E84",color:"#ffffff"},children:(0,r.jsx)(p.Z,{size:18})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("span",{className:"text-xs font-bold",style:{color:"var(--text-1)"},children:["Export All ",eE.length," Modules"]}),(0,r.jsx)("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded font-semibold",style:{background:"rgba(1, 126, 132, 0.2)",color:"#017E84"},children:"ZIP Bundle"})]}),(0,r.jsx)("p",{className:"text-[11px] mt-0.5",style:{color:"var(--text-3)"},children:"High-res diagrams partitioned into isolated sub-graphs"})]})]}),(0,r.jsx)(h.Z,{size:15,style:{color:"var(--accent)"},className:"group-hover:translate-x-0.5 transition-transform shrink-0"})]})})})]})]},"erd-empty")),"path"===E&&(0,r.jsx)(o.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.14},className:"w-full h-full",children:(0,r.jsx)(el,{graphData:a,onSelectModel:e=>{e_(e),M("graph")}})},"path"),"schema"===E&&(0,r.jsx)(o.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.14},className:"w-full h-full",children:(0,r.jsx)(en,{models:a.models,onSelectModel:e_})},"schema"),"metrics"===E&&(0,r.jsx)(o.E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.14},className:"w-full h-full",children:(0,r.jsx)(ec,{graphData:a})},"metrics")]})]}),(0,r.jsx)(q,{model:eo,onClose:()=>es(null),onFocus:eL,cy:eS.current,isDark:ek})]})]})}}},function(e){e.O(0,[264,682,971,117,744],function(){return e(e.s=48914)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/ormgraph_odoo/static/src/_next/static/chunks/fd9d1056-12bf5ae46b454cac.js b/ormgraph_odoo/static/src/_next/static/chunks/fd9d1056-12bf5ae46b454cac.js new file mode 100644 index 00000000000..1c1c7aa9375 --- /dev/null +++ b/ormgraph_odoo/static/src/_next/static/chunks/fd9d1056-12bf5ae46b454cac.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[971],{84417:function(e,t,n){var r,l=n(2265),a=n(71767),o={usingClientEntryPoint:!1,Events:null,Dispatcher:{current:null}};function i(e){var t="https://react.dev/errors/"+e;if(1p||(e.current=d[p],d[p]=null,p--)}function g(e,t){d[++p]=e.current,e.current=t}var y=Symbol.for("react.element"),v=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),C=Symbol.for("react.consumer"),E=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),L=Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var T=Symbol.for("react.offscreen"),F=Symbol.for("react.legacy_hidden"),M=Symbol.for("react.cache");Symbol.for("react.tracing_marker");var O=Symbol.iterator;function R(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}var D=m(null),A=m(null),I=m(null),U=m(null),B={$$typeof:E,_currentValue:null,_currentValue2:null,_threadCount:0,Provider:null,Consumer:null};function V(e,t){switch(g(I,t),g(A,e),g(D,null),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?s2(t):0;break;default:if(t=(e=8===e?t.parentNode:t).tagName,e=e.namespaceURI)t=s3(e=s2(e),t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}h(D),g(D,t)}function Q(){h(D),h(A),h(I)}function $(e){null!==e.memoizedState&&g(U,e);var t=D.current,n=s3(t,e.type);t!==n&&(g(A,e),g(D,n))}function j(e){A.current===e&&(h(D),h(A)),U.current===e&&(h(U),B._currentValue=null)}var W=a.unstable_scheduleCallback,H=a.unstable_cancelCallback,q=a.unstable_shouldYield,K=a.unstable_requestPaint,Y=a.unstable_now,X=a.unstable_getCurrentPriorityLevel,G=a.unstable_ImmediatePriority,Z=a.unstable_UserBlockingPriority,J=a.unstable_NormalPriority,ee=a.unstable_LowPriority,et=a.unstable_IdlePriority,en=a.log,er=a.unstable_setDisableYieldValue,el=null,ea=null;function eo(e){if("function"==typeof en&&er(e),ea&&"function"==typeof ea.setStrictMode)try{ea.setStrictMode(el,e)}catch(e){}}var ei=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(eu(e)/es|0)|0},eu=Math.log,es=Math.LN2,ec=128,ef=4194304;function ed(e){var t=42&e;if(0!==t)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 4194176&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ep(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,l=e.suspendedLanes;e=e.pingedLanes;var a=134217727&n;return 0!==a?0!=(n=a&~l)?r=ed(n):0!=(e&=a)&&(r=ed(e)):0!=(n&=~l)?r=ed(n):0!==e&&(r=ed(e)),0===r?0:0!==t&&t!==r&&0==(t&l)&&((l=r&-r)>=(e=t&-t)||32===l&&0!=(4194176&e))?t:r}function em(e,t){return e.errorRecoveryDisabledLanes&t?0:0!=(e=-536870913&e.pendingLanes)?e:536870912&e?536870912:0}function eh(){var e=ec;return 0==(4194176&(ec<<=1))&&(ec=128),e}function eg(){var e=ef;return 0==(62914560&(ef<<=1))&&(ef=4194304),e}function ey(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ev(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ei(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|4194218&n}function eb(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ei(n),l=1<l||u[r]!==s[l]){var c="\n"+u[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=r&&0<=l);break}}}finally{eG=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?eX(n):""}function eJ(e){try{var t="";do t+=function(e){switch(e.tag){case 26:case 27:case 5:return eX(e.type);case 16:return eX("Lazy");case 13:return eX("Suspense");case 19:return eX("SuspenseList");case 0:case 2:case 15:return e=eZ(e.type,!1);case 11:return e=eZ(e.type.render,!1);case 1:return e=eZ(e.type,!0);default:return""}}(e),e=e.return;while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var e0=Symbol.for("react.client.reference");function e1(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function e2(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function e3(e){e._valueTracker||(e._valueTracker=function(e){var t=e2(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var l=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function e4(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=e2(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function e6(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var e8=/[\n"\\]/g;function e5(e){return e.replace(e8,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function e7(e,t,n,r,l,a,o,i){e.name="",null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o?e.type=o:e.removeAttribute("type"),null!=t?"number"===o?(0===t&&""===e.value||e.value!=t)&&(e.value=""+e1(t)):e.value!==""+e1(t)&&(e.value=""+e1(t)):"submit"!==o&&"reset"!==o||e.removeAttribute("value"),null!=t?te(e,o,e1(t)):null!=n?te(e,o,e1(n)):null!=r&&e.removeAttribute("value"),null==l&&null!=a&&(e.defaultChecked=!!a),null!=l&&(e.checked=l&&"function"!=typeof l&&"symbol"!=typeof l),null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i?e.name=""+e1(i):e.removeAttribute("name")}function e9(e,t,n,r,l,a,o,i){if(null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.type=a),null!=t||null!=n){if(!("submit"!==a&&"reset"!==a||null!=t))return;n=null!=n?""+e1(n):"",t=null!=t?""+e1(t):n,i||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:l)&&"symbol"!=typeof r&&!!r,e.checked=i?e.checked:!!r,e.defaultChecked=!!r,null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.name=o)}function te(e,t,n){"number"===t&&e6(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}var tt=Array.isArray;function tn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=iX.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}var to=ta;"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(to=function(e,t){return MSApp.execUnsafeLocalFunction(function(){return ta(e,t)})});var ti=to;function tu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType){n.nodeValue=t;return}}e.textContent=t}var ts=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function tc(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!=typeof n||0===n||ts.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function tf(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(i(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var l in t)r=t[l],t.hasOwnProperty(l)&&n[l]!==r&&tc(e,l,r)}else for(var a in t)t.hasOwnProperty(a)&&tc(e,a,t[a])}function td(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tp=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),tm=null;function th(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var tg=null,ty=null;function tv(e){var t=eO(e);if(t&&(e=t.stateNode)){var n=eD(e);switch(e=t.stateNode,t.type){case"input":if(e7(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+e5(""+t)+'"][type="radio"]'),t=0;t>=o,l-=o,tj=1<<32-ei(t)+l|n<h?(g=f,f=null):g=f.sibling;var y=p(l,f,i[h],u);if(null===y){null===f&&(f=g);break}e&&f&&null===y.alternate&&t(l,f),o=a(y,o,h),null===c?s=y:c.sibling=y,c=y,f=g}if(h===i.length)return n(l,f),tZ&&tH(l,h),s;if(null===f){for(;hg?(y=h,h=null):y=h.sibling;var b=p(l,h,v.value,s);if(null===b){null===h&&(h=y);break}e&&h&&null===b.alternate&&t(l,h),o=a(b,o,g),null===f?c=b:f.sibling=b,f=b,h=y}if(v.done)return n(l,h),tZ&&tH(l,g),c;if(null===h){for(;!v.done;g++,v=u.next())null!==(v=d(l,v.value,s))&&(o=a(v,o,g),null===f?c=v:f.sibling=v,f=v);return tZ&&tH(l,g),c}for(h=r(l,h);!v.done;g++,v=u.next())null!==(v=m(h,l,g,v.value,s))&&(e&&null!==v.alternate&&h.delete(null===v.key?g:v.key),o=a(v,o,g),null===f?c=v:f.sibling=v,f=v);return e&&h.forEach(function(e){return t(l,e)}),tZ&&tH(l,g),c}(s,c,f,h);if("function"==typeof f.then)return u(s,c,nJ(f),h);if(f.$$typeof===E)return u(s,c,ai(s,f,h),h);n1(s,f)}return"string"==typeof f&&""!==f||"number"==typeof f?(f=""+f,null!==c&&6===c.tag?(n(s,c.sibling),(c=l(c,f)).return=s):(n(s,c),(c=i_(f,s.mode,h)).return=s),o(s=c)):n(s,c)}(u,s,c,f),nG=null,u}}var n4=n3(!0),n6=n3(!1),n8=m(null),n5=m(0);function n7(e,t){g(n5,e=oz),g(n8,t),oz=e|t.baseLanes}function n9(){g(n5,oz),g(n8,n8.current)}function re(){oz=n5.current,h(n8),h(n5)}var rt=m(null),rn=null;function rr(e){var t=e.alternate;g(ri,1&ri.current),g(rt,e),null===rn&&(null===t||null!==n8.current?rn=e:null!==t.memoizedState&&(rn=e))}function rl(e){if(22===e.tag){if(g(ri,ri.current),g(rt,e),null===rn){var t=e.alternate;null!==t&&null!==t.memoizedState&&(rn=e)}}else ra(e)}function ra(){g(ri,ri.current),g(rt,rt.current)}function ro(e){h(rt),rn===e&&(rn=null),h(ri)}var ri=m(0);function ru(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var rs=s.ReactCurrentDispatcher,rc=s.ReactCurrentBatchConfig,rf=0,rd=null,rp=null,rm=null,rh=!1,rg=!1,ry=!1,rv=0,rb=0,rk=null,rw=0;function rS(){throw Error(i(321))}function rC(e,t){if(null===t)return!1;for(var n=0;na?a:8;var o=rc.transition,i={_callbacks:new Set};rc.transition=i,lf(e,!1,t,n);try{var u=l();if(null!==u&&"object"==typeof u&&"function"==typeof u.then){av(i,u);var s,c,f=(s=[],c={status:"pending",value:null,reason:null,then:function(e){s.push(e)}},u.then(function(){c.status="fulfilled",c.value=r;for(var e=0;e title"))),sG(l,n,r),l[eE]=e,eI(l),n=l;break e;case"link":var a=cE("link","href",t).get(n+(r.href||""));if(a){for(var o=0;o",e=e.removeChild(e.firstChild);break;case"select":e="string"==typeof r.is?l.createElement("select",{is:r.is}):l.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e="string"==typeof r.is?l.createElement(n,{is:r.is}):l.createElement(n)}}e[eE]=t,e[ex]=r;e:for(l=t.child;null!==l;){if(5===l.tag||6===l.tag)e.appendChild(l.stateNode);else if(4!==l.tag&&27!==l.tag&&null!==l.child){l.child.return=l,l=l.child;continue}if(l===t)break;for(;null===l.sibling;){if(null===l.return||l.return===t)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(t.stateNode=e,sG(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break;case"img":e=!0;break;default:e=!1}e&&aC(t)}}return aP(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&aC(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=I.current,t9(t)){e:{if(e=t.stateNode,n=t.memoizedProps,e[eE]=t,(r=e.nodeValue!==n)&&null!==(l=tX))switch(l.tag){case 3:if(l=0!=(1&l.mode),sq(e.nodeValue,n,l),l){e=!1;break e}break;case 27:case 5:var a=0!=(1&l.mode);if(!0!==l.memoizedProps.suppressHydrationWarning&&sq(e.nodeValue,n,a),a){e=!1;break e}}e=r}e&&aC(t)}else(e=s1(e).createTextNode(r))[eE]=t,t.stateNode=e}return aP(t),null;case 13:if(ro(t),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(tZ&&null!==tG&&0!=(1&t.mode)&&0==(128&t.flags))ne(),nt(),t.flags|=384,l=!1;else if(l=t9(t),null!==r&&null!==r.dehydrated){if(null===e){if(!l)throw Error(i(318));if(!(l=null!==(l=t.memoizedState)?l.dehydrated:null))throw Error(i(317));l[eE]=t}else nt(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;aP(t),l=!1}else null!==tJ&&(o0(tJ),tJ=null),l=!0;if(!l)return 256&t.flags?t:null}if(0!=(128&t.flags))return t.lanes=n,t;return n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(r=t.child,l=null,null!==r.alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(l=r.alternate.memoizedState.cachePool.pool),a=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(a=r.memoizedState.cachePool.pool),a!==l&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ax(t,t.updateQueue),aP(t),null;case 4:return Q(),null===e&&sA(t.stateNode.containerInfo),aP(t),null;case 10:return an(t.type._context),aP(t),null;case 19:if(h(ri),null===(l=t.memoizedState))return aP(t),null;if(r=0!=(128&t.flags),null===(a=l.rendering)){if(r)az(l,!1);else{if(0!==oP||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=ru(e))){for(t.flags|=128,az(l,!1),e=a.updateQueue,t.updateQueue=e,ax(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)ix(n,e),n=n.sibling;return g(ri,1&ri.current|2),t.child}e=e.sibling}null!==l.tail&&Y()>oI&&(t.flags|=128,r=!0,az(l,!1),t.lanes=4194304)}}else{if(!r){if(null!==(e=ru(a))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,ax(t,e),az(l,!0),null===l.tail&&"hidden"===l.tailMode&&!a.alternate&&!tZ)return aP(t),null}else 2*Y()-l.renderingStartTime>oI&&536870912!==n&&(t.flags|=128,r=!0,az(l,!1),t.lanes=4194304)}l.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=l.last)?e.sibling=a:t.child=a,l.last=a)}if(null!==l.tail)return t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Y(),t.sibling=null,e=ri.current,g(ri,r?1&e|2:1&e),t;return aP(t),null;case 22:case 23:return ro(t),re(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(536870912&n)&&0==(128&t.flags)&&(aP(t),6&t.subtreeFlags&&(t.flags|=8192)):aP(t),null!==(n=t.updateQueue)&&ax(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&h(ab),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),an(ad),aP(t),null;case 25:return null}throw Error(i(156,t.tag))}(t.alternate,t,oz);if(null!==n){ow=n;return}if(null!==(t=t.sibling)){ow=t;return}ow=t=e}while(null!==t);0===oP&&(oP=5)}function is(e,t,n,r,l){var a=ek,o=ov.transition;try{ov.transition=null,ek=2,function(e,t,n,r,l,a){do id();while(null!==oj);if(0!=(6&ob))throw Error(i(327));var o,u=e.finishedWork,s=e.finishedLanes;if(null!==u){if(e.finishedWork=null,e.finishedLanes=0,u===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var c=u.lanes|u.childLanes;if(function(e,t,n){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.entangledLanes&=t,e.errorRecoveryDisabledLanes&=t,e.shellSuspendCounter=0,t=e.entanglements;for(var l=e.expirationTimes,a=e.hiddenUpdates;0r&&(l=r,r=a,a=l),l=si(n,a);var o=si(n,r);l&&o&&(1!==e.rangeCount||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(l.node,l.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;nn?32:n;n=ov.transition;var l=ek;try{if(ov.transition=null,ek=r,null===oj)var a=!1;else{r=oq,oq=null;var o=oj,u=oW;if(oj=null,oW=0,0!=(6&ob))throw Error(i(331));var s=ob;if(ob|=4,of(o.current),ol(o,o.current,u,r),ob=s,nb(!1),ea&&"function"==typeof ea.onPostCommitFiberRoot)try{ea.onPostCommitFiberRoot(el,o)}catch(e){}a=!0}return a}finally{ek=l,ov.transition=n,ic(e,t)}}return!1}function ip(e,t,n){t=lL(e,t=lP(n,t),2),null!==(e=nO(e,t,2))&&(o2(e,2),nv(e))}function im(e,t,n){if(3===e.tag)ip(e,e,n);else for(;null!==t;){if(3===t.tag){ip(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===oQ||!oQ.has(r))){e=lT(t,e=lP(n,e),2),null!==(t=nO(t,e,2))&&(o2(t,2),nv(t));break}}t=t.return}}function ih(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new om;var l=new Set;r.set(t,l)}else void 0===(l=r.get(t))&&(l=new Set,r.set(t,l));l.has(n)||(ox=!0,l.add(n),e=ig.bind(null,e,t,n),t.then(e,e))}function ig(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,2&ob?oR=!0:4&ob&&(oD=!0),ik(),ok===e&&(oS&n)===n&&(4===oP||3===oP&&(62914560&oS)===oS&&300>Y()-oA?0==(2&ob)&&o5(e,0):oT|=n),nv(e)}function iy(e,t){0===t&&(t=0==(1&e.mode)?2:eg()),null!==(e=ns(e,t))&&(o2(e,t),nv(e))}function iv(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),iy(e,n)}function ib(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;null!==l&&(n=l.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}null!==r&&r.delete(t),iy(e,n)}function ik(){if(50=uH),uY=!1;function uX(e,t){switch(e){case"keyup":return -1!==uj.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uG(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var uZ=!1,uJ={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function u0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!uJ[e.type]:"textarea"===t}function u1(e,t,n,r){tb(r),0<(t=sV(t,"onChange")).length&&(n=new i3("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var u2=null,u3=null;function u4(e){sM(e,0)}function u6(e){if(e4(eR(e)))return e}function u8(e,t){if("change"===e)return t}var u5=!1;if(e$){if(e$){var u7="oninput"in document;if(!u7){var u9=document.createElement("div");u9.setAttribute("oninput","return;"),u7="function"==typeof u9.oninput}r=u7}else r=!1;u5=r&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=so(r)}}function su(){for(var e=window,t=e6();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(n)e=t.contentWindow;else break;t=e6(e.document)}return t}function ss(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var sc=e$&&"documentMode"in document&&11>=document.documentMode,sf=null,sd=null,sp=null,sm=!1;function sh(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;sm||null==sf||sf!==e6(r)||(r="selectionStart"in(r=sf)&&ss(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},sp&&nQ(sp,r)||(sp=r,0<(r=sV(sd,"onSelect")).length&&(t=new i3("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sf)))}function sg(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var sy={animationend:sg("Animation","AnimationEnd"),animationiteration:sg("Animation","AnimationIteration"),animationstart:sg("Animation","AnimationStart"),transitionend:sg("Transition","TransitionEnd")},sv={},sb={};function sk(e){if(sv[e])return sv[e];if(!sy[e])return e;var t,n=sy[e];for(t in n)if(n.hasOwnProperty(t)&&t in sb)return sv[e]=n[t];return e}e$&&(sb=document.createElement("div").style,"AnimationEvent"in window||(delete sy.animationend.animation,delete sy.animationiteration.animation,delete sy.animationstart.animation),"TransitionEvent"in window||delete sy.transitionend.transition);var sw=sk("animationend"),sS=sk("animationiteration"),sC=sk("animationstart"),sE=sk("transitionend"),sx=new Map,sz="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function sP(e,t){sx.set(e,t),eV(t,[e])}for(var sN=0;sN title"):null)}var cz=null;function cP(){}function cN(){if(this.count--,0===this.count){if(this.stylesheets)cL(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var c_=null;function cL(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,c_=new Map,t.forEach(cT,e),c_=null,cN.call(e))}function cT(e,t){if(!(4&t.state.loading)){var n=c_.get(e);if(n)var r=n.get(null);else{n=new Map,c_.set(e,n);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a