Spaces:
No application file
No application file
Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .dockerignore +18 -0
- .github/workflows/publish.yml +52 -0
- .github/workflows/test.yml +28 -0
- .gitignore +14 -0
- .python-version +1 -0
- .vscode/extensions.json +3 -0
- .vscode/settings.json +6 -0
- Dockerfile +16 -0
- LICENSE +201 -0
- README.md +60 -7
- fly.toml +29 -0
- openui/__init__.py +0 -0
- openui/__main__.py +60 -0
- openui/config.py +51 -0
- openui/config.yaml +2 -0
- openui/db/models.py +149 -0
- openui/dist/android-chrome-192x192.png +0 -0
- openui/dist/android-chrome-512x512.png +0 -0
- openui/dist/annotator/extra.min.js +0 -0
- openui/dist/annotator/index.html +343 -0
- openui/dist/annotator/tailwindcss.min.js +0 -0
- openui/dist/apple-touch-icon.png +0 -0
- openui/dist/assets/Builder-b4JJdzJb.js +0 -0
- openui/dist/assets/CodeEditor-68n03aha.js +0 -0
- openui/dist/assets/SyntaxHighlighter-qlnMxUBv.js +13 -0
- openui/dist/assets/babel-nhLfYeWA.js +0 -0
- openui/dist/assets/html-i1xo8y4u.js +0 -0
- openui/dist/assets/index-2-rOUq-J.js +7 -0
- openui/dist/assets/index-3rRckdGL.js +12 -0
- openui/dist/assets/index-OfmkY5JK.css +1 -0
- openui/dist/assets/index-VsdO9OoH.js +11 -0
- openui/dist/assets/standalone-dIyWdECw.js +34 -0
- openui/dist/assets/textarea-4A01Dc6n.js +0 -0
- openui/dist/assets/vendor-BJpsy9o3.js +0 -0
- openui/dist/favicon.png +0 -0
- openui/dist/fonts/Inter-Bold.woff2 +0 -0
- openui/dist/fonts/Inter-Medium.woff2 +0 -0
- openui/dist/fonts/Inter-Regular.woff2 +0 -0
- openui/dist/icons/arrow-left.svg +1 -0
- openui/dist/index.html +42 -0
- openui/dist/robots.txt +2 -0
- openui/eval/.gitignore +3 -0
- openui/eval/__init__.py +0 -0
- openui/eval/dataset.py +78 -0
- openui/eval/evaluate.py +194 -0
- openui/eval/evaluate_weave.py +314 -0
- openui/eval/model.py +68 -0
- openui/eval/prompt_to_img.py +125 -0
- openui/eval/scrape.py +139 -0
- openui/eval/screenshots.py +20 -0
.dockerignore
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# flyctl launch added from .gitignore
|
2 |
+
**/.venv
|
3 |
+
**/__pycache__
|
4 |
+
**/wandb
|
5 |
+
**/*.py[cod]
|
6 |
+
**/*$py.class
|
7 |
+
**/venv
|
8 |
+
**/.eggs
|
9 |
+
**/.pytest_cache
|
10 |
+
**/*.egg-info
|
11 |
+
**/.DS_Store
|
12 |
+
**/build
|
13 |
+
|
14 |
+
# flyctl launch added from openui/eval/.gitignore
|
15 |
+
openui/eval/**/wandb
|
16 |
+
openui/eval/**/datasets
|
17 |
+
openui/eval/**/components
|
18 |
+
fly.toml
|
.github/workflows/publish.yml
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Publish Python Package
|
2 |
+
|
3 |
+
on:
|
4 |
+
release:
|
5 |
+
types: [created]
|
6 |
+
|
7 |
+
permissions:
|
8 |
+
contents: read
|
9 |
+
|
10 |
+
jobs:
|
11 |
+
test:
|
12 |
+
runs-on: ubuntu-latest
|
13 |
+
strategy:
|
14 |
+
matrix:
|
15 |
+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
16 |
+
steps:
|
17 |
+
- uses: actions/checkout@v4
|
18 |
+
- name: Set up Python ${{ matrix.python-version }}
|
19 |
+
uses: actions/setup-python@v5
|
20 |
+
with:
|
21 |
+
python-version: ${{ matrix.python-version }}
|
22 |
+
cache: pip
|
23 |
+
cache-dependency-path: pyproject.toml
|
24 |
+
- name: Install dependencies
|
25 |
+
run: |
|
26 |
+
pip install '.[test]'
|
27 |
+
- name: Run tests
|
28 |
+
run: |
|
29 |
+
pytest
|
30 |
+
deploy:
|
31 |
+
runs-on: ubuntu-latest
|
32 |
+
needs: [test]
|
33 |
+
environment: release
|
34 |
+
permissions:
|
35 |
+
id-token: write
|
36 |
+
steps:
|
37 |
+
- uses: actions/checkout@v4
|
38 |
+
- name: Set up Python
|
39 |
+
uses: actions/setup-python@v5
|
40 |
+
with:
|
41 |
+
python-version: "3.12"
|
42 |
+
cache: pip
|
43 |
+
cache-dependency-path: pyproject.toml
|
44 |
+
- name: Install dependencies
|
45 |
+
run: |
|
46 |
+
pip install setuptools wheel build
|
47 |
+
- name: Build
|
48 |
+
run: |
|
49 |
+
python -m build
|
50 |
+
- name: Publish
|
51 |
+
uses: pypa/gh-action-pypi-publish@release/v1
|
52 |
+
|
.github/workflows/test.yml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Test
|
2 |
+
|
3 |
+
on: [push, pull_request]
|
4 |
+
|
5 |
+
permissions:
|
6 |
+
contents: read
|
7 |
+
|
8 |
+
jobs:
|
9 |
+
test:
|
10 |
+
runs-on: ubuntu-latest
|
11 |
+
strategy:
|
12 |
+
matrix:
|
13 |
+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
14 |
+
steps:
|
15 |
+
- uses: actions/checkout@v4
|
16 |
+
- name: Set up Python ${{ matrix.python-version }}
|
17 |
+
uses: actions/setup-python@v5
|
18 |
+
with:
|
19 |
+
python-version: ${{ matrix.python-version }}
|
20 |
+
cache: pip
|
21 |
+
cache-dependency-path: pyproject.toml
|
22 |
+
- name: Install dependencies
|
23 |
+
run: |
|
24 |
+
pip install '.[test]'
|
25 |
+
- name: Run tests
|
26 |
+
run: |
|
27 |
+
pytest
|
28 |
+
|
.gitignore
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.venv
|
2 |
+
__pycache__/
|
3 |
+
wandb/
|
4 |
+
*.py[cod]
|
5 |
+
*$py.class
|
6 |
+
venv
|
7 |
+
.eggs
|
8 |
+
.pytest_cache
|
9 |
+
*.egg-info
|
10 |
+
.DS_Store
|
11 |
+
build
|
12 |
+
eval/components
|
13 |
+
eval/datasets
|
14 |
+
!eval/datasets/eval.csv
|
.python-version
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
openui
|
.vscode/extensions.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"recommendations": ["charliermarsh.ruff"]
|
3 |
+
}
|
.vscode/settings.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"[python]": {
|
3 |
+
"editor.formatOnSave": true,
|
4 |
+
"editor.defaultFormatter": "charliermarsh.ruff"
|
5 |
+
}
|
6 |
+
}
|
Dockerfile
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Build the virtualenv as a separate step: Only re-execute this step when pyproject.toml changes
|
2 |
+
FROM python:3.12-bookworm AS build-venv
|
3 |
+
COPY pyproject.toml /build/pyproject.toml
|
4 |
+
RUN python -m venv /venv && \
|
5 |
+
/venv/bin/pip install --upgrade pip setuptools wheel && \
|
6 |
+
mkdir -p /build/openui/util && touch /build/README.md
|
7 |
+
RUN /venv/bin/pip install --disable-pip-version-check /build
|
8 |
+
|
9 |
+
# Copy the virtualenv into a distroless image
|
10 |
+
FROM python:3.12-slim-bookworm
|
11 |
+
ENV PATH="/venv/bin:$PATH"
|
12 |
+
COPY --from=build-venv /venv /venv
|
13 |
+
COPY . /app
|
14 |
+
WORKDIR /app
|
15 |
+
RUN pip install --no-deps -U /app
|
16 |
+
ENTRYPOINT ["python", "-m", "openui"]
|
LICENSE
ADDED
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Apache License
|
2 |
+
Version 2.0, January 2004
|
3 |
+
http://www.apache.org/licenses/
|
4 |
+
|
5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6 |
+
|
7 |
+
1. Definitions.
|
8 |
+
|
9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
11 |
+
|
12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13 |
+
the copyright owner that is granting the License.
|
14 |
+
|
15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
16 |
+
other entities that control, are controlled by, or are under common
|
17 |
+
control with that entity. For the purposes of this definition,
|
18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
19 |
+
direction or management of such entity, whether by contract or
|
20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22 |
+
|
23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24 |
+
exercising permissions granted by this License.
|
25 |
+
|
26 |
+
"Source" form shall mean the preferred form for making modifications,
|
27 |
+
including but not limited to software source code, documentation
|
28 |
+
source, and configuration files.
|
29 |
+
|
30 |
+
"Object" form shall mean any form resulting from mechanical
|
31 |
+
transformation or translation of a Source form, including but
|
32 |
+
not limited to compiled object code, generated documentation,
|
33 |
+
and conversions to other media types.
|
34 |
+
|
35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
36 |
+
Object form, made available under the License, as indicated by a
|
37 |
+
copyright notice that is included in or attached to the work
|
38 |
+
(an example is provided in the Appendix below).
|
39 |
+
|
40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41 |
+
form, that is based on (or derived from) the Work and for which the
|
42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
44 |
+
of this License, Derivative Works shall not include works that remain
|
45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46 |
+
the Work and Derivative Works thereof.
|
47 |
+
|
48 |
+
"Contribution" shall mean any work of authorship, including
|
49 |
+
the original version of the Work and any modifications or additions
|
50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
54 |
+
means any form of electronic, verbal, or written communication sent
|
55 |
+
to the Licensor or its representatives, including but not limited to
|
56 |
+
communication on electronic mailing lists, source code control systems,
|
57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
59 |
+
excluding communication that is conspicuously marked or otherwise
|
60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
61 |
+
|
62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
64 |
+
subsequently incorporated within the Work.
|
65 |
+
|
66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
71 |
+
Work and such Derivative Works in Source or Object form.
|
72 |
+
|
73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76 |
+
(except as stated in this section) patent license to make, have made,
|
77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78 |
+
where such license applies only to those patent claims licensable
|
79 |
+
by such Contributor that are necessarily infringed by their
|
80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
82 |
+
institute patent litigation against any entity (including a
|
83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84 |
+
or a Contribution incorporated within the Work constitutes direct
|
85 |
+
or contributory patent infringement, then any patent licenses
|
86 |
+
granted to You under this License for that Work shall terminate
|
87 |
+
as of the date such litigation is filed.
|
88 |
+
|
89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
90 |
+
Work or Derivative Works thereof in any medium, with or without
|
91 |
+
modifications, and in Source or Object form, provided that You
|
92 |
+
meet the following conditions:
|
93 |
+
|
94 |
+
(a) You must give any other recipients of the Work or
|
95 |
+
Derivative Works a copy of this License; and
|
96 |
+
|
97 |
+
(b) You must cause any modified files to carry prominent notices
|
98 |
+
stating that You changed the files; and
|
99 |
+
|
100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
101 |
+
that You distribute, all copyright, patent, trademark, and
|
102 |
+
attribution notices from the Source form of the Work,
|
103 |
+
excluding those notices that do not pertain to any part of
|
104 |
+
the Derivative Works; and
|
105 |
+
|
106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107 |
+
distribution, then any Derivative Works that You distribute must
|
108 |
+
include a readable copy of the attribution notices contained
|
109 |
+
within such NOTICE file, excluding those notices that do not
|
110 |
+
pertain to any part of the Derivative Works, in at least one
|
111 |
+
of the following places: within a NOTICE text file distributed
|
112 |
+
as part of the Derivative Works; within the Source form or
|
113 |
+
documentation, if provided along with the Derivative Works; or,
|
114 |
+
within a display generated by the Derivative Works, if and
|
115 |
+
wherever such third-party notices normally appear. The contents
|
116 |
+
of the NOTICE file are for informational purposes only and
|
117 |
+
do not modify the License. You may add Your own attribution
|
118 |
+
notices within Derivative Works that You distribute, alongside
|
119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
120 |
+
that such additional attribution notices cannot be construed
|
121 |
+
as modifying the License.
|
122 |
+
|
123 |
+
You may add Your own copyright statement to Your modifications and
|
124 |
+
may provide additional or different license terms and conditions
|
125 |
+
for use, reproduction, or distribution of Your modifications, or
|
126 |
+
for any such Derivative Works as a whole, provided Your use,
|
127 |
+
reproduction, and distribution of the Work otherwise complies with
|
128 |
+
the conditions stated in this License.
|
129 |
+
|
130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
132 |
+
by You to the Licensor shall be under the terms and conditions of
|
133 |
+
this License, without any additional terms or conditions.
|
134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135 |
+
the terms of any separate license agreement you may have executed
|
136 |
+
with Licensor regarding such Contributions.
|
137 |
+
|
138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
140 |
+
except as required for reasonable and customary use in describing the
|
141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
142 |
+
|
143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144 |
+
agreed to in writing, Licensor provides the Work (and each
|
145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147 |
+
implied, including, without limitation, any warranties or conditions
|
148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150 |
+
appropriateness of using or redistributing the Work and assume any
|
151 |
+
risks associated with Your exercise of permissions under this License.
|
152 |
+
|
153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
154 |
+
whether in tort (including negligence), contract, or otherwise,
|
155 |
+
unless required by applicable law (such as deliberate and grossly
|
156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157 |
+
liable to You for damages, including any direct, indirect, special,
|
158 |
+
incidental, or consequential damages of any character arising as a
|
159 |
+
result of this License or out of the use or inability to use the
|
160 |
+
Work (including but not limited to damages for loss of goodwill,
|
161 |
+
work stoppage, computer failure or malfunction, or any and all
|
162 |
+
other commercial damages or losses), even if such Contributor
|
163 |
+
has been advised of the possibility of such damages.
|
164 |
+
|
165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168 |
+
or other liability obligations and/or rights consistent with this
|
169 |
+
License. However, in accepting such obligations, You may act only
|
170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171 |
+
of any other Contributor, and only if You agree to indemnify,
|
172 |
+
defend, and hold each Contributor harmless for any liability
|
173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
174 |
+
of your accepting any such warranty or additional liability.
|
175 |
+
|
176 |
+
END OF TERMS AND CONDITIONS
|
177 |
+
|
178 |
+
APPENDIX: How to apply the Apache License to your work.
|
179 |
+
|
180 |
+
To apply the Apache License to your work, attach the following
|
181 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182 |
+
replaced with your own identifying information. (Don't include
|
183 |
+
the brackets!) The text should be enclosed in the appropriate
|
184 |
+
comment syntax for the file format. We also recommend that a
|
185 |
+
file or class name and description of purpose be included on the
|
186 |
+
same "printed page" as the copyright notice for easier
|
187 |
+
identification within third-party archives.
|
188 |
+
|
189 |
+
Copyright [2024] [Weights and Biases, Inc.]
|
190 |
+
|
191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192 |
+
you may not use this file except in compliance with the License.
|
193 |
+
You may obtain a copy of the License at
|
194 |
+
|
195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
196 |
+
|
197 |
+
Unless required by applicable law or agreed to in writing, software
|
198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200 |
+
See the License for the specific language governing permissions and
|
201 |
+
limitations under the License.
|
README.md
CHANGED
@@ -1,12 +1,65 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
|
4 |
-
colorFrom: purple
|
5 |
-
colorTo: indigo
|
6 |
sdk: gradio
|
7 |
sdk_version: 4.25.0
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
---
|
|
|
11 |
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
title: open-ui
|
3 |
+
app_file: openui
|
|
|
|
|
4 |
sdk: gradio
|
5 |
sdk_version: 4.25.0
|
|
|
|
|
6 |
---
|
7 |
+
# OpenUI
|
8 |
|
9 |
+
[](https://pypi.org/project/wandb-openui/)
|
10 |
+
[](https://github.com/wandb/openui/releases)
|
11 |
+
[](https://github.com/wandb/openui/blob/main/LICENSE)
|
12 |
+
|
13 |
+
A backend service for generating HTML components with AI
|
14 |
+
|
15 |
+
## Installation
|
16 |
+
|
17 |
+
Clone this repo, then install using `pip`. You'll probably want to create a virtual env.
|
18 |
+
|
19 |
+
```bash
|
20 |
+
git clone https://github.com/wandb/openui
|
21 |
+
cd openui/backend
|
22 |
+
pip install .
|
23 |
+
```
|
24 |
+
|
25 |
+
## Usage
|
26 |
+
|
27 |
+
You must set the `OPENAI_API_KEY` even if you just want to try Ollama models. Just set it to `xxx` in that case like below.
|
28 |
+
|
29 |
+
```bash
|
30 |
+
OPENAI_API_KEY=xxx python -m openui
|
31 |
+
```
|
32 |
+
|
33 |
+
### Docker
|
34 |
+
|
35 |
+
You can build and run the docker file from the `/backend` directory:
|
36 |
+
|
37 |
+
```bash
|
38 |
+
docker build . -t wandb/openui --load
|
39 |
+
docker run -p 7878:7878 -e OPENAI_API_KEY wandb/openui
|
40 |
+
```
|
41 |
+
|
42 |
+
## Development
|
43 |
+
|
44 |
+
First be sure to install the package as editable, then passing `--dev` as an argument will live reload any local changes.
|
45 |
+
|
46 |
+
```bash
|
47 |
+
pip install -e .
|
48 |
+
python -m openui --dev
|
49 |
+
```
|
50 |
+
|
51 |
+
Now install the dependencies and test dependencies:
|
52 |
+
|
53 |
+
```bash
|
54 |
+
pip install -e '.[test]'
|
55 |
+
```
|
56 |
+
|
57 |
+
To run the tests:
|
58 |
+
|
59 |
+
```bash
|
60 |
+
pytest
|
61 |
+
```
|
62 |
+
|
63 |
+
## Evaluation
|
64 |
+
|
65 |
+
The [eval](./openui/eval) folder contains scripts for evaluating the performance of a model. It automates generating UI, taking screenshots of the UI, then asking `gpt-4-vision-preview` to rate the elements. More details about the eval pipeline coming soon...
|
fly.toml
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# fly.toml app configuration file generated for openui on 2024-03-15T15:53:15-07:00
|
2 |
+
#
|
3 |
+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
|
4 |
+
#
|
5 |
+
|
6 |
+
app = 'openui'
|
7 |
+
primary_region = 'sjc'
|
8 |
+
|
9 |
+
[http_service]
|
10 |
+
internal_port = 7878
|
11 |
+
force_https = true
|
12 |
+
auto_stop_machines = true
|
13 |
+
auto_start_machines = true
|
14 |
+
min_machines_running = 0
|
15 |
+
processes = ['app']
|
16 |
+
|
17 |
+
[mounts]
|
18 |
+
source = "openui_data"
|
19 |
+
destination = "/root/.openui"
|
20 |
+
|
21 |
+
[env]
|
22 |
+
OPENUI_ENVIRONMENT = "production"
|
23 |
+
OPENUI_HOST = "https://openui.fly.dev"
|
24 |
+
GITHUB_CLIENT_ID = "3af8fbeb90d06484dff0"
|
25 |
+
|
26 |
+
[[vm]]
|
27 |
+
memory = '1gb'
|
28 |
+
cpu_kind = 'shared'
|
29 |
+
cpus = 1
|
openui/__init__.py
ADDED
File without changes
|
openui/__main__.py
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from pathlib import Path
|
2 |
+
from .logs import setup_logger
|
3 |
+
from . import server
|
4 |
+
from . import config
|
5 |
+
import uvicorn
|
6 |
+
from uvicorn import Config
|
7 |
+
import sys
|
8 |
+
|
9 |
+
|
10 |
+
if __name__ == "__main__":
|
11 |
+
ui = any([arg == "-i" for arg in sys.argv])
|
12 |
+
logger = setup_logger("/tmp/openui.log" if ui else None)
|
13 |
+
logger.info("Starting OpenUI AI Server created by W&B...")
|
14 |
+
|
15 |
+
reload = any([arg == "--dev" for arg in sys.argv])
|
16 |
+
if reload:
|
17 |
+
config.ENV = config.Env.DEV
|
18 |
+
logger.info("Running in dev mode")
|
19 |
+
|
20 |
+
try:
|
21 |
+
from .tui.app import OpenUIApp
|
22 |
+
|
23 |
+
app = OpenUIApp()
|
24 |
+
server.queue = app.queue
|
25 |
+
except ImportError:
|
26 |
+
if ui:
|
27 |
+
logger.warning(
|
28 |
+
"Install OpenUI with pip install .[tui] to use the terminal UI"
|
29 |
+
)
|
30 |
+
ui = False
|
31 |
+
|
32 |
+
config_file = Path(__file__).parent / "log_config.yaml"
|
33 |
+
api_server = server.Server(
|
34 |
+
Config(
|
35 |
+
"openui.server:app",
|
36 |
+
host="0.0.0.0" if config.ENV == config.Env.PROD else "127.0.0.1",
|
37 |
+
log_config=str(config_file) if ui else None,
|
38 |
+
port=7878,
|
39 |
+
reload=reload,
|
40 |
+
)
|
41 |
+
)
|
42 |
+
if ui:
|
43 |
+
with api_server.run_in_thread():
|
44 |
+
logger.info("Running Terminal UI App")
|
45 |
+
app.run()
|
46 |
+
else:
|
47 |
+
logger.info("Running API Server")
|
48 |
+
mkcert_dir = Path.home() / ".vite-plugin-mkcert"
|
49 |
+
|
50 |
+
if reload:
|
51 |
+
# TODO: hot reload wasn't working with the server approach, and ctrl-C doesn't
|
52 |
+
# work with the uvicorn.run approach, so here we are
|
53 |
+
uvicorn.run(
|
54 |
+
"openui.server:app",
|
55 |
+
host="0.0.0.0" if config.ENV == config.Env.PROD else "127.0.0.1",
|
56 |
+
port=7878,
|
57 |
+
reload=reload,
|
58 |
+
)
|
59 |
+
else:
|
60 |
+
api_server.run_with_wandb()
|
openui/config.py
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from pathlib import Path
|
3 |
+
import secrets
|
4 |
+
from urllib.parse import urlparse
|
5 |
+
from enum import Enum
|
6 |
+
|
7 |
+
|
8 |
+
class Env(Enum):
|
9 |
+
LOCAL = 1
|
10 |
+
PROD = 2
|
11 |
+
DEV = 3
|
12 |
+
|
13 |
+
|
14 |
+
try:
|
15 |
+
env = os.getenv("OPENUI_ENVIRONMENT", "local")
|
16 |
+
if env == "production":
|
17 |
+
env = "prod"
|
18 |
+
elif env == "development":
|
19 |
+
env = "dev"
|
20 |
+
ENV = Env[env.upper()]
|
21 |
+
except KeyError:
|
22 |
+
print("Invalid environment, defaulting to running locally")
|
23 |
+
ENV = Env.LOCAL
|
24 |
+
|
25 |
+
default_db = Path.home() / ".openui" / "db.sqlite"
|
26 |
+
default_db.parent.mkdir(exist_ok=True)
|
27 |
+
DB = os.getenv("DATABASE", default_db)
|
28 |
+
HOST = os.getenv(
|
29 |
+
"OPENUI_HOST",
|
30 |
+
"https://localhost:5173" if ENV == Env.DEV else "http://localhost:7878",
|
31 |
+
)
|
32 |
+
RP_ID = urlparse(HOST).hostname
|
33 |
+
SESSION_KEY = os.getenv("OPENUI_SESSION_KEY")
|
34 |
+
if SESSION_KEY is None:
|
35 |
+
env_path = Path.home() / ".openui" / ".env"
|
36 |
+
if env_path.exists():
|
37 |
+
SESSION_KEY = env_path.read_text().splitlines()[0].split("=")[1]
|
38 |
+
else:
|
39 |
+
SESSION_KEY = secrets.token_hex(32)
|
40 |
+
with env_path.open("w") as f:
|
41 |
+
f.write("OPENUI_SESSION_KEY={SESSION_KEY}")
|
42 |
+
# GPT 3.5 is 0.0005 per 1k tokens input and 0.0015 output
|
43 |
+
# 700k puts us at a max of $1.00 spent per user over a 48 hour period
|
44 |
+
MAX_TOKENS = int(os.getenv("OPENUI_MAX_TOKENS", "700000"))
|
45 |
+
GITHUB_CLIENT_ID = os.getenv("GITHUB_CLIENT_ID")
|
46 |
+
GITHUB_CLIENT_SECRET = os.getenv("GITHUB_CLIENT_SECRET")
|
47 |
+
|
48 |
+
AWS_ENDPOINT_URL_S3 = os.getenv("AWS_ENDPOINT_URL_S3")
|
49 |
+
AWS_ACCESS_KEY_ID = os.getenv("AWS_ACCESS_KEY_ID")
|
50 |
+
AWS_SECRET_ACCESS_KEY = os.getenv("AWS_SECRET_ACCESS_KEY")
|
51 |
+
BUCKET_NAME = os.getenv("BUCKET_NAME", "openui")
|
openui/config.yaml
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
litellm_settings:
|
2 |
+
# callbacks: callbacks.weave_handler
|
openui/db/models.py
ADDED
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from peewee import (
|
2 |
+
Model,
|
3 |
+
BinaryUUIDField,
|
4 |
+
BooleanField,
|
5 |
+
CharField,
|
6 |
+
IntegerField,
|
7 |
+
DateField,
|
8 |
+
CompositeKey,
|
9 |
+
DateTimeField,
|
10 |
+
ForeignKeyField,
|
11 |
+
OperationalError,
|
12 |
+
fn,
|
13 |
+
)
|
14 |
+
import uuid
|
15 |
+
import datetime
|
16 |
+
from playhouse.sqlite_ext import SqliteExtDatabase, JSONField
|
17 |
+
from playhouse.migrate import SqliteMigrator, migrate
|
18 |
+
from openui import config
|
19 |
+
|
20 |
+
database = SqliteExtDatabase(
|
21 |
+
config.DB,
|
22 |
+
pragmas=(
|
23 |
+
("cache_size", -1024 * 64), # 64MB page-cache.
|
24 |
+
("journal_mode", "wal"), # Use WAL-mode
|
25 |
+
("foreign_keys", 1),
|
26 |
+
),
|
27 |
+
)
|
28 |
+
migrator = SqliteMigrator(database)
|
29 |
+
|
30 |
+
|
31 |
+
class BaseModel(Model):
|
32 |
+
class Meta:
|
33 |
+
database = database
|
34 |
+
|
35 |
+
|
36 |
+
class SchemaMigration(BaseModel):
|
37 |
+
version = CharField()
|
38 |
+
|
39 |
+
|
40 |
+
class User(BaseModel):
|
41 |
+
id = BinaryUUIDField(primary_key=True)
|
42 |
+
username = CharField(unique=True)
|
43 |
+
email = CharField(null=True)
|
44 |
+
created_at = DateTimeField()
|
45 |
+
|
46 |
+
|
47 |
+
class Credential(BaseModel):
|
48 |
+
credential_id = CharField(primary_key=True)
|
49 |
+
public_key = CharField()
|
50 |
+
sign_count = IntegerField()
|
51 |
+
aaguid = CharField(null=True)
|
52 |
+
user_verified = BooleanField(default=False)
|
53 |
+
user = ForeignKeyField(User, backref="credentials")
|
54 |
+
|
55 |
+
|
56 |
+
class Session(BaseModel):
|
57 |
+
id = BinaryUUIDField(primary_key=True)
|
58 |
+
user = ForeignKeyField(User, backref="sessions")
|
59 |
+
data = JSONField()
|
60 |
+
created_at = DateTimeField()
|
61 |
+
updated_at = DateTimeField()
|
62 |
+
|
63 |
+
|
64 |
+
class Component(BaseModel):
|
65 |
+
id = BinaryUUIDField(primary_key=True)
|
66 |
+
name = CharField()
|
67 |
+
user = ForeignKeyField(User, backref="components")
|
68 |
+
data = JSONField()
|
69 |
+
|
70 |
+
|
71 |
+
class Usage(BaseModel):
|
72 |
+
input_tokens = IntegerField()
|
73 |
+
output_tokens = IntegerField()
|
74 |
+
day = DateField()
|
75 |
+
user = ForeignKeyField(User, backref="usage")
|
76 |
+
|
77 |
+
class Meta:
|
78 |
+
primary_key = CompositeKey("user", "day")
|
79 |
+
|
80 |
+
@classmethod
|
81 |
+
def update_tokens(cls, user_id: str, input_tokens: int, output_tokens: int):
|
82 |
+
Usage.insert(
|
83 |
+
user_id=uuid.UUID(user_id).bytes,
|
84 |
+
day=datetime.datetime.now().date(),
|
85 |
+
input_tokens=input_tokens,
|
86 |
+
output_tokens=output_tokens,
|
87 |
+
).on_conflict(
|
88 |
+
conflict_target=[Usage.user_id, Usage.day],
|
89 |
+
update={
|
90 |
+
Usage.input_tokens: Usage.input_tokens + input_tokens,
|
91 |
+
Usage.output_tokens: Usage.output_tokens + output_tokens,
|
92 |
+
},
|
93 |
+
).execute()
|
94 |
+
|
95 |
+
@classmethod
|
96 |
+
def tokens_since(cls, user_id: str, day: datetime.date) -> int:
|
97 |
+
return (
|
98 |
+
Usage.select(
|
99 |
+
fn.SUM(Usage.input_tokens + Usage.output_tokens).alias("tokens")
|
100 |
+
)
|
101 |
+
.where(Usage.user_id == uuid.UUID(user_id).bytes, Usage.day >= day)
|
102 |
+
.get()
|
103 |
+
.tokens
|
104 |
+
or 0
|
105 |
+
)
|
106 |
+
|
107 |
+
|
108 |
+
CURRENT_VERSION = "2024-03-12"
|
109 |
+
|
110 |
+
|
111 |
+
def alter(schema: SchemaMigration, ops: list[list], version: str) -> bool:
|
112 |
+
try:
|
113 |
+
migrate(*ops)
|
114 |
+
except OperationalError as e:
|
115 |
+
print("Migration failed", e)
|
116 |
+
return False
|
117 |
+
schema.version = version
|
118 |
+
schema.save()
|
119 |
+
print(f"Migrated {version}")
|
120 |
+
return version != CURRENT_VERSION
|
121 |
+
|
122 |
+
|
123 |
+
def perform_migration(schema: SchemaMigration) -> bool:
|
124 |
+
if schema.version == "2024-03-08":
|
125 |
+
version = "2024-03-12"
|
126 |
+
aaguid = CharField(null=True)
|
127 |
+
user_verified = BooleanField(default=False)
|
128 |
+
altered = alter(
|
129 |
+
schema,
|
130 |
+
[
|
131 |
+
migrator.add_column("credential", "aaguid", aaguid),
|
132 |
+
migrator.add_column("credential", "user_verified", user_verified),
|
133 |
+
],
|
134 |
+
version,
|
135 |
+
)
|
136 |
+
if altered:
|
137 |
+
perform_migration(schema)
|
138 |
+
|
139 |
+
|
140 |
+
def ensure_migrated():
|
141 |
+
if not config.DB.exists():
|
142 |
+
database.create_tables(
|
143 |
+
[User, Credential, Session, Component, SchemaMigration, Usage]
|
144 |
+
)
|
145 |
+
SchemaMigration.create(version=CURRENT_VERSION)
|
146 |
+
else:
|
147 |
+
schema = SchemaMigration.select().first()
|
148 |
+
if schema.version != CURRENT_VERSION:
|
149 |
+
perform_migration(schema)
|
openui/dist/android-chrome-192x192.png
ADDED
![]() |
openui/dist/android-chrome-512x512.png
ADDED
![]() |
openui/dist/annotator/extra.min.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
openui/dist/annotator/index.html
ADDED
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html>
|
2 |
+
<head>
|
3 |
+
<script src="/openui/tailwindcss.min.js"></script>
|
4 |
+
<script type="text/javascript">
|
5 |
+
window.tailwind.config.darkMode = ['class', '.darkMode']
|
6 |
+
</script>
|
7 |
+
<style type="text/css">
|
8 |
+
.selected {
|
9 |
+
position: absolute;
|
10 |
+
z-index: 49;
|
11 |
+
border: 2px dashed orange;
|
12 |
+
border-radius: 3px;
|
13 |
+
}
|
14 |
+
.inspector-element {
|
15 |
+
position: absolute;
|
16 |
+
z-index: 100;
|
17 |
+
pointer-events: none;
|
18 |
+
border: 1px dashed rgb(139 92 246);
|
19 |
+
box-shadow: 0 0 3px rgb(139 92 246);
|
20 |
+
animation: pulseGlow 1s infinite ease-in-out;
|
21 |
+
border-radius: 2px;
|
22 |
+
transition: all 250ms ease-in-out;
|
23 |
+
background-color: rgba(250, 250, 250, 0.1);
|
24 |
+
}
|
25 |
+
#wrapper {
|
26 |
+
cursor: pointer;
|
27 |
+
padding-top: 20px;
|
28 |
+
}
|
29 |
+
@keyframes pulseGlow {
|
30 |
+
0% {
|
31 |
+
box-shadow: 0 0 3px rgb(139 92 246);
|
32 |
+
}
|
33 |
+
50% {
|
34 |
+
box-shadow: 0 0 8px rgb(139 92 200);
|
35 |
+
}
|
36 |
+
100% {
|
37 |
+
box-shadow: 0 0 3px rgb(139 92 246);
|
38 |
+
}
|
39 |
+
}
|
40 |
+
</style>
|
41 |
+
</head>
|
42 |
+
<body
|
43 |
+
class="no-select items-top flex h-full w-full justify-center bg-zinc-300 dark:bg-zinc-900"
|
44 |
+
>
|
45 |
+
<div class="no-select relative w-[80vw]" id="wrapper">${body}</div>
|
46 |
+
<div
|
47 |
+
id="prompt"
|
48 |
+
class="no-select absolute z-50 origin-top scale-0 transform rounded-md border border-zinc-200 bg-zinc-100 text-zinc-700 shadow-lg transition-all duration-300 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-300"
|
49 |
+
>
|
50 |
+
<div class="p-4 text-xs">
|
51 |
+
<h3 class="text-base font-semibold">How do you want this to change?</h3>
|
52 |
+
<input
|
53 |
+
type="text"
|
54 |
+
class="mt-2 w-[300px] rounded-md border border-zinc-200 px-4 py-2 text-zinc-600 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-300"
|
55 |
+
/>
|
56 |
+
<button class="ml-2 mt-4 rounded-md bg-blue-500 p-2 text-white">
|
57 |
+
Submit
|
58 |
+
</button>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
</body>
|
62 |
+
<script src="/openui/extra.min.js"></script>
|
63 |
+
<script type="text/javascript">
|
64 |
+
// Setup the room
|
65 |
+
window.theRoom.configure({
|
66 |
+
blockRedirection: false,
|
67 |
+
createInspector: true,
|
68 |
+
excludes: ['.no-select']
|
69 |
+
})
|
70 |
+
function clearInspector() {
|
71 |
+
const inspector = document.querySelector('.inspector-element')
|
72 |
+
if (inspector) {
|
73 |
+
inspector.style.top = '50%'
|
74 |
+
inspector.style.left = '50%'
|
75 |
+
inspector.style.width = ''
|
76 |
+
inspector.style.height = ''
|
77 |
+
inspector.style.border = 'none'
|
78 |
+
inspector.style.boxShadow = 'none'
|
79 |
+
}
|
80 |
+
}
|
81 |
+
let inspectorEnabled = false
|
82 |
+
// State TODO: maybe hydrate this from the parent
|
83 |
+
let commentIdx = 0
|
84 |
+
let selectedElements = []
|
85 |
+
// Reset the inspector every 5 seconds
|
86 |
+
let interval = null
|
87 |
+
// TODO: support more
|
88 |
+
let colors = ['blue', 'green', 'orange', 'yellow', 'red', 'purple']
|
89 |
+
let moved = false
|
90 |
+
document.addEventListener('mousemove', () => (moved = true))
|
91 |
+
document
|
92 |
+
.getElementById('wrapper')
|
93 |
+
.addEventListener('mouseleave', clearInspector)
|
94 |
+
function reset() {
|
95 |
+
interval = setInterval(() => {
|
96 |
+
if (!moved) {
|
97 |
+
clearInspector()
|
98 |
+
} else {
|
99 |
+
moved = false
|
100 |
+
}
|
101 |
+
}, 3000)
|
102 |
+
}
|
103 |
+
reset()
|
104 |
+
|
105 |
+
// TODO: might not need this if we just refactor the click handler
|
106 |
+
function reinitInspector(target, inspector) {
|
107 |
+
var pos = target.getBoundingClientRect()
|
108 |
+
var scrollTop = window.scrollY || document.documentElement.scrollTop
|
109 |
+
var scrollLeft = window.scrollX || document.documentElement.scrollLeft
|
110 |
+
var width = pos.width + 8
|
111 |
+
var height = pos.height + 8
|
112 |
+
var top = Math.max(-4, pos.top + scrollTop - 4)
|
113 |
+
var left = Math.max(-4, pos.left + scrollLeft - 4)
|
114 |
+
|
115 |
+
inspector.style.top = top + 'px'
|
116 |
+
inspector.style.left = left + 'px'
|
117 |
+
inspector.style.width = width + 'px'
|
118 |
+
inspector.style.height = height + 'px'
|
119 |
+
}
|
120 |
+
|
121 |
+
// Reset state on escape, submit on enter
|
122 |
+
document.addEventListener('keydown', e => {
|
123 |
+
if (e.key === 'Escape') {
|
124 |
+
clearInspector()
|
125 |
+
let p = document.getElementById('prompt')
|
126 |
+
if (p.classList.contains('scale-100')) {
|
127 |
+
p.querySelector('input').value = ''
|
128 |
+
let idx = p.dataset.commentIdx
|
129 |
+
document
|
130 |
+
.querySelectorAll('.selected-' + idx + ', .fix-legend-' + idx)
|
131 |
+
.forEach(selected => {
|
132 |
+
selected.parentNode.removeChild(selected)
|
133 |
+
})
|
134 |
+
p.classList.remove('scale-100')
|
135 |
+
if (inspectorEnabled) {
|
136 |
+
window.theRoom.start()
|
137 |
+
}
|
138 |
+
}
|
139 |
+
} else if (e.key === 'Enter') {
|
140 |
+
let sub = document.getElementById('prompt').querySelector('button')
|
141 |
+
sub.click()
|
142 |
+
}
|
143 |
+
})
|
144 |
+
|
145 |
+
window.addEventListener('resize', () => {
|
146 |
+
document.querySelectorAll('.selected').forEach(selected => {
|
147 |
+
let selIdx = parseInt(selected.dataset.commentIdx)
|
148 |
+
let el = selectedElements[selIdx]
|
149 |
+
reinitInspector(el, selected)
|
150 |
+
let fix = document.querySelector(`.fix-legend-${selIdx + 1}`)
|
151 |
+
fix.style.top = Math.max(3, parseFloat(selected.style.top) - 10) + 'px'
|
152 |
+
fix.style.left = parseFloat(selected.style.left) + 5 + 'px'
|
153 |
+
})
|
154 |
+
})
|
155 |
+
|
156 |
+
window.theRoom.on('mouseover', function () {
|
157 |
+
const inspector = document.querySelector('.inspector-element')
|
158 |
+
if (inspector) {
|
159 |
+
inspector.style.border = ''
|
160 |
+
inspector.style.boxShadow = ''
|
161 |
+
}
|
162 |
+
})
|
163 |
+
window.theRoom.on('click', function (element, event) {
|
164 |
+
event.preventDefault()
|
165 |
+
event.stopPropagation()
|
166 |
+
clearInterval(interval)
|
167 |
+
// TODO: reinit inspector here if it's gone
|
168 |
+
let inspector = document.querySelector('.inspector-element')
|
169 |
+
if (inspector.style.border === 'none') {
|
170 |
+
reinitInspector(element, inspector)
|
171 |
+
}
|
172 |
+
let selected = inspector.cloneNode()
|
173 |
+
let color = colors[commentIdx]
|
174 |
+
selected.classList.add('selected')
|
175 |
+
selected.classList.add('no-select')
|
176 |
+
selected.classList.add('selected-' + commentIdx)
|
177 |
+
selected.classList.remove('inspector-element')
|
178 |
+
selected.dataset.commentIdx = commentIdx
|
179 |
+
selected.style.borderColor = color
|
180 |
+
if (element.parentNode.id === 'wrapper') {
|
181 |
+
// TODO: think about this one more
|
182 |
+
selected.style.zIndex = -1
|
183 |
+
}
|
184 |
+
let prompt = document.getElementById('prompt')
|
185 |
+
prompt.dataset.commentIdx = commentIdx
|
186 |
+
prompt.classList.add('scale-100')
|
187 |
+
prompt.style.top = event.clientY + 'px'
|
188 |
+
prompt.style.left = '50%' // event.clientX + 'px'
|
189 |
+
prompt.style.marginLeft = `-200px`
|
190 |
+
let input = prompt.querySelector('input')
|
191 |
+
input.focus()
|
192 |
+
prompt.querySelector('button').addEventListener('click', () => {
|
193 |
+
addComment(input.value)
|
194 |
+
input.value = ''
|
195 |
+
prompt.classList.remove('scale-100')
|
196 |
+
})
|
197 |
+
// TODO: make it clear "esc" cancels
|
198 |
+
document.body.append(selected)
|
199 |
+
let fix = document.createElement('div')
|
200 |
+
fix.innerText = element.tagName
|
201 |
+
fix.addEventListener('mouseenter', () => {
|
202 |
+
const cmt = document.createElement('div')
|
203 |
+
cmt.innerText = text
|
204 |
+
cmt.className =
|
205 |
+
'p-2 rounded bg-white text-purple-500 italic absolute opacity-95 fix-comment'
|
206 |
+
cmt.style.top = Math.max(3, parseFloat(selected.style.top)) + 'px'
|
207 |
+
cmt.style.left = parseFloat(selected.style.left) + 'px'
|
208 |
+
cmt.style.zIndex = 50
|
209 |
+
document.body.append(cmt)
|
210 |
+
})
|
211 |
+
fix.addEventListener('mouseleave', () => {
|
212 |
+
const cmt = document.querySelector('.fix-comment')
|
213 |
+
if (cmt) {
|
214 |
+
cmt.parentNode.removeChild(cmt)
|
215 |
+
}
|
216 |
+
})
|
217 |
+
fix.className = `no-select fix fix-legend-${commentIdx} italic text-white text-center font-mono text-[8px] px-2 pt-0 z-50`
|
218 |
+
fix.classList.add('bg-' + color + '-600/[0.7]')
|
219 |
+
// TODO: use tailwind
|
220 |
+
fix.style.border = '1px dashed ' + color
|
221 |
+
fix.style.position = 'absolute'
|
222 |
+
fix.style.height = '12px'
|
223 |
+
fix.style.top = Math.max(3, parseFloat(selected.style.top) - 10) + 'px'
|
224 |
+
fix.style.left = parseFloat(selected.style.left) + 5 + 'px'
|
225 |
+
document.body.append(fix)
|
226 |
+
window.theRoom.stop()
|
227 |
+
function addComment(text) {
|
228 |
+
//let text = prompt('What would you like to fix about this?')
|
229 |
+
if (text) {
|
230 |
+
commentIdx += 1
|
231 |
+
let c = document.createComment('FIX (' + commentIdx + '): ' + text)
|
232 |
+
element.parentNode.insertBefore(c, element)
|
233 |
+
window.parent.parent.postMessage(
|
234 |
+
{
|
235 |
+
comment: text,
|
236 |
+
idx: commentIdx,
|
237 |
+
html: document.getElementById('wrapper').innerHTML
|
238 |
+
},
|
239 |
+
'*'
|
240 |
+
)
|
241 |
+
} else {
|
242 |
+
return
|
243 |
+
}
|
244 |
+
selectedElements.push(element)
|
245 |
+
clearInspector()
|
246 |
+
setTimeout(() => {
|
247 |
+
if (inspectorEnabled) {
|
248 |
+
window.theRoom.start()
|
249 |
+
}
|
250 |
+
reset()
|
251 |
+
}, 500)
|
252 |
+
}
|
253 |
+
})
|
254 |
+
|
255 |
+
window.addEventListener('load', () => {
|
256 |
+
window.parent.parent.postMessage({ action: 'ready' }, '*')
|
257 |
+
})
|
258 |
+
|
259 |
+
window._go = function (cb) {
|
260 |
+
if (document.readyState === 'complete') {
|
261 |
+
cb()
|
262 |
+
} else {
|
263 |
+
document.addEventListener('DOMContentLoaded', cb)
|
264 |
+
}
|
265 |
+
}
|
266 |
+
|
267 |
+
// handle events from parent
|
268 |
+
window.addEventListener(
|
269 |
+
'message',
|
270 |
+
function (event) {
|
271 |
+
if (event.data.action === 'take-screenshot') {
|
272 |
+
console.log('Got take screenshot event')
|
273 |
+
html2canvas(document.body, {
|
274 |
+
useCors: true,
|
275 |
+
foreignObjectRendering: true,
|
276 |
+
allowTaint: true,
|
277 |
+
windowWidth: 1524,
|
278 |
+
windowHeight: 768
|
279 |
+
}).then(function (canvas) {
|
280 |
+
const data = canvas.toDataURL('image/png')
|
281 |
+
window.parent.parent.postMessage(
|
282 |
+
{ screenshot: data, action: 'screenshot' },
|
283 |
+
'*'
|
284 |
+
)
|
285 |
+
})
|
286 |
+
} else if (event.data.action === 'hydrate') {
|
287 |
+
let wrapper = document.getElementById('wrapper')
|
288 |
+
wrapper.innerHTML = event.data.html
|
289 |
+
wrapper.querySelectorAll('img').forEach(img => {
|
290 |
+
img.crossOrigin = 'anonymous'
|
291 |
+
})
|
292 |
+
|
293 |
+
if (event.data.darkMode) {
|
294 |
+
document.documentElement.classList.add('darkMode')
|
295 |
+
}
|
296 |
+
document.querySelectorAll('.user-script').forEach(scr => {
|
297 |
+
scr.parentNode.removeChild(scr)
|
298 |
+
})
|
299 |
+
event.data.js.forEach(js => {
|
300 |
+
const script = document.createElement('script')
|
301 |
+
script.classList.add('user-script')
|
302 |
+
script.type = js.type
|
303 |
+
if (js.src) script.setAttribute('src', js.src)
|
304 |
+
// Close our JS to avoid conflicts
|
305 |
+
script.text = `(()=>{${js.text}})()`
|
306 |
+
document.body.append(script)
|
307 |
+
})
|
308 |
+
// Remove our selected elements
|
309 |
+
selectedElements = []
|
310 |
+
commentIdx = 0
|
311 |
+
var elements = document.querySelectorAll('.selected, .fix')
|
312 |
+
elements.forEach(function (element) {
|
313 |
+
element.parentNode.removeChild(element)
|
314 |
+
})
|
315 |
+
// TODO: maybe delay this a bit
|
316 |
+
window.parent.parent.postMessage(
|
317 |
+
{
|
318 |
+
preview: wrapper.hasChildNodes(),
|
319 |
+
height: document.body.scrollHeight,
|
320 |
+
action: 'loaded'
|
321 |
+
},
|
322 |
+
'*'
|
323 |
+
)
|
324 |
+
// state = event.data.state
|
325 |
+
} else if (event.data.action === 'toggle-dark-mode') {
|
326 |
+
if (document.documentElement.classList.contains('darkMode')) {
|
327 |
+
document.documentElement.classList.remove('darkMode')
|
328 |
+
} else {
|
329 |
+
document.documentElement.classList.add('darkMode')
|
330 |
+
}
|
331 |
+
} else if (event.data.action === 'toggle-inspector') {
|
332 |
+
if (inspectorEnabled) {
|
333 |
+
window.theRoom.stop()
|
334 |
+
} else {
|
335 |
+
window.theRoom.start()
|
336 |
+
}
|
337 |
+
inspectorEnabled = !inspectorEnabled
|
338 |
+
}
|
339 |
+
},
|
340 |
+
false
|
341 |
+
)
|
342 |
+
</script>
|
343 |
+
</html>
|
openui/dist/annotator/tailwindcss.min.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
openui/dist/apple-touch-icon.png
ADDED
![]() |
openui/dist/assets/Builder-b4JJdzJb.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
openui/dist/assets/CodeEditor-68n03aha.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
openui/dist/assets/SyntaxHighlighter-qlnMxUBv.js
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import{R as X,_ as Zn,T as ye,I as be,j as Vn}from"./vendor-BJpsy9o3.js";import{u as Kn}from"./index-2-rOUq-J.js";function Yn(e,n){if(e==null)return{};var t={},a=Object.keys(e),o,s;for(s=0;s<a.length;s++)o=a[s],!(n.indexOf(o)>=0)&&(t[o]=e[o]);return t}function Jn(e,n){if(e==null)return{};var t=Yn(e,n),a,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)a=s[o],!(n.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(t[a]=e[a])}return t}function Fe(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,a=new Array(n);t<n;t++)a[t]=e[t];return a}function Xn(e){if(Array.isArray(e))return Fe(e)}function Qn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function et(e,n){if(e){if(typeof e=="string")return Fe(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Fe(e,n)}}function nt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
2 |
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tt(e){return Xn(e)||Qn(e)||et(e)||nt()}function ge(e){"@babel/helpers - typeof";return ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ge(e)}function at(e,n){if(ge(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var a=t.call(e,n||"default");if(ge(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function rt(e){var n=at(e,"string");return ge(n)=="symbol"?n:String(n)}function fn(e,n,t){return n=rt(n),n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Ge(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,a)}return t}function oe(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Ge(Object(t),!0).forEach(function(a){fn(e,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ge(Object(t)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))})}return e}function ot(e){var n=e.length;if(n===0||n===1)return e;if(n===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(n===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(n>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var Ae={};function lt(e){if(e.length===0||e.length===1)return e;var n=e.join(".");return Ae[n]||(Ae[n]=ot(e)),Ae[n]}function ct(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0,a=e.filter(function(s){return s!=="token"}),o=lt(a);return o.reduce(function(s,p){return oe(oe({},s),t[p])},n)}function Ze(e){return e.join(" ")}function it(e,n){var t=0;return function(a){return t+=1,a.map(function(o,s){return pn({node:o,stylesheet:e,useInlineStyles:n,key:"code-segment-".concat(t,"-").concat(s)})})}}function pn(e){var n=e.node,t=e.stylesheet,a=e.style,o=a===void 0?{}:a,s=e.useInlineStyles,p=e.key,l=n.properties,m=n.type,S=n.tagName,v=n.value;if(m==="text")return v;if(S){var h=it(t,s),x;if(!s)x=oe(oe({},l),{},{className:Ze(l.className)});else{var b=Object.keys(t).reduce(function(N,c){return c.split(".").forEach(function(r){N.includes(r)||N.push(r)}),N},[]),R=l.className&&l.className.includes("token")?["token"]:[],k=l.className&&R.concat(l.className.filter(function(N){return!b.includes(N)}));x=oe(oe({},l),{},{className:Ze(k)||void 0,style:ct(l.className,Object.assign({},l.style,o),t)})}var M=h(n.children);return X.createElement(S,Zn({key:p},x),M)}}const st=function(e,n){var t=e.listLanguages();return t.indexOf(n)!==-1};var ut=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Ve(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,a)}return t}function Y(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Ve(Object(t),!0).forEach(function(a){fn(e,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ve(Object(t)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))})}return e}var gt=/\n/g;function dt(e){return e.match(gt)}function ft(e){var n=e.lines,t=e.startingLineNumber,a=e.style;return n.map(function(o,s){var p=s+t;return X.createElement("span",{key:"line-".concat(s),className:"react-syntax-highlighter-line-number",style:typeof a=="function"?a(p):a},"".concat(p,`
|
3 |
+
`))})}function pt(e){var n=e.codeString,t=e.codeStyle,a=e.containerStyle,o=a===void 0?{float:"left",paddingRight:"10px"}:a,s=e.numberStyle,p=s===void 0?{}:s,l=e.startingLineNumber;return X.createElement("code",{style:Object.assign({},t,o)},ft({lines:n.replace(/\n$/,"").split(`
|
4 |
+
`),style:p,startingLineNumber:l}))}function vt(e){return"".concat(e.toString().length,".25em")}function vn(e,n){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:n},children:[{type:"text",value:e}]}}function mn(e,n,t){var a={display:"inline-block",minWidth:vt(t),paddingRight:"1em",textAlign:"right",userSelect:"none"},o=typeof e=="function"?e(n):e,s=Y(Y({},a),o);return s}function he(e){var n=e.children,t=e.lineNumber,a=e.lineNumberStyle,o=e.largestLineNumber,s=e.showInlineLineNumbers,p=e.lineProps,l=p===void 0?{}:p,m=e.className,S=m===void 0?[]:m,v=e.showLineNumbers,h=e.wrapLongLines,x=typeof l=="function"?l(t):l;if(x.className=S,t&&s){var b=mn(a,t,o);n.unshift(vn(t,b))}return h&v&&(x.style=Y(Y({},x.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:x,children:n}}function hn(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=0;a<e.length;a++){var o=e[a];if(o.type==="text")t.push(he({children:[o],className:tt(new Set(n))}));else if(o.children){var s=n.concat(o.properties.className);hn(o.children,s).forEach(function(p){return t.push(p)})}}return t}function mt(e,n,t,a,o,s,p,l,m){var S,v=hn(e.value),h=[],x=-1,b=0;function R(u,i){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return he({children:u,lineNumber:i,lineNumberStyle:l,largestLineNumber:p,showInlineLineNumbers:o,lineProps:t,className:f,showLineNumbers:a,wrapLongLines:m})}function k(u,i){if(a&&i&&o){var f=mn(l,i,p);u.unshift(vn(i,f))}return u}function M(u,i){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return n||f.length>0?R(u,i,f):k(u,i)}for(var N=function(){var i=v[b],f=i.children[0].value,y=dt(f);if(y){var d=f.split(`
|
5 |
+
`);d.forEach(function(A,$){var j=a&&h.length+s,P={type:"text",value:"".concat(A,`
|
6 |
+
`)};if($===0){var U=v.slice(x+1,b).concat(he({children:[P],className:i.properties.className})),_=M(U,j);h.push(_)}else if($===d.length-1){var z=v[b+1]&&v[b+1].children&&v[b+1].children[0],Z={type:"text",value:"".concat(A)};if(z){var C=he({children:[Z],className:i.properties.className});v.splice(b+1,0,C)}else{var E=[Z],O=M(E,j,i.properties.className);h.push(O)}}else{var F=[P],T=M(F,j,i.properties.className);h.push(T)}}),x=b}b++};b<v.length;)N();if(x!==v.length-1){var c=v.slice(x+1,v.length);if(c&&c.length){var r=a&&h.length+s,g=M(c,r);h.push(g)}}return n?h:(S=[]).concat.apply(S,h)}function ht(e){var n=e.rows,t=e.stylesheet,a=e.useInlineStyles;return n.map(function(o,s){return pn({node:o,stylesheet:t,useInlineStyles:a,key:"code-segement".concat(s)})})}function yn(e){return e&&typeof e.highlightAuto<"u"}function yt(e){var n=e.astGenerator,t=e.language,a=e.code,o=e.defaultCodeValue;if(yn(n)){var s=st(n,t);return t==="text"?{value:o,language:"text"}:s?n.highlight(t,a):n.highlightAuto(a)}try{return t&&t!=="text"?{value:n.highlight(a,t)}:{value:o}}catch{return{value:o}}}function bt(e,n){return function(a){var o=a.language,s=a.children,p=a.style,l=p===void 0?n:p,m=a.customStyle,S=m===void 0?{}:m,v=a.codeTagProps,h=v===void 0?{className:o?"language-".concat(o):void 0,style:Y(Y({},l['code[class*="language-"]']),l['code[class*="language-'.concat(o,'"]')])}:v,x=a.useInlineStyles,b=x===void 0?!0:x,R=a.showLineNumbers,k=R===void 0?!1:R,M=a.showInlineLineNumbers,N=M===void 0?!0:M,c=a.startingLineNumber,r=c===void 0?1:c,g=a.lineNumberContainerStyle,u=a.lineNumberStyle,i=u===void 0?{}:u,f=a.wrapLines,y=a.wrapLongLines,d=y===void 0?!1:y,A=a.lineProps,$=A===void 0?{}:A,j=a.renderer,P=a.PreTag,U=P===void 0?"pre":P,_=a.CodeTag,z=_===void 0?"code":_,Z=a.code,C=Z===void 0?(Array.isArray(s)?s[0]:s)||"":Z,E=a.astGenerator,O=Jn(a,ut);E=E||e;var F=k?X.createElement(pt,{containerStyle:g,codeStyle:h.style||{},numberStyle:i,startingLineNumber:r,codeString:C}):null,T=l.hljs||l['pre[class*="language-"]']||{backgroundColor:"#fff"},te=yn(E)?"hljs":"prismjs",H=b?Object.assign({},O,{style:Object.assign({},T,S)}):Object.assign({},O,{className:O.className?"".concat(te," ").concat(O.className):te,style:Object.assign({},S)});if(d?h.style=Y(Y({},h.style),{},{whiteSpace:"pre-wrap"}):h.style=Y(Y({},h.style),{},{whiteSpace:"pre"}),!E)return X.createElement(U,H,F,X.createElement(z,h,C));(f===void 0&&j||d)&&(f=!0),j=j||ht;var V=[{type:"text",value:C}],q=yt({astGenerator:E,language:o,code:C,defaultCodeValue:V});q.language===null&&(q.value=V);var K=q.value.length+r,ce=mt(q,f,$,k,N,r,K,i,d);return X.createElement(U,H,X.createElement(z,h,!N&&F,j({rows:ce,stylesheet:l,useInlineStyles:b})))}}var xt=St,wt=Object.prototype.hasOwnProperty;function St(){for(var e={},n=0;n<arguments.length;n++){var t=arguments[n];for(var a in t)wt.call(t,a)&&(e[a]=t[a])}return e}var bn=xn,Le=xn.prototype;Le.space=null;Le.normal={};Le.property={};function xn(e,n,t){this.property=e,this.normal=n,t&&(this.space=t)}var Ke=xt,At=bn,Ct=Ft;function Ft(e){for(var n=e.length,t=[],a=[],o=-1,s,p;++o<n;)s=e[o],t.push(s.property),a.push(s.normal),p=s.space;return new At(Ke.apply(null,t),Ke.apply(null,a),p)}var Oe=kt;function kt(e){return e.toLowerCase()}var wn=Sn,G=Sn.prototype;G.space=null;G.attribute=null;G.property=null;G.boolean=!1;G.booleanish=!1;G.overloadedBoolean=!1;G.number=!1;G.commaSeparated=!1;G.spaceSeparated=!1;G.commaOrSpaceSeparated=!1;G.mustUseProperty=!1;G.defined=!1;function Sn(e,n){this.property=e,this.attribute=n}var J={},$t=0;J.boolean=ne();J.booleanish=ne();J.overloadedBoolean=ne();J.number=ne();J.spaceSeparated=ne();J.commaSeparated=ne();J.commaOrSpaceSeparated=ne();function ne(){return Math.pow(2,++$t)}var An=wn,Ye=J,Cn=Ee;Ee.prototype=new An;Ee.prototype.defined=!0;var Fn=["boolean","booleanish","overloadedBoolean","number","commaSeparated","spaceSeparated","commaOrSpaceSeparated"],Lt=Fn.length;function Ee(e,n,t,a){var o=-1,s;for(Je(this,"space",a),An.call(this,e,n);++o<Lt;)s=Fn[o],Je(this,s,(t&Ye[s])===Ye[s])}function Je(e,n,t){t&&(e[n]=t)}var Xe=Oe,Ot=bn,Et=Cn,de=Nt;function Nt(e){var n=e.space,t=e.mustUseProperty||[],a=e.attributes||{},o=e.properties,s=e.transform,p={},l={},m,S;for(m in o)S=new Et(m,s(a,m),o[m],n),t.indexOf(m)!==-1&&(S.mustUseProperty=!0),p[m]=S,l[Xe(m)]=m,l[Xe(S.attribute)]=m;return new Ot(p,l,n)}var jt=de,Tt=jt({space:"xlink",transform:It,properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}});function It(e,n){return"xlink:"+n.slice(5).toLowerCase()}var Mt=de,Pt=Mt({space:"xml",transform:zt,properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function zt(e,n){return"xml:"+n.slice(3).toLowerCase()}var Dt=Rt;function Rt(e,n){return n in e?e[n]:n}var _t=Dt,kn=Ht;function Ht(e,n){return _t(e,n.toLowerCase())}var Bt=de,Ut=kn,qt=Bt({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Ut,properties:{xmlns:null,xmlnsXLink:null}}),Ne=J,Wt=de,B=Ne.booleanish,W=Ne.number,ee=Ne.spaceSeparated,Gt=Wt({transform:Zt,properties:{ariaActiveDescendant:null,ariaAtomic:B,ariaAutoComplete:null,ariaBusy:B,ariaChecked:B,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:ee,ariaCurrent:null,ariaDescribedBy:ee,ariaDetails:null,ariaDisabled:B,ariaDropEffect:ee,ariaErrorMessage:null,ariaExpanded:B,ariaFlowTo:ee,ariaGrabbed:B,ariaHasPopup:null,ariaHidden:B,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ee,ariaLevel:W,ariaLive:null,ariaModal:B,ariaMultiLine:B,ariaMultiSelectable:B,ariaOrientation:null,ariaOwns:ee,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:B,ariaReadOnly:B,ariaRelevant:null,ariaRequired:B,ariaRoleDescription:ee,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:B,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null}});function Zt(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}var le=J,Vt=de,Kt=kn,w=le.boolean,Yt=le.overloadedBoolean,ie=le.booleanish,L=le.number,D=le.spaceSeparated,ve=le.commaSeparated,Jt=Vt({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Kt,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ve,acceptCharset:D,accessKey:D,action:null,allow:null,allowFullScreen:w,allowPaymentRequest:w,allowUserMedia:w,alt:null,as:null,async:w,autoCapitalize:null,autoComplete:D,autoFocus:w,autoPlay:w,capture:w,charSet:null,checked:w,cite:null,className:D,cols:L,colSpan:null,content:null,contentEditable:ie,controls:w,controlsList:D,coords:L|ve,crossOrigin:null,data:null,dateTime:null,decoding:null,default:w,defer:w,dir:null,dirName:null,disabled:w,download:Yt,draggable:ie,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:w,formTarget:null,headers:D,height:L,hidden:w,high:L,href:null,hrefLang:null,htmlFor:D,httpEquiv:D,id:null,imageSizes:null,imageSrcSet:ve,inputMode:null,integrity:null,is:null,isMap:w,itemId:null,itemProp:D,itemRef:D,itemScope:w,itemType:D,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:w,low:L,manifest:null,max:null,maxLength:L,media:null,method:null,min:null,minLength:L,multiple:w,muted:w,name:null,nonce:null,noModule:w,noValidate:w,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextMenu:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:w,optimum:L,pattern:null,ping:D,placeholder:null,playsInline:w,poster:null,preload:null,readOnly:w,referrerPolicy:null,rel:D,required:w,reversed:w,rows:L,rowSpan:L,sandbox:D,scope:null,scoped:w,seamless:w,selected:w,shape:null,size:L,sizes:null,slot:null,span:L,spellCheck:ie,src:null,srcDoc:null,srcLang:null,srcSet:ve,start:L,step:null,style:null,tabIndex:L,target:null,title:null,translate:null,type:null,typeMustMatch:w,useMap:null,value:ie,width:L,wrap:null,align:null,aLink:null,archive:D,axis:null,background:null,bgColor:null,border:L,borderColor:null,bottomMargin:L,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:w,declare:w,event:null,face:null,frame:null,frameBorder:null,hSpace:L,leftMargin:L,link:null,longDesc:null,lowSrc:null,marginHeight:L,marginWidth:L,noResize:w,noHref:w,noShade:w,noWrap:w,object:null,profile:null,prompt:null,rev:null,rightMargin:L,rules:null,scheme:null,scrolling:ie,standby:null,summary:null,text:null,topMargin:L,valueType:null,version:null,vAlign:null,vLink:null,vSpace:L,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:w,disableRemotePlayback:w,prefix:null,property:null,results:L,security:null,unselectable:null}}),Xt=Ct,Qt=Tt,ea=Pt,na=qt,ta=Gt,aa=Jt,ra=Xt([ea,Qt,na,ta,aa]),oa=Oe,la=Cn,ca=wn,je="data",ia=ga,sa=/^data[-\w.:]+$/i,$n=/-[a-z]/g,ua=/[A-Z]/g;function ga(e,n){var t=oa(n),a=n,o=ca;return t in e.normal?e.property[e.normal[t]]:(t.length>4&&t.slice(0,4)===je&&sa.test(n)&&(n.charAt(4)==="-"?a=da(n):n=fa(n),o=la),new o(a,n))}function da(e){var n=e.slice(5).replace($n,va);return je+n.charAt(0).toUpperCase()+n.slice(1)}function fa(e){var n=e.slice(4);return $n.test(n)?e:(n=n.replace(ua,pa),n.charAt(0)!=="-"&&(n="-"+n),je+n)}function pa(e){return"-"+e.toLowerCase()}function va(e){return e.charAt(1).toUpperCase()}var ma=ha,Qe=/[#.]/g;function ha(e,n){for(var t=e||"",a=n||"div",o={},s=0,p,l,m;s<t.length;)Qe.lastIndex=s,m=Qe.exec(t),p=t.slice(s,m?m.index:t.length),p&&(l?l==="#"?o.id=p:o.className?o.className.push(p):o.className=[p]:a=p,s+=p.length),m&&(l=m[0],s++);return{type:"element",tagName:a,properties:o,children:[]}}var Te={};Te.parse=xa;Te.stringify=wa;var en="",ya=" ",ba=/[ \t\n\r\f]+/g;function xa(e){var n=String(e||en).trim();return n===en?[]:n.split(ba)}function wa(e){return e.join(ya).trim()}var Ie={};Ie.parse=Sa;Ie.stringify=Aa;var ke=",",nn=" ",se="";function Sa(e){for(var n=[],t=String(e||se),a=t.indexOf(ke),o=0,s=!1,p;!s;)a===-1&&(a=t.length,s=!0),p=t.slice(o,a).trim(),(p||!s)&&n.push(p),o=a+1,a=t.indexOf(ke,o);return n}function Aa(e,n){var t=n||{},a=t.padLeft===!1?se:nn,o=t.padRight?nn:se;return e[e.length-1]===se&&(e=e.concat(se)),e.join(o+ke+a).trim()}var Ca=ia,tn=Oe,Fa=ma,an=Te.parse,rn=Ie.parse,ka=La,$a={}.hasOwnProperty;function La(e,n,t){var a=t?Ta(t):null;return o;function o(p,l){var m=Fa(p,n),S=Array.prototype.slice.call(arguments,2),v=m.tagName.toLowerCase(),h;if(m.tagName=a&&$a.call(a,v)?a[v]:v,l&&Oa(l,m)&&(S.unshift(l),l=null),l)for(h in l)s(m.properties,h,l[h]);return Ln(m.children,S),m.tagName==="template"&&(m.content={type:"root",children:m.children},m.children=[]),m}function s(p,l,m){var S,v,h;m==null||m!==m||(S=Ca(e,l),v=S.property,h=m,typeof h=="string"&&(S.spaceSeparated?h=an(h):S.commaSeparated?h=rn(h):S.commaOrSpaceSeparated&&(h=an(rn(h).join(" ")))),v==="style"&&typeof m!="string"&&(h=ja(h)),v==="className"&&p.className&&(h=p.className.concat(h)),p[v]=Na(S,v,h))}}function Oa(e,n){return typeof e=="string"||"length"in e||Ea(n.tagName,e)}function Ea(e,n){var t=n.type;return e==="input"||!t||typeof t!="string"?!1:typeof n.children=="object"&&"length"in n.children?!0:(t=t.toLowerCase(),e==="button"?t!=="menu"&&t!=="submit"&&t!=="reset"&&t!=="button":"value"in n)}function Ln(e,n){var t,a;if(typeof n=="string"||typeof n=="number"){e.push({type:"text",value:String(n)});return}if(typeof n=="object"&&"length"in n){for(t=-1,a=n.length;++t<a;)Ln(e,n[t]);return}if(typeof n!="object"||!("type"in n))throw new Error("Expected node, nodes, or string, got `"+n+"`");e.push(n)}function Na(e,n,t){var a,o,s;if(typeof t!="object"||!("length"in t))return on(e,n,t);for(o=t.length,a=-1,s=[];++a<o;)s[a]=on(e,n,t[a]);return s}function on(e,n,t){var a=t;return e.number||e.positiveNumber?!isNaN(a)&&a!==""&&(a=Number(a)):(e.boolean||e.overloadedBoolean)&&typeof a=="string"&&(a===""||tn(t)===tn(n))&&(a=!0),a}function ja(e){var n=[],t;for(t in e)n.push([t,e[t]].join(": "));return n.join("; ")}function Ta(e){for(var n=e.length,t=-1,a={},o;++t<n;)o=e[t],a[o.toLowerCase()]=o;return a}var Ia=ra,Ma=ka,On=Ma(Ia,"div");On.displayName="html";var Pa=On,za=Pa;const Da="Æ",Ra="&",_a="Á",Ha="Â",Ba="À",Ua="Å",qa="Ã",Wa="Ä",Ga="©",Za="Ç",Va="Ð",Ka="É",Ya="Ê",Ja="È",Xa="Ë",Qa=">",er="Í",nr="Î",tr="Ì",ar="Ï",rr="<",or="Ñ",lr="Ó",cr="Ô",ir="Ò",sr="Ø",ur="Õ",gr="Ö",dr='"',fr="®",pr="Þ",vr="Ú",mr="Û",hr="Ù",yr="Ü",br="Ý",xr="á",wr="â",Sr="´",Ar="æ",Cr="à",Fr="&",kr="å",$r="ã",Lr="ä",Or="¦",Er="ç",Nr="¸",jr="¢",Tr="©",Ir="¤",Mr="°",Pr="÷",zr="é",Dr="ê",Rr="è",_r="ð",Hr="ë",Br="½",Ur="¼",qr="¾",Wr=">",Gr="í",Zr="î",Vr="¡",Kr="ì",Yr="¿",Jr="ï",Xr="«",Qr="<",eo="¯",no="µ",to="·",ao=" ",ro="¬",oo="ñ",lo="ó",co="ô",io="ò",so="ª",uo="º",go="ø",fo="õ",po="ö",vo="¶",mo="±",ho="£",yo='"',bo="»",xo="®",wo="§",So="",Ao="¹",Co="²",Fo="³",ko="ß",$o="þ",Lo="×",Oo="ú",Eo="û",No="ù",jo="¨",To="ü",Io="ý",Mo="¥",Po="ÿ",zo={AElig:Da,AMP:Ra,Aacute:_a,Acirc:Ha,Agrave:Ba,Aring:Ua,Atilde:qa,Auml:Wa,COPY:Ga,Ccedil:Za,ETH:Va,Eacute:Ka,Ecirc:Ya,Egrave:Ja,Euml:Xa,GT:Qa,Iacute:er,Icirc:nr,Igrave:tr,Iuml:ar,LT:rr,Ntilde:or,Oacute:lr,Ocirc:cr,Ograve:ir,Oslash:sr,Otilde:ur,Ouml:gr,QUOT:dr,REG:fr,THORN:pr,Uacute:vr,Ucirc:mr,Ugrave:hr,Uuml:yr,Yacute:br,aacute:xr,acirc:wr,acute:Sr,aelig:Ar,agrave:Cr,amp:Fr,aring:kr,atilde:$r,auml:Lr,brvbar:Or,ccedil:Er,cedil:Nr,cent:jr,copy:Tr,curren:Ir,deg:Mr,divide:Pr,eacute:zr,ecirc:Dr,egrave:Rr,eth:_r,euml:Hr,frac12:Br,frac14:Ur,frac34:qr,gt:Wr,iacute:Gr,icirc:Zr,iexcl:Vr,igrave:Kr,iquest:Yr,iuml:Jr,laquo:Xr,lt:Qr,macr:eo,micro:no,middot:to,nbsp:ao,not:ro,ntilde:oo,oacute:lo,ocirc:co,ograve:io,ordf:so,ordm:uo,oslash:go,otilde:fo,ouml:po,para:vo,plusmn:mo,pound:ho,quot:yo,raquo:bo,reg:xo,sect:wo,shy:So,sup1:Ao,sup2:Co,sup3:Fo,szlig:ko,thorn:$o,times:Lo,uacute:Oo,ucirc:Eo,ugrave:No,uml:jo,uuml:To,yacute:Io,yen:Mo,yuml:Po},Do={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};var En=Ro;function Ro(e){var n=typeof e=="string"?e.charCodeAt(0):e;return n>=48&&n<=57}var _o=Ho;function Ho(e){var n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}var Bo=Uo;function Uo(e){var n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}var qo=Bo,Wo=En,Go=Zo;function Zo(e){return qo(e)||Wo(e)}var me,Vo=59,Ko=Yo;function Yo(e){var n="&"+e+";",t;return me=me||document.createElement("i"),me.innerHTML=n,t=me.textContent,t.charCodeAt(t.length-1)===Vo&&e!=="semi"||t===n?!1:t}var ln=zo,cn=Do,Jo=En,Xo=_o,Nn=Go,Qo=Ko,el=fl,nl={}.hasOwnProperty,ae=String.fromCharCode,tl=Function.prototype,sn={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},al=9,un=10,rl=12,ol=32,gn=38,ll=59,cl=60,il=61,sl=35,ul=88,gl=120,dl=65533,re="named",Me="hexadecimal",Pe="decimal",ze={};ze[Me]=16;ze[Pe]=10;var xe={};xe[re]=Nn;xe[Pe]=Jo;xe[Me]=Xo;var jn=1,Tn=2,In=3,Mn=4,Pn=5,$e=6,zn=7,Q={};Q[jn]="Named character references must be terminated by a semicolon";Q[Tn]="Numeric character references must be terminated by a semicolon";Q[In]="Named character references cannot be empty";Q[Mn]="Numeric character references cannot be empty";Q[Pn]="Named character references must be known";Q[$e]="Numeric character references cannot be disallowed";Q[zn]="Numeric character references cannot be outside the permissible Unicode range";function fl(e,n){var t={},a,o;n||(n={});for(o in sn)a=n[o],t[o]=a??sn[o];return(t.position.indent||t.position.start)&&(t.indent=t.position.indent||[],t.position=t.position.start),pl(e,t)}function pl(e,n){var t=n.additional,a=n.nonTerminated,o=n.text,s=n.reference,p=n.warning,l=n.textContext,m=n.referenceContext,S=n.warningContext,v=n.position,h=n.indent||[],x=e.length,b=0,R=-1,k=v.column||1,M=v.line||1,N="",c=[],r,g,u,i,f,y,d,A,$,j,P,U,_,z,Z,C,E,O,F;for(typeof t=="string"&&(t=t.charCodeAt(0)),C=T(),A=p?te:tl,b--,x++;++b<x;)if(f===un&&(k=h[R]||1),f=e.charCodeAt(b),f===gn){if(d=e.charCodeAt(b+1),d===al||d===un||d===rl||d===ol||d===gn||d===cl||d!==d||t&&d===t){N+=ae(f),k++;continue}for(_=b+1,U=_,F=_,d===sl?(F=++U,d=e.charCodeAt(F),d===ul||d===gl?(z=Me,F=++U):z=Pe):z=re,r="",P="",i="",Z=xe[z],F--;++F<x&&(d=e.charCodeAt(F),!!Z(d));)i+=ae(d),z===re&&nl.call(ln,i)&&(r=i,P=ln[i]);u=e.charCodeAt(F)===ll,u&&(F++,g=z===re?Qo(i):!1,g&&(r=i,P=g)),O=1+F-_,!u&&!a||(i?z===re?(u&&!P?A(Pn,1):(r!==i&&(F=U+r.length,O=1+F-U,u=!1),u||($=r?jn:In,n.attribute?(d=e.charCodeAt(F),d===il?(A($,O),P=null):Nn(d)?P=null:A($,O)):A($,O))),y=P):(u||A(Tn,O),y=parseInt(i,ze[z]),vl(y)?(A(zn,O),y=ae(dl)):y in cn?(A($e,O),y=cn[y]):(j="",ml(y)&&A($e,O),y>65535&&(y-=65536,j+=ae(y>>>10|55296),y=56320|y&1023),y=j+ae(y))):z!==re&&A(Mn,O)),y?(H(),C=T(),b=F-1,k+=F-_+1,c.push(y),E=T(),E.offset++,s&&s.call(m,y,{start:C,end:E},e.slice(_-1,F)),C=E):(i=e.slice(_-1,F),N+=i,k+=i.length,b=F-1)}else f===10&&(M++,R++,k=0),f===f?(N+=ae(f),k++):H();return c.join("");function T(){return{line:M,column:k,offset:b+(v.offset||0)}}function te(V,q){var K=T();K.column+=q,K.offset+=q,p.call(S,Q[V],K,V)}function H(){N&&(c.push(N),o&&o.call(l,N,{start:C,end:T()}),N="")}}function vl(e){return e>=55296&&e<=57343||e>1114111}function ml(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Dn={exports:{}};(function(e){var n=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
7 |
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
8 |
+
*
|
9 |
+
* @license MIT <https://opensource.org/licenses/MIT>
|
10 |
+
* @author Lea Verou <https://lea.verou.me>
|
11 |
+
* @namespace
|
12 |
+
* @public
|
13 |
+
*/var t=function(a){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,p={},l={manual:a.Prism&&a.Prism.manual,disableWorkerMessageHandler:a.Prism&&a.Prism.disableWorkerMessageHandler,util:{encode:function c(r){return r instanceof m?new m(r.type,c(r.content),r.alias):Array.isArray(r)?r.map(c):r.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(c){return Object.prototype.toString.call(c).slice(8,-1)},objId:function(c){return c.__id||Object.defineProperty(c,"__id",{value:++s}),c.__id},clone:function c(r,g){g=g||{};var u,i;switch(l.util.type(r)){case"Object":if(i=l.util.objId(r),g[i])return g[i];u={},g[i]=u;for(var f in r)r.hasOwnProperty(f)&&(u[f]=c(r[f],g));return u;case"Array":return i=l.util.objId(r),g[i]?g[i]:(u=[],g[i]=u,r.forEach(function(y,d){u[d]=c(y,g)}),u);default:return r}},getLanguage:function(c){for(;c;){var r=o.exec(c.className);if(r)return r[1].toLowerCase();c=c.parentElement}return"none"},setLanguage:function(c,r){c.className=c.className.replace(RegExp(o,"gi"),""),c.classList.add("language-"+r)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(u){var c=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(u.stack)||[])[1];if(c){var r=document.getElementsByTagName("script");for(var g in r)if(r[g].src==c)return r[g]}return null}},isActive:function(c,r,g){for(var u="no-"+r;c;){var i=c.classList;if(i.contains(r))return!0;if(i.contains(u))return!1;c=c.parentElement}return!!g}},languages:{plain:p,plaintext:p,text:p,txt:p,extend:function(c,r){var g=l.util.clone(l.languages[c]);for(var u in r)g[u]=r[u];return g},insertBefore:function(c,r,g,u){u=u||l.languages;var i=u[c],f={};for(var y in i)if(i.hasOwnProperty(y)){if(y==r)for(var d in g)g.hasOwnProperty(d)&&(f[d]=g[d]);g.hasOwnProperty(y)||(f[y]=i[y])}var A=u[c];return u[c]=f,l.languages.DFS(l.languages,function($,j){j===A&&$!=c&&(this[$]=f)}),f},DFS:function c(r,g,u,i){i=i||{};var f=l.util.objId;for(var y in r)if(r.hasOwnProperty(y)){g.call(r,y,r[y],u||y);var d=r[y],A=l.util.type(d);A==="Object"&&!i[f(d)]?(i[f(d)]=!0,c(d,g,null,i)):A==="Array"&&!i[f(d)]&&(i[f(d)]=!0,c(d,g,y,i))}}},plugins:{},highlightAll:function(c,r){l.highlightAllUnder(document,c,r)},highlightAllUnder:function(c,r,g){var u={callback:g,container:c,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};l.hooks.run("before-highlightall",u),u.elements=Array.prototype.slice.apply(u.container.querySelectorAll(u.selector)),l.hooks.run("before-all-elements-highlight",u);for(var i=0,f;f=u.elements[i++];)l.highlightElement(f,r===!0,u.callback)},highlightElement:function(c,r,g){var u=l.util.getLanguage(c),i=l.languages[u];l.util.setLanguage(c,u);var f=c.parentElement;f&&f.nodeName.toLowerCase()==="pre"&&l.util.setLanguage(f,u);var y=c.textContent,d={element:c,language:u,grammar:i,code:y};function A(j){d.highlightedCode=j,l.hooks.run("before-insert",d),d.element.innerHTML=d.highlightedCode,l.hooks.run("after-highlight",d),l.hooks.run("complete",d),g&&g.call(d.element)}if(l.hooks.run("before-sanity-check",d),f=d.element.parentElement,f&&f.nodeName.toLowerCase()==="pre"&&!f.hasAttribute("tabindex")&&f.setAttribute("tabindex","0"),!d.code){l.hooks.run("complete",d),g&&g.call(d.element);return}if(l.hooks.run("before-highlight",d),!d.grammar){A(l.util.encode(d.code));return}if(r&&a.Worker){var $=new Worker(l.filename);$.onmessage=function(j){A(j.data)},$.postMessage(JSON.stringify({language:d.language,code:d.code,immediateClose:!0}))}else A(l.highlight(d.code,d.grammar,d.language))},highlight:function(c,r,g){var u={code:c,grammar:r,language:g};if(l.hooks.run("before-tokenize",u),!u.grammar)throw new Error('The language "'+u.language+'" has no grammar.');return u.tokens=l.tokenize(u.code,u.grammar),l.hooks.run("after-tokenize",u),m.stringify(l.util.encode(u.tokens),u.language)},tokenize:function(c,r){var g=r.rest;if(g){for(var u in g)r[u]=g[u];delete r.rest}var i=new h;return x(i,i.head,c),v(c,i,r,i.head,0),R(i)},hooks:{all:{},add:function(c,r){var g=l.hooks.all;g[c]=g[c]||[],g[c].push(r)},run:function(c,r){var g=l.hooks.all[c];if(!(!g||!g.length))for(var u=0,i;i=g[u++];)i(r)}},Token:m};a.Prism=l;function m(c,r,g,u){this.type=c,this.content=r,this.alias=g,this.length=(u||"").length|0}m.stringify=function c(r,g){if(typeof r=="string")return r;if(Array.isArray(r)){var u="";return r.forEach(function(A){u+=c(A,g)}),u}var i={type:r.type,content:c(r.content,g),tag:"span",classes:["token",r.type],attributes:{},language:g},f=r.alias;f&&(Array.isArray(f)?Array.prototype.push.apply(i.classes,f):i.classes.push(f)),l.hooks.run("wrap",i);var y="";for(var d in i.attributes)y+=" "+d+'="'+(i.attributes[d]||"").replace(/"/g,""")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+y+">"+i.content+"</"+i.tag+">"};function S(c,r,g,u){c.lastIndex=r;var i=c.exec(g);if(i&&u&&i[1]){var f=i[1].length;i.index+=f,i[0]=i[0].slice(f)}return i}function v(c,r,g,u,i,f){for(var y in g)if(!(!g.hasOwnProperty(y)||!g[y])){var d=g[y];d=Array.isArray(d)?d:[d];for(var A=0;A<d.length;++A){if(f&&f.cause==y+","+A)return;var $=d[A],j=$.inside,P=!!$.lookbehind,U=!!$.greedy,_=$.alias;if(U&&!$.pattern.global){var z=$.pattern.toString().match(/[imsuy]*$/)[0];$.pattern=RegExp($.pattern.source,z+"g")}for(var Z=$.pattern||$,C=u.next,E=i;C!==r.tail&&!(f&&E>=f.reach);E+=C.value.length,C=C.next){var O=C.value;if(r.length>c.length)return;if(!(O instanceof m)){var F=1,T;if(U){if(T=S(Z,E,c,P),!T||T.index>=c.length)break;var q=T.index,te=T.index+T[0].length,H=E;for(H+=C.value.length;q>=H;)C=C.next,H+=C.value.length;if(H-=C.value.length,E=H,C.value instanceof m)continue;for(var V=C;V!==r.tail&&(H<te||typeof V.value=="string");V=V.next)F++,H+=V.value.length;F--,O=c.slice(E,H),T.index-=E}else if(T=S(Z,0,O,P),!T)continue;var q=T.index,K=T[0],ce=O.slice(0,q),We=O.slice(q+K.length),we=E+O.length;f&&we>f.reach&&(f.reach=we);var pe=C.prev;ce&&(pe=x(r,pe,ce),E+=ce.length),b(r,pe,F);var Gn=new m(y,j?l.tokenize(K,j):K,_,K);if(C=x(r,pe,Gn),We&&x(r,C,We),F>1){var Se={cause:y+","+A,reach:we};v(c,r,g,C.prev,E,Se),f&&Se.reach>f.reach&&(f.reach=Se.reach)}}}}}}function h(){var c={value:null,prev:null,next:null},r={value:null,prev:c,next:null};c.next=r,this.head=c,this.tail=r,this.length=0}function x(c,r,g){var u=r.next,i={value:g,prev:r,next:u};return r.next=i,u.prev=i,c.length++,i}function b(c,r,g){for(var u=r.next,i=0;i<g&&u!==c.tail;i++)u=u.next;r.next=u,u.prev=r,c.length-=i}function R(c){for(var r=[],g=c.head.next;g!==c.tail;)r.push(g.value),g=g.next;return r}if(!a.document)return a.addEventListener&&(l.disableWorkerMessageHandler||a.addEventListener("message",function(c){var r=JSON.parse(c.data),g=r.language,u=r.code,i=r.immediateClose;a.postMessage(l.highlight(u,l.languages[g],g)),i&&a.close()},!1)),l;var k=l.util.currentScript();k&&(l.filename=k.src,k.hasAttribute("data-manual")&&(l.manual=!0));function M(){l.manual||l.highlightAll()}if(!l.manual){var N=document.readyState;N==="loading"||N==="interactive"&&k&&k.defer?document.addEventListener("DOMContentLoaded",M):window.requestAnimationFrame?window.requestAnimationFrame(M):window.setTimeout(M,16)}return l}(n);e.exports&&(e.exports=t),typeof ye<"u"&&(ye.Prism=t)})(Dn);var hl=Dn.exports,yl=De;De.displayName="markup";De.aliases=["html","mathml","svg","xml","ssml","atom","rss"];function De(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,a){var o={};o["language-"+a]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[a]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var s={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};s["language-"+a]={pattern:/[\s\S]+/,inside:e.languages[a]};var p={};p[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:s},e.languages.insertBefore("markup","cdata",p)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:e.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}var bl=Re;Re.displayName="css";Re.aliases=[];function Re(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var a=n.languages.markup;a&&(a.tag.addInlined("style","css"),a.tag.addAttribute("style","css"))})(e)}var xl=_e;_e.displayName="clike";_e.aliases=[];function _e(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}var wl=He;He.displayName="javascript";He.aliases=["js"];function He(e){e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}var ue=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof ye=="object"?ye:{},Sl=Dl();ue.Prism={manual:!0,disableWorkerMessageHandler:!0};var Al=za,Cl=el,Rn=hl,Fl=yl,kl=bl,$l=xl,Ll=wl;Sl();var Be={}.hasOwnProperty;function _n(){}_n.prototype=Rn;var I=new _n,Ol=I;I.highlight=Nl;I.register=fe;I.alias=El;I.registered=jl;I.listLanguages=Tl;fe(Fl);fe(kl);fe($l);fe(Ll);I.util.encode=Pl;I.Token.stringify=Il;function fe(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `grammar`, got `"+e+"`");I.languages[e.displayName]===void 0&&e(I)}function El(e,n){var t=I.languages,a=e,o,s,p,l;n&&(a={},a[e]=n);for(o in a)for(s=a[o],s=typeof s=="string"?[s]:s,p=s.length,l=-1;++l<p;)t[s[l]]=t[o]}function Nl(e,n){var t=Rn.highlight,a;if(typeof e!="string")throw new Error("Expected `string` for `value`, got `"+e+"`");if(I.util.type(n)==="Object")a=n,n=null;else{if(typeof n!="string")throw new Error("Expected `string` for `name`, got `"+n+"`");if(Be.call(I.languages,n))a=I.languages[n];else throw new Error("Unknown language: `"+n+"` is not registered")}return t.call(this,e,a,n)}function jl(e){if(typeof e!="string")throw new Error("Expected `string` for `language`, got `"+e+"`");return Be.call(I.languages,e)}function Tl(){var e=I.languages,n=[],t;for(t in e)Be.call(e,t)&&typeof e[t]=="object"&&n.push(t);return n}function Il(e,n,t){var a;return typeof e=="string"?{type:"text",value:e}:I.util.type(e)==="Array"?Ml(e,n):(a={type:e.type,content:I.Token.stringify(e.content,n,t),tag:"span",classes:["token",e.type],attributes:{},language:n,parent:t},e.alias&&(a.classes=a.classes.concat(e.alias)),I.hooks.run("wrap",a),Al(a.tag+"."+a.classes.join("."),zl(a.attributes),a.content))}function Ml(e,n){for(var t=[],a=e.length,o=-1,s;++o<a;)s=e[o],s!==""&&s!==null&&s!==void 0&&t.push(s);for(o=-1,a=t.length;++o<a;)s=t[o],t[o]=I.Token.stringify(s,n,t);return t}function Pl(e){return e}function zl(e){var n;for(n in e)e[n]=Cl(e[n]);return e}function Dl(){var e="Prism"in ue,n=e?ue.Prism:void 0;return t;function t(){e?ue.Prism=n:delete ue.Prism,e=void 0,n=void 0}}const Ue=be(Ol);var qe=bt(Ue,{});qe.registerLanguage=function(e,n){return Ue.register(n)};qe.alias=function(e,n){return Ue.alias(e,n)};const Hn=qe;var Ce,dn;function Rl(){if(dn)return Ce;dn=1,Ce=e,e.displayName="jsx",e.aliases=[];function e(n){(function(t){var a=t.util.clone(t.languages.javascript),o=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,s=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,p=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function l(v,h){return v=v.replace(/<S>/g,function(){return o}).replace(/<BRACES>/g,function(){return s}).replace(/<SPREAD>/g,function(){return p}),RegExp(v,h)}p=l(p).source,t.languages.jsx=t.languages.extend("markup",a),t.languages.jsx.tag.pattern=l(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=a.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:l(/<SPREAD>/.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:l(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);var m=function(v){return v?typeof v=="string"?v:typeof v.content=="string"?v.content:v.content.map(m).join(""):""},S=function(v){for(var h=[],x=0;x<v.length;x++){var b=v[x],R=!1;if(typeof b!="string"&&(b.type==="tag"&&b.content[0]&&b.content[0].type==="tag"?b.content[0].content[0].content==="</"?h.length>0&&h[h.length-1].tagName===m(b.content[0].content[1])&&h.pop():b.content[b.content.length-1].content==="/>"||h.push({tagName:m(b.content[0].content[1]),openedBraces:0}):h.length>0&&b.type==="punctuation"&&b.content==="{"?h[h.length-1].openedBraces++:h.length>0&&h[h.length-1].openedBraces>0&&b.type==="punctuation"&&b.content==="}"?h[h.length-1].openedBraces--:R=!0),(R||typeof b=="string")&&h.length>0&&h[h.length-1].openedBraces===0){var k=m(b);x<v.length-1&&(typeof v[x+1]=="string"||v[x+1].type==="plain-text")&&(k+=m(v[x+1]),v.splice(x+1,1)),x>0&&(typeof v[x-1]=="string"||v[x-1].type==="plain-text")&&(k=m(v[x-1])+k,v.splice(x-1,1),x--),v[x]=new t.Token("plain-text",k,null,k)}b.content&&typeof b.content!="string"&&S(b.content)}};t.hooks.add("after-tokenize",function(v){v.language!=="jsx"&&v.language!=="tsx"||S(v.tokens)})})(n)}return Ce}var Bn={},Un={exports:{}};(function(e){function n(t){return t&&t.__esModule?t:{default:t}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Un);var _l=Un.exports;(function(e){var n=_l;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=n(Rl()),a=t.default;e.default=a})(Bn);const Hl=be(Bn);var qn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={'code[class*="language-"]':{textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",color:"#90a4ae",background:"#fafafa",fontFamily:"Roboto Mono, monospace",fontSize:"1em",lineHeight:"1.5em",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",color:"#90a4ae",background:"#fafafa",fontFamily:"Roboto Mono, monospace",fontSize:"1em",lineHeight:"1.5em",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",overflow:"auto",position:"relative",margin:"0.5em 0",padding:"1.25em 1em"},'code[class*="language-"]::-moz-selection':{background:"#cceae7",color:"#263238"},'pre[class*="language-"]::-moz-selection':{background:"#cceae7",color:"#263238"},'code[class*="language-"] ::-moz-selection':{background:"#cceae7",color:"#263238"},'pre[class*="language-"] ::-moz-selection':{background:"#cceae7",color:"#263238"},'code[class*="language-"]::selection':{background:"#cceae7",color:"#263238"},'pre[class*="language-"]::selection':{background:"#cceae7",color:"#263238"},'code[class*="language-"] ::selection':{background:"#cceae7",color:"#263238"},'pre[class*="language-"] ::selection':{background:"#cceae7",color:"#263238"},':not(pre) > code[class*="language-"]':{whiteSpace:"normal",borderRadius:"0.2em",padding:"0.1em"},".language-css > code":{color:"#f76d47"},".language-sass > code":{color:"#f76d47"},".language-scss > code":{color:"#f76d47"},'[class*="language-"] .namespace':{Opacity:"0.7"},atrule:{color:"#7c4dff"},"attr-name":{color:"#39adb5"},"attr-value":{color:"#f6a434"},attribute:{color:"#f6a434"},boolean:{color:"#7c4dff"},builtin:{color:"#39adb5"},cdata:{color:"#39adb5"},char:{color:"#39adb5"},class:{color:"#39adb5"},"class-name":{color:"#6182b8"},comment:{color:"#aabfc9"},constant:{color:"#7c4dff"},deleted:{color:"#e53935"},doctype:{color:"#aabfc9"},entity:{color:"#e53935"},function:{color:"#7c4dff"},hexcode:{color:"#f76d47"},id:{color:"#7c4dff",fontWeight:"bold"},important:{color:"#7c4dff",fontWeight:"bold"},inserted:{color:"#39adb5"},keyword:{color:"#7c4dff"},number:{color:"#f76d47"},operator:{color:"#39adb5"},prolog:{color:"#aabfc9"},property:{color:"#39adb5"},"pseudo-class":{color:"#f6a434"},"pseudo-element":{color:"#f6a434"},punctuation:{color:"#39adb5"},regex:{color:"#6182b8"},selector:{color:"#e53935"},string:{color:"#f6a434"},symbol:{color:"#7c4dff"},tag:{color:"#e53935"},unit:{color:"#f76d47"},url:{color:"#e53935"},variable:{color:"#e53935"}};e.default=n})(qn);const Bl=be(qn);var Wn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={'code[class*="language-"]':{color:"#c5c8c6",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:"Inconsolata, Monaco, Consolas, 'Courier New', Courier, monospace",direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{color:"#c5c8c6",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:"Inconsolata, Monaco, Consolas, 'Courier New', Courier, monospace",direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto",borderRadius:"0.3em",background:"#1e1e1e"},':not(pre) > code[class*="language-"]':{background:"#1e1e1e",padding:".1em",borderRadius:".3em"},comment:{color:"#6a9955"},prolog:{color:"#6a9955"},doctype:{color:"#6a9955"},cdata:{color:"#6a9955"},punctuation:{color:"#569cd6"},".namespace":{Opacity:".7"},property:{color:"#ce9178"},keyword:{color:"#569cd6"},tag:{color:"#569cd6"},"class-name":{color:"#FFFFB6",textDecoration:"underline"},boolean:{color:"#99CC99"},constant:{color:"#99CC99"},symbol:{color:"#f92672"},deleted:{color:"#ce9178"},number:{color:"#FF73FD"},selector:{color:"#A8FF60"},"attr-name":{color:"@"},string:{color:"#ce9178"},char:{color:"#A8FF60"},builtin:{color:"#569cd6"},inserted:{color:"#A8FF60"},variable:{color:"#C6C5FE"},operator:{color:"##ce9178"},entity:{color:"#FFFFB6",cursor:"help"},url:{color:"#96CBFE"},".language-css .token.string":{color:"#99CC99"},".style .token.string":{color:"#99CC99"},atrule:{color:"#F9EE98"},"attr-value":{color:"#F9EE98"},function:{color:"#569cd6"},regex:{color:"#E9C062"},important:{color:"#fd971f",fontWeight:"bold"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}};e.default=n})(Wn);const Ul=be(Wn);Hn.registerLanguage("jsx",Hl);function ql(e){const n=Kn("(prefers-color-scheme: dark)");return Vn.jsx(Hn,{...e,style:n?Ul:Bl})}ql.defaultProps={PreTag:void 0,className:void 0,language:"jsx"};export{ql as default};
|
openui/dist/assets/babel-nhLfYeWA.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
openui/dist/assets/html-i1xo8y4u.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
openui/dist/assets/index-2-rOUq-J.js
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var R=Object.defineProperty;var L=(e,r,o)=>r in e?R(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o;var p=(e,r,o)=>(L(e,typeof r!="symbol"?r+"":r,o),o);import{R as h,j as n,t as T,c as P,r as c,$ as v,a as N,b as O,d as _,e as $,f as S,g as I,h as m,N as C,Q as M,i as k,k as B}from"./vendor-BJpsy9o3.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))a(t);new MutationObserver(t=>{for(const s of t)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&a(i)}).observe(document,{childList:!0,subtree:!0});function o(t){const s={};return t.integrity&&(s.integrity=t.integrity),t.referrerPolicy&&(s.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?s.credentials="include":t.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(t){if(t.ep)return;t.ep=!0;const s=o(t);fetch(t.href,s)}})();const A="modulepreload",D=function(e){return"/"+e},g={},b=function(r,o,a){let t=Promise.resolve();if(o&&o.length>0){const s=document.getElementsByTagName("link");t=Promise.all(o.map(i=>{if(i=D(i),i in g)return;g[i]=!0;const l=i.endsWith(".css"),w=l?'[rel="stylesheet"]':"";if(!!a)for(let u=s.length-1;u>=0;u--){const f=s[u];if(f.href===i&&(!l||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${w}`))return;const d=document.createElement("link");if(d.rel=l?"stylesheet":A,l||(d.as="script",d.crossOrigin=""),d.href=i,document.head.appendChild(d),l)return new Promise((u,f)=>{d.addEventListener("load",u),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${i}`)))})}))}return t.then(()=>r()).catch(s=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=s,window.dispatchEvent(i),!i.defaultPrevented)throw s})};class j extends h.Component{constructor(){super(...arguments);p(this,"state",{error:void 0})}static getDerivedStateFromError(o){return{error:o}}componentDidCatch(o,a){console.error("Encountered ErrorBoundary:",o,a);const{onError:t}=this.props;t==null||t(o)}render(){const{error:o}=this.state;if(o!==void 0){const{renderError:t}=this.props;return t(o)}const{children:a}=this.props;return a}}p(j,"defaultProps",{children:void 0,onError:void 0});function x({error:e}){return n.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center",children:[n.jsx("h1",{className:"text-xl","data-testid":"LoadingOrError",children:e?e.message:n.jsx("div",{className:"h-16 w-16 animate-spin rounded-full bg-gradient-to-r from-purple-500 via-pink-500 to-red-500"})}),e?n.jsx("a",{href:"/",className:"mt-5 text-lg text-blue-500 underline",onClick:r=>{r.preventDefault(),document.location.reload()},children:"Reload"}):void 0]})}x.defaultProps={error:void 0};function U(...e){return T(P(e))}function Z(e,r,o){const a=new Blob([e],{type:r}),t=URL.createObjectURL(a),s=document.createElement("a");s.href=t,s.download=o,document.body.append(s),s.click(),s.remove(),URL.revokeObjectURL(t)}const ee=580,F=N,te=O,re=_,Q=c.forwardRef(({className:e,sideOffset:r=4,...o},a)=>n.jsx(v,{ref:a,sideOffset:r,className:U("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));Q.displayName=v.displayName;const z=500;function oe(e,r=z){const[o,a]=h.useState(e),t=h.useRef(null);return h.useEffect(()=>{const s=Date.now();if(t.current&&s>=t.current+r)t.current=s,a(e);else{const i=window.setTimeout(()=>{t.current=s,a(e)},r);return()=>window.clearTimeout(i)}},[e,r]),o}function V(e){const[r,o]=c.useState(()=>matchMedia(e).matches);return c.useLayoutEffect(()=>{const a=matchMedia(e);function t(){o(a.matches)}return a.addEventListener("change",t),()=>{a.removeEventListener("change",t)}},[e]),r}const q=c.lazy(async()=>b(()=>import("./index-VsdO9OoH.js"),__vite__mapDeps([0,1,2]))),y=c.lazy(async()=>b(()=>import("./Builder-b4JJdzJb.js").then(e=>e.B),__vite__mapDeps([3,1,2]))),W=$(S(n.jsxs(n.Fragment,{children:[n.jsx(m,{path:"/",element:n.jsx(C,{replace:!0,to:"/ai"})}),n.jsx(m,{path:"/ai",element:n.jsx(q,{}),children:n.jsx(m,{path:":id",element:n.jsx(y,{})})}),n.jsx(m,{path:"/ai/shared/:id",element:n.jsx(y,{shared:!0})})]})));function H(){const e=V("(prefers-color-scheme: dark)");return c.useEffect(()=>{e&&document.documentElement.classList.add("dark")},[e]),n.jsx(c.Suspense,{fallback:n.jsx(x,{}),children:n.jsx(j,{renderError:r=>n.jsx(x,{error:r}),children:n.jsx(F,{children:n.jsx(I,{router:W})})})})}const K=1,X=new M({defaultOptions:{queries:{staleTime:Number.POSITIVE_INFINITY,retry:K}}}),E=document.querySelector("#root");E&&k(E).render(n.jsx(c.StrictMode,{children:n.jsx(B,{client:X,children:n.jsx(H,{})})}));export{j as E,x as L,ee as M,te as T,b as _,re as a,Q as b,U as c,Z as d,oe as e,V as u};
|
2 |
+
function __vite__mapDeps(indexes) {
|
3 |
+
if (!__vite__mapDeps.viteFileDeps) {
|
4 |
+
__vite__mapDeps.viteFileDeps = ["assets/index-VsdO9OoH.js","assets/vendor-BJpsy9o3.js","assets/textarea-4A01Dc6n.js","assets/Builder-b4JJdzJb.js"]
|
5 |
+
}
|
6 |
+
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
7 |
+
}
|
openui/dist/assets/index-3rRckdGL.js
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import{T as ae,j as X}from"./vendor-BJpsy9o3.js";import{a as se,V as Ne,u as en,r as nn,b as tn}from"./Builder-b4JJdzJb.js";import"./textarea-4A01Dc6n.js";import"./index-2-rOUq-J.js";function T(e){const n=[];let t=-1,l=0,r=0;for(;++t<e.length;){const i=e.charCodeAt(t);let o="";if(i===37&&se(e.charCodeAt(t+1))&&se(e.charCodeAt(t+2)))r=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(o=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(t+1);i<56320&&a>56319&&a<57344?(o=String.fromCharCode(i,a),r=1):o="�"}else o=String.fromCharCode(i);o&&(n.push(e.slice(l,t),encodeURIComponent(o)),l=t+r+1,o=""),r&&(t+=r,r=0)}return n.join("")+e.slice(l)}function ln(e,n){const t=n||{};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const rn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,on=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,an={};function ue(e,n){return((n||an).jsx?on:rn).test(e)}const sn=/[ \t\n\f\r]/g;function un(e){return typeof e=="object"?e.type==="text"?ce(e.value):!1:ce(e)}function ce(e){return e.replace(sn,"")===""}class j{constructor(n,t,l){this.property=n,this.normal=t,l&&(this.space=l)}}j.prototype.property={};j.prototype.normal={};j.prototype.space=null;function Ae(e,n){const t={},l={};let r=-1;for(;++r<e.length;)Object.assign(t,e[r].property),Object.assign(l,e[r].normal);return new j(t,l,n)}function W(e){return e.toLowerCase()}class S{constructor(n,t){this.property=n,this.attribute=t}}S.prototype.space=null;S.prototype.boolean=!1;S.prototype.booleanish=!1;S.prototype.overloadedBoolean=!1;S.prototype.number=!1;S.prototype.commaSeparated=!1;S.prototype.spaceSeparated=!1;S.prototype.commaOrSpaceSeparated=!1;S.prototype.mustUseProperty=!1;S.prototype.defined=!1;let cn=0;const h=N(),w=N(),Le=N(),s=N(),v=N(),L=N(),C=N();function N(){return 2**++cn}const Y=Object.freeze(Object.defineProperty({__proto__:null,boolean:h,booleanish:w,commaOrSpaceSeparated:C,commaSeparated:L,number:s,overloadedBoolean:Le,spaceSeparated:v},Symbol.toStringTag,{value:"Module"})),K=Object.keys(Y);class $ extends S{constructor(n,t,l,r){let i=-1;if(super(n,t),pe(this,"space",r),typeof l=="number")for(;++i<K.length;){const o=K[i];pe(this,K[i],(l&Y[o])===Y[o])}}}$.prototype.defined=!0;function pe(e,n,t){t&&(e[n]=t)}const pn={}.hasOwnProperty;function R(e){const n={},t={};let l;for(l in e.properties)if(pn.call(e.properties,l)){const r=e.properties[l],i=new $(l,e.transform(e.attributes||{},l),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(i.mustUseProperty=!0),n[l]=i,t[W(l)]=l,t[W(i.attribute)]=l}return new j(n,t,e.space)}const Te=R({space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Re=R({space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Me(e,n){return n in e?e[n]:n}function Ie(e,n){return Me(e,n.toLowerCase())}const je=R({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Ie,properties:{xmlns:null,xmlnsXLink:null}}),Be=R({transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:w,ariaAutoComplete:null,ariaBusy:w,ariaChecked:w,ariaColCount:s,ariaColIndex:s,ariaColSpan:s,ariaControls:v,ariaCurrent:null,ariaDescribedBy:v,ariaDetails:null,ariaDisabled:w,ariaDropEffect:v,ariaErrorMessage:null,ariaExpanded:w,ariaFlowTo:v,ariaGrabbed:w,ariaHasPopup:null,ariaHidden:w,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:v,ariaLevel:s,ariaLive:null,ariaModal:w,ariaMultiLine:w,ariaMultiSelectable:w,ariaOrientation:null,ariaOwns:v,ariaPlaceholder:null,ariaPosInSet:s,ariaPressed:w,ariaReadOnly:w,ariaRelevant:null,ariaRequired:w,ariaRoleDescription:v,ariaRowCount:s,ariaRowIndex:s,ariaRowSpan:s,ariaSelected:w,ariaSetSize:s,ariaSort:null,ariaValueMax:s,ariaValueMin:s,ariaValueNow:s,ariaValueText:null,role:null}}),fn=R({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Ie,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:L,acceptCharset:v,accessKey:v,action:null,allow:null,allowFullScreen:h,allowPaymentRequest:h,allowUserMedia:h,alt:null,as:null,async:h,autoCapitalize:null,autoComplete:v,autoFocus:h,autoPlay:h,blocking:v,capture:null,charSet:null,checked:h,cite:null,className:v,cols:s,colSpan:null,content:null,contentEditable:w,controls:h,controlsList:v,coords:s|L,crossOrigin:null,data:null,dateTime:null,decoding:null,default:h,defer:h,dir:null,dirName:null,disabled:h,download:Le,draggable:w,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:h,formTarget:null,headers:v,height:s,hidden:h,high:s,href:null,hrefLang:null,htmlFor:v,httpEquiv:v,id:null,imageSizes:null,imageSrcSet:null,inert:h,inputMode:null,integrity:null,is:null,isMap:h,itemId:null,itemProp:v,itemRef:v,itemScope:h,itemType:v,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:h,low:s,manifest:null,max:null,maxLength:s,media:null,method:null,min:null,minLength:s,multiple:h,muted:h,name:null,nonce:null,noModule:h,noValidate:h,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:h,optimum:s,pattern:null,ping:v,placeholder:null,playsInline:h,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:h,referrerPolicy:null,rel:v,required:h,reversed:h,rows:s,rowSpan:s,sandbox:v,scope:null,scoped:h,seamless:h,selected:h,shadowRootDelegatesFocus:h,shadowRootMode:null,shape:null,size:s,sizes:null,slot:null,span:s,spellCheck:w,src:null,srcDoc:null,srcLang:null,srcSet:null,start:s,step:null,style:null,tabIndex:s,target:null,title:null,translate:null,type:null,typeMustMatch:h,useMap:null,value:w,width:s,wrap:null,align:null,aLink:null,archive:v,axis:null,background:null,bgColor:null,border:s,borderColor:null,bottomMargin:s,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:h,declare:h,event:null,face:null,frame:null,frameBorder:null,hSpace:s,leftMargin:s,link:null,longDesc:null,lowSrc:null,marginHeight:s,marginWidth:s,noResize:h,noHref:h,noShade:h,noWrap:h,object:null,profile:null,prompt:null,rev:null,rightMargin:s,rules:null,scheme:null,scrolling:w,standby:null,summary:null,text:null,topMargin:s,valueType:null,version:null,vAlign:null,vLink:null,vSpace:s,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:h,disableRemotePlayback:h,prefix:null,property:null,results:s,security:null,unselectable:null}}),dn=R({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:Me,properties:{about:C,accentHeight:s,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:s,amplitude:s,arabicForm:null,ascent:s,attributeName:null,attributeType:null,azimuth:s,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:s,by:null,calcMode:null,capHeight:s,className:v,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:s,diffuseConstant:s,direction:null,display:null,dur:null,divisor:s,dominantBaseline:null,download:h,dx:null,dy:null,edgeMode:null,editable:null,elevation:s,enableBackground:null,end:null,event:null,exponent:s,externalResourcesRequired:null,fill:null,fillOpacity:s,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:L,g2:L,glyphName:L,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:s,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:s,horizOriginX:s,horizOriginY:s,id:null,ideographic:s,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:s,k:s,k1:s,k2:s,k3:s,k4:s,kernelMatrix:C,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:s,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:s,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:s,overlineThickness:s,paintOrder:null,panose1:null,path:null,pathLength:s,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:v,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:s,pointsAtY:s,pointsAtZ:s,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:C,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:C,rev:C,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:C,requiredFeatures:C,requiredFonts:C,requiredFormats:C,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:s,specularExponent:s,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:s,strikethroughThickness:s,string:null,stroke:null,strokeDashArray:C,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:s,strokeOpacity:s,strokeWidth:null,style:null,surfaceScale:s,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:C,tabIndex:s,tableValues:null,target:null,targetX:s,targetY:s,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:C,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:s,underlineThickness:s,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:s,values:null,vAlphabetic:s,vMathematical:s,vectorEffect:null,vHanging:s,vIdeographic:s,version:null,vertAdvY:s,vertOriginX:s,vertOriginY:s,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:s,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),hn=/^data[-\w.:]+$/i,fe=/-[a-z]/g,mn=/[A-Z]/g;function gn(e,n){const t=W(n);let l=n,r=S;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&hn.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(fe,xn);l="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!fe.test(i)){let o=i.replace(mn,yn);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}r=$}return new r(l,n)}function yn(e){return"-"+e.toLowerCase()}function xn(e){return e.charAt(1).toUpperCase()}const bn={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},vn=Ae([Re,Te,je,Be,fn],"html"),G=Ae([Re,Te,je,Be,dn],"svg");function wn(e){return e.join(" ").trim()}var Ue={},de=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,kn=/\n/g,Cn=/^\s*/,Sn=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,En=/^:\s*/,Pn=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Dn=/^[;\s]*/,On=/^\s+|\s+$/g,Nn=`
|
2 |
+
`,he="/",me="*",O="",An="comment",Ln="declaration",Tn=function(e,n){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];n=n||{};var t=1,l=1;function r(p){var f=p.match(kn);f&&(t+=f.length);var b=p.lastIndexOf(Nn);l=~b?p.length-b:l+p.length}function i(){var p={line:t,column:l};return function(f){return f.position=new o(p),m(),f}}function o(p){this.start=p,this.end={line:t,column:l},this.source=n.source}o.prototype.content=e;function a(p){var f=new Error(n.source+":"+t+":"+l+": "+p);if(f.reason=p,f.filename=n.source,f.line=t,f.column=l,f.source=e,!n.silent)throw f}function u(p){var f=p.exec(e);if(f){var b=f[0];return r(b),e=e.slice(b.length),f}}function m(){u(Cn)}function c(p){var f;for(p=p||[];f=d();)f!==!1&&p.push(f);return p}function d(){var p=i();if(!(he!=e.charAt(0)||me!=e.charAt(1))){for(var f=2;O!=e.charAt(f)&&(me!=e.charAt(f)||he!=e.charAt(f+1));)++f;if(f+=2,O===e.charAt(f-1))return a("End of comment missing");var b=e.slice(2,f-2);return l+=2,r(b),e=e.slice(f),l+=2,p({type:An,comment:b})}}function g(){var p=i(),f=u(Sn);if(f){if(d(),!u(En))return a("property missing ':'");var b=u(Pn),k=p({type:Ln,property:ge(f[0].replace(de,O)),value:b?ge(b[0].replace(de,O)):O});return u(Dn),k}}function y(){var p=[];c(p);for(var f;f=g();)f!==!1&&(p.push(f),c(p));return p}return m(),y()};function ge(e){return e?e.replace(On,O):O}var Rn=ae&&ae.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ue,"__esModule",{value:!0});var Mn=Rn(Tn);function In(e,n){var t=null;if(!e||typeof e!="string")return t;var l=(0,Mn.default)(e),r=typeof n=="function";return l.forEach(function(i){if(i.type==="declaration"){var o=i.property,a=i.value;r?n(o,a,i):a&&(t=t||{},t[o]=a)}}),t}var ye=Ue.default=In;const jn=ye.default||ye,Fe=_e("end"),Z=_e("start");function _e(e){return n;function n(t){const l=t&&t.position&&t.position[e]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function Bn(e){const n=Z(e),t=Fe(e);if(n&&t)return{start:n,end:t}}const Q={}.hasOwnProperty,Un=new Map,Fn=/[A-Z]/g,_n=/-([a-z])/g,zn=new Set(["table","tbody","thead","tfoot","tr"]),Hn=new Set(["td","th"]),ze="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Vn(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let l;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=Gn(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=$n(t,n.jsx,n.jsxs)}const r={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:l,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?G:vn,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},i=He(r,e,void 0);return i&&typeof i!="string"?i:r.create(e,r.Fragment,{children:i||void 0},void 0)}function He(e,n,t){if(n.type==="element")return Xn(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Kn(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Wn(e,n,t);if(n.type==="mdxjsEsm")return qn(e,n);if(n.type==="root")return Yn(e,n,t);if(n.type==="text")return Jn(e,n)}function Xn(e,n,t){const l=e.schema;let r=l;n.tagName.toLowerCase()==="svg"&&l.space==="html"&&(r=G,e.schema=r),e.ancestors.push(n);const i=Xe(e,n.tagName,!1),o=Zn(e,n);let a=ne(e,n);return zn.has(n.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!un(u):!0})),Ve(e,o,i,n),ee(o,a),e.ancestors.pop(),e.schema=l,e.create(n,i,o,t)}function Kn(e,n){if(n.data&&n.data.estree&&e.evaluater){const l=n.data.estree.body[0];return l.type,e.evaluater.evaluateExpression(l.expression)}I(e,n.position)}function qn(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);I(e,n.position)}function Wn(e,n,t){const l=e.schema;let r=l;n.name==="svg"&&l.space==="html"&&(r=G,e.schema=r),e.ancestors.push(n);const i=n.name===null?e.Fragment:Xe(e,n.name,!0),o=Qn(e,n),a=ne(e,n);return Ve(e,o,i,n),ee(o,a),e.ancestors.pop(),e.schema=l,e.create(n,i,o,t)}function Yn(e,n,t){const l={};return ee(l,ne(e,n)),e.create(n,e.Fragment,l,t)}function Jn(e,n){return n.value}function Ve(e,n,t,l){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=l)}function ee(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function $n(e,n,t){return l;function l(r,i,o,a){const m=Array.isArray(o.children)?t:n;return a?m(i,o,a):m(i,o)}}function Gn(e,n){return t;function t(l,r,i,o){const a=Array.isArray(i.children),u=Z(l);return n(r,i,o,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Zn(e,n){const t={};let l,r;for(r in n.properties)if(r!=="children"&&Q.call(n.properties,r)){const i=et(e,r,n.properties[r]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&Hn.has(n.tagName)?l=a:t[o]=a}}if(l){const i=t.style||(t.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return t}function Qn(e,n){const t={};for(const l of n.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&e.evaluater){const i=l.data.estree.body[0];i.type;const o=i.expression;o.type;const a=o.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else I(e,n.position);else{const r=l.name;let i;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&e.evaluater){const a=l.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else I(e,n.position);else i=l.value===null?!0:l.value;t[r]=i}return t}function ne(e,n){const t=[];let l=-1;const r=e.passKeys?new Map:Un;for(;++l<n.children.length;){const i=n.children[l];let o;if(e.passKeys){const u=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(u){const m=r.get(u)||0;o=u+"-"+m,r.set(u,m+1)}}const a=He(e,i,o);a!==void 0&&t.push(a)}return t}function et(e,n,t){const l=gn(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=l.commaSeparated?ln(t):wn(t)),l.property==="style"){let r=typeof t=="object"?t:nt(e,String(t));return e.stylePropertyNameCase==="css"&&(r=tt(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&l.space?bn[l.property]||l.property:l.attribute,t]}}function nt(e,n){const t={};try{jn(n,l)}catch(r){if(!e.ignoreInvalidStyle){const i=r,o=new Ne("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=ze+"#cannot-parse-style-attribute",o}}return t;function l(r,i){let o=r;o.slice(0,2)!=="--"&&(o.slice(0,4)==="-ms-"&&(o="ms-"+o.slice(4)),o=o.replace(_n,rt)),t[o]=i}}function Xe(e,n,t){let l;if(!t)l={type:"Literal",value:n};else if(n.includes(".")){const r=n.split(".");let i=-1,o;for(;++i<r.length;){const a=ue(r[i])?{type:"Identifier",name:r[i]}:{type:"Literal",value:r[i]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}l=o}else l=ue(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(l.type==="Literal"){const r=l.value;return Q.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(l);I(e)}function I(e,n){const t=new Ne("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=ze+"#cannot-handle-mdx-estrees-without-createevaluater",t}function tt(e){const n={};let t;for(t in e)Q.call(e,t)&&(n[lt(t)]=e[t]);return n}function lt(e){let n=e.replace(Fn,ot);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function rt(e,n){return n.toUpperCase()}function ot(e){return"-"+e.toLowerCase()}const q={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};function it(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function at(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
|
3 |
+
`}]}function st(e,n){const t=n.value?n.value+`
|
4 |
+
`:"",l={};n.lang&&(l.className=["language-"+n.lang]);let r={type:"element",tagName:"code",properties:l,children:[{type:"text",value:t}]};return n.meta&&(r.data={meta:n.meta}),e.patch(n,r),r=e.applyData(n,r),r={type:"element",tagName:"pre",properties:{},children:[r]},e.patch(n,r),r}function ut(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ct(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function pt(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=String(n.identifier).toUpperCase(),r=T(l.toLowerCase()),i=e.footnoteOrder.indexOf(l);let o,a=e.footnoteCounts.get(l);a===void 0?(a=0,e.footnoteOrder.push(l),o=e.footnoteOrder.length):o=i+1,a+=1,e.footnoteCounts.set(l,a);const u={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+r,id:t+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(n,u);const m={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(n,m),e.applyData(n,m)}function ft(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function dt(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function Ke(e,n){const t=n.referenceType;let l="]";if(t==="collapsed"?l+="[]":t==="full"&&(l+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+l}];const r=e.all(n),i=r[0];i&&i.type==="text"?i.value="["+i.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=l:r.push({type:"text",value:l}),r}function ht(e,n){const t=String(n.identifier).toUpperCase(),l=e.definitionById.get(t);if(!l)return Ke(e,n);const r={src:T(l.url||""),alt:n.alt};l.title!==null&&l.title!==void 0&&(r.title=l.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(n,i),e.applyData(n,i)}function mt(e,n){const t={src:T(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const l={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,l),e.applyData(n,l)}function gt(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const l={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,l),e.applyData(n,l)}function yt(e,n){const t=String(n.identifier).toUpperCase(),l=e.definitionById.get(t);if(!l)return Ke(e,n);const r={href:T(l.url||"")};l.title!==null&&l.title!==void 0&&(r.title=l.title);const i={type:"element",tagName:"a",properties:r,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function xt(e,n){const t={href:T(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const l={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function bt(e,n,t){const l=e.all(n),r=t?vt(t):qe(n),i={},o=[];if(typeof n.checked=="boolean"){const c=l[0];let d;c&&c.type==="element"&&c.tagName==="p"?d=c:(d={type:"element",tagName:"p",properties:{},children:[]},l.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<l.length;){const c=l[a];(r||a!==0||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
|
5 |
+
`}),c.type==="element"&&c.tagName==="p"&&!r?o.push(...c.children):o.push(c)}const u=l[l.length-1];u&&(r||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
|
6 |
+
`});const m={type:"element",tagName:"li",properties:i,children:o};return e.patch(n,m),e.applyData(n,m)}function vt(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let l=-1;for(;!n&&++l<t.length;)n=qe(t[l])}return n}function qe(e){const n=e.spread;return n??e.children.length>1}function wt(e,n){const t={},l=e.all(n);let r=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++r<l.length;){const o=l[r];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const i={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(l,!0)};return e.patch(n,i),e.applyData(n,i)}function kt(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ct(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function St(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Et(e,n){const t=e.all(n),l=t.shift(),r=[];if(l){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([l],!0)};e.patch(n.children[0],o),r.push(o)}if(t.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=Z(n.children[1]),u=Fe(n.children[n.children.length-1]);a&&u&&(o.position={start:a,end:u}),r.push(o)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(n,i),e.applyData(n,i)}function Pt(e,n,t){const l=t?t.children:void 0,i=(l?l.indexOf(n):1)===0?"th":"td",o=t&&t.type==="table"?t.align:void 0,a=o?o.length:n.children.length;let u=-1;const m=[];for(;++u<a;){const d=n.children[u],g={},y=o?o[u]:void 0;y&&(g.align=y);let p={type:"element",tagName:i,properties:g,children:[]};d&&(p.children=e.all(d),e.patch(d,p),p=e.applyData(d,p)),m.push(p)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(n,c),e.applyData(n,c)}function Dt(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const xe=9,be=32;function Ot(e){const n=String(e),t=/\r?\n|\r/g;let l=t.exec(n),r=0;const i=[];for(;l;)i.push(ve(n.slice(r,l.index),r>0,!0),l[0]),r=l.index+l[0].length,l=t.exec(n);return i.push(ve(n.slice(r),r>0,!1)),i.join("")}function ve(e,n,t){let l=0,r=e.length;if(n){let i=e.codePointAt(l);for(;i===xe||i===be;)l++,i=e.codePointAt(l)}if(t){let i=e.codePointAt(r-1);for(;i===xe||i===be;)r--,i=e.codePointAt(r-1)}return r>l?e.slice(l,r):""}function Nt(e,n){const t={type:"text",value:Ot(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function At(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const Lt={blockquote:it,break:at,code:st,delete:ut,emphasis:ct,footnoteReference:pt,heading:ft,html:dt,imageReference:ht,image:mt,inlineCode:gt,linkReference:yt,link:xt,listItem:bt,list:wt,paragraph:kt,root:Ct,strong:St,table:Et,tableCell:Dt,tableRow:Pt,text:Nt,thematicBreak:At,toml:B,yaml:B,definition:B,footnoteDefinition:B};function B(){}const We=-1,H=0,F=1,_=2,te=3,le=4,re=5,oe=6,Ye=7,Je=8,we=typeof self=="object"?self:globalThis,Tt=(e,n)=>{const t=(r,i)=>(e.set(i,r),r),l=r=>{if(e.has(r))return e.get(r);const[i,o]=n[r];switch(i){case H:case We:return t(o,r);case F:{const a=t([],r);for(const u of o)a.push(l(u));return a}case _:{const a=t({},r);for(const[u,m]of o)a[l(u)]=l(m);return a}case te:return t(new Date(o),r);case le:{const{source:a,flags:u}=o;return t(new RegExp(a,u),r)}case re:{const a=t(new Map,r);for(const[u,m]of o)a.set(l(u),l(m));return a}case oe:{const a=t(new Set,r);for(const u of o)a.add(l(u));return a}case Ye:{const{name:a,message:u}=o;return t(new we[a](u),r)}case Je:return t(BigInt(o),r);case"BigInt":return t(Object(BigInt(o)),r)}return t(new we[i](o),r)};return l},ke=e=>Tt(new Map,e)(0),A="",{toString:Rt}={},{keys:Mt}=Object,M=e=>{const n=typeof e;if(n!=="object"||!e)return[H,n];const t=Rt.call(e).slice(8,-1);switch(t){case"Array":return[F,A];case"Object":return[_,A];case"Date":return[te,A];case"RegExp":return[le,A];case"Map":return[re,A];case"Set":return[oe,A]}return t.includes("Array")?[F,t]:t.includes("Error")?[Ye,t]:[_,t]},U=([e,n])=>e===H&&(n==="function"||n==="symbol"),It=(e,n,t,l)=>{const r=(o,a)=>{const u=l.push(o)-1;return t.set(a,u),u},i=o=>{if(t.has(o))return t.get(o);let[a,u]=M(o);switch(a){case H:{let c=o;switch(u){case"bigint":a=Je,c=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return r([We],o)}return r([a,c],o)}case F:{if(u)return r([u,[...o]],o);const c=[],d=r([a,c],o);for(const g of o)c.push(i(g));return d}case _:{if(u)switch(u){case"BigInt":return r([u,o.toString()],o);case"Boolean":case"Number":case"String":return r([u,o.valueOf()],o)}if(n&&"toJSON"in o)return i(o.toJSON());const c=[],d=r([a,c],o);for(const g of Mt(o))(e||!U(M(o[g])))&&c.push([i(g),i(o[g])]);return d}case te:return r([a,o.toISOString()],o);case le:{const{source:c,flags:d}=o;return r([a,{source:c,flags:d}],o)}case re:{const c=[],d=r([a,c],o);for(const[g,y]of o)(e||!(U(M(g))||U(M(y))))&&c.push([i(g),i(y)]);return d}case oe:{const c=[],d=r([a,c],o);for(const g of o)(e||!U(M(g)))&&c.push(i(g));return d}}const{message:m}=o;return r([a,{name:u,message:m}],o)};return i},Ce=(e,{json:n,lossy:t}={})=>{const l=[];return It(!(n||t),!!n,new Map,l)(e),l},z=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?ke(Ce(e,n)):structuredClone(e):(e,n)=>ke(Ce(e,n));function jt(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function Bt(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Ut(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||jt,l=e.options.footnoteBackLabel||Bt,r=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[u]);if(!m)continue;const c=e.all(m),d=String(m.identifier).toUpperCase(),g=T(d.toLowerCase());let y=0;const p=[],f=e.footnoteCounts.get(d);for(;f!==void 0&&++y<=f;){p.length>0&&p.push({type:"text",value:" "});let x=typeof t=="string"?t:t(u,y);typeof x=="string"&&(x={type:"text",value:x}),p.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+g+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(u,y),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const b=c[c.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const x=b.children[b.children.length-1];x&&x.type==="text"?x.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...p)}else c.push(...p);const k={type:"element",tagName:"li",properties:{id:n+"fn-"+g},children:e.wrap(c,!0)};e.patch(m,k),a.push(k)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...z(o),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
|
7 |
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
8 |
+
`}]}}const $e=function(e){if(e==null)return Ht;if(typeof e=="function")return V(e);if(typeof e=="object")return Array.isArray(e)?Ft(e):_t(e);if(typeof e=="string")return zt(e);throw new Error("Expected function, string, or object as test")};function Ft(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=$e(e[t]);return V(l);function l(...r){let i=-1;for(;++i<n.length;)if(n[i].apply(this,r))return!0;return!1}}function _t(e){const n=e;return V(t);function t(l){const r=l;let i;for(i in e)if(r[i]!==n[i])return!1;return!0}}function zt(e){return V(n);function n(t){return t&&t.type===e}}function V(e){return n;function n(t,l,r){return!!(Vt(t)&&e.call(this,t,typeof l=="number"?l:void 0,r||void 0))}}function Ht(){return!0}function Vt(e){return e!==null&&typeof e=="object"&&"type"in e}const Ge=[],Xt=!0,Se=!1,Kt="skip";function qt(e,n,t,l){let r;typeof n=="function"&&typeof t!="function"?(l=t,t=n):r=n;const i=$e(r),o=l?-1:1;a(e,void 0,[])();function a(u,m,c){const d=u&&typeof u=="object"?u:{};if(typeof d.type=="string"){const y=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(u.type+(y?"<"+y+">":""))+")"})}return g;function g(){let y=Ge,p,f,b;if((!n||i(u,m,c[c.length-1]||void 0))&&(y=Wt(t(u,c)),y[0]===Se))return y;if("children"in u&&u.children){const k=u;if(k.children&&y[0]!==Kt)for(f=(l?k.children.length:-1)+o,b=c.concat(k);f>-1&&f<k.children.length;){const x=k.children[f];if(p=a(x,f,b)(),p[0]===Se)return p;f=typeof p[1]=="number"?p[1]:f+o}}return y}}}function Wt(e){return Array.isArray(e)?e:typeof e=="number"?[Xt,e]:e==null?Ge:[e]}function Ze(e,n,t,l){let r,i,o;typeof n=="function"&&typeof t!="function"?(i=void 0,o=n,r=t):(i=n,o=t,r=l),qt(e,i,a,r);function a(u,m){const c=m[m.length-1],d=c?c.children.indexOf(u):void 0;return o(u,d,c)}}const J={}.hasOwnProperty,Yt={};function Jt(e,n){const t=n||Yt,l=new Map,r=new Map,i=new Map,o={...Lt,...t.handlers},a={all:m,applyData:Gt,definitionById:l,footnoteById:r,footnoteCounts:i,footnoteOrder:[],handlers:o,one:u,options:t,patch:$t,wrap:Qt};return Ze(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const d=c.type==="definition"?l:r,g=String(c.identifier).toUpperCase();d.has(g)||d.set(g,c)}}),a;function u(c,d){const g=c.type,y=a.handlers[g];if(J.call(a.handlers,g)&&y)return y(a,c,d);if(a.options.passThrough&&a.options.passThrough.includes(g)){if("children"in c){const{children:f,...b}=c,k=z(b);return k.children=a.all(c),k}return z(c)}return(a.options.unknownHandler||Zt)(a,c,d)}function m(c){const d=[];if("children"in c){const g=c.children;let y=-1;for(;++y<g.length;){const p=a.one(g[y],c);if(p){if(y&&g[y-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=Ee(p.value)),!Array.isArray(p)&&p.type==="element")){const f=p.children[0];f&&f.type==="text"&&(f.value=Ee(f.value))}Array.isArray(p)?d.push(...p):d.push(p)}}}return d}}function $t(e,n){e.position&&(n.position=Bn(e))}function Gt(e,n){let t=n;if(e&&e.data){const l=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;if(typeof l=="string")if(t.type==="element")t.tagName=l;else{const o="children"in t?t.children:[t];t={type:"element",tagName:l,properties:{},children:o}}t.type==="element"&&i&&Object.assign(t.properties,z(i)),"children"in t&&t.children&&r!==null&&r!==void 0&&(t.children=r)}return t}function Zt(e,n){const t=n.data||{},l="value"in n&&!(J.call(t,"hProperties")||J.call(t,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function Qt(e,n){const t=[];let l=-1;for(n&&t.push({type:"text",value:`
|
9 |
+
`});++l<e.length;)l&&t.push({type:"text",value:`
|
10 |
+
`}),t.push(e[l]);return n&&e.length>0&&t.push({type:"text",value:`
|
11 |
+
`}),t}function Ee(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function Pe(e,n){const t=Jt(e,n),l=t.one(e,void 0),r=Ut(t),i=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return r&&i.children.push({type:"text",value:`
|
12 |
+
`},r),i}function el(e,n){return e&&"run"in e?async function(t,l){const r=Pe(t,{file:l,...n});await e.run(r,l)}:function(t,l){return Pe(t,{file:l,...n||e})}}const nl="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",De=[],Oe={allowDangerousHtml:!0},tl=/^(https?|ircs?|mailto|xmpp)$/i,ll=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function ul(e){const n=e.allowedElements,t=e.allowElement,l=e.children||"",r=e.className,i=e.components,o=e.disallowedElements,a=e.rehypePlugins||De,u=e.remarkPlugins||De,m=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Oe}:Oe,c=e.skipHtml,d=e.unwrapDisallowed,g=e.urlTransform||rl,y=en().use(nn).use(u).use(el,m).use(a),p=new tn;typeof l=="string"&&(p.value=l);for(const x of ll)Object.hasOwn(e,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+nl+x.id,void 0);const f=y.parse(p);let b=y.runSync(f,p);return r&&(b={type:"element",tagName:"div",properties:{className:r},children:b.type==="root"?b.children:[b]}),Ze(b,k),Vn(b,{Fragment:X.Fragment,components:i,ignoreInvalidStyle:!0,jsx:X.jsx,jsxs:X.jsxs,passKeys:!0,passNode:!0});function k(x,P,D){if(x.type==="raw"&&D&&typeof P=="number")return c?D.children.splice(P,1):D.children[P]={type:"text",value:x.value},P;if(x.type==="element"){let E;for(E in q)if(Object.hasOwn(q,E)&&Object.hasOwn(x.properties,E)){const Qe=x.properties[E],ie=q[E];(ie===null||ie.includes(x.tagName))&&(x.properties[E]=g(String(Qe||""),E,x))}}if(x.type==="element"){let E=n?!n.includes(x.tagName):o?o.includes(x.tagName):!1;if(!E&&t&&typeof P=="number"&&(E=!t(x,P,D)),E&&D&&typeof P=="number")return d&&x.children?D.children.splice(P,1,...x.children):D.children.splice(P,1),P}}}function rl(e){const n=e.indexOf(":"),t=e.indexOf("?"),l=e.indexOf("#"),r=e.indexOf("/");return n<0||r>-1&&n>r||t>-1&&n>t||l>-1&&n>l||tl.test(e.slice(0,n))?e:""}export{ul as default,rl as defaultUrlTransform};
|
openui/dist/assets/index-OfmkY5JK.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-ms-input-placeholder,textarea::-ms-input-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--background: 0 0% 100%;--foreground: 240 10% 3.9%;--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--primary: 240 5.9% 10%;--primary-foreground: 0 0% 98%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 240 10% 3.9%;--radius: .5rem}.dark{--background: 240 10% 3.9%;--foreground: 0 0% 98%;--card: 240 10% 3.9%;--card-foreground: 0 0% 98%;--popover: 240 10% 3.9%;--popover-foreground: 0 0% 98%;--primary: 0 0% 98%;--primary-foreground: 240 5.9% 10%;--secondary: 240 3.7% 15.9%;--secondary-foreground: 0 0% 98%;--muted: 240 3.7% 15.9%;--muted-foreground: 240 5% 64.9%;--accent: 240 3.7% 15.9%;--accent-foreground: 0 0% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 0 0% 98%;--border: 240 3.7% 15.9%;--input: 240 3.7% 15.9%;--ring: 240 4.9% 83.9%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::-ms-backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-left-width:.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding:.1875em .375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding:.8571429em 1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-right:.5714286em;padding-bottom:.5714286em;padding-left:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-left:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-left:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding:.1428571em .3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding:.6666667em 1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-left:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-left:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-left:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:1em;padding-bottom:.6666667em;padding-left:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding:.6666667em 1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-zinc{--tw-prose-body: #3f3f46;--tw-prose-headings: #18181b;--tw-prose-lead: #52525b;--tw-prose-links: #18181b;--tw-prose-bold: #18181b;--tw-prose-counters: #71717a;--tw-prose-bullets: #d4d4d8;--tw-prose-hr: #e4e4e7;--tw-prose-quotes: #18181b;--tw-prose-quote-borders: #e4e4e7;--tw-prose-captions: #71717a;--tw-prose-kbd: #18181b;--tw-prose-kbd-shadows: 24 24 27;--tw-prose-code: #18181b;--tw-prose-pre-code: #e4e4e7;--tw-prose-pre-bg: #27272a;--tw-prose-th-borders: #d4d4d8;--tw-prose-td-borders: #e4e4e7;--tw-prose-invert-body: #d4d4d8;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #a1a1aa;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #a1a1aa;--tw-prose-invert-bullets: #52525b;--tw-prose-invert-hr: #3f3f46;--tw-prose-invert-quotes: #f4f4f5;--tw-prose-invert-quote-borders: #3f3f46;--tw-prose-invert-captions: #a1a1aa;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d4d4d8;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #52525b;--tw-prose-invert-td-borders: #3f3f46}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:-webkit-sticky;position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-bottom-10{bottom:-2.5rem}.-left-2{left:-.5rem}.-right-\[58px\]{right:-58px}.bottom-0{bottom:0}.left-0{left:0}.left-2{left:.5rem}.left-\[50\%\],.left-\[calc\(50\%\)\]{left:50%}.left-\[calc\(50\%-1\.25rem\)\]{left:calc(50% - 1.25rem)}.right-0{right:0}.right-4{right:1rem}.top-0{top:0}.top-4{top:1rem}.top-\[50\%\]{top:50%}.top-\[90px\]{top:90px}.z-0{z-index:0}.z-10{z-index:10}.z-50{z-index:50}.col-span-1{grid-column:span 1 / span 1}.col-span-2{grid-column:span 2 / span 2}.col-span-3{grid-column:span 3 / span 3}.col-start-4{grid-column-start:4}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.my-7{margin-top:1.75rem;margin-bottom:1.75rem}.-ml-4{margin-left:-1rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-20{margin-bottom:5rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-7{margin-bottom:1.75rem}.ml-10{margin-left:2.5rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mt-10{margin-top:2.5rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-5{margin-top:1.25rem}.mt-7{margin-top:1.75rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-64{height:16rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[60vh\]{height:60vh}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-96{max-height:24rem}.max-h-\[20vh\]{max-height:20vh}.max-h-\[24vh\]{max-height:24vh}.max-h-\[300px\]{max-height:300px}.max-h-\[60vh\]{max-height:60vh}.max-h-full{max-height:100%}.min-h-\[20vh\]{min-height:20vh}.min-h-\[41px\]{min-height:41px}.min-h-\[80px\]{min-height:80px}.min-h-screen{min-height:100vh}.w-0{width:0px}.w-10{width:2.5rem}.w-11\/12{width:91.666667%}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-64{width:16rem}.w-8{width:2rem}.w-\[100\%\]{width:100%}.w-\[300px\]{width:300px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-\[380px\]{max-width:380px}.max-w-\[450px\]{max-width:450px}.max-w-\[460px\]{max-width:460px}.max-w-\[500px\]{max-width:500px}.max-w-\[80\%\]{max-width:80%}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.grow{flex-grow:1}.-translate-x-1\/2,.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-24{--tw-translate-y: 6rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-4{gap:1rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-t-md{border-top-left-radius:calc(var(--radius) - 2px);border-top-right-radius:calc(var(--radius) - 2px)}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-\[1px\]{border-width:1px}.border-x{border-left-width:1px;border-right-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity))}.border-zinc-100{--tw-border-opacity: 1;border-color:rgb(244 244 245 / var(--tw-border-opacity))}.border-zinc-400{--tw-border-opacity: 1;border-color:rgb(161 161 170 / var(--tw-border-opacity))}.border-b-zinc-500{--tw-border-opacity: 1;border-bottom-color:rgb(113 113 122 / var(--tw-border-opacity))}.bg-background{background-color:hsl(var(--background))}.bg-black\/80{background-color:#000c}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-zinc-200{--tw-bg-opacity: 1;background-color:rgb(228 228 231 / var(--tw-bg-opacity))}.bg-zinc-300{--tw-bg-opacity: 1;background-color:rgb(212 212 216 / var(--tw-bg-opacity))}.bg-zinc-50{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity))}.bg-zinc-900{--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity))}.bg-gradient-to-l{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-purple-400{--tw-gradient-from: #c084fc var(--tw-gradient-from-position);--tw-gradient-to: rgb(192 132 252 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-secondary{--tw-gradient-from: hsl(var(--secondary)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--secondary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-teal-400{--tw-gradient-from: #2dd4bf var(--tw-gradient-from-position);--tw-gradient-to: rgb(45 212 191 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-yellow-400{--tw-gradient-from: #facc15 var(--tw-gradient-from-position);--tw-gradient-to: rgb(250 204 21 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-zinc-300{--tw-gradient-from: #d4d4d8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(212 212 216 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-0\%{--tw-gradient-from-position: 0%}.via-pink-500{--tw-gradient-to: rgb(236 72 153 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #ec4899 var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-blue-500{--tw-gradient-to: #3b82f6 var(--tw-gradient-to-position)}.to-orange-500{--tw-gradient-to: #f97316 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-red-500{--tw-gradient-to: #ef4444 var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\[10px\]{padding:10px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pb-8{padding-bottom:2rem}.pl-4{padding-left:1rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.text-6xl{font-size:3.75rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-zinc-600{--tw-text-opacity: 1;color:rgb(82 82 91 / var(--tw-text-opacity))}.underline{-webkit-text-decoration-line:underline;text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,fill,stroke,-webkit-text-decoration-color;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,-webkit-text-decoration-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.prose h3{text-align:right;font-weight:400;font-style:italic}.mobile-safe-container{padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);min-height:100vh;min-height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom))}:is(:where(.dark) .dark\:prose-invert){--tw-prose-body: var(--tw-prose-invert-body);--tw-prose-headings: var(--tw-prose-invert-headings);--tw-prose-lead: var(--tw-prose-invert-lead);--tw-prose-links: var(--tw-prose-invert-links);--tw-prose-bold: var(--tw-prose-invert-bold);--tw-prose-counters: var(--tw-prose-invert-counters);--tw-prose-bullets: var(--tw-prose-invert-bullets);--tw-prose-hr: var(--tw-prose-invert-hr);--tw-prose-quotes: var(--tw-prose-invert-quotes);--tw-prose-quote-borders: var(--tw-prose-invert-quote-borders);--tw-prose-captions: var(--tw-prose-invert-captions);--tw-prose-kbd: var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows);--tw-prose-code: var(--tw-prose-invert-code);--tw-prose-pre-code: var(--tw-prose-invert-pre-code);--tw-prose-pre-bg: var(--tw-prose-invert-pre-bg);--tw-prose-th-borders: var(--tw-prose-invert-th-borders);--tw-prose-td-borders: var(--tw-prose-invert-td-borders)}.file\:border-0::-webkit-file-upload-button{border-width:0px}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::-webkit-file-upload-button{background-color:transparent}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::-webkit-file-upload-button{font-size:.875rem;line-height:1.25rem}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::-webkit-file-upload-button{font-weight:500}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-ms-input-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:-ml-96:hover{margin-left:-24rem}.hover\:mr-36:hover{margin-right:9rem}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.hover\:animate-pulse:hover{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-background:hover{background-color:hsl(var(--background))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-inherit:hover{background-color:inherit}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:from-purple-500:hover{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-teal-500:hover{--tw-gradient-from: #14b8a6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(20 184 166 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-yellow-500:hover{--tw-gradient-from: #eab308 var(--tw-gradient-from-position);--tw-gradient-to: rgb(234 179 8 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-blue-600:hover{--tw-gradient-to: #2563eb var(--tw-gradient-to-position)}.hover\:to-orange-600:hover{--tw-gradient-to: #ea580c var(--tw-gradient-to-position)}.hover\:to-pink-600:hover{--tw-gradient-to: #db2777 var(--tw-gradient-to-position)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:underline:hover{-webkit-text-decoration-line:underline;text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:ring-transparent:hover{--tw-ring-color: transparent}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-0:focus{--tw-ring-offset-width: 0px}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-0:focus-visible{--tw-ring-offset-width: 0px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.active\:text-black:active{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:right-5{right:1.25rem}.group:hover .group-hover\:from-secondary{--tw-gradient-from: hsl(var(--secondary)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--secondary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.group:hover .group-hover\:opacity-100{opacity:1}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}@media (min-width: 640px){.sm\:col-span-1{grid-column:span 1 / span 1}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:max-w-\[425px\]{max-width:425px}.sm\:max-w-sm{max-width:24rem}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}@media not all and (min-width: 1024px){.sm\:max-lg\:max-w-\[75\%\]{max-width:75%}}}@media (min-width: 768px){.md\:max-w-\[50\%\]{max-width:50%}}@media (min-width: 1024px){.lg\:max-w-full{max-width:100%}}:is(:where(.dark) .dark\:bg-zinc-700){--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity))}:is(:where(.dark) .dark\:bg-zinc-800){--tw-bg-opacity: 1;background-color:rgb(39 39 42 / var(--tw-bg-opacity))}:is(:where(.dark) .dark\:bg-zinc-900){--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity))}:is(:where(.dark) .dark\:from-secondary){--tw-gradient-from: hsl(var(--secondary)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--secondary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}:is(:where(.dark) .dark\:from-zinc-900){--tw-gradient-from: #18181b var(--tw-gradient-from-position);--tw-gradient-to: rgb(24 24 27 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}:is(:where(.dark) .dark\:text-gray-400){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}:is(:where(.dark) .dark\:text-red-400){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity))}:is(:where(.dark) .dark\:text-white){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}
|
openui/dist/assets/index-VsdO9OoH.js
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import{r as t,u as Ue,j as l,L as Ot,l as j,_ as y,m as We,n as Ge,o as Pe,p as Vt,q as De,s as k,v as Lt,w as N,x as te,y as Bt,z as qe,A as Ht,B as Kt,C as Ft,D as zt,E as Ut,F as Wt,G as Gt,H as qt,O as Yt}from"./vendor-BJpsy9o3.js";import{c as Ye,u as Xe,h as ge,a as Xt,D as Zt,b as Qt,B as Q,d as Jt,e as eo,f as ke,g as Ze,i as Qe,j as Je,k as et,l as tt,m as Ie,G as ot,n as to,o as oo,$ as nt,p as rt,q as no,r as ro,s as ao,t as so,C as co,v as me,w as lo,T as io,x as uo,y as fo,z as po,A as mo,E as ho,F as go,P as vo,H as xo,I as $o}from"./textarea-4A01Dc6n.js";import{c as A,u as wo,E as bo,L as So,M as yo}from"./index-2-rOUq-J.js";function Co({title:e}){return t.useEffect(()=>{document.title=e},[e]),null}/**
|
2 |
+
* @license lucide-react v0.316.0 - ISC
|
3 |
+
*
|
4 |
+
* This source code is licensed under the ISC license.
|
5 |
+
* See the LICENSE file in the root directory of this source tree.
|
6 |
+
*/const at=Ye("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
7 |
+
* @license lucide-react v0.316.0 - ISC
|
8 |
+
*
|
9 |
+
* This source code is licensed under the ISC license.
|
10 |
+
* See the LICENSE file in the root directory of this source tree.
|
11 |
+
*/const Eo=Ye("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);function st({id:e,label:n,active:o=!1,collapsed:r=!1}){const a=Xe(ge({id:e})),c=Ue(),i=Xt(Ze);return l.jsxs(l.Fragment,{children:[!!n&&l.jsx("div",{className:"mb-2 w-full text-xs",children:l.jsx("h3",{children:n})}),l.jsxs("div",{className:`${o&&"bg-secondary"} group relative mb-2 w-full rounded-md p-2 text-sm hover:bg-secondary`,children:[l.jsx(Ot,{to:`/ai/${e}`,className:"flex items-center active:text-black",children:l.jsxs("div",{className:"relative grow overflow-hidden whitespace-nowrap",children:[`${a.emoji??"🤔"} `,a.name??a.prompt,l.jsx("div",{className:A("absolute bottom-0 right-0 top-0 w-8 bg-gradient-to-l from-zinc-300 from-0% to-transparent group-hover:right-5 group-hover:from-secondary dark:from-zinc-900",{"from-secondary":o,"dark:from-secondary":o})})]})}),l.jsx("div",{className:"absolute bottom-0 right-0 top-0 flex items-center bg-secondary pr-2 opacity-0 group-hover:opacity-100",children:l.jsxs(Zt,{modal:!1,children:[l.jsx(Qt,{asChild:!0,children:l.jsx(Q,{className:"h-5 w-5 text-sm hover:ring-transparent focus-visible:ring-0",variant:"ghost",size:"icon",children:l.jsx(Jt,{className:"inline-block h-4 w-4"})})}),l.jsxs(eo,{children:[l.jsx(ke,{children:"Copy"}),l.jsx(ke,{onClick:()=>{i(s=>s.filter(d=>d!==e)),ge.remove({id:e}),localStorage.removeItem(`${e}.html`),localStorage.removeItem(`${e}.md`),c("/ai/new")},children:"Delete"})]})]})}),l.jsx(Q,{onClick:()=>c(`/ai/${e}`),className:A("absolute -right-[58px] top-0 z-50 ml-auto inline-flex h-8 w-8 p-2 hover:scale-110 hover:bg-inherit",r&&"ml-10",o&&"bg-zinc-900"),variant:"ghost",size:"icon",children:a.emoji??"🤔"})]})]})}st.defaultProps={label:void 0};/*! js-cookie v3.0.5 | MIT */function fe(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var r in o)e[r]=o[r]}return e}var Po={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function _e(e,n){function o(a,c,i){if(!(typeof document>"u")){i=fe({},n,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var d in i)i[d]&&(s+="; "+d,i[d]!==!0&&(s+="="+i[d].split(";")[0]));return document.cookie=a+"="+e.write(c,a)+s}}function r(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var c=document.cookie?document.cookie.split("; "):[],i={},s=0;s<c.length;s++){var d=c[s].split("="),f=d.slice(1).join("=");try{var p=decodeURIComponent(d[0]);if(i[p]=e.read(f,p),a===p)break}catch{}}return a?i[a]:i}}return Object.create({set:o,get:r,remove:function(a,c){o(a,"",fe({},c,{expires:-1}))},withAttributes:function(a){return _e(this.converter,fe({},this.attributes,a))},withConverter:function(a){return _e(fe({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(e)}})}var Oe=_e(Po,{path:"/"});function Io(){const[e,n]=t.useState(),[o,r]=t.useState(!1);return t.useEffect(()=>{const c=async()=>{const s=await to();r(s===void 0)},i=Oe.get("error");i&&(n(i),Oe.remove("error")),c().catch(s=>console.error(s))},[]),l.jsx(Qe,{open:o,onOpenChange:c=>{console.log(c)},children:l.jsxs(Je,{noClose:!0,className:"sm:max-w-[425px]",children:[l.jsxs(et,{children:[l.jsx(tt,{children:"Login"}),e?l.jsx(Ie,{className:"mb-2 text-red-500 dark:text-red-400",children:e}):l.jsx(Ie,{children:"To enforce usage quotas an account is required."})]}),l.jsx("div",{className:"items-center",children:l.jsx(Q,{asChild:!0,children:l.jsxs("a",{href:"/v1/login",children:[l.jsx(ot,{className:"mr-2"})," Login with GitHub"]})})})]})})}async function _o(){try{return(await(await fetch("http://127.0.0.1:11434/api/tags")).json()).models}catch(e){return console.error(e),[]}}const Ro=t.forwardRef((e,n)=>t.createElement(j.label,y({},e,{ref:n,onMouseDown:o=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,o),!o.defaultPrevented&&o.detail>1&&o.preventDefault()}}))),ct=Ro,To=oo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),he=t.forwardRef(({className:e,...n},o)=>l.jsx(ct,{ref:o,className:A(To(),e),...n}));he.displayName=ct.displayName;function ve(e,[n,o]){return Math.min(o,Math.max(n,e))}function lt(e){const n=t.useRef({value:e,previous:e});return t.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}const No=[" ","Enter","ArrowUp","ArrowDown"],Do=[" ","Enter"],xe="Select",[$e,we,jo]=nt(xe),[le,Yn]=We(xe,[jo,Ge]),je=Ge(),[Mo,oe]=le(xe),[Ao,ko]=le(xe),Oo=e=>{const{__scopeSelect:n,children:o,open:r,defaultOpen:a,onOpenChange:c,value:i,defaultValue:s,onValueChange:d,dir:f,name:p,autoComplete:u,disabled:x,required:b}=e,m=je(n),[v,S]=t.useState(null),[$,h]=t.useState(null),[g,M]=t.useState(!1),D=rt(f),[J=!1,E]=Pe({prop:r,defaultProp:a,onChange:c}),[V,G]=Pe({prop:i,defaultProp:s,onChange:d}),ee=t.useRef(null),X=v?!!v.closest("form"):!0,[K,L]=t.useState(new Set),P=Array.from(K).map(C=>C.props.value).join(";");return t.createElement(Vt,m,t.createElement(Mo,{required:b,scope:n,trigger:v,onTriggerChange:S,valueNode:$,onValueNodeChange:h,valueNodeHasChildren:g,onValueNodeHasChildrenChange:M,contentId:De(),value:V,onValueChange:G,open:J,onOpenChange:E,dir:D,triggerPointerDownPosRef:ee,disabled:x},t.createElement($e.Provider,{scope:n},t.createElement(Ao,{scope:e.__scopeSelect,onNativeOptionAdd:t.useCallback(C=>{L(O=>new Set(O).add(C))},[]),onNativeOptionRemove:t.useCallback(C=>{L(O=>{const F=new Set(O);return F.delete(C),F})},[])},o)),X?t.createElement(pt,{key:P,"aria-hidden":!0,required:b,tabIndex:-1,name:p,autoComplete:u,value:V,onChange:C=>G(C.target.value),disabled:x},V===void 0?t.createElement("option",{value:""}):null,Array.from(K)):null))},Vo="SelectTrigger",Lo=t.forwardRef((e,n)=>{const{__scopeSelect:o,disabled:r=!1,...a}=e,c=je(o),i=oe(Vo,o),s=i.disabled||r,d=k(n,i.onTriggerChange),f=we(o),[p,u,x]=mt(m=>{const v=f().filter(h=>!h.disabled),S=v.find(h=>h.value===i.value),$=ht(v,m,S);$!==void 0&&i.onValueChange($.value)}),b=()=>{s||(i.onOpenChange(!0),x())};return t.createElement(Lt,y({asChild:!0},c),t.createElement(j.button,y({type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":ft(i.value)?"":void 0},a,{ref:d,onClick:N(a.onClick,m=>{m.currentTarget.focus()}),onPointerDown:N(a.onPointerDown,m=>{const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&(b(),i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)},m.preventDefault())}),onKeyDown:N(a.onKeyDown,m=>{const v=p.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&u(m.key),!(v&&m.key===" ")&&No.includes(m.key)&&(b(),m.preventDefault())})})))}),Bo="SelectValue",Ho=t.forwardRef((e,n)=>{const{__scopeSelect:o,className:r,style:a,children:c,placeholder:i="",...s}=e,d=oe(Bo,o),{onValueNodeHasChildrenChange:f}=d,p=c!==void 0,u=k(n,d.onValueNodeChange);return te(()=>{f(p)},[f,p]),t.createElement(j.span,y({},s,{ref:u,style:{pointerEvents:"none"}}),ft(d.value)?t.createElement(t.Fragment,null,i):c)}),Ko=t.forwardRef((e,n)=>{const{__scopeSelect:o,children:r,...a}=e;return t.createElement(j.span,y({"aria-hidden":!0},a,{ref:n}),r||"▼")}),Fo=e=>t.createElement(Bt,y({asChild:!0},e)),ce="SelectContent",zo=t.forwardRef((e,n)=>{const o=oe(ce,e.__scopeSelect),[r,a]=t.useState();if(te(()=>{a(new DocumentFragment)},[]),!o.open){const c=r;return c?qe.createPortal(t.createElement(it,{scope:e.__scopeSelect},t.createElement($e.Slot,{scope:e.__scopeSelect},t.createElement("div",null,e.children))),c):null}return t.createElement(Uo,y({},e,{ref:n}))}),Z=10,[it,ne]=le(ce),Uo=t.forwardRef((e,n)=>{const{__scopeSelect:o,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:c,onPointerDownOutside:i,side:s,sideOffset:d,align:f,alignOffset:p,arrowPadding:u,collisionBoundary:x,collisionPadding:b,sticky:m,hideWhenDetached:v,avoidCollisions:S,...$}=e,h=oe(ce,o),[g,M]=t.useState(null),[D,J]=t.useState(null),E=k(n,w=>M(w)),[V,G]=t.useState(null),[ee,X]=t.useState(null),K=we(o),[L,P]=t.useState(!1),C=t.useRef(!1);t.useEffect(()=>{if(g)return no(g)},[g]),ro();const O=t.useCallback(w=>{const[R,...H]=K().map(_=>_.ref.current),[T]=H.slice(-1),I=document.activeElement;for(const _ of w)if(_===I||(_==null||_.scrollIntoView({block:"nearest"}),_===R&&D&&(D.scrollTop=0),_===T&&D&&(D.scrollTop=D.scrollHeight),_==null||_.focus(),document.activeElement!==I))return},[K,D]),F=t.useCallback(()=>O([V,g]),[O,V,g]);t.useEffect(()=>{L&&F()},[L,F]);const{onOpenChange:q,triggerPointerDownPosRef:B}=h;t.useEffect(()=>{if(g){let w={x:0,y:0};const R=T=>{var I,_,U,W;w={x:Math.abs(Math.round(T.pageX)-((I=(_=B.current)===null||_===void 0?void 0:_.x)!==null&&I!==void 0?I:0)),y:Math.abs(Math.round(T.pageY)-((U=(W=B.current)===null||W===void 0?void 0:W.y)!==null&&U!==void 0?U:0))}},H=T=>{w.x<=10&&w.y<=10?T.preventDefault():g.contains(T.target)||q(!1),document.removeEventListener("pointermove",R),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",R),document.addEventListener("pointerup",H,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",H,{capture:!0})}}},[g,q,B]),t.useEffect(()=>{const w=()=>q(!1);return window.addEventListener("blur",w),window.addEventListener("resize",w),()=>{window.removeEventListener("blur",w),window.removeEventListener("resize",w)}},[q]);const[Y,z]=mt(w=>{const R=K().filter(I=>!I.disabled),H=R.find(I=>I.ref.current===document.activeElement),T=ht(R,w,H);T&&setTimeout(()=>T.ref.current.focus())}),re=t.useCallback((w,R,H)=>{const T=!C.current&&!H;(h.value!==void 0&&h.value===R||T)&&(G(w),T&&(C.current=!0))},[h.value]),Se=t.useCallback(()=>g==null?void 0:g.focus(),[g]),ae=t.useCallback((w,R,H)=>{const T=!C.current&&!H;(h.value!==void 0&&h.value===R||T)&&X(w)},[h.value]),ue=r==="popper"?Ve:Wo,ie=ue===Ve?{side:s,sideOffset:d,align:f,alignOffset:p,arrowPadding:u,collisionBoundary:x,collisionPadding:b,sticky:m,hideWhenDetached:v,avoidCollisions:S}:{};return t.createElement(it,{scope:o,content:g,viewport:D,onViewportChange:J,itemRefCallback:re,selectedItem:V,onItemLeave:Se,itemTextRefCallback:ae,focusSelectedItem:F,selectedItemText:ee,position:r,isPositioned:L,searchRef:Y},t.createElement(ao,{as:Ht,allowPinchZoom:!0},t.createElement(so,{asChild:!0,trapped:h.open,onMountAutoFocus:w=>{w.preventDefault()},onUnmountAutoFocus:N(a,w=>{var R;(R=h.trigger)===null||R===void 0||R.focus({preventScroll:!0}),w.preventDefault()})},t.createElement(Kt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:i,onFocusOutside:w=>w.preventDefault(),onDismiss:()=>h.onOpenChange(!1)},t.createElement(ue,y({role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:w=>w.preventDefault()},$,ie,{onPlaced:()=>P(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...$.style},onKeyDown:N($.onKeyDown,w=>{const R=w.ctrlKey||w.altKey||w.metaKey;if(w.key==="Tab"&&w.preventDefault(),!R&&w.key.length===1&&z(w.key),["ArrowUp","ArrowDown","Home","End"].includes(w.key)){let T=K().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(w.key)&&(T=T.slice().reverse()),["ArrowUp","ArrowDown"].includes(w.key)){const I=w.target,_=T.indexOf(I);T=T.slice(_+1)}setTimeout(()=>O(T)),w.preventDefault()}})}))))))}),Wo=t.forwardRef((e,n)=>{const{__scopeSelect:o,onPlaced:r,...a}=e,c=oe(ce,o),i=ne(ce,o),[s,d]=t.useState(null),[f,p]=t.useState(null),u=k(n,E=>p(E)),x=we(o),b=t.useRef(!1),m=t.useRef(!0),{viewport:v,selectedItem:S,selectedItemText:$,focusSelectedItem:h}=i,g=t.useCallback(()=>{if(c.trigger&&c.valueNode&&s&&f&&v&&S&&$){const E=c.trigger.getBoundingClientRect(),V=f.getBoundingClientRect(),G=c.valueNode.getBoundingClientRect(),ee=$.getBoundingClientRect();if(c.dir!=="rtl"){const I=ee.left-V.left,_=G.left-I,U=E.left-_,W=E.width+U,ye=Math.max(W,V.width),Ce=window.innerWidth-Z,Ee=ve(_,[Z,Ce-ye]);s.style.minWidth=W+"px",s.style.left=Ee+"px"}else{const I=V.right-ee.right,_=window.innerWidth-G.right-I,U=window.innerWidth-E.right-_,W=E.width+U,ye=Math.max(W,V.width),Ce=window.innerWidth-Z,Ee=ve(_,[Z,Ce-ye]);s.style.minWidth=W+"px",s.style.right=Ee+"px"}const X=x(),K=window.innerHeight-Z*2,L=v.scrollHeight,P=window.getComputedStyle(f),C=parseInt(P.borderTopWidth,10),O=parseInt(P.paddingTop,10),F=parseInt(P.borderBottomWidth,10),q=parseInt(P.paddingBottom,10),B=C+O+L+q+F,Y=Math.min(S.offsetHeight*5,B),z=window.getComputedStyle(v),re=parseInt(z.paddingTop,10),Se=parseInt(z.paddingBottom,10),ae=E.top+E.height/2-Z,ue=K-ae,ie=S.offsetHeight/2,w=S.offsetTop+ie,R=C+O+w,H=B-R;if(R<=ae){const I=S===X[X.length-1].ref.current;s.style.bottom="0px";const _=f.clientHeight-v.offsetTop-v.offsetHeight,U=Math.max(ue,ie+(I?Se:0)+_+F),W=R+U;s.style.height=W+"px"}else{const I=S===X[0].ref.current;s.style.top="0px";const U=Math.max(ae,C+v.offsetTop+(I?re:0)+ie)+H;s.style.height=U+"px",v.scrollTop=R-ae+v.offsetTop}s.style.margin=`${Z}px 0`,s.style.minHeight=Y+"px",s.style.maxHeight=K+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[x,c.trigger,c.valueNode,s,f,v,S,$,c.dir,r]);te(()=>g(),[g]);const[M,D]=t.useState();te(()=>{f&&D(window.getComputedStyle(f).zIndex)},[f]);const J=t.useCallback(E=>{E&&m.current===!0&&(g(),h==null||h(),m.current=!1)},[g,h]);return t.createElement(Go,{scope:o,contentWrapper:s,shouldExpandOnScrollRef:b,onScrollButtonChange:J},t.createElement("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M}},t.createElement(j.div,y({},a,{ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}}))))}),Ve=t.forwardRef((e,n)=>{const{__scopeSelect:o,align:r="start",collisionPadding:a=Z,...c}=e,i=je(o);return t.createElement(Ut,y({},i,c,{ref:n,align:r,collisionPadding:a,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[Go,Me]=le(ce,{}),Le="SelectViewport",qo=t.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=ne(Le,o),c=Me(Le,o),i=k(n,a.onViewportChange),s=t.useRef(0);return t.createElement(t.Fragment,null,t.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),t.createElement($e.Slot,{scope:o},t.createElement(j.div,y({"data-radix-select-viewport":"",role:"presentation"},r,{ref:i,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:N(r.onScroll,d=>{const f=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:u}=c;if(u!=null&&u.current&&p){const x=Math.abs(s.current-f.scrollTop);if(x>0){const b=window.innerHeight-Z*2,m=parseFloat(p.style.minHeight),v=parseFloat(p.style.height),S=Math.max(m,v);if(S<b){const $=S+x,h=Math.min(b,$),g=$-h;p.style.height=h+"px",p.style.bottom==="0px"&&(f.scrollTop=g>0?g:0,p.style.justifyContent="flex-end")}}}s.current=f.scrollTop})}))))}),Yo="SelectGroup",[Xo,Zo]=le(Yo),Qo=t.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=De();return t.createElement(Xo,{scope:o,id:a},t.createElement(j.div,y({role:"group","aria-labelledby":a},r,{ref:n})))}),Jo="SelectLabel",en=t.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=Zo(Jo,o);return t.createElement(j.div,y({id:a.id},r,{ref:n}))}),Re="SelectItem",[tn,dt]=le(Re),on=t.forwardRef((e,n)=>{const{__scopeSelect:o,value:r,disabled:a=!1,textValue:c,...i}=e,s=oe(Re,o),d=ne(Re,o),f=s.value===r,[p,u]=t.useState(c??""),[x,b]=t.useState(!1),m=k(n,$=>{var h;return(h=d.itemRefCallback)===null||h===void 0?void 0:h.call(d,$,r,a)}),v=De(),S=()=>{a||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.createElement(tn,{scope:o,value:r,disabled:a,textId:v,isSelected:f,onItemTextChange:t.useCallback($=>{u(h=>{var g;return h||((g=$==null?void 0:$.textContent)!==null&&g!==void 0?g:"").trim()})},[])},t.createElement($e.ItemSlot,{scope:o,value:r,disabled:a,textValue:p},t.createElement(j.div,y({role:"option","aria-labelledby":v,"data-highlighted":x?"":void 0,"aria-selected":f&&x,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1},i,{ref:m,onFocus:N(i.onFocus,()=>b(!0)),onBlur:N(i.onBlur,()=>b(!1)),onPointerUp:N(i.onPointerUp,S),onPointerMove:N(i.onPointerMove,$=>{if(a){var h;(h=d.onItemLeave)===null||h===void 0||h.call(d)}else $.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(i.onPointerLeave,$=>{if($.currentTarget===document.activeElement){var h;(h=d.onItemLeave)===null||h===void 0||h.call(d)}}),onKeyDown:N(i.onKeyDown,$=>{var h;((h=d.searchRef)===null||h===void 0?void 0:h.current)!==""&&$.key===" "||(Do.includes($.key)&&S(),$.key===" "&&$.preventDefault())})}))))}),pe="SelectItemText",nn=t.forwardRef((e,n)=>{const{__scopeSelect:o,className:r,style:a,...c}=e,i=oe(pe,o),s=ne(pe,o),d=dt(pe,o),f=ko(pe,o),[p,u]=t.useState(null),x=k(n,$=>u($),d.onItemTextChange,$=>{var h;return(h=s.itemTextRefCallback)===null||h===void 0?void 0:h.call(s,$,d.value,d.disabled)}),b=p==null?void 0:p.textContent,m=t.useMemo(()=>t.createElement("option",{key:d.value,value:d.value,disabled:d.disabled},b),[d.disabled,d.value,b]),{onNativeOptionAdd:v,onNativeOptionRemove:S}=f;return te(()=>(v(m),()=>S(m)),[v,S,m]),t.createElement(t.Fragment,null,t.createElement(j.span,y({id:d.textId},c,{ref:x})),d.isSelected&&i.valueNode&&!i.valueNodeHasChildren?qe.createPortal(c.children,i.valueNode):null)}),rn="SelectItemIndicator",an=t.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return dt(rn,o).isSelected?t.createElement(j.span,y({"aria-hidden":!0},r,{ref:n})):null}),Be="SelectScrollUpButton",sn=t.forwardRef((e,n)=>{const o=ne(Be,e.__scopeSelect),r=Me(Be,e.__scopeSelect),[a,c]=t.useState(!1),i=k(n,r.onScrollButtonChange);return te(()=>{if(o.viewport&&o.isPositioned){let d=function(){const f=s.scrollTop>0;c(f)};const s=o.viewport;return d(),s.addEventListener("scroll",d),()=>s.removeEventListener("scroll",d)}},[o.viewport,o.isPositioned]),a?t.createElement(ut,y({},e,{ref:i,onAutoScroll:()=>{const{viewport:s,selectedItem:d}=o;s&&d&&(s.scrollTop=s.scrollTop-d.offsetHeight)}})):null}),He="SelectScrollDownButton",cn=t.forwardRef((e,n)=>{const o=ne(He,e.__scopeSelect),r=Me(He,e.__scopeSelect),[a,c]=t.useState(!1),i=k(n,r.onScrollButtonChange);return te(()=>{if(o.viewport&&o.isPositioned){let d=function(){const f=s.scrollHeight-s.clientHeight,p=Math.ceil(s.scrollTop)<f;c(p)};const s=o.viewport;return d(),s.addEventListener("scroll",d),()=>s.removeEventListener("scroll",d)}},[o.viewport,o.isPositioned]),a?t.createElement(ut,y({},e,{ref:i,onAutoScroll:()=>{const{viewport:s,selectedItem:d}=o;s&&d&&(s.scrollTop=s.scrollTop+d.offsetHeight)}})):null}),ut=t.forwardRef((e,n)=>{const{__scopeSelect:o,onAutoScroll:r,...a}=e,c=ne("SelectScrollButton",o),i=t.useRef(null),s=we(o),d=t.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return t.useEffect(()=>()=>d(),[d]),te(()=>{var f;const p=s().find(u=>u.ref.current===document.activeElement);p==null||(f=p.ref.current)===null||f===void 0||f.scrollIntoView({block:"nearest"})},[s]),t.createElement(j.div,y({"aria-hidden":!0},a,{ref:n,style:{flexShrink:0,...a.style},onPointerDown:N(a.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:N(a.onPointerMove,()=>{var f;(f=c.onItemLeave)===null||f===void 0||f.call(c),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:N(a.onPointerLeave,()=>{d()})}))}),ln=t.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return t.createElement(j.div,y({"aria-hidden":!0},r,{ref:n}))});function ft(e){return e===""||e===void 0}const pt=t.forwardRef((e,n)=>{const{value:o,...r}=e,a=t.useRef(null),c=k(n,a),i=lt(o);return t.useEffect(()=>{const s=a.current,d=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==o&&p){const u=new Event("change",{bubbles:!0});p.call(s,o),s.dispatchEvent(u)}},[i,o]),t.createElement(Ft,{asChild:!0},t.createElement("select",y({},r,{ref:c,defaultValue:o})))});pt.displayName="BubbleSelect";function mt(e){const n=zt(e),o=t.useRef(""),r=t.useRef(0),a=t.useCallback(i=>{const s=o.current+i;n(s),function d(f){o.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))}(s)},[n]),c=t.useCallback(()=>{o.current="",window.clearTimeout(r.current)},[]);return t.useEffect(()=>()=>window.clearTimeout(r.current),[]),[o,a,c]}function ht(e,n,o){const a=n.length>1&&Array.from(n).every(f=>f===n[0])?n[0]:n,c=o?e.indexOf(o):-1;let i=dn(e,Math.max(c,0));a.length===1&&(i=i.filter(f=>f!==o));const d=i.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==o?d:void 0}function dn(e,n){return e.map((o,r)=>e[(n+r)%e.length])}const un=Oo,gt=Lo,fn=Ho,pn=Ko,mn=Fo,vt=zo,hn=qo,gn=Qo,xt=en,$t=on,vn=nn,xn=an,wt=sn,bt=cn,St=ln,$n=un,Ke=gn,wn=fn,yt=t.forwardRef(({className:e,children:n,...o},r)=>l.jsxs(gt,{ref:r,className:A("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...o,children:[n,l.jsx(pn,{asChild:!0,children:l.jsx(at,{className:"h-4 w-4 opacity-50"})})]}));yt.displayName=gt.displayName;const Ct=t.forwardRef(({className:e,...n},o)=>l.jsx(wt,{ref:o,className:A("flex cursor-default items-center justify-center py-1",e),...n,children:l.jsx(Eo,{className:"h-4 w-4"})}));Ct.displayName=wt.displayName;const Et=t.forwardRef(({className:e,...n},o)=>l.jsx(bt,{ref:o,className:A("flex cursor-default items-center justify-center py-1",e),...n,children:l.jsx(at,{className:"h-4 w-4"})}));Et.displayName=bt.displayName;const Pt=t.forwardRef(({className:e,children:n,position:o="popper",...r},a)=>l.jsx(mn,{children:l.jsxs(vt,{ref:a,className:A("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:o,...r,children:[l.jsx(Ct,{}),l.jsx(hn,{className:A("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),l.jsx(Et,{})]})}));Pt.displayName=vt.displayName;const Te=t.forwardRef(({className:e,...n},o)=>l.jsx(xt,{ref:o,className:A("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...n}));Te.displayName=xt.displayName;const se=t.forwardRef(({className:e,children:n,...o},r)=>l.jsxs($t,{ref:r,className:A("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(xn,{children:l.jsx(co,{className:"h-4 w-4"})})}),l.jsx(vn,{children:n})]}));se.displayName=$t.displayName;const bn=t.forwardRef(({className:e,...n},o)=>l.jsx(St,{ref:o,className:A("-mx-1 my-1 h-px bg-muted",e),...n}));bn.displayName=St.displayName;const It=["PageUp","PageDown"],_t=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Rt={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},de="Slider",[Ne,Sn,yn]=nt(de),[Tt,Xn]=We(de,[yn]),[Cn,be]=Tt(de),En=t.forwardRef((e,n)=>{const{name:o,min:r=0,max:a=100,step:c=1,orientation:i="horizontal",disabled:s=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[r],value:p,onValueChange:u=()=>{},onValueCommit:x=()=>{},inverted:b=!1,...m}=e,[v,S]=t.useState(null),$=k(n,P=>S(P)),h=t.useRef(new Set),g=t.useRef(0),M=i==="horizontal",D=v?!!v.closest("form"):!0,J=M?Pn:In,[E=[],V]=Pe({prop:p,defaultProp:f,onChange:P=>{var C;(C=[...h.current][g.current])===null||C===void 0||C.focus(),u(P)}}),G=t.useRef(E);function ee(P){const C=kn(E,P);L(P,C)}function X(P){L(P,g.current)}function K(){const P=G.current[g.current];E[g.current]!==P&&x(E)}function L(P,C,{commit:O}={commit:!1}){const F=Bn(c),q=Hn(Math.round((P-r)/c)*c+r,F),B=ve(q,[r,a]);V((Y=[])=>{const z=Mn(Y,B,C);if(Ln(z,d*c)){g.current=z.indexOf(B);const re=String(z)!==String(Y);return re&&O&&x(z),re?z:Y}else return Y})}return t.createElement(Cn,{scope:e.__scopeSlider,disabled:s,min:r,max:a,valueIndexToChangeRef:g,thumbs:h.current,values:E,orientation:i},t.createElement(Ne.Provider,{scope:e.__scopeSlider},t.createElement(Ne.Slot,{scope:e.__scopeSlider},t.createElement(J,y({"aria-disabled":s,"data-disabled":s?"":void 0},m,{ref:$,onPointerDown:N(m.onPointerDown,()=>{s||(G.current=E)}),min:r,max:a,inverted:b,onSlideStart:s?void 0:ee,onSlideMove:s?void 0:X,onSlideEnd:s?void 0:K,onHomeKeyDown:()=>!s&&L(r,0,{commit:!0}),onEndKeyDown:()=>!s&&L(a,E.length-1,{commit:!0}),onStepKeyDown:({event:P,direction:C})=>{if(!s){const q=It.includes(P.key)||P.shiftKey&&_t.includes(P.key)?10:1,B=g.current,Y=E[B],z=c*q*C;L(Y+z,B,{commit:!0})}}})))),D&&E.map((P,C)=>t.createElement(jn,{key:C,name:o?o+(E.length>1?"[]":""):void 0,value:P})))}),[Nt,Dt]=Tt(de,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Pn=t.forwardRef((e,n)=>{const{min:o,max:r,dir:a,inverted:c,onSlideStart:i,onSlideMove:s,onSlideEnd:d,onStepKeyDown:f,...p}=e,[u,x]=t.useState(null),b=k(n,g=>x(g)),m=t.useRef(),v=rt(a),S=v==="ltr",$=S&&!c||!S&&c;function h(g){const M=m.current||u.getBoundingClientRect(),D=[0,M.width],E=Ae(D,$?[o,r]:[r,o]);return m.current=M,E(g-M.left)}return t.createElement(Nt,{scope:e.__scopeSlider,startEdge:$?"left":"right",endEdge:$?"right":"left",direction:$?1:-1,size:"width"},t.createElement(jt,y({dir:v,"data-orientation":"horizontal"},p,{ref:b,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:g=>{const M=h(g.clientX);i==null||i(M)},onSlideMove:g=>{const M=h(g.clientX);s==null||s(M)},onSlideEnd:()=>{m.current=void 0,d==null||d()},onStepKeyDown:g=>{const D=Rt[$?"from-left":"from-right"].includes(g.key);f==null||f({event:g,direction:D?-1:1})}})))}),In=t.forwardRef((e,n)=>{const{min:o,max:r,inverted:a,onSlideStart:c,onSlideMove:i,onSlideEnd:s,onStepKeyDown:d,...f}=e,p=t.useRef(null),u=k(n,p),x=t.useRef(),b=!a;function m(v){const S=x.current||p.current.getBoundingClientRect(),$=[0,S.height],g=Ae($,b?[r,o]:[o,r]);return x.current=S,g(v-S.top)}return t.createElement(Nt,{scope:e.__scopeSlider,startEdge:b?"bottom":"top",endEdge:b?"top":"bottom",size:"height",direction:b?1:-1},t.createElement(jt,y({"data-orientation":"vertical"},f,{ref:u,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const S=m(v.clientY);c==null||c(S)},onSlideMove:v=>{const S=m(v.clientY);i==null||i(S)},onSlideEnd:()=>{x.current=void 0,s==null||s()},onStepKeyDown:v=>{const $=Rt[b?"from-bottom":"from-top"].includes(v.key);d==null||d({event:v,direction:$?-1:1})}})))}),jt=t.forwardRef((e,n)=>{const{__scopeSlider:o,onSlideStart:r,onSlideMove:a,onSlideEnd:c,onHomeKeyDown:i,onEndKeyDown:s,onStepKeyDown:d,...f}=e,p=be(de,o);return t.createElement(j.span,y({},f,{ref:n,onKeyDown:N(e.onKeyDown,u=>{u.key==="Home"?(i(u),u.preventDefault()):u.key==="End"?(s(u),u.preventDefault()):It.concat(_t).includes(u.key)&&(d(u),u.preventDefault())}),onPointerDown:N(e.onPointerDown,u=>{const x=u.target;x.setPointerCapture(u.pointerId),u.preventDefault(),p.thumbs.has(x)?x.focus():r(u)}),onPointerMove:N(e.onPointerMove,u=>{u.target.hasPointerCapture(u.pointerId)&&a(u)}),onPointerUp:N(e.onPointerUp,u=>{const x=u.target;x.hasPointerCapture(u.pointerId)&&(x.releasePointerCapture(u.pointerId),c(u))})}))}),_n="SliderTrack",Rn=t.forwardRef((e,n)=>{const{__scopeSlider:o,...r}=e,a=be(_n,o);return t.createElement(j.span,y({"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation},r,{ref:n}))}),Fe="SliderRange",Tn=t.forwardRef((e,n)=>{const{__scopeSlider:o,...r}=e,a=be(Fe,o),c=Dt(Fe,o),i=t.useRef(null),s=k(n,i),d=a.values.length,f=a.values.map(x=>Mt(x,a.min,a.max)),p=d>1?Math.min(...f):0,u=100-Math.max(...f);return t.createElement(j.span,y({"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0},r,{ref:s,style:{...e.style,[c.startEdge]:p+"%",[c.endEdge]:u+"%"}}))}),ze="SliderThumb",Nn=t.forwardRef((e,n)=>{const o=Sn(e.__scopeSlider),[r,a]=t.useState(null),c=k(n,s=>a(s)),i=t.useMemo(()=>r?o().findIndex(s=>s.ref.current===r):-1,[o,r]);return t.createElement(Dn,y({},e,{ref:c,index:i}))}),Dn=t.forwardRef((e,n)=>{const{__scopeSlider:o,index:r,...a}=e,c=be(ze,o),i=Dt(ze,o),[s,d]=t.useState(null),f=k(n,S=>d(S)),p=Wt(s),u=c.values[r],x=u===void 0?0:Mt(u,c.min,c.max),b=An(r,c.values.length),m=p==null?void 0:p[i.size],v=m?On(m,x,i.direction):0;return t.useEffect(()=>{if(s)return c.thumbs.add(s),()=>{c.thumbs.delete(s)}},[s,c.thumbs]),t.createElement("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:`calc(${x}% + ${v}px)`}},t.createElement(Ne.ItemSlot,{scope:e.__scopeSlider},t.createElement(j.span,y({role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":c.min,"aria-valuenow":u,"aria-valuemax":c.max,"aria-orientation":c.orientation,"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,tabIndex:c.disabled?void 0:0},a,{ref:f,style:u===void 0?{display:"none"}:e.style,onFocus:N(e.onFocus,()=>{c.valueIndexToChangeRef.current=r})}))))}),jn=e=>{const{value:n,...o}=e,r=t.useRef(null),a=lt(n);return t.useEffect(()=>{const c=r.current,i=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(i,"value").set;if(a!==n&&d){const f=new Event("input",{bubbles:!0});d.call(c,n),c.dispatchEvent(f)}},[a,n]),t.createElement("input",y({style:{display:"none"}},o,{ref:r,defaultValue:n}))};function Mn(e=[],n,o){const r=[...e];return r[o]=n,r.sort((a,c)=>a-c)}function Mt(e,n,o){const c=100/(o-n)*(e-n);return ve(c,[0,100])}function An(e,n){return n>2?`Value ${e+1} of ${n}`:n===2?["Minimum","Maximum"][e]:void 0}function kn(e,n){if(e.length===1)return 0;const o=e.map(a=>Math.abs(a-n)),r=Math.min(...o);return o.indexOf(r)}function On(e,n,o){const r=e/2,c=Ae([0,50],[0,r]);return(r-c(n)*o)*o}function Vn(e){return e.slice(0,-1).map((n,o)=>e[o+1]-n)}function Ln(e,n){if(n>0){const o=Vn(e);return Math.min(...o)>=n}return!0}function Ae(e,n){return o=>{if(e[0]===e[1]||n[0]===n[1])return n[0];const r=(n[1]-n[0])/(e[1]-e[0]);return n[0]+r*(o-e[0])}}function Bn(e){return(String(e).split(".")[1]||"").length}function Hn(e,n){const o=Math.pow(10,n);return Math.round(e*o)/o}const At=En,Kn=Rn,Fn=Tn,zn=Nn,kt=t.forwardRef(({className:e,...n},o)=>l.jsxs(At,{ref:o,className:A("relative flex w-full touch-none select-none items-center",e),...n,children:[l.jsx(Kn,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:l.jsx(Fn,{className:"absolute h-full bg-primary"})}),l.jsx(zn,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));kt.displayName=At.displayName;function Un({trigger:e}){const{isPending:n,isError:o,error:r,data:a}=Gt({queryKey:["ollama-models"],queryFn:_o}),[c,i]=me(fo),[s,d]=me(po),[f,p]=me(mo);return t.useEffect(()=>{r&&console.error("Error fetching ollama models",r)},[r]),l.jsxs(Qe,{children:[l.jsx(lo,{asChild:!0,children:e}),l.jsxs(Je,{className:"max-w-xl",children:[l.jsxs(et,{children:[l.jsx(tt,{children:"Settings"}),l.jsx(Ie,{children:"Make changes to your settings or logout"})]}),l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[l.jsx(he,{className:"text-right",htmlFor:"model",children:"Model"}),l.jsxs($n,{value:c,onValueChange:u=>{i(u)},children:[l.jsx(yt,{className:"min-w-[200px]",children:l.jsx(wn,{placeholder:"Switch models"})}),l.jsxs(Pt,{children:[l.jsxs(Ke,{children:[l.jsx(Te,{children:"OpenAI"}),l.jsx(se,{value:"gpt-3.5-turbo",children:"GPT-3.5 Turbo"}),l.jsx(se,{value:"gpt-4-turbo-preview",children:"GPT-4 Turbo"})]}),l.jsxs(Ke,{children:[n||a&&a.length>0?l.jsx(Te,{children:"Ollama"}):void 0,!!n&&l.jsx(se,{disabled:!0,value:"",children:"Loading..."}),!!o&&l.jsx(se,{disabled:!0,value:"",children:"Unable to load Ollama models, see console"}),!!a&&a.map(u=>l.jsx(se,{value:`ollama/${u.name}`,children:u.name},u.digest))]})]})]})]}),l.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[l.jsx(he,{className:"text-right",htmlFor:"prompt",children:"System Prompt"}),l.jsx(io,{className:"col-span-3",id:"prompt",onChange:u=>d(u.target.value),value:s})]}),l.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[l.jsx(he,{className:"text-right",htmlFor:"temperature",children:"Temperature"}),l.jsx(kt,{min:0,max:1,step:.05,onValueChange:u=>p(u[0]),value:[f],className:"col-span-3",id:"temperature"})]}),l.jsx("div",{className:"mt-3 grid grid-cols-4 items-center gap-4",children:l.jsxs("div",{className:"col-start-4 flex justify-end",children:[l.jsx(Q,{variant:"secondary",onClick:()=>{fetch("/v1/session",{method:"DELETE"}).then(()=>document.location.reload()).catch(u=>console.error(u))},children:"Logout"}),l.jsx(uo,{asChild:!0,children:l.jsx(Q,{type:"button",className:"ml-2",children:"Update"})})]})})]})]})]})}function Zn(){const e=wo(`(min-width: ${yo}px)`),[n,o]=t.useState(!e),r=Ue(),[a]=me(Ze),c=qt(),i=Xe(ge({id:c.id??"new"})),s=ho();t.useEffect(()=>{c.id===void 0&&(console.log("redirecting"),r("/ai/new"))},[c.id,r]),t.useEffect(()=>{o(!e)},[e,o]);const d=new Date,f=new Date(d.getTime()-24*60*60*1e3),p=new Date(d.getTime()-7*24*60*60*1e3);let u="";return l.jsxs("div",{className:"mobile-safe-container flex overflow-hidden bg-secondary",children:[l.jsx(Co,{title:i.name??"Create a new Elemint"}),l.jsx(Io,{}),l.jsxs("div",{className:A(`${n?"w-0":"w-[300px]"} flex h-screen flex-none flex-col border-r border-input bg-zinc-300 transition-all duration-300 ease-in-out dark:bg-zinc-900`,!e&&!n&&"absolute z-50"),children:[l.jsxs("div",{className:"flex items-center pb-2 pl-4",children:[l.jsx("h2",{className:`${n?"opacity-0":"opacity-100"} text-sm text-secondary-foreground transition-all duration-300`,children:"History"}),l.jsx(Q,{asChild:!0,size:"icon",variant:"ghost",className:"ml-auto inline-flex p-2 hover:bg-inherit",children:l.jsx("a",{"aria-label":"GitHub",rel:"noreferrer",target:"_blank",href:"https://github.com/wandb/openui",children:l.jsx(ot,{className:"h-5 w-5"})})}),l.jsx(Un,{trigger:l.jsx(Q,{className:A("inline-flex p-2 hover:scale-110 hover:bg-inherit",!n&&"-ml-4"),variant:"ghost",size:"icon",children:l.jsx(go,{className:"h-4 w-4"})})}),l.jsx(Q,{onClick:()=>{r("/ai/new"),e||o(!0)},className:A("inline-flex p-2 hover:scale-110 hover:bg-inherit",!n&&"-ml-4"),variant:"ghost",size:"icon",children:l.jsx(vo,{className:"inline-block h-4 w-4"})})]}),l.jsx("div",{className:"flex h-full max-h-full flex-col items-start justify-start overflow-y-auto overflow-x-hidden p-3",children:a.map(x=>{let b;const m=s.get(ge({id:x}));return m.createdAt&&m.createdAt>=f&&(u===""||u==="Today")?(b=u==="Today"?void 0:"Today",u="Today"):m.createdAt&&m.createdAt>=p&&u==="Today"?(b="Previous 7 days",u=b):u==="Previous 7 days"&&m.createdAt&&m.createdAt<=p?(b="Previous 30 days",u=b):b=void 0,l.jsx(st,{id:x,label:b,active:c.id===x,collapsed:n},x)})}),l.jsx(Q,{onClick:()=>{o(!n)},className:A("ml-auto inline-flex p-2 hover:scale-110 hover:bg-secondary",n&&"absolute -left-2 top-[90px] z-50 bg-secondary",!e&&"mb-20"),variant:"ghost",size:"icon",children:n?l.jsx(xo,{className:"inline-block h-4 w-4"}):l.jsx($o,{className:"inline-block h-4 w-4"})})]}),l.jsx("div",{className:"mobile-safe-container relative flex-1 overflow-hidden",children:l.jsx(bo,{renderError:x=>l.jsx(So,{error:x}),children:l.jsx(Yt,{})})})]})}export{Zn as default};
|
openui/dist/assets/standalone-dIyWdECw.js
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var xu=Object.defineProperty;var _u=(e,t,u)=>t in e?xu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[t]=u;var ge=(e,t,u)=>(_u(e,typeof t!="symbol"?t+"":t,u),u);var Ou=Object.create,we=Object.defineProperty,Nu=Object.getOwnPropertyDescriptor,ju=Object.getOwnPropertyNames,Pu=Object.getPrototypeOf,Tu=Object.prototype.hasOwnProperty,Iu=(e,t)=>()=>(e&&(t=e(e=0)),t),Ae=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ke=(e,t)=>{for(var u in t)we(e,u,{get:t[u],enumerable:!0})},Tt=(e,t,u,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ju(t))!Tu.call(e,n)&&n!==u&&we(e,n,{get:()=>t[n],enumerable:!(r=Nu(t,n))||r.enumerable});return e},pe=(e,t,u)=>(u=e!=null?Ou(Pu(e)):{},Tt(t||!e||!e.__esModule?we(u,"default",{value:e,enumerable:!0}):u,e)),$u=e=>Tt(we({},"__esModule",{value:!0}),e),Lu=(e,t,u)=>{if(!t.has(e))throw TypeError("Cannot "+u)},st=(e,t,u)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,u)},ce=(e,t,u)=>(Lu(e,t,"access private method"),u),Mu=Ae(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(){}t.prototype={diff:function(n,D){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=o.callback;typeof o=="function"&&(i=o,o={}),this.options=o;var a=this;function s(E){return i?(setTimeout(function(){i(void 0,E)},0),!0):E}n=this.castInput(n),D=this.castInput(D),n=this.removeEmpty(this.tokenize(n)),D=this.removeEmpty(this.tokenize(D));var l=D.length,F=n.length,c=1,f=l+F;o.maxEditLength&&(f=Math.min(f,o.maxEditLength));var d=[{newPos:-1,components:[]}],p=this.extractCommon(d[0],D,n,0);if(d[0].newPos+1>=l&&p+1>=F)return s([{value:this.join(D),count:D.length}]);function h(){for(var E=-1*c;E<=c;E+=2){var C=void 0,y=d[E-1],m=d[E+1],b=(m?m.newPos:0)-E;y&&(d[E-1]=void 0);var v=y&&y.newPos+1<l,k=m&&0<=b&&b<F;if(!v&&!k){d[E]=void 0;continue}if(!v||k&&y.newPos<m.newPos?(C=r(m),a.pushComponent(C.components,void 0,!0)):(C=y,C.newPos++,a.pushComponent(C.components,!0,void 0)),b=a.extractCommon(C,D,n,E),C.newPos+1>=l&&b+1>=F)return s(u(a,C.components,D,n,a.useLongestToken));d[E]=C}c++}if(i)(function E(){setTimeout(function(){if(c>f)return i();h()||E()},0)})();else for(;c<=f;){var g=h();if(g)return g}},pushComponent:function(n,D,o){var i=n[n.length-1];i&&i.added===D&&i.removed===o?n[n.length-1]={count:i.count+1,added:D,removed:o}:n.push({count:1,added:D,removed:o})},extractCommon:function(n,D,o,i){for(var a=D.length,s=o.length,l=n.newPos,F=l-i,c=0;l+1<a&&F+1<s&&this.equals(D[l+1],o[F+1]);)l++,F++,c++;return c&&n.components.push({count:c}),n.newPos=l,F},equals:function(n,D){return this.options.comparator?this.options.comparator(n,D):n===D||this.options.ignoreCase&&n.toLowerCase()===D.toLowerCase()},removeEmpty:function(n){for(var D=[],o=0;o<n.length;o++)n[o]&&D.push(n[o]);return D},castInput:function(n){return n},tokenize:function(n){return n.split("")},join:function(n){return n.join("")}};function u(n,D,o,i,a){for(var s=0,l=D.length,F=0,c=0;s<l;s++){var f=D[s];if(f.removed){if(f.value=n.join(i.slice(c,c+f.count)),c+=f.count,s&&D[s-1].added){var d=D[s-1];D[s-1]=D[s],D[s]=d}}else{if(!f.added&&a){var p=o.slice(F,F+f.count);p=p.map(function(g,E){var C=i[c+E];return C.length>g.length?C:g}),f.value=n.join(p)}else f.value=n.join(o.slice(F,F+f.count));F+=f.count,f.added||(c+=f.count)}}var h=D[l-1];return l>1&&typeof h.value=="string"&&(h.added||h.removed)&&n.equals("",h.value)&&(D[l-2].value+=h.value,D.pop()),D}function r(n){return{newPos:n.newPos,components:n.components.slice(0)}}}),Wu=Ae(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.diffArrays=n,e.arrayDiff=void 0;var t=u(Mu());function u(D){return D&&D.__esModule?D:{default:D}}var r=new t.default;e.arrayDiff=r,r.tokenize=function(D){return D.slice()},r.join=r.removeEmpty=function(D){return D};function n(D,o,i){return r.diff(D,o,i)}}),Se=Ae((e,t)=>{var u=new Proxy(String,{get:()=>u});t.exports=u}),It={};ke(It,{default:()=>Lt,shouldHighlight:()=>$t});var $t,Lt,Ru=Iu(()=>{$t=()=>!1,Lt=String}),Vu=Ae(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.codeFrameColumns=F,e.default=c;var t=(Ru(),$u(It)),u=n(Se(),!0);function r(f){if(typeof WeakMap!="function")return null;var d=new WeakMap,p=new WeakMap;return(r=function(h){return h?p:d})(f)}function n(f,d){if(!d&&f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var p=r(d);if(p&&p.has(f))return p.get(f);var h={__proto__:null},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in f)if(E!=="default"&&Object.prototype.hasOwnProperty.call(f,E)){var C=g?Object.getOwnPropertyDescriptor(f,E):null;C&&(C.get||C.set)?Object.defineProperty(h,E,C):h[E]=f[E]}return h.default=f,p&&p.set(f,h),h}var D;function o(f){return f?(D!=null||(D=new u.default.constructor({enabled:!0,level:1})),D):u.default}var i=!1;function a(f){return{gutter:f.grey,marker:f.red.bold,message:f.red.bold}}var s=/\r\n|[\n\r\u2028\u2029]/;function l(f,d,p){let h=Object.assign({column:0,line:-1},f.start),g=Object.assign({},h,f.end),{linesAbove:E=2,linesBelow:C=3}=p||{},y=h.line,m=h.column,b=g.line,v=g.column,k=Math.max(y-(E+1),0),G=Math.min(d.length,b+C);y===-1&&(k=0),b===-1&&(G=d.length);let z=b-y,A={};if(z)for(let j=0;j<=z;j++){let P=j+y;if(!m)A[P]=!0;else if(j===0){let Y=d[P-1].length;A[P]=[m,Y-m+1]}else if(j===z)A[P]=[0,v];else{let Y=d[P-j].length;A[P]=[0,Y]}}else m===v?m?A[y]=[m,0]:A[y]=!0:A[y]=[m,v-m];return{start:k,end:G,markerLines:A}}function F(f,d,p={}){let h=(p.highlightCode||p.forceColor)&&(0,t.shouldHighlight)(p),g=o(p.forceColor),E=a(g),C=(A,j)=>h?A(j):j,y=f.split(s),{start:m,end:b,markerLines:v}=l(d,y,p),k=d.start&&typeof d.start.column=="number",G=String(b).length,z=(h?(0,t.default)(f,p):f).split(s,b).slice(m,b).map((A,j)=>{let P=m+1+j,Y=` ${` ${P}`.slice(-G)} |`,Ce=v[P],Au=!v[P+1];if(Ce){let Te="";if(Array.isArray(Ce)){let ku=A.slice(0,Math.max(Ce[0]-1,0)).replace(/[^\t]/g," "),Su=Ce[1]||1;Te=[`
|
2 |
+
`,C(E.gutter,Y.replace(/\d/g," "))," ",ku,C(E.marker,"^").repeat(Su)].join(""),Au&&p.message&&(Te+=" "+C(E.message,p.message))}return[C(E.marker,">"),C(E.gutter,Y),A.length>0?` ${A}`:"",Te].join("")}else return` ${C(E.gutter,Y)}${A.length>0?` ${A}`:""}`}).join(`
|
3 |
+
`);return p.message&&!k&&(z=`${" ".repeat(G+1)}${p.message}
|
4 |
+
${z}`),h?g.reset(z):z}function c(f,d,p,h={}){if(!i){i=!0;let g="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";{let E=new Error(g);E.name="DeprecationWarning",console.warn(new Error(g))}}return p=Math.max(p,0),F(f,{start:{column:p,line:d}},h)}}),Mt={};ke(Mt,{__debug:()=>MD,check:()=>$D,doc:()=>Bu,format:()=>wu,formatWithCursor:()=>bu,getSupportInfo:()=>LD,util:()=>vu,version:()=>ID});var qu=(e,t,u,r)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(u,r):u.global?t.replace(u,r):t.split(u).join(r)},xe=qu,zu=pe(Wu(),1),te="string",J="array",ue="cursor",L="indent",M="align",W="trim",x="group",O="fill",_="if-break",R="indent-if-break",V="line-suffix",q="line-suffix-boundary",w="line",I="label",N="break-parent",Wt=new Set([ue,L,M,W,x,O,_,R,V,q,w,I,N]);function Hu(e){if(typeof e=="string")return te;if(Array.isArray(e))return J;if(!e)return;let{type:t}=e;if(Wt.has(t))return t}var re=Hu,Ju=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function Uu(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}',
|
5 |
+
Expected it to be 'string' or 'object'.`;if(re(e))throw new Error("doc is valid.");let u=Object.prototype.toString.call(e);if(u!=="[object Object]")return`Unexpected doc '${u}'.`;let r=Ju([...Wt].map(n=>`'${n}'`));return`Unexpected doc.type '${e.type}'.
|
6 |
+
Expected it to be ${r}.`}var Ku=class extends Error{constructor(t){super(Uu(t));ge(this,"name","InvalidDocError");this.doc=t}},ae=Ku,lt={};function Gu(e,t,u,r){let n=[e];for(;n.length>0;){let D=n.pop();if(D===lt){u(n.pop());continue}u&&n.push(D,lt);let o=re(D);if(!o)throw new ae(D);if((t==null?void 0:t(D))!==!1)switch(o){case J:case O:{let i=o===J?D:D.parts;for(let a=i.length,s=a-1;s>=0;--s)n.push(i[s]);break}case _:n.push(D.flatContents,D.breakContents);break;case x:if(r&&D.expandedStates)for(let i=D.expandedStates.length,a=i-1;a>=0;--a)n.push(D.expandedStates[a]);else n.push(D.contents);break;case M:case L:case R:case I:case V:n.push(D.contents);break;case te:case ue:case W:case q:case w:case N:break;default:throw new ae(D)}}}var Ye=Gu,Yu=()=>{},Zu=Yu;function be(e){return{type:L,contents:e}}function se(e,t){return{type:M,contents:t,n:e}}function Rt(e,t={}){return Zu(t.expandedStates),{type:x,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Qu(e){return se(Number.NEGATIVE_INFINITY,e)}function Xu(e){return se({type:"root"},e)}function er(e){return se(-1,e)}function tr(e,t){return Rt(e[0],{...t,expandedStates:e})}function Vt(e){return{type:O,parts:e}}function ur(e,t="",u={}){return{type:_,breakContents:e,flatContents:t,groupId:u.groupId}}function rr(e,t){return{type:R,contents:e,groupId:t.groupId,negate:t.negate}}function Ve(e){return{type:V,contents:e}}var nr={type:q},_e={type:N},Dr={type:W},Ze={type:w,hard:!0},qt={type:w,hard:!0,literal:!0},zt={type:w},or={type:w,soft:!0},X=[Ze,_e],Ht=[qt,_e],qe={type:ue};function Jt(e,t){let u=[];for(let r=0;r<t.length;r++)r!==0&&u.push(e),u.push(t[r]);return u}function Ut(e,t,u){let r=e;if(t>0){for(let n=0;n<Math.floor(t/u);++n)r=be(r);r=se(t%u,r),r=se(Number.NEGATIVE_INFINITY,r)}return r}function ir(e,t){return e?{type:I,label:e,contents:t}:t}var ar=(e,t,u)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[u<0?t.length+u:u]:t.at(u)},B=ar;function sr(e){let t=e.indexOf("\r");return t>=0?e.charAt(t+1)===`
|
7 |
+
`?"crlf":"cr":"lf"}function Qe(e){switch(e){case"cr":return"\r";case"crlf":return`\r
|
8 |
+
`;default:return`
|
9 |
+
`}}function Kt(e,t){let u;switch(t){case`
|
10 |
+
`:u=/\n/g;break;case"\r":u=/\r/g;break;case`\r
|
11 |
+
`:u=/\r\n/g;break;default:throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`)}let r=e.match(u);return r?r.length:0}function lr(e){return xe(!1,e,/\r\n?/g,`
|
12 |
+
`)}var cr=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function fr(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function dr(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var Fr=e=>!(fr(e)||dr(e)),pr=/[^\x20-\x7F]/;function hr(e){if(!e)return 0;if(!pr.test(e))return e.length;e=e.replace(cr()," ");let t=0;for(let u of e){let r=u.codePointAt(0);r<=31||r>=127&&r<=159||r>=768&&r<=879||(t+=Fr(r)?1:2)}return t}var Xe=hr,Er=e=>{if(Array.isArray(e))return e;if(e.type!==O)throw new Error(`Expect doc to be 'array' or '${O}'.`);return e.parts};function Oe(e,t){if(typeof e=="string")return t(e);let u=new Map;return r(e);function r(D){if(u.has(D))return u.get(D);let o=n(D);return u.set(D,o),o}function n(D){switch(re(D)){case J:return t(D.map(r));case O:return t({...D,parts:D.parts.map(r)});case _:return t({...D,breakContents:r(D.breakContents),flatContents:r(D.flatContents)});case x:{let{expandedStates:o,contents:i}=D;return o?(o=o.map(r),i=o[0]):i=r(i),t({...D,contents:i,expandedStates:o})}case M:case L:case R:case I:case V:return t({...D,contents:r(D.contents)});case te:case ue:case W:case q:case w:case N:return t(D);default:throw new ae(D)}}}function et(e,t,u){let r=u,n=!1;function D(o){if(n)return!1;let i=t(o);i!==void 0&&(n=!0,r=i)}return Ye(e,D),r}function Cr(e){if(e.type===x&&e.break||e.type===w&&e.hard||e.type===N)return!0}function gr(e){return et(e,Cr,!1)}function ct(e){if(e.length>0){let t=B(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function mr(e){let t=new Set,u=[];function r(D){if(D.type===N&&ct(u),D.type===x){if(u.push(D),t.has(D))return!1;t.add(D)}}function n(D){D.type===x&&u.pop().break&&ct(u)}Ye(e,r,n,!0)}function yr(e){return e.type===w&&!e.hard?e.soft?"":" ":e.type===_?e.flatContents:e}function vr(e){return Oe(e,yr)}function ft(e){for(e=[...e];e.length>=2&&B(!1,e,-2).type===w&&B(!1,e,-1).type===N;)e.length-=2;if(e.length>0){let t=de(B(!1,e,-1));e[e.length-1]=t}return e}function de(e){switch(re(e)){case M:case L:case R:case x:case V:case I:{let t=de(e.contents);return{...e,contents:t}}case _:return{...e,breakContents:de(e.breakContents),flatContents:de(e.flatContents)};case O:return{...e,parts:ft(e.parts)};case J:return ft(e);case te:return e.replace(/[\n\r]*$/,"");case ue:case W:case q:case w:case N:break;default:throw new ae(e)}return e}function Gt(e){return de(br(e))}function Br(e){switch(re(e)){case O:if(e.parts.every(t=>t===""))return"";break;case x:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===x&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case M:case L:case R:case V:if(!e.contents)return"";break;case _:if(!e.flatContents&&!e.breakContents)return"";break;case J:{let t=[];for(let u of e){if(!u)continue;let[r,...n]=Array.isArray(u)?u:[u];typeof r=="string"&&typeof B(!1,t,-1)=="string"?t[t.length-1]+=r:t.push(r),t.push(...n)}return t.length===0?"":t.length===1?t[0]:t}case te:case ue:case W:case q:case w:case I:case N:break;default:throw new ae(e)}return e}function br(e){return Oe(e,t=>Br(t))}function wr(e,t=Ht){return Oe(e,u=>typeof u=="string"?Jt(t,u.split(`
|
13 |
+
`)):u)}function Ar(e){if(e.type===w)return!0}function kr(e){return et(e,Ar,!1)}function Yt(e,t){return e.type===I?{...e,contents:t(e.contents)}:t(e)}var S=Symbol("MODE_BREAK"),T=Symbol("MODE_FLAT"),Fe=Symbol("cursor");function Zt(){return{value:"",length:0,queue:[]}}function Sr(e,t){return ze(e,{type:"indent"},t)}function xr(e,t,u){return t===Number.NEGATIVE_INFINITY?e.root||Zt():t<0?ze(e,{type:"dedent"},u):t?t.type==="root"?{...e,root:e}:ze(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},u):e}function ze(e,t,u){let r=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],n="",D=0,o=0,i=0;for(let d of r)switch(d.type){case"indent":l(),u.useTabs?a(1):s(u.tabWidth);break;case"stringAlign":l(),n+=d.n,D+=d.n.length;break;case"numberAlign":o+=1,i+=d.n;break;default:throw new Error(`Unexpected type '${d.type}'`)}return c(),{...e,value:n,length:D,queue:r};function a(d){n+=" ".repeat(d),D+=u.tabWidth*d}function s(d){n+=" ".repeat(d),D+=d}function l(){u.useTabs?F():c()}function F(){o>0&&a(o),f()}function c(){i>0&&s(i),f()}function f(){o=0,i=0}}function He(e){let t=0,u=0,r=e.length;e:for(;r--;){let n=e[r];if(n===Fe){u++;continue}for(let D=n.length-1;D>=0;D--){let o=n[D];if(o===" "||o===" ")t++;else{e[r]=n.slice(0,D+1);break e}}}if(t>0||u>0)for(e.length=r+1;u-- >0;)e.push(Fe);return t}function me(e,t,u,r,n,D){if(u===Number.POSITIVE_INFINITY)return!0;let o=t.length,i=[e],a=[];for(;u>=0;){if(i.length===0){if(o===0)return!0;i.push(t[--o]);continue}let{mode:s,doc:l}=i.pop();switch(re(l)){case te:a.push(l),u-=Xe(l);break;case J:case O:{let F=Er(l);for(let c=F.length-1;c>=0;c--)i.push({mode:s,doc:F[c]});break}case L:case M:case R:case I:i.push({mode:s,doc:l.contents});break;case W:u+=He(a);break;case x:{if(D&&l.break)return!1;let F=l.break?S:s,c=l.expandedStates&&F===S?B(!1,l.expandedStates,-1):l.contents;i.push({mode:F,doc:c});break}case _:{let F=(l.groupId?n[l.groupId]||T:s)===S?l.breakContents:l.flatContents;F&&i.push({mode:s,doc:F});break}case w:if(s===S||l.hard)return!0;l.soft||(a.push(" "),u--);break;case V:r=!0;break;case q:if(r)return!1;break}}return!1}function Ne(e,t){let u={},r=t.printWidth,n=Qe(t.endOfLine),D=0,o=[{ind:Zt(),mode:S,doc:e}],i=[],a=!1,s=[],l=0;for(mr(e);o.length>0;){let{ind:c,mode:f,doc:d}=o.pop();switch(re(d)){case te:{let p=n!==`
|
14 |
+
`?xe(!1,d,`
|
15 |
+
`,n):d;i.push(p),o.length>0&&(D+=Xe(p));break}case J:for(let p=d.length-1;p>=0;p--)o.push({ind:c,mode:f,doc:d[p]});break;case ue:if(l>=2)throw new Error("There are too many 'cursor' in doc.");i.push(Fe),l++;break;case L:o.push({ind:Sr(c,t),mode:f,doc:d.contents});break;case M:o.push({ind:xr(c,d.n,t),mode:f,doc:d.contents});break;case W:D-=He(i);break;case x:switch(f){case T:if(!a){o.push({ind:c,mode:d.break?S:T,doc:d.contents});break}case S:{a=!1;let p={ind:c,mode:T,doc:d.contents},h=r-D,g=s.length>0;if(!d.break&&me(p,o,h,g,u))o.push(p);else if(d.expandedStates){let E=B(!1,d.expandedStates,-1);if(d.break){o.push({ind:c,mode:S,doc:E});break}else for(let C=1;C<d.expandedStates.length+1;C++)if(C>=d.expandedStates.length){o.push({ind:c,mode:S,doc:E});break}else{let y=d.expandedStates[C],m={ind:c,mode:T,doc:y};if(me(m,o,h,g,u)){o.push(m);break}}}else o.push({ind:c,mode:S,doc:d.contents});break}}d.id&&(u[d.id]=B(!1,o,-1).mode);break;case O:{let p=r-D,{parts:h}=d;if(h.length===0)break;let[g,E]=h,C={ind:c,mode:T,doc:g},y={ind:c,mode:S,doc:g},m=me(C,[],p,s.length>0,u,!0);if(h.length===1){m?o.push(C):o.push(y);break}let b={ind:c,mode:T,doc:E},v={ind:c,mode:S,doc:E};if(h.length===2){m?o.push(b,C):o.push(v,y);break}h.splice(0,2);let k={ind:c,mode:f,doc:Vt(h)},G=h[0];me({ind:c,mode:T,doc:[g,E,G]},[],p,s.length>0,u,!0)?o.push(k,b,C):m?o.push(k,v,C):o.push(k,v,y);break}case _:case R:{let p=d.groupId?u[d.groupId]:f;if(p===S){let h=d.type===_?d.breakContents:d.negate?d.contents:be(d.contents);h&&o.push({ind:c,mode:f,doc:h})}if(p===T){let h=d.type===_?d.flatContents:d.negate?be(d.contents):d.contents;h&&o.push({ind:c,mode:f,doc:h})}break}case V:s.push({ind:c,mode:f,doc:d.contents});break;case q:s.length>0&&o.push({ind:c,mode:f,doc:Ze});break;case w:switch(f){case T:if(d.hard)a=!0;else{d.soft||(i.push(" "),D+=1);break}case S:if(s.length>0){o.push({ind:c,mode:f,doc:d},...s.reverse()),s.length=0;break}d.literal?c.root?(i.push(n,c.root.value),D=c.root.length):(i.push(n),D=0):(D-=He(i),i.push(n+c.value),D=c.length);break}break;case I:o.push({ind:c,mode:f,doc:d.contents});break;case N:break;default:throw new ae(d)}o.length===0&&s.length>0&&(o.push(...s.reverse()),s.length=0)}let F=i.indexOf(Fe);if(F!==-1){let c=i.indexOf(Fe,F+1),f=i.slice(0,F).join(""),d=i.slice(F+1,c).join(""),p=i.slice(c+1).join("");return{formatted:f+d+p,cursorNodeStart:f.length,cursorNodeText:d}}return{formatted:i.join("")}}function $(e){var t;if(!e)return"";if(Array.isArray(e)){let u=[];for(let r of e)if(Array.isArray(r))u.push(...$(r));else{let n=$(r);n!==""&&u.push(n)}return u}return e.type===_?{...e,breakContents:$(e.breakContents),flatContents:$(e.flatContents)}:e.type===x?{...e,contents:$(e.contents),expandedStates:(t=e.expandedStates)==null?void 0:t.map($)}:e.type===O?{type:"fill",parts:e.parts.map($)}:e.contents?{...e,contents:$(e.contents)}:e}function _r(e){let t=Object.create(null),u=new Set;return r($(e));function r(D,o,i){var a,s;if(typeof D=="string")return JSON.stringify(D);if(Array.isArray(D)){let l=D.map(r).filter(Boolean);return l.length===1?l[0]:`[${l.join(", ")}]`}if(D.type===w){let l=((a=i==null?void 0:i[o+1])==null?void 0:a.type)===N;return D.literal?l?"literalline":"literallineWithoutBreakParent":D.hard?l?"hardline":"hardlineWithoutBreakParent":D.soft?"softline":"line"}if(D.type===N)return((s=i==null?void 0:i[o-1])==null?void 0:s.type)===w&&i[o-1].hard?void 0:"breakParent";if(D.type===W)return"trim";if(D.type===L)return"indent("+r(D.contents)+")";if(D.type===M)return D.n===Number.NEGATIVE_INFINITY?"dedentToRoot("+r(D.contents)+")":D.n<0?"dedent("+r(D.contents)+")":D.n.type==="root"?"markAsRoot("+r(D.contents)+")":"align("+JSON.stringify(D.n)+", "+r(D.contents)+")";if(D.type===_)return"ifBreak("+r(D.breakContents)+(D.flatContents?", "+r(D.flatContents):"")+(D.groupId?(D.flatContents?"":', ""')+`, { groupId: ${n(D.groupId)} }`:"")+")";if(D.type===R){let l=[];D.negate&&l.push("negate: true"),D.groupId&&l.push(`groupId: ${n(D.groupId)}`);let F=l.length>0?`, { ${l.join(", ")} }`:"";return`indentIfBreak(${r(D.contents)}${F})`}if(D.type===x){let l=[];D.break&&D.break!=="propagated"&&l.push("shouldBreak: true"),D.id&&l.push(`id: ${n(D.id)}`);let F=l.length>0?`, { ${l.join(", ")} }`:"";return D.expandedStates?`conditionalGroup([${D.expandedStates.map(c=>r(c)).join(",")}]${F})`:`group(${r(D.contents)}${F})`}if(D.type===O)return`fill([${D.parts.map(l=>r(l)).join(", ")}])`;if(D.type===V)return"lineSuffix("+r(D.contents)+")";if(D.type===q)return"lineSuffixBoundary";if(D.type===I)return`label(${JSON.stringify(D.label)}, ${r(D.contents)})`;throw new Error("Unknown doc type "+D.type)}function n(D){if(typeof D!="symbol")return JSON.stringify(String(D));if(D in t)return t[D];let o=D.description||"symbol";for(let i=0;;i++){let a=o+(i>0?` #${i}`:"");if(!u.has(a))return u.add(a),t[D]=`Symbol.for(${JSON.stringify(a)})`}}}function Or(e,t,u=0){let r=0;for(let n=u;n<e.length;++n)e[n]===" "?r=r+t-r%t:r++;return r}var tt=Or,Qt=class extends Error{constructor(){super(...arguments);ge(this,"name","ConfigError")}},dt=class extends Error{constructor(){super(...arguments);ge(this,"name","UndefinedParserError")}},Nr={cursorOffset:{category:"Special",type:"int",default:-1,range:{start:-1,end:1/0,step:1},description:"Print (to stderr) where a cursor at the given position would move to after formatting.",cliCategory:"Editor"},endOfLine:{category:"Global",type:"choice",default:"lf",description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:`Maintain existing
|
16 |
+
(mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:e=>typeof e=="string"||typeof e=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>typeof e=="string"||typeof e=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive).
|
17 |
+
The range will extend forwards to the end of the selected statement.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset.
|
18 |
+
The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:`Require either '@prettier' or '@format' to be present in the file's first docblock comment
|
19 |
+
in order for it to be formatted.`,cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function Xt({plugins:e=[],showDeprecated:t=!1}={}){let u=e.flatMap(n=>n.languages??[]),r=[];for(let n of Pr(Object.assign({},...e.map(({options:D})=>D),Nr)))!t&&n.deprecated||(Array.isArray(n.choices)&&(t||(n.choices=n.choices.filter(D=>!D.deprecated)),n.name==="parser"&&(n.choices=[...n.choices,...jr(n.choices,u,e)])),n.pluginDefaults=Object.fromEntries(e.filter(D=>{var o;return((o=D.defaultOptions)==null?void 0:o[n.name])!==void 0}).map(D=>[D.name,D.defaultOptions[n.name]])),r.push(n));return{languages:u,options:r}}function*jr(e,t,u){let r=new Set(e.map(n=>n.value));for(let n of t)if(n.parsers){for(let D of n.parsers)if(!r.has(D)){r.add(D);let o=u.find(a=>a.parsers&&Object.prototype.hasOwnProperty.call(a.parsers,D)),i=n.name;o!=null&&o.name&&(i+=` (plugin: ${o.name})`),yield{value:D,description:i}}}}function Pr(e){let t=[];for(let[u,r]of Object.entries(e)){let n={name:u,...r};Array.isArray(n.default)&&(n.default=B(!1,n.default,-1).value),t.push(n)}return t}var Tr=e=>String(e).split(/[/\\]/).pop();function Ft(e,t){if(!t)return;let u=Tr(t).toLowerCase();return e.find(r=>{var n,D;return((n=r.extensions)==null?void 0:n.some(o=>u.endsWith(o)))||((D=r.filenames)==null?void 0:D.some(o=>o.toLowerCase()===u))})}function Ir(e,t){if(t)return e.find(({name:u})=>u.toLowerCase()===t)??e.find(({aliases:u})=>u==null?void 0:u.includes(t))??e.find(({extensions:u})=>u==null?void 0:u.includes(`.${t}`))}function $r(e,t){let u=e.plugins.flatMap(n=>n.languages??[]),r=Ir(u,t.language)??Ft(u,t.physicalFile)??Ft(u,t.file)??(t.physicalFile,void 0);return r==null?void 0:r.parsers[0]}var Lr=$r,ne={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(u=>ne.value(u)).join(", ")}]`;let t=Object.keys(e);return t.length===0?"{}":`{ ${t.map(u=>`${ne.key(u)}: ${ne.value(e[u])}`).join(", ")} }`},pair:({key:e,value:t})=>ne.value({[e]:t})},pt=pe(Se(),1),Mr=(e,t,{descriptor:u})=>{let r=[`${pt.default.yellow(typeof e=="string"?u.key(e):u.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${pt.default.blue(typeof t=="string"?u.key(t):u.pair(t))}`),r.join("; ")+"."},De=pe(Se(),1),eu=Symbol.for("vnopts.VALUE_NOT_EXIST"),ye=Symbol.for("vnopts.VALUE_UNCHANGED"),ht=" ".repeat(2),Wr=(e,t,u)=>{let{text:r,list:n}=u.normalizeExpectedResult(u.schemas[e].expected(u)),D=[];return r&&D.push(Et(e,t,r,u.descriptor)),n&&D.push([Et(e,t,n.title,u.descriptor)].concat(n.values.map(o=>tu(o,u.loggerPrintWidth))).join(`
|
20 |
+
`)),uu(D,u.loggerPrintWidth)};function Et(e,t,u,r){return[`Invalid ${De.default.red(r.key(e))} value.`,`Expected ${De.default.blue(u)},`,`but received ${t===eu?De.default.gray("nothing"):De.default.red(r.value(t))}.`].join(" ")}function tu({text:e,list:t},u){let r=[];return e&&r.push(`- ${De.default.blue(e)}`),t&&r.push([`- ${De.default.blue(t.title)}:`].concat(t.values.map(n=>tu(n,u-ht.length).replace(/^|\n/g,`$&${ht}`))).join(`
|
21 |
+
`)),uu(r,u)}function uu(e,t){if(e.length===1)return e[0];let[u,r]=e,[n,D]=e.map(o=>o.split(`
|
22 |
+
`,1)[0].length);return n>t&&n>D?r:u}var Ct=pe(Se(),1),Ie=[],gt=[];function Rr(e,t){if(e===t)return 0;let u=e;e.length>t.length&&(e=t,t=u);let r=e.length,n=t.length;for(;r>0&&e.charCodeAt(~-r)===t.charCodeAt(~-n);)r--,n--;let D=0;for(;D<r&&e.charCodeAt(D)===t.charCodeAt(D);)D++;if(r-=D,n-=D,r===0)return n;let o,i,a,s,l=0,F=0;for(;l<r;)gt[l]=e.charCodeAt(D+l),Ie[l]=++l;for(;F<n;)for(o=t.charCodeAt(D+F),a=F++,i=F,l=0;l<r;l++)s=o===gt[l]?a:a+1,a=Ie[l],i=Ie[l]=a>i?s>i?i+1:s:s>a?a+1:s;return i}var ru=(e,t,{descriptor:u,logger:r,schemas:n})=>{let D=[`Ignored unknown option ${Ct.default.yellow(u.pair({key:e,value:t}))}.`],o=Object.keys(n).sort().find(i=>Rr(e,i)<3);o&&D.push(`Did you mean ${Ct.default.blue(u.key(o))}?`),r.warn(D.join(" "))},Vr=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function qr(e,t){let u=new e(t),r=Object.create(u);for(let n of Vr)n in t&&(r[n]=zr(t[n],u,K.prototype[n].length));return r}var K=class{static create(e){return qr(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,u){return e}preprocess(e,t){return e}postprocess(e,t){return ye}};function zr(e,t,u){return typeof e=="function"?(...r)=>e(...r.slice(0,u-1),t,...r.slice(u-1)):()=>e}var Hr=class extends K{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},Jr=class extends K{expected(){return"anything"}validate(){return!0}},Ur=class extends K{constructor({valueSchema:e,name:t=e.name,...u}){super({...u,name:t}),this._valueSchema=e}expected(e){let{text:t,list:u}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:u&&{title:"an array of the following values",values:[{list:u}]}}}validate(e,t){if(!Array.isArray(e))return!1;let u=[];for(let r of e){let n=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);n!==!0&&u.push(n.value)}return u.length===0?!0:{value:u}}deprecated(e,t){let u=[];for(let r of e){let n=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);n!==!1&&u.push(...n.map(({value:D})=>({value:[D]})))}return u}forward(e,t){let u=[];for(let r of e){let n=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);u.push(...n.map(mt))}return u}redirect(e,t){let u=[],r=[];for(let n of e){let D=t.normalizeRedirectResult(this._valueSchema.redirect(n,t),n);"remain"in D&&u.push(D.remain),r.push(...D.redirect.map(mt))}return u.length===0?{redirect:r}:{redirect:r,remain:u}}overlap(e,t){return e.concat(t)}};function mt({from:e,to:t}){return{from:[e],to:t}}var Kr=class extends K{expected(){return"true or false"}validate(e){return typeof e=="boolean"}};function Gr(e,t){let u=Object.create(null);for(let r of e){let n=r[t];if(u[n])throw new Error(`Duplicate ${t} ${JSON.stringify(n)}`);u[n]=r}return u}function Yr(e,t){let u=new Map;for(let r of e){let n=r[t];if(u.has(n))throw new Error(`Duplicate ${t} ${JSON.stringify(n)}`);u.set(n,r)}return u}function Zr(){let e=Object.create(null);return t=>{let u=JSON.stringify(t);return e[u]?!0:(e[u]=!0,!1)}}function Qr(e,t){let u=[],r=[];for(let n of e)t(n)?u.push(n):r.push(n);return[u,r]}function Xr(e){return e===Math.floor(e)}function en(e,t){if(e===t)return 0;let u=typeof e,r=typeof t,n=["undefined","object","boolean","number","string"];return u!==r?n.indexOf(u)-n.indexOf(r):u!=="string"?Number(e)-Number(t):e.localeCompare(t)}function tn(e){return(...t)=>{let u=e(...t);return typeof u=="string"?new Error(u):u}}function yt(e){return e===void 0?{}:e}function nu(e){if(typeof e=="string")return{text:e};let{text:t,list:u}=e;return un((t||u)!==void 0,"Unexpected `expected` result, there should be at least one field."),u?{text:t,list:{title:u.title,values:u.values.map(nu)}}:{text:t}}function vt(e,t){return e===!0?!0:e===!1?{value:t}:e}function Bt(e,t,u=!1){return e===!1?!1:e===!0?u?!0:[{value:t}]:"value"in e?[e]:e.length===0?!1:e}function bt(e,t){return typeof e=="string"||"key"in e?{from:t,to:e}:"from"in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function Je(e,t){return e===void 0?[]:Array.isArray(e)?e.map(u=>bt(u,t)):[bt(e,t)]}function wt(e,t){let u=Je(typeof e=="object"&&"redirect"in e?e.redirect:e,t);return u.length===0?{remain:t,redirect:u}:typeof e=="object"&&"remain"in e?{remain:e.remain,redirect:u}:{redirect:u}}function un(e,t){if(!e)throw new Error(t)}var rn=class extends K{constructor(e){super(e),this._choices=Yr(e.choices.map(t=>t&&typeof t=="object"?t:{value:t}),"value")}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(n=>this._choices.get(n)).filter(({hidden:n})=>!n).map(n=>n.value).sort(en).map(e.value),u=t.slice(0,-2),r=t.slice(-2);return{text:u.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return t&&t.deprecated?{value:e}:!1}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},nn=class extends K{expected(){return"a number"}validate(e,t){return typeof e=="number"}},Dn=class extends nn{expected(){return"an integer"}validate(e,t){return t.normalizeValidateResult(super.validate(e,t),e)===!0&&Xr(e)}},At=class extends K{expected(){return"a string"}validate(e){return typeof e=="string"}},on=ne,an=ru,sn=Wr,ln=Mr,cn=class{constructor(e,t){let{logger:u=console,loggerPrintWidth:r=80,descriptor:n=on,unknown:D=an,invalid:o=sn,deprecated:i=ln,missing:a=()=>!1,required:s=()=>!1,preprocess:l=c=>c,postprocess:F=()=>ye}=t||{};this._utils={descriptor:n,logger:u||{warn:()=>{}},loggerPrintWidth:r,schemas:Gr(e,"name"),normalizeDefaultResult:yt,normalizeExpectedResult:nu,normalizeDeprecatedResult:Bt,normalizeForwardResult:Je,normalizeRedirectResult:wt,normalizeValidateResult:vt},this._unknownHandler=D,this._invalidHandler=tn(o),this._deprecatedHandler=i,this._identifyMissing=(c,f)=>!(c in f)||a(c,f),this._identifyRequired=s,this._preprocess=l,this._postprocess=F,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=Zr()}normalize(e){let t={},u=[this._preprocess(e,this._utils)],r=()=>{for(;u.length!==0;){let n=u.shift(),D=this._applyNormalization(n,t);u.push(...D)}};r();for(let n of Object.keys(this._utils.schemas)){let D=this._utils.schemas[n];if(!(n in t)){let o=yt(D.default(this._utils));"value"in o&&u.push({[n]:o.value})}}r();for(let n of Object.keys(this._utils.schemas)){if(!(n in t))continue;let D=this._utils.schemas[n],o=t[n],i=D.postprocess(o,this._utils);i!==ye&&(this._applyValidation(i,n,D),t[n]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let u=[],{knownKeys:r,unknownKeys:n}=this._partitionOptionKeys(e);for(let D of r){let o=this._utils.schemas[D],i=o.preprocess(e[D],this._utils);this._applyValidation(i,D,o);let a=({from:F,to:c})=>{u.push(typeof c=="string"?{[c]:F}:{[c.key]:c.value})},s=({value:F,redirectTo:c})=>{let f=Bt(o.deprecated(F,this._utils),i,!0);if(f!==!1)if(f===!0)this._hasDeprecationWarned(D)||this._utils.logger.warn(this._deprecatedHandler(D,c,this._utils));else for(let{value:d}of f){let p={key:D,value:d};if(!this._hasDeprecationWarned(p)){let h=typeof c=="string"?{key:c,value:d}:c;this._utils.logger.warn(this._deprecatedHandler(p,h,this._utils))}}};Je(o.forward(i,this._utils),i).forEach(a);let l=wt(o.redirect(i,this._utils),i);if(l.redirect.forEach(a),"remain"in l){let F=l.remain;t[D]=D in t?o.overlap(t[D],F,this._utils):F,s({value:F})}for(let{from:F,to:c}of l.redirect)s({value:F,redirectTo:c})}for(let D of n){let o=e[D];this._applyUnknownHandler(D,o,t,(i,a)=>{u.push({[i]:a})})}return u}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,eu,this._utils)}_partitionOptionKeys(e){let[t,u]=Qr(Object.keys(e).filter(r=>!this._identifyMissing(r,e)),r=>r in this._utils.schemas);return{knownKeys:t,unknownKeys:u}}_applyValidation(e,t,u){let r=vt(u.validate(e,this._utils),e);if(r!==!0)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,u,r){let n=this._unknownHandler(e,t,this._utils);if(n)for(let D of Object.keys(n)){if(this._identifyMissing(D,n))continue;let o=n[D];D in this._utils.schemas?r(D,o):u[D]=o}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==ye){if(t.delete)for(let u of t.delete)delete e[u];if(t.override){let{knownKeys:u,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let n of u){let D=t.override[n];this._applyValidation(D,n,this._utils.schemas[n]),e[n]=D}for(let n of r){let D=t.override[n];this._applyUnknownHandler(n,D,e,(o,i)=>{let a=this._utils.schemas[o];this._applyValidation(i,o,a),e[o]=i})}}}}},$e;function fn(e,t,{logger:u=!1,isCLI:r=!1,passThrough:n=!1,FlagSchema:D,descriptor:o}={}){if(r){if(!D)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=ne;let i=n?Array.isArray(n)?(c,f)=>n.includes(c)?{[c]:f}:void 0:(c,f)=>({[c]:f}):(c,f,d)=>{let{_:p,...h}=d.schemas;return ru(c,f,{...d,schemas:h})},a=dn(t,{isCLI:r,FlagSchema:D}),s=new cn(a,{logger:u,unknown:i,descriptor:o}),l=u!==!1;l&&$e&&(s._hasDeprecationWarned=$e);let F=s.normalize(e);return l&&($e=s._hasDeprecationWarned),F}function dn(e,{isCLI:t,FlagSchema:u}){let r=[];t&&r.push(Jr.create({name:"_"}));for(let n of e)r.push(Fn(n,{isCLI:t,optionInfos:e,FlagSchema:u})),n.alias&&t&&r.push(Hr.create({name:n.alias,sourceName:n.name}));return r}function Fn(e,{isCLI:t,optionInfos:u,FlagSchema:r}){let{name:n}=e,D={name:n},o,i={};switch(e.type){case"int":o=Dn,t&&(D.preprocess=Number);break;case"string":o=At;break;case"choice":o=rn,D.choices=e.choices.map(a=>a!=null&&a.redirect?{...a,redirect:{to:{key:e.name,value:a.redirect}}}:a);break;case"boolean":o=Kr;break;case"flag":o=r,D.flags=u.flatMap(a=>[a.alias,a.description&&a.name,a.oppositeDescription&&`no-${a.name}`].filter(Boolean));break;case"path":o=At;break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?D.validate=(a,s,l)=>e.exception(a)||s.validate(a,l):D.validate=(a,s,l)=>a===void 0||s.validate(a,l),e.redirect&&(i.redirect=a=>a?{to:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(i.deprecated=!0),t&&!e.array){let a=D.preprocess||(s=>s);D.preprocess=(s,l,F)=>l.preprocess(a(Array.isArray(s)?B(!1,s,-1):s),F)}return e.array?Ur.create({...t?{preprocess:a=>Array.isArray(a)?a:[a]}:{},...i,valueSchema:o.create(D)}):o.create({...D,...i})}var pn=fn;function Du(e,t){if(!t)throw new Error("parserName is required.");for(let r=e.length-1;r>=0;r--){let n=e[r];if(n.parsers&&Object.prototype.hasOwnProperty.call(n.parsers,t))return n}let u=`Couldn't resolve parser "${t}".`;throw u+=" Plugins must be explicitly added to the standalone bundle.",new Qt(u)}function hn(e,t){if(!t)throw new Error("astFormat is required.");for(let r=e.length-1;r>=0;r--){let n=e[r];if(n.printers&&Object.prototype.hasOwnProperty.call(n.printers,t))return n}let u=`Couldn't find plugin for AST format "${t}".`;throw u+=" Plugins must be explicitly added to the standalone bundle.",new Qt(u)}function ou({plugins:e,parser:t}){let u=Du(e,t);return iu(u,t)}function iu(e,t){let u=e.parsers[t];return typeof u=="function"?u():u}function En(e,t){let u=e.printers[t];return typeof u=="function"?u():u}var kt={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null};async function Cn(e,t={}){var u;let r={...e};if(!r.parser)if(r.filepath){if(r.parser=Lr(r,{physicalFile:r.filepath}),!r.parser)throw new dt(`No parser could be inferred for file "${r.filepath}".`)}else throw new dt("No parser and no file path given, couldn't infer a parser.");let n=Xt({plugins:e.plugins,showDeprecated:!0}).options,D={...kt,...Object.fromEntries(n.filter(c=>c.default!==void 0).map(c=>[c.name,c.default]))},o=Du(r.plugins,r.parser),i=await iu(o,r.parser);r.astFormat=i.astFormat,r.locEnd=i.locEnd,r.locStart=i.locStart;let a=(u=o.printers)!=null&&u[i.astFormat]?o:hn(r.plugins,i.astFormat),s=await En(a,i.astFormat);r.printer=s;let l=a.defaultOptions?Object.fromEntries(Object.entries(a.defaultOptions).filter(([,c])=>c!==void 0)):{},F={...D,...l};for(let[c,f]of Object.entries(F))(r[c]===null||r[c]===void 0)&&(r[c]=f);return r.parser==="json"&&(r.trailingComma="none"),pn(r,n,{passThrough:Object.keys(kt),...t})}var le=Cn,au=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),gn=e=>Object.keys(e).filter(t=>!au.has(t));function mn(e){return e?t=>e(t,au):gn}var je=mn;function yn(e,t){let{printer:{massageAstNode:u,getVisitorKeys:r}}=t;if(!u)return e;let n=je(r),D=u.ignoredProperties??new Set;return o(e);function o(i,a){if(!(i!==null&&typeof i=="object"))return i;if(Array.isArray(i))return i.map(c=>o(c,a)).filter(Boolean);let s={},l=new Set(n(i));for(let c in i)!Object.prototype.hasOwnProperty.call(i,c)||D.has(c)||(l.has(c)?s[c]=o(i[c],i):s[c]=i[c]);let F=u(i,s,a);if(F!==null)return F??s}}var vn=yn,Bn=pe(Vu(),1);async function bn(e,t){let u=await ou(t),r=u.preprocess?u.preprocess(e,t):e;t.originalText=r;let n;try{n=await u.parse(r,t,t)}catch(D){wn(D,e)}return{text:r,ast:n}}function wn(e,t){let{loc:u}=e;if(u){let r=(0,Bn.codeFrameColumns)(t,u,{highlightCode:!0});throw e.message+=`
|
23 |
+
`+r,e.codeFrame=r,e}throw e}var he=bn,ve,Ue,fe,Be,An=class{constructor(e){st(this,ve),st(this,fe),this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return B(!1,e,t===null?-2:-4)??null}get index(){return this.siblings===null?null:B(!1,this.stack,-2)}get node(){return B(!1,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return this.siblings!==null}get siblings(){let{stack:e}=this,t=B(!1,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return e===null?null:e[this.index+1]}get previous(){let{siblings:e}=this;return e===null?null:e[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:e,index:t}=this;return e!==null&&t===e.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return[...ce(this,fe,Be).call(this)]}getName(){let{stack:e}=this,{length:t}=e;return t>1?B(!1,e,-2):null}getValue(){return B(!1,this.stack,-1)}getNode(e=0){let t=ce(this,ve,Ue).call(this,e);return t===-1?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}call(e,...t){let{stack:u}=this,{length:r}=u,n=B(!1,u,-1);for(let D of t)n=n[D],u.push(D,n);try{return e(this)}finally{u.length=r}}callParent(e,t=0){let u=ce(this,ve,Ue).call(this,t+1),r=this.stack.splice(u+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:u}=this,{length:r}=u,n=B(!1,u,-1);for(let D of t)n=n[D],u.push(D,n);try{for(let D=0;D<n.length;++D)u.push(D,n[D]),e(this,D,n),u.length-=2}finally{u.length=r}}map(e,...t){let u=[];return this.each((r,n,D)=>{u[n]=e(r,n,D)},...t),u}match(...e){let t=this.stack.length-1,u=null,r=this.stack[t--];for(let n of e){if(r===void 0)return!1;let D=null;if(typeof u=="number"&&(D=u,u=this.stack[t--],r=this.stack[t--]),n&&!n(r,u,D))return!1;u=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of ce(this,fe,Be).call(this))if(e(t))return t}hasAncestor(e){for(let t of ce(this,fe,Be).call(this))if(e(t))return!0;return!1}};ve=new WeakSet,Ue=function(e){let{stack:t}=this;for(let u=t.length-1;u>=0;u-=2)if(!Array.isArray(t[u])&&--e<0)return u;return-1},fe=new WeakSet,Be=function*(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let u=e[t];Array.isArray(u)||(yield u)}};var kn=An,su=new Proxy(()=>{},{get:()=>su}),Ke=su;function Ee(e){return(t,u,r)=>{let n=!!(r!=null&&r.backwards);if(u===!1)return!1;let{length:D}=t,o=u;for(;o>=0&&o<D;){let i=t.charAt(o);if(e instanceof RegExp){if(!e.test(i))return o}else if(!e.includes(i))return o;n?o--:o++}return o===-1||o===D?o:!1}}var Sn=Ee(/\s/),U=Ee(" "),lu=Ee(",; "),cu=Ee(/[^\n\r]/);function xn(e,t,u){let r=!!(u!=null&&u.backwards);if(t===!1)return!1;let n=e.charAt(t);if(r){if(e.charAt(t-1)==="\r"&&n===`
|
24 |
+
`)return t-2;if(n===`
|
25 |
+
`||n==="\r"||n==="\u2028"||n==="\u2029")return t-1}else{if(n==="\r"&&e.charAt(t+1)===`
|
26 |
+
`)return t+2;if(n===`
|
27 |
+
`||n==="\r"||n==="\u2028"||n==="\u2029")return t+1}return t}var ee=xn;function _n(e,t,u={}){let r=U(e,u.backwards?t-1:t,u),n=ee(e,r,u);return r!==n}var H=_n;function On(e){return Array.isArray(e)&&e.length>0}var Nn=On;function jn(e){return e!==null&&typeof e=="object"}var Pn=jn;function*fu(e,t){let{getVisitorKeys:u,filter:r=()=>!0}=t,n=D=>Pn(D)&&r(D);for(let D of u(e)){let o=e[D];if(Array.isArray(o))for(let i of o)n(i)&&(yield i);else n(o)&&(yield o)}}function*Tn(e,t){let u=[e];for(let r=0;r<u.length;r++){let n=u[r];for(let D of fu(n,t))yield D,u.push(D)}}function In(e){let t=e.type||e.kind||"(unknown type)",u=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return u.length>20&&(u=u.slice(0,19)+"…"),t+(u?" "+u:"")}function ut(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=In(e)}function oe(e,t){t.leading=!0,t.trailing=!1,ut(e,t)}function Z(e,t,u){t.leading=!1,t.trailing=!1,u&&(t.marker=u),ut(e,t)}function ie(e,t){t.leading=!1,t.trailing=!0,ut(e,t)}var Le=new WeakMap;function rt(e,t){if(Le.has(e))return Le.get(e);let{printer:{getCommentChildNodes:u,canAttachComment:r,getVisitorKeys:n},locStart:D,locEnd:o}=t;if(!r)return[];let i=((u==null?void 0:u(e,t))??[...fu(e,{getVisitorKeys:je(n)})]).flatMap(a=>r(a)?[a]:rt(a,t));return i.sort((a,s)=>D(a)-D(s)||o(a)-o(s)),Le.set(e,i),i}function du(e,t,u,r){let{locStart:n,locEnd:D}=u,o=n(t),i=D(t),a=rt(e,u),s,l,F=0,c=a.length;for(;F<c;){let f=F+c>>1,d=a[f],p=n(d),h=D(d);if(p<=o&&i<=h)return du(d,t,u,d);if(h<=o){s=d,F=f+1;continue}if(i<=p){l=d,c=f;continue}throw new Error("Comment location overlaps with node location")}if((r==null?void 0:r.type)==="TemplateLiteral"){let{quasis:f}=r,d=We(f,t,u);s&&We(f,s,u)!==d&&(s=null),l&&We(f,l,u)!==d&&(l=null)}return{enclosingNode:r,precedingNode:s,followingNode:l}}var Me=()=>!1;function $n(e,t){let{comments:u}=e;if(delete e.comments,!Nn(u)||!t.printer.canAttachComment)return;let r=[],{locStart:n,locEnd:D,printer:{experimentalFeatures:{avoidAstMutation:o=!1}={},handleComments:i={}},originalText:a}=t,{ownLine:s=Me,endOfLine:l=Me,remaining:F=Me}=i,c=u.map((f,d)=>({...du(e,f,t),comment:f,text:a,options:t,ast:e,isLastComment:u.length-1===d}));for(let[f,d]of c.entries()){let{comment:p,precedingNode:h,enclosingNode:g,followingNode:E,text:C,options:y,ast:m,isLastComment:b}=d;if(y.parser==="json"||y.parser==="json5"||y.parser==="__js_expression"||y.parser==="__ts_expression"||y.parser==="__vue_expression"||y.parser==="__vue_ts_expression"){if(n(p)-n(m)<=0){oe(m,p);continue}if(D(p)-D(m)>=0){ie(m,p);continue}}let v;if(o?v=[d]:(p.enclosingNode=g,p.precedingNode=h,p.followingNode=E,v=[p,C,y,m,b]),Ln(C,y,c,f))p.placement="ownLine",s(...v)||(E?oe(E,p):h?ie(h,p):Z(g||m,p));else if(Mn(C,y,c,f))p.placement="endOfLine",l(...v)||(h?ie(h,p):E?oe(E,p):Z(g||m,p));else if(p.placement="remaining",!F(...v))if(h&&E){let k=r.length;k>0&&r[k-1].followingNode!==E&&St(r,y),r.push(d)}else h?ie(h,p):E?oe(E,p):Z(g||m,p)}if(St(r,t),!o)for(let f of u)delete f.precedingNode,delete f.enclosingNode,delete f.followingNode}var Fu=e=>!/[\S\n\u2028\u2029]/.test(e);function Ln(e,t,u,r){let{comment:n,precedingNode:D}=u[r],{locStart:o,locEnd:i}=t,a=o(n);if(D)for(let s=r-1;s>=0;s--){let{comment:l,precedingNode:F}=u[s];if(F!==D||!Fu(e.slice(i(l),a)))break;a=o(l)}return H(e,a,{backwards:!0})}function Mn(e,t,u,r){let{comment:n,followingNode:D}=u[r],{locStart:o,locEnd:i}=t,a=i(n);if(D)for(let s=r+1;s<u.length;s++){let{comment:l,followingNode:F}=u[s];if(F!==D||!Fu(e.slice(a,o(l))))break;a=i(l)}return H(e,a)}function St(e,t){var u,r;let n=e.length;if(n===0)return;let{precedingNode:D,followingNode:o}=e[0],i=t.locStart(o),a;for(a=n;a>0;--a){let{comment:s,precedingNode:l,followingNode:F}=e[a-1];Ke.strictEqual(l,D),Ke.strictEqual(F,o);let c=t.originalText.slice(t.locEnd(s),i);if(((r=(u=t.printer).isGap)==null?void 0:r.call(u,c,t))??/^[\s(]*$/.test(c))i=t.locStart(s);else break}for(let[s,{comment:l}]of e.entries())s<a?ie(D,l):oe(o,l);for(let s of[D,o])s.comments&&s.comments.length>1&&s.comments.sort((l,F)=>t.locStart(l)-t.locStart(F));e.length=0}function We(e,t,u){let r=u.locStart(t)-1;for(let n=1;n<e.length;++n)if(r<u.locStart(e[n]))return n-1;return 0}function Wn(e,t){let u=t-1;u=U(e,u,{backwards:!0}),u=ee(e,u,{backwards:!0}),u=U(e,u,{backwards:!0});let r=ee(e,u,{backwards:!0});return u!==r}var nt=Wn;function pu(e,t){let u=e.node;return u.printed=!0,t.printer.printComment(e,t)}function Rn(e,t){var u;let r=e.node,n=[pu(e,t)],{printer:D,originalText:o,locStart:i,locEnd:a}=t;if((u=D.isBlockComment)!=null&&u.call(D,r)){let l=H(o,a(r))?H(o,i(r),{backwards:!0})?X:zt:" ";n.push(l)}else n.push(X);let s=ee(o,U(o,a(r)));return s!==!1&&H(o,s)&&n.push(X),n}function Vn(e,t,u){var r;let n=e.node,D=pu(e,t),{printer:o,originalText:i,locStart:a}=t,s=(r=o.isBlockComment)==null?void 0:r.call(o,n);if(u!=null&&u.hasLineSuffix&&!(u!=null&&u.isBlock)||H(i,a(n),{backwards:!0})){let l=nt(i,a(n));return{doc:Ve([X,l?X:"",D]),isBlock:s,hasLineSuffix:!0}}return!s||u!=null&&u.hasLineSuffix?{doc:[Ve([" ",D]),_e],isBlock:s,hasLineSuffix:!0}:{doc:[" ",D],isBlock:s,hasLineSuffix:!1}}function qn(e,t){let u=e.node;if(!u)return{};let r=t[Symbol.for("printedComments")];if((u.comments||[]).filter(i=>!r.has(i)).length===0)return{leading:"",trailing:""};let n=[],D=[],o;return e.each(()=>{let i=e.node;if(r!=null&&r.has(i))return;let{leading:a,trailing:s}=i;a?n.push(Rn(e,t)):s&&(o=Vn(e,t,o),D.push(o.doc))},"comments"),{leading:n,trailing:D}}function zn(e,t,u){let{leading:r,trailing:n}=qn(e,u);return!r&&!n?t:Yt(t,D=>[r,D,n])}function Hn(e){let{[Symbol.for("comments")]:t,[Symbol.for("printedComments")]:u}=e;for(let r of t){if(!r.printed&&!u.has(r))throw new Error('Comment "'+r.value.trim()+'" was not printed. Please report this error!');delete r.printed}}async function Jn(e,t,u,r,n){let{embeddedLanguageFormatting:D,printer:{embed:o,hasPrettierIgnore:i=()=>!1,getVisitorKeys:a}}=u;if(!o||D!=="auto")return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/en/plugins.html#optional-embed");let s=je(o.getVisitorKeys??a),l=[];f();let F=e.stack;for(let{print:d,node:p,pathStack:h}of l)try{e.stack=h;let g=await d(c,t,e,u);g&&n.set(p,g)}catch(g){if(globalThis.PRETTIER_DEBUG)throw g}e.stack=F;function c(d,p){return Un(d,p,u,r)}function f(){let{node:d}=e;if(d===null||typeof d!="object"||i(e))return;for(let h of s(d))Array.isArray(d[h])?e.each(f,h):e.call(f,h);let p=o(e,u);if(p){if(typeof p=="function"){l.push({print:p,node:d,pathStack:[...e.stack]});return}n.set(d,p)}}}async function Un(e,t,u,r){let n=await le({...u,...t,parentParser:u.parser,originalText:e},{passThrough:!0}),{ast:D}=await he(e,n),o=await r(D,n);return Gt(o)}function Kn(e,t){let{originalText:u,[Symbol.for("comments")]:r,locStart:n,locEnd:D,[Symbol.for("printedComments")]:o}=t,{node:i}=e,a=n(i),s=D(i);for(let l of r)n(l)>=a&&D(l)<=s&&o.add(l);return u.slice(a,s)}var Gn=Kn;async function Pe(e,t){({ast:e}=await hu(e,t));let u=new Map,r=new kn(e),n=new Map;await Jn(r,o,t,Pe,n);let D=await xt(r,t,o,void 0,n);return Hn(t),D;function o(a,s){return a===void 0||a===r?i(s):Array.isArray(a)?r.call(()=>i(s),...a):r.call(()=>i(s),a)}function i(a){let s=r.node;if(s==null)return"";let l=s&&typeof s=="object"&&a===void 0;if(l&&u.has(s))return u.get(s);let F=xt(r,t,o,a,n);return l&&u.set(s,F),F}}function xt(e,t,u,r,n){var D;let{node:o}=e,{printer:i}=t,a;return(D=i.hasPrettierIgnore)!=null&&D.call(i,e)?a=Gn(e,t):n.has(o)?a=n.get(o):a=i.print(e,t,u,r),o===t.cursorNode&&(a=Yt(a,s=>[qe,s,qe])),i.printComment&&(!i.willPrintOwnComments||!i.willPrintOwnComments(e,t))&&(a=zn(e,a,t)),a}async function hu(e,t){let u=e.comments??[];t[Symbol.for("comments")]=u,t[Symbol.for("tokens")]=e.tokens??[],t[Symbol.for("printedComments")]=new Set,$n(e,t);let{printer:{preprocess:r}}=t;return e=r?await r(e,t):e,{ast:e,comments:u}}var Yn=({parser:e})=>e==="json"||e==="json5"||e==="json-stringify";function Zn(e,t){let u=[e.node,...e.parentNodes],r=new Set([t.node,...t.parentNodes]);return u.find(n=>Eu.has(n.type)&&r.has(n))}function _t(e){let t=e.length-1;for(;;){let u=e[t];if((u==null?void 0:u.type)==="Program"||(u==null?void 0:u.type)==="File")t--;else break}return e.slice(0,t+1)}function Qn(e,t,{locStart:u,locEnd:r}){let n=e.node,D=t.node;if(n===D)return{startNode:n,endNode:D};let o=u(e.node);for(let a of _t(t.parentNodes))if(u(a)>=o)D=a;else break;let i=r(t.node);for(let a of _t(e.parentNodes)){if(r(a)<=i)n=a;else break;if(n===D)break}return{startNode:n,endNode:D}}function Ge(e,t,u,r,n=[],D){let{locStart:o,locEnd:i}=u,a=o(e),s=i(e);if(!(t>s||t<a||D==="rangeEnd"&&t===a||D==="rangeStart"&&t===s)){for(let l of rt(e,u)){let F=Ge(l,t,u,r,[e,...n],D);if(F)return F}if(!r||r(e,n[0]))return{node:e,parentNodes:n}}}function Xn(e,t){return t!=="DeclareExportDeclaration"&&e!=="TypeParameterDeclaration"&&(e==="Directive"||e==="TypeAlias"||e==="TSExportAssignment"||e.startsWith("Declare")||e.startsWith("TSDeclare")||e.endsWith("Statement")||e.endsWith("Declaration"))}var Eu=new Set(["JsonRoot","ObjectExpression","ArrayExpression","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","UnaryExpression","TemplateLiteral"]),eD=new Set(["OperationDefinition","FragmentDefinition","VariableDefinition","TypeExtensionDefinition","ObjectTypeDefinition","FieldDefinition","DirectiveDefinition","EnumTypeDefinition","EnumValueDefinition","InputValueDefinition","InputObjectTypeDefinition","SchemaDefinition","OperationTypeDefinition","InterfaceTypeDefinition","UnionTypeDefinition","ScalarTypeDefinition"]);function Ot(e,t,u){if(!t)return!1;switch(e.parser){case"flow":case"babel":case"babel-flow":case"babel-ts":case"typescript":case"acorn":case"espree":case"meriyah":case"__babel_estree":return Xn(t.type,u==null?void 0:u.type);case"json":case"json5":case"json-stringify":return Eu.has(t.type);case"graphql":return eD.has(t.kind);case"vue":return t.tag!=="root"}return!1}function tD(e,t,u){let{rangeStart:r,rangeEnd:n,locStart:D,locEnd:o}=t;Ke.ok(n>r);let i=e.slice(r,n).search(/\S/),a=i===-1;if(!a)for(r+=i;n>r&&!/\S/.test(e[n-1]);--n);let s=Ge(u,r,t,(f,d)=>Ot(t,f,d),[],"rangeStart"),l=a?s:Ge(u,n,t,f=>Ot(t,f),[],"rangeEnd");if(!s||!l)return{rangeStart:0,rangeEnd:0};let F,c;if(Yn(t)){let f=Zn(s,l);F=f,c=f}else({startNode:F,endNode:c}=Qn(s,l,t));return{rangeStart:Math.min(D(F),D(c)),rangeEnd:Math.max(o(F),o(c))}}function uD(e,t){let{cursorOffset:u,locStart:r,locEnd:n}=t,D=je(t.printer.getVisitorKeys),o=a=>r(a)<=u&&n(a)>=u,i=e;for(let a of Tn(e,{getVisitorKeys:D,filter:o}))i=a;return i}var rD=uD,Cu="\uFEFF",Nt=Symbol("cursor");async function gu(e,t,u=0){if(!e||e.trim().length===0)return{formatted:"",cursorOffset:-1,comments:[]};let{ast:r,text:n}=await he(e,t);t.cursorOffset>=0&&(t.cursorNode=rD(r,t));let D=await Pe(r,t);u>0&&(D=Ut([X,D],u,t.tabWidth));let o=Ne(D,t);if(u>0){let a=o.formatted.trim();o.cursorNodeStart!==void 0&&(o.cursorNodeStart-=o.formatted.indexOf(a)),o.formatted=a+Qe(t.endOfLine)}let i=t[Symbol.for("comments")];if(t.cursorOffset>=0){let a,s,l,F,c;if(t.cursorNode&&o.cursorNodeText?(a=t.locStart(t.cursorNode),s=n.slice(a,t.locEnd(t.cursorNode)),l=t.cursorOffset-a,F=o.cursorNodeStart,c=o.cursorNodeText):(a=0,s=n,l=t.cursorOffset,F=0,c=o.formatted),s===c)return{formatted:o.formatted,cursorOffset:F+l,comments:i};let f=s.split("");f.splice(l,0,Nt);let d=c.split(""),p=(0,zu.diffArrays)(f,d),h=F;for(let g of p)if(g.removed){if(g.value.includes(Nt))break}else h+=g.count;return{formatted:o.formatted,cursorOffset:h,comments:i}}return{formatted:o.formatted,cursorOffset:-1,comments:i}}async function nD(e,t){let{ast:u,text:r}=await he(e,t),{rangeStart:n,rangeEnd:D}=tD(r,t,u),o=r.slice(n,D),i=Math.min(n,r.lastIndexOf(`
|
28 |
+
`,n)+1),a=r.slice(i,n).match(/^\s*/)[0],s=tt(a,t.tabWidth),l=await gu(o,{...t,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:t.cursorOffset>n&&t.cursorOffset<=D?t.cursorOffset-n:-1,endOfLine:"lf"},s),F=l.formatted.trimEnd(),{cursorOffset:c}=t;c>D?c+=F.length-o.length:l.cursorOffset>=0&&(c=l.cursorOffset+n);let f=r.slice(0,n)+F+r.slice(D);if(t.endOfLine!=="lf"){let d=Qe(t.endOfLine);c>=0&&d===`\r
|
29 |
+
`&&(c+=Kt(f.slice(0,c),`
|
30 |
+
`)),f=xe(!1,f,`
|
31 |
+
`,d)}return{formatted:f,cursorOffset:c,comments:l.comments}}function Re(e,t,u){return typeof t!="number"||Number.isNaN(t)||t<0||t>e.length?u:t}function jt(e,t){let{cursorOffset:u,rangeStart:r,rangeEnd:n}=t;return u=Re(e,u,-1),r=Re(e,r,0),n=Re(e,n,e.length),{...t,cursorOffset:u,rangeStart:r,rangeEnd:n}}function mu(e,t){let{cursorOffset:u,rangeStart:r,rangeEnd:n,endOfLine:D}=jt(e,t),o=e.charAt(0)===Cu;if(o&&(e=e.slice(1),u--,r--,n--),D==="auto"&&(D=sr(e)),e.includes("\r")){let i=a=>Kt(e.slice(0,Math.max(a,0)),`\r
|
32 |
+
`);u-=i(u),r-=i(r),n-=i(n),e=lr(e)}return{hasBOM:o,text:e,options:jt(e,{...t,cursorOffset:u,rangeStart:r,rangeEnd:n,endOfLine:D})}}async function Pt(e,t){let u=await ou(t);return!u.hasPragma||u.hasPragma(e)}async function yu(e,t){let{hasBOM:u,text:r,options:n}=mu(e,await le(t));if(n.rangeStart>=n.rangeEnd&&r!==""||n.requirePragma&&!await Pt(r,n))return{formatted:e,cursorOffset:t.cursorOffset,comments:[]};let D;return n.rangeStart>0||n.rangeEnd<r.length?D=await nD(r,n):(!n.requirePragma&&n.insertPragma&&n.printer.insertPragma&&!await Pt(r,n)&&(r=n.printer.insertPragma(r)),D=await gu(r,n)),u&&(D.formatted=Cu+D.formatted,D.cursorOffset>=0&&D.cursorOffset++),D}async function DD(e,t,u){let{text:r,options:n}=mu(e,await le(t)),D=await he(r,n);return u&&(u.preprocessForPrint&&(D.ast=await hu(D.ast,n)),u.massage&&(D.ast=vn(D.ast,n))),D}async function oD(e,t){t=await le(t);let u=await Pe(e,t);return Ne(u,t)}async function iD(e,t){let u=_r(e),{formatted:r}=await yu(u,{...t,parser:"__js_expression"});return r}async function aD(e,t){t=await le(t);let{ast:u}=await he(e,t);return Pe(u,t)}async function sD(e,t){return Ne(e,await le(t))}var vu={};ke(vu,{addDanglingComment:()=>Z,addLeadingComment:()=>oe,addTrailingComment:()=>ie,getAlignmentSize:()=>tt,getIndentSize:()=>CD,getMaxContinuousCount:()=>hD,getNextNonSpaceNonCommentCharacter:()=>bD,getNextNonSpaceNonCommentCharacterIndex:()=>SD,getStringWidth:()=>Xe,hasNewline:()=>H,hasNewlineInRange:()=>mD,hasSpaces:()=>vD,isNextLineEmpty:()=>ND,isNextLineEmptyAfterIndex:()=>at,isPreviousLineEmpty:()=>_D,makeString:()=>AD,skip:()=>Ee,skipEverythingButNewLine:()=>cu,skipInlineComment:()=>Dt,skipNewline:()=>ee,skipSpaces:()=>U,skipToLineEnd:()=>lu,skipTrailingComment:()=>ot,skipWhitespace:()=>Sn});function lD(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let u=t+2;u<e.length;++u)if(e.charAt(u)==="*"&&e.charAt(u+1)==="/")return u+2}return t}var Dt=lD;function cD(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?cu(e,t):t}var ot=cD;function fD(e,t){let u=null,r=t;for(;r!==u;)u=r,r=U(e,r),r=Dt(e,r),r=ot(e,r),r=ee(e,r);return r}var it=fD;function dD(e,t){let u=null,r=t;for(;r!==u;)u=r,r=lu(e,r),r=Dt(e,r),r=U(e,r);return r=ot(e,r),r=ee(e,r),r!==!1&&H(e,r)}var at=dD;function FD(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function pD(e,t){let u=e.match(new RegExp(`(${FD(t)})+`,"g"));return u===null?0:u.reduce((r,n)=>Math.max(r,n.length/t.length),0)}var hD=pD;function ED(e,t){let u=e.lastIndexOf(`
|
33 |
+
`);return u===-1?0:tt(e.slice(u+1).match(/^[\t ]*/)[0],t)}var CD=ED;function gD(e,t,u){for(let r=t;r<u;++r)if(e.charAt(r)===`
|
34 |
+
`)return!0;return!1}var mD=gD;function yD(e,t,u={}){return U(e,u.backwards?t-1:t,u)!==t}var vD=yD;function BD(e,t){let u=it(e,t);return u===!1?"":e.charAt(u)}var bD=BD;function wD(e,t,u){let r=t==='"'?"'":'"',n=xe(!1,e,/\\(.)|(["'])/gs,(D,o,i)=>o===r?o:i===t?"\\"+i:i||(u&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(o)?o:"\\"+o));return t+n+t}var AD=wD;function kD(e,t,u){return it(e,u(t))}function SD(e,t){return arguments.length===2||typeof t=="number"?it(e,t):kD(...arguments)}function xD(e,t,u){return nt(e,u(t))}function _D(e,t){return arguments.length===2||typeof t=="number"?nt(e,t):xD(...arguments)}function OD(e,t,u){return at(e,u(t))}function ND(e,t){return arguments.length===2||typeof t=="number"?at(e,t):OD(...arguments)}var Bu={};ke(Bu,{builders:()=>jD,printer:()=>PD,utils:()=>TD});var jD={join:Jt,line:zt,softline:or,hardline:X,literalline:Ht,group:Rt,conditionalGroup:tr,fill:Vt,lineSuffix:Ve,lineSuffixBoundary:nr,cursor:qe,breakParent:_e,ifBreak:ur,trim:Dr,indent:be,indentIfBreak:rr,align:se,addAlignmentToDoc:Ut,markAsRoot:Xu,dedentToRoot:Qu,dedent:er,hardlineWithoutBreakParent:Ze,literallineWithoutBreakParent:qt,label:ir,concat:e=>e},PD={printDocToString:Ne},TD={willBreak:gr,traverseDoc:Ye,findInDoc:et,mapDoc:Oe,removeLines:vr,stripTrailingHardline:Gt,replaceEndOfLine:wr,canBreak:kr},ID="3.1.1";function Q(e,t=1){return async(...u)=>{let r=u[t]??{},n=r.plugins??[];return u[t]={...r,plugins:Array.isArray(n)?n:Object.values(n)},e(...u)}}var bu=Q(yu);async function wu(e,t){let{formatted:u}=await bu(e,{...t,cursorOffset:-1});return u}async function $D(e,t){return await wu(e,t)===e}var LD=Q(Xt,0),MD={parse:Q(DD),formatAST:Q(oD),formatDoc:Q(iD),printToDoc:Q(aD),printDocToString:Q(sD)},RD=Mt;export{MD as __debug,$D as check,RD as default,Bu as doc,wu as format,bu as formatWithCursor,LD as getSupportInfo,vu as util,ID as version};
|
openui/dist/assets/textarea-4A01Dc6n.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
openui/dist/assets/vendor-BJpsy9o3.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
openui/dist/favicon.png
ADDED
![]() |
openui/dist/fonts/Inter-Bold.woff2
ADDED
Binary file (106 kB). View file
|
|
openui/dist/fonts/Inter-Medium.woff2
ADDED
Binary file (106 kB). View file
|
|
openui/dist/fonts/Inter-Regular.woff2
ADDED
Binary file (98.9 kB). View file
|
|
openui/dist/icons/arrow-left.svg
ADDED
|
openui/dist/index.html
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!doctype html>
|
2 |
+
<html
|
3 |
+
lang="en"
|
4 |
+
class="text-zinc-900 antialiased dark:bg-zinc-800 dark:text-white"
|
5 |
+
>
|
6 |
+
<head>
|
7 |
+
<script>
|
8 |
+
// Only add google analytics when built for hosting
|
9 |
+
if ('production' === 'hosted') {
|
10 |
+
const script = document.createElement('script')
|
11 |
+
script.src = 'https://www.googletagmanager.com/gtag/js?id=G-FDHP7DEY94'
|
12 |
+
script.async = true
|
13 |
+
document.head.appendChild(script)
|
14 |
+
}
|
15 |
+
window.dataLayer = window.dataLayer || []
|
16 |
+
function gtag() {
|
17 |
+
dataLayer.push(arguments)
|
18 |
+
}
|
19 |
+
gtag('js', new Date())
|
20 |
+
|
21 |
+
gtag('config', 'G-FDHP7DEY94')
|
22 |
+
</script>
|
23 |
+
<meta charset="UTF-8" />
|
24 |
+
<link rel="icon" type="image/png" href="/favicon.png" />
|
25 |
+
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
26 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
27 |
+
<meta name="description" content="OpenUI" />
|
28 |
+
<meta
|
29 |
+
name="apple-mobile-web-app-status-bar-style"
|
30 |
+
content="black-translucent"
|
31 |
+
/>
|
32 |
+
<meta name="theme-color" content="rgb(217,87,155)" />
|
33 |
+
<title>OpenUI by W&B</title>
|
34 |
+
<script type="module" crossorigin src="/assets/index-2-rOUq-J.js"></script>
|
35 |
+
<link rel="modulepreload" crossorigin href="/assets/vendor-BJpsy9o3.js">
|
36 |
+
<link rel="stylesheet" crossorigin href="/assets/index-OfmkY5JK.css">
|
37 |
+
</head>
|
38 |
+
<body>
|
39 |
+
<noscript>You need to enable JavaScript to run this app.</noscript>
|
40 |
+
<div id="root"></div>
|
41 |
+
</body>
|
42 |
+
</html>
|
openui/dist/robots.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
User-agent: *
|
2 |
+
Allow: /
|
openui/eval/.gitignore
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
wandb/
|
2 |
+
datasets/
|
3 |
+
components/
|
openui/eval/__init__.py
ADDED
File without changes
|
openui/eval/dataset.py
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import asyncio
|
2 |
+
import csv
|
3 |
+
import weave
|
4 |
+
from weave import Dataset
|
5 |
+
from pathlib import Path
|
6 |
+
import json
|
7 |
+
import sys
|
8 |
+
|
9 |
+
|
10 |
+
# TODO: Maybe use this for finetuning
|
11 |
+
async def flowbite():
|
12 |
+
weave.init("openui-test-20")
|
13 |
+
|
14 |
+
data_dir = Path(__file__).parent / "components"
|
15 |
+
|
16 |
+
ds = []
|
17 |
+
for file in sorted(data_dir.glob("*.json")):
|
18 |
+
with open(file, "r") as f:
|
19 |
+
data = json.load(f)
|
20 |
+
abort = False
|
21 |
+
category = file.name.split(".")[0]
|
22 |
+
if category == "avatar":
|
23 |
+
print("Skipped ", category)
|
24 |
+
continue
|
25 |
+
for row in data:
|
26 |
+
if not row.get("names"):
|
27 |
+
abort = True
|
28 |
+
print("Aborting!")
|
29 |
+
break
|
30 |
+
source = row["name"].lower().replace(" ", "-")
|
31 |
+
for i, name in enumerate(row["names"]):
|
32 |
+
ds.append(
|
33 |
+
{
|
34 |
+
"name": name,
|
35 |
+
# hack for weirdly named folders.
|
36 |
+
"id": f"flowbite/{category.replace(' ', '-')}/{source}/{i}",
|
37 |
+
"emoji": row["emojis"][i],
|
38 |
+
"prompt": row["prompts"][i],
|
39 |
+
"desktop_img": f"{category}/{source}.combined.png",
|
40 |
+
"mobile_img": f"{category}/{source}.combined.mobile.png",
|
41 |
+
}
|
42 |
+
)
|
43 |
+
if abort:
|
44 |
+
break
|
45 |
+
|
46 |
+
dataset = Dataset(ds)
|
47 |
+
print("Created dataset of ", len(ds))
|
48 |
+
dataset_ref = weave.publish(dataset, "flowbite")
|
49 |
+
print("Published dataset:", dataset_ref)
|
50 |
+
|
51 |
+
|
52 |
+
async def publish(model):
|
53 |
+
weave.init("openui-test-20")
|
54 |
+
|
55 |
+
ds_dir = Path(__file__).parent / "datasets"
|
56 |
+
|
57 |
+
if model:
|
58 |
+
with open(ds_dir / f"{model}.json", "r") as f:
|
59 |
+
ds = json.load(f)
|
60 |
+
else:
|
61 |
+
ds = []
|
62 |
+
with open(ds_dir / "eval.csv", "r") as f:
|
63 |
+
reader = csv.DictReader(f)
|
64 |
+
for row in reader:
|
65 |
+
ds.append(row)
|
66 |
+
|
67 |
+
dataset = weaveflow.Dataset(ds)
|
68 |
+
print("Created dataset of ", len(ds))
|
69 |
+
dataset_ref = weave.publish(dataset, model.replace(":", "-") if model else "eval")
|
70 |
+
print("Published dataset:", dataset_ref)
|
71 |
+
|
72 |
+
|
73 |
+
if __name__ == "__main__":
|
74 |
+
if len(sys.argv) > 1:
|
75 |
+
model = sys.argv[1]
|
76 |
+
else:
|
77 |
+
model = None
|
78 |
+
asyncio.run(publish(model))
|
openui/eval/evaluate.py
ADDED
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import asyncio
|
2 |
+
import sys
|
3 |
+
import textwrap
|
4 |
+
from weave import Evaluation, Model
|
5 |
+
|
6 |
+
# from .model import EvaluateQualityModel
|
7 |
+
import weave
|
8 |
+
from pathlib import Path
|
9 |
+
import base64
|
10 |
+
import json
|
11 |
+
from datetime import datetime
|
12 |
+
|
13 |
+
last: datetime | None = None
|
14 |
+
|
15 |
+
|
16 |
+
def pt(*args):
|
17 |
+
global last
|
18 |
+
now = datetime.now()
|
19 |
+
if last:
|
20 |
+
delta = str(now - last).split(":")[2][:5]
|
21 |
+
else:
|
22 |
+
delta = "00.00"
|
23 |
+
last = now
|
24 |
+
print(f"{now.strftime('%M:%S')} ({delta}) -", *args)
|
25 |
+
|
26 |
+
|
27 |
+
def data_url(file_path):
|
28 |
+
with open(file_path, "rb") as image_file:
|
29 |
+
binary_data = image_file.read()
|
30 |
+
base64_encoded_data = base64.b64encode(binary_data)
|
31 |
+
base64_string = base64_encoded_data.decode("utf-8")
|
32 |
+
data_url = f"data:image/png;base64,{base64_string}"
|
33 |
+
return data_url
|
34 |
+
|
35 |
+
|
36 |
+
base_dir = Path(__file__).parent / "datasets"
|
37 |
+
|
38 |
+
|
39 |
+
@weave.type()
|
40 |
+
class EvaluateQualityModel(Model):
|
41 |
+
system_message: str
|
42 |
+
model_name: str = "gpt-4-vision-preview"
|
43 |
+
# "gpt-3.5-turbo-1106"
|
44 |
+
|
45 |
+
@weave.op()
|
46 |
+
async def predict(self, input: dict) -> dict:
|
47 |
+
from openai import OpenAI
|
48 |
+
|
49 |
+
pt("Actually predicting", input["emoji"], input["name"] + ":", input["prompt"])
|
50 |
+
pt("Desktop:", input["desktop_img"], "Mobile:", input["mobile_img"])
|
51 |
+
client = OpenAI()
|
52 |
+
user_message = f"""{input['prompt']}
|
53 |
+
---
|
54 |
+
name: {input['name']}
|
55 |
+
emoji: {input['emoji']}
|
56 |
+
"""
|
57 |
+
|
58 |
+
response = client.chat.completions.create(
|
59 |
+
model=self.model_name,
|
60 |
+
messages=[
|
61 |
+
{"role": "system", "content": self.system_message},
|
62 |
+
{
|
63 |
+
"role": "user",
|
64 |
+
"content": [
|
65 |
+
{"type": "text", "text": user_message},
|
66 |
+
{
|
67 |
+
"type": "text",
|
68 |
+
"text": "Screenshot of the light and dark desktop versions:",
|
69 |
+
},
|
70 |
+
{
|
71 |
+
"type": "image_url",
|
72 |
+
"image_url": {
|
73 |
+
"url": data_url(base_dir / input["desktop_img"])
|
74 |
+
},
|
75 |
+
},
|
76 |
+
{
|
77 |
+
"type": "text",
|
78 |
+
"text": "Screenshot of the light and dark mobile versions:",
|
79 |
+
},
|
80 |
+
{
|
81 |
+
"type": "image_url",
|
82 |
+
"image_url": {
|
83 |
+
"url": data_url(base_dir / input["mobile_img"])
|
84 |
+
},
|
85 |
+
},
|
86 |
+
],
|
87 |
+
},
|
88 |
+
{
|
89 |
+
"role": "assistant",
|
90 |
+
"content": "Here's my assessment of the component in JSON format:",
|
91 |
+
},
|
92 |
+
],
|
93 |
+
temperature=0.3,
|
94 |
+
max_tokens=128,
|
95 |
+
seed=42,
|
96 |
+
)
|
97 |
+
extracted = response.choices[0].message.content
|
98 |
+
pk = response.usage.prompt_tokens
|
99 |
+
pc = pk * 0.01 / 1000
|
100 |
+
ck = response.usage.completion_tokens
|
101 |
+
cc = ck * 0.03 / 1000
|
102 |
+
pt(f"Usage: {pk} prompt tokens, {ck} completion tokens, ${round(pc + cc, 3)}")
|
103 |
+
try:
|
104 |
+
return json.loads(extracted.replace("```json", "").replace("```", ""))
|
105 |
+
except json.JSONDecodeError:
|
106 |
+
pt("Failed to decode JSON!")
|
107 |
+
return extracted
|
108 |
+
|
109 |
+
|
110 |
+
@weave.op()
|
111 |
+
def media_score(example: dict, prediction: dict) -> dict:
|
112 |
+
return prediction["media"]
|
113 |
+
|
114 |
+
|
115 |
+
@weave.op()
|
116 |
+
def contrast_score(example: dict, prediction: dict) -> dict:
|
117 |
+
return prediction["contrast"]
|
118 |
+
|
119 |
+
|
120 |
+
@weave.op()
|
121 |
+
def overall_score(example: dict, prediction: dict) -> float:
|
122 |
+
return prediction["relevance"]
|
123 |
+
|
124 |
+
|
125 |
+
@weave.op()
|
126 |
+
def example_to_model_input(example: dict) -> str:
|
127 |
+
return example
|
128 |
+
|
129 |
+
|
130 |
+
SYSTEM_MESSAGE = textwrap.dedent(
|
131 |
+
"""
|
132 |
+
You are an expert web developer and will be assessing the quality of web components.
|
133 |
+
Given a prompt, emoji, name and 2 images, you will be asked to rate the quality of
|
134 |
+
the component on the following criteria:
|
135 |
+
|
136 |
+
- Media Quality: How well the component is displayed on desktop and mobile
|
137 |
+
- Contrast: How well the component is displayed in light and dark mode
|
138 |
+
- Relevance: Given the users prompt, do the images, name and emoji satisfy the request
|
139 |
+
|
140 |
+
Use the following scale to rate each criteria:
|
141 |
+
|
142 |
+
1. Terrible - The criteria isn't met at all
|
143 |
+
2. Poor - The criteria is somewhat met but it looks very amateur
|
144 |
+
3. Average - The criteria is met but it could be improved
|
145 |
+
4. Good - The criteria is met and it looks professional
|
146 |
+
5. Excellent - The criteria is met and it looks exceptional
|
147 |
+
|
148 |
+
Output a JSON object with the following structure:
|
149 |
+
|
150 |
+
{
|
151 |
+
"media": 4,
|
152 |
+
"contrast": 2,
|
153 |
+
"relevance": 5
|
154 |
+
}
|
155 |
+
"""
|
156 |
+
)
|
157 |
+
model = EvaluateQualityModel(SYSTEM_MESSAGE)
|
158 |
+
|
159 |
+
|
160 |
+
async def run(row=0, bad=False):
|
161 |
+
pt("Initializing weave")
|
162 |
+
weave.init("openui-test-21")
|
163 |
+
pt("Loading dataset")
|
164 |
+
dataset = weave.ref("flowbite").get()
|
165 |
+
pt("Running predict, row:", row)
|
166 |
+
comp = dataset.rows[row]
|
167 |
+
if bad:
|
168 |
+
comp["prompt"] = (
|
169 |
+
"A slider control that uses a gradient and displays a percentage."
|
170 |
+
)
|
171 |
+
res = await model.predict(comp)
|
172 |
+
pt("Result:", res)
|
173 |
+
|
174 |
+
|
175 |
+
async def eval(ds="gpt-3.5-turbo"):
|
176 |
+
pt("Initializing weave")
|
177 |
+
weave.init("openui-test-21")
|
178 |
+
pt("Loading dataset", ds)
|
179 |
+
dataset = weave.ref(ds).get()
|
180 |
+
evaluation = Evaluation(
|
181 |
+
dataset,
|
182 |
+
scorers=[media_score, contrast_score, overall_score],
|
183 |
+
preprocess_model_input=example_to_model_input,
|
184 |
+
)
|
185 |
+
pt("Running evaluation")
|
186 |
+
await evaluation.evaluate(model)
|
187 |
+
|
188 |
+
|
189 |
+
if __name__ == "__main__":
|
190 |
+
if len(sys.argv) > 1:
|
191 |
+
ds = sys.argv[1].replace(":", "-")
|
192 |
+
else:
|
193 |
+
ds = "gpt-3.5-turbo"
|
194 |
+
asyncio.run(eval(ds))
|
openui/eval/evaluate_weave.py
ADDED
@@ -0,0 +1,314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import asyncio
|
2 |
+
import sys
|
3 |
+
import os
|
4 |
+
import textwrap
|
5 |
+
import yaml
|
6 |
+
import mistletoe
|
7 |
+
from openai import AsyncOpenAI
|
8 |
+
from weave import Evaluation, Model
|
9 |
+
|
10 |
+
# from .model import EvaluateQualityModel
|
11 |
+
import weave
|
12 |
+
from pathlib import Path
|
13 |
+
import base64
|
14 |
+
import json
|
15 |
+
from datetime import datetime
|
16 |
+
from openui.util import gen_screenshots
|
17 |
+
|
18 |
+
|
19 |
+
last: datetime | None = None
|
20 |
+
|
21 |
+
|
22 |
+
def pt(*args):
|
23 |
+
global last
|
24 |
+
now = datetime.now()
|
25 |
+
if last:
|
26 |
+
delta = str(now - last).split(":")[2][:5]
|
27 |
+
else:
|
28 |
+
delta = "00.00"
|
29 |
+
last = now
|
30 |
+
print(f"{now.strftime('%M:%S')} ({delta}) -", *args)
|
31 |
+
|
32 |
+
|
33 |
+
base_dir = Path(__file__).parent / "datasets"
|
34 |
+
|
35 |
+
SYSTEM_PROMPT = """You're a frontend web developer that specializes in tailwindcss. Given a description, generate HTML with tailwindcss. You should support both dark and light mode. It should render nicely on desktop, tablet, and mobile. Keep your responses concise and just return HTML that would appear in the <body> no need for <head>. Use placehold.co for placeholder images. If the user asks for interactivity, use modern ES6 javascript and native browser apis to handle events.
|
36 |
+
|
37 |
+
Always start your response with frontmatter wrapped in ---. Set name: with a 2 to 5 word description of the component. Set emoji: with an emoji for the component, i.e.:
|
38 |
+
---
|
39 |
+
name: Fancy Button
|
40 |
+
emoji: 🎉
|
41 |
+
---
|
42 |
+
|
43 |
+
<button class="bg-blue-500 text-white p-2 rounded-lg">Click me</button>"""
|
44 |
+
|
45 |
+
|
46 |
+
@weave.type()
|
47 |
+
class OpenUIModel(Model):
|
48 |
+
system_prompt: str
|
49 |
+
model_name: str = "gpt-3.5-turbo"
|
50 |
+
take_screenshot: bool = True
|
51 |
+
temp: float = 0.5
|
52 |
+
_iter: int = 0
|
53 |
+
# "gpt-3.5-turbo-1106"
|
54 |
+
|
55 |
+
@property
|
56 |
+
def client(self):
|
57 |
+
if self.model_name.startswith("ollama/"):
|
58 |
+
return AsyncOpenAI(base_url="http://localhost:11434/v1")
|
59 |
+
if self.model_name.startswith("fireworks/"):
|
60 |
+
return AsyncOpenAI(
|
61 |
+
api_key=os.getenv("FIREWORKS_API_KEY"),
|
62 |
+
base_url="https://api.fireworks.ai/inference/v1",
|
63 |
+
)
|
64 |
+
else:
|
65 |
+
return AsyncOpenAI()
|
66 |
+
|
67 |
+
@property
|
68 |
+
def model(self):
|
69 |
+
if self.model_name.startswith("ollama/"):
|
70 |
+
return self.model_name.replace("ollama/", "")
|
71 |
+
if self.model_name.startswith("fireworks/"):
|
72 |
+
return (
|
73 |
+
f"accounts/fireworks/models/{self.model_name.replace('fireworks/', '')}"
|
74 |
+
)
|
75 |
+
return self.model_name
|
76 |
+
|
77 |
+
@property
|
78 |
+
def model_dir(self):
|
79 |
+
return self.model_name.split("/")[-1]
|
80 |
+
|
81 |
+
@weave.op()
|
82 |
+
async def predict(self, prompt: str) -> dict:
|
83 |
+
pt("Actually predicting", prompt)
|
84 |
+
completion = await self.client.chat.completions.create(
|
85 |
+
messages=[
|
86 |
+
{
|
87 |
+
"role": "system",
|
88 |
+
"content": self.system_prompt,
|
89 |
+
},
|
90 |
+
{
|
91 |
+
"role": "user",
|
92 |
+
"content": prompt,
|
93 |
+
},
|
94 |
+
],
|
95 |
+
max_tokens=2048,
|
96 |
+
temperature=self.temp,
|
97 |
+
model=self.model,
|
98 |
+
)
|
99 |
+
result = completion.choices[0].message.content
|
100 |
+
parsed = self.extract_html(result)
|
101 |
+
if self.take_screenshot:
|
102 |
+
name = f"prompt-{self._iter}"
|
103 |
+
self._iter += 1
|
104 |
+
await self.screenshot(parsed["html"], name)
|
105 |
+
parsed["desktop_img"] = f"./{self.model_dir}/{name}.combined.png"
|
106 |
+
parsed["mobile_img"] = f"./{self.model_dir}/{name}.combined.mobile.png"
|
107 |
+
return parsed
|
108 |
+
|
109 |
+
async def screenshot(self, html: str, name: str):
|
110 |
+
screenshot_dir = base_dir / self.model_dir
|
111 |
+
screenshot_dir.mkdir(exist_ok=True)
|
112 |
+
await gen_screenshots(name, html, screenshot_dir)
|
113 |
+
|
114 |
+
def extract_html(self, result: str):
|
115 |
+
fm = {}
|
116 |
+
parts = result.split("---")
|
117 |
+
try:
|
118 |
+
if len(parts) > 2:
|
119 |
+
fm = yaml.safe_load(parts[1])
|
120 |
+
if not isinstance(fm, dict):
|
121 |
+
fm = {"name": fm}
|
122 |
+
md = "---".join(parts[2:])
|
123 |
+
elif len(parts) == 2:
|
124 |
+
fm = yaml.safe_load(parts[0])
|
125 |
+
if not isinstance(fm, dict):
|
126 |
+
fm = {"name": fm}
|
127 |
+
md = parts[1]
|
128 |
+
else:
|
129 |
+
md = result
|
130 |
+
except Exception as e:
|
131 |
+
print(f"Error parsing frontmatter: {e}")
|
132 |
+
print(parts)
|
133 |
+
fm["name"] = "Component"
|
134 |
+
fm["emoji"] = "🎉"
|
135 |
+
md = result
|
136 |
+
doc = mistletoe.Document(md)
|
137 |
+
html = ""
|
138 |
+
blocks = 0
|
139 |
+
for node in doc.children:
|
140 |
+
if isinstance(node, mistletoe.block_token.CodeFence):
|
141 |
+
blocks += 1
|
142 |
+
if node.language == "js" or node.language == "javascript":
|
143 |
+
html += f"<script>\n{node.children[0].content}\n</script>\n"
|
144 |
+
else:
|
145 |
+
html += f"{node.children[0].content}\n"
|
146 |
+
if blocks == 0:
|
147 |
+
html = md
|
148 |
+
fm["html"] = html.strip()
|
149 |
+
return fm
|
150 |
+
|
151 |
+
|
152 |
+
EVAL_SYSTEM_PROMPT = textwrap.dedent(
|
153 |
+
"""
|
154 |
+
You are an expert web developer and will be assessing the quality of web components.
|
155 |
+
Given a prompt, emoji, name and 2 images, you will be asked to rate the quality of
|
156 |
+
the component on the following criteria:
|
157 |
+
|
158 |
+
- Media Quality: How well the component is displayed on desktop and mobile
|
159 |
+
- Contrast: How well the component is displayed in light and dark mode
|
160 |
+
- Relevance: Given the users prompt, do the images, name and emoji satisfy the request
|
161 |
+
|
162 |
+
Use the following scale to rate each criteria:
|
163 |
+
|
164 |
+
1. Terrible - The criteria isn't met at all
|
165 |
+
2. Poor - The criteria is somewhat met but it looks very amateur
|
166 |
+
3. Average - The criteria is met but it could be improved
|
167 |
+
4. Good - The criteria is met and it looks professional
|
168 |
+
5. Excellent - The criteria is met and it looks exceptional
|
169 |
+
|
170 |
+
Output a JSON object with the following structure:
|
171 |
+
|
172 |
+
{
|
173 |
+
"media": 4,
|
174 |
+
"contrast": 2,
|
175 |
+
"relevance": 5
|
176 |
+
}
|
177 |
+
"""
|
178 |
+
)
|
179 |
+
|
180 |
+
|
181 |
+
@weave.type()
|
182 |
+
class OpenUIScoringModel(Model):
|
183 |
+
system_prompt: str
|
184 |
+
model_name: str = "gpt-4-vision-preview"
|
185 |
+
temp: float = 0.3
|
186 |
+
|
187 |
+
def data_url(self, file_path):
|
188 |
+
with open(file_path, "rb") as image_file:
|
189 |
+
binary_data = image_file.read()
|
190 |
+
base64_encoded_data = base64.b64encode(binary_data)
|
191 |
+
base64_string = base64_encoded_data.decode("utf-8")
|
192 |
+
data_url = f"data:image/png;base64,{base64_string}"
|
193 |
+
return data_url
|
194 |
+
|
195 |
+
@weave.op()
|
196 |
+
async def predict(self, example: dict, prediction: dict) -> dict:
|
197 |
+
client = AsyncOpenAI()
|
198 |
+
|
199 |
+
user_message = f"""{example['prompt']}
|
200 |
+
---
|
201 |
+
name: {prediction['name']}
|
202 |
+
emoji: {prediction['emoji']}
|
203 |
+
"""
|
204 |
+
response = await client.chat.completions.create(
|
205 |
+
model=self.model_name,
|
206 |
+
messages=[
|
207 |
+
{"role": "system", "content": self.system_prompt},
|
208 |
+
{
|
209 |
+
"role": "user",
|
210 |
+
"content": [
|
211 |
+
{"type": "text", "text": user_message},
|
212 |
+
{
|
213 |
+
"type": "text",
|
214 |
+
"text": "Screenshot of the light and dark desktop versions:",
|
215 |
+
},
|
216 |
+
{
|
217 |
+
"type": "image_url",
|
218 |
+
"image_url": {
|
219 |
+
"url": self.data_url(
|
220 |
+
base_dir / prediction["desktop_img"]
|
221 |
+
)
|
222 |
+
},
|
223 |
+
},
|
224 |
+
{
|
225 |
+
"type": "text",
|
226 |
+
"text": "Screenshot of the light and dark mobile versions:",
|
227 |
+
},
|
228 |
+
{
|
229 |
+
"type": "image_url",
|
230 |
+
"image_url": {
|
231 |
+
"url": self.data_url(
|
232 |
+
base_dir / prediction["mobile_img"]
|
233 |
+
)
|
234 |
+
},
|
235 |
+
},
|
236 |
+
],
|
237 |
+
},
|
238 |
+
{
|
239 |
+
"role": "assistant",
|
240 |
+
"content": "Here's my assessment of the component in JSON format:",
|
241 |
+
},
|
242 |
+
],
|
243 |
+
temperature=self.temp,
|
244 |
+
max_tokens=128,
|
245 |
+
seed=42,
|
246 |
+
)
|
247 |
+
extracted = response.choices[0].message.content
|
248 |
+
pk = response.usage.prompt_tokens
|
249 |
+
pc = pk * 0.01 / 1000
|
250 |
+
ck = response.usage.completion_tokens
|
251 |
+
cc = ck * 0.03 / 1000
|
252 |
+
pt(f"Usage: {pk} prompt tokens, {ck} completion tokens, ${round(pc + cc, 3)}")
|
253 |
+
try:
|
254 |
+
return json.loads(extracted.replace("```json", "").replace("```", ""))
|
255 |
+
except json.JSONDecodeError:
|
256 |
+
pt("Failed to decode JSON!")
|
257 |
+
return {
|
258 |
+
"media": None,
|
259 |
+
"contrast": None,
|
260 |
+
"relevance": None,
|
261 |
+
"source": extracted,
|
262 |
+
}
|
263 |
+
|
264 |
+
|
265 |
+
scoring_model = OpenUIScoringModel(EVAL_SYSTEM_PROMPT)
|
266 |
+
|
267 |
+
|
268 |
+
@weave.op()
|
269 |
+
async def scores(example: dict, prediction: dict) -> dict:
|
270 |
+
return await scoring_model.predict(example, prediction)
|
271 |
+
|
272 |
+
|
273 |
+
@weave.op()
|
274 |
+
def example_to_model_input(example: dict) -> str:
|
275 |
+
return example["prompt"]
|
276 |
+
|
277 |
+
|
278 |
+
async def run(row=0, bad=False):
|
279 |
+
pt("Initializing weave")
|
280 |
+
weave.init("openui-test-20")
|
281 |
+
model = OpenUIModel(SYSTEM_PROMPT)
|
282 |
+
pt("Loading dataset")
|
283 |
+
dataset = weave.ref("flowbite").get()
|
284 |
+
pt("Running predict, row:", row)
|
285 |
+
comp = dataset.rows[row]
|
286 |
+
if bad:
|
287 |
+
comp["prompt"] = (
|
288 |
+
"A slider control that uses a gradient and displays a percentage."
|
289 |
+
)
|
290 |
+
res = await model.predict(comp)
|
291 |
+
pt("Result:", res)
|
292 |
+
|
293 |
+
|
294 |
+
async def eval(mod="gpt-3.5-turbo"):
|
295 |
+
pt("Initializing weave")
|
296 |
+
weave.init("openui-test-20")
|
297 |
+
model = OpenUIModel(SYSTEM_PROMPT, mod)
|
298 |
+
pt("Loading dataset")
|
299 |
+
dataset = weave.ref("eval").get()
|
300 |
+
evaluation = Evaluation(
|
301 |
+
dataset,
|
302 |
+
scorers=[scores],
|
303 |
+
preprocess_model_input=example_to_model_input,
|
304 |
+
)
|
305 |
+
pt("Running evaluation")
|
306 |
+
await evaluation.evaluate(model)
|
307 |
+
|
308 |
+
|
309 |
+
if __name__ == "__main__":
|
310 |
+
if len(sys.argv) > 1:
|
311 |
+
mod = sys.argv[1]
|
312 |
+
else:
|
313 |
+
mod = "gpt-3.5-turbo"
|
314 |
+
asyncio.run(eval(mod))
|
openui/eval/model.py
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from weave import Model
|
2 |
+
import weave
|
3 |
+
import json
|
4 |
+
from pathlib import Path
|
5 |
+
|
6 |
+
import base64
|
7 |
+
|
8 |
+
|
9 |
+
def data_url(file_path):
|
10 |
+
with open(file_path, "rb") as image_file:
|
11 |
+
binary_data = image_file.read()
|
12 |
+
base64_encoded_data = base64.b64encode(binary_data)
|
13 |
+
base64_string = base64_encoded_data.decode("utf-8")
|
14 |
+
data_url = f"data:image/png;base64,{base64_string}"
|
15 |
+
return data_url
|
16 |
+
|
17 |
+
|
18 |
+
base_dir = Path(__file__).parent / "components"
|
19 |
+
|
20 |
+
|
21 |
+
@weave.type()
|
22 |
+
class EvaluateQualityModel(Model):
|
23 |
+
system_message: str
|
24 |
+
model_name: str = "gpt-4-vision-preview"
|
25 |
+
# "gpt-3.5-turbo-1106"
|
26 |
+
|
27 |
+
@weave.op()
|
28 |
+
async def predict(self, input: dict) -> dict:
|
29 |
+
from openai import OpenAI
|
30 |
+
|
31 |
+
client = OpenAI()
|
32 |
+
user_message = f"""prompt: {input['prompt']}
|
33 |
+
name: {input['name']}
|
34 |
+
emoji: {input['emoji']}
|
35 |
+
"""
|
36 |
+
|
37 |
+
response = client.chat.completions.create(
|
38 |
+
model=self.model_name,
|
39 |
+
messages=[
|
40 |
+
{"role": "system", "content": self.system_message},
|
41 |
+
{"role": "user", "content": user_message},
|
42 |
+
{
|
43 |
+
"role": "user",
|
44 |
+
"content": [
|
45 |
+
{
|
46 |
+
"type": "text",
|
47 |
+
"text": "Screenshot of the light and dark desktop versions:",
|
48 |
+
},
|
49 |
+
{
|
50 |
+
"type": "image_url",
|
51 |
+
"image_url": data_url(base_dir / input["desktop_img"]),
|
52 |
+
},
|
53 |
+
{
|
54 |
+
"type": "text",
|
55 |
+
"text": "Screenshot of the light and dark mobile versions:",
|
56 |
+
},
|
57 |
+
{
|
58 |
+
"type": "image_url",
|
59 |
+
"image_url": data_url(base_dir / input["mobile_img"]),
|
60 |
+
},
|
61 |
+
],
|
62 |
+
},
|
63 |
+
],
|
64 |
+
temperature=0.7,
|
65 |
+
response_format={"type": "json_object"},
|
66 |
+
)
|
67 |
+
extracted = response.choices[0].message.content
|
68 |
+
return json.loads(extracted)
|
openui/eval/prompt_to_img.py
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from pathlib import Path
|
2 |
+
import csv
|
3 |
+
import json
|
4 |
+
import mistletoe
|
5 |
+
import yaml
|
6 |
+
import asyncio
|
7 |
+
import sys
|
8 |
+
from openui.util import gen_screenshots
|
9 |
+
|
10 |
+
from openai import AsyncOpenAI
|
11 |
+
|
12 |
+
SYSTEM_PROMPT = """You're a frontend web developer that specializes in tailwindcss. Given a description, generate HTML with tailwindcss. You should support both dark and light mode. It should render nicely on desktop, tablet, and mobile. Keep your responses concise and just return HTML that would appear in the <body> no need for <head>. Use placehold.co for placeholder images. If the user asks for interactivity, use modern ES6 javascript and native browser apis to handle events.
|
13 |
+
|
14 |
+
Always start your response with frontmatter wrapped in ---. Set name: with a 2 to 5 word description of the component. Set emoji: with an emoji for the component, i.e.:
|
15 |
+
---
|
16 |
+
name: Fancy Button
|
17 |
+
emoji: 🎉
|
18 |
+
---
|
19 |
+
|
20 |
+
<button class="bg-blue-500 text-white p-2 rounded-lg">Click me</button>"""
|
21 |
+
|
22 |
+
|
23 |
+
def extract_html(result: str):
|
24 |
+
fm = {}
|
25 |
+
parts = result.split("---")
|
26 |
+
try:
|
27 |
+
if len(parts) > 2:
|
28 |
+
fm = yaml.safe_load(parts[1])
|
29 |
+
if not isinstance(fm, dict):
|
30 |
+
fm = {"name": fm}
|
31 |
+
md = "---".join(parts[2:])
|
32 |
+
elif len(parts) == 2:
|
33 |
+
fm = yaml.safe_load(parts[0])
|
34 |
+
if not isinstance(fm, dict):
|
35 |
+
fm = {"name": fm}
|
36 |
+
md = parts[1]
|
37 |
+
else:
|
38 |
+
md = result
|
39 |
+
except Exception as e:
|
40 |
+
print(f"Error parsing frontmatter: {e}")
|
41 |
+
print(parts)
|
42 |
+
fm["name"] = "Component"
|
43 |
+
fm["emoji"] = "🎉"
|
44 |
+
md = result
|
45 |
+
doc = mistletoe.Document(md)
|
46 |
+
html = ""
|
47 |
+
blocks = 0
|
48 |
+
for node in doc.children:
|
49 |
+
if isinstance(node, mistletoe.block_token.CodeFence):
|
50 |
+
blocks += 1
|
51 |
+
if node.language == "js" or node.language == "javascript":
|
52 |
+
html += f"<script>\n{node.children[0].content}\n</script>\n"
|
53 |
+
else:
|
54 |
+
html += f"{node.children[0].content}\n"
|
55 |
+
if blocks == 0:
|
56 |
+
html = md
|
57 |
+
fm["html"] = html.strip()
|
58 |
+
return fm
|
59 |
+
|
60 |
+
|
61 |
+
async def synth(prompt, model="gpt-3.5-turbo"):
|
62 |
+
print(f"Generating HTML for: {prompt}")
|
63 |
+
completion = await openai.chat.completions.create(
|
64 |
+
messages=[
|
65 |
+
{
|
66 |
+
"role": "system",
|
67 |
+
"content": SYSTEM_PROMPT,
|
68 |
+
},
|
69 |
+
{
|
70 |
+
"role": "user",
|
71 |
+
"content": prompt,
|
72 |
+
},
|
73 |
+
],
|
74 |
+
max_tokens=2048,
|
75 |
+
temperature=0.5,
|
76 |
+
model=model,
|
77 |
+
)
|
78 |
+
result = completion.choices[0].message.content
|
79 |
+
parsed = extract_html(result)
|
80 |
+
parsed["prompt"] = prompt
|
81 |
+
return parsed
|
82 |
+
|
83 |
+
|
84 |
+
async def main(model="gpt-3.5-turbo"):
|
85 |
+
eval_csv = Path(__file__).parent / "datasets" / "eval.csv"
|
86 |
+
gen_json = Path(__file__).parent / "datasets" / f"{model}.json"
|
87 |
+
screenshot_dir = Path(__file__).parent / "datasets" / model
|
88 |
+
screenshot_dir.mkdir(exist_ok=True)
|
89 |
+
# Regenerate screenshots only for existing generations
|
90 |
+
if gen_json.exists():
|
91 |
+
with open(gen_json, "r") as f:
|
92 |
+
results = json.load(f)
|
93 |
+
for i, row in enumerate(results):
|
94 |
+
await gen_screenshots(f"prompt-{i}", row["html"], screenshot_dir)
|
95 |
+
row["desktop_img"] = f"./{model}/prompt-{i}.combined.png"
|
96 |
+
row["mobile_img"] = f"./{model}/prompt-{i}.combined.mobile.png"
|
97 |
+
with open(gen_json, "w") as f:
|
98 |
+
f.write(json.dumps(results, indent=4))
|
99 |
+
return
|
100 |
+
|
101 |
+
with open(eval_csv, "r") as f:
|
102 |
+
reader = csv.DictReader(f)
|
103 |
+
tasks = [synth(row["prompt"], model) for i, row in enumerate(reader)]
|
104 |
+
results = await asyncio.gather(*tasks)
|
105 |
+
for i, row in enumerate(results):
|
106 |
+
await gen_screenshots(f"prompt-{i}", row["html"], screenshot_dir)
|
107 |
+
row["desktop_img"] = f"./{model}/prompt-{i}.combined.png"
|
108 |
+
row["mobile_img"] = f"./{model}/prompt-{i}.combined.mobile.png"
|
109 |
+
|
110 |
+
with open(gen_json, "w") as f:
|
111 |
+
f.write(json.dumps(results, indent=4))
|
112 |
+
|
113 |
+
|
114 |
+
if __name__ == "__main__":
|
115 |
+
if len(sys.argv) > 1:
|
116 |
+
model = sys.argv[1]
|
117 |
+
else:
|
118 |
+
model = "gpt-3.5-turbo"
|
119 |
+
if model.startswith("ollama/"):
|
120 |
+
model = model.replace("ollama/", "")
|
121 |
+
openai = AsyncOpenAI(base_url="http://localhost:11434/v1")
|
122 |
+
else:
|
123 |
+
openai = AsyncOpenAI()
|
124 |
+
|
125 |
+
asyncio.run(main(model))
|
openui/eval/scrape.py
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from bs4 import BeautifulSoup
|
2 |
+
from urllib.request import urlopen
|
3 |
+
from pathlib import Path
|
4 |
+
import json
|
5 |
+
|
6 |
+
comps = [
|
7 |
+
"Accordion",
|
8 |
+
"Alerts",
|
9 |
+
"Avatar",
|
10 |
+
"Badge",
|
11 |
+
"Banner",
|
12 |
+
"Bottom Navigation",
|
13 |
+
"Breadcrumb",
|
14 |
+
"Buttons",
|
15 |
+
"Button Group",
|
16 |
+
"Card",
|
17 |
+
"Carousel",
|
18 |
+
"Chat Bubble",
|
19 |
+
"Device Mockups",
|
20 |
+
"Drawer",
|
21 |
+
"Dropdowns",
|
22 |
+
"Footer",
|
23 |
+
"Forms",
|
24 |
+
"Gallery",
|
25 |
+
"Indicators",
|
26 |
+
"Jumbotron",
|
27 |
+
"List Group",
|
28 |
+
"Mega Menu",
|
29 |
+
"Modal",
|
30 |
+
"Navbar",
|
31 |
+
"Pagination",
|
32 |
+
"Popover",
|
33 |
+
"Progress",
|
34 |
+
"Rating",
|
35 |
+
"Sidebar",
|
36 |
+
"Skeleton",
|
37 |
+
"Speed Dial",
|
38 |
+
"Spinner",
|
39 |
+
"Stepper",
|
40 |
+
"Tables",
|
41 |
+
"Tabs",
|
42 |
+
"Timeline",
|
43 |
+
"Toast",
|
44 |
+
"Tooltips",
|
45 |
+
"Typography",
|
46 |
+
"Video",
|
47 |
+
"FORMS",
|
48 |
+
"Input Field",
|
49 |
+
"File Input",
|
50 |
+
"Search Input",
|
51 |
+
"Number Input",
|
52 |
+
"Phone Input",
|
53 |
+
"Select",
|
54 |
+
"Textarea",
|
55 |
+
"Checkbox",
|
56 |
+
"Radio",
|
57 |
+
"Toggle",
|
58 |
+
"Range",
|
59 |
+
"Floating Label",
|
60 |
+
"TYPOGRAPHY",
|
61 |
+
"Headings",
|
62 |
+
"Paragraphs",
|
63 |
+
"Blockquote",
|
64 |
+
"Images",
|
65 |
+
"Lists",
|
66 |
+
"Links",
|
67 |
+
"Text",
|
68 |
+
"PLUGINS",
|
69 |
+
"Charts",
|
70 |
+
"Datepicker",
|
71 |
+
]
|
72 |
+
|
73 |
+
base_url = "https://flowbite.com/docs/components/"
|
74 |
+
total_examples = 0
|
75 |
+
for comp in comps:
|
76 |
+
if comp == "FORMS":
|
77 |
+
base_url = "https://flowbite.com/docs/forms/"
|
78 |
+
continue
|
79 |
+
elif comp == "TYPOGRAPHY":
|
80 |
+
base_url = "https://flowbite.com/docs/typography/"
|
81 |
+
continue
|
82 |
+
elif comp == "PLUGINS":
|
83 |
+
base_url = "https://flowbite.com/docs/plugins/"
|
84 |
+
continue
|
85 |
+
clean_comp = comp.lower().replace(" ", "-")
|
86 |
+
print(f"Loading examples for: {clean_comp}, ({total_examples} total examples)")
|
87 |
+
|
88 |
+
cached_html = Path(__file__).parent / "components" / f"{clean_comp}.html"
|
89 |
+
cached_dataset = Path(__file__).parent / "components" / f"{comp.lower()}.json"
|
90 |
+
if cached_dataset.exists():
|
91 |
+
print(f"Skipping:{comp} as we parsed it back in the day")
|
92 |
+
ds = json.load(cached_dataset.open("r"))
|
93 |
+
total_examples += len(ds)
|
94 |
+
continue
|
95 |
+
if not cached_html.exists():
|
96 |
+
response = urlopen(base_url + clean_comp)
|
97 |
+
html_content = response.read()
|
98 |
+
with open(cached_html, "wb") as f:
|
99 |
+
f.write(html_content)
|
100 |
+
else:
|
101 |
+
with cached_html.open("rb") as f:
|
102 |
+
html_content = f.read()
|
103 |
+
|
104 |
+
soup = BeautifulSoup(html_content, "html.parser")
|
105 |
+
|
106 |
+
dataset = []
|
107 |
+
flavors = soup.find_all("h2")
|
108 |
+
for flavor in flavors:
|
109 |
+
row = {}
|
110 |
+
row["name"] = flavor.text.replace("\n #", "").strip()
|
111 |
+
row["description"] = flavor.next_sibling.text
|
112 |
+
code_parent = flavor.find_next_sibling("div")
|
113 |
+
if not code_parent:
|
114 |
+
print(f"Something's fucked up with {row['name']}, skipping")
|
115 |
+
continue
|
116 |
+
iframe = code_parent.find("iframe")
|
117 |
+
if not iframe or not iframe.has_attr("srcdoc"):
|
118 |
+
print("Skipped, no iframe: ", row["name"])
|
119 |
+
continue
|
120 |
+
srcdoc_soup = BeautifulSoup(iframe["srcdoc"], "html.parser")
|
121 |
+
row["html"] = srcdoc_soup.find("div", id="exampleWrapper").prettify()
|
122 |
+
dataset.append(row)
|
123 |
+
|
124 |
+
print(f"Collected {len(dataset)} examples for {clean_comp} like a boss\n=====\n")
|
125 |
+
total_examples += len(dataset)
|
126 |
+
|
127 |
+
with open(cached_dataset, "w") as f:
|
128 |
+
json.dump(dataset, f, indent=2)
|
129 |
+
|
130 |
+
"""
|
131 |
+
for row in dataset:
|
132 |
+
print("======================================")
|
133 |
+
print(row["name"], "-", row["description"])
|
134 |
+
print("======================================\n")
|
135 |
+
print(row["html"])
|
136 |
+
print("\n\n")
|
137 |
+
"""
|
138 |
+
print("!!!!!!!!!!!!!")
|
139 |
+
print(f"Collected {total_examples} total examples")
|
openui/eval/screenshots.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from pathlib import Path
|
3 |
+
import json
|
4 |
+
from openui.util import gen_screenshots
|
5 |
+
|
6 |
+
data_dir = Path(__file__).parent / "components"
|
7 |
+
|
8 |
+
if __name__ == "__main__":
|
9 |
+
i = 0
|
10 |
+
for file in sorted(data_dir.glob("*.json")):
|
11 |
+
with open(file, "r") as f:
|
12 |
+
data = json.load(f)
|
13 |
+
i += 1
|
14 |
+
if i > 10:
|
15 |
+
continue
|
16 |
+
img_dir = data_dir / file.name.split(".")[0]
|
17 |
+
os.makedirs(img_dir, exist_ok=True)
|
18 |
+
for row in data:
|
19 |
+
root_name = row["name"].lower().replace(" ", "-")
|
20 |
+
gen_screenshots(root_name, row["html"], img_dir)
|